/* ---------- Report a price (#/report-price, js/submissions-prices-directions.js) ----------
   Opt-in layout: the page adds .rp-screen to .suggest-screen, so Settings, Profile, the admin console and the owner catalogue
   keep the shared one-column .suggest-screen. The two-column layout is a container query on .rp-wrap (the width the page really
   has, after the app sidebar), not a viewport query: the sidebar takes 284 px from 860 px up, so a viewport query would squeeze
   the form to under 400 px between 860 and about 1100 px. */

.rp-wrap { container-type: inline-size; container-name: rp; }
.rp-screen { padding-bottom: 40px; }
.rp-grid { display: block; }

/* Back link: the name truncates, the arrow stays. */
.rp-back { max-width: 100%; }
.rp-back > span:first-child { flex: none; }
.rp-back-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The form card: a pastel banner on top, then the form. */
.rp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.rp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 16px 20px;
  background: var(--banner-gradient);
  color: var(--banner-title);
}
.rp-banner-text { min-width: 0; }
.rp-title { margin: 0 0 2px; font-size: 20px; font-weight: 600; color: var(--banner-title); }
.rp-banner p { margin: 0; font-size: 14px; line-height: 1.4; color: var(--banner-title); }
.rp-help-btn {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--banner-title) 35%, transparent);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--banner-title);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.rp-help-phone { margin: 0; padding: 12px 20px; font-size: 14px; line-height: 1.5; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.rp-form { margin-top: 0; padding: 16px; gap: 16px; }

/* Labels (14 px: a person reads them to decide). */
.rp-label { font-size: 14px; font-weight: 600; }
.rp-screen .rp-pick input[type="text"],
.rp-screen .rp-newproduct input[type="text"],
.rp-screen .rp-form .suggest-field input[type="text"],
.rp-screen .rp-form .suggest-field input[type="number"],
.rp-screen .rp-form select,
.rp-screen .rp-form textarea { font-size: 16px; min-height: 44px; }
.rp-screen .rp-form .suggest-field > span { font-size: 14px; }

/* Context block: the store, then the product. */
.rp-context { display: flex; flex-direction: column; gap: 12px; }
.rp-context .card-desc { margin: 0; }
.rp-chosen[hidden] { display: none; }
.rp-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rp-chip:hover { border-color: var(--brand-text); }
.rp-chip .message-avatar { width: 40px; height: 40px; }
.rp-chip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rp-chip-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-chip-text strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.25; }
.rp-chip-text strong { font-size: 14px; font-weight: 600; }
.rp-chip-text small { font-size: 12px; color: var(--text-muted); }
.rp-chip-edit { flex: none; font-size: 14px; font-weight: 600; color: var(--brand-text); padding: 0 6px; }
.rp-notlisted { align-self: flex-start; font-size: 14px; }
.rp-newproduct {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.rp-brand-fixed { margin: 0; font-size: 14px; color: var(--text); }

/* Price: the main element. */
.rp-price-block { display: flex; flex-direction: column; gap: 10px; }
.rp-price-row { display: flex; align-items: flex-end; gap: 10px; }
.rp-price-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rp-price-wrap {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rp-price-wrap:focus-within { border-color: var(--brand-text); box-shadow: 0 0 0 1px var(--brand-text); outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.rp-naira { font-size: 24px; font-weight: 600; color: var(--text-muted); padding-right: 6px; }
.rp-price-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rp-unknown-link { align-self: flex-start; font-size: 14px; }
#priceUnknownNote { margin: 0; }

/* Pill toggles: a checkbox kept in the tab order, drawn as a pill. In stock turns success-coloured when on. */
.rp-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.rp-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rp-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rp-pill input:checked + span::before { content: "✓"; font-weight: 700; }
.rp-pill input:checked + span { background: var(--brand-tint); border-color: var(--brand-text); color: var(--brand-text); }
.rp-pill-stock input:checked + span { background: var(--success-bg); border-color: var(--success); color: var(--success-text); }
.rp-pill input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.rp-pill-stock { height: 60px; align-items: stretch; }
.rp-pill-stock span { min-height: 60px; padding: 0 10px; border-radius: var(--radius-lg); }
.rp-more-body .rp-pill { align-self: flex-start; }

/* Typical price: a line and a below / near / above bar. */
.rp-typical { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.rp-typical p { margin: 0; }
.rp-typical-text { font-size: 14px; font-weight: 600; }
.rp-typical-verdict { margin-top: 6px !important; font-size: 13px; color: var(--text-muted); }
.rp-bar { position: relative; display: flex; height: 8px; margin: 10px 0 0; border-radius: 999px; overflow: visible; }
.rp-bar-seg { display: block; height: 100%; }
.rp-bar-below { flex: 40; background: var(--success); border-radius: 999px 0 0 999px; }
.rp-bar-near { flex: 20; background: var(--text-muted); }
.rp-bar-above { flex: 40; background: var(--warning); border-radius: 0 999px 999px 0; }
.rp-bar-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--surface-2);
  box-sizing: border-box;
}

/* More details fold. */
.rp-more { border: 1px solid var(--border); border-radius: var(--radius-lg); }
.rp-more > summary, .rp-help-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.rp-more > summary::-webkit-details-marker, .rp-help-panel > summary::-webkit-details-marker { display: none; }
.rp-more > summary::after, .rp-help-panel > summary::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--text-muted); }
.rp-more[open] > summary::after, .rp-help-panel[open] > summary::after { content: "\2212"; }
.rp-more-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 14px 14px; }

