/* radar — dark order-ticket terminal.
   One dark ground, one orange accent, soft rounded plates. */

:root {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #080909;
  --bg-2: #0b0c0c;
  --rail: #0b0c0c;
  --card: #111313;
  --card-2: #171919;
  --field: #1c1e1e;
  --field-2: #232626;
  --line: #202323;
  --line-soft: #171919;
  --line-strong: #2c3030;

  --ink: #f5f6f6;
  --ink-2: #ccd1d1;
  --ink-3: #8b9191;
  --ink-4: #878d8d;

  --accent: #ff8a1f;
  --accent-2: #ffa04d;
  --accent-soft: rgba(255, 138, 31, .11);
  --accent-line: rgba(255, 138, 31, .32);
  --up: #3ddc97;
  --down: #ff5c66;
  --up-soft: rgba(61, 220, 151, .12);
  --down-soft: rgba(255, 92, 102, .12);

  --radius: 10px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);

  /* One layout contract for the head and every workspace: a new screen gets
     the same board track and side column without naming either again. */
  --page-max: 1720px;
  --page-pad: 28px;
  --side-col: 350px;
  --col-gap: 18px;

  --t-quick: 120ms;
  --t-move: 220ms;
  --ease: cubic-bezier(.22, .8, .24, 1);

  /* The plot's ink, read by chart.js as it draws. */
  --lime: #3ddc97;
  --lime-dim: #2b8f66;
  --lime-bright: #ffffff;
  --label: #9aa0a0;
  --brand: #ff8a1f;
  --brand-bright: #ffb066;
  --ch-plate: #111313;
  --ch-grid: #1b1e1e;
  --ch-grid-2: #262a2a;
  --ch-frame: #2c3131;
  --ch-cross: #4b5252;
  --ch-note: #9aa0a0;
  --ch-vol: #232626;
  --ch-vol-hi: #333838;
  --ch-vol-plate: #0d0f0f;
  --ch-chip: #161818;
  --ch-chip-line: #3a4040;
  /* The volume lane's two sides, painted as they are: the alpha here is the
     weight of the bar, so nothing fades it a second time (chart.js). */
  --ch-up-fill: rgba(61, 220, 151, .28);
  --ch-down-fill: rgba(255, 92, 102, .24);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

/* --------------------------------------------------------------- width --- */
/* A page the app draws is never wider than the glass, whatever a chart was
   measured at when it was drawn. The plot is capped to its own box above, and
   this is the guard under it: no screen may be dragged left and right to find a
   column, a key or a chart's right edge. */
html { overflow-x: hidden; overflow-x: clip; }
.chart-wrap, .iv-main, .iv-grid, .col-main, .mkt-hero, .chart-card, .list-card { max-width: 100%; }.chart-top{ min-width: 0; max-width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }
svg { display: block; }

::selection { background: var(--accent); color: #111; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  padding: 9px 14px; border-radius: 10px; background: var(--accent); color: #111;
  font-weight: 600; transition: top var(--t-quick) var(--ease);
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ shell --- */
.shell {
  display: flex;
  height: 100dvh;
  min-height: 0;
  background: var(--bg);
}

/* ------------------------------------------------------------------- rail --- */
.rail {
  flex: 0 0 76px;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 0 18px;
  background: var(--rail);
  border-right: 1px solid var(--line-soft);
  z-index: 70;
}

.brand { display: grid; place-items: center; }

.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 8px;
  /* The scope itself is the mark: no plate behind it, and its linework takes
     the accent of the surface it sits on. */
  color: var(--accent);
  background: transparent;
}

.rail-brand { margin-bottom: 14px; }
.brand-mark img {
  display: block; width: 100%; height: 100%;
  border-radius: inherit; object-fit: contain;
}

.rail-switch, .rail-marks { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: center; }

.rail-tab {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background var(--t-quick), color var(--t-quick);
}
.rail-tab:hover { color: var(--ink); background: #151717; }
.rail-tab[aria-pressed="true"], .rail-tab.on, .rail-tab[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.rail-tab.rail-toggle { color: var(--ink-2); font-size: 0; }
.rail-tab.rail-toggle svg { width: 19px; height: 19px; }

/* The Tools mark is a disclosure, not a link: its menu names every tool, and
   each one is a page of its own. Nothing here needs a script to work - the
   browser opens the summary and every destination is a real link - while
   app.js adds the press-away and Escape that a menu is expected to answer. */
.rail-tools { position: relative; width: 100%; display: flex; justify-content: center; }
.rail-tools > summary { list-style: none; cursor: pointer; }
.rail-tools > summary::-webkit-details-marker { display: none; }
.rail-tools[open] > summary { color: var(--accent); background: var(--accent-soft); }
.rail-menu {
  position: absolute; left: calc(100% + 10px); top: -6px; z-index: 80;
  width: 246px; max-height: calc(100dvh - 24px); overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
.rail-menu-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 10px; border-radius: 7px; text-decoration: none;
}
.rail-menu-item:hover, .rail-menu-item:focus-visible { background: var(--field); }
.rm-name { color: var(--ink); font-size: 12.5px; font-weight: 600; }
.rm-note { color: var(--ink-3); font-size: 11px; }
.rail-menu-all {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; padding: 9px 10px 7px;
  border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 11.5px; text-decoration: none;
}
.rail-menu-all:hover { color: var(--accent); }

.rail-lbl { display: none; }
.rail-you { display: none; text-decoration: none; }

.rail-badge, .chip-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 15px; height: 15px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-size: 9px; font-weight: 700; line-height: 1;
}
.rail-badge[hidden], .chip-badge[hidden] { display: none; }

.rail-marks .acct, .rail-marks #signin {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 8px;
  /* A mark on the rail, not a plate: the account and the bell sit in the same
     column as the switch and take its shape - no outline, no fill, and the
     same hover the marks above them have. */
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px; font-weight: 600;
  overflow: hidden;
}
.rail-marks .acct:hover, .rail-marks #signin:hover { background: #151717; color: var(--ink); }
.rail-marks .acct[aria-current="page"],
.rail-marks .acct[aria-current="page"]:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.rail-marks .acct img, .rail-marks .acct svg { width: 20px; height: 20px; }
.rail-marks .acct .rail-lbl { display: none; }

/* ------------------------------------------------------------------ main ---- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ------------------------------------------------------------------ band ---- */
.tb-band {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px 6px;
}

.band-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }

.stat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
}
.stat-pill b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-pill .spark {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }

.tb-bell {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
}
.tb-bell:hover { color: var(--ink); border-color: var(--line-strong); }
.tb-bell-dot {
  position: absolute; top: 6px; right: 7px;
  min-width: 8px; height: 8px; padding: 0;
  border-radius: 999px; background: var(--accent);
  font-size: 0; box-shadow: 0 0 0 2px var(--card);
}
.tb-bell-dot[hidden] { display: none; }

/* The rail's bell: a mark in the bottom group, just above the account. */
.rail-marks .tb-bell {
  width: 44px; height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
}
.rail-marks .tb-bell:hover { background: #151717; color: var(--ink); }
.rail-marks .tb-bell-dot { box-shadow: 0 0 0 2px var(--rail); }
.ph-actions .tb-bell {
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-3);
}
.ph-actions .tb-bell:hover { background: #151717; color: var(--ink); }

/* ------------------------------------------------------------- page head ---- */
/* The shell's top line: the open pages on the left, the way to find another
   on the right. It is the same row on every screen - the rail's counterpart
   across the top - so a tab and the field keep their places when the view
   changes. The page's own title steps aside whenever pages are open. */
.page-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  height: 72px;
  padding: 0 calc(var(--page-pad) + var(--shell-gutter, 0px)) 0 var(--page-pad);
}
/* The board is the page, so a "Market" title beside it names something the
   reader is already looking at: the head's one job is finding an item, and the
   search takes the width the title was using. A pane's title is the exception -
   it says what the column is showing - and `ph-pane` is set with it (app.js). */
/* The page's name is always in the page: the board's own title would repeat the rows under it, so the h1 is read and not drawn, and the pane that names itself restores it. */
.ph-copy { order: 0; flex: 0 1 auto; min-width: 0; position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.page-head.ph-pane .ph-copy { position: static; width: auto; height: auto; margin: 0; padding: 0; overflow: visible; clip: auto; white-space: normal; display: block; }
.page-head:has(.tb-pages:not([hidden])) .ph-copy { position: absolute; }

.ph-copy h1 {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -.02em;
}
.ph-copy p { margin-top: 4px; color: var(--ink-4); font-size: 11.5px; }

/* The item page is a screen of its own, so the head carries the way off it.
   The rail's Market mark is the same move, a column away; this is the one a
   reader looks for at the page's own edge. Every other screen is already a
   destination, and the mark is not drawn there. */
.ph-back {
  order: -1;
  display: none;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-3);
}
.shell.item-view .ph-back { display: grid; }
.ph-back:hover { color: var(--ink); border-color: var(--line-strong); background: var(--field); }
.ph-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ph-actions {
  order: 2;
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1 1 auto;
}

.search-wrap { position: relative; }

.ph-search {
  display: flex; align-items: center; gap: 4px;
  flex: 1 1 auto; width: auto; height: 38px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color var(--t-quick);
}
.ph-search:focus-within { border-color: var(--line-strong); }

.search-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-4);
  cursor: pointer;
}
.search-mark:hover { color: var(--ink-2); }

.ph-search input {
  flex: 1 1 auto; min-width: 0;
  height: 100%;
  border: 0; background: transparent; outline: none;
  color: var(--ink); font-size: 12px;
}
.ph-search input::placeholder { color: var(--ink-4); }
.ph-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.ph-filter {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-3);
  cursor: pointer;
}
.ph-filter:hover { color: var(--ink); border-color: var(--line-strong); }

/* the answers */
.suggest {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 90;
  width: 320px; max-height: 340px; overflow: auto;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow);
}
.suggest[hidden] { display: none; }
.sug {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 7px 8px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-2);
  text-align: left; cursor: pointer;
}
.sug.on, .sug:hover { background: var(--field); color: var(--ink); }
.sug img { width: 26px; height: 26px; object-fit: contain; }
.sug .nm { flex: 1 1 auto; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug .p { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.sug .p i { font-style: normal; color: var(--ink-4); margin: 0 3px; }
.sug-note { padding: 12px; color: var(--ink-3); font-size: 12px; }
.suggest .loading { padding: 12px; color: var(--ink-3); font-size: 12px; }

/* open item tabs */
.tb-pages {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 0;
}
.tb-pages[hidden] { display: none; }
.tb-pages::-webkit-scrollbar { display: none; }
/* A strip wider than its glass is a draggable tab bar. The grab cursor is the
   only affordance the hidden scrollbar leaves; user-select keeps the names from
   being painted while a drag is in progress. */
.tb-pages.can-drag, .tb-pages.can-drag .tb-page, .tb-pages.can-drag .tb-page-open { cursor: grab; }
.tb-pages.can-drag .tb-page-x { cursor: pointer; }
.tb-pages.dragging,
.tb-pages.dragging .tb-page,
.tb-pages.dragging button { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* The pages a free account cannot open: one control at the end of the strip,
   in the strip's own shape. Dashed rather than solid because it is a place a
   page would go, not a page. It carries `data-upsell`, so the press opens the
   item-pages pitch (upsell.js) instead of leaving for the plans page; the href
   is what a browser without that file still follows. */
.tb-more {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink-4);
  font-size: 15px; line-height: 1; text-decoration: none;
  cursor: pointer;
}
.tb-more:hover, .tb-more:focus-visible {
  border-color: var(--accent); color: var(--accent); background: var(--field-2);
}
.tb-pages .tb-page img { -webkit-user-drag: none; }
/* The head mirrors the workspace below it: the tabs take the board's track and
   the field takes the side column's, so the field starts on the same edge as the
   item tools however many tabs are open. It holds that shape whether or not a
   page is open. It used to be conditional on the strip being in the document,
   and the strip is drawn by the boot: a refresh painted the field the whole line
   and then snapped it into the column when the pages arrived. With no pages the
   strip's track is simply empty and the field keeps its place. */
@media (min-width: 1081px) {
  .page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-col);
    column-gap: var(--col-gap);
  }
  .page-head .tb-pages { grid-column: 1; }
  .page-head .ph-actions {
    grid-column: 2;
    margin-left: 0;
  }
  /* The item page's way back is a column of its own, before the tabs: held open
     only while the mark is drawn, so the field keeps the side column's edge and
     the market's head keeps its two tracks. Without a track of its own the mark
     became a grid item above the tabs and pushed them to a second row. */
  .shell.item-view .page-head {
    grid-template-columns: auto minmax(0, 1fr) var(--side-col);
  }
  .shell.item-view .page-head .ph-back { grid-column: 1; }
  .shell.item-view .page-head .tb-pages { grid-column: 2; }
  .shell.item-view .page-head .ph-actions { grid-column: 3; }
}
/* Ten names will not fit a phone, and a strip with no scrollbar and no edge
   fade looks like it ended at the second tab. The same fade the sort strip
   wears: only while a page is still beyond the edge (item.js repaints it). */
.tb-pages.more {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}
.tb-page {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 4px 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  flex: 0 0 auto;
}
.tb-page.on { border-color: var(--accent-line); background: var(--accent-soft); }
.tb-page-open {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; color: var(--ink-3);
  padding: 4px 4px; cursor: pointer; font-size: 12px;
}
.tb-page.on .tb-page-open { color: var(--ink); }
.tb-page-open img { width: 18px; height: 18px; object-fit: contain; }
.tb-page-x {
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-4); cursor: pointer; font-size: 14px;
}
.tb-page-x:hover { background: var(--field-2); color: var(--ink); }

/* -------------------------------------------------------------- workspace --- */
.workspace {
  flex: 1 1 auto;
  min-height: 0;
  /* The viewport, not the board's figures, decides how wide the column is:
     zeroed, no child can re-impose a min-content floor on it. */
  min-width: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 0 var(--page-pad) var(--page-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-col);
  gap: var(--col-gap);
  align-items: start;
  scrollbar-color: #2a2e2e transparent;
}

.col-main { display: flex; flex-direction: column; gap: var(--col-gap); min-width: 0; }
/* A terminal is read across, but only so far: past 1720px the row's numbers drift
   away from the item they belong to. The head is capped with the board so the
   search stays over the board's own left edge. */
.page-head, .workspace { width: 100%; max-width: var(--page-max); margin-inline: auto; }
/* The width above is not redundant with the stretch: an `auto` margin on a
   flex item cancels it, and the column shrink-fit to its widest row instead -
   338px on every phone, and 18px past a 320 screen. */
.col-side { display: flex; flex-direction: column; gap: var(--col-gap); min-width: 0; position: sticky; top: 0; }

/* ----------------------------------------------------------------- cards ---- */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 20px;
  min-width: 0;
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-acts { display: flex; align-items: center; gap: 8px; }
/* A locked trade card's premium mark lives in the header, so it is visible
   while the card is folded and the body's lock has not been opened. The crown
   is also the way to the pitch. */
.card-crown {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 26px; height: 26px;
  border: 1px solid var(--accent-line); border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  text-decoration: none;
  transition: background var(--t-quick), border-color var(--t-quick);
}
.card-crown[hidden] { display: none; }
.card-crown:hover, .card-crown:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  outline: 0;
}
.card-crown:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-crown svg { width: 13px; height: 13px; }
@media (max-width: 620px) {
  .card-crown { width: 34px; height: 34px; }
}
/* The item column's three cards fold from the whole head, not just the arrow, so
   the bar says it is pressable and a press on it never leaves the title
   selected. The arrow stays the tab stop. */
