/* board.css — The shell, rail, page heads, workspace, cards and the market list.
   Split from styles.css at its original section boundary; order is unchanged. */
/* ------------------------------------------------------------------ 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: var(--hover); }
.rail-tab[aria-pressed="true"], .rail-tab.on, .rail-tab[aria-current="page"] {
  color: var(--on-marker);
  background: var(--marker);
}
.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 the
   index, and every destination is a page of its own. Nothing here needs
   a script to work - the browser opens the summary and every link is real - 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-menu-in-y: -6px;
  --rail-menu-out-y: -4px;
}
.rail-tools > summary { list-style: none; cursor: pointer; }
.rail-tools > summary::-webkit-details-marker { display: none; }
.rail-caret {
  flex: 0 0 auto;
  width: 10px;
  height: 7px;
  margin-left: 4px;
  transition: transform var(--t-quick) var(--ease);
}
.rail-tools[open] .rail-caret { transform: rotate(180deg); }
.rail-tools[open] > summary { color: var(--accent); background: var(--accent-soft); }
/* An open Tools menu owns the rail's highlight. The pane mark underneath is
   still the column's state, but leaving it lit put two orange plates in the
   rail - most visibly the Market mark at the top - and made the rail look as
   if the logo had been selected while the menu was open. */
.rail-switch:has(.rail-tools[open]) .rail-tab[aria-pressed="true"] {
  color: var(--ink-3);
  background: transparent;
}
/* The panel drops from the mark without a fade from nowhere: the short
   downward move makes the top edge the thing that opened. */
@keyframes rail-menu-in {
  from { opacity: 0; transform: translateY(var(--rail-menu-in-y, -6px)); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rail-menu-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(var(--rail-menu-out-y, -4px)); }
}
.rail-tools[open] > .rail-menu {
  animation: rail-menu-in 160ms cubic-bezier(.16, 1, .3, 1) both;
}
.rail-tools.closing > .rail-menu {
  animation: rail-menu-out 120ms cubic-bezier(.4, 0, 1, 1) both;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .rail-tools[open] > .rail-menu,
  .rail-tools.closing > .rail-menu { animation: none; }
  .rail-caret { transition: none; }
}

.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: var(--on-accent);
  font-size: var(--text-label); font-weight: var(--fw-medium); 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: var(--text-label); font-weight: var(--fw-medium);
  overflow: hidden;
}
.rail-marks .acct:hover, .rail-marks #signin:hover { background: var(--hover); color: var(--ink); }
.rail-marks .acct[aria-current="page"],
.rail-marks .acct[aria-current="page"]:hover {
  color: var(--on-marker);
  background: var(--marker);
}
.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 ---- */
.stat-pill .spark {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.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: var(--hover); 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: var(--hover); 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: var(--text-title);
  line-height: var(--leading-display);
  font-weight: var(--fw-display);
  letter-spacing: var(--track-display);
}
.ph-copy p { margin-top: 4px; color: var(--ink-4); font-size: var(--text-label); }

/* 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; }

.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: var(--text-label);
}
.ph-search input::placeholder { color: var(--ink-4); }
.ph-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 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: var(--text-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug .p {
  font-weight: var(--fw-medium); font-family: var(--mono); font-size: var(--text-label); 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: var(--text-label); }
.suggest .loading { padding: 12px; color: var(--ink-3); font-size: var(--text-label); }

/* 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; }

.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: var(--text-label);
}
.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: var(--text-body);
}
.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: var(--scroll) transparent;
}

.col-main { display: flex; flex-direction: column; gap: var(--col-gap); min-width: 0; }
/* The board takes every pixel the rail leaves. No centered measure: the head's
   search sits over the board's left edge and the side column ends on the glass. */
.page-head, .workspace { width: 100%; }
/* 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: var(--text-body); font-weight: var(--fw-medium); letter-spacing: 0; }
/* The item's three tool 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 {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* -------------------------------------------------------------- chart card -- */

/* 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: var(--text-label); font-weight: var(--fw-medium);
  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-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-family: var(--mono); font-size: var(--text-micro); font-weight: var(--fw-medium);
  letter-spacing: var(--track-label);
  text-align: right;
  white-space: nowrap;
}
.board-body thead th:first-child { width: 34px; }
.board-body table.grid 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: var(--text-label); color: var(--accent); }

.board-body tbody td {
  font-weight: var(--fw-medium);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  font-family: var(--mono);
  font-size: var(--text-label);
  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: var(--hover); }
.board-body tbody td.name { text-align: left; font-family: var(--sans); font-weight: var(--fw-regular); font-size: var(--text-body); 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: var(--fw-medium);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-cell .nm:hover { color: var(--accent-2); }
.item-cell .f2p {
  font-size: var(--text-label); font-weight: var(--fw-medium); letter-spacing: 0;
  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: var(--text-body);
}
.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 {
  font-weight: var(--fw-medium);
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--mono); font-size: var(--text-label);
  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(--ink-4); border-radius: inherit; }
.bar-cell .num { font-size: var(--text-label); }
.vol-short { display: none; }

.board-body .hide-xs, .board-body .hide-sm, .board-body .hide-md { display: table-cell; }

/* A removed column leaves the table's layout, not just its ink: the remaining
   columns get its width back. The picker's visibility is the one owner. */
