/* Price Watch — operational tool, not a marketing page.
   Palette: ink navy surfaces, signal-amber for "needs review", cool teal for
   confirmed/accepted. Monospace for anything numeric — prices and IDs are
   data, not prose, and should look like it. */

/* Fonts are linked from each template's <head>, not @import-ed here. An
   @import can only be discovered after this file downloads and parses, which
   serialises the font request behind it; a <link> in the document head starts
   both in parallel (paired with preconnect to the two font hosts). */

:root {
  /* Dark-only design (no light theme, no toggle) -- tell the browser so
     native chrome CSS can't restyle (select dropdown listboxes, number-input
     spinners, scrollbars, default focus rings) renders dark too instead of
     following the OS/browser light/dark preference (GitHub #36). */
  color-scheme: dark;

  --ink-900: #10141a;
  --ink-800: #171d26;
  --ink-700: #1f2733;
  --ink-600: #2a3441;
  --line: #313c4a;
  /* Border for interactive controls (inputs, selects, ghost buttons). WCAG
     1.4.11 wants 3:1 for the boundary that identifies a UI component, and
     --line only manages 1.34:1 against --ink-700, so a form field's edge is
     effectively invisible. Same hue and saturation as --line, lifted to 46%
     lightness: 3.05:1 on --ink-700, 3.43:1 on --ink-800, 3.74:1 on --ink-900.
     Deliberately NOT applied to cards, dividers, thumbnails or panels --
     1.4.11 governs component identification, not decorative surfaces, and
     raising all 27 --line uses would restyle the app for no a11y gain. */
  --line-control: #5d728d;
  --text-hi: #e8ecf1;
  --text-mid: #9aa7b8;
  --text-lo: #7c8898;

  --amber: #e0a955;
  --amber-dim: #6b5732;
  --teal: #4fb8a8;
  --teal-dim: #2c5751;
  --coral: #d9755f;
  --coral-dim: #5c3830;

  --radius: 6px;
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
/* !important is deliberate: this utility must force-hide regardless of any
   other rule's specificity or source order (e.g. .extra-photo-slot and
   .more-photo-options both set their own `display`, which would otherwise
   win the cascade tie by appearing later in this file). */
.hidden { display: none !important; }

/* Visually hidden but still reachable by screen readers -- used for the
   page <h1> on pages where a second visible title would be redundant
   with the existing .section-heading/.auth-title text (GitHub #21). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* One keyboard-focus ring for every interactive control. Previously only
   .hist-bar and .cost-basis-input defined one, so every button, link, menu
   item and summary fell back to whatever ring the UA draws -- which varies by
   browser and is easy to lose against these ink surfaces. :focus-visible (not
   :focus) keeps it off mouse clicks, so nothing changes at rest. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 3px;
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text-hi);
  min-height: 100vh;
  overflow-x: hidden;
}

/* "Skip to main content" link -- visually hidden until focused, so
   keyboard/screen-reader users can bypass the topbar instead of tabbing
   through every nav link and menu button on every page load (GitHub #31). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  padding: 10px 16px;
  background: var(--ink-800);
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-800);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--amber); font-size: 18px; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: 0.2px; }

.env-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--text-mid);
}
.env-sandbox { color: var(--amber); border-color: var(--amber-dim); }
.env-production { color: var(--teal); border-color: var(--teal-dim); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-mid);
  text-decoration: none;
}
.status-badge--ok { color: var(--teal); border-color: var(--teal-dim); background: rgba(79, 184, 168, 0.08); }
a.status-badge:hover { filter: brightness(1.15); }

.topbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
/* Dashboard's topbar-actions mixes nav links with action buttons/menus, so
   only the actual nav links are wrapped in a <nav> landmark (GitHub #21);
   this keeps that <nav> a plain flex container so it lays out identically
   to being unwrapped direct children of .topbar-actions. */
.topbar-nav-links { display: flex; align-items: center; gap: 14px; }

.menu-wrap { position: relative; }
.icon-btn { padding: 6px 11px; font-size: 15px; line-height: 1; }
.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 220px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.menu-panel .threshold-control { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.menu-link {
  display: block;
  padding: 6px 4px;
  color: var(--text-mid);
  text-decoration: none;
  font-size: 13px;
  border-radius: 4px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.menu-link:hover { background: var(--ink-700); color: var(--text-hi); }
.menu-panel .logout-form { display: block; width: 100%; }

.notice {
  font-size: 12.5px;
  color: var(--text-mid);
  border-left: 2px solid var(--amber-dim);
  padding-left: 10px;
}

.btn-primary {
  background: var(--amber);
  color: var(--ink-900);
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

main { max-width: 920px; margin: 0 auto; padding: 24px 20px 80px; }

@media (min-width: 1400px) {
  main { max-width: 1400px; }
}
@media (min-width: 1900px) {
  main { max-width: 1860px; }
}

.flash-messages { max-width: 920px; margin: 16px auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 8px; }
.flash { font-size: 13px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid; }
.flash-error { color: var(--coral); background: rgba(217, 117, 95, 0.08); border-color: var(--coral-dim); }
.flash-success { color: var(--teal); background: rgba(79, 184, 168, 0.08); border-color: var(--teal-dim); }

.status-strip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-lo);
  padding: 6px 4px 18px;
}

.status-strip.stale { color: var(--amber); }

.empty-state {
  text-align: center;
  padding: 80px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 20px;
}
.empty-title { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.empty-sub { color: var(--text-mid); font-size: 13.5px; max-width: 420px; margin: 0 auto 20px; }

.section-block { margin-bottom: 28px; }
.section-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-mid);
  margin: 0 0 12px;
}
.section-raise .section-heading { color: var(--teal); }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.section-heading-row .section-heading { margin: 0; }
.section-subtext {
  font-size: 12.5px;
  color: var(--text-mid);
  margin: -6px 0 14px;
}

.rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  align-items: start;
  gap: 12px;
}

