:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #efeadf;
  --ink: #142433;
  --ink-soft: #4b5b69;
  --line: #ddd5c5;
  --sea: #1f5f8b;
  --sea-deep: #0f2d44;
  --sea-soft: #d6e6f1;
  --accent: #e07a3f;
  --good: #2f7d5b;
  --good-soft: #dcefe5;
  --warn: #a8611b;
  --warn-soft: #f6e6d3;
  --sail: #fffdf8;
  --shadow: 0 1px 2px rgb(20 36 51 / .06), 0 8px 24px rgb(20 36 51 / .07);
  --radius: 14px;
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1822; --surface: #13222f; --surface-2: #1a2d3c; --ink: #e8eef3; --ink-soft: #9fb1c0;
    --line: #26394a; --sea: #6fb0dc; --sea-deep: #b9dcf2; --sea-soft: #1b3448; --accent: #f0955e;
    --good: #6cc59a; --good-soft: #173528; --warn: #e9a866; --warn-soft: #3a2a18; --sail: #e8eef3;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1822; --surface: #13222f; --surface-2: #1a2d3c; --ink: #e8eef3; --ink-soft: #9fb1c0;
  --line: #26394a; --sea: #6fb0dc; --sea-deep: #b9dcf2; --sea-soft: #1b3448; --accent: #f0955e;
  --good: #6cc59a; --good-soft: #173528; --warn: #e9a866; --warn-soft: #3a2a18; --sail: #e8eef3;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font-body);
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 650; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0;
  font-family: var(--font-head); font-size: 1.2rem; font-weight: 650; }
.brand svg { width: 28px; height: 28px; }
.sail-a { fill: var(--sea); } .sail-b { fill: var(--accent); } .hull { fill: var(--sea-deep); }
.topbar nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.link { background: none; border: 0; padding: 8px 12px; border-radius: 8px; color: var(--ink-soft); font-weight: 500; }
.link:hover, .link[aria-current="page"] { background: var(--surface-2); color: var(--ink); }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 24px 56px; outline: none; }
.footer { text-align: center; color: var(--ink-soft); font-size: .85rem; padding: 20px 24px 28px; border-top: 1px solid var(--line); }
.footer p { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 10px; }
.footer-nav a { color: var(--ink-soft); }
.footer-nav a:hover { color: var(--ink); }
.footer-legal { margin-top: 8px !important; font-size: .8rem; }
.footer-legal a { color: var(--ink-soft); }
.legal p { max-width: 65ch; }
.fb-privacy { margin: -4px 0 10px; font-size: .78rem; color: var(--ink-soft); }
.fb-privacy a { color: var(--sea); }
.footer-legal a + a { margin-left: 14px; }
mark.todo { background: #fff1a8; color: #5a4300; padding: 0 3px; border-radius: 3px; }
.todo-note { padding: 10px 14px; border-radius: 10px; background: #fff1a8; color: #5a4300; font-size: .92rem; }
/* Server-rendered pages use links where the app used buttons */
a.brand, a.link, a.btn, a.btn-text, a.card, a.chip { text-decoration: none; }
a.brand { color: inherit; }
a.card { color: inherit; display: flex; }
a.chip { display: inline-flex; align-items: center; gap: 6px; }
a.btn-text { display: inline-block; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 18px; font-size: .85rem; color: var(--ink-soft); }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--line); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.profile { max-width: 860px; }
.profile h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 4px; }
.profile h3, .profile .h3 { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 22px 0 8px; }
.profile .dialog-head .boat-svg { width: 180px; }
.page-intro .h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 8px; }
.more-link { margin-top: 28px; }
.builder-card { padding: 18px; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.builder-card:hover { border-color: var(--sea); }
.builder-card h3 { font-size: 1.05rem; }
.builder-card p { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.profile table a { color: var(--sea); }
.shared-note { margin: -8px 0 20px; padding: 10px 14px; border-radius: 10px; background: var(--sea-soft); color: var(--ink); font-size: .92rem; }
.shared-note .btn-text { padding: 0 0 0 6px; color: var(--sea); font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 12px 22px;
  border: 1px solid transparent; font-weight: 600; transition: transform .12s, background .15s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--sea); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0d1822; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0d1822; } }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-text { background: none; border: 0; color: var(--ink-soft); padding: 12px 8px; }