.calc-card .card-head,
.fill-card .card-head,
.press-card .card-head {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.card-note { color: var(--ink-4); font-size: 11px; }
.card-kicker { display: block; color: var(--ink-3); font-size: 12px; }

/* -------------------------------------------------------------- chart card -- */
.chart-card { padding: 20px 20px 14px; }

.mkt-chart[hidden] { display: none; }

.mkt-chart-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.mkt-chart-copy { display: flex; flex-direction: column; gap: 2px; }
.mkt-chart-figs { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mkt-chart-value {
  font-size: 32px; font-weight: 600; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.mkt-chart-move {
  font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  background: var(--up-soft); color: var(--up);
}
.mkt-chart-move.down, .mkt-chart-move.bad { background: var(--down-soft); color: var(--down); }
.mkt-chart-move.flat { background: var(--field); color: var(--ink-3); }
.mkt-chart-sub { margin-top: 6px; line-height: 1; }
/* The mover's own name: the kicker above says what the ranking is, and the name
   is a chip - the one thing on the card that is the item rather than a number.
   A link, because the next thing to do with a mover is open it. */
.mkt-chart-name {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 10px 4px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--field-2);
  color: var(--ink); font-size: 12px; font-weight: 600;
  text-decoration: none;
}
.mkt-chart-name .ico { width: 16px; height: 16px; }
.mkt-chart-name img { width: 16px; height: 16px; object-fit: contain; }
.mkt-chart-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-chart-name:hover span { text-decoration: underline; }

.mkt-chart-plot { margin-top: 12px; height: 190px; }
.mkt-chart-plot svg { display: block; }

.chart-empty-note { padding: 8px 4px 12px; }
.chart-empty-note p { color: var(--ink-4); font-size: 12px; margin-top: 6px; }
/* The chart is drawn after the boot, and the note that stands in for it is a
   third of the plot's height. Until the two were the same, the list beneath
   stood high and was pushed down the moment the chart landed - the market's
   biggest jump on a reload. The card keeps the drawn height while the note
   shows, so the chart fills the space it always had instead of taking it. The
   figures are the plot plus the head at the two plot sizes (190 + 138, and
   170 + 133 at the 860 breakpoint, where the plot becomes 170px). */
#mkt-hero:has(.mkt-chart[hidden]) { min-height: 328px; }
@media (max-width: 860px) {
  #mkt-hero:has(.mkt-chart[hidden]) { min-height: 303px; }
}

/* the segmented pills used by chart + filters */
.chips {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.chips button {
  height: 26px; min-width: 34px;
  padding: 0 10px;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--ink-4);
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: background var(--t-quick), color var(--t-quick);
}
.chips button:hover { color: var(--ink-2); }
.chips button.on {
  background: var(--field-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* -------------------------------------------------------------- list card --- */
/* The board's live region is a 1x1 `sr-only` box beside the table, not inside
   it, so the card has to be its containing block: resolved against the page
   instead, its one pixel landed at the foot of a five-thousand-pixel table and
   the document scrolled that far past the shell - into empty background. */
.list-card { position: relative; padding: 4px 6px 8px; overflow: hidden; }

.board-body { overflow-x: auto; position: relative; }
/* The board is a programmatic focus target (the skip link lands here), so a
   mouse press paints no ring around the whole window; a keyboard visit does. */
.board-body:focus:not(:focus-visible) { outline: none; }
.board-body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.board-body .sortbar { display: none; }

.board-body table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.board-body table.grid caption {
  padding: 16px 14px 12px;
  text-align: left;
  caption-side: top;
}
.board-title {
  display: inline-block;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
}
.board-meta { margin-left: 8px; color: var(--ink-4); font-size: 11px; }
.board-meta.stale { color: var(--accent); }

.board-body thead th {
  position: sticky; top: 0; z-index: 4;
  padding: 8px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  color: var(--ink-4);
  font-size: 10.5px; font-weight: 500;
  text-align: right;
  white-space: nowrap;
}
.board-body thead th:first-child { width: 34px; }
.board-body thead th:nth-child(2) { text-align: left; }
.board-body thead th .sort {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: transparent; padding: 2px 0;
  color: inherit; font: inherit; cursor: pointer;
}
.board-body thead th .sort:hover { color: var(--ink-2); }
.board-body thead th[aria-sort] .sort { color: var(--ink); }
.board-body thead th .caret { font-size: 9px; color: var(--accent); }

.board-body tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.board-body tbody tr:last-child td { border-bottom: 0; }
.board-body tbody tr { cursor: pointer; transition: background var(--t-quick); }
.board-body tbody tr:hover { background: #151717; }
.board-body tbody td.name { text-align: left; font-family: var(--sans); font-size: 13px; color: var(--ink); }
.board-body tbody td.star-cell { padding-left: 8px; width: 34px; }

.item-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.item-cell img {
  width: 30px; height: 30px; object-fit: contain;
  padding: 3px;
  border-radius: 6px;
  background: var(--field);
  flex: 0 0 auto;
}
.item-cell .nm {
  color: var(--ink); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-cell .nm:hover { color: var(--accent-2); }
.item-cell .f2p {
  font-size: 8.5px; font-weight: 600; letter-spacing: .04em;
  padding: 1px 5px; border-radius: 5px;
  background: var(--field); color: var(--ink-4);
}
.item-cell .f2p.new { background: var(--accent-soft); color: var(--accent); }
.item-cell .row-spark {
  flex: 0 0 44px; width: 44px; height: 14px;
  margin-left: auto; overflow: visible;
}
.item-cell .row-spark path {
  fill: none; stroke: var(--ink-4); stroke-width: 1.2;
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.item-cell .row-spark.up path { stroke: var(--up); }
.item-cell .row-spark.down path { stroke: var(--down); }
.item-cell .row-spark.empty {
  /* `.board-body .empty` pads an empty board's message; this span is an empty
     series, not that message, and its 112px of padding made a one-line row
     113px tall. The placeholder is a hairline and nothing else. */
  height: 1px; min-height: 0; padding: 0;
  border-top: 1px dashed var(--line); align-self: center;
}

.star {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: 0; border-radius: 5px;
  background: transparent; color: var(--ink-4);
  cursor: pointer; font-size: 13px;
}
.star:hover { background: var(--field); color: var(--ink-2); }
.star.on { color: var(--accent); }
.star svg { width: 14px; height: 14px; }

/* The window a change is measured over. The desk's column header names it, so
   the label is drawn only where that header is not: on a phone's card. */
.mkt-win { display: none; }

.mkt-delta {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--mono); font-size: 11px;
  background: var(--field); color: var(--ink-3);
}
td.up .mkt-delta, .mkt-delta.up { background: var(--up-soft); color: var(--up); }
td.down .mkt-delta, .mkt-delta.down { background: var(--down-soft); color: var(--down); }

.bar-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.bar-cell .bar {
  display: block; width: 64px; height: 3px;
  border-radius: 999px; background: var(--field);
  overflow: hidden;
}
.bar-cell .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar-cell .num { font-size: 11.5px; }
.vol-short { display: none; }

.board-body .hide-xs, .board-body .hide-sm, .board-body .hide-md { display: table-cell; }

.board-body .suspect { color: var(--accent-2); }
/* The warning is in a title, and a finger has no hover: the mark is the same
   warning, drawn - the label carries it for a reader who cannot see either. */
.suspect-mark {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; margin-left: 4px;
  border: 1px solid currentColor; border-radius: 50%;
  font: 600 9px/1 var(--sans); vertical-align: 2px;
}

.board-body .empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-3);
}
.board-body .empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.board-body .empty p { font-size: 12px; }

.loadmore { display: none; }
.sortbar { display: none; }

/* the pager */
/* Before the boot has a list to page there is no pager: the empty bar's border
   was a line that appeared for the length of the market read and moved when its
   own buttons arrived. The app fills it and unhides it together. */
.pager:empty { display: none; }
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 14px 6px;
  border-top: 1px solid var(--line-soft);
}
.pager[hidden] { display: none; }
.pg-nums { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.pg {
  min-width: 28px; height: 28px;
  padding: 0 7px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono); font-size: 11px;
  cursor: pointer;
}
.pg:hover { background: var(--field); color: var(--ink); }
.pg.on { background: var(--field-2); color: var(--ink); border-color: var(--line-strong); }
.pg[disabled] { opacity: .35; cursor: default; }
.pg-info { color: var(--ink-4); font-size: 11px; font-family: var(--mono); }

/* ------------------------------------------------------------- movers ------ */
.movers-card { padding: 16px 16px 8px; }
.movers-card[hidden] { display: none; }
/* On a stacked layout the movers sit between the chart and the filter band, and
   they are read after the board's first rows: the card arriving opened a 306px
   hole under the chart and pushed the filters and the list down the screen - the
   last big jump a reload showed at these widths. Its slot is kept from the
   first paint (the card is empty for the length of one read), so the ranking
   fills the space instead of making it. The figure is the card's own seven
   40px rows plus its padding; the list is what counts, not `hidden`, because the
   card is unhidden a beat before its rows are drawn. */
@media (min-width: 621px) and (max-width: 1080px) {
  .movers-card[hidden],
  .movers-card:not(:has(.mkt-top-list > *)) { display: block; min-height: 306px; }
}
/* The hero and the list beside it are one ranking with no heading of their
   own: the ranking is named on the card itself, so both cards start at the top
   of the column, level with the filters beside them. */
.mkt-top-list { display: flex; flex-direction: column; }
/* Four columns, the last sized to its chip and flush with the row's right edge:
   a long name shrinks the name column (it ellipsizes) and never moves the
   percent, so every row's chip - and the number in it - ends at the same x. */
.mkt-top-row {
  display: grid; align-items: center;
  grid-template-columns: 13px auto minmax(0, 1fr) auto;
  column-gap: 9px;
  padding: 8px 6px;
  border-radius: 10px;
  color: var(--ink-2);
  /* The card is stretched to the hero's height: the rows share whatever room
     it has, so the last one sits on the card's floor instead of leaving a
     strip of nothing under it. */
  flex: 1 1 0;
  min-height: 40px;
}
.mkt-top-row:hover { background: var(--field); }
.mkt-top-row img { width: 24px; height: 24px; object-fit: contain; }
/* Where the row stands: the first mover is the wide card, so the list is
   numbered from 2. The digit starts at the row's own inset rather than being
   pushed right inside its box, so the space before the number is the one the
   change pill leaves after itself on the card's other edge. */
.mkt-top-rank {
  flex: 0 0 auto; width: 13px; text-align: left;
  font-family: var(--mono); font-size: 10px; color: var(--ink-4);
}
/* The one column that gives way: the name ellipsizes at its own edge, a gap
   short of the chip, so a long one never reaches the percent. */
.mkt-top-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px;
}
/* The chip is as wide as the number it carries and never narrower: a move can
   run to four digits. It is the grid's last column, so its right edge is the
   row's right edge whatever the name beside it does; `nowrap` keeps a long
   percent on one line, and `min-width` keeps short ones the size they were. */
.mkt-top-chg {
  justify-self: end; min-width: 54px; text-align: right; white-space: nowrap;
  font-family: var(--mono); font-size: 11px;
  padding: 2px 6px; border-radius: 6px;
  background: var(--field); color: var(--ink-3);
}
.mkt-top-chg.up { background: var(--up-soft); color: var(--up); }
.mkt-top-chg.down { background: var(--down-soft); color: var(--down); }

/* The card's own failure: a line, and the press that asks the week again. It is
   the only reading of the week on the page, so a failed read cannot quietly
   look like a quiet market. */
.mkt-top-fail {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 6px;
  font-size: 12px; color: var(--ink-3);
}
.mkt-top-fail .link { font-size: 12px; }

/* ------------------------------------------------------------- calculator --- */
.calc-card { padding: 16px; }
.calc-card .card-head { margin-bottom: 12px; }
/* An item page is one screen: the plot and the column beside it share the
   window, and the column's cards are tightened to fit it, so neither the page
   nor the column grows a scrollbar. */
/* An item page is one screen: the plot and the column beside it share the
   window, and the column's cards are tightened to fit it, so neither the page
   nor the column grows a scrollbar. */
@media (min-width: 1181px) {
  .shell.item-view #board { height: calc(100dvh - 72px); overflow: hidden; }
  .shell.item-view .col-side {
    display: flex; flex-direction: column; gap: 10px;
    min-height: 0; max-height: 100%; overflow-y: auto;
  }
  .shell.item-view .col-side > .card { min-height: 0; flex: 0 0 auto; }
  .shell.item-view .calc-card { padding: 10px 12px; }
  /* The ticket's own height until its plate is drawn: the card arrives with
     the item, and on a reload an empty body made the two cards under it move
     down 411px when `renderCalc` filled it. The figure is the drawn card at
     this width (the same for every item); a folded card is left alone. */
  .shell.item-view .calc-card:not(.min):has(.calc-body:empty) { min-height: 458px; }
  .shell.item-view .calc-card .card-head { margin-bottom: 6px; }
  .shell.item-view .calc-card .tool { gap: 5px; }
  .shell.item-view .calc-plate { padding: 9px 10px; }
  .shell.item-view .calc-field { gap: 3px; }
  .shell.item-view .fill-card { padding: 10px 12px; }
  .shell.item-view .fill-card .card-head { margin-bottom: 5px; }
  .shell.item-view .fill-body { gap: 4px; }
  .shell.item-view .fill-top { padding-bottom: 6px; }
  .shell.item-view .fill-row { padding: 2.5px 0; }
  .shell.item-view .fill-badge { width: 30px; height: 30px; }
  .shell.item-view .fill-note { font-size: 9px; line-height: 1.4; }
  .shell.item-view .press-card { padding: 7px 12px; }
  .shell.item-view .press-card .card-head { margin-bottom: 5px; }
  .shell.item-view .press-body { gap: 5px; }
  /* The item page is one screen: the tape and the lede tighten together so the
     card still reads at the column's shorter height. */
  .shell.item-view .press-body { gap: 7px; }
  .shell.item-view .press-tape { height: 22px; }
  .shell.item-view .press-lead b { font-size: 28px; }
}

.note-hint { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.calc-body { display: flex; flex-direction: column; gap: 10px; }

/* A card's own fold: the head stays and the body goes, so a column of cards can
   be narrowed to the one being read. The mark lives in the head, beside the
   title it names. */
.card-min {
  display: grid; place-items: center;
  width: 24px; height: 24px; margin: -6px -6px -6px 0;
  padding: 0; border: 1px solid transparent; border-radius: 5px;
  background: none; color: var(--ink-4); cursor: pointer;
  transition: color var(--t-quick), border-color var(--t-quick), background-color var(--t-quick);
}
.card-min:hover, .card-min:focus-visible {
  color: var(--ink); border-color: var(--line); background: var(--bg-2);
}
.card-min:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.card-min svg {
  width: 10px; height: 6px; fill: none;
  stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--t-quick);
}
.card.min > :not(.card-head) { display: none; }
.card-min[hidden] { display: none; }
/* The body's gap is not part of a bar whose body is gone: leaving it in put
   the title half its margin above the centre. The item view's own card rules
   set that gap at four classes, so the folded item cards are named with them. */
.card.min .card-head,
.shell.item-view .card.min .card-head { margin-bottom: 0; }
.card.min .card-min svg { transform: rotate(-90deg); }

/* The fill estimate: the pitch card's artwork, read at the rail's own size and
   from the item's buckets rather than a mock. */
.fill-card { display: none; padding: 16px; }
.shell.item-view .fill-card { display: block; }
/* The calculator is the item page's ticket, and its card frame is in the
   server's shell: it is on the glass from the first paint, so a reload waits
   in the tool the reader came for rather than under a bare head. The two
   readings below it need the live item's flow, so those wait for the app's own
   `.itemview`; the reserved heights keep the page still when they arrive. */
.shell.item-view:not(:has(#board .itemview:not(.ssr))) .fill-card,
.shell.item-view:not(:has(#board .itemview:not(.ssr))) .press-card { display: none; }
/* On a stacked layout the board is above the ticket, so a ticket painted before
   the board is pushed down by the item's own height when it lands. The desk's
   side column has no such move: there the ticket can wait from the first
   paint, in the column it belongs to. */
@media (max-width: 1080px) {
  .shell.item-view:not(:has(#board .itemview:not(.ssr))) .calc-card { display: none; }
}
.fill-card .card-head { margin-bottom: 10px; }
.fill-body { display: flex; flex-direction: column; gap: 9px; }
.fill-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.fill-top > span:not(.fill-badge) { color: var(--ink-4); font-size: 10.5px; line-height: 1.4; }
.fill-badge {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--bg-2); color: var(--accent);
  font-family: var(--mono); font-size: 10px;
}
.fill-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-3); font-size: 10.5px;
}
.fill-row b { color: var(--ink); font-family: var(--mono); font-size: 10.5px; font-weight: 400; }
.fill-row b.up { color: var(--up); }
.fill-row b.down { color: var(--down); }
.fill-row-last { border-bottom: 0; padding-bottom: 0; }
.fill-bar { height: 5px; margin: 2px 0; overflow: hidden; border-radius: 999px; background: var(--bg-2); }
.fill-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--line-strong), var(--accent)); }
/* The buy/sell pressure: the same day's trade split by the price it went
   through at, green for the volume at the sell price and red for the volume at
   the buy price. */
.press-card {
  display: none;
  padding: 16px;
}
.shell.item-view .press-card { display: block; }
.press-card .card-head { margin-bottom: 12px; }
.press-acts { display: flex; align-items: center; gap: 8px; }
.press-body { display: flex; flex-direction: column; gap: 12px; }

/* A card the plan has not unlocked: the question the card answers and the way
   to the pitch that sells it. The head and fold stay - the card says what it
   holds - so the body is the whole lock, and the button is the one press. */
.card-lock { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.card-lock p { margin: 0; color: var(--ink-3); font-size: 10.5px; line-height: 1.55; }
.card-lock .pro-cta { margin-top: 0; }

/* The pitch's picture of either card: the page's own classes in the pitch's
   frame, so the rows, the badge, the tape and the ledger are not a likeness. */
.pitch-card {
  width: 100%; box-sizing: border-box; text-align: left;
  padding: 14px 15px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card, var(--bg-2));
}
.pitch-card.fill-body { gap: 7px; }
.pitch-card.press-body { gap: 11px; }
.pitch-card .fill-top { padding-bottom: 9px; }
.pitch-card .fill-badge { width: 34px; height: 34px; }
.pitch-card-src { color: var(--ink-4); font-size: 10.5px; }
.pitch-card-src b { color: var(--ink-2); font-weight: 500; }
/* The fill card is six rows and a badge; at its page padding it is 260px, which
   pushes the way out of the sheet past a 640px phone. The rows tighten here so
   the card, the pill, the CTA and the line under it all stay on the sheet. */
@media (max-width: 700px) {
  .pitch-card { padding: 10px 12px; }
  .pitch-card.fill-body { gap: 3px; }
  .pitch-card .fill-top { padding-bottom: 7px; }
  .pitch-card .fill-badge { width: 30px; height: 30px; font-size: 9.5px; }
  .pitch-card .fill-row { padding: 4px 0; }
}

/* The card's lede: which side owns the day, its share, and the ratio beside it.
   The share is the one figure the eye should land on first; everything under it
   explains how the day got there. */
.press-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0 10px;
  padding: 2px 0 1px;
}
.press-kicker {
  grid-column: 1 / -1;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 7px;
  color: var(--ink-4);
  font-size: 8.5px; font-weight: 600; line-height: 1;
  letter-spacing: .12em; text-transform: none;
}
.press-kicker::before {
  content: ""; flex: 0 0 5px; width: 5px; height: 5px;
  border-radius: 999px; background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .03);
}
.press-hero.up .press-kicker { color: var(--up); }
.press-hero.down .press-kicker { color: var(--down); }
.press-hero.even .press-kicker { color: var(--ink-3); }
.press-lead { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.press-lead b {
  color: var(--ink);
  font-family: var(--mono); font-size: 34px; font-weight: 500;
  line-height: .88; letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.press-lead i {
  margin-left: 2px; color: var(--ink-3);
  font-style: normal; font-size: 12px; letter-spacing: 0;
}
.press-lead span { color: var(--ink-4); font-size: 9.5px; line-height: 1.25; }
.press-ratio { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-bottom: 1px; }
.press-ratio b {
  color: var(--ink-2);
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.press-ratio em {
  color: var(--ink-4); font-style: normal;
  font-size: 8px; letter-spacing: .1em; text-transform: none;
}
.press-hero.up .press-ratio b { color: var(--up); }
.press-hero.down .press-ratio b { color: var(--down); }

/* The day's rhythm without a second axis: one tick per slice, height by the
   trade it held, colour by the side that took the larger part. */
.press-tape {
  display: flex; align-items: flex-end; gap: 2px;
  height: 30px; padding: 0 1px 1px;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.press-tick { flex: 1 1 0; min-width: 0; border-radius: 1px 1px 0 0; background: var(--line); }
.press-tick.up { background: var(--up); }
.press-tick.down { background: var(--down); }
.press-tick.flat { height: 2px; background: var(--line-strong); opacity: .75; }

/* The whole day in one line, with the even mark underneath and the notch where
   the split actually fell. */
.press-rail {
  position: relative; display: flex;
  height: 8px; overflow: hidden;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}
.press-fill { display: block; height: 100%; }
.press-fill.buy { background: linear-gradient(90deg, rgba(61, 220, 151, .3), var(--up)); }
.press-fill.sell { background: linear-gradient(90deg, var(--down), rgba(255, 92, 102, .3)); }
.press-notch {
  position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
  border-radius: 2px; background: var(--ink);
  box-shadow: 0 0 0 2px var(--card);
}
.press-even {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: rgba(8, 9, 9, .65);
}

.press-ledger { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.press-ledger span {
  display: flex; flex-direction: column; gap: 2px;
  padding-top: 8px; border-top: 1px solid var(--line-soft);
}
.press-ledger span:last-child { align-items: flex-end; text-align: right; }
.press-ledger em {
  color: var(--ink-4); font-style: normal;
  font-size: 8.5px; letter-spacing: .1em; text-transform: none;
}
.press-ledger b {
  color: var(--ink-2);
  font-family: var(--mono); font-size: 11px; font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.press-ledger .up b { color: var(--up); }
.press-ledger .down b { color: var(--down); }
.press-empty {
  margin: 0; padding: 16px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-xs);
  color: var(--ink-4); font-size: 10.5px; line-height: 1.5; text-align: center;
}

.tool { display: flex; flex-direction: column; gap: 10px; }

.tool-note { color: var(--down); font-size: 11px; }

/* the two big price plates, as on an order ticket */
/* `minmax(0, 1fr)`, not `1fr`: a track's floor is otherwise its content's, and
   a text box's own width would hold both plates wider than the card. */
.calc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.calc-row.one { grid-template-columns: minmax(0, 1fr); }

.calc-plate {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  /* A press on one of these lights that side, so it is a button and says so on
     the way past: the quote is the page's number, not the reader's. */
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--t-quick), background-color var(--t-quick),
    transform var(--t-quick), box-shadow var(--t-quick);
}
.calc-plate.buy { border-color: rgba(61, 220, 151, .22); background: rgba(61, 220, 151, .06); }
.calc-plate.sell { border-color: rgba(255, 92, 102, .22); background: rgba(255, 92, 102, .06); }
/* The lit side is the one being read: its own colour at full strength while the
   other sits back at its resting tint. Hover only hints that the press is
   there - it can change which side is lit, and nothing else on the ticket. */
.calc-plate:hover, .calc-plate:focus-visible { border-color: var(--line-strong); }
.calc-plate.buy.on {
  border-color: rgba(61, 220, 151, .55);
  background: rgba(61, 220, 151, .12);
  box-shadow: 0 6px 18px rgba(61, 220, 151, .10);
}
.calc-plate.sell.on {
  border-color: rgba(255, 92, 102, .55);
  background: rgba(255, 92, 102, .12);
  box-shadow: 0 6px 18px rgba(255, 92, 102, .10);
}
.calc-plate:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.calc-plate:hover span, .calc-plate.on span { color: var(--ink-2); }
.calc-plate span { color: var(--ink-4); font-size: 10.5px; text-transform: none; letter-spacing: .05em; }
.calc-plate b {
  color: var(--ink);
  font-family: var(--mono); font-size: 17px; font-weight: 600;
}
/* The unit sits on the figure's own line and against it, the way a price is
   written: "1,250gp", not a number with a caption under it and not a number at
   one edge with its unit at the other. The two are one group and the group is
   centred: the box is only as wide as what is typed (field-sizing), so the
   digits and their unit travel together instead of the digits centring in a box
   that runs to the plate's edge while the unit stays behind at it. */
.calc-plate .amt { display: flex; align-items: baseline; justify-content: center; gap: 2px; min-width: 0; }
.calc-plate .amt b { flex: 0 1 auto; min-width: 0; text-align: center; }
.calc-plate em { color: var(--ink-4); font-style: normal; font-size: 10px; }

/* A field is a stack: what it is, then one row of the stepper, the box, and the
   number a trade usually starts from. The target and the quantity are laid out
   the same way, so they read as one column of fields. Both suggestions are
   pressable - that is what the buy limit's chip was, now with room to say what
   it is. */
.calc-field { display: flex; flex-direction: column; gap: 5px; padding: 2px 2px 0; }
.calc-field label { color: var(--ink-3); font-size: 11px; }
/* The suggestion shares the label's line and sits immediately after it - not at
   the row's far edge - so the field reads "what this is, and what the trade
   usually starts at" in one glance before the box itself. */
.calc-head { display: flex; align-items: center; justify-content: flex-start; gap: 7px; min-width: 0; }
.calc-field .numbox { display: flex; align-items: center; gap: 4px; }
.calc-field input {
  flex: 1 1 auto; min-width: 0; width: 0; height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  text-align: center;
  padding: 0 9px;
  font-family: var(--mono); font-size: 13px;
  outline: none;
}
.calc-field input:focus { border-color: var(--line-strong); }
.numbox button {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--ink-3);
  cursor: pointer;
  line-height: 1;
}
.numbox button:hover { color: var(--ink); border-color: var(--line-strong); }
/* A suggested value, in the one chip the app offers it in: a dashed hairline and
   the market's own mono digits, quiet enough to read as an offer rather than as
   the value the box already holds, solid enough to be seen at 10px. The
   calculator keeps one beside each field's label; the alert condition dialog
   keeps one under its target. It is not called `suggest` because the search's
   answer list owns that name, and its absolute positioning would pull this chip
   out of its row. */
.suggest-chip {
  display: inline-flex; align-items: center;
  box-sizing: border-box;
  min-height: 17px; padding: 0 6px;
  border: 1px dashed var(--line-strong); border-radius: 6px;
  background: var(--bg-2); color: var(--ink-2);
  font-family: var(--mono); font-size: 10px; line-height: 1.3;
  text-align: left; cursor: pointer;
}
.suggest-chip:hover { color: var(--ink); border-color: var(--accent-line); }
/* The calculator's is a single number on its label's line: it must keep that
   line's height and never fold onto a second one. */
.calc-field .suggest-chip { flex: 0 0 auto; white-space: nowrap; }
/* A phone's suggestion is a value beside a label, not a row action: the 44px
   floor turned two small numbers into two tall blocks and made each label line
   as tall as the input under it. The alert editor's chip keeps that floor
   because it is a press on a line of its own. */
@media (max-width: 620px) {
  .calc-field .suggest-chip {
    min-width: 0; min-height: 28px;
    padding: 0 7px; font-size: 10px;
  }
}

.calc-out { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
/* Four rows of money under one another, so their figures share one right edge.
   The hero is a panel with a 1px border and 12px of padding, which puts its
   figure 13px in from the card edge; its three workings above it had no padding
   and ended on the card's own edge, so they read as a different column. The
   plain rows carry the hero's inset and the four figures line up. */
.calc-out > div {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-right: 13px;
  color: var(--ink-4); font-size: 11.5px;
}
.calc-out b { color: var(--ink-2); font-family: var(--mono); font-weight: 500; font-size: 12px; }
.calc-out .hero {
  margin-top: 2px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-3);
}
.calc-out .hero b { font-size: 17px; font-weight: 600; }
/* The sale is a sum, not a statement: the value, the fee taken out of it, and a
   rule under the pair that the answer sits beneath. The rule is the result
   row's own top border, so it meets the card's edges the way the figures above
   it meet their right edge, and the answer reads as what the two lines come to. */
.calc-out .sum {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.calc-out .sum b { color: var(--ink); }
.calc-out b.up, .calc-out .hero b.up { color: var(--up); }
.calc-out b.down, .calc-out .hero b.down { color: var(--down); }
.calc-out .sub, .calc-out p.sub { color: var(--ink-4); font-size: 11.5px; }

.tool-pad { display: flex; flex-direction: column; min-height: 260px; }
.note-box { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.note-pad {
  flex: 1 1 auto; min-height: 200px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--sans); font-size: 12.5px; line-height: 1.6;
  resize: vertical;
  outline: none;
}
.note-pad:focus { border-color: var(--line-strong); }
.note-state { color: var(--ink-4); font-size: 10.5px; }
.note-state.bad { color: var(--down); }

/* The item's pad is a dialog, not a destination: it opens over the item it
   belongs to and leaves the five-tab navigation alone. */
.note-modal {
  position: fixed; inset: 0; z-index: 125;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.note-modal.on { display: flex; }
body:has(#notes-modal.on) { overflow: hidden; }
.note-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); }
.note-dialog {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: min(560px, 100%); max-height: calc(100dvh - 32px);
  padding: 18px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.note-head h3 { font-size: 17px; font-weight: 600; }
.note-body { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.note-body .note-box { min-height: 0; }
.note-body .note-pad { min-height: 240px; resize: none; }
@media (max-width: 620px) {
  .note-body .note-pad { min-height: 36dvh; }
}

/* --------------------------------------------------------------- filters ---- */
.facets {
  position: fixed;
  top: 0; bottom: 0; left: 76px;
  width: 336px;
  z-index: 65;
  display: flex; flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--line);
  box-shadow: 30px 0 60px -40px rgba(0, 0, 0, .95);
  transform: translateX(-105%);
  transition: transform var(--t-move) var(--ease);
  visibility: hidden;
}
.facets.open { transform: none; visibility: visible; }
.facets .rail-body { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.facets .rail-pane { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.facets .rail-pane[hidden] { display: none; }

/* The filters are the market column's own card, where the ticket used to sit. */
.filters-card {
  display: none;
  flex-direction: column;
  padding: 0;
  overflow: visible;
}
.shell[data-screen="market"] .filters-card { display: flex; padding: 0; }
.shell[data-screen="market"] .calc-card { display: none; }
.filters-card .rail-pane { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.filters-card .rail-pane[hidden] { display: none; }
.filters-card .facets-body { padding: 14px 16px 18px; overflow: visible; }
.filters-foot { display: none; }
#filters-open { display: none; position: relative; }
/* The filters belong to the market's column, not to an item or a document. */
.shell:not([data-screen="market"]) #filters-open { display: none; }
.board-filter {
  display: none; position: relative;
  flex: 0 0 auto; align-items: center; gap: 6px;
  height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--field); color: var(--ink-3);
  font-size: 12px; font-weight: 500; cursor: pointer;
  white-space: nowrap;
}
.board-filter:hover { color: var(--ink); border-color: var(--line-strong); }
.board-filter.on { color: var(--ink); background: var(--field-2); border-color: var(--line-strong); }
#filters-open .filter-count {
  position: static;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--accent); color: #17130d;
  font-family: var(--mono); font-size: 9px; line-height: 1;
}
#filters-open .filter-count[hidden] { display: none; }

.facets-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
}
/* The Flips head is the pane's title, with the current item's plan button when
   there is one. Hiding it with the button made the planner lose its header
   everywhere except an item page; the title keeps the pane legible. */
#facets-head-flips .filters-title { color: var(--ink-2); }
.flips-rl-slot { display: inline-flex; align-items: center; }
.flips-rl-slot:empty { display: none; }
.flips-rl-slot .ghost { height: 30px; padding: 0 9px; font-size: 10.5px; }
/* One voice for every app header: sentence case, the sans at 600, tracking as
   tight as the card titles'. The pane captions (Filters, Flips, Alerts, the
   watchlist selector) used to be uppercase micro-labels - a second voice for
   the same job as `.card-head h2`, and the one place a user's own list name was
   shouted. A pane's actions keep their own words and case. */
.filters-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
}
.filters-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* Only a narrow screen folds the filters away: there the card is a band above
   the list, and open it is taller than the list's first screen. */
.filters-show { display: none; }
.filter-state {
  display: inline-flex; align-items: center;
  min-height: 19px; padding: 1px 7px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
}
.filter-state[hidden] { display: none; }

.facets-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  /* The flips filters can shorten the list enough to remove its scrollbar.
     Reserving the scrollbar's lane keeps cards from changing width and
     shifting sideways when that happens. */
  scrollbar-gutter: stable;
  padding: 14px 16px 22px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-color: #2a2e2e transparent;
}
/* The planner pane's scrollbar belongs in its right padding, not in the
   column the summary, filters and cards share. Take the measured lane out of
   that padding, leaving a 1px breath: the three then keep the head's full
   width whether a plan list scrolls or not, and the scrollbar sits at the
   pane's edge instead of narrowing the cards. flips.js measures the lane,
   because an overlay scrollbar reserves none. */
#facets-flips {
  --flip-pad-right: 16px;
  padding-right: max(0px, calc(var(--flip-pad-right) - var(--flip-scroll-lane, 0px)));
}
@media (max-width: 620px) {
  #facets-flips { --flip-pad-right: 14px; }
}

.group { display: flex; flex-direction: column; gap: 8px; }
.facet-label {
  color: var(--ink-4);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .07em; text-transform: none;
}
.fv-block { display: flex; flex-direction: column; gap: 7px; }
.facet-view { gap: 12px; padding-bottom: 2px; display: flex; flex-direction: column; }

.scope-grid { display: flex; }
.scope-switch { display: flex; align-items: center; gap: 4px; width: 100%; }
.saveonly {
  flex: 1 1 auto;
  display: flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}
.saveonly { transition: color var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease), background var(--t-quick) var(--ease); }
.saveonly:hover { color: var(--ink); border-color: var(--line-strong); }
.saveonly[aria-expanded="true"] { border-color: var(--accent-line); }
.saveonly.on { border-color: var(--accent-line); color: var(--ink); background: var(--accent-soft); }
.saveonly .s-star { color: var(--accent); font-size: 13px; }
.saveonly .lbl { flex: 1 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saveonly em { color: var(--ink-4); font-style: normal; font-family: var(--mono); font-size: 10.5px; }
.saveonly .s-caret { color: var(--ink-4); font-size: 9px; transition: transform var(--t-quick) var(--ease); }
.saveonly[aria-expanded="true"] .s-caret { transform: rotate(180deg); }
.scope-x {
  width: 32px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink-4);
  cursor: pointer;
  display: none;
}
.scope-switch.scoped .scope-x { display: block; }
.scope-x:hover { color: var(--down); }

.filter-tools { display: flex; flex-direction: column; gap: 8px; }
.filter-search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); color: var(--ink-4);
}
.filter-search:focus-within { border-color: var(--line-strong); }
.filter-search svg { flex: 0 0 auto; width: 14px; height: 14px; }
.filter-search input {
  flex: 1 1 auto; min-width: 0; height: 100%;
  border: 0; outline: 0; background: none;
  color: var(--ink); font-size: 12px;
}
.filter-search input::placeholder { color: var(--ink-4); }
.filter-search input::-webkit-search-cancel-button { display: none; }
.filter-search-x {
  display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 5px;
  background: none; color: var(--ink-4); cursor: pointer;
}
.filter-search-x[hidden] { display: none; }
.filter-search-x:hover { color: var(--ink); background: var(--field); }

