:root {
  --bg: #000;
  --panel: #121212;
  --card: #181818;
  --card-hover: #242424;
  --elev: #2a2a2a;
  --line: #2e2e2e;
  --text: #fff;
  --muted: #b3b3b3;
  --subtle: #7a7a7a;
  --green: #1ed760;
  --red: #f3727f;
  --amber: #f59b23;
  --blue: #4ea8ff;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.up { color: var(--green); }
.down { color: var(--red); }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }

/* ── Layout ── */
.app {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  height: 100vh;
  height: 100dvh;
}
.side, .main {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}
.side { display: flex; flex-direction: column; }
.main { overflow-y: auto; position: relative; }
.main::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 260px;
  background: linear-gradient(180deg, rgba(30, 215, 96, .16), rgba(18, 18, 18, 0));
  pointer-events: none;
}

/* ── Sidebar ── */
.side-head { padding: 16px 16px 8px; display: grid; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--elev); border-radius: 999px; padding: 0 14px; color: var(--muted);
}
.search input { flex: 1; background: none; border: 0; outline: none; padding: 10px 0; color: var(--text); }
.search:focus-within { box-shadow: 0 0 0 2px #fff inset; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 0; background: var(--elev); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip:hover { background: #333; }
.chip.on { background: var(--text); color: #000; }
.side-list { overflow-y: auto; padding: 4px 8px 16px; flex: 1; }
.cat-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); padding: 14px 8px 6px; font-weight: 700; }

