/* =====================================================================
   HomeScope.ie styles
   1. Tokens   2. Base   3. Components   4. Layout   5. Views   6. Responsive
   Neutral UI; colour is kept for data (verdicts, price ramp, chart series).
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* HomeScope.ie brand (docs/brand/): emerald, aged brass, slate charcoal, parchment */
  --page: #F8F3E6;
  --surface: #FFFDF7;
  --surface-2: #F1EAD8;
  --surface-3: #E5DAC0;
  --ink: #1F2A24;
  --ink-2: #4A5560;
  --ink-3: #5E6770;
  --line: rgba(31, 42, 36, 0.12);
  --line-strong: rgba(31, 42, 36, 0.22);
  --primary: #0B6623;
  --on-primary: #FFFDF7;
  --focus: #0B6623;
  --brand: #0A4F1C;        /* the header band and the answer tile */
  --on-brand: #FFFDF7;
  --on-brand-2: #C9D6CC;
  --brass: #C8A951;        /* rules and ornament only: too light for text on parchment */
  --brass-hi: #E3CB7F;     /* brass for text and marks on emerald */
  --brass-ink: #7A6224;    /* brass for text on parchment */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  /* Linen paper: a faint grain over the parchment */
  --texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Verdict status: always shown with an icon and a label, never colour alone */
  --good: #0ca30c;     --good-ink: #006300;
  --warning: #fab219;  --warning-ink: #7a5200;
  --serious: #ec835a;  --serious-ink: #9a3d17;
  --critical: #d03b3b; --critical-ink: #a32424;

  /* Sequential price ramp (map shading) */
  --p1: #80c092; --p2: #57a970; --p3: #2f8550; --p4: #1d703d; --p5: #0b5126;   /* one green, light to dark (validated ordinal ramp, as Insights) */

  /* Chart series and axes */
  --s1: #1d703d; --s2: #b07d1a; --s3: #2a78d6;   /* emerald, brass, blue: dataviz validator, all checks pass (light) */ --grid: #E6DDC8; --axis: #CBBF9F;

  /* Map overlays (labels sit on busy tiles, so they're dark in both themes) */
  --map-label-bg: rgba(26, 31, 36, 0.92);
  --map-label-ink: #ffffff;
  --map-label-ink-2: #E3CB7F;
  --river: #0369a1;

  /* Type scale (base 15px body) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-2xs: 0.75rem;    /* 12px  legal, axis ticks (same as xs: one caption size) */
  --fs-xs: 0.75rem;     /* 12px  captions, sources */
  --fs-sm: 0.875rem;    /* 14px  labels, meta (same as md) */
  --fs-md: 0.875rem;    /* 14px  secondary text, controls */
  --fs-base: 0.9375rem; /* 15px  body */
  --fs-lg: 1.0625rem;   /* 17px  card titles */
  --fs-xl: 1.25rem;     /* 20px  figures, section titles */
  --fs-2xl: 1.5rem;     /* 24px  panel titles */
  --fs-3xl: 1.875rem;   /* 30px  big figures */
  --fs-display: clamp(1.75rem, 3.4vw, 2.75rem);
  --fw-regular: 400; --fw-medium: 600; --fw-bold: 700; --fw-heavy: 700;

  /* Spacing scale (4px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px;

  /* Shape, depth, motion, layers */
  --radius-xs: 6px; --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow-2: 0 8px 28px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  --shadow-3: 0 24px 60px rgba(0,0,0,.22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .16s;
  --z-map-ui: 500; --z-sticky: 900; --z-topbar: 1000; --z-pop: 1100;

  /* Layout */
  --topbar-h: 64px;
  --filterbar-h: 0px;
  --control-h: 36px;
  --control-h-lg: 42px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111417; --surface: #181C20; --surface-2: #20252A; --surface-3: #2A3036;
    --ink: #F3EDDC; --ink-2: #C9C2AE; --ink-3: #A39D89;
    --line: rgba(243,237,220,.11); --line-strong: rgba(243,237,220,.22);
    --primary: #C8A951; --on-primary: #14171A; --focus: #E3CB7F;
    --brand: #1A1F24; --on-brand: #F3EDDC; --on-brand-2: #C9C2AE; --brass-ink: #D9BF6E;
    --map-label-bg: rgba(20, 24, 28, 0.92);
    --texture: none;
    --shadow-1: 0 1px 2px rgba(0,0,0,.5); --shadow-2: 0 10px 30px rgba(0,0,0,.55); --shadow-3: 0 24px 60px rgba(0,0,0,.7);
    --good-ink: #3fcf3f; --warning-ink: #fab219; --serious-ink: #f09a78; --critical-ink: #ef7272;
    --p1: #2a7a45; --p2: #3d9659; --p3: #5bb274; --p4: #82cb95; --p5: #b3e2bf;
    --s1: #278047; --s2: #b58e3c; --s3: #4d8ee6;   /* validated for dark */ --grid: #2c2c2a; --axis: #383835;
    --river: #5cb4e6;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111417; --surface: #181C20; --surface-2: #20252A; --surface-3: #2A3036;
  --ink: #F3EDDC; --ink-2: #C9C2AE; --ink-3: #A39D89;
  --line: rgba(243,237,220,.11); --line-strong: rgba(243,237,220,.22);
  --primary: #C8A951; --on-primary: #14171A; --focus: #E3CB7F;
  --brand: #1A1F24; --on-brand: #F3EDDC; --on-brand-2: #C9C2AE; --brass-ink: #D9BF6E;
  --map-label-bg: rgba(20, 24, 28, 0.92);
  --texture: none;
  --shadow-1: 0 1px 2px rgba(0,0,0,.5); --shadow-2: 0 10px 30px rgba(0,0,0,.55); --shadow-3: 0 24px 60px rgba(0,0,0,.7);
  --good-ink: #3fcf3f; --warning-ink: #fab219; --serious-ink: #f09a78; --critical-ink: #ef7272;
  --p1: #2a7a45; --p2: #3d9659; --p3: #5bb274; --p4: #82cb95; --p5: #b3e2bf;
  --s1: #278047; --s2: #b58e3c; --s3: #4d8ee6;   /* validated for dark */ --grid: #2c2c2a; --axis: #383835;
  --river: #5cb4e6;
}

/* ---------------------------------------------------------------------
   2. Base
   --------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.45;
  color: var(--ink); background: var(--page) var(--texture);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
b, strong { font-weight: var(--fw-bold); }
small { font-size: var(--fs-xs); }
.muted { color: var(--ink-3); }
.note { font-size: var(--fs-sm); color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }

/* ---------------------------------------------------------------------
   3. Components
   --------------------------------------------------------------------- */

/* Card: the one surface used by summaries, county cards, tiles, charts */
.card-surface, .area-card, .acard, .tile, .t-card, .cmp-card, .ctable-wrap {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--control-h-lg); padding: 0 var(--sp-5); border-radius: var(--radius-pill);
  border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary);
  font-weight: var(--fw-bold); text-decoration: none;
}
.btn:hover { opacity: .88; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { opacity: 1; border-color: var(--ink); }
.icon-btn {
  width: var(--control-h-lg); height: var(--control-h-lg); border-radius: var(--radius-pill);
  display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--ink); font-weight: var(--fw-medium); font-size: var(--fs-md);
  text-decoration: underline; text-underline-offset: 3px; justify-self: start; align-self: flex-start;
}
.dialog-close { position: absolute; top: var(--sp-3); right: var(--sp-3); background: var(--surface); box-shadow: var(--shadow-1); }

/* Chips and toggles */
.toggle-chip, .area-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--control-h); padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: var(--fw-medium); font-size: var(--fs-md); white-space: nowrap;
}
.toggle-chip { cursor: pointer; user-select: none; position: relative; }
#area-chip-slot:empty { display: none; }
.toggle-chip:hover { border-color: var(--ink); }
.toggle-chip input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle-dot { width: 28px; height: 16px; border-radius: var(--radius-pill); background: var(--surface-3); position: relative; transition: background var(--dur); }
.toggle-dot::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--dur); }
.toggle-chip input:checked + .toggle-dot { background: var(--ink); }
.toggle-chip input:checked + .toggle-dot::after { transform: translateX(12px); background: var(--on-primary); }
.area-chip { background: var(--primary); color: var(--on-primary); border-color: var(--primary); padding-right: 6px; font-weight: var(--fw-bold); }
.area-chip button { border: 0; background: color-mix(in srgb, var(--on-primary) 20%, transparent); color: inherit; width: 24px; height: 24px; border-radius: var(--radius-pill); display: grid; place-items: center; }

