:root { color-scheme: light; --ink: #202b2a; --muted: #566662; --line: #d3ded8; --paper: #f5f7f1; --white: #fff; --green: #155b47; --red: #904026; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 system-ui, sans-serif; }
.shell { max-width: 1120px; padding: 40px 28px 20px; margin: auto; }
.masthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); letter-spacing: -.06em; line-height: 1.05; margin: 8px 0 10px; font-weight: 750; }
h2 { font-size: 1.25rem; margin: 0 0 12px; letter-spacing: -.025em; }
p { margin-top: 0; }
.intro, .note, footer, small { color: var(--muted); }
.intro { margin: 0; font-size: 1rem; max-width: 60ch; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; color: var(--green); margin-bottom: 8px; }
.counts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; min-width: 240px; }
.counts span { color: var(--muted); font-size: .86rem; }
button { font: inherit; border-radius: 7px; border: 1px solid #a8bcb1; padding: 9px 14px; background: var(--white); color: var(--ink); cursor: pointer; font-size: .86rem; font-weight: 650; min-height: 42px; }
button:hover { background: #e9eee7; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--green); border-color: var(--green); color: white; }
button.primary:hover { background: #0c4938; }
button.quiet { color: var(--ink); background: transparent; border-color: transparent; padding-left: 0; text-align: left; }
button.quiet:hover { text-decoration: underline; background: transparent; }
.tiny { min-height: 30px; padding: 4px 8px; font-size: .8rem; font-weight: 500; }
:focus-visible { outline: 3px solid #207d62; outline-offset: 3px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.section-heading span { font-size: .82rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); text-align: left; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { color: var(--muted); background: #edf1e9; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
tr.group th { background: #f5f7f1; color: var(--green); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; padding-top: 14px; }

.number { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.status { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); }
tr.risk-risk_on .status { color: var(--green); }
tr.risk-risk_off .status { color: var(--red); }
.up { color: var(--green); }
.down { color: var(--red); }
.brief { background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 8px 22px 16px; max-width: 80ch; margin-top: 14px; }
.brief h2 { font-size: 1rem; margin: 18px 0 6px; }
.brief p, .brief li { font-size: .95rem; }
.brief ul, .brief ol { padding-left: 22px; }
.lower-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; border-top: 1px solid var(--line); padding-top: 28px; margin-top: 36px; }
.journal { padding: 0; list-style: none; height: 225px; overflow-y: auto; margin: 0; }
.journal.tall { height: 420px; }
.journal li { display: flex; gap: 12px; padding: 8px 0; font-size: .86rem; border-bottom: 1px solid var(--line); align-items: flex-start; }
.journal li span { font: .74rem/1.8 ui-monospace, monospace; color: var(--muted); min-width: 12ch; }
.journal li div { display: flex; flex-direction: column; gap: 2px; }
.journal a { color: var(--ink); }
.error { padding: 12px 16px; background: #f8e5da; color: #792917; border-left: 3px solid #984329; margin: 0 0 16px; }
ul.error { list-style: none; font-size: .86rem; }
.connection-warning { display: none; background: #f8e5da; padding: 12px; }
.phx-disconnected .connection-warning { display: block; }
.note { font-size: .9rem; margin: 12px 0 32px; max-width: 90ch; }
section + section { margin-top: 36px; }
footer { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; font-size: .75rem; }
@media (max-width: 720px) { .shell { padding: 28px 16px 16px; } .masthead, .counts { flex-direction: column; align-items: flex-start; text-align: left; } .lower-grid { grid-template-columns: 1fr; gap: 30px; } th, td { padding: 8px 10px; } }
.clock { display: flex; gap: 10px; align-items: center; }
.clock form { display: flex; gap: 6px; align-items: center; font-size: .86rem; color: var(--muted); }
select { font: inherit; border-radius: 7px; border: 1px solid #a8bcb1; padding: 8px 10px; background: var(--white); color: var(--ink); min-height: 42px; }
.counts .note { margin: 0; font-size: .78rem; max-width: 34ch; }
.changes { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.changes li { background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 7px; padding: 8px 12px; font-size: .9rem; }
.changes li.change-shock, .changes li.change-regime { border-left-color: var(--red); }
td.shock { color: var(--red); font-weight: 700; }
td.previous { color: var(--muted); }
td:nth-child(6) { white-space: normal; }
td.wrap { white-space: normal; min-width: 18ch; font-size: .86rem; }
.direction-long { color: var(--green); }
.direction-short { color: var(--red); }
.conviction-strong { font-weight: 800; color: var(--ink); }
.conviction-weak { color: var(--muted); }
#ideas td small { margin-left: 4px; }
.nav { font-size: .86rem; color: var(--green); font-weight: 650; text-decoration: none; }
.nav:hover { text-decoration: underline; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; font-size: .8rem; color: var(--muted); }
.kpis div { background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 10px 14px; }
.kpis span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.kpis strong { display: block; font-size: 1.35rem; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpis strong.up { color: var(--green); }
.kpis strong.down { color: var(--red); }
td.in-band { font-weight: 700; }
.flag { display: inline-block; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; background: #edf1e9; color: var(--muted); }
.flag-no_stop, .flag-revenge, .flag-counter_trend, .flag-oversized { background: #f8e5da; color: #792917; }
.flag-hindsight { background: #f3ead2; color: #6b4e00; margin-left: 6px; }
/* Experimental: Jev's verdicts (Desk101.Referee). */
.flag-back { background: #e3efe0; color: #24521b; }
.flag-doubt, .flag-unfaithful { background: #f3ead2; color: #6b4e00; margin-left: 6px; }
.flag-veto { background: #f8e5da; color: #792917; }
td.referee small { display: block; color: var(--muted); margin: 4px 0 0; }
.pm-day { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.pm-day h3 { font-size: 1rem; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 12px; }
.pm-trade { background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 10px 14px; margin-bottom: 8px; font-size: .9rem; }
.pm-trade .head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.pm-trade .head .number { font-size: .8rem; color: var(--muted); }
.pm-trade .head strong.number { color: var(--ink); font-size: .95rem; }
.pm-trade .tape { font: .78rem/1.5 ui-monospace, monospace; color: var(--muted); margin: 6px 0 0; }
.pm-trade .review { margin: 6px 0 0; }
.pm-trade .lesson { font-style: italic; color: var(--muted); margin: 4px 0 0; }
.rules { background: var(--white); border: 1px solid var(--line); border-radius: 7px; margin-top: 10px; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) 17ch 128px; gap: 0 16px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--line); font-size: .86rem; }
.rule:first-child { border-top: 0; }
.rule-what strong { font-size: .95rem; }
.rule-what small { display: block; margin-top: 4px; }
.rule .also { color: var(--muted); }
.rule .facts { margin: 6px 0 0; color: var(--muted); }
.rule .instead { margin: 2px 0 0; color: var(--ink); }
.rule-effect { text-align: right; }
.rule-effect .rule-net { display: block; font-size: 1.15rem; letter-spacing: -.02em; }
.rule-effect .bar { display: flex; height: 6px; background: #edf1e9; border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.rule-effect .bar i { display: block; height: 100%; }
.rule-effect .bar i.up { background: var(--green); }
.rule-effect .bar i.down { background: var(--red); }
.rule-effect small { font-size: .74rem; }
.rule-act { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.rule-retired { opacity: .6; }
.pred { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.cond { display: inline-block; font: .76rem/1.7 ui-monospace, monospace; background: #edf1e9; color: var(--ink); border-radius: 4px; padding: 0 7px; }
.cond.then { background: transparent; color: var(--green); font-weight: 700; padding-left: 0; }
.cond.then::before { content: "→ "; }
.rule-retired .cond.then { color: var(--muted); }
h3.bucket { font-size: .95rem; margin: 24px 0 0; }
details.bucket { margin-top: 18px; }
details.bucket > summary, details.pm-day > summary { cursor: pointer; font-size: .95rem; font-weight: 650; padding: 8px 0; }
details.bucket > button { margin: 8px 0; }
.pm-latest { margin-bottom: 36px; }
.pm-latest h2 .number { font-size: 1.6rem; }
details.pm-day { border-top: 1px solid var(--line); padding: 4px 0; margin-top: 0; }
details.pm-day > summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-weight: 500; }
details.pm-day > summary .net { font-weight: 700; min-width: 10ch; text-align: right; }
.pm-trade .head strong.net { margin-left: auto; }
.pm-trade .lesson { font-style: normal; color: var(--ink); font-weight: 600; border-left: 3px solid var(--green); padding-left: 10px; margin: 8px 0 0; }
.pm-trade .lesson.pending { color: var(--muted); font-weight: 400; border-left-color: var(--line); }
.pm-trade .review { color: var(--muted); }
.counts strong.number { font-size: 1.35rem; letter-spacing: -.02em; }
.strip { position: relative; display: flex; align-items: stretch; gap: 3px; height: 120px; margin: 4px 0 8px; padding: 0; list-style: none; }
.strip::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--muted); }
.strip::after { content: ""; position: absolute; left: 0; right: 0; top: 42%; height: 3%; background: #cfe3d9; }
.strip li { flex: 1; position: relative; min-width: 0; }
.strip li i { position: absolute; left: 0; right: 0; bottom: 50%; height: var(--h); background: var(--green); border-radius: 2px 2px 0 0; opacity: .85; }
.strip li.down i { top: 50%; bottom: auto; background: var(--red); border-radius: 0 0 2px 2px; }
.strip li.in-band i { opacity: 1; outline: 2px solid var(--green); outline-offset: -1px; }
@media (max-width: 720px) { .rule { grid-template-columns: 1fr; gap: 8px; } .rule-effect { text-align: left; } .rule-act { flex-direction: row; } }
.chat-head { margin-bottom: 16px; }
.chat-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin: 4px 0 6px; }
.chat-head .intro { font-size: .88rem; }
/* Ask the book: the conversations beside the open one, which reads down to the composer. */
.chat-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.conversations { flex: 0 1 240px; display: flex; flex-direction: column; gap: 4px; }
.conversations > button { margin-bottom: 12px; }
.conversations ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.conversations a { display: block; padding: 9px 12px; border-radius: 7px; border: 1px solid transparent; color: var(--ink); text-decoration: none; font-size: .9rem; overflow-wrap: anywhere; }
.conversations a:hover { background: #e9eee7; }
.conversations a[aria-current="page"] { background: var(--white); border-color: var(--line); }
.conversations small { display: block; font-size: .74rem; }
.conversation { flex: 999 1 560px; min-width: 0; }
.chat-head .model-pick { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--muted); min-width: 220px; }
.exchanges { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.exchange { background: var(--white); border: 1px solid var(--line); border-radius: 9px; padding: 12px 16px; overflow-wrap: anywhere; }
.exchange .question { font-weight: 650; white-space: pre-wrap; margin: 0; }
.exchange .question.none { font-weight: 400; font-style: italic; color: var(--muted); }
.exchange .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: .74rem; color: var(--muted); margin-top: 2px; }
.exchange .images { font-weight: 650; color: var(--green); }
.exchange .brief { margin: 8px 0 0; padding: 0; border: 0; max-width: 80ch; }
.exchange .brief > :first-child { margin-top: 0; }
.exchange > .note { margin: 8px 0 0; }
.note.busy { color: var(--green); font-weight: 650; }
.composer { max-width: 80ch; }
.composer .row { display: flex; gap: 8px; }
.composer input[type=text] { flex: 1; font: inherit; border-radius: 7px; border: 1px solid #a8bcb1; padding: 9px 12px; min-height: 42px; background: var(--white); }
.attach { margin-top: 8px; font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border: 1px dashed #a8bcb1; border-radius: 7px; }
.attach.phx-drop-target-active { border-color: var(--green); background: #e9eee7; }
.attach input[type=file] { font-size: .8rem; }
.attach .entry { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
#chat-error { margin: 0 0 10px; }
.import form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dropzone { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px dashed #a8bcb1; border-radius: 7px; background: var(--white); font-size: .82rem; color: var(--muted); min-width: 34ch; }
.dropzone.phx-drop-target-active { border-color: var(--green); background: #e9eee7; }
.import .entry { display: flex; gap: 8px; align-items: center; font-size: .86rem; }
.import .entry progress { width: 120px; }
.note.inline { margin: 0; }
/* The trades page scoped to one export (2026-10-01). */
.scope { margin: 10px 0 0; font-size: .92rem; color: var(--ink); }
.kpis small.book { display: block; margin-top: 4px; font-size: .74rem; }
.flag-in-file { background: #e3efe0; color: #24521b; margin-left: 6px; }

/* The desk's model menu and its call (2026-10-01). */
.clock { flex-wrap: wrap; justify-content: flex-end; }
.call { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 7px; padding: 16px 22px; max-width: 80ch; }
.call-head { font-size: clamp(1.6rem, 3.6vw, 2.3rem); letter-spacing: -.04em; line-height: 1.1; font-weight: 800; margin: 0 0 8px; }
.call-size { font-weight: 650; margin-bottom: 10px; }
.call-why { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 10px; }
.call-why dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); padding-top: 3px; }
.call-why dd { margin: 0; }
.call .note { margin: 0; font-size: .82rem; }
.writer { display: block; font-size: .72rem; }
@media (max-width: 720px) { .clock { justify-content: flex-start; } .call { padding: 14px 16px; } }
/* ponytail: a closed select is as wide as its longest option, and a disabled "(add ANTHROPIC_API_KEY)" one would push the row past a 375px screen (estimated, not measured); the cap fits the enabled labels, a longer one is clipped closed and shown whole when open. */
.clock select { max-width: 12rem; }

/* A fresh book: add, replace, reset (2026-10-02). */
/* Quiet like the other small actions, red because it deletes. */
button.reset { color: var(--red); margin-top: 6px; }

/* The import's progress at the top (2026-10-02). */
/* A white card under the masthead: green edge while the job runs, red when it failed, quiet once done. */
.job-banner { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 7px; padding: 12px 18px; margin: 0 0 20px; display: grid; gap: 8px; }
.job-banner.running { border-left-color: var(--green); }
.job-banner.failed { border-left-color: var(--red); }
.job-banner .note { margin: 0; overflow-wrap: anywhere; }
.job-banner progress { width: 100%; height: 10px; accent-color: var(--green); }
@media (max-width: 720px) { .job-banner { padding: 10px 14px; } }

/* The one header (Layouts.topbar/1): brand, the three sections, the current one underlined. */
.topbar { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 6px 0; margin: -28px 0 32px; }
.topbar a { display: flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 650; }
.topbar .brand { gap: 10px; color: var(--ink); font-size: 1.12rem; font-weight: 750; letter-spacing: -.04em; }
.topbar .brand svg { fill: var(--green); }
.topbar nav { display: flex; gap: 24px; }
.topbar nav a { color: var(--muted); font-size: .94rem; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--green); }
.topbar .disclaimer { margin-left: auto; font-size: .8rem; color: var(--muted); }
.counts.controls { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
@media (max-width: 720px) { .topbar { flex-direction: column; align-items: flex-start; gap: 0; margin-top: -12px; } .topbar nav { gap: 20px; } .topbar .disclaimer { display: none; } }

/* The gate: who is signed in, and the sign-in page. */
.topbar .who { font-size: .8rem; color: var(--muted); }
.topbar .who a { display: inline; min-height: 0; color: var(--green); font-weight: 650; }
.login { max-width: 440px; padding-top: 80px; text-align: center; }
.login .intro { margin: 0 auto 28px; }
.login #signin { width: 100%; min-height: 52px; font-size: 1rem; }
.login .note { margin-top: 16px; font-size: .82rem; }
.login dialog { max-width: 400px; padding: 28px 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); text-align: left; }
.login dialog::backdrop { background: rgba(32, 43, 42, .55); }
.login dialog form { display: flex; justify-content: flex-end; margin-top: 16px; }
