/* radar — Weather Desk.
   A working synoptic board for the Grand Exchange: deep-sea navy, chart cream,
   a warm-front coral for action and a marker amber for the line being read.
   The structure is the desk's; the weather is the material, not a costume. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
}

/* radar — Arcade.
   Warm parchment, brass frames and a market board that reads like an OSRS
   cabinet. This sheet is loaded after the app's own styles: it changes the
   material and the type, never the structure or the data. */

:root {
  color-scheme: light;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--sans);
  --display: var(--sans);

  --fw-display: 800;
  --fw-regular: 400;
  --fw-medium: 600;
  --fw-semibold: 700;

  --track-display: -.045em;

  --bg: #071925;
  --bg-2: #0a202c;
  --rail: #06141d;
  --card: #0a2230;
  --card-2: #0a2230;
  --field: #0f2b3a;
  --field-2: #0a2230;
  --line: #1c3a46;
  --line-soft: #315462;
  --line-strong: #315462;

  --ink: #f2ead9;
  --ink-2: #ccd9da;
  --ink-3: #87a3a9;
  --ink-4: #6f8b92;

  --accent: #f0bd55;
  --accent-2: #d9a63f;
  --on-accent: #0f2b3a;
  --marker: #f0bd55;

  --on-marker: #071925;
  --peri: #87a3a9;
  --accent-soft: rgba(240, 189, 85, .2);
  --accent-line: rgba(155, 101, 35, .45);

  --up: #79c9b3;
  --down: #e75a3f;
  --up-soft: rgba(121, 201, 179, .12);
  --down-soft: rgba(239, 130, 105, .12);

  --radius: 4px;
  --radius-sm: 3px;
  --radius-xs: 2px;
  --shadow: 0 2px 0 #1c3a46;

  --shadow-pop: 0 14px 32px rgba(0, 0, 0, .42);

  --hover: rgba(240, 189, 85, .08);
  --inset-line: #06141d;
  --scrim: rgba(0, 0, 0, .5);
  --scroll: #244755;

  --lime: #f2ead9;
  --lime-dim: #6f8b92;


  --brand: #f0bd55;

  --ch-up: #79c9b3;
  --ch-down: #e75a3f;
  --ch-brand: #f0bd55;
  --ch-axis: #87a3a9;
  --ch-plate: #0a2230;
  --ch-grid: rgba(0, 0, 0, .18);
  --ch-grid-2: rgba(0, 0, 0, .24);
  --ch-frame: rgba(0, 0, 0, .35);
  --ch-cross: #6f8b92;
  --ch-note: #ccd9da;
  --ch-vol: #244755;
  --ch-vol-hi: #b98d36;
  --ch-vol-plate: #0a202c;
  --ch-chip: #0f2b3a;
  --ch-chip-line: #1c3a46;
  --ch-up-fill: rgba(121, 201, 179, .2);
  --ch-down-fill: rgba(239, 130, 105, .16);
  --cmp-1: #d9a63f;
  --cmp-2: #79c9b3;
  --cmp-3: #e75a3f;
  --cmp-4: #79c9b3;
}