/* Segmented controls */
.seg { display: grid; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg button { border: 0; background: none; padding: 7px 10px; border-radius: var(--radius-sm); font-weight: var(--fw-medium); font-size: var(--fs-md); color: var(--ink-2); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }

.mode-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); user-select: none; }
.mode-switch-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px;
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-2);
  font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1; transition: background var(--dur), color var(--dur);
}
.mode-switch-btn:hover { color: var(--ink); }
.mode-switch-btn.is-active { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-1); }
.mode-switch-btn svg { flex-shrink: 0; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-2); }
.field-label b { color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.money { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); padding-left: 10px; }
.money i { font-style: normal; color: var(--ink-3); }
.money input { border: 0; background: none; outline: none; width: 100%; padding: 9px 10px 9px 4px; font-weight: var(--fw-medium); }
.money:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.select {
  height: 38px; padding: 0 30px 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background-color: var(--surface);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23888' stroke-width='2.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select-bare { border-color: transparent; background-color: transparent; font-weight: var(--fw-bold); padding-left: 4px; }
input[type="range"] { accent-color: var(--ink); width: 100%; }

/* Verdict pill: colour + icon + label */
.verdict {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px;
  border-radius: var(--radius-pill); font-weight: var(--fw-bold); font-size: var(--fs-sm); white-space: nowrap;
  background: color-mix(in srgb, var(--v) 14%, var(--surface)); color: var(--v-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--v) 45%, transparent);
}
.verdict .vi { width: 18px; height: 18px; border-radius: 50%; background: var(--v); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.verdict.sm { height: 24px; font-size: var(--fs-xs); padding-right: var(--sp-2); }
.verdict.sm .vi { width: 16px; height: 16px; }
.v-reach { --v: var(--good); --v-ink: var(--good-ink); }
.v-stretch { --v: var(--warning); --v-ink: var(--warning-ink); }
.v-stretch .vi { color: #3d2a00; }
.v-out { --v: var(--serious); --v-ink: var(--serious-ink); }
.v-far { --v: var(--critical); --v-ink: var(--critical-ink); }

/* Stat tiles: label, figure, source */
.stat-label, .tile span { font-size: var(--fs-xs); color: var(--ink-3); font-weight: var(--fw-medium); }
.tile { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-1); }
.tile strong { font-size: var(--fs-3xl); letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile strong small { font-size: var(--fs-base); color: var(--ink-3); font-weight: var(--fw-medium); }
.tile p { margin: 0; font-size: var(--fs-xs); color: var(--ink-3); }

/* Empty state */
.empty { grid-column: 1 / -1; text-align: center; padding: var(--sp-8) var(--sp-5); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------------------------------------------------------------------
   4. Layout: top bar, filter bar, split view, footer
   --------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  display: flex; flex-direction: column;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
/* Two rows: the site row (brand, search, site nav, saved, theme), then the map's tools
   (views, Buy/Rent, the chosen county, who's buying) */
.tb-row { display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-5); }
.tb-site { height: 60px; border-bottom: 1px solid var(--line); }
.tb-site .search { flex: 1 1 320px; max-width: 460px; min-width: 160px; }
.tb-tools { height: 52px; gap: var(--sp-3); }
.tools-homes { display: flex; align-items: center; gap: var(--sp-2); padding-left: var(--sp-3); border-left: 1px solid var(--line); }
.who-btn { margin-left: auto; display: inline-flex; align-items: baseline; gap: 6px; border: 0; background: none; padding: 6px 4px; font-size: var(--fs-md); color: var(--ink-3); white-space: nowrap; }
.who-value { font-weight: var(--fw-bold); color: var(--ink); }
.who-edit { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.who-btn:hover .who-edit { color: var(--ink); }
.site-nav { display: flex; gap: 2px; margin-left: auto; }
.site-nav a { padding: 8px 12px; border-radius: var(--radius-pill); font-weight: var(--fw-medium); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.site-actions { display: flex; gap: 2px; align-items: center; }
.saved-link { position: relative; }
.badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: var(--fw-bold); line-height: 18px; text-align: center; }
.skip { position: absolute; left: var(--sp-3); top: -60px; z-index: 2000; background: var(--primary); color: var(--on-primary); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); }
.skip:focus { top: var(--sp-3); }
#main:focus { outline: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.brand-name { font-size: var(--fs-lg); font-weight: var(--fw-regular); letter-spacing: -0.02em; }
.brand-name b { font-weight: var(--fw-heavy); }

.view-tabs { display: flex; gap: 2px; }
.view-tab { border: 0; background: none; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-pill); font-weight: var(--fw-medium); color: var(--ink-2); }
.view-tab:hover { background: var(--surface-2); color: var(--ink); }
.view-tab.is-active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; height: var(--control-h-lg); padding: 0 14px 0 40px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.search-icon { position: absolute; left: 14px; top: 12px; color: var(--ink-3); pointer-events: none; }
.search-results { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 6px; max-height: 380px; overflow: auto; }
.sr-group { font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: var(--sp-2) 10px var(--sp-1); }
.sr-item { display: flex; justify-content: space-between; gap: var(--sp-3); width: 100%; border: 0; background: none; text-align: left; padding: var(--sp-2) 10px; border-radius: var(--radius-sm); color: var(--ink); font-weight: var(--fw-medium); }
.sr-item:hover, .sr-item.is-active { background: var(--surface-2); }
.sr-item small { color: var(--ink-3); white-space: nowrap; }
.sr-empty { padding: var(--sp-3); color: var(--ink-3); }

.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

.sort { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-md); color: var(--ink-3); }
.view { display: block; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46%); height: calc(100vh - var(--topbar-h)); }
.results { position: relative; overflow-y: auto; padding: var(--sp-5) var(--sp-5) 0; }
/* Hidden until js/app.js has filled it, so nothing jumps as the cards arrive */
.results:not(.is-ready) { visibility: hidden; }
.map-error { padding: var(--sp-6); color: var(--ink-2); }
.map-pane { position: relative; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.mobile-toggle { display: none; }

.site-foot { margin: var(--sp-8) 0 0; padding: 18px 0 28px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--ink-3); }
.site-foot p { margin: 0 0 var(--sp-2); }
.site-foot .link-btn { font-size: var(--fs-xs); color: var(--ink-2); }

/* ---------------------------------------------------------------------
   5. Views
   --------------------------------------------------------------------- */

/* Counties view: summary card. A title with one verdict, three figures, their sources, the slider */
.area-card { padding: 18px 20px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 14px; }
.ac-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.area-card .card-title { font-size: var(--fs-2xl); }
.mn-head h2, .results-head h2 { font-size: var(--fs-xl); }
.acard-head h3 { font-size: var(--fs-lg); }
.area-card .eyebrow { margin-bottom: var(--sp-1); }
.sale-card .card-title { font-size: var(--fs-xl); line-height: 1.25; }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin: 0; }
.figs div { min-width: 0; }
.figs dt { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); }
.figs dd { margin: 2px 0 0; font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.figs dd small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); }
.card-src { margin: -6px 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-3); max-width: 80ch; }
.card-src a { color: inherit; }

