/* responsive.css - the responsive layer and phone sheets.
   Split from styles.css at its original section boundary; order is unchanged. */
/* ---------------------------------------------------------------- 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-search { width: 180px; }
  /* One column: the wrappers become contents so the chart and the list are
     siblings, and the list sits under the chart rather than beside it. */
  .workspace { display: flex; flex-direction: column; align-items: stretch; }
  .workspace .card { flex: 0 0 auto; }
  .col-main, .col-side { display: contents; }
  .filters-card { order: 1; max-width: none; }
  .filters-card .facets-body { display: none; }
  .filters-card.open .facets-body { display: flex; flex-direction: column; }
  .list-card { order: 2; }
  /* 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; }
}

/* 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) {
}

@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; }
  .workspace { padding: 0 var(--page-pad) 20px; }
  .ph-copy h1 {
  font-weight: var(--fw-display); font-size: var(--text-heading); }
  .ph-search { width: 180px; }
  .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) {
  .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) {
}

/* 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: var(--text-body); }
  .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; }
  .page-head { height: 60px; padding: 0 calc(var(--page-pad) + var(--shell-gutter, 0px)) 0 var(--page-pad); gap: 8px; }
  .ph-copy h1 {
  font-weight: var(--fw-display); font-size: var(--text-heading); }
  .ph-copy p { display: none; }
  .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; }
  /* 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. */
  .list-card { padding: 2px 2px 6px; }
  .card-head h2 { font-size: var(--text-body); }
  .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: var(--text-label); 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: var(--text-label);
  }
  /* 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.col-change {
    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-weight: var(--fw-regular); font-size: var(--text-label); line-height: 1;
    letter-spacing: 0; 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:is(.col-price, .col-cycle, .col-volume, .col-bought, .col-sold, .col-vr, .col-limit, .col-highalch, .col-alch) { display: none; }
  .board-body tbody td.col-buy { grid-area: buy; }
  .board-body tbody td.col-sell { grid-area: sell; }
  .board-body tbody td.col-margin { grid-area: margin; }
  .board-body tbody td.col-roi { 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.col-buy,
  .board-body tbody td.col-sell,
  .board-body tbody td.col-margin,
  .board-body tbody td.col-roi {
    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.col-roi {
    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: var(--text-label); }
  /* 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: var(--text-label); }
  .board-body tbody td.col-buy::before,
  .board-body tbody td.col-sell::before,
  .board-body tbody td.col-margin::before,
  .board-body tbody td.col-roi::before {
    display: block;
    color: var(--ink-4);
    font-family: var(--sans); font-weight: var(--fw-regular);
    font-size: var(--text-label);
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 0;
    text-align: left;
  }
  .board-body tbody td.col-buy::before { content: "Buy"; }
  .board-body tbody td.col-sell::before { content: "Sell"; }
  .board-body tbody td.col-margin::before { content: "Margin"; }
  .board-body tbody td.col-roi::before { content: "ROI"; }
  .board-body tbody td.col-margin { 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: var(--text-label); font-weight: var(--fw-medium); 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: var(--text-label); 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 12px; }
  .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: var(--text-label); font-weight: var(--fw-medium); 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; }
  /* 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: var(--text-heading); flex-wrap: wrap; gap: 1px 6px; }
  .q-cell .q-pct { font-size: var(--text-label); }
  .iv-head { padding: 12px; gap: 10px; border-radius: 15px; }
  .iv-head .ico-lg, .iv-head > img { width: 40px; height: 40px; }
  .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. */
  /* 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: var(--text-label); }
}

@media (max-width: 400px) {
}

@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 --- */

/* 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 .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 {
  display: none; }
.shell:is([data-screen="settings"], [data-screen="notifications"]) .workspace {
  grid-template-columns: minmax(0, 1fr);
}

/* The server's blocks (`.ssr`) are the document for a crawler and a reader
   without scripts. A scripted browser starts on the server-rendered skeleton
   instead, so the plain table or SEO article never flashes before the app draws
   its own rows. `gutter.js` sets `.js` before the body paints; the server block
   stays in the HTML, hidden from the scripted view, and is revealed again when
   scripts are off. The app still clears it 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 :is(thead th, tbody td).col-limit,
  .board-body :is(thead th, tbody td).col-volume { 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; }

/* -------------------------------------------------------- other screens ----- */
.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; }
@media (max-width: 1080px) {
  .acct-grid { flex-direction: column; align-items: stretch; gap: 12px; }
  .acct-main, .acct-side { display: contents; }
  .acct-billing { order: 1; }
  .acct-signin { order: 2; }
  .acct-alert { order: 3; }
  .acct-delete { order: 5; }
}
.set-head.mast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.set-head h2 { font-family: var(--sans); font-size: var(--text-heading); font-weight: var(--fw-medium); letter-spacing: 0; line-height: var(--leading-heading); }
.scard { position: relative; }
.scard h3 { font-size: var(--text-body); font-weight: var(--fw-medium); margin: 0 0 4px; }
.set-id { min-width: 0; }
.set-who { margin: 4px 0 0; color: var(--ink-3); font-size: var(--text-label); }
.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: var(--text-body); font-weight: var(--fw-medium);
  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: var(--fw-medium);
}
.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: var(--text-label); }
.facts dd {
  font-weight: var(--fw-medium); display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 0; color: var(--ink); font-family: var(--mono); font-size: var(--text-label); }