html,
body {
  background: var(--bg);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 50% -14%, #0a2230 0%, rgba(10, 34, 48, 0) 64%),
    linear-gradient(180deg, #071925 0%, #071925 55%, #071925 100%);
  background-attachment: fixed;
}

.shell {
  background: transparent;
}

::selection {
  background: var(--marker);
  color: var(--on-marker);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  border: 2px solid #315462;
  border-radius: 2px;
  background: linear-gradient(180deg, #f0bd55, #d9a63f);
  color: var(--ink);
  font-weight: 800;
}

/* ---------------------------------------------------------------- topbar --- */
.topbar {
  background: linear-gradient(180deg, #06141d 0%, #0f2b3a 100%);
  border-bottom: 2px solid #315462;
  box-shadow: inset 0 -1px 0 #0f2b3a, 0 2px 0 rgba(240, 189, 85, .14);
}

.topbar-brand {
  color: var(--ink);
}

.topbar-brand .brand-mark,
.brand-mark {
  padding: 2px;
  border: 1px solid #315462;
  border-radius: 3px;
  background: #0f2b3a;
  box-shadow: inset 0 1px 0 #06141d, 0 1px 0 #244755;
}

.brand-word {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.055em;
}

.topbar .rail-tab,
.topbar .rail-tools > summary {
  border-radius: 2px;
  color: var(--ink-3);
  font-weight: 800;
}

.topbar .rail-tab:hover,
.topbar .rail-tools > summary:hover {
  background: rgba(240, 189, 85, .16);
  color: var(--ink);
}

.topbar .rail-tab[aria-pressed="true"],
.topbar .rail-tab[aria-current="page"],
.topbar .rail-tools[open] > summary {
  background: linear-gradient(180deg, #d9a63f, #f0bd55);
  color: var(--ink);
  box-shadow: inset 0 1px 0 #ffe6a3, 0 1px 0 #315462;
}

.topbar .rail-tab[aria-pressed="true"]::after,
.topbar .rail-tab[aria-current="page"]::after {
  display: none;
}

.rail-badge,
.chip-badge {
  background: var(--down);
  color: #0f2b3a;
}

.topbar .ph-search {
  border: 1px solid #315462;
  border-radius: 3px;
  background: #0a2230;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2), 0 1px 0 #06141d;
}

.topbar .ph-search:focus-within,
.ph-search:focus-within {
  border-color: #f0bd55;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2), 0 0 0 2px rgba(240, 189, 85, .22);
}

.topbar .search-mark,
.search-mark {
  color: var(--ink-3);
}

.topbar .tb-bell,
.tb-bell {
  border: 1px solid #315462;
  border-radius: 3px;
  background: #0f2b3a;
  color: var(--ink-3);
  box-shadow: inset 0 1px 0 #06141d, 0 1px 0 #1c3a46;
}

.topbar .tb-bell:hover,
.tb-bell:hover {
  background: #0f2b3a;
  color: var(--ink);
  border-color: #315462;
}

.topbar .rail-marks .acct {
  border-radius: 3px;
}

/* ---------------------------------------------------------------- type ----- */
h1,
h2,
h3,
h4 {
  letter-spacing: -.02em;
}

.market-mast-copy h2,
.page-mast-title,
.ph-copy h1,
.desk-page .hub-title,
.card-head h2 {
  font-weight: 800;
}

/* ---------------------------------------------------------------- mast ----- */
.shell[data-screen="market"]:not(.item-view) .market-mast {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 20px;
  padding: 28px 28px 25px;
  background: linear-gradient(180deg, #06141d 0%, #081d29 100%);
  border: 2px solid #315462;
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 2px #0f2b3a,
    inset 0 0 0 3px #244755,
    0 2px 0 #315462,
    0 12px 26px rgba(0, 0, 0, .3);
}

.shell[data-screen="market"]:not(.item-view) .market-mast::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #244755;
  pointer-events: none;
}

.shell[data-screen="market"]:not(.item-view) .market-mast::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: -5px;
  height: 7px;
  background: radial-gradient(circle, #f0bd55 0 2px, transparent 2.4px) 0 50% / 15px 7px repeat-x;
  filter: drop-shadow(0 1px 0 #0f2b3a);
  pointer-events: none;
}

.shell[data-screen="market"]:not(.item-view) .market-mast > * {
  position: relative;
  z-index: 1;
}

.market-mast-copy h2 {
  color: var(--ink);
  font-size: clamp(38px, 4.8vw, 62px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.055em;
  text-shadow: 0 1px 0 #fff;
}

.market-mast-copy h2::after {
  content: ".";
  color: #e75a3f;
}

.market-lede {
  max-width: 48ch;
  margin-top: 9px;
  color: var(--ink-2);
  font-weight: 600;
}

/* --------------------------------------------------------------- ledger ---- */
.shell[data-screen="market"]:not(.item-view) .list-card {
  padding: 0;
  border: 2px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  box-shadow:
    inset 0 0 0 1px #fff,
    inset 0 0 0 2px #0f2b3a,
    0 2px 0 #1c3a46;
  overflow: hidden;
}

.shell[data-screen="market"]:not(.item-view) .board-body {
  background: #0a2230;
}

.shell[data-screen="market"]:not(.item-view) .board-body thead th {
  background: #081d29;
  border-bottom: 2px solid #244755;
  color: var(--ink-3);
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: .1em;
  box-shadow: inset 0 1px 0 #0f2b3a;
}

.shell[data-screen="market"]:not(.item-view) .board-body thead th[aria-sort] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 #f0bd55;
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody td {
  color: var(--ink-3);
  border-bottom: 1px solid #244755;
  font-family: var(--sans);
  font-weight: 600;
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody td.col-buy,
.shell[data-screen="market"]:not(.item-view) .board-body tbody td.col-sell {
  color: var(--ink);
  font-weight: 700;
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody td:is(.col-price, .col-margin) {
  color: var(--ink-2);
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody td.name {
  color: var(--ink);
}

.shell[data-screen="market"]:not(.item-view) .board-body .nm {
  font-weight: 800;
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:hover {
  background: #0a2230;
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:nth-child(1) {
  background: rgba(240, 189, 85, .2);
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:nth-child(2) {
  background: rgba(242, 234, 217, .09);
}

.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:nth-child(3) {
  background: rgba(231, 90, 63, .16);
}

/* The first three rows carry their rank in the row tint. Hover changes the
   tint across the whole row; no edge stripe is needed. */
.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:nth-child(-n+3):hover {
  background: #0f2b3a;
}

.shell[data-screen="market"]:not(.item-view) .item-cell img {
  width: 28px;
  height: 28px;
  padding: 2px;
  border: 1px solid #244755;
  border-radius: 2px;
  background: #0a2230;
}

.shell[data-screen="market"]:not(.item-view) .item-cell .f2p {
  border-color: #1c3a46;
  border-radius: 2px;
  background: #0f2b3a;
  color: var(--ink-3);
  font-weight: 800;
}

.shell[data-screen="market"]:not(.item-view) .item-cell .f2p.new {
  border-color: #315462;
  background: linear-gradient(180deg, #d9a63f, #f0bd55);
  color: var(--ink);
}

.shell[data-screen="market"]:not(.item-view) .item-cell .row-spark path {
  stroke: #7f9aa0;
}

.shell[data-screen="market"]:not(.item-view) .item-cell .row-spark.up path {
  stroke: var(--up);
}

.shell[data-screen="market"]:not(.item-view) .item-cell .row-spark.down path {
  stroke: var(--down);
}

.shell[data-screen="market"]:not(.item-view) .bar-cell .bar {
  background: #244755;
  border-radius: 0;
}

.shell[data-screen="market"]:not(.item-view) .bar-cell .bar i {
  background: #d9a63f;
  border-radius: 0;
}

.shell[data-screen="market"]:not(.item-view) .board-body td.up .mkt-delta {
  color: var(--up);
}

.shell[data-screen="market"]:not(.item-view) .board-body td.down .mkt-delta {
  color: var(--down);
}

.star {
  border-radius: 2px;
  color: var(--ink-4);
}

.star:hover {
  background: #0f2b3a;
  color: var(--ink-2);
}

.star.on {
  color: #f0bd55;
}

/* ---------------------------------------------------------------- pager ---- */
.shell[data-screen="market"]:not(.item-view) .pager {
  border-top: 1px solid #244755;
  background: #0f2b3a;
}

.shell[data-screen="market"]:not(.item-view) .pg {
  border-radius: 2px;
  font-weight: 800;
}

.shell[data-screen="market"]:not(.item-view) .pg.on {
  border-color: #315462;
  background: linear-gradient(180deg, #f0bd55, #d9a63f);
  color: var(--ink);
  box-shadow: inset 0 1px 0 #f0bd55, 0 1px 0 #315462;
}

.shell[data-screen="market"]:not(.item-view) .pg-info {
  color: var(--ink-3);
}

/* --------------------------------------------------------------- filters --- */
.shell[data-screen="market"]:not(.item-view) .filters-card {
  align-self: stretch;
  min-height: 0;
  padding: 0;
  border: 2px solid #315462;
  border-radius: 2px;
  background: linear-gradient(180deg, #0f2b3a 0%, #244755 100%);
  box-shadow:
    inset 0 0 0 2px #0f2b3a,
    inset 0 0 0 3px #244755,
    0 2px 0 #315462;
  overflow: hidden;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .facets-head {
  min-height: 0;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #244755;
}

.shell[data-screen="market"]:not(.item-view) .filters-title {
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: .02em;
}

.shell[data-screen="market"]:not(.item-view) .filters-actions .ghost {
  height: 28px;
  padding: 0 9px;
  border: 1px solid #315462;
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #1c3a46;
}

.shell[data-screen="market"]:not(.item-view) .filters-actions .ghost:hover {
  border-color: #315462;
  color: var(--ink);
}

.shell[data-screen="market"]:not(.item-view) .filters-card .facets-body {
  padding: 14px;
}

.shell[data-screen="market"]:not(.item-view) .facet-label {
  color: var(--ink-3);
  font-family: var(--sans);
  font-weight: 800;
}

.shell[data-screen="market"]:not(.item-view) .filter-search {
  border: 1px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  color: var(--ink-3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}

.shell[data-screen="market"]:not(.item-view) .filter-search:focus-within {
  border-color: #f0bd55;
  background: #0a2230;
}

.shell[data-screen="market"]:not(.item-view) .saveonly {
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  border-color: #315462;
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 800;
}

.shell[data-screen="market"]:not(.item-view) .saveonly.on {
  border-color: #315462;
  background: linear-gradient(180deg, #d9a63f, #f0bd55);
}

.shell[data-screen="market"]:not(.item-view) .scope-x {
  border-radius: 2px;
  border-color: #315462;
  background: #0a2230;
  color: var(--ink-3);
}

/* ---------------------------------------------------------- shared plates --- */
.card,
.scard {
  border: 1px solid #315462;
  border-radius: 3px;
  background: linear-gradient(180deg, #0a2230 0%, #0a2230 100%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #1c3a46;
}

.card-head h2,
.scard h2 {
  color: var(--ink);
  font-weight: 800;
}

.ghost,
.sbtn,
.btn {
  border: 1px solid #315462;
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-2);
  font-weight: 800;
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #1c3a46;
}

.ghost:hover,
.btn:hover {
  border-color: #315462;
  background: #0f2b3a;
  color: var(--ink);
}

.sbtn {
  border-color: #315462;
  background: linear-gradient(180deg, #f0bd55, #d9a63f);
  color: var(--ink);
  box-shadow: inset 0 1px 0 #f0bd55, 0 1px 0 #315462;
}

.sbtn:hover {
  border-color: #d9a63f;
  background: linear-gradient(180deg, #d9a63f, #b98d36);
  color: #071925;
}

.sbtn.danger {
  border-color: #ef8269;
  background: #2a1c1c;
  color: var(--down);
}

.link {
  color: var(--accent);
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
textarea,
select {
  border-color: #315462;
  border-radius: 2px;
  background-color: #0a2230;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}

input:focus,
textarea:focus,
select:focus {
  border-color: #f0bd55;
}

/* The pill and a calculator's input line are the field themselves. The input
   inside is their text, not a second box: the global input chrome (white fill,
   inset shadow, square corners) painted over the rounded border and read as a
   white card sticking out of it. */
.ph-search input,
.calc-input-line input {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (pointer: coarse), (max-width: 620px) {
  /* The wrapper owns the 44px tap target. The field inside has to stay within
     the border it sits in rather than growing past it on the flat 44px floor. */
  .ph-search input,
  .calc-input-line input {
    min-height: 0 !important;
    height: 100%;
  }
}

/* ---------------------------------------------------------------- popovers -- */
.suggest,
.rail-menu,
.notif-drawer,
.items-menu,
.facets.nav-dropdown,
.amodal-box,
.auth-card {
  border: 2px solid #315462;
  border-radius: 3px;
  background: linear-gradient(180deg, #0a2230 0%, #0a2230 100%);
  color: var(--ink);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .45), inset 0 1px 0 #fff;
}

.rail-menu-all {
  border-top-color: #244755;
  background: #0a2230;
  color: var(--ink-2);
}

.rail-menu-all:hover {
  background: #0a2230;
  color: var(--ink);
}

.rail-menu-item:hover,
.rail-skill:hover {
  background: #0f2b3a;
  border-color: #315462;
}

.suggest .sug-row:hover,
.items-menu .items-row:hover {
  background: #0f2b3a;
}

/* ---------------------------------------------------------------- item ----- */
.shell.item-view .workspace {
  background: transparent;
}

.shell.item-view .il-icon,
.shell.item-view .il-chart,
.shell.item-view .iv-head .ico-lg,
.shell.item-view .iv-head > img,
.shell.item-view .chart-wrap {
  border-color: #315462;
  background-color: #0a2230;
}

.shell.item-view .il-chart,
.shell.item-view .chart-wrap {
  background-image:
    linear-gradient(#0f2b3a 1px, transparent 1px),
    linear-gradient(90deg, #0f2b3a 1px, transparent 1px);
}

.shell.item-view .iv-title h2 {
  font-weight: 800;
}

.shell.item-view .iv-btn {
  border-radius: 2px;
  border-color: #315462;
  background: #0f2b3a;
  color: var(--ink-2);
  font-weight: 800;
}

.shell.item-view .iv-btn:hover {
  border-color: #315462;
  background: #0f2b3a;
  color: var(--ink);
}

/* ------------------------------------------------------------- page heads --- */
.page-mast {
  border-bottom: 2px solid #315462;
}

.page-mast-title {
  color: var(--ink);
}

.page-mast-lede,
.market-lede {
  color: var(--ink-2);
}

.page-crumb,
.page-crumb [aria-current="page"] {
  color: var(--ink-4);
}

.page-crumb a {
  color: var(--ink-3);
}

.page-crumb a:hover {
  color: var(--accent);
}

/* The Arcade page begins at the controls, not at a market mast. */
.shell[data-screen="market"]:not(.item-view) .market-mast {
  display: none;
}

/* One column: the filter shelf sits over a full-width ledger, and the board
   gets the space the old side column used to hold. */
@media (min-width: 1081px) {
  .shell[data-screen="market"]:not(.item-view) .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 0;
    row-gap: 0;
    padding-bottom: 18px;
    overflow: auto;
  }

  .shell[data-screen="market"]:not(.item-view) .col-side {
    display: contents;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    min-height: 0;
    margin: 16px 0 14px;
    padding: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .col-main {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-show {
    display: inline-flex;
    align-items: center;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card:not(.open) .facets-head {
    border-bottom: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card .facets-body {
    display: none;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facets-body {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: start;
    padding: 14px;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facet-view {
    grid-column: 1 / 4;
    padding-bottom: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-tools {
    grid-column: 4 / 7;
    padding-top: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-active {
    grid-column: 1 / -1;
    position: static;
    margin: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-catalog {
    display: contents;
    margin: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-block {
    min-width: 0;
    padding-top: 0;
    border-top: 0;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-empty {
    grid-column: 1 / -1;
    margin: 0;
  }
}

@media (min-width: 621px) and (max-width: 1080px) {
  .shell[data-screen="market"]:not(.item-view) .filters-card {
    margin-top: 14px;
  }
}

/* ---------------------------------------------------------------- phone ----- */
@media (max-width: 1080px) {
  .shell[data-screen="market"]:not(.item-view) .market-mast {
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 24px;
    padding: 22px 20px 19px;
  }

  .market-mast-copy {
    flex: 1 1 320px;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card {
    padding: 0;
    border: 2px solid #315462;
    border-radius: 2px;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card .facets-body {
    padding: 14px;
  }
}

@media (max-width: 620px) {
  .topbar {
    background: linear-gradient(180deg, #06141d, #0f2b3a);
  }

  .shell[data-screen="market"]:not(.item-view) .market-mast {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 14px;
    padding: 19px 16px 16px;
  }

  .shell[data-screen="market"]:not(.item-view) .market-mast::before {
    inset: 5px;
  }

  .market-mast-copy h2 {
    font-size: clamp(34px, 9.4vw, 42px);
  }

  .market-mast-copy h2::after {
    content: ".";
  }

  .market-lede {
    margin-top: 7px;
    font-size: var(--text-label);
    line-height: 1.4;
  }

  .shell[data-screen="market"]:not(.item-view) .list-card {
    border-width: 2px;
  }

  .shell[data-screen="market"]:not(.item-view) .board-body thead th {
    font-size: 10px;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card {
    border: 2px solid #315462;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open {
    border: 1px solid #315462;
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(180deg, #0a2230 0%, #0a2230 100%);
    box-shadow: 0 -24px 60px -34px rgba(0, 0, 0, .5);
  }
}

@media (max-width: 430px) {
  .market-mast-copy h2 {
    font-size: 34px;
  }
}

/* ---------------------------------------------------------- shell frame --- */
/* Every screen lives on the same page measure: the lab's 1280px frame with
   30px gutters. The topbar keeps the glass full-bleed; its contents, the page
   head and the workspace all end on the same two edges. The workspace's
   stable scrollbar lane is taken out of its right padding, so the board's
   content edge still meets the topbar's. */
:root {
  --frame-max: 1280px;
  --frame-pad: 30px;
}

.main {
  width: 100%;
  max-width: var(--frame-max);
  margin-inline: auto;
}

/* One page measure for every screen. The workspace is the page track; a page
   sheet fills it rather than declaring a width of its own. New screens inherit
   this rule, so they do not need a page-specific max-width. */
.workspace :is(.hub, .items-hub, .settings, .opt-mast, .opt-screen, .toolview, .dps-calc) {
  max-width: none;
  margin-inline: 0;
}

@media (min-width: 621px) {
  :root {
    --topbar-h: 72px;
  }

  #shell .topbar {
    height: var(--topbar-h);
    padding-left: max(var(--frame-pad), calc((100% - var(--frame-max)) / 2 + var(--frame-pad)));
    padding-right: max(var(--frame-pad), calc((100% - var(--frame-max)) / 2 + var(--frame-pad)));
  }

  #shell .workspace {
    padding-left: var(--frame-pad);
    padding-right: calc(var(--frame-pad) - var(--shell-gutter, 0px));
  }

  /* These screens scroll the document, not the workspace, so they reserve no
     scrollbar lane and use the whole frame edge. */
  #shell:has(.toolview) .workspace,
  #shell:has(.toolview-hub) .workspace,
  #shell.item-view .workspace {
    padding-right: var(--frame-pad);
  }

  /* The optimizer draws a 10px scrollbar of its own. */
  #shell[data-screen="optimizer"] .workspace {
    padding-left: var(--frame-pad);
    padding-right: calc(var(--frame-pad) - 10px);
  }

  #shell[data-screen] .page-head {
    padding-left: var(--frame-pad);
    padding-right: var(--frame-pad);
  }
}

@media (min-width: 621px) and (max-width: 820px) {
  :root {
    --frame-pad: 20px;
  }
}

@media (min-width: 901px) {
  .topbar {
    gap: 28px;
  }

  .topbar-brand {
    gap: 0;
  }

  .topbar-brand .brand-mark {
    display: none;
  }

  .topbar-brand .brand-word {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 23px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.055em;
  }

  .topbar-brand .brand-word::before {
    content: "OSRS";
    color: var(--accent);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .12em;
    text-transform: uppercase;
    transform: translateY(-2px);
  }

  .topbar .rail-tab {
    height: 34px;
    padding: 0 10px;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 700;
  }

  .topbar .rail-lbl {
    font-size: 13px;
    font-weight: 700;
  }

  .topbar .ph-search {
    flex: 0 0 255px;
    width: 255px;
    height: 40px;
    padding: 0 14px;
  }

  .topbar .ph-search .search-mark {
    display: none;
  }

  .topbar .ph-search input {
    font-size: 13px;
    font-weight: 500;
  }
}

@media (max-width: 620px) {
  :root {
    --frame-pad: 16px;
  }

  #shell .topbar {
    padding: 0 var(--frame-pad);
  }

  #shell .workspace {
    padding-left: var(--frame-pad);
    padding-right: calc(var(--frame-pad) - var(--shell-gutter, 0px));
  }

  #shell:has(.toolview) .workspace,
  #shell:has(.toolview-hub) .workspace,
  #shell.item-view .workspace {
    padding-right: var(--frame-pad);
  }

  #shell[data-screen="optimizer"] .workspace {
    padding-left: var(--frame-pad);
    padding-right: calc(var(--frame-pad) - 10px);
  }

  #shell .page-head {
    padding-left: var(--frame-pad);
    padding-right: var(--frame-pad);
  }
}

/* --------------------------------------------------------------- tape — item --- */
/* The production item page in Tape's architecture: one printed sheet, ruled
   bands, a six-column quote tape and a full-width plot. The live hooks are the
   app's own ids, so the quote clock patches these bands in place. */

/* The item shell flattens its wrappers so the old header, chart and reading
   sections could be laid out as separate bands. Tape is one sheet: it is put
   back as a block in the main column, and the reading rail keeps the second
   column beside it. On phones the workspace is a single column, so the sheet
   runs full width and the rail follows it. */
.shell.item-view .itemview.tape {
  display: block;
  grid-column: 1;
  grid-row: 1 / span 60;
}

@media (min-width: 1081px) {
  .shell.item-view:has(#board .itemview.tape) #board,
  .shell.item-view:has(#board .itemview.tape) .board-body {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

.itemview.tape {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}

.itemview.tape .tp-head {
  padding: 22px 24px 20px;
  background: linear-gradient(180deg, #06141d, #0f2b3a);
  border-bottom: 1px solid var(--line);
}
.tp-head-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
}
.itemview.tape .ico-lg {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  padding: 4px;
  background: linear-gradient(180deg, #0a2230, #081d29);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 2px #244755;
}
.itemview.tape .ico-lg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.tp-id { min-width: 0; }
.tp-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.itemview.tape h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(27px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
}
.itemview.tape h2:focus { outline: none; }
.tp-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  color: var(--ink-3);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}
.itemview.tape .examine { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.tp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 0; }
.itemview.tape .iv-acts { justify-content: flex-end; }
.itemview.tape .iv-btn { height: 30px; padding: 0 10px; border-radius: 2px; font-size: 11px; font-weight: 800; }
.itemview.tape .page-crumb,
.itemview.tape .page-crumb [aria-current="page"] { color: var(--ink-3); }
.itemview.tape .page-crumb .sep { color: var(--ink-3); }
.itemview.tape .page-crumb { margin-bottom: 5px; font-size: 11px; letter-spacing: .07em; }

.itemview.tape .tp-quote {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-bottom: 1px solid var(--line);
}
.itemview.tape .tp-q { min-width: 0; padding: 12px 14px 14px; background: var(--card); }
.itemview.tape .tp-q > span {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.itemview.tape .tp-q > b {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1px 6px;
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
/* The price is the reading; the change after it is the annotation. A 1b gp
   price and its percentage cannot share one 201px cell, so the change takes
   the next line rather than the last digits being cut off. */
.itemview.tape .tp-q > b > span { white-space: nowrap; }
.itemview.tape .tp-q > b.up { color: var(--up); }
.itemview.tape .tp-q > b.down { color: var(--down); }
.itemview.tape .tp-q > b .q-pct {
  margin-left: 0;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.itemview.tape .q-pct.up,
.itemview.tape .ix-change.up,
.itemview.tape .ix-perf-change.up { color: var(--up); }
.itemview.tape .q-pct.down,
.itemview.tape .ix-change.down,
.itemview.tape .ix-perf-change.down { color: var(--down); }

.itemview.tape .tp-chart.chart-wrap {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
}
.itemview.tape .chart-top {
  margin: 0;
  padding: 9px 14px;
  background: var(--card-2);
  border-bottom: 1px solid var(--line);
}
/* The plot is the item's instrument, not a strip inside the ledger: it takes
   the height the first viewport leaves under the quote, and as much width as
   the quote's own inset gives it. At 1440x900 it now runs from the toolbar to
   the fold instead of stopping 120px short. */
.itemview.tape .chart,
.itemview.tape .tp-chart.chart-wrap .chart {
  width: auto;
  height: clamp(400px, 52vh, 640px);
  min-height: 400px;
  /* The plot is the card's instrument, so it runs the card's own width: the
     toolbar above it is the only thing with an inset. The chart's own frame
     (a few units at the axis) is what keeps the newest print off the border. */
  margin: 0 0 14px;
}
.itemview.tape .ranges { border-radius: 2px; padding: 2px; }
.itemview.tape .ranges button { border-radius: 1px; }
.itemview.tape .chart-sub { margin: 0 24px 18px; }

/* The pinned toolbar needs its own band at desk widths. The band used to be
   cleared by the Market history head; with that head gone the section keeps the
   space itself, so the controls never sit over the plotted line. */
@media (min-width: 1181px) {
  .itemview.tape .tp-chart.chart-command:not(.full) {
    padding-top: 34px;
  }
  .itemview.tape .tp-chart.chart-command:not(.full) .chart {
    margin-top: 0;
  }
  .itemview.tape .tp-chart.chart-command:not(.full) .chart-top {
    top: 0;
  }
  .itemview.tape .tp-chart.chart-command:not(.full)::before {
    display: none;
  }
}

.itemview.tape .tp-perf { border-bottom: 1px solid var(--line); }

/* Related items are the ledger's footnote, not a card: one hairline, a quiet
   inline label, and the busiest siblings as plain names. The names wrap as a
   single line of prose, so the section never grows a second header row. */
.itemview.tape .tp-related {
  padding: 12px 24px 14px;
  border-top: 1px solid var(--line-soft);
}
.itemview.tape .tp-related-line {
  margin: 0;
  color: var(--ink-3);
  font-size: var(--text-label);
  line-height: 1.7;
}
.itemview.tape .tp-related-kicker {
  margin-right: 10px;
  color: var(--ink-2);
  font-weight: 500;
}
.itemview.tape .tp-related-line a {
  color: var(--ink-3);
  text-decoration: none;
}
.itemview.tape .tp-related-line a:hover,
.itemview.tape .tp-related-line a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.itemview.tape .tp-related-line .sep {
  margin: 0 8px;
  color: var(--line);
}
.itemview.tape .tp-band-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.tp-band-head h3 {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}
.tp-band-head > span { color: var(--ink-3); font-size: 11px; font-weight: 600; text-align: right; }
.itemview.tape .tp-cells {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
}
.itemview.tape .tp-cells-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.itemview.tape .tp-cells-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.itemview.tape .tp-cell { min-width: 0; padding: 9px 12px; background: var(--card); }
.itemview.tape .tp-cell > span,
.itemview.tape .tp-cell > dt {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.itemview.tape .tp-cell > b,
.itemview.tape .tp-cell > dd {
  display: block;
  margin: 3px 0 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.itemview.tape .tp-split { display: grid; grid-template-columns: minmax(0, 1fr); }
/* Performance and Live statistics are two bands of the same ledger: the head
   keeps the page inset, the cells run to the rule, and the hairlines divide
   them. Insetting only the statistics made it read as a card inside the card. */
.itemview.tape .tp-stats { min-width: 0; padding: 0; }
.itemview.tape .tp-prints {
  min-width: 0;
  padding: 16px 0 20px;
  background: var(--card-2);
  border-top: 1px solid var(--line);
}
/* The tape's words keep the panel's inset; its rules and figures run to the
   panel's edges, so the ledger is the width of the sheet it sits in. */
.itemview.tape .tp-prints > .tp-band-head { padding-inline: 24px; }
.itemview.tape .tp-print-table th:first-child,
.itemview.tape .tp-print-table td:first-child { padding-left: 24px; }
.itemview.tape .tp-print-table th:last-child,
.itemview.tape .tp-print-table td:last-child { padding-right: 24px; }
.tp-print-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--scroll) var(--field); }
.tp-print-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.itemview.tape .tp-print-table th {
  padding: 6px 8px;
  color: var(--ink-3);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
/* The board's own table rules sit closer to the cells than a bare `.tp-print-table`
   selector does, and their wrapping turned a nine-character price into an
   eight-line cell on a phone. The tape's cells are one line each; the scroll
   wrapper owns any overflow. */
.itemview.tape .tp-print-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}
.tp-print-table tbody tr:last-child td { border-bottom: 0; }
.tp-print-time time { display: block; color: var(--ink-2); font-weight: 700; }
.tp-print-time span { display: block; color: var(--ink-3); font-size: 11px; }
.tp-print-buy { color: var(--up); font-weight: 700; }
.tp-print-sell { color: var(--down); font-weight: 700; }
.tp-print-qty { color: var(--ink-3); }
.tp-print-empty { padding: 14px 8px; color: var(--ink-3); }
/* The board's phone card layout reaches every table under `.board-body`: it
   turns rows into grids, columns into labelled flex cells. The print tape is a
   real table at every width, so it opts back out. */
.itemview.tape .tp-print-table { display: table; width: 100%; }
.itemview.tape .tp-print-table thead { display: table-header-group; }
.itemview.tape .tp-print-table tbody { display: table-row-group; }
.itemview.tape .tp-print-table tr { display: table-row; }
.itemview.tape .tp-print-table th,
.itemview.tape .tp-print-table td { display: table-cell; }
.itemview.tape .tp-print-table td::before,
.itemview.tape .tp-print-table td::after { content: none; display: none; }
.tp-th-short { display: none; }

@media (max-width: 960px) {
  .itemview.tape .tp-quote { grid-template-columns: 1fr 1fr; }
  .tp-head-top { grid-template-columns: auto minmax(0, 1fr); }
  .tp-side { grid-column: 1 / -1; align-items: flex-start; }
  .itemview.tape .iv-acts { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .itemview.tape .tp-head { padding: 16px 16px 14px; }
  .itemview.tape .iv-btn { height: 44px; min-height: 44px; }
  .itemview.tape .ranges button { min-height: 44px; }
  .itemview.tape .tp-head-top { gap: 14px; }
  .itemview.tape .ico-lg { width: 56px; height: 56px; }
  .itemview.tape .tp-band-head { padding: 12px 16px 8px; }
  .itemview.tape .tp-prints { padding: 14px 16px 16px; }
  .itemview.tape .tp-cells-5,
  .itemview.tape .tp-cells-4 { grid-template-columns: 1fr 1fr; }
  .itemview.tape .tp-cells-5 > .tp-cell:last-child { grid-column: 1 / -1; }
  .tp-th-long { display: none; }
  .tp-th-short { display: inline; }
}

@media (max-width: 520px) {
  .itemview.tape .tp-quote { grid-template-columns: 1fr 1fr; }
  .itemview.tape h2 { font-size: 26px; }
  .itemview.tape .tp-print-table th { padding: 5px 6px; font-size: 11px; }
  .itemview.tape .tp-print-table td { padding: 5px 6px; font-size: 11px; }
  .itemview.tape .tp-q { padding: 10px 12px 12px; }
  .itemview.tape .tp-q > b { font-size: 18px; }
  .itemview.tape .tp-cell { padding: 8px 10px; }
}

/* ------------------------------------------------------- tape — reading rail --- */
/* The rail is the page's second sheet: two ruled panels on the same paper as
   the tape, with the calculator as a receipt and the two readings as bands. The
   item shell flattens the rail, so every frame here is scoped to the Tape page
   and restored as a block in the second column. */
.shell.item-view:has(#board .itemview.tape) .reading-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
  align-self: start;
  margin: 0;
  padding: 0;
  border: 0;
}
/* The rail is the record's second column, so its two panels stack in the
   ticket's own width rather than reading as a band under the ledger. */
@media (min-width: 1181px) {
  .shell.item-view:has(#board .itemview.tape) .reading-rail {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .ix-section {
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .ix-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 10px 14px 8px;
  background: linear-gradient(180deg, #06141d, #0f2b3a);
  border-bottom: 1px solid var(--line);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .ix-section-head h2 {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .ix-sec-meta {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* The calculator is a ticket: prices on two plates, then the two fields, then
   the receipt. Its frame is the panel; nothing inside it is a second card. */
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-card,
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-body {
  padding: 0;
  border: 0;
  background: transparent;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-body {
  padding: 12px 14px 14px;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-body .tool { gap: 10px; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-note {
  margin: 0;
  color: var(--down);
  font-size: 11px;
  line-height: 1.4;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate {
  min-height: 62px;
  padding: 9px 12px 10px;
  border: 0;
  border-radius: 0;
  background: var(--card);
  text-align: left;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate + .calc-plate {
  border-left: 1px solid var(--line);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate:hover,
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate.on { background: var(--field); }
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: -2px;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate span {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate.on span { color: var(--ink-2); }
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate.buy.on span { color: var(--up); }
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate.sell.on span { color: var(--down); }
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate .amt { justify-content: flex-start; gap: 3px; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate .amt b {
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plate em {
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-field {
  gap: 6px;
  padding: 10px 0 0;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-field + .calc-field {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-field label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-head { gap: 8px; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .suggest-chip {
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--field);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .suggest-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-field .numbox {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .numbox button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--card-2);
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .numbox button:last-child {
  border-right: 0;
  border-left: 1px solid var(--line);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .numbox button:hover {
  color: var(--ink);
  background: var(--field);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-field input.num {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-field input.num:focus {
  outline: 2px solid var(--accent-line);
  outline-offset: -2px;
}

.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-out {
  margin-top: 12px;
  padding-top: 0;
  border-top: 1px solid var(--line);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-out > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 12px;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-out b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-basis {
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.4;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-out .hero {
  margin-top: 2px;
  padding: 9px 0 1px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
/* The answer's rule is the hero's own top edge. The row above it closed with a
   hairline of its own, two pixels up, which read as a doubled line. */
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-out > :has(+ .hero) {
  border-bottom: 0;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-out .hero > span {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-out .hero b {
  font-size: 22px;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  margin: 10px 0 0;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--field);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plan:hover { background: var(--field-2); }

/* Pressure and fill are two ruled bands inside the readings panel, not two
   cards: a hairline separates them. */
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-grid {
  display: block;
  max-width: none;
  margin: 0;
  row-gap: 0;
}
#item-readings-grid[hidden],
#item-readings-gate[hidden] { display: none !important; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-grid > .reading-band {
  display: block;
  margin: 0;
  padding: 14px 14px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-grid > .reading-band + .reading-band {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  background: transparent;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-gate {
  padding: 14px 14px 16px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-gate p {
  max-width: 38ch;
  margin: 0;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-gate-btn {
  min-height: 34px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--field);
  color: var(--ink);
  font: 800 11px/1 var(--sans);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-gate-btn:hover {
  background: var(--field-2);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-grid .card-head { margin: 0 0 10px; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .reading-grid .card-head h3 {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-hero { display: block; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-kicker {
  display: block;
  margin: 0 0 5px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-lead {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-lead b {
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-lead b i {
  margin-left: 1px;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-lead span {
  color: var(--ink-3);
  font-size: 12px;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-tape {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-tick {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 1px 1px 0 0;
  background: var(--line);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-tick.up { background: var(--up); }
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-tick.down { background: var(--down); }
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-ledger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line-soft);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-ledger span { padding: 0; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-ledger span + span { text-align: right; }
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-ledger em {
  display: block;
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-ledger b {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-badge {
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-top-copy {
  max-width: none;
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.4;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 12px;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-row b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-row-last {
  padding-bottom: 0;
  border-bottom: 0;
}
.shell.item-view:has(#board .itemview.tape) .reading-rail .press-empty,
.shell.item-view:has(#board .itemview.tape) .reading-rail .fill-empty {
  margin: 0;
  padding: 14px 0 2px;
  border: 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}

/* The print tape's columns are numbers: their heads sit on the same right edge
   as the figures below them. The time column is the one piece of prose. */
.itemview.tape .tp-print-table th { text-align: right; }
.itemview.tape .tp-print-table th:first-child { text-align: left; }
.itemview.tape .tp-print-table td { text-align: right; }
.itemview.tape .tp-print-table td:first-child { text-align: left; }

@media (max-width: 720px) {
  .shell.item-view:has(#board .itemview.tape) .reading-rail .calc-plan { height: 44px; }
  .shell.item-view:has(#board .itemview.tape) .reading-rail .reading-gate-btn { min-height: 44px; }
}

/* ------------------------------------------------ tools — the printed sheet --- */
/* Every calculator is now the same object as the Tape item sheet: one paper
   frame with a brass top rule, a ruled masthead, a ticket rail for the inputs,
   and a receipt of ruled facts and ledger rows on the answer side. The skin is
   scoped to the tools screen so the market board, the item page and the flip
   optimizer keep their own furniture. */

/* The calculator sheet is the page's own card, not a second frame a pixel
   inside it. Both used to be drawn - the card's 1px frame and then this block's
   1px frame with a brass top just under it - so every edge of a calculator read
   as two rules, and the top as a hairline above the brass. The brass and the
   frame are the card's now, as they are on lists, flips and alerts; the block
   nested in it draws neither and lets the paper through. */
.shell[data-screen="tools"] .list-card:has(#board > .toolview) {
  border-top: 2px solid var(--line-strong);
}
.shell[data-screen="tools"] #board > .toolview,
.shell[data-screen="tools"] #board > .toolview-calc,
.shell[data-screen="tools"] #board > .toolview-hub {
  background: transparent;
  border: 0;
  border-radius: 0;
}
/* The ledger closes on the sheet's own frame. Its last row used to draw a rule
   twenty to thirty pixels above the frame with nothing between them, which on a
   phone read as a band of empty paper ruled off inside the sheet; the row ends
   without one and the frame is what closes the list. */
.shell[data-screen="tools"] .skill-table tbody tr:last-child,
.shell[data-screen="tools"] .skill-table tbody tr:last-child > td {
  border-bottom: 0;
}
/* The desk draws its row rules from rules steep in ids, so the closing row's
   cancelling rule has to name the same table to be the one that lands. */
#shell[data-screen="tools"] #board .toolview.calcview #skill-methods-table tbody tr.skill-row:last-child > td {
  border-bottom: 0;
}
.shell[data-screen="tools"] #board > .toolview-calc { overflow: hidden; }

/* The masthead is the sheet's printed head: warm paper, one rule underneath,
   a breadcrumb small enough to sit above the title instead of compete. */
.shell[data-screen="tools"] .toolview > .page-mast {
  margin: 0;
  padding: 18px 24px 16px;
  background: linear-gradient(180deg, #06141d, #0f2b3a);
  border-bottom: 1px solid var(--line);
}
.shell[data-screen="tools"] .toolview > .page-mast .page-crumb {
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.shell[data-screen="tools"] .toolview > .page-mast .page-mast-title {
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}
.shell[data-screen="tools"] .toolview > .page-mast .page-mast-lede {
  max-width: 78ch;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}

/* One inner gutter for the whole sheet; the tool columns already own their
   internal padding, so the sheet edge and the masthead share the same lane. */
@media (min-width: 761px) {
  .shell[data-screen="tools"] .toolview > .calc-desk,
  .shell[data-screen="tools"] .toolview > .dps-workbench {
    padding-left: 24px;
    padding-right: 24px;
  }
  /* The bottom gutter sat under the tinted rail, so every calculator ended in
     a strip of bare card below the controls. The columns run to the edge. */
  .shell[data-screen="tools"] .toolview > .calc-desk { padding-bottom: 0; }
  .shell[data-screen="tools"] .toolview > .bench-body {
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 20px;
  }
}

@media (max-width: 760px) {
  .shell[data-screen="tools"] .toolview > .page-mast { padding: 14px 16px 13px; }
  /* As on a desk, the columns run to the frame: the phone sheet used to keep a
     14px gutter under a ledger whose last row already ends in its own space, so
     the frame sat 35px below the last line with nothing to close. */
  .shell[data-screen="tools"] .toolview > .calc-desk { padding: 0; }
  .shell[data-screen="tools"] .toolview > .dps-workbench { padding: 0 0 14px; }
  .shell[data-screen="tools"] .toolview > .bench-body { padding: 0 16px 16px; }
}

/* ------------------------------------------------------------- ticket rail --- */
/* The control strip is a paper band, not the page's own background showing
   through. On a two-column calculator it becomes the ticket rail: a tinted
   column closed by one rule where the receipt begins. */
.shell[data-screen="tools"] .toolview .calc-bar {
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}
@media (min-width: 901px) {
  .shell[data-screen="tools"] .skillview:not(.toolboxview-band) .skill-desk > .calc-bar,
  .shell[data-screen="tools"] .combatview .combat-desk > .calc-bar,
  .shell[data-screen="tools"] .taxview .tax-desk > .calc-bar {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
}

.shell[data-screen="tools"] .toolview .dps-target-form {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

/* Fields are tickets: a bordered paper box with the brass focus ring, not a
   bare underline. The item calculator's number box is the reference. */
.shell[data-screen="tools"] .toolview.calcview .calc-input-line {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
.shell[data-screen="tools"] .toolview.calcview .calc-input-line:focus-within {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .18),
    0 0 0 2px var(--accent-soft);
}
.shell[data-screen="tools"] .toolview.calcview .calc-input-line input {
  height: 38px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
/* The ticket's own press is the same paper box as the field beside it: the
   hiscores row then reads as one control instead of a native button dropped
   into a ruled form. */
.shell[data-screen="tools"] .toolview.calcview .calc-mini {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
  font: 700 13px/1 var(--sans);
  letter-spacing: 0;
}
.shell[data-screen="tools"] .toolview.calcview .calc-mini:hover {
  border-color: var(--line-strong);
  background: var(--card-2);
  color: var(--ink);
}
.shell[data-screen="tools"] .toolview .dps-form input,
.shell[data-screen="tools"] .toolview .dps-form select {
  border-color: var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}

/* Functional labels stay at the 11px floor and speak in the sheet's tracked
   caps, so a field, a fact and a ledger head read as one taxonomy. */
.shell[data-screen="tools"] #board .toolview :is(
  .calc-group-label,
  .calc-input-label,
  .calc-field label,
  .calc-hero-label,
  .calc-facts dt,
  .tool-field-head label,
  .tool-field-label
) {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="tools"] #board .toolview :is(.calc-tape, .alch-rune) {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--field);
}
.shell[data-screen="tools"] #board .toolview :is(.calc-tape-label, .alch-rune-label, .alch-field-label) {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="tools"] #board .toolview :is(.calc-tape-copy b, .alch-rune-copy b) {
  font-weight: 800;
}

/* Golden action, quietly embossed: the same plate the app's primary buttons
   already use, squared to the sheet. */
.shell[data-screen="tools"] #board .toolview :is(
  .calc-submit,
  .calc-run,
  .tool-run,
  .bf-plan,
  .plan-action
) {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: linear-gradient(180deg, #f0bd55, #d9a63f);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #f0bd55, 0 1px 0 #315462;
}
.shell[data-screen="tools"] #board .toolview :is(
  .calc-submit,
  .calc-run,
  .tool-run,
  .bf-plan,
  .plan-action
):hover {
  border-color: #d9a63f;
  background: linear-gradient(180deg, #d9a63f, #b98d36);
  color: #071925;
}
.shell[data-screen="tools"] #board .toolview :is(
  .calc-submit,
  .calc-run,
  .tool-run,
  .bf-plan,
  .plan-action
):disabled {
  opacity: .55;
  cursor: not-allowed;
}
.shell[data-screen="tools"] .toolview .calc-reset {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #1c3a46;
}
.shell[data-screen="tools"] .toolview .calc-reset:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ---------------------------------------------------------- receipt answer --- */
/* The answer is a receipt, not a card: a tracked head, a large tabular figure,
   then facts and ledger rows divided by hairlines. */
.shell[data-screen="tools"] #board .toolview :is(
  .calc-read-head,
  .skill-ledger-head,
  .plan-ledger-head,
  .cru-plan-head
) {
  border-bottom: 1px solid var(--line);
}
.shell[data-screen="tools"] #board .toolview :is(
  .calc-read-head h2,
  .calc-read-head h3,
  .skill-ledger-head h2,
  .skill-ledger-head h3,
  .plan-ledger-head h2,
  .plan-ledger-head h3,
  .cru-plan-head h3,
  .cru-top .cru-kicker,
  .dps-readout h2
) {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="tools"] .toolview .cru-plan-head {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
}
.shell[data-screen="tools"] #board .toolview :is(.calc-hero b, .cru .combat-level, .bf-goal-figure b) {
  font-weight: 800;
  letter-spacing: -.035em;
}
.shell[data-screen="tools"] .toolview .calc-facts dd {
  color: var(--ink);
  font-weight: 800;
}

/* Ledgers: a paper header band, hairline rows, tabular figures. Headers keep
   each table's own alignment; only the material changes. */
.shell[data-screen="tools"] #board .toolview .calc-reading table:not(.dps-result-table) th,
.shell[data-screen="tools"] #board .toolview .alch-table thead th,
.shell[data-screen="tools"] #board .toolview .plan-table th {
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="tools"] #board .toolview .calc-reading table:not(.dps-result-table) td,
.shell[data-screen="tools"] #board .toolview .alch-scroll .alch-table tbody td {
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
}
.shell[data-screen="tools"] #board .toolview .calc-reading table:not(.dps-result-table) tbody tr:hover td,
.shell[data-screen="tools"] .toolview .alch-table tbody tr:hover {
  background: var(--field);
}
.shell[data-screen="tools"] .toolview .alch-filters {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

/* DPS keeps its three-column bench, but the readout becomes the receipt band
   and its labels join the sheet's taxonomy. */
.shell[data-screen="tools"] .toolview .dps-readout {
  padding: 18px 20px 20px;
  border-left: 1px solid var(--line);
  background: var(--card-2);
}
.shell[data-screen="tools"] #board .toolview .dps-result-table th {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="tools"] #board .toolview .dps-result-table td {
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
.shell[data-screen="tools"] .toolview .dps-tab {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .shell[data-screen="tools"] .toolview .dps-readout {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* --------------------------------------------------------------- tools hub --- */
/* The index is the bench on the same sheet: tracked caps over each bay, the
   tool rows as ledger lines, and squared brass plates for the icons. */
.shell[data-screen="tools"] .toolview-hub .bench-group-head h3 {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="tools"] .toolview-hub .bench-tool {
  border-top: 1px solid var(--line-soft);
}
.shell[data-screen="tools"] .toolview-hub .bench-tool:hover {
  border-color: var(--line);
  background: var(--field);
}
.shell[data-screen="tools"] .toolview-hub :is(.bench-tool-icon, .bench-plan-icon) {
  border-color: var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #081d29);
  color: var(--ink-3);
  box-shadow: inset 0 1px 0 #fff;
}
.shell[data-screen="tools"] .toolview-hub .bench-plan {
  border-top: 1px solid var(--line);
}
.shell[data-screen="tools"] .toolview-hub .bench-plan-copy small,
.shell[data-screen="tools"] .toolview-hub .bench-group-note {
  color: var(--ink-4);
  font-size: 12px;
}

/* Phones keep the 44px press targets the rest of the app uses. */
@media (max-width: 760px) {
  .shell[data-screen="tools"] #board .toolview :is(
    .calc-submit,
    .calc-run,
    .tool-run,
    .bf-plan,
    .plan-action
  ) {
    min-height: 44px;
  }
  .shell[data-screen="tools"] .toolview.calcview .calc-input-line { height: 44px; }
  .shell[data-screen="tools"] .toolview.calcview .calc-input-line input { height: 42px; }
  .shell[data-screen="tools"] .toolview.calcview .calc-mini { height: 44px; }
}

/* The alchemy finder's min-price and search fields are tickets too. */
.shell[data-screen="tools"] .toolview .alch-field {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
.shell[data-screen="tools"] .toolview .alch-field:focus-within {
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .18),
    0 0 0 2px var(--accent-soft);
}

@media (max-width: 760px) {
  .shell[data-screen="tools"] .toolview .alch-field { height: 44px; }
  .shell[data-screen="tools"] .toolview .alch-search button { width: 40px; height: 40px; }
}

/* ---------------------------------------------- settings — the account sheet --- */
/* My Account is the same printed object as the calculators: one paper frame
   with a brass top rule, a ruled masthead and an index rail. The account's
   sections stay a register rather than becoming cards, so the rules and the
   type carry the grouping. */

.shell[data-screen="settings"] #board > .settings.account {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 2px;
}

/* The masthead is the sheet's printed head: warm paper, one rule underneath,
   the account's name at the size of a title, and the deed beside it. It is the
   same masthead Alerts and Lists print - paper, never the navy band this sheet
   wore before the site moved to paper. */
.shell[data-screen="settings"] #board .settings.account .set-head.mast {
  margin: 0;
  padding: 18px 24px 16px;
  background: none;
  border-bottom: 1px solid var(--line);
}
.shell[data-screen="settings"] #board .settings.account .set-head h2 {
  color: var(--ink);
  font-family: var(--display);
  font-size: var(--text-title);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.03;
}
.shell[data-screen="settings"] #board .settings.account .set-who {
  max-width: 78ch;
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.shell[data-screen="settings"] #board .settings.account .set-who b {
  color: var(--ink-2);
  font-weight: 800;
}
.shell[data-screen="settings"] #board .settings.account .set-head-actions { padding-bottom: 0; }

/* One inner gutter for the whole sheet; the rules stop at the gutter rather
   than running into the frame. */
.shell[data-screen="settings"] #board .settings.account .set-sheet {
  column-gap: clamp(32px, 4vw, 56px);
  padding: 0 24px 30px;
}

/* The index is a rail of ruled entries, not a second menu. */
.shell[data-screen="settings"] #board .settings.account .set-nav {
  gap: 0;
  padding-top: 28px;
}
.shell[data-screen="settings"] #board .settings.account .set-nav a {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1.3;
  text-transform: uppercase;
}
.shell[data-screen="settings"] #board .settings.account .set-nav a:first-child {
  border-top: 1px solid var(--line-soft);
}
.shell[data-screen="settings"] #board .settings.account .set-nav a:hover {
  border-bottom-color: var(--line);
  background: var(--field);
  color: var(--ink);
}

/* Sections remain rules on the sheet. */
.shell[data-screen="settings"] #board .settings.account .scard {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.shell[data-screen="settings"] #board .settings.account .acct-main > .scard:first-child {
  padding-top: 30px;
  border-top: 0;
}
.shell[data-screen="settings"] #board .settings.account .scard h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.shell[data-screen="settings"] #board .settings.account .scard p,
.shell[data-screen="settings"] #board .settings.account .sub {
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Fields are tickets: a bordered paper box with the brass focus ring, not a
   bare underline. */
.shell[data-screen="settings"] #board .settings.account .passform {
  gap: 16px;
}
.shell[data-screen="settings"] #board .settings.account .passform label {
  gap: 6px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="settings"] #board .settings.account .passform label b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}
.shell[data-screen="settings"] #board .settings.account .passform input,
.shell[data-screen="settings"] #board .settings.account .acfg-row input.num {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  box-shadow: none;
  transition: border-color var(--t-quick) var(--ease),
    box-shadow var(--t-quick) var(--ease);
}
.shell[data-screen="settings"] #board .settings.account .passform input:hover,
.shell[data-screen="settings"] #board .settings.account .acfg-row input.num:hover {
  border-color: var(--line-strong);
}
.shell[data-screen="settings"] #board .settings.account .passform input:focus,
.shell[data-screen="settings"] #board .settings.account .passform input:focus-visible,
.shell[data-screen="settings"] #board .settings.account .acfg-row input.num:focus,
.shell[data-screen="settings"] #board .settings.account .acfg-row input.num:focus-visible {
  border-color: var(--line-strong);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.shell[data-screen="settings"] #board .settings.account .passform input::placeholder,
.shell[data-screen="settings"] #board .settings.account .acfg-row input.num::placeholder {
  color: var(--ink-4);
  opacity: 1;
}

/* Actions: the brass plate for a form's deed, paper for the quiet ways out. */
.shell[data-screen="settings"] #board .settings.account .sbtn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: linear-gradient(180deg, #f0bd55, #d9a63f);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  /* The ink plate the rest of the paper theme gives a form's deed: flat, with
     no brass edge line left from the navy sheet. */
  box-shadow: none;
}
.shell[data-screen="settings"] #board .settings.account .sbtn:hover {
  border-color: #000;
  background: #000;
  color: var(--bg-2);
}
.shell[data-screen="settings"] #board .settings.account .sbtn:disabled {
  cursor: default;
  opacity: .55;
}
.shell[data-screen="settings"] #board .settings.account .set-head .sbtn {
  background: var(--ink);
  color: var(--bg-2);
  box-shadow: none;
}
.shell[data-screen="settings"] #board .settings.account .set-head .sbtn:hover {
  border-color: #000;
  background: #000;
  color: var(--bg-2);
}
.shell[data-screen="settings"] #board .settings.account .ghost {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: none;
}
.shell[data-screen="settings"] #board .settings.account .ghost:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}
.shell[data-screen="settings"] #board .settings.account .sbtn.danger {
  border-color: var(--down);
  background: transparent;
  color: var(--down);
  box-shadow: none;
}
.shell[data-screen="settings"] #board .settings.account .sbtn.danger:hover {
  border-color: var(--down);
  background: rgba(239, 130, 105, .1);
  color: var(--down);
}

/* The alert destinations read as a ruled register with boxed fields. */
.shell[data-screen="settings"] #board .settings.account .acfg-head { margin-bottom: 14px; }
.shell[data-screen="settings"] #board .settings.account .acfg-power {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.shell[data-screen="settings"] #board .settings.account .acfg-rows {
  border-top: 1px solid var(--line);
}
.shell[data-screen="settings"] #board .settings.account .acfg-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.shell[data-screen="settings"] #board .settings.account .acfg-name {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
}
.shell[data-screen="settings"] #board .settings.account .acfg-state {
  color: var(--ink-3);
  font-size: 12px;
}
.shell[data-screen="settings"] #board .settings.account .acfg-row input.num {
  height: 36px;
  padding: 0 10px;
  font-size: 12.5px;
}
.shell[data-screen="settings"] #board .settings.account .alertfoot { padding: 16px 0 0; }
.shell[data-screen="settings"] #board .settings.account .acct-alert .alertfoot {
  padding-right: 0;
  border-top: 1px solid var(--line);
}

/* The statement line, when an old subscription is still on the account. */
.shell[data-screen="settings"] #board .settings.account .facts > div {
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}
.shell[data-screen="settings"] #board .settings.account .facts dt {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.shell[data-screen="settings"] #board .settings.account .facts dd {
  font-size: 15px;
  font-weight: 800;
}

/* The way out stays a closing rule, with the same section head as the rest. */
.shell[data-screen="settings"] #board .settings.account .scard.danger-fold > summary {
  padding: 24px 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.shell[data-screen="settings"] #board .settings.account .scard.danger-fold > summary::after {
  color: var(--ink-3);
  font-size: 18px;
}
.shell[data-screen="settings"] #board .settings.account .danger-body { padding: 18px 0 26px; }

/* The Discord dialog belongs to this sheet too: square corners, a brass top
   rule and the same paper controls. */
.shell[data-screen="settings"] #dc-modal .dc-box {
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 2px;
  background: var(--card);
}
.shell[data-screen="settings"] #dc-modal .dc-head h3 {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.shell[data-screen="settings"] #dc-modal .dc-mark {
  border-radius: 2px;
  background: var(--card);
}
.shell[data-screen="settings"] #dc-modal .dc-foot {
  border-top: 1px solid var(--line);
}
.shell[data-screen="settings"] #dc-modal .sbtn {
  height: 34px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .shell[data-screen="settings"] #board .settings.account .set-nav {
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--line);
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a {
    padding: 13px 14px 11px;
    border-top: 0;
    border-right: 1px solid var(--line-soft);
    border-bottom: 0;
    white-space: nowrap;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a:first-child {
    padding-left: 0;
    border-top: 0;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a:last-child {
    border-right: 0;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a:hover {
    background: var(--field);
  }
}

@media (max-width: 760px) {
  .shell[data-screen="settings"] #board .settings.account .set-head.mast {
    padding: 14px 16px 13px;
    gap: 14px;
  }
  .shell[data-screen="settings"] #board .settings.account .set-sheet {
    padding: 0 16px 22px;
  }
  .shell[data-screen="settings"] #board .settings.account .passform input,
  .shell[data-screen="settings"] #board .settings.account .acfg-row input.num {
    height: 44px;
    font-size: 16px;
  }
  .shell[data-screen="settings"] #board .settings.account .sbtn {
    height: 44px;
    min-height: 44px;
  }
  .shell[data-screen="settings"] #board .settings.account .ghost {
    height: 34px;
    min-height: 34px;
  }
  /* The identity is not a page lede: the shared phone rule would hide it. */
  .shell[data-screen="settings"] #board .settings.account .set-who { display: block; }
  .shell[data-screen="settings"] #board .settings.account .scard h3,
  .shell[data-screen="settings"] #board .settings.account .scard.danger-fold > summary {
    font-size: 18px;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a {
    font-size: 10.5px;
    padding: 12px 12px 10px;
  }
}

@media (max-width: 620px) {
  .shell[data-screen="settings"] #board > .settings.account {
    margin-bottom: 84px;
  }
  .shell[data-screen="settings"] #board .settings.account .set-head-actions {
    justify-content: flex-start;
  }
  .shell[data-screen="settings"] #board .settings.account .acfg-row,
  .shell[data-screen="settings"] #board .settings.account .acfg-row:not(.acfg-field),
  .shell[data-screen="settings"] #board .settings.account .acfg-row.acfg-field {
    grid-template-columns: 7px minmax(0, 1fr) auto;
    padding: 12px 0;
  }
  .shell[data-screen="settings"] #board .settings.account .acfg-row input.num {
    height: 40px;
    font-size: 16px;
  }
  .shell[data-screen="settings"] #board .settings.account .acfg-row .ghost {
    height: 32px;
    min-height: 32px;
  }
}

/* At the narrowest phones the four section names no longer fit on one line;
   the index becomes a two-column block rather than a clipped horizontal
   scroller. */
@media (max-width: 460px) {
  .shell[data-screen="settings"] #board .settings.account .set-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: visible;
    border-bottom: 0;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a {
    padding: 11px 10px;
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    font-size: 11px;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a:first-child {
    padding-left: 0;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a:nth-child(2n) {
    border-right: 0;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  .shell[data-screen="settings"] #board .settings.account .set-nav a:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 0;
  }
}

/* --------------------------------- lists, alerts, flips — three registers --- */
/* The three account desks are the same printed object as the calculators and
   the account sheet: one paper frame with a brass top rule, a tinted masthead
   and ruled registers under it. The frame is shared; each screen keeps its own
   instrument below. */

/* The card around these pages is the sheet: it carries the frame and the brass
   top rule, as it does on the guides hub. Framing the desk inside it as well
   drew every edge twice, the brass rule a pixel under the card's hairline. */
.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .card.list-card:has(> #board > .hub.desk-page) {
  border-top: 2px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}
.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  #board > .hub.desk-page {
  width: 100%;
  max-width: none;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* The masthead is the sheet's printed head: warm paper, the page's name at the
   size of a title, one plain reading, and its deed beside it. */
.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page > .page-mast.desk-head {
  margin: 0;
  padding: 18px 24px 16px;
  background: linear-gradient(180deg, #06141d, #0f2b3a);
  border-bottom: 1px solid var(--line);
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page > .page-mast .page-mast-title {
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page > .page-mast .page-mast-lede {
  max-width: 78ch;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.45;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page .desk-actions .sbtn,
.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page .desk-actions .ghost {
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page .desk-actions .sbtn {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #f0bd55, #d9a63f);
  color: var(--ink);
  box-shadow: inset 0 1px 0 #f0bd55, 0 1px 0 #315462;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page .desk-actions .sbtn:hover {
  border-color: #d9a63f;
  background: linear-gradient(180deg, #d9a63f, #b98d36);
  color: #071925;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page .desk-actions .ghost {
  border-color: var(--line);
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-3);
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 #1c3a46;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page .desk-actions .ghost:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page .desk-meta {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.4;
}

/* An empty state is a printed note on the same sheet, not a floating card. */
.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page :is(.apanel-empty, .flip-empty) {
  gap: 7px;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page :is(.ae-title, .flip-empty > b) {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page :is(.ae-sub, .flip-empty p) {
  max-width: 54ch;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.55;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page :is(.apanel-empty, .flip-empty) .abtn {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #fff;
}

.shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
  .hub.desk-page :is(.apanel-empty, .flip-empty) .abtn:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}

/* ------------------------------------------------------------- lists ------ */
/* An index, a quote ledger and the market read: three ruled columns on one
   sheet, with the index entries quiet until the list on the glass. */
.shell[data-screen="lists"] .lists-rail {
  padding: 18px 16px 16px 24px;
}

.shell[data-screen="lists"] .lists-cap {
  margin: 0 0 10px;
  padding: 0 5px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.shell[data-screen="lists"] .lists-cap span:last-child {
  color: var(--ink-3);
}

.shell[data-screen="lists"] .list-pick {
  min-height: 42px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  color: var(--ink-2);
}

.shell[data-screen="lists"] .list-pick:hover {
  background: var(--field);
  color: var(--ink);
}

.shell[data-screen="lists"] .list-pick[aria-current="true"] {
  border-bottom-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--ink);
}

.shell[data-screen="lists"] .list-pick .lamp {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  border-radius: 0;
  background: var(--line-strong);
}

.shell[data-screen="lists"] .list-pick[aria-current="true"] .lamp {
  background: var(--accent);
}

.shell[data-screen="lists"] .list-pick .nm {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
}

.shell[data-screen="lists"] .list-pick .n {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
}

.shell[data-screen="lists"] :is(.lists-none, .lists-kept) {
  color: var(--ink-4);
  font-size: 11.5px;
  line-height: 1.5;
}

.shell[data-screen="lists"] .lists-ledger {
  padding: 17px 24px 0;
}

.shell[data-screen="lists"] .ledger-head {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.shell[data-screen="lists"] .ledger-head h2 {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.shell[data-screen="lists"] .sheet-sub {
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.shell[data-screen="lists"] .ledger-head .ghost {
  height: 32px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #fff;
}

.shell[data-screen="lists"] .ledger-head .ghost:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}

.shell[data-screen="lists"] .lists-body {
  min-height: 300px;
}

/* On the desk, the page is one fixed register: the sheet fills the window and
   the selected list is the only scrollport. The masthead, the index and the
   read stay put; the list's ruler sticks while its rows move. */
@media (min-width: 1121px) {
  .shell[data-screen="lists"] .workspace {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
  }
  .shell[data-screen="lists"] .col-main {
    flex: 1 1 auto;
    min-height: 0;
  }
  .shell[data-screen="lists"] .col-main > .list-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  .shell[data-screen="lists"] #board {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .shell[data-screen="lists"] #board > .hub.desk-page {
    flex: 1 1 auto;
    min-height: 0;
  }
  .shell[data-screen="lists"] .lists-work {
    flex: 1 1 auto;
    min-height: 0;
  }
  .shell[data-screen="lists"] .lists-ledger {
    min-height: 0;
  }
  .shell[data-screen="lists"] .lists-ledger .lists-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .shell[data-screen="lists"] .lists-body .lhead {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}

.shell[data-screen="lists"] .lhead {
  height: 36px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  line-height: 1.2;
}

.shell[data-screen="lists"] .lline {
  min-height: 42px;
  border-bottom: 1px solid var(--line-soft);
}

.shell[data-screen="lists"] .lline:hover {
  background: var(--field);
  box-shadow: none;
}

.shell[data-screen="lists"] .litem .lico {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card-2);
}

.shell[data-screen="lists"] .litem .lico img {
  width: 24px;
  height: 24px;
}

.shell[data-screen="lists"] .litem b {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
}

.shell[data-screen="lists"] .litem .f2p {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}

.shell[data-screen="lists"] :is(.llast, .lchg) {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
}

.shell[data-screen="lists"] .lists-readout {
  padding: 17px 24px 20px;
  background: var(--card-2);
}

.shell[data-screen="lists"] .readout-head {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .09em;
  line-height: 1.2;
}

.shell[data-screen="lists"] .readout-head span:last-child {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
}

.shell[data-screen="lists"] .readout-label {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .07em;
}

.shell[data-screen="lists"] .readout-avg span {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
}

.shell[data-screen="lists"] .readout-avg b {
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.shell[data-screen="lists"] .readout-name {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

.shell[data-screen="lists"] .readout-mover b {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
}

.shell[data-screen="lists"] .readout-breadth-head,
.shell[data-screen="lists"] .breadth-key {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
}

.shell[data-screen="lists"] .breadth-bar {
  height: 6px;
  background: var(--field);
}

.shell[data-screen="lists"] .readout-note {
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.5;
}

/* ------------------------------------------------------------ alerts ------ */
/* The console is a signal register and its record: a ruled column of lines,
   and the log beside it on a tinted band. */
.shell[data-screen="alerts"] .alerts-rules {
  border-right: 1px solid var(--line);
}

.shell[data-screen="alerts"] .alerts-console {
  border-bottom: 1px solid var(--line);
}
/* The console is the sheet's last block, so its closing rule landed a pixel
   inside the sheet's own frame on a desk and a line above its foot on a phone. */
.shell[data-screen="alerts"] .desk-page > .alerts-console:last-child {
  border-bottom: 0;
}

.shell[data-screen="alerts"] .alerts-console .panel-head {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.shell[data-screen="alerts"] .alerts-console .panel-head h3 {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.shell[data-screen="alerts"] .alerts-console .panel-head .n,
.shell[data-screen="alerts"] .alerts-console .panel-link {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.shell[data-screen="alerts"] .alerts-console .panel-link {
  border-bottom: 1px solid var(--line-strong);
  text-decoration: none;
}

.shell[data-screen="alerts"] .alerts-console .panel-link:hover {
  border-bottom-color: var(--ink-3);
  color: var(--ink);
}

.shell[data-screen="alerts"] .page-alert-lines {
  padding: 0 24px;
}

.shell[data-screen="alerts"] .page-alerts .aitem {
  padding: 18px 0 17px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
}

.shell[data-screen="alerts"] .page-alerts .aitem:last-child {
  border-bottom: 0;
}

.shell[data-screen="alerts"] .page-alerts .aitem:hover {
  background: var(--field);
}

.shell[data-screen="alerts"] .page-alerts .aitem .anm {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
}

.shell[data-screen="alerts"] .page-alerts .aico {
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card-2);
}

.shell[data-screen="alerts"] .page-alerts .aitem .aonce {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card-2);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1.3;
  text-transform: uppercase;
}

.shell[data-screen="alerts"] .page-alerts .aitem .aonce.fired {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent);
}

.shell[data-screen="alerts"] .page-alerts .arearm {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-3);
  box-shadow: inset 0 1px 0 #fff;
}

.shell[data-screen="alerts"] .page-alerts .arearm:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}

.shell[data-screen="alerts"] .page-alerts .alvl {
  gap: 4px 20px;
}

.shell[data-screen="alerts"] .page-alerts .aline {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}

.shell[data-screen="alerts"] .page-alerts .aval {
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.8rem, 2.4vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .95;
}

.shell[data-screen="alerts"] .page-alerts .aval em {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.shell[data-screen="alerts"] .page-alerts .aguard {
  color: var(--ink-4);
  font-size: 10.5px;
  line-height: 1.45;
}

.shell[data-screen="alerts"] .alerts-feed {
  background: var(--card-2);
}

.shell[data-screen="alerts"] .alerts-feed #alerts-page-log {
  max-height: 680px;
}

.shell[data-screen="alerts"] .alerts-feed .apanel-note {
  padding: 20px 24px;
  color: var(--ink-4);
  font-size: 11.5px;
}

.shell[data-screen="alerts"] .alerts-feed .nday {
  padding: 14px 24px 7px;
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .09em;
}

.shell[data-screen="alerts"] .alerts-feed .nrow {
  padding: 11px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.shell[data-screen="alerts"] .alerts-feed button.nrow:hover {
  background: var(--field);
}

.shell[data-screen="alerts"] .alerts-feed .nwrap.unread .nrow {
  background: var(--accent-soft);
}

.shell[data-screen="alerts"] .alerts-feed .ndot {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: var(--line-strong);
}

.shell[data-screen="alerts"] .alerts-feed .nwrap.unread .ndot {
  background: var(--accent);
}

.shell[data-screen="alerts"] .alerts-feed .n-ico {
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card);
}

.shell[data-screen="alerts"] .alerts-feed .ntext b {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
}

.shell[data-screen="alerts"] .alerts-feed .ntext span {
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.4;
}

.shell[data-screen="alerts"] .alerts-feed .nwhen {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ------------------------------------------------------------- flips ------ */
/* The planner is a blotter: the book's four totals on a tinted band, a ruled
   filter strip, then positions as ledger lines with their actions at the end. */
.shell[data-screen="flips"] .page-flips-body {
  display: flex;
  flex-direction: column;
}

.shell[data-screen="flips"] .flip-summary {
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.shell[data-screen="flips"] .book-kpi {
  padding: 16px 20px 15px 0;
}

.shell[data-screen="flips"] .book-kpi + .book-kpi {
  padding-left: 20px;
  border-left: 1px solid var(--line-soft);
}

.shell[data-screen="flips"] .book-kpi span {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  line-height: 1.2;
}

.shell[data-screen="flips"] .book-kpi b {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.shell[data-screen="flips"] .book-kpi b.up { color: var(--up); }
.shell[data-screen="flips"] .book-kpi b.down { color: var(--down); }

.shell[data-screen="flips"] .book-kpi small {
  color: var(--ink-4);
  font-size: 10px;
  line-height: 1.4;
}

.shell[data-screen="flips"] .flip-tools {
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.shell[data-screen="flips"] .flip-filters button {
  height: 30px;
  padding: 0 10px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.shell[data-screen="flips"] .flip-filters button span {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 800;
}

.shell[data-screen="flips"] .flip-filters button:hover {
  background: var(--field);
  color: var(--ink);
}

.shell[data-screen="flips"] .flip-filters button[aria-pressed="true"] {
  border-bottom-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.shell[data-screen="flips"] .flip-filters button[aria-pressed="true"] span {
  color: var(--accent);
}

.shell[data-screen="flips"] .flip-sort {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.shell[data-screen="flips"] .flip-sort select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}

.shell[data-screen="flips"] .blotter-head {
  min-height: 34px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .09em;
}

.shell[data-screen="flips"] .page-flips .flip-card.flip-row {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

.shell[data-screen="flips"] .page-flips .flip-card.flip-row:hover {
  background: var(--field);
}

.shell[data-screen="flips"] .page-flips .flip-card.flip-row.open {
  border-bottom-color: var(--line-strong);
  background: var(--card-2);
}

.shell[data-screen="flips"] .flip-row-main {
  padding: 15px 24px 11px;
}

.shell[data-screen="flips"] .flip-ico {
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card-2);
}

.shell[data-screen="flips"] .flip-copy b {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 800;
}

.shell[data-screen="flips"] .flip-copy span {
  color: var(--ink-4);
  font-size: 10.5px;
}

.shell[data-screen="flips"] .page-flips .flip-state {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}

.shell[data-screen="flips"] .page-flips .flip-state.planned {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent);
}

.shell[data-screen="flips"] .page-flips .flip-state.open {
  border-color: color-mix(in srgb, var(--up) 35%, var(--line));
  background: var(--up-soft);
  color: var(--up);
}

.shell[data-screen="flips"] .page-flips .flip-state.closed {
  border-color: color-mix(in srgb, var(--down) 35%, var(--line));
  background: var(--down-soft);
  color: var(--down);
}

.shell[data-screen="flips"] .cell-label {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.2;
}

.shell[data-screen="flips"] .page-flips .flip-live b {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
}

.shell[data-screen="flips"] .page-flips .flip-bar {
  height: 4px;
  background: var(--field);
}

.shell[data-screen="flips"] .pos-line b {
  color: var(--ink-2);
  font-weight: 700;
}

.shell[data-screen="flips"] .pos-line span {
  color: var(--ink-4);
  font-size: 10px;
}

.shell[data-screen="flips"] .flip-pnl > b {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.shell[data-screen="flips"] .flip-pnl > b.up { color: var(--up); }
.shell[data-screen="flips"] .flip-pnl > b.down { color: var(--down); }

.shell[data-screen="flips"] .pnl-sub {
  color: var(--ink-4);
  font-size: 10px;
}

.shell[data-screen="flips"] .flip-acts :is(.abtn, .ghost),
.shell[data-screen="flips"] .flip-detail-acts .ghost {
  height: 30px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 #fff;
}

.shell[data-screen="flips"] .flip-acts :is(.abtn, .ghost):hover,
.shell[data-screen="flips"] .flip-detail-acts .ghost:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}

.shell[data-screen="flips"] .page-flips .flip-buy {
  border-color: color-mix(in srgb, var(--up) 30%, var(--line));
  color: var(--up);
}

.shell[data-screen="flips"] .page-flips .flip-sell {
  border-color: var(--line-strong);
  color: var(--accent);
}

.shell[data-screen="flips"] .flip-facts {
  padding: 0 24px 12px;
  gap: 4px 16px;
}

.shell[data-screen="flips"] .flip-facts em {
  flex-basis: 38px;
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
}

.shell[data-screen="flips"] .flip-facts b {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
}

.shell[data-screen="flips"] .page-flips .flip-note {
  padding: 0 24px 12px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.45;
}

.shell[data-screen="flips"] .page-flips .flip-detail {
  margin: 0 24px 14px;
  padding: 12px 0 5px;
  border-top: 1px solid var(--line-soft);
}

.shell[data-screen="flips"] .flip-detail .flip-ledger-head {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.shell[data-screen="flips"] .page-flips .flip-empty {
  padding: 48px 24px;
}

.shell[data-screen="flips"] .page-flips .flip-empty-line {
  padding: 56px 24px;
}

.shell[data-screen="flips"] .page-flips .flip-empty-line b {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.shell[data-screen="flips"] .page-flips .flip-empty-line p {
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.55;
}

.shell[data-screen="flips"] .flip-picker {
  padding: 16px 24px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.shell[data-screen="flips"] .flip-picker-form label {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.shell[data-screen="flips"] .flip-picker-form input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}

.shell[data-screen="flips"] .flip-picker-form input:focus {
  border-color: var(--line-strong);
  outline: none;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .18),
    0 0 0 2px var(--accent-soft);
}

.shell[data-screen="flips"] .flip-pick {
  min-height: 40px;
  border-bottom: 1px solid var(--line-soft);
}

.shell[data-screen="flips"] .flip-pick-name {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
}

.shell[data-screen="flips"] .flip-pick b {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 11px;
}

/* ------------------------------------------------------- narrow desks ----- */
@media (max-width: 1120px) {
  .shell[data-screen="lists"] .lists-ledger {
    border-right: 0;
  }
  .shell[data-screen="lists"] .lists-readout {
    padding: 18px 24px 20px;
  }
}

@media (max-width: 980px) {
  .shell[data-screen="alerts"] .alerts-rules {
    border-right: 0;
  }
  .shell[data-screen="alerts"] .alerts-feed {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
    .hub.desk-page > .page-mast.desk-head {
    padding: 14px 16px 13px;
    gap: 14px;
  }
  .shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
    .hub.desk-page .desk-actions :is(.sbtn, .ghost) {
    height: 44px;
    min-height: 44px;
  }
  .shell:is([data-screen="lists"], [data-screen="flips"], [data-screen="alerts"])
    .hub.desk-page .desk-meta {
    font-size: 10px;
  }

  .shell[data-screen="lists"] .lists-rail {
    padding: 0;
    border-right: 0;
  }
  .shell[data-screen="lists"] .list-pick {
    min-height: 45px;
    padding: 0 14px;
  }
  .shell[data-screen="lists"] .lists-ledger {
    padding: 14px 16px 0;
  }
  .shell[data-screen="lists"] .lists-readout {
    padding: 16px 16px 18px;
  }
  .shell[data-screen="lists"] .lists-body {
    min-height: 180px;
  }
  .shell[data-screen="lists"] .ledger-head .ghost {
    height: 32px;
    min-height: 32px;
  }
  .shell[data-screen="lists"] .lhead {
    background: transparent;
  }

  .shell[data-screen="alerts"] .alerts-console .panel-head {
    padding: 14px 16px 12px;
  }
  .shell[data-screen="alerts"] .alerts-console .panel-head h3 {
    font-size: 18px;
  }
  .shell[data-screen="alerts"] .page-alert-lines {
    padding: 0 16px;
  }
  .shell[data-screen="alerts"] .page-alerts .aitem {
    padding: 16px 0;
  }
  .shell[data-screen="alerts"] .page-alerts .aitem .anm {
    font-size: 12px;
  }
  .shell[data-screen="alerts"] .page-alerts .aval {
    font-size: 26px;
  }
  .shell[data-screen="alerts"] .page-alerts .aline {
    font-size: 11px;
  }
  .shell[data-screen="alerts"] .page-alerts .aguard {
    font-size: 10px;
  }
  .shell[data-screen="alerts"] .alerts-feed .nday {
    padding: 12px 16px 5px;
  }
  .shell[data-screen="alerts"] .alerts-feed .nrow {
    padding: 10px 16px;
  }
  .shell[data-screen="alerts"] .alerts-feed .apanel-note {
    padding: 16px;
  }

  .shell[data-screen="flips"] .flip-summary {
    padding: 0 16px;
  }
  .shell[data-screen="flips"] .book-kpi {
    padding: 14px 14px 13px 0;
  }
  .shell[data-screen="flips"] .book-kpi + .book-kpi {
    padding-left: 14px;
  }
  .shell[data-screen="flips"] .book-kpi:nth-child(3) {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .shell[data-screen="flips"] .book-kpi:nth-child(4) {
    border-top: 1px solid var(--line-soft);
  }
  .shell[data-screen="flips"] .flip-tools {
    padding: 9px 16px;
  }
  .shell[data-screen="flips"] .flip-filters button {
    padding: 0 9px;
  }
  .shell[data-screen="flips"] .flip-row-main {
    padding: 15px 16px 11px;
  }
  .shell[data-screen="flips"] .flip-facts {
    padding: 0 16px 11px;
    gap: 4px 12px;
  }
  .shell[data-screen="flips"] .flip-facts em {
    flex-basis: 30px;
  }
  .shell[data-screen="flips"] .page-flips .flip-note {
    padding: 0 16px 12px;
  }
  .shell[data-screen="flips"] .page-flips .flip-detail {
    margin: 0 16px 12px;
  }
  .shell[data-screen="flips"] .flip-picker {
    padding: 14px 16px;
  }
  .shell[data-screen="flips"] .page-flips .flip-empty {
    padding: 40px 16px;
  }
  .shell[data-screen="flips"] .page-flips .flip-empty-line {
    padding: 48px 16px;
  }
}

@media (pointer: coarse) {
  .shell[data-screen="flips"] .flip-acts :is(.abtn, .ghost),
  .shell[data-screen="flips"] .flip-detail-acts .ghost {
    height: 44px;
    min-height: 44px;
  }
  .shell[data-screen="alerts"] .page-alerts .arearm {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
}

/* ------------------------------------------ tools menu — the catalogue --- */
/* The dropdown is the tools sheet folded into an index: one paper card with a
   brass top rule, ruled section bands, and each destination a ledger line
   rather than a rounded tile. The sections stack so the index has no dead
   column; the footer stays pinned while the register scrolls. */

.topbar .rail-tools > .rail-menu {
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 2px;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
}

.topbar .rail-tools .rail-menu-body {
  display: block;
  min-height: 0;
  overflow-y: auto;
  background: var(--card);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) var(--card-2);
}

.topbar .rail-tools .rail-menu-body::-webkit-scrollbar {
  width: 10px;
}
.topbar .rail-tools .rail-menu-body::-webkit-scrollbar-track {
  background: var(--card-2);
}
.topbar .rail-tools .rail-menu-body::-webkit-scrollbar-thumb {
  border: 3px solid var(--card);
  border-radius: 2px;
  background: var(--line);
}
.topbar .rail-tools .rail-menu-body::-webkit-scrollbar-thumb:hover {
  background: var(--line-strong);
}

/* Each group is a register, not a card: a tinted band names it and the rows
   below share the sheet's hairlines. */
.topbar .rail-tools :is(
  .rail-menu-character,
  .rail-menu-price,
  .rail-menu-skills
) {
  padding: 0;
  border: 0;
}

.topbar .rail-tools .rail-menu-band {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 11px 16px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.topbar .rail-tools .rail-menu-heading {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.topbar .rail-tools .rail-menu-meta {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.2;
}

/* The three groups share one three-column index on desk and tablet; the phone
   drops character to full rows and price and skills to two columns. */
.topbar .rail-tools .rail-menu-character .rail-menu-list,
.topbar .rail-tools .rail-menu-price .rail-menu-list,
.topbar .rail-tools .rail-skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 0;
}

.topbar .rail-tools .rail-menu-item,
.topbar .rail-tools .rail-skill {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  text-decoration: none;
  transition: background var(--t-quick) var(--ease),
    border-color var(--t-quick) var(--ease);
}

.topbar .rail-tools .rail-menu-item {
  grid-template-columns: 28px minmax(0, 1fr) 13px;
  gap: 9px;
  min-height: 50px;
  padding: 8px 14px;
}

.topbar .rail-tools .rail-menu-item:nth-child(3n),
.topbar .rail-tools .rail-skill:nth-child(3n) {
  border-right: 0;
}

.topbar .rail-tools .rail-menu-item:hover,
.topbar .rail-tools .rail-menu-item:focus-visible,
.topbar .rail-tools .rail-skill:hover,
.topbar .rail-tools .rail-skill:focus-visible {
  border-color: var(--line-soft);
  background: var(--field);
}

.topbar .rail-tools .rail-menu-item:active,
.topbar .rail-tools .rail-skill:active {
  background: var(--field-2);
}

.topbar .rail-tools .rail-menu-item:focus-visible,
.topbar .rail-tools .rail-skill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.topbar .rail-tools .rail-menu-item .rm-name {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.topbar .rail-tools .rail-menu-character .rm-name {
  color: var(--ink);
  font-size: 12.5px;
}

.topbar .rail-tools .rail-menu-item:hover .rm-name,
.topbar .rail-tools .rail-menu-item:focus-visible .rm-name,
.topbar .rail-tools .rail-skill:hover .rail-skill-name,
.topbar .rail-tools .rail-skill:focus-visible .rail-skill-name {
  color: var(--ink);
}

.topbar .rail-tools .rm-art {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card);
  box-shadow: none;
}

.topbar .rail-tools .rm-art img {
  width: 22px;
  height: 22px;
}

.topbar .rail-tools .rm-art .rm-mark {
  width: 16px;
  height: 16px;
}

.topbar .rail-tools .rm-go {
  width: 13px;
  height: 13px;
  color: var(--ink-4);
}

.topbar .rail-tools .rail-menu-item:hover .rm-art,
.topbar .rail-tools .rail-menu-item:focus-visible .rm-art {
  border-color: var(--line-strong);
  background: var(--field);
}

.topbar .rail-tools .rail-menu-item:hover .rm-go,
.topbar .rail-tools .rail-menu-item:focus-visible .rm-go {
  color: var(--accent);
  transform: translateX(2px);
}

.topbar .rail-tools .rail-skill {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.topbar .rail-tools .rail-skill-icon {
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card);
}

.topbar .rail-tools .rail-skill:hover .rail-skill-icon,
.topbar .rail-tools .rail-skill:focus-visible .rail-skill-icon {
  border-color: var(--line-strong);
  background: var(--field);
}

/* The way to the full index is the sheet's closing rule, not another tile. */
.topbar .rail-tools .rail-menu-all {
  min-height: 44px;
  padding: 0 16px;
  border-top: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.topbar .rail-tools .rail-menu-all:hover,
.topbar .rail-tools .rail-menu-all:focus-visible {
  background: var(--field);
  color: var(--ink);
}

.topbar .rail-tools .rail-menu-all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

@media (max-width: 620px) {
  .topbar .rail-tools .rail-menu-band {
    padding: 10px 14px 8px;
  }

  .topbar .rail-tools .rail-skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar .rail-tools .rail-skill:nth-child(3n) {
    border-right: 1px solid var(--line-soft);
  }
  .topbar .rail-tools .rail-skill:nth-child(2n) {
    border-right: 0;
  }

  .topbar .rail-tools .rail-menu-character .rail-menu-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar .rail-tools .rail-menu-price .rail-menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar .rail-tools .rail-menu-item {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    min-height: 50px;
    padding: 8px 12px;
    border-right: 1px solid var(--line-soft);
  }
  .topbar .rail-tools .rail-menu-character .rail-menu-item {
    grid-template-columns: 26px minmax(0, 1fr) 13px;
    border-right: 0;
  }
  .topbar .rail-tools .rail-menu-price .rail-menu-item:nth-child(2n) {
    border-right: 0;
  }
  .topbar .rail-tools .rail-menu-item .rm-go {
    display: none;
  }
  .topbar .rail-tools .rail-menu-character .rail-menu-item .rm-go {
    display: block;
  }

  .topbar .rail-tools .rm-art {
    width: 26px;
    height: 26px;
  }
  .topbar .rail-tools .rm-art img {
    width: 20px;
    height: 20px;
  }
  .topbar .rail-tools .rail-menu-item .rm-name {
    font-size: 11.5px;
  }
  .topbar .rail-tools .rail-menu-character .rm-name {
    font-size: 12px;
  }

  .topbar .rail-tools .rail-skill {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    font-size: 11.5px;
  }
  .topbar .rail-tools .rail-skill-icon {
    width: 24px;
    height: 24px;
  }

  .topbar .rail-tools .rail-menu-all {
    padding: 0 14px;
  }
}

/* ------------------------------------------------ tools hub — the catalogue --- */
/* The index is the same printed sheet as a calculator, but read as a
   catalogue: three ruled bays across the top, the skills as a compact
   register, and the two onward actions as a footer band. Cards stay out of it;
   section caps, hairlines and square sprite plates do the grouping. */

.shell[data-screen="tools"] .toolview-hub .bench-group {
  min-width: 0;
  padding: 20px 24px 22px;
  border-left: 1px solid var(--line);
}
.shell[data-screen="tools"] .toolview-hub .bench-group:first-child {
  padding-left: 24px;
  border-left: 0;
}
.shell[data-screen="tools"] .toolview-hub .bench-group-head {
  padding-bottom: 0;
}
.shell[data-screen="tools"] .toolview-hub .bench-list {
  /* The next bay opens with its own cap, so the register does not also close
     itself: the two hairlines left a band of empty paper between them. */
  flex: 0 0 auto;
  margin-top: 10px;
}

.shell[data-screen="tools"] .toolview-hub .bench-tool {
  grid-template-columns: 32px minmax(0, 1fr) 15px;
  gap: 11px;
  min-height: 56px;
  padding: 10px 0;
}
.shell[data-screen="tools"] .toolview-hub .bench-tool:hover {
  background: var(--field);
}
.shell[data-screen="tools"] .toolview-hub :is(.bench-tool-icon, .bench-plan-icon) {
  width: 32px;
  height: 32px;
  border-color: var(--line-soft);
  border-radius: 2px;
  background: var(--field);
  box-shadow: none;
}
.shell[data-screen="tools"] .toolview-hub .bench-tool-img {
  width: 22px;
  height: 22px;
}
.shell[data-screen="tools"] .toolview-hub .bench-tool:hover .bench-tool-icon {
  border-color: var(--line);
  background: var(--card-2);
}
.shell[data-screen="tools"] .toolview-hub :is(.bench-tool, .bench-plan):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* The eighteen skills are a register, not a wall: two ruled columns on a
   tablet and phone, three on the wide sheet. The arrow retires on a phone so
   the name keeps the room; the icon and the whole row are still the target. */
.shell[data-screen="tools"] .toolview-hub .bench-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0;
}
.shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool {
  min-height: 54px;
  padding: 10px 12px;
}
.shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(odd) {
  padding-left: 0;
}
.shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(even) {
  padding-right: 0;
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

/* The footer is one band: the optimizer's plan card closes the register, and
   a plan with no sprite drops the empty icon track rather than crushing the
   label into it. */
.shell[data-screen="tools"] .toolview-hub .bench-plan {
  min-width: 0;
  min-height: 72px;
  margin-top: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line-strong);
  background: var(--card-2);
}
.shell[data-screen="tools"] .toolview-hub .bench-plan:not(:has(.bench-plan-icon)) {
  grid-template-columns: minmax(0, 1fr) auto;
}
.shell[data-screen="tools"] .toolview-hub .bench-plan:hover {
  border-color: var(--accent-line);
  background: var(--field);
}
.shell[data-screen="tools"] .toolview-hub .bench-plan-icon {
  width: 34px;
  height: 34px;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.shell[data-screen="tools"] .toolview-hub .bench-plan-img {
  width: 24px;
  height: 24px;
}
.shell[data-screen="tools"] .toolview-hub .bench-plan-go {
  grid-column: auto;
  justify-self: end;
}

@media (min-width: 1000px) {
  .shell[data-screen="tools"] .toolview-hub > .bench-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto;
    align-content: start;
    padding: 0;
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-group {
    align-self: stretch;
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-group:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    border-left: 0;
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-group:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-group:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / span 2;
    border-left: 1px solid var(--line);
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-group:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 20px 24px 22px;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool {
    min-height: 56px;
    padding: 10px 16px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(3n + 1) {
    padding-left: 0;
    border-left: 0;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(3n + 2),
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(3n) {
    border-left: 1px solid var(--line-soft);
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(3n) {
    padding-right: 0;
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-plan {
    grid-column: span 1;
    grid-row: 4;
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-plan:nth-of-type(1) {
    grid-column: 1;
  }
  .shell[data-screen="tools"] .toolview-hub > .bench-body > .bench-plan:nth-of-type(2) {
    grid-column: 2;
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 999px) {
  .shell[data-screen="tools"] .toolview-hub > .bench-body {
    display: flex;
    flex-direction: column;
    padding: 0 24px 16px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-group,
  .shell[data-screen="tools"] .toolview-hub .bench-group:first-child {
    padding: 18px 0 20px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-group:first-child {
    border-top: 0;
    padding-top: 20px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-group:last-of-type {
    border-bottom: 0;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan {
    margin-top: 0;
  }
}

@media (min-width: 621px) and (max-width: 999px) {
  .shell[data-screen="tools"] .toolview-hub .bench-group:not(:last-of-type) .bench-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    row-gap: 0;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan:not(:has(.bench-plan-icon)) {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan-go {
    grid-column: auto;
    justify-self: end;
  }
}

@media (max-width: 620px) {
  .shell[data-screen="tools"] .toolview-hub > .bench-body {
    padding: 0 16px 14px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-group:not(:last-of-type) .bench-tool-copy b {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.3;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-group,
  .shell[data-screen="tools"] .toolview-hub .bench-group:first-child {
    padding: 16px 0 18px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool {
    grid-template-columns: 28px minmax(0, 1fr) 0;
    gap: 9px;
    min-height: 50px;
    padding: 9px 10px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(odd) {
    padding-left: 0;
    padding-right: 10px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(even) {
    padding-right: 0;
    padding-left: 10px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool-go {
    display: none;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool-icon {
    width: 28px;
    height: 28px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool-img {
    width: 20px;
    height: 20px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool-copy b {
    font-size: 12px;
    line-height: 1.3;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan {
    grid-template-columns: 34px minmax(0, 1fr);
    row-gap: 5px;
    padding: 13px 0 15px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan:not(:has(.bench-plan-icon)) {
    grid-template-columns: minmax(0, 1fr);
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan-icon {
    width: 34px;
    height: 34px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan-go {
    grid-column: 2;
    justify-self: start;
    padding-left: 0;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-plan:not(:has(.bench-plan-icon)) .bench-plan-go {
    grid-column: 1;
  }
}

/* At 320 the two skill columns are only 127px wide. Give the longest name its
   last few pixels back rather than clipping it to an ellipsis. */
@media (max-width: 360px) {
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool {
    gap: 7px;
    padding: 8px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(odd) {
    padding-left: 0;
    padding-right: 8px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool:nth-child(even) {
    padding-right: 0;
    padding-left: 8px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool-icon {
    width: 26px;
    height: 26px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool-img {
    width: 19px;
    height: 19px;
  }
  .shell[data-screen="tools"] .toolview-hub .bench-list-grid .bench-tool-copy b {
    font-size: 11.5px;
  }
}

/* ------------------------------------------------ market filters — the index --- */
/* The filters are a second catalogue on the market sheet: one ruled bar when
   shut, a paper register when open. The groups are three columns on a desk,
   two on a tablet and one in the phone sheet; the open group's fields stay
   inside its own column instead of pushing the whole panel taller. */

.shell[data-screen="market"]:not(.item-view) .filters-card {
  align-self: stretch;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 2px;
  background: var(--card);
  box-shadow: none;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .facets-head {
  min-height: 48px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}
.shell[data-screen="market"]:not(.item-view) .filters-card:not(.open) .facets-head {
  border-bottom: 0;
}

.shell[data-screen="market"]:not(.item-view) .filters-title {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="market"]:not(.item-view) .filter-state {
  min-height: 19px;
  padding: 1px 6px;
  border-radius: 2px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
}

.shell[data-screen="market"]:not(.item-view) .filters-actions .ghost {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: none;
}
.shell[data-screen="market"]:not(.item-view) .filters-actions .ghost:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}
.shell[data-screen="market"]:not(.item-view) .filters-actions .ghost[disabled] {
  border-color: var(--line-soft);
  background: transparent;
  color: var(--ink-4);
  opacity: .55;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .facets-body {
  gap: 12px;
  padding: 14px 16px 16px;
  background: var(--card);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .facet-view {
  padding-bottom: 0;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .facet-label {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: none;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly:hover {
  border-color: var(--line-strong);
  background: var(--field);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly.on {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .scope-x {
  width: 34px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink-4);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .scope-x:hover {
  border-color: var(--line-strong);
  color: var(--down);
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-search {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--field);
  color: var(--ink-3);
  box-shadow: none;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-search:focus-within {
  border-color: var(--line-strong);
  background: var(--card);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-search svg {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-search input::placeholder {
  color: var(--ink-4);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-search input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* One rule per group, drawn as an index line rather than a card. */
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-catalog {
  margin: 0;
  border-top: 0;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-block {
  min-width: 0;
  padding: 9px 0 11px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-block summary {
  height: 38px;
  padding: 0 1px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.2;
  text-transform: uppercase;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-block summary:hover {
  color: var(--accent-2);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-block summary::after {
  width: 6px;
  height: 6px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  border-color: var(--ink-3);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-block[open] summary {
  color: var(--accent-2);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .fb-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 2px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-index {
  padding: 0 0 8px;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-fields {
  gap: 6px;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip.on,
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip.open {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-2);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip .ff-mark {
  width: 10px;
  font-family: var(--sans);
  font-size: 11px;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-editor {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--field);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-editor-name {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-editor-name em {
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 10.5px;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-editor-hint {
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.35;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-editor-clear {
  color: var(--ink-3);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-input > span {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-input input {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-input input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-sep {
  color: var(--ink-3);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-empty {
  color: var(--ink-4);
  font-size: 12px;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-active {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 2px;
  background: var(--accent-soft);
  box-shadow: none;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-active-title {
  color: var(--accent-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-active-clear {
  color: var(--ink-3);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-chip {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-chip:hover {
  border-color: var(--line-strong);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-chip-x {
  width: 24px;
  color: var(--ink-3);
}

/* The register: three groups across the desk, two on a tablet. The details
   become direct grid items, so Membership sits in the same rhythm as the
   generated groups instead of being an orphan column. */
@media (min-width: 621px) {
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facets-body {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: row;
    align-content: start;
    gap: 12px 20px;
    padding: 14px 16px 16px;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facet-view {
    grid-column: 1 / 4;
    grid-row: 1;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-tools {
    grid-column: 4 / 7;
    grid-row: 1;
    align-self: end;
    padding: 0;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-active {
    grid-column: 1 / -1;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-catalog {
    display: contents;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-empty {
    grid-column: 1 / -1;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-block {
    grid-column: span 3;
    align-self: start;
    padding: 9px 0 11px;
    border-top: 1px solid var(--line-soft);
  }
}

@media (min-width: 1000px) {
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-block {
    grid-column: span 2;
  }
}

/* The phone is a sheet on the bar, not a card in the column. Its paper has
   square top corners and the same pinned foot as the tools sheet. */
@media (max-width: 620px) {
  .shell[data-screen="market"]:not(.item-view) .filters-card.open {
    border: 1px solid var(--line);
    border-top: 2px solid var(--line-strong);
    border-radius: 2px 2px 0 0;
    background: var(--card);
    box-shadow: 0 -18px 38px -30px rgba(0, 0, 0, .6);
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facets-head {
    min-height: 54px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--card-2);
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facets-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    overflow: auto;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-block {
    padding: 9px 0 10px;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-active {
    position: static;
    top: auto;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-block summary {
    height: 44px;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-search {
    height: 44px;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .filter-field-chip {
    min-height: 44px;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card .filters-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-top: 1px solid var(--line);
    background: var(--card-2);
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card .filters-foot .ghost,
  .shell[data-screen="market"]:not(.item-view) .filters-card .filters-foot .sbtn {
    min-height: 40px;
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card .filters-foot .ghost {
    border-color: var(--line);
    background: var(--card);
    color: var(--ink-3);
  }
  .shell[data-screen="market"]:not(.item-view) .filters-card .filters-foot .sbtn {
    margin-left: auto;
  }
}

/* ------------------------------------------------------------ view picker --- */
/* The market's View switch and the lists watchlist picker ask the same question:
   which set is being read. They share one paper trigger and one ruled menu, so
   the control is the same instrument in both places. The menu keeps its rows,
   counts, ticks and row actions; only its material changes. */
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly,
.wl-pick {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--field);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: none;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly:hover,
.wl-pick:hover {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--ink);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly[aria-expanded="true"],
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly.on,
.wl-pick[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--card-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly .s-star,
.wl-caret {
  color: var(--accent);
}
.wl-pick:disabled {
  color: var(--ink-4);
  background: var(--field);
  border-color: var(--line);
}
.wl-pick:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.shell[data-screen="market"]:not(.item-view) .filters-card .saveonly .s-caret {
  color: var(--accent-2);
  font-size: 10px;
}
.wl-caret {
  stroke: var(--accent-2);
}

@media (min-width: 621px) {
  .listmenu:not(.ctx) {
    min-width: 264px;
    max-width: 300px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-top-width: 2px;
    border-radius: 2px;
    background: var(--card);
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) var(--card-2);
  }
  .listmenu:not(.ctx)::-webkit-scrollbar {
    width: 10px;
  }
  .listmenu:not(.ctx)::-webkit-scrollbar-track {
    background: var(--card-2);
  }
  .listmenu:not(.ctx)::-webkit-scrollbar-thumb {
    border: 3px solid var(--card-2);
    background: var(--line-strong);
  }

  .listmenu:not(.ctx) .lm-head {
    margin: 0;
    padding: 9px 12px 8px;
    border-bottom: 1px solid var(--line);
    background: var(--card-2);
    color: var(--ink-3);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  .listmenu:not(.ctx) .lm-head-now {
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  .listmenu:not(.ctx) .lm-all {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }
  .listmenu:not(.ctx) .lm-all.lm-pick[aria-pressed="true"] {
    background: var(--accent-soft);
  }

  .listmenu:not(.ctx) .lm-row {
    gap: 2px;
    padding: 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
  }
  .listmenu:not(.ctx) .lm-row:has(.lm-pick[aria-pressed="true"]) {
    background: var(--accent-soft);
  }
  .listmenu:not(.ctx) .lm-pick {
    min-height: 36px;
    padding: 7px 10px 7px 12px;
    border-radius: 0;
    font-size: 12.5px;
  }
  .listmenu:not(.ctx) .lm-pick[aria-pressed="true"] {
    background: transparent;
  }
  .listmenu:not(.ctx) .lm-pick:hover {
    background: var(--field);
  }
  .listmenu:not(.ctx) .lm-row:has(.lm-pick[aria-pressed="true"]) .lm-pick:hover {
    background: transparent;
  }
  .listmenu:not(.ctx) .lm-name {
    font-size: 12.5px;
    font-weight: 600;
  }
  .listmenu:not(.ctx) .lm-n {
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 700;
  }
  .listmenu:not(.ctx) .lm-tool {
    width: 28px;
    height: 28px;
    border-radius: 0;
    color: var(--ink-4);
  }
  .listmenu:not(.ctx) .lm-tool:hover {
    background: var(--field);
    color: var(--ink);
  }
  .listmenu:not(.ctx) .lm-tick {
    color: var(--accent);
    font-size: 10px;
  }

  .listmenu:not(.ctx) .lm-group {
    margin: 0;
    padding: 7px 12px 6px;
    border-top: 1px solid var(--line);
    background: var(--card-2);
    color: var(--ink-3);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  .listmenu:not(.ctx) .lm-row + .lm-group {
    border-top: 0;
  }
  .listmenu:not(.ctx) .lm-group-sep {
    margin-top: 0;
  }

  .listmenu:not(.ctx) .lm-foot {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
  }
  .listmenu:not(.ctx) .lm-row + .lm-foot {
    border-top: 0;
  }
  .listmenu:not(.ctx) .lm-new {
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 0;
    color: var(--accent-2);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
  .listmenu:not(.ctx) .lm-new:hover {
    background: var(--accent-soft);
    color: var(--accent-2);
  }
  .listmenu:not(.ctx) .lm-pick:focus-visible,
  .listmenu:not(.ctx) .lm-tool:focus-visible,
  .listmenu:not(.ctx) .lm-new:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 2px var(--accent-line);
  }
}

@media (max-width: 620px) {
  .listmenu.docked .lm-dock-head {
    background: var(--card-2);
    border-bottom-color: var(--line);
  }
  .listmenu.docked .lm-body {
    padding-top: 0;
  }
  .listmenu.docked .lm-group {
    margin: 6px 0 0;
    padding: 7px 10px 5px;
    border-top: 1px solid var(--line);
    background: var(--card-2);
    color: var(--ink-3);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
}

/* ------------------------------------------------------------ item tabs --- */
/* The open items are the ledger's index, not a row of cards: each page is a
   folio entry with a bare sprite and a close mark, separated by a dotted
   column rule. The page on the glass is the brass flag; the rest sit as quiet
   entries on the sheet. Overflow, drag, skeleton and the 20-page behaviour are
   untouched. */
/* The strip is an index, not a ruled row: the sheet or board below carries its
   own top edge. The head's hairline doubled that edge on the item page and left
   a stray rule under the tabs everywhere else. The transparent border keeps the
   head's 1px of box height, so removing the rule moves nothing. The shell is
   named by id here because the paper skin's own `#shell .page-head` rule does:
   at class weight this line lost and every page with a tab open kept it. */
#shell:has(.page-head .tb-pages:not([hidden])) .page-head {
  border-bottom-color: transparent;
}

/* The item head is the page's index line: its back control, open tabs and All
   control sit on the same 1220px track as the item sheet below, not on the
   wider shell frame. */
#shell.item-view .page-head {
  width: calc(100% - 2 * var(--frame-pad));
  margin-inline: auto;
  padding-left: 0;
  padding-right: 0;
}

.page-head .tb-pages {
  gap: 0;
  padding: 5px 0;
}

.page-head .tb-page {
  position: relative;
  height: 40px;
  max-width: 240px;
  padding: 0 2px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.page-head .tb-page + .tb-page::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 18px;
  background: var(--line-soft);
  transform: translateY(-50%);
  pointer-events: none;
}

.page-head .tb-page:hover {
  background: var(--field);
}

.page-head .tb-page.on {
  background: linear-gradient(180deg, #d9a63f, #f0bd55);
  box-shadow: inset 0 1px 0 #ffe6a3, inset 0 -2px 0 #315462;
}

.page-head .tb-page.on:hover {
  background: linear-gradient(180deg, #d9a63f, #f0bd55);
}

.page-head .tb-page.on::before {
  display: none;
}

.page-head .tb-page-open {
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 0 4px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.page-head .tb-page-nm {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-head .tb-page.on .tb-page-open {
  color: var(--ink);
  font-weight: 800;
}

.page-head .tb-page-open img {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: .78;
  image-rendering: pixelated;
}

.page-head .tb-page.on .tb-page-open img {
  opacity: 1;
}

.page-head .tb-page-x {
  position: relative;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  border-radius: 0;
  color: var(--ink-3);
  font-size: 0;
  line-height: 1;
}

.page-head .tb-page-x::before,
.page-head .tb-page-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  pointer-events: none;
}

.page-head .tb-page-x::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.page-head .tb-page-x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.page-head .tb-page:hover .tb-page-x {
  color: var(--ink-2);
}

.page-head .tb-page-x:hover {
  background: var(--field-2);
  color: var(--ink);
}

.page-head .tb-page.on .tb-page-x {
  color: var(--ink-2);
}

.page-head .tb-page.on .tb-page-x:hover {
  background: rgba(0, 0, 0, .2);
  color: var(--ink);
}

.page-head .tb-page-open:focus-visible,
.page-head .tb-page-x:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 0;
}

.page-head .tb-page.on .tb-page-open:focus-visible,
.page-head .tb-page.on .tb-page-x:focus-visible {
  outline-color: var(--ink);
}

.page-head .tb-all {
  min-width: 40px;
  height: 40px;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--ink-3);
  box-shadow: none;
}

.page-head .tb-all:hover {
  background: var(--field);
  color: var(--ink);
}

.page-head .tb-all-count {
  font-size: 12px;
  color: var(--ink-3);
}

.page-head .tb-all:hover .tb-all-count {
  color: var(--ink);
}

/* The strip is the workspace's index, and it keeps one rhythm on every page:
   the market board, the item sheet and the tool pages all start under the same
   52px line. On a phone the line becomes 56px so the 44px tabs, back mark and
   all-items count sit inside it rather than spilling over. */
.shell:has(.page-head .tb-pages:not([hidden])) {
  --strip-h: 52px;
}
.shell:has(.page-head .tb-pages:not([hidden])) .page-head {
  height: var(--strip-h);
  min-height: var(--strip-h);
}

.page-head .ph-back {
  width: 40px;
  height: 40px;
}

.page-head .tb-page.tb-page-skel {
  height: 40px;
}
.page-head .tb-page-skel .tb-skel-x {
  width: 26px;
  height: 26px;
  border-radius: 0;
}

@media (max-width: 620px) {
  .shell:has(.page-head .tb-pages:not([hidden])) {
    --strip-h: 56px;
  }
  .shell:has(.page-head .tb-pages:not([hidden])) .workspace {
    padding-top: 12px;
  }
  .page-head .tb-pages {
    gap: 0;
    padding: 5px 0;
  }
  .page-head .tb-page {
    height: 44px;
    max-width: 190px;
    padding-left: 6px;
  }
  .page-head .tb-page-open {
    gap: 7px;
    min-height: 44px;
    padding: 0 4px;
  }
  .page-head .tb-page-open img {
    width: 18px;
    height: 18px;
  }
  .page-head .tb-page-x {
    width: 44px;
    height: 44px;
    margin-left: 0;
  }
  .page-head .tb-all {
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
  }
  .page-head .ph-back {
    width: 44px;
    height: 44px;
  }
  .page-head .tb-page.tb-page-skel {
    height: 44px;
  }
  .page-head .tb-page-skel .tb-skel-x {
    width: 44px;
    height: 44px;
  }
}

/* ------------------------------------------------ consistency pass --- */
/* The strip is the page's ledger; the mark beside it is a quiet entry, not
   the old rounded card that used to sit at the head of the pills. */
.page-head .ph-back {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-3);
}

.page-head .ph-back:hover {
  background: var(--field);
  color: var(--ink);
}

/* Say what the count counts. The old three-line mark read as a menu once the
   box around it was removed. */
.page-head .tb-all { gap: 5px; }
.page-head .tb-all-label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
}
.page-head .tb-all:hover .tb-all-label { color: var(--ink); }

/* One close mark, drawn rather than typed. The open-item strip set the
   reference; the dialogs and the open-items card now use the same rule. */
:is(.nd-x, .adel, .flip-x, .items-x, .studies-x) {
  position: relative;
  border-radius: 2px;
  font-size: 0;
  line-height: 1;
}
:is(.nd-x, .adel, .flip-x, .items-x, .studies-x)::before,
:is(.nd-x, .adel, .flip-x, .items-x, .studies-x)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  pointer-events: none;
}
:is(.nd-x, .adel, .flip-x, .items-x, .studies-x)::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
:is(.nd-x, .adel, .flip-x, .items-x, .studies-x)::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* The open-items card is the strip's overflow surface; keep its sheet square
   with the strip, including the phone sheet it becomes. */
.items-menu .items-row { border-radius: 0; }
@media (max-width: 620px) {
  #items-menu { border-radius: 3px; }
}

/* The sign-in gate is a printed slip: brass primary, paper providers, and the
   same square close as the rest of the app. */
#auth-modal .auth-card {
  border-radius: 3px;
  background: linear-gradient(180deg, #0a2230 0%, #0a2230 100%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .45), inset 0 1px 0 #fff;
}
/* The phone dialog layer gives every sheet 15px corners; the sign-in gate is a
   printed slip like the rest of this system, so keep its square edge at every
   width. The extra specificity overrides that layer's !important rule. */
body #auth-modal .auth-card { border-radius: 3px !important; }
#auth-modal .auth-card h2 {
  font-weight: 800;
  letter-spacing: -.025em;
}
#auth-modal .pbtn { font-weight: 800; }
#auth-modal .pbtn.discord {
  border-color: var(--line);
  background: linear-gradient(180deg, #0a2230, #0a202c);
  color: var(--ink-2);
}
#auth-modal .pbtn.discord:hover {
  border-color: var(--line-strong);
  background: var(--field);
  color: var(--ink);
}
#auth-modal #auth-go {
  border: 1px solid #315462;
  background: linear-gradient(180deg, #f0bd55, #d9a63f);
  color: var(--ink);
  font-weight: 800;
  box-shadow: inset 0 1px 0 #f0bd55, 0 1px 0 #315462;
}
#auth-modal #auth-go:hover {
  border-color: #d9a63f;
  background: linear-gradient(180deg, #d9a63f, #b98d36);
  color: #071925;
}
@media (max-width: 620px) {
  #auth-modal .pbtn { height: 44px; }
}

/* ----------------------------------------------------- market filters — deck -- */
/* The filter shelf is one permanent bar over the ledger. Every group and every
   field is on the glass at once, and a field that holds a bound says so on its
   own chip. Nothing opens in place of anything else: a chip unfolds its range
   in the one ruled row below the shelf, then folds back. */

.shell[data-screen="market"]:not(.item-view) .filters-card {
  margin: 14px 0 12px;
  overflow: visible;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .facets-head {
  min-height: 42px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

.shell[data-screen="market"]:not(.item-view) .filters-card:not(.open) .facets-head {
  border-bottom: 1px solid var(--line);
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filters-title {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .12em;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filters-actions .ghost {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: none;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filters-actions .ghost:hover {
  border-color: #315462;
  background: #0a2230;
  color: var(--ink);
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filters-actions .ghost[disabled] {
  border-color: var(--line-soft);
  background: transparent;
  color: var(--ink-4);
  opacity: .7;
}

/* The body is the shelf, at every width that draws the card. */
.shell[data-screen="market"]:not(.item-view) .filters-card .facets-body,
.shell[data-screen="market"]:not(.item-view) .filters-card.open .facets-body {
  display: block;
  padding: 9px 12px 10px;
  overflow: visible;
  background: #0f2b3a;
}

.filter-deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 18px;
}

.filter-deck #filters-catalog { display: contents; }

.filter-deck .fd-group,
.filter-deck .filter-block {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.filter-deck .fb-name,
.filter-deck .fd-label {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
}

.filter-deck .fb-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 2px;
  background: #244755;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.filter-deck .filter-fields { display: contents; }

.filter-deck .scope-switch { gap: 4px; }

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-deck .saveonly {
  height: 30px;
  padding: 0 8px;
  border: 1px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 #fff;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-deck .saveonly.on {
  border-color: #315462;
  background: linear-gradient(180deg, #d9a63f, #f0bd55);
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-deck .scope-x {
  width: 26px;
  height: 30px;
  border: 1px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  color: var(--ink-3);
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-deck .scope-x:hover {
  border-color: #315462;
  color: #f0bd55;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip {
  height: 30px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 #fff;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip:hover {
  border-color: #315462;
  background: #0a2230;
  color: var(--ink);
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip.on,
.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip.open {
  border-color: #315462;
  background: linear-gradient(180deg, #d9a63f, #f0bd55);
  color: var(--ink);
  box-shadow: inset 0 1px 0 #f0bd55, 0 1px 0 #244755;
}

.shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip .ff-mark {
  display: none;
}

.filter-deck .filter-field-chip.has-tip {
  text-decoration: none;
  border-bottom: 1px solid #315462;
}

.filter-field-chip .ff-value { font-weight: 800; }
.filter-field-chip .ff-value[hidden] { display: none; }
.filter-field-chip .ff-value::before {
  content: "·";
  margin-right: 4px;
  color: var(--ink-4);
  font-weight: 400;
}

/* The one editor row under the shelf. */
#filter-editor-host { margin: 0; padding: 0; border-top: 0; }

#filter-editor-host:has(.filter-editor:not([hidden])) {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #244755;
}

#filter-editor-host .filter-editor[hidden] { display: none; }

#filter-editor-host .filter-editor {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 7px 14px;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  box-shadow: inset 0 1px 0 #fff;
}

#filter-editor-host .filter-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}

#filter-editor-host .filter-editor-name {
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
}

#filter-editor-host .filter-editor-name em {
  margin-left: 4px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 400;
}

#filter-editor-host .filter-editor-hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.35;
}

#filter-editor-host .filter-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}

#filter-editor-host .filter-input {
  display: flex;
  align-items: center;
  gap: 5px;
}

#filter-editor-host .filter-input > span {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#filter-editor-host .filter-input input {
  width: 86px;
  height: 30px;
  padding: 0 7px;
  border: 1px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
}

#filter-editor-host .filter-input input:focus {
  border-color: #f0bd55;
  outline: none;
  box-shadow: 0 0 0 2px rgba(240, 189, 85, .22);
}

#filter-editor-host .filter-sep { display: none; }

#filter-editor-host .filter-editor-clear {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#filter-editor-host .filter-editor-x {
  width: 24px;
  height: 24px;
  border: 1px solid #315462;
  border-radius: 2px;
  background: #0a2230;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

#filter-editor-host .filter-editor-x:hover {
  border-color: #315462;
  color: var(--ink);
}

@media (max-width: 620px) {
  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facets-head {
    min-height: 52px;
    padding: 10px 14px;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card.open .facets-body {
    padding: 10px 12px 14px;
    overflow-y: auto;
  }

  .filter-deck { gap: 9px 14px; }
}

@media (max-width: 620px), (pointer: coarse) {
  .shell[data-screen="market"]:not(.item-view) .filters-card .filter-field-chip {
    height: 44px;
    min-height: 44px;
    padding: 0 11px;
  }

  .shell[data-screen="market"]:not(.item-view) .filters-card .filter-deck .saveonly,
  .shell[data-screen="market"]:not(.item-view) .filters-card .filter-deck .scope-x {
    height: 44px;
  }

  #filter-editor-host .filter-input input { height: 40px; }
  #filter-editor-host .filter-editor-clear,
  #filter-editor-host .filter-editor-x { min-height: 44px; }
}

/* The paper shell's search placeholder was the one text on the item page under
   WCAG AA (4.3:1). Tint it deeper from the same warm ink so it stays quiet but
   readable. */
.ph-search input::placeholder { color: #7f9aa0; opacity: 1; }

/* ------------------------------------------------------ tools on a phone --- */
/* The printed-sheet skin keeps functional labels at 11px and ledger rows at
   13px: a desk density that a phone cannot read at arm's length. Give the
   labels the page's own label size, the fields 16px (the size iOS will not zoom
   under), and the ledgers one more pixel of type. Scoped to the tools screen so
   the market, item and optimizer keep their own furniture. */
@media (max-width: 760px) {
  .shell[data-screen="tools"] #board .toolview :is(
    .calc-group-label,
    .calc-input-label,
    .calc-field label,
    .calc-hero-label,
    .calc-facts dt,
    .tool-field-head label,
    .tool-field-label,
    .alch-field-label,
    .skill-goal-heading,
    .skill-goal-axis,
    .plan-group legend
  ) {
    font-size: var(--text-label);
    letter-spacing: .05em;
    line-height: 1.35;
  }

  .shell[data-screen="tools"] #board .toolview :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select,
    textarea
  ) {
    font-size: 16px;
    min-height: 44px;
  }
  .shell[data-screen="tools"] .toolview.calcview .calc-input-line {
    height: 48px;
  }
  .shell[data-screen="tools"] .toolview.calcview .calc-input-line input {
    height: 46px;
    min-height: 0;
    font-size: 16px;
  }
  .shell[data-screen="tools"] .toolview .calc-mini {
    min-height: 44px;
    font-size: 14px;
  }
  .shell[data-screen="tools"] .toolview .tool-run {
    height: 46px;
    font-size: 15px;
  }
  .shell[data-screen="tools"] #board .calcview table {
    font-size: 14px;
  }
  .shell[data-screen="tools"] #board .calcview table :is(th, td) {
    line-height: 1.45;
  }
  .shell[data-screen="tools"] #board .calcview table th {
    font-size: 12px;
  }
  .shell[data-screen="tools"] #board .calcview :is(
    .calc-footnote,
    .tool-note,
    .tool-footnote,
    .calc-hero-note,
    .tax-source-note
  ) {
    font-size: 13px;
  }
  .shell[data-screen="tools"] .toolview > .page-mast .page-crumb,
  .shell[data-screen="tools"] .toolview .calc-reset {
    font-size: 12px;
  }
  .shell[data-screen="tools"] {
    --text-micro: .8125rem;
    --text-label: .875rem;
  }
  #shell[data-screen="tools"] #board .toolview-hub h3,
  .shell[data-screen="tools"] .toolview-hub h3 {
    font-size: 12px;
  }
  .shell[data-screen="tools"] .toolview-hub b {
    font-size: 13px;
  }
  /* Ledger cells set their own size, so the table's inherited size is not
     enough: name the cells to lift them off the 13px desk ledger. */
  #shell[data-screen="tools"] #board .toolview.calcview table :is(th, td) {
    font-size: 14px;
  }
  #shell[data-screen="tools"] #board .toolview.calcview table th {
    font-size: 12px;
  }
}

/* ==========================================================================
   Weather Desk — the committed system
   ========================================================================== */
:root{
  color-scheme: dark;
  --sans:"Archivo",ui-sans-serif,system-ui,sans-serif;
  --mono:"Archivo",ui-sans-serif,system-ui,sans-serif;
  --display:"Archivo",ui-sans-serif,system-ui,sans-serif;
  --bg:#071925; --bg-2:#0a202c; --rail:#06141d;
  --card:#0a2230; --card-2:#0c2532; --field:#0f2b3a; --field-2:#123340;
  --line:#1c3a46; --line-soft:#122b37; --line-strong:#315462;
  --ink:#f2ead9; --ink-2:#ccd9da; --ink-3:#87a3a9; --ink-4:#6f8b92;
  --accent:#f0bd55; --accent-2:#ffd27a; --on-accent:#071925;
  --marker:#f0bd55; --on-marker:#071925;
  --peri:#79c9b3; --accent-soft:rgba(240,189,85,.14); --accent-line:rgba(240,189,85,.45);
  --up:#79c9b3; --down:#ef8269;
  --up-soft:rgba(121,201,179,.11); --down-soft:rgba(239,130,105,.11);
  --radius:9px; --radius-sm:6px; --radius-xs:3px;
  --shadow:0 1px 2px rgba(0,0,0,.3);

  --shadow-pop:0 18px 46px rgba(0,0,0,.55);

  --hover:rgba(242,234,217,.055); --inset-line:rgba(242,234,217,.07);
  --scrim:rgba(2,10,15,.7); --scroll:#2b4f5c;
  --lime:#f2ead9; --lime-dim:#6f8b92;
 --brand:#79c9b3;
  --ch-up:#79c9b3; --ch-down:#ef8269; --ch-brand:#f0bd55; --ch-axis:#87a3a9;
  --ch-plate:#071925; --ch-grid:rgba(242,234,217,.055); --ch-grid-2:rgba(242,234,217,.09);
  --ch-frame:rgba(242,234,217,.2); --ch-cross:#87a3a9; --ch-note:#ccd9da;
  --ch-vol:#1b4552; --ch-vol-hi:#2b5a68; --ch-vol-plate:#0a2230;
  --ch-chip:#0f2b3a; --ch-chip-line:#315462;
  --ch-up-fill:rgba(121,201,179,.2); --ch-down-fill:rgba(239,130,105,.18);
  --cmp-1:#79c9b3; --cmp-2:#f0bd55; --cmp-3:#ef8269; --cmp-4:#9fb7bb;
 --chart-fill:#e75a3f; --chart-vol:#1b4552;
  --chart-isobar:rgba(242,234,217,.14);
}
html,body{background:#071925}
body{
  background-color:#071925;
  background-image:linear-gradient(180deg,#071925 0%,#0a2230 58%,#071925 100%);
  background-attachment:fixed;
  color:var(--ink);
  font-family:var(--sans);
  font-weight:400;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{font-family:var(--sans);letter-spacing:-.03em}
h1{font-weight:700}
::selection{background:var(--marker);color:var(--on-marker)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.skip{background:var(--accent);color:var(--on-accent);border:0;border-radius:var(--radius-sm);font-weight:700}

/* ------------------------------------------------------------------ chrome */
#shell .topbar{
  background:#06141d;border-bottom:1px solid #244755;box-shadow:none;
  gap:24px;
}
.topbar-brand{color:var(--ink)}
.topbar-brand .brand-word{font-weight:700;letter-spacing:-.05em}
.topbar-brand .brand-word::before{content:none!important}
.brand-sub{
  font-size:9px;font-weight:600;letter-spacing:.15em;text-transform:uppercase;
  color:var(--accent);margin-left:8px;transform:translateY(-1px);
}
@media (max-width:900px){.brand-sub{display:none}}
.topbar .rail-tab{height:34px;padding:0 10px;border-radius:var(--radius-sm);font-size:13px;font-weight:600;color:var(--ink-2)}
.topbar .rail-tab:hover{background:var(--hover);color:var(--ink)}
.topbar .rail-tab[aria-current="page"],.topbar .rail-tab.on{background:var(--marker);color:var(--on-marker)}
.topbar .rail-lbl{font-size:13px;font-weight:600;letter-spacing:0}
.topbar .ph-search{background:#0a2230;border:1px solid #244755;border-radius:var(--radius-sm);box-shadow:none;height:38px}
.topbar .ph-search:focus-within{border-color:var(--line-strong)}
.topbar .ph-search input{color:var(--ink);font-size:13px}
.topbar .ph-search input::placeholder{color:var(--ink-3)}
.tb-bell{background:none;border:0;border-radius:var(--radius-sm);color:var(--ink-2)}
.tb-bell:hover{background:var(--hover);color:var(--ink)}
.rail-marks .acct,.rail-marks #signin{color:var(--ink-2)}

/* ------------------------------------------------------------------ heads */
#shell .page-head{
  background:transparent;border-bottom:1px solid var(--line);
  padding-top:18px;padding-bottom:14px;
}
#ph-title{font-family:var(--sans);font-weight:700;color:var(--ink);letter-spacing:-.035em}
.shell[data-screen="market"]:not(.item-view) #ph-title{font-size:30px}
.ph-copy h1,.ph-copy>div{font-weight:700}

/* ---------------------------------------------------------------- filters */
.filters-card,.list-card,.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:none;
}
.filters-card{margin-top:14px;overflow:hidden}
.filters-card .facets-head{border-bottom:1px solid var(--line-soft);min-height:46px;padding:0 14px}
.filters-title{font-size:10px;font-weight:700;letter-spacing:.15em;text-transform:uppercase;color:var(--accent)}
.filters-actions .ghost,.filters-reset{color:var(--ink-3);border:0;background:none;font-size:10px;letter-spacing:.08em;text-transform:uppercase}
.facets-body{padding:12px 14px 14px;gap:10px}
.fd-label,.facet-label,.filter-label{
  font-size:9px;font-weight:600;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-3);
}
.saveonly,.filter-field-chip,.filter-search,.scope-x{
  background:var(--field);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--ink-2);
}
.saveonly:hover,.filter-field-chip:hover{border-color:var(--line-strong);color:var(--ink)}
.saveonly.on,.filter-field-chip.on,.filter-field-chip[aria-pressed="true"]{
  background:var(--accent);border-color:var(--accent);color:var(--on-accent);
}
.saveonly.on .s-star,.saveonly.on .lbl,.saveonly.on em,.saveonly.on .s-caret{color:var(--on-accent)}
.filter-field-chip .ff-mark{background:currentColor;opacity:.5}
.filter-search input{color:var(--ink)}
.filter-state{background:var(--accent-soft);color:var(--accent);border-radius:3px}
.filter-active,.filter-block{border-color:var(--line-soft)}
.sbtn{
  background:#e75a3f;border:1px solid #e75a3f;color:#fff7ec;border-radius:var(--radius-sm);font-weight:600;
}
.sbtn:hover{background:#f47a5f;border-color:#f47a5f}
.sbtn.danger{background:transparent;border-color:var(--down);color:var(--down)}

/* ------------------------------------------------------------------ board */
.shell[data-screen="market"]:not(.item-view) .list-card{
  margin-top:12px;overflow:hidden;background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:none;
}
.sortbar{
  background:#081d29;border-bottom:1px solid var(--line);border-radius:0;
  padding:8px 12px;gap:4px;
}
.sortbar button{
  border:1px solid transparent;background:none;border-radius:4px;
  font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);
}
.sortbar button:hover{background:var(--hover);color:var(--ink)}
.sortbar button[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent-line);color:var(--accent)}
.board-filter{border:1px solid var(--line);background:var(--field);border-radius:4px;color:var(--ink-2)}
.board-body th{
  background:#071925;color:var(--ink-3);font-size:9px;font-weight:600;letter-spacing:.12em;
  border-bottom:1px solid #2b4d5a;
}
.board-body th .sort,.board-body th button{color:inherit;font:inherit;letter-spacing:inherit}
.board-body td{border-bottom:1px solid var(--line-soft);color:var(--ink-2);font-size:12.5px}
.board-body tbody tr:hover{background:rgba(240,189,85,.055)}
.board-body tbody tr.saved{background:rgba(240,189,85,.09)}
.board-body .col-name .name,.board-body .item-cell .name{color:var(--ink);font-weight:500}
.board-body td.col-buy,.board-body td.col-buy .num,.board-body td.buy{color:var(--accent)}
.board-body td.col-sell,.board-body td.col-sell .num,.board-body td.sell{color:var(--ink)}
.board-body .tag,.board-body .pill,.board-body .ftag{
  border:1px solid #2e515e;color:#93adb2;background:transparent;border-radius:3px;
  font-size:9px;font-weight:600;letter-spacing:.05em;
}
.board-body .mkt-delta{border-radius:3px;font-weight:600}
.board-body td.up .mkt-delta,.mkt-delta.up{background:rgba(121,201,179,.12);color:var(--up)}
.board-body td.down .mkt-delta,.mkt-delta.down{background:rgba(239,130,105,.12);color:var(--down)}
.board-body td.flat .mkt-delta,.mkt-delta.flat{background:transparent;color:var(--ink-3)}
.board-body .row-spark{color:var(--accent);opacity:.85}
.board-body .row-spark.up{color:var(--up)}.board-body .row-spark.down{color:var(--down)}
.pager{border-top:1px solid var(--line);padding:10px 12px}
.pager button{background:var(--field);border:1px solid var(--line);color:var(--ink-3);border-radius:3px}
.pager button[aria-current="true"]{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}

/* ------------------------------------------------------------------- item */
.shell.item-view .itemview.tape,.itemview.tape{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:none;
}
.itemview.tape .tp-q{border-color:var(--line)}
.itemview.tape .tp-q>dt{color:var(--ink-3);font-size:9px;letter-spacing:.12em;text-transform:uppercase}
.itemview.tape .tp-q>dd,.itemview.tape .tp-q>b{font-family:var(--sans);font-weight:600;letter-spacing:-.03em}
.itemview.tape .tp-q>dd.up,.itemview.tape .tp-q>b.up{color:var(--up)}
.itemview.tape .tp-q>dd.down,.itemview.tape .tp-q>b.down{color:var(--down)}
.itemview.tape .tp-title{font-weight:700;letter-spacing:-.035em}
.itemview.tape .tp-band-head,.ix-section-head{border-bottom-color:var(--line)}
.itemview.tape .tp-band-head h3,.ix-section-head h2{font-size:10px;font-weight:700;letter-spacing:.15em;text-transform:uppercase;color:var(--accent)}
.itemview.tape .tp-action,.itemview.tape .tp-actions button,.itemview.tape .ix-btn{
  background:var(--field);border:1px solid var(--line-strong);border-radius:var(--radius-sm);color:var(--ink-2);
}
.itemview.tape .tp-action:hover,.itemview.tape .tp-actions button:hover{background:var(--hover);color:var(--ink)}
.itemview.tape .tp-action.primary,.itemview.tape .tp-cta,.itemview.tape .ix-cta{
  background:#e75a3f;border-color:#e75a3f;color:#fff7ec;
}
.chart-wrap,.chart-card{background:transparent}
.chart-top{border-bottom:1px solid var(--line-soft)}
.ranges button,.chart-tools button{color:var(--ink-3);border-radius:3px}
.ranges button[aria-pressed="true"]{background:var(--accent);color:var(--on-accent)}
.itemview.tape .ix-section{border-top:1px solid var(--line)}
.reading-rail,.reading-band,.calc-card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
}
.calc-card{border:0;background:transparent}
.calc-plate{background:var(--field);border:1px solid var(--line);border-radius:var(--radius-sm)}
.calc-plate.buy{border-color:rgba(121,201,179,.3);background:rgba(121,201,179,.06)}
.calc-plate.sell{border-color:rgba(239,130,105,.3);background:rgba(239,130,105,.06)}
.calc-plate span,.calc-plate dt{color:var(--ink-3)}
.calc-plate b,.calc-plate dd{color:var(--ink);font-weight:600}
.press-card,.fill-card{background:transparent;border:0}
.press-tape{border-color:var(--line-soft)}
.reading-gate,.card-lock{background:var(--field);border-color:var(--line)}
.press-hero .press-kicker{letter-spacing:.13em;text-transform:uppercase;font-size:9px}
.press-ledger,.fill-row{border-color:var(--line-soft)}

/* ------------------------------------------------------------ tools, hubs */
.toolview,.toolview-hub,.settings,.opt-setup,.opt-board,.items-hub,.hub,.listview,.flips-view,.alerts-view{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:none;
}
/* The items hub is laid inside the card that already frames the page: a border
   here drew a second edge one pixel inside the card's, on all four sides. */
.card .items-hub{
  background:transparent;border:0;border-radius:0;
}

.toolview .tp-band-head,.toolview h1,.toolview h2,.toolview h3,
.settings h1,.settings h2,.settings h3,.opt-setup h2,.items-hub h1,.hub h1{color:var(--ink)}
.toolview input,.toolview select,.settings input,.settings select,.opt-input{
  background:var(--field);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--ink);
}
.toolview input:focus,.settings input:focus,.opt-input:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 2px var(--accent-soft)}
.toolview label,.settings label,.opt-control-label{color:var(--ink-3)}
.toolview .tp-run,.toolview button[type="submit"],.settings .sbtn,.opt-run,.flip-save,.abtn{
  background:#e75a3f;border:1px solid #e75a3f;color:#fff7ec;border-radius:var(--radius-sm);font-weight:600;
}
.toolview .tp-run:hover,.toolview button[type="submit"]:hover,.opt-run:hover{background:#f47a5f;border-color:#f47a5f}
.opt-chip,.opt-slot{background:var(--field);border:1px solid var(--line);border-radius:999px;color:var(--ink-2)}
.opt-slot[aria-pressed="true"],.opt-chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.opt-slot-grid,.opt-quick-budgets{gap:6px}
.toolview table th,.settings table th,.items-hub table th{border-color:var(--line);color:var(--ink-3)}
.toolview table td,.settings table td,.items-hub table td{border-color:var(--line-soft);color:var(--ink-2)}
.hub-card,.tool-card,.item-card,.cat-card,.list-card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:none;
}

/* ------------------------------------------------------------- account/veil */
.abtn{background:var(--field);border:1px solid var(--line-strong);color:var(--ink-2)}
.abtn:hover{background:var(--hover);color:var(--ink)}
.view-loading .skel,.skel{background:linear-gradient(90deg,var(--field),var(--field-2),var(--field));}
.dialog,.modal,.auth-card,.notif-drawer{
  background:var(--card);border:1px solid var(--line-strong);border-radius:var(--radius);box-shadow:var(--shadow-pop);
}
.auth h2,.dialog h2{color:var(--ink)}
.auth input,.dialog input{background:var(--field);border:1px solid var(--line);color:var(--ink);border-radius:var(--radius-sm)}

/* ---------------------------------------------------------------- phones */
@media (max-width:620px){
  .filters-card{border-radius:var(--radius);margin-top:10px}
  .sortbar{overflow-x:auto;flex-wrap:nowrap}
  .shell[data-screen="market"]:not(.item-view) .list-card{margin-top:10px}
  .topbar-brand .brand-word{font-size:21px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* ------------------------------------------------------------- chart weather */
.chart-isobars{opacity:.6;pointer-events:none}
.chart-isobars path{stroke:var(--chart-isobar);stroke-width:1;fill:none;stroke-linecap:round}
/* ------------------------------------------------------------- refinements */
.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:nth-child(1){background:rgba(240,189,85,.085)}
.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:nth-child(2){background:rgba(240,189,85,.045)}
.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:nth-child(3){background:rgba(240,189,85,.025)}
.shell[data-screen="market"]:not(.item-view) .board-body tbody tr:hover{background:rgba(240,189,85,.1)}
.shell[data-screen="market"]:not(.item-view) .bar-cell .bar{display:none}
.shell[data-screen="market"]:not(.item-view) .vol-short{display:none}
.shell[data-screen="market"]:not(.item-view) .vol-full{display:inline}
.calc-plate.buy{border-color:rgba(240,189,85,.32);background:rgba(240,189,85,.07)}
.calc-plate.sell{border-color:var(--line);background:var(--field)}
#shell .page-head .ph-copy{min-width:0;max-width:100%;flex:1 1 auto;width:auto}
#shell .page-head .ph-copy h1{max-width:100%}
/* Primary action is the warm front: coral, never the marker amber. */
.shell .sbtn:not(.danger){background:#e75a3f!important;border-color:#e75a3f!important;color:#fff7ec!important}
.shell .sbtn:not(.danger):hover{background:#f47a5f!important;border-color:#f47a5f!important}
.shell .calc-plan{background:#e75a3f!important;border-color:#e75a3f!important;color:#fff7ec!important}
.shell .calc-plan:hover{background:#f47a5f!important;border-color:#f47a5f!important}
.shell .reading-gate-btn,.shell .abtn.flip-signin{background:var(--field);border:1px solid var(--line-strong);color:var(--ink-2)}
@media (max-width:620px){
  .board-body tbody tr{position:relative;grid-template-columns:repeat(4,minmax(0,1fr));column-gap:0}
  .board-body td.col-name{padding-right:54px}
  .board-body td.col-change{
    position:absolute;top:9px;right:0;width:48px;height:auto;min-height:0;
    display:flex;flex-direction:column;align-items:flex-end;gap:1px;
    padding:0;border:0;font-size:10px;line-height:1.2;
  }
  .board-body td.col-change .mkt-win{font-size:8px;letter-spacing:.08em;color:var(--ink-4);text-transform:uppercase}
  .board-body td.col-roi{padding-right:2px}
  .board-body td.col-roi .mkt-delta{font-size:12px;padding:0;background:none}
  .board-body .vol-full{display:none}
  .board-body .vol-short{display:inline}
}

@media (max-width:620px){
  #shell .topbar{gap:8px;flex-wrap:nowrap}
  #shell .topbar-brand{display:flex;width:auto;flex:0 0 auto;margin:0}
  #shell .topbar-brand .brand-mark{display:none}
  #shell .topbar-brand .brand-word{display:inline;font-size:19px;letter-spacing:-.045em}
  #shell .topbar .topbar-tools{flex:1 1 auto;min-width:0;display:flex;gap:8px}
  #shell .topbar .ph-search{flex:1 1 auto;min-width:0;width:auto}
  #shell .topbar .tb-bell{flex:0 0 auto}
  .shell[data-screen] .workspace{padding-bottom:76px}
}

@media (max-width:620px){
  /* The wordmark lives in the station kicker on a phone; the topbar stays one row. */
  #shell .topbar-brand{display:none}
}

/* Every primary action carries navy type on coral: 5.05:1, where cream was 3.33. */
.shell .sbtn:not(.danger),.shell .calc-plan,.shell .tp-cta,
.toolview button[type="submit"],.shell .opt-run,.shell .flip-save,
.nf-btn.primary,#auth-go{
  color:#071925!important;
}
#auth-go{background:#e75a3f!important;border-color:#e75a3f!important}
#auth-go:hover{background:#f47a5f!important;border-color:#f47a5f!important}

:root{--chart-isobar:rgba(242,234,217,.19)}
.chart-isobars{opacity:.75}

/* Quote prices are prices; only the percentage beside them carries direction. */
.tp-q #q-buy{color:var(--accent)}
.tp-q #q-sell{color:var(--ink)}
.tp-q .q-pct.down{color:var(--down)}
.tp-q .q-pct.up{color:var(--up)}
.calc-plate.sell span,.calc-plate.sell b,.calc-plate.sell dt,.calc-plate.sell dd{color:var(--ink)}
.calc-plate.sell.on span,.calc-plate.sell.on b{color:var(--ink)}
.calc-plate.buy b,.calc-plate.buy dd{color:var(--accent)}
@media (max-width:620px){
  .board-body tbody tr:nth-child(-n+3){background:transparent!important}
  .board-body tbody tr:hover{background:rgba(240,189,85,.06)!important}
  .board-body td.col-roi{padding-right:6px}
}

@media (max-width:620px){
  #shell .topbar{
    display:grid;grid-template-columns:auto minmax(0,1fr);
    grid-template-rows:auto;align-items:center;gap:8px;
    height:56px;padding:0 16px;
  }
  #shell .topbar-brand{display:flex;grid-column:1;grid-row:1;margin:0;align-self:center}
  #shell .topbar .rail{display:none}
  #shell .topbar .topbar-tools{grid-column:2;grid-row:1;min-width:0;display:flex;gap:8px}
  #shell .topbar .ph-search{flex:1 1 auto;min-width:0;width:auto;height:38px}
}
