/* ───────────────────────────────────────────────────────────────────
 * mobile-modern.css — Hermès-flavor mobile design system
 *
 * Loaded AFTER each mobile page's inline <style> block so cascade
 * order makes us win on conflicts. Pages that include us:
 *   public/mobile-home.html   — landing / top-3 / 4-tile menu
 *   public/mobile.html        — new order wizard (4 steps)
 *   public/mobile-quote.html  — quote builder
 *   public/mobile-sales.html  — sales activity / customer cards
 *   public/mobile-orders.html — order queue / status
 *
 * What this file does (and why):
 *   1. Refined warm parchment palette + deep burgundy accent — same
 *      brand language as the desktop loader / quotation PDF.
 *   2. Soft shadows replace 1px borders on cards — the single biggest
 *      "instantly looks 2024" change. Modern UIs use elevation, not
 *      outlines, to separate surfaces.
 *   3. Noto Serif JP for headlines (titles, prices, totals) — gives
 *      the app the same gravitas a real Hermès in-store catalogue has.
 *   4. Pill buttons (radius 999px), full-width primaries, subtle inner
 *      highlight on press. Big touch targets (≥48px) preserved.
 *   5. Generous whitespace — 20px main padding, 14px between cards
 *      (was 14/10 → felt cramped at 6.1" phone size).
 *   6. Hairline dividers (rgba(0,0,0,.06)) — replaces the heavy
 *      var(--border) full borders on grouped lists.
 *
 * What this file does NOT touch:
 *   - tier-badge styles (they live in app-shared.css and stay loud)
 *   - the branded loader (already a luxury moment)
 *   - any JS-driven behavior — pure CSS.
 *
 * NB: every selector here intentionally matches existing markup so
 * we don't have to refactor HTML on the 5 pages. Where we needed
 * new classes (.hero, .pill, etc.) they're additive.
 * ─────────────────────────────────────────────────────────────────── */

/* ===== Refined design tokens ===== */
/* Override per-page :root tokens. Only touch tokens that actually
   change visual identity — keep size/spacing tokens consistent across
   pages so layout doesn't shift. */
:root {
  /* Surface palette — warmer + brighter than the original tan. */
  --bg:           #fbfaf5;   /* page background — slightly lighter, less yellow */
  --surface:      #ffffff;   /* card background */
  --surface-2:    #f6f2e8;   /* nested surface (item-card inside card) */
  --surface-3:    #efeadb;   /* deeper warm — pressed/selected states */

  /* Type — readable on warm bg, not pure black so it doesn't fight the parchment. */
  --text:         #2a2521;
  --text-muted:   #6a655a;
  --text-faint:   #a09a8d;

  /* Accent — deep burgundy is the brand color. Used sparingly:
     CTAs, current-page indicators, totals. */
  --accent:       #8e3650;
  --accent-2:     #6c2a3d;   /* darker hover state */
  --accent-3:     #4a1c2a;   /* pressed state */
  --accent-soft:  #f5e6ea;   /* tints + selected backgrounds */
  --accent-faint: #fbf3f5;

  /* Secondary tan — supplementary, never the primary CTA. */
  --tan:          #c89b5e;
  --tan-soft:     #f5edde;

  /* Status colors — dialed back from the originals, more grown-up. */
  --warn:         #c8941d;
  --warn-soft:    #fcf5e2;
  --success:      #588d5a;
  --success-soft: #e8f1e6;
  --danger:       #b03a3a;
  --danger-soft:  #f8eaea;

  /* Hairline dividers — replaces full var(--border) borders on lists. */
  --divider:      rgba(20, 14, 6, 0.07);
  --divider-strong: rgba(20, 14, 6, 0.13);

  /* Shadow ramp — three steps. Use level-1 for cards at rest,
     level-2 for raised/active states, level-3 for sticky chrome. */
  --shadow-1:     0 1px 2px rgba(31, 22, 14, 0.04),
                  0 2px 6px rgba(31, 22, 14, 0.04);
  --shadow-2:     0 2px 4px rgba(31, 22, 14, 0.06),
                  0 8px 20px rgba(31, 22, 14, 0.06);
  --shadow-3:     0 4px 12px rgba(31, 22, 14, 0.10);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.5);

  /* Radii — bumped up from 10/14 → 14/20 for a softer, more current feel. */
  --radius-sm:    10px;
  --radius:       14px;
  --radius-lg:    20px;
  --radius-pill:  999px;

  /* Typography */
  --font-serif:   'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-sans:    -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
}