.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: var(--text-label); }
.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-weight: var(--fw-regular); font-size: var(--text-label); 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-state.on { color: var(--up); }
.soc-row .sbtn { justify-self: end; }
@media (max-width: 620px) {
  /* 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, 133, 140, .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: var(--text-label); }
.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: var(--on-accent); }
.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: var(--text-label); }
.acfg-state { color: var(--ink-4); font-size: var(--text-label); 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: var(--text-label); 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; }
   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. */


/* ----------------------------------------------------------- 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-family: var(--sans); font-size: var(--text-label); font-weight: var(--fw-medium); color: var(--ink-2); }
.aitem .aonce { grid-area: 1 / 2; justify-self: end; }
.aitem .acts { grid-area: 1 / 3; justify-self: end; }
.alvl {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: var(--text-label);
  font-weight: var(--fw-regular);
  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 { font-family: var(--mono); font-weight: var(--fw-medium); letter-spacing: 0; }
.aval em { font-style: normal; }



.aonce {
  padding: 1px 6px; border-radius: 5px;
  background: var(--field-2); color: var(--ink-4);
  font-family: var(--mono); font-size: var(--text-micro); font-weight: var(--fw-medium);
  letter-spacing: var(--track-label); line-height: var(--leading-label);
}
.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-search { width: 150px; min-width: 110px; }
  .col-main, .list-card, .board-body { min-width: 0; max-width: 100%; }
  .board-body table.grid tbody tr { width: 100%; }
  .board-body table.grid tbody td.col-volume { 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 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-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: var(--text-label); }
.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-weight: var(--fw-regular); font-size: var(--text-label); 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: var(--text-label); cursor: pointer;
}
.flip-filters button span {
  font-weight: var(--fw-medium); color: var(--ink-3); font-family: var(--mono); font-size: var(--text-label); }
.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-card {
  padding: 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-2);
}
.flip-card.open { border-color: var(--line-strong); }
.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: var(--text-label);
}
.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: var(--text-label); font-weight: var(--fw-medium);
}
.flip-copy span {
  font-weight: var(--fw-medium);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-3); font-family: var(--mono); font-size: var(--text-label);
}
.flip-tags { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.flip-state {
  font-weight: var(--fw-medium);
  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: var(--text-label);
  letter-spacing: 0; 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: var(--text-label);
}
.flip-live span { display: inline-flex; align-items: baseline; gap: 4px; }
.flip-live b {
  color: var(--ink); font-family: var(--mono);
  font-size: var(--text-label); font-weight: var(--fw-medium);
}
.flip-live .sell b { color: var(--accent); }
.flip-age {
  font-weight: var(--fw-medium); color: var(--ink-3); font-family: var(--mono); font-size: var(--text-label); }
.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-note {
  margin: 8px 0 0; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--ink-3); font-size: var(--text-label); line-height: var(--leading-label);
}
.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: var(--text-label); }
.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 {
  font-weight: var(--fw-medium);
  display: flex; justify-content: space-between; gap: 8px;
  color: var(--ink-3); font-family: var(--mono); font-size: var(--text-label);
  letter-spacing: 0; text-transform: none;
}
.flip-ledger-none { margin: 5px 0 2px; color: var(--ink-3); font-size: var(--text-label); }
.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 {
  font-weight: var(--fw-medium);
  flex: 0 0 auto; width: 24px; padding: 2px 0; border-radius: 4px;
  font-family: var(--mono); font-size: var(--text-label); letter-spacing: 0; 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 {
  font-weight: var(--fw-medium);
  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: var(--text-label);
}
.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: var(--text-label);
}
.flip-fill-at { flex: 0 0 auto; color: var(--ink-3); font-size: var(--text-label); }
.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: var(--text-body); 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-weight: var(--fw-regular); font-size: var(--text-label); 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: var(--text-label); }
.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: var(--text-label); }
.flip-empty p { max-width: 220px; color: var(--ink-4); font-size: var(--text-label); line-height: var(--leading-body); }
.flip-empty strong { color: var(--ink-2); font-weight: var(--fw-medium); }
.flip-empty-line { padding: 18px 4px; color: var(--ink-4); font-size: var(--text-label); text-align: center; }
.flip-error { margin: 0 0 8px; color: var(--down); font-size: var(--text-label); line-height: var(--leading-label); }
.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. */
@media (pointer: coarse), (max-width: 620px) {
}
.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: var(--text-label); font-weight: var(--fw-medium); 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: var(--scrim); 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: var(--text-heading); font-weight: var(--fw-medium); letter-spacing: 0; }
.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: var(--text-heading); 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-weight: var(--fw-regular); font-size: var(--text-label); 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 {
  font-weight: var(--fw-medium);
  color: var(--ink-3); font-family: var(--mono); font-size: var(--text-label);
  letter-spacing: 0; 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-weight: var(--fw-regular); font-size: var(--text-label); outline: none;
}
.flip-field input { height: 36px; }
.flip-field textarea { padding: 8px 9px; resize: vertical; line-height: var(--leading-label); }
.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: var(--text-label); }
.flip-projection b { color: var(--ink-2); font-family: var(--mono); font-size: var(--text-label); font-weight: var(--fw-medium); }
.flip-projection .sum { padding-top: 5px; border-top: 1px solid var(--line-soft); }
.flip-tax-note { margin: 0; color: var(--ink-3); font-size: var(--text-label); line-height: var(--leading-label); }
.flip-form-error { min-height: 0; margin: 0; color: var(--down); font-size: var(--text-label); line-height: var(--leading-label); }
.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: var(--text-label); }
.flip-save { border: 0; background: var(--accent); color: var(--on-accent); font-weight: var(--fw-medium); }
.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; }
}