.btn-text:hover { color: var(--ink); }

/* Intro */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 24px 0 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin-bottom: 18px; }
.hero p { color: var(--ink-soft); font-size: 1.1rem; max-width: 52ch; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-art { color: var(--sea); }
.hero-art > svg, .fleet-svg { display: block; width: 100%; height: auto; }

/* Front-page teaser: fleet of boat types, example answers move the highlight */
.hero:has(.fleet) { grid-template-columns: 1fr; gap: 8px; }
.hero:has(.fleet) .hero-art { order: 0; max-width: none; min-width: 0; }
.fleet { margin: 0; --zoom: 1; overflow: hidden; }
.fleet-svg { transform: translateX(var(--pan, 0%)); transition: transform .9s ease; }
.fleet figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; min-height: 64px;
  margin-bottom: 6px; transition: opacity .26s ease; }
.fleet-eg { width: 100%; text-align: center; font-size: .78rem; color: var(--ink-soft); }
.fleet-chips { display: contents; }
.fleet-chip { font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--sea-soft); color: var(--sea);
  white-space: nowrap; }
.fleet.switching figcaption { opacity: 0; }
.fleet-svg .boat-svg .i-water, .fleet-svg .boat-svg .i-wave { display: none; }
.fleet-boat { opacity: .42; filter: saturate(.35); transition: opacity .6s ease, filter .6s ease; }
.fleet-boat.on { opacity: 1; filter: none; }
.fleet-mark { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .4s ease; }
.fleet-name { font: 600 20px var(--font-body); fill: var(--ink); opacity: 0; transition: opacity .4s ease; }
.fleet-boat.on .fleet-mark, .fleet-boat.on .fleet-name { opacity: 1; }
.fleet-water { fill: var(--i-water); opacity: .55; }
.fleet-wave { fill: none; stroke: var(--i-wave); stroke-width: 2; stroke-linecap: round; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .fleet-boat, .fleet-mark, .fleet-name, .fleet figcaption, .fleet-svg { transition: none; } }
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step b { display: block; font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 4px; }
.step span { color: var(--ink-soft); font-size: .95rem; }
.step .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--sea-soft); color: var(--sea); font-weight: 600; font-size: .85rem; margin-bottom: 10px; }

/* Quiz */
.quiz { max-width: 760px; margin: 0 auto; }
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; color: var(--ink-soft); font-size: .9rem; }
.progress-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--sea); border-radius: 999px; transition: width .35s ease; }
.q-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 26px; }
.q-icon { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--sea-soft); color: var(--sea);
  display: grid; place-items: center; }
.q-icon svg { width: 26px; height: 26px; }
.q-head h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-bottom: 6px; }
.q-head p { margin: 0; color: var(--ink-soft); }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.option { text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; position: relative;
  transition: border-color .15s, background .15s, transform .12s; }
.option:hover { border-color: var(--sea); }
.option:active { transform: scale(.99); }
.option b { font-weight: 600; }
.option span { color: var(--ink-soft); font-size: .9rem; }
.option[aria-pressed="true"] { border-color: var(--sea); background: var(--sea-soft); }
.option[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 12px; right: 14px; color: var(--sea); font-weight: 700; }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; gap: 12px; }
.quiz-nav .right { display: flex; gap: 8px; align-items: center; }