.filter-active {
  position: sticky; top: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 9px;
  padding: 11px 12px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  box-shadow: 0 10px 20px -20px #000;
}
.filter-active[hidden] { display: none; }
.filter-active-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filter-active-title {
  color: var(--accent);
  font-size: 10px; font-weight: 600;
  letter-spacing: .04em;
}
.filter-active-clear {
  padding: 0; border: 0; background: none;
  color: var(--ink-3); font-size: 10.5px; cursor: pointer;
}
.filter-active-clear:hover { color: var(--ink); }
.filter-active-list { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip {
  display: inline-flex; align-items: stretch;
  max-width: 100%; min-height: 27px; padding: 0;
  overflow: hidden;
  border: 1px solid var(--accent-line); border-radius: 6px;
  background: var(--card); color: var(--ink-2);
  font-family: var(--mono); font-size: 10px; line-height: 1.2;
  text-align: left;
}
.filter-chip-body {
  min-width: 0; max-width: 250px; padding: 0 2px 0 8px;
  overflow: hidden; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.filter-chip-x {
  display: grid; place-items: center;
  width: 25px; padding: 0; border: 0; background: none;
  color: var(--ink-4); font-family: var(--sans); font-size: 13px;
  line-height: 1; cursor: pointer;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip-body:hover, .filter-chip-x:hover { color: var(--ink); }
.filter-chip-x:hover { color: var(--down); }
.filter-chip:focus-within { border-color: var(--accent); }

.filter-block { border-top: 1px solid var(--line); padding-top: 4px; }
.filter-block summary {
  display: flex; align-items: center; justify-content: space-between; gap: 9px;
  height: 34px;
  cursor: pointer;
  list-style: none;
  color: var(--ink-2);
  font-size: 12px; font-weight: 500;
}
.filter-block summary:hover { color: var(--ink); }
.filter-block summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.filter-block summary::-webkit-details-marker { display: none; }
.filter-block summary::after {
  content: ""; width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 1.5px solid var(--ink-4); border-bottom: 1.5px solid var(--ink-4);
  transform: rotate(45deg); margin-top: -3px;
  transition: transform var(--t-quick);
}
.filter-block[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.fb-name { flex: 1 1 auto; }
.fb-meta { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.fb-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 5px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  line-height: 1;
}
.fb-count[hidden] { display: none; }

.filter-index { display: flex; flex-direction: column; gap: 9px; padding: 2px 0 14px; }
.filter-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-field-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 29px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2); color: var(--ink-3);
  font-size: 11.5px; line-height: 1; cursor: pointer;
}
.filter-field-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.filter-field-chip.on, .filter-field-chip.open {
  color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft);
}
.filter-field-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-field-chip[data-tip] { position: relative; }
.filter-field-chip.has-tip .ff-label {
  text-decoration: underline dotted; text-underline-offset: 2px;
  text-decoration-color: var(--ink-4);
}
.filter-field-chip[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 7px); z-index: 30;
  width: max-content; max-width: min(240px, calc(100vw - 88px));
  padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--card); color: var(--ink-2);
  box-shadow: 0 10px 24px -16px #000;
  font: 11px/1.35 var(--sans); font-weight: 400; text-align: left;
  white-space: normal; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms;
}
.filter-field-chip[data-tip]:hover::after,
.filter-field-chip[data-tip]:focus-visible::after {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 120ms ease, transform 120ms ease, visibility 0s;
}
.ff-mark { width: 11px; color: var(--ink-4); font-family: var(--mono); font-size: 11px; text-align: center; }
.ff-mark::before { content: "+"; }
.filter-field-chip.on .ff-mark { color: var(--accent); }
.filter-field-chip.on .ff-mark::before { content: "✓"; }
.filter-editor-hint { margin: -1px 0 0; color: var(--ink-4); font-size: 10.5px; line-height: 1.35; }
.filter-editors { display: flex; flex-direction: column; }
.filter-editor {
  display: flex; flex-direction: column; gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--card);
}
.filter-editor[hidden] { display: none; }
.filter-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filter-editor-name { color: var(--ink-2); font-size: 11.5px; font-weight: 500; }
.filter-editor-name em {
  margin-left: 6px; color: var(--ink-4); font-style: normal;
  font-family: var(--mono); font-size: 9.5px;
}
.filter-editor-clear {
  padding: 0; border: 0; background: none;
  color: var(--ink-4); font-size: 10.5px; cursor: pointer;
}
.filter-editor-clear:hover { color: var(--ink); }
.filter-empty { padding: 10px 0 14px; color: var(--ink-4); font-size: 12px; }
.filter-empty[hidden] { display: none; }
.filter-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
  align-items: end;
  gap: 5px;
}
.filter-input { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-input > span {
  color: var(--ink-4);
  font-family: var(--mono); font-size: 9.5px;
  line-height: 1;
}
.filter-input input {
  width: 100%; height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--mono); font-size: 11.5px;
  outline: none;
}
.filter-input input:focus { border-color: var(--line-strong); }
.filter-input input::placeholder { color: var(--ink-4); }
.filter-sep { color: var(--ink-4); font-size: 10px; text-align: center; padding-bottom: 11px; }

@media (pointer: coarse), (max-width: 620px) {
  .filter-sep { padding-bottom: 16px; }
  .filter-search { height: 44px; }
  .filter-field-chip { min-height: 44px; }
  .filter-search-x { width: 44px; height: 44px; }
  .filter-editor-clear { min-height: 44px; }
}

.filter-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.members .chips { width: 100%; }
.members .chips button { flex: 1 1 auto; }

/* shared small controls */
.ghost {
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center;
  height: 30px; padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.ghost:hover { color: var(--ink); border-color: var(--line-strong); }
.ghost[disabled] { opacity: .4; cursor: default; }
.link {
  border: 0; background: none; padding: 0;
  color: var(--accent); font-size: inherit; cursor: pointer;
}
.link:hover { color: var(--accent-2); }

/* watchlists */
.wl-pick {
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 0; max-width: 100%; height: 30px; padding: 0;
  border: 0; border-radius: 8px;
  background: none; color: var(--ink);
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
.wl-pick:hover { color: var(--ink); }
.wl-pick[aria-expanded="true"] { color: var(--ink); background: var(--accent-soft); }
#watchlist-pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-caret {
  width: 9px; height: 6px; flex: 0 0 auto;
  stroke: var(--ink-4); fill: none; stroke-width: 1.6;
  transition: transform var(--t-quick) var(--ease);
}
.wl-pick[aria-expanded="true"] .wl-caret { transform: rotate(180deg); }
.wl-open { margin-left: auto; }
.wl-add { font-size: 15px; width: 30px; padding: 0; }

/* One saved list as the pane's quote board: a head of sort words over rows of
   sprite, name and change. The row is the way into the item; the bin rides at
   its right end and only shows while the line is being read. */
/* The plate's rows: no column head over them - the pane's own caption is the
   only word above the list - and a dashed hairline between one row and the
   next, the way the item page divides the rows of its plates. */
.wtable { display: flex; flex-direction: column; gap: 0; }
/* A banked watchlist keeps its name and its items and loses only the reading:
   the note names what is waiting and the press is what brings it back. It sits
   over the rows because it answers "where did my other list go?". */
.wbanked {
  display: block; width: 100%; margin: 0 0 8px; padding: 7px 9px;
  border: 1px solid var(--accent-line); border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: 11px; line-height: 1.5;
  text-align: left; cursor: pointer;
}
.wbanked:hover { border-color: var(--accent); }
.wbanked:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent); }
.wline + .wline { border-top: 1px dashed var(--line); }
.whead {
  display: none;
  font-size: 11.5px;
}
.whead > span { display: none; }
.wsort {
  border: 0; background: none; padding: 0;
  color: var(--ink-4);
  font-size: 10px; font-weight: 500;
  letter-spacing: .06em; text-transform: none;
  cursor: pointer;
}
.wsort:hover { color: var(--ink-2); }
.wsort[aria-pressed="true"] { color: var(--ink); }
.wsort[data-wsort="name"] { flex: 1 1 auto; text-align: left; }
.wsort[data-wsort="chg"] { flex: 0 0 46px; text-align: right; }
.wsort-d { font-style: normal; margin-left: 3px; color: var(--accent); }
.wline {
  display: flex; align-items: center;
  padding-right: 2px;
  border-radius: 4px;
}
.wrow {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  min-height: 30px;
  padding: 6px 8px;
  border: 0; border-radius: 4px; background: transparent;
  color: inherit; text-align: left; cursor: pointer;
}
.wline:hover { background: var(--field); }
/* The sprite is a cell, not the picture's own size: a wiki image is 20px wide
   on one line and 29px on the next, and sizing the picture made every name start
   somewhere else. A 24 box holds them all, the small ones centred in it, so the
   names are one column and sit under the head's own word. */
.wrow .wico {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
}
.wrow .wico img { max-width: 24px; max-height: 24px; object-fit: contain; }
.wname {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
  /* The market listing's own name: `.board-body tbody td.name` and
     `.item-cell .nm` set an item's name in the sans at 13px and weight 500.
     The pane reads the same name at the same size, so the two lists cannot
     look like two typefaces. Figures below stay mono, as the board's do. */
  font-family: var(--sans); font-size: 13px; font-weight: 500;
}
.wchg {
  flex: 0 0 46px; text-align: right;
  color: var(--ink-3); font-family: var(--mono); font-size: 13px;
}
.wchg.up { color: var(--up); }
.wchg.down { color: var(--down); }
.wdel {
  flex: 0 0 22px; width: 22px; height: 26px;
  display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 4px; background: transparent;
  color: var(--ink-4); cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-quick), color var(--t-quick), background var(--t-quick);
}
.wline:hover .wdel, .wdel:focus-visible { opacity: 1; }
.wdel:hover { color: var(--down); background: var(--down-soft); }
.wdel svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round;
}
/* A thumb has no hover: the way off the list is always drawn where there is
   no pointer to reveal it. */
@media (hover: none) { .wdel { opacity: 1; } }

/* The planner and the imported trades are two readings of one ledger, so their
   heads carry the same small switch: a segmented control rather than a second
   row of filters. The rail keeps its own marks for both. */
.pane-switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--field);
}
.pane-switch button {
  height: 26px; padding: 0 9px;
  border: 0; border-radius: 6px; background: none;
  color: var(--ink-3); font-size: 11px; font-weight: 500; cursor: pointer;
  transition: background var(--t-quick), color var(--t-quick);
}
.pane-switch button:hover { color: var(--ink-2); }
.pane-switch button[aria-pressed="true"] { color: var(--ink); background: var(--field-2); }

/* alerts pane */
.alerts-head-lead { display: inline-flex; align-items: center; gap: 4px; }
.alerts-tabs { display: inline-flex; gap: 2px; }
/* The alerts head names its pane in the head's own type, as the flips head
   does. It used to be a filled pill - the only head whose name was a control,
   at the tab size rather than the title's - and the log it switched to is
   behind the bell now, so the pill was a switch with one side. */
.alerts-tabs button {
  height: auto; padding: 0;
  border: 0; border-radius: 0;
  background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer;
  letter-spacing: -.01em;
}
.alerts-tabs button[aria-pressed="true"] { color: var(--ink); background: transparent; }

.apanel-lines { display: flex; flex-direction: column; gap: 6px; }
.apanel-note { color: var(--ink-4); font-size: 11.5px; padding: 8px 0; }
.apanel-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 10px; text-align: center;
}
.apanel-empty .ae-glyph { color: var(--ink-4); line-height: 0; }
.apanel-empty .ae-title { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.apanel-empty .ae-sub { max-width: 220px; color: var(--ink-4); font-size: 11px; line-height: 1.5; }
.apanel-empty .abtn { margin-top: 4px; }

.alert-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.alert-row img { width: 24px; height: 24px; object-fit: contain; }
.alert-body { flex: 1 1 auto; min-width: 0; }
.alertcap { color: var(--ink-3); font-size: 10.5px; }
.alert-row .n { font-size: 12px; color: var(--ink); }

/* --------------------------------------------------------------- the drawer's scrim --- */
.scrim {
  position: fixed; inset: 0 0 0 76px;
  z-index: 60;
  background: rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-move), visibility var(--t-move);
}
.scrim.on { opacity: 1; visibility: visible; }

/* ---------------------------------------------------------------- item page --- */
.itemview { display: flex; flex-direction: column; gap: 16px; }

.iv-head {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
.iv-head .ico-lg, .iv-head > img {
  width: 48px; height: 48px; object-fit: contain;
  padding: 5px; border-radius: 8px; background: var(--field);
  flex: 0 0 auto;
}
/* The sprite is drawn in the tile rather than at the corner of it: the picture
   is an inline image on a block anchor, so it sat on the text baseline and
   hugged the top-left - a small icon in a big shifted box. The picture takes
   the tile's whole inner box and `contain` keeps its shape centred in it. */
.iv-head .ico-lg { display: grid; place-items: center; position: relative; }
/* Sized to the inner box rather than to their own height: a percentage height
   against an auto-sized row is indefinite, so a tall sprite was laid out at its
   aspect's height and hung out below the tile. */
.iv-head .ico-lg img {
  position: absolute; inset: 5px;
  width: calc(100% - 10px); height: calc(100% - 10px);
  object-fit: contain;
}
.iv-id { flex: 1 1 auto; min-width: 0; }
.iv-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iv-title h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
/* The name takes focus when its page opens so a screen reader lands on it. It
   is a landing target, not a tab stop, so a mouse or a thumb gets no ring drawn
   around the item's name for the whole time the page is on the glass. */
.iv-title h2:focus { outline: none; }
.examine { margin-top: 3px; color: var(--ink-4); font-size: 11.5px; }
.iv-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* The app's item header carries the quote strip inside the same card. The SSR
   header (`server/itempage.py`) keeps the plain `iv-head` shape and its table,
   so this variant is only on the card the app draws. */
.iv-head-stats { display: block; }
.iv-top { position: relative; display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
/* The four readings are sections of the same card, not cards inside a card:
   one rule under the identity row and single lines between the figures. */
.iv-head-stats .quote-row {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  gap: 0;
}
.iv-head-stats .q-cell {
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.iv-head-stats .q-cell:first-child { padding-left: 0; }
.iv-head-stats .q-cell:last-child { padding-right: 0; }
.iv-head-stats .q-cell + .q-cell { border-left: 1px solid var(--line); }
.iv-btn {
  height: 32px; padding: 0 11px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 11.5px; cursor: pointer;
}
.iv-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.iv-btn.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.iv-slot { display: inline-grid; }
.iv-btn.copy .iv-slot > svg { width: 13px; height: 13px; grid-area: 1 / 1; }
.iv-btn.copy .iv-slot .tick, .iv-btn.copy .iv-slot .cross { display: none; }
.iv-btn.copy.done .iv-slot .sheets { display: none; }
.iv-btn.copy.done .iv-slot .tick { display: block; color: var(--up); }
.iv-btn.copy.miss .iv-slot .sheets { display: none; }
.iv-btn.copy.miss .iv-slot .cross { display: block; color: var(--down); }
/* The slot is decorative and a phone hides it, so the button itself carries
   the answer there: the word changes and the border takes the result's colour. */
.iv-btn.copy.done { border-color: var(--up); color: var(--up); }
.iv-btn.copy.miss { border-color: var(--down); color: var(--down); }

.facts-pop {
  /* Fixed: the card lives inside the board's scrolling column, and an absolute
     overlay contributes its height to that scroller even when it is only a
     card. `fitFacts` anchors it under the Details button. */
  position: fixed; top: 60px; right: 14px; z-index: 30;
  width: min(268px, calc(100vw - 24px));
  max-height: min(72vh, 560px);
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow);
}
.facts-pop[hidden] { display: none; }
.facts-pop:focus { outline: none; }
.facts-pop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A 280px phone leaves less room than the plate's own 268px: right-aligning it
   from the header's content edge pushed its left side off the glass. Left-align
   it there and let it take the width that is actually inside the card. */
@media (max-width: 360px) {
  .facts-pop {
    width: min(268px, calc(100vw - 48px));
  }
}
.facts-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 11.5px; color: var(--ink-3); }
.facts-row b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.facts-row.asof { display: block; padding-top: 8px; margin-top: 5px; border-top: 1px solid var(--line); color: var(--ink-4); font-size: 10.5px; }

.quote-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin-bottom: 14px;
}
.q-cell {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
}
.q-cell .k { color: var(--ink-4); font-size: 10.5px; text-transform: none; letter-spacing: .06em; }
.q-cell .v {
  margin-top: 2px;
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 20px; font-weight: 600;
  letter-spacing: -.02em;
}
.q-cell .q-pct { font-size: 11px; font-weight: 500; }
.q-pct.up, .q-cell .v .up { color: var(--up); }
.q-pct.down, .q-cell .v .down { color: var(--down); }

.chart-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 14px;
}
/* A press on the plot drags a window, not a text selection: without this a
   drag sweeps over the axis labels and time ticks and leaves them highlighted. */
.chart, .chart * { user-select: none; -webkit-user-select: none; }
/* The plot is a window to drag, and the hand is the only thing that says so:
   open over it, closed while the drag is running, as a map's is. The knobs on
   the axes keep their own stretch cursors, which chart.js sets on the host. */
.pannable .chart-hit { cursor: grab; }
.pannable.panning .chart-hit { cursor: grabbing; }
.chart-top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.ranges { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); }
.ranges button {
  height: 25px; min-width: 30px; padding: 0 8px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-4);
  font-family: var(--mono); font-size: 10.5px; cursor: pointer;
}
.ranges button:hover { color: var(--ink-2); }
.ranges button.on { background: var(--field-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
/* The live light rides inside the strip's Live button: a window named Live and
   a light named Live are one control's worth of words, not two. Unlit ink while
   another window is on, green and steady while the plot follows the newest
   bucket, and blinking once a drag or a zoom has moved the window - a line that
   stopped moving is otherwise indistinguishable from a market that did. */
.ranges button[data-range="live"] { display: inline-flex; align-items: center; gap: 5px; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .5;
}
.ranges button[data-range="live"].on .live-dot { background: var(--up); opacity: 1; }
/* Only the dot blinks. The chip itself keeps the ink and the ground of the
   window it is on: a button that floods green reads as a state of the strip
   rather than of the light, and the strip's job is to say which window is
   selected, which `.on` already does. */
/* A moved window drops the chip's highlight, so the dot keeps its own green:
   the light names the window even when the strip says nothing is selected. */
.ranges button[data-range="live"].moved .live-dot {
  background: var(--up); opacity: 1;
  animation: live-blink 1.2s steps(2, start) infinite;
}
@keyframes live-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: .2; }
}
/* A reader who asked for no motion gets the same reading without the pulse:
   the dot stays lit inside its ring, so the light still says the plot has
   stopped - blinking is one way to say it, not the only one. */
@media (prefers-reduced-motion: reduce) {
  .ranges button[data-range="live"].moved .live-dot {
    animation: none !important; opacity: 1;
  }
}
/* The quote's clock: one small line in the action group, naming the time the
   quote was measured. No plate, ring or countdown; freshness is a reading, not
   a progress bar. */
.refresh-clock {
  display: inline-flex; align-items: baseline; gap: 5px;
  height: auto; padding: 0;
  color: var(--ink-3); flex: 0 0 auto;
}
.rclock-copy {
  display: flex; align-items: baseline; gap: 5px; min-width: 0;
  white-space: nowrap;
}
.rclock-k {
  color: var(--ink-4); font-size: 10px; font-weight: 400;
  letter-spacing: 0; line-height: 1;
}
.rclock-v {
  color: var(--ink-2); font-family: var(--mono); font-size: 11px;
  font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1;
  white-space: nowrap;
}
.abtn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 10px; text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 11px; cursor: pointer;
}
.abtn:hover { color: var(--ink); border-color: var(--line-strong); }
.abtn[aria-pressed="true"], .abtn.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.ovs-open {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; padding: 0;
}
/* The chart's readings are switches in one card, opened from Layers on a phone
   and standing with the plot on a desk. */
.ovs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.read-key {
  height: 24px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); color: var(--ink-3);
  font: inherit; font-size: 10.5px; cursor: pointer;
}
.read-key:hover { color: var(--ink); border-color: var(--line-strong); }
.read-key[aria-pressed="true"] { color: var(--ink); border-color: var(--line-strong); background: var(--field-2); }
.read-key.off { opacity: .55; }
.chart { position: relative; min-height: 300px; overflow: hidden; }
.chart .loading { padding: 40px; text-align: center; color: var(--ink-4); font-size: 12px; }
/* The margin pane shares the time axis and has a scale of its own: gp of margin
   is not gp of price, so it is a second plot rather than a second line. */
.chart-sub { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.chart-sub[hidden] { display: none; }
.chart-sub-k {
  display: block; margin: 0 0 2px 2px;
  color: var(--ink-4); font-size: 9.5px; letter-spacing: .05em;
  text-transform: uppercase;
}
.chart.chart-margin { height: 96px; min-height: 0; }
/* Chart settings' rows: its popover frame is shared with the other menus. */
.cs-title {
  margin: 2px 2px 7px; color: var(--ink-4);
  font-size: 10.5px; font-weight: 500; letter-spacing: .07em;
}
.cs-title.cs-sub { margin-top: 12px; }
/* The two styles are a scale of marks, like the window's range chips: one
   row, the chosen one in the page's selected ink. */
/* Three styles in one pill: the segment is a scale of words, so it gives each
   option the same share and keeps its own gutters small enough that the words
   never run past the pill's edge. */
.cs-seg {
  display: flex; gap: 2px; padding: 3px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2);
}
.cs-opt {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 28px; min-width: 0; padding: 0 4px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-3); font: 9.5px var(--sans); white-space: nowrap;
  cursor: pointer;
}
.cs-opt:hover { color: var(--ink-2); }
.cs-opt:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.cs-opt.on {
  background: var(--field-2); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.cs-swatch { display: inline-grid; place-items: center; width: 13px; height: 8px; flex: 0 0 auto; }
.cs-swatch svg { width: 13px; height: 8px; overflow: visible; }
.sw-up, .sw-down, .sw-mid { fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sw-up { stroke: var(--up); }
.sw-down { stroke: var(--down); }
.sw-mid { stroke: var(--accent); }
.cs-note {
  margin: 8px 2px 0; color: var(--ink-4);
  font-size: 10.5px; line-height: 1.4;
}
.cs-rows { display: flex; flex-direction: column; }
.cs-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 38px; padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); font-size: 12px; cursor: pointer;
}
.cs-row:last-child { border-bottom: 0; }
.cs-lead { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cs-glyph { flex: 0 0 16px; display: grid; place-items: center; color: var(--ink-3); }
.cs-glyph svg { width: 16px; height: 16px; overflow: visible; }
.ico-line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico-up { fill: var(--up); stroke: var(--up); }
.ico-down { fill: var(--down); stroke: var(--down); }
.cs-name { white-space: nowrap; }
/* The switch is the page's own, accent and all. */
.cs-row .switch { flex: 0 0 auto; }
.cs-row.off { opacity: .55; }
.cs-row.disabled { opacity: .35; cursor: default; }
.cs-row.locked { cursor: default; }
.cs-row.locked .cs-lead { opacity: .62; }
.cs-lock {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px 3px 6px;
  border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--sans); font-size: 9.5px; font-weight: 600;
  letter-spacing: .01em; line-height: 1; text-decoration: none;
}
.cs-lock svg { flex: 0 0 auto; width: 12px; height: 12px; }
.cs-lock:hover { color: var(--accent-strong, var(--accent)); }
.cs-row[hidden] { display: none; }
.chart svg { display: block; width: 100%; max-width: 100%; }
.chart-tip {
  /* Its own size, whatever the plot's edge is doing. A shrink-to-fit box with
     only `left` set is as wide as the room left of the host's right edge, so a
     readout near the end of the chart wrapped and changed shape; `max-content`
     plus no wrapping keeps every reading one line, and `fixed` (positioned by
     placeTip in chart.js) lets the box hang past the card instead of being
     squeezed into it. */
  position: fixed; z-index: 5;
  width: max-content; white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms var(--ease);
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--ink-2);
  font-family: var(--mono); font-size: 10.5px;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.chart-tip.below { transform: none; }
.chart-tip .side.buy { color: var(--up); }
.chart-tip .side.sell { color: var(--down); }

/* The alert press rides the crosshair: out of the flow, invisible until the
   pointer is on the plot, and a chart-sized target rather than a control that
   pushed the plot 25px taller. */
.chart-alert-add {
  position: absolute; z-index: 6;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  padding: 0; margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--ink-2);
  font-size: 14px; line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-quick), border-color var(--t-quick), color var(--t-quick);
}
.chart-alert-add:focus-visible { opacity: 1; outline: 2px solid var(--accent-line); outline-offset: 1px; }
.chart-alert-add.is-hot { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
/* A finger covers what it points at, so the press is drawn larger there and its
   target is 44px in chart.js rather than the square's own box. */
@media (pointer: coarse) {
  .chart-alert-add { width: 32px; height: 32px; font-size: 17px; }
}

.iv-grid { display: block; }
.iv-main { min-width: 0; }

/* the comparison picker */
/* The picker opens down from the header and over the plot. It is measured from
   the header rather than the menu item that raised it, so a phone does not put
   half of it off the card. */
.cmp-pop {
  position: absolute; left: auto; right: 0; top: calc(100% + 6px); z-index: 40;
  width: 250px; max-width: calc(100vw - 46px); padding: 7px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow);
}
.cmp-pop[hidden] { display: none; }
/* When the header is near the bottom of the window, the shared placer asks for
   the picker above its anchor. The header has no footer under it to rise from
   any more, so it opens over the quote instead of leaving the viewport. */
.cmp-pop.up { top: auto; bottom: calc(100% + 6px); }
.cmp-pop input {
  width: 100%; height: 32px; padding: 0 9px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); font-size: 11.5px; outline: none;
}
.cmp-list { margin-top: 5px; max-height: 200px; overflow: auto; }
/* The picker's answers are the page's own rows - a name and the line it trades
   on - rather than the platform's grey buttons. */
.cmp-hit {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); text-align: left; cursor: pointer;
  font-family: var(--sans); font-size: 12px;
}
.cmp-hit:hover, .cmp-hit:focus-visible, .cmp-hit[aria-selected="true"] {
  background: var(--field); color: var(--ink);
}
.cmp-hit .n { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmp-hit .c { flex: 0 0 auto; color: var(--ink-4); font-family: var(--mono); font-size: 10px; }
.cmp-pop .note { margin: 0; padding: 8px 9px; color: var(--ink-3); font-size: 11px; }

/* A compared item is a chip like the chart's other keys: its swatch, its name,
   and a cross that takes the line off. */
.cmp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; margin: 0; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
  font-family: var(--sans); font-size: 10.5px;
}
.cmp-chip.this { color: var(--ink-3); }
button.cmp-chip { cursor: pointer; }
button.cmp-chip:hover, button.cmp-chip:focus-visible {
  border-color: var(--line-strong); color: var(--ink); background: var(--field);
}
.cmp-chip i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.cmp-chip b { font-weight: 400; color: var(--ink-4); margin-left: 2px; }
button.cmp-chip:hover b { color: var(--ink-2); }
.cmp-legend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0;
  color: var(--ink-3); font-size: 11px;
}
.cmp-legend[hidden] { display: none; }
/* studies row */

/* -------------------------------------------------------------- other screens --- */
.settings, .history-page { display: flex; flex-direction: column; gap: 14px; }
.scard {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.scard h2, .section-head h2 { font-size: 15px; font-weight: 600; }
.scard p, .sub { color: var(--ink-3); font-size: 11.5px; }
.scard-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings { max-width: 720px; }
.sbtn, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center;
  height: 34px; padding: 0 13px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 12px; cursor: pointer;
}
.sbtn:hover, .btn:hover { border-color: var(--line-strong); color: var(--ink); }
/* A form's submit is the height of the field it sends. The account screen's
   pair sat 4px shorter than their own inputs, so a field and its action read as
   two different kinds of control on the same line. */
