/* Drayworth — the bench. Line-art: one thin stroke everywhere, no fills to speak of, one amber accent.
   Display: Outfit. Body: IBM Plex Sans. Ground #0F1218, ink #E4E1D6, accent #F2B84B. */
:root {
  --ground: #0F1218; --ink: #E4E1D6; --amber: #F2B84B; --panel: #151922; --rule: #2A3040; --dim: #8C92A3;
  --stroke: rgba(228,225,214,.55); --faint: rgba(228,225,214,.14);
  --tb: 96px; --gutter: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--ground); color: var(--ink); font: 15px/1.5 "IBM Plex Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { font-family: Outfit, "IBM Plex Sans", sans-serif; font-weight: 500; letter-spacing: -.01em; margin: 0; }
.num { font-family: "IBM Plex Sans", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---- the tollbooth: fixed top strip ------------------------------------------------------------ */
#tollbooth {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: var(--tb);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "mark cuff" "nav buy";
  align-items: center; gap: 6px 10px; padding: 8px var(--gutter) 6px;
  background: rgba(15,18,24,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
.tb-mark { grid-area: mark; display: flex; align-items: center; gap: 9px; text-decoration: none; min-width: 0; }
.tb-mark img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--rule); }
.tb-mark b { font-family: Outfit, sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .01em; white-space: nowrap; }
.tb-nav { grid-area: nav; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tb-nav::-webkit-scrollbar { display: none; }
.tb-nav a { text-decoration: none; font-size: 13px; color: var(--dim); padding: 4px 10px; border: 1px solid transparent; border-radius: 999px; white-space: nowrap; }
.tb-nav a[aria-current] { color: var(--ink); border-color: var(--rule); }
.tb-buy { grid-area: buy; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 6px 12px; justify-self: end; border: 1px solid var(--amber); border-radius: 6px; color: var(--amber); white-space: nowrap; font-size: 13px; }
.tb-buy i { font-style: normal; font-weight: 600; }
.tb-buy span { color: var(--dim); }
.tb-buy[data-live="1"] { background: var(--amber); color: var(--ground); }
.tb-buy[data-live="1"] span { color: var(--ground); font-weight: 500; }
.tb-cuff { grid-area: cuff; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 7px 12px; font-size: 13px; color: var(--dim); white-space: nowrap; }
.tb-cuff[data-on="1"] { color: var(--ink); border-color: var(--stroke); }

/* ---- the bench: one column, recomposes past 1000px ------------------------------------------- */
#bench { max-width: 1180px; margin: 0 auto; padding: calc(var(--tb) + 22px) var(--gutter) 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.slip { min-width: 0; }
.manifestcol { min-width: 0; display: grid; gap: 16px; align-content: start; }
.waybill { border-top: 1px dashed var(--rule); padding-top: 14px; color: var(--dim); font-size: 12px; display: grid; gap: 4px; }
.waybill code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11px; word-break: break-all; color: var(--ink); opacity: .8; }
.waybill a { color: var(--ink); }

