/* ==========================================================================
   FUT Panel — admin stylesheet

   Layout is a sticky top bar over a single centred column. Everything below is
   grouped by component, and every component is built from the tokens declared
   at the top, so a palette change never needs a search-and-replace.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Surfaces, from the page backdrop up to the most raised element. */
    --bg:          #080c16;
    --bg-veil:     rgba(8, 12, 22, 0.86);
    --surface:     #111a2c;
    --surface-2:   #172236;
    --surface-3:   #1e2b43;
    --input:       #0d1524;

    --line:        #26334c;
    --line-soft:   #1c2740;

    --text:        #e9eefb;
    --text-2:      #9dafcc;
    --text-3:      #67799a;

    --brand:       #6366f1;
    --brand-2:     #8b93ff;
    --brand-ink:   #ffffff;
    --brand-soft:  rgba(99, 102, 241, 0.14);
    --brand-line:  rgba(99, 102, 241, 0.38);

    --good:        #34d399;
    --good-soft:   rgba(52, 211, 153, 0.13);
    --warn:        #fbbf24;
    --warn-soft:   rgba(251, 191, 36, 0.13);
    --bad:         #f87171;
    --bad-soft:    rgba(248, 113, 113, 0.13);
    --info:        #56ccf2;
    --info-soft:   rgba(86, 204, 242, 0.13);
    --violet:      #b39cff;
    --violet-soft: rgba(179, 156, 255, 0.13);

    --radius-xs: 6px;
    --radius-sm: 9px;
    --radius:    13px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 6px 20px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

    --nav-h: 60px;
    --gutter: 28px;
    --page-max: 1460px;

    --mono: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Consolas, ui-monospace, monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', Inter, system-ui, sans-serif;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    /* A very soft wash behind the top of the page keeps the nav from looking
       pasted onto a flat field. */
    background-image:
        radial-gradient(900px 420px at 18% -10%, rgba(99, 102, 241, 0.10), transparent 70%),
        radial-gradient(700px 380px at 92% -14%, rgba(139, 92, 246, 0.08), transparent 70%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.55;
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
    min-height: 100vh;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--brand-2);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.mono { font-family: var(--mono); font-size: 0.92em; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-3); }
.pos { color: var(--good); }
.neg { color: var(--bad); }

/* ==========================================================================
   Top navigation
   ========================================================================== */

.topnav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--bg-veil);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.topnav-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    height: var(--nav-h);
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: -0.01em;
    color: var(--text);
    flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }

.brand-mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--brand), #a855f7);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 1 1 auto;
    min-width: 0;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--brand-soft); }
.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0.75rem; right: 0.75rem; bottom: -11px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-2);
}

.nav-link .icon { flex: 0 0 auto; opacity: 0.85; }

/* A live count riding on a nav item — used for orders needing attention. */
.nav-count {
    min-width: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--bad);
    color: #2a0707;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.nav-toggle {
    display: none;
    width: 38px; height: 38px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
}

/* ==========================================================================
   Market price strip

   Lives in the top bar. The chips are readable at a glance; the panel behind
   them explains where each number came from.
   ========================================================================== */

.market { position: relative; flex: 0 0 auto; }

.market-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.55rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
}
.market-toggle:hover { background: var(--surface-3); border-color: #38496d; }
body.market-open .market-toggle { border-color: var(--brand-line); background: var(--brand-soft); }
body.market-open .market-caret { transform: rotate(180deg); }
.market-caret { transition: transform 0.18s; opacity: 0.7; }

/* The wide form: one chip per platform, read without opening anything. */
.market-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
    padding: 0.05rem 0.4rem;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-size: 0.795rem;
    white-space: nowrap;
}
.market-chip b { font-size: 0.68rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.03em; }
.market-chip.market-green  { box-shadow: inset 0 -2px 0 var(--good); }
.market-chip.market-yellow { box-shadow: inset 0 -2px 0 var(--warn); }
.market-chip.market-red    { box-shadow: inset 0 -2px 0 var(--bad); color: var(--text-3); }
.market-chip.market-gray   { color: var(--text-3); }

/* "Market" only labels the button once the chips are hidden. */
.market-label { display: none; font-weight: 570; }