/* Counties view: list of county cards, with its filter and sort */
.results-head { margin: var(--sp-7) 0 var(--sp-3); }
.results-head h2 { font-size: var(--fs-lg); }
.results-note { margin: var(--sp-1) 0 0; font-size: var(--fs-sm); color: var(--ink-3); max-width: 70ch; }
.list-tools { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-3); }
.list-tools #results-count { margin-right: auto; font-size: var(--fs-md); }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acard { display: flex; flex-direction: column; gap: 10px; padding: 14px var(--sp-4); box-shadow: var(--shadow-1); }
.acard.is-open { grid-column: 1 / -1; border-color: var(--line-strong); }
.acard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.acard-head h3 { font-size: var(--fs-lg); }
.acard-title { border: 0; background: none; padding: 0; font-weight: var(--fw-bold); text-align: left; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.acard-title:hover { text-decoration-color: currentColor; }
.acard-prov { font-size: var(--fs-xs); color: var(--ink-3); }
.acard-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acard-figs span, .beds-row span { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.acard-figs strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.acard-figs small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); }
.acard-meaning { margin: 0; font-size: var(--fs-md); color: var(--ink-2); }
.acard-extra { border-top: 1px solid var(--line); padding-top: 10px; }
.acard-extra-title { display: block; font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 6px; }
.beds-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--sp-2); }
.beds-row strong { font-variant-numeric: tabular-nums; }
/* Where to look: one county picture, then Daft.ie and MyHome.ie searches up to this buyer's budget */
.acard-links { display: flex; align-items: center; gap: var(--sp-3); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.pl-pic { position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 56px; border-radius: var(--radius-sm); background: var(--surface-2); }
.pl-pic .place-thumb { width: 42px; height: auto; }
.pt-land { fill: var(--line-strong); stroke: var(--surface-2); stroke-width: .5; stroke-linejoin: round; }
.pt-here { fill: var(--ink); stroke: var(--surface-2); stroke-width: .5; stroke-linejoin: round; }
.pl-badge { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 2px var(--surface-2); }
.pl-badge svg { width: 10px; height: 10px; }
.pl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-title { font-size: var(--fs-md); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pl-go { display: flex; flex-wrap: wrap; gap: 2px var(--sp-4); }
.portal-link { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; font-weight: var(--fw-bold); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.portal-link svg { width: 12px; height: 12px; color: var(--ink-3); }
.portal-link:hover { text-decoration-thickness: 2px; }
.county-page-link { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink); text-underline-offset: 3px; }

/* Map: controls, legend, labels, tooltip */
.map-header-bar { position: absolute; top: var(--sp-3); left: var(--sp-3); right: var(--sp-3); z-index: var(--z-map-ui); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; }
.map-header-bar > * { pointer-events: auto; }
.map-card { padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.map-seg { display: inline-flex; align-items: center; gap: 2px; }
.map-seg button {
  border: 0; background: transparent; color: var(--ink-2); white-space: nowrap;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background var(--dur), color var(--dur);
}
.map-seg button:hover { background: var(--surface-2); color: var(--ink); }
.map-seg button[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }
.map-layers { position: relative; }
.map-period { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 4px 0 10px; margin-right: auto; color: var(--ink-2); cursor: pointer; }
.map-period select { height: 32px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: 0 2px; cursor: pointer; font-variant-numeric: tabular-nums; }
.map-period select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.map-period:hover { background: var(--surface-2); }
.map-period[hidden] { display: none; }
.map-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.map-icon-btn:hover, .map-icon-btn[aria-expanded="true"] { background: var(--surface-2); }
.layers-pop { position: absolute; right: 0; top: 48px; width: 240px; padding: 14px; display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
.lp-title { font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.lp-check { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-medium); cursor: pointer; }
.lp-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.lp-note { margin: 0; font-size: var(--fs-xs); color: var(--ink-3); }
#map .leaflet-tile-container img.leaflet-tile { width: 256.5px !important; height: 256.5px !important; mix-blend-mode: normal; }   /* overlap tiles by half a pixel so no hairlines show at fractional zoom (instead of Leaflet's plus-lighter, which draws light lines under our tile filter) */
#map.tiles-light .leaflet-tile-pane { filter: saturate(.45) sepia(.12) brightness(1.03) contrast(.94); }   /* OpenStreetMap, calmer so the data stands out */
#map.tiles-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }

.legend {
  position: absolute; left: var(--sp-3); bottom: 24px; z-index: var(--z-map-ui); max-width: calc(100% - 76px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2);
  padding: 6px 6px 6px var(--sp-3); font-size: var(--fs-xs);
}
.legend-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.legend-title { font-weight: var(--fw-bold); color: var(--ink); }
.legend-row { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.legend-row .sw { width: 14px; height: 14px; border-radius: var(--radius-xs); flex-shrink: 0; display: grid; place-items: center; color: #fff; }
.legend-row .sw svg { width: 10px; height: 10px; }
.legend-muted { color: var(--ink-3); }
.legend-info { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: italic var(--fw-bold) var(--fs-xs)/1 Georgia, serif; display: grid; place-items: center; }
.legend-info:hover, .legend-info[aria-expanded="true"] { border-color: var(--ink); color: var(--ink); }
.legend-more { margin: 6px 6px 2px 0; color: var(--ink-3); line-height: 1.5; max-width: 62ch; }

.leaflet-container { font-family: var(--font); background: var(--surface-2); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-2) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; width: 36px !important; height: 36px !important; line-height: 36px !important; font-size: var(--fs-xl) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--ink-3) !important; font-size: var(--fs-2xs) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; text-decoration: underline !important; }

/* County labels on the map (collision-checked in js/app.js) */
.clabel-marker { background: none !important; border: 0 !important; }
.clabel {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 8px 3px 6px; border-radius: var(--radius-pill);
  background: var(--map-label-bg); color: var(--map-label-ink);
  font-size: var(--fs-2xs); line-height: 1.3; box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transition: opacity var(--dur);
}
.clabel b { font-weight: var(--fw-bold); }
.clabel span { color: var(--map-label-ink-2); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.clabel i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); flex-shrink: 0; box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }
.clabel.is-selected { outline: 2px solid #fff; font-size: var(--fs-xs); }
.clabel.is-hidden { opacity: 0; pointer-events: none; }
/* No room even for the name: a coloured dot, named on hover */
.clabel.is-dot { padding: 0; gap: 0; background: none; box-shadow: none; }
.clabel.is-dot i { width: 10px; height: 10px; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.45); }
.clabel.is-dot b, .clabel.is-dot span { display: none; }
.clabel.is-compact { padding: 1px 5px; font-size: var(--fs-2xs); gap: 3px; opacity: .92; }
.clabel.is-compact span { display: none; }
.clabel.is-compact i { width: 6px; height: 6px; }
.leaflet-marker-icon.clabel-marker:hover { z-index: 9999 !important; }

.leaflet-tooltip.map-tip {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 10px var(--sp-3); min-width: 190px;
}
.leaflet-tooltip.map-tip::before { display: none; }
.tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.tip-name { font-weight: var(--fw-heavy); font-size: var(--fs-base); }
.tip-prov { font-size: var(--fs-2xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.tip-price { font-size: var(--fs-lg); font-weight: var(--fw-heavy); margin: 2px 0; font-variant-numeric: tabular-nums; }
.tip-price small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); }
.tip-row { display: flex; justify-content: space-between; gap: 18px; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.tip-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tip-verdict { margin-top: var(--sp-2); }
.tip-hint { font-size: var(--fs-2xs); color: var(--ink-3); margin-top: 6px; }

/* Market and Trends views */
.market { min-height: calc(100vh - var(--topbar-h)); }
.market-inner { max-width: 1120px; margin: 0 auto; padding: 36px var(--sp-6) 60px; display: flex; flex-direction: column; gap: 36px; }
.m-hero h1, .m-hero h2 { font-size: var(--fs-display); letter-spacing: -0.03em; max-width: 22ch; }
.m-hero p { font-size: var(--fs-lg); color: var(--ink-2); max-width: 64ch; margin: var(--sp-3) 0 0; }
.m-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.m-section h2 { font-size: var(--fs-2xl); }
.m-section > p { color: var(--ink-2); margin: 6px 0 var(--sp-4); max-width: 70ch; }
.m-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }

.ctable-wrap { overflow: auto; }
.ctable { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.ctable caption { text-align: left; }
.ctable th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: var(--fw-bold); padding: var(--sp-3) 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.ctable th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: var(--sp-1); }
.ctable th[aria-sort] button { color: var(--ink); }
.ctable td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ctable td.num, .ctable th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ctable tbody tr { cursor: pointer; }
.ctable tbody tr:hover { background: var(--surface-2); }
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctable .county-cell { font-weight: var(--fw-bold); }
.ctable .county-cell small { display: block; font-weight: 500; color: var(--ink-3); font-size: var(--fs-xs); }
.gapbar { position: relative; width: 180px; height: 10px; border-radius: var(--radius-pill); background: var(--surface-2); }
.gapbar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-pill); }
.gapbar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.cmp-card { padding: 18px; display: flex; flex-direction: column; gap: var(--sp-3); }
.cmp-card .select { width: 100%; font-weight: var(--fw-bold); font-size: var(--fs-base); height: 44px; }
.cmp-card > .verdict { align-self: flex-start; }
.cmp-rows { display: flex; flex-direction: column; }
.cmp-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: var(--fs-md); color: var(--ink-2); }
.cmp-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.cmp-row.win strong::after { content: ' ●'; color: var(--good); font-size: var(--fs-2xs); vertical-align: middle; }

