/* Auralog Markets — the original Auralog notebook, upgraded.
   Handwritten display (MyFont) + Kaiti for Chinese headings, Songti for diary prose,
   system sans with tabular figures for every number. */

/* letters only: MyFont's numerals are decorative, so digits fall through to Kaiti / system */
@font-face { font-family: "MyFont"; src: url("/assets/MyFont.otf"); font-display: swap; unicode-range: U+0041-005A, U+0061-007A, U+0027, U+002C, U+002E, U+0021, U+003F; }
@font-face { font-family: "Font2"; src: url("/assets/Font2.otf"); font-display: swap; unicode-range: U+0041-005A, U+0061-007A; }

:root {
  --paper: #f5efe4;
  --paper-2: #fbf8f2;
  --sheet: rgba(255, 253, 249, 0.86);
  --ink: #3b2f2f;
  --ink-2: #5b4d47;
  --graphite: #7a6e64;
  --rule: #e4d9c8;
  --rule-2: #d6c7b1;
  --kraft: #d8a87b;
  --kraft-2: #c8966f;
  --kraft-tint: #f3e9dd;
  --gain: #4e7a57;
  --gain-tint: #e3eee2;
  --loss: #b04a3c;
  --loss-tint: #f6e1dc;
  --marker: #f2d86b;
  --ai: #efe6f7;
  --me: #e3eff7;

  --hand: "MyFont", "Kaiti SC", "STKaiti", "KaiTi", "Baskerville", Georgia, serif;
  --script: "Font2", "Kaiti SC", "STKaiti", serif;
  --prose: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;

  --r-sheet: 18px;
  --r-card: 12px;
  --r-chip: 999px;
  --lift: 0 1px 0 rgba(59, 47, 47, 0.04), 0 10px 30px -18px rgba(59, 47, 47, 0.35);
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--ui);
  background: var(--paper) url("/assets/indexImage.png") no-repeat left top / auto 100vh fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.num, .mono-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); text-decoration-color: var(--kraft); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--kraft-2); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--graphite); }
.gain { color: var(--gain); }
.loss { color: var(--loss); }

/* ---------- frame ---------- */
.app {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 28px 48px 92px; /* leave room for the spiral */
}
.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: -1px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 10px;
}
.brand h1 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 46px;
  line-height: 1;
  margin: 0;
  letter-spacing: 0.5px;
}
.brand .sub { font-family: var(--hand); font-size: 20px; color: var(--graphite); }

/* index tabs — the notebook's divider tabs */
.tabs { display: flex; gap: 4px; align-self: flex-end; }
.tab {
  border: 1px solid var(--rule-2);
  border-bottom: none;
  background: var(--kraft-tint);
  padding: 9px 20px 8px;
  border-radius: 12px 12px 0 0;
  font-family: var(--hand);
  font-size: 21px;
  line-height: 1;
  color: var(--ink-2);
  position: relative;
  top: 1px;
  transition: background 0.15s;
}
.lang-toggle {
  align-self: flex-start; margin-left: 8px; padding: 4px 11px; border-radius: var(--r-chip);
  border: 1px solid var(--rule-2); background: var(--paper-2); color: var(--ink-2);
  font: 600 12px/1.4 var(--ui); letter-spacing: .04em; cursor: pointer;
}
.top-actions { align-self: flex-start; display: flex; gap: 6px; margin-left: 8px; }
.top-actions .lang-toggle { margin-left: 0; }
.lang-toggle[hidden] { display: none; }
.lang-toggle:hover { border-color: var(--kraft-2); color: var(--ink); }
.lang-toggle:focus-visible { outline: 2px solid var(--kraft); outline-offset: 2px; }
.tab small { font-family: var(--ui); font-size: 11px; color: var(--graphite); margin-left: 6px; }
.tab:hover { background: #efe0cc; }
.tab[aria-selected="true"] { background: var(--sheet); color: var(--ink); z-index: 2; }

.sheet {
  background: var(--sheet);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--rule-2);
  border-radius: 0 var(--r-sheet) var(--r-sheet) var(--r-sheet);
  box-shadow: var(--lift);
  padding: 26px 28px 30px;
  min-height: calc(100vh - 140px);
}
.statusline {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--graphite);
  margin: 10px 4px 0;
}
.statusline .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--rule-2); vertical-align: 1px; }
.statusline .dot.on { background: var(--gain); }