.passform .sbtn { height: 38px; }
/* The saved-view row is one pair too: the name field is 32, so Save is 32. */
.sbtn.danger { color: var(--down); border-color: rgba(255, 92, 102, .3); }
.btn-quiet { height: 34px; padding: 0 13px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.btn-full { width: 100%; }

/* modals */
.ascrim, #async-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: none;
}
.amodal-box, .auth-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 60px);
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card);
  box-shadow: 0 40px 100px -40px #000;
}
.amodal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.amodal-h h2 { font-size: 17px; font-weight: 600; }
.amodal-body { display: flex; flex-direction: column; gap: 10px; }
.adel {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: var(--field);
  color: var(--ink-3); cursor: pointer; font-size: 16px;
}
.adel:hover { color: var(--ink); }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="url"], textarea, select {
  font-family: var(--sans);
}
form label { color: var(--ink-3); font-size: 11.5px; }

fieldset { border: 0; padding: 0; margin: 0; }

/* generic list rows used across the panes and screens */
.alert-row, .acfg-row, .fill-row, .nrow {
  border-bottom: 1px solid var(--line-soft);
}

/* misc utility text */
.eyebrow { color: var(--ink-4); font-size: 10px; letter-spacing: .08em; text-transform: none; }
.quiet { color: var(--ink-4); }
.fine { color: var(--ink-4); font-size: 10.5px; }

/* --------------------------------------------------------------- notif drawer --- */
.notif-drawer {
  position: fixed; left: 88px; bottom: 88px; z-index: 120;
  width: 340px; max-height: min(480px, calc(100dvh - 120px));
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notif-drawer[hidden] { display: none; }
/* The rail's corner is the phone's placement, where the Alerts pane opens the
   record. From 621px the page head carries the bell, so the drawer hangs from
   that corner instead of crossing the board to the rail. */
@media (min-width: 621px) {
  .notif-drawer {
    left: auto;    right: calc(28px + var(--shell-gutter, 0px));
    top: 66px; bottom: auto;
  }
}
@media (min-width: 621px) and (max-width: 860px) {
  .notif-drawer { right: calc(18px + var(--shell-gutter, 0px)); }
}
/* The Alerts pane owns the record on a phone, where the header bell is gone. */
.alerts-head-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* The record's mark sits in the head beside the plus the other two heads carry,
   so it is the same ghost box: one line, one fill and the same 30px height,
   rather than a bordered circle that made the alerts head the odd one. */
.alerts-notif {
  display: none; position: relative;
  width: 30px; height: 30px; padding: 0; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); color: var(--ink-3); cursor: pointer;
}
.alerts-notif:hover { color: var(--ink); border-color: var(--line-strong); }
.alerts-notif-count {
  position: absolute; top: -3px; right: -3px;
  min-width: 15px; height: 15px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--accent); color: #17130d;
  font-family: var(--mono); font-size: 9px; line-height: 1;
}
.alerts-notif-count[hidden] { display: none; }
.nd-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nd-head h2 { font-size: 13px; font-weight: 600; }
.nd-x { width: 26px; height: 26px; border: 0; border-radius: 5px; background: var(--field); color: var(--ink-3); cursor: pointer; }
.nd-body { flex: 1 1 auto; overflow: auto; padding: 8px; }
.nd-foot { padding: 8px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* The drawer is the record at the bell; the page is the record at the width of
   the board. The foot is the way from one to the other. */
.nd-all { display: inline-flex; align-items: center; text-decoration: none; }
.nd-note { color: var(--ink-4); font-size: 11.5px; padding: 10px; }

/* One firing, wherever the record is read: the bell's drawer or the full
   notifications screen. The dot is the unread mark; the row is the way into
   the item it was about. */
.nday {
  padding: 14px 20px 6px;
  color: var(--ink-4); font-size: 9.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: none;
}
.nwrap { display: block; }
.nrow {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 20px;
  border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; color: inherit;
  text-align: left; font: inherit; cursor: pointer;
  transition: background var(--t-quick);
}
div.nrow { cursor: default; }
button.nrow:hover { background: #151717; }
.nwrap.unread .nrow { background: rgba(255, 138, 31, .035); }
.nwrap:last-child .nrow { border-bottom: 0; }
.ndot {
  flex: 0 0 6px; width: 6px; height: 6px;
  border-radius: 999px; background: var(--line-strong);
}
.nwrap.unread .ndot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.n-ico {
  flex: 0 0 24px; width: 24px; height: 24px;
  display: grid; place-items: center;
  object-fit: contain; border-radius: 5px; background: var(--field);
  font-size: 10px;
}
.ntext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ntext b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 12px; font-weight: 600;
}
.ntext span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-3); font-size: 11.5px;
}
.nwhen {
  flex: 0 0 auto; margin-left: auto;
  color: var(--ink-4); font-family: var(--mono); font-size: 10px;
}
.nd-body .nday { padding: 10px 10px 4px; }
.nd-body .nrow { padding: 8px 10px; }

/* The board's copy of the record: a card the width of the list, not a drawer. */
.hist {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
}
.hist-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.hist-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.hist-head span { color: var(--ink-4); font-family: var(--mono); font-size: 10.5px; }
.hist-none { padding: 40px 20px 14px; text-align: center; color: var(--ink-4); font-size: 12px; }
.hist .link { display: block; margin: 0 auto 32px; }

/* --------------------------------------------------------------- open items menu --- */
/* The list menu: one floating card, used three times - a star asks which list
   the item goes into, the panel's switch asks which list the table shows, and
   the watchlists pane's head asks which list that column reads. It sits on the
   page rather than in either layout, so the same card opens from a table row
   and from the panel without moving what it opened from. */
.listmenu {
  position: fixed;
  /* Above the column's drawer (65) and the board, under the search card and the
     open-items card: the picker is raised from inside the drawer as well as
     from the filters card, and a menu behind the sheet it was opened from is a
     menu nobody can press. */
  z-index: 70;
  min-width: 224px;
  max-width: 268px;
  /* The window, not a card-sized guess: the picker grew past 340 with the
     built-in views, and a scrollbar on a desk with room to spare is a control
     for a problem that is not there. It still scrolls on a short screen or a
     phone, where the content genuinely does not fit. */
  max-height: calc(100dvh - var(--kb, 0px) - 24px);
  overflow-y: auto;
  padding: 5px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  /* One step above the page it covers, and it says so in its own light: a
     hairline of it along the card's top edge and a shadow that only has to
     lift the card, not draw it. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 22px 44px -22px rgba(0, 0, 0, 0.95);
}
/* The card's one title line: the question it answers, in the app's title voice,
   closed with a hairline so the rows begin cleanly. */
.lm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 4px;
  padding: 5px 8px 7px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 11.5px; font-weight: 600; letter-spacing: -.005em;
  color: var(--ink-3);
}
.lm-head-title { color: var(--ink-3); }
.lm-head-now {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
/* A row: the name as the press, its count at the far end, and the two verbs it
   owns in a pair of quiet glyphs. The ground is drawn one step in from the
   card's edge, so the rows read as a list of things rather than a stack of
   table rows. */
.lm-row {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0;
  border-radius: 4px;
}
.lm-pick {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
@media (hover: hover) {
  .lm-pick:hover { background: var(--field); color: var(--ink); }
}

/* The row this card is already showing: the dot is the accent, the name is the
   page's own ink, and a wash of the accent holds it open after the pointer has
   gone. */
.lm-pick[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
.lm-crown {
  display: grid; place-items: center; flex: 0 0 12px;
  width: 12px; height: 12px; color: var(--accent);
}
.lm-crown svg { width: 12px; height: 12px; }
/* A list the plan has banked keeps its name and press - one opens the Pro pitch,
   the other deletes it - but loses the ink and the sprite brightness of a list
   that can be read. The crown stays as the reason, muted with the rest. */
.lm-row.banked .lm-pick { color: var(--ink-4); }
.lm-row.banked .lm-name { font-weight: 400; }
.lm-row.banked .lm-ico { opacity: .55; filter: grayscale(1); }
.lm-row.banked .lm-n { opacity: .7; }
.lm-row.banked .lm-crown { color: var(--ink-4); opacity: .7; }
@media (hover: hover) {
  .lm-row.banked .lm-pick:hover { background: var(--field); color: var(--ink-3); }
}
.lm-pick:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line); }
.lm-tick {
  flex: 0 0 13px;
  width: 13px;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  color: var(--accent);
}
/* The view's own mark, in the column the board's sprites have: a watchlist's
   first saved item, a preset's first result, or a quiet line drawing when the
   view has no item to lend it one. */
.lm-ico {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.lm-ico .ico { width: 100%; height: 100%; display: grid; place-items: center; }
.lm-ico img {
  max-width: 20px; max-height: 20px;
  object-fit: contain;
  image-rendering: pixelated;
}
.lm-ico svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.lm-pick[aria-pressed="true"] .lm-ico { color: var(--accent); }

.lm-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* The names are read at the same 13px/500 as the board's own name column. */
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
}
/* The rows are cut from the card's own plate: a 4px corner inside the 6px one,
   so the things in it belong to the card rather than sit on it. */
.lm-row, .lm-pick, .lm-new, .lm-tool { border-radius: 4px; }
.lm-n {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
/* The two verbs a list owns, in miniature. They are drawn, not faded in: a
   glyph nobody can see is not an affordance, and the right-click card behind
   them says the same two things in words. */
.lm-tool {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
@media (hover: hover) {
  .lm-tool:hover { background: var(--field); color: var(--ink); }
}

.lm-tool:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line); }
/* The row is a button, and a button shrinks to its words: without this "all
   items" was 62px of text in a 220px card, so a press on the rest of the row
   hit the card and did nothing - the one way back out of the preset was
   the one place that looked pressable and was not. */
.lm-all { width: 100%; margin-bottom: 4px; }
.lm-foot {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
  padding: 4px 0 0;
  border-top: 1px solid var(--line);
}
.lm-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
  text-align: left;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
@media (hover: hover) {
  .lm-new:hover { background: var(--field); color: var(--ink); }
  .lm-new[data-save-view]:hover { background: var(--accent-soft); color: var(--accent); }
}
.lm-new.pro { color: var(--accent); }

.lm-new:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line); }
/* The right-click menu is a context menu, and it has to look like the one the
   browser raises: a narrow card at the pointer, the list it is about written
   dim across the top, then the two things that can be done to it, one under the
   other on full-width lines. */
.listmenu.ctx {
  min-width: 186px;
  max-width: 260px;
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.95);
}
.ctx-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  padding: 4px 8px 7px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
}
.ctx-head .lm-input { flex: 1 1 auto; width: 0; margin: 0; }
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
} .ctx-item:focus{ background: var(--field); color: var(--ink); outline: 0; }
@media (hover: hover) {
  .ctx-item:hover { background: var(--field); color: var(--ink); outline: 0; }
}
 .ctx-item.del:focus{ color: var(--down); }
@media (hover: hover) {
  .ctx-item.del:hover { color: var(--down); }
}

/* The verb's own mark, the word, and the value it acts on: the icon row shows
   the sprite in force at the far end, so the card says what it would change
   before it is pressed. */
