/* Round 18 layout and panels (dashboard-redesign-18.md), linked after heat.css and panel.css; the tokens are in heat.css.
   Header 48 px flush top and full width; panels below it; left = one panel (Layers, Wind or Smoke settings, #board); right = crew list;
   legend chip bottom left; tour panel centre top. Colour = status or data only; red = Alert only. */
:root { --rail: 0px; --L: calc(var(--gap) * 2 + var(--pw-l)); --R: calc(var(--gap) * 2 + var(--pw-r)); }
html, body { background: var(--bg-0); color: var(--tx-1); font-variant-numeric: tabular-nums; }
#c { top: var(--hdr); }
.panel, #dock, #tip, #sheet { background: var(--sf); border: 1px solid var(--ln); box-shadow: var(--sh); -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px); }
small { color: var(--tx-3); } b i, .num i, .r3 b i, #tip b i { color: var(--tx-3); }
.hc-btn { background: var(--sf-3); border-color: var(--ln-2); color: var(--tx-1); } .hc-btn:hover { background: var(--sf-2); }
.hc-btn.pri { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }
.hc-btn.pri:hover { background: var(--acc); filter: brightness(1.12); }
.hc-btn.sm { background: none; border-color: transparent; color: var(--tx-3); }
.hc-btn.sm:hover { color: var(--tx-1); background: var(--sf-3); }
.hc-btn[aria-pressed=true], .hc-btn[aria-expanded=true] { background: var(--acc-t); border-color: var(--acc-hi); color: var(--acc-hi); }
.rl-tip { background: var(--bg-0); color: var(--tx-1); box-shadow: 0 0 0 1px var(--ln-2); }
:focus-visible { outline-color: var(--acc-hi); }

/* status pill: three only */
.pill { height: 18px; padding: 0 7px; gap: 4px; border-radius: 9px; font-size: 11px; font-weight: 600; line-height: 18px; background: none;
  }
.pill.ok { color: var(--ok); background: none; box-shadow: inset 0 0 0 1px var(--ok-line); }
.pill.watch { color: var(--watch); background: var(--watch-t); }
.pill.alert { color: var(--on-alert); background: var(--alert); } .pill .ic { display: none; }

/* header */
#top { position: fixed; z-index: 30; inset: 0 0 auto 0; height: var(--hdr); max-width: none; transform: none; box-sizing: border-box;
  padding: 0 12px 0 16px;
  display: flex; align-items: center; gap: 16px; background: var(--bg-0); border: 0; border-bottom: 1px solid var(--ln); border-radius: 0; box-shadow: none; overflow: visible; }
#top .brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--tx-2); }
#top .brand img { height: 16px; }
#top .vr { width: 1px; height: 24px; background: var(--ln); flex: none; }
.loc { position: relative; display: block; padding: 0; background: none; border-radius: 0; overflow: visible; }
.loc-b { display: flex; align-items: center; gap: 8px; height: 32px; min-width: 212px; padding: 0 10px; border: 1px solid var(--ln-2);
  border-radius: var(--r-2);
  background: var(--sf-2); color: var(--tx-3); font: inherit; cursor: pointer; }
.loc-b .loc-n { font-size: 13px; font-weight: 600; color: var(--tx-1); white-space: nowrap; }
.loc-b .loc-s { font-size: 12px; white-space: nowrap; }
.loc-b > .ic:last-child { margin-left: auto; }
.loc-b[aria-expanded=true] { border-color: var(--acc-hi); }
.loc-b:hover { border-color: var(--tx-3); }
.loc-m { position: absolute; z-index: 40; left: 0; top: calc(100% + 4px); width: 260px; padding: 6px; box-sizing: border-box; display: flex;
  flex-direction: column;
  background: var(--sf-solid); border: 1px solid var(--ln); border-radius: var(--r); box-shadow: var(--sh); }
  .loc-m[hidden] { display: none; }