/* Results */
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.results-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); border: 0; }
button.chip:hover { color: var(--ink); background: var(--sea-soft); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.top-match { display: grid; grid-template-columns: 300px 1fr; overflow: hidden; margin-bottom: 28px; }
.top-art { background: linear-gradient(180deg, var(--sea-soft), var(--surface-2)); color: var(--sea);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 14px; }
.top-art .boat-svg { width: 100%; max-width: 250px; }
.top-body { padding: 28px 30px; }
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.top-body h2 { font-size: 2rem; margin-bottom: 4px; }
.tagline { color: var(--ink-soft); font-style: italic; margin: 0 0 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .9rem; margin: 14px 0 18px; color: var(--ink-soft); }
.facts b { color: var(--ink); font-weight: 600; }
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.why h3 { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 8px; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .93rem; }
.list li { display: flex; gap: 8px; align-items: flex-start; }
.list li::before { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 700; margin-top: 1px; }
.list.good li::before { content: "✓"; background: var(--good-soft); color: var(--good); }
.list.warn li::before { content: "!"; background: var(--warn-soft); color: var(--warn); }
.list.plain li::before { content: "•"; color: var(--sea); }
.empty-note { color: var(--ink-soft); font-size: .9rem; margin: 0; }

.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring { position: relative; width: 96px; height: 96px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .value { stroke: var(--sea); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; }
.ring .label b { font-family: var(--font-head); font-size: 1.6rem; }
/* The word sits under the ring, so any language fits */
.ring-caption { max-width: 140px; text-align: center; font-size: .7rem; line-height: 1.2; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }

.section-title { font-size: 1.4rem; margin: 36px 0 14px; }
.runners { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.runner { padding: 18px; display: flex; flex-direction: column; gap: 10px; text-align: left; border: 1px solid var(--line); }
.runner:hover { border-color: var(--sea); }
.runner .boat-svg { width: 100%; height: 96px; }
.runner h3 { font-size: 1.1rem; }
.runner p { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.score-line { display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; }
.bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--sea); border-radius: 999px; }

.compare { width: 100%; border-collapse: collapse; font-size: .9rem; }
.compare-wrap { overflow-x: auto; padding: 6px 18px 12px; }
.compare th, .compare td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.compare thead th { font-family: var(--font-head); font-size: 1rem; font-weight: 650; }
.compare tbody th { font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.meter .bar > i.costly { background: var(--accent); }
.meter span { width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.ranking { list-style: none; margin: 0; padding: 6px 0; }
.ranking li > button[data-boat] { width: 100%; display: grid; grid-template-columns: 2em 1fr 160px 3em; gap: 12px; align-items: center;
  background: none; border: 0; padding: 10px 18px; text-align: left; }
.ranking li > button[data-boat]:hover { background: var(--surface-2); }
.ranking .pos { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ranking .pct { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.next-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.next-steps .step b { font-size: 1rem; }
.next-sub { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 4px 0 10px; }
.buy-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.buy-path { padding: 20px 22px; }
.buy-path h3 { font-size: 1.15rem; margin-bottom: 12px; }
.buy-steps { margin: 0; padding: 0; list-style: none; counter-reset: buy; display: grid; gap: 12px; }
.buy-steps li { counter-increment: buy; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; font-size: .92rem; }
.buy-steps li::before { content: counter(buy); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--sea-soft); color: var(--sea);
  display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.buy-steps b { font-weight: 600; }
.buy-steps span { color: var(--ink-soft); }
@media (max-width: 760px) { .buy-paths { grid-template-columns: 1fr; } }

/* Browse */
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.page-intro h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 8px; }
.page-intro p { color: var(--ink-soft); margin: 0; max-width: 60ch; }

/* Dialog */
dialog { border: 0; padding: 0; border-radius: 18px; max-width: 720px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(8 18 28 / .55); backdrop-filter: blur(2px); }
.dialog-body { padding: 28px; max-height: 85vh; overflow-y: auto; }
.dialog-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.dialog-head .boat-svg { width: 130px; flex: none; color: var(--sea); }
.dialog-head h2 { font-size: 1.7rem; }
.close { position: absolute; top: 12px; right: 14px; background: var(--surface-2); border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; }
.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 18px 0; font-size: .88rem; }
.attr-grid .meter { min-width: 0; }
.attr-grid label { color: var(--ink-soft); display: block; margin-bottom: 2px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.two-col h3, .dialog-body h3 { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 14px 0 8px; }

/* Boat icons */
:root {
  --i-hull: #1d3b53; --i-hull-2: #6f8ea6; --i-bottom: #8c3a2e; --i-boot: #e07a3f; --i-sheer: rgb(255 255 255 / .28);
  --i-cabin: #f3eee3; --i-cabin-line: #1d3b53; --i-win: #2b4f6b; --i-sail: #fffdf8; --i-sail-line: #2a465c;
  --i-tan: #d39a5f; --i-kite: #e07a3f; --i-water: #7fb6d6; --i-wave: #3f86b4; --i-crew: #1d3b53; --i-vest: #f2b33d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --i-hull: #d6e6f2; --i-hull-2: #7f9db5; --i-bottom: #c0675a; --i-boot: #f0955e; --i-sheer: rgb(13 24 34 / .25);
    --i-cabin: #8fa9bd; --i-cabin-line: #0d1822; --i-win: #0d1822; --i-sail: #e8eef3; --i-sail-line: #9fb1c0;
    --i-tan: #c78d55; --i-kite: #f0955e; --i-water: #2c6c94; --i-wave: #6fb0dc; --i-crew: #e8eef3; --i-vest: #f2b33d;
  }
}
:root[data-theme="dark"] {
  --i-hull: #d6e6f2; --i-hull-2: #7f9db5; --i-bottom: #c0675a; --i-boot: #f0955e; --i-sheer: rgb(13 24 34 / .25);
  --i-cabin: #8fa9bd; --i-cabin-line: #0d1822; --i-win: #0d1822; --i-sail: #e8eef3; --i-sail-line: #9fb1c0;
  --i-tan: #c78d55; --i-kite: #f0955e; --i-water: #2c6c94; --i-wave: #6fb0dc; --i-crew: #e8eef3; --i-vest: #f2b33d;
}
.boat-svg { display: block; overflow: visible; }
.boat-svg .i-hull { fill: var(--i-hull); }
.boat-svg .i-bottom, .boat-svg .i-under { fill: var(--i-bottom); }
.boat-svg .i-hull-back { fill: var(--i-hull-2); }
.boat-svg .i-hull-front { fill: var(--i-hull-2); stroke: var(--i-hull); stroke-width: 1; }
.boat-svg .i-boot { fill: var(--i-boot); }
.boat-svg .i-sheer { fill: none; stroke: var(--i-sheer); stroke-width: 1.2; }
.boat-svg .i-cabin { fill: var(--i-cabin); stroke: var(--i-cabin-line); stroke-width: 1; stroke-linejoin: round; }
.boat-svg .i-win { fill: var(--i-win); }
.boat-svg .i-port { fill: var(--i-cabin); }
.boat-svg .i-mast { stroke: var(--i-sail-line); stroke-width: 2; stroke-linecap: round; }
.boat-svg .i-boom, .boat-svg .i-spar { stroke: var(--i-sail-line); stroke-width: 1.8; stroke-linecap: round; }
.boat-svg .i-sail { fill: var(--i-sail); stroke: var(--i-sail-line); stroke-width: 1.1; stroke-linejoin: round; }
.boat-svg .i-sail.tan { fill: var(--i-tan); }
.boat-svg .i-batten { stroke: var(--i-sail-line); stroke-width: .7; opacity: .55; }
.boat-svg .i-kite { fill: var(--i-kite); stroke: var(--i-sail-line); stroke-width: 1; stroke-linejoin: round; }
.boat-svg .i-seam { fill: none; stroke: #fff; stroke-width: .8; opacity: .5; }
.boat-svg .i-wire, .boat-svg .i-rail, .boat-svg .i-beam { stroke: var(--i-sail-line); stroke-width: .8; fill: none; }
.boat-svg .i-beam { stroke: var(--i-hull); stroke-width: 2.4; stroke-linecap: round; }
.boat-svg .i-dodger { fill: none; stroke: var(--i-sail-line); stroke-width: 1.6; stroke-linejoin: round; }
.boat-svg .i-crew path { stroke: var(--i-crew); stroke-width: 1.8; stroke-linecap: round; fill: none; }
.boat-svg .i-crew circle { fill: var(--i-crew); }
.boat-svg .i-vest { fill: var(--i-vest); }
.boat-svg .i-motor rect { fill: var(--i-hull-2); }
.boat-svg .i-motor path, .boat-svg .i-vane line { stroke: var(--i-hull-2); stroke-width: 2; stroke-linecap: round; }
.boat-svg .i-vane rect { fill: var(--i-hull-2); }
.boat-svg .i-pivot { fill: var(--i-cabin); }
.boat-svg .i-rudderline { stroke: var(--i-hull); stroke-width: .8; opacity: .5; }
.boat-svg .i-water { fill: var(--i-water); opacity: .55; }
.boat-svg .i-wave { fill: none; stroke: var(--i-wave); stroke-width: 1.4; stroke-linecap: round; opacity: .8; }

.loading, .error { text-align: center; padding: 60px 0; color: var(--ink-soft); }
.error { color: var(--warn); }

/* Hull materials */
.swatch { display: inline-block; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid rgb(0 0 0 / .15); box-shadow: inset 0 1px 2px rgb(255 255 255 / .35); vertical-align: middle; }
.swatch-lg { width: 64px; height: 64px; border-radius: 16px; }
.swatch-grp { background: radial-gradient(circle at 30% 30%, #ffffff, #dfe7ea 60%, #b9c6cc); }
.swatch-aluminium { background: linear-gradient(135deg, #f1f3f5, #aeb6bd 45%, #e3e7ea 55%, #8d969e); }
.swatch-steel { background: linear-gradient(135deg, #6b7278, #3c4247 50%, #8a5a3c 85%); }
.swatch-wood-traditional { background: repeating-linear-gradient(100deg, #9c5f2e 0 4px, #b87742 4px 7px, #8a4f24 7px 9px); }
.swatch-wood-epoxy { background: repeating-linear-gradient(80deg, #e2ac5b 0 5px, #d0943f 5px 8px), #e2ac5b; box-shadow: inset 0 0 0 30px rgb(255 230 170 / .25); }
.swatch-carbon { background: repeating-conic-gradient(#1b1d20 0 25%, #3a3d42 0 50%) 0 0 / 6px 6px; }
.swatch-polyethylene { background: radial-gradient(circle at 30% 30%, #ffd36b, #f2a12e 55%, #e0742a); }
.materials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.material-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; text-align: left; border: 1px solid var(--line); }
.material-card:hover { border-color: var(--sea); }
.material-card.is-top { border: 2px solid var(--sea); }
.material-card h3 { font-size: 1.05rem; }
.material-card p { margin: 0; color: var(--ink-soft); font-size: .88rem; }
.material-head { display: flex; gap: 12px; align-items: center; }
.material-head .swatch { width: 36px; height: 36px; border-radius: 10px; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--sea-soft); color: var(--sea); margin-top: 3px; }
.section-sub { color: var(--ink-soft); margin: -6px 0 16px; font-size: .95rem; }
.suggested-mat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; margin: -4px 0 18px;
  background: var(--surface-2); border-radius: 12px; font-size: .9rem; }
.suggested-mat .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; }
.suggested-mat .muted { color: var(--ink-soft); font-size: .85rem; }
.mat-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 5px; }
.mat-pill:hover { border-color: var(--sea); }
.mat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; }
.mat-chip .swatch { width: 16px; height: 16px; }
.mat-chip.is-suggested { background: var(--sea-soft); color: var(--sea); font-weight: 600; }
.mat-line { display: flex; align-items: center; gap: 6px; }
.mat-line .swatch { width: 14px; height: 14px; }
.mini-ratings { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: .75rem; margin-top: 4px; }
.mini-ratings label { color: var(--ink-soft); }
.mini-ratings .meter { min-width: 0; gap: 6px; }
.mini-ratings .meter span { display: none; }

/* Build-quality tier */
.tier { display: inline-block; font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px;
  vertical-align: middle; white-space: nowrap; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); cursor: help; }
.tooltip { position: fixed; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: 8px 11px; border-radius: 8px;
  background: var(--ink); color: var(--surface); font-size: .8rem; line-height: 1.4; font-weight: 400; text-transform: none; letter-spacing: 0;
  box-shadow: 0 6px 20px rgb(0 0 0 / .25); pointer-events: none; animation: tip-in .12s ease-out; }
.tooltip[hidden] { display: none; }
@keyframes tip-in { from { opacity: 0; transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .tooltip { animation: none; } }
.tier-quality { background: var(--sea-soft); color: var(--sea); border-color: transparent; }
.tier-premium { background: var(--sea); color: var(--surface); border-color: transparent; }
.tier-performance { background: transparent; color: var(--accent); border-color: var(--accent); }
.tier-box { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: .88rem; }
.tier-box .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; }
.tier-box .tier { margin-left: 4px; }
.tier-box p { margin: 6px 0 0; color: var(--ink-soft); }

/* Example models */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.examples { width: 100%; border-collapse: collapse; font-size: .88rem; }
.examples th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.examples td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.examples tr:last-child td { border-bottom: 0; }
.examples td small { display: block; color: var(--ink-soft); font-size: .8rem; margin-top: 2px; }
.examples .nowrap { white-space: nowrap; color: var(--ink-soft); }
.muted-sm { font-size: .8rem !important; }

/* Builder line-up */
.back { background: none; border: 0; color: var(--sea); font-weight: 600; padding: 0 0 10px; font-size: .9rem; }
.back:hover { text-decoration: underline; }
.model-link { background: none; border: 0; padding: 0; text-align: left; color: var(--sea); display: inline-flex; align-items: center; gap: 6px; }
.model-link b { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--sea) 40%, transparent); text-underline-offset: 3px; }
.model-link:hover b { text-decoration-color: currentColor; }
.model-link span { font-size: 1.1rem; line-height: 1; }
.lineup { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.lineup li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; }
.lineup li.is-current { background: var(--sea-soft); border-color: var(--sea); }
.lineup-art { color: var(--sea); }
.lineup-art .boat-svg { width: 100%; height: auto; display: block; }
.lineup-meta { display: flex; flex-direction: column; gap: 3px; font-size: .88rem; min-width: 0; }
.lineup-meta .nowrap { color: var(--ink-soft); }
.lineup-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.lineup-tags .chip { font-size: .72rem; }
.fine-print { color: var(--ink-soft); font-size: .78rem; margin-top: 16px; }

@media (max-width: 760px) {
  .topbar { padding: 12px 16px; }
  .brand span { display: none; }
  main { padding: 22px 16px 44px; }
  .hero { grid-template-columns: 1fr; gap: 16px; padding-top: 8px; }
  .hero-art { order: -1; max-width: 300px; }
  .fleet { --zoom: 1.7; }
  .fleet .fleet-svg { width: 170%; }
  .fleet-name { font-size: 28px; }
  .steps { grid-template-columns: 1fr; }
  .top-match { grid-template-columns: 1fr; }
  .top-art { flex-direction: row; padding: 18px; }
  .top-art .boat-svg { max-width: 170px; }
  .top-body { padding: 22px 20px; }
  .why, .two-col, .attr-grid { grid-template-columns: 1fr; }
  .ranking li > button[data-boat] { grid-template-columns: 1.6em 1fr 60px 2.6em; padding: 10px 14px; }
  .dialog-body { padding: 22px 18px; }
  .dialog-head .boat-svg { width: 90px; }
  .lineup li { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; padding: 8px 6px; }
  .quiz-nav { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Feedback ---------- */
.fb { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; margin-left: 4px; flex: none; vertical-align: middle;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); opacity: 0; transition: opacity .15s, color .15s, background .15s; }
.fb .flag-icon { width: 14px; height: 14px; }
:hover > .fb, tr:hover .fb, .fb:focus-visible { opacity: 1; }
.fb:hover { color: var(--accent); background: var(--surface-2); }
@media (hover: none) { .fb { opacity: .55; } }
.flag-icon { width: 14px; height: 14px; vertical-align: -2px; }
.list li > span { flex: 1; }
.meter-row { display: flex; align-items: center; gap: 2px; }
.meter-row .meter { flex: 1; }
.ranking li { display: flex; align-items: center; padding-right: 8px; }
.ranking li > button[data-boat] { flex: 1; min-width: 0; }
.examples td.fb-cell { width: 28px; padding-left: 0; padding-right: 0; }
.fb-hint { font-size: .82rem; color: var(--ink-soft); margin: 10px 0 0; }
.fb-hint .flag-icon { color: var(--accent); }
.fb-missing { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; font-size: .85rem; }

.fb-match { padding: 22px 26px; margin: -8px 0 28px; }
.fb-match h2 { font-size: 1.25rem; margin-bottom: 4px; }
.fb-match .muted, .fb-thanks p { color: var(--ink-soft); font-size: .9rem; margin: 0 0 14px; }
.fb-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fb-scale button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .78rem; }
.fb-scale button b { font-size: 1.15rem; font-family: var(--font-head); }
.fb-scale button span { color: var(--ink-soft); }
.fb-scale button:hover { border-color: var(--sea); }
.fb-scale button[aria-checked="true"] { background: var(--sea); border-color: var(--sea); color: #fff; }
.fb-scale button[aria-checked="true"] span { color: inherit; }
.chip[aria-pressed="true"] { background: var(--sea); color: #fff; }

.fb-form { display: grid; gap: 14px; margin-top: 16px; }
.fb-form fieldset { border: 0; padding: 0; margin: 0; }
.fb-form legend, .fb-field > span { font-size: .85rem; font-weight: 600; margin-bottom: 6px; padding: 0; display: block; }
.fb-form .opt { font-weight: 400; color: var(--ink-soft); }
.fb-field { display: block; }
.fb-field input, .fb-field select, .fb-field textarea { width: 100%; font: inherit; font-size: .92rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.fb-field textarea { resize: vertical; min-height: 70px; }
.fb-field input:focus, .fb-field select:focus, .fb-field textarea:focus { outline: 2px solid var(--sea); outline-offset: 0; border-color: var(--sea); }
.fb-verdicts { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-radio { position: relative; }
.fb-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fb-radio span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; background: var(--surface); }
.fb-radio input:checked + span { background: var(--sea); border-color: var(--sea); color: #fff; }
.fb-radio input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.fb-shown { margin: 0; font-size: .88rem; color: var(--ink-soft); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.fb-shown b { color: var(--ink); font-weight: 600; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-error { margin: 0; color: var(--warn); font-size: .88rem; font-weight: 600; }
.fb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-thanks { padding: 8px 0; }
@media (max-width: 560px) {
  .fb-scale { gap: 4px; }
  .fb-scale button { padding: 8px 2px; font-size: .68rem; }
  .fb-match { padding: 18px 16px; }
}

/* Language picker */
.lang-select { font: inherit; font-size: .85rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 10px; margin-left: 4px; cursor: pointer; }
.lang-select:hover { border-color: var(--sea); }

