/* Sailings: a map and a list beside it on every tab (Planning, Live,
   History), sized to the screen so the page itself does not scroll; plus
   the lane panel and the live part of a vessel's panel.

   The map is dark in both themes: it is a chart, and a dark sea makes the
   ships and lanes the brightest things on it. Its colours are its own,
   below; everything else uses the tokens. */

/* ---------- the frame: map left, list right, one screen ---------- */
.wrap:has(> .sx) { max-width: none; padding: var(--space-3) var(--space-4); }
/* A panel over Sailings floats over the list and never docks: docked, it
   took the width from the map. The scrim stays a click-to-close, but light,
   so the route drawn on the map is still there to see. */
@media (min-width: 1600px) {
  .shell:has(.sx) .main { padding-right: 0; }
  .shell:has(.sx):has(> .main .panel) .scrim { display: block; }
}
.shell:has(.sx) .scrim { background: rgba(10, 16, 23, .18); }
.sx {
  display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--space-3);
  height: calc(100dvh - var(--strip-h) - 2 * var(--space-3));
  min-height: 520px;
}
.sx-map { position: relative; min-height: 0; border-radius: var(--radius-lg); overflow: hidden; background: #0a1017;
          border: 1px solid #1a2532; }
.sx-side { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
           background: var(--surface); overflow: hidden; }
.sx-head { flex: none; display: grid; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--border-soft); }
.sx-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sx-foot { flex: none; border-top: 1px solid var(--border-soft); font-size: var(--text-xs); }
.sx-foot > summary { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
                     color: var(--ink-faint); cursor: pointer; list-style: none; }
.sx-foot > summary::-webkit-details-marker { display: none; }
.sx-foot > summary:hover { color: var(--ink); }
.sx-foot > summary .icon { --icon-size: 12px; }
.sx-foot .v-about-list { padding: 0 var(--space-3) var(--space-3); max-height: 30vh; overflow-y: auto; }

/* The phase tabs on Live: four numbers that are also the switch. */
.sx-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 2px;
           background: var(--surface-sunk); border: 1px solid var(--border); border-radius: var(--radius-md); }
.sx-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: var(--space-2) var(--space-3);
          border-radius: calc(var(--radius-md) - 2px); color: var(--ink-muted); text-decoration: none; min-width: 0; }
.sx-tab b { font-size: var(--text-lg); color: var(--ink); letter-spacing: -0.02em; line-height: 1.1; }
.sx-tab span { font-size: var(--text-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sx-tab:hover { color: var(--ink); }
.sx-tab[aria-current="true"] { background: var(--surface-raised); box-shadow: var(--shadow-card); color: var(--ink); }
.sx-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.seg--sub { justify-self: start; }
.sx-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: 0; }
.sx-filters select { width: 100%; min-width: 0; height: 30px; padding-top: 0; padding-bottom: 0; font-size: var(--text-xs); }
/* Live: Monitored, carrier, fruit. The toggle's state is a fill, like every selection. */
.sx-filters--live { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
.sx-toggle { display: inline-flex; align-items: center; gap: var(--space-2); height: 30px; padding: 0 var(--space-3);
             border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
             font-size: var(--text-xs); color: var(--ink-muted); cursor: pointer; white-space: nowrap; user-select: none; }
.sx-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sx-toggle .icon { --icon-size: 13px; }
.sx-toggle b { color: var(--ink-faint); font-weight: 500; }
.sx-toggle:hover { color: var(--ink); }
.sx-toggle:has(input:checked) { background: var(--accent-tint-strong); border-color: transparent; color: var(--ink); font-weight: 600; }
.sx-toggle:has(input:checked) b { color: var(--ink); }
.sx-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 520px) { .sx-filters--live { grid-template-columns: 1fr 1fr; } .sx-filters--live .sx-toggle { grid-column: 1 / -1; justify-self: start; } }

/* The monitored ships themselves, above the phase's rows. */
.sx-watch { padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--border-soft); background: var(--surface-sunk); font-size: var(--text-xs); }
.sx-watch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sx-watch li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2); min-height: 28px; }
.sx-watch-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-watch-name:hover { text-decoration: underline; }
.sx-watch .sx-empty { padding: var(--space-2) 0; }
.sx-watch-clear { margin-top: var(--space-2); }
.sx-mon { display: inline-flex; vertical-align: -1px; margin-right: var(--space-1); color: var(--ink-muted); }
.sx-mon .icon { --icon-size: 12px; }

.sx-sum { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-xs); color: var(--ink-muted); }
.sx-sum .btn { margin-left: auto; }

/* ---------- the list ---------- */
.sx-group { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
            padding: var(--space-2) var(--space-3); background: var(--surface-sunk); border-bottom: 1px solid var(--border-soft);
            font-size: var(--text-xs); color: var(--ink-muted); }
.sx-group > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-group b { color: var(--ink); }
.sx-group .icon { --icon-size: 12px; color: var(--accent); }
.sx-group .mono { font-size: var(--text-2xs); }
.sx-row { display: grid; gap: 2px; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-soft);
          color: var(--ink); text-decoration: none; font-size: var(--text-sm); }
