/* =============================================================== tokens ===
   Palette is the validated data-viz reference instance: categorical slots in
   fixed order (never cycled), one sequential blue ramp, diverging blue<->red
   with a neutral gray midpoint, and a reserved status palette that never
   doubles as a series color. Dark steps are selected for the dark surface,
   not an automatic flip.
   ======================================================================== */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --surface-2: #f2f1ed;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;

  --seq-100: #cde2fb;
  --seq-200: #9ec5f4;
  --seq-300: #6da7ec;
  --seq-400: #3987e5;
  --seq-500: #256abf;
  --seq-600: #184f95;
  --seq-700: #0d366b;

  --diverge-pos: #2a78d6;
  --diverge-neg: #e34948;
  --diverge-mid: #f0efec;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --success-text: #006300;

  /* Elev8 brand: yellow is the accent and never carries body text (1.74:1 on
     white); black and white carry the structure. Yellow-on-black is the
     signature pairing, so the sidebar and the report header use it. */
  --brand: #F6BB12;
  --brand-ink: #000000;
  --brand-dark: #0b0b0b;
  --brand-dark-2: #17171a;

  --accent: #F6BB12;
  --accent-text: #0b0b0b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 4px 14px rgba(11, 11, 11, 0.04);
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --surface-2: #232322;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --diverge-pos: #3987e5;
    --diverge-neg: #e66767;
    --diverge-mid: #383835;
    --success-text: #0ca30c;
    --accent: #F6BB12;
    --accent-text: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #1a1a19;
  --surface-2: #232322;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --diverge-pos: #3987e5;
  --diverge-neg: #e66767;
  --diverge-mid: #383835;
  --success-text: #0ca30c;
  --accent: #F6BB12;
  --accent-text: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ================================================================= base === */
* { box-sizing: border-box; }
/* `hidden` has to beat the layout classes below, which set their own display. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
/* Yellow measures 1.74:1 on white, so links never wear the accent colour. */
a { color: var(--text-primary); text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--text-primary); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ================================================================ shell === */
.app { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--brand-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  color: #fff;
}
.brand { padding: 2px 8px 18px; }
.brand-logo { display: block; height: 26px; width: auto; }
.brand-logo img { height: 26px; width: auto; display: block; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.brand-text { min-width: 0; margin-top: 9px; }
.brand-name { font-weight: 600; font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 10.5px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.01em; }

.nav-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.42); padding: 15px 8px 5px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 9px; border-radius: 7px; cursor: pointer;
  color: rgba(255, 255, 255, 0.72); font-size: 13px; border: 0; background: none;
  width: 100%; text-align: left; position: relative;
}
.nav-item:hover { background: var(--brand-dark-2); color: #fff; }
.nav-item[aria-current="true"] { background: var(--brand-dark-2); color: #fff; font-weight: 600; }
/* The active marker is the only yellow in the nav - a bar, not a background,
   so the accent stays an accent. */
.nav-item[aria-current="true"]::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item .ico { width: 15px; text-align: center; opacity: 0.6; flex: 0 0 auto; }
.nav-item[aria-current="true"] .ico { opacity: 1; color: var(--brand); }
.sidebar-foot {
  margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px; color: rgba(255, 255, 255, 0.45);
}
.sidebar-foot .btn {
  background: transparent; border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.75);
}
.sidebar-foot .btn:hover { background: var(--brand-dark-2); color: #fff; }

.main { min-width: 0; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-secondary); max-width: 74ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =============================================================== controls  */
.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.02em; }
input[type="text"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  background: var(--page); border: 1px solid var(--border-strong);
  border-radius: 7px; padding: 6px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.btn:focus-visible, .chip:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.w-sm { width: 82px; } .w-md { width: 132px; } .w-lg { width: 240px; } .w-xl { width: 330px; }

.btn {
  border: 1px solid var(--border-strong); background: var(--surface-1);
  padding: 6px 13px; border-radius: 7px; cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.05); background: var(--brand); }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: none; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border-strong); background: var(--surface-1);
  border-radius: 999px; padding: 3px 11px; font-size: 12px; cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* The remove affordance on a saved market sits inside its chip, so the pair
   reads as one control. Kept dim until the chip is hovered: it is destructive,
   and a row of visible crosses turns a quiet filter into a warning sign. */
