/* ==========================================================================
   SwapR design system
   Dark-first, brand green #48B818 on near-black. No build step: modern CSS
   only (custom properties, @layer, :has(), container-friendly grids).
   ========================================================================== */

@layer reset, base, components, utilities, overrides;

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;
  /* Palette ported from the old thread's design system:
     blue-black canvas, #111629 cards, vivid SwapR green. */
  --brand: #2ed05e;
  --brand-bright: #7be382;
  --brand-hover: #46e074;
  --brand-dim: #16a34a;
  --brand-ink: #04120a;

  --bg: #0a0e1a;
  --bg-raised: #111629;
  --surface: #111629;
  --surface-2: #0d1220;
  --surface-3: #161d33;
  --border: #1e2742;
  --border-strong: #2a3556;

  --text: #e6e9f2;
  --text-2: #8b93ab;
  --text-3: #66708c;

  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, .12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, .13);
  --info: #7ab6ff;
  --info-bg: rgba(122, 182, 255, .12);
  --ok: var(--brand-bright);
  --ok-bg: rgba(46, 208, 94, .13);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow: 0 8px 30px rgb(0 0 0 / .45);
  --shadow-lg: 0 24px 70px rgb(0 0 0 / .55);

  --font: "Geist", ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --nav-h: 64px;
  --bottomnav-h: 62px;
  --max: 1180px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --speed: .22s;
}

