:root {
  --navy: #0F2340; --navy-2: #16304F; --navy-3: #3B5578;
  --teal: #1E9E95; --teal-dark: #127A73; --teal-light: #7FD3CC; --teal-pale: #B9E6E1;
  --orange: #FF7A00; --orange-dark: #B54700; --orange-pale: #FFF1E5;
  --yellow: #FFD60A;
  --ink: #0F2340; --muted: #4D5F75; --line: #D5DEE8; --bg: #F4F6F8; --card: #FFFFFF;
  --heading: 'Space Grotesk', system-ui, sans-serif; --body: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: var(--teal-dark); }
h1, h2, h3 { font-family: var(--heading); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-dark); margin: 0 0 8px; }
.dark .kicker { color: var(--teal-light); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar */
.top { background: var(--navy); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--heading); font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand span { color: var(--teal-light); font-weight: 500; }
.brand svg { flex: none; }
.top nav { display: flex; gap: 22px; }
.top nav a { color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; }
.top nav a:hover { color: var(--teal-light); }
@media (max-width: 760px) { .top nav { display: none; } }

/* Hero */
.hero { background: var(--navy); color: #fff; padding: 56px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); }
.hero p.lede { color: #D7E2EE; font-size: 17px; margin: 18px 0 26px; max-width: 34em; }
.search { position: relative; display: flex; gap: 10px; max-width: 520px; }
.search input { flex: 1; min-width: 0; height: 50px; border-radius: 8px; border: 2px solid var(--teal); padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
.search input:focus { outline: 3px solid var(--teal-light); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 20px; border-radius: 8px; border: 0; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-orange { background: var(--orange); color: var(--navy); }
.btn-orange:hover { background: #ff8f2a; }
.btn-line { background: #fff; color: var(--ink); border: 2px solid var(--ink); height: 42px; font-size: 14px; }
.btn-line:hover { background: var(--bg); }
.btn-black { background: #000; color: #fff; }
.suggest { position: absolute; top: 54px; left: 0; right: 0; z-index: 20; background: #fff; color: var(--ink); border-radius: 8px; box-shadow: 0 12px 32px rgba(15, 35, 64, 0.25); list-style: none; margin: 0; padding: 6px 0; max-height: 320px; overflow: auto; }
.suggest li { padding: 9px 14px; cursor: pointer; font-size: 15px; }
.suggest li small { display: block; color: var(--muted); font-size: 12px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--bg); }
.hero-chart { background: var(--navy-2); border-radius: 16px; padding: 18px 18px 12px; }
.hero-chart .note { font-size: 12px; color: #A9BACD; margin: 6px 4px 0; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 32px; } .hero { padding-top: 40px; } }
@media (max-width: 480px) { .search { flex-direction: column; } .search .btn { width: 100%; } }

/* Sections */
section.block { padding: 48px 0 8px; }
.card { background: var(--card); border-radius: 16px; padding: 26px 26px 22px; }
.card h2 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 6px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.small { font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.chart-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.credit { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* Job card */
.job-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 18px; }
.job-head h2 { font-size: clamp(24px, 3.4vw, 32px); }
.job-head .soc { color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: #fff; border-radius: 14px; padding: 18px; }
.stat .label { font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.stat .big { font-family: var(--heading); font-weight: 700; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; margin: 0 0 6px; }
.stat .big.neg { color: var(--orange-dark); }
.stat .small { margin: 0; }
.spark { display: block; width: 100%; height: 38px; margin-top: 8px; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .stats { grid-template-columns: 1fr; } }
.empty { color: var(--muted); }

/* Door chart */
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 6px; font-size: 13px; }
.legend button { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--ink); cursor: pointer; }
.legend button[aria-pressed="false"] { opacity: 0.4; }
.legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; flex: none; margin-top: 8px; }
.legend { gap: 10px 24px; margin: 8px 0 10px; }
.legend .lg { display: inline-flex; align-items: flex-start; gap: 8px; line-height: 1.35; max-width: 300px; }
.legend .lg strong { font-weight: 600; }
.legend .lg-note { align-self: flex-end; }
.tip .small { display: block; margin-bottom: 4px; }
.tabs { display: inline-flex; background: var(--bg); border-radius: 8px; padding: 3px; margin: 6px 0 4px; }
.tabs button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* Map */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 76px)); grid-auto-rows: 44px; gap: 6px; margin: 10px 0 12px; }
.tile { border: 0; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; display: grid; place-items: center; line-height: 1.1; text-align: center; padding: 2px; }
.tile small { display: block; font-weight: 500; font-size: 11px; }
.tile:focus-visible, .tile[aria-pressed="true"] { outline: 3px solid var(--orange); outline-offset: 1px; }
.map-detail { font-size: 14px; margin: 0 0 6px; min-height: 3em; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.scale span.bar { height: 10px; width: 120px; border-radius: 5px; background: linear-gradient(90deg, #E3F5F3, #0B4E4A); }

/* Top ten list */
ol.ten { margin: 0; padding: 0; list-style: none; counter-reset: n; }
ol.ten li { counter-increment: n; display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
ol.ten li::before { content: counter(n); font-family: var(--heading); font-weight: 700; color: var(--teal-dark); width: 1.6em; flex: none; }
ol.ten li span:first-of-type { flex: 1; }
ol.ten li button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

/* Jobs like yours */
ol.related { margin: 0; padding: 0; list-style: none; max-height: 420px; overflow-y: auto; }
ol.related li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 72px; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px solid var(--line); font-size: 14px; border-radius: 6px; }
ol.related li.me { background: var(--orange-pale); font-weight: 700; }
ol.related button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
ol.related button:hover { text-decoration: underline; }
ol.related .bar { height: 8px; background: #EEF2F6; border-radius: 4px; overflow: hidden; }
ol.related .bar i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
ol.related li.me .bar i { background: var(--orange); }
ol.related .small { text-align: right; }
@media (max-width: 420px) { ol.related li { grid-template-columns: minmax(0, 1fr) 64px; } ol.related .bar { display: none; } }

/* "Showing your job" chip on each chart */
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--orange-pale); color: var(--orange-dark); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.chip button { border: 0; background: #fff; color: var(--orange-dark); border-radius: 999px; font: inherit; font-size: 12px; padding: 2px 9px; cursor: pointer; }
.chip[hidden] { display: none; }

/* Trust box and evidence */
.trust { margin: 14px 0 4px; font-size: 14px; }
.trust summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; color: #7A5600; background: #FFF8E6; border: 1px solid #F0D58A; border-radius: 999px; padding: 7px 14px; }
.trust summary::-webkit-details-marker { display: none; }
.trust summary::before { content: '\25B8'; transition: transform 0.15s; }
.trust[open] summary::before { transform: rotate(90deg); }
.trust summary:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.trust[open] summary { border-radius: 8px 8px 0 0; border-bottom-color: transparent; }
.trust[open] ul { margin: 0; padding: 12px 16px 12px 34px; background: #FFF8E6; border: 1px solid #F0D58A; border-left: 4px solid #E0A100; border-radius: 0 8px 8px 8px; }
.trust ul { margin: 0; padding-left: 18px; }
.trust li { margin: 4px 0; }
.evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ev { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.ev h3 { font-size: 19px; margin: 2px 0 8px; }
.ev p { margin: 0 0 8px; font-size: 15px; }
.ev .small { font-size: 13px; }
.st { border-radius: 999px; padding: 1px 7px; }
.st-supports { background: #E3F5F3; color: #0B4E4A; }
.st-mixed { background: #FFF8E6; color: #7A5600; }
.st-against { background: #FCE8E8; color: #9B1C1C; }
.ev-tag { font-size: 11px !important; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-dark); }

ol.sources { margin: 0; padding-left: 22px; }
ol.sources li { margin: 0 0 10px; font-size: 15px; }
ol.sources li a { font-weight: 600; overflow-wrap: anywhere; }
ol.sources li .small { display: block; }

/* The ladder */
.ladder-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 14px; }
.ladder-controls select { font: inherit; font-size: 15px; padding: 9px 12px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; }
.rung { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; position: relative; }
.rung::before { content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 4px; border-radius: 2px; background: var(--teal); }
.rung.me { border-color: var(--orange); background: var(--orange-pale); }
.rung.me::before { background: var(--orange); }
.rung-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; font-family: var(--heading); font-size: 17px; }
.rung-bar { position: relative; height: 26px; background: #EEF2F6; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.rung-bar i { position: absolute; inset: 0 auto 0 0; background: var(--teal-pale); }
.rung.me .rung-bar i { background: #FFD3AD; }
.rung-bar span { position: relative; display: block; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.rung-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin-bottom: 8px; }
.rung-jobs { display: flex; flex-wrap: wrap; gap: 6px; }
.rung-jobs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); }
.rung-jobs button:hover { border-color: var(--teal); }
.rung-jobs button.me { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }

/* Book CTA */
.book { background: var(--yellow); border-radius: 16px; padding: 22px 26px; display: flex; align-items: center; gap: 22px; margin: 48px 0; }
.book img { width: 64px; height: auto; border-radius: 3px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); flex: none; }
.book h2 { font-size: 22px; }
.book p { margin: 4px 0 0; font-size: 14px; }
.book .grow { flex: 1; }
@media (max-width: 700px) { .book { flex-wrap: wrap; } .book .btn { width: 100%; } }

/* Footer */
footer.foot { background: var(--navy); color: #D7E2EE; padding: 40px 0 48px; font-size: 14px; }
footer.foot .wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
footer.foot h3 { color: #fff; font-size: 15px; font-family: var(--body); margin-bottom: 8px; }
footer.foot a { color: var(--teal-light); }
footer.foot p { margin: 0 0 8px; }
@media (max-width: 760px) { footer.foot .wrap { grid-template-columns: 1fr; } }

/* Charts */
svg text { font-family: var(--body); }
.axis text { font-size: 11px; fill: var(--muted); }
.dark .axis text { fill: #A9BACD; }
.axis path, .axis line { stroke: var(--line); }
.dark .axis path, .dark .axis line { stroke: #3B5578; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(15, 35, 64, 0.25); max-width: 260px; }
.tip strong { display: block; }

/* Modal (embed code) */
dialog { border: 0; border-radius: 14px; padding: 22px; max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(15, 35, 64, 0.6); }
dialog textarea { width: 100%; height: 96px; font-family: ui-monospace, monospace; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
dialog h3 { margin-bottom: 8px; }

/* Prose pages */
.prose { max-width: 760px; }
.prose h2 { font-size: 24px; margin: 36px 0 10px; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 10px 0 18px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; background: var(--bg); }
.prose .tablewrap { overflow-x: auto; max-width: 100%; }
.prose td a, .prose li a { overflow-wrap: anywhere; }
@media (max-width: 600px) { .prose table, .prose thead, .prose tbody, .prose tr, .prose td { display: block; } .prose thead { display: none; } .prose tr { padding: 10px 0; border-bottom: 1px solid var(--line); } .prose td { border: 0; padding: 2px 0; } .prose td:first-child { font-weight: 700; } }

/* Embed pages */
body.embed { background: #fff; }
body.embed .card { padding: 16px 16px 12px; border-radius: 0; }