.row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 32px; gap: 10px; align-items: center;
  padding: 8px; border-radius: 6px; cursor: pointer;
}
.row:hover, .row.open { background: var(--card-hover); }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .px { text-align: right; font-size: 13px; }
.row .px b { display: block; font-weight: 600; }
.row .px span { font-size: 12px; }
.tile {
  width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .02em; color: #000;
}
.tile.lg { width: 56px; height: 56px; font-size: 12px; border-radius: 8px; }
.tile.xl { width: 112px; height: 112px; font-size: 20px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.add-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--subtle); background: none;
  display: grid; place-items: center; color: var(--muted); padding: 0;
}
.add-btn:hover { border-color: #fff; color: #fff; transform: scale(1.05); }
.add-btn.on { background: var(--green); border-color: var(--green); color: #000; }
.add-btn svg { width: 14px; height: 14px; }

.infobox {
  margin: 2px 8px 10px 8px; padding: 12px 14px; background: var(--card); border-radius: 8px;
  border-left: 3px solid var(--green); font-size: 13px; line-height: 1.5; animation: fadeIn .18s ease;
}
.infobox p { margin: 0 0 8px; color: #ddd; }
.infobox dl { margin: 0; display: grid; grid-template-columns: 78px 1fr; gap: 4px 10px; }
.infobox dt { color: var(--subtle); font-size: 12px; font-weight: 600; }
.infobox dd { margin: 0; color: var(--muted); }
.infobox .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.proxy-note { font-size: 12px; color: var(--amber); }

/* ── Buttons ── */
.btn {
  border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 13px;
  background: var(--text); color: #000; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { transform: scale(1.03); }
.btn.green { background: var(--green); }
.btn.ghost { background: none; color: var(--text); box-shadow: inset 0 0 0 1px var(--subtle); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px #fff; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 24px; background: rgba(18, 18, 18, .75); backdrop-filter: blur(12px);
}
.tabs { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: var(--elev); font-weight: 600; font-size: 13px; white-space: nowrap; }
.tabs a:hover { background: #333; }
.tabs a.on { background: var(--text); color: #000; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); }
.status.live i { background: var(--green); box-shadow: 0 0 0 0 rgba(30, 215, 96, .6); animation: pulse 2s infinite; }
.status.err i { background: var(--red); }
select {
  background: var(--elev); border: 0; border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: 13px;
}

.view { position: relative; padding: 8px 24px 40px; }
h1 { font-size: 32px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { color: var(--muted); font-size: 13px; font-weight: 600; }
.section-head a:hover { color: #fff; text-decoration: underline; }

/* ── Cards ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border-radius: 8px; padding: 14px; cursor: pointer; position: relative;
  transition: background .2s ease; min-width: 0;
}
.card:hover { background: var(--card-hover); }
.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-top .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-top .sub { font-size: 12px; color: var(--muted); }
.card .price { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.card .unit { font-size: 12px; color: var(--muted); font-weight: 500; }
.card .chg { font-size: 13px; font-weight: 600; margin-top: 2px; }
.card canvas { width: 100%; height: 56px; display: block; margin-top: 10px; }
.card .remove {
  position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .15s;
  width: 26px; height: 26px; border-radius: 50%; border: 0; background: #000a; color: var(--muted);
}
.card:hover .remove { opacity: 1; }
.card .remove:hover { color: #fff; }
.card .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; background: var(--subtle); }
.card .dot.open { background: var(--green); }
.range52 { margin-top: 10px; font-size: 11px; color: var(--subtle); }
.range52 .bar { height: 3px; background: var(--elev); border-radius: 2px; position: relative; margin: 4px 0; }
.range52 .bar i { position: absolute; top: -3px; width: 3px; height: 9px; background: #fff; border-radius: 2px; }
.range52 .ends { display: flex; justify-content: space-between; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.up { background: rgba(30, 215, 96, .14); }
.pill.down { background: rgba(243, 114, 127, .14); }

.add-card {
  border: 2px dashed var(--line); background: none; color: var(--muted); border-radius: 8px; min-height: 180px;
  display: grid; place-items: center; font-weight: 600;
}
.add-card:hover { border-color: var(--subtle); color: #fff; }

.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mini {
  background: var(--card); border-radius: 8px; padding: 12px 14px; display: flex; justify-content: space-between;
  align-items: center; gap: 10px; cursor: pointer;
}
.mini:hover { background: var(--card-hover); }
.mini .l { min-width: 0; }
.mini .l b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .l span { font-size: 12px; color: var(--muted); }
.mini .r { text-align: right; font-weight: 700; }
.mini .r small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }

/* ── Detail ── */
.hero { display: flex; gap: 24px; align-items: flex-end; padding: 16px 0 8px; }
.hero .meta { min-width: 0; }
.hero .kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero h1 { font-size: clamp(28px, 5vw, 56px); line-height: 1.05; margin: 6px 0 10px; }
.hero .bigprice { font-size: 28px; font-weight: 800; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.hero-actions { display: flex; gap: 10px; align-items: center; margin: 16px 0 4px; flex-wrap: wrap; }
.ranges { display: flex; gap: 6px; }
.ranges button { border: 0; background: var(--elev); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.ranges button.on { background: #fff; color: #000; }
.chart-box { background: var(--card); border-radius: 8px; padding: 12px; margin-top: 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chart { height: 340px; position: relative; }
.chart .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.panel { background: var(--card); border-radius: 8px; padding: 16px 18px; line-height: 1.55; }
.panel.wide { grid-column: 1 / -1; }
.panel p { margin: 0; color: #ddd; }
.panel ul { margin: 0; padding-left: 18px; color: #ddd; }
.panel li { margin: 4px 0; }
.panel .basis { font-size: 12px; color: var(--subtle); margin: -4px 0 10px; }
.panel.season { border-left: 3px solid var(--amber); }
.panel.fact { border-left: 3px solid var(--blue); }
.bars { display: grid; gap: 8px; }
.bars .b { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bars .b span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ddd; }
.bars .track { height: 6px; border-radius: 3px; background: var(--elev); overflow: hidden; }
.bars .track i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.bars .b span:last-child { text-align: right; color: var(--muted); }
.threshold-row { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.threshold-row input { width: 64px; }

/* ── Map ── */
.map-wrap { position: relative; background: #0b0b0b; border-radius: 8px; overflow: hidden; margin-top: 4px; }
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-wrap .country { fill: #242424; stroke: #0b0b0b; stroke-width: .5; }
.map-wrap .country.prod { stroke: #0b0b0b; }
.map-wrap .route { fill: none; stroke-width: 1.8; stroke-dasharray: 5 4; animation: dash 1.2s linear infinite; opacity: .9; }
.map-wrap .route.hl { stroke-width: 3; opacity: 1; }
.map-wrap .cp { cursor: pointer; }
.map-wrap .cp-label { font-size: 10px; fill: #eee; paint-order: stroke; stroke: #000; stroke-width: 3px; font-weight: 600; pointer-events: none; }
.map-tip {
  position: absolute; max-width: 280px; background: #282828; border-radius: 6px; padding: 10px 12px; font-size: 12px;
  line-height: 1.45; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.6); display: none; z-index: 2;
}
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; display: inline-block; }
.cp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.cp-item { background: #202020; border-radius: 6px; padding: 10px 12px; font-size: 13px; line-height: 1.45; cursor: default; }
.cp-item b { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.cp-item p { margin: 0; color: var(--muted); }
.cp-item:hover { background: #262626; }
.sym-choke { width: 10px; height: 10px; background: #ff5e7e; transform: rotate(45deg); display: inline-block; }
.sym-hub { width: 10px; height: 10px; background: var(--blue); border-radius: 50%; display: inline-block; }

/* ── Shipping ── */
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.wk { background: var(--card); border-radius: 8px; padding: 14px 16px; }
.wk .t { font-weight: 700; }
.wk .v { font-size: 26px; font-weight: 800; margin-top: 6px; }
.wk .src { font-size: 11px; color: var(--subtle); margin-top: 4px; }
.wk .wkchart { height: 170px; margin-top: 10px; position: relative; }
.wk .wkchart .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--subtle); text-align: center; font-size: 13px; padding: 0 20px; }
.wk form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wk form input { flex: 1; min-width: 110px; }
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.list th { color: var(--subtle); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
table.list td.n { text-align: right; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--card-hover); }

/* ── Forms / settings ── */
.settings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.box { background: var(--card); border-radius: 8px; padding: 18px; }
.box h3 { display: flex; align-items: center; gap: 8px; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=search] {
  background: var(--elev); border: 1px solid transparent; border-radius: 6px; padding: 9px 12px; outline: none;
}
input:focus { border-color: #fff; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #555; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.ovr { display: grid; gap: 6px; max-height: 300px; overflow: auto; margin-top: 8px; }
.ovr .o { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.ovr input { width: 100%; }
.pick { display: grid; gap: 6px; margin-top: 8px; }
.pick label { display: flex; align-items: center; gap: 10px; background: #202020; border-radius: 6px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.pick label.on { box-shadow: inset 0 0 0 1px var(--green); }
.pick input { accent-color: var(--green); }
.pick .ord { margin-left: auto; color: var(--green); font-weight: 700; }
pre.code {
  background: #0b0b0b; border-radius: 6px; padding: 12px; font-size: 11.5px; line-height: 1.5; overflow: auto; max-height: 220px;
  white-space: pre; font-family: ui-monospace, 'SF Mono', Consolas, monospace; color: #cfcfcf;
}
ol.steps { padding-left: 20px; line-height: 1.6; color: #ddd; margin: 8px 0; }
.log { display: grid; gap: 6px; margin-top: 8px; font-size: 13px; }
.log div { display: flex; justify-content: space-between; background: #202020; border-radius: 6px; padding: 8px 10px; }
.note { font-size: 12px; color: var(--subtle); line-height: 1.5; }

/* ── Toast / misc ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #fff; color: #000; padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); transition: .25s; z-index: 50; max-width: min(520px, calc(100vw - 32px));
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast small { display: block; font-weight: 500; color: #333; margin-top: 3px; line-height: 1.4; }
.skeleton { background: linear-gradient(90deg, #1c1c1c, #262626, #1c1c1c); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--card); border-radius: 8px; }
.bottom-nav { display: none; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(30,215,96,.6); } 70% { box-shadow: 0 0 0 7px rgba(30,215,96,0); } 100% { box-shadow: 0 0 0 0 rgba(30,215,96,0); } }
@keyframes dash { to { stroke-dashoffset: -18; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Mobile ── */
/* Owner vs visitor: settings are only shown once the access key is saved in this browser. */
html:not(.owner) .owner-only, html.owner .visitor-only { display: none !important; }
.site-foot { margin: 0 24px; padding: 14px 0 28px; border-top: 1px solid #232323; font-size: 11px; color: var(--subtle); line-height: 1.6; }
.site-foot a { color: var(--muted); margin-left: 6px; text-decoration: underline; }

/* Spreads */
.wk .sub2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rangebar { position: relative; height: 6px; background: #2a2a2a; border-radius: 3px; margin: 12px 0 4px; }
.rangebar i { position: absolute; top: -3px; width: 4px; height: 12px; background: #fff; border-radius: 2px; transform: translateX(-50%); }
.rangebar-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--subtle); }
.wk .signal { font-size: 13px; margin-top: 10px; padding: 8px 10px; background: #202020; border-radius: 6px; line-height: 1.45; }
.wk .ship { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 10px; }

/* Chokepoints */
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cp { background: var(--card); border-radius: 8px; padding: 12px 14px; }
.cp .t { font-weight: 700; }
.cp .n { font-size: 12px; color: var(--muted); }
.cp .v { font-size: 22px; font-weight: 800; margin-top: 6px; }
.cp .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.cp .mix { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cp canvas { width: 100%; height: 46px; display: block; margin-top: 8px; }

/* Voyage estimator */
.vg { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.vform { background: var(--card); border-radius: 8px; padding: 6px 16px 16px; }
.vsec { padding: 12px 0; border-bottom: 1px solid #262626; }
.vsec h3 { margin: 0 0 8px; font-size: 14px; }
.vsec h3 small { font-weight: 500; font-size: 11px; }
.vform select, .vform input { width: 100%; box-sizing: border-box; }
.vform details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 8px; }
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 6px; align-items: start; }
.vf { display: grid; gap: 3px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.vin { display: flex; align-items: center; gap: 4px; }
.vin input { min-width: 0; }
.vin i { font-style: normal; font-size: 11px; color: var(--subtle); white-space: nowrap; }
.vform > .btn { margin-top: 14px; }
.vres h3 { margin: 22px 0 8px; font-size: 15px; }
.tce-head { background: var(--card); border-radius: 8px; padding: 16px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.tce-head .kicker { font-size: 12px; color: var(--muted); }
.tce-big { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.tce-big small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.tce-facts { display: grid; grid-template-columns: repeat(2, minmax(130px, auto)); gap: 8px 20px; }
.tce-facts b { display: block; font-size: 15px; }
.tce-facts span { font-size: 11px; color: var(--subtle); }
.vwarn { margin-top: 10px; background: #3a2a10; color: #ffcf80; border-radius: 6px; padding: 8px 12px; font-size: 13px; line-height: 1.5; }
.vt td, .vt th { font-size: 13px; }
.vt .sm { font-size: 11px; }
.vt tr.on td { background: #202a20; }
.pl td.ind { padding-left: 22px; color: var(--muted); font-size: 12px; }
.pl tr.tot td { font-weight: 800; border-top: 1px solid #333; }
.sens td.base { font-weight: 800; color: #fff; }
.speeds { display: grid; gap: 4px; }
.speeds .sp { display: grid; grid-template-columns: 52px 1fr 86px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.speeds .sp i { display: block; height: 10px; border-radius: 3px; background: #3a3a3a; }
.speeds .sp i.neg { background: var(--red); }
.speeds .sp.best i { background: var(--green); }
.speeds .sp.cur span, .speeds .sp.cur b { color: #fff; font-weight: 800; }
.speeds .sp b { text-align: right; }
/* Stack form and results whenever the content area (not just the screen) is narrow. */
.view { container-type: inline-size; }
@container (max-width: 600px) {
  .callform .vgrid { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 960px) {
  .vg { grid-template-columns: minmax(0, 1fr); }
  .callform { grid-column: 1 / -1; }
  .vt { display: block; overflow-x: auto; }
  .vt.pl, .vt.sens { display: table; width: 100%; }
}

/* Weekly desk */
.desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.desk-grid .box h3 { margin: 0 0 8px; font-size: 14px; }
.desk-grid .commentary textarea, .callform textarea, .review input { width: 100%; box-sizing: border-box; font: inherit; }
.desk-grid .commentary { grid-column: 1 / -1; }
.take { font-size: 15px; line-height: 1.6; margin: 0; }
.callform { grid-column: span 2; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button, .opts button { border: 0; border-radius: 999px; padding: 7px 12px; background: var(--elev, #2a2a2a); color: var(--text, #fff); font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on, .opts button.on { background: var(--green); color: #000; font-weight: 700; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 6px; }
.opts button { border-radius: 8px; padding: 10px; text-align: center; }
.ctx { background: #141414; border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.ctx-v { font-size: 22px; margin-right: 8px; }
.reason { display: grid; gap: 4px; margin: 6px 0 12px; }
.sc-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.sc-top b { display: block; font-size: 22px; }
.sc-top span { font-size: 11px; color: var(--subtle); }
.call { background: var(--card); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; border-left: 3px solid var(--subtle); font-size: 13px; line-height: 1.5; }
.call.right { border-left-color: var(--green); }
.call.wrong { border-left-color: var(--red); }
.call-h { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.call details summary { cursor: pointer; color: var(--muted); }
.call details p { margin: 4px 0; color: var(--muted); }
.call .review { margin-top: 8px; }
.call .review input { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--subtle); text-decoration: underline; font-size: 12px; cursor: pointer; padding: 0; margin-top: 6px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; height: auto; min-height: 100dvh; }
  .side, .main { border-radius: 0; }
  .main { overflow: visible; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .side { display: none; min-height: 100dvh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); padding-top: env(safe-area-inset-top); }
  body.view-markets .side { display: flex; }
  body.view-markets .main { display: none; }
  .side-list { overflow: visible; }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .tabs { display: none; }
  .topbar::before { content: 'Commodity Terminal'; font-weight: 800; font-size: 17px; }
  .view { padding: 4px 16px 24px; }
  h1 { font-size: 26px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 12px; }
  .card .price { font-size: 19px; }
  .card canvas { height: 44px; }
  .card .remove { opacity: 1; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .tile.xl { width: 72px; height: 72px; font-size: 14px; }
  .chart { height: 260px; }
  .bars .b { grid-template-columns: 110px 1fr 40px; }
  .settings, .wk-grid { grid-template-columns: minmax(0, 1fr); }
  .cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vg { grid-template-columns: minmax(0, 1fr); }
  .tce-big { font-size: 32px; }
  .vt { display: block; overflow-x: auto; }
  .site-foot { margin: 0 16px; }
  .infobox { margin-left: 8px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: linear-gradient(180deg, rgba(0,0,0,.7), #000 40%);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
  html.owner .bottom-nav a { font-size: 10px; }
  .bottom-nav a svg { width: 24px; height: 24px; }
  .bottom-nav a.on { color: #fff; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