/* Dark is the default theme; light is an explicit choice (old thread behaviour). */
:root[data-theme="light"] {
  color-scheme: light;
  --brand: #16a34a;
  --brand-bright: #15803d;
  --brand-hover: #128a3e;
  --brand-dim: #128a3e;
  --brand-ink: #ffffff;

  --bg: #f4f7f5;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --surface-3: #e3eae5;
  --border: #dfe7e2;
  --border-strong: #c6d2ca;
  --text: #16211b;
  --text-2: #5b6b61;
  --text-3: #86988d;

  --danger: #dc2626;
  --danger-bg: #fdecec;
  --warn: #b45309;
  --warn-bg: #fdf3e0;
  --info: #1d63b8;
  --info-bg: #e9f3ff;
  --ok: var(--brand-bright);
  --ok-bg: #eaf8ee;
  --shadow-sm: 0 1px 2px rgb(20 30 20 / .08);
  --shadow: 0 8px 30px rgb(20 30 20 / .10);
  --shadow-lg: 0 24px 70px rgb(20 30 20 / .16);
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body {
    font-family: var(--font);
    /* The old thread's signature: two soft green glows over the canvas. */
    background:
      radial-gradient(1200px 600px at 80% -10%, color-mix(in oklab, var(--brand) 10%, transparent), transparent 60%),
      radial-gradient(900px 500px at 0% 0%, color-mix(in oklab, var(--brand) 5%, transparent), transparent 55%),
      var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-size: 16px;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  img, picture, video, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  h1, h2, h3, h4 { line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
  :focus-visible {
    outline: 2px solid var(--brand-bright);
    outline-offset: 2px;
    border-radius: 4px;
  }
  ::selection { background: color-mix(in oklab, var(--brand) 40%, transparent); }
}

@layer base {
  .container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
  .narrow { width: min(760px, 100% - 2.5rem); margin-inline: auto; }
  main { padding-bottom: calc(var(--bottomnav-h) + 2rem); }
  @media (min-width: 880px) { main { padding-bottom: 4rem; } }

  .muted { color: var(--text-2); }
  .dim { color: var(--text-3); }
  .small { font-size: .875rem; }
  .xs { font-size: .78rem; }
  .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .num { font-variant-numeric: tabular-nums; }
  .prose { color: var(--text-2); }
  .prose p + p { margin-top: .8em; }
  .center { text-align: center; }
  .grow { flex: 1; min-width: 0; }
  .row { display: flex; align-items: center; gap: .6rem; }
  .row.wrap { flex-wrap: wrap; }
  .stack { display: flex; flex-direction: column; gap: .75rem; }
  .hidden { display: none !important; }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
@layer components {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--nav-h);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    border-bottom: 1px solid var(--border);
  }
  .site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.25rem;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
  }
  .brand img { height: 25px; width: auto; }
  .brand .alt { display: none; }
  :root[data-theme="light"] .brand .main { display: none; }
  :root[data-theme="light"] .brand .alt { display: block; }

  .nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
  .nav a, .nav button.navlink {
    padding: .5rem .8rem;
    border-radius: var(--radius-sm);
    font-size: .92rem;
    font-weight: 550;
    color: var(--text-2);
    white-space: nowrap;
    transition: color var(--speed), background var(--speed);
  }
  .nav a:hover, .nav button.navlink:hover { color: var(--text); background: var(--surface-2); }
  .nav a.active { color: var(--text); background: var(--surface-2); }
  .nav .divider { width: 1px; height: 22px; background: var(--border); margin-inline: .4rem; }
  @media (max-width: 760px) {
    .nav .desktop-only { display: none; }
  }

  /* Mobile bottom nav — the thumb-reach answer to the header. */
  .bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 70;
    height: var(--bottomnav-h);
    display: flex;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: .66rem;
    font-weight: 600;
    color: var(--text-3);
    transition: color var(--speed);
    position: relative;
  }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--brand); }
  /* Old-thread indicator: a green bar sits over the active tab. */
  .bottom-nav a.active::before {
    content: "";
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 40px; height: 3px; border-radius: 0 0 4px 4px;
    background: var(--brand);
  }
  /* “Sell” is deliberately raised and filled — it is the one action that
     creates supply, so it reads as a button, not a tab. */
  .bottom-nav a .dn-sell {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    margin-top: -17px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--brand);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgb(0 0 0 / .35);
    transition: background var(--speed), color var(--speed);
    position: relative; z-index: 1;
  }
  .bottom-nav a .dn-sell svg { width: 18px; height: 18px; }
  .bottom-nav a.active .dn-sell { background: var(--brand); color: #04120a; border-color: var(--brand); }
  .bottom-nav a.active::before { display: none; }
  .bottom-nav a .badge { position: absolute; top: 6px; margin-left: 26px; }
  @media (min-width: 880px) { .bottom-nav { display: none; } }

  /* ---------------------------------------------------------------- Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .875rem;
    letter-spacing: .01em;
    border: 1px solid transparent;
    transition: transform var(--speed) var(--ease), background var(--speed),
      border-color var(--speed), box-shadow var(--speed), opacity var(--speed);
    user-select: none;
    white-space: nowrap;
  }
  .btn:active { transform: scale(.97); }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

  .btn-primary {
    background: var(--brand);
    color: #ffffff;
  }
  .btn-primary:hover { background: var(--brand-hover); }
  .btn-secondary, .btn-ghost, .btn-quiet { border-radius: var(--radius-sm); }

  .btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
  .btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-3); }

  .btn-quiet { background: transparent; border-color: var(--border); color: var(--text-2); }
  .btn-quiet:hover { color: var(--text); border-color: var(--border-strong); }

  .btn-danger { background: var(--danger-bg); border-color: color-mix(in oklab, var(--danger) 40%, transparent); color: var(--danger); }
  .btn-danger:hover { border-color: var(--danger); }

  .btn-sm { padding: .4rem .85rem; font-size: .84rem; }
  .btn-lg { padding: .85rem 1.7rem; font-size: 1.02rem; }
  .btn-block { width: 100%; }

  /* Spinner for pending buttons: label swaps to a rotating arc. */
  .btn.loading { pointer-events: none; opacity: .8; }
  .btn.loading::before {
    content: "";
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: spin .7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ----------------------------------------------------------------- Pills */
  /* Old thread's badge spec: borderless translucent tint, terse and uppercase. */
  .pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .14rem .6rem;
    border-radius: var(--radius-pill);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    border: 0;
    background: color-mix(in oklab, var(--text-3) 15%, transparent);
    color: var(--text-2);
    white-space: nowrap;
  }
  .pill svg { flex: none; }
  .pill.ok { background: color-mix(in oklab, var(--brand) 15%, transparent); color: var(--brand-bright); }
  .pill.warn { background: color-mix(in oklab, var(--warn) 14%, transparent); color: var(--warn); }
  .pill.danger { background: color-mix(in oklab, var(--danger) 14%, transparent); color: var(--danger); }
  .pill.info { background: color-mix(in oklab, var(--info) 14%, transparent); color: var(--info); }
  .pill.neutral { background: color-mix(in oklab, var(--text-3) 15%, transparent); color: var(--text-2); }

  .badge {
    min-width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: .66rem;
    font-weight: 800;
  }

  .verified-tick {
    display: inline-flex;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-ink);
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 900;
    vertical-align: -2px;
    flex: none;
  }

  /* ----------------------------------------------------------------- Cards */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
  }
  .card.pad-lg { padding: 1.75rem; }
  .card.hover { transition: transform var(--speed) var(--ease), border-color var(--speed), box-shadow var(--speed); }
  .card.hover:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }

  .card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
  .card-head h3 { font-size: 1.02rem; }

  /* ----------------------------------------------------------------- Forms */
  .field { display: flex; flex-direction: column; gap: .38rem; }
  .field > label { font-size: .84rem; font-weight: 650; color: var(--text-2); }
  .field .hint { font-size: .78rem; color: var(--text-3); }

  .input, textarea.input, select.input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .68rem .9rem;
    font-size: .96rem;
    color: var(--text);
    transition: border-color var(--speed), box-shadow var(--speed), background var(--speed);
    appearance: none;
  }
  .input::placeholder { color: var(--text-3); }
  .input:hover { border-color: var(--border-strong); }
  .input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 22%, transparent);
    background: var(--bg-raised);
  }
  textarea.input { resize: vertical; min-height: 110px; line-height: 1.5; }
  select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.2rem;
  }
  .input-prefix { position: relative; }
  .input-prefix > span {
    position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
    color: var(--text-3); font-weight: 650; pointer-events: none;
  }
  .input-prefix .input { padding-left: 1.9rem; }

  .chip-group { display: flex; flex-wrap: wrap; gap: .5rem; }
  .chip input { position: absolute; opacity: 0; pointer-events: none; }
  .chip span {
    display: inline-flex; padding: .42rem .9rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: .86rem; font-weight: 600; color: var(--text-2);
    cursor: pointer;
    transition: all var(--speed);
  }
  .chip span:hover { border-color: var(--border-strong); color: var(--text); }
  .chip input:checked + span {
    background: color-mix(in oklab, var(--brand) 18%, transparent);
    border-color: var(--brand);
    color: var(--brand-bright);
  }
  .chip input:focus-visible + span { outline: 2px solid var(--brand-bright); outline-offset: 2px; }

  .checkline { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--text-2); }
  .checkline input { margin-top: .25rem; accent-color: var(--brand); }

  /* ---------------------------------------------------------------- Toasts */
  .toasts {
    position: fixed;
    top: calc(var(--nav-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(430px, calc(100vw - 2rem));
    pointer-events: none;
  }
  .toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .8rem 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: .9rem;
    animation: toast-in .34s var(--ease);
  }
  .toast.out { animation: toast-out .3s var(--ease) forwards; }
  .toast::before {
    content: "";
    flex: none;
    width: 8px; height: 8px;
    margin-top: .45rem;
    border-radius: 50%;
    background: var(--text-3);
  }
  .toast.success::before { background: var(--brand-bright); box-shadow: 0 0 10px var(--brand); }
  .toast.error::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
  .toast.info::before { background: var(--info); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

  /* -------------------------------------------------------- Listing cards */
  .grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.1rem;
  }
  .listing-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--speed) var(--ease), border-color var(--speed), box-shadow var(--speed);
  }
  .listing-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
  }
  .listing-card .thumb {
    aspect-ratio: 4 / 3;
    background: var(--surface-3);
    position: relative;
    overflow: hidden;
  }
  .listing-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
  .listing-card:hover .thumb img { transform: scale(1.045); }
  .listing-card .thumb .noimg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 1.8rem;
    background:
      radial-gradient(120% 90% at 20% 0%, color-mix(in oklab, var(--brand) 14%, transparent), transparent 60%),
      var(--surface-3);
  }
  .listing-card .thumb .tags { position: absolute; top: .55rem; left: .55rem; display: flex; gap: .35rem; }
  .listing-card .body { padding: .85rem .95rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
  .listing-card .title {
    font-weight: 650; font-size: .95rem; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .listing-card .price { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
  .listing-card .who { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-3); margin-top: auto; }

  /* Stars */
  .stars { display: inline-flex; gap: 1px; color: var(--warn); font-size: .85rem; letter-spacing: 1px; }
  .stars .off { color: var(--text-3); opacity: .5; }

  /* ------------------------------------------------------------- Hero/home */
  .hero {
    position: relative;
    padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem);
    overflow: hidden;
  }
  .hero::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto;
    height: 130%;
    background:
      radial-gradient(45% 55% at 72% 18%, color-mix(in oklab, var(--brand) 22%, transparent), transparent 70%),
      radial-gradient(35% 45% at 15% 8%, color-mix(in oklab, var(--brand) 12%, transparent), transparent 70%);
    pointer-events: none;
    z-index: -1;
  }
  .hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .9rem;
    border-radius: var(--radius-pill);
    background: color-mix(in oklab, var(--brand) 12%, transparent);
    border: 1px solid color-mix(in oklab, var(--brand) 30%, transparent);
    color: var(--brand-bright);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
  }
  .hero h1 {
    font-size: clamp(2.4rem, 6.2vw, 4.4rem);
    letter-spacing: -0.035em;
    max-width: 15ch;
  }
  .hero h1 .accent {
    background: linear-gradient(120deg, var(--brand-bright), color-mix(in oklab, var(--brand) 60%, #dfffce));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .hero .sub {
    margin-top: 1.2rem;
    font-size: clamp(1.02rem, 1.6vw, 1.2rem);
    color: var(--text-2);
    max-width: 56ch;
  }
  .hero .cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 3rem;
  }
  .hero-stats > div { background: var(--surface); padding: 1.1rem 1.25rem; }
  .hero-stats .v { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
  .hero-stats .k { font-size: .78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }

  /* Feature triptych */
  .features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
  }
  .feature {
    position: relative;
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--speed), transform var(--speed) var(--ease);
  }
  .feature:hover { border-color: color-mix(in oklab, var(--brand) 40%, var(--border)); transform: translateY(-3px); }
  .feature::after {
    content: "";
    position: absolute;
    top: -60px; right: -60px;
    width: 170px; height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in oklab, var(--brand) 16%, transparent), transparent 70%);
    pointer-events: none;
  }
  .feature .ico {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 13px;
    background: color-mix(in oklab, var(--brand) 15%, transparent);
    color: var(--brand-bright);
    margin-bottom: 1rem;
    border: 1px solid color-mix(in oklab, var(--brand) 30%, transparent);
  }
  .feature h3 { font-size: 1.2rem; margin-bottom: .3rem; }
  .feature .tag { font-size: .8rem; font-weight: 700; color: var(--brand-bright); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .55rem; }
  .feature p { color: var(--text-2); font-size: .95rem; }

  /* Steps */
  .steps { counter-reset: step; display: flex; flex-direction: column; gap: 0; margin-top: 1.5rem; }
  .step {
    counter-increment: step;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 1.1rem;
    padding: 1.15rem 0;
    position: relative;
  }
  .step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 21px; top: 54px; bottom: -8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--brand), transparent);
    opacity: .35;
  }
  .step::after {
    content: counter(step);
    grid-column: 1;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    font-weight: 800;
    color: var(--brand-bright);
    z-index: 1;
  }
  .step .txt { grid-column: 2; grid-row: 1; padding-top: .45rem; }
  .step .txt p { color: var(--text-2); font-size: .97rem; }

  /* Markets */
  .markets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .9rem;
    margin-top: 1.5rem;
  }
  .market {
    display: flex; align-items: center; gap: .7rem;
    padding: .95rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 650;
    font-size: .94rem;
    transition: border-color var(--speed), transform var(--speed) var(--ease);
  }
  .market:hover { border-color: var(--brand); transform: translateY(-2px); }
  .market .flag { font-size: 1.45rem; }
  .market .cur { margin-left: auto; font-size: .74rem; color: var(--text-3); font-weight: 700; }

  /* Section headers */
  .section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
  .section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
  .section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.025em; }
  .section-head .sub { color: var(--text-2); margin-top: .35rem; }

  /* ------------------------------------------------------------- Listing pg */
  .listing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.6rem;
    align-items: start;
    margin-top: 1.5rem;
  }
  .listing-layout.layout-wide { grid-template-columns: minmax(0, 1fr) 380px; }
  /* Grid items must be allowed to shrink below their min-content (tables,
     ledger rows) or one wide child drags the whole page into horizontal
     scroll on a phone. */
  .listing-layout > * { min-width: 0; }
  @media (max-width: 940px) {
    .listing-layout,
    .listing-layout.layout-wide { grid-template-columns: minmax(0, 1fr); }
  }

  .gallery { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
  .gallery .main { aspect-ratio: 4 / 3; position: relative; }
  .gallery .main img { width: 100%; height: 100%; object-fit: cover; }
  .gallery .main .noimg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--text-3);
    background:
      radial-gradient(120% 90% at 20% 0%, color-mix(in oklab, var(--brand) 14%, transparent), transparent 60%),
      var(--surface-3);
  }
  .gallery .thumbs { display: flex; gap: .5rem; padding: .6rem; background: var(--surface); overflow-x: auto; }
  .gallery .thumbs button {
    width: 68px; height: 52px;
    border-radius: 8px; overflow: hidden;
    border: 2px solid transparent;
    opacity: .6;
    transition: all var(--speed);
    flex: none;
  }
  .gallery .thumbs button.on { border-color: var(--brand); opacity: 1; }
  .gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }

  .offer-panel { position: sticky; top: calc(var(--nav-h) + 14px); display: flex; flex-direction: column; gap: 1rem; }
  @media (max-width: 940px) { .offer-panel { position: static; } }
  .offer-panel .price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
  .offer-panel .big-price { font-size: 2rem; font-weight: 850; letter-spacing: -0.03em; }

  .tabs { display: flex; gap: .3rem; background: var(--surface-2); padding: .3rem; border-radius: var(--radius-pill); border: 1px solid var(--border); }
  .tabs button {
    flex: 1;
    padding: .5rem 1rem;
    border-radius: var(--radius-pill);
    font-size: .88rem; font-weight: 650;
    color: var(--text-2);
    transition: all var(--speed);
  }
  .tabs button.on { background: var(--bg-raised); color: var(--text); box-shadow: var(--shadow-sm); }

  /* ------------------------------------------------------------- Escrow UI */
  .escrow-track { display: flex; flex-direction: column; gap: 0; }
  .escrow-node {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: .9rem;
    position: relative;
    padding-bottom: 1.15rem;
  }
  .escrow-node:last-child { padding-bottom: 0; }
  .escrow-node::before {
    content: "";
    position: absolute;
    left: 14px; top: 30px; bottom: 0;
    width: 2px;
    background: var(--border);
  }
  .escrow-node:last-child::before { display: none; }
  .escrow-node.done::before { background: var(--brand); opacity: .5; }
  .escrow-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2);
    border: 2px solid var(--border-strong);
    font-size: .8rem;
    z-index: 1;
    transition: all .4s var(--ease);
  }
  .escrow-node.done .escrow-dot { background: var(--brand); border-color: var(--brand-bright); color: var(--brand-ink); }
  .escrow-node.current .escrow-dot {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 22%, transparent);
    animation: pulse 2s var(--ease) infinite;
  }
  .escrow-node .lbl { font-weight: 650; font-size: .94rem; padding-top: .2rem; }
  .escrow-node .desc { font-size: .83rem; color: var(--text-3); }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 22%, transparent); }
    50% { box-shadow: 0 0 0 7px color-mix(in oklab, var(--brand) 10%, transparent); }
  }

  .money-held {
    text-align: center;
    padding: 1.2rem;
    border-radius: var(--radius);
    background: linear-gradient(180deg, color-mix(in oklab, var(--brand) 13%, var(--surface)), var(--surface));
    border: 1px solid color-mix(in oklab, var(--brand) 35%, transparent);
  }
  .money-held .amt { font-size: 1.9rem; font-weight: 850; letter-spacing: -0.03em; color: var(--brand-bright); }
  .money-held .lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 700; }

  /* ---------------------------------------------------------------- Ledger */
  .ledger-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
  .ledger-table th {
    text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-3); padding: .6rem .75rem; border-bottom: 1px solid var(--border);
    font-weight: 700;
  }
  .ledger-table td { padding: .7rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
  .ledger-table tr:last-child td { border-bottom: none; }
  .ledger-table .amt { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .ledger-table .pos { color: var(--brand-bright); }
  .ledger-table .neg { color: var(--text); }
  .table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .card, .stack { min-width: 0; }

  /* ----------------------------------------------------------------- Chat */
  .chat { display: flex; flex-direction: column; gap: .7rem; max-height: 340px; overflow-y: auto; padding: .25rem; }
  .bubble {
    max-width: 82%;
    padding: .6rem .9rem;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: .92rem;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
  }
  .bubble.mine { align-self: flex-end; background: color-mix(in oklab, var(--brand) 16%, var(--surface)); border-color: color-mix(in oklab, var(--brand) 30%, transparent); border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
  .bubble .meta { display: block; font-size: .7rem; color: var(--text-3); margin-top: .3rem; }

  /* -------------------------------------------------------------- Skeletons */
  .skeleton {
    background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface-3) 50%, var(--surface-2) 60%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: var(--radius-sm);
  }
  @keyframes shimmer { to { background-position: -200% 0; } }

  /* ------------------------------------------------------------------ Misc */
  .empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-3);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
  }
  .empty .big { font-size: 2.2rem; margin-bottom: .5rem; }

  .kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; font-size: .9rem; }
  .kv dt { color: var(--text-3); }
  .kv dd { margin: 0; text-align: right; font-weight: 600; }

  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
  .split.split-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .split.split-wide-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .split > * { min-width: 0; }
  @media (max-width: 760px) {
    .split,
    .split.split-wide,
    .split.split-wide-r { grid-template-columns: minmax(0, 1fr); }
  }

  .admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
  .admin-layout > * { min-width: 0; }
  @media (max-width: 880px) { .admin-layout { grid-template-columns: minmax(0, 1fr); } }
  /* Console sidebar — grouped shell */
  .admin-nav {
    display: flex; flex-direction: column; gap: .9rem;
    position: sticky; top: calc(var(--nav-h) + 14px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .9rem .7rem;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - var(--nav-h) - 34px);
    overflow-y: auto;
  }
  .admin-nav-group { display: flex; flex-direction: column; gap: .1rem; }
  /* The wrapper is layout-transparent on desktop; ≤880px it becomes the
     collapsible chip drawer behind .admin-nav-toggle (see the media block). */
  .admin-nav-menu { display: contents; }
  .admin-nav-toggle { display: none; }
  .admin-nav-label {
    font-size: .66rem; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: var(--text-3);
    padding: .35rem .85rem .25rem;
  }
  .admin-nav a {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .9rem; font-weight: 600;
    color: var(--text-2);
    transition: background var(--speed), color var(--speed), transform var(--speed);
  }
  .admin-nav a .ico { width: 1.1rem; text-align: center; flex: none; opacity: .85; }
  .admin-nav a .arrow { margin-left: auto; opacity: .5; }
  .admin-nav a .count {
    margin-left: auto;
    min-width: 20px; text-align: center;
    padding: .05rem .4rem; border-radius: var(--radius-pill);
    background: color-mix(in oklab, var(--brand) 18%, transparent);
    color: var(--brand-bright); font-size: .72rem; font-weight: 800;
  }
  .admin-nav a:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
  .admin-nav a.active {
    background: color-mix(in oklab, var(--brand) 14%, transparent);
    color: var(--brand-bright);
    box-shadow: inset 2px 0 0 var(--brand-bright);
  }
  @media (max-width: 880px) {
    /* The console rail collapses to one toggle bar; opening it reveals the
       same chips wrapped underneath. app.js flips .is-open + aria-expanded,
       and the partial's noscript block keeps the rail open without JS. */
    .admin-nav { display: flex; flex-direction: column; gap: .45rem; position: static; max-height: none; padding: .6rem; }
    .admin-nav-toggle {
      display: flex; align-items: center; gap: .5rem; width: 100%;
      padding: .45rem .8rem; font: inherit; font-size: .82rem; font-weight: 700;
      color: var(--text); background: var(--surface-2);
      border: 1px solid var(--border); border-radius: var(--radius-pill);
      cursor: pointer; appearance: none; -webkit-appearance: none;
    }
    .admin-nav-toggle .ico { margin-left: auto; display: grid; place-items: center; color: var(--text-3); transition: transform var(--speed); }
    .admin-nav.is-open .admin-nav-toggle .ico { transform: rotate(180deg); }
    .admin-nav-where { color: var(--text-3); font-weight: 600; }
    .admin-nav-toggle:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 2px; }
    .admin-nav-menu { display: none; flex-wrap: wrap; gap: .35rem; }
    .admin-nav.is-open .admin-nav-menu { display: flex; }
    .admin-nav-group { display: contents; }
    .admin-nav-label { display: none; }
    .admin-nav a { padding: .4rem .7rem; font-size: .82rem; }
    .admin-nav a:hover { transform: none; }
    .admin-nav a.active { box-shadow: none; }
  }

  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
  .stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
  }
  .stat .v { font-size: 1.55rem; font-weight: 820; letter-spacing: -0.02em; }
  .stat .k { font-size: .74rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
  .stat.good .v { color: var(--brand-bright); }
  .stat.bad .v { color: var(--danger); }

  /* Workforce month calendar (/hours) */
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
  .cal-grid .hd {
    text-align: center; font-size: .68rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; color: var(--text-3);
  }
  .cal-d {
    position: relative; display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1; border-radius: var(--radius-xs);
    font-size: .78rem; font-weight: 650; font-variant-numeric: tabular-nums;
    color: var(--text-2); background: color-mix(in oklab, var(--text-3) 9%, transparent);
    border: 1px solid transparent;
  }
  .cal-d.worked {
    background: var(--ok-bg); color: var(--brand-bright);
    border-color: color-mix(in oklab, var(--brand) 45%, transparent);
  }
  .cal-d.absent {
    background: color-mix(in oklab, var(--danger) 13%, transparent); color: var(--danger);
    border-color: color-mix(in oklab, var(--danger) 40%, transparent);
  }
  .cal-d.incomplete {
    background: var(--warn-bg); color: var(--warn);
    border-color: color-mix(in oklab, var(--warn) 40%, transparent);
  }
  .cal-d.holiday {
    background: var(--info-bg); color: var(--info);
    border-color: color-mix(in oklab, var(--info) 35%, transparent);
  }
  .cal-d.pending {
    background: transparent; border: 1px dashed var(--text-3); color: var(--text-3);
  }
  .cal-d.nonwork { background: transparent; color: var(--text-3); opacity: .5; }
  .cal-d.today { outline: 2px solid var(--brand); outline-offset: 1px; }
  .cal-d .dot {
    position: absolute; right: 4px; bottom: 4px; width: 5px; height: 5px;
    border-radius: 50%; background: currentColor;
  }
  .cal-dot {
    display: inline-block; width: .55rem; height: .55rem;
    border-radius: 50%; vertical-align: -1px;
  }

  /* Live assist score dial */
  .assist { display: flex; flex-direction: column; gap: .7rem; }
  .assist .dial { display: flex; align-items: center; gap: .9rem; }
  .assist .ring {
    --p: 0;
    width: 58px; height: 58px;
    border-radius: 50%;
    flex: none;
    background: conic-gradient(var(--brand-bright) calc(var(--p) * 1%), var(--surface-3) 0);
    display: grid;
    place-items: center;
    transition: background .5s var(--ease);
  }
  .assist .ring::before {
    content: attr(data-score);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--surface);
    display: grid; place-items: center;
    font-size: .82rem; font-weight: 800;
  }
  .assist ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
  .assist li { font-size: .84rem; display: flex; gap: .5rem; align-items: flex-start; color: var(--text-2); }
  .assist li::before { content: "•"; color: var(--text-3); font-weight: 900; }
  .assist li.error::before { content: "!"; color: var(--danger); }
  .assist li.warn::before { content: "!"; color: var(--warn); }
  .assist li.tip::before { content: "→"; color: var(--info); }
  .assist li.good::before { content: "✓"; color: var(--brand-bright); }

  /* Footer */
  .site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-raised);
    padding: 3rem 0 6rem;
    margin-top: 3rem;
    font-size: .9rem;
    color: var(--text-2);
  }
  @media (min-width: 880px) { .site-footer { padding-bottom: 3rem; } }
  .site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 2rem; }
  .site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: .7rem; }
  .site-footer a { display: block; padding: .22rem 0; color: var(--text-2); transition: color var(--speed); }
  .site-footer a:hover { color: var(--brand-bright); }
  .site-footer .fine { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }

  /* Verify banner strip */
  .strip {
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    padding: .8rem 1.1rem;
    background: var(--info-bg);
    border: 1px solid color-mix(in oklab, var(--info) 30%, transparent);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--text);
  }
  .strip.warn { background: var(--warn-bg); border-color: color-mix(in oklab, var(--warn) 35%, transparent); }
  .strip.danger { background: var(--danger-bg); border-color: color-mix(in oklab, var(--danger) 35%, transparent); }
  .strip.ok { background: var(--ok-bg); border-color: color-mix(in oklab, var(--brand) 35%, transparent); }

  /* Dialogs (native <dialog>) */
  dialog {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-raised);
    color: var(--text);
    padding: 1.6rem;
    width: min(480px, calc(100vw - 2rem));
    box-shadow: var(--shadow-lg);
  }
  dialog::backdrop { background: rgb(0 0 0 / .6); backdrop-filter: blur(3px); }
  dialog form.stack { margin-top: 1rem; }

  /* Reduced motion: honour the user, not the demo. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ===========================================================================
   Console richness + site-wide polish
   =========================================================================== */

