/* Apple-inspired look. Light is default; dark follows the system or the in-app switch. */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --card-2: #fbfbfd;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .08);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: rgba(0, 0, 0, .08);
  --accent: #0071e3;
  --accent-tint: rgba(0, 113, 227, .1);
  --on-accent: #ffffff;
  --green: #248a3d;
  --green-tint: rgba(52, 199, 89, .14);
  --red: #e3241b;
  --red-tint: rgba(255, 59, 48, .1);
  --orange: #c93400;
  --orange-tint: rgba(255, 149, 0, .14);
  --bar: rgba(245, 245, 247, .78);
  --sheet: #ffffff;
  --shadow: 0 2px 6px rgba(0, 0, 0, .03), 0 8px 24px rgba(0, 0, 0, .05);
  --hero-1: #0b3a75;
  --hero-2: #0071e3;
  --hero-live-1: #0c4a3e;
  --hero-live-2: #1a8f6e;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --card-2: #232326; --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
    --text: #f5f5f7; --muted: #98989d; --faint: #8d8d93; --line: rgba(255, 255, 255, .1);
    --accent: #2997ff; --accent-tint: rgba(41, 151, 255, .16); --on-accent: #ffffff;
    --green: #30d158; --green-tint: rgba(48, 209, 88, .16); --red: #ff453a; --red-tint: rgba(255, 69, 58, .16);
    --orange: #ff9f0a; --orange-tint: rgba(255, 159, 10, .16);
    --bar: rgba(22, 22, 23, .78); --sheet: #1c1c1e; --shadow: none;
    --hero-1: #06213f; --hero-2: #0a4f9e; --hero-live-1: #052e26; --hero-live-2: #0f6b52;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --card-2: #232326; --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .16);
  --text: #f5f5f7; --muted: #98989d; --faint: #8d8d93; --line: rgba(255, 255, 255, .1);
  --accent: #2997ff; --accent-tint: rgba(41, 151, 255, .16); --on-accent: #ffffff;
  --green: #30d158; --green-tint: rgba(48, 209, 88, .16); --red: #ff453a; --red-tint: rgba(255, 69, 58, .16);
  --orange: #ff9f0a; --orange-tint: rgba(255, 159, 10, .16);
  --bar: rgba(22, 22, 23, .78); --sheet: #1c1c1e; --shadow: none;
  --hero-1: #06213f; --hero-2: #0a4f9e; --hero-live-1: #052e26; --hero-live-2: #0f6b52;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 var(--font);
  letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
  transition: background-color .3s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; letter-spacing: -.028em; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 700; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 650; }