/* The plan sheet is a trade ticket, not a generic form: the item is the head of
   the ticket, the three numbers are one row, and the tax maths closes it. The
   form body scrolls under a fixed foot, so Save stays on a short phone. */
.flip-dialog.flip-plan {
  display: flex; flex-direction: column;
  width: min(520px, 100%);
  padding: 0; overflow: hidden;
}
.flip-plan .flip-dialog-head {
  flex: 0 0 auto;
  margin: 0; padding: 18px 20px 15px;
  border-bottom: 1px solid var(--line-soft);
}
.flip-plan .flip-dialog-head h3 { font-size: var(--text-heading); }
.flip-plan .flip-x { width: 32px; height: 32px; }
.flip-plan .flip-form {
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
  gap: 0; padding: 0;
}
.flip-plan .flip-plan-body {
  display: flex; flex-direction: column; gap: 14px;
  flex: 1 1 auto; min-height: 0;
  padding: 18px 20px;
  overflow-y: auto;
}
.flip-plan .flip-item-row {
  gap: 12px; padding: 12px 13px;
  border-color: var(--accent-line); border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--card));
}
.flip-plan .flip-item-row .flip-ico {
  width: 38px; height: 38px; flex-basis: 38px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card);
}
.flip-plan .flip-item-row .flip-ico img { width: 30px; height: 30px; image-rendering: pixelated; }
.flip-plan .flip-item-row .flip-copy b { font-size: var(--text-body); }
.flip-plan .flip-item-row .flip-copy span { font-size: var(--text-label); color: var(--ink-3); }
.flip-plan .flip-fields {
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 10px;
}
.flip-plan .flip-fields > .flip-field:first-child { grid-column: auto; }
.flip-plan .flip-field > span {
  font-family: var(--sans); font-weight: var(--fw-medium);
  color: var(--ink-2); font-size: var(--text-label);
}
.flip-plan .flip-field input {
  background: var(--card);
  font-family: var(--mono); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.flip-plan .flip-field input:focus,
.flip-plan .flip-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.flip-plan .flip-field textarea { min-height: 68px; background: var(--card); }
.flip-plan .flip-projection {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2);
}
.flip-plan .flip-projection > div {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 10px 13px;
}
.flip-plan .flip-projection > div + div { border-left: 1px solid var(--line-soft); }
.flip-plan .flip-projection b { font-size: 12px; line-height: 1.35; }
.flip-plan .flip-projection .sum {
  grid-column: 1 / -1;
  flex-direction: row; align-items: baseline; justify-content: space-between;
  padding: 11px 13px;
  border-top: 1px solid var(--line-soft); border-left: 0;
  background: color-mix(in srgb, var(--accent-soft) 38%, var(--card));
}
.flip-plan .flip-projection .sum b { font-size: 16px; line-height: 1.2; }
.flip-plan .flip-foot {
  flex: 0 0 auto;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.flip-plan .flip-foot .ghost,
.flip-plan .flip-foot .abtn { height: 38px; padding: 0 16px; }

@media (max-width: 620px) {
  .flip-plan .flip-dialog-head { padding: 16px 16px 13px; }
  .flip-plan .flip-plan-body { gap: 12px; padding: 16px; }
  .flip-plan .flip-item-row { padding: 11px 12px; }
  .flip-plan .flip-fields { grid-template-columns: 1fr 1fr; }
  .flip-plan .flip-fields > .flip-field:first-child { grid-column: 1 / -1; }
  .flip-plan .flip-foot {
    display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 8px; padding: 12px 16px;
  }
  .flip-plan .flip-foot .ghost,
  .flip-plan .flip-foot .abtn { width: 100%; height: 44px; }
}

/* 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 { border-radius: 5px; }
.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; }
.wf-row span, .eyebrow { font-family: var(--sans); font-weight: var(--fw-regular); font-size: var(--text-label); letter-spacing: 0; }
.press-kicker, .press-ratio em, .press-ledger em, .calc-plate span { font-family: var(--sans); font-weight: var(--fw-regular); letter-spacing: 0; }
.press-kicker, .press-ratio em, .press-ledger em { font-size: var(--text-label); }
.calc-plate span { font-size: var(--text-label); }
.flip-field > span, .flip-sum-row span, .flip-sum-foot { font-family: var(--sans); font-weight: var(--fw-regular); font-size: var(--text-label); letter-spacing: 0; }
.flip-state { font-family: var(--sans); font-weight: var(--fw-regular); font-size: var(--text-label); letter-spacing: 0; }
.flip-fill-side { font-family: var(--sans); font-weight: var(--fw-regular); font-size: var(--text-label); 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 {
    align-self: start;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }
}

/* ------------------------------------------------------- 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: var(--text-body) !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; }
}

/* 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; }
  .facets { bottom: var(--kb, 0px); }
  /* 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; }
  .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: var(--text-heading);
    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: var(--text-label); font-weight: var(--fw-medium); letter-spacing: 0;
    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: var(--text-body);
  }
  .listmenu.docked .lm-new { min-height: 44px; font-size: var(--text-body); }
  .listmenu.docked .lm-tool { width: 44px; height: 44px; font-size: var(--text-body); }
  .listmenu.docked .lm-input { min-height: 44px; font-size: var(--text-body); }
  .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; }
  #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: var(--text-label); }
}

@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-tab > .rail-caret {
    position: absolute;
    top: 6px;
    right: 9px;
    width: 9px;
    height: 6px;
    margin: 0;
  }
  .rail-lbl { display: block; font-size: var(--text-label); 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-menu-in-y: 8px;
    --rail-menu-out-y: 4px;
  }
  .rail-tools > summary { width: 100%; }
  .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;
    max-height: none;
    display: flex;
    opacity: 1;
    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(var(--topbar-h) + var(--strip-h) + 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: var(--text-heading); font-weight: var(--fw-regular); letter-spacing: 0; }
  .scard h2, .scard h3, .section-head h2 { font-size: var(--text-body); letter-spacing: 0; }
  .hist { border-radius: 15px; }
  /* The record is a card of rows like every other card of rows. */
  .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: var(--text-label); }
  .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; }
  .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: var(--text-label); }
  /* 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: var(--text-body); }
  /* 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: var(--text-body); }
}

/* ---------------------------------------------- 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: var(--text-body); }
  .listmenu .lm-tool { width: 44px; height: 44px; font-size: var(--text-body); }
  .listmenu .lm-input { min-height: 44px; font-size: var(--text-body); }

  /* 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: var(--text-body); }
  .cmp-hit { min-height: 44px; padding: 10px 8px; }

  /* Layers: on a phone the readings are a card of switches, so each is a row. */

  /* 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; }

  /* 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 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; }

  /* All five actions share one row of equal cells. Saving on a row by itself
     left the fifth cell empty and the live stamp floating between two rows. */
  .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, .iv-acts .iv-crown { 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. */

  /* 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: var(--text-micro); color: var(--ink-3); letter-spacing: var(--track-label); line-height: var(--leading-label);
  }
  .iv-head-stats .q-cell .v {
    margin-top: 3px; gap: 4px; line-height: var(--leading-label);
  }
  .iv-head-stats .q-cell .q-pct { line-height: var(--leading-heading); }

  /* 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. */
  .ranges button { flex: 1 1 0; min-width: 0; padding: 0 2px; }
}