.ctx-glyph {
  flex: 0 0 16px;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.ctx-glyph svg { width: 15px; height: 15px; fill: none; stroke: currentColor; }
.ctx-item.del .ctx-glyph { color: var(--ink-4); }
@media (hover: hover) {
  .ctx-item.del:hover .ctx-glyph { color: var(--down); }
}
.ctx-word { flex: 1 1 auto; min-width: 0; }
.ctx-item .lm-ico { flex: 0 0 18px; width: 18px; height: 18px; }
.ctx-item .lm-ico img { max-width: 18px; max-height: 18px; }

/* The card's one field, and its delete question: a label over the input, then
   Save and Cancel in words - the same two presses on every screen. */
.ctx-form, .ctx-ask { display: grid; gap: 5px; padding: 2px 3px 4px; }
.ctx-field { display: grid; gap: 3px; }
.ctx-field-word { padding: 0 5px; font-size: 11px; color: var(--ink-4); }
.ctx-form .lm-input { margin: 0; }
.ctx-question { margin: 2px 5px 0; font-size: 13.5px; color: var(--ink); }
.ctx-sub { margin: 0 5px 3px; font-size: 11.5px; line-height: 1.4; color: var(--ink-4); }
.ctx-acts { display: flex; gap: 5px; }
.ctx-go, .ctx-ghost {
  flex: 1 1 auto;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ctx-go { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.ctx-ghost { border: 1px solid var(--line); background: none; color: var(--ink-3); }
@media (hover: hover) {
  .ctx-go:hover { background: var(--accent); color: var(--card-2); }
  .ctx-ghost:hover { background: var(--field); color: var(--ink); }
}
.ctx-go.danger { border-color: var(--down); background: var(--down-soft); color: var(--down); }
@media (hover: hover) {
  .ctx-go.danger:hover { background: var(--down); color: var(--card-2); }
}
.ctx-go:focus-visible, .ctx-ghost:focus-visible {
  outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* The icon picker is the row menu's third level: a field and the items it
   found, each drawn with the sprite it would pin. */
.ctx-icon-pick { display: grid; gap: 2px; }
.ctx-icon-pick .lm-input { margin: 2px 0 4px; }
.ctx-icon-results { max-height: 208px; overflow: auto; }
.ctx-icon-results .lm-pick { min-height: 30px; }
.lm-tool svg { display: block; width: 14px; height: 14px; margin: 0 auto; }
.ctx-head .lm-ico { align-self: center; }

/* The View picker holds two kinds of row - the lists, and the presets -
   and each kind says which it is in the head's voice, one step quieter. */
.lm-group {
  margin: 8px 0 2px;
  padding: 0 8px;
  font-family: var(--sans);
  font-size: 11px; font-weight: 600; letter-spacing: -.005em;
  color: var(--ink-4);
}
.lm-group-sep { margin-top: 10px; }
.lm-empty {
  margin: 2px 8px 6px;
  color: var(--ink-4);
  font-size: 11.5px;
  line-height: 1.4;
}
.lm-saveform { display: flex; align-items: center; gap: 4px; }
.lm-saveform .lm-input { flex: 1 1 auto; margin: 2px 0; }
.lm-save { width: auto; flex: 0 0 auto; color: var(--accent); }
.lm-input {
  width: 100%;
  margin: 3px 0;
  padding: 6px 8px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-xs);
  background: var(--field);
  color: var(--ink);
  font-size: 13px;
}
.lm-note { margin: 4px 7px 2px; font-size: 12px; color: var(--accent); }

.items-menu {
  position: fixed; z-index: 95;
  width: 260px; max-height: 60vh; overflow: auto;
  padding: 7px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow);
}
.items-menu[hidden] { display: none; }
.items-menu .items-row { display: flex; align-items: center; gap: 6px; border-radius: 6px; }
.items-menu .items-row:hover { background: var(--field); }
.items-open {
  flex: 1 1 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px; border: 0; background: none; color: var(--ink-2);
  font-size: 12px; text-align: left; cursor: pointer;
}
.items-open img { width: 22px; height: 22px; object-fit: contain; }
.items-x { width: 26px; height: 26px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-4); cursor: pointer; }
.items-x:hover { background: var(--field-2); color: var(--ink); }

/* the item page's full-screen chart keeps the card shape */
.chart-wrap.full { position: fixed; inset: 0; z-index: 90; margin: 0; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.chart-wrap.full .chart { flex: 1 1 auto; min-height: 0; }
.chart-wrap.full .chart svg { height: 100%; }
.chart-wrap.full .chart.chart-margin { flex: 0 0 96px; }
.chart-wrap.full .chart-sub { flex: 0 0 auto; }
/* A phone's full-screen chart needs its frame: edge to edge, the card's rounded
   corners sit against the glass and read as cropped. The 12px inset keeps all
   four corners whole without giving up the card's full-height plot. */
@media (max-width: 620px) {
  .chart-wrap.full { inset: 12px; }
}

/* One control, one glyph: the button carries both the enter and leave icons so
   the press does not swap a node, and only the one that describes the next press
   is drawn. */
.fs-open .fs-in { display: none; }
.fs-open[aria-pressed="true"] .fs-out { display: none; }
.fs-open[aria-pressed="true"] .fs-in { display: block; }

/* ---------------------------------------------------------------- responsive --- */
@media (max-width: 1240px) {
  :root { --side-col: 320px; }
}

@media (max-width: 1080px) {
  /* The field is a field's width here, not the row's spare space: below the
     desk's grid the strip is what takes what is left. Growing it from the row
     is what painted it the whole line on a refresh and shrank it a beat later,
     when the boot drew the pages and the strip claimed its half. */
  .ph-actions { flex: 0 0 auto; }
  .ph-search { width: 180px; }
  /* One column: the wrappers become contents so the chart, the ticket and the
     list are siblings, and the ticket sits under the chart rather than under
     four thousand rows. */
  .workspace { display: flex; flex-direction: column; align-items: stretch; }
  .workspace .card { flex: 0 0 auto; }
  .col-main, .col-side { display: contents; }
  .calc-card { order: 1; max-width: none; }
  .filters-card { order: 1; max-width: none; }
  .filters-show { display: inline-flex; align-items: center; }
  .filters-card .facets-body { display: none; }
  .filters-card.open .facets-body { display: flex; flex-direction: column; }
  .list-card { order: 2; }
  /* The movers are one ranking with the chart, so on a stacked layout they
     follow it rather than trailing the whole board. */
  .movers-card { order: 1; }
  /* Below this width `.workspace` is the scrollport, so neither the board nor
     the card around it may be one: a `thead` that sticks inside a box which
     never scrolls never moves, and it scrolled off the top with the rows.
     `clip` keeps the card's rounded corners cutting the rows exactly as
     `hidden` did, without becoming a scrollport of its own. The table still
     fits - every column a narrow screen cannot afford is already hidden. */
  .board-body { overflow: visible; }
  .list-card { overflow: clip; }
  /* An item is the page: its chart and quote come first, and the calculator
     follows the card rather than sitting between the tab strip and the item. */
  .shell.item-view .list-card { order: 1; }
  .shell.item-view .calc-card { order: 2; }
  /* The two cards under the ticket are siblings of it once the column is
     `display: contents`. Without their own order they fall back to zero and
     render above the item they describe. */
  .shell.item-view .fill-card { order: 3; }
  .shell.item-view .press-card { order: 4; }
}

/* Above the narrow-window breakpoint the card draws its body unconditionally,
   so the Show/Hide toggle would be a control that changes a class with no
   visible effect. The column already has the fields on the glass. */
@media (min-width: 1081px) {
  .filters-show { display: none; }
}

@media (max-width: 860px) {
  .rail { flex-basis: 64px; width: 64px; }
  .facets { left: 64px; width: min(320px, calc(100vw - 64px)); }
  .scrim { left: 64px; }
  :root { --page-pad: 18px; }
  .tb-band { padding-left: 18px; padding-right: 18px; }
  .workspace { padding: 0 var(--page-pad) 20px; }
  .ph-copy h1 { font-size: 24px; }
  .ph-search { width: 180px; }
  .mkt-chart-value { font-size: 26px; }
  .mkt-chart-plot { height: 170px; }
  .chart { min-height: 240px; }
}

/* Open items take the width the fixed search does not need: the strip scrolls,
   so it is the one that gives way. At 740 with eight tabs the strip's content
   held the row and the 180px field spilled past the glass (document 813 wide).
   Unconditional for the same reason as the desk's grid: the field's 180 is not
   the strip's answer to arrive with, it is the width of the field here. */
@media (min-width: 621px) and (max-width: 860px) {
  .ph-actions { flex: 0 0 auto; }
  .tb-pages { flex: 1 1 0; }
}

/* A cell has to be wider than the eleven-digit price it holds. Below this the
   four-up strip has less room than its own figures need, so it goes two-up
   ahead of the phone rules rather than spilling out of the card. */
@media (max-width: 819px) {
  .quote-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iv-head-stats .q-cell { padding: 0 12px; }
  .iv-head-stats .q-cell:nth-child(odd) { padding-left: 0; border-left: 0; }
  .iv-head-stats .q-cell:nth-child(even) { padding-right: 0; border-left: 1px solid var(--line); }
  .iv-head-stats .q-cell:nth-child(n + 3) {
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
}

/* The scale and the track under it are one column on every screen a hand holds,
   a landscape phone included. Both were shrink-to-fit in a wrapping row, so the
   scale stopped at its last word while the track was pushed right by its own
   margin: same left edge, two different right ones. */
@media (max-width: 860px) {
  .ranges button { flex: 1 1 0; min-width: 0; padding: 0 2px; }
}

@media (max-width: 620px) {
  body { font-size: 12.5px; }
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: 62px; flex-basis: auto;
    flex-direction: row; justify-content: space-around;
    padding: 0 8px env(safe-area-inset-bottom, 0px);
    border-right: 0; border-top: 1px solid var(--line);
    background: var(--rail);
  }
  .rail-brand { display: none; }
  .rail-switch { flex-direction: row; justify-content: space-around; gap: 0; flex: 1 1 auto; }
  .rail-foot { margin: 0; width: auto; }
  .rail-marks { flex-direction: row; }
  .rail-marks .tb-bell { width: 36px; height: 36px; }
  .notif-drawer { left: 12px; right: 12px; bottom: 74px; width: auto; max-height: calc(100dvh - 150px); }
  .rail-tab { width: 42px; height: 42px; }
  .rail-lbl { display: none; }
  .main { padding-bottom: 66px; }
  :root { --page-pad: 12px; --col-gap: 12px; }
  .workspace { padding: 0 var(--page-pad) 14px; }
  .tb-band { padding: 10px 12px 0; }
  .band-stats { gap: 6px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .band-stats::-webkit-scrollbar { display: none; }
  .stat-pill { height: 28px; font-size: 10.5px; padding: 0 10px; }
  .page-head { height: 60px; padding: 0 calc(var(--page-pad) + var(--shell-gutter, 0px)) 0 var(--page-pad); gap: 8px; }
  .ph-copy h1 { font-size: 21px; }
  .ph-copy p { display: none; }
  .ph-actions { width: auto; margin-left: auto; min-width: 0; flex: 1 1 auto; }
  .ph-search { flex: 1 1 auto; width: auto; min-width: 0; }
  /* The card hangs from the field's left edge, not its right. The field ends at
     100vw minus its right padding and the scrollbar's lane, so a card wider than
     the field and anchored to that edge ran off the glass at 320 (x -4). Its own
     cap is the viewport less 12px a side, which from the left edge always fits. */
  .suggest {
    left: 0; right: auto; width: min(320px, calc(100vw - 24px));
    /* Eight answers at a thumb's 46 and the plate's 14 of frame: the desk cap
       below 340 showed seven and left the eighth under the fold, though the
       card has the room for it even at 320x568. */
    /* Above the keys and the bar: the card's own 57 from the glass, the 56
       the bar takes, 8 of breathing room, and whatever the keyboard holds. */
    max-height: clamp(120px, calc(100dvh - 129px - var(--kb, 0px)), 382px);
  }
  .ph-actions .tb-bell { display: none; }
  /* Open items are a row of their own: search keeps the full header width and
     the tabs get the strip under it instead of being squeezed beside it. */
  .page-head:has(.tb-pages:not([hidden])) {
    height: auto; min-height: 60px; flex-wrap: wrap;
    padding-top: 8px; padding-bottom: 4px; row-gap: 4px;
  }
  .page-head:has(.tb-pages:not([hidden])) .tb-pages {
    order: 3; flex: 1 0 100%;
  }
  /* On a phone the open-item strip is the head's second line, and an item URL
     always has its item as an open tab - so that line is part of the page, even
     for the length of a boot. It used to be drawn 46px into a 60px head and
     pushed the workspace down by the row's own height; the head keeps the line's
     height while the strip is still missing. Only an item page reserves it: the
     market opens with no tabs as often as with them. */
  .shell[data-screen="item"] .page-head:not(:has(.tb-pages:not([hidden]))) {
    min-height: 106px;
    align-items: flex-start;
    padding-top: 8px;
  }
  .card { padding: 14px; border-radius: 15px; }
  .chart-card { padding: 14px 14px 6px; }
  /* A phone's headline is one line: the move, the count and the change. The
     plot and its controls belong to a window with room for them, and the
     listing starts where they would have. */
  .mkt-hero { padding: 12px 14px; }
  .mkt-chart-head { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .mkt-chart-copy { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
  .mkt-chart-figs { gap: 6px; flex-wrap: nowrap; }
  .mkt-chart-value { font-size: 21px; }
  .mkt-chart-sub, .mkt-chart-plot { display: none; }
  .list-card { padding: 2px 2px 6px; }
  .card-head h2 { font-size: 13px; }
  .mkt-chart-plot { height: 150px; }
  .facets { left: 0; width: 88vw; top: 0; bottom: 62px; border-radius: 0 16px 0 0; }
  .scrim { left: 0; bottom: 62px; }

  /* The rows become compact cards on a phone: the name owns the top line,
     the change sits at its right, and four readings share the width below.
     The grid uses the whole card instead of leaving the figures bunched at
     one end. */
  .board-body table.grid thead { display: none; }
  .board-body table.grid tbody tr {
    position: relative;
    display: grid;
    /* The four readings share the card's width equally: each track is one
       fraction of the row, so a long figure cannot widen its own column and
       push the card past the phone's edge. */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "name name name ."
      "buy sell margin roi";
    gap: 3px 8px;
    align-items: center;
    /* The card is a row of readings, not a tile: the padding and the gap are
       what the eye needs to tell one card from the next, and every pixel past
       that is a card the screen cannot show. The readings below use the whole
       of that width; only the name line steps in past the star. */
    padding: 6px 10px 7px;
    border-bottom: 1px solid var(--line-soft);
  }
  .board-body table.grid tbody td {
    border: 0; padding: 0; text-align: left; font-size: 11px; min-width: 0;
  }
  /* A card carries no star. Its 44px target shared the left edge with the
     sprite, so it either sat on the sprite or pushed the name off the card's
     edge - and at 44px it was most of the name line's height. Saving is the item
     page's control, one press from the card. */
  .board-body tbody td.star-cell { display: none; }
  /* The sprite starts on the card's own left inset, level with the first of the
     four readings below it, and the name follows it. With no star to make room
     for, the line is as tall as the sprite and the change it carries. `table.grid`
     is named so this stays the more specific rule against the card's `padding: 0`. */
  .board-body table.grid tbody td.name {
    grid-area: name;
    display: flex; align-items: center;
    min-width: 0;
    padding: 0;
    /* The name is one cut line, not a column header: the cell spans three of
       the readings' columns, so its content would otherwise size them, and a
       long name would widen the first three tracks and move every reading - and
       the spark above them. Contained, it fills its area and truncates, and the
       tracks stay on the floor the readings are held to. */
    contain: inline-size;
  }
  .board-body tbody td.name .item-cell { width: 100%; }
  /* The spark is the Margin reading's column: it is exactly one reading wide at
     the name line's right end, and that end is the third reading's right edge,
     so its left edge starts where Margin's does on every card. Its own
     font-size is the readings' because `ch` is measured on the element it is
     written on, and 8ch is the floor the four tracks are held to. */
  .board-body table.grid tbody td.name .item-cell .row-spark {
    flex: 0 0 8ch; width: 8ch; font-size: 11px;
  }
  /* The change is the one reading a card carries without the window beside it,
     because the header that names the window is not drawn here. The label rides
     above the pill, and the pair is the top row's own right end rather than a
     column of its own: a column wide enough for a pill would have taken its
     width out of the four readings' spacing below it. */
  .board-body tbody td:nth-child(11) {
    grid-area: 1 / 1 / 2 / 5; justify-self: end; align-self: center;
    display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  }
  .mkt-win {
    display: block;
    font-family: var(--sans); font-size: 8.5px; line-height: 1;
    letter-spacing: .04em; color: var(--ink-4);
  }
  /* Every key the sort strip offers is a reading the card shows: the quote
     pair the list is about, the two spreads made from it, and volume. Limit,
     bought and sold stay on the desk, where there is a column for them. */
  .board-body tbody td:nth-child(7),
  .board-body tbody td:nth-child(9),
  .board-body tbody td:nth-child(10) { display: none; }
  .board-body tbody td:nth-child(3) { grid-area: buy; }
  .board-body tbody td:nth-child(4) { grid-area: sell; }
  .board-body tbody td:nth-child(5) { grid-area: margin; }
  .board-body tbody td:nth-child(6) { grid-area: roi; }
  /* Left on each reading's own edge, not centred in it: a centred first reading
     starts a label's width inside the sprite, so the two rows only looked like
     they shared a left edge. */
  .board-body tbody td:nth-child(3),
  .board-body tbody td:nth-child(4),
  .board-body tbody td:nth-child(5),
  .board-body tbody td:nth-child(6) {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 0; text-align: left;
  }
  /* The last reading closes the row on the card's right edge, the way the first
     opens it on the sprite's: the row reaches both sides. */
  .board-body tbody td:nth-child(6) {
    align-items: flex-end; text-align: right;
  }
  /* The spread pills are a reading inside a card, so they carry a card's
     tighter padding rather than the desk's. */
  .board-body table.grid tbody .mkt-delta { padding: 1px 6px; font-size: 10.5px; }
  /* The membership tag rides the name: at 8.5px it was a smudge, not a tag. */
  .board-body table.grid tbody .item-cell .f2p { font-size: 10px; }
  .board-body tbody td:nth-child(3)::before,
  .board-body tbody td:nth-child(4)::before,
  .board-body tbody td:nth-child(5)::before,
  .board-body tbody td:nth-child(6)::before {
    display: block;
    color: var(--ink-4);
    font-family: var(--sans);
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: none;
    margin-bottom: 0;
    text-align: left;
  }
  .board-body tbody td:nth-child(3)::before { content: "Buy"; }
  .board-body tbody td:nth-child(4)::before { content: "Sell"; }
  .board-body tbody td:nth-child(5)::before { content: "Margin"; }
  .board-body tbody td:nth-child(6)::before { content: "ROI"; }
  .board-body tbody td:nth-child(5) { color: var(--ink-2); }
  .vol-full { display: none; }
  .vol-short { display: inline; }
  /* The caption, the sort strip and the Load more button sit on the same left
     edge as the cards' own content, not 2px outside it. */
  .board-body caption { padding: 12px 10px 8px; }

  /* The header is not drawn at this width, so its sort buttons ride over the
     cards as one sideways strip. The strip scrolls rather than wrapping, and
     fades its edge only while a key is still beyond it. */
  .board-body .sortbar {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px 6px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
  }
  .board-body .sortbar::-webkit-scrollbar { display: none; }
  .board-body .sortbar.more {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  .board-body .sortbar button {
    flex: 0 0 auto; height: 44px; min-width: 44px; padding: 0 12px;
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--field); color: var(--ink-3);
    font-size: 12px; font-weight: 500; cursor: pointer;
  }
  .board-body .sortbar button[aria-pressed="true"] {
    background: var(--field-2); color: var(--ink); border-color: var(--line-strong);
  }
  .board-body .sortbar button .caret { font-size: 9px; color: var(--accent); }

  /* A phone's way on: the next page is a press at the foot of the cards. */
  .loadmore { display: block; padding: 4px 10px 10px; }
  .loadmore[hidden] { display: none; }
  #load-more {
    width: 100%; height: 42px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--field);
    color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer;
  }
  #load-more:hover { background: var(--field-2); color: var(--ink); }
  #load-more:disabled { opacity: .55; cursor: default; }
  .rail-tab { width: 40px; height: 40px; }
  .rail-switch { gap: 0; }
  .rail-marks .acct, .rail-marks #signin { width: 36px; height: 36px; }

  .quote-row { gap: 6px; grid-template-columns: repeat(2, 1fr); }
  .q-cell { padding: 9px 10px; min-width: 0; }
  /* Four cells will not fit a phone once a margin runs to nine digits: a cell
     cannot shrink below the figure it holds, so the strip spilled its ROI out
     of the card. Two rows of two keep every figure whole, and the return is
     still allowed to sit under the gp figure rather than widen the cell. */
  .q-cell .v { font-size: 15px; flex-wrap: wrap; gap: 1px 6px; }
  .q-cell .q-pct { font-size: 10px; }
  .iv-head { padding: 12px; gap: 10px; border-radius: 15px; }
  .iv-top { gap: 10px; flex-wrap: wrap; }
  .iv-head .ico-lg, .iv-head > img { width: 40px; height: 40px; }
  .iv-title h2 { font-size: 18px; }
  .iv-acts { width: 100%; }
  .chart { height: clamp(120px, calc(100dvh - 560px), 288px); min-height: 120px; }
  /* The chart's header scale and footer key are the card's own; see the chart
     card block at the end of this sheet. */
  .calc-card { max-width: none; }
  /* The pager belongs to the desk's window; a phone reads the same list a page
     at a time from the Load more row under the cards. */
  .pager { display: none; }
  .pg-info { font-size: 10px; }
}

@media (max-width: 400px) {
  .mkt-chart-value { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  /* No transitions rather than a thousandth of a millisecond of them: a
     duration that short still starts each property at its old value, and the
     first frame after the item page gives the board back to the market painted
     the item page's unframed card and its 28px foot padding once before the
     market's own. That one frame is the listings card that looked like it
     shrank into place. A moving thing is what this query asks us not to draw. */
  *, *::before, *::after {
    transition: none !important;
    animation-duration: .01ms !important;
  }
}

/* ------------------------------------------------------------ view shapes --- */

/* The market's list is its own window. The page does not scroll on this screen:
   the chart keeps its place at the top with the movers beside it, the list takes
   whatever height is left, and the rows move under a head that stays where it
   is. The scrollbar therefore rides the table's edge rather than the window's,
   which is several hundred pixels to the right of the last column it moves. */
@media (min-width: 1081px) {
  /* No padding at the foot: the filter column is 824px of card at every width,
     and the 28px the column used to reserve is the difference between the whole
     card fitting a laptop window and the column growing a scrollbar of its own.
     When the window is shorter than the card the page scrolls, as it did before. */
  .shell[data-screen="market"]:not(.item-view) .workspace {
    overflow: auto; padding-bottom: 0; align-items: stretch;
  }
  /* Two rows, not three: the chart and the movers share the first, and the list
     is the row that is left over - which is what makes the table, rather than
     the page, the thing that scrolls. */
  .shell[data-screen="market"]:not(.item-view) .col-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
    min-height: 0;
  }
  .shell[data-screen="market"]:not(.item-view) .col-main:has(#mkt-top:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  }
  .shell[data-screen="market"]:not(.item-view) .mkt-hero {
    grid-column: 1; grid-row: 1; min-width: 0;
  }
  /* The movers read as a column beside the chart: same top edge, same height,
     and its own soft scroll when a window's worth of them is taller than the
     plot. The hidden card keeps its silence - `display: flex` here would
     otherwise beat the attribute that hides it. */
  .shell[data-screen="market"]:not(.item-view) .movers-card {
    grid-column: 2; grid-row: 1; min-height: 0;
    display: flex; flex-direction: column;
  }
  .shell[data-screen="market"]:not(.item-view) .movers-card[hidden] { display: none; }
  .shell[data-screen="market"]:not(.item-view) .movers-card .mkt-top-list {
    flex: 1 1 auto; min-height: 0; overflow: auto;
  }
  /* The filters show in full or the page moves: a scrollbar inside the column
     would hide half of them behind a bar nobody asked to drag. */
  .shell[data-screen="market"]:not(.item-view) .col-side {
    position: static; min-height: 0;
  }
  /* The row that is left over, under the chart and the movers: with no heading
     above them the cards are row 1, so the list cannot stay on the old row 3 -
     an implicit row there sits past the window's foot and the board is the
     thing that disappears. */
  .shell[data-screen="market"]:not(.item-view) .list-card {
    grid-column: 1 / -1; grid-row: 2;
    min-height: 0; display: flex; flex-direction: column;
  }
  /* A zero basis: the board's own content is ten thousand pixels, and letting
     that be its starting size is what used to squeeze it to three rows. */
  .shell[data-screen="market"]:not(.item-view) .board-body {
    flex: 1 1 0; min-height: 0; overflow: auto;
  }
}

/* An item is the board itself: its own header and plot replace the list's
   cards, so those step out of the way rather than leaving empty plates. */
.shell.item-view .mkt-hero,
.shell.item-view .movers-card { display: none; }
  .shell.item-view .band-stats { display: none; }
.shell.item-view .list-card { padding: 0; border: 0; background: none; }
.shell.item-view .pager { display: none; }

/* An item fills the window rather than a card: the plot is the page now, so it
   takes every pixel under the quote row and ends at the shell's foot. */
@media (min-width: 1081px) {
  .shell.item-view .workspace { overflow: auto; align-items: stretch; }
  .shell.item-view .col-main { min-height: 0; }
  .shell.item-view .list-card {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
  }
  .shell.item-view .board-body {
    flex: 1 1 auto; min-height: 0; overflow-y: hidden;
    display: flex; flex-direction: column;
  }
  .shell.item-view .itemview { flex: 1 1 auto; min-height: 0; }
  .shell.item-view .iv-grid { flex: 1 1 auto; min-height: 0; display: flex; }
  .shell.item-view .iv-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .shell.item-view .quote-row { flex: 0 0 auto; }
  .shell.item-view .chart-wrap {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
  }
  .shell.item-view .chart-top { flex: 0 0 auto; }
  .shell.item-view .chart { flex: 1 1 auto; min-height: 180px; }
  .shell.item-view .chart.chart-margin { flex: 0 0 96px; min-height: 0; }
}

/* Settings, the history and the plans page are documents, not boards: the
   market band, the board's head, the open-item tabs and the ticket all belong
   to the list. Without this the ticket stayed beside the document and left it
   in a two-column workspace sized for a list that is not there. */
.shell:is([data-screen="settings"], [data-screen="notifications"]) .band-stats,
/* every screen keeps its own h1, named by app.js, so it is not hidden here */
.shell:is([data-screen="settings"], [data-screen="notifications"]) .ph-filter,
.shell:is([data-screen="settings"], [data-screen="notifications"]) .calc-card { display: none; }
.shell:is([data-screen="settings"], [data-screen="notifications"]) .workspace {
  grid-template-columns: minmax(0, 1fr);
}
#mkt-hero:has(#mkt-chart:not([hidden])) .chart-empty-note { display: none; }

/* The server's blocks (`.ssr`) are not hidden here: they are the page's first
   paint until the app replaces them. Hiding them made LCP wait for the boot's
   first fetch - 4.3s on a throttled phone for the market board, 4.6s for an
   item - while the same content was already in the HTML. The app clears the
   block as it paints (`renderTable` in market.js, `renderItem` in item.js), so
   a running page never shows a stale copy beside its own. */

/* The drawer slides; it is only removed from the page once it has landed. */
.facets { transition: transform var(--t-move) var(--ease), visibility 0s linear var(--t-move); }
.facets.open { transition: transform var(--t-move) var(--ease), visibility 0s; }


/* --------------------------------------------------------------- list fit --- */
/* A terminal is read across, but ten columns of gp at 13px do not fit a 1440
   screen beside the ticket: the two activity columns are the first to go, and
   the change stays because it is what a row is scanned for. */
@media (max-width: 1640px) {
  .board-body .hide-md { display: none; }
}
/* A name is a name, not a width: the item column is the one whose content is a
   sentence, so it gets a ceiling no real item name reaches. Without it one long
   catalogue entry widens the table past its card at every width above 940,
   where the buy limit and the volume come back. */
.board-body tbody td.name,
.board-body thead th:nth-child(2) { max-width: 320px; }
/* A tablet is still a table - the cards start at 620 - and the nine columns
   left at that width are 761px of nowrap figures against a card 492-919 wide.
   The table cannot scroll sideways there (`overflow: visible` keeps the sticky
   head stuck to the page), so the columns that do not fit are dropped rather
   than left half under the card's edge: the buy limit is the item page's
   business, and the volume bar goes with it. The change stays.

   Where even that set overflows - up to ~860 on the longest name the
   catalogue holds, 729px of table against a 492-731 board - the name column
   takes the squeeze: capped at 180, a name that does not fit ellipsizes under
   the spark rather than widening the table past the card. The cap is held to
   the same 940 as the hidden columns, so a longer name still cannot push the
   table over the edge. The measurement is the table's own, `probe_board_fit`,
   against a catalogue seeded with the longest names. */
@media (min-width: 621px) and (max-width: 940px) {
  .board-body tbody td:nth-child(7),
  .board-body thead th:nth-child(7),
  .board-body tbody td:nth-child(8),
  .board-body thead th:nth-child(8) { display: none; }
}
@media (min-width: 621px) and (max-width: 940px) {
  .board-body tbody td.name,
  .board-body thead th:nth-child(2) { max-width: 180px; }
}
.board-body tbody td { padding: 9px 10px; }
.board-body thead th { padding: 8px 10px; }
.bar-cell .bar { width: 54px; }
.mkt-chart-plot { overflow: hidden; }
.mkt-chart-plot svg { width: 100%; height: 100%; max-width: 100%; }

/* -------------------------------------------------------- other screens ----- */
.shell.no-facets .mkt-hero,
.shell.no-facets .movers-card { display: none; }
.shell.no-facets .list-card { padding: 0; border: 0; background: none; }

.settings { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
/* My Account is a settings surface, but it is still a page in this workspace:
   the forms take the same main track as the market and item pages, and the
   account's summary cards take the same side track. It was a centred 780px
   island, narrower than every page it sat beside. */
.settings.account { max-width: none; margin: 0; gap: 14px; }
.acct-grid { display: flex; align-items: flex-start; gap: var(--col-gap); }
.acct-main, .acct-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.acct-main { flex: 1 1 auto; }
.acct-side { flex: 0 0 var(--side-col); position: sticky; top: 0; }
@media (max-width: 1080px) {
  .acct-grid { flex-direction: column; align-items: stretch; gap: 12px; }
  .acct-main, .acct-side { display: contents; }
  .acct-upsell { order: 0; }
  .acct-billing { order: 1; }
  .acct-signin { order: 2; }
  .acct-alert { order: 3; }
  .acct-delete { order: 4; }
}
.set-head.mast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.set-head h2 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.setgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.scard { position: relative; }
.scard h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.scard.upsell { border-color: var(--accent-line); background: linear-gradient(180deg, rgba(255, 138, 31, .07), transparent 70%), var(--card); }
.upsell-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upsell-copy { min-width: 0; }
.upsell-row .scard-foot { flex: 0 0 auto; }
.set-id { min-width: 0; }
.set-who { margin: 4px 0 0; color: var(--ink-3); font-size: 11.5px; }
.set-head.mast .sbtn { flex: 0 0 auto; }
.scard.danger-fold { padding: 0; gap: 0; }
.scard.danger-fold > summary {
  padding: 18px; color: var(--ink-2); font-size: 14px; font-weight: 600;
  cursor: pointer; list-style: none;
}
.scard.danger-fold > summary::-webkit-details-marker { display: none; }
.scard.danger-fold > summary::after {
  content: "+"; float: right; color: var(--ink-3); font-family: var(--mono);
  font-weight: 400;
}
.scard.danger-fold[open] > summary::after { content: "−"; }
.scard.danger-fold[open] > summary { border-bottom: 1px solid var(--line); }
.danger-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }

.facts { display: grid; gap: 2px; margin: 0; }
.facts > div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--line-soft);
}
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-3); font-size: 11.5px; }
.facts dd { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 0; color: var(--ink); font-family: var(--mono); font-size: 12px; }
.facts dd em { color: var(--ink-3); font-style: normal; }

.passform { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.passform label { display: flex; flex-direction: column; gap: 4px; color: var(--ink-3); font-size: 11px; }
.passform label b { color: var(--ink-2); }
.passform input {
  width: 100%; height: 38px; padding: 0 11px;
  border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink);
  font-family: var(--sans); font-size: 12.5px; outline: none;
}
.passform input:focus { border-color: var(--line-strong); }
.passform input::placeholder { color: var(--ink-4); }
.passform .sbtn, .passform .drow { align-self: flex-start; }
.drow { display: flex; gap: 8px; flex-wrap: wrap; }

/* Connected sign-in providers: the marks are inline SVGs, so they need a
   measured row and a measured plate. Without both, an SVG with no width/height
   painted at its intrinsic size and took over the card. */
.soc { display: flex; flex-direction: column; margin-top: 2px; border-top: 1px solid var(--line-soft); }
.soc-row {
  display: grid;
  grid-template-columns: 24px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.soc-row:last-child { border-bottom: 0; }
.soc-mark {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  overflow: hidden; border-radius: 6px; background: var(--bg-2);
}
.soc-mark svg, .soc-mark img { width: 16px; height: 16px; }
.soc-name { color: var(--ink-2); font-size: 12px; }
.soc-state {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-4); font-size: 11px;
}
.soc-state.on { color: var(--up); }
.soc-row .sbtn { justify-self: end; }
@media (max-width: 620px) {
  .soc-state { white-space: normal; line-height: 1.35; }
  /* A field has a second line to itself on a phone: the name column and the
     action column left a long address about 144px wide at 320. */
  .acfg-row.acfg-field { grid-template-columns: 8px minmax(0, 1fr); row-gap: 4px; }
  .acfg-row.acfg-field .acfg-name { grid-column: 2; }
  .acfg-row.acfg-field input.num { grid-column: 1 / -1; }
}

#del-form { display: none; }
#del-form.armed { display: flex; }
.scard.danger { border-color: rgba(255, 92, 102, .25); }
.scard-foot .sbtn:first-child { margin-left: 0; }
.set-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* the alert-settings card */
.spanel { overflow: hidden; }
.acfg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acfg-power { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 11px; }
.switch {
  appearance: none; -webkit-appearance: none;
  width: 38px; height: 22px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--field);
  position: relative; cursor: pointer; margin: 0;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink-3); transition: left var(--t-quick), background var(--t-quick);
}
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { left: 18px; background: #16110a; }
.alertcfg-body { margin-top: 10px; }
.acfg-rows { display: flex; flex-direction: column; }
.acfg-row {
  display: grid;
  grid-template-columns: 8px 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.acfg-row:last-child { border-bottom: 0; }
.acfg-row.off { opacity: .55; }
.acfg-row.off input { cursor: default; }
.acfg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--field-2); border: 1px solid var(--line-strong); }
.acfg-dot.on { background: var(--up); border-color: var(--up); }
.acfg-name { color: var(--ink-2); font-size: 12px; }
.acfg-state { color: var(--ink-4); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acfg-row input.num {
  height: 34px; padding: 0 10px; width: 100%;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); font-size: 11.5px; outline: none;
}
.acfg-row input.num:focus { border-color: var(--line-strong); }
.alertfoot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 12px; }
.alertfoot .sub { margin: 0 auto 0 0; }
/* The imported-trades log under the RuneLite connection card: every row the
   server kept, newest first. The left column is what was traded, the right is
   what it came to and when; the numbers are mono so they line up down the card,
   and the sprite is a fixed cell whether or not the catalogue has one. */
.trd-rows { display: flex; flex-direction: column; margin: 2px 0 0; padding: 0; list-style: none; }
.trd-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.trd-row:last-child { border-bottom: 0; }
.trd-row .ico { width: 26px; height: 26px; display: grid; place-items: center; }
.trd-row .ico img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.trd-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trd-nm { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trd-meta {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  color: var(--ink-4); font-family: var(--mono); font-size: 10.5px;
}
.trd-side { padding: 1px 5px; border-radius: 4px; font-family: var(--sans); font-size: 9.5px; line-height: 1.5; }
.trd-side.buy { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.trd-side.sell { color: var(--accent); background: var(--accent-soft); }
.trd-num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: var(--mono); }
.trd-num b { color: var(--ink); font-size: 12px; font-weight: 500; }
.trd-num span { color: var(--ink-4); font-size: 10px; white-space: nowrap; }
.trd-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 10px; border-top: 1px solid var(--line-soft);
}
.trd-foot .sub { margin: 0; }
/* The Trades tab reuses the planner's summary and card, with one more row of
   figures because a trade ledger has a bought and a sold side. */
.trade-sum-row { margin-top: 8px; }
.trade-note { margin: 7px 0 0; color: var(--ink-4); font-size: 10px; line-height: 1.45; }
.trade-pos .flip-copy span { white-space: normal; }
.trade-pos .trade-note { margin-bottom: 0; }
.trade-card { padding: 4px 10px; }
.trd-pnl { color: var(--ink-4); font-size: 10px; }
.trd-pnl.up { color: var(--up); }
.trd-pnl.down { color: var(--down); }
@media (max-width: 620px) {
  /* A phone has no room for three readings on one line: the total and the time
     move under the name, and only the sprite and the name share the first. */
  .trd-row { grid-template-columns: 24px minmax(0, 1fr); row-gap: 3px; }
  .trd-num { grid-column: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; }
}

.pcrown { position: absolute; top: 12px; right: 12px; }


/* ----------------------------------------------------------- alert rows ----- */
.aitem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 3px 8px;
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color var(--t-quick), background var(--t-quick);
}
.aitem:hover { border-color: var(--line-strong); background: var(--field); }
/* The name on its own line and the sentence with its level under it, on every
   row: a short line and a long one used to draw at different heights, so a pane
   of four read as two kinds of row rather than one list. The two right-hand
   columns hold the once-badge and the re-arm mark; empty ones take no room. */