.loc-m a { position: relative; display: flex; flex-direction: column; justify-content: center; height: 40px; padding: 0 30px 0 10px;
  border-radius: var(--r-3);
  color: var(--tx-1); text-decoration: none; }
  .loc-m a b { font-size: 13px; font-weight: 500; line-height: 16px; }
  .loc-m a small { font-size: 11px; line-height: 13px; }
.loc-m a:hover, .loc-m a:focus-visible, .loc-m a.on { background: var(--sf-3); }
.loc-m a .ic { position: absolute; right: 10px; top: 13px; color: var(--acc-hi); display: none; }
.loc-m a.on .ic { display: block; }
.hwx { display: flex; align-items: center; height: 32px; min-width: 0; overflow: hidden; }
.hw { display: flex; flex-direction: column; justify-content: center; height: 32px; padding: 0 16px; border-left: 1px solid var(--ln);
  white-space: nowrap; }
.hw:first-child { border-left: 0; padding-left: 4px; } .hw small { font-size: 11px; line-height: 12px; }
.hw b { font-size: 14px; line-height: 18px; font-weight: 500; color: var(--tx-1); }
.hw b i { font-style: normal; font-size: 11px; margin-left: 4px; }
.hw-t b { font-size: 13px; color: var(--tx-2); } .hw [data-wx="utci"] { min-width: 76px; } .hw [data-wx="wind"] { min-width: 84px; }
.hd-sim { margin-left: auto; font-size: 11px; color: var(--tx-3); white-space: nowrap; }
#top #storyb { height: 32px; } #top #qi { width: 32px; height: 32px; color: var(--tx-2); }
@media (max-width: 1360px) { .hd-sim, .loc-b .loc-s { display: none; } #top #storyb { margin-left: auto; } }
@media (max-width: 1180px) { #top .brand span { display: none; } .hw { padding: 0 10px; } }

/* left panel: one panel, sections split by hairlines */
@media (min-width: 821px) {
  #layers { top: calc(var(--hdr) + var(--gap)); width: var(--pw-l); max-height: calc(100vh - var(--hdr) - var(--gap) - 80px); padding: 0;
    gap: 0;
    background: var(--sf); border: 1px solid var(--ln); border-radius: var(--r); box-shadow: var(--sh); }
  #layers > .card { padding: 12px 16px; gap: 10px; background: none; box-shadow: none; border-radius: 0; }
  #layers > .card + .card { border-top: 1px solid var(--ln); }
  #layers > .card > h2 { font-size: 13px; color: var(--tx-1); }
  #layers .ly-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; border: 1px solid var(--ln);
    border-radius: var(--r-2); background: var(--bg-0); }
  #layers .ly-list .ly { height: 30px; padding: 0 6px; gap: 6px; justify-content: center; border: 0; border-radius: var(--r-3);
    color: var(--tx-2); }
  #layers .ly-list .ly span { flex: none; } #layers .ly-list .ly small { display: none; }
  #layers .ly-list .ly.on { background: var(--sf-3); color: var(--tx-1); box-shadow: inset 0 0 0 1px var(--ln-2); }
  #layers .ly-list .ly.on .ic { color: var(--acc-hi); }
  #layers .ly-list .ly-sm, #layers .ly-list .ly:nth-child(n+4) { grid-column: 1 / -1; justify-content: flex-start; padding: 0 8px; }
  #layers .ly-list .ly:nth-child(n+4) span { flex: 1; text-align: left; }
  #rail { position: static; width: auto; padding: 0; display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px; background: none;
    border: 0; box-shadow: none; }
  #rail .rl { width: 28px; height: 28px; color: var(--tx-3); border-radius: var(--r-3); } #rail .rl .ic { width: 16px; height: 16px; }
  #rail .rl.on { color: var(--acc-hi); background: var(--acc-t); }
  #rail .rl:hover:not(:disabled) { background: var(--sf-3); color: var(--tx-1); }
  #rail .rl-base { flex-direction: row; gap: 2px; padding: 0 6px 0 0; margin: 0 4px 0 0; border-bottom: 0;
    border-right: 1px solid var(--ln); }
  #rail .rl-tip { left: 50%; top: auto; bottom: 34px; transform: translateX(-50%); }
}
#board:empty { display: none; }