/* ---------- shared ---------- */
.spread { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.spread.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
.spread.list-detail { grid-template-columns: 300px minmax(0, 1fr); }
.page-title { font-family: var(--hand); font-weight: 400; font-size: 34px; margin: 0 0 4px; line-height: 1.05; }
.page-lede { margin: 0 0 18px; color: var(--graphite); max-width: 60ch; line-height: 1.55; }
h3.h { font-family: var(--hand); font-weight: 400; font-size: 25px; margin: 22px 0 10px; line-height: 1.1; }
h3.h:first-child { margin-top: 0; }
.panel {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 18px 20px;
}
.rule { height: 1px; background: var(--rule); border: 0; margin: 18px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-chip);
  font-size: 12px; background: var(--kraft-tint); color: var(--ink-2);
  border: 1px solid transparent;
}
.chip.gain { background: var(--gain-tint); color: var(--gain); }
.chip.loss { background: var(--loss-tint); color: var(--loss); }
.chip.outline { background: transparent; border-color: var(--rule-2); }

.btn {
  border: 1px solid var(--rule-2);
  background: var(--paper-2);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--kraft-tint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--kraft); border-color: var(--kraft-2); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--kraft-2); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--graphite); }
.btn.quiet:hover { color: var(--ink); background: var(--kraft-tint); }
.btn.danger { color: var(--loss); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
label.field > span em { font-style: normal; color: var(--graphite); font-size: 12px; margin-left: 6px; }
.input, textarea.input, select.input {
  width: 100%;
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fffdf9;
  font-size: 14px;
  line-height: 1.5;
}
textarea.input { resize: vertical; min-height: 70px; font-family: var(--prose); font-size: 15px; }
.input:focus { outline: none; border-color: var(--kraft-2); box-shadow: 0 0 0 3px rgba(216, 168, 123, 0.25); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.empty {
  border: 1.5px dashed var(--rule-2);
  border-radius: var(--r-card);
  padding: 22px;
  color: var(--graphite);
  text-align: center;
  line-height: 1.6;
}
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 50; box-shadow: var(--lift);
}
.toast.err { background: var(--loss); }

/* ---------- calendar ---------- */
.month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.month-head .title { display: flex; align-items: baseline; gap: 12px; }
.month-head .title h2 { font-family: var(--hand); font-weight: 400; font-size: 38px; margin: 0; line-height: 1; white-space: nowrap; }
.month-head .title .btn { white-space: nowrap; }
.month-stats { display: flex; gap: 20px; margin: 0 0 16px; flex-wrap: wrap; }
.month-stats div { font-size: 13px; color: var(--graphite); }
.month-stats b { display: block; font-size: 20px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: var(--kraft-tint); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-family: var(--hand); font-size: 18px; color: var(--graphite); text-align: center; padding-bottom: 2px; }
.day {
  position: relative;
  min-height: 86px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fffdf9;
  padding: 7px 8px 6px;
  text-align: left;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: border-color 0.12s, transform 0.12s;
}
.day:hover { border-color: var(--kraft-2); }
.day.out { visibility: hidden; }
.day.weekend { background: transparent; border-style: dashed; }
.day.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.day .d { font-family: var(--hand); font-size: 20px; line-height: 1; }
.day.today .d {
  align-self: flex-start;          /* the cell is a flex column: without this the number stretches the full width */
  min-width: 26px; height: 26px; padding: 0 6px; margin: -3px 0 0 -4px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--ink); color: var(--paper-2);
  font-size: 17px;
}
.day .pnl { white-space: nowrap; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.day .pct { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0.85; }
.day .marks { display: flex; gap: 4px; align-items: center; min-height: 14px; }
.mark { width: 14px; height: 14px; display: inline-grid; place-items: center; font-size: 10px; border-radius: 4px; line-height: 1; }
.mark.j { background: var(--kraft); color: #fff; }
.mark.t { background: var(--ink); color: #fff; }
.mark.e { border: 1.5px solid var(--ink); color: var(--ink); }
.mark.b { color: var(--graphite); font-size: 11px; width: auto; }
.day.est::after { content: ""; position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--rule-2); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--graphite); margin-top: 12px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* day page */
.daypage .date-big { font-family: var(--hand); font-size: 34px; line-height: 1; margin: 0; }
.daypage .weekday { color: var(--graphite); margin: 2px 0 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.kpi .k { font-size: 12px; color: var(--graphite); }
.kpi .v { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .s { font-size: 12px; font-variant-numeric: tabular-nums; }
.contrib { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.contrib td { padding: 5px 4px; border-bottom: 1px solid var(--rule); }
.contrib td.sym { font-weight: 600; width: 64px; }
.contrib td.r { text-align: right; white-space: nowrap; }
.contrib .bar { position: relative; height: 10px; }
.contrib .bar i { position: absolute; top: 0; height: 10px; border-radius: 3px; }
.contrib .bar .axis { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--rule-2); }
.note-est { font-size: 12px; color: var(--graphite); margin-top: 8px; }

.entry { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: 0; }
.entry h4 { font-family: var(--hand); font-weight: 400; font-size: 22px; margin: 0 0 6px; line-height: 1.15; }
.entry .body { font-family: var(--prose); font-size: 15.5px; line-height: 1.85; white-space: pre-wrap; max-width: 68ch; }
.entry .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.entry .take { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.quick-note textarea { min-height: 96px; background-image: repeating-linear-gradient(transparent, transparent 27px, var(--rule) 27px, var(--rule) 28px); line-height: 28px; padding-top: 4px; }

.brief-link { display: block; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rule); background: #fffdf9; text-decoration: none; margin-bottom: 8px; }
.brief-link:hover { border-color: var(--kraft-2); }
.brief-link b { font-weight: 600; font-size: 13px; }
.brief-link p { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* ---------- theses ---------- */
.lab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.calib { display: flex; gap: 22px; font-size: 13px; color: var(--graphite); }
.calib b { display: block; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.group-title { font-family: var(--hand); font-size: 23px; margin: 20px 0 10px; font-weight: 400; display: flex; align-items: baseline; gap: 8px; }
.group-title span { font-family: var(--ui); font-size: 12px; color: var(--graphite); }
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

/* the letter: the one bold element */
.letter {
  position: relative;
  text-align: left;
  border: 1px solid var(--rule-2);
  border-radius: 6px 6px 12px 12px;
  background:
    linear-gradient(to bottom right, transparent 49.6%, var(--rule-2) 49.8%, transparent 50.2%) top left / 50% 34px no-repeat,
    linear-gradient(to bottom left, transparent 49.6%, var(--rule-2) 49.8%, transparent 50.2%) top right / 50% 34px no-repeat,
    #fffdf8;
  padding: 54px 16px 14px;
  box-shadow: 0 8px 18px -14px rgba(59, 47, 47, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.letter:hover { transform: translateY(-2px); box-shadow: 0 14px 22px -16px rgba(59, 47, 47, 0.55); }
.seal {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c7685a, #9a3b30 70%);
  box-shadow: 0 2px 0 rgba(0,0,0,.15), inset 0 0 0 3px rgba(255,255,255,.12);
  color: #f9e7df; font-family: var(--hand); font-size: 15px; display: grid; place-items: center;
}
.letter.done .seal { background: radial-gradient(circle at 35% 30%, #a89a8c, #75685c 70%); }
.letter h4 { font-family: var(--hand); font-weight: 400; font-size: 22px; margin: 4px 0 8px; line-height: 1.15; }
.letter .legs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.letter .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.letter .ret { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.letter .ret small { display: block; font-size: 11px; color: var(--graphite); font-weight: 400; margin-top: 4px; }
.letter .progress { height: 4px; background: var(--rule); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.letter .progress i { display: block; height: 100%; background: var(--kraft); }
.letter .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--graphite); margin-top: 6px; }
.compose-card {
  border: 1.5px dashed var(--kraft); border-radius: 12px; background: transparent;
  display: grid; place-items: center; min-height: 180px; font-family: var(--hand); font-size: 23px; color: var(--ink-2);
}
.compose-card:hover { background: var(--kraft-tint); }

/* thesis detail */
.back { margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
.paper-letter {
  background: #fffdf8 repeating-linear-gradient(transparent, transparent 31px, #efe6d8 31px, #efe6d8 32px);
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  padding: 26px 30px 24px;
  position: relative;
  box-shadow: var(--lift);
}
.paper-letter .salute { font-family: var(--hand); font-size: 22px; color: var(--graphite); margin: 0 0 6px; line-height: 32px; }
.paper-letter h2 { font-family: var(--hand); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0 0 10px; }
.paper-letter .body { font-family: var(--prose); font-size: 16px; line-height: 32px; white-space: pre-wrap; margin: 0; }
.paper-letter dl { margin: 10px 0 0; }
.paper-letter dt { font-family: var(--hand); font-size: 19px; color: var(--ink-2); line-height: 32px; margin-top: 4px; }
.paper-letter dd { margin: 0; font-family: var(--prose); font-size: 15px; line-height: 32px; white-space: pre-wrap; }
.paper-letter .sign { text-align: right; font-family: var(--hand); font-size: 20px; color: var(--graphite); margin-top: 6px; }
.big-seal {
  position: absolute; right: 22px; top: -18px; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c7685a, #9a3b30 70%);
  display: grid; place-items: center; color: #f9e7df; font-family: var(--hand); font-size: 22px;
  box-shadow: 0 3px 0 rgba(0,0,0,.15), inset 0 0 0 4px rgba(255,255,255,.12);
  transform: rotate(-8deg);
}
.hash { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--graphite); word-break: break-all; }
.chart-wrap { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 14px 8px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--graphite); margin: 2px 0 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--rule-2); }
.timeline li { position: relative; padding: 0 0 14px 16px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--kraft-2); }
.timeline li.seal-v::before { background: #9a3b30; border-color: #9a3b30; }
.timeline .when { font-size: 12px; color: var(--graphite); }
.timeline .what { font-family: var(--prose); font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; }
.verdict { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; }
.verdict label { flex: 1; min-width: 110px; border: 1px solid var(--rule-2); border-radius: 10px; padding: 8px 10px; font-size: 13px; cursor: pointer; background: #fffdf9; }
.verdict input { margin-right: 6px; }
.verdict label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* composer */
.composer { max-width: 920px; }
.legs-editor .leg { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.legs-editor .px { font-size: 12px; color: var(--graphite); grid-column: 1 / -1; margin-top: -4px; }
.conf { display: flex; align-items: center; gap: 12px; }
.conf input[type=range] { flex: 1; accent-color: var(--kraft-2); }
.conf output { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 44px; text-align: right; }
.horizons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.horizons button { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--rule-2); background: #fffdf9; }
.horizons button:hover { background: var(--kraft-tint); }
.seal-note { font-size: 13px; color: var(--graphite); line-height: 1.6; max-width: 62ch; }

/* ---------- chat ---------- */
.chat-col { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 480px; }
.convo {
  flex: 1; overflow-y: auto; padding: 16px; background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: var(--r-card);
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; line-height: 1.65; font-size: 15px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--me); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--ai); border-bottom-left-radius: 4px; }
.msg.typing { color: var(--graphite); font-style: italic; }
.composer-bar { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.composer-bar textarea { flex: 1; min-height: 46px; max-height: 160px; font-family: var(--ui); font-size: 15px; }
.mic { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--rule-2); background: #fffdf9; font-size: 18px; flex: none; }
.mic.rec { background: var(--loss); color: #fff; border-color: var(--loss); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(176, 74, 60, 0.15); } }
.chat-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.starter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.starter button { font-size: 13px; border: 1px solid var(--rule-2); border-radius: 999px; padding: 5px 12px; background: #fffdf9; }
.starter button:hover { background: var(--kraft-tint); }
.sessions { list-style: none; padding: 0; margin: 0; }
.sessions li button { width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.sessions li button:hover { background: var(--kraft-tint); }
.sessions li .t { color: var(--graphite); font-size: 11px; display: block; }

/* ---------- briefs ---------- */
.brief-list { list-style: none; margin: 0; padding: 0; }
.brief-list li button {
  width: 100%; text-align: left; border: 0; border-left: 3px solid transparent; background: transparent;
  padding: 9px 10px; border-radius: 0 8px 8px 0; display: block;
}
.brief-list li button:hover { background: var(--kraft-tint); }
.brief-list li button[aria-current="true"] { background: var(--paper-2); border-left-color: var(--kraft-2); }
.brief-list .bd { font-family: var(--hand); font-size: 19px; line-height: 1.1; }
.brief-list .bs { font-size: 12px; color: var(--graphite); }
.brief-list .bh { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brief h2 { font-family: var(--hand); font-weight: 400; font-size: 34px; margin: 0 0 8px; line-height: 1.05; }
.brief .headline { font-family: var(--prose); font-size: 18px; line-height: 1.75; margin: 0 0 18px; max-width: 64ch; }
.tape { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 22px; }
.tape > div { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; }
.tape .n { font-size: 12px; color: var(--graphite); }
.tape .v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tape .c { font-size: 12px; font-variant-numeric: tabular-nums; }
.brief section { margin-bottom: 20px; }
.brief section h3 { font-family: var(--hand); font-weight: 400; font-size: 24px; margin: 0 0 8px; }
.news { list-style: none; margin: 0; padding: 0; max-width: 72ch; }
.news li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.news li:last-child { border-bottom: 0; }
.news .t { font-family: var(--prose); font-size: 15.5px; line-height: 1.75; }
.news .w { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin-top: 4px; padding-left: 12px; border-left: 2px solid var(--kraft); }
.news .src { font-size: 12px; margin-top: 4px; color: var(--graphite); }
.watch { width: 100%; border-collapse: collapse; font-size: 14px; }
.watch td { padding: 7px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; line-height: 1.5; }
.watch td:first-child { white-space: nowrap; color: var(--ink-2); font-weight: 600; width: 1%; padding-right: 16px; }
.pnotes .pn { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 1.55; }
.pnotes .pn:last-child { border-bottom: 0; }
.pnotes .pn b { min-width: 48px; }
.src-note { font-size: 12px; color: var(--graphite); margin-top: 14px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(59, 47, 47, 0.32); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal { background: var(--paper-2); border-radius: 16px; border: 1px solid var(--rule-2); width: min(640px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px 24px; box-shadow: var(--lift); }
.modal h3 { font-family: var(--hand); font-weight: 400; font-size: 26px; margin: 0 0 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .spread, .spread.wide-left, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { background-size: auto 60vh; background-image: none; }
  .app { padding: 14px 12px 40px; }
  .masthead { flex-direction: column; align-items: stretch; gap: 8px; }
  .brand h1 { font-size: 36px; }
  .tabs { overflow-x: auto; }
  .tab { padding: 8px 12px 7px; font-size: 18px; }
  .tab small { display: none; }
  .sheet { padding: 16px; border-radius: 0 0 14px 14px; }
  .spread.list-detail { grid-template-columns: 1fr; }
  .day { min-height: 62px; padding: 5px; }
  .day .pct, .day .marks .b { display: none; }
  .day .pnl { font-size: 10px; letter-spacing: -0.2px; }
  .month-head .title h2 { font-size: 28px; }
  .month-head .title { gap: 4px; }
  .kpis, .stats, .grid-3 { grid-template-columns: 1fr 1fr; }
  .legs-editor .leg { grid-template-columns: 1fr 1fr; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
