  :root {
    color-scheme: light;
    --surface-1:      #ffffff;
    --page-plane:      #eef0ef;
    --text-primary:   #0b0b0b;
    --text-secondary: #52514e;
    --text-muted:     #898781;
    --gridline:       #e1e0d9;
    --border:         rgba(11,11,11,0.14);
    --series-blue:    #2a78d6;
    --series-blue-tint: #eaf2fc;
    --status-good:     #0ca30c;
    --status-good-tint: #e8f7e6;
    --status-warning:  #fab219;
    --status-warning-tint: #fef3dc;
    --status-serious:  #ec835a;
    --status-serious-tint: #fdeae1;
    --status-critical: #d03b3b;
    --status-critical-tint: #fbe6e6;
    --status-quoted:   #eb6834;
    --status-quoted-tint: #fdeadf;
    --series-teal:     #1f9e8b;
    --series-teal-tint: #e3f5f1;
    --series-purple:   #7c5cd6;
    --series-purple-tint: #efe9fb;
    --series-orange:   #e08a2e;
    --series-orange-tint: #fcefdc;
    --gold:            #D4AF37;
    --gold-tint:       rgba(212,175,55,0.10);
    --gold-text:       #8a6a1f;
    --jewel-teal:      #0F5C6B;
    --jewel-emerald:   #0F7B5C;
    --jewel-coral:     #E8734A;
    --radius: 16px;
    --radius-sm: 10px;
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page-plane:      #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --border:         rgba(255,255,255,0.10);
    --series-blue:    #3987e5;
    --series-blue-tint: #12233a;
    --status-good:     #0ca30c;
    --status-good-tint: #123317;
    --status-warning:  #fab219;
    --status-warning-tint: #3a2c0c;
    --status-serious:  #ec835a;
    --status-serious-tint: #3a2318;
    --status-critical: #d03b3b;
    --status-critical-tint: #3a1414;
    --status-quoted:   #d95926;
    --status-quoted-tint: #3a2311;
    --series-teal:     #2bbfa8;
    --series-teal-tint: #0f2e29;
    --series-purple:   #9b7ce8;
    --series-purple-tint: #241c3a;
    --series-orange:   #e8a250;
    --series-orange-tint: #3a2712;
    --gold-tint:       rgba(212,175,55,0.14);
    --gold-text:       #D4AF37;
  }
  @media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) {
      color-scheme: dark;
      --surface-1:      #1a1a19;
      --page-plane:      #0d0d0d;
      --text-primary:   #ffffff;
      --text-secondary: #c3c2b7;
      --text-muted:     #898781;
      --gridline:       #2c2c2a;
      --border:         rgba(255,255,255,0.10);
      --series-blue:    #3987e5;
      --series-blue-tint: #12233a;
      --status-good:     #0ca30c;
      --status-good-tint: #123317;
      --status-warning:  #fab219;
      --status-warning-tint: #3a2c0c;
      --status-serious:  #ec835a;
      --status-serious-tint: #3a2318;
      --status-critical: #d03b3b;
      --status-critical-tint: #3a1414;
      --status-quoted:   #d95926;
      --status-quoted-tint: #3a2311;
      --series-teal:     #2bbfa8;
      --series-teal-tint: #0f2e29;
      --series-purple:   #9b7ce8;
      --series-purple-tint: #241c3a;
      --series-orange:   #e8a250;
      --series-orange-tint: #3a2712;
      --gold-tint:       rgba(212,175,55,0.14);
      --gold-text:       #D4AF37;
    }
  }

  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--page-plane);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
  }
  body {
    display: flex;
    justify-content: center;
    min-height: 100vh;
  }
  .phone {
    width: 100%;
    max-width: 460px;
    min-height: 100vh;
    background: var(--page-plane);
    display: flex;
    flex-direction: column;
    position: relative;
  }

  header.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 10px;
    background: #0B2545;
  }
  .brand {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
  }
  .brand-logo {
    height: 58px;
    width: auto;
    display: block;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .theme-toggle {
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    border-radius: 999px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
  }
  .sync-dot {
    position: absolute;
    top: -2px; right: -2px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--status-good);
    border: 1.5px solid #0B2545;
  }
  .sync-dot.is-offline { background: var(--status-critical); }
  .basket-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--status-critical);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #0B2545;
  }
  .basket-modal-empty { margin: 0 0 4px; }

  main {
    flex: 1;
    padding: 4px 20px 96px;
    overflow-y: auto;
  }
  .view { display: none; }
  .view.active { display: block; animation: fadein .18s ease; }
  @keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

  h2.view-title {
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .2px;
    margin: 10px 0 4px;
  }

  /* hero (New Request landing moment) */
  .hero-band {
    position: relative;
    overflow: hidden;
    margin: -4px -20px 20px;
    padding: 30px 24px 26px;
    background: linear-gradient(135deg, #0B2545 0%, #0F5C6B 55%, #0F7B5C 100%);
    text-align: center;
  }
  .hero-band::after {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    top: -70px; right: -50px;
    background: radial-gradient(circle, rgba(232,115,74,0.35), transparent 70%);
    pointer-events: none;
    animation: heroGlowDrift 8s ease-in-out infinite;
  }
  .hero-band::before {
    content: '';
    position: absolute;
    width: 260px; height: 260px;
    bottom: -100px; left: -70px;
    background: radial-gradient(circle, rgba(212,175,55,0.22), transparent 70%);
    pointer-events: none;
    animation: heroGlowDrift 10s ease-in-out infinite reverse;
  }
  @keyframes heroGlowDrift {
    0%, 100% { transform: translate(0,0) scale(1); opacity: .85; }
    50% { transform: translate(10px,-8px) scale(1.08); opacity: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .hero-band::before, .hero-band::after, .basket-item, .basket-badge.pulse { animation: none !important; }
  }
  .hero-logo { width: 100%; max-width: 280px; height: auto; display: block; margin: 0 auto 14px; position: relative; }
  .hero-tagline {
    position: relative;
    color: rgba(255,255,255,0.94);
    font-size: 14px;
    line-height: 1.55;
    max-width: 420px;
    margin: 0 auto;
  }

  /* how it works */
  .how-it-works {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 26px;
  }
  .start-request-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--series-blue);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 30px;
  }
  .how-step { display: flex; align-items: flex-start; gap: 12px; }
  .how-icon {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
  }
  .how-text strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
  .how-text span { display: block; font-size: 12.5px; color: var(--text-secondary); }

  /* basket badge pulse on add */
  .basket-badge.pulse { animation: badgePulse .4s ease; }
  @keyframes badgePulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.4); }
    100% { transform: scale(1); }
  }

  @media (hover: hover) {
    .ticket-card { transition: transform .18s ease, box-shadow .18s ease; }
    .ticket-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(11,37,69,0.10); }
  }
  p.view-sub {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--text-secondary);
  }

  /* form */
  .field { margin-bottom: 16px; }
  .field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
  }
  .field .hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
  }
  .field input, .field textarea, .field select {
    width: 100%;
    padding: 12px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
  }
  .field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--series-blue);
    outline-offset: 1px;
  }
  .item-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    animation: sourceCardIn .18s ease;
  }
  .item-suggestion-chip {
    background: var(--gold-tint);
    border: 1px solid rgba(212,175,55,0.35);
    color: var(--gold-text);
    border-radius: 999px;
    padding: 10px 14px;
    min-height: 36px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .1s ease;
  }
  .item-suggestion-chip:active { transform: scale(.96); }
  .item-suggestion-chip:focus-visible {
    outline: 2px solid var(--series-blue);
    outline-offset: 1px;
  }
  .item-suggestion-hint {
    font-size: 12px;
    font-style: italic;
    color: var(--text-secondary);
    padding: 4px 2px;
  }
  .field input[readonly] { background: var(--page-plane); color: var(--text-secondary); cursor: not-allowed; }
  .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  .legal-footer {
    text-align: center;
    padding: 20px 10px 90px;
    font-size: 12px;
  }
  .legal-footer a { color: var(--text-secondary); text-decoration: underline; }
  .legal-footer span { color: var(--text-muted); margin: 0 6px; }
  @media (min-width: 900px) {
    .legal-footer { padding-bottom: 20px; }
  }

  .home-account-prompt {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--gold-tint);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: -6px 0 16px;
  }
  .home-account-prompt .link-btn { font-size: 12.5px; font-weight: 700; }

  .same-day-disclaimer {
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(232,115,74,0.10);
    border: 1px solid rgba(232,115,74,0.3);
    color: var(--text-primary);
    margin: -6px 0 16px;
  }
  .same-day-disclaimer.is-past-cutoff { background: rgba(232,115,74,0.18); font-weight: 600; }

  .pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
  .pill-option {
    flex: 1;
    min-width: 84px;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: transform .12s ease, background .15s ease, border-color .15s ease;
  }
  .pill-option:active { transform: scale(.96); }
  .pill-option.is-selected {
    background: #0B2545;
    border-color: #0B2545;
    color: #D4AF37;
  }

  .lookup-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    min-height: 14px;
  }
  .lookup-status.is-error { color: var(--status-critical); }

  .address-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 8px;
  }
  .address-result-item {
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
  }
  .address-result-item.is-selected {
    outline: 2px solid var(--series-blue);
    outline-offset: -1px;
    background: var(--series-blue-tint);
  }

  .btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--series-blue);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: transform .12s ease, opacity .12s ease;
  }
  .btn-primary:active { opacity: .85; transform: scale(.98); }
  .btn-secondary {
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease;
  }
  .btn-secondary:active { transform: scale(.98); }

  /* stat tiles */
  .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }
  .stat-tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
  }
  .stat-tile.is-active { outline: 2px solid var(--series-blue); outline-offset: -1px; }
  .stat-tile .stat-top {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
  }
  .stat-tile .stat-value {
    font-size: 26px;
    font-weight: 700;
    font-variant-numeric: proportional-nums;
  }
  .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

  .manage-split { display: block; }
  .manage-pane { }
  .manage-tabs { display: none; gap: 8px; margin-bottom: 16px; }
  .manage-tab {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
  }
  .manage-tab.is-active { background: #0B2545; color: #D4AF37; border-color: #0B2545; }

  /* filter chips + search */
  .search-row { margin-bottom: 12px; }
  .search-row input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 14px;
  }
  .chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
  }
  .chip {
    flex-shrink: 0;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .chip.is-active {
    background: var(--series-blue);
    border-color: var(--series-blue);
    color: white;
  }

  /* request cards */
  .card-list { display: flex; flex-direction: column; gap: 10px; }
  .req-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 14px;
    cursor: pointer;
  }
  .req-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
  }
  .req-card-item { font-size: 15px; font-weight: 700; }
  .req-card-meta { font-size: 12.5px; color: var(--text-secondary); margin: 1px 0; }
  .req-card-meta strong { color: var(--text-primary); font-weight: 600; }
  .req-card-basket-note { font-style: italic; color: var(--gold-text); font-size: 11.5px; margin-top: 4px; }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
  }

  .empty-state {
    text-align: center;
    padding: 50px 16px;
    color: var(--text-secondary);
  }
  .empty-state .emoji { font-size: 34px; margin-bottom: 10px; }

  /* basket */
  .basket-section { margin-bottom: 22px; }
  .basket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .basket-header h3 { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif; font-size: 15px; font-weight: 700; }
  .basket-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
  .basket-item {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-left: 3px dashed var(--gold);
    border-radius: var(--radius);
    padding: 11px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    animation: basketItemIn .22s ease;
  }
  @keyframes basketItemIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
  .basket-item-main { min-width: 0; }
  .basket-item-name { font-size: 14px; font-weight: 700; }
  .basket-item-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .basket-item-remove {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2, var(--surface-1));
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
  }
  .basket-item-remove:hover { color: var(--status-critical); border-color: var(--status-critical); }
  .item-form-title {
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
    font-size: 17px;
    font-weight: 700;
    margin: 2px 0 14px;
  }
  .form-layout { display: block; }
  .basket-sidebar { display: none; }

  .btn-add-basket {
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(90deg, var(--jewel-emerald), var(--gold));
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(15,123,92,0.28);
    transition: transform .12s ease, box-shadow .15s ease;
  }
  .btn-add-basket:active { transform: scale(.98); }
  @media (hover: hover) {
    .btn-add-basket:hover { box-shadow: 0 5px 16px rgba(15,123,92,0.4); }
  }

  .ticket-card {
    position: relative;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 23px 18px 18px;
    box-shadow: 0 2px 10px rgba(11,37,69,0.06);
    margin-bottom: 4px;
  }
  .ticket-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--gold) 0%, var(--jewel-emerald) 65%, var(--jewel-coral) 100%);
  }
  .ticket-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--gold-text);
    margin-bottom: 2px;
  }

  /* item-form step wizard */
  .wizard-progress {
    display: flex;
    gap: 6px;
    margin: 2px 0 10px;
  }
  .wizard-progress-step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--gridline);
  }
  .wizard-progress-step.is-done,
  .wizard-progress-step.is-current {
    background: linear-gradient(90deg, var(--gold), var(--jewel-emerald));
  }
  .wizard-step-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--text-secondary);
    margin-bottom: 16px;
  }
  .wizard-nav {
    display: flex;
    gap: 10px;
    margin-top: 4px;
  }
  .wizard-nav .btn-secondary,
  .wizard-nav .btn-primary,
  .wizard-nav .btn-add-basket {
    width: auto;
    flex: 1;
  }
  .wizard-back-btn { flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }

  /* bottom nav */
  nav.bottomnav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    justify-content: center;
    background: var(--page-plane);
    border-top: 1px solid var(--border);
    padding: 8px max(8px, env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-bottom));
  }
  nav.bottomnav .inner {
    width: 100%; max-width: 460px;
    display: flex;
  }
  nav.bottomnav button {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
  }
  nav.bottomnav button.is-active { color: var(--series-blue); }

  /* detail overlay */
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 20;
  }
  .overlay.active { display: flex; }
  .sheet {
    width: 100%;
    max-width: 460px;
    max-height: 86vh;
    overflow-y: auto;
    background: var(--page-plane);
    border-radius: 20px 20px 0 0;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
    animation: slideup .2s ease;
  }
  @keyframes slideup { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

  /* "Welcome to the Club" — shown once, right after creating an account */
  .club-welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11,37,69,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
    opacity: 0;
    transition: opacity .2s ease;
  }
  .club-welcome-overlay.is-visible { opacity: 1; }
  .confetti-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
  .confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation-name: confetti-fall;
    animation-timing-function: ease-in;
    animation-iteration-count: infinite;
  }
  @keyframes confetti-fall {
    0% { transform: translateY(-20px) translateX(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) translateX(var(--drift)) rotate(540deg); opacity: 0.85; }
  }
  .club-welcome-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--surface-1);
    border-radius: var(--radius);
    padding: 30px 24px 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    transform: scale(.85);
    opacity: 0;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
  }
  .club-welcome-overlay.is-visible .club-welcome-card { transform: scale(1); opacity: 1; }
  .club-welcome-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--gold) 0%, var(--jewel-emerald) 65%, var(--jewel-coral) 100%);
  }
  .club-welcome-icon { font-size: 44px; margin-bottom: 6px; }
  .club-welcome-card h2 {
    font-family: Georgia, "Iowan Old Style", Palatino, serif;
    font-size: 22px;
    margin: 0 0 10px;
    color: var(--gold-text);
  }
  .club-welcome-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 20px; }
  .club-welcome-card .btn-primary { width: 100%; }
  @media (prefers-reduced-motion: reduce) {
    .confetti-piece { animation: none; display: none; }
  }
  .sheet-handle {
    width: 40px; height: 4px; border-radius: 999px;
    background: var(--border);
    margin: 0 auto 16px;
  }
  .sheet h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
  .detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gridline);
    font-size: 13.5px;
  }
  .detail-row:last-of-type { border-bottom: none; }
  .detail-row .k { color: var(--text-secondary); flex-shrink: 0; }
  .detail-row .v { text-align: right; font-weight: 600; }
  .basket-detail-item { margin-bottom: 6px; }
  .basket-detail-item:last-child { margin-bottom: 0; }
  .basket-detail-item-name {
    font-weight: 700;
    font-size: 14px;
    margin: 14px 0 2px;
  }

  /* order timeline */
  .timeline { display: flex; flex-direction: column; padding: 2px 0 4px; }
  .timeline-item {
    position: relative;
    display: flex;
    gap: 10px;
    padding-bottom: 16px;
    padding-left: 2px;
  }
  .timeline-item:last-child { padding-bottom: 0; }
  .timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: -2px;
    width: 2px;
    background: var(--gridline);
  }
  .timeline-item:last-child::before { display: none; }
  .timeline-dot {
    flex-shrink: 0;
    width: 12px; height: 12px;
    border-radius: 50%;
    margin-top: 2px;
  }
  .timeline-body { min-width: 0; }
  .timeline-status {
    font-size: 13.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .timeline-item:not(.is-current) .timeline-status { color: var(--text-secondary); font-weight: 600; }
  .timeline-date { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

  /* horizontal stage tracker ("pizza tracker" style progress bar) */
  .stage-tracker { margin: 4px 0 20px; }
  .stage-track {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 34px;
  }
  .stage-track::before {
    content: '';
    position: absolute;
    left: 17px; right: 17px; top: 50%;
    height: 3px;
    background: var(--gridline);
    transform: translateY(-50%);
  }
  .stage-track-fill {
    position: absolute;
    left: 17px; top: 50%;
    height: 3px;
    background: var(--status-good);
    transform: translateY(-50%);
    transition: width .3s ease;
  }
  .stage-dot {
    position: relative;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface-1);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .stage-dot.is-current { animation: stagepulse 1.4s ease-in-out infinite; }
  @keyframes stagepulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
  }
  .stage-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
  }
  .stage-labels span {
    flex: 1;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 2px;
  }
  .stage-labels span.is-current { color: var(--text-primary); font-weight: 700; }

  .status-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px 0 10px;
  }
  .status-btn {
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
  }
  .status-btn.is-current { outline: 2px solid var(--series-blue); outline-offset: -1px; }
  .sheet h4.section-title {
    font-size: 13px;
    font-weight: 700;
    margin: 18px 0 10px;
  }
  .per-item-cost-block {
    background: var(--page-plane);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
  }
  .per-item-cost-label { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
  .per-item-speed-toggle { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 12px 0 8px; }
  .per-item-speed-toggle .hint { font-weight: 400; }
  .per-item-total-box {
    background: var(--gold-tint);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin: 4px 0 14px;
  }
  .per-item-total-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }

  .quote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }
  .quote-row label { font-size: 13.5px; font-weight: 600; flex: 1; }
  .quote-input-wrap { position: relative; width: 116px; flex-shrink: 0; }
  .quote-input-wrap .prefix {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--text-secondary);
  }
  .quote-input-wrap input {
    width: 100%;
    padding: 9px 10px 9px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
  }
  .margin-tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }
  .margin-tile .mt-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
  }
  .margin-tile .mt-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
  .margin-tile .mt-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: proportional-nums;
    color: var(--status-good);
  }

  /* monthly reports */
  .reports-summary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .reports-summary-tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
  }
  .reports-summary-tile .mt-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
  .reports-summary-tile .mt-value { font-size: 22px; font-weight: 700; margin-top: 4px; color: var(--status-good); }
  .reports-month-list { display: flex; flex-direction: column; gap: 8px; }
  .reports-month-row {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .reports-month-label { font-weight: 700; font-size: 14px; }
  .reports-month-stats { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-secondary); }
  .reports-month-margin { font-weight: 700; color: var(--status-good); font-size: 14px; }

  /* accounts / auth */
  .auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
  .auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
  }
  .auth-tab.is-active { background: var(--series-blue); border-color: var(--series-blue); color: #fff; }
  .auth-error {
    font-size: 12px;
    color: var(--status-critical);
    margin: -6px 0 12px;
    min-height: 14px;
  }
  .guest-link-row { text-align: center; margin-top: 8px; }
  .guest-link-row button {
    background: none; border: none; color: var(--text-secondary);
    font-size: 12.5px; font-family: inherit; text-decoration: underline; cursor: pointer;
  }
  .account-banner {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
  }
  .account-banner strong { color: var(--text-primary); }
  .account-banner.is-note { border-color: var(--series-blue); background: var(--series-blue-tint); }
  .staff-login-prompt { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; }
  .staff-login-prompt .link-btn { margin-top: 0; }
  .staff-login-prompt .field { text-align: left; }

  /* ---- Important Dates ---- */
  .account-section-title {
    font-family: Georgia, "Iowan Old Style", Palatino, serif;
    font-size: 17px;
    margin: 22px 0 4px;
  }
  .important-dates-section { margin-bottom: 6px; }
  .account-two-col { display: block; }
  .account-col-requests, .account-col-dates { min-width: 0; }

  /* ---- Analytics ---- */
  .analytics-hero {
    text-align: center;
    background: linear-gradient(180deg, var(--gold-tint), transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 20px 20px;
    margin-bottom: 16px;
  }
  .analytics-hero-value {
    font-family: Georgia, "Iowan Old Style", Palatino, serif;
    font-size: 52px;
    font-weight: 700;
    color: var(--gold-text);
    line-height: 1;
  }
  .analytics-hero-unit { font-size: 22px; font-weight: 600; margin-left: 4px; }
  .analytics-hero-label { font-size: 13.5px; color: var(--text-secondary); margin-top: 6px; font-weight: 600; }

  .metric-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
  }
  .metric-tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
  }
  .metric-tile-value { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
  .metric-tile-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-top: 2px; }
  .metric-tile-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

  .analytics-callout {
    background: var(--gold-tint);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    margin-bottom: 16px;
  }
  .analytics-callout strong { color: var(--gold-text); }

  .chart-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px 14px;
  }
  .chart-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .chart-card-head h3 { margin: 0; font-size: 15px; font-family: Georgia, "Iowan Old Style", Palatino, serif; }

  .bar-chart { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 150px; }
  .bar-chart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    cursor: pointer;
    outline: none;
  }
  .bar-chart-track {
    width: 100%;
    max-width: 22px;
    height: 120px;
    display: flex;
    align-items: flex-end;
    border-bottom: 1px solid var(--gridline);
  }
  .bar-chart-bar {
    width: 100%;
    min-height: 3px;
    background: var(--series-blue);
    border-radius: 4px 4px 0 0;
    transition: opacity .12s ease;
  }
  .bar-chart-col:hover .bar-chart-bar, .bar-chart-col:focus .bar-chart-bar { opacity: 0.75; }
  .bar-chart-tick { font-size: 10px; color: var(--text-muted); margin-top: 6px; white-space: nowrap; }
  .bar-chart-tooltip {
    position: absolute;
    top: -6px;
    transform: translateY(-100%);
    background: var(--text-primary);
    color: var(--surface-1);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
  }
  .analytics-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .analytics-table th, .analytics-table td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--gridline); }
  .analytics-table th { color: var(--text-secondary); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; }
  .analytics-table td:last-child, .analytics-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
  .analytics-table-wrap { overflow-x: auto; }

  .bar-chart-horizontal { height: auto; display: block; }
  .hbar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
  .hbar-label { width: 108px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
  .hbar-track { flex: 1; height: 14px; background: var(--page-plane); border-radius: 999px; overflow: hidden; }
  .hbar-fill { height: 100%; border-radius: 999px; background: var(--series-blue); min-width: 4px; }
  .hbar-value { width: 28px; text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }

  @media (min-width: 480px) {
    .metric-tile-grid { grid-template-columns: repeat(4, 1fr); }
  }
  .occ-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(11,37,69,0.06);
  }
  .occ-card-main { display: flex; gap: 12px; align-items: flex-start; }
  .occ-icon {
    font-size: 22px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--gold-tint);
    flex-shrink: 0;
  }
  .occ-info { min-width: 0; flex: 1; }
  .occ-label { font-weight: 700; font-size: 14.5px; }
  .occ-next { font-size: 13px; color: var(--text-secondary); margin-top: 1px; }
  .occ-order-line { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
  .occ-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .occ-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--page-plane);
    color: var(--text-secondary);
    border: 1px solid var(--border);
  }
  .occ-badge-auto { background: var(--gold-tint); color: var(--gold-text); border-color: rgba(212,175,55,0.35); }
  .occ-actions {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gridline);
  }
  .occ-actions .link-btn { margin: 0; font-size: 12.5px; }
  .important-dates-section > .card-list { margin-bottom: 12px; }
  .important-dates-section .empty-state { padding: 20px 14px; margin-bottom: 12px; }
  #addImportantDateBtn { width: 100%; }
  .occ-form { margin-top: 4px; }
  .occ-auto-toggle {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    margin: 10px 0 2px;
    cursor: pointer;
  }
  .occ-auto-toggle input { margin-top: 2px; }
  .occ-form-error { color: var(--status-critical); font-size: 12.5px; margin: 4px 0; min-height: 1em; }
  .btn-quote {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--series-blue);
    color: white;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
  }
  .btn-quote:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
  .choice-grid { margin-bottom: 4px; }
  .choice-tile.is-selected-tile { border-color: var(--series-blue); background: var(--series-blue-tint); }
  .choice-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 2px;
    margin: 4px 0 10px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
  }
  .item-breakdown-box {
    background: var(--page-plane);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: -4px 0 12px;
  }
  .item-breakdown-title { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
  .item-breakdown-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
  .choice-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 8px;
  }
  .choice-tile:active { background: var(--series-blue-tint); }
  .choice-tile .ct-name { font-weight: 700; font-size: 14px; }
  .choice-tile .ct-price { font-weight: 700; font-size: 15px; color: var(--series-blue); }
  .quote-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13.5px;
    border-bottom: 1px solid var(--gridline);
  }
  .quote-summary-row:last-child { border-bottom: none; }
  .quote-summary-row.is-chosen { font-weight: 700; color: var(--status-good); }
  .quote-summary-row.is-refunded { font-weight: 700; color: var(--status-critical); }
  .refund-reason-note { font-size: 12px; color: var(--text-secondary); margin: -4px 0 8px; font-style: italic; }
  .link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--series-blue);
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 6px;
  }
  /* staff decline + counter-offer a date */
  .decline-tool { margin: 10px 0 4px; }
  .decline-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--jewel-coral);
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
  }
  .decline-panel {
    margin-top: 10px;
    padding: 14px;
    background: rgba(232,115,74,0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .decline-panel .field { margin-bottom: 10px; }
  .decline-error { font-size: 12px; color: var(--status-critical); min-height: 14px; margin-bottom: 6px; }
  .decline-pending-note {
    background: rgba(232,115,74,0.10);
    border: 1px solid rgba(232,115,74,0.3);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.5;
  }
  .decline-pending-sub { color: var(--text-secondary); margin-top: 4px; font-size: 12px; }
  .decline-withdraw-btn { margin-top: 6px; color: var(--text-secondary); }

  /* buyer-facing: staff proposed a different date */
  .proposed-date-banner {
    background: var(--gold-tint);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: var(--radius);
    padding: 14px;
    margin: 10px 0 4px;
    font-size: 13px;
    line-height: 1.5;
  }
  .proposed-date-banner-title { font-weight: 700; margin-bottom: 4px; }
  .proposed-date-banner-note { color: var(--text-secondary); font-size: 12.5px; margin: 6px 0; }
  .proposed-date-banner .btn-primary { margin-top: 10px; }

  /* staff item sourcing search — standalone tool on the Manage dashboard */
  .item-search-standalone {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: 0 2px 10px rgba(11,37,69,0.06);
  }
  .item-search-standalone .field { margin-bottom: 12px; }
  .source-search-btn-row { display: flex; gap: 10px; }
  .source-search-btn-row .btn-add-basket { flex: 2; }
  .source-search-btn-row .btn-secondary { flex: 1; }
  .source-status { font-size: 12.5px; color: var(--text-secondary); margin: 8px 0; }
  .source-status.is-error { color: var(--status-critical); }
  .source-option-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-left: 3px solid var(--jewel-teal);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
  }
  .source-option-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
  .source-option-retailer { font-weight: 700; font-size: 13.5px; }
  .source-option-price { font-weight: 700; font-size: 13.5px; color: var(--jewel-emerald); white-space: nowrap; }
  .source-option-name { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
  .source-option-note { font-size: 11.5px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
  .source-option-note.is-feasible { color: var(--jewel-emerald); }
  .source-option-note.is-tight { color: var(--jewel-coral); }

  .source-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .tier-result-tile {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: sourceCardIn .22s ease;
  }
  .tier-result-label { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
  .tier-result-price { font-size: 18px; font-weight: 800; color: var(--text-primary); margin: 2px 0; }
  .tier-result-save-btn { margin-top: 8px; font-size: 12.5px; padding: 10px; }
  @media (min-width: 600px) { .source-results { grid-template-columns: repeat(3, 1fr); } }
  .source-option-link { font-size: 12px; margin-top: 6px; display: inline-block; color: var(--jewel-teal); font-weight: 600; }

  .source-loading { display: flex; align-items: center; gap: 10px; }
  .source-spinner {
    width: 15px; height: 15px;
    border: 2px solid var(--border);
    border-top-color: var(--jewel-teal);
    border-radius: 50%;
    flex-shrink: 0;
    animation: sourceSpin .8s linear infinite;
  }
  @keyframes sourceSpin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) {
    .source-spinner { animation: none; }
    .source-option-card { animation: none !important; }
  }
  .source-option-card {
    animation: sourceCardIn .22s ease;
    position: relative;
  }
  @keyframes sourceCardIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
  }
  .source-option-card.is-best { border-left-color: var(--gold); box-shadow: 0 2px 10px rgba(212,175,55,0.18); }
  .source-best-badge {
    display: inline-block;
    background: var(--gold-tint);
    color: var(--gold-text);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .3px;
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 6px;
  }
  .source-option-card.is-best.is-chosen { border-left-color: var(--jewel-emerald); box-shadow: none; }

  .danger-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--status-critical);
    background: var(--status-critical-tint);
    color: var(--status-critical);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
  }

  .chat-fab {
    position: fixed;
    right: 16px;
    bottom: 76px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #0B2545;
    color: #D4AF37;
    border: none;
    box-shadow: 0 4px 14px rgba(11,37,69,0.35);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 30;
  }
  .chat-panel {
    position: fixed;
    right: 16px;
    bottom: 136px;
    width: min(340px, calc(100vw - 32px));
    max-height: 60vh;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    z-index: 31;
    overflow: hidden;
  }
  .chat-panel-header {
    background: #0B2545;
    color: #ffffff;
    padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
  }
  .chat-panel-title { font-weight: 700; font-size: 14px; }
  .chat-panel-close { background: none; border: none; color: #ffffff; font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px; }
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
  }
  .chat-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
  }
  .chat-msg-bot { align-self: flex-start; background: var(--page-plane); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
  .chat-msg-user { align-self: flex-end; background: #0B2545; color: #ffffff; border-bottom-right-radius: 4px; }
  .chat-msg-error { align-self: center; font-size: 12px; color: var(--status-critical); text-align: center; }
  .chat-msg-loading { align-self: flex-start; font-size: 12px; color: var(--text-secondary); font-style: italic; }

  .message-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 10px;
    background: var(--page-plane);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
  }
  .message-thread .chat-msg { max-width: 88%; }
  .message-sender-label { font-size: 10.5px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
  .message-thread-empty { font-size: 12.5px; color: var(--text-secondary); text-align: center; padding: 10px; }
  .message-compose-row { display: flex; gap: 8px; margin-bottom: 6px; }
  .message-compose-row input {
    flex: 1;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
  }
  .chat-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); flex-shrink: 0; }
  .chat-input-row input {
    flex: 1;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--page-plane);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
  }
  .chat-send-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #D4AF37;
    color: #0B2545;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }
  @media (min-width: 900px) {
    .chat-fab { bottom: 24px; }
    .chat-panel { bottom: 88px; width: 360px; }
  }

  /* toast */
  .toast {
    position: fixed;
    bottom: 86px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text-primary);
    color: var(--page-plane);
    padding: 11px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 30;
    white-space: nowrap;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  svg { display: block; }

  /* ---------- desktop layout ----------
     Below 900px this is untouched: full-height phone-style shell, bottom tab
     bar, single narrow column. At 900px+ the same DOM is re-laid-out via CSS
     Grid into a proper desktop app shell — sticky top bar, a left sidebar
     (the bottom nav's buttons, restyled in place, not duplicated), and an
     independently scrolling content pane — so the app fills the browser
     window instead of floating as a narrow strip in empty space. */
  @media (min-width: 900px) {
    html, body { height: 100%; }
    body { overflow: hidden; }
    .phone {
      max-width: none;
      width: 100%;
      height: 100vh;
      min-height: 0;
      display: grid;
      grid-template-columns: 248px 1fr;
      grid-template-rows: auto 1fr;
      grid-template-areas: "header header" "nav main";
    }
    header.topbar { grid-area: header; padding: 14px 32px; }
    .brand-logo { height: 72px; }

    nav.bottomnav {
      grid-area: nav;
      position: static;
      height: 100%;
      overflow-y: auto;
      justify-content: flex-start;
      border-top: none;
      border-right: 1px solid var(--border);
      padding: 24px 14px;
    }
    nav.bottomnav .inner {
      max-width: none;
      width: 100%;
      flex-direction: column;
      gap: 2px;
    }
    nav.bottomnav button {
      flex: none;
      flex-direction: row;
      justify-content: flex-start;
      gap: 12px;
      padding: 11px 14px;
      border-radius: var(--radius-sm);
      font-size: 14px;
      border-left: 3px solid transparent;
    }
    nav.bottomnav button.is-active {
      background: rgba(212,175,55,0.10);
      border-left-color: #D4AF37;
    }

    main {
      grid-area: main;
      height: 100%;
      padding: 40px 48px 56px;
    }
    .view { max-width: 720px; }
    #view-form { max-width: 1000px; }
    #view-dashboard { max-width: 1100px; }
    #view-dashboard .manage-tabs { display: none !important; }
    .manage-split.has-search { display: grid; grid-template-columns: 1fr 400px; gap: 28px; align-items: start; }
    .manage-split.has-search #managePaneSearch { display: block !important; position: sticky; top: 0; }
    .manage-split.has-search #managePaneRequests { display: block !important; }
    h2.view-title { font-size: 26px; }
    .hero-band { margin: 0 0 28px; border-radius: var(--radius); padding: 40px 32px; }
    .hero-logo { max-width: 340px; }
    .how-it-works { flex-direction: row; gap: 22px; }
    .how-step { flex: 1; flex-direction: column; align-items: flex-start; gap: 10px; }

    .form-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
    .account-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
    .basket-sidebar { display: block; position: sticky; top: 0; }
    .basket-section { display: none !important; }
    .basket-sidebar-inner {
      background: var(--surface-1);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 18px;
      box-shadow: 0 2px 10px rgba(11,37,69,0.06);
    }
    .basket-sidebar-inner h3 { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif; font-size: 15px; font-weight: 700; margin: 0 0 12px; }
    /* the sidebar is always visible here, so the header icon/modal would be redundant */
    #basketNavBtn { display: none; }

    .toast { bottom: 32px; }
  }