.aitem .anm { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.aico {
  display: inline-flex; flex: 0 0 22px;
  width: 22px; height: 22px; align-items: center; justify-content: center;
}
.aico .ico { display: grid; place-items: center; width: 100%; height: 100%; }
.aico img, .aico svg { width: 22px; height: 22px; object-fit: contain; }
.anm [data-aname] { font-size: 11.5px; color: var(--ink-3); }
.aitem .aonce { grid-area: 1 / 2; justify-self: end; }
.aitem .acts { grid-area: 1 / 3; justify-self: end; }
.alvl {
  color: var(--ink-2);
  font-size: 11.5px;
  grid-area: 2 / 1 / 3 / 4;
  /* A sentence, not a row of boxes: the crossing and its level are separated by
     the space between their spans, the width of a word space, rather than by a
     flex gap that put 7px in front of every value. */
  min-width: 0;
}


/* Each guard is a line of its own under the crossing, so a row with three
   conditions reads as three lines instead of one clause wrapping at whatever
   width the pane happened to be. */
.aitem .aguard { display: block; color: var(--ink-3); }
.aval em { font-style: normal; }



.aonce {
  padding: 1px 6px; border-radius: 5px;
  background: var(--field-2); color: var(--ink-4);
  font-size: 9px; letter-spacing: .04em; text-transform: none;
}
.aonce.fired { color: var(--accent); background: var(--accent-soft); }
.acts { display: inline-flex; }
.arearm {
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 5px; background: var(--field-2); color: var(--ink-3); cursor: pointer;
}
.arearm:hover { color: var(--accent); }


/* The phone's header and rows are laid out rather than left to min-content:
   a field with a minimum width would push the filter off the glass. */
@media (max-width: 620px) {
  .ph-actions { display: flex; align-items: center; gap: 8px; }
  .ph-search { width: 150px; min-width: 110px; }
  .ph-filter { width: 44px; height: 44px; }
  .col-main, .list-card, .board-body, .mkt-chart-head { min-width: 0; max-width: 100%; }
  .board-body table.grid tbody tr { width: 100%; }
  .board-body table.grid tbody td:nth-child(8) { display: none; }
  .item-cell .nm { max-width: 160px; }
  .item-cell .row-spark { flex-basis: 34px; width: 34px; height: 12px; }
}

/* ----------------------------------------------------------------- flips --- */
/* A flip is a plan with a ledger under it. The pane is the column's width, so
   the card is a stack rather than a table: item and state, progress, four
   figures, then the fills when the reader asks for them. */
.flip-summary {
  margin-bottom: 9px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2);
}
.flip-sum-row { display: flex; gap: 14px; flex-wrap: wrap; }
.flip-sum-row > div { flex: 1 1 30%; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.flip-sum-row span, .flip-sum-foot {
  color: var(--ink-3); font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .06em; text-transform: none;
}
.flip-sum-row b { color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 500; }
.flip-sum-row b.up, .flip-figures b.up, .flip-projection b.up { color: var(--up); }
.flip-sum-row b.down, .flip-figures b.down, .flip-projection b.down { color: var(--down); }
.flip-sum-foot {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line-soft);
  text-transform: none; letter-spacing: 0;
}
.flip-runelite-row .flip-runelite::before { background: #c9a227; box-shadow: 0 0 0 2px rgba(201, 162, 39, .16); }

/* the imported-trade review: a raw list, sorted so open holdings come first */
#rl-review-modal, #rl-connect-modal {
  position: fixed; inset: 0; z-index: 126;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
body:has(#rl-review-modal), body:has(#rl-connect-modal) {
  overflow: hidden; padding-right: var(--overlay-scrollbar, 0px);
}
.rl-review-scrim, .rl-connect-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); }
.rl-review-dialog, .rl-connect-dialog {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  width: min(680px, 100%); max-height: calc(100dvh - 32px); overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.rl-connect-dialog { width: min(560px, 100%); }
.rl-review-head, .rl-connect-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--line);
}
.rl-review-head h3, .rl-connect-head h3 {
  margin: 0; color: var(--ink); font-size: 18px; font-weight: 600;
  letter-spacing: -.015em;
}
.rl-review-head p, .rl-connect-head p {
  max-width: 54ch; margin: 4px 0 0; color: var(--ink-3);
  font-size: 10.5px; line-height: 1.45;
}
.rl-connect-body { padding: 16px; overflow-y: auto; }
.rl-connect-steps {
  display: flex; flex-direction: column; gap: 14px;
  margin: 0; padding-left: 20px;
}
.rl-connect-steps > li { padding-left: 2px; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.rl-connect-steps > li::marker { color: var(--accent); font-family: var(--mono); font-size: 11px; }
.rl-connect-steps b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.rl-connect-steps p { margin: 0 0 6px; color: var(--ink-3); }
.rl-connect-steps p:last-child { margin-bottom: 0; }
.rl-connect-location {
  margin: 7px 0 9px; padding: 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2);
}
.rl-connect-location-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.rl-connect-location-label { color: var(--ink-2); font-size: 10.5px; }
.rl-connect-os { position: relative; display: inline-flex; flex: 0 0 auto; }
.rl-connect-os::after {
  content: ""; position: absolute; right: 9px; top: 50%;
  width: 5px; height: 5px;
  border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.rl-connect-os select {
  height: 30px; padding: 0 25px 0 9px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2); color: var(--ink-2);
  font-family: var(--sans); font-size: 10.5px; font-weight: 500;
  cursor: pointer;
}
.rl-connect-os select:hover, .rl-connect-copy:hover {
  border-color: var(--line-strong); color: var(--ink);
}
.rl-connect-os select:focus-visible, .rl-connect-copy:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.rl-connect-location-row { display: flex; flex-wrap: wrap; gap: 7px; }
.rl-connect-steps .rl-connect-location-path {
  flex: 1 1 260px; min-width: 0; min-height: 34px;
  display: flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--field); color: var(--ink-2);
  font-family: var(--mono); font-size: 10px; line-height: 1.35;
  overflow-wrap: anywhere;
}
.rl-connect-copy {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; min-width: 122px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2); color: var(--ink-2);
  font-family: var(--sans); font-size: 10.5px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
}
.rl-connect-copy svg { flex: 0 0 auto; }
.rl-connect-copy.done {
  color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent);
  background: var(--up-soft);
}
.rl-connect-copy.miss {
  color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent);
  background: color-mix(in srgb, var(--down) 8%, transparent);
}
.rl-connect-steps code {
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--field); color: var(--ink-2); font-family: var(--mono);
  font-size: 10px; overflow-wrap: anywhere;
}
.rl-connect-note {
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft);
  color: var(--ink-4); font-size: 10px; line-height: 1.5;
}
.rl-connect-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 82%, transparent);
}
@media (max-width: 620px) {
  .rl-connect-foot { flex-wrap: wrap; }
  .rl-connect-foot .sbtn { flex: 1 1 auto; }
}
@media (max-width: 480px) {
  .rl-connect-copy { width: 100%; }
}
@media (pointer: coarse) {
  .rl-connect-copy { min-height: 44px; }
}
.rl-review-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 16px; border-bottom: 1px solid var(--line-soft);
}
.rl-review-bulk {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 16px; border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
}
.rl-review-all { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 10px; cursor: pointer; }
.rl-review-all input, .rl-trade-check input { width: 14px; height: 14px; accent-color: var(--accent); }
.rl-review-picked { color: var(--ink-3); font-family: var(--mono); font-size: 9.5px; }
.rl-review-bulkacts { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.rl-review-bulkacts button { height: 27px; padding: 0 8px; font-size: 9.5px; }
.rl-review-bulkacts button[disabled] { opacity: .4; cursor: default; }
.rl-review-note { margin: 10px 0 0; color: var(--accent); font-size: 10px; }
.rl-review-filters { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.rl-review-filters button {
  height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: 5px;
  background: none; color: var(--ink-3); font-size: 10.5px; cursor: pointer;
}
.rl-review-filters button:hover { color: var(--ink-2); background: var(--field); }
.rl-review-filters button[aria-pressed="true"] {
  color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft);
}
.rl-review-count {
  margin-left: auto; color: var(--ink-3); font-family: var(--mono);
  font-size: 9.5px; white-space: nowrap;
}
.rl-review-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 10px; }
.rl-review-sort select {
  height: 28px; padding: 0 22px 0 7px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg-2); color: var(--ink-2); font-family: var(--sans);
  font-size: 10.5px; cursor: pointer;
}
.rl-review-list { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 0 16px 14px; }
.rl-review-groups { list-style: none; margin: 0; padding: 0; }
.rl-item-group {
  margin: 0 0 9px; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: var(--bg-2);
}
.rl-item-group:last-child { margin-bottom: 0; }
.rl-item-head {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center; gap: 9px; padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft); background: var(--field);
}
.rl-item-ico { width: 30px; height: 28px; display: grid; place-items: center; }
.rl-item-ico img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.rl-item-ico > span { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.rl-item-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rl-item-copy b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 12px; font-weight: 500;
}
.rl-item-copy span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-4); font-family: var(--mono); font-size: 8.5px;
}
.rl-item-gain { color: var(--ink-3); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.rl-item-gain.up { color: var(--up); }
.rl-item-gain.down { color: var(--down); }
.rl-item-state {
  padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-4); font-family: var(--mono); font-size: 8px; white-space: nowrap;
}
.rl-item-state.flip {
  color: var(--up); border-color: color-mix(in srgb, var(--up) 35%, transparent);
  background: var(--up-soft);
}
.rl-item-state.open, .rl-item-state.mixed {
  color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft);
}
.rl-item-state.unmatched {
  color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, transparent);
  background: color-mix(in srgb, var(--down) 10%, transparent);
}
.rl-trade-list { list-style: none; margin: 0; padding: 0 10px; }
.rl-trade {
  display: grid; grid-template-columns: 18px 58px minmax(0, 1fr) auto auto;
  align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.rl-trade:last-child { border-bottom: 0; }
.rl-trade.is-hidden { opacity: .48; }
.rl-trade-check { display: grid; place-items: center; cursor: pointer; }
.rl-trade-date { color: var(--ink-4); font-family: var(--mono); font-size: 9px; }
.rl-trade-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rl-trade-main b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2); font-size: 11px; font-weight: 500;
}
.rl-trade-main span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-4); font-family: var(--mono); font-size: 8.5px;
}
.rl-trade-side { margin-right: 4px; font-style: normal; font-weight: 600; }
.rl-trade-side.buy { color: var(--up); }
.rl-trade-side.sell { color: var(--down); }
.rl-trade-note.up { color: var(--up); }
.rl-trade-note.down { color: var(--down); }
.rl-trade-flag {
  grid-column: 4;
  padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink-4); font-family: var(--mono); font-size: 8px;
}
.rl-trade-toggle { grid-column: 5; height: 27px; padding: 0 8px; font-size: 9.5px; }
.rl-review-empty, .rl-review-error { margin: 14px 0; color: var(--ink-3); font-size: 11px; }
.rl-review-error { color: var(--down); }
@media (max-width: 620px) {
  .rl-review-count { order: 3; width: 100%; margin-left: 0; }
  .rl-review-sort { margin-left: auto; }
  .rl-review-bulkacts { width: 100%; margin-left: 0; }
  .rl-item-head { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .rl-item-copy { grid-column: 2; grid-row: 1; }
  .rl-item-gain { grid-column: 2 / span 2; grid-row: 2; justify-self: start; }
  .rl-item-state { grid-column: 3; grid-row: 1 / span 2; }
  .rl-trade { grid-template-columns: 18px 44px minmax(0, 1fr) auto; gap: 6px; }
  .rl-trade-check { grid-row: 1 / span 2; }
  .rl-trade-flag { grid-column: 4; grid-row: 1; }
  .rl-trade-toggle { grid-column: 4; grid-row: 2; }
}
.flip-progress-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 9px 1px 5px; color: var(--ink-3);
}
.flip-progress-head b { color: var(--ink-2); font-size: 10px; font-weight: 500; }
.flip-progress-head span { font-size: 9.5px; }
.flip-matches {
  margin-bottom: 9px; padding: 9px 10px;
  border: 1px solid var(--accent-line); border-radius: 8px;
  background: var(--accent-soft);
}
.flip-matches-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.flip-matches-head b { color: var(--accent); font-size: 10.5px; font-weight: 600; }
.flip-matches-head span { color: var(--ink-3); font-family: var(--mono); font-size: 9.5px; }
.flip-matches-note { margin: 4px 0 7px; color: var(--ink-3); font-size: 9.5px; line-height: 1.45; }
.flip-match { display: flex; flex-direction: column; gap: 5px; padding-top: 7px; border-top: 1px solid var(--line-soft); }
.flip-match:first-of-type { padding-top: 0; border-top: 0; }
.flip-match-name { color: var(--ink-2); font-size: 10px; }
.flip-match-plans { display: flex; flex-wrap: wrap; gap: 4px; }
.flip-match-plans button { height: 27px; padding: 0 7px; font-size: 9.5px; }
.flip-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.flip-tools .flip-filters { margin-bottom: 0; }
.flip-filters { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; margin-bottom: 8px; }
.flip-sort { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ink-3); font-size: 10px; }
.flip-sort select {
  height: 30px; padding: 0 24px 0 8px;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg-2); color: var(--ink-2);
  font-family: var(--sans); font-size: 10.5px; cursor: pointer;
}
.flip-sort select:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.flip-filters button {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 5px;
  background: none; color: var(--ink-3); font-size: 10.5px; cursor: pointer;
}
.flip-filters button span { color: var(--ink-3); font-family: var(--mono); font-size: 9.5px; }
.flip-filters button:hover { color: var(--ink-2); background: var(--field); }
.flip-filters button[aria-pressed="true"] {
  color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft);
}
.flip-list, .flip-progress-list { display: flex; flex-direction: column; gap: 8px; }
.flip-progress-list { margin-bottom: 2px; }
.flip-card {
  padding: 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-2);
}
.flip-card.open { border-color: var(--line-strong); }
.flip-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.flip-item {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
  padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
}
.flip-ico {
  display: grid; place-items: center; flex: 0 0 28px;
  width: 28px; height: 28px; overflow: hidden;
  border-radius: 8px; background: var(--field);
  color: var(--ink-3); font-size: 11px;
}
.flip-ico img { width: 23px; height: 23px; object-fit: contain; }
.flip-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.flip-copy b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 12px; font-weight: 600;
}
.flip-copy span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-3); font-family: var(--mono); font-size: 9.5px;
}
.flip-tags { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.rl-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-3); font-family: var(--mono); font-size: 8.5px;
  letter-spacing: .04em; white-space: nowrap;
}
.rl-chip-dot { width: 5px; height: 5px; border-radius: 1px; background: var(--accent); }
.flip-state {
  flex: 0 0 auto; padding: 3px 6px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-3); font-family: var(--mono); font-size: 8.5px;
  letter-spacing: .07em; text-transform: none;
}
.flip-state.planned {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.flip-state.open {
  color: var(--up);
  border-color: color-mix(in srgb, var(--up) 35%, transparent);
  background: var(--up-soft);
}
.flip-state.closed {
  color: var(--down);
  border-color: color-mix(in srgb, var(--down) 35%, transparent);
  background: var(--down-soft);
}
.flip-state.cancelled { color: var(--ink-4); }
.flip-live {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px;
  margin-top: 5px; color: var(--ink-3); font-size: 9.5px;
}
.flip-live span { display: inline-flex; align-items: baseline; gap: 4px; }
.flip-live b {
  color: var(--ink); font-family: var(--mono);
  font-size: 10.5px; font-weight: 400;
}
.flip-live .sell b { color: var(--accent); }
.flip-age { color: var(--ink-3); font-family: var(--mono); font-size: 9px; }
.flip-age.stale { color: var(--down); }
.flip-bar { height: 3px; margin: 8px 0 7px; overflow: hidden; border-radius: 999px; background: var(--bg-2); }
.flip-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--line-strong), var(--accent)); }
.flip-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.flip-figures > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.flip-figures span { color: var(--ink-3); font-size: 9.5px; }
.flip-figures b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; font-weight: 400;
}
.flip-note {
  margin: 8px 0 0; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--ink-3); font-size: 10.5px; line-height: 1.45;
}
.flip-note.full { display: block; overflow: visible; -webkit-line-clamp: unset; }
.flip-acts { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.flip-acts .abtn, .flip-acts .ghost { height: 27px; padding: 0 8px; border-radius: 5px; font-size: 10px; }
.flip-buy { color: var(--up); }
.flip-sell { color: var(--accent); }
.flip-more { margin-left: auto; }
.flip-danger { color: var(--down); }
.flip-detail { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.flip-ledger-head {
  display: flex; justify-content: space-between; gap: 8px;
  color: var(--ink-3); font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .06em; text-transform: none;
}
.flip-ledger-none { margin: 5px 0 2px; color: var(--ink-3); font-size: 10.5px; }
.flip-fill { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.flip-fill:last-child { border-bottom: 0; }
.flip-fill-side {
  flex: 0 0 auto; width: 24px; padding: 2px 0; border-radius: 4px;
  font-family: var(--mono); font-size: 8px; letter-spacing: .04em; text-align: center;
  text-transform: none;
}
.flip-fill-side.buy { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.flip-fill-side.sell { color: var(--accent); background: var(--accent-soft); }
.flip-fill-qty {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2); font-family: var(--mono); font-size: 9.5px;
}
.flip-fill-note {
  flex: 1 0 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-left: 30px; color: var(--ink-3); font-size: 9.5px;
}
.flip-fill-at { flex: 0 0 auto; color: var(--ink-3); font-size: 9.5px; }
.flip-fill-x {
  flex: 0 0 auto; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 5px; background: none; color: var(--ink-3);
  cursor: pointer; font-size: 14px; line-height: 1;
}
.flip-fill-x:hover { color: var(--down); background: var(--field); }
.flip-fill-x[data-armed="1"] {
  width: auto; padding: 0 5px;
  color: var(--down); background: var(--field);
  font-family: var(--sans); font-size: 9px; letter-spacing: 0; white-space: nowrap;
}
.flip-detail-acts { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.flip-detail-acts .ghost { height: 27px; padding: 0 8px; border-radius: 5px; font-size: 10px; }
.flip-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 10px; text-align: center; }
.flip-empty b { color: var(--ink-2); font-size: 12.5px; }
.flip-empty p { max-width: 220px; color: var(--ink-4); font-size: 11px; line-height: 1.5; }
.flip-empty strong { color: var(--ink-2); font-weight: 500; }
.flip-empty-line { padding: 18px 4px; color: var(--ink-4); font-size: 11px; text-align: center; }
.flip-error { margin: 0 0 8px; color: var(--down); font-size: 11px; line-height: 1.4; }
.flip-signin { margin-top: 3px; }
/* A paid feature's one press: a crown and words rather than another "See Pro"
   line. The accent pill is the site's mark for Pro; it is used wherever a lock
   is the only control a reader has, without turning the panel into an advert. */
.pro-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; margin-top: 6px; padding: 0 14px 0 12px;
  border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  text-decoration: none;
  transition: background var(--t-quick), border-color var(--t-quick);
}
.pro-cta svg { flex: 0 0 auto; width: 17px; height: 17px; }
.pro-cta span { white-space: nowrap; }
.pro-cta:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.pro-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse), (max-width: 620px) {
  .pro-cta { min-height: 44px; }
}
.flip-empty .abtn { margin-top: 4px; }

/* The calculator's hand-off: the ticket is a draft, and this is the press that
   makes it a plan. Quiet, because it is not the calculator's answer. */
.calc-plan {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 32px; margin-top: 3px;
  border: 1px solid var(--accent-line); border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.calc-plan:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.calc-plan svg { flex: 0 0 auto; width: 13px; height: 13px; }

/* the plan and fill dialogs */
#flip-modal {
  position: fixed; inset: 0; z-index: 125;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
body:has(#flip-modal) {
  overflow: hidden;
  padding-right: var(--overlay-scrollbar, 0px);
}
.flip-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: none; }
.flip-dialog {
  position: relative; z-index: 1;
  width: min(430px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 18px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.flip-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.flip-dialog-head h3 { color: var(--ink); font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.flip-x {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-3); font-size: 20px; cursor: pointer;
}
.flip-x:hover { color: var(--ink); background: var(--field); }
.flip-form { display: flex; flex-direction: column; gap: 10px; }
.flip-item-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2);
}
.flip-item-row .flip-ico { width: 32px; height: 32px; flex-basis: 32px; }
.flip-item-row .flip-ico img { width: 26px; height: 26px; }
.flip-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flip-fields > .flip-field:first-child { grid-column: 1 / -1; }
.flip-field select {
  width: 100%; height: 36px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); color: var(--ink);
  font-family: var(--sans); font-size: 12px; outline: none;
}
.flip-field select:focus { border-color: var(--line-strong); }
.flip-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.flip-field > span {
  color: var(--ink-3); font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .07em; text-transform: none;
}
.flip-field input, .flip-field textarea {
  width: 100%; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); color: var(--ink);
  font-family: var(--sans); font-size: 12px; outline: none;
}
.flip-field input { height: 36px; }
.flip-field textarea { padding: 8px 9px; resize: vertical; line-height: 1.45; }
.flip-field input:focus, .flip-field textarea:focus { border-color: var(--line-strong); }
.flip-wide { grid-column: 1 / -1; }
.flip-projection {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px;
  background: var(--bg-2);
}
.flip-projection > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--ink-3); font-size: 10.5px; }
.flip-projection b { color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; font-weight: 400; }
.flip-projection .sum { padding-top: 5px; border-top: 1px solid var(--line-soft); }
.flip-tax-note { margin: 0; color: var(--ink-3); font-size: 10.5px; line-height: 1.4; }
.flip-form-error { min-height: 0; margin: 0; color: var(--down); font-size: 11px; line-height: 1.4; }
.flip-form-error:empty { display: none; }
.flip-foot { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding-top: 2px; }
.flip-foot .ghost, .flip-foot .abtn { height: 34px; padding: 0 13px; border-radius: 6px; font-size: 12px; }
.flip-save { border: 0; background: var(--accent); color: #17130d; font-weight: 600; }
.flip-save[disabled] { opacity: .45; cursor: default; }

@media (max-width: 620px) {
  .flip-field input { height: 40px; }
  .flip-field textarea { min-height: 70px; }
  .flip-foot .ghost, .flip-foot .abtn { height: 40px; }
  .flip-acts .abtn, .flip-acts .ghost { height: 34px; }
  .flip-filters button { height: 34px; }
  .flip-sort select { height: 34px; }
  .flip-fill-x { width: 34px; height: 34px; }
}

/* Flatter surfaces and calmer labels: the app is a terminal, not a card gallery. */
.ph-search, .ph-filter, .tb-page, .stat-pill, .tb-bell { border-radius: 8px; }
.search-mark, .tb-page-x, .rail-badge, .chip-badge, .filter-state,
.flip-state, .mkt-chart-move, .mkt-chart-name { border-radius: 5px; }
.press-rail { border-radius: 4px; }
.tb-bell-dot, .press-kicker::before { border-radius: 50%; }
.brand-mark { box-shadow: none; }
.stat-pill .spark, .tb-bell-dot, .press-kicker::before { box-shadow: none; }
.facets { box-shadow: none; }
.facet-label { font-family: var(--sans); font-size: 11.5px; letter-spacing: 0; }
.q-cell .k, .wf-row span, .eyebrow { font-family: var(--sans); font-size: 11px; letter-spacing: 0; }
.press-kicker, .press-ratio em, .press-ledger em, .calc-plate span { font-family: var(--sans); letter-spacing: 0; }
.press-kicker, .press-ratio em, .press-ledger em { font-size: 10px; }
.calc-plate span { font-size: 11px; }
.flip-field > span, .flip-sum-row span, .flip-sum-foot { font-family: var(--sans); font-size: 10px; letter-spacing: 0; }
.aonce, .flip-state { font-family: var(--sans); font-size: 9.5px; letter-spacing: 0; }
.flip-fill-side { font-family: var(--sans); font-size: 9px; letter-spacing: 0; }
.press-fill.buy { background: var(--up); }
.press-fill.sell { background: var(--down); }
.chips { border-radius: 6px; }
.chips button, .iv-btn, .abtn, .cmp-chip { border-radius: 6px; }
.bar-cell .bar, .fill-bar, .flip-bar { border-radius: 4px; }
.ranges { border-radius: 6px; }
.ranges button { border-radius: 5px; }
.ndot { border-radius: 50%; }
.nwrap.unread .ndot { box-shadow: none; }
.rail-marks .tb-bell-dot { box-shadow: none; }
.flip-bar span { background: var(--accent); }
@media (min-width: 1181px) {
  .shell.item-view .col-side {
    /* The item workspace stretches its grid children to the board's height.
       This group is the frame around the column's cards, so it stops at the
       last one rather than painting empty card down to the window's foot. */
    align-self: start;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    overflow-y: auto;
  }
  .shell.item-view .col-side > .card {
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .shell.item-view .col-side > .card + .card { border-top: 1px solid var(--line); }
}

/* ------------------------------------------------------- phone foundation --- */
/* A phone is a finger even when it is 844px wide, and iOS zooms a field under
   16px. The width rules still shape the page; this layer sizes the controls. */

@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  select, textarea { font-size: 16px !important; }
  .rail-tab { width: 44px; height: 44px; }
  .ph-back { width: 44px; height: 44px; }
  .rail-marks .tb-bell, .rail-marks .acct, .rail-marks #signin { width: 44px; height: 44px; }.star, #filters-show, .facets [data-seg="members"] button, .abtn, .sbtn, .btn, .ghost, .nd-x, .wdel, .arearm, .flip-filters button, .pane-switch button, .flip-acts .abtn, .flip-acts .ghost, .flip-fill-x, .ranges button, .iv-btn{ min-height: 44px; }
  .star, .nd-x, .wdel, .arearm, .flip-fill-x { min-width: 44px; }
  .board-body table.grid tbody tr { content-visibility: auto; contain-intrinsic-size: auto 82px; }
}

/* The movers and their summary are desk-side readings; a phone goes straight
   to the board. */
@media (max-width: 620px) {
  .shell[data-screen="market"]:not(.item-view) .mkt-hero,
  .shell[data-screen="market"]:not(.item-view) .movers-card { display: none; }
}

/* A phone on its side keeps the drawer, but the drawer also stops at the keys. */
@media (pointer: coarse) and (min-width: 621px) and (max-width: 860px) {
  /* The wordmark is the way home and the mover's name opens its item: both
     were drawn at a mouse's size on a phone held sideways. */
  .rail .brand-mark { width: 44px; height: 44px; }
  .mkt-chart-name { min-height: 44px; }
  .facets { bottom: var(--kb, 0px); }
  #filters-show { display: inline-flex; align-items: center; }
  /* The chart's key names are switches for their own lines. A desk's 15px
     caption was a 15px target here, and a landscape phone is still a thumb. */
  #alert-modal, #cond-modal, #auth-modal {
    align-items: flex-start;
    padding-bottom: calc(16px + var(--kb, 0px));
  }
  .amodal-box, .auth-card { max-height: calc(100dvh - 32px - var(--kb, 0px)); }
}

@media (max-width: 620px) {
  .set-head.mast { align-items: flex-start; }
  .upsell-row { align-items: flex-start; }
  .upsell-row .scard-foot .sbtn { white-space: nowrap; }
  .scard.danger-fold > summary { padding: 14px; }
  .danger-body { padding: 14px; }
}

@media (max-width: 620px) and (max-height: 500px) {
  .chart { height: 150px; }
  .page-head { height: 52px; }
}

@media (max-width: 560px) {
  .btn, .btn-small { min-height: 44px; }
}

/* The View picker on a phone is a pane in the sheet, not a card over it. The
   sheet is already the surface the reader is in, so the picker takes its own
   glass: one line saying where it is, one row per view, and the rows at the
   size a finger is given everywhere else on the page. The card it was - a
   second floating surface at the same depth as the sheet - could be dragged
   with the sheet, scrolled over another scroller, and handed a 30px row and a
   22px ✎ to a thumb. */
@media (max-width: 620px) {
  .listmenu.docked {
    position: absolute;
    inset: 0;
    z-index: 3;
    min-width: 0;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--card);
    box-shadow: none;
    overflow: hidden;
  }
  .lm-dock-head {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-bottom: 1px solid var(--line);
  }
  .lm-back {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ink-2);
    font-size: 20px;
    line-height: 1;
  }
  .lm-back:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent-line); }
  .lm-back:active { background: var(--field); }
  .lm-dock-title {
    font-family: var(--sans);
    font-size: 12px; font-weight: 600; letter-spacing: -.005em;
    color: var(--ink-3);
  }
  .lm-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  /* The rows are the press, so they are a thumb's height, and the glyph beside
     the pick is the same - not a 22px box sharing the row's edge. */
  .listmenu.docked .lm-pick {
    min-height: 44px;
    padding: 10px 11px;
    border-radius: 6px;
    font-size: 14px;
  }
  .listmenu.docked .lm-new { min-height: 44px; font-size: 13.5px; }
  .listmenu.docked .lm-tool { width: 44px; height: 44px; font-size: 16px; }
  .listmenu.docked .lm-input { min-height: 44px; font-size: 16px; }
  .listmenu.docked .lm-group { margin-top: 10px; }
  .listmenu.docked .lm-all { margin-bottom: 6px; }
  .listmenu.docked .lm-note { margin: 6px 4px 2px; }
}

/* The market's phone sheet is the filters card: it leaves the column, sits on
   the bar and stops at the keyboard, exactly like the pane drawer. */
@media (max-width: 620px) {
  /* Filters are a sheet, not a band above the board. The page-head funnel is
     their only door while the sheet is shut. */
  .shell[data-screen="market"] .filters-card { display: none; }
  .shell[data-screen="market"] .filters-card.open {
    position: fixed; left: 0; right: 0; top: auto;
    bottom: max(calc(56px + env(safe-area-inset-bottom, 0px)), var(--kb, 0px));
    width: auto; max-height: calc(100dvh - 76px - max(calc(56px + env(safe-area-inset-bottom, 0px)), var(--kb, 0px))); z-index: 70;
    display: flex; flex-direction: column;
    padding: 0; overflow: hidden;
    border: 1px solid var(--line); border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: var(--card);
    box-shadow: 0 -24px 60px -34px #000;
  }
  .filters-card.open .facets-body {
    display: flex; flex-direction: column;
    min-height: 0; overflow: auto;
    padding-bottom: 14px;
  }
  .filters-card.open .facets-head { flex: 0 0 auto; }
  .filters-card.open .filters-show,
  .filters-card.open .filters-reset { display: none; }
  .filters-card.open .filters-foot {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    background: var(--card);
  }
  .filters-card.open .filters-foot .sbtn { margin-left: auto; min-height: 44px; }
  .filters-card.open .filters-foot .ghost { min-height: 44px; }
  #filters-open { display: inline-flex; }
  #filters-show { display: none; }
  #facets.filters-open { visibility: hidden; }
}