/* legend chip, bottom left */
#legend { position: fixed; z-index: 20; left: var(--gap); bottom: var(--gap); padding: 6px 10px 7px; border-radius: var(--r-2);
  background: var(--chip);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; }
#legend .lgc-t { display: block; font-size: 11px; line-height: 14px; font-weight: 600; color: var(--tx-1); margin-bottom: 4px; }
#legend .lg { display: flex; flex-direction: row; align-items: center; gap: 8px; }
#legend .lg small { font-size: 11px; color: var(--tx-2); white-space: nowrap; }
#legend .lv-bar { width: 168px; height: 6px; border-radius: 3px; box-shadow: inset 0 0 0 1px hsl(0 0% 100% / .12); }
#legend .lg.empty .lv-bar { background: var(--ln-2); }

/* right panel: crew list */
@media (min-width: 821px) { #crew { top: calc(var(--hdr) + var(--gap)); } }
.pn-h { padding: 12px 12px 8px 16px; } .pn-h h2 { font-size: 15px; color: var(--tx-1); } .pn-h small { font-size: 11px; }
.th-menu { background: var(--sf-2); } .th-dept b { color: var(--tx-1); }
.pn-sort { padding: 0 16px 8px; } .pn-sort small { display: none; } .pn-sort button { color: var(--tx-3); }
.pn-sort button[aria-pressed=true] { background: var(--sf-3); color: var(--tx-1); font-weight: 500; }
.rh, .r1 { display: grid; grid-template-columns: 16px minmax(0, 1fr) 56px 44px 44px; gap: 8px; align-items: center; }
.rh { padding: 6px 16px; border-top: 1px solid var(--ln); border-bottom: 1px solid var(--ln); }
.rh small { font-size: 11px; white-space: nowrap; }
.rh .rh-a, .rh .rh-h { text-align: right; }
.rows { padding: 0 8px 8px; } .row { padding: 0 8px; border-radius: 0; } .row + .row { box-shadow: none; border-top: 1px solid var(--ln); }
.row:hover, .row.hov { background: var(--sf-2); } .r1 { min-height: 46px; }
.row .ric { color: var(--tx-3); } .row.watch .ric { color: var(--watch); } .row.alert .ric, .row.hot .ric { color: var(--alert); }
.nmc { display: flex; flex-direction: column; gap: 3px; min-width: 0; } .nm { font-size: 13px; font-weight: 500; line-height: 16px; }
.l2 { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; line-height: 14px; color: var(--tx-3);
  white-space: nowrap; }
.l2 .fact { overflow: hidden; text-overflow: ellipsis; } .l2 .smk { margin: 0; flex: none; }
.sp { display: flex; align-items: center; } .sp svg { display: block; max-width: 56px; }
.num { display: block; text-align: right; } .num b { font-size: 14px; } .num.core b { font-weight: 500; color: var(--tx-2); }
.row.watch .num.core b { color: var(--watch); }
.row.alert .num.core b { color: var(--alert); }
.num.heat b, .row.hot .num.heat b { font-weight: 600; color: var(--tx-1); }
.row.sel { background: var(--sf-2); box-shadow: inset 2px 0 0 var(--acc-hi); }
.row.sel.watch { box-shadow: inset 2px 0 0 var(--watch); }
.row.sel.alert { box-shadow: inset 2px 0 0 var(--alert); }
/* detail */
.r3 { margin: 0; padding: 4px 4px 12px 24px; display: flex; flex-direction: column; gap: 8px; cursor: default; }
.r3n { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.r3n div, .r3g div { display: flex; flex-direction: column; min-width: 0; }
.r3n small, .r3g small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3n b { font-size: 15px; line-height: 20px; font-weight: 500; }
.r3n .watch b { color: var(--watch); }
.r3n .alert b { color: var(--alert); }
.r3-ch { min-height: 120px; } .r3-ch svg { display: block; max-width: 100%; }
.r3f { margin: 0; font-size: 12px; line-height: 17px; font-weight: 400; color: var(--tx-2); }
.r3f b { font-weight: 600; color: var(--acc-hi); }
.r3f b.watch { color: var(--watch); } .r3f b.alert { color: var(--alert); }
.r3g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--ln); font-size: 12px;
  }