.sx-row.is-link:hover, .sx-row.is-lit { background: var(--accent-tint); }
.sx-row[aria-current="true"] { background: var(--accent-tint-strong); }
.sx-row.is-thin { color: var(--ink-muted); }
.sx-r1, .sx-r2, .sx-r3 { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.sx-r1 > :first-child, .sx-r2 > :first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-r1 > :not(:first-child), .sx-r2 > :not(:first-child) { flex: none; white-space: nowrap; }
.sx-r2 { font-size: var(--text-xs); }
.sx-r3 { font-size: var(--text-2xs); white-space: nowrap; overflow: hidden; }
.sx-name { font-weight: var(--weight-semi); }
.sx-when { font-size: var(--text-xs); }
.sx-meta { margin-left: auto; flex: none; }
.sx-empty { margin: 0; padding: var(--space-5) var(--space-3); font-size: var(--text-sm); color: var(--ink-muted); }
/* The markets, folded: a line each, its sailings beneath when opened. */
.sx-index { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
            padding: var(--space-2) var(--space-3); font-size: var(--text-xs); border-bottom: 1px solid var(--border-soft); }
.sx-index b { color: var(--ink); }
.sx-index-acts { display: flex; gap: 2px; }
.sx-market { border-bottom: 1px solid var(--border-soft); }
summary.sx-group { display: grid; gap: 2px; justify-content: stretch; cursor: pointer; list-style: none; background: var(--surface-raised);
                   border-bottom: 0; padding: var(--space-2) var(--space-3); }
summary.sx-group::-webkit-details-marker { display: none; }
summary.sx-group:hover { background: var(--surface-sunk); }
summary.sx-group:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sx-market[open] > summary.sx-group { background: var(--surface-sunk); border-bottom: 1px solid var(--border-soft); }
.sx-g1 { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-sm); }
.sx-g1 b { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-g1 .sx-gports { flex: 1; min-width: 0; font-size: var(--text-2xs); color: var(--ink-faint); }
.sx-chev { --icon-size: 14px; color: var(--ink-faint); transition: transform var(--motion-fast) var(--ease); }
.sx-market[open] .sx-chev { transform: rotate(90deg); }
.sx-gn b { color: var(--ink); }
.sx-g2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-3); min-width: 0; padding-left: calc(14px + var(--space-2));
         font-size: var(--text-2xs); color: var(--ink-muted); white-space: nowrap; }
.sx-g2 b { color: var(--ink); font-weight: var(--weight-semi); }
.sx-gports { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-gstk { flex: none; margin-left: auto; font-size: var(--text-2xs); }

/* A sailing: the ship and when it leaves; from → to with the days between,
   and when it lands; who sells it, and the one thing to act on — whether its
   reefer stack is still open. Closed, the card steps back. */
.sx-row.is-closed { color: var(--ink-muted); }
.sx-row.is-closed .sx-name, .sx-row.is-closed .sx-leg { opacity: .6; }
.sx-sail { gap: var(--space-1); padding: var(--space-2) var(--space-3) var(--space-2); }
.sx-sail.is-link { cursor: pointer; }
.sx-s-top { display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: 24px; }
.sx-s-ship { --icon-size: 14px; flex: none; color: var(--ink-faint); }
.sx-s-top .sx-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.sx-s-top a.sx-name:hover { text-decoration: underline; }
.sx-s-top a.sx-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.sx-s-top > :not(.sx-name):not(.sx-s-ship) { flex: none; white-space: nowrap; }
/* Show on the map: a quiet icon until it is pressed, then a fill. */
.sx-locate { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -2px -4px -2px 0; padding: 0;
             border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-faint); cursor: pointer; }
.sx-locate .icon { --icon-size: 15px; }
.sx-locate:hover { color: var(--ink); background: var(--surface-sunk); }
.sx-locate:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.sx-locate[aria-pressed="true"] { color: var(--accent); background: var(--accent-tint-strong); }
/* Leaves and lands as two dates in columns, the ports beneath, the days at sea between. */
.sx-sail .sx-leg { display: grid; grid-template-columns: minmax(0, auto) minmax(40px, 1fr) minmax(0, auto); align-items: center;
                   gap: var(--space-2); padding-left: calc(14px + var(--space-2)); }