.market-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 2 * var(--gutter));
    padding: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 70;
}
body.market-open .market-panel { display: block; }

.market-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line-soft);
}
.market-panel-head strong { font-size: 0.875rem; }
.market-panel-head .hint { margin-top: 0.15rem; }
.market-panel-head .btn { flex: 0 0 auto; }

.market-rows { display: flex; flex-direction: column; }

.market-row { padding: 0.7rem 0; border-bottom: 1px solid var(--line-soft); }
.market-row:last-child { border-bottom: none; }

.market-row-head { display: flex; align-items: center; gap: 0.45rem; }
.market-row-name { font-size: 0.8rem; color: var(--text-2); margin-right: auto; }
.market-row-note { margin-top: 0.35rem; font-size: 0.775rem; color: var(--text-3); }
.market-row-shared { margin-top: 0.3rem; font-size: 0.72rem; color: var(--text-3); font-style: italic; }
.market-row-head .badge-platform + .badge-platform { margin-left: -0.25rem; }

.market-row-body {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.25rem 0.7rem;
    margin-top: 0.5rem;
}
.market-price { display: flex; align-items: baseline; gap: 0.3rem; }
.market-price-value {
    font-size: 1.22rem;
    font-weight: 660;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    color: var(--good);
}
.market-price-unit { font-size: 0.72rem; color: var(--text-3); }

.market-row-meta {
    display: flex;
    flex-direction: column;
    font-size: 0.735rem;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.market-row-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
}
.market-row-actions .btn { flex: 1 1 0; }

.market-panel-foot { margin-top: 0.75rem; padding-top: 0.7rem; border-top: 1px solid var(--line-soft); }

.market-row-note.warn-note { color: var(--warn); }

/* The probe trail: collapsed by default, because it only matters when a number
   looks wrong — and then it matters a great deal. */
.probe-trail { margin-top: 0.5rem; }
.probe-trail summary {
    font-size: 0.72rem;
    color: var(--text-3);
    cursor: pointer;
    list-style: none;
}
.probe-trail summary::-webkit-details-marker { display: none; }
.probe-trail summary::before { content: '▸ '; }
.probe-trail[open] summary::before { content: '▾ '; }
.probe-trail summary:hover { color: var(--text-2); }

.probe-list {
    list-style: none;
    margin-top: 0.4rem;
    padding: 0.4rem 0.5rem;
    background: var(--input);
    border-radius: var(--radius-xs);
    max-height: 190px;
    overflow-y: auto;
}
.probe-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.1rem 0;
    font-size: 0.72rem;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.probe-list li.pos { color: var(--good); }
.probe-price { font-family: var(--mono); }
.probe-answer { text-transform: lowercase; }

/* ==========================================================================
   Page shell
   ========================================================================== */

.shell {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 1.75rem var(--gutter) 4.5rem;
}
/* Form-driven pages read badly when inputs stretch across a wide monitor. */
.shell.narrow { max-width: 1020px; }
.shell.medium { max-width: 1240px; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.45rem;
    font-weight: 680;
    letter-spacing: -0.022em;
}
.page-sub {
    margin-top: 0.2rem;
    color: var(--text-3);
    font-size: 0.855rem;
}
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.count-chip {
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 2rem 0 0.85rem;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-3);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.1rem;
    overflow: hidden;
}
.card:last-child { margin-bottom: 0; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
}
.card-header h2 { font-size: 0.9rem; font-weight: 640; letter-spacing: -0.005em; }
.card-header .hint { color: var(--text-3); font-size: 0.78rem; font-weight: 400; }

.card-body { padding: 1.15rem; }
.card-body > :last-child { margin-bottom: 0; }
.card-body.tight { padding: 0.85rem 1.15rem; }
.card-body.flush { padding: 0; }

.card-footer {
    padding: 0.8rem 1.15rem;
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.015);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-accent { border-color: var(--brand-line); }
.card-good { border-color: rgba(52, 211, 153, 0.35); }
.card-bad  { border-color: rgba(248, 113, 113, 0.35); }

/* Two-column arrangements used by the detail and editor pages. */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.grid-main > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }

/* ==========================================================================
   Stat tiles
   ========================================================================== */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}