h3 { font-size: 17px; font-weight: 600; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.ic-lg { width: 26px; height: 26px; }

/* ---------- bars ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; min-width: 0; }
.brand img { border-radius: 7px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted);
  background: var(--fill-2); padding: 5px 10px; border-radius: 999px;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status.offline .dot { background: var(--orange); }
.icon-btn {
  appearance: none; border: 0; background: var(--fill-2); color: var(--text); width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--fill); }

.view { max-width: 780px; margin: 0 auto; padding: 20px 16px 24px; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 8px; font-size: 10.5px; font-weight: 500; letter-spacing: 0; color: var(--faint); text-decoration: none;
}
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a.active { color: var(--accent); }
@media (min-width: 900px) {
  .tabbar { left: 50%; right: auto; bottom: 18px; transform: translateX(-50%); width: 500px; border-radius: 22px; border: .5px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.12); padding-bottom: 0; }
  body { padding-bottom: 110px; }
}

/* ---------- surfaces ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.card.tight { padding: 14px 18px; margin-bottom: 10px; }
.card.link { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .2s ease; }
.card.link:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.04), 0 14px 34px rgba(0,0,0,.08); }
.card.link:active { transform: scale(.99); }
.card.warn { box-shadow: inset 4px 0 0 var(--orange), var(--shadow); }
.card.danger { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }

.hero {
  border-radius: 24px; padding: 26px 22px 22px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, var(--hero-2) 0%, var(--hero-1) 70%);
  box-shadow: 0 12px 40px rgba(0, 60, 140, .22);
  position: relative; overflow: hidden;
}
.hero.live { background: radial-gradient(120% 140% at 100% 0%, var(--hero-live-2) 0%, var(--hero-live-1) 75%); box-shadow: 0 12px 40px rgba(10, 90, 70, .25); }
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%); pointer-events: none;
}
.hero h1 { color: #fff; margin-bottom: 4px; }
.hero .eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; opacity: .75; margin-bottom: 6px; }
.hero .sub { opacity: .8; font-size: 15px; margin-bottom: 18px; }
.hero input { background: rgba(255,255,255,.16); color: #fff; }
.hero input::placeholder { color: rgba(255,255,255,.65); }
.hero input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.hero .stats { margin-top: 6px; }
.hero .stat { background: rgba(255,255,255,.12); }
.hero .stat .l, .hero .muted { color: rgba(255,255,255,.72); }
.hero .btn { background: rgba(255,255,255,.18); color: #fff; }
.hero .btn:hover { background: rgba(255,255,255,.26); }
.hero .btn.white { background: #fff; color: #0b3a75; }
.hero.live .btn.white { color: #0c4a3e; }
.hero .btn.red { background: #ff453a; color: #fff; }
.hero .live-line { font-size: 13px; color: rgba(255,255,255,.78); margin-top: 12px; display: flex; gap: 6px; align-items: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 0 rgba(48,209,88,.7); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(48,209,88,0); } 100% { box-shadow: 0 0 0 0 rgba(48,209,88,0); } }

/* ---------- layout utils ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 15px; letter-spacing: -.01em; }
.tiny { font-size: 12px; letter-spacing: 0; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hr { border: 0; border-top: .5px solid var(--line); margin: 16px 0; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; margin-left: -4px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.page-head h1 { margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.meta > span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; background: var(--accent-tint); color: var(--accent);
  border-radius: 980px; padding: 10px 18px; font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -.01em; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none !important;
  min-height: 44px; transition: background-color .2s ease, transform .1s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.green { background: var(--green-tint); color: var(--green); }
.btn.red { background: var(--red-tint); color: var(--red); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.gray { background: var(--fill-2); color: var(--text); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btns > .btn { flex: 1 1 auto; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.card .stat { background: var(--fill-2); box-shadow: none; }
.stat .v { font: 700 26px/1.15 var(--font-round); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-top: 2px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -.025em; margin: 28px 2px 12px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title a { font-size: 15px; font-weight: 400; }
.year { margin: 26px 4px 10px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }

/* ---------- grouped key/value list ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; margin: 0; font-size: 15px; }
.kv dt, .kv dd { padding: 11px 0; border-top: .5px solid var(--line); margin: 0; }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }
.kv dt { color: var(--muted); padding-right: 12px; }
.kv dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }

/* ---------- chips, segmented, badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0; background: var(--fill-2); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s;
}
.chip:hover { background: var(--fill); }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip a { color: inherit; display: inline-flex; opacity: .6; }
.seg { display: inline-flex; background: var(--fill-2); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  padding: 6px 16px; border-radius: 8px; cursor: pointer; min-height: 32px;
}
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600; }
:root[data-theme="dark"] .seg button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }
select.pill { width: auto; min-height: 36px; padding: 6px 32px 6px 14px; border-radius: 10px; font-size: 14px; }

.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--fill-2); color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.badge.high { background: var(--red-tint); color: var(--red); }
.badge.medium { background: var(--orange-tint); color: var(--orange); }
.badge.low { background: var(--fill-2); color: var(--muted); }
.badge.done { background: var(--green-tint); color: var(--green); }
.badge.overdue { background: var(--red); color: #fff; }

/* ---------- forms ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 4px; font-weight: 500; letter-spacing: 0; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--text); background: var(--fill-2);
  border: 0; border-radius: 12px; padding: 11px 14px; min-height: 46px; outline: none;
  transition: box-shadow .15s, background-color .15s;
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--accent-tint), inset 0 0 0 1px var(--accent); background: var(--card); }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; padding: 0; accent-color: var(--accent); border-radius: 50%; cursor: pointer; }
input[type=date] { min-height: 46px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 16px; cursor: pointer; }

/* ---------- collapsible reference sections ---------- */
details.section { background: var(--card); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); overflow: hidden; }
details.section > summary {
  cursor: pointer; padding: 16px 20px; list-style: none; display: flex; gap: 14px; align-items: center;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary .s-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); flex: none; }