.sx-sail .sx-end { display: grid; gap: 0; max-width: none; min-width: 0; }
.sx-sail .sx-end.is-to { text-align: right; }
.sx-sail .sx-when, .sx-sail .sx-arr { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--ink); white-space: nowrap; }
.sx-pname { font-size: var(--text-xs); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-sail .sx-line { min-width: 40px; padding: 0 var(--space-2); }
.sx-sail .sx-r3 { gap: var(--space-3); align-items: center; padding-left: calc(14px + var(--space-2)); color: var(--ink-muted); }
.sx-how { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.sx-how .icon, .sx-sail .sx-meta .icon { --icon-size: 11px; color: var(--ink-faint); }
.sx-how.is-ts .icon { color: var(--caution); }
.sx-how.is-warn { color: var(--caution); }
.sx-how.is-warn .icon { color: currentColor; }
.sx-sail .sail-lines { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sx-sail .sx-meta { display: inline-flex; align-items: center; gap: 3px; }
.sx-leg { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-xs); }
.sx-end { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-line { flex: 1; min-width: 28px; display: flex; align-items: center; gap: var(--space-1); color: var(--ink-faint); }
.sx-line i { flex: 1; height: 1px; background: var(--border-strong); }
.sx-line i:last-child { position: relative; }
.sx-line i:last-child::after { content: ""; position: absolute; right: 0; top: -3px; border: 3.5px solid transparent;
                               border-left: 5px solid var(--border-strong); border-right: 0; }
.sx-line em { font-style: normal; font-size: var(--text-2xs); color: var(--ink-muted); }
.sx-arr { flex: none; color: var(--ink-muted); }
.stk.is-none { color: var(--ink-faint); }

.sx-none { margin: 0; padding: var(--space-3); font-size: var(--text-xs); }

.sail-dole { display: inline-flex; align-items: center; gap: 2px; flex: none; font-size: var(--text-2xs);
             font-weight: var(--weight-semi); color: var(--accent); }
.sail-dole .icon { --icon-size: 11px; }
.firm { font-size: var(--text-2xs); color: var(--ink-faint); white-space: nowrap; }
.firm--ts { color: var(--caution); }

.lv-ports, .lv-mix { white-space: nowrap; }
.lv-fruit.is-inline { display: inline; }
.lv-late.is-warn { color: var(--caution); font-weight: var(--weight-semi); }
.lv-late.is-bad { color: var(--critical); font-weight: var(--weight-semi); }

/* ---------- the map ---------- */
.sm { position: absolute; inset: 0; user-select: none; }
.sm-svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; --k: 1; }
.sm-svg:active { cursor: grabbing; }
.sm-sea { fill: #0a1017; }
.sm .m { transform: scale(var(--k)); }

.sm-lane { fill: none; stroke-width: var(--w); vector-effect: non-scaling-stroke; stroke-linecap: round; opacity: .55; cursor: pointer;
           transition: opacity 120ms ease; }
.sm-lane:hover, .sm-lane.is-lit { opacity: 1; }
/* A ship's line to its next port shows when you point at the ship or its
   row: forty of them at once cross Africa and say nothing. On the Planning
   map, where only ships bound for our ports have one, they always show. */
.sm-route { fill: none; stroke-width: 1.2px; vector-effect: non-scaling-stroke; stroke-dasharray: 2 4; opacity: 0;
            transition: opacity 120ms ease; }
.sm-routes.is-always .sm-route { opacity: .5; }
.sm-route.is-lit { opacity: 1; stroke-width: 1.8px; }

.sm-port { fill: #0e2a1d; stroke: #3ddc84; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.sm-badge { fill: #d7ffe9; font: 700 9px var(--font-mono, ui-monospace, monospace); }
.sm-label { fill: #a9b8c7; font: 600 11px var(--font-sans, system-ui, sans-serif); paint-order: stroke; stroke: #0a1017;
            stroke-width: 3px; stroke-linejoin: round; }
.sm-dest { fill: #5b6b7c; }
.t-dest:hover .sm-dest { fill: #c9d4df; }
.sm[data-zoom="far"] .t-ours .sm-label { display: none; }
.sm-depot { fill: #c79bff; stroke: #0a1017; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }

.sm-hull { stroke: #0a1017; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.sm-head { opacity: .9; }
.sm-ship { cursor: pointer; }
.sm-ship.is-lit .sm-hull, .sm-ship:hover .sm-hull { stroke: #ffffff; stroke-width: 2px; }

.t-ok { --c: #3ddc84; } .t-warn { --c: #f2c14e; } .t-bad { --c: #ff6b61; } .t-dim { --c: #4a5a6b; } .t-ours { --c: #57c7ff; }
.sm-ship .sm-hull, .sm-ship .sm-head { fill: var(--c); }
.sm-lane, .sm-route { stroke: var(--c); }
.sm-ship.t-dim:not([data-href]) { cursor: default; }

/* A pointed-at sailing (Planning): its route, its ports of call, and the
   ship where it is now — solid from AIS, hollow when estimated from its
   schedule — with a dashed line to its next port. */
.sm-hroute { fill: none; stroke: #57c7ff; stroke-width: 2.2px; vector-effect: non-scaling-stroke; stroke-linecap: round;
             filter: drop-shadow(0 0 4px rgba(87, 199, 255, .55)); }
.sm-hstop circle { fill: #0a1017; stroke: #57c7ff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.sm-hstop.is-end circle { fill: #57c7ff; }
.sm-hto { fill: none; stroke: #ffffff; stroke-width: 1.2px; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; opacity: .7; }
.sm-hship circle { fill: #ffffff; stroke: #57c7ff; stroke-width: 2.5px; vector-effect: non-scaling-stroke; }
.sm-hship:not(.is-ais) circle { fill: #0a1017; stroke: #ffffff; stroke-dasharray: 3 2; }
.sm-hship .pulse { fill: none; stroke: #57c7ff; stroke-width: 2px; transform-box: fill-box; transform-origin: center; animation: sm-pulse 1.6s ease-out infinite; }
.sm-hship-l { fill: #ffffff; font-weight: 600; }
@keyframes sm-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sm-hship .pulse { animation: none; opacity: 0; } }
.sm-pin.is-link { cursor: pointer; }
.sm-pin.is-link:hover .sm-port { fill: #155a39; }
.sx-where { display: inline-flex; align-items: center; gap: 2px; color: #2b8fd6; font-weight: var(--weight-semi); }
.sx-where.is-est { color: var(--ink-faint); font-weight: var(--weight-normal); }
.sx-where .icon { --icon-size: 10px; }

.sm-tools { position: absolute; top: var(--space-3); right: var(--space-3); display: flex; gap: 2px; padding: 2px;
            background: rgba(10, 16, 23, .82); border: 1px solid #22303f; border-radius: var(--radius-md); backdrop-filter: blur(6px); }
.sm-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0 var(--space-3);
          border: 0; border-radius: calc(var(--radius-md) - 2px); background: transparent; color: #a9b8c7; font-size: var(--text-xs);
          font-weight: var(--weight-semi); cursor: pointer; }
.sm-btn:hover { background: #1b2633; color: #ffffff; }
.sm-btn:focus-visible { outline: 2px solid #57c7ff; outline-offset: 1px; }
.sm-btn--icon { padding: 0 var(--space-2); }
.sm-btn .icon { --icon-size: 13px; }
.sm-legend { position: absolute; left: var(--space-3); bottom: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3);
             max-width: calc(100% - 2 * var(--space-3)); padding: var(--space-2) var(--space-3); background: rgba(10, 16, 23, .82);
             border: 1px solid #22303f; border-radius: var(--radius-md); color: #8496a8; font-size: var(--text-2xs); backdrop-filter: blur(6px); }
.lg { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.lg-line { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.sm-note { position: absolute; left: var(--space-3); top: var(--space-3); display: inline-flex; align-items: center; gap: var(--space-1);
           padding: var(--space-1) var(--space-2); background: rgba(10, 16, 23, .82); border: 1px solid #22303f; border-radius: var(--radius-md);
           color: #8496a8; font-size: var(--text-2xs); }
.sm-note .icon { --icon-size: 11px; color: #c79bff; }
.sm-tip { position: absolute; left: 0; top: 0; z-index: 2; max-width: 280px; padding: var(--space-2) var(--space-3); pointer-events: none;
          white-space: pre-line; background: #0f1823; border: 1px solid #2b3b4d; border-radius: var(--radius-md); color: #dbe5ee;
          font-size: var(--text-xs); line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.sm-tip::first-line { font-weight: var(--weight-semi); color: #ffffff; }

/* ---------- narrower screens: map above, list below, the page scrolls ---------- */
@media (max-width: 1100px) {
  .sx { grid-template-columns: minmax(0, 1fr); height: auto; }
  .sx-map { height: 52vh; min-height: 320px; }
  .sx-list { overflow: visible; }
}
@media (max-width: 640px) {
  .wrap:has(> .sx) { padding: var(--space-2); }
  .sx-tab b { font-size: var(--text-md); }
  .sm-legend { display: none; }
}

/* ---------- panels: a ship's cargo and fruit ---------- */
.atable--cargo .arow, .atable--fruit .arow { padding: var(--space-2) var(--space-3); gap: var(--space-3); font-size: var(--text-xs); }
.atable--cargo .arow { grid-template-columns: minmax(0, 1.4fr) 40px 56px minmax(0, 1fr) 76px 52px; }
.atable--cargo .arow > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atable--cargo .arow > span:first-child small { display: block; }
.atable--fruit .arow { grid-template-columns: minmax(0, 1.6fr) 60px 48px 52px 60px minmax(0, 0.9fr); }
.fr-grower, .lv-port { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-more { margin-top: var(--space-3); }
.lv-more > summary { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; list-style: none;
                     font-size: var(--text-xs); color: var(--ink-muted); padding: var(--space-1) 0; }
.lv-more > summary::-webkit-details-marker { display: none; }
.lv-more > summary .icon { --icon-size: 12px; transition: transform 140ms ease; }
.lv-more[open] > summary .icon { transform: rotate(180deg); }
.lv-more > .atable { margin-top: var(--space-2); }
.v-eta { list-style: none; margin: 0; padding: 0 0 0 var(--space-3); border-left: 2px solid var(--border); display: grid; gap: var(--space-1); }
.v-eta li { display: grid; grid-template-columns: 56px 100px auto; gap: var(--space-3); align-items: baseline; font-size: var(--text-xs); }
.v-eta li.is-now b { color: var(--accent); }
@media (max-width: 640px) {
  .atable--fruit .arow { grid-template-columns: minmax(0, 1fr) 56px 56px; }
  .atable--fruit .arow > :nth-child(3), .atable--fruit .arow > :nth-child(4), .atable--fruit .arow > :nth-child(6) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sm-lane, .lv-more > summary .icon { transition: none; }
}

/* ---------- a lane's panel (Shipments::LaneChart) ----------
   Wide like the line panel: the charts need the room. Lateness colours are
   the status colours, validated per mode (scripts/validate_palette.js from
   the dataviz skill: light against #FFFFFF, dark against #171F1B); green and
   amber sit in the colour-blind floor band, so every mark also has a shape
   and the legend names each. */
.panel.lpanel { width: min(var(--panel-w-wide), 100vw); }
/* Docked on a wide screen (anywhere but Sailings, where panels float), a
   wide panel takes its own width from the page. */
@media (min-width: 1600px) { .shell:not(:has(.sx)):has(> .main .panel.lpanel) .main { padding-right: var(--panel-w-wide); } }
.ln { position: relative; --ln-ok: #0E7A3C; --ln-warn: #A97C00; --ln-bad: #C8262C; --ln-none: var(--ink-faint);
      --ln-l: 168px; --ln-r: 84px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ln { --ln-ok: #3BA867; --ln-warn: #B98C21; --ln-bad: #E8606E; } }
:root[data-theme="dark"] .ln { --ln-ok: #3BA867; --ln-warn: #B98C21; --ln-bad: #E8606E; }
.b-ok { --c: var(--ln-ok); } .b-warn { --c: var(--ln-warn); } .b-bad { --c: var(--ln-bad); } .b-none { --c: var(--ln-none); }

.ln-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-4) 0 var(--space-2); }
.ln-stat { display: grid; gap: 2px; padding: var(--space-3); border: 1px solid var(--border-soft); border-radius: var(--radius-md);
           background: var(--surface-sunk); min-width: 0; }
.ln-k { font-size: var(--text-2xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: var(--tracking-label); white-space: nowrap;
        overflow: hidden; text-overflow: ellipsis; }
.ln-v { font-size: var(--text-xl); font-weight: var(--weight-semi); letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.ln-u { font-size: var(--text-xs); font-weight: var(--weight-normal); color: var(--ink-muted); letter-spacing: 0; }
.ln-v.is-warn { color: var(--caution); } .ln-v.is-bad { color: var(--critical); }
.ln-s { font-size: var(--text-2xs); color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ln-sec { margin-top: var(--space-5); }
.ln-h { display: flex; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: var(--text-xs);
        text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--ink-muted); }
.ln-h .icon { --icon-size: 12px; align-self: center; }
.ln-hs { text-transform: none; letter-spacing: 0; color: var(--ink-faint); font-weight: var(--weight-normal); }
.ln-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ln-grid { stroke: var(--border-soft); stroke-width: 1; }
.ln-axis { fill: var(--ink-faint); font-size: 10px; }
.ln-name { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
.ln-rule { stroke-width: 1.5; }
.ln-rule.is-median { stroke: var(--ink-muted); }
.ln-rule.is-desk { stroke: var(--accent); stroke-dasharray: 4 4; }
.ln-rule-t { font-size: 10px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.ln-rule-t.is-median { fill: var(--ink-muted); }
.ln-rule-t.is-desk { fill: var(--accent); }
.ln-hit, .ln-hitrow { fill: transparent; }
.ln-mark { cursor: default; }
.ln-shape { fill: var(--c); stroke: var(--surface); stroke-width: 1.5; }
.ln-shape.is-ring { fill: none; stroke: var(--c); stroke-width: 1.5; }
.ln-mark.is-lit .ln-shape { stroke: var(--ink); stroke-width: 2; }
.ln-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-top: var(--space-2); font-size: var(--text-2xs); color: var(--ink-muted); }
.ln-lg { display: inline-flex; align-items: center; gap: var(--space-1); }
.ln-lg svg .ln-shape { stroke: none; }
.ln-lg svg .ln-shape.is-ring { stroke: var(--c); }
.ln-whisker { stroke: var(--ink-faint); stroke-width: 3; stroke-linecap: round; }
.ln-median { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
g.is-lit .ln-hitrow { fill: var(--accent-tint); }
.ln-note { margin: var(--space-1) 0 0; font-size: var(--text-2xs); }

.ln-via { display: grid; gap: var(--space-1); }
.ln-via-i { position: relative; display: flex; align-items: baseline; gap: var(--space-2); padding: 3px var(--space-2); font-size: var(--text-xs);
            border-radius: var(--radius-sm); overflow: hidden; }
.ln-via-bar { position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--accent-tint); z-index: 0; }
.ln-via-i > :not(.ln-via-bar) { position: relative; }

.ln-rows { display: grid; }
.ln-row, .ln-axisrow { display: grid; grid-template-columns: var(--ln-l) minmax(0, 1fr) var(--ln-r); align-items: center; gap: var(--space-2); }
.ln-row { padding: 3px 0; border-bottom: 1px solid var(--border-soft); }
.ln-row.is-lit { background: var(--accent-tint); }
.ln-row-l { display: grid; min-width: 0; font-size: var(--text-xs); }
.ln-row-l b, .ln-row-l small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-row-l small { font-size: var(--text-2xs); }
.ln-row-svg { display: block; width: 100%; height: 20px; }
.ln-axisrow .ln-row-svg { height: 14px; }
.ln-bar { fill: var(--c); }
.ln-tick { stroke: var(--border-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ln-page { margin-top: var(--space-4); }
.ln-row-r { text-align: right; font-size: var(--text-xs); white-space: nowrap; }
.ln-late { color: var(--c); font-weight: var(--weight-semi); }
.ln-late.b-ok { color: var(--ink-faint); font-weight: var(--weight-normal); }
.ln-axislabels { position: relative; height: 14px; font-size: 10px; color: var(--ink-faint); }
.ln-axislabels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ln-tip { position: absolute; }
@media (max-width: 640px) {
  .ln-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ln { --ln-l: 120px; --ln-r: 64px; }
}

/* A lane's voyages are links now: to the voyage's own panel. */
a.ln-row { color: inherit; text-decoration: none; }
a.ln-row:hover { background: var(--accent-tint); }
.ln-mark[data-href] { cursor: pointer; }

/* ---------- a voyage's panel (Shipments::Voyage) ---------- */
.vy-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.vy-step { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-2);
           padding: 5px 0; font-size: var(--text-sm); }
.vy-step::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.vy-step:first-child::before { top: 50%; }
.vy-step:last-child::before { bottom: 50%; }
.vy-step.is-planned::before { background: repeating-linear-gradient(to bottom, var(--border-strong) 0 3px, transparent 3px 6px); }
.vy-dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
          align-self: center; }
.vy-step.is-planned .vy-dot { background: var(--surface); border: 2px solid var(--border-strong); }
.vy-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vy-when { font-size: var(--text-xs); white-space: nowrap; }
.vy-step.is-planned .vy-what b { font-weight: var(--weight-normal); color: var(--ink-muted); }

.vy-boxes { display: grid; border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow: hidden; }
.vy-box { border-bottom: 1px solid var(--border-soft); }
.vy-box:last-child { border-bottom: 0; }
.vy-box > summary { display: grid; grid-template-columns: 116px 36px 84px 52px minmax(0, 1fr) 14px; align-items: center; gap: var(--space-3);
                    padding: var(--space-2) var(--space-3); font-size: var(--text-xs); cursor: pointer; list-style: none; }
.vy-box > summary::-webkit-details-marker { display: none; }
.vy-box > summary:hover { background: var(--accent-tint); }
.vy-box[open] > summary { background: var(--surface-sunk); }
.vy-st { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vy-chev { --icon-size: 12px; color: var(--ink-faint); transition: transform 140ms ease; }
.vy-box[open] .vy-chev { transform: rotate(180deg); }
.vy-box > .atable { border: 0; border-top: 1px solid var(--border-soft); border-radius: 0; }
.vy-none { margin: 0; padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
.vy-qc { display: inline-flex; align-items: center; gap: 2px; margin-right: var(--space-2); color: var(--ink); }
.vy-qc .icon { --icon-size: 12px; }
.vy-insp { list-style: none; margin: 0; padding: var(--space-1) 0; border-top: 1px solid var(--border-soft); font-size: var(--text-xs); }
.vy-insp a { display: grid; grid-template-columns: 96px 48px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  padding: 3px var(--space-3); color: inherit; text-decoration: none; }
.vy-insp a:hover { background: var(--accent-tint); }
@media (prefers-reduced-motion: reduce) { .vy-chev { transition: none; } }
@media (max-width: 640px) {
  .vy-box > summary { grid-template-columns: 110px minmax(0, 1fr) 70px 14px; }
  .vy-box > summary > :nth-child(2), .vy-box > summary > :nth-child(4) { display: none; }
}

/* ---------- a block as a record, and a week's voyages ---------- */
.br-dests { display: grid; gap: 2px; }
.br-dest { display: grid; grid-template-columns: minmax(0, 1fr) 80px 96px 84px; align-items: center; gap: var(--space-3);
           padding: 3px 0; font-size: var(--text-xs); }
.br-dest-n { position: relative; padding: 3px var(--space-2); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: var(--radius-sm); }
.br-bar { position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--accent-tint); }
.br-dest-n > :not(.br-bar) { position: relative; }
.br-legs { display: grid; border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.br-leg { display: grid; grid-template-columns: minmax(0, 1.6fr) 120px 92px 120px 84px; align-items: center; gap: var(--space-3);
          padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-soft); color: inherit; text-decoration: none; font-size: var(--text-xs); }
.br-leg:last-child { border-bottom: 0; }
.br-leg:hover, .br-leg.is-lit { background: var(--accent-tint); }
.br-leg-l { display: grid; min-width: 0; }
.br-leg-l b, .br-leg-l small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-leg-l b { font-size: var(--text-sm); }
.br-leg-when { white-space: nowrap; }
.br-none { margin: 0; font-size: var(--text-xs); }
.br-defects { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.br-notes { margin: var(--space-2) 0 0; padding-left: var(--space-4); display: grid; gap: var(--space-2); font-size: var(--text-xs); color: var(--ink-muted); }
.br-went { font-size: var(--text-sm); }
.br-went .cc { margin-right: 2px; }
.kpi--link { color: inherit; text-decoration: none; border-radius: var(--radius-md); }
.kpi--link:hover { background: var(--accent-tint); }
@media (max-width: 640px) {
  .br-leg { grid-template-columns: minmax(0, 1fr) 90px; }
  .br-leg > :nth-child(2), .br-leg > :nth-child(4) { display: none; }
  .br-dest { grid-template-columns: minmax(0, 1fr) 70px 80px; }
  .br-dest > :nth-child(4) { display: none; }
}

/* A sound share nothing has been paid on yet: a figure so far, shown lighter. */
.bgauge.is-prov i { opacity: .45; }
.pct.is-prov { color: var(--ink-muted); }

/* ---------- how a voyage landed (Shipments::Voyage#by_grower, #boxes_by_quality) ----------
   Sound against unsound as a pale tint against a strong red, with a hatch on
   the red: they differ in lightness, not only hue, so they hold apart for
   red–green colour blindness (validated: ΔE 28.7 light, 14.0 dark). */
.ln { --vq-sound: #A8D5B8; --vq-unsound: #C8262C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ln { --vq-sound: #2E5A40; --vq-unsound: #E8606E; } }
:root[data-theme="dark"] .ln { --vq-sound: #2E5A40; --vq-unsound: #E8606E; }
.ln-stats--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vq-growers { display: grid; gap: 4px; }
.vq-row { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 44px 64px; align-items: center; gap: var(--space-3);
          font-size: var(--text-xs); padding: 2px 0; border-radius: var(--radius-sm); }
.vq-row.is-lit { background: var(--accent-tint); }
.vq-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vq-bar { display: flex; height: 12px; border-radius: 3px; overflow: hidden; gap: 2px; background: var(--surface); }
.vq-bar i { display: block; height: 100%; min-width: 0; }
.vq-sound { background: var(--vq-sound); }
.vq-unsound { background: repeating-linear-gradient(135deg, var(--vq-unsound) 0 3px, color-mix(in srgb, var(--vq-unsound) 70%, var(--surface)) 3px 5px); }
.vq-bar i[style*="width: 0%"] { display: none; }
.vq-pct { text-align: right; }
.vq-boxes { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-3); align-items: center; margin-top: var(--space-3); }
.vq-boxes-l { font-size: var(--text-2xs); }
.vq-strip { display: flex; flex-wrap: wrap; gap: 3px; }
.vq-box { display: block; width: 14px; height: 22px; border-radius: 3px; position: relative; overflow: hidden;
          background: repeating-linear-gradient(135deg, var(--vq-unsound) 0 3px, color-mix(in srgb, var(--vq-unsound) 70%, var(--surface)) 3px 5px); }
.vq-box::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--s); background: var(--vq-sound); }
.vq-box.is-lit { outline: 2px solid var(--ink); outline-offset: 1px; }
.vq-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: var(--space-2);
             font-size: var(--text-2xs); color: var(--ink-muted); }
.vq-lg { display: inline-flex; align-items: center; gap: var(--space-1); }
.vq-lg i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.vq-defects { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.atable--fruit-q .arow { grid-template-columns: minmax(0, 1.6fr) 60px 48px 52px 60px minmax(0, 0.8fr) 48px; }
@media (max-width: 640px) {
  .ln-stats--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vq-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .vq-row > :nth-child(4) { display: none; }
  .vq-boxes { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- a depot, opened from its square on the map ---------- */
.sm-depot-g { cursor: pointer; }
.sm-depot-g:hover .sm-depot, .sm-depot-g.is-on .sm-depot { fill: #e2c8ff; stroke: #ffffff; }
.sm-depot-g.is-on .sm-depot { stroke-width: 2px; }

.dp-cm { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 var(--space-1); font-size: var(--text-sm); }
.dp-cm .icon { --icon-size: 14px; color: var(--ink-muted); }
.dp-lots { display: grid; border-top: 1px solid var(--border-soft); }
.dp-lot { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr) 64px 76px; gap: var(--space-3); align-items: center;
          padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--border-soft); color: var(--ink); text-decoration: none;
          font-size: var(--text-xs); }
.dp-lot:hover { background: var(--accent-tint); }
.dp-var { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-2); min-width: 0; overflow: hidden; white-space: nowrap; }
.dp-pack { flex-basis: 100%; font-size: var(--text-2xs); overflow: hidden; text-overflow: ellipsis; }
.dp-farm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-age { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.dp-track { position: relative; flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunk); }
.dp-span { position: absolute; top: 0; bottom: 0; min-width: 4px; border-radius: var(--radius-pill); background: var(--ink-faint); }
.dp-lot.is-watch .dp-span { background: var(--caution); }
.dp-lot.is-watch .dp-days { color: var(--caution); font-weight: var(--weight-semi); }
.dp-days { flex: none; min-width: 48px; text-align: right; color: var(--ink-muted); }
.dp-lot .icon { --icon-size: 11px; vertical-align: -1px; }
.dp-legend { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 0; font-size: var(--text-2xs); }
.dp-key { display: inline-block; width: 16px; height: 6px; border-radius: var(--radius-pill); background: var(--ink-faint); }
.dp-key.is-watch { background: var(--caution); }
.dp-port { display: flex; align-items: center; gap: var(--space-4); margin: 0 0 var(--space-2); font-size: var(--text-xs); color: var(--ink-muted); }
.dp-port b { color: var(--ink); }
.dp-port .btn { margin-left: auto; }
.dp-leaving { display: grid; border-top: 1px solid var(--border-soft); }
.dp-ship { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); padding: var(--space-2) var(--space-1);
           border-bottom: 1px solid var(--border-soft); color: var(--ink); text-decoration: none; font-size: var(--text-xs); }
.dp-ship.is-link:hover { background: var(--accent-tint); }
.dp-ship-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-ship-to { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-ship-stk { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 640px) {
  .dp-lot { grid-template-columns: minmax(0, 1fr) 64px; }
  .dp-lot > .dp-age { grid-column: 1 / -1; grid-row: 2; }
  .dp-lot > :last-child { display: none; }
}

/* ---------- names on the land (SeaMap::Places) ---------- */
.sm-place { display: none; pointer-events: none; }
.sm[data-detail="1"] .sm-place.d1,
.sm[data-detail="2"] .sm-place:is(.d1, .d2),
.sm[data-detail="3"] .sm-place:is(.d1, .d2, .d3) { display: inline; }
.sm-place text { font: 500 10px var(--font-sans, system-ui, sans-serif); fill: #8193a5; paint-order: stroke;
                 stroke: #0a1017; stroke-width: 3px; stroke-linejoin: round; }
.sm-place.is-country text { font-size: 11px; font-weight: 600; letter-spacing: .18em; fill: #56677a; }
.sm-place.is-province text { font-style: italic; font-size: 10px; fill: #4e6072; }
.sm-place.is-town circle { fill: #8193a5; }
.sm-place.is-district circle { fill: #6fcf97; }
.sm-place.is-district text { fill: #8fd3a9; font-size: 9.5px; }

/* ---------- Live by grower ---------- */
.sx-find { width: 100%; height: 30px; font-size: var(--text-xs); grid-column: 1 / -1; }
.gr-phases { justify-content: flex-start; flex-wrap: wrap; gap: 2px var(--space-3); }
.sx-r2.gr-phases > * { flex: none; overflow: visible; }
.gr-ph { color: var(--ink-muted); white-space: nowrap; }
.gr-ph b { color: var(--ink); }
.gr-ph--landed b { color: var(--positive); }
.gr-latest { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.gr-latest.is-later { color: var(--caution); }
.gr-unknown { font-size: var(--text-2xs); }
.gr-updates { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: var(--text-xs); }
.gr-updates li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.gr-updates li.is-later b { color: var(--caution); }
.gr-ship { padding: var(--space-2) 0; border-top: 1px solid var(--border-soft); }
.gr-ship:first-of-type { border-top: 0; }
.gr-ship-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); margin: 0 0 var(--space-1); font-size: var(--text-sm); }
.gr-ship-name { font-weight: var(--weight-semi); color: var(--ink); }
a.gr-ship-name { text-decoration: none; }
a.gr-ship-name:hover { text-decoration: underline; }
.gr-ship-when { margin-left: auto; display: inline-flex; gap: var(--space-2); font-size: var(--text-xs); }
.gr-boxes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: var(--text-xs); }
.gr-boxes li { display: grid; grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.gr-boxes li > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gr-fruit { display: flex; gap: var(--space-2); }
.gr-last { text-align: right; }
@media (max-width: 640px) { .gr-boxes li { grid-template-columns: 1fr; } .gr-last { text-align: left; } }

/* ---------- routes: a box's legs, feeders named (Shipments::Route) ---------- */
.rt { list-style: none; margin: 0; padding: 0; display: grid; font-size: var(--text-sm); }
.rt-port { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: var(--space-2); align-items: baseline; }
.rt-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-faint); background: var(--surface); align-self: center; }
.rt-port.is-done .rt-dot { background: var(--ink-muted); border-color: var(--ink-muted); }
.rt-port.is-here .rt-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint-strong); }
.rt-name { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.rt-ts { font-size: var(--text-2xs); color: var(--ink-faint); }
.rt-when { display: inline-flex; gap: var(--space-2); font-size: var(--text-xs); white-space: nowrap; }
.rt-leg { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; min-height: 30px; }
.rt-line { justify-self: center; width: 2px; height: 100%; min-height: 26px; background: var(--ink-faint); }
.rt-leg.is-planned .rt-line { background: repeating-linear-gradient(to bottom, var(--ink-faint) 0 4px, transparent 4px 8px); }
.rt-leg.is-under-way .rt-line { background: var(--accent); }
.rt-ship { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--text-xs); color: var(--ink-muted); min-width: 0; }
.rt-ship b { color: var(--ink); font-weight: var(--weight-semi); }
.rt-ship .icon { --icon-size: 12px; }
.rt-leg.is-planned .rt-ship b { font-weight: 500; color: var(--ink-muted); }
.rt-days { font-size: var(--text-xs); }
.rt-role { display: inline-block; padding: 0 6px; border-radius: var(--radius-pill); font-size: var(--text-2xs); font-weight: var(--weight-semi);
  text-transform: uppercase; letter-spacing: .04em; background: var(--surface-sunk); color: var(--ink-muted); }
.rt-role--feeder { background: var(--caution-tint, var(--surface-sunk)); color: var(--caution); }
.rt-now { font-size: var(--text-2xs); font-weight: var(--weight-semi); color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.rt-count { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-xs); }
.rt-line-1 { display: inline; }
.rt-line-1 .is-ts { color: var(--ink-muted); }
.rt-line-1 .is-here { font-weight: var(--weight-semi); color: var(--ink); }
.rt-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: var(--text-xs); }
.rt-changes li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.rt-chg { display: inline-flex; align-items: baseline; gap: var(--space-1); margin-right: var(--space-3); flex-wrap: wrap; }
.rt-chg .icon { --icon-size: 11px; }
.ln-v--name { font-size: var(--text-sm); line-height: 1.3; overflow-wrap: anywhere; }
.ln-v--name a { color: inherit; }
.ts-boxes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--text-xs); }
.ts-boxes li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 2px var(--space-2); }
.ts-route { grid-column: 2; }
.gr-boxes .gr-route { grid-column: 1 / -1; padding-left: 112px; white-space: normal; color: var(--ink-muted); }
@media (max-width: 640px) { .gr-boxes .gr-route { padding-left: 0; } }
.firm--ts.is-maybe { opacity: .75; border-style: dashed; }
.rot-note { margin: var(--space-2) 0 0; font-size: var(--text-2xs); line-height: 1.4; }

/* ---------- a market's best ways there, its ports and the sort ---------- */
.sx-best { display: grid; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--border-soft); background: var(--surface-sunk); }
.sx-chips, .sx-sort { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); font-size: var(--text-xs); }
.sx-sort > span { margin-right: var(--space-1); }
.sx-chip { padding: 2px var(--space-2); border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-muted); text-decoration: none; white-space: nowrap; }
.sx-chip:hover { color: var(--ink); }
.sx-chip[aria-current="true"] { background: var(--accent-tint-strong); border-color: transparent; color: var(--ink); font-weight: var(--weight-semi); }
.sx-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.sx-pick { display: grid; gap: 1px; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  color: inherit; text-decoration: none; min-width: 0; font-size: var(--text-xs); }
a.sx-pick:hover { border-color: var(--border-strong); }
.sx-pick > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-pick-k { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.sx-pick-k .icon { --icon-size: 11px; }
.sx-pick-ship { font-size: var(--text-sm); color: var(--ink); }
.sx-pick-when { color: var(--ink-muted); }
.sx-pick-how { color: var(--ink-muted); }
.sx-stops { font-size: var(--text-2xs); }
@media (max-width: 640px) { .sx-picks { grid-template-columns: 1fr; } }
.rot-sub { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 var(--space-1); font-size: var(--text-2xs);
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.rot-sub .icon { --icon-size: 11px; }
.sx-ts { margin-top: var(--space-1); }
.sx-more-ts { margin: 0; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-soft); font-size: var(--text-xs); }
.sx-more-ts a { display: inline-flex; align-items: center; gap: var(--space-1); }
.sx-more-ts .icon { --icon-size: 12px; }

/* ---------- the Planning list's icons: a market's line, a line-up row ---------- */
.sx-g2 > span, .sx-gstk { display: inline-flex; align-items: center; gap: 3px; }
.sx-g2 .icon, .sx-gstk .icon { --icon-size: 11px; color: var(--ink-faint); }
.sx-lu-name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.sx-lu-name .sx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-port .sx-r1 .sx-when, .sx-lu-n { display: inline-flex; align-items: center; gap: 3px; }
.sx-port .sx-r1 .sx-when .icon, .sx-lu-n .icon, .sx-lu-note .icon { --icon-size: 11px; color: var(--ink-faint); }
.sx-lu-meta { padding-left: calc(14px + var(--space-2)); }
.sx-lu-meta > .sx-lu-n { min-width: 4.5em; justify-content: flex-end; }
.sx-lu-note { align-items: center; gap: 3px; padding-left: calc(14px + var(--space-2)); }
.sx-lu-note .icon { flex: none; }
.sx-lu-note > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