/* Bulk publish/discard (GitHub #18) */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
}
.bulk-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bulk-selected-count { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-lo); }
.row-select { display: flex; align-items: flex-start; padding-top: 3px; flex-shrink: 0; cursor: pointer; }
.row-select input, .bulk-select-all input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--amber); }

.row-card {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s ease;
}
.row-card:hover { border-color: var(--ink-600); }

.row-card--raise {
  border-color: var(--teal-dim);
  background: linear-gradient(180deg, rgba(79, 184, 168, 0.06), transparent 60%), var(--ink-800);
}
.row-card--raise:hover { border-color: var(--teal); }

.row-card--ready {
  border-color: var(--teal-dim);
  background: linear-gradient(180deg, rgba(79, 184, 168, 0.06), transparent 60%), var(--ink-800);
}
.row-card--ready:hover { border-color: var(--teal); }

.row-main { margin-bottom: 12px; }
.row-main-with-thumb { display: flex; gap: 12px; align-items: flex-start; }
.row-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-700); flex-shrink: 0; }
.row-thumb--broken { visibility: hidden; }
.row-title { font-weight: 500; font-size: 14.5px; line-height: 1.4; }
.row-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 3px;
}
.row-sub a, .row-sub a:visited { color: var(--text-lo); text-decoration: none; }
.row-sub a:hover { color: var(--amber); text-decoration: underline; }