/* — Console tables: calmer rows, clearer headers — */
.ledger-table thead th {
  font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 800;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.ledger-table tbody tr:nth-child(even) { background: color-mix(in oklab, var(--surface-2) 55%, transparent); }
.ledger-table tbody tr:hover { background: color-mix(in oklab, var(--brand) 6%, transparent); }

/* — Grant chips on Members — */
.tag.mono {
  padding: .12rem .5rem; border-radius: var(--radius-pill);
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: .7rem; color: var(--text-2);
}

/* — Hidden review rows read as demoted — */
.is-hidden-row { opacity: .68; }
.is-hidden-row:hover { opacity: 1; transition: opacity var(--speed); }

/* — Buttons: a touch more presence — */
.btn { transition: transform var(--speed), box-shadow var(--speed), background var(--speed), border-color var(--speed), color var(--speed); }
@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }
}
.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: none;
}
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 4px 14px color-mix(in oklab, var(--brand) 32%, transparent); }
.btn-danger:hover { box-shadow: 0 4px 14px color-mix(in oklab, var(--danger) 30%, transparent); }

/* — Cards lift a hair on pointer devices — */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card { transition: border-color var(--speed), box-shadow var(--speed); }
  .card:hover { border-color: color-mix(in oklab, var(--brand) 22%, var(--border)); }
  .listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
}