.t-loading { color: var(--ink-3); padding: var(--sp-8) 0; }
.t-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: calc(var(--sp-3) * -1); font-size: var(--fs-md); }
.t-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.t-card { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.t-card.t-wide, #t-long, #t-ratio { grid-column: 1 / -1; }
.t-card header h2 { font-size: var(--fs-lg); }
.t-card header p { margin: var(--sp-1) 0 0; color: var(--ink-2); font-size: var(--fs-md); max-width: 72ch; }
.t-card h3 { font-size: var(--fs-md); color: var(--ink-2); margin-bottom: 6px; }
.t-source { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.45; border-top: 1px solid var(--line); padding-top: 10px; }
.t-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.t-select { display: inline-flex; align-items: center; gap: var(--sp-2); margin-top: 10px; font-weight: var(--fw-medium); font-size: var(--fs-md); }
.t-select .select { min-width: 160px; }

.lc { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.lc-legend { display: flex; flex-wrap: wrap; gap: 6px var(--sp-4); font-size: var(--fs-sm); color: var(--ink-2); }
.lc-key { display: inline-flex; align-items: center; gap: 6px; }
.lc-key i { width: 16px; height: 2px; border-radius: 2px; display: inline-block; }
.lc-key i.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; color: var(--ink-3); }
.lc-plot { position: relative; width: 100%; }
.lc-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.lc-gridline { stroke: var(--grid); stroke-width: 1; }
.lc-base { stroke: var(--axis); stroke-width: 1; }
.lc-ytick, .lc-xtick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-line.dash { stroke-dasharray: 5 4; stroke-width: 1.5; }
.lc-ref { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.lc-reflabel { fill: var(--ink-2); font-size: 11px; font-weight: var(--fw-medium); }
.lc-band { fill: var(--ink); opacity: .045; }
.lc-bandlabel { fill: var(--ink-3); font-size: 11px; font-weight: var(--fw-medium); }
.lc-note-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.lc-note { fill: var(--ink); font-size: 11px; font-weight: var(--fw-bold); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.lc-enddot { stroke: var(--surface); stroke-width: 2; }
.lc-leader { stroke: var(--ink-3); stroke-width: 1; fill: none; }
.lc-endval { fill: var(--ink); font-size: 12px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.lc-endname { fill: var(--ink-3); font-size: 11px; }
.lc-cross { stroke: var(--ink-3); stroke-width: 1; }
.lc-hoverdot { stroke: var(--surface); stroke-width: 2; }
.lc-hit { cursor: crosshair; outline: none; }
.lc-hit:focus-visible { outline: none; }
.lc-plot:has(.lc-hit:focus-visible) { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--radius-xs); }
.lc-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); padding: var(--sp-2) 10px; font-size: var(--fs-sm); }
.lc-tip-x { font-weight: var(--fw-bold); color: var(--ink-2); margin-bottom: var(--sp-1); }
.lc-tip-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: var(--sp-2); padding: 1px 0; }
.lc-tip-row i { width: 14px; height: 2px; border-radius: 2px; }
.lc-tip-row strong { font-variant-numeric: tabular-nums; }
.lc-tip-row span { color: var(--ink-3); white-space: nowrap; }
.lc-tip-extra { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); color: var(--ink-2); }
.lc-table summary { cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-2); width: max-content; }
.lc-table-scroll { max-height: 260px; overflow: auto; margin-top: var(--sp-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lc-table table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
.lc-table th, .lc-table td { padding: 5px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lc-table th:first-child, .lc-table td:first-child { text-align: left; }
.lc-table th { position: sticky; top: 0; background: var(--surface); color: var(--ink-3); font-weight: var(--fw-bold); }

/* Method dialog */
.method { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 48px); border: 0; border-radius: 18px; padding: 28px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); }
.method::backdrop { background: rgba(0,0,0,.4); }
.method h2 { font-size: var(--fs-2xl); margin-bottom: 10px; }
.method h3 { font-size: var(--fs-lg); margin: var(--sp-5) 0 6px; }
.method p, .method li { color: var(--ink-2); font-size: var(--fs-base); }
.method ol, .method ul { padding-left: var(--sp-5); display: flex; flex-direction: column; gap: 6px; }
.source-list li { font-size: var(--fs-md); }

/* ---------------------------------------------------------------------
   6. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 42%); }
  .m-tiles { grid-template-columns: repeat(2, 1fr); }
  .site-nav a { padding: 8px 9px; }
  .who-label { display: none; }
}
@media (max-width: 960px) {
  .tb-site .brand-name { display: none; }
}
@media (max-width: 900px) {
  .t-grid, .t-two { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  /* Phones: the header scrolls up until only its tools row (views, Buy/Rent) is left, stuck at the top */
  .topbar { top: var(--topbar-tuck, 0px); }
  .tb-row { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .tb-site { height: auto; flex-wrap: wrap; row-gap: 2px; padding-top: var(--sp-2); }
  .tb-site .brand { order: 0; }
  .tb-site .search { order: 1; flex: 1 1 0; max-width: none; min-width: 0; }
  .site-actions { order: 2; }
  .site-nav { order: 3; width: 100%; margin: 0 -8px; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 8px; font-size: var(--fs-md); flex: none; }
  .search input { height: 40px; }
  .icon-btn { width: 38px; height: 38px; }
  .tb-tools { height: 48px; overflow-x: auto; scrollbar-width: none; }
  .tb-tools::-webkit-scrollbar { display: none; }
  .view-tab { padding: 6px 7px; font-size: var(--fs-md); }
  .tb-tools { gap: 6px; }
  .view-tabs { gap: 0; }
  .mode-switch-btn { padding: 0 11px; height: 28px; }
  .who-btn { display: none; }
  .tools-homes { padding-left: 6px; }
  .split { height: auto; }
  .map-pane { display: none; position: fixed; left: 0; right: 0; bottom: 0; top: var(--topbar-h); border: 0; z-index: 800; }
  body.show-map .topbar { top: 0; }
  body.show-map .map-pane { display: block; }
  body.show-map .results { display: none; }
  .mobile-toggle {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: var(--z-topbar);   /* corner, so it covers less of the text (I-004) */
    height: 46px; padding: 0 var(--sp-5); border-radius: var(--radius-pill); border: 0;
    background: var(--primary); color: var(--on-primary); font-weight: var(--fw-bold); box-shadow: var(--shadow-3);
    transition: opacity var(--dur), transform var(--dur);
  }
  body.is-typing .mobile-toggle { opacity: 0; pointer-events: none; transform: translateY(16px); }
  .results { padding-bottom: 72px; }   /* the last item clears the Map button */

  .area-card { padding: 14px; gap: 12px; }
  .area-card .card-title { font-size: var(--fs-xl); }
  .figs { gap: var(--sp-3); }
  .figs dd { font-size: var(--fs-lg); }

  .areas { grid-template-columns: 1fr; }
  .acard { padding: var(--sp-3) 14px; }
  .legend { left: 10px; bottom: 84px; }
  .compare { grid-template-columns: 1fr; }
  .market-inner { padding: var(--sp-6) 14px 60px; gap: 28px; }
  .tile strong { font-size: var(--fs-2xl); }
  .gapbar { width: 110px; }
  .t-card { padding: 14px; }
  .foot-grid, .foot-grid nav { grid-template-columns: 1fr; }
  .home-intro h1 { font-size: var(--fs-xl); }
}
@media (max-width: 480px) {
  .m-tiles { grid-template-columns: 1fr 1fr; }
  .map-seg button { padding: 6px 10px; }
  .mode-switch-btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* "What can you afford?": a compact strip above the map (on phones, at the top of the page) */
.side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.side .map-pane { flex: 1; min-height: 0; border-left: 0; isolation: isolate; }
.my-numbers { position: relative; z-index: 2; padding: 12px var(--sp-4) 10px; background: var(--surface); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.mn-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.mn-head h2 { font-size: var(--fs-lg); margin-right: auto; }
.mn-who { min-width: 220px; }
.mn-who button { padding: 5px 10px; }
#mn-clear { white-space: nowrap; }
.mn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 34%); grid-template-areas: "fields result" "row result"; gap: 10px; align-items: stretch; }
.mn-grid .mn-fields { grid-area: fields; }
.mn-grid .mn-row { grid-area: row; }
.mn-grid .mn-result { grid-area: result; }
.mn-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: end; }
.mn-fields.three { grid-template-columns: 1fr 1fr 1fr; }
.mn-fields .field { gap: 4px; }
.mn-fields .field-label small { font-weight: var(--fw-regular); color: var(--ink-3); }
.mn-fields .money input { padding: 7px 10px 7px 4px; }
.mn-row { display: flex; align-items: center; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; }
.mn-schemes { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mn-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: var(--fs-md); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap; }
.mn-chip:hover { border-color: var(--ink); }
.mn-chip:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.mn-chip:has(input:disabled) { opacity: .5; cursor: not-allowed; }
/* The whole chip is the tap target: the real checkbox covers it, invisibly; the box is drawn */
.mn-chip { position: relative; }
.mn-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mn-chip span::before { content: ''; display: inline-block; vertical-align: -2px; width: 14px; height: 14px; margin-right: 6px; border: 1.5px solid var(--ink-3); border-radius: 4px; background: var(--surface) center / 10px no-repeat; }
.mn-chip:has(input:checked) span::before { border-color: var(--primary); background-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 5 5 9-10' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .mn-chip:has(input:checked) span::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 5 5 9-10' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mn-chip:has(input:checked) span::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 5 5 9-10' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }
.mn-chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* More options opens as a small panel over the map, so the map keeps its room */
.mn-more { position: relative; }
.mn-more summary { cursor: pointer; font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 4px; text-decoration: underline; text-underline-offset: 3px; }
.mn-more summary::-webkit-details-marker { display: none; }
.mn-more summary::after { content: ''; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); margin-left: 4px; }
.mn-more[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.mn-more summary:hover { color: var(--ink); }
.mn-more-body { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: calc(100vw - 32px); padding: var(--sp-4); display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
.mn-opt { display: flex; flex-direction: column; gap: 6px; }
.mn-opt .select { width: 100%; }
.mn-scheme-notes { border-top: 1px solid var(--line); padding-top: 10px; font-size: var(--fs-xs); color: var(--ink-3); }
.mn-scheme-notes p { margin: 0 0 4px; }
.mn-scheme-notes b { color: var(--ink-2); }
.mn-result { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); font-size: var(--fs-xs); line-height: 1.35; color: var(--ink-2); }
.mn-k { color: var(--ink-3); font-weight: var(--fw-medium); }
.mn-big { font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mn-big small { font-size: var(--fs-xs); color: var(--ink-3); }
.mn-sub b { color: var(--ink); }
.mn-why summary { cursor: pointer; width: max-content; padding: 4px 0; margin: 0 0 -4px; font-weight: var(--fw-medium); color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; list-style: none; }
.mn-why summary::-webkit-details-marker { display: none; }
.mn-why-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 3; width: 340px; max-width: calc(100vw - 32px); padding: 14px; font-size: var(--fs-sm); line-height: 1.5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
.mn-parts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.mn-parts li { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.mn-note { color: var(--ink-3); font-size: var(--fs-sm); margin: 6px 0 0; }
@media (max-width: 1100px) {
  .mn-who { min-width: 0; }
  .mn-grid { grid-template-columns: 1fr; grid-template-areas: "fields" "row" "result"; }
  .mn-result { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .mn-big { order: -1; }
}
@media (max-width: 820px) {
  /* Phones: page heading, then the calculator, then the cards; the map opens full screen */
  .split { display: flex; flex-direction: column; padding: var(--sp-3) var(--sp-3) 90px; }
  .results, .side { display: contents; }
  .home-head { order: 0; }
  .my-numbers { order: 1; margin: 0 0 14px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); z-index: auto; }
  .results > :not(.home-head) { order: 2; }
  body.show-map .my-numbers { display: none; }
  .mn-head h2 { flex-basis: 100%; }
  .mn-who { width: 100%; }
  .mn-grid { grid-template-columns: 1fr; grid-template-areas: "fields" "row" "result"; }
  .mn-fields.three > :last-child { grid-column: 1 / -1; }
  .mn-why-body { position: static; width: auto; margin-top: 8px; box-shadow: none; }
  .mn-fields .field-label small { display: none; }
  .mn-more-body { position: static; width: auto; margin-top: 10px; box-shadow: none; }
  .mn-more[open] { flex-basis: 100%; order: 5; }
}
/* "Try a price" explorer in the summary card: the price, the slider with its marks, one result line,
   and the breakdown (upfront, mortgage, repayment, budget) behind a toggle */
.explorer { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.ex-label { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ink-2); }
.ex-value { font-size: var(--fs-2xl); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ex-slider { position: relative; padding: 10px 0 0; }
.ex-track { position: absolute; left: 0; right: 0; top: 19px; height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.ex-fill { height: 100%; border-radius: var(--radius-pill); transition: background-color .2s; }
.ex-slider input[type="range"] { position: relative; z-index: 2; width: 100%; height: 26px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.ex-slider input[type="range"]::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.ex-slider input[type="range"]::-moz-range-track { height: 26px; background: transparent; }
.ex-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-1), 0 0 0 4px color-mix(in srgb, var(--surface) 70%, transparent); }
.ex-slider input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-1); }
.ex-slider input[type="range"]:focus-visible { outline: none; }
.ex-slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 45%, transparent); }
.ex-slider input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 45%, transparent); }
.ex-marks { position: relative; height: 38px; margin-top: 0; }
.ex-mark { position: absolute; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.2; cursor: pointer; white-space: nowrap; }
.ex-mark i { position: absolute; z-index: 1; left: -1px; top: 0; width: 2px; height: 8px; background: var(--line-strong); border-radius: 1px; }
.ex-mark span { position: absolute; z-index: 2; top: 10px; left: 0; display: flex; flex-direction: column; align-items: center; padding: 1px 4px; border-radius: var(--radius-sm); background: var(--surface); }
.ex-mark b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ex-mark.no-label span { display: none; }
.ex-mark.is-main, .ex-mark.is-main b { color: var(--ink); font-weight: var(--fw-bold); }
.ex-mark.is-main i { background: var(--ink); }
.ex-mark.is-budget { font-weight: var(--fw-bold); }
.ex-mark.is-budget i { width: 3px; left: -1.5px; background: var(--ink); }
.ex-mark.is-budget span { background: var(--primary); color: var(--on-primary); }
.ex-mark.is-budget b { color: var(--on-primary); }
.ex-mark:hover span { background: var(--surface-2); color: var(--ink); }
.ex-mark.is-budget:hover span { background: var(--primary); color: var(--on-primary); filter: brightness(1.2); }
.ex-mark:focus-visible { outline: none; } .ex-mark:focus-visible span { outline: 2px solid var(--focus); }
.ex-result { display: grid; gap: var(--sp-2); }
.ex-out { margin: 0; display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-md); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ex-out b { color: var(--ink); }
.ex-ic { flex: none; width: 20px; height: 20px; margin-top: -1px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ex-more summary { width: max-content; cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.ex-more summary:hover { color: var(--ink); }
.ex-cells { margin-top: var(--sp-2); display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ex-cell { background: var(--surface); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.ex-cell span { font-size: var(--fs-xs); color: var(--ink-3); font-weight: var(--fw-medium); }
.ex-cell strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.ex-cell small { font-size: var(--fs-xs); color: var(--ink-3); }
.ex-note { grid-column: 1 / -1; margin: 0; background: var(--surface); padding: 8px 14px; font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 720px) { .ex-cells { grid-template-columns: 1fr 1fr; } .ex-value { font-size: var(--fs-xl); } }

/* A real home or a place selected on the map, and the "homes sold here" chips */
.sale-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: var(--fs-xs); color: var(--ink-3); margin: 0; }
.sale-foot .link-btn { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink); }
.recent-sales { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.recent-sales > span { color: var(--ink-3); margin-right: 2px; }
.sale-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-2); font: inherit; cursor: pointer; max-width: 100%; }
.sale-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sale-chip i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-strong); flex: none; }
.sale-chip:hover { border-color: var(--ink); color: var(--ink); }
.pin-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 2px #fff; flex: none; }
#area-summary { scroll-margin-top: 12px; }
@media (max-width: 820px) { #area-summary, #my-numbers { scroll-margin-top: 60px; } }

/* Home: the page heading above the calculator */
.home-intro { margin: 2px 0 14px; }
.home-intro h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; line-height: 1.15; }
.home-intro h1 span { color: var(--ink-2); }
.home-intro p { margin: 6px 0 0; color: var(--ink-2); font-size: var(--fs-md); max-width: 60ch; }
/* Home: the site footer at the end of the left panel */
.data-asof { margin: var(--sp-6) 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
.results .site-foot { margin-top: var(--sp-4); padding: var(--sp-5) 0 var(--sp-3); border-top: 1px solid var(--line); font-size: var(--fs-md); color: var(--ink-2); background: none; }
.results .site-foot .wrap { padding: 0; max-width: none; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--sp-5); }
.foot-grid p { margin: 0 0 8px; }
.foot-grid nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--sp-4); align-content: start; }
.foot-grid nav a { color: var(--ink); }
.foot-brand { font-size: var(--fs-lg); } .foot-brand b { font-weight: var(--fw-heavy); }
.foot-small { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--ink-3); }
.sr-item span i { display: block; font-style: normal; font-size: var(--fs-xs); color: var(--ink-3); }
.place-tip { font-weight: var(--fw-bold); }
/* Phones, last so they win over the calculator's base rules above */
@media (max-width: 820px) {
  .mn-schemes { gap: 6px; }
  .mn-chip { padding: 0 8px; }
  .mn-chip span::before { margin-right: 5px; }
  .mn-result { flex-direction: column; align-items: flex-start; justify-content: flex-start; }
  .mn-big { order: 0; }
}
@media (max-width: 400px) {
  /* Two equal scheme chips side by side; a long name wraps inside its chip */
  .mn-schemes { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .mn-chip { height: auto; min-height: 40px; padding: 6px 10px; border-radius: var(--radius); white-space: normal; line-height: 1.25; }
  .mn-chip span { display: flex; align-items: center; }
  .mn-chip span::before { flex: none; }
}

/* =====================================================================
   7. HomeScope.ie brand (docs/brand/): an emerald band with the brass mark, serif headings,
   parchment surfaces, brass rules. Data colours (verdicts, price ramp) are unchanged.
   ===================================================================== */
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair-display-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* Serif for headings; figures stay in the sans with tabular numbers, so they line up */
.card-title, .mn-head h2, .results-head h2, .acard-head h3, .m-hero h2, .m-section h2, .t-card header h2, .method h2, .method h3, .foot-brand, .empty h3 {
  font-family: var(--font-serif); font-weight: 700; letter-spacing: 0;
}
.area-card .card-title { font-size: var(--fs-2xl); }
.mn-head h2, .results-head h2 { font-size: var(--fs-xl); }
.acard-head h3 { font-size: var(--fs-lg); }

/* Header: the site row is the emerald band, with a brass rule under it */
.tb-site { --focus: var(--brass-hi); background: var(--brand); color: var(--on-brand); border-bottom: 2px solid var(--brass); }
.brand { gap: 12px; color: var(--on-brand); }
.brand-mark { width: auto; height: auto; background: none; border-radius: 0; display: block; }
.brand-mark .mark { display: block; }
.brand-mark .h, .brand-mark .p { stroke: var(--brass-hi); }
.brand-mark .i { stroke: var(--brass); }
.brand-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .14em; color: var(--on-brand); }
.tb-site .search input { background: var(--surface); border-color: color-mix(in srgb, var(--on-brand) 18%, transparent); color: var(--ink); }
.tb-site .search input:focus { border-color: var(--brass-hi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass-hi) 45%, transparent); }
.tb-site .site-nav a { color: var(--on-brand-2); border-radius: 0; padding-left: 4px; padding-right: 4px; margin: 0 8px; }
.tb-site .site-nav a:hover { background: none; color: var(--on-brand); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--brass) 60%, transparent); }
.tb-site .site-nav a[aria-current="page"] { background: none; color: var(--on-brand); box-shadow: inset 0 -2px 0 var(--brass); }
.tb-site .icon-btn { color: var(--on-brand); }
.tb-site .icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--on-brand); }
.tb-site .badge { background: var(--brass-hi); color: #14201A; }

/* Tools row: parchment, emerald for what's chosen */
.tb-tools { background: var(--surface); }
.view-tab.is-active { background: color-mix(in srgb, var(--primary) 9%, transparent); color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent); }
.mode-switch { background: var(--surface-2); }