.row-prices {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.price-block { display: flex; flex-direction: column; gap: 2px; }
.price-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-lo); }
.price-value { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 500; }
.price-net { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-mid); }
.price-block.suggested .price-value { color: var(--amber); }
.price-arrow { color: var(--text-lo); font-size: 14px; }
.price-arrow.arrow-up { color: var(--teal); font-weight: 600; }
.price-arrow.arrow-down { color: var(--coral); font-weight: 600; }
.cost-basis-block { min-width: 88px; }
.cost-basis-input {
  font-family: 'IBM Plex Mono', monospace;
  /* 16px avoids iOS Safari's auto-zoom-on-focus for sub-16px text inputs (GitHub #38, #40). */
  font-size: 16px;
  background: var(--ink-700);
  border: 1px solid var(--line-control);
  border-radius: 4px;
  color: var(--text-hi);
  padding: 2px 6px;
  width: 88px;
}
.cost-basis-input:focus { outline: 1px solid var(--amber); }
.margin-line { font-size: 12px; color: var(--teal); margin: -4px 0 8px; }
.margin-line--negative { color: var(--coral); }
.stale-tag { color: var(--text-mid); }
.sales-summary {
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.confidence {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  align-self: center;
}
.conf-high { color: var(--teal); background: rgba(79, 184, 168, 0.12); }
.conf-medium { color: var(--amber); background: rgba(224, 169, 85, 0.12); }
.conf-low, .conf-none { color: var(--coral); background: rgba(217, 117, 95, 0.12); }
.conf-noaction { color: var(--text-lo); background: rgba(154, 167, 184, 0.1); }

.range-bar-wrap { margin: 14px 0 12px; }

.hist-wrap { margin: 14px 0 12px; }
.hist-track {
  position: relative;
  height: 44px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  background: var(--ink-700);
  border-radius: 4px;
  padding: 3px 3px 0;
}
.hist-bin {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 100%;
  min-width: 0;
}
.hist-bar { position: relative; flex: 1; min-height: 2px; border-radius: 1px 1px 0 0; }
.hist-bar--active { background: rgba(154, 167, 184, 0.75); }
.hist-bar--sold { background: var(--teal); }
/* Bin count, always visible (not just on hover/title) -- GitHub #24. */
.hist-bar-count {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  line-height: 1;
  /* --text-lo on the .hist-track's --ink-700 fill is 4.18:1, under the 4.5:1
     AA floor, and this is the smallest type in the app. --text-mid clears it
     at 6.15:1. */
  color: var(--text-mid);
  white-space: nowrap;
  pointer-events: none;
}
.hist-bar:focus-visible { outline: 1px solid var(--amber); outline-offset: 1px; }
.hist-marker-suggested {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 0;
  border-left: 2px dashed var(--amber);
  transform: translateX(-1px);
}
.hist-marker-label {
  position: absolute;
  top: -16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--amber);
  white-space: nowrap;
  pointer-events: none;
}
.hist-ticks {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--text-lo);
  margin-top: 4px;
}

.range-block-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.range-block-label {
  width: 40px;
  flex-shrink: 0;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-lo);
}
.range-block-track {
  position: relative;
  flex: 1;
  height: 10px;
  background: var(--ink-700);
  border-radius: 3px;
  overflow: visible;
}
.range-block {
  position: absolute;
  top: 0;
  height: 10px;
  border-radius: 3px;
}
.active-block { background: rgba(154, 167, 184, 0.55); }
.sold-block { background: var(--teal-dim); }
.range-block-value {
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--text-lo);
  white-space: nowrap;
}
.range-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  background: var(--coral);
  transform: translateX(-1px);
}
.range-marker-suggested {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  background: var(--amber);
  transform: translateX(-1px);
}
.range-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
}
.range-median {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mid);
  border: 1px solid var(--ink-800);
  transform: translate(-3px, -50%);
}
.range-median.sold { background: var(--teal); }
.range-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-mid);
  flex-wrap: wrap;
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.active-dot { background: rgba(154, 167, 184, 0.7); }
.sold-dot { background: var(--teal); }

.range-thin-note { font-size: 11.5px; color: var(--text-lo); margin: 0; font-style: italic; }

.reasoning {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.55;
  margin: 10px 0 12px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-700);
}

.suggestion-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-lo);
  margin-right: auto;
}
.status-accepted { color: var(--amber); }
.status-dismissed { color: var(--text-lo); text-decoration: line-through; }
.status-applied { color: var(--teal); }
.status-draft { color: var(--teal); }
.status-failed { color: var(--coral); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-control);
  color: var(--text-mid);
  padding: 6px 13px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-accept:hover { border-color: var(--teal-dim); color: var(--teal); }
.btn-dismiss:hover { border-color: var(--coral-dim); color: var(--coral); }

.in-range-section { margin-top: 20px; }
.in-range-section summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-mid);
  padding: 10px 4px;
  border-top: 1px solid var(--line);
  list-style: none;
}
.in-range-section summary::-webkit-details-marker { display: none; }
.in-range-section summary::before { content: '▸ '; color: var(--text-lo); }
.in-range-section[open] summary::before { content: '▾ '; }
.in-range-section summary:hover { color: var(--text-hi); }
.in-range-section .rows { margin-top: 12px; }

.threshold-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-mid);
}
.threshold-control input {
  width: 52px;
  background: var(--ink-700);
  border: 1px solid var(--line-control);
  color: var(--text-hi);
  border-radius: 4px;
  padding: 5px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
}
.threshold-control input:disabled { opacity: 0.5; }

.dup-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.dup-group {
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.dup-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.dup-items { display: flex; flex-wrap: wrap; gap: 10px; }
.dup-item {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-mid);
}