/* — Inputs read as editable — */
.input { transition: border-color var(--speed), box-shadow var(--speed); }
.input:focus {
  border-color: color-mix(in oklab, var(--brand) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 16%, transparent);
  outline: none;
}

/* — Section headings in the console — */
.section-head h2 { letter-spacing: -0.02em; }
.section-head h3 { font-size: 1.02rem; font-weight: 800; }

/* — Stat cards: label/value rhythm + accent stripe — */
.stat { position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--brand) 45%, transparent));
  opacity: .6;
}
.stat.bad::after { background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--danger) 55%, transparent)); }

/* — Toasts sit clear of the bottom nav on phones — */
@media (max-width: 880px) {
  .toasts { bottom: calc(var(--bottomnav-h, 64px) + 12px); }
}

/* ===========================================================================
   Listing form steps · dispute workspace · SLA timers
   =========================================================================== */

/* — Numbered step heads on the list-an-item cards — */
.card-head h3 { display: flex; align-items: center; gap: .55rem; }
.step-num {
  display: inline-grid; place-items: center;
  width: 1.7rem; height: 1.7rem; flex: none;
  border-radius: 50%;
  background: color-mix(in oklab, var(--brand) 18%, transparent);
  color: var(--brand-bright);
  font-size: .85rem; font-weight: 850;
}