@media (pointer: coarse) and (min-width: 621px) and (max-width: 860px) {
  /* A finger's width still has no page-head bell; the Alerts pane carries the
     record's door there too, so the bell does not reappear at 621px. */
  .ph-actions .tb-bell { display: none; }
  .alerts-notif { display: grid; width: 44px; }
  /* This width opens the record from the Alerts pane, not the page head, so the
     drawer stays in the rail's corner with the rest of the finger's layout. */
  .notif-drawer {
    left: 88px; right: auto; top: auto; bottom: 88px;
  }
  .filters-card.open {
    position: fixed; left: 64px; top: 0;
    bottom: var(--kb, 0px); width: min(320px, calc(100vw - 64px));
    z-index: 70; display: flex; flex-direction: column;
    padding: 0; overflow: hidden;
    border: 0; border-right: 1px solid var(--line); border-radius: 0;
    background: var(--card);
  }
  .filters-card.open .facets-body {
    display: flex; flex-direction: column; min-height: 0; overflow: auto;
    padding-bottom: calc(22px + var(--kb, 0px));
  }
  #facets.filters-open { visibility: hidden; }
  .board-body thead th .sort, .pager .pg { min-height: 44px; }
}

@media (pointer: fine) and (min-width: 621px) and (max-width: 860px) {
  .filters-card.open .filter-input input { font-size: 12.5px; }
}

@media (max-width: 620px), (pointer: coarse) {
  .filters-card [data-seg="members"] button,
  .chips[data-seg="members"] button { min-height: 44px; }
  .filters-card.open .filter-input input { height: 36px; }
}

@media (pointer: fine) and (min-width: 621px) and (max-width: 860px) {
  .rail-tab { height: 48px; }
}

/* Phone rail: seven labelled destinations, no utility icons. The bell is in
   the page head and account is the You tab. */
@media (max-width: 620px) {
  .rail {
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    justify-content: center;
  }
  .rail-switch {
    flex: 1 1 auto; width: 100%; gap: 0;
    justify-content: stretch; align-items: stretch;
  }
  .rail-tab {
    flex: 1 1 0; width: auto; min-width: 44px; height: 55px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; padding: 4px 0 2px;
  }
  .rail-tab svg { width: 20px; height: 20px; }
  .rail-lbl { display: block; font-size: 10px; line-height: 1; letter-spacing: 0; }
  .rail-you { display: flex; }
  /* The Tools mark is one of the seven, so its wrapper takes the same share of
     the bar; the menu is a sheet above the bar rather than a card off the side
     of a tab that is only 55px wide. */
  .rail-tools { flex: 1 1 0; width: auto; }
  .rail-tools > summary { width: 100%; }
  .rail-menu {
    position: fixed; left: 8px; right: 8px; top: auto;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    width: auto; max-height: min(70dvh, 420px);
  }
  .rail-menu-item { justify-content: center; min-height: 44px; }
  .rail-marks { display: none; }
  .alerts-notif { display: grid; width: 44px; }
  .rail-foot { margin: 0; width: 0; min-width: 0; }
  .ph-actions .tb-bell { display: none; }
  .ph-search { flex: 1 1 auto; width: auto; min-width: 0; }
  .notif-drawer {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 140px);
  }
  .main {
    /* The bar is 56; the 68 it was padded by left 12px of empty glass above it
       on every phone screen. The top inset is the notch in a standalone app. */
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .facets { top: 76px; bottom: 56px; }
  .facets {
    bottom: max(calc(56px + env(safe-area-inset-bottom, 0px)), var(--kb, 0px));
  }
  .facets .facets-body { padding-bottom: calc(22px + var(--kb, 0px)); }
  .scrim { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .filters-card.open {
    bottom: max(calc(56px + env(safe-area-inset-bottom, 0px)), var(--kb, 0px));
  }
}

/* On a phone the rail switches the page rather than floating a drawer over it:
   the selected pane owns the glass below the head, the board goes, the bar
   stays, and there is no scrim. */
@media (max-width: 620px) {
  .shell.rail-inline .workspace { display: none; }
  .facets.inline {
    top: calc(60px + env(safe-area-inset-top, 0px));
    bottom: max(calc(56px + env(safe-area-inset-bottom, 0px)), var(--kb, 0px));
    left: 0; right: 0;
    width: auto;
    display: flex;
    visibility: visible;
    transform: none;
    transition: none;
    z-index: 60;
    background: var(--bg);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .facets.inline .rail-body { height: 100%; }
  .facets.inline .rail-pane { flex: 1 1 auto; min-height: 0; }
  /* One head row on every pane. The controls in it are 30px on the flips and
     44px on the watchlists and the alerts, and the row grew around them, so it
     ended at 58 on one pane and 69 on the others and each pane's first card sat
     at a different height. The row is a fixed 60 - the page head's own height,
     directly above it - and whatever the pane puts in it is centred. */
  .facets.inline .facets-head { height: 60px; padding: 0 14px; }
  .facets.inline .facets-body {
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
  }
  /* The open-item strip makes the head taller; the pane starts below it, not
     under it. 106 is that head measured: 6 + 44 field + 4 row gap + 46 pill + 6. */
  .shell:has(.page-head .tb-pages:not([hidden])) .facets.inline {
    top: calc(106px + env(safe-area-inset-top, 0px));
  }
}
@media (max-width: 620px) and (max-height: 500px) {
  .facets.inline { top: calc(52px + env(safe-area-inset-top, 0px)); }
  .facets.inline .facets-head { height: 52px; min-height: 52px; }
  /* On its side the head has no second row to give: the search and the open
     items share the line a desk gives them, so 54px of glass stay with the
     page. The pane starts at that one line, not at the portrait strip. */
  .page-head:has(.tb-pages:not([hidden])) {
    height: 52px; min-height: 52px; flex-wrap: nowrap;
    padding-top: 0; padding-bottom: 0; row-gap: 0;
  }
  /* The field keeps a field's width and the strip takes what is left: with both
     growing from their content the eight pills left the field 6px of input. */
  .page-head:has(.tb-pages:not([hidden])) .tb-pages { order: 1; flex: 1 1 0; }
  .page-head:has(.tb-pages:not([hidden])) .ph-actions {
    flex: 0 1 42%; min-width: 120px;
  }
  .shell:has(.page-head .tb-pages:not([hidden])) .facets.inline {
    top: calc(52px + env(safe-area-inset-top, 0px));
  }
}

/* Rail controls: the page's chrome, not the platform's. Text fields, search
   fields, number fields and textareas keep one drawn box; the browser's own
   cancel button, steppers and resize grip are not part of that box. */
input[type="text"], input[type="search"], input[type="number"],
input[type="email"], input[type="password"], input[type="url"],
textarea, select {
  -webkit-appearance: none;
  appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
select::-ms-expand { display: none; }

@media (max-width: 620px) {
  textarea { resize: none; }
  /* The watchlists pane asks with its own picker card - on a phone a pane in
     this one - rather than the platform's select sheet, so a thumb and a mouse
     read the same list of lists. */
  #watchlist-pick {
    display: inline-flex !important;
    min-width: 0;
    max-width: 58%;
  }
  #watchlist-pick-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .listmenu { max-width: calc(100vw - 24px); }
}

/* ------------------------------------------------------- phone: one surface --- */
/* An audit of every mobile page found four systems where there should be one:
   settings cards at a desk's 10px radius and 18px padding while market and item
   cards sat at 15 and 14, a 24px account title against the 18px record and item
   titles, the record's card and rows at 10px/20px, and controls whose corners
   were 5, 6, 8 and 10px for the same kind of press. The phone is one surface, so
   the same roles take the same numbers here. */
@media (max-width: 620px) {
  /* Cards: the app's 15px card, at the app's 14px padding. Settings' own
     "My Account" masthead takes the record's 18px title rather than 24. */
  .scard { padding: 14px; border-radius: 15px; }
  .scard.danger-fold { padding: 0; }
  .settings, .setgrid { gap: 12px; }
  .set-head.mast { padding: 4px 0; }
  .set-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
  .scard h2, .scard h3, .section-head h2 { font-size: 13px; letter-spacing: -.01em; }
  .hist { border-radius: 15px; }
  /* The record is a card of rows like every other card of rows. */
  .hist-head { padding: 14px; }
  .hist-list .nrow { padding: 10px 14px; }
  .hist-none { padding: 32px 14px 14px; }
  .nday { padding: 14px 14px 6px; }
  /* Dialogs are centred cards on a phone; the filters are the one bottom sheet.
     The shared dialog edges live with the rest of the phone pattern in
     panels.css. */
  /* The filter sheet's head is the same 60 as the pane heads it opens from. */
  .filters-card.open .facets-head { min-height: 60px; }
}

@media (pointer: coarse), (max-width: 620px) {
  /* A bordered press is 6px, whatever its role: ghost, account, pane, field
     select and stepper all sat between 8 and 10. Pills stay pills. */
  .ghost { border-radius: 6px; font-size: 12px; }
  .numbox button { border-radius: 6px; }
  .filter-input input, .filters-card .filter-input input,
  .filters-card.open .filter-input input { border-radius: 6px; }
  .num.wide, .saveonly, #watchlist-pick { border-radius: 6px; }
  /* The board's last button was 42 and a 10px corner; it is the same 44x6 as
     the other full-width actions. */
  #load-more { height: 44px; border-radius: 6px; }
  /* The alerts pane's record door was a 30px box beside a 44px plus. */
  .alerts-notif { width: 44px; height: 44px; border-radius: 6px; }
  /* The flip sheet's close was the last 30px door in a 44px dialog world. */
  #flip-modal .flip-x { width: 44px; height: 44px; border-radius: 6px; }
}

/* ------------------------------------------------------------ phone targets --- */
/* The layer above sizes the rail, the page's buttons and a field's font. This
   one finishes the controls a walk of every screen at 390 and 320 found short of
   a thumb's 44: the page-head search, the open-item pills, the watchlists head,
   the filter sheet's summaries and ranges, the alerts switch, and the record's
   empty-state link. 44 is the floor; it is the same floor the newer panes use,
   so the page stops having two. */
@media (pointer: coarse), (max-width: 620px) {
  /* A field is a row, not a line: the alert editor's fields were the page's
     smallest tap. `height` may be set per surface; the floor still holds. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="color"]),
  select { min-height: 44px; }
  /* The page-head search: the mark is the press, so it is a 44 box, and the
     field follows it instead of sitting in a 38px pill. */
  .ph-search { height: 44px; }
  .search-mark { width: 44px; height: 44px; }
  /* Open-item pills: the name and its close are two presses in one pill, so
     both are the pill's height and the ✕ is a box, not a 24px glyph. */
  .tb-page {
    min-height: 44px;
    /* The pill is its 44px press and a border, not those plus the desk's 3px
       of slack: at 52 the strip cost the head six pixels it never used. */
    padding: 0 2px 0 4px;
  }
  .tb-page-open { min-height: 44px; padding: 0 8px; }
  .tb-page-x { width: 44px; height: 44px; }
  /* The watchlists pane asks which list on this line; on a phone it is the
     pane's only door, so the line is a row. */
  #watchlist-pick { min-height: 44px; padding: 0 6px; border-radius: 6px; }
  /* The filter sheet: a 30px summary and a 36px range were a desk's rows. */
  .filter-block summary { height: 44px; }
  .filter-chip { min-height: 44px; }
  .filter-active-clear { min-height: 44px; }
  .saveonly { height: 44px; }
  .scope-x { width: 44px; height: 44px; }
  .filter-input input,
  .filters-card .filter-input input,
  .filters-card.open .filter-input input { height: 44px; }
  .filter-input > span { font-size: 12px; }
  /* The alerts pane's lines/log switch. */
  #facets-head-alerts [data-alerts-view] { min-height: 44px; }
  /* The settings switch is a 22px box by design; the row that names it is what
     a thumb presses, so the row is a row. */
  .acfg-power { display: flex; align-items: center; gap: 8px; min-height: 44px; }
  /* A market row is the item's door; its name link was 16px tall inside the row
     that is already the right height. */
  .board-body table.grid tbody a.nm { display: inline-flex; align-items: center; min-height: 44px; }
  /* The record's empty state ends in this link, one line tall. */
  .hist .link { min-height: 44px; }
  /* The auth card's two sentences are the only things on it that were not a
     field or a button; both are the way to another screen. */
  .auth-card .link, .auth-card a { display: inline-flex; align-items: center; min-height: 44px; }
  /* The flips dialog is the shared centred card on a phone; its controls were
     the last 34s and 40s in the app. */
  #flip-modal .flip-field input { height: 44px; }
  #flip-modal .flip-foot .ghost, #flip-modal .flip-foot .abtn { height: 44px; }
  #flip-modal .flip-acts .abtn, #flip-modal .flip-acts .ghost { height: 44px; }
  #flip-modal .flip-filters button { height: 44px; }
  #flip-modal .flip-fill-x { width: 44px; height: 44px; }
}

/* The row menu is the picker's second level on a phone: docked in the same pane,
   with the same 44px rows as the list it came from. Floating over the pane it
   was the one surface left at 32, and the ✎ it hides behind is the rename. */
@media (pointer: coarse), (max-width: 620px) {
  .listmenu.docked.ctx { min-width: 0; }
  .listmenu.docked .ctx-head { padding: 10px 8px; }
  .listmenu.docked .ctx-item { min-height: 44px; padding: 10px 8px; font-size: 14px; }
  /* A menu that still floats (the star's card) is a thumb's too. */
  .listmenu.ctx .ctx-item { min-height: 44px; padding: 10px 8px; }
  .listmenu.ctx .lm-input { min-height: 44px; font-size: 16px; }
}

/* ---------------------------------------------- every popup, phone-checked --- */
/* The surfaces that open over the board were swept one by one. What they were
   missing was the floor the panes already keep: a 44px row, a 16px field (the
   size iOS does not zoom the page for), and the home bar's inset under the last
   row. Sizes only - no surface changes place here. */
@media (pointer: coarse), (max-width: 620px) {
  /* The star's picker is the one card that still floats (a star over a board has
     no pane to dock in), and it kept the desk's 30px row and 22px pencil. */
  .listmenu .lm-pick { min-height: 44px; }
  .listmenu .lm-new { min-height: 44px; font-size: 13.5px; }
  .listmenu .lm-tool { width: 44px; height: 44px; font-size: 16px; }
  .listmenu .lm-input { min-height: 44px; font-size: 16px; }

  /* A suggestion is a row a thumb picks, not a line a pointer hovers. */
  .sug { min-height: 44px; padding: 10px 8px; }

  /* Compare's field and its answers: a 32px field at 11.5px zoomed the whole
     page the moment the keyboard came up. */
  /* A landscape phone has the header low on the glass and a keyboard that can
     take half of it: the card is capped to what is left and scrolls rather
     than hanging off the foot (the placer still lifts it above the button). */
  .cmp-pop { max-height: calc(100dvh - 24px - var(--kb, 0px)); overflow-y: auto; }
  .cmp-pop input { height: 44px; font-size: 16px; }
  .cmp-hit { min-height: 44px; padding: 10px 8px; }

  /* Layers: on a phone the readings are a card of switches, so each is a row. */
  .read-key { min-height: 44px; padding: 0 12px; font-size: 12px; }

  /* The closes and menu rows over the chart keep the phone's thumb floor. */
  .shell #studies .studies-x,
  .items-menu .items-x { width: 44px; height: 44px; }
  .shell .chart-menu .menu-item { height: 44px; }
  #pitch-modal .pitch-x { width: 44px; height: 44px; }

  /* The bell's drawer: one firing per row, and the foot clears the home bar. */
  #notif-drawer .nrow { min-height: 44px; }
  #notif-drawer { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }

  /* The notes pad: a textarea under 16px zooms the page as it is tapped. */
  .note-pad { font-size: 16px; }
}

/* --------------------------------------------------- the phone's item page --- */
/* At 390 the page was 728px in a 664px window before the reader touched it: a
   284px plot with no line in it, five actions wrapped 4+1 (3+2 at 320), and a
   card header repeating the name the open-item pill already carried. The chart
   keeps its height when it has history; these rules take back the height that
   was holding nothing. */
@media (max-width: 620px) {
  /* No history is one sentence, not a plot's worth of glass. */
  .chart-wrap.chart-empty .chart { height: 104px; min-height: 104px; }

  /* One row of equal cells: the five actions weigh the same, and the wrap left
     Details alone under the other four. */
  .iv-acts {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
  }
  .iv-acts .iv-btn {
    width: 100%; min-width: 0; padding: 0 4px;
    justify-content: center; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* The glyphs sat before the words, so the words themselves were off-centre in
     their equal cells. They are decorative; the label is the control. */
  .iv-acts .iv-btn svg, .iv-acts .iv-slot { display: none; }
  /* The copy word is the one stateful label in this row: it changes to Copied
     or Failed for the same beat the desk's tick is up. */
  .iv-acts .iv-btn.copy { font-variant-numeric: tabular-nums; }

  /* The item keeps its name in the card even though the open-item pill above
     repeats it: the pill is a browser tab, and the page it names still needs a
     heading of its own. The name and its icon line up with the actions. */
  .iv-top { align-items: center; }

  /* The two-by-two strip stays; it was the voice inside the cells that was
     uneven. One label height, one figure size and baseline, and one gap
     between a figure and its percent - across all four cells. */
  .iv-head-stats .q-cell .k {
    font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; line-height: 1.3;
  }
  .iv-head-stats .q-cell .v {
    margin-top: 3px; gap: 4px; line-height: 1.25;
  }
  .iv-head-stats .q-cell .q-pct { line-height: 1.25; }

  /* The cells hug the strip: nothing extra above the first row, nothing extra
     below the second - the card's own inset is the only space at the two ends.
     The two rows meet the middle rule with 12px each, so a figure is never
     pinned to the line above the next label, and each column's 12px sits on the
     side facing the vertical rule, never on the outside edge. */
  .iv-head-stats .q-cell:nth-child(1) {
    padding: 0 12px 12px 0; border: 0;
  }
  .iv-head-stats .q-cell:nth-child(2) {
    padding: 0 0 12px 12px; border: 0; border-left: 1px solid var(--line);
  }
  .iv-head-stats .q-cell:nth-child(3) {
    padding: 12px 12px 0 0; border: 0; border-top: 1px solid var(--line);
  }
  .iv-head-stats .q-cell:nth-child(4) {
    padding: 12px 0 0 12px;
    border: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  }
  .ranges button { flex: 1 1 0; min-width: 0; padding: 0 2px; }
}

/* A 320 cell is 49px: the five words fit, but only at a smaller size. */
@media (max-width: 360px) {
  .iv-acts .iv-btn { padding: 0 2px; font-size: 10px; }
}

/* ------------------------------------------- every screen, phone-checked --- */
/* A walk of every screen a phone can reach - the board, its three rail panes,
   the item page, My Account, the record and the plans page - found the last
   rows still drawn at a desk's height. The popup layer above sizes the surfaces
   that open over a screen; this one finishes the panes that ARE the screen. */
@media (pointer: coarse), (max-width: 620px) {
  /* Watchlists: the head's sort words were a 15px line and each saved item was
     a 38px row, so the pane's two jobs - reorder, open - were the smallest
     presses on the page. The words are a 44 row and the item is a row too, at
     the size a name is read at rather than a caption's. */
  .wl-add { min-width: 44px; }
  .whead { padding-top: 0; padding-bottom: 0; }
  .wsort { min-height: 44px; font-size: 11px; }
  .wrow { min-height: 44px; padding: 8px; }
  .wchg { font-size: 11.5px; }

  /* Flips: the card's title is the way into the item, and it was a 32px line
     inside a card that is otherwise a thumb's. */
  .flip-item { min-height: 44px; }

  /* The alerts pane's new-line door is a + beside its head, like the lists'. */
  .al-add { min-width: 44px; }

  /* The page-head search's mark is a box, and the field beside it is what has
     to give when the head is narrow; it was shrinking to 36 at 320. */
  .search-mark { flex: 0 0 44px; }

  /* The item column's own controls: the fold chevron on each card was 24, the
     calculator's hand-off was a 32px bar, and a suggestion chip away from the
     calculator's label line was a 17px line. The column is a thumb's scroll
     like every pane, so these take the floor the panes keep; the head holds its
     title to one cut line so the wider chevron cannot push it out of the card.
     The calculator's own chips are the exception (see `.calc-field
     .suggest-chip` above): they share a label's line rather than occupy a row. */
  .card-min { width: 44px; height: 44px; }
  .card-head { min-width: 0; }
  .card-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calc-plan { height: 44px; }
  .numbox button { width: 44px; height: 44px; }
  .suggest-chip { min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 11px; }
  .fs-open { min-width: 44px; }

  /* A pane's title names the screen beside the search. It was the flex item
     that gave on a 320 head, so "Watchlists" was clipped under the search
     pill; the title holds its width and the field takes what is left. */
  .page-head.ph-pane .ph-copy { flex: 0 0 auto; }
  .ph-copy h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* A status chip is a press before it is a word. */
  .flip-filters button { min-width: 44px; }

  /* My Account's delivery rows: the note under Browser is a sentence, and on a
     phone it was ellipsised to its first six words - the only place the page
     says whether notifications will work. It wraps there instead. */
  .acfg-row { min-height: 44px; }
  .acfg-state {
    white-space: normal; overflow: visible; text-overflow: clip;
    line-height: 1.4;
  }
}

/* The account page uses the same phone type and control sizes as the rest of
   the app; only the field geometry is shared here. The delivery rows use a
   compact 60px name track so no channel wraps its state beside its action, and
   the fields span the card's content width instead of inheriting the dot
   indent. */
@media (max-width: 620px) {
  .settings.account .passform input,
  .settings.account .acfg-row input.num {
    padding: 0 11px;
    border-radius: 6px;
  }
  .settings.account .acfg-row:not(.acfg-field) {
    grid-template-columns: 8px 60px minmax(0, 1fr) auto;
  }
}

/* --------------------------------------------------- phone: one head shape --- */
/* A phone's head is the search bar, on every screen. The market has always drawn
   it that way; a pane also put its name beside the field, so the same row had
   two shapes - and at 320 the title took the width the search needed. The h1 is
   not removed: it is the page's heading, the focus target after a screen change
   and the base of `document.title`, and it stays readable to a screen reader.
   It is only not drawn. */
@media (max-width: 620px) {
  .page-head .ph-copy,
  .page-head.ph-pane .ph-copy {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; display: block;
  }
}

/* ---------------------------------------------------------- press feedback --- */
/* One answer for every control, whatever its surface: a native button, an
   anchor wearing a button's class, or a disclosure row. A press darkens and
   sinks it; a pointer brightens it; disabled controls dim and stop. The class
   rules above still carry each control's own colour, so this layer adds the
   response rather than replacing it. */
:is(button, a.btn, a.sbtn, a.ghost, a.abtn, a.iv-btn, a.nd-all, a.pbtn, [role="button"], summary):not(:disabled):not([aria-disabled="true"]):active {
  filter: brightness(.9);
  transform: translateY(1px);
}

@media (hover: hover) and (pointer: fine) {
  :is(button, a.btn, a.sbtn, a.ghost, a.abtn, a.iv-btn, a.nd-all, a.pbtn, [role="button"], summary):not(:disabled):not([aria-disabled="true"]):hover {
    filter: brightness(1.08);
  }
}

/* A control with nowhere to go still has to look like it. Existing class
   disabled rules keep their own opacity; this is the fallback. */
button:disabled { opacity: .55; cursor: default; }

/* ----------------------------------------------------------- chart card --- */
/* The chart is an instrument inside a frame, not a plot floating on the page.
   The key holds the top centre, the time-scale rail and tools sit beneath it,
   and the price field is the hero. */
.chart-wrap {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.chart-top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  padding: 0;
  border: 0;
  min-width: 0;
}

/* The range is a scale, not a pill: seven words over one baseline, with the
   active window marked by the accent and a dot that moves along the rail. */
.ranges {
  position: relative;
  display: flex; align-items: flex-end; gap: 0;
  grid-column: 1; justify-self: start;
  min-width: 0; padding: 0 2px 8px;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}
.ranges::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px;
  height: 1px; background: var(--line); pointer-events: none;
}
.ranges button {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; flex: 0 0 auto;
  height: 28px; min-width: 38px; padding: 0 8px;
  border: 0; border-radius: 4px; background: none;
  color: var(--ink-3); font: 10.5px var(--mono); cursor: pointer;
  transition: color var(--t-quick);
}
.ranges button:hover { color: var(--ink); background: none; }
.ranges button::after {
  content: ""; position: absolute; left: 50%; bottom: -6px;
  width: 1px; height: 6px; background: var(--line-strong);
  transform: translateX(-.5px); pointer-events: none;
}
.ranges button.on {
  color: var(--accent); background: none; box-shadow: none;
}
.ranges button.on::after {
  width: 6px; height: 6px; bottom: -8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
  transform: translateX(-50%);
}
.ranges button[data-range="live"] { display: inline-flex; align-items: center; justify-content: center; }
.ranges .live-dot { width: 5px; height: 5px; opacity: .45; background: currentColor; }
.ranges button.on .live-dot { opacity: 1; background: currentColor; }

/* The actions group anchors the right edge: the tools, Compare beside the
   drawing tools, the quote's own clock, and the overflow menu for the rest. */
.chart-actions {
  grid-column: 3; justify-self: end;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.ct-tools {
  position: static; display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; flex: 0 0 auto; min-width: 0;
}
.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--field); color: var(--ink-2);
  font: 11.5px var(--sans); white-space: nowrap; cursor: pointer;
  transition: color var(--t-quick), background var(--t-quick), border-color var(--t-quick);
}
.tool-btn:hover, .tool-btn:focus-visible {
  background: var(--field-2); border-color: var(--line-strong); color: var(--ink); outline: 0;
}
.tool-btn[aria-expanded="true"] {
  background: var(--field-2); border-color: var(--line-strong); color: var(--ink);
}
#ovs-open[aria-expanded="true"],
#chart-more[aria-expanded="true"],
#cmp-open[aria-expanded="true"],
#draw-open[aria-expanded="true"],
#draw-open.on {
  color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line);
}
.tool-btn:disabled { opacity: .45; cursor: default; }
.tool-btn svg { flex: 0 0 auto; }
.ovs-open, .chart-more, .chart-draw, .chart-cmp { width: 32px; padding: 0; }
/* Compare is the chart's Pro tool: only a plan without it wears the crown. */
.chart-cmp { position: relative; }

