/* FAT Kassia view (#/fat) and dashboard card (js/fat.js).
   The cockpit is always in the kassia.ai palette (warm black, parchment text, amber), like a car's
   screen: the star map, Kassia travelling through Cassiopeia's sky, is its one bold element. Tabs below follow the app theme. */

.fat-view {
    --k-bg: #131311;
    --k-deep: #0c0c0a;
    --k-surface: #1c1c18;
    --k-surface-2: #26261f;
    --k-line: rgba(255, 255, 255, .10);
    --k-line-2: rgba(255, 255, 255, .16);
    --k-text: #f5f3ea;
    --k-text-2: #cbc8ba;
    --k-muted: #93907f;
    --k-amber: #f5c11e;
    --k-amber-2: #ffd23f;
    --k-amber-dim: rgba(245, 193, 30, .13);
    --k-ink: #171408;
    --k-halt: #f2564b;
    --fat-line: var(--border-color, rgba(127, 127, 127, .25));
    --fat-ink: var(--text-primary, #f5f3ea);
    --fat-quiet: var(--text-muted, #93907f);
    --fat-accent: var(--accent-color, #f5c11e);
    --fat-halt: var(--danger-color, #f85149);
    max-width: none;
    padding-bottom: 2rem;
    color: var(--fat-ink);
    font-variant-numeric: tabular-nums;
}

/* The view scrolls on its own: the page body does not (same contract as Reports and Members). */
[data-view-root="fat"] {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* --- header ---------------------------------------------------------------------------- */

.fat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.fat-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.fat-title .bi { color: var(--fat-accent); }
.fat-status { margin: 0; font-weight: 600; color: var(--fat-quiet); }
.fat-status[data-state="armed"] { color: var(--fat-accent); }
.fat-status[data-state="disengaged"] { color: var(--fat-halt); }
.fat-eligibility:empty { display: none; }
.fat-eligibility { margin-bottom: .75rem; color: var(--fat-quiet); }
.fat-eligibility ul { margin: .25rem 0 0; padding-left: 1.1rem; }

/* --- cockpit (kassia.ai palette in both app themes) ---------------------------------------- */

.fat-cockpit {
    color: var(--k-text);
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(245, 193, 30, .07), transparent 60%),
        var(--k-bg);
    border: 1px solid var(--k-line-2);
    border-radius: 24px;
    padding: 1.1rem 1.25rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.fat-cockpit .form-check-label { color: var(--k-text-2); }

/* Mode selector: one bar, three segments, a sliding amber thumb. */
.fat-profile-row { display: flex; align-items: center; justify-content: center; gap: .5rem 1.25rem; flex-wrap: wrap; }
.fat-profile {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(6.5rem, 1fr));
    width: min(30rem, 100%);
    padding: 4px;
    border-radius: 16px;
    background: var(--k-deep);
    border: 1px solid var(--k-line-2);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .6);
}
.fat-profile-thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 3);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--k-amber-2), var(--k-amber));
    box-shadow: 0 0 22px rgba(245, 193, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
    transform: translateX(100%);
    transition: transform .45s cubic-bezier(.3, 1.35, .45, 1);
}
.fat-profile-seg {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 0;
    background: none;
    color: var(--k-muted);
    font-weight: 700;
    font-size: 1rem;
    padding: .7rem .5rem;
    border-radius: 12px;
    transition: color .3s ease;
}
.fat-profile-seg .bi { font-size: 1.1rem; }
.fat-profile-seg:hover { color: var(--k-text); }
.fat-profile-seg[aria-checked="true"] { color: var(--k-ink); }
.fat-profile-seg:focus-visible { outline: 2px solid var(--k-amber-2); outline-offset: 2px; }
.fat-profile-sub { margin: 0; font-size: .85rem; color: var(--k-text-2); min-width: 12rem; }
.fat-link { border: 0; background: none; color: var(--k-amber); font-weight: 700; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.fat-profile-msg { text-align: center; color: var(--k-text-2); }
.fat-sim { display: grid; justify-items: center; gap: .2rem; margin: .1rem 0 .5rem; font-size: .88rem; }
.fat-sim .form-check { margin: 0; }
.fat-sim-tag { display: inline-block; padding: 0 .45rem; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #0f5f55; background: rgba(127, 224, 208, .35); }
.fat-sim-msg { margin: 0; max-width: 46rem; text-align: center; font-size: .78rem; color: var(--k-text-2); }

/* The checks, as a heads-up row above the road. */
.fat-drive { margin-top: 1rem; }
/* The candidate being evaluated, above the star map (js/fat.js renderNow). */
.fat-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin: 0 0 .6rem;
    padding: .55rem .8rem; border: 1px solid var(--fat-line, rgba(255,255,255,.12)); border-radius: .5rem;
    background: rgba(255,255,255,.03); }
.fat-now-label { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--fat-quiet); }
.fat-now-spread { font-weight: 700; }
.fat-now-odds { font-variant-numeric: tabular-nums; }
.fat-now-verdict.is-go { color: var(--fat-accent); font-weight: 600; }
.fat-now-verdict.is-stop { color: var(--fat-halt); font-weight: 600; }
.fat-hud { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; margin: 0 0 .6rem; padding: 0; }
.fat-hud li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .6rem;
    border-radius: 999px;
    border: 1px solid var(--k-line);
    color: var(--k-muted);
    font-size: .76rem;
    font-weight: 600;
    transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.fat-hud li.is-passed { color: var(--k-text); border-color: rgba(245, 193, 30, .45); }