/* — Photo dropzone — */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-align: center;
  background: color-mix(in oklab, var(--surface-2) 60%, transparent);
  transition: border-color var(--speed), background var(--speed);
}
.dropzone:hover { border-color: color-mix(in oklab, var(--brand) 45%, var(--border-strong)); }
.dropzone input[type="file"] { border: 0; background: transparent; padding: 0; }

/* — SLA timer bar — */
.sla-track {
  height: 8px; border-radius: var(--radius-pill);
  background: var(--surface-3); overflow: hidden;
}
.sla-bar {
  height: 100%; width: 0;
  border-radius: var(--radius-pill);
  background: var(--brand);
  transition: width 1s linear, background var(--speed);
}

/* — Evidence panes: buyer vs seller side by side — */
.ev-pane {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem;
  background: var(--surface-2);
  min-width: 0;
}
.ev-pane.ev-buyer { border-left: 3px solid var(--info); }
.ev-pane.ev-seller { border-left: 3px solid var(--warn); }
.ev-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ev-item {
  margin-top: .6rem; padding: .6rem .7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ===========================================================================
   Header controls ported from the old thread: the currency converter chip
   and the sun/moon theme toggle.
   =========================================================================== */
.currency-select {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  height: 2.25rem;
  padding: 0 .5rem 0 .625rem;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in oklab, var(--brand) 35%, var(--border));
  background: color-mix(in oklab, var(--brand) 8%, transparent);
  color: var(--text-2);
  font-size: .75rem;
  font-weight: 650;
  cursor: pointer;
  transition: color var(--speed), border-color var(--speed), background var(--speed);
}
.currency-select:hover {
  color: var(--text);
  border-color: var(--brand);
  background: color-mix(in oklab, var(--brand) 14%, transparent);
}
.currency-select .fx-globe { display: inline-flex; color: var(--brand-bright); }
.currency-select select {
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
  max-width: 7rem;
}
.currency-select select option {
  background: var(--surface);
  color: var(--text);
}