/* A 320 cell is 49px: the five words fit, but the last one loses a pixel to
   the default inset. Give the row back that inset rather than an ellipsis. */
@media (max-width: 360px) {
  .shell.item-view .iv-acts .iv-btn { padding: 0 3px; font-size: 11px; }
}

/* ------------------------------------------- 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: var(--text-label); }
  .wrow { min-height: 44px; padding: 8px; }
  .wchg { font-size: var(--text-label); }

  /* 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-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: var(--text-label); }
  .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 {
  font-weight: var(--fw-display); 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: var(--leading-label);
  }
}

/* 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 var(--inset-line);
}
.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: var(--fw-medium) var(--text-label) 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: relative; display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; flex: 0 0 auto; min-width: 0;
}
/* Every chart popover hangs from one right-hand lane. Without a shared width,
   the wider Settings and Compare panels stepped farther left than More, so the
   three controls opened from visibly different places. */
.shell.item-view .ct-tools,
.chart-wrap.full .ct-tools { --chart-pop-w: 250px; }
.shell.item-view .chart-menu,
.shell.item-view .cmp-pop,
.shell.item-view #studies,
.chart-wrap.full .chart-menu,
.chart-wrap.full .cmp-pop,
.chart-wrap.full #studies {
  width: var(--chart-pop-w);
  max-width: none;
}
@media (max-width: 620px) {
  .shell.item-view .ct-tools,
  .chart-wrap.full .ct-tools { --chart-pop-w: calc(100vw - 36px); }
}
.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: var(--fw-regular) var(--text-label) 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-weight: var(--fw-medium); font-family: var(--mono); font-size: var(--text-label); letter-spacing: 0; }