.card-body .tiles { margin-bottom: 0; }

.tile {
    position: relative;
    padding: 0.95rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}
.card-body .tile { background: var(--surface-2); }

.tile-label {
    font-size: 0.71rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}
.tile-value {
    font-size: 1.5rem;
    font-weight: 660;
    letter-spacing: -0.028em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.tile-value.sm { font-size: 1.18rem; }
.tile-note { font-size: 0.755rem; color: var(--text-3); }

.tile.pos .tile-value { color: var(--good); }
.tile.neg .tile-value { color: var(--bad); }
.tile.accent .tile-value { color: var(--brand-2); }
.tile.info .tile-value { color: var(--info); }
.tile.warn .tile-value { color: var(--warn); }

/* A tile that is also a link to the list it summarises. */
a.tile { color: inherit; transition: border-color 0.15s, transform 0.15s; }
a.tile:hover { text-decoration: none; border-color: var(--brand-line); transform: translateY(-1px); }

/* The headline tile on a detail page: bigger, and carries the accent rail. */
.tile-hero { padding: 1.15rem 1.2rem; }
.tile-hero .tile-value { font-size: 2rem; }
.tile-hero::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--brand);
}
.tile-hero.pos::before { background: var(--good); }
.tile-hero.neg::before { background: var(--bad); }

/* ==========================================================================
   Key/value rows
   ========================================================================== */

.kv { display: flex; flex-direction: column; }
.kv-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--line-soft);
}
.kv-row:last-child { border-bottom: none; }
.kv-row.total {
    border-top: 1px solid var(--line);
    border-bottom: none;
    margin-top: 0.25rem;
    padding-top: 0.7rem;
    font-weight: 640;
}
.kv-key { color: var(--text-2); font-size: 0.83rem; }
.kv-key .sub { display: block; color: var(--text-3); font-size: 0.74rem; }
.kv-val {
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    max-width: 62%;
    word-break: break-word;
}
.kv-val.strong { font-weight: 640; }

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.735rem;
    font-weight: 620;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

.badge-green  { background: var(--good-soft);   color: var(--good);   border-color: rgba(52, 211, 153, 0.3); }
.badge-blue   { background: var(--info-soft);   color: var(--info);   border-color: rgba(86, 204, 242, 0.3); }
.badge-red    { background: var(--bad-soft);    color: var(--bad);    border-color: rgba(248, 113, 113, 0.3); }
.badge-yellow { background: var(--warn-soft);   color: var(--warn);   border-color: rgba(251, 191, 36, 0.3); }
.badge-violet { background: var(--violet-soft); color: var(--violet); border-color: rgba(179, 156, 255, 0.3); }
.badge-primary{ background: var(--brand-soft);  color: var(--brand-2);border-color: var(--brand-line); }
.badge-gray   { background: rgba(148, 163, 184, 0.12); color: var(--text-2); border-color: var(--line); }
.badge-platform { background: var(--surface-3); color: var(--text-2); border-color: var(--line); font-family: var(--mono); font-size: 0.7rem; }

.badge-lg { padding: 0.35rem 0.8rem; font-size: 0.85rem; }

/* ==========================================================================
   Progress
   ========================================================================== */