.fat-hud li.is-passed .bi { color: var(--k-amber); }
.fat-hud li.is-stop { color: #fff; background: var(--k-halt); border-color: var(--k-halt); animation: fat-hud-alert 1.4s ease-out 1; }
.fat-hud li.is-go { color: var(--k-ink); background: var(--k-amber); border-color: var(--k-amber); }
@keyframes fat-hud-alert {
    0% { box-shadow: 0 0 0 0 rgba(242, 86, 75, .6); }
    100% { box-shadow: 0 0 0 12px rgba(242, 86, 75, 0); }
}

/* The star map. */
/* Star map and its instrument panel, side by side on wide screens. */
.fat-deck { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: .9rem; align-items: stretch; }
@media (max-width: 1100px) { .fat-deck { grid-template-columns: 1fr; } }
.fat-panel-gauges {
    display: flex; flex-direction: column; gap: .7rem;
    padding: .8rem .85rem; border-radius: 18px; background: var(--k-deep); border: 1px solid var(--k-line);
    font-size: .8rem; max-height: clamp(380px, 60vh, 680px); overflow-y: auto;
}
@media (max-width: 1100px) { .fat-panel-gauges { max-height: none; } }
.fat-gp-head { display: flex; align-items: baseline; justify-content: space-between; }
.fat-gp-head h4 { margin: 0; font-size: .95rem; font-weight: 800; color: var(--k-text); }
.fat-gp-asof { font-size: .72rem; color: var(--k-muted); }
.fat-gp-asof:not(:empty)::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .3rem;
    border-radius: 50%; background: #7fe0d0; box-shadow: 0 0 6px #7fe0d0; vertical-align: middle; }
.fat-gp-group h5, .fat-gp-risk h5 { margin: 0 0 .25rem; font-size: .7rem; font-weight: 700; letter-spacing: .02em; color: var(--k-muted); }
.fat-gp-group ul { list-style: none; margin: 0; padding: 0; }
.fat-gp-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "tog label value mark" "tog sub trend trend" "tog vs vs vs" "tog bar bar bar";
    align-items: baseline; column-gap: .45rem; padding: .28rem 0 .28rem .55rem; border-bottom: 1px solid var(--k-line); position: relative;
}
.fat-gp-row::before { content: ""; position: absolute; left: 0; top: .45rem; bottom: .45rem; width: 3px; border-radius: 2px; background: var(--k-line-2); }
.fat-gp-row[data-lean="up"]::before { background: rgb(90, 150, 255); }
.fat-gp-row[data-lean="down"]::before { background: rgb(214, 40, 69); }
.fat-gp-row.is-off { opacity: .55; }
.fat-gp-row.is-disabled .fat-gp-label, .fat-gp-row.is-disabled .fat-gp-value, .fat-gp-row.is-disabled .fat-gp-sub { opacity: .4; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .35); }
.fat-gp-toggle {
    grid-area: tog; align-self: center; min-width: 2.7rem; margin-right: .15rem; padding: .05rem .25rem;
    border-radius: 999px; border: 1px solid var(--k-line-2); background: transparent; cursor: pointer;
    font-size: .64rem; font-weight: 800; line-height: 1.3; color: var(--k-muted);
}
.fat-gp-toggle[data-state="on"] { color: var(--k-ink); background: var(--k-amber); border-color: var(--k-amber); }
.fat-gp-toggle[data-state="warn"] { color: #ffb347; border-color: rgba(255, 179, 71, .7); background: rgba(255, 179, 71, .12); }
.fat-gp-toggle:focus-visible { outline: 2px solid var(--k-amber-2); outline-offset: 2px; }
.fat-gp-mark.is-warn { color: #1a1206; background: #ffb347; }
.fat-gp-toggle.is-custom { box-shadow: 0 0 0 2px rgba(127, 224, 208, .55); }
.fat-gp-modeline { margin: 0; font-size: .74rem; color: var(--k-muted); }
.fat-gp-modeline b { color: var(--k-text); }
.fat-gp-reset { font-size: .72rem; margin-left: .25rem; }
.fat-gp-label { grid-area: label; color: var(--k-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fat-gp-value { grid-area: value; font-size: .86rem; font-weight: 800; color: var(--k-text); font-variant-numeric: tabular-nums; text-align: right; }
.fat-gp-sub { grid-area: sub; color: var(--k-muted); font-size: .7rem; line-height: 1.25; }
/* A gauge's bar glides to each new reading, like a car's dials; a faint tick marks where it stood at the start
   of the trend window. Lean meters fill from the centre; proximity bars fill as SPX nears the level. */
.fat-gp-bar { grid-area: bar; position: relative; height: 4px; margin-top: .3rem; border-radius: 2px; background: var(--k-line); }
.fat-gp-bar i { position: absolute; top: 0; bottom: 0; left: 0; display: block; border-radius: 2px; background: var(--k-amber);
    transition: left .9s cubic-bezier(.22, .9, .3, 1), width .9s cubic-bezier(.22, .9, .3, 1); }
.fat-gp-bar.is-lean::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--k-line-2); }
/* Right of centre (bullish, buying, up) blue; left of it crimson: the lean stripe's colours. */
.fat-gp-bar.is-lean i { background: rgb(90, 150, 255); }
.fat-gp-bar.is-lean.is-down i { background: rgb(214, 40, 69); }
.fat-gp-bar.is-near i { background: linear-gradient(90deg, rgba(245, 193, 30, .35), var(--k-amber)); }
.fat-gp-ghost { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(245, 243, 234, .45); }
.fat-gp-trend { grid-area: trend; justify-self: end; font-size: .66rem; font-weight: 700; white-space: nowrap; color: var(--k-muted);
    font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fat-gp-trend[data-tier="2"] { color: var(--k-text-2); }
.fat-gp-trend[data-tier="3"] { color: var(--k-amber); }
@media (prefers-reduced-motion: reduce) { .fat-gp-bar i { transition: none; } }
.fat-gp-mark { grid-area: mark; font-size: .62rem; font-weight: 700; padding: 0 .35rem; border-radius: 999px; }
.fat-gp-mark.is-agree { color: var(--k-ink); background: var(--k-amber); }
.fat-gp-mark.is-disagree { color: #fff; background: var(--k-halt); }
.fat-gp-mark.is-skip { color: var(--k-muted); border: 1px solid var(--k-line-2); }
/* The trade the verdict judges, right-aligned under the badge in its own row so the label keeps its width. */
.fat-gp-vs { grid-area: vs; justify-self: end; font-size: .6rem; font-weight: 600; color: var(--k-muted); white-space: nowrap; }
.fat-gp-judging { margin: .15rem 0 .1rem; font-size: .74rem; color: var(--k-text-2); }
.fat-gp-judging b { color: var(--k-text); }
.fat-gp-note, .fat-gp-empty { margin: 0; font-size: .72rem; color: var(--k-muted); }
.fat-gp-risk { padding-bottom: .55rem; border-bottom: 1px solid var(--k-line-2); }
.fat-gp-meter { position: relative; height: .55rem; border-radius: 999px; background: var(--k-line); margin: .35rem 0 .3rem; }
.fat-gp-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f5c11e, #f2564b); }
.fat-gp-meter b { position: absolute; top: -.25rem; bottom: -.25rem; width: 2px; background: var(--k-text); transform: translateX(-1px); }
.fat-gp-meter.is-hot i { box-shadow: 0 0 10px rgba(242, 86, 75, .6); }
.fat-gp-score { margin: 0; color: var(--k-text-2); }
.fat-gp-score strong { font-size: 1.1rem; color: var(--k-text); }
.fat-gp-parts { list-style: none; margin: .3rem 0 0; padding: 0; color: var(--k-muted); font-size: .72rem; }
.fat-gp-parts span { color: var(--k-text-2); font-weight: 700; }
.fat-road-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--k-deep);
    border: 1px solid var(--k-line);
}
.fat-road-svg { display: block; width: 100%; height: clamp(380px, 60vh, 680px); }
@media (max-width: 700px) { .fat-road-svg { height: auto; aspect-ratio: 520 / 460; } }
/* The HUD along the bottom of the star map, after the kassia.ai scene: two slightly transparent panels either
   side of Kassia. On phones it sits under the scene instead. */
.fat-r-hud { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.fat-r-hud > div {
    display: grid; grid-template-columns: repeat(2, minmax(6.5rem, auto)); column-gap: 1.1rem;
    padding: .45rem .85rem .5rem; border-radius: 12px; background: rgba(12, 12, 10, .7);
    border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.fat-r-hud [data-hud] { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .45rem; min-width: 0; }
.fat-r-hud-label { flex: 0 0 100%; font-size: .68rem; font-weight: 600; color: var(--k-muted); white-space: nowrap; }
.fat-r-hud b { font-family: var(--bs-font-monospace, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: .92rem;
    font-weight: 700; color: var(--k-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fat-r-hud-pnl[data-sign="pos"] { color: var(--k-amber-2, #ffd23f); }
.fat-r-hud-pnl[data-sign="neg"] { color: var(--k-halt); }
.fat-r-hud small { font-size: .62rem; color: var(--k-muted); }
.fat-r-hud-meter { align-self: center; width: 4.4rem; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.fat-r-hud-meter i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--k-amber); transition: width .9s cubic-bezier(.22, .9, .3, 1); }
@media (max-width: 700px) {
    .fat-r-hud { position: static; padding: 8px; gap: 8px; background: var(--k-deep); }
    .fat-r-hud > div { flex: 1 1 0; grid-template-columns: 1fr; row-gap: .4rem; padding: .45rem .6rem; }
    .fat-r-hud b { font-size: .85rem; }
    .fat-r-hud-meter { width: 3rem; }
}
@media (prefers-reduced-motion: reduce) { .fat-r-hud-meter i { transition: none; } }
.fat-road-svg text { font-family: inherit; }
.fat-r-label { fill: var(--k-text-2); font-size: 13px; font-weight: 600; }
.fat-r-label-strong { fill: var(--k-text); font-size: 14px; font-weight: 800; }
.fat-r-amber { fill: var(--k-amber); }
.fat-r-sim { fill: #7fe0d0; font-size: 12px; font-weight: 800; }
.fat-r-cloud { fill: #e9dcff; font-size: 11.5px; font-weight: 700; }
.fat-r-void { fill: #ffd9a0; font-size: 11.5px; font-weight: 700; }
.fat-r-edge { font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #0a0a08; stroke-width: 3px; }
.fat-r-edge-pos { fill: #cdb4ff; }
.fat-r-edge-neg { fill: #ff8a98; }
.fat-r-edge-void { fill: #ffcf8a; }
@media (max-width: 700px) { .fat-r-edge { font-size: 9px; } }
.fat-r-halt { fill: var(--k-halt); }
.fat-r-muted { fill: var(--k-muted); font-size: 12px; }
.fat-r-pill { fill: rgba(12, 12, 10, .82); stroke: var(--k-line-2); }

.fat-readout { min-height: 2.8rem; margin: .8rem .25rem .5rem; font-size: .95rem; line-height: 1.45; color: var(--k-text); text-align: center; }
.fat-readout strong { font-weight: 800; }
.fat-readout .is-stop { color: var(--k-halt); }
.fat-readout .is-go { color: var(--k-amber); }
.fat-readout-sub { color: var(--k-muted); }
.fat-readout-note { color: var(--k-amber); font-weight: 600; }
.fat-r-kassia { fill: #bcd3ff; }

/* Today's trades under the star map. */
.fat-trades { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: .6rem; margin: 0 0 .9rem; }
.fat-trades:empty { display: none; }
.fat-trade {
    display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border-radius: 14px;
    background: var(--k-surface); border: 1px solid var(--k-line-2); color: var(--k-text-2); font-size: .84rem;
}
.fat-trade.is-open { border-color: rgba(245, 193, 30, .55); box-shadow: 0 0 18px rgba(245, 193, 30, .18); }
.fat-trade-star {
    flex: none; width: 30px; height: 30px; background: #cbc8ba;
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.fat-trade.is-open .fat-trade-star { background: #ffd23f; filter: drop-shadow(0 0 6px rgba(255, 210, 63, .8)); }
.fat-trade-body { display: flex; flex-direction: column; min-width: 0; }
.fat-trade-body b { color: var(--k-text); font-weight: 800; }
.fat-trade-pnl { margin-left: auto; font-weight: 800; color: var(--k-amber); white-space: nowrap; }
.fat-trade-pnl.is-loss { color: var(--k-halt); }
.fat-now, .fat-trade-table { margin-bottom: .9rem; }
.fat-now-row { display: flex; flex-direction: column; gap: .2rem; font-size: .86rem; }
.fat-trade-list { margin: 0; padding-left: 1.1rem; font-size: .86rem; }
.fat-trades-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem 1rem; }
.fat-trades-head .fat-filter { margin-bottom: .4rem; }
.fat-trades-table th, .fat-trades-table td { white-space: nowrap; }
.fat-trades-table td.fat-target { white-space: normal; min-width: 13rem; max-width: 20rem; }
.fat-target b { display: block; }
.fat-target span { display: block; font-size: .76rem; color: var(--fat-quiet); line-height: 1.3; }
.fat-num { text-align: right; font-variant-numeric: tabular-nums; }
.fat-trade-status { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.fat-trade-status.is-opened { color: #23a058; background: rgba(46, 160, 90, .16); }
.fat-trade-status.is-closed { color: var(--fat-quiet); background: rgba(147, 144, 127, .16); }
.fat-trades-table .is-loss { color: #d23a2f; }
.fat-trades-total th, .fat-trades-total td { border-top: 2px solid var(--fat-line); border-bottom: 0; font-weight: 700; padding-top: .45rem; }
.fat-trades-total th { text-align: right; font-weight: 600; color: var(--fat-quiet); }
.fat-total-inline { display: none; }
@media (max-width: 575.98px) {
    /* The table scrolls sideways on a phone; keep the total in view at its left edge. */
    .fat-trades-total th { text-align: left; position: sticky; left: 0; }
    .fat-total-inline { display: inline; margin-left: .5rem; color: var(--fat-ink); font-weight: 700; }
    .fat-total-inline.is-loss { color: #d23a2f; }
}
.fat-trade-table .fat-trade-pnl { margin-left: .35rem; }
/* Trade history: a day, a month, or a custom range of FAT's trades. */
.fat-history { margin-bottom: .9rem; }
.fat-history-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem .9rem; margin-bottom: .5rem; }
.fat-history-field { display: inline-flex; flex-direction: column; gap: .15rem; font-size: .82rem; }
.fat-history-field[hidden] { display: none; }
.fat-history-field .form-control, .fat-history-field .form-select { min-width: 9.5rem; }
.fat-history-summary { font-size: .86rem; margin-bottom: .4rem; }
.fat-history-day th { background: rgba(147, 144, 127, .10); font-weight: 700; }
.fat-history-note { font-size: .8rem; color: var(--fat-quiet); margin: .3rem 0 0; }
.fat-cands { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.25rem; margin-top: .45rem; font-size: .84rem; color: var(--k-text-2); }
.fat-cand { font-weight: 700; margin-right: .35rem; }
.fat-cand::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: .4rem; vertical-align: 3px; }
.fat-cand-engine { color: var(--k-text); }
.fat-cand-engine::before { background: var(--k-text); }
.fat-cand-sample { color: #bcd3ff; }
.fat-cand-sample::before { background: repeating-linear-gradient(90deg, #bcd3ff 0 4px, transparent 4px 7px); }

/* Replay and the day's strip. */
.fat-scrub { display: flex; align-items: center; gap: .75rem; }
.fat-play {
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1px solid rgba(245, 193, 30, .5);
    background: var(--k-amber-dim);
    color: var(--k-amber);
    font-size: 1.25rem;
    display: grid;
    place-items: center;
}
.fat-play:focus-visible { outline: 2px solid var(--k-amber-2); outline-offset: 2px; }
.fat-play[aria-pressed="true"] { background: var(--k-amber); color: var(--k-ink); }
.fat-timeline-svg {
    display: block;
    flex: 1;
    min-width: 0;
    height: 4.25rem;
    border-radius: 12px;
    background: var(--k-deep);
    border: 1px solid var(--k-line);
    outline: none;
    cursor: pointer;
}
.fat-timeline-svg:focus-visible { box-shadow: 0 0 0 2px var(--k-amber); }
.fat-t-bar { fill: var(--k-muted); opacity: .35; }
.fat-t-bar.is-go { fill: var(--k-amber); opacity: .95; }
.fat-t-cursor { fill: var(--k-text); }
.fat-t-pick { fill: var(--k-text); font-size: 10px; font-weight: 700; }
.fat-t-now { stroke: var(--k-amber); stroke-width: 2; stroke-dasharray: 3 3; }
.fat-t-nowlabel { fill: var(--k-amber); font-size: 10px; font-weight: 700; }
.fat-t-label { fill: var(--k-muted); font-size: 10px; }
.fat-t-empty { fill: var(--k-muted); font-size: 12px; text-anchor: middle; }

/* Today, as the cockpit's bottom bar. */
.fat-today {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: .75rem 1.5rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: .9rem;
    border-top: 1px solid var(--k-line);
}
.fat-today > .fat-choice, .fat-today > .fat-msg { grid-column: 1 / -1; }
.fat-gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 0; }
.fat-gauges:empty { display: none; }
.fat-gauge dt { font-size: .74rem; font-weight: 600; color: var(--k-muted); }
.fat-gauge dt b { display: block; color: var(--k-text); font-size: .95rem; font-weight: 800; margin-top: .1rem; }
.fat-gauge dd { margin: .35rem 0 0; }
.fat-bar { display: flex; gap: 3px; height: 6px; }
.fat-bar span { flex: 1; border-radius: 3px; background: var(--k-surface-2); }
.fat-bar span.is-on { background: var(--k-amber); box-shadow: 0 0 8px rgba(245, 193, 30, .5); }
.fat-meter { position: relative; height: 6px; border-radius: 3px; background: var(--k-surface-2); overflow: hidden; }
.fat-meter i { position: absolute; inset: 0 auto 0 0; background: var(--k-amber); border-radius: 3px; }
.fat-meter s { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--k-halt); }
.fat-plan { font-size: .85rem; color: var(--k-text-2); }
.fat-plan strong { color: var(--k-text); }
.fat-rationale { margin-top: .5rem; white-space: normal; overflow-wrap: anywhere; max-width: 42rem; }
.fat-rationale[open] { min-width: min(28rem, 70vw); }
.fat-rationale summary { cursor: pointer; color: var(--k-text); }
.fat-rationale h5 { margin: .75rem 0 .25rem; font-size: .85rem; }
.fat-rationale p { white-space: pre-wrap; margin: .5rem 0; }
.fat-rationale dl { margin: .25rem 0 .5rem; }
.fat-rationale dd { margin: 0 0 .25rem 1rem; }
.fat-today-actions { justify-self: end; max-width: 30rem; }
.fat-today-hint { margin: .45rem 0 0; font-size: .8rem; color: var(--k-text-2); }
.fat-today-hint:empty { display: none; }

.fat-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.fat-today .fat-actions { margin-top: .25rem; }
.fat-btn {
    border: 1px solid var(--fat-line);
    background: transparent;
    color: var(--fat-ink);
    border-radius: 10px;
    padding: .45rem 1rem;
    font-weight: 700;
    font-size: .9rem;
}
.fat-btn:disabled { opacity: .4; }
.fat-btn:focus-visible, .fat-tab:focus-visible, .fat-chip:focus-visible, .fat-link:focus-visible { outline: 2px solid var(--fat-accent); outline-offset: 2px; }
.fat-btn-go { background: var(--fat-accent); border-color: var(--fat-accent); color: var(--accent-ink, #171408); }
.fat-btn-halt { border-color: var(--fat-halt); color: var(--fat-halt); }
.fat-cockpit .fat-btn { color: var(--k-text); border-color: var(--k-line-2); }
.fat-cockpit .fat-btn-go { background: var(--k-amber); border-color: var(--k-amber); color: var(--k-ink); box-shadow: 0 0 18px rgba(245, 193, 30, .3); }
.fat-cockpit .fat-btn-halt { border-color: var(--k-halt); color: var(--k-halt); }
.fat-choice { margin-top: .6rem; }
.fat-choice .fat-btn { margin-right: .4rem; }
.fat-msg { font-size: .85rem; margin: .5rem 0 0; }

/* --- tabs and panels (app theme) ------------------------------------------------------------- */

.fat-tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--fat-line); margin-bottom: 1rem; }
.fat-tab { border: 0; background: none; color: var(--fat-quiet); font-weight: 600; padding: .5rem 0; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.fat-tab[aria-selected="true"] { color: var(--fat-ink); border-bottom-color: var(--fat-accent); }
.fat-panel { margin-bottom: 1rem; }
.fat-filter { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; }
.fat-filter-spacer { flex: 1; }
.fat-chip { border: 1px solid var(--fat-line); background: transparent; color: var(--fat-quiet); border-radius: 999px; padding: .2rem .75rem; font-size: .82rem; font-weight: 600; }
.fat-chip[aria-pressed="true"] { color: var(--fat-ink); border-color: var(--fat-accent); }
.fat-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--fat-ink);
    --bs-table-border-color: var(--fat-line);
    font-size: .86rem;
}
.fat-table td:first-child { white-space: nowrap; color: var(--fat-quiet); }
.fat-result-go { color: var(--fat-accent); font-weight: 700; }
.fat-result-stop { color: var(--fat-quiet); }
.fat-mode-tag { font-weight: 700; }
.fat-subhead { font-size: .95rem; font-weight: 700; margin: 0 0 .5rem; }
.fat-fold, .fat-fold-static { border-top: 1px solid var(--fat-line); padding: .75rem 0; }
.fat-fold > summary { font-weight: 700; cursor: pointer; }
.fat-fold[open] > summary { margin-bottom: .75rem; }
.fat-form-grid { display: grid; grid-template-columns: minmax(12rem, max-content) minmax(8rem, 16rem); gap: .35rem .75rem; align-items: center; }
.fat-preview { margin-top: .75rem; }
.fat-preview caption { caption-side: top; font-size: .8rem; }
.fat-card-grid { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .75rem; margin: .5rem 0; font-size: .85rem; }
.fat-card-grid dt { font-weight: 600; }
.fat-card-grid dd { margin: 0; }
.fat-inbox { list-style: none; padding: 0; margin: 0; max-height: 24rem; overflow-y: auto; }
.fat-inbox li { padding: .4rem 0; border-bottom: 1px solid var(--fat-line); }
.fat-inbox li.fat-safety { font-weight: 600; }
.fat-switch-reason { display: grid; gap: .25rem; max-width: 34rem; margin-bottom: .6rem; font-size: .85rem; }
.fat-switches { display: grid; gap: .35rem; max-width: 46rem; }
.fat-sw-row { display: grid; grid-template-columns: minmax(14rem, 1fr) auto; align-items: center; gap: .3rem 1rem; padding: .35rem 0;
    border-bottom: 1px solid var(--fat-line); font-size: .9rem; }
.fat-sw-note { grid-column: 1 / -1; font-size: .76rem; color: var(--fat-quiet); }
.fat-sw-text { display: flex; gap: .4rem; }
.fat-sw-text input { min-width: 14rem; }
.fat-toggle {
    position: relative; width: 3rem; height: 1.6rem; border-radius: 999px; border: 1px solid var(--fat-line);
    background: var(--bg-tertiary, #26261f); padding: 0; transition: background .2s ease;
}
.fat-toggle::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.6rem - 6px); height: calc(1.6rem - 6px);
    border-radius: 50%; background: var(--fat-ink); transition: transform .2s ease;
}
.fat-toggle[aria-checked="true"] { background: var(--fat-accent); border-color: var(--fat-accent); }
.fat-toggle[aria-checked="true"]::after { transform: translateX(1.4rem); background: var(--accent-ink, #171408); }
.fat-toggle:disabled { opacity: .45; cursor: not-allowed; }
.fat-toggle:focus-visible { outline: 2px solid var(--fat-accent); outline-offset: 2px; }
.fat-sw-state { font-size: .8rem; color: var(--fat-quiet); margin-left: .5rem; min-width: 1.6rem; display: inline-block; }
@media (prefers-reduced-motion: reduce) { .fat-toggle, .fat-toggle::after { transition: none; } }
.fat-ops-mode { display: flex; gap: 1rem; align-items: baseline; font-size: .88rem; padding: .2rem 0; }

/* --- small screens and reduced motion ------------------------------------------------------- */

@media (max-width: 860px) {
    .fat-cockpit { padding: .9rem; border-radius: 18px; }
    .fat-today { grid-template-columns: 1fr; }
    .fat-today-actions { justify-self: stretch; }
    .fat-profile-sub { text-align: center; }
}
@media (max-width: 576px) {
    .fat-form-grid { grid-template-columns: 1fr; }
    .fat-profile { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fat-profile-seg { font-size: .9rem; padding: .6rem .25rem; }
    .fat-hud li span { display: none; }
    .fat-gauges { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .fat-profile-thumb, .fat-profile-seg, .fat-hud li { transition: none; }
    .fat-hud li.is-stop { animation: none; }
}

/* The one-time disclosure request: a quiet sheet in the cockpit palette, amber only on the action. */
.fat-disclosure-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    width: min(34rem, calc(100vw - 2rem));
    padding: 1.5rem 1.5rem 1.25rem;
    border: 1px solid var(--k-line-2);
    border-radius: 10px;
    background: var(--k-surface);
    color: var(--k-text);
}
.fat-disclosure-dialog:focus { outline: none; }
.fat-disclosure-dialog::backdrop { background: rgba(12, 12, 10, .72); }
.fat-disclosure-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .75rem; }
.fat-disclosure-text { line-height: 1.55; margin: 0 0 .9rem; color: var(--k-text); }
.fat-disclosure-note { font-size: .85rem; color: var(--k-muted); margin: 0 0 1.1rem; }
.fat-disclosure-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
/* The dialog sits outside .fat-cockpit, so its secondary button needs the sheet's light text (Not now was dark on dark). */
.fat-disclosure-dialog .fat-btn:not(.fat-btn-go) { color: var(--k-text); border-color: var(--k-line-2); }

/* "Why this decision? ›": the arrow opens a short reason; its button opens the full reasoning in a fixed,
   scrolling dialog. Text follows the app theme in the tables and the kassia.ai palette on the cockpit, so it is
   always the theme's strongest text colour, never the amber accent. */
.fat-why { margin: -.1rem .25rem .7rem; text-align: center; }
.fat-why-line {
    --why-ink: var(--fat-ink);
    --why-bg: var(--bg-secondary, #1c1c18);
    --why-line: var(--fat-line);
    --why-hover: var(--bg-hover, rgba(127, 127, 127, .18));
    font-size: .88rem;
    line-height: 1.45;
    color: var(--why-ink);
    white-space: normal;
    overflow-wrap: anywhere;
}
.fat-cockpit .fat-why-line { --why-ink: var(--k-text); --why-bg: var(--k-surface); --why-line: var(--k-line-2); --why-hover: var(--k-surface-2); }
td .fat-why-line { margin-top: .3rem; max-width: 34rem; text-align: left; }
.fat-why-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .1rem .25rem;
    border-radius: 6px;
    list-style: none;
    cursor: pointer;
    color: var(--why-ink);
}
.fat-why-toggle::-webkit-details-marker { display: none; }
.fat-why-toggle::marker { content: ''; }
.fat-why-toggle:hover { background: var(--why-hover); }
.fat-why-toggle:focus-visible, .fat-why-more:focus-visible { outline: 2px solid var(--why-ink); outline-offset: 2px; }
.fat-why-label { font-weight: 700; }
.fat-why-arrow { font-size: .8em; transition: transform .15s ease; }
.fat-why-line[open] .fat-why-arrow { transform: rotate(90deg); }
.fat-why-short {
    margin-top: .35rem;
    padding: .55rem .75rem;
    border: 1px solid var(--why-line);
    border-radius: 8px;
    background: var(--why-bg);
    color: var(--why-ink);
    text-align: left;
}
.fat-why .fat-why-short { display: inline-block; max-width: 44rem; }
.fat-why-text { margin: 0 0 .5rem; }
.fat-why-more {
    border: 1px solid var(--why-line);
    border-radius: 8px;
    background: transparent;
    color: var(--why-ink);
    padding: .25rem .7rem;
    font-size: .82rem;
    font-weight: 600;
}
.fat-why-more:hover { background: var(--why-hover); }
.fat-why-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(44rem, calc(100vw - 2rem));
    height: min(34rem, calc(100vh - 3rem));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, .16));
    border-radius: 10px;
    background: var(--bg-primary, #131311);
    color: var(--text-primary, #f5f3ea);
}
.fat-why-dialog[open] { display: flex; flex-direction: column; }
.fat-why-dialog:focus { outline: none; }
.fat-why-dialog::backdrop { background: rgba(12, 12, 10, .72); }
.fat-why-dialog-title { font-size: 1.1rem; font-weight: 600; margin: 0; padding: 1.1rem 1.5rem .8rem; border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, .16)); }
.fat-why-actions { margin: 0; padding: .75rem 1.5rem 1rem; border-top: 1px solid var(--border-color, rgba(255, 255, 255, .16)); }
.fat-why-dialog .fat-btn { color: var(--text-primary, #f5f3ea); border-color: var(--border-color, rgba(255, 255, 255, .16)); }
.fat-why-body { flex: 1 1 auto; min-height: 0; overflow-y: scroll; padding: .75rem 1.5rem 1rem; scrollbar-gutter: stable; }
.fat-why-body:focus-visible { outline: 2px solid var(--text-primary, #f5f3ea); outline-offset: -2px; }
.fat-why-note { font-size: .82rem; color: var(--text-secondary, #cbc8ba); margin: .75rem 0 0; }
.fat-why-headline { font-weight: 700; margin: 0 0 .6rem; }
.fat-why-body h5 { margin: .75rem 0 .25rem; font-size: .85rem; }
.fat-why-body p { white-space: pre-wrap; margin: .4rem 0; }
.fat-why-body dl { margin: .25rem 0 .5rem; }
.fat-why-body dd { margin: 0 0 .25rem 1rem; overflow-wrap: anywhere; }

/* An unavailable check (constitution 3.16.0): the Ignore or Pause dialog and the banner under Today. */
.fat-check-dialog { height: auto; max-height: calc(100vh - 3rem); }
.fat-check-dialog .fat-why-body { overflow-y: auto; }
.fat-check-warning { border-left: 3px solid var(--danger-color, #f85149); padding: .4rem .7rem; font-weight: 600; }

/* Live FAT (Amendment B): the level badge, the live controls under Today, and FAT Kassia's proposal dialog
   (js/sample-trades.js openFatProposal). None of it shows while FAT is on paper. */
.fat-live-badge { display: inline-block; margin-left: .5rem; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; vertical-align: middle; color: var(--k-ink, #171408); background: var(--fat-halt, #f85149); }
.fat-live { grid-column: 1 / -1; margin-top: .6rem; padding: .5rem .8rem; border: 1px solid rgba(242, 86, 75, .55); border-radius: 8px; font-size: .85rem; }
.fat-live .fat-btn { margin: .3rem .4rem 0 0; }
.fat-live-needs ul { margin: .25rem 0 .4rem; padding-left: 1.1rem; }
.fat-live-confirm-revoke { margin-top: .4rem; padding: .4rem .7rem; border-left: 3px solid var(--danger-color, #f85149); }
.fat-sms { margin-top: .6rem; }
.fat-sms .fat-form-grid { margin-top: .4rem; }
.fat-proposal-dialog { width: min(36rem, calc(100vw - 2rem)); }
.fat-proposal-countdown { font-weight: 700; margin: .25rem 0 .5rem; }
.fat-proposal-seconds { font-variant-numeric: tabular-nums; font-size: 1.25rem; color: var(--danger-color, #f85149); }
.fat-proposal-warnings { border-left: 3px solid var(--danger-color, #f85149); padding: .4rem .7rem; margin-bottom: .6rem; font-size: .85rem; }
.fat-proposal-warnings ul { margin: 0; padding-left: 1rem; }
.fat-proposal-high { font-weight: 700; }
.fat-today > .fat-checks { grid-column: 1 / -1; }
.fat-checks { margin-top: .6rem; padding: .5rem .8rem; border: 1px solid rgba(245, 193, 30, .45); border-radius: 8px; font-size: .85rem; }
.fat-checks-title { font-weight: 700; margin: 0 0 .25rem; }
.fat-checks-list { margin: 0; padding-left: 1.1rem; }
.fat-checks-state { font-weight: 600; }

/* Show or hide today's closed trades on the star map and the trade cards under it. */
.fat-closed-toggle { display: flex; justify-content: flex-end; align-items: center; gap: .4rem; margin: 0 .25rem .4rem; font-size: .85rem; color: var(--k-muted); }

/* FAT Settings sliders (2026-11-26): blue is safer, red exposes more risk; --fat-track and --fat-thumb come from fat.js. */
.fat-settings-modes { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0 .6rem; }
.fat-settings-mode[aria-selected="true"] { border-color: var(--fat-accent); color: var(--fat-accent); }
.fat-settings-mode-note { font-size: .72rem; color: var(--fat-quiet); }
.fat-slider-main { margin: .4rem 0 .6rem; padding: .55rem .7rem; border: 1px solid var(--fat-line); border-radius: .5rem; }
.fat-slider-fine > summary, .fat-slider-other > summary { font-size: .85rem; font-weight: 600; cursor: pointer; margin-top: .4rem; }
.fat-slider-row { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(10rem, 1fr) 5.5rem; gap: .2rem .75rem;
    align-items: center; padding: .25rem 0; }
.fat-slider-master .fat-slider-title { font-weight: 600; }
.fat-slider-title { margin: 0; font-size: .85rem; cursor: help; }
.fat-slider-custom { margin-left: .35rem; padding: 0 .4rem; border: 1px solid var(--fat-line); border-radius: .5rem;
    font-size: .7rem; color: var(--fat-quiet); }
.fat-slider { -webkit-appearance: none; appearance: none; width: 100%; height: .45rem; margin: .45rem 0; border-radius: 999px;
    background: var(--fat-track); cursor: pointer; }
.fat-slider:focus-visible { outline: 2px solid var(--fat-accent); outline-offset: 4px; }
.fat-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.05rem; height: 1.05rem; border-radius: 50%;
    background: var(--fat-thumb); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.fat-slider::-moz-range-thumb { width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--fat-thumb);
    border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.fat-slider::-moz-range-track { height: .45rem; border-radius: 999px; background: var(--fat-track); }
.fat-slider-value { justify-self: start; padding: .05rem .45rem; border-radius: .35rem; background: var(--fat-thumb); color: #fff;
    font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fat-slider-legend { padding: 0; }
.fat-slider-legend .fat-slider-ends { margin-top: 0; }
.fat-slider-ends { grid-column: 2; display: flex; justify-content: space-between; margin-top: -.25rem; font-size: .72rem;
    color: var(--fat-quiet); }
@media (max-width: 576px) {
    .fat-slider-row { grid-template-columns: 1fr auto; }
    .fat-slider-row .fat-slider { grid-column: 1 / -1; grid-row: 2; }
    .fat-slider-ends { grid-column: 1 / -1; }
}
@media (forced-colors: active) {
    .fat-slider { background: CanvasText; }
    .fat-slider-value { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
}