/* ===== Page chrome ===== */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* Header — translucent on scroll for that iOS frosted feel where
   supported, solid fallback otherwise. The blur is subtle (12px)
   not headache-inducing.

   Layout note (2026-05-08 fix): the original .brand-row tried to
   pack brand + 5 nav pills + PC link + language select onto one
   flex row. With English labels ("Orders" / "Sales Activity") the
   pills overflowed onto 3-4 wrapped rows AND squeezed the brand
   into a 4-line vertical column. Now we split into two rows:
     row 1 = .brand-row → brand on left, .header-utility on right
                          (just PC + language — small, low-attention)
     row 2 = .header-nav → 5 page pills, horizontally scrollable so
                           we never wrap regardless of label length. */
.app-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 250, 245, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--divider);
  padding: 12px 16px 10px;
  padding-top: max(12px, env(safe-area-inset-top));
}
@supports not (backdrop-filter: blur(1px)) {
  .app-header { background: var(--surface); }
}
.brand-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
}
.brand {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
  /* Single-line, truncate with ellipsis if the screen is too narrow.
     Without this it wrapped to 4 lines on iPhone 13 mini. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.brand .sub {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Utility cluster on the right side of brand-row — keep this
   compact and de-emphasized so attention goes to the page nav below. */
.header-utility {
  display: flex; gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.header-utility .header-link,
.header-utility select.header-link {
  font-size: 11px;
  padding: 6px 12px;
  min-height: 30px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Page-nav strip — row 2 of the header. Horizontally scrollable so
   labels never wrap or truncate the pills themselves. Scrollbar is
   hidden visually; native momentum scrolling preserved. */
.header-nav {
  display: flex; gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Negative margins + padding fade the strip's leading/trailing edges
     into the page edge so partial pills look like "more available"
     rather than cut off. */
  margin-left: -16px; margin-right: -16px;
  padding: 2px 16px 4px;
}
.header-nav::-webkit-scrollbar { display: none; }
.header-nav .header-link {
  flex-shrink: 0;
  font-size: 13px;
  padding: 8px 14px;
}

/* Header pill links — pill-shaped, hairline outline, no fill at rest. */
.header-link, .header-pc, .desktop-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  min-height: 36px;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  /* Override any leftover inline styles from the legacy lang-switcher
     <select style="..."> markup. The old inline styles fought our
     mobile-modern.css and made the language pill look mismatched. */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.header-link:active, .header-pc:active, .desktop-link:active {
  transform: scale(0.96);
  background: var(--surface-3);
}
.header-link.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(142, 54, 80, 0.20);
}
/* Lang-switcher select — strip native chevron + match other pills. */
select.header-link {
  background-image: none;
  padding-right: 14px;
}

main {
  padding: 20px;
  padding-bottom: 100px;
}

/* ===== Cards — shadow not border ===== */
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.18s ease, transform 0.12s ease;
}
.card h3 {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Step 3 item-card on mobile.html — nested inside main, slightly
   recessed so the row reads as part of a list. */
.item-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}
.item-card.unresolved {
  box-shadow: var(--shadow-1), inset 4px 0 0 var(--warn);
}
.item-card.unresolved .prod-wrap input { border-left: none; }

/* ===== Step indicator — slimmer + serif numerals ===== */
.stepper { gap: 6px; margin-bottom: 12px; }
.step-dot {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.step-dot .num {
  width: 32px; height: 32px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--divider-strong);
  box-shadow: var(--shadow-1);
}
.step-dot.active .num {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(142, 54, 80, 0.30);
}
.step-dot.done .num {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 2px 6px rgba(88, 141, 90, 0.30);
}
.step-dot::after {
  top: 22px;
  height: 1.5px;
  background: var(--divider-strong);
}
.step-dot.done::after { background: var(--success); opacity: 0.6; }

/* ===== Titles — serif headlines for gravitas ===== */
.step-title, .step-panel > h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
}
.step-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 22px;
  line-height: 1.55;
}