.bar {
    position: relative;
    height: 6px;
    background: var(--input);
    border-radius: var(--radius-pill);
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 40px;
}
.bar-lg { height: 9px; }
.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar-fill.good { background: linear-gradient(90deg, #10b981, var(--good)); }
.bar-fill.warn { background: linear-gradient(90deg, #d97706, var(--warn)); }
.bar-fill.bad  { background: linear-gradient(90deg, #dc2626, var(--bad)); }

.progress-cell { display: flex; align-items: center; gap: 0.55rem; min-width: 130px; }
.progress-cell .bar { max-width: 110px; }
.progress-text { font-size: 0.755rem; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.progress-block { display: flex; flex-direction: column; gap: 0.45rem; }
.progress-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.progress-meta strong { color: var(--text); font-weight: 640; }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap { width: 100%; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 0.855rem; }

.table th {
    position: sticky;
    top: 0;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 660;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td {
    padding: 0.62rem 0.75rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-strong { font-weight: 600; }
.table .col-action { width: 1%; white-space: nowrap; text-align: right; }

.row-link { cursor: pointer; transition: background 0.14s; }
.row-link:hover { background: rgba(99, 102, 241, 0.07); }

/* A left rail marking rows that need an operator's eye. */
.table tr.row-flag td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.table tr.row-hold td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.cell-title { display: flex; flex-direction: column; gap: 0.1rem; }
.cell-sub { font-size: 0.745rem; color: var(--text-3); }

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline { list-style: none; position: relative; padding: 0.25rem 0 0.25rem 0; }
.timeline::before {
    content: '';
    position: absolute;
    left: 6px; top: 12px; bottom: 12px;
    width: 1px;
    background: var(--line);
}

.tl-item { position: relative; display: flex; gap: 0.85rem; padding: 0.45rem 0; }

.tl-dot {
    position: relative;
    z-index: 1;
    flex: 0 0 13px;
    width: 13px; height: 13px;
    margin-top: 0.32rem;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--text-3);
}
.tl-primary .tl-dot { border-color: var(--brand-2); background: var(--brand-soft); }
.tl-green   .tl-dot { border-color: var(--good);   background: var(--good-soft); }
.tl-red     .tl-dot { border-color: var(--bad);    background: var(--bad-soft); }
.tl-yellow  .tl-dot { border-color: var(--warn);   background: var(--warn-soft); }
.tl-blue    .tl-dot { border-color: var(--info);   background: var(--info-soft); }
.tl-violet  .tl-dot { border-color: var(--violet); background: var(--violet-soft); }

.tl-body { flex: 1 1 auto; min-width: 0; }
.tl-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}
.tl-title { font-size: 0.855rem; font-weight: 570; }
.tl-green  .tl-title { color: var(--good); }
.tl-red    .tl-title { color: var(--bad); }
.tl-yellow .tl-title { color: var(--warn); }

.tl-time {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.tl-detail { font-size: 0.78rem; color: var(--text-3); margin-top: 0.1rem; }

/* A day divider inside the timeline. */
.tl-day {
    list-style: none;
    margin: 0.75rem 0 0.35rem 1.85rem;
    font-size: 0.7rem;
    font-weight: 680;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-3);
}
.tl-day:first-child { margin-top: 0; }

.timeline-scroll { max-height: 560px; overflow-y: auto; padding-right: 0.35rem; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 0.95rem; }
.field:last-child { margin-bottom: 0; }

.field label, .field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.79rem;
    font-weight: 580;
    color: var(--text-2);
}
.field label .req { color: var(--brand-2); }

.input, .form-input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: var(--input);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.input::placeholder, .form-input::placeholder { color: var(--text-3); }
.input:hover, .form-input:hover { border-color: #33456a; }
.input:focus, .form-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    background: #0f1829;
}
textarea.input, textarea.form-input { resize: vertical; min-height: 68px; line-height: 1.5; }
select.input, select.form-input { cursor: pointer; }

.input.num, .form-input.num { font-variant-numeric: tabular-nums; text-align: left; }

.hint { margin-top: 0.3rem; font-size: 0.755rem; color: var(--text-3); }

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.95rem;
}
.row + .row { margin-top: 0.95rem; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row .field { margin-bottom: 0; }

/* An input with a currency or unit glued to it. */
.affix {
    display: flex;
    align-items: stretch;
    background: var(--input);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color 0.14s, box-shadow 0.14s;
}
.affix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.affix .input, .affix .form-input {
    border: none;
    background: transparent;
    box-shadow: none;
    flex: 1 1 auto;
    min-width: 0;
}
.affix .input:focus { box-shadow: none; background: transparent; }
.affix-tag {
    display: grid;
    place-items: center;
    padding: 0 0.65rem;
    color: var(--text-3);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.028);
}
.affix-tag:first-child { border-right: 1px solid var(--line-soft); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.affix-tag:last-child  { border-left: 1px solid var(--line-soft);  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Segmented radio control. */
.segmented { display: inline-flex; padding: 3px; background: var(--input); border: 1px solid var(--line); border-radius: var(--radius-sm); gap: 3px; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: block;
    padding: 0.32rem 0.7rem;
    border-radius: var(--radius-xs);
    font-size: 0.795rem;
    font-weight: 570;
    color: var(--text-2);
    white-space: nowrap;
    transition: background 0.14s, color 0.14s;
}
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span { background: var(--brand); color: var(--brand-ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 1px; }

.check-list { display: flex; flex-direction: column; gap: 0.7rem; }
.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.86rem;
    color: var(--text-2);
    cursor: pointer;
}
.check input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }

.color-field { display: flex; align-items: center; gap: 0.5rem; }
.color-field input[type="color"] {
    width: 40px; height: 36px;
    padding: 2px;
    background: var(--input);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex: 0 0 auto;
}

.form-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1.25rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.845rem;
    font-weight: 560;
    line-height: 1.35;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s, border-color 0.14s, transform 0.08s, color 0.14s;
}
.btn:hover { background: var(--surface-3); border-color: #38496d; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: 0.45; pointer-events: none; }

.btn-sm { padding: 0.33rem 0.62rem; font-size: 0.79rem; }
.btn-lg { padding: 0.68rem 1.3rem; font-size: 0.93rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 620; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }

.btn-good { background: #0f7a5a; border-color: #0f7a5a; color: #fff; }
.btn-good:hover { background: #12946d; border-color: #12946d; }
.btn-warn { background: #a5620a; border-color: #a5620a; color: #fff; }
.btn-warn:hover { background: #c2740c; border-color: #c2740c; }
.btn-bad  { background: #a52222; border-color: #a52222; color: #fff; }
.btn-bad:hover { background: #c22c2c; border-color: #c22c2c; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: transparent; }

.btn-icon { padding: 0.4rem; width: 32px; height: 32px; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.855rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert:last-child { margin-bottom: 0; }
.alert-success { background: var(--good-soft); color: var(--good); border-color: rgba(52, 211, 153, 0.3); }
.alert-danger  { background: var(--bad-soft);  color: var(--bad);  border-color: rgba(248, 113, 113, 0.3); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: rgba(251, 191, 36, 0.3); }
.alert-info    { background: var(--info-soft); color: var(--info); border-color: rgba(86, 204, 242, 0.3); }

/* A banner that stretches the width of a page section. */
.notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.86rem;
    margin-bottom: 1.1rem;
}
.notice-bad { border-color: rgba(248, 113, 113, 0.35); background: var(--bad-soft); color: #ffd4d4; }
.notice-warn { border-color: rgba(251, 191, 36, 0.35); background: var(--warn-soft); color: #ffeec2; }
.notice strong { font-weight: 660; }
.notice .btn { margin-left: auto; }

/* ==========================================================================
   Filters
   ========================================================================== */

.filters {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.search {
    position: relative;
    flex: 1 1 260px;
    min-width: 200px;
}
.search .form-input { padding-left: 2.15rem; }
.search svg {
    position: absolute;
    left: 0.7rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.filters .form-input { width: auto; }
.filter-select { min-width: 145px; }
.filter-date { width: 148px; }
.filter-date::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }

.filter-dates { display: flex; align-items: center; gap: 0.4rem; }
.filter-dates label { font-size: 0.78rem; color: var(--text-3); }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--line-soft);
}
.pagination-summary { font-size: 0.8rem; color: var(--text-3); }
.pagination-summary strong { color: var(--text-2); font-variant-numeric: tabular-nums; }
.pagination-pages, .pagination-size { display: flex; align-items: center; gap: 0.28rem; flex-wrap: wrap; }

.page-btn {
    min-width: 30px;
    padding: 0.24rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
a.page-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 620; }
.page-btn.disabled { opacity: 0.4; }
.page-gap { color: var(--text-3); padding: 0 0.15rem; }
.page-info { font-size: 0.78rem; color: var(--text-3); margin-right: 0.15rem; }

/* ==========================================================================
   Empty states
   ========================================================================== */

.empty {
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--text-2);
}
.empty-icon {
    width: 44px; height: 44px;
    margin: 0 auto 0.85rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-3);
}
.empty p { margin-bottom: 1rem; font-size: 0.885rem; }
.empty-sm { padding: 1.6rem 1rem; font-size: 0.83rem; }

/* ==========================================================================
   Quote panel (create order + pricing calculator)
   ========================================================================== */

.quote-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.15rem;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), transparent 65%);
}
.quote-headline { display: flex; flex-direction: column; gap: 0.1rem; }
.quote-headline .tile-label { color: var(--brand-2); }
.quote-price {
    font-size: 2.1rem;
    font-weight: 680;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.quote-unit { font-size: 0.9rem; font-weight: 500; color: var(--text-3); margin-left: 0.3rem; }

/* The standing offer to reprice the order at what the market is doing now. */
.market-suggest {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 0.8rem;
    font-weight: 570;
    color: var(--text-2);
}
.chip-green  { border-color: rgba(52, 211, 153, 0.35); background: var(--good-soft); color: var(--good); }
.chip-yellow { border-color: rgba(251, 191, 36, 0.35); background: var(--warn-soft); color: var(--warn); }
.chip-red    { border-color: rgba(248, 113, 113, 0.35); background: var(--bad-soft); color: var(--bad); }
.chip-gray   { color: var(--text-3); }

/* The waterfall from gross sale down to profit. */
.waterfall .kv-row.deduct .kv-val { color: var(--bad); }
.waterfall .kv-row.gain .kv-val { color: var(--good); }

/* ==========================================================================
   Copy field
   ========================================================================== */

.copy-field { display: flex; gap: 0.5rem; align-items: stretch; }
.copy-field .form-input { font-size: 0.795rem; font-family: var(--mono); }

/* ==========================================================================
   Template editor
   ========================================================================== */

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.editor-preview { position: sticky; top: calc(var(--nav-h) + 1.25rem); }

.preview-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--line-soft);
}
.preview-widths { display: flex; gap: 0.35rem; }
.preview-widths .btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-ink);
}
.preview-toolbar .form-input { width: auto; min-width: 180px; }
.preview-stage {
    height: 640px;
    background: var(--input);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}
.preview-stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #111; }
.preview-stage.phone { display: grid; place-items: center; padding: 1rem 0; }
.preview-stage.phone iframe {
    width: 390px;
    max-width: 100%;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* The editor's own column: a tab strip over one panel at a time, so the form
   stays short enough to keep the preview beside it in view. */
.editor-form { display: flex; flex-direction: column; gap: 1.1rem; }

.tabbar {
    display: flex;
    gap: 0.25rem;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.815rem;
    font-weight: 570;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--brand); color: var(--brand-ink); }
.tabpanel[hidden] { display: none; }
.tabpanel { display: flex; flex-direction: column; gap: 1.1rem; }

/* Palette swatches. Each is a live sample of the four colours it applies. */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.55rem; }
.swatch {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--input);
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.14s, transform 0.14s;
}
.swatch:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.swatch.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.swatch-strip { display: flex; height: 34px; }
.swatch-strip i { flex: 1; }
.swatch-strip i:first-child { flex: 1.6; }
.swatch-name { display: block; padding: 0.35rem 0.55rem; font-size: 0.755rem; font-weight: 570; color: var(--text-2); }
.swatch.active .swatch-name { color: var(--text); }

/* Toggle switches read faster than a column of checkboxes when there are a
   dozen of them, and each carries a line explaining what it hides. */
.switch-list { display: grid; gap: 0.5rem; }
.switch {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
}
.switch:hover { border-color: var(--line); background: var(--surface-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
    position: relative;
    flex: none;
    width: 38px;
    height: 22px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    transition: background 0.16s;
}
.switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-3);
    transition: transform 0.16s, background 0.16s;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--brand-ink); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.switch-text { min-width: 0; }
.switch-title { display: block; font-size: 0.855rem; font-weight: 570; }
.switch-note { display: block; font-size: 0.755rem; color: var(--text-3); line-height: 1.4; }

/* The colour text field is the one that submits; the picker beside it is a
   convenience that writes into it. */
.color-field .form-input { font-family: var(--mono); font-size: 0.8rem; }

/* Save bar, pinned to the bottom of the form column. */
.savebar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    background: var(--bg-veil);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.savebar .status { font-size: 0.79rem; color: var(--text-3); margin-right: auto; }
.savebar .status.dirty { color: var(--warn); }

.list-editor { font-family: var(--mono); font-size: 0.78rem; line-height: 1.65; }

@media (max-width: 720px) {
    .swatches { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
    .tab { flex: 0 0 auto; }
}

/* ==========================================================================
   Login
   ========================================================================== */

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}
.login-card {
    width: 100%;
    max-width: 380px;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.25rem; }
.login-card h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.login-sub { color: var(--text-3); font-size: 0.83rem; margin-bottom: 1.5rem; }

/* ==========================================================================
   HTMX feedback
   ========================================================================== */

.htmx-indicator { opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Anything mid-request dims slightly so a slow endpoint still feels answered. */
.htmx-request.quote-panel, .quote-panel.htmx-request { opacity: 0.55; }

.spin { display: inline-flex; }
.htmx-request .spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* A pulsing dot marking a panel that refreshes itself. */
.live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-3);
}
.live::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--good);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
    .grid-main { grid-template-columns: minmax(0, 1fr); }
    .editor-grid { grid-template-columns: minmax(0, 1fr); }
    .editor-preview { position: static; }
}