.chip-x {
  display: inline-block; margin-left: 4px; padding: 0 3px;
  border-radius: 3px; opacity: 0; font-weight: 600; line-height: 1;
  transition: opacity 120ms ease, background 120ms ease;
}
.chip:hover .chip-x, .chip:focus-within .chip-x { opacity: 0.55; }
.chip-x:hover { opacity: 1; background: color-mix(in oklab, var(--critical) 16%, transparent); color: var(--critical); }
.chip-x:focus-visible { opacity: 1; outline: 2px solid var(--brand); outline-offset: 1px; }

/* ================================================================== grid === */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ================================================================= tiles === */
.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow);
}
.tile-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.tile-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 3px; line-height: 1.12; }
.tile-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.tile-spark { height: 34px; margin-top: 6px; }

.delta { font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--success-text); }
.delta.down { color: var(--critical); }
.delta.flat { color: var(--text-muted); }

/* ================================================================= cards === */
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-head { padding: 13px 15px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head .sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; max-width: 70ch; }
.card-body { padding: 10px 15px 15px; }
.chart { width: 100%; height: 300px; }
.chart-sm { height: 220px; }
.chart-lg { height: 400px; }
.chart-xl { height: 480px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); padding: 0 15px 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.swatch.line { height: 3px; border-radius: 2px; width: 15px; }