/* Links and small actions in emerald, underlined in brass */
.link-btn, .county-page-link, .portal-link, .ex-more summary, .mn-why summary, .mn-more summary, .card-src a, .acard-title { color: var(--primary); text-decoration-color: color-mix(in srgb, var(--brass) 75%, transparent); }
.acard-title { color: var(--ink); }
.acard-title:hover { color: var(--primary); text-decoration-color: var(--brass); }
.eyebrow { color: var(--brass-ink); }

/* Cards: parchment paper with a brass rule on the summary */
.area-card { border-top: 3px solid var(--brass); box-shadow: var(--shadow-1); }
.acard { transition: box-shadow var(--dur), border-color var(--dur); }
.acard:hover { border-color: color-mix(in srgb, var(--brass) 55%, transparent); box-shadow: var(--shadow-2); }
.pt-here { fill: var(--primary); }
.pl-badge { background: var(--primary); color: var(--on-primary); }
.explorer, .acard-links, .acard-extra { border-top-color: color-mix(in srgb, var(--brass) 35%, var(--line)); }

/* "What can you afford?": the answer sits on emerald, the figure in brass */
.my-numbers { background: var(--surface) var(--texture); }
.mn-result { background: var(--brand); color: var(--on-brand-2); }
.mn-result .mn-k { color: var(--on-brand-2); }
.mn-result .mn-big, .mn-result .mn-big small { color: var(--brass-hi); }
.mn-result .mn-sub b { color: var(--on-brand); }
.mn-result .mn-why summary { color: var(--on-brand); text-decoration-color: var(--brass); }
.mn-result { --focus: var(--brass-hi); }
.mn-why-body { color: var(--ink-2); }
.mn-chip:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.seg button[aria-checked="true"] { color: var(--primary); }
.money:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }

/* Slider */
.ex-slider input[type="range"]::-webkit-slider-thumb { border-color: var(--primary); }
.ex-slider input[type="range"]::-moz-range-thumb { border-color: var(--primary); }
.ex-mark.is-main i, .ex-mark.is-budget i { background: var(--primary); }

/* Map: controls on parchment, county labels on deep emerald with brass figures */
#map, .leaflet-container { background: var(--surface-2); }
.clabel { box-shadow: 0 2px 8px rgba(20, 24, 28, .35); }
.clabel.is-selected { outline-color: var(--brass-hi); }

/* Footer: an emerald block at the end of the list */
.results .site-foot { margin: var(--sp-5) calc(var(--sp-5) * -1) 0; padding: var(--sp-6) var(--sp-5) var(--sp-5); background: var(--brand); color: var(--on-brand-2); border-top: 3px solid var(--brass); }
.results .site-foot a, .results .site-foot .foot-grid nav a { color: var(--on-brand); text-decoration-color: color-mix(in srgb, var(--brass) 70%, transparent); }
.results .site-foot .foot-brand { color: var(--on-brand); font-size: var(--fs-xl); }
.results .site-foot .foot-brand b { font-weight: 700; color: var(--brass-hi); }
.results .site-foot .foot-small { color: var(--on-brand-2); }
.results .site-foot { --focus: var(--brass-hi); }

/* Phone: the Map button in emerald (brass in dark mode) */
.mobile-toggle { box-shadow: 0 10px 30px rgba(10, 40, 20, .35); }
@media (max-width: 820px) {
  .tb-site .site-nav a { margin: 0 4px; padding: 8px 4px; }
  .results .site-foot { margin: var(--sp-5) calc(var(--sp-3) * -1) 0; }
}