details.section > summary .s-t { flex: 1; min-width: 0; }
details.section > summary .s-t b { display: block; font-weight: 600; }
details.section > summary .s-t small { color: var(--muted); font-size: 13px; }
details.section > summary .chev { color: var(--faint); transition: transform .25s ease; }
details.section[open] > summary .chev { transform: rotate(90deg); }
details.section .inner { padding: 0 20px 20px; }
details.section h3 { margin: 22px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.verify { font-size: 10px; color: var(--orange); background: var(--orange-tint); font-weight: 700; margin-left: 6px; padding: 1px 6px; border-radius: 4px; letter-spacing: .03em; vertical-align: 1px; }
.note-box { background: var(--fill-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); margin-bottom: 4px; }

/* ---------- parts ---------- */
.parts { width: 100%; border-collapse: collapse; font-size: 15px; }
.parts td { padding: 10px 4px; border-top: .5px solid var(--line); vertical-align: middle; }
.parts tr:first-child td { border-top: 0; }
.part-edit { display: grid; grid-template-columns: 28px 1fr 34px; gap: 10px; align-items: start; padding: 14px 0; border-top: .5px solid var(--line); }
.part-edit:first-child { border-top: 0; }
.part-edit > input[type=checkbox] { margin-top: 10px; }
.part-edit .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.part-edit .fields input { min-height: 40px; padding: 8px 12px; font-size: 15px; }
.part-edit .fields .full { grid-column: 1 / -1; }
.part-edit .btn { padding: 0; width: 34px; min-height: 34px; margin-top: 3px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 28px; margin-left: 9px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li .t-ic { position: absolute; left: -11px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.timeline li .t-ic svg { width: 12px; height: 12px; }
.timeline li b { font-weight: 600; }

/* ---------- map & weather ---------- */
.map { height: 340px; border-radius: var(--radius); overflow: hidden; z-index: 0; margin-bottom: 16px; box-shadow: var(--shadow); background: var(--fill-2); }
:root[data-theme="dark"] .map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.7); } }
.leaflet-container { font: inherit; }
.leaflet-control-zoom a { border-radius: 8px !important; }
.wx { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 520px) { .wx { grid-template-columns: repeat(4, 1fr); } }
.wx .stat .v { font-size: 20px; display: flex; align-items: center; gap: 6px; }
.wx .stat .l { margin: 0 0 4px; }
.arrow { display: inline-flex; color: var(--accent); }
.arrow svg { width: 18px; height: 18px; }

/* ---------- modal sheet ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal .sheet {
  background: var(--sheet); width: 100%; max-width: 600px; max-height: 92vh; overflow: auto;
  border-radius: 22px 22px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  animation: up .32s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
.modal .sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--fill); margin: 0 auto 14px; }
.modal .sheet h2 { font-size: 24px; font-weight: 700; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal .sheet { border-radius: 22px; padding-top: 24px; }
  .modal .sheet::before { display: none; }
}

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(29, 29, 31, .92); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 200;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 15px; font-weight: 500; animation: up .3s ease;
}
.toast.err { background: var(--red); }

/* ---------- misc ---------- */
.login { max-width: 380px; margin: 12vh auto 0; text-align: center; padding: 36px 28px; }
.login img { border-radius: 18px; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(0,60,140,.25); }
.login h1 { font-size: 30px; }
.login input { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 8px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.route { font-weight: 600; font-size: 17px; }
.route .to { color: var(--faint); margin: 0 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* segmented control on the blue hero card */
.hero .seg { background: rgba(255, 255, 255, .14); }
.hero .seg button { color: rgba(255, 255, 255, .85); }
:root .hero .seg button.on { background: #fff; color: #0b3a75; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.hero .tiny.muted { color: rgba(255, 255, 255, .7); }

/* ---------- passage planner ---------- */
.plan-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0 10px; align-items: end; }
.plan-route .swap { margin-bottom: 20px; }
@media (max-width: 520px) {
  .plan-route { grid-template-columns: 1fr auto; }
  .plan-route label:last-child { grid-column: 1; }
  .plan-route .swap { grid-row: 1 / span 2; grid-column: 2; align-self: center; margin: 0; }
}
.plan-map { height: 300px; margin: 4px 0 14px; }
.plan-map.picking { cursor: crosshair; box-shadow: 0 0 0 3px var(--accent); }
.pm span { display: grid; place-items: center; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); color: #fff; font: 700 10px/1 var(--font); }
.wind-mk { display: flex; flex-direction: column; align-items: center; color: #0b3a75; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff); }
.wind-mk svg { width: 20px; height: 20px; }
.wind-mk b { font: 700 11px/1 var(--font); margin-top: -2px; }
details.opts { border-top: .5px solid var(--line); padding-top: 4px; }
details.opts > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 0; font-weight: 600; color: var(--accent); }
details.opts > summary::-webkit-details-marker { display: none; }
.opts-inner { padding-top: 8px; }

.plan-summary .eyebrow-dark { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--muted); }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--fill); }
.ring-fg { stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.9,.3,1); }
.ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-txt b { font: 700 34px/1 var(--font-round); letter-spacing: -.03em; }
.ring-txt span { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; text-align: center; max-width: 80px; line-height: 1.15; }
@media (max-width: 420px) { .plan-summary > .row { flex-direction: column; align-items: flex-start !important; } }