.r3g b { font-size: 13px; font-weight: 500; color: var(--tx-1); }
.r3m { margin: 0; font-size: 11px; color: var(--tx-3); }
.r3-ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.r3-loc { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--acc-hi); font: inherit;
  font-size: 12px; cursor: pointer; }

/* person card */
@media (min-width: 821px) { #tip { width: 264px; padding: 12px 14px; gap: 8px; } }
#tip .tp-h { gap: 8px; }
#tip .tp-h b { font-size: 13px; font-weight: 600; }
#tip .tp-h small { font-size: 11px; }
#tip .tp-ic { color: var(--tx-3); }
#tip.tip-watch .tp-ic { color: var(--watch); } #tip.tip-alert .tp-ic { color: var(--alert); }
#tip .tp-h .hc-btn.sm { width: 24px; height: 24px; } #tip .tp-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
#tip .tp-grid small { font-size: 11px; white-space: nowrap; } #tip .tp-grid b { font-size: 15px; line-height: 20px; font-weight: 500; }
#tip .tp-grid .watch b { color: var(--watch); } #tip .tp-grid .alert b { color: var(--alert); }
#tip .tp-f { padding-top: 8px; border-top: 1px solid var(--ln); font-size: 12px; line-height: 16px; font-weight: 400; color: var(--tx-2); }
/* round 19: the card is anchored to the person (tip.js sets the transform and --ax); arrow down to the icon, up when the card flips below */
@media (min-width: 821px) {
  #tip.anch { overflow: visible; max-height: none; will-change: transform; }
  #tip.anch::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -7px; width: 12px; height: 12px; background: var(--sf-solid);
    border: 1px solid var(--ln); border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
  #tip.anch.below::after { bottom: auto; top: -7px; transform: translateX(-50%) rotate(225deg); }
  #tip.anch.off::after { display: none; }
}

/* info card: title, at most three sentences, one source line */
#icard { width: 272px; background: var(--sf-solid); border: 1px solid var(--ln); box-shadow: var(--sh); }
#icard .ic-h b { font-size: 13px; }
#icard .ic-one { font-size: 12px; line-height: 17px; color: var(--tx-2); }
#icard .ic-s { margin: 6px 0 0; font-size: 11px; color: var(--tx-3); }
.ii { background: none; border-color: var(--ln-2); color: var(--tx-3); }
.ii:hover, .ii[aria-expanded=true] { color: var(--acc-hi); border-color: var(--acc-hi); background: var(--acc-t); }
.il { text-decoration-color: var(--ln-2); } .il:hover, .il[aria-expanded=true] { color: var(--acc-hi); }
#sheet { top: calc(var(--hdr) + var(--gap)); }

/* dock: neutral "now" (red is Alert only) */
#dk-t { font-size: 18px; }
.dk-track::after { background: var(--tx-1); }
.dk-tick.now { color: var(--tx-1); }
.dk-tick.forecast { color: var(--acc-hi); }
.dk-track::before { background: linear-gradient(90deg, var(--ln-2) var(--now), transparent var(--now)),
  repeating-linear-gradient(135deg, hsl(186 46% 62% / .22) 0 4px, hsl(186 46% 62% / .08) 4px 8px); }
#dk-s::-webkit-slider-thumb { background: var(--tx-1); border-color: var(--acc-hi); }
#dk-s::-moz-range-thumb { background: var(--tx-1); border-color: var(--acc-hi); }
.hc-tag { background: var(--sf-3); color: var(--tx-2); }
.hc-tag.now { background: var(--sf-3); color: var(--tx-1); }
.hc-tag.forecast { background: var(--acc-t); color: var(--acc-hi); }
.seg { background: var(--bg-0); box-shadow: inset 0 0 0 1px var(--ln); } .seg button, .seg a { color: var(--tx-3); }
.seg button[aria-pressed=true], .seg a[aria-pressed=true] { background: var(--sf-3); color: var(--tx-1);
  box-shadow: inset 0 0 0 1px var(--ln-2); }
.smk { background: hsl(270 30% 60% / .18); color: hsl(270 45% 78%); } .smk.now { background: hsl(270 35% 55%); color: #fff; }
[data-theme="light"] .smk { background: #ece9f3; color: #4a3f6b; }
.cesium-viewer-bottom, .cesium-credit-logoContainer { left: calc(var(--L) + 240px) !important; }
/* round 18 integration: the credit bar (Cesium logo, imagery attribution) sat half under the dock; on desktop it sits right-aligned above the dock,
   next to the crew panel, fully visible */
@media (min-width: 821px) { .cesium-viewer-bottom { left: auto !important; right: calc(var(--R) + 4px) !important; bottom: 128px !important;
    transform: scale(.7); transform-origin: right bottom; opacity: .55; transition: opacity .2s; }
  .cesium-viewer-bottom:hover { opacity: 1; }
  .cesium-viewer-bottom .cesium-credit-logoContainer { left: auto !important; } }

/* phone (<= 820 px): header with the dropdown, Tour and "i" only */
@media (max-width: 820px) {
  #top { left: 0; width: auto; height: var(--hdr); padding: 0 6px; gap: 6px; }
  #top .brand, #top .vr, .hwx, .hd-sim { display: none; }
  .loc { flex: 1; min-width: 0; }
  .loc-b { min-width: 0; width: 100%; height: 40px; }
  .rh, .r1 { grid-template-columns: 18px minmax(0, 1fr) 64px 44px 44px; } #board { display: none; }
  #legend { bottom: calc(var(--above-dock) + 64px); } body.tip-on #legend, #crew.open ~ #legend { display: none; }
}
.rh .rh-h, .rh .rh-t { grid-column: auto; }
@media (min-width: 821px) { #rail { gap: 1px; }
#rail .rl { width: 26px; height: 26px; }
#rail .rl-base { padding-right: 4px; margin-right: 3px; }
}
@media (min-width: 821px) { #layers > #board { padding: 0 16px; gap: 0; } }
/* issue chips (issues.js): one per extra issue; outline, one stroke weight, colour = level */
.iss { display: inline-flex; flex: none; align-items: center; gap: 3px; height: 16px; padding: 0 5px; border-radius: 8px; font-size: 10.5px;
  font-weight: 600; line-height: 16px; color: var(--tx-2); box-shadow: inset 0 0 0 1px var(--ln-2); white-space: nowrap; }
.iss .ic { width: 11px; height: 11px; } .iss.watch { color: var(--watch); box-shadow: inset 0 0 0 1px hsl(38 84% 60% / .45); }
.iss.alert { color: var(--alert); box-shadow: inset 0 0 0 1px hsl(8 74% 58% / .5); }
[data-theme="light"] .iss.watch { box-shadow: inset 0 0 0 1px var(--watch); } [data-theme="light"] .iss.alert { box-shadow: inset 0 0 0 1px var(--alert); }
.r3i, .tp-iss { display: flex; flex-wrap: wrap; gap: 4px; } .tp-iss { margin-bottom: 4px; }
/* round 19: the row's second line wraps (pill + up to three chips + the smoke badge fit the 126 px name column at 1280 to 1728 px) */
.row .l2 { flex-wrap: wrap; gap: 3px 4px; overflow: visible; white-space: normal; } .row .l2 > * { flex: none; }
.row .l2 .fact { flex: 0 1 auto; min-width: 0; white-space: nowrap; } .row .r1 { padding: 4px 0; box-sizing: border-box; }
.iss.cpt { gap: 2px; padding: 0 4px; letter-spacing: -.1px; }
.iss.flag { color: var(--tx-2); }