/* ===== Inputs — softer, thicker, animated focus ring ===== */
input[type="text"], input[type="number"], input[type="date"],
input[type="email"], input[type="search"], input[type="tel"],
textarea, select {
  width: 100%;
  font-size: 16px; /* ≥16 to defeat iOS zoom-on-focus */
  padding: 14px 16px;
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(142, 54, 80, 0.10);
  background: var(--surface);
}
input::placeholder, textarea::placeholder {
  color: var(--text-faint);
  font-weight: 400;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

/* ===== Buttons — pill-shaped, soft shadow ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px;
  padding: 14px 26px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not([disabled]) { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(142, 54, 80, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover:not([disabled]) {
  background: var(--accent-2);
  box-shadow: 0 3px 10px rgba(142, 54, 80, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary[disabled] {
  background: var(--surface-3);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-1);
}
.btn-secondary:hover:not([disabled]) {
  background: var(--accent-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
}
.btn-ghost:hover:not([disabled]) { background: var(--surface-3); }

.btn-full { width: 100%; }
.btn-row { display: flex; gap: 12px; margin-top: 10px; }

/* item-remove — keep modest, no big red */
.item-card .item-remove {
  background: transparent;
  border: 1px solid var(--divider-strong);
  color: var(--text-muted);
  font-size: 13px;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  margin-top: 12px;
  width: 100%;
  transition: background 0.15s;
}
.item-card .item-remove:hover { background: var(--surface-3); }

/* ===== Sticky bottom nav — frosted ===== */
.wizard-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(251, 250, 245, 0.90);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--divider);
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  display: flex; gap: 12px;
  z-index: 10;
}
@supports not (backdrop-filter: blur(1px)) {
  .wizard-nav { background: var(--surface); }
}
.wizard-nav .btn { flex: 1; }
.wizard-nav .btn-back { flex: 0 1 38%; }

/* ===== Search dropdowns ===== */
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius);
  max-height: 340px; overflow-y: auto;
  z-index: 5;
  box-shadow: var(--shadow-2);
}
.search-result {
  padding: 14px 16px;
  border-top: 1px solid var(--divider);
  cursor: pointer;
  transition: background 0.1s;
}
.search-result:first-child { border-top: none; }
.search-result:hover, .search-result:active {
  background: var(--accent-soft);
}
.search-result .main { font-size: 15px; font-weight: 500; color: var(--text); }
.search-result .sub  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ===== Selected customer card — refined ===== */
.selected-card {
  background: linear-gradient(180deg, var(--accent-faint), var(--accent-soft));
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 14px;
  box-shadow: var(--shadow-1);
}
.selected-card .name {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 500;
  color: var(--accent-3);
}
.selected-card .addr { font-size: 13px; color: var(--text); margin-top: 6px; line-height: 1.55; }
.selected-card .clear {
  margin-top: 12px; padding: 9px 16px; font-size: 13px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-pill);
  transition: background 0.15s;
}
.selected-card .clear:hover { background: rgba(255, 255, 255, 0.5); }