/* A drawing tool on a plan without drawings keeps its mark and wears a small
   crown: the press opens the pitch, not a disabled control. */
.chart-draw.pro-locked {
  position: relative; color: var(--accent);
  background: var(--accent-soft); border-color: var(--accent-line);
}
.chart-draw.pro-locked:hover, .chart-draw.pro-locked:focus-visible {
  color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.tool-crown {
  position: absolute; top: -4px; right: -4px;
  display: grid; place-items: center; width: 14px; height: 14px;
  border: 1px solid var(--accent-line); border-radius: 50%;
  background: var(--card); color: var(--accent);
}
.tool-crown svg { width: 9px; height: 9px; }

/* A drawing tool turns the plot's pointer into a crosshair and keeps a finger's
   drag on the plot instead of letting it pan the page. */
.chart.drawing .chart-hit { cursor: crosshair; touch-action: none; }
.chart-drawing { pointer-events: none; }
.dw-label { font-family: var(--mono); font-size: 10px; letter-spacing: .02em; }

.menu-item[aria-checked="true"] { color: var(--accent); }
.menu-item[aria-checked="true"] svg { color: var(--accent); }
.menu-item .mi-check { margin-left: auto; opacity: 0; color: var(--accent); font-size: 11px; }
.menu-item[aria-checked="true"] .mi-check { opacity: 1; }
.menu-item:disabled { opacity: .45; cursor: default; }

.chart-menu {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 35;
  width: 210px; padding: 5px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--card-2); box-shadow: 0 22px 50px -24px #000;
}
.chart-menu[hidden] { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  height: 38px; padding: 0 10px;
  border: 0; border-radius: 6px; background: none;
  color: var(--ink-2); font: 12px var(--sans); text-align: left; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--field); color: var(--ink); outline: 0; }
.menu-item svg { flex: 0 0 15px; color: var(--ink-3); }
.menu-item[aria-pressed="true"] { color: var(--accent); }
.menu-item[aria-pressed="true"] svg { color: var(--accent); }

/* The key sits between the range rail and the actions, at the card's centre. */
.chart-legend-row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap; min-height: 18px;
  grid-column: 2; justify-self: center;
  max-width: 100%;
  margin: 0; padding: 0;
}
.chart-legend-row[hidden] { display: none; }
.chart-key { display: flex; align-items: center; gap: 12px; }
.chart-key[hidden] { display: none; }
.ck {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-3); font-size: 10.5px; white-space: nowrap;
}
.ck[hidden] { display: none; }
.ck-line { width: 14px; height: 2px; border-radius: 2px; display: inline-block; flex: 0 0 auto; }
.ck-line.buy { background: var(--up); }
.ck-line.sell { background: var(--down); }
.ck-line.mid { background: var(--accent); }
/* The margin style's key is a band, not a line: the two quote edges with the
   gap between them, at the size of the key that names it. */
.ck-line.band {
  height: 9px; border-radius: 2px;
  background: var(--accent-soft);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}

.cmp-legend {
  position: static; display: flex; align-items: center; justify-content: flex-start;
  gap: 12px; flex-wrap: wrap; max-width: none; margin: 0; padding: 0;
  pointer-events: auto;
}
.cmp-legend[hidden] { display: none; }
.cmp-legend .cmp-chip {
  pointer-events: auto; height: auto; padding: 0; gap: 6px;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--ink-2); font-size: 10.5px;
}
.cmp-legend .cmp-chip.this { border: 0; background: none; box-shadow: none; color: var(--ink-3); }
.cmp-legend .cmp-dot { width: 14px; height: 2px; border-radius: 2px; }
.cmp-x { margin-left: 2px; color: var(--ink-4); font-size: 12px; line-height: 1; }
button.cmp-chip:hover .cmp-x { color: var(--ink); }

/* The quote's age is a quiet text stamp at the right edge, not a countdown. */
.refresh-clock {
  display: inline-flex; align-items: baseline; gap: 5px;
  height: auto; padding: 0; border: 0; border-radius: 0; background: none;
  color: var(--ink-3); flex: 0 0 auto;
}
.rclock-copy {
  display: flex; align-items: baseline; gap: 4px; min-width: 0;
  white-space: nowrap; line-height: 1;
}
.rclock-k {
  color: var(--ink-4); font: 9px var(--mono); font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
}
.rclock-v {
  color: var(--ink-3); font-family: var(--mono); font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

/* Chart settings is a popover in the frame, not a dialog. */
#studies {
  position: absolute; inset: 8px 8px auto auto; z-index: 40;
  display: none; width: min(320px, calc(100% - 16px));
  max-height: calc(100% - 16px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--card-2); box-shadow: 0 26px 70px -30px #000;
  text-align: left; overflow: hidden;
}
.chart-wrap.studies #studies { display: flex; flex-direction: column; }
#overlays { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px; }
.studies-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 6px; padding: 0 0 12px; border-bottom: 1px solid var(--line);
}
.studies-title { color: var(--ink); font-size: 12.5px; font-weight: 600; }
.studies-x {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--ink-4); font-size: 20px; line-height: 1; cursor: pointer;
}
.studies-x:hover, .studies-x:focus-visible { background: var(--field); color: var(--ink); outline: 0; }

.fs-open .fs-in { display: none; }
.fs-open[aria-pressed="true"] .fs-out { display: none; }
.fs-open[aria-pressed="true"] .fs-in { display: block; }
.chart-wrap.full { padding: 12px; background: var(--card); }

@media (max-width: 1300px) {
  .chart-top {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 4px;
  }
  .ranges { order: 1; flex: 1 1 100%; width: 100%; }
  .chart-legend-row { order: 2; flex: 1 1 100%; max-width: 100%; }
  .chart-actions { order: 3; flex: 1 1 100%; justify-content: flex-end; margin-left: auto; }
}
@media (max-width: 620px) {
  .chart-wrap { padding: 10px; border-radius: 15px; }
  .chart-top { margin: 0 0 8px; }
  .ranges { padding-bottom: 8px; }
  .ranges button { flex: 1 1 0; min-width: 0; padding: 0 1px; }
  .chart-legend-row { gap: 10px; max-width: 100%; }
  #studies { inset: 7px 7px auto auto; width: calc(100% - 14px); max-height: calc(100% - 14px); }
  #overlays { padding: 14px; }
  /* A 320px card leaves 280px for the switches; "Volume profile" was one
     clipped word at that width. Let the labels wrap instead of cutting them. */
  #overlays .cs-name, #overlays .cs-row, #overlays button {
    white-space: normal; height: auto;
  }
  #overlays .cs-row button { min-height: 32px; }
  .chart-wrap.full { padding: 10px; }
}
@media (max-width: 620px) and (max-height: 620px) {
  .chart-wrap { padding: 8px; }
  .chart-top { margin-bottom: 6px; }
}

/* ------------------------------------------------------------- the upsell --- */
/* The one dialog every Pro lock opens (see upsell.js). It sits above the
   builder, the flip dialog and the drawers: it is the answer to a press made
   from any of them, and the machine has already closed what was up. */
#pitch-modal {
  position: fixed; inset: 0; z-index: 160;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.pitch-scrim {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: none;
}
.pitch {
  position: relative; z-index: 1;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 22px 20px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  text-align: center;
}
.pitch:focus { outline: none; }
/* A pitch whose picture is a strip needs the width to show it at the size the
   app draws it: 540 leaves the art 498px for a 480px crop, so the page names
   are the app's own 12px rather than a smaller copy of them. */
.pitch.is-wide { width: min(540px, calc(100vw - 32px)); }
.pitch-x {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--field); color: var(--ink-3);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.pitch-x:hover { color: var(--ink); }

/* The mark: one tile, the plan's own amber, the feature's own glyph. */
.pitch-mark {
  display: grid; place-items: center;
  width: 54px; height: 54px; margin: 4px auto 0;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.pitch-mark svg { width: 26px; height: 26px; }

.pitch-title {
  margin: 14px 0 0;
  font-size: 22px; font-weight: 600; line-height: 1.25;
  letter-spacing: -.02em; color: var(--ink);
}
.pitch-title em { font-style: normal; color: var(--accent); }
.pitch-unlock { white-space: nowrap; }
.pitch-lead {
  margin: 8px auto 0; max-width: 34ch;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-3);
}

/* The picture is the site's own, cropped and faded into the card rather than
   framed: a border round a screenshot reads as a second window. */
.pitch-art {
  position: relative;
  margin: 16px 0 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--field);
}
.pitch-art img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.pitch-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--card) 100%);
  pointer-events: none;
}
/* The conditions pitch is the builder's rail, not a screenshot of one row: it
   shows the item, the second and third condition, the arrows that order them,
   and the sentence they make. It uses the app's own builder classes; only the
   order arrows are live controls, because they are what the pitch explains. */
.pitch-conds {
  margin: 16px 0 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  text-align: left;
}
/* The item row is the builder's Item row to the pixel: its label above the
   field, the item's tile, the search field and its clear. It is a picture of
   the row, so the field is readonly and the clear is not a control. */
.pitch-conds > .ab-itemrow { padding: 0 0 9px; }
.pitch-conds .ab-item-q { cursor: default; }
.pitch-conds .ab-item-x { cursor: default; }
.pitch-conds .ab-item-x:hover { background: transparent; color: var(--ink-4); }
.pitch-conds .ab-conds { padding: 9px 0 0; border: 0; }
.pitch-conds .ab-conds-head { margin-bottom: 8px; }
.pitch-conds .ab-cond-add {
  height: 28px; padding: 0 9px; font-size: 10.5px;
  cursor: default;
}
.pitch-conds .ab-cond-add:hover { border-color: var(--line); color: var(--ink-3); }
.pitch-conds .ab-flow { margin-top: 0; }
.pitch-conds .ab-cond-mini,
.pitch-conds .ab-cond-x {
  width: 24px; height: 24px; padding: 0; cursor: default;
}
.pitch-conds .ab-cond-mini[data-pitch-cond-move] { cursor: pointer; }
.pitch-conds .ab-cond-mini[data-pitch-cond-move]:hover {
  background: var(--field); color: var(--ink);
}
.pitch-conds .ab-cond-mini[data-pitch-cond-move]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.pitch-conds .ab-cond-x:hover { background: transparent; color: var(--ink-4); }
.pitch-conds .ab-summary { margin: 9px 0 0; font-size: 11px; }

/* The comparison pitch is a working two-item chart: the two pickers are the
   feature, and the plot is the app's own comparison renderer. The prices under
   each picker keep the two items' own spreads visible while the lines answer
   the shape question above. */
.pitch-compare {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field);
  text-align: left;
}
.cmp-demo-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 0 1px 9px;
}
.cmp-demo-title { color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.cmp-demo-window {
  color: var(--ink-4);
  font-family: var(--mono); font-size: 9.5px; white-space: nowrap;
}
.cmp-demo-picks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start; gap: 7px;
}
.cmp-demo-pick { display: grid; gap: 4px; min-width: 0; }
.cmp-demo-pick-k {
  display: flex; align-items: center; gap: 5px;
  color: var(--ink-4); font-size: 9.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}
.cmp-demo-dot {
  display: inline-block; flex: 0 0 auto;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--ink-4);
}
.cmp-demo-select { position: relative; display: block; min-width: 0; }
.cmp-demo-select::after {
  content: ""; position: absolute; right: 9px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1px solid var(--ink-4); border-bottom: 1px solid var(--ink-4);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.cmp-demo-pick select {
  width: 100%; height: 32px; padding: 0 24px 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2); color: var(--ink-2);
  font: 500 11.5px/1 var(--sans);
  text-overflow: ellipsis; cursor: pointer;
}
.cmp-demo-pick select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.cmp-demo-vs {
  align-self: center;
  color: var(--ink-4);
  font-family: var(--mono); font-size: 9.5px; text-transform: uppercase;
}
.cmp-demo-prices {
  display: flex; flex-wrap: wrap; gap: 2px 8px;
  color: var(--ink-3);
  font-family: var(--mono); font-size: 9.5px; line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.cmp-demo-prices span { display: inline-flex; align-items: baseline; gap: 3px; }
.cmp-demo-prices em {
  color: var(--ink-4);
  font-family: var(--sans); font-size: 9px; font-style: normal;
}
.cmp-demo-plot {
  min-height: 176px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.cmp-demo-plot svg { display: block; width: 100%; max-width: 100%; }
.cmp-demo-plot .chart-tip { z-index: 170; }
@media (max-width: 360px) {
  .cmp-demo-picks { grid-template-columns: minmax(0, 1fr); }
  .cmp-demo-vs { justify-self: center; }
}

/* The item-pages pitch draws its picture instead of shooting one. It is the one
   feature whose point is a press, and a picture of tabs cannot be pressed: the
   strip below is the app's own pill markup, so the names, the icons and the lit
   page are the ones the board gives, and the panel under it is the top of the
   page that opened - the item header's identity row, cut off by the frame's own
   edge, fading where the rest of the page goes on. */
.pitch-demo {
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field);
  text-align: left;
}
.pitch-strip {
  display: flex; align-items: center; gap: 6px;
  padding: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.pitch-strip::-webkit-scrollbar { display: none; }
/* The same edge fade the band's strip wears while a page is still beyond it
   (upsell.js keeps the class in step), so the row reads as continuing rather
   than as ending at the frame. */
.pitch-strip.more {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}
/* The strip is dragged the way the band's is (`app.js`): no scrollbar, so the
   grab hand is the only affordance there is, and a drag keeps its own text from
   being selected under the pointer. */
.pitch-strip.can-drag, .pitch-strip.can-drag .tb-page, .pitch-strip.can-drag .tb-page-open { cursor: grab; }
.pitch-strip.dragging,
.pitch-strip.dragging .tb-page,
.pitch-strip.dragging button { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.pitch-strip .tb-page img { -webkit-user-drag: none; }
/* The pill's own padding leaves room for the close it does not have here. */
.pitch-strip .tb-page { padding-right: 9px; }
.pitch-strip .tb-page:hover { border-color: var(--line-strong); background: var(--field-2); }
.pitch-strip .tb-page.on:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.pitch-strip .tb-page-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
.pitch-page {
  position: relative;
  height: 152px;
  overflow: hidden;
  padding: 13px 12px 0;
  border-top: 1px solid var(--line);
  background: var(--card);
}
/* The fade starts under the quote strip's figures, not over them: the prices are
   the part of the page a reader is meant to read. */
.pitch-page::after {
  content: "";
  position: absolute; inset: auto 0 0;
  height: 22px;
  background: linear-gradient(to bottom, transparent, var(--card));
  pointer-events: none;
}
/* The header is the app's, without its card: this is the page's top, not a card
   standing inside the strip's frame. */
.pitch-page .iv-head { padding: 0; border: 0; border-radius: 0; background: none; }
.pitch-page-name {
  margin: 0;
  font-size: 22px; font-weight: 600; line-height: 1.15;
  letter-spacing: -.02em; color: var(--ink);
}
/* The quote strip is the app's (`item.js`), at this frame's width rather than a
   column's: one step down in type, and the cells' own outer padding pulled in
   so all four readings keep their own line and no figure wraps. */
.pitch-page .iv-head-stats .quote-row { margin: 12px 0 0; padding-top: 12px; }
.pitch-page .iv-head-stats .q-cell { padding: 0 12px; }
.pitch-page .iv-head-stats .q-cell .k { font-size: 10px; }
.pitch-page .iv-head-stats .q-cell .v { margin-top: 2px; font-size: 17px; }
/* A phone is not a narrower item page. The app stacks the four readings two by
   two in a phone's column, but this frame is showing what the Pro page looks
   like, and that page has them abreast: kept on one line here, the prices are
   the same picture at a smaller width instead of a different layout, and the
   frame stays short enough that the card's own button is not pushed off a
   phone's screen. The type comes down with the width so no figure wraps. */
@media (max-width: 819px) {
  .pitch-page { height: 140px; }
  .pitch-page .iv-head-stats .quote-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pitch-page .iv-head-stats .q-cell {
    padding: 0 8px;
    border: 0; border-left: 1px solid var(--line);
  }
  .pitch-page .iv-head-stats .q-cell:first-child { padding-left: 0; border-left: 0; }
  .pitch-page .iv-head-stats .q-cell:last-child { padding-right: 0; }
  .pitch-page .iv-head-stats .q-cell .v { font-size: 15px; }
}

/* The flip planner's picture is an open flip: the planner's own card
   (`flips.js`), part filled and with its ledger out, because the trade being
   tracked is the thing Pro keeps - a form is a picture of planning one. Its
   controls are drawn as the card draws them, but only the details press is a
   real button: it folds the fills the way the rail's card does, so it and it
   alone wears a pointer. */
.pitch-flip {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field);
  text-align: left;
}
.pitch-flip .flip-card { background: var(--card); }
.pitch-flip .flip-item,
.pitch-flip .abtn,
.pitch-flip .ghost { cursor: default; }
.pitch-flip .flip-more { cursor: pointer; }
/* The whole card with its ledger and its controls is taller than a phone's
   sheet can hold beside the words, and a sheet whose button sits under the fold
   is not a pitch. A phone keeps the card whole - the flip, the live buy and
   sell, the fill bar and the four figures - and drops the two rows of controls
   and the fills under them, which are the desktop card's and the part a phone
   is not there to read. Nothing is cut through, so nothing is drawn faded. */
@media (max-width: 620px) {
  .pitch-flip .flip-acts,
  .pitch-flip .flip-detail { display: none; }
}

/* The watchlists pitch is the market view with its View picker open: the board
   is scoped to one list and the card names the other occasions. The menu is
   the picker's own markup, laid over the board the way it opens over a page;
   it is a picture, so it takes no pointer and nothing inside it is a control. */
.pitch-lists {
  position: relative;
  min-height: 232px;
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  text-align: left;
}
.pitch-lists-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}
/* The mock's own captions speak in the app's voice, not a second one: the
   board title and its column labels, one step down for the miniature. */
.pitch-lists-title {
  color: var(--ink-4);
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: -.005em;
}
.pitch-lists-scope {
  display: inline-flex; align-items: center; height: 26px; padding: 0 9px;
  border: 1px solid var(--accent-line); border-radius: 5px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 500;
}
.pitch-lists-board { padding-bottom: 4px; }
.pitch-lists-cols {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 11px 4px;
  color: var(--ink-4); font-family: var(--sans); font-size: 9.5px;
  font-weight: 500; letter-spacing: 0;
}
.pitch-lists-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 0 11px;
  color: var(--ink-2);
}
.pitch-lists-row + .pitch-lists-row { border-top: 1px solid var(--line-soft); }
.pitch-lists-row img {
  width: 20px; height: 20px; flex: 0 0 20px; object-fit: contain;
}
.pitch-lists-row b {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 11.5px; font-weight: 500;
}
.pitch-lists-row em {
  flex: 0 0 auto; font-style: normal;
  color: var(--up); font-family: var(--mono); font-size: 10px;
}
.pitch-lists-menu {
  position: absolute; top: 44px; right: 10px; width: 208px;
  padding: 5px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--card-2);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .95);
  pointer-events: none;
}
/* The presets picture holds the picker's full-width locked row, whose words are
   longer than a list's name: it takes the real card's 224px minimum so that row
   sits on one line the way it does on the page. */
/* That card is also taller than the watchlists one: the extras row adds a
   fourth line, and the frame grows so the row's own foot is not cut by its
   rounded edge. */
.pitch-lists.is-presets { min-height: 244px; }
.pitch-lists-menu.is-presets { width: 224px; }
/* A phone's column is too narrow for the board and the card abreast: the menu
   takes the frame and the board becomes the line above it. */
@media (max-width: 440px) {
  .pitch-lists,
  .pitch-lists.is-presets { min-height: 0; }
  .pitch-lists-board { display: none; }
  .pitch-lists-menu {
    position: static; width: auto; margin: 8px;
    border-color: var(--line); box-shadow: none;
  }
  .pitch-lists-menu.is-presets { width: auto; }
}

.pitch-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 16px 0 0;
}
.pitch-chip {
  padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--field);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2, var(--ink));
}

.pitch-pill {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 14px 0 0; padding: 6px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
}
.pitch-spark { font-size: 11px; }

.pitch-cta {
  display: block;
  margin: 16px 0 0;
  padding: 13px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: #120a02;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
}
.pitch-cta:hover { filter: brightness(1.06); }

.pitch-fine {
  margin: 8px 0 0;
  font-size: 11.5px; color: var(--ink-3);
}
.pitch-alt {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.pitch-or { color: var(--ink-3); }
.pitch-alt a { color: var(--ink-2, var(--ink)); text-decoration: none; }
.pitch-alt a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 620px) {
  .pitch-title { font-size: 20px; }
  .pitch-art { aspect-ratio: 16 / 9; }
}

/* ------------------------------------------------------- the board's foot --- */
/* The server-rendered board and the way to the category index, under the pager. */
.board-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 14px 4px 2px;
  color: var(--ink-3);
  font-size: 12px;
}
.board-foot a { color: var(--ink-2); text-decoration: none; }
.board-foot a:hover { color: var(--accent); }
/* The foot belongs to the market's list, not to an item, settings, or the
   optimizer, which wear `no-facets` and fill the same element with their own
   content. */
.shell.no-facets .board-foot,
.shell.item-view .board-foot { display: none; }

/* The server's item note is a no-script footnote: the app's page has no copy,
   so leaving it visible until the app replaces the article made it the largest
   layout-shift source on a reload (0.079 on a throttled phone). <noscript> puts
   it back for a reader that never runs the app. */
.itemview.ssr .ssr-note { display: none; }

/* The server's board is a table inside the list card. It stays on the glass
   until the app replaces it with its own rows; the document's <noscript> style
   keeps it for a reader that never runs the app. */
.board-ssr { padding: 4px 2px 2px; }
.board-ssr h2 { margin: 0 0 6px; font-size: 15px; letter-spacing: -.01em; }
.board-ssr > p { margin: 0 0 12px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.board-ssr table { width: 100%; }
.board-ssr th, .board-ssr td { padding: 7px 8px; text-align: right; white-space: nowrap; }
.board-ssr th:first-child, .board-ssr td:first-child { text-align: left; }
.board-ssr th { color: var(--ink-3); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.board-ssr td { color: var(--ink-2); font-family: var(--mono); font-size: 12px; }
.board-ssr td.name a { color: var(--ink); text-decoration: none; }
.board-ssr td.name a:hover { color: var(--accent); }
.board-ssr .ssr-note { margin: 12px 0 2px; }

/* The calculator screens: the app's shell, the server's block in #board, and no
   market column beside it. The content is visible without the `.ssr` class, so
   the app can boot around it without hiding the page it was served. */
.shell[data-screen="tools"] .col-main { grid-column: 1 / -1; }
.shell[data-screen="tools"] .col-side,
.shell[data-screen="tools"] .mkt-hero,
.shell[data-screen="tools"] .movers-card { display: none; }
.shell[data-screen="tools"] .list-card { padding: 18px 20px; }
.toolview { max-width: 760px; margin: 0 auto; }
.toolview .hb-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px; margin: 14px 0 18px;
}
.toolview .hb-card {
  display: flex; flex-direction: column; gap: 5px; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--ink); text-decoration: none;
}
.toolview .hb-card:hover { border-color: var(--line-strong); }
.toolview .hb-name { font-size: 13px; font-weight: 600; }
.toolview .hb-items { color: var(--ink-3); font-size: 11.5px; line-height: 1.5; }
.toolview .hb-go { color: var(--accent); font-size: 14px; }
.toolview .hb-crumbs,
.itemview .hb-crumbs {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  margin: 0 0 10px; color: var(--ink-4); font-size: 11.5px;
}
.toolview .hb-crumbs a,
.itemview .hb-crumbs a { color: var(--ink-3); text-decoration: none; }
.toolview .hb-crumbs a:hover,
.itemview .hb-crumbs a:hover { color: var(--accent); }
.tool-lede { margin: 0 0 18px; color: var(--ink-3); font-size: 13.5px; line-height: 1.65; }
.tool-form {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.tool-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.tool-field { display: flex; flex-direction: column; gap: 5px; }
.tool-field > span:first-child { color: var(--ink-3); font-size: 11px; }
.tool-input { display: flex; align-items: baseline; gap: 4px; }
.tool-input input {
  width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--bg); color: var(--ink);
  font: 500 14px var(--mono);
}
.tool-input input:focus { border-color: var(--line-strong); outline: none; }
.tool-input em { color: var(--ink-4); font-style: normal; font-size: 10.5px; }
.tool-check { display: flex; gap: 7px; align-items: center; color: var(--ink-3); font-size: 12px; }
.tool-actions { display: flex; gap: 10px; align-items: center; }
.tool-formula {
  display: flex; flex-direction: column; gap: 4px; margin: 14px 0; padding: 10px 12px;
  border-left: 2px solid var(--accent-line); background: var(--panel);
  color: var(--ink-3); font-size: 12px;
}
.tool-formula code { color: var(--ink); font-family: var(--mono); font-size: 12px; }
.tool-out {
  display: flex; flex-direction: column; gap: 7px; margin: 16px 0;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
}
.tool-out h2 { margin: 0 0 4px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.tool-out > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.tool-out span { color: var(--ink-4); font-size: 11.5px; }
.tool-out b { color: var(--ink-2); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.tool-out .hero { margin-top: 3px; padding-top: 8px; border-top: 1px solid var(--line); }
.tool-out .hero b { font-size: 17px; color: var(--ink); }
.tool-out .hero.up b, .tool-out b.up { color: var(--up); }
.tool-out .hero.down b, .tool-out b.down { color: var(--down); }
.tool-note { margin: 0 0 16px; color: var(--ink-3); font-size: 12.5px; line-height: 1.6; }
.toolview > h2 { margin: 24px 0 8px; font-size: 15px; }
.toolview > p { color: var(--ink-3); font-size: 13px; line-height: 1.65; }
.tool-examples ul, .tool-related ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-3); font-size: 13px; line-height: 1.8; }
.tool-examples a, .tool-related a { color: var(--ink-2); }
.tool-examples a:hover, .tool-related a:hover { color: var(--accent); }
.ssr-answers { margin-top: 22px; }
.ssr-answers h3 { margin: 14px 0 4px; font-size: 13px; color: var(--ink-2); }
.ssr-answers p { margin: 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.6; }
.ssr-tools { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.ssr-tools ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-3); font-size: 12.5px; line-height: 1.8; }
.ssr-tools a { color: var(--ink-2); }
@media (max-width: 620px) {
  .shell[data-screen="tools"] .list-card { padding: 14px; }
  .tool-fields { grid-template-columns: minmax(0, 1fr); }
}