/* Submit and the saved confirmation. */
.rp-form .btn-row { margin-top: 0; }
.rp-submit { width: 100%; min-height: 48px; font-size: 15px; }
.rp-success {
  padding: 14px;
  border: 1px solid var(--success);
  border-radius: var(--radius-lg);
  background: var(--success-bg);
  color: var(--success-text);
}
.rp-success-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.rp-success-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rp-success-actions .btn { min-height: 44px; font-size: 14px; }
.rp-add-another { flex: 1 1 200px; min-width: 0; max-width: 100%; background: var(--brand); box-shadow: none; }
.rp-add-another-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-success-actions .btn-secondary { flex: none; }

/* Added at this store. */
.rp-added-line { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.rp-added-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.rp-added-count { flex: none; }
.rp-added-store { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-added-list { list-style: none; margin: 0; padding: 0; }
.rp-added-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.rp-added-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rp-added-price { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.rp-added-variant { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.rp-aside .rp-added-list li { padding-left: 0; padding-right: 0; }

/* Side panel pieces (shown only in the wide layout). */
.rp-wide-only { display: none; }
.rp-aside { flex-direction: column; gap: 12px; }
.rp-side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.rp-side-h { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.rp-side-store { display: flex; align-items: flex-start; gap: 10px; }
.rp-side-store-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.rp-side-store-text strong { overflow-wrap: anywhere; }
.rp-side-store-text span { color: var(--text-muted); font-size: 13px; }
.rp-side-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.rp-side-actions .link-btn { font-size: 14px; display: inline-flex; align-items: center; min-height: 28px; }
.rp-side-card .card-desc { margin: 0; }
.rp-help-panel { padding: 0; }
.rp-help-panel > summary { padding: 0 14px; }
.rp-help-panel p { margin: 0; padding: 0 14px 14px; font-size: 14px; line-height: 1.5; color: var(--text-muted); }

/* Narrow phones: a 9-digit price still fits beside the In stock pill. */
@media (max-width: 420px) {
  .rp-naira, .rp-price-wrap input { font-size: 20px; }
  .rp-price-wrap { padding: 0 8px; }
  .rp-naira { padding-right: 4px; }
}

@media (max-width: 380px) {
  .rp-naira, .rp-price-wrap input { font-size: 18px; }
}

/* Visible keyboard focus on the page's own controls. */
.rp-screen .rp-chip:focus-visible,
.rp-screen .rp-added-toggle:focus-visible,
.rp-screen .rp-help-btn:focus-visible,
.rp-screen summary:focus-visible,
.rp-screen .link-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Wide layout: the form column and a context panel to its right, the pair centred. */
@container rp (min-width: 840px) {
  .rp-screen { max-width: 956px; }
  .rp-grid { display: grid; grid-template-columns: minmax(0, 600px) 300px; gap: 24px; justify-content: center; align-items: start; }
  .rp-phone-only { display: none !important; }
  .rp-wide-only { display: flex; }
}
@container rp (min-width: 960px) {
  .rp-screen { max-width: 996px; }
  .rp-grid { grid-template-columns: minmax(0, 620px) 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .rp-screen *, .rp-screen *::before, .rp-screen *::after { transition: none !important; animation: none !important; }
}