/* Second line under a converted price: what the seller actually asked for. */
.price-alt { font-size: .74rem; margin-top: .1rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  transition: color var(--speed), border-color var(--speed);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-3); }
/* Destination-style icons: anything that is not dark renders the light look,
   so it offers the moon (back to dark); dark offers the sun (back to light). */
.theme-icon-moon { display: block; }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }

/* ===========================================================================
   SwapR AI widget — floating assistant, branded as SwapR's own
   =========================================================================== */
.ai-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--bottomnav-h, 62px) + .9rem);
  z-index: 75;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 2.9rem;
  padding: 0 1.05rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-size: .88rem;
  font-weight: 750;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgb(0 0 0 / .45), 0 0 0 0 color-mix(in oklab, var(--brand) 55%, transparent);
  transition: transform var(--speed), box-shadow var(--speed), background var(--speed);
}
.ai-fab:hover { background: var(--brand-hover); transform: translateY(-2px); }
.ai-fab svg { flex: none; }
@media (min-width: 880px) { .ai-fab { bottom: 1.4rem; right: 1.4rem; } }

.ai-panel[hidden] { display: none; }
.ai-panel {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--bottomnav-h, 62px) + .9rem + 2.9rem + .7rem);
  z-index: 76;
  width: min(23rem, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg-raised) 94%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) * 1.4);
  box-shadow: 0 24px 70px rgb(0 0 0 / .55);
  overflow: hidden;
  max-height: min(32rem, calc(100vh - var(--bottomnav-h, 62px) - 6.5rem));
}
@media (min-width: 880px) {
  .ai-panel { right: 1.4rem; bottom: 1.4rem + 2.9rem; bottom: calc(1.4rem + 2.9rem + .7rem); max-height: min(34rem, calc(100vh - 7rem)); }
}

.ai-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem .9rem;
  background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 16%, var(--surface)), var(--surface));
  border-bottom: 1px solid var(--border);
}
.ai-avatar {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
}
.ai-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ai-id strong { font-size: .92rem; letter-spacing: -.01em; }
.ai-id .xs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}
.ai-close:hover { background: var(--surface-3); color: var(--text); }

.ai-msgs {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .9rem;
  overflow-y: auto;
  flex: 1;
  min-height: 12rem;
}
.ai-msg {
  max-width: 88%;
  padding: .55rem .8rem;
  border-radius: 14px;
  font-size: .87rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-msg.bot {
  align-self: flex-start;
  background: var(--surface-3);
  color: var(--text);
  border-bottom-left-radius: 5px;
}
.ai-msg.me {
  align-self: flex-end;
  background: var(--brand);
  color: var(--brand-ink);
  border-bottom-right-radius: 5px;
}
.ai-msg.err { background: var(--danger-bg); color: var(--danger); align-self: stretch; max-width: 100%; }
.ai-msg.typing { display: inline-flex; gap: 5px; align-items: center; }
.ai-msg.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: ai-blink 1.1s infinite;
}
.ai-msg.typing i:nth-child(2) { animation-delay: .18s; }
.ai-msg.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes ai-blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ai-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.ai-chip {
  border: 1px solid color-mix(in oklab, var(--brand) 40%, var(--border));
  background: color-mix(in oklab, var(--brand) 8%, transparent);
  color: var(--brand-bright);
  border-radius: var(--radius-pill);
  padding: .34rem .7rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--speed), border-color var(--speed);
}
.ai-chip:hover { background: color-mix(in oklab, var(--brand) 18%, transparent); border-color: var(--brand); }

.ai-form {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  padding: .7rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.ai-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .88rem;
  line-height: 1.45;
  padding: .55rem .7rem;
  max-height: 7rem;
  outline: none;
  transition: border-color var(--speed);
}
.ai-form textarea:focus { border-color: var(--brand); }
.ai-send {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  flex: none;
  border: none;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  cursor: pointer;
  transition: background var(--speed), transform var(--speed);
}
.ai-send:hover { background: var(--brand-hover); transform: scale(1.06); }
.ai-send[disabled] { opacity: .5; cursor: default; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ai-fab, .ai-send { transition: none; transform: none; }
  .ai-msg.typing i { animation: none; opacity: .6; }
}