/* ---- the slip: the instrument ----------------------------------------------------------------- */
.overline { color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.slip h1 { font-size: 40px; line-height: 1.02; font-weight: 300; }
.slip h1 b { font-weight: 700; color: var(--amber); }
.slip .lede { color: var(--dim); margin: 12px 0 18px; max-width: 58ch; }
.drayart { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.instrument { border: 1px solid var(--rule); border-radius: 10px; padding: 18px 16px 14px; background: linear-gradient(180deg, rgba(228,225,214,.025), transparent); }
.declare { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.declare .cap { color: var(--dim); font-size: 13px; }
.declare .worthnum { font-family: Outfit, sans-serif; font-weight: 700; font-size: 84px; line-height: .9; color: var(--amber); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.declare .worthnum small { font-size: 18px; font-weight: 300; color: var(--dim); margin-left: 6px; letter-spacing: 0; }
.beamwrap { position: relative; margin: 14px 0 6px; }
.beam { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; display: block; }
.beam:focus { outline: none; }
.beam::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--amber) var(--fill, 0%), var(--rule) var(--fill, 0%)); }
.beam::-moz-range-track { height: 2px; background: var(--rule); }
.beam::-moz-range-progress { height: 2px; background: var(--amber); }
.beam::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -14px; border-radius: 50%; background: var(--ground); border: 2px solid var(--amber); box-shadow: 0 0 0 6px rgba(242,184,75,.12); }
.beam::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--ground); border: 2px solid var(--amber); }
.beam[disabled]::-webkit-slider-thumb { border-color: var(--rule); box-shadow: none; }
.beamticks { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; padding: 0 2px; }
.receipt { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 14px; }
.receipt li { display: flex; align-items: baseline; gap: 8px; }
.receipt li em { font-style: normal; color: var(--dim); white-space: nowrap; }
.receipt li i { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-4px); min-width: 12px; }
.receipt li b { font-weight: 500; white-space: nowrap; }
.receipt li[data-t="pass"] b { color: #7ED9A2; }
.receipt li[data-t="caught"] b { color: #E27A6A; }
.receipt li[data-t="sum"] { border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 2px; }
.receipt li[data-t="sum"] b { font-family: Outfit, sans-serif; font-size: 18px; }
.loadrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.loadbtn { flex: 1 1 220px; min-height: 52px; border: none; border-radius: 8px; background: var(--amber); color: var(--ground); font-family: Outfit, sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.loadbtn[disabled] { background: var(--panel); color: var(--dim); border: 1px solid var(--rule); cursor: default; }
.loadnote { color: var(--dim); font-size: 13px; flex: 1 1 200px; margin: 0; }

/* ---- the manifest column ---------------------------------------------------------------------- */
.plate { border: 1px solid var(--rule); border-radius: 10px; padding: 14px 14px 12px; background: var(--panel); }
.platehead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.platehead h3 { font-size: 15px; font-weight: 500; }
.platehead span { color: var(--dim); font-size: 12px; white-space: nowrap; }
.gateclock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gauge { border-top: 1px solid var(--rule); padding-top: 8px; min-width: 0; }
.gauge dt { color: var(--dim); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.gauge dd { margin: 2px 0 0; font-family: Outfit, sans-serif; font-weight: 500; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cargo { display: grid; gap: 6px; }
.cargorow { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.cargorow .slotno { color: var(--dim); font-size: 12px; }
.cargorow .who { min-width: 0; display: grid; gap: 3px; }
.cargorow .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worthbar { height: 4px; background: var(--faint); border-radius: 2px; overflow: hidden; }
.worthbar i { display: block; height: 100%; background: var(--stroke); width: var(--w, 0%); }
.cargorow[data-caught="1"] .worthbar i { background: #E27A6A; }
.cargorow[data-mine="1"] .worthbar i { background: var(--amber); }
.cargorow .worthno { font-family: Outfit, sans-serif; font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.cargorow[data-caught="1"] .worthno { color: #E27A6A; }
.stamp { display: inline-block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; margin-left: 6px; color: #E27A6A; vertical-align: middle; }
.hush { color: var(--dim); font-size: 13px; margin: 0; }
.tapeln { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--faint); }
.tapeln:last-child { border-bottom: none; }
.tapeln u { text-decoration: none; color: var(--dim); font-size: 12px; white-space: nowrap; }
.tapeln[data-k="caught"] { color: #E27A6A; }
.tapeln[data-k="inspected"] { color: var(--amber); }
.primer ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13px; color: var(--dim); }
.primer b { color: var(--ink); font-weight: 500; }

/* ---- leaves: rules, hauls, mine, 404 ---------------------------------------------------------- */
.leaf h2 { font-size: 30px; font-weight: 300; margin-bottom: 10px; }
.leaf p { max-width: 64ch; }
.leaf p b { font-weight: 600; }
.scrollx { overflow-x: auto; margin-top: 12px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.ledger th { text-align: left; color: var(--dim); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.ledger td { padding: 7px 8px; border-bottom: 1px solid var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.smallbtn { min-height: 32px; font-size: 12px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--amber); background: none; color: var(--amber); }

/* ---- the hatch: modal ------------------------------------------------------------------------- */
#hatch { display: none; }
#hatch:not([hidden]) { display: flex; position: fixed; inset: 0; z-index: 40; background: rgba(15,18,24,.78); align-items: flex-end; justify-content: center; padding: 0; }
.hatchbox { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--rule); border-radius: 14px 14px 0 0; padding: 14px 16px 22px; }
.hatchhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-family: Outfit, sans-serif; font-weight: 500; font-size: 18px; }
.hatchshut { background: none; border: 1px solid var(--rule); border-radius: 50%; width: 32px; height: 32px; color: var(--dim); }
.hatchbody p { margin: 8px 0; font-size: 14px; }
.hatchbody .receipt { margin-top: 6px; }
.wellpick { display: grid; gap: 8px; }
.wellpick button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); background: none; border-radius: 8px; }
.wellpick img { width: 22px; height: 22px; }
.sparknote { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--ground); padding: 9px 14px; border-radius: 6px; font-size: 13px; max-width: calc(100vw - 32px); }

/* ---- widths ------------------------------------------------------------------------------------ */
@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .slip h1 { font-size: 52px; }
  .declare .worthnum { font-size: 112px; }
  .instrument { padding: 22px 22px 18px; }
}
@media (min-width: 900px) {
  :root { --tb: 64px; }
  #tollbooth { grid-template-columns: auto 1fr auto auto; grid-template-areas: "mark nav buy cuff"; gap: 18px; padding: 0 var(--gutter); }
  .tb-nav { justify-content: flex-start; }
}
@media (min-width: 1000px) {
  #bench { grid-template-columns: minmax(0, 1fr) 372px; grid-template-areas: "slip side" "foot foot"; gap: 28px 40px; align-items: start; padding-top: calc(var(--tb) + 34px); }
  .slip { grid-area: slip; }
  .manifestcol { grid-area: side; position: sticky; top: calc(var(--tb) + 20px); }
  .waybill { grid-area: foot; }
  .slip h1 { font-size: 60px; }
  .declare .worthnum { font-size: 132px; }
  .gauge dd { font-size: 22px; }
  #hatch:not([hidden]) { align-items: center; padding: 20px; }
  .hatchbox { border-radius: 14px; }
}
