@font-face { font-family: Figtree; src: url(https://inroad-site.vercel.app/fonts/figtree-latin-wght-normal.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
:root {
  --bg: #F9F8F6; --surface: #fff; --stone: #F3F3F1; --stone-2: #F1F2ED; --ink: #000; --body: #2E2D29; --muted: #6B6A64; --line: #E6E4DD; --line-soft: #EEEDE8;
  --sky: #C5DEFB; --sky-soft: #E3EEFD; --blue-ink: #2F6DB5; --blush: #F9D9EE; --mag-ink: #9C1F7E; --butter: #FCEFA0; --peach: #F8E3D5;
  --orange: #EE8B4B; --orange-ink: #A84A14; --lime: #CED748; --navy: #0D2747; --navy-2: #16355C;
  --warn: #9A4A00; --warn-soft: #FDEBD3; --pos: #1F7A4D; --pos-soft: #E1F3E8; --err: #C0262D; --err-soft: #FBE4E5;
  --sans: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.23,1,.32,1); --bounce: cubic-bezier(.34,1.56,.64,1);
  --shadow: 0 24px 48px -28px rgba(0,0,0,.28), 0 4px 12px -6px rgba(0,0,0,.08);
  --shadow-sm: 0 10px 30px -20px #00000059;
  --r: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--body); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-ink); }
h1, h2, h3 { color: var(--ink); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
h1 { font-size: 34px; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 0 0 12px; letter-spacing: -.025em; }
h3 { font-size: 11px; margin: 0 0 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; }
:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 3px; border-radius: 8px; }
img { max-width: 100%; display: block; }