.board-body :is(thead th, tbody td).col-off { display: none !important; }

.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: var(--fw-medium) var(--text-body)/var(--leading-tight) var(--sans); vertical-align: 2px;
}

.board-body .empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-3);
}
.board-body .empty h3 { font-size: var(--text-body); color: var(--ink); margin-bottom: 4px; }
.board-body .empty p { font-size: var(--text-label); }

.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;
  border-top: 1px solid var(--line-soft);
}
.pager[hidden] { display: none; }
.pg-nums { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.pg {
  font-weight: var(--fw-medium);
  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: var(--text-label);
  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 {
  font-weight: var(--fw-medium); color: var(--ink-4); font-size: var(--text-label); font-family: var(--mono); }

/* ------------------------------------------------------------- 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; }
}
.calc-body { display: flex; flex-direction: column; gap: 10px; }

/* The order ticket's fold: the head stays and the body goes, so the ticket can
   be narrowed to its name. The mark lives in the head, beside the title it
   names. */
.card.min > :not(.card-head) { 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 { 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 two paid readings need the live item's flow, so they 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; }
.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: var(--text-label); line-height: var(--leading-label); }
.fill-badge {
  font-weight: var(--fw-medium);
  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: var(--text-label);
}
.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: var(--text-label);
}
.fill-row b { color: var(--ink); font-family: var(--mono); font-size: var(--text-label); font-weight: var(--fw-medium); }
.fill-row b.up { color: var(--up); }
.fill-row b.down { color: var(--down); }
.fill-row-last { border-bottom: 0; padding-bottom: 0; }
/* 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;
}
.press-card .card-head { margin-bottom: 12px; }
.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 stays and the body carries the lock, so
   the button is the one press. */

/* 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: var(--text-label); font-weight: var(--fw-medium); line-height: 1;
  letter-spacing: var(--track-label); 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 var(--inset-line);
}
.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: var(--text-title); font-weight: var(--fw-medium);
  line-height: .88; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.press-lead i {
  margin-left: 2px; color: var(--ink-3);
  font-style: normal; font-size: var(--text-label); letter-spacing: 0;
}
.press-lead span { color: var(--ink-4); font-size: var(--text-label); line-height: var(--leading-heading); }
.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-fill.buy { background: linear-gradient(90deg, var(--up-soft), var(--up)); }
.press-fill.sell { background: linear-gradient(90deg, var(--down), var(--down-soft)); }

.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: var(--text-label); letter-spacing: var(--track-label); text-transform: none;
}
.press-ledger b {
  color: var(--ink-2);
  font-family: var(--mono); font-size: var(--text-label); font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}
.press-ledger .up b { color: var(--up); }
.press-ledger .down b { color: var(--down); }
.press-empty,
.fill-empty {
  margin: 0; padding: 16px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-xs);
  color: var(--ink-4); font-size: var(--text-label); line-height: var(--leading-body); text-align: center;
}

.tool { display: flex; flex-direction: column; gap: 10px; }

.tool-note { color: var(--down); font-size: var(--text-label); }

/* 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(115, 215, 165, .27); background: rgba(115, 215, 165, .065); }
.calc-plate.sell { border-color: rgba(255, 133, 140, .27); background: rgba(255, 133, 140, .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(115, 215, 165, .58);
  background: rgba(115, 215, 165, .13);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
.calc-plate.sell.on {
  border-color: rgba(255, 133, 140, .58);
  background: rgba(255, 133, 140, .12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
.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: var(--text-label); text-transform: none; letter-spacing: 0; }
.calc-plate b {
  color: var(--ink);
  font-family: var(--mono); font-size: var(--text-body); font-weight: var(--fw-medium);
}
/* 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: var(--text-label); }

/* 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: var(--text-label); }
/* 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 {
  font-weight: var(--fw-medium);
  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: var(--text-body);
  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 {
  font-weight: var(--fw-medium);
  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: var(--text-label); line-height: var(--leading-label);
  text-align: left; cursor: pointer;
}
.suggest-chip:hover { color: var(--ink); border-color: var(--accent-line); }
.suggest-chip[hidden] { display: none; }
/* 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: var(--text-label);
  }
}

.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: var(--text-label);
}
.calc-out b { color: var(--ink-2); font-family: var(--mono); font-weight: var(--fw-medium); font-size: var(--text-label); }
.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: var(--text-body); font-weight: var(--fw-medium); }
/* 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: var(--text-label); }