/* --- Guided first-login tour banner -------------------------------------- */
.tour {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px));
  z-index: 110;
  background: color-mix(in oklab, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in oklab, var(--brand) 45%, var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px 13px;
  animation: tour-in .32s var(--ease);
}
@keyframes tour-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.tour-top { display: flex; align-items: center; gap: .7rem; }
.tour-badge {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand);
}
.tour-count {
  margin-left: auto;
  font-size: .74rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.tour-x {
  background: none;
  border: 0;
  color: var(--text-3);
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  padding: .25rem .45rem;
  border-radius: var(--radius-xs);
}
.tour-x:hover { color: var(--text); background: var(--surface-3); }
.tour-chain { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.tour-chain:empty { display: none; }
.tour-chip {
  font-size: .66rem;
  letter-spacing: .08em;
  font-weight: 700;
  padding: .24rem .58rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-3);
  background: var(--surface-2);
  white-space: nowrap;
  transition: all var(--speed) var(--ease);
}
.tour-chip.done {
  color: var(--ok);
  border-color: color-mix(in oklab, var(--brand) 35%, var(--border));
  background: var(--ok-bg);
}
.tour-chip.on {
  color: var(--brand-ink);
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 25%, transparent);
}
.tour-title { margin: .55rem 0 .15rem; font-size: 1.02rem; }
.tour-text { margin: 0; color: var(--text-2); font-size: .9rem; line-height: 1.55; }
.tour-foot { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }
.tour-dots { display: flex; gap: .32rem; align-items: center; }
.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--border-strong);
  cursor: pointer;
  transition: transform var(--speed) var(--ease), background var(--speed);
}
.tour-dot.past { background: color-mix(in oklab, var(--brand) 55%, var(--border)); }
.tour-dot.on { background: var(--brand); transform: scale(1.4); }
.tour-actions { margin-left: auto; display: flex; gap: .5rem; }
.tour-spot {
  outline: 3px solid color-mix(in oklab, var(--brand) 80%, transparent);
  outline-offset: 3px;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 0 0 8px color-mix(in oklab, var(--brand) 14%, transparent);
}
@media (max-width: 640px) {
  .tour { top: calc(var(--nav-h) + 8px); padding: 12px 14px 11px; }
  .tour-title { font-size: .95rem; }
  .tour-text { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tour { animation: none; }
  .tour-chip, .tour-dot { transition: none; }
}

/* --- Payment rails: gateway picker, charge preview, console cards --------- */
.gw-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.gw-opt {
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .55rem .65rem; cursor: pointer;
  background: var(--surface-2);
  transition: border-color var(--speed) var(--ease), background var(--speed);
}
.gw-opt:hover { border-color: var(--border-strong); }
.gw-opt:has(input:checked) {
  border-color: color-mix(in oklab, var(--brand) 65%, transparent);
  background: var(--ok-bg);
}
.gw-opt input { accent-color: var(--brand); margin: 0; }
.gw-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.gw-name { font-size: .85rem; font-weight: 650; display: flex; align-items: center; gap: .35rem; }
.gw-cur {
  font-size: .62rem; font-weight: 700; letter-spacing: .06em;
  padding: .05rem .35rem; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
}
.gw-eg { font-size: .74rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
#topup-preview { min-height: 1.1em; }
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.gw-card.gw-off { opacity: .78; }
.gw-card.gw-new { border-style: dashed; border-color: color-mix(in oklab, var(--brand) 40%, var(--border)); }
.gw-flag { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text-2); cursor: pointer; }
.gw-flag input { accent-color: var(--brand); }
table.dim-row td { opacity: .75; }

/* --- Header2.0: dropdowns, icons, countdown, marquee, footer brand ------- */
.hide-sm { }
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
}
/* Header density — the bar is a single nowrap flex row, so chrome is shed
   in steps before it can ever overflow: tablets lose the listing CTA, and
   everything under a full laptop also loses the name, currency and palette. */
.hide-md { }
.hide-lg { }
@media (max-width: 1024px) { .hide-md { display: none !important; } }
@media (max-width: 1280px) { .hide-lg { display: none !important; } }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0 !important; }
.dot-badge {
  position: absolute; top: 2px; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill); background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 800; line-height: 16px; text-align: center;
  border: 2px solid var(--bg);
}

/* Dropdown shell — hover on pointers, click/keyboard everywhere */
.h-drop { position: relative; display: inline-flex; }
.h-drop > button.navlink, .h-drop > .user-btn { display: inline-flex; align-items: center; gap: .35rem; }
.h-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 90;
  min-width: 230px; padding: .4rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; gap: 1px;
  animation: pop-in .16s var(--ease);
}
.h-pop-right { left: auto; right: 0; }
.h-drop.open > .h-pop, .h-drop:focus-within > .h-pop { display: flex; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.h-pop a, .h-pop .up-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .65rem; border-radius: 9px;
  font-size: .88rem; font-weight: 560; color: var(--text-2); cursor: pointer;
  text-decoration: none; white-space: nowrap; width: 100%; text-align: left;
}
.h-pop a:hover, .h-pop .up-item:hover { background: var(--surface-3); color: var(--text); }
.h-sep { height: 1px; background: var(--border); margin: .3rem .4rem; }
.up-label { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: .35rem .65rem .2rem; }
.up-danger:hover { background: var(--danger-bg) !important; color: var(--danger) !important; }
.up-head { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem .6rem; border-bottom: 1px solid var(--border);
  margin-bottom: .3rem; min-width: 250px; }
.up-head strong { font-size: .92rem; }