/* Header: floating white bar like wellby site */
.hdr { position: sticky; top: 12px; z-index: 1000; padding: 0 clamp(12px, 3vw, 28px); margin-top: 12px; }
.bar { max-width: 1240px; margin: 0 auto; height: 58px; display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 0 10px 0 16px; box-shadow: var(--shadow-sm); }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.045em; font-size: 21px; white-space: nowrap; }
.logo .mark { width: 30px; height: 30px; }
.logo:hover .mark { animation: squish .6s var(--bounce); }
@keyframes squish { 30% { transform: scale(1.12, .88); } 60% { transform: scale(.94, 1.06); } }
.agency { font-weight: 500; font-size: 14px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; white-space: nowrap; letter-spacing: -.01em; }
.bar nav { display: flex; gap: 2px; flex: 1; justify-content: center; }
.bar nav a { text-decoration: none; font-size: 15px; padding: 7px 14px; border-radius: 999px; color: var(--ink); font-weight: 500; }
.bar nav a:hover { background: var(--stone); }
.bar nav a.on { background: var(--navy); color: #fff; }
.me { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.me button { background: var(--stone-2); border: 0; color: var(--ink); border-radius: 12px; height: 36px; padding: 0 14px; font: inherit; font-weight: 600; cursor: pointer; }

main#app { max-width: 1240px; margin: 0 auto; padding: 30px clamp(12px, 3vw, 28px) 80px; }
.loading { padding: 100px; text-align: center; color: var(--muted); }

/* Eyebrow pill (black) */
.eyebrow { display: inline-block; background: #000; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1; padding: 7px 12px; border-radius: 999px; margin-bottom: 12px; }
.eyebrow.sky { background: var(--sky); color: var(--navy); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.card.navy { background: var(--navy); border-color: var(--navy); color: #dfe7f2; }
.card.navy h2, .card.navy h3 { color: #fff; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin: 22px 0 20px; }
.kpi { position: relative; overflow: hidden; min-height: 128px; }
.kpi .v { font-size: 38px; font-weight: 600; letter-spacing: -.04em; color: var(--ink); line-height: 1.1; margin-top: 4px; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .d { font-size: 13px; font-weight: 600; }
.kpi img { position: absolute; right: -6px; bottom: -8px; width: 86px; opacity: .95; pointer-events: none; }
.kpi.c1 { background: var(--sky-soft); border-color: #d6e5f8; } .kpi.c2 { background: var(--pos-soft); border-color: #cfe9da; }
.kpi.c3 { background: var(--peach); border-color: #f1d3bf; } .kpi.c4 { background: #fdf6cf; border-color: #f2e7a6; }
.up { color: var(--pos); } .down { color: var(--err); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-head { display: flex; align-items: center; gap: 18px; }
.hero-head img { width: 92px; height: auto; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--stone-2); color: var(--ink); border-radius: 12px; height: 38px; padding: 0 15px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), background .2s; white-space: nowrap; }
.btn:hover { background: #e8e9e2; transform: translateY(-1px); }
.btn.primary { background: var(--orange); color: #000; }
.btn.primary:hover { background: #f39a5f; }
.btn.dark { background: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--stone); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; justify-content: center; height: 50px; border-radius: 14px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

input, select, textarea { font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sky); border-color: var(--blue-ink); }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 14px; color: var(--ink); }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--stone); color: var(--body); white-space: nowrap; }
.st-Protect { background: var(--err-soft); color: var(--err); }
.st-Grow { background: var(--peach); color: var(--orange-ink); }
.st-Open { background: var(--sky-soft); color: var(--blue-ink); }
.st-Healthy { background: var(--pos-soft); color: var(--pos); }
.st-Followup { background: var(--butter); color: #6d5a00; }
.why { color: var(--muted); font-size: 13px; }

.plan { list-style: none; padding: 0; margin: 0; }
.plan li { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line-soft); }
.plan li:first-child { border-top: 0; }
.rank { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.hcard .rank { background: var(--orange); color: #000; }
.name { font-weight: 650; cursor: pointer; color: var(--ink); letter-spacing: -.01em; }
.name:hover { color: var(--blue-ink); }
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr.click:hover td { background: var(--stone); cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.score { display: inline-flex; align-items: center; gap: 8px; }
.bar-g { height: 6px; background: var(--stone); border-radius: 3px; overflow: hidden; width: 60px; display: inline-block; }
.bar-g > i { display: block; height: 100%; background: var(--navy); border-radius: 3px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 14px; }
.filters input { width: 300px; } .filters select { width: auto; }

#map { height: calc(100vh - 230px); min-height: 480px; border-radius: var(--r); border: 1px solid var(--line); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.map-wrap { position: relative; }
.map-panel { position: absolute; z-index: 500; top: 12px; left: 56px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow-sm); max-width: 680px; }
.typechecks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; align-items: center; }
.typechecks label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 500; }
.typechecks input { width: auto; margin: 0; accent-color: var(--navy); }
.leaflet-container { font-family: var(--sans); }

.drawer { position: fixed; top: 84px; right: 12px; bottom: 12px; width: 470px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); transform: translateX(110%); transition: transform .25s var(--ease); overflow-y: auto; z-index: 1100; padding: 22px 24px 40px; }
.drawer.open { transform: none; }
.drawer .close { position: absolute; right: 14px; top: 14px; }
.drawer h1 { font-size: 26px; }
.facts { display: grid; grid-template-columns: 116px 1fr; gap: 6px 12px; font-size: 14px; margin: 14px 0 18px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; color: var(--ink); }
.breakdown { display: grid; grid-template-columns: 116px 1fr 36px; gap: 8px 12px; align-items: center; font-size: 13px; margin-bottom: 12px; }
.breakdown .bar-g { width: 100%; }
.section { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 16px; }

.draft { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: var(--bg); }
.draft .meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; align-items: center; }
.draft textarea { min-height: 170px; background: #fff; }
.empty { text-align: center; color: var(--muted); padding: 24px 10px; }
.empty img { width: 120px; margin: 0 auto 10px; }

.drop { border: 2px dashed #d9d6cc; border-radius: 18px; padding: 22px; text-align: center; background: var(--bg); cursor: pointer; transition: background .2s, border-color .2s; }
.drop img { width: 96px; margin: 0 auto 8px; }
.drop.over { border-color: var(--orange); background: var(--peach); }
.chart { width: 100%; height: 230px; }
.seg { display: inline-flex; background: var(--stone); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); border-radius: 9px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 16px; padding: 12px 16px; font-size: 14px; margin-top: 16px; }
.notice.info { background: var(--sky-soft); color: var(--navy); display: flex; align-items: center; gap: 14px; }
.notice.info img { width: 64px; flex: none; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(90px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 14px; transition: transform .25s var(--bounce); z-index: 2000; font-weight: 500; }
.toast.show { transform: translateX(-50%); }
.err { color: var(--err); font-size: 13px; min-height: 18px; margin: 0 0 8px; }
code { background: var(--stone); padding: 2px 6px; border-radius: 6px; }
.spark { display: block; }
.pill-n { font-weight: 650; color: var(--ink); }

/* Login */
.login-body { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--bg); }
.login-art { background: var(--navy); border-radius: 0 40px 40px 0; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 5vw, 72px); color: #c9d6e8; overflow: hidden; }
.login-art h2 { color: #fff; font-size: clamp(30px, 3.4vw, 46px); margin: 0 0 12px; }
.login-art img { width: 100%; max-width: 760px; margin-top: 28px; border-radius: 24px; }
.login-side { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .logo { margin-bottom: 28px; }
.login-card h1 { font-size: 36px; }

@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, 1fr); } .cols { grid-template-columns: 1fr; }
  .bar { overflow-x: auto; } .agency, .me span { display: none; } .bar nav { justify-content: flex-start; }
  .login-body { grid-template-columns: 1fr; } .login-art { display: none; }
}

/* ---------- Map-first home ---------- */
body.mapmode main#app { max-width: none; padding: 0; }
body.mapmode .hdr { position: fixed; left: 0; right: 0; }
.mapwrap { position: relative; height: 100vh; }
#nmap { position: absolute; inset: 0; background: #F3F2EE; }
.mpanel { position: absolute; z-index: 600; top: 84px; left: 16px; bottom: 16px; width: 384px; overflow-y: auto; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 18px 18px 22px; }
.mpanel .ptitle h2 { font-size: 28px; margin: 2px 0 4px; }
.mpanel .ptitle .btn { margin: -4px 0 6px -8px; }
.mtools { position: absolute; z-index: 600; top: 84px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mtools input { width: 320px; background: #fff; box-shadow: var(--shadow-sm); height: 42px; border-radius: 14px; }
.mtools .seg { background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.mlegend { position: absolute; z-index: 600; bottom: 16px; left: 416px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: 13px; box-shadow: var(--shadow-sm); max-width: calc(100vw - 520px); }
.mlegend span { display: inline-flex; align-items: center; gap: 5px; }
.mlegend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.mlegend .ramp { gap: 0; } .mlegend .ramp i { width: 28px; height: 10px; border-radius: 0; }
.mlegend .ramp i:first-child { border-radius: 5px 0 0 5px; } .mlegend .ramp i:last-child { border-radius: 0 5px 5px 0; }
.opin { display: flex; flex-direction: column; align-items: center; }
.opin img { width: 44px; height: 44px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.opin span { background: var(--navy); color: #fff; font: 600 11px var(--sans); padding: 2px 7px; border-radius: 999px; white-space: nowrap; margin-top: -6px; }
.pcard { border: 1px solid var(--line-soft); border-radius: 18px; padding: 14px; margin-top: 12px; background: #fff; }
.pcard.terr { background: linear-gradient(180deg, var(--sky-soft), #fff 60%); }
.vcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.vcard { position: relative; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 12px 12px 10px; min-height: 96px; cursor: pointer; overflow: hidden; font: inherit; transition: transform .2s var(--ease), border-color .2s; }
.vcard:hover { transform: translateY(-2px); }
.vcard.on { border-color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }
.vcard img { position: absolute; right: -4px; bottom: -6px; width: 64px; }
.vcard .vv { display: block; font-size: 24px; font-weight: 650; letter-spacing: -.03em; color: var(--ink); }
.vcard .vl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.vcard::before { content: ''; position: absolute; left: 12px; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }

/* ---------- Charts ---------- */
.donut { display: flex; align-items: center; gap: 14px; }
.donut svg { flex: none; }
.donut .dn-c { font: 650 20px var(--sans); fill: var(--ink); letter-spacing: -.02em; }
.donut .dn-s { font: 500 11px var(--sans); fill: var(--muted); }
.lg { list-style: none; margin: 0; padding: 0; flex: 1; font-size: 13px; }
.lg li { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 8px; }
.lg li.click { cursor: pointer; } .lg li.click:hover { background: var(--stone); }
.lg i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lg span { flex: 1; color: var(--body); } .lg b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 7px; }
.hb { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 54px; gap: 8px; align-items: center; font-size: 13px; }
.hb.click { cursor: pointer; border-radius: 8px; } .hb.click:hover .hb-l { color: var(--blue-ink); }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--body); }
.hb-t { height: 12px; background: var(--stone); border-radius: 6px; overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.tip { position: fixed; z-index: 3000; display: none; pointer-events: none; background: var(--navy); color: #fff; font-size: 12px; line-height: 1.4; padding: 7px 10px; border-radius: 10px; box-shadow: var(--shadow); max-width: 280px; }
.charts3 { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 18px; }
.charts2 { grid-template-columns: 1.4fr 1fr; }
.hero-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.hcard { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; position: relative; overflow: hidden; }
.hcard img { width: 76px; margin: -6px -6px 0 0; }
.hcard .name { font-size: 18px; line-height: 1.25; display: block; margin-top: 4px; }
.hcard:first-child { background: linear-gradient(160deg, var(--peach), #fff 55%); border-color: #f1d3bf; }
@media (max-width: 960px) {
  .charts3, .hero-cards, .charts2 { grid-template-columns: 1fr; }
  .mpanel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 45vh; border-radius: 22px 22px 0 0; }
  .mtools { top: 80px; left: 12px; right: 12px; align-items: stretch; } .mtools input { width: 100%; } .mtools .seg { overflow-x: auto; }
  .mlegend { display: none; }
}
.pname { font-size: 18px; font-weight: 650; color: var(--ink); letter-spacing: -.02em; }
.d-art { float: right; width: 88px; margin: 26px 0 0 10px; }