.btn-queue { font-family: 'IBM Plex Mono', monospace; }
.btn-queue:hover { border-color: var(--amber-dim); color: var(--amber); }
.btn-queue.has-items {
  border-color: var(--amber-dim);
  color: var(--amber);
  background: rgba(224, 169, 85, 0.1);
  font-weight: 600;
}
.btn-queue.has-items:hover { background: rgba(224, 169, 85, 0.18); }

.user-email { font-size: 12px; color: var(--text-mid); font-family: 'IBM Plex Mono', monospace; }
.logout-form { display: inline-flex; margin: 0; }

.modal-confirm { max-width: 440px; }
.confirm-message { margin: 0 0 18px; color: var(--text-hi); }
.confirm-footer { justify-content: flex-end; border-top: none; padding-top: 0; }

.scan-photo-input { align-self: center; }
.scan-list-action { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0; }
.scan-result { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.scan-thumb { max-width: 220px; border-radius: var(--radius); border: 1px solid var(--line); align-self: center; }
.scan-title { font-size: 15px; color: var(--text-hi); margin: 0; text-align: center; }
.scan-price-row { display: flex; justify-content: center; gap: 24px; }
.comp-chip-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.comp-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-hi);
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 4px;
  padding: 3px 8px;
}

.modal-progress { max-width: 360px; align-items: center; text-align: center; gap: 14px; }
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-message { margin: 0; color: var(--text-hi); }
.progress-sub { margin: 0; color: var(--text-lo); font-size: 12px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-header h2 { font-size: 16px; margin: 0; }

.modal-sub {
  color: var(--text-mid);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.queue-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}
.queue-item--error { border-color: var(--coral-dim); background: rgba(217, 117, 95, 0.06); }
.queue-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.queue-item-head { display: flex; align-items: baseline; gap: 12px; }
.queue-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-prices { font-family: 'IBM Plex Mono', monospace; color: var(--amber); white-space: nowrap; }
.queue-item-error { font-size: 11.5px; color: var(--coral); line-height: 1.4; }
.queue-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.queue-item-actions .btn-ghost { padding: 5px 10px; font-size: 11.5px; }

.queue-empty { color: var(--text-lo); font-size: 13px; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--ink-700);
}

.btn-danger { background: var(--coral); }

.queue-results {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}
.queue-summary { font-size: 12.5px; color: var(--text-mid); margin: 0 0 4px; }
.queue-result { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.queue-result.ok { color: var(--teal); }
.queue-result.error { color: var(--coral); }

.auth-page {
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 18px; }
.auth-title { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.auth-sub { color: var(--text-mid); font-size: 13px; line-height: 1.55; margin: 0 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input[type="email"] {
  background: var(--ink-700);
  border: 1px solid var(--line-control);
  color: var(--text-hi);
  border-radius: var(--radius);
  padding: 10px 12px;
  /* 16px avoids iOS Safari's auto-zoom-on-focus for sub-16px text inputs (GitHub #38). */
  font-size: 16px;
  font-family: inherit;
}
.auth-form .btn-primary { width: 100%; padding: 10px 16px; }
.auth-link-back, .auth-link-back-btn { display: inline-block; margin-top: 4px; }
.auth-link-back { color: var(--text-mid); font-size: 13px; }
.auth-link-back:hover { color: var(--text-hi); }
.auth-invite-sent { color: var(--teal); font-size: 13px; margin: 16px 0 0; }
.auth-invite-failed { color: var(--coral); font-size: 13px; margin: 16px 0 0; }

.listings-main { max-width: 640px; }
.listing-form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.form-row > .tooltip-note { flex-basis: 100%; }
.form-row .form-field { flex: 1; min-width: 0; }
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-mid);
}
.form-field input, .form-field select, .form-field textarea {
  background: var(--ink-700);
  border: 1px solid var(--line-control);
  color: var(--text-hi);
  border-radius: var(--radius);
  padding: 9px 11px;
  /* 16px avoids iOS Safari's auto-zoom-on-focus for sub-16px text inputs (GitHub #38). */
  font-size: 16px;
  font-family: inherit;
}
.form-field textarea { resize: vertical; }
.field-optional { color: var(--text-lo); font-weight: 400; }
.field-required { color: var(--amber); font-weight: 600; }
.tooltip-trigger { cursor: help; border-bottom: 1px dotted var(--text-lo); }
.field-note { font-size: 11.5px; color: var(--text-lo); margin: -6px 0 0; font-style: italic; min-height: 1.4em; }
.auto-note {
  font-size: 12px;
  color: var(--teal);
  background: rgba(79, 184, 168, 0.08);
  border: 1px solid var(--teal-dim);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin: -2px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.auto-note:empty { display: none; padding: 0; border: none; background: none; margin: 0; }
.auto-note .btn-ghost { padding: 4px 9px; font-size: 11.5px; }
.auto-note--warning { color: var(--coral); background: rgba(217, 117, 95, 0.1); border-color: var(--coral-dim); font-weight: 600; }

.photo-section { display: flex; flex-direction: column; gap: 14px; }
.extra-photo-slot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 0 0 12px;
  border-left: 2px solid var(--line);
}
.more-photo-options { display: flex; flex-direction: column; gap: 14px; }
.photo-intro { margin: 0; }
.form-divider { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.section-divider { border: none; border-top: 1px solid var(--line); margin: 8px 0 28px; max-width: 640px; }
.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-lo);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: -4px 0;
}
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.image-preview-wrap { margin-top: -4px; }
.image-preview-wrap img { max-width: 160px; max-height: 160px; border-radius: var(--radius); border: 1px solid var(--line); display: block; margin-bottom: 4px; }
/* 16px avoids iOS Safari's auto-zoom-on-focus for sub-16px text inputs (GitHub #38). */
.listing-form input[type="file"] { color: var(--text-mid); font-size: 16px; }