/* ===== もしかして suggest chips ===== */
.suggest-chips {
  background: var(--accent-faint);
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
}
.suggest-chips .label {
  font-size: 11px;
  color: var(--accent-2);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  box-shadow: var(--shadow-1);
  transition: transform 0.08s, box-shadow 0.15s;
}
.chip:active { transform: scale(0.97); }
.chip-main { font-weight: 500; line-height: 1.3; }
.chip-sub { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

/* ===== Per-line subtotal (Step 3 on mobile.html) ===== */
.item-card .line-subtotal {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; align-items: baseline;
}
.item-card .line-subtotal .formula {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.item-card .line-subtotal .amount {
  font-family: var(--font-serif);
  color: var(--accent);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.item-card .line-subtotal.zero .amount {
  color: var(--text-faint);
  font-weight: 400;
}

/* ===== Order grand total bar — luxury hero number ===== */
.order-total-bar {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: none;
  border-radius: var(--radius-lg);
  margin-top: 16px;
  box-shadow: var(--shadow-2);
}
.order-total-bar .total-label {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.order-total-bar .total-amount {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.005em;
}

/* ===== Drop zone (Step 1 on mobile.html / mobile-quote.html) ===== */
.dropzone {
  border: 1.5px dashed var(--divider-strong);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: var(--surface);
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-faint); }
.dropzone strong {
  display: block; font-size: 16px; margin-bottom: 6px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 500;
}
.dropzone .sub { font-size: 12px; color: var(--text-muted); }
.dropzone-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 12px 26px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(142, 54, 80, 0.22);
}

/* ===== mobile-home.html top-3 widget ===== */
.top3-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-1);
}
.top3-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}
.top3-title .badge {
  font-family: var(--font-sans);
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  margin-left: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.top3-reload {
  background: transparent;
  border: 1px solid var(--divider-strong);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.top3-reload:hover { background: var(--surface-3); }
.top3-list { gap: 10px; }
.top3-item {
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform 0.08s, box-shadow 0.15s;
}
.top3-item:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-2);
}