.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: var(--text-label); }
.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: var(--fw-regular) var(--text-label) 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: var(--text-label); 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: var(--text-label);
}
.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: var(--text-label); 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: var(--fw-medium) var(--text-label) var(--mono); font-weight: var(--fw-medium);
  letter-spacing: var(--track-label);
}
.rclock-v {
  font-weight: var(--fw-medium);
  color: var(--ink-3); font-family: var(--mono); font-size: var(--text-label);
  font-variant-numeric: tabular-nums;
}

/* Chart settings is a popover, not a dialog: it hangs from the same toolbar
   row as the drawing and overflow menus, so every chart control opens in one
   place. The room left under it is measured when it opens (app.js), which keeps
   the sheet on a short phone without tying its height to the card behind it. */
#studies {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 40;
  display: none; width: min(340px, calc(100vw - 36px));
  max-height: min(560px, calc(100dvh - 24px)); 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: var(--text-label); font-weight: var(--fw-medium); }
.studies-x {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--ink-4); font-size: var(--text-heading); 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 auto; justify-content: flex-start; max-width: 100%; }
  .chart-actions { order: 2; flex: 0 0 auto; 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 { width: calc(100vw - 36px); }
  #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 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: var(--text-body); letter-spacing: 0; }
.board-ssr > p { margin: 0 0 12px; color: var(--ink-3); font-size: var(--text-label); line-height: var(--leading-body); }
.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: var(--text-label); font-weight: var(--fw-medium); letter-spacing: var(--track-label); }
.board-ssr td {
  font-weight: var(--fw-medium); color: var(--ink-2); font-family: var(--mono); font-size: var(--text-label); }
.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; }

/* ==========================================================================
   Tools / calculators
   ==========================================================================
   The hub and the three calculators are screens of the app. They share one
   design language - dark plates, 1px rules, mono labels, numbered cells and one
   accent - but not one arrangement. The question decides the desk: a trade
   ticket and receipt for tax, a cast setup and return sheet for alchemy, a
   cycle setup and board for a buy limit. */

.shell[data-screen="tools"] .col-main { grid-column: 1 / -1; }
.shell[data-screen="tools"] .col-side,
.shell[data-screen="tools"] .list-card {
  padding: 0; border: 0; background: none; overflow: visible;
}
/* The optimizer markup lives in the shared shell. A tools page omits
   optimizer.css, so keep the unstyled desk out of its way. */
.shell .opt-screen { display: none; }
.shell[data-screen="optimizer"] .opt-screen { display: grid; }

.toolview {


  --tool-rule: rgba(255, 255, 255, .09);

  --tool-pad: 16px;
  width: 100%; min-width: 0;
}