.mobile-upload-panel {
  margin-top: -4px;
  padding: 14px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mobile-upload-panel img {
  width: 140px;
  height: 140px;
  background: #fff;
  border-radius: 4px;
  padding: 6px;
  display: block;
  margin-bottom: 8px;
}
.mobile-upload-panel a { color: var(--amber); word-break: break-all; }

.csv-reference {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 12px;
  font-size: 12px;
}
.csv-reference h3 { font-size: 12px; color: var(--text-mid); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.csv-reference ul { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.csv-reference li { padding: 2px 0; color: var(--text-mid); }
.csv-reference code { color: var(--text-hi); font-family: 'IBM Plex Mono', monospace; margin-right: 6px; }

.csv-optional-list { margin: 4px 0 12px; padding-left: 20px; }
.csv-optional-list li { margin-bottom: 4px; }
.csv-optional-list code { color: var(--text-hi); font-family: 'IBM Plex Mono', monospace; }

/* Touch targets. The compact button sizing here is deliberate for a dense
   desktop tool -- .btn-ghost lands near 26px tall, .icon-btn near 27px -- but
   that is well under the 44px WCAG 2.5.5 asks for on touch. Scoping the bump
   to coarse pointers fixes the phone flows this app explicitly supports
   (GitHub #19, #38, #40) while leaving mouse density exactly as designed. */
@media (pointer: coarse) {
  .btn-primary,
  .btn-ghost,
  .icon-btn,
  .menu-link,
  .queue-item-actions .btn-ghost,
  .auto-note .btn-ghost {
    min-height: 44px;
  }

  .btn-primary,
  .btn-ghost,
  .icon-btn,
  .queue-item-actions .btn-ghost,
  .auto-note .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Block-level flex, not inline: .menu-link is a full-width left-aligned row
     in the dropdown, so it centers vertically without becoming shrink-to-fit. */
  .menu-link { display: flex; align-items: center; }

  /* Anything that toggles a disclosure needs the same reachable height. */
  .in-range-section summary { padding: 14px 4px; }
  .row-select, .bulk-select-all { min-height: 44px; align-items: center; }
  .row-select input, .bulk-select-all input { width: 18px; height: 18px; }
}

/* Reduced motion. Not a blanket kill: the spinner's rotation IS the "still
   working" signal, so it slows to a non-vestibular pace rather than freezing
   into a meaningless ring. Decorative hover/border transitions carry no
   information and are dropped outright. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }

  .btn-primary,
  .btn-ghost,
  .row-card {
    transition: none;
  }
}

@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .topbar-actions { gap: 8px; }
  .topbar-nav-links { gap: 8px; }
  main { padding: 16px 14px 60px; }
  .row-prices { gap: 10px; }
  /* minmax(380px, 1fr) can't shrink below 380px, so on phones narrower
     than that (iPhone SE/8, 12/13/14, most Pixels once main's padding is
     subtracted) the grid track overflows main and gets silently clipped
     by body{overflow-x:hidden} -- GitHub #19. A single fluid column fits
     any width instead. */
  .rows { grid-template-columns: 1fr; }
}
