/* FKD Capital - public site.
   Phone first: the base rules are the 360-430 px layout; wider screens add to it (640 / 900 / 1100 px).
   No build step, no external resources, no inline styles anywhere (the Content-Security-Policy forbids them). */

:root {
  color-scheme: dark;
  --bg: #07090c;
  --bg-2: #0a0d12;
  --surface: #11151c;          /* cards and chart surface (the chart palette is validated against this value) */
  --surface-2: #171c25;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .15);
  --ink: #edf0f5;
  --ink-2: #b6bdc9;
  --muted: #838c9b;
  --accent: #9bb7ee;           /* focus, active states, single-series chart lines */
  --pos: #35c27a;
  --neg: #f07373;
  --flat: #9aa3b2;
  --warn: #f0b429;
  --series-1: #3987e5;         /* book colours: fixed order, used only where the four books share one chart */
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --grid: #1c212b;
  --axis: #2e3644;
  --radius: 14px;
  --radius-sm: 10px;
  --gutter: 20px;
  --top-h: 60px;
  --sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--top-h) + 18px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(155, 183, 238, .32); }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.narrow { max-width: 820px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: calc(8px + env(safe-area-inset-top)); }
.muted { color: var(--muted); }

/* ------------------------------------------------------------------------------------------------ type */
.eyebrow { font: 500 12px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.h1 { font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; }
.h2 { font-size: clamp(1.45rem, 5.4vw, 2.3rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 600; }
.h3 { font-size: 1.05rem; line-height: 1.3; letter-spacing: -.005em; font-weight: 600; }
.lede { font-size: clamp(1.02rem, 3.9vw, 1.2rem); line-height: 1.55; color: var(--ink-2); margin-top: 16px; max-width: 62ch; }
.prose { color: var(--ink-2); max-width: 68ch; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 1em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a, .finenote a, .lede a, .formnote a, .check a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.prose a:hover, .finenote a:hover { text-decoration-thickness: 2px; }
.prose--doc { margin-top: 28px; }
.prose--doc h2 { color: var(--ink); font-size: 1.3rem; line-height: 1.2; letter-spacing: -.015em; font-weight: 600; margin: 2.2em 0 .7em; padding-top: 1.4em; border-top: 1px solid var(--line); }
.prose--doc ul { list-style: none; display: grid; gap: .6em; }
.prose--doc ul li { position: relative; padding-left: 20px; }
.prose--doc ul li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 8px; height: 1px; background: var(--muted); }
.prose--doc .tablewrap { margin: 1.1em 0; }
.formula { font: 500 14px/1.5 var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 1em 0; overflow-x: auto; white-space: nowrap; }
.defs { display: grid; gap: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.defs > div { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.defs dt { color: var(--ink); font-weight: 600; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); border-color: var(--ink-2); }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 18px; color: var(--muted); font-size: 14px; }
.facts > span + span::before { content: "·"; margin-right: 10px; color: var(--muted); }
.finenote { margin-top: 28px; color: var(--muted); font-size: 14px; max-width: 78ch; }
.empty { color: var(--muted); padding: 22px 18px; border: 1px dashed var(--line-2); border-radius: var(--radius); text-align: center; font-size: 15px; }

/* --------------------------------------------------------------------------------------------- numbers */
.num { font-variant-numeric: lining-nums; white-space: nowrap; }
.num--pos { color: var(--pos); }
.num--neg { color: var(--neg); }
.num--flat { color: var(--ink-2); }
.num--na { color: var(--muted); }
.num--risk { color: var(--ink-2); }
.sym { font-weight: 600; letter-spacing: .01em; }
.recid { font: 400 12px/1 var(--mono); color: var(--muted); letter-spacing: .02em; }
/* one side of an entry in the activity feed: the price above the time */
.fill { display: inline-flex; flex-direction: column; gap: 3px; vertical-align: middle; }
.px { font: 500 13px/1.25 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.px--na { color: var(--muted); }
.fill time { font: 400 12px/1.25 var(--mono); color: var(--muted); white-space: nowrap; }
.fill time:only-child { color: var(--ink-2); }

/* ------------------------------------------------------------------------------------------- small UI */
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2);
  font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.tag--tf { text-transform: none; letter-spacing: .02em; font-size: 12px; }
.tag--warn { color: var(--warn); border-color: rgba(240, 180, 41, .42); }
.tag--info { color: var(--accent); border-color: rgba(155, 183, 238, .42); }
.tag--quiet { color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.badge--live { color: var(--ink); }
.badge--live .badge__dot { background: var(--pos); box-shadow: 0 0 0 0 rgba(53, 194, 122, .55); animation: pulse 2.4s ease-out infinite; }
.badge--delayed .badge__dot { background: var(--warn); }
.badge--offline .badge__dot { background: var(--neg); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(53, 194, 122, .5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(53, 194, 122, 0); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid transparent; font: 600 15px/1 var(--sans); letter-spacing: .005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--ink); color: #07090c; }
.btn--primary:hover { background: #fff; }
.btn--ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink-2); background: rgba(255, 255, 255, .04); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn--wide { width: 100%; }
.btn--off { opacity: .35; cursor: default; pointer-events: none; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--lg { width: 26px; height: 26px; stroke-width: 1.4; color: var(--accent); }

/* --------------------------------------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 50; background: rgba(7, 9, 12, .84); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(150%) blur(14px); backdrop-filter: saturate(150%) blur(14px); padding-top: env(safe-area-inset-top); }
.top__bar { display: flex; align-items: center; justify-content: space-between; height: var(--top-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
/* the monogram: the frame is the D, inside it the F and the K; the K's rising arm carries the accent.
   (the frame's stroke is set in the markup: a colour run defined once per page, see ui.MARK_DEFS) */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mark { width: 32px; height: 32px; flex: none; overflow: visible; }
.mark__frame { fill: rgba(155, 183, 238, .07); stroke-width: 1.8; stroke-linejoin: round; transition: fill .2s ease; }
.mark__glyph { fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.mark__rise { fill: none; stroke: var(--accent); stroke-width: 2.3; stroke-linecap: round; filter: drop-shadow(0 0 2.5px rgba(155, 183, 238, .75)); }
.brand:hover .mark__frame { fill: rgba(155, 183, 238, .14); }
.brand__name { font: 600 14px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }

.nav-toggle { position: absolute; right: max(calc(var(--gutter) - 10px), env(safe-area-inset-right)); width: 44px; height: 44px; margin: 0; opacity: 0; z-index: 2; cursor: pointer; }
.nav-btn { width: 44px; height: 44px; margin-right: -10px; display: grid; place-content: center; gap: 7px; border-radius: 10px; }
.nav-btn span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .22s ease; }
.nav-toggle:focus-visible + .nav-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle:checked + .nav-btn span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle:checked + .nav-btn span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
.nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--bg);
  border-bottom: 1px solid var(--line); max-height: calc(100vh - var(--top-h)); max-height: calc(100dvh - var(--top-h)); overflow-y: auto;
  padding: 6px max(var(--gutter), env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); }
.nav-toggle:checked ~ .nav { display: flex; }
.nav__link { display: flex; align-items: center; min-height: 56px; font-size: 18px; font-weight: 500; text-decoration: none; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__cta { margin-top: 18px; min-height: 48px; font-size: 15px; }

/* --------------------------------------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 44px 0 calc(30px + env(safe-area-inset-bottom)); margin-top: 24px; }
.foot__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 16px; }
.foot__brand { grid-column: 1 / -1; }
.foot__line { color: var(--muted); font-size: 14px; margin-top: 10px; }
.foot__contact { margin-top: 6px; font-size: 14px; }
.mail { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.mail:hover { text-decoration-color: var(--ink); }
.foot__contact .mail { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink-2); }
.foot__col .mail { text-decoration: none; overflow-wrap: normal; }
.contactline { margin-top: 18px; color: var(--ink-2); font-size: 15px; }
.foot__h { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.foot__col a { display: flex; align-items: center; min-height: 40px; text-decoration: none; color: var(--ink-2); font-size: 14px; }
.foot__col a:hover { color: var(--ink); }
.foot__legal { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.foot__legal p { max-width: 96ch; }
.foot__meta { margin-top: 12px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; }

/* ------------------------------------------------------------------------------------------- sections */
.section { padding: 56px 0; }
.section--top { padding-top: 36px; }
.section--tight { padding-top: 8px; }
.section--line { border-top: 1px solid var(--line); }
.section__head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.section__note { color: var(--muted); font-size: 14px; max-width: 60ch; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.section__foot { color: var(--muted); font-size: 14px; margin-top: 20px; max-width: 70ch; }
.split { display: grid; gap: 22px; }
.block { margin-top: 44px; }
.block__head { margin-bottom: 18px; display: grid; gap: 8px; }
.block__head .h2 { font-size: clamp(1.25rem, 4.6vw, 1.6rem); }
.block__note { color: var(--muted); font-size: 14px; max-width: 78ch; }

/* ----------------------------------------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  min-height: calc(100vh - var(--top-h)); min-height: calc(100svh - var(--top-h) - env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__veil { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 18% 30%, rgba(7, 9, 12, .9) 0%, rgba(7, 9, 12, .55) 48%, rgba(7, 9, 12, 0) 78%),
              linear-gradient(180deg, rgba(7, 9, 12, .2) 0%, rgba(7, 9, 12, 0) 40%, rgba(7, 9, 12, .92) 100%); }
.hero__inner { position: relative; padding-top: clamp(40px, 12vh, 132px); padding-bottom: 28px; }
.hero__title { font-size: clamp(2.25rem, 10.4vw, 6rem); line-height: 1; letter-spacing: -.04em; font-weight: 600; }
.hero__lede { margin-top: 20px; font-size: clamp(1.1rem, 4.6vw, 1.6rem); line-height: 1.3; letter-spacing: -.012em; color: var(--ink); }
.hero__sub { margin-top: 16px; color: var(--ink-2); font-size: clamp(.98rem, 3.7vw, 1.1rem); max-width: 52ch; }
.hero__cta { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.hero__cta .btn { width: 100%; }
.hero__status { position: relative; padding-bottom: 22px; }
.hero__inner > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero__inner > :nth-child(2) { animation-delay: .06s; }
.hero__inner > :nth-child(3) { animation-delay: .14s; }
.hero__inner > :nth-child(4) { animation-delay: .2s; }
.hero__inner > :nth-child(5) { animation-delay: .28s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.creed { text-align: center; border-top: 1px solid var(--line); background: radial-gradient(80% 120% at 50% 0%, rgba(155, 183, 238, .07), rgba(7, 9, 12, 0) 70%); }
.creed__quote { font-size: clamp(1.7rem, 7.4vw, 3.4rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 600; }
.creed__sub { margin-top: 18px; color: var(--ink-2); font-size: 1.05rem; }
.hero__cta--center { align-items: stretch; margin-left: auto; margin-right: auto; max-width: 520px; }

/* ----------------------------------------------------------------------------------------- status bar */
.statusbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(17, 21, 28, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow: hidden; margin-top: 26px; }
.statusbar__item { padding: 14px 16px; display: grid; gap: 8px; align-content: start; border-top: 1px solid var(--line); min-width: 0; }
.statusbar__item:nth-child(-n+2) { border-top: 0; }
.statusbar__item:nth-child(odd) { border-right: 1px solid var(--line); }
.statusbar__item:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.statusbar__label { font: 500 11px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.statusbar__value { font: 600 15px/1.2 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.statusbar__note { font-size: 12px; color: var(--muted); }
.hero__status .statusbar { margin-top: 0; }

/* ---------------------------------------------------------------------------------------------- books */
.books { display: grid; gap: 14px; }
.bookcard { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-decoration: none; transition: border-color .2s ease, transform .2s ease, background-color .2s ease; -webkit-tap-highlight-color: transparent; }
.bookcard:hover { border-color: var(--line-2); background: var(--surface-2); }
.bookcard__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bookcard__name { font: 600 13px/1 var(--mono); letter-spacing: .2em; }
.bookcard__value { display: flex; align-items: baseline; gap: 10px; font-size: clamp(2.1rem, 10vw, 2.7rem); font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.bookcard__unit { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.spark { width: 100%; height: 44px; overflow: visible; }
.spark__line { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark__zero { stroke: var(--axis); stroke-width: 1; vector-effect: non-scaling-stroke; }
.bookcard__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.bookcard__stats > div { display: flex; flex-direction: column; justify-content: space-between; }   /* values share one line when a label wraps */
.bookcard__stats dt { font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.bookcard__stats dd { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bookcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.bookcard__go { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.bookcard:hover .bookcard__go { color: var(--ink); }

/* ------------------------------------------------------------------------------------------- features */
.features { display: grid; gap: 14px; }
.feature { padding: 22px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 10px; align-content: start; }
.feature p { color: var(--ink-2); font-size: 15px; }
.steps { display: grid; gap: 0; counter-reset: step; }
.step { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 0 0 26px; }
.step::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 1px; background: var(--line-2); }
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }
.step > .ico { width: 44px; height: 44px; padding: 9px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.step p { color: var(--ink-2); font-size: 15px; margin-top: 6px; max-width: 60ch; }

/* ----------------------------------------------------------------------------------------- desk, book */
.backlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 14px; }
.backlink:hover { color: var(--ink); }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--line-2); border-radius: 13px; margin: 6px 0 26px; max-width: 520px; }
.tab { display: grid; place-items: center; min-height: 44px; border-radius: 9px; font: 600 13px/1 var(--mono); letter-spacing: .14em; color: var(--ink-2); text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab--on { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.bookhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.jump { display: flex; gap: 8px; margin: 16px -3px -6px; padding: 3px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.jump a:hover { color: var(--ink); border-color: var(--line-2); }
.view { margin-top: 28px; transition: opacity .16s ease; }
.is-loading { opacity: .5; pointer-events: none; }
.filterbar { display: grid; gap: 10px; margin-bottom: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 3px; margin: -3px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); font: 600 13px/1 var(--mono); letter-spacing: .03em; color: var(--ink-2); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.chip:hover { color: var(--ink); border-color: var(--ink-2); }
.chip--on { background: var(--ink); border-color: var(--ink); color: #07090c; }
.chip--on:hover { color: #07090c; }
.chip--off { opacity: .34; cursor: not-allowed; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 14px 14px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 8px; align-content: start; min-width: 0; }
.tile--hero { grid-column: 1 / -1; padding: 18px 16px 20px; }
.tile--hero ~ .tile:last-child:nth-child(even) { grid-column: 1 / -1; }      /* two columns: no tile is left alone on a row */
.tile__label { font: 500 11px/1.25 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tile__value { font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.tile--hero .tile__value { font-size: clamp(2.4rem, 12vw, 3.4rem); letter-spacing: -.04em; line-height: 1; }
.tile__sub { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }

/* --------------------------------------------------------------------------------------------- charts */
.charts { display: grid; gap: 14px; margin-top: 14px; }
.chart { position: relative; padding: 16px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.chart__head { margin-bottom: 12px; display: grid; gap: 4px; }
.chart__title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.chart__sub { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.chart__plot { position: relative; height: 220px; touch-action: pan-y; cursor: crosshair; border-radius: 8px; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.chart__plot--tall { height: 260px; }
.chart__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart__tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; min-width: 132px; max-width: 240px; padding: 9px 11px;
  background: #080b10; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 12.5px; line-height: 1.35; }
.tip__head { color: var(--muted); font: 500 11px/1.3 var(--mono); letter-spacing: .03em; margin-bottom: 6px; }
.tip__row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; }
.tip__row + .tip__row { margin-top: 4px; }
.tip__key { width: 14px; height: 2px; border-radius: 2px; background: var(--accent); }
.tip__val { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip__name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip__sub { color: var(--muted); margin-top: 4px; }
.chart__note, .chart__noscript { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.legend__item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; min-height: 24px; }
.legend__key { width: 16px; height: 3px; border-radius: 2px; background: var(--accent); flex: none; }
.legend__key--b1 { background: var(--series-1); }
.legend__key--b2 { background: var(--series-2); }
.legend__key--b3 { background: var(--series-3); }
.legend__key--b4 { background: var(--series-4); }
.legend__name { color: var(--ink-2); font: 600 12px/1 var(--mono); letter-spacing: .1em; }
.legend__value { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend__value .num { color: var(--ink); }
.twin { margin-top: 12px; border-top: 1px solid var(--line); }
.twin > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; font-weight: 500; list-style: none; -webkit-tap-highlight-color: transparent; }
.twin > summary::-webkit-details-marker { display: none; }
.twin > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border: 1px solid var(--line-2); border-radius: 6px; font: 500 13px/1 var(--mono); color: var(--muted); }
.twin[open] > summary::before { content: "\2212"; }
.twin > .tablewrap, .twin > .twin__note { margin-bottom: 6px; }
.twin__note { color: var(--muted); font-size: 13.5px; }
.twin--block { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px 8px; background: var(--surface); }
.twin--block > .tablewrap { margin-top: 2px; }

/* --------------------------------------------------------------------------------------------- tables */
.tablewrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rt th { text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.rt td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rt .t-num { text-align: right; font-variant-numeric: tabular-nums; }
.rt td.t-num, .rt td.t-time { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.rt td.t-main { color: var(--ink); font-weight: 500; white-space: nowrap; }
.rt tbody tr:last-child td { border-bottom: 0; }
.booklink { font: 600 12px/1 var(--mono); letter-spacing: .14em; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.booklink:hover { border-color: var(--accent); }
/* the desk feed: one row per trade, with a chip for every book that took it */
.bookchips { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.bookchip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 6px;
  font: 600 11px/1 var(--mono); letter-spacing: .1em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.bookchip:hover { border-color: var(--accent); background: rgba(155, 183, 238, .08); }
.revs { margin-top: 6px; font-size: 12.5px; }
.revs > summary { cursor: pointer; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }
.revs__list { margin-top: 6px; display: grid; gap: 6px; color: var(--ink-2); text-align: left; white-space: normal; }

/* phones: a table becomes a stack of cards, each cell labelled */
@media (max-width: 899.98px) {
  .rt--cards, .rt--cards tbody, .rt--cards tr, .rt--cards td { display: block; }
  .rt--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rt--cards tbody { display: grid; gap: 10px; }
  .rt--cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .rt--cards td { padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; }
  .rt--cards td.t-num { text-align: left; }
  .rt--cards td::before { content: attr(data-label); display: block; margin-bottom: 4px; font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .rt--cards td.t-main { grid-column: 1 / -1; font-size: 15px; font-weight: 600; font-family: var(--sans); }
  .rt--cards td.t-main::before { display: none; }
  /* many short figures per row (daily reports, period tables): three to a line, times on their own line */
  .rt--dense tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
  .rt--dense td.t-time { grid-column: 1 / -1; }

  /* the trade list gets its own compact card: instrument and result on top, the rest beneath */
  .rt--trades tr { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; }
  .rt--trades td::before { display: none; }
  .rt--trades td:nth-child(n) { grid-column: auto; }
  .rt--trades td.c-book { grid-column: 1; grid-row: 1; }
  .rt--trades td.c-inst { grid-column: 1 / 3; grid-row: 1; font: 600 16px/1.2 var(--sans); }
  .rt--trades td.c-book + td + td.c-inst, .rt--trades td.c-book ~ td.c-inst { grid-column: 2; }
  .rt--trades td.c-r { grid-column: 3; grid-row: 1; text-align: right; font: 600 16px/1.2 var(--sans); }
  .rt--trades td.c-tf { grid-column: 1; grid-row: 2; }
  .rt--trades td.c-closed { grid-column: 2; grid-row: 2; color: var(--ink-2); }
  .rt--trades td.c-status { grid-column: 3; grid-row: 2; text-align: right; font-size: 12px; }
  .rt--trades td.c-opened, .rt--trades td.c-pub { grid-column: 1 / -1; color: var(--muted); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
  .rt--trades td.c-opened { grid-row: 3; grid-column: 1 / 3; }
  .rt--trades td.c-risk { grid-column: 3; grid-row: 3; text-align: right; font-size: 12px; white-space: nowrap; }
  .rt--trades td.c-pub { grid-row: 4; }
  .rt--trades td.c-closed::before, .rt--trades td.c-opened::before, .rt--trades td.c-pub::before, .rt--trades td.c-risk::before { display: inline; content: attr(data-label); margin: 0 6px 0 0; font: 500 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .rt--trades td.c-side { grid-column: 1 / -1; grid-row: 5; font-size: 12px; color: var(--ink-2); }
  .rt--trades td.c-id { display: none; }

  /* the desk feed: instrument, timeframe and result on top, the books that took the trade on a line of their own,
     then entry and exit side by side (price above time), risk and R:R, and the publication line */
  .rt--feed tr { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rt--feed td.c-inst { grid-column: 1; grid-row: 1; }
  .rt--feed td.c-tf { grid-column: 2; grid-row: 1; }
  .rt--feed td.c-books { grid-column: 1 / -1; grid-row: 2; }
  .rt--feed td.c-entry { grid-column: 1 / 3; grid-row: 3; }
  .rt--feed td.c-exit { grid-column: 3; grid-row: 3; text-align: right; }
  .rt--feed td.c-exit .fill { align-items: flex-end; }
  .rt--feed td.c-entry::before, .rt--feed td.c-exit::before { display: block; content: attr(data-label); margin: 0 0 3px; font: 500 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .rt--feed td.c-risk { grid-column: 1 / 3; grid-row: 4; text-align: left; }
  .rt--feed td.c-rr { grid-column: 3; grid-row: 4; text-align: right; font-size: 12px; white-space: nowrap; }
  .rt--feed td.c-rr::before { display: inline; content: attr(data-label); margin: 0 6px 0 0; font: 500 10px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .rt--feed td.c-pub { grid-column: 1 / 3; grid-row: 5; }
  .rt--feed td.c-status { grid-column: 3; grid-row: 5; }
  .rt--feed td.c-side { grid-row: 6; }
  .bookchip { min-height: 30px; padding: 0 9px; }
}

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pager__info { color: var(--muted); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.pager__total { color: var(--muted); font-size: 13px; }
p.pager__total { margin-top: 12px; }
.found { color: var(--muted); font-size: 13px; margin: 14px 0 12px; }

/* ---------------------------------------------------------------------------------------------- forms */
.field { display: grid; gap: 7px; min-width: 0; }
.field__label { font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2);
  font-size: 16px; line-height: 1.4; color: var(--ink); -webkit-appearance: none; appearance: none; transition: border-color .15s ease, background-color .15s ease; }
.input::placeholder { color: #5d6675; }
.input:hover { border-color: #3a4352; }
.input:focus { outline: none; border-color: var(--accent); background: #0c1016; box-shadow: 0 0 0 3px rgba(155, 183, 238, .2); }
select.input { padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--surface); color: var(--ink); }
.input--area { min-height: 150px; resize: vertical; }
.field__hint { color: var(--muted); font-size: 12.5px; }
.field__error { color: var(--neg); font-size: 13px; font-weight: 500; }
.field--bad .input { border-color: var(--neg); }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filters .field--wide { grid-column: 1 / -1; }          /* phones: the order list has the longest choices */
.filters__actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.filters__actions .btn { flex: 1 1 0; }
.form { display: grid; gap: 20px; margin-top: 30px; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; min-height: 44px; color: var(--ink-2); font-size: 14.5px; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--accent); }
.formnote { color: var(--muted); font-size: 13px; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.alert { margin-top: 24px; padding: 14px 16px; border: 1px solid rgba(240, 115, 115, .5); border-radius: var(--radius-sm); background: rgba(240, 115, 115, .08); color: var(--ink); font-size: 14.5px; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); }
.toast .btn { box-shadow: 0 12px 34px rgba(0, 0, 0, .55); }
/* a record that became public since the visitor last looked: marked once by app.js, fades to the row's own ground */
@keyframes arrive { from { background-color: rgba(155, 183, 238, .2); } }
.rt tr.is-new { animation: arrive 2.6s ease-out 1; }

/* ---------------------------------------------------------------------------------------------- 640+ */
@media (min-width: 640px) {
  :root { --gutter: 28px; }
  .section { padding: 72px 0; }
  .section--top { padding-top: 48px; }
  .section--tight { padding-top: 8px; }
  .hero__cta { flex-direction: row; flex-wrap: wrap; }
  .hero__cta .btn { width: auto; }
  .hero__cta--center { justify-content: center; max-width: none; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }       /* a book: the headline, then 3 x 3 */
  .tiles--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tile--hero ~ .tile:last-child:nth-child(even) { grid-column: auto; }
  .statusbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .statusbar__item { border-top: 0; border-right: 1px solid var(--line); }
  .statusbar__item:last-child { border-right: 0; }
  .statusbar__item:last-child:nth-child(odd) { grid-column: auto; }
  .statusbar:not(.statusbar--compact) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .section__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .filterbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); align-items: end; }
  .filters .field--grow { grid-column: 1 / -1; }
  .filters .field--wide { grid-column: auto; }
  .filters__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .filters__actions .btn { flex: 0 0 auto; }
  .btn--wide { width: auto; min-width: 220px; justify-self: start; }
  .foot__grid { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); }
  .foot__brand { grid-column: auto; }
  .charts--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart { padding: 20px 20px 16px; }
}

/* ---------------------------------------------------------------------------------------------- 900+ */
@media (min-width: 900px) {
  :root { --top-h: 68px; }
  .nav-toggle, .nav-btn { display: none; }
  .nav { display: flex; position: static; flex-direction: row; align-items: center; gap: 30px; padding: 0; border: 0; background: none; max-height: none; overflow: visible; }
  .nav__link { min-height: 44px; font-size: 14px; border: 0; letter-spacing: .01em; }
  .nav__link:hover { color: var(--ink); }
  .nav__cta { margin: 0 0 0 6px; min-height: 40px; font-size: 13.5px; }
  .section { padding: 96px 0; }
  .section--top { padding-top: 60px; }
  .section--tight { padding-top: 0; }
  .split { grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
  .prose { font-size: 1.06rem; }
  .features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .features--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart__plot { height: 280px; }
  .chart__plot--tall { height: 380px; }
  .charts--three .chart__plot { height: 220px; }
  .btn--sm { min-height: 40px; }
  .chip { min-height: 36px; }
  .tab { min-height: 40px; }
  .rt { font-size: 14px; }
  .rt th, .rt td { padding-left: 14px; padding-right: 14px; }
  .rt--feed th, .rt--feed td { padding-left: 10px; padding-right: 10px; }      /* ten columns: tighter until there is room (1240+) */
  .rt--cards { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); border-collapse: separate; border-spacing: 0; overflow: hidden; }
  .rt--cards tbody tr:hover td { background: rgba(255, 255, 255, .025); }
  .tablewrap { border-radius: var(--radius); }
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
  .step { grid-template-columns: 1fr; padding: 0; gap: 16px; }
  .step::before { left: 56px; right: -18px; top: 22px; bottom: auto; width: auto; height: 1px; }
  .twin--block { padding: 0 18px 10px; }
}

/* --------------------------------------------------------------------------------------------- 1100+ */
@media (min-width: 1100px) {
  .books { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }                  /* a book: headline + 3, then 6 */
  .tile--hero { grid-column: span 3; }
  .tiles--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters { grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); }
  .filters .field--grow { grid-column: auto; }
  .tile { padding: 18px 18px 20px; }
  .tile__value { font-size: 1.6rem; }
  .tile--hero .tile__value { font-size: 3.5rem; }
}

/* --------------------------------------------------------------------------------------------- 1240+ */
@media (min-width: 1240px) {
  .rt--feed th, .rt--feed td { padding-left: 14px; padding-right: 14px; }
}

/* fine pointers get tighter controls; touch keeps 44 px targets whatever the width */
@media (pointer: coarse) {
  .chip, .tab, .btn--sm { min-height: 44px; }
}

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

@media print {
  .top, .foot__grid, .hero__canvas, .hero__veil, .hero__cta, .filterbar, .filters, .pager, .nav-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .chart, .tile, .bookcard, .feature { border-color: #bbb; background: #fff; }
}

/* very narrow phones */
@media (max-width: 349.98px) {
  .rt--dense tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