/* Avatar chip in the header */
.user-btn { padding: .3rem .5rem .3rem .35rem !important; border-radius: var(--radius-pill) !important;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.user-btn:hover { border-color: var(--border-strong); color: var(--text); }
.user-name { font-size: .85rem; font-weight: 650; max-width: 130px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: color-mix(in oklab, var(--brand) 24%, var(--surface-3));
  color: var(--brand-bright); font-weight: 800; font-size: .95rem;
  border: 1px solid var(--border-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 26px; height: 26px; font-size: .75rem; }
.avatar-md { width: 42px; height: 42px; font-size: 1.1rem; }
.avatar-xl { width: 78px; height: 78px; font-size: 1.9rem; }

/* Theme picker popover */
.theme-pop { min-width: 190px; }
.theme-opt { display: flex; align-items: center; gap: .6rem; padding: .5rem .65rem;
  border-radius: 9px; font-size: .88rem; font-weight: 600; color: var(--text-2); text-align: left; width: 100%; }
.theme-opt:hover { background: var(--surface-3); color: var(--text); }
.theme-opt .swatch { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.theme-opt .theme-tick { margin-left: auto; opacity: 0; color: var(--brand-bright); }
.theme-opt.on .theme-tick { opacity: 1; }
.theme-opt.on { color: var(--text); }

/* Countdown bar (festivals, sales — admin-configured) */
.cd-bar {
  display: flex; align-items: center; justify-content: center; gap: .9rem; flex-wrap: wrap;
  padding: .5rem 1rem; font-size: .86rem; text-align: center;
  background: linear-gradient(90deg, #7f1d1d, #b91c1c 50%, #7f1d1d); color: #fff;
}
.cd-bar .cd-title { display: inline-flex; align-items: center; gap: .4rem; }
.cd-timer {
  font-family: var(--mono); font-weight: 800; font-size: .95rem; letter-spacing: .04em;
  background: rgba(0,0,0,.28); padding: .18rem .6rem; border-radius: 8px;
}
.cd-msg { opacity: .92; }
@media (max-width: 640px) { .cd-msg { display: none; } }
.cd-sale   { background: linear-gradient(90deg, #7f1d1d, #dc2626 50%, #7f1d1d); }
.cd-spooky { background: linear-gradient(90deg, #3b0764, #ea580c 55%, #3b0764); }
.cd-neon   { background: linear-gradient(90deg, #0f172a, #1d4ed8 45%, #7c3aed 75%, #0f172a); }
.cd-festive{ background: linear-gradient(90deg, #14532d, #16a34a 50%, #7f1d1d 85%, #14532d); }
.cd-spooky .cd-timer, .cd-festive .cd-timer { animation: cd-pulse 2s ease-in-out infinite; }
@keyframes cd-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Scrolling marquee (admin broadcast strip) */
.mq-bar {
  display: flex; align-items: center; gap: .6rem; padding: .42rem .9rem;
  font-size: .84rem; font-weight: 600; overflow: hidden;
  background: var(--surface-2); color: var(--text-2); border-bottom: 1px solid var(--border);
}
.mq-icon { display: inline-flex; flex: none; color: var(--brand-bright); }
.mq-viewport { overflow: hidden; flex: 1; min-width: 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.mq-track { display: inline-flex; gap: 4rem; white-space: nowrap; animation: mq-scroll 36s linear infinite; padding-right: 4rem; }
.mq-bar:hover .mq-track { animation-play-state: paused; }
.mq-item a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@keyframes mq-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mq-warn { background: var(--warn-bg); color: var(--warn); border-bottom-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.mq-warn .mq-icon { color: var(--warn); }
.mq-urgent { background: var(--danger-bg); color: var(--danger); border-bottom-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.mq-urgent .mq-icon { color: var(--danger); }
.mq-success { background: var(--ok-bg); color: var(--ok); border-bottom-color: color-mix(in srgb, var(--brand) 35%, transparent); }
@media (prefers-reduced-motion: reduce) { .mq-track { animation: none; } }

/* Footer brand block */
.site-footer .f-brand { display: flex; flex-direction: column; gap: .5rem; max-width: 460px; margin-bottom: 2rem; }
.site-footer .f-tag { font-weight: 750; font-size: 1.02rem; color: var(--text); letter-spacing: -.01em; }
.site-footer .f-desc { color: var(--text-3); font-size: .87rem; line-height: 1.6; }
.site-footer .f-social { display: flex; gap: .45rem; margin-top: .35rem; }
.site-footer .f-social a {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text-2);
  background: var(--surface-2); transition: color var(--speed), border-color var(--speed), transform var(--speed);
}
.site-footer .f-social a:hover { color: var(--brand-bright); border-color: color-mix(in oklab, var(--brand) 50%, var(--border)); transform: translateY(-2px); }
.site-footer .cols a { font-size: .87rem; }

/* Shared page header (redesigned screens use this shell) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.page-head .muted { font-size: .9rem; margin-top: .25rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .35rem; border-bottom: 1px solid var(--border); margin: 0 0 1.2rem; flex-wrap: wrap; }
.tab { padding: .55rem .95rem; font-weight: 650; font-size: 14px; color: var(--text-2);
  border-bottom: 2px solid transparent; text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--brand-bright); }
.tab:hover { color: var(--text); }

/* --- Extra palettes (the old build shipped "ocean") ----------------------- */
:root[data-theme="ocean"] {
  color-scheme: dark;
  --brand: #22d3ee;
  --brand-bright: #67e8f9;
  --brand-hover: #38bdf8;
  --brand-dim: #0e7490;
  --brand-ink: #04212a;
  --bg: #06121c;
  --bg-raised: #0b1c29;
  --surface: #0b1c29;
  --surface-2: #08151f;
  --surface-3: #102634;
  --border: #12313f;
  --border-strong: #1d4557;
  --text: #e3f4fa;
  --text-2: #8fb3c2;
  --text-3: #63899a;
  --info: #7dd3fc;
  --info-bg: rgba(125, 211, 252, .12);
  --ok: var(--brand-bright);
  --ok-bg: rgba(34, 211, 238, .13);
}
:root[data-theme="sunset"] {
  color-scheme: dark;
  --brand: #fb923c;
  --brand-bright: #fdba74;
  --brand-hover: #f97316;
  --brand-dim: #c2410c;
  --brand-ink: #2a1002;
  --bg: #17100c;
  --bg-raised: #211610;
  --surface: #211610;
  --surface-2: #1a110c;
  --surface-3: #2c1d13;
  --border: #38241a;
  --border-strong: #4d3323;
  --text: #faece2;
  --text-2: #c4a491;
  --text-3: #9a7d6b;
  --info: #93c5fd;
  --info-bg: rgba(147, 197, 253, .12);
  --ok: var(--brand-bright);
  --ok-bg: rgba(251, 146, 60, .14);
}
:root[data-theme="forest"] {
  color-scheme: dark;
  --brand: #4ade80;
  --brand-bright: #86efac;
  --brand-hover: #22c55e;
  --brand-dim: #15803d;
  --brand-ink: #052e16;
  --bg: #0a140d;
  --bg-raised: #10200f;
  --surface: #10200f;
  --surface-2: #0c190d;
  --surface-3: #172c17;
  --border: #1e3a1e;
  --border-strong: #2c512c;
  --text: #e8f5e8;
  --text-2: #9dbfa1;
  --text-3: #72947a;
  --info: #93c5fd;
  --info-bg: rgba(147, 197, 253, .12);
  --ok: var(--brand-bright);
  --ok-bg: rgba(74, 222, 128, .13);
}
:root[data-theme="violet"] {
  color-scheme: dark;
  --brand: #a78bfa;
  --brand-bright: #c4b5fd;
  --brand-hover: #8b5cf6;
  --brand-dim: #6d28d9;
  --brand-ink: #1a1040;
  --bg: #100c1c;
  --bg-raised: #171129;
  --surface: #171129;
  --surface-2: #120e21;
  --surface-3: #1f1837;
  --border: #2a2148;
  --border-strong: #3a2f61;
  --text: #eeeafd;
  --text-2: #a99fce;
  --text-3: #7f76a6;
  --info: #93c5fd;
  --info-bg: rgba(147, 197, 253, .12);
  --ok: var(--brand-bright);
  --ok-bg: rgba(167, 139, 250, .15);
}
/* Non-default palettes keep the dark-style logo treatment. */
:root[data-theme="light"] .brand .main,
:root[data-theme="ocean"] .brand .main,
:root[data-theme="sunset"] .brand .main,
:root[data-theme="forest"] .brand .main,
:root[data-theme="violet"] .brand .main { display: none; }
:root[data-theme="light"] .brand .alt,
:root[data-theme="ocean"] .brand .alt,
:root[data-theme="sunset"] .brand .alt,
:root[data-theme="forest"] .brand .alt,
:root[data-theme="violet"] .brand .alt { display: block; }
.wd-dest[hidden], .wd-note[hidden] { display: none; }