/* ================================================================ tables === */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 600; cursor: pointer; user-select: none;
  position: sticky; top: 0; background: var(--surface-1); z-index: 1;
}
table.data th.no-sort { cursor: default; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.is-subject { background: color-mix(in srgb, var(--series-1) 12%, transparent); }
table.data tr.is-subject td { font-weight: 600; }
.t-mut { color: var(--text-muted); }
.t-sec { color: var(--text-secondary); }
.t-right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--border-strong);
}
.badge.ok { color: var(--success-text); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.badge.warn { color: #8a5b00; border-color: color-mix(in srgb, var(--warning) 55%, transparent); }
:root[data-theme="dark"] .badge.warn { color: var(--warning); }
.badge.bad { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.badge.neutral { color: var(--text-secondary); }

/* ================================================================= notes === */
.note {
  border-left: 3px solid var(--text-secondary); background: var(--surface-2);
  padding: 10px 13px; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--text-secondary);
}
.note strong { color: var(--text-primary); }
.note.caution { border-left-color: var(--brand); }
.note.alert { border-left-color: var(--critical); }
.note.good { border-left-color: var(--good); }
.note-list { margin: 6px 0 0; padding-left: 18px; }
.note-list li { margin: 3px 0; }

.verdict { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.verdict .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }

.empty { padding: 34px 18px; text-align: center; color: var(--text-muted); }
.spinner {
  width: 15px; height: 15px; border: 2px solid var(--border-strong);
  border-top-color: var(--accent); border-radius: 50%; display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--accent);
  transform-origin: left; animation: load 1.1s ease-in-out infinite; z-index: 200;
}
@keyframes load { 0% { transform: scaleX(0); } 50% { transform: scaleX(0.7); } 100% { transform: scaleX(1); opacity: 0.3; } }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: var(--page);
  padding: 9px 16px; border-radius: 8px; z-index: 300; font-size: 13px; box-shadow: var(--shadow);
}
.toast.error { background: var(--critical); color: #fff; }

/* ================================================================= login === */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: var(--brand-dark);
}
.login-card {
  background: var(--brand-dark-2); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; padding: 30px; width: 100%; max-width: 380px; color: #fff;
}
.login-card .brand-logo { margin-bottom: 22px; }
.login-card .brand-logo img { height: 30px; }
.login-card h1 { margin-bottom: 4px; color: #fff; font-size: 18px; }
.login-card p { color: rgba(255, 255, 255, 0.6); margin: 0 0 18px; font-size: 13px; }
.login-card label { color: rgba(255, 255, 255, 0.6) !important; }
.login-card input {
  background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.18); color: #fff;
}
.login-card input { width: 100%; margin-bottom: 12px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-err { color: var(--critical); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ================================================================ drawer === */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(11, 11, 11, 0.42); z-index: 150;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(1080px, 94vw);
  background: var(--page); border-left: 1px solid var(--border);
  z-index: 151; overflow-y: auto; padding: 20px 24px 60px; box-shadow: -8px 0 30px rgba(0,0,0,0.12);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }

/* ============================================================== report === */
.report { max-width: 1120px; margin: 0 auto; padding: 30px 26px 80px; }
.report-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 20px 22px; margin-bottom: 24px; flex-wrap: wrap;
  background: var(--brand-dark); color: #fff; border-radius: var(--radius);
  border-bottom: 3px solid var(--brand);
}
.report-head h1 { color: #fff; }
.report-head .t-sec { color: rgba(255, 255, 255, 0.68) !important; }
.report-logo { max-height: 34px; max-width: 220px; display: block; }
.report-meta { font-size: 12px; color: rgba(255, 255, 255, 0.6); text-align: right; }
.report-foot { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.report h2 { margin: 30px 0 10px; padding-left: 10px; border-left: 3px solid var(--brand); }

/* ======================================================= property lookup  */
/* A single entry point: paste an Airbnb id, or type a name and pick from the
   locally built index. The dropdown has to sit above the cards below it, hence
   the stacking context on the wrapper. */
.lookup { display: flex; gap: 10px; align-items: flex-start; position: relative; z-index: 5; }
.lookup-box { position: relative; flex: 1 1 520px; max-width: 640px; }
.lookup-box input { width: 100%; font-size: 14px; padding: 9px 12px; }
.lookup-drop {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 30;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  max-height: 360px; overflow-y: auto;
}
.lookup-opt {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.lookup-opt:last-child { border-bottom: 0; }
.lookup-opt:hover, .lookup-opt[aria-selected="true"] { background: var(--surface-2); }
.lookup-opt .lo-name { font-weight: 600; font-size: 13px; }
.lookup-opt .lo-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.lookup-opt .lo-rev { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lookup-note { padding: 11px 12px; font-size: 12.5px; color: var(--text-muted); }
.prop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.prop-head h2 { margin: 0 0 4px; font-size: 20px; }

/* ==================================================================== maps */
/* Dots, never pins: Airbnb offsets a listing's coordinates, so a pin would
   promise a precision the data has not got. `isolation` matters - Leaflet's
   panes sit at z-index 400-700 and would otherwise paint over the sidebar,
   the property drawer and the lookup dropdown. */
.geomap {
  width: 100%; height: 420px; border-radius: 8px;
  background: var(--surface-2); position: relative; z-index: 0; isolation: isolate;
}
.geomap-sm { height: 300px; }
/* One tile source for both themes: the dark basemap is the light one inverted. */
.geomap.is-dark .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.55);
}
.leaflet-container { font-family: var(--font); font-size: 12px; background: var(--surface-2); }
.leaflet-container a { color: var(--text-primary); }
.leaflet-bar a, .leaflet-bar a:hover {
  background: var(--surface-1); color: var(--text-primary); border-bottom-color: var(--border);
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--surface-1); color: var(--text-primary);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18); border-radius: 9px;
}
.leaflet-popup-content { margin: 10px 12px; }
.map-pop-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.map-pop-line { color: var(--text-secondary); font-size: 12px; }
.map-pop-links { margin-top: 8px; display: flex; gap: 12px; font-size: 12px; font-weight: 600; }
.leaflet-tooltip.map-own {
  background: var(--brand); color: var(--brand-ink); border: 0; font-weight: 600;
  box-shadow: none; padding: 2px 7px;
}
.leaflet-tooltip.map-own::before { border-top-color: var(--brand); }
.leaflet-control-attribution {
  background: var(--surface-1) !important; color: var(--text-muted); font-size: 10px;
}
.leaflet-control-attribution a { color: var(--text-secondary); }


/* ---------------------------------------------------------- owner blocks ---
   The three client-facing blocks in owner.js. Shared by the dashboard's
   property page and the report behind a share link, so everything here has to
   hold up in light, dark and print. */

.own-hero {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: 18px 20px;
}
.own-hero-k {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
}
/* Deliberately the page's own ink, not the brand yellow: this is the largest
   number in the report and yellow sits far outside the lightness band a
   readable mark needs. Yellow stays an accent, never a value. */