/* News view: headlines from Irish newsrooms and official releases, linking out */
.news-inner { max-width: 860px; gap: var(--sp-5); }
.news-head h2 { font-family: var(--font-serif); font-size: var(--fs-2xl); }
.news-head p { margin: var(--sp-2) 0 0; color: var(--ink-2); max-width: 68ch; }
.news-callout { display: block; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--brass) 60%, transparent); border-left: 4px solid var(--brass); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.news-callout b { color: var(--ink); }
.news-callout:hover { border-color: var(--brass); color: var(--ink); }
.seg-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.seg-chips button { height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-2); font-size: var(--fs-md); font-weight: var(--fw-medium); }
.seg-chips button:hover { border-color: var(--ink); color: var(--ink); }
.seg-chips button[aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.news-item { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: var(--sp-4); align-items: start; padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.news-item .news-art { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 560px) { .news-item { grid-template-columns: 96px minmax(0, 1fr); gap: var(--sp-3); } .news-item .news-h { font-size: var(--fs-base); } }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--fs-xs); color: var(--ink-3); }
.news-source { font-weight: var(--fw-bold); color: var(--brass-ink); text-transform: uppercase; letter-spacing: .05em; }
.news-official { margin-left: 4px; padding: 1px 6px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); text-transform: none; letter-spacing: 0; }
.news-topic { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2); }
.news-item .news-h { margin: 6px 0 4px; font-family: var(--font-serif); font-size: var(--fs-lg); line-height: 1.3; }
.news-item .news-h a { color: var(--ink); text-decoration: none; }
.news-item .news-h a:hover { color: var(--primary); text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 3px; }
.news-item .news-h svg { margin-left: 6px; color: var(--ink-3); vertical-align: -1px; }
.news-item p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.news-empty { padding: var(--sp-5) 0; color: var(--ink-3); }
.news-foot { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
@media (max-width: 480px) {
  /* Four views and Buy/Rent don't fit a phone row: Buy/Rent first, the views scroll */
  .tools-homes { order: -1; padding-left: 0; border-left: 0; padding-right: 6px; border-right: 1px solid var(--line); }
  .tb-tools { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
}

/* Summary card, compact: title and province on one line, one source line, one-line slider marks,
   the result and "Breakdown" on one row */
.area-card { padding: 14px 18px; gap: 10px; }
.ac-titles { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; min-width: 0; }
.ac-titles .eyebrow { margin: 0; }
.area-card .card-title { font-size: var(--fs-xl); }
.ac-head { align-items: center; }
.figs { gap: var(--sp-3); }
.figs dd { margin-top: 0; font-size: var(--fs-lg); }
.card-src { margin-top: -4px; }
.recent-sales { gap: 4px 6px; font-size: var(--fs-xs); }
.sale-chip { padding: 2px 9px; gap: 5px; }
.sale-chip i { width: 8px; height: 8px; }
.explorer { gap: 4px; padding-top: 8px; }
.ex-value { font-size: var(--fs-xl); }
.ex-slider { padding-top: 4px; }
.ex-track { top: 13px; }
.ex-mark span { flex-direction: row; gap: 4px; white-space: nowrap; }
.ex-result { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.ex-more[open] { flex-basis: 100%; }
.ex-cells { margin-top: 6px; }
@media (max-width: 820px) { .area-card { padding: 12px 14px; } }
/* The price you're trying leads the result line; the slider's label sits above its left end */
.ex-label { display: block; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.ex-slider .ex-track { top: 13px; }
.ex-out { align-items: center; gap: 10px; }
.ex-out .ex-value { font-size: var(--fs-lg); color: var(--ink); white-space: nowrap; }
#ex-out { display: inline-flex; align-items: flex-start; gap: var(--sp-2); }

/* News pictures: our own illustrations (public/js/news-art.js), in the brand colours, themed */
.news-art { --art-sky: #EFE7D2; --art-ground: #DCCFB0; --art-paper: #FFFDF7; --art-line: #4A5560; --art-em: #0B6623; --art-brass: #C8A951; --art-slate: #5E6B76; --art-brick: #B9674B; --art-blue: #3E6A8F; --art-red: #C0392B; }
:root[data-theme="dark"] .news-art { --art-sky: #20252A; --art-ground: #2A3036; --art-paper: #3A424A; --art-line: #C9C2AE; --art-em: #2F8F4E; --art-slate: #77838E; --art-brick: #9C5A43; --art-blue: #34587A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .news-art { --art-sky: #20252A; --art-ground: #2A3036; --art-paper: #3A424A; --art-line: #C9C2AE; --art-em: #2F8F4E; --art-slate: #77838E; --art-brick: #9C5A43; --art-blue: #34587A; } }
.news-art svg { display: block; width: 100%; height: 100%; }
.news-art .a-sky { fill: var(--art-sky); } .news-art .a-ground { fill: var(--art-ground); }
.news-art .a-paper { fill: var(--art-paper); } .news-art .a-stroke { stroke: var(--art-line); stroke-width: 1.5; }
.news-art .a-em { fill: var(--art-em); } .news-art .a-brass { fill: var(--art-brass); } .news-art .a-slate { fill: var(--art-slate); }
.news-art .a-brick { fill: var(--art-brick); } .news-art .a-blue { fill: var(--art-blue); }
.news-art .a-line { fill: none; stroke: var(--art-line); stroke-width: 2; stroke-linecap: round; }
.news-art .a-axis { fill: none; stroke: var(--art-line); stroke-width: 2; stroke-linecap: round; opacity: .55; }
.news-art .a-trend { fill: none; stroke: var(--art-brass); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.news-art .a-post { fill: var(--art-line); }
.news-art .a-sign, .news-art .a-stamp-t, .news-art .a-tag-t { font: 700 8.5px/1 system-ui, sans-serif; letter-spacing: .04em; }
.news-art .a-sign { fill: #FFFDF7; font-size: 7.5px; }
.news-art .a-tick { fill: none; stroke: #FFFDF7; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.news-art .a-key { fill: none; stroke: var(--art-brass); stroke-width: 6; }
.news-art .a-handle { fill: none; stroke: var(--art-em); stroke-width: 5; }
.news-art .a-euro { font: 700 34px/1 Georgia, serif; fill: var(--art-brass); }
.news-art .a-coin { fill: var(--art-brass); stroke: #8A6F25; stroke-width: 1; }
.news-art .a-grid { stroke: rgba(255, 255, 255, .18); stroke-width: 1; }
.news-art .a-plan { fill: none; stroke: #FFFDF7; stroke-width: 2.5; stroke-linejoin: round; }
.news-art .a-stamp { fill: var(--art-paper); fill-opacity: .9; stroke: var(--art-em); stroke-width: 3; }
.news-art .a-stamp-t { fill: var(--art-em); font-size: 6.2px; letter-spacing: .02em; }
.news-art .a-pct { font: 700 78px/1 Georgia, serif; fill: var(--art-em); }
.news-art .a-up { fill: none; stroke: var(--art-brass); stroke-width: 6; stroke-linecap: round; }
.news-art .a-window { fill: var(--art-paper); opacity: .9; }
.news-art .a-string { fill: none; stroke: var(--art-line); stroke-width: 1.5; }
.news-art .a-tag { fill: var(--art-brass); }
.news-art .a-tag-t { fill: #1F2A24; }
.news-art .a-lattice { fill: none; stroke: #8A6F25; stroke-width: 1.2; }
.news-art .a-frame { fill: none; stroke: var(--art-slate); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }

/* One menu (the site nav, in the header). The home page's heading, with Buy/Rent beside it,
   leads the left column; News and Historical have their own heading. */
.home-head { margin: 0 0 14px; }
.home-head h1 { font-family: var(--font-serif); font-size: var(--fs-2xl); line-height: 1.15; }
.home-head p { margin: 4px 0 10px; color: var(--ink-2); font-size: var(--fs-md); max-width: 60ch; }
.home-head .tools-homes { padding: 0; border: 0; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.view-head h1, .news-head h1 { font-family: var(--font-serif); font-size: var(--fs-2xl); }
.view-head { max-width: 1120px; margin: 0 auto; padding: 32px var(--sp-6) 0; }
.view-head p { margin: var(--sp-2) 0 0; color: var(--ink-2); }
.view-head + .market-inner { padding-top: 20px; }
@media (max-width: 820px) {
  .home-head { order: 0; }
  .home-head h1 { font-size: var(--fs-xl); }
  .view-head { padding: var(--sp-5) 14px 0; }
  /* the menu row stays at the top as you scroll */
  .tb-site { padding-bottom: 0; }
}
@media (max-width: 820px) { .tb-site .site-nav a { margin: 0; padding: 8px 5px; } }
@media (max-width: 380px) { .tb-site .site-nav a { padding: 8px 3px; font-size: var(--fs-sm); } }
.market-inner > .m-hero h1 { font-family: var(--font-serif); }

/* ---- the "Try a price" slider drives the card and the map */
.figs .fig-sub { display: block; margin-top: 1px; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); letter-spacing: 0; line-height: 1.35; }
.ex-schemes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 2px; }
.ex-schemes .mn-chip { height: 30px; font-size: var(--fs-sm); }
.ex-sch-note { font-size: var(--fs-xs); color: var(--ink-3); }
.legend-vs { font-weight: var(--fw-bold); color: var(--ink); }
.legend-reset { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-pill); padding: 2px 10px; font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-bold); cursor: pointer; }
.legend-reset:hover { background: var(--surface-2); }
.legend-reset:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- the list's switch: Counties | Recently sold */
.list-switch { margin-bottom: var(--sp-3); }
.list-switch[hidden] { display: none; }
.sold-card .sold-addr { margin: 0; font-size: var(--fs-lg); line-height: 1.25; overflow-wrap: anywhere; }
.sold-kind { flex-shrink: 0; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-2); white-space: nowrap; }
.sold-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: var(--sp-2) 0; }
.sold-card .pl-go .link-btn { font-weight: var(--fw-bold); }

/* Rent mode: the deposit and the buying schemes step aside */
.mn-buy-only[hidden] { display: none !important; }
#map.towns-on .clabel > span { display: none; }   /* county name only while the towns show */
.pin-dot.is-none { background: var(--ink-3); }
.legend-row .pin-dot:not(.is-none) { background: var(--brass); }

/* ---- an address picked in search: its own sales, at the top of the area card */
.addr-box { margin: -4px 0 16px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: var(--radius); }
.addr-head { display: flex; justify-content: space-between; align-items: center; }
.addr-title { margin: 2px 0 6px; font-family: var(--font-serif); font-size: var(--fs-lg); line-height: 1.25; }
.addr-sales { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.addr-sales li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: var(--fs-sm); }
.addr-sales b { font-variant-numeric: tabular-nums; }
.addr-meta { color: var(--ink-3); font-size: var(--fs-xs); }
.addr-note { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.45; }

/* ---- town labels (zoomed in): name and median */
.tlabel { position: absolute; left: 0; bottom: 10px; transform: translateX(-50%); display: inline-flex; gap: 5px; align-items: baseline; padding: 2px 7px; border-radius: 999px; background: var(--map-label-bg); color: var(--map-label-ink); font-size: 11.5px; line-height: 16px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: pointer; }
.tlabel b { font-weight: 700; }
.tlabel span { color: var(--brass-hi); font-weight: 700; font-variant-numeric: tabular-nums; }
.place-tip small { opacity: .8; }

/* ---- Desktop: a shorter top of the left column, so more of the list shows on arrival.
   The heading sits right above the card with Buy/Rent beside it. */
@media (min-width: 821px) {
  .home-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-4); margin: 0 0 10px; }
  .home-head h1 { grid-column: 1; }
  .home-head p { grid-column: 1; margin: 3px 0 0; font-size: var(--fs-sm); max-width: none; }
  .home-head .tools-homes { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; }
  .area-card { padding: 12px 18px 14px; gap: 8px; }
  .card-src { max-width: none; }
  .ex-schemes .mn-chip { height: 28px; }
  .ex-out { font-size: var(--fs-sm); }
}
@media (min-width: 821px) {
  .home-head p { text-wrap: balance; }
  /* "Breakdown" sits at the end of the result line until it's opened */
  .ex-result { flex-wrap: wrap; align-items: flex-end; }
  .ex-result .ex-out { flex: 1 1 360px; min-width: 0; }
  .ex-result .ex-more:not([open]) { flex: none; margin-bottom: 2px; }
}

/* Help to Buy and First Home Scheme sit in the card's top right, beside the title and the figures */
.ac-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--sp-3) var(--sp-5); }
.ac-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ac-schemes:empty { display: none; }
.ac-schemes .ex-schemes { flex-direction: column; align-items: stretch; gap: 6px; margin: 0; max-width: 210px; }
.ac-schemes .mn-chip { height: 30px; }
.ac-schemes .ex-sch-note { line-height: 1.3; text-align: center; }
@media (max-width: 820px) {
  .ac-top { grid-template-columns: minmax(0, 1fr); }
  .ac-schemes .ex-schemes { flex-direction: row; flex-wrap: wrap; align-items: center; max-width: none; }
  .ac-schemes .ex-sch-note { text-align: left; }
}
/* "Latest sold" / "By county" lead the row of list tools, under the heading and note */
.list-tools .list-switch { margin: 0; }
.list-tools #results-count { font-size: var(--fs-sm); }

/* The card is the three figures and the slider; the result line, the numbers behind it and the
   sources sit in "Breakdown" (closed by default, on the right under the slider) */
.area-card .explorer { border-top: 0; padding-top: 2px; }
.ex-result { display: block; }
.ex-more summary { margin-left: auto; }
.ex-more[open] .ex-out { margin-top: 8px; }
.ex-more .ex-src { margin: 8px 0 0; }

/* Breakdown's summary is pulled up beside the slider labels (layoutMarks); the empty strip of its
   box mustn't block clicks on those labels */
.ex-result { pointer-events: none; position: relative; z-index: 3; }
.ex-more > summary, .ex-more[open] > :not(summary) { pointer-events: auto; }
.ex-more > summary { width: max-content; }

/* ---- The map key, compact: one short line; the notes open from "i" */
.legend { padding: 4px 4px 4px 10px; font-size: 11px; line-height: 1.2; max-width: min(560px, calc(100% - 76px)); }
.legend-line { gap: 3px 8px; }
.legend-row { gap: 4px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .sw svg { width: 8px; height: 8px; }
.legend-info { width: 20px; height: 20px; font-size: 11px; }
.legend-reset { padding: 1px 8px; font-size: 11px; }
.legend-more { font-size: 11px; max-width: 54ch; }
.legend-size svg { display: block; overflow: visible; }
.legend-size circle { fill: var(--ink-3); fill-opacity: .35; stroke: var(--ink-2); stroke-width: 1; }

/* ======================================================================
   Insights view (js/insights.js): the Property Price Register in charts
   ====================================================================== */
:root {
  /* price bands, cheapest (light) to dearest (dark): one hue, validated as an ordinal ramp */
  --band-0: #80c092; --band-1: #57a970; --band-2: #2f8550; --band-3: #1d703d; --band-4: #0b5126;
  --band-t0: #10301b; --band-t1: #10301b; --band-t2: #fff; --band-t3: #fff; --band-t4: #fff;
  --ib-bar: #368e55; --ib-mark: #0b5126;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --band-0: #2a7a45; --band-1: #3d9659; --band-2: #5bb274; --band-3: #82cb95; --band-4: #b3e2bf; --band-t0: #fff; --band-t1: #0d1a12; --band-t2: #0d1a12; --band-t3: #0d1a12; --band-t4: #0d1a12; --ib-bar: #5bb274; --ib-mark: #b3e2bf; } }
:root[data-theme="dark"] { --band-0: #2a7a45; --band-1: #3d9659; --band-2: #5bb274; --band-3: #82cb95; --band-4: #b3e2bf; --band-t0: #fff; --band-t1: #0d1a12; --band-t2: #0d1a12; --band-t3: #0d1a12; --band-t4: #0d1a12; --ib-bar: #5bb274; --ib-mark: #b3e2bf; }

#insights { padding-bottom: 0; }
#trends.i-long { padding-top: 0; }
#trends.i-long .m-hero h2 { font-size: var(--fs-2xl); max-width: 40ch; }
.i-hero h1 { max-width: 24ch; }
.i-jump { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: var(--sp-4); }
.i-jump a { padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: var(--fw-medium); text-decoration: none; }
.i-jump a:hover { background: var(--surface-2); }
.i-sec { display: flex; flex-direction: column; gap: var(--sp-4); scroll-margin-top: 80px; }
.i-sec > h2 { font-family: var(--font-serif); font-size: var(--fs-2xl); scroll-margin-top: 80px; }
.i-long-h { margin: 0; padding-top: var(--sp-5); border-top: 1px solid var(--line); scroll-margin-top: 80px; font-size: var(--fs-sm); font-weight: var(--fw-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--brass-ink, var(--ink-2)); }
.i-card header h3 { font-family: var(--font-serif); font-size: var(--fs-lg); }
.i-card header p { margin: var(--sp-1) 0 0; color: var(--ink-2); font-size: var(--fs-md); max-width: 72ch; }

/* bars with their values on them */
.ib { position: relative; }
.ib-plot { position: relative; height: var(--h, 180px); display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; padding-top: 16px; border-bottom: 1px solid var(--axis); margin-bottom: 20px; }
.ib-col { position: relative; height: 100%; outline: none; cursor: default; }
.ib-col i { position: absolute; left: 1px; right: 1px; bottom: 0; background: var(--ib-bar); border-radius: 4px 4px 0 0; }
.ib-col.is-part i { background: repeating-linear-gradient(135deg, var(--ib-bar) 0 3px, color-mix(in srgb, var(--ib-bar) 45%, transparent) 3px 6px); }
.ib-col.is-mark i { background: var(--ib-mark); }
.ib-col:hover i, .ib-col:focus-visible i { filter: brightness(1.15); }
.ib-col:focus-visible { box-shadow: 0 0 0 2px var(--focus); border-radius: 4px; }
.ib-val { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.ib-short { display: none; }
.ib.is-tight .ib-long { display: none; } .ib.is-tight .ib-short { display: inline; }
.ib.is-tight .ib-val { font-size: 10px; letter-spacing: -0.02em; }
.ib.is-bare .ib-val { display: none; }
.ib-x { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); font-size: 11px; line-height: 18px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ib-x.is-hidden { visibility: hidden; }
.ib-marker { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--ink-2); z-index: 1; pointer-events: none; }
.ib-marker span { position: absolute; top: -2px; left: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink); white-space: nowrap; background: var(--surface); padding: 0 4px; border-radius: 4px; }
.ib-tip, .is-stack .ib-tip { position: absolute; top: -6px; left: 0; z-index: 3; padding: 3px 9px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 12px; font-weight: 600; color: var(--ink); width: max-content; max-width: 100%; pointer-events: none; opacity: 0; transition: opacity .1s; }
.ib-tip.is-on { opacity: 1; }

/* price bands: 100% stacked columns */
.is-stack { position: relative; }
.is-key { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-sm); color: var(--ink-2); }
.is-key li { display: inline-flex; align-items: center; gap: 6px; }
.is-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.is-plot { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; height: 300px; }
.is-col { display: flex; flex-direction: column; min-width: 0; outline: none; }
.is-col:focus-visible .is-bar { box-shadow: 0 0 0 2px var(--focus); }
.is-bar { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px; overflow: hidden; }
.is-bar span { display: flex; align-items: center; justify-content: center; min-height: 0; }
.is-bar em { font-style: normal; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ib-b0 em { color: var(--band-t0); } .ib-b1 em { color: var(--band-t1); } .ib-b2 em { color: var(--band-t2); } .ib-b3 em { color: var(--band-t3); } .ib-b4 em { color: var(--band-t4); }
.ib-b0 { background: var(--band-0); } .ib-b1 { background: var(--band-1); } .ib-b2 { background: var(--band-2); } .ib-b3 { background: var(--band-3); } .ib-b4 { background: var(--band-4); }
.is-col .ib-x { position: static; transform: none; text-align: center; margin-top: 4px; }
.is-col:hover .is-bar { filter: brightness(1.08); }

/* rankings */
.ir-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ir-note { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.ir-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ir-list li { display: grid; grid-template-columns: 28px minmax(140px, 1.1fr) minmax(80px, 2fr) 11.5em;   /* fixed value column: every bar gets the same track */ align-items: center; gap: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ir-rank { font-size: var(--fs-sm); color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.ir-name { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.ir-name:hover { text-decoration: underline; }
.ir-name small { font-weight: 400; font-size: var(--fs-xs); color: var(--ink-3); }
.ir-bar { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.ir-bar i { display: block; height: 100%; background: var(--ib-bar); border-radius: 4px; }
.ir-bar i.is-neg { background: var(--ink-3); }
.ir-val { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.ir-val b { font-size: var(--fs-md); }
.ir-val small { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }
.ir-val .ir-mix { color: var(--warning-ink); font-weight: 600; white-space: normal; text-align: right; }   /* rise mostly from new homes (R3) */
.ir-more { align-self: flex-start; }
@media (max-width: 720px) { .ir-list li { grid-template-columns: 24px minmax(0, 1fr) auto; } .ir-bar { display: none; } }
@media (max-width: 720px) {
  .is-bar em { display: none; }
  .is-col:not(:nth-child(4n+1)) .ib-x { visibility: hidden; }
  .is-plot { height: 220px; }
}

/* ---- The card's verdict says what it judges: "Typical home here" (your numbers) or "At €450k" (the slider) */
.ac-vwrap { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ac-vlab { font-size: 11px; line-height: 1.1; font-weight: var(--fw-bold); letter-spacing: .02em; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 820px) { .ac-vwrap { align-items: flex-start; } }

/* ---- Under the slider: how many homes sold here went for that price or less, beside "Breakdown" */
.area-card .ex-result { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; margin-top: 2px; }
.ex-count { flex: 1 1 320px; margin: 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ex-count:empty { visibility: hidden; }   /* keeps its space while the sales load, so the card doesn't grow (R1) */
@media (min-width: 821px) { .ex-count { min-height: 4.2em; } }
@media (min-width: 1200px) { .ex-count { min-height: 2.8em; } }
.ex-count b { color: var(--ink); }
.area-card .ex-result .ex-more:not([open]) { flex: none; margin: 0 0 0 auto; }
.area-card .ex-result .ex-more[open] { flex-basis: 100%; }

/* ---- "In reach": where your numbers reach, as a short ranked list */
.reach-counties { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.7; }
.reach-counties > span { font-weight: var(--fw-bold); color: var(--ink); margin-right: 4px; }
.reach-counties small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.reach-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.reach-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.reach-name { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-weight: var(--fw-bold); text-align: left; cursor: pointer; }
.reach-name span { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brass) 75%, transparent); text-underline-offset: 3px; }
.reach-name small { font-weight: var(--fw-medium); color: var(--ink-3); }
.reach-name:hover { color: var(--ink); }
.reach-fig { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.reach-fig small, .reach-range small { color: var(--ink-3); font-size: var(--fs-xs); }
.reach-range { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mn-see { color: inherit; font-weight: var(--fw-bold); }
@media (max-width: 720px) { .reach-row { grid-template-columns: minmax(0, 1fr) auto; } .reach-range { display: none; } }
#areas > .reach-counties, #areas > .reach-list, #areas > .empty { grid-column: 1 / -1; }

/* ---------------------------------------------------------------------
   Desktop: one long page (trial). Home first, with the calculator and map pinned beside the card and
   the list until Home ends; then News; then Insights; the footer closes the page. Phones are unchanged.
   --------------------------------------------------------------------- */
.is-stacked .split { height: auto; min-height: calc(100vh - var(--topbar-h)); align-items: start; }
.is-stacked .results { overflow: visible; padding-bottom: var(--sp-7); }
.is-stacked .side { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); align-self: start; }
.is-stacked #area-summary, .is-stacked .results-head, .is-stacked #my-numbers { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.is-stacked .market { min-height: calc(100vh - var(--topbar-h)); border-top: 1px solid var(--line); }
.is-stacked #view-news { background: var(--surface); }
.is-stacked #view-news .news-inner { padding-bottom: 72px; }
.is-stacked .i-hero h2 { max-width: 24ch; }
.is-stacked .market-inner > .m-hero h2 { font-family: var(--font-serif); }
/* each section rises in as it arrives */
@media (prefers-reduced-motion: no-preference) {
  .is-stacked .reveal > .market-inner { opacity: 0; transform: translateY(32px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .is-stacked .reveal.is-in > .market-inner { opacity: 1; transform: none; }
}
/* the footer closes the whole page */
.is-stacked main > .site-foot { margin: 0; padding: var(--sp-7) 0 var(--sp-6); font-size: var(--fs-md); background: var(--brand); color: var(--on-brand-2); border-top: 3px solid var(--brass); --focus: var(--brass-hi); }
.is-stacked main > .site-foot .wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--sp-6); }
.is-stacked main > .site-foot a, .is-stacked main > .site-foot .foot-grid nav a { color: var(--on-brand); text-decoration-color: color-mix(in srgb, var(--brass) 70%, transparent); }
.is-stacked main > .site-foot .foot-brand { color: var(--on-brand); font-size: var(--fs-xl); }
.is-stacked main > .site-foot .foot-brand b { font-weight: 700; color: var(--brass-hi); }
.is-stacked main > .site-foot .foot-small { color: var(--on-brand-2); }

/* Layout shift (review R1): the card and the lists under it are drawn by JavaScript. Until the first
   draw, the parts under the card stay out of the layout, so nothing on screen jumps down when the card
   arrives; the "Data as of" line waits for the list above it for the same reason. */
.homes-loading #area-summary ~ * { display: none; }
@media (min-width: 821px) { #areas:empty, #areas:has(> .sl-status[role="status"]) { min-height: 1100px; } }   /* room for the sales while they load, so the line below doesn't jump on screen */
@media (min-width: 821px) { #results-count { display: inline-block; min-width: 6.5em; } }   /* the count arrives after the sales load: keep its room so the row doesn't re-wrap (R1) */

/* A link to #news or #insights lands below the sticky header (review R6, phones). */
#news, #insights { scroll-margin-top: calc(var(--topbar-h) + 12px); }

/* With seven links in the menu, the gaps between them close up a little between 821px and 1279px so the
   search box keeps its room (desktop and tablet only). */
@media (min-width: 821px) and (max-width: 1279px) { .tb-site .site-nav a { margin: 0 3px; } }