/* ===== mobile-home.html 4-tile menu ===== */
/* Each tile becomes a soft elevated card with a serif label and a
   glyph that reads like a Hermès catalogue icon — generous breathing
   room, no harsh borders. */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  text-decoration: none;
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 10px;
  box-shadow: var(--shadow-1);
  transition: transform 0.1s, box-shadow 0.18s;
  min-height: 130px;
}
.tile:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-2);
}
.tile .icon {
  font-size: 28px;
  line-height: 1;
}
/* mobile-home.html uses .title-line + .sub for tile text — match. */
.tile .title-line, .tile .label {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.tile .sub, .tile .desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tonal accents per tile — softer than the original eye-watering
   neon-soft fills. Each tile gets a faint top-down gradient that
   fades into pure surface so the title still reads cleanly. */
.tile.helper {
  background: linear-gradient(180deg, #f3f0fa, var(--surface) 35%);
  border-color: transparent;
}
.tile.helper .title-line, .tile.helper .label { color: #4a3d8c; }
.tile.order {
  background: linear-gradient(180deg, #fbf1e0, var(--surface) 35%);
  border-color: transparent;
}
.tile.order .title-line, .tile.order .label  { color: #8b471a; }
.tile.quote {
  background: linear-gradient(180deg, #e8f3eb, var(--surface) 35%);
  border-color: transparent;
}
.tile.quote .title-line, .tile.quote .label  { color: #2a5e3b; }
.tile.status {
  background: linear-gradient(180deg, #ebeef4, var(--surface) 35%);
  border-color: transparent;
}
.tile.status .title-line, .tile.status .label { color: #3a4555; }

/* ===== mobile-sales.html / mobile-orders.html — list rows ===== */
/* These pages have lots of customer/order rows. Replace heavy
   bordered card lists with hairline-divided list groups inside a
   single card. */
.list-group {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 4px 0;
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.list-group .row {
  padding: 14px 18px;
  border-top: 1px solid var(--divider);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  transition: background 0.1s;
}
.list-group .row:first-child { border-top: none; }
.list-group .row:active { background: var(--surface-3); }
.list-group .row .lead {
  flex: 1; min-width: 0;
}
.list-group .row .lead .name {
  font-size: 15px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-group .row .lead .meta {
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
}
.list-group .row .trail {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Loading / progress ===== */
.progress {
  background: rgba(142, 54, 80, 0.08);
  height: 3px;
  border-radius: var(--radius-pill);
}
.progress::before {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ===== 👑 Org overview (mobile-sales.html, owner-only) =====
   Compact mobile rendering of the manager → IC tree from
   /api/org-overview. Sits above the AI suggestions card. Each team
   is a self-contained sub-card; ICs stack vertically inside it. */
.org-mobile {
  background: linear-gradient(180deg, var(--surface) 0%, var(--accent-faint) 100%);
}
.org-mobile-company {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
  border-left: 3px solid var(--accent);
}
.org-mobile-period {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.org-mobile-headline {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.org-mobile-headline .muted { font-size: 13px; color: var(--text-muted); font-family: var(--font-sans); }
.org-mobile-headline .org-mobile-att {
  margin-left: auto;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-sans);
}
.org-mobile-meta { font-size: 11px; color: var(--text-muted); }

.org-mobile-team {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-1);
}
.org-mobile-team.unassigned { background: var(--warn-soft); }
.org-mobile-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.org-mobile-team-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  font-size: 13px;
}
.org-mobile-team-name strong {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.org-mobile-headcount { font-size: 10.5px; color: var(--text-muted); }
.org-mobile-team-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.org-mobile-members {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.org-mobile-member {
  background: var(--surface-2);
  border-radius: var(--radius-sm, 6px);
  padding: 6px 9px;
  font-size: 12px;
}
.org-mobile-member.is-manager {
  background: var(--accent-faint);
  border-left: 2px solid var(--accent);
}
.org-mobile-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1px;
}
.org-mobile-member-name {
  font-weight: 500;
  color: var(--text);
}
.org-mobile-member-att {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}
.org-mobile-member-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.45;
}
.org-mobile-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-family: ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-right: 4px;
  vertical-align: middle;
}
.org-mobile-tag.team { background: var(--accent-faint); color: var(--accent); }
.org-mobile-tag.mgr  { background: #fef3c7;             color: #b85f00; }

.org-mobile-bar {
  position: relative;
  width: 88px;
  height: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  flex: 0 0 auto;
}
.org-mobile-bar .bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--text-muted);
}
.org-mobile-bar.good .bar-fill { background: #2c8a3a; }
.org-mobile-bar.warn .bar-fill { background: var(--warn); }
.org-mobile-bar.low  .bar-fill { background: var(--accent); }
.org-mobile-bar .bar-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,0.45);
}
.org-mobile-no-target {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ===== 🤖 AI suggestions (mobile-sales.html) =====
   Top-3 priority customers + lapsed-products card. Sits above the
   KPI row. Card-style backdrop comes from .card; this block layers
   the inner blocks (banner, top-3 cards, lapsed list). */
.ai-mobile {
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-faint) 100%);
}
.ai-mobile-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  box-shadow: var(--shadow-1);
}
.ai-mobile-banner .ai-icon { flex: 0 0 auto; font-size: 14px; }
.ai-mobile-loading {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  padding: 8px 0;
}
.ai-mobile-loading .ai-spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--divider-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ai-mobile-spin 0.8s linear infinite;
}
@keyframes ai-mobile-spin { to { transform: rotate(360deg); } }
.ai-mobile-empty {
  font-size: 12px; color: var(--text-muted);
  padding: 10px 0;
}

/* Top-3 cards — full-width on mobile, vertical stack. */
.ai-mobile-top3 { display: flex; flex-direction: column; gap: 10px; }
.ai-mobile-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-1);
  border-left: 3px solid var(--accent);
}
.ai-mobile-priority {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.ai-mobile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ai-mobile-reason {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
}
.ai-mobile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ai-mobile-action {
  flex: 0 0 auto;
  display: inline-block;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  min-height: 36px;
  line-height: 20px;
}
.ai-mobile-action.disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  pointer-events: none;
}
.ai-mobile-action:active { background: var(--accent-3); }
.ai-mobile-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Lapsed products — compact list at the bottom of the section. */
.ai-mobile-lapsed {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}
.ai-mobile-lapsed:empty { display: none; }
.ai-mobile-lapsed-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-mobile-lapsed-count {
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}
.ai-mobile-lapsed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-mobile-lapsed-list li {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 10px;
  box-shadow: var(--shadow-1);
}
.ai-mobile-lapsed-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.ai-mobile-lapsed-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Reduced motion respect ===== */
@media (prefers-reduced-motion: reduce) {
  .card, .btn, .chip, .tile, .top3-item,
  .item-card, .header-link, .selected-card .clear {
    transition: none !important;
  }
  .btn:active, .chip:active, .tile:active, .top3-item:active,
  .header-link:active, .header-pc:active, .desktop-link:active {
    transform: none !important;
  }
}

/* ===== Quote history (mobile-quote.html) ===== */
.q-history-mobile h3 { display: flex; align-items: center; }
.q-history-row-mob {
  background: var(--surface-2);
  border-radius: var(--radius-sm, 8px);
  padding: 9px 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.q-history-head-mob {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.q-history-head-mob strong {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
}
.q-history-meta-mob {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-muted);
}
.q-history-cust-mob {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.q-history-cust-mob .muted { color: var(--text-muted); font-size: 10.5px; }
.q-note-input-mob {
  width: 100%;
  font-size: 12px;
  font-family: var(--font-sans);
  padding: 6px 8px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface);
  resize: vertical;
  min-height: 36px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}
.q-note-input-mob:focus { outline: none; border-color: var(--accent); }
.q-note-input-mob.q-note-saved { border-color: #2c8a3a; }
.q-note-input-mob.q-note-error { border-color: #b94a4a; }

/* ===== Convert modal (mobile) ===== */
.q-convert-modal-backdrop-mob {
  position: fixed; inset: 0;
  background: rgba(40, 30, 20, 0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;       /* slide-up sheet on phone */
  justify-content: center;
}
.q-convert-modal-mob {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.q-convert-head-mob {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
}
.q-convert-head-mob strong {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
}
.q-convert-head-mob .close-mob {
  background: transparent; border: none;
  font-size: 22px; line-height: 1; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px;
}
.q-convert-body-mob {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.q-convert-summary-mob {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm, 8px);
}
.q-convert-summary-mob .muted { color: var(--text-muted); font-size: 11px; }
.q-convert-item-mob {
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.q-convert-item-mob:last-child { border-bottom: none; }
.q-convert-item-name-mob strong { font-size: 13px; }
.q-convert-item-name-mob .muted {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.q-convert-qty-mob {
  display: flex; gap: 8px; margin-top: 8px;
}
.q-convert-qty-mob label {
  flex: 1 1 50%;
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.q-convert-qty-mob input {
  flex: 1 1 auto;
  padding: 8px 10px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm, 6px);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 14px;
  min-height: 40px;
}
.q-convert-foot-mob {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--divider);
}
.q-convert-foot-mob .status-text { margin-right: auto; }

/* ===== Quote history items (mobile, inline under each row) ===== */
.q-history-items-mob {
  margin: 6px 0 4px;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: var(--radius-sm, 8px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.q-history-item-mob { font-size: 11.5px; }
.q-item-name { color: var(--text); font-weight: 500; }
.q-item-meta { color: var(--text-muted); font-size: 10.5px; margin-top: 1px; }
.q-history-empty-mob { font-size: 11px; color: var(--text-muted); margin: 4px 0; }