.own-hero-v {
  font-size: 40px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.05; margin-top: 4px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.own-hero-u { font-size: 17px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0; }
.own-hero-p { font-size: 13px; color: var(--text-secondary); margin: 8px 0 0; max-width: 78ch; line-height: 1.5; }
.own-hero.is-ahead { border-left: 3px solid var(--good); }

.own-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.own-chart { height: 300px; }
.own-parts { width: 100%; }
.own-parts td.is-up { color: var(--diverge-pos); font-weight: 600; }
.own-parts td.is-down { color: var(--diverge-neg); font-weight: 600; }
.own-parts tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); }
.own-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; font-weight: 400; }
.own-lede { font-size: 13px; color: var(--text-secondary); margin: 0 0 12px; max-width: 80ch; line-height: 1.5; }
.own-aside {
  margin-top: 12px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-secondary);
}
.own-aside strong { color: var(--text-primary); }
.own-strengths { margin-top: 12px; }
.own-strength {
  font-size: 12.5px; line-height: 1.5; color: var(--text-secondary);
  padding: 7px 11px; border-left: 3px solid var(--good); background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 6px;
}
.own-strength strong { color: var(--text-primary); }

/* A percentile track per metric. Position carries the value; the two ticks are
   the comp-set median and upper quartile. Band is exposed as a data attribute
   for the dot only - colouring the whole row by band would encode an ordered
   scale as five categories. */
.own-score { padding: 12px 0; border-top: 1px solid var(--border); }
.own-score:first-of-type { border-top: 0; }
.own-score-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.own-score-label { font-size: 13px; font-weight: 600; }
.own-score-val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.own-score-track {
  position: relative; height: 8px; margin: 8px 0 7px;
  background: var(--grid); border-radius: 999px; overflow: visible;
}
.own-score-fill { position: absolute; inset: 0 auto 0 0; background: var(--seq-300); border-radius: 999px; }
.own-score-tick { position: absolute; top: -3px; width: 1px; height: 14px; background: var(--border-strong); }
.own-score-tick.is-upper { background: var(--text-muted); }
.own-score-dot {
  position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%; background: var(--seq-600); border: 2px solid var(--surface-1);
}
.own-score[data-band="top"] .own-score-dot, .own-score[data-band="upper"] .own-score-dot { background: var(--good); }
.own-score[data-band="bottom"] .own-score-dot, .own-score[data-band="lower"] .own-score-dot { background: var(--critical); }
.own-score-read { font-size: 12.5px; color: var(--text-secondary); }
.own-score-read strong { color: var(--text-primary); }

/* Findings, each split into the decision and the execution. */
.own-play { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.own-play:first-of-type { border-top: 0; }
.own-play-n {
  flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.own-play-body { flex: 1 1 auto; min-width: 0; }
.own-play-body h4 { margin: 2px 0 0; font-size: 14px; font-weight: 600; line-height: 1.35; }
.own-play-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 9px; }
.own-play-cell {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-1);
}
.own-play-cell.is-soft { background: var(--surface-2); }
.own-play-who {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 4px;
}
.own-play-cell p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }

@media (max-width: 900px) {
  .own-split, .own-play-split { grid-template-columns: 1fr; }
  .own-hero-v { font-size: 32px; }
}

@media print {
  .sidebar, .head-actions, .filters, .no-print, .lookup { display: none !important; }
  .report-head {
    background: #fff !important; color: #000 !important;
    border-bottom: 3px solid var(--brand); border-radius: 0; padding: 0 0 14px;
  }
  .report-head h1 { color: #000 !important; }
  .report-head .t-sec, .report-meta { color: #444 !important; }
  body { background: #fff; }
  .app { grid-template-columns: 1fr; }
  .card, .tile { break-inside: avoid; box-shadow: none; border-color: #ddd; }
  .report { padding: 0; }
  /* The map prints; its controls do not. */
  .geomap { height: 320px; break-inside: avoid; }
  .own-split { grid-template-columns: 1fr; }
  .own-chart { height: 260px; }
  .own-hero, .own-score, .own-play, .own-aside { break-inside: avoid; }
  .own-hero-v { font-size: 34px; }
  .leaflet-control-container { display: none !important; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; align-items: center; }
  .nav-group, .sidebar-foot, .brand-text { display: none; }
  .main { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