/* Below this the chips stop fitting beside a full nav, so the strip becomes a
   labelled button and the numbers move into the panel. */
@media (max-width: 1400px) {
    .market-chip { display: none; }
    .market-label { display: inline; }
}

@media (max-width: 1024px) {
    :root { --gutter: 20px; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The nav collapses into a drop-down panel rather than a drawer: it keeps the
   same vertical order the bar has, so nothing has to be relearned. */
@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.6rem var(--gutter) 1rem;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-lg);
        display: none;
    }
    body.nav-open .nav-links { display: flex; }
    .nav-link { padding: 0.62rem 0.75rem; font-size: 0.92rem; }
    .nav-link.active::after { display: none; }
    .nav-link.active { background: var(--brand-soft); }
    .nav-actions .btn-label { display: none; }
}

@media (max-width: 780px) {
    .grid-2, .grid-3, .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions { justify-content: flex-start; }
    .tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .tile-value { font-size: 1.3rem; }
    .tile-hero .tile-value { font-size: 1.65rem; }
    .quote-price { font-size: 1.7rem; }
}

/* Phones: a wide table can no longer scroll comfortably, so each row becomes a
   card with its column headings inlined as labels. */
@media (max-width: 720px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr {
        padding: 0.75rem 0.9rem;
        border-bottom: 1px solid var(--line-soft);
    }
    .table-cards tr.row-flag { box-shadow: inset 3px 0 0 var(--bad); }
    .table-cards tr.row-hold { box-shadow: inset 3px 0 0 var(--warn); }
    .table-cards tr.row-flag td:first-child,
    .table-cards tr.row-hold td:first-child { box-shadow: none; }
    .table-cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.28rem 0;
        border: none;
        text-align: left;
    }
    .table-cards td.num { text-align: right; }
    .table-cards td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 0.71rem;
        font-weight: 640;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--text-3);
    }
    .table-cards td:empty { display: none; }
    .table-cards .col-action { justify-content: space-between; }
    .progress-cell { min-width: 0; flex: 1 1 auto; justify-content: flex-end; }
    .progress-cell .bar { max-width: 90px; }

    .pagination { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .filters .form-input, .filter-select, .filter-date { width: 100%; }
    .filter-dates { flex-wrap: wrap; }
    .search { flex: 1 1 100%; }
}

@media (max-width: 560px) {
    .market { position: static; }
    .market-panel {
        left: var(--gutter);
        right: var(--gutter);
        width: auto;
    }
    .market-label { display: none; }
}

@media (max-width: 480px) {
    :root { --gutter: 14px; }
    body { font-size: 14px; }
    .shell { padding-top: 1.25rem; }
    .card-body { padding: 0.95rem; }
    .btn-group .btn { flex: 1 1 auto; }
    .segmented { width: 100%; }
    .segmented label { flex: 1 1 0; }
    .segmented span { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .topnav, .page-actions, .btn { display: none !important; }
    body { background: #fff; color: #000; }
    .card { border-color: #ccc; box-shadow: none; }
}