.mix { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.mix-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.why { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-size: 15px; }
.why li { display: flex; gap: 8px; align-items: flex-start; }
.why li .ic { margin-top: 2px; }
.why li.good .ic { color: var(--green); }
.why li.meh .ic { color: var(--orange); }
.why li.bad .ic { color: var(--red); }

.wchart { display: flex; align-items: flex-end; gap: 3px; height: 150px; overflow-x: auto; padding: 18px 2px 0; scrollbar-width: thin; }
.wbar { appearance: none; border: 0; background: none; padding: 0; flex: 0 0 18px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: pointer; position: relative; }
.wbar i { display: block; width: 100%; height: var(--h); background: var(--c); border-radius: 5px 5px 2px 2px; opacity: .55; transition: opacity .15s, transform .15s; }
.wbar:hover i { opacity: .85; }
.wbar.on i { opacity: 1; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.wbar span { font-size: 9px; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.wday { flex: 0 0 auto; align-self: stretch; border-left: 1px solid var(--line); margin: 0 4px 0 6px; position: relative; }
.wday { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 600; color: var(--muted); padding: 4px 2px; text-align: right; white-space: nowrap; letter-spacing: 0; }

.leg-card p { font-size: 15px; margin: 12px 0 0; }
.leg-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.leg-no { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.leg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .leg-grid { grid-template-columns: repeat(4, 1fr); } }
.leg-grid .v { font-size: 19px; display: flex; align-items: center; gap: 4px; }
.leg-grid .v.sm { font-size: 15px; font-family: var(--font); font-weight: 650; line-height: 1.25; }
.boards { margin: 8px 0 0; padding-left: 22px; font-size: 15px; display: grid; gap: 6px; }

.table-wrap { padding: 8px 0 16px; overflow-x: auto; }
.table-wrap > p { padding: 0 18px; }
.hourly { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.hourly th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 10px; border-bottom: .5px solid var(--line); }
.hourly td { padding: 9px 10px; border-bottom: .5px solid var(--line); }
.hourly tr:last-child td { border-bottom: 0; }
.hourly th:first-child, .hourly td:first-child { padding-left: 18px; }
.hourly tr.dark-row td { background: var(--fill-2); }
.arrow.sm svg { width: 14px; height: 14px; }
.arrow.sm { vertical-align: -2px; margin-right: 3px; }

/* ---------- sailing guide ---------- */
.term { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; letter-spacing: inherit; text-align: inherit; }
.term:hover { color: var(--accent); }
.term.b { font-weight: 650; }
.sheet.guide p { font-size: 16px; line-height: 1.5; margin: 6px 0 0; }
.sg { margin: 14px 0 10px; }
.sg svg { width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; }
.sg-water { fill: var(--fill-2); }
.sg-hull { fill: var(--card); stroke: var(--text); stroke-width: 1.4; }
.sg-mast { fill: var(--text); }
.sg-sail { fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; }
.sg-jib { fill: none; stroke: #34c759; stroke-width: 2.4; stroke-linecap: round; }
.sg-pole { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 3 2; }
.sg-prev { fill: none; stroke: var(--red); stroke-width: 1.8; stroke-dasharray: 4 3; }
.sg-wind line { stroke: var(--muted); }
.sg-wind path { fill: var(--muted); }
.sg-label { fill: var(--text); font: 600 12px var(--font); letter-spacing: -.01em; }
.sg-muted { fill: var(--muted); font: 500 11px var(--font); }
.sg-strong { fill: var(--accent); font-size: 13px; }
.sg-sector { fill: var(--card); stroke: var(--line); stroke-width: 1; }
.sg-sector.on { fill: var(--accent); fill-opacity: .28; }
.sg-nogo { fill: var(--red); fill-opacity: .12; }
.sg-nogo.on { fill-opacity: .3; }
.sg-path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 7 5; stroke-linejoin: round; }
.sg-rhumb { stroke: var(--faint); stroke-width: 1.2; stroke-dasharray: 2 4; }
.sg-dot { fill: #af52de; stroke: #fff; stroke-width: 2; }
.sg-mark { fill: var(--red); stroke: #fff; stroke-width: 2; }
.sg-arc { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.sg-mastline { stroke: var(--text); stroke-width: 2.5; }
.sg-boom { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.sg-sailfill { fill: var(--accent); fill-opacity: .22; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.sg-jibfill { fill: #34c759; fill-opacity: .22; stroke: #34c759; stroke-width: 2; stroke-linejoin: round; }
.sg-reefband { fill: var(--muted); }
