:root {
  --rec: #0e9aa7;
  --trial: #f07b3f;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e2e7ee;
  --text: #0f1b2d;
  --muted: #5b6b80;
  --accent: #0e7c86;
  --accent-2: #0b2545;
  --accent-soft: #e2f3f4;
  --catch: #0e9aa7;
  --finish: #f07b3f;
  --warn: #b45309;
  --warn-soft: #fff4e5;
  --ok: #15803d;
  --ok-soft: #e8f6ec;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 6px 24px rgba(15, 27, 45, .06);
  --radius: 14px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121b2c; --surface-2: #172238; --line: #24314a;
    --text: #e7edf6; --muted: #93a3ba; --accent: #2cc2c9; --accent-2: #9ad7ff;
    --accent-soft: #123a44; --catch: #2cc2c9; --finish: #ff9a62;
    --warn: #fbbf6a; --warn-soft: #3a2a12; --ok: #4ade80; --ok-soft: #12321f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    --rec: #169ca4; --trial: #d96f35;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121b2c; --surface-2: #172238; --line: #24314a;
  --text: #e7edf6; --muted: #93a3ba; --accent: #2cc2c9; --accent-2: #9ad7ff;
  --accent-soft: #123a44; --catch: #2cc2c9; --finish: #ff9a62;
  --warn: #fbbf6a; --warn-soft: #3a2a12; --ok: #4ade80; --ok-soft: #12321f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  --rec: #169ca4; --trial: #d96f35;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 12.5px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 24px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 36px; height: 36px; flex: none; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(340px, 430px) 1fr; gap: 20px;
  max-width: 1440px; margin: 0 auto; padding: 20px 24px 60px;
}
.inputs { display: flex; flex-direction: column; gap: 16px; }
.results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 981px) {
  .inputs { position: sticky; top: 78px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800;
}

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field > label b { color: var(--text); font-weight: 700; margin-left: 4px; }
.hint { font-weight: 400; opacity: .8; }
.unit { font-weight: 400; }
input[type=text], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.small { margin: 0; }
.seg.small button { padding: 5px 10px; font-size: 12.5px; }

.boat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.boat-grid .grp { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
.boat-btn {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 8px 4px 6px;
  cursor: pointer; text-align: center; transition: .15s;
}
.boat-btn b { display: block; font-family: var(--mono); font-size: 15px; }
.boat-btn span { font-size: 10.5px; color: var(--muted); }
.boat-btn:hover { border-color: var(--accent); }
.boat-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.boat-btn.on span { color: rgba(255, 255, 255, .85); }

.blade-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.blade-btn {
  display: flex; align-items: center; gap: 8px; text-align: left;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 9px; cursor: pointer;
}
.blade-btn svg { width: 42px; height: 22px; flex: none; }
.blade-btn .bn { font-weight: 600; font-size: 13px; line-height: 1.2; }
.blade-btn .bo { font-size: 11px; color: var(--muted); }
.blade-btn:hover { border-color: var(--accent); }
.blade-btn.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.blade-note { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); padding: 2px 2px 0; }

.rower-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.rower-card .rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.rower-card .rc-head b { font-size: 13.5px; }
.seat-badge { font-family: var(--mono); font-size: 11.5px; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.rower-card .field { margin-bottom: 8px; }
.rower-card input, .rower-card select { background: var(--surface); padding: 7px 9px; }
.side-tag { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); }
.side-tag.port { color: #c2410c; }
.side-tag.stbd { color: #15803d; }
.copy-btn { font-size: 12px; border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 600; padding: 0; }

.overlap-row { display: flex; gap: 10px; align-items: center; }
.overlap-row .seg { flex: none; }
.overlap-row input:disabled { opacity: .4; }
.cond-grid .field { margin-bottom: 16px; }
.wind-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
#wind-dial { width: 150px; height: 150px; touch-action: none; cursor: grab; }
.big-read { font-family: var(--mono); font-size: 26px; font-weight: 700; }
.big-read .unit { font-size: 13px; color: var(--muted); font-family: Inter, sans-serif; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.chips button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; font-size: 11.5px; padding: 3px 9px; cursor: pointer; }
.chips button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- results ---------- */
.hero { background: linear-gradient(135deg, var(--accent-2), color-mix(in srgb, var(--accent) 75%, var(--accent-2))); color: #fff; border: 0; }
:root[data-theme="dark"] .hero { background: linear-gradient(135deg, #0f2a44, #0d5560); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: linear-gradient(135deg, #0f2a44, #0d5560); } }
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .75; font-weight: 600; }
.res-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.speed-pill { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 8px 12px; text-align: right; font-size: 12px; }
.speed-pill b { display: block; font-family: var(--mono); font-size: 18px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 12px 14px; }
.tile .tl { font-size: 12px; opacity: .8; font-weight: 600; }
.tile .tv { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.tile .tv small { font-size: 14px; opacity: .75; margin-left: 2px; }
.tile .ts { font-size: 11.5px; opacity: .75; }
.range { position: relative; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); margin: 8px 0 4px; }
.range .band { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, .35); border-radius: 3px; }
.range .dot { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.tile .delta { font-size: 11.5px; font-weight: 600; }

.diagram svg { width: 100%; height: auto; display: block; }
.diagram.side { margin-top: 10px; }
.legend { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-left: 8px; }
.lg.catch { background: var(--catch); }
.lg.finish { background: var(--finish); }

.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spec { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.spec .sl { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.spec .sv { font-family: var(--mono); font-weight: 700; font-size: 18px; }
.spec .sv small { font-size: 12px; color: var(--muted); font-weight: 500; }
.spec .sd { font-size: 11.5px; color: var(--muted); }

.arc-row { margin-bottom: 12px; }
.arc-row .ar-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; gap: 8px; }
.arc-row .ar-head b { font-family: var(--mono); }
.arc-bar { position: relative; height: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.arc-bar .zone { position: absolute; top: 0; bottom: 0; background: var(--ok-soft); border-left: 1px dashed var(--ok); border-right: 1px dashed var(--ok); }
.arc-bar .c { position: absolute; top: 3px; bottom: 3px; background: var(--catch); border-radius: 4px 0 0 4px; }
.arc-bar .f { position: absolute; top: 3px; bottom: 3px; background: var(--finish); border-radius: 0 4px 4px 0; }
.status { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.lo, .status.hi { background: var(--warn-soft); color: var(--warn); }

.table-wrap { overflow-x: auto; }
.seat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.seat-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.seat-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.seat-table td.num { font-family: var(--mono); }
.seat-table tr:last-child td { border-bottom: 0; }

.notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.notes li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; display: flex; gap: 10px; }
.notes li::before { content: 'ℹ'; color: var(--accent); font-weight: 800; }
.notes li.warn { background: var(--warn-soft); border-color: transparent; }
.notes li.warn::before { content: '!'; color: var(--warn); }
.notes li.good::before { content: '✓'; color: var(--ok); }

.method summary { cursor: pointer; list-style: none; }
.method summary::-webkit-details-marker { display: none; }
.method summary h3 { display: inline; margin: 0; }
.method summary::after { content: '＋'; float: right; color: var(--muted); }
.method[open] summary::after { content: '－'; }
.method-body { font-size: 14px; color: var(--text); margin-top: 10px; }
.method-body p { margin: 0 0 10px; }

/* ---------- gearing & feel ---------- */
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 5px 0 10px; vertical-align: -1px; }
.sw.rec { background: var(--rec); }
.sw.trial { background: var(--trial); }
.gear-controls { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 18px; align-items: start; margin: 4px 0 6px; }
.gear-controls .btn { margin-top: 22px; }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.gear-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin-top: 12px; }
.sublabel { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 6px; }
.gear-chart-wrap { position: relative; }
.gv-svg, .lv-svg { width: 100%; height: auto; display: block; }
.gv-grid { stroke: var(--line); stroke-width: 1; }
.gv-axis { stroke: var(--muted); stroke-width: 1; }
.gv-tick { font-size: 11px; fill: var(--muted); }
.gv-axlabel { font-size: 11.5px; fill: var(--muted); font-weight: 600; }
.gv-band { fill: var(--ok-soft); }
.gv-bandlabel { font-size: 10.5px; fill: var(--ok); font-weight: 700; }
.gv-curve { fill: none; stroke: var(--text); stroke-width: 2; opacity: .75; }
.gv-move { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; }
.gv-dot { stroke: var(--surface); stroke-width: 2; }
.gv-pt.rec .gv-dot { fill: var(--rec); }
.gv-pt.trial .gv-dot { fill: var(--trial); }
.gv-dlabel { font-size: 11.5px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.gv-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.gv-hdot { fill: var(--text); }
.gv-hit { cursor: crosshair; }
.gear-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.45; width: 180px; z-index: 5; }
.lv-svg { margin-bottom: 4px; }
.lv-cap { font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.lv-cap .sw { margin-left: 0; }
.lv-shaft { stroke: var(--muted); stroke-width: 4; stroke-linecap: round; }
.lv-svg.rec .lv-blade { fill: var(--rec); }
.lv-svg.trial .lv-blade { fill: var(--trial); }
.lv-grip { fill: var(--text); opacity: .6; }
.lv-pin { fill: var(--text); }
.lv-arrow { stroke-width: 3; }
.lv-arrow.h, .lv-headfill.h { stroke: var(--text); fill: var(--text); }
.lv-arrow.b, .lv-headfill.b { stroke: var(--muted); fill: var(--muted); }
.lv-arrow.p, .lv-headfill.p { stroke: var(--accent); fill: var(--accent); }
.lv-ftext { font-size: 11px; font-weight: 600; fill: var(--text); }
.lv-dim { font-size: 10.5px; fill: var(--muted); }
.feel-scale { position: relative; height: 54px; margin-top: 4px; }
.fs-track { position: absolute; left: 0; right: 0; top: 0; height: 26px; }
.fs-seg { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--text); border-right: 2px solid var(--surface); overflow: hidden; white-space: nowrap; }
.fs-seg.s0 { background: color-mix(in srgb, var(--muted) 45%, var(--surface)); border-radius: 6px 0 0 6px; }
.fs-seg.s1 { background: color-mix(in srgb, var(--muted) 25%, var(--surface)); }
.fs-seg.s2 { background: var(--ok-soft); color: var(--ok); }
.fs-seg.s3 { background: color-mix(in srgb, var(--muted) 25%, var(--surface)); }
.fs-seg.s4 { background: color-mix(in srgb, var(--muted) 45%, var(--surface)); border-radius: 0 6px 6px 0; border-right: 0; }
.fs-mark { position: absolute; top: 22px; transform: translateX(-50%); text-align: center; font-size: 11px; }
.fs-mark::before { content: ''; display: block; width: 0; height: 0; margin: 0 auto 2px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--rec); }
.fs-mark.trial::before { border-bottom-color: var(--trial); }
.fs-mark b { color: var(--text); white-space: nowrap; }
.fs-mark.low b { display: block; margin-top: 14px; }
.fs-mark.low::before { border-bottom-width: 9px; }
.feel-scale.tall { height: 70px; }
.fs-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; gap: 8px; }
.gear-verdict { font-size: 14px; margin: 14px 0 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.gear-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gear-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gear-table th .sw { margin-left: 0; }
.gear-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gear-table td.num { font-family: var(--mono); font-size: 12.5px; }
.gear-table td.delta { color: var(--muted); }
.gear-table tr:last-child td { border-bottom: 0; }
.gear-why { margin-top: 12px; font-size: 13.5px; }
.gear-why summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.gear-why p { margin: 8px 0; }
@media (max-width: 1180px) { .gear-grid { grid-template-columns: 1fr; } .gear-controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .gear-controls { grid-template-columns: 1fr; gap: 6px; } .gear-controls .btn { margin-top: 0; justify-self: start; } }

/* ---------- current rig ---------- */
.cur-intro { margin: 0 0 10px; }
.cur-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 10px; }
.cur-fields .field { margin: 0; }
.cur-fields label .hint { display: block; font-size: 11px; }
.cur-fields input.odd { border-color: var(--warn); }
.cur-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.cs-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.cs-item span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.cs-item b { font-family: var(--mono); font-size: 17px; }
.cs-item em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.cur-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cur-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cur-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cur-table td.num { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.cur-table tr.ok td:last-child { color: var(--muted); }
.cur-table tr.todo td:last-child { font-weight: 600; }
#cur-panel h4 { font-size: 14px; margin: 16px 0 6px; }
.cur-steps { margin: 0; padding-left: 22px; font-size: 13.5px; }
.cur-steps li { margin-bottom: 4px; }
.cur-match { font-size: 13.5px; color: var(--ok); font-weight: 600; }
@media (max-width: 1180px) { .cur-summary { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .cur-summary { grid-template-columns: 1fr 1fr; } }

.where { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 99px; margin-right: 4px; vertical-align: 1px; }
.where.quick { background: var(--ok-soft); color: var(--ok); }
.where.workshop { background: var(--warn-soft); color: var(--warn); }
.step-group { font-size: 12.5px; color: var(--muted); margin: 8px 0 4px; }

.erg-hint { margin: 4px 0 0; }
.stroke-row { align-items: end; }
.stroke-hint { margin: 0 0 10px; font-size: 11.5px; line-height: 1.35; }
.shaft-note { margin: -6px 0 12px; }
#load-mode { width: 100%; }
.chk-group { margin-bottom: 10px; }
.chk-item { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: start; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.chk-item:hover { background: var(--surface-2); }
.chk-item input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.chk-item.done .chk-text { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.chk-date { font-size: 11.5px; color: var(--ok); font-weight: 600; white-space: nowrap; }

/* ---------- oar length check ---------- */
.len-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.len-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.len-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.len-table td.num { font-family: var(--mono); text-align: right; white-space: nowrap; width: 80px; }
.len-table tr.zero td { color: var(--muted); }
.len-table tr.total td { border-bottom: 0; border-top: 2px solid var(--text); font-weight: 700; }
.c2-row { display: grid; grid-template-columns: 62px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.c2-track { position: relative; height: 22px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.c2-band { position: absolute; top: 3px; bottom: 3px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-radius: 4px; display: grid; place-items: center; font-size: 10.5px; color: var(--text); font-family: var(--mono); }
.c2-marker { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--trial); transform: translateX(-1px); }
.c2-axis { display: grid; grid-template-columns: 62px 1fr; gap: 8px; }
.c2-axis div { position: relative; height: 18px; font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.c2-axis span { position: absolute; transform: translateX(-50%); top: 2px; }
.len-verdict { font-size: 13.5px; margin-top: 10px; }
@media (max-width: 1180px) { .len-grid { grid-template-columns: 1fr; } }

/* ---------- saved setups ---------- */
.setup-save { display: flex; gap: 8px; margin-bottom: 10px; }
.setup-save input { flex: 1; min-width: 0; }
.inputs, .results { min-width: 0; }
.row2 > *, .row3 > * { min-width: 0; }
.setup-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.setup-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 13px; }
.setup-list li.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.setup-list li div { display: flex; flex-direction: column; min-width: 0; }
.setup-list li > span { white-space: nowrap; flex: none; }
.setup-list li.empty { background: none; border-style: dashed; }
.setup-io { display: flex; gap: 14px; }
.file-btn { cursor: pointer; }
.copy-btn.danger { color: var(--warn); }

/* ---------- options ---------- */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; align-items: center; margin: 4px 0 12px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.chk .hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.opts .rig-units { margin: 0; grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.opts .rig-units label { margin: 0; }
.src { font-size: 9.5px; font-weight: 700; padding: 0 5px; border-radius: 99px; vertical-align: 1px; text-transform: uppercase; letter-spacing: .03em; }
.src.pub { background: var(--ok-soft); color: var(--ok); }
.src.est { background: var(--warn-soft); color: var(--warn); }
.src.cus { background: var(--accent-soft); color: var(--accent); }
.custom-blade { margin-top: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.custom-blade p { margin: 2px 0 0; }
.dsm { font-size: 10.5px; color: var(--muted); }

/* ---------- forecast ---------- */
.forecast summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.forecast .fc-body { margin-top: 10px; }
.forecast .fc-body .field { margin-bottom: 8px; }
.forecast .btn { width: 100%; }

/* ---------- rig log ---------- */
.log-form { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface-2); margin-bottom: 10px; }
.log-form .field { margin-bottom: 8px; }
.log-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.log-list li { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13.5px; }
.log-list li.empty { border-style: dashed; }
.log-top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.log-top .copy-btn { margin-left: auto; }

/* ---------- rigging day ---------- */
.rigday { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; padding: 18px 20px 60px; }
.rigday[hidden] { display: none; }
.rigday-head { position: sticky; top: -18px; background: var(--bg); padding: 10px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); z-index: 2; }
.rigday-head h2 { font-size: 22px; margin: 0; }
.rigday-actions { display: flex; gap: 10px; align-items: center; }
#rigday-body { max-width: 760px; margin: 0 auto; }
#rigday-body section { margin-top: 18px; }
#rigday-body h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.rd-item { display: flex; gap: 14px; align-items: center; padding: 14px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 8px; font-size: 19px; line-height: 1.35; cursor: pointer; }
.rd-item input { width: 28px; height: 28px; flex: none; accent-color: var(--accent); }
.rd-item.done { opacity: .55; }
.rd-item.done span { text-decoration: line-through; }
body.noscroll { overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--accent-2); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 80; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; width: 100%; }
  .top-actions .btn { padding: 6px 9px; font-size: 12.5px; }
  .opts { grid-template-columns: 1fr; }
  .rd-item { font-size: 17px; }
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 12, 24, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 16px; width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h3 { margin: 0; }
.card-preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 6px 0 14px; }
.card-preview canvas { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .brand-sub { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile .tv { font-size: 24px; }
  .boat-grid { grid-template-columns: repeat(5, 1fr); }
  .wind-wrap { grid-template-columns: 1fr; justify-items: center; }
  .wind-side { width: 100%; }
  #theme-toggle { display: none; }
  .row3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .brand-name { display: none; }
  .blade-btn svg { width: 32px; }
  #open-card { padding: 9px 10px; }
}
