:root {
    --teal: #0D9488;
    --teal-dark: #0b7a70;
    --teal-soft: #ecfdf5;
    --teal-muted: #ccfbf1;
    --slate: #1E3A5F;
    --ink: #334155;
    --muted: #64748b;
    --paper: #f8fafc;
    --card: #ffffff;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --shadow: 0 1px 3px rgba(30, 58, 95, 0.06), 0 4px 16px rgba(30, 58, 95, 0.04);
    --shadow-lg: 0 4px 24px rgba(30, 58, 95, 0.08);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-pill: 999px;
    --header-h: 4rem;
    --font: "Noto Sans TC", "PingFang TC", "Hiragino Sans CNS", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html {
    overflow-x: clip;
}

body {
    overflow-x: clip;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--slate);
    color: #fff;
    padding: 0.5rem 0.75rem;
    z-index: 100;
    border-radius: var(--radius-sm);
}

.skip-link:focus { left: 0.75rem; }

.wrap {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 1px 0 rgba(30, 58, 95, 0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: inherit;
    text-decoration: none;
    flex-shrink: 0;
}

.brand img, .brand-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-zh {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--slate);
    letter-spacing: 0.04em;
}

.brand-en {
    font-size: 0.78rem;
    color: var(--teal);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-desktop > a,
.nav-desktop > .nav-dropdown > .nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.75rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.nav-desktop > a:hover,
.nav-desktop > .nav-dropdown > .nav-trigger:hover,
.nav-desktop > a:focus-visible,
.nav-desktop > .nav-dropdown > .nav-trigger:focus-visible {
    color: var(--teal);
    background: var(--teal-soft);
}

.nav-desktop > a.is-active {
    color: var(--teal);
    box-shadow: inset 0 -2px 0 var(--teal);
    border-radius: 0;
}

.nav-dropdown { position: relative; }

.nav-dropdown .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 11rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    z-index: 60;
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu,
.nav-dropdown.is-open .nav-menu {
    display: block;
}

.nav-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

.nav-menu a:hover,
.nav-menu a.is-active {
    background: var(--teal-soft);
    color: var(--teal);
}

.nav-chevron {
    width: 0.85rem;
    height: 0.85rem;
    opacity: 0.55;
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--slate);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.menu-toggle svg { width: 1.1rem; height: 1.1rem; }

.menu-toggle:hover,
.menu-toggle:focus-visible {
    border-color: var(--teal-muted);
    color: var(--teal);
    background: var(--teal-soft);
}

.menu-toggle[aria-expanded="true"] {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--teal-soft);
}

.nav-mobile {
    display: none;
    border-top: 1px solid var(--line);
    background: var(--card);
}

.nav-mobile.is-open { display: block; }

.nav-mobile-panel {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.35rem max(1.25rem, env(safe-area-inset-right, 0px)) 1rem max(1.25rem, env(safe-area-inset-left, 0px));
}

.nav-mobile-panel > a,
.nav-mobile-group a {
    display: block;
    padding: 0.65rem 0.75rem;
    margin: 0.1rem 0;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
}

.nav-mobile-group a {
    padding-left: 1.35rem;
}

.nav-mobile-panel > a:hover,
.nav-mobile-panel > a:focus-visible,
.nav-mobile-group a:hover,
.nav-mobile-group a:focus-visible {
    color: var(--teal);
    background: var(--teal-soft);
}

.nav-mobile-panel > a.is-active,
.nav-mobile-group a.is-active {
    color: var(--teal);
    background: var(--teal-soft);
    border-left-color: var(--teal);
    font-weight: 600;
}

.nav-mobile-group {
    padding: 0.35rem 0;
    margin: 0.35rem 0;
    border-top: 1px solid var(--line);
}

.nav-mobile-group:first-of-type {
    margin-top: 0.15rem;
}

.nav-mobile .nav-group-label {
    display: block;
    font-size: 0.72rem;
    color: var(--slate);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.75rem 0.35rem;
    font-weight: 700;
}

.nav-mobile-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.nav-mobile-footer a {
    display: block;
    padding: 0.55rem 0.75rem;
    margin: 0.1rem 0;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.nav-mobile-footer a:hover,
.nav-mobile-footer a:focus-visible,
.nav-mobile-footer a.is-active {
    color: var(--teal);
    background: var(--teal-soft);
}

/* Main */
main.wrap {
    min-width: 0;
    padding-top: 2rem;
    padding-bottom: 3.5rem;
    min-height: 60vh;
}

/* Typography */
h1 {
    font-size: clamp(1.65rem, 3.5vw, 2.25rem);
    margin: 0 0 0.5rem;
    color: var(--slate);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

h2 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
    color: var(--slate);
    font-weight: 700;
}

h3 {
    font-size: 1.02rem;
    margin: 1rem 0 0.4rem;
    color: var(--slate);
    font-weight: 600;
}

.lede {
    color: var(--muted);
    margin: 0 0 1.5rem;
    max-width: 44rem;
    font-size: 1rem;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
}

.kicker .live-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--teal);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.muted { color: var(--muted); font-size: 0.9rem; }
.name-en { color: var(--muted); margin: 0 0 1.25rem; }
.empty { color: var(--muted); margin: 0; }
.region-label { margin-top: 1.75rem; color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }

a { color: var(--teal); }
a:hover { color: var(--teal-dark); }

/* Page header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.page-header-main {
    flex: 1 1 20rem;
    min-width: 0;
}

.page-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    margin-top: 0.5rem;
}

.source-callout {
    flex: 0 1 auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 16rem;
}

.source-callout strong { display: block; color: var(--slate); margin-bottom: 0.15rem; }

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .hero { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
}

.hero-visual {
    background: linear-gradient(135deg, var(--teal-soft) 0%, #e0f2fe 100%);
    border-radius: var(--radius);
    min-height: 14rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 1px solid var(--line);
}

.hero-visual svg { width: 5rem; height: 5rem; opacity: 0.85; }

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.85rem;
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.stats li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.stats strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.stats span { color: var(--muted); font-size: 0.88rem; }
.stats.compact strong { font-size: 1.35rem; }

.stat-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--teal);
    margin-bottom: 0.25rem;
}

/* Cards & panels */
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
    margin: 0 0 1rem;
}

.stats-grid dt {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.stats-grid dd {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--teal);
}

.tps-sales-summary,
.emms-stock-summary { margin-bottom: 1.25rem; }

.estate-intake-context { margin-bottom: 1.25rem; }

.estate-intake-context-stats { margin-top: 0.75rem; }

.estate-intake-context-disclaimer {
    font-size: 0.9rem;
    border-left: 3px solid var(--line);
    padding-left: 0.65rem;
    margin: 0.75rem 0 0;
}

.estate-redevelopment-notices { margin-bottom: 1.25rem; }

.redevelopment-notice-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.redevelopment-notice-item {
    border-top: 1px solid var(--line);
    padding: 0.85rem 0;
}

.redevelopment-notice-item:first-child {
    border-top: none;
    padding-top: 0;
}

.redevelopment-notice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: baseline;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.redevelopment-notice-status {
    font-weight: 600;
    color: var(--slate);
}

.redevelopment-notice-phase {
    background: var(--wash);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.82rem;
}

.redevelopment-notice-summary {
    margin: 0 0 0.35rem;
}

.redevelopment-notice-source {
    margin: 0;
    font-size: 0.9rem;
}

.estate-redevelopment-disclaimer {
    font-size: 0.9rem;
    border-left: 3px solid var(--line);
    padding-left: 0.65rem;
    margin: 0.75rem 0 0;
}

.redevelopment-list-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.redevelopment-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.redevelopment-filter select {
    min-width: 10rem;
}

.redevelopment-filter-clear {
    align-self: center;
    font-size: 0.9rem;
}

.redevelopment-notice-blocks,
.redevelopment-notice-citation {
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
}

.redevelopment-notice-target {
    font-size: 0.92rem;
}

.redevelopment-list-disclaimer {
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.redevelopment-list-table td {
    vertical-align: top;
}

.living-circle { margin-bottom: 1.25rem; }

.living-circle-block { margin-bottom: 1.1rem; }

.living-circle-block h3 {
    font-size: 0.95rem;
    margin: 0 0 0.35rem;
    color: var(--slate);
}

.living-circle-list {
    margin: 0.35rem 0 0.5rem 1.1rem;
    padding: 0;
}

.living-circle-disclaimer {
    font-size: 0.9rem;
    border-left: 3px solid var(--line);
    padding-left: 0.65rem;
    margin: 0.5rem 0;
}

.living-circle-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.1rem 0.4rem;
    margin-left: 0.25rem;
    border-radius: 0.25rem;
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fecaca;
    vertical-align: middle;
}

.living-circle-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.85rem;
}

.card-link {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.card-link:hover, .card-link:focus {
    border-color: var(--teal);
    box-shadow: var(--shadow-lg);
}

.card-link strong { display: block; color: var(--slate); }
.card-link span { color: var(--muted); font-size: 0.88rem; }

.district-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: border-color 0.15s;
}

.district-card:hover, .district-card:focus {
    border-color: var(--teal);
}

.district-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.district-card-header strong {
    color: var(--slate);
    font-size: 1.05rem;
}

.district-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.district-card-stats dt {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0;
}

.district-card-stats dd {
    margin: 0.1rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--teal);
}

/* Chips */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--teal);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s;
}

.chip:hover, .chip:focus {
    border-color: var(--teal);
    background: var(--teal-soft);
}

.chip.is-active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

/* List tabs */
.list-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    align-items: center;
}

.list-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.list-tab:hover { border-color: var(--teal); color: var(--teal); }

.list-tab.is-active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.list-tab-note {
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: auto;
    flex: 1 1 12rem;
}

/* Data table */
.data-table-wrap {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    background: var(--paper);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table th.num, .data-table td.num { text-align: right; }

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--teal-soft); }

.data-table a {
    font-weight: 600;
    text-decoration: none;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.82rem;
}

.rank-badge.top { background: var(--teal); color: #fff; }
.rank-badge.plain { color: var(--slate); }

/* Teaser lists */
.teaser-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .teaser-grid { grid-template-columns: 1fr 1fr; }
}

.teaser-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.teaser-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--line);
}

.teaser-card-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.teaser-card-header a {
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
}

.teaser-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s;
}

.teaser-item:last-child { border-bottom: none; }
.teaser-item:hover { background: var(--teal-soft); }

.teaser-date {
    flex-shrink: 0;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    min-width: 3.5rem;
    line-height: 1.3;
}

.teaser-body { flex: 1; min-width: 0; }
.teaser-body strong { display: block; color: var(--slate); font-size: 0.92rem; }
.teaser-body span { font-size: 0.82rem; color: var(--muted); }

.teaser-rank {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.teaser-chevron {
    flex-shrink: 0;
    color: var(--muted);
    width: 1rem;
    height: 1rem;
}

/* District layout */
.districts-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 900px) {
    .districts-layout { grid-template-columns: 1fr 1fr; }
}

.district-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .district-hero { grid-template-columns: 1fr 1fr; }
}

.region-badge {
    display: inline-block;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.entity-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

@media (min-width: 900px) {
    .entity-columns { grid-template-columns: repeat(3, 1fr); }
}

.entity-column {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.entity-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.entity-column-header h2 {
    margin: 0;
    font-size: 0.95rem;
}

.entity-column-header a {
    font-size: 0.82rem;
    text-decoration: none;
}

/* Map */
.map {
    height: 20rem;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0.5rem 0 1rem;
    background: #e2e8f0;
    box-shadow: var(--shadow);
}

.map-lg { height: 24rem; }

.map-fallback { font-size: 0.9rem; color: var(--muted); margin: 0 0 1.25rem; }

.map-disclaimer {
    font-size: 0.88rem;
    line-height: 1.55;
    margin: -0.25rem 0 1rem;
}

.ha-map-marker-wrap {
    background: transparent;
    border: none;
}

.ha-map-marker {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0 auto;
    background: var(--teal);
    border: 3px solid var(--slate);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.35);
}

.map .leaflet-control-attribution {
    font-size: 0.68rem;
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.92);
}

.info-bar {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: var(--muted);
    margin: 1.5rem 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.info-bar a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Entity page */
.entity-badge {
    display: inline-block;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.tldr {
    background: var(--teal-soft);
    border: 1px solid var(--teal-muted);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin: 0 0 1.5rem;
}

.tldr h2 { margin-top: 0; color: var(--teal); font-size: 0.95rem; }
.tldr p { margin: 0; max-width: 44rem; color: var(--ink); }

.section-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--teal);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
}

.section-heading svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }

.contact-list {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.contact-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}

.contact-row:last-child { border-bottom: none; }

.contact-row dt {
    font-weight: 600;
    color: var(--slate);
    margin: 0;
}

.contact-row dd {
    margin: 0;
    text-align: right;
}

.contact-row dd a { font-weight: 600; text-decoration: none; }

.contact {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    margin: 0 0 0.75rem;
}

.contact h3 { margin: 0 0 0.35rem; color: var(--slate); }
.contact p { margin: 0; }

.ha-html a { color: var(--teal); }
.website { margin: 0.75rem 0 0; }

.entity-list, .rank-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.entity-list li, .rank-list li {
    border-bottom: 1px solid var(--line);
    padding: 0.65rem 0;
}

.entity-list a, .rank-list a {
    color: var(--slate);
    font-weight: 600;
    text-decoration: none;
}

.entity-list a:hover, .rank-list a:hover { color: var(--teal); }

.meta { display: block; color: var(--muted); font-size: 0.88rem; }

.rank-list { counter-reset: rank; }
.rank-list li { padding-left: 2rem; position: relative; }
.rank-list li::before {
    counter-increment: rank;
    content: counter(rank);
    position: absolute;
    left: 0;
    color: var(--teal);
    font-weight: 700;
}

.related-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
}

.related-link:hover { background: var(--teal-soft); }
.related-link strong { color: var(--slate); flex: 1; }
.related-link span { color: var(--muted); font-size: 0.85rem; }

.avd-results { min-height: 8rem; }
.avd-duty-line strong { font-size: 1.35rem; color: var(--teal); }
.avd-bands-panel summary { cursor: pointer; list-style: none; }
.avd-bands-panel summary::-webkit-details-marker { display: none; }
.avd-bands-summary { display: inline; margin: 0; }
.avd-source-list { margin-top: 1rem; padding-left: 1.25rem; }
.avd-ssd-note { margin-top: 0.75rem; }
.mortgage-dsr-results { min-height: 8rem; }
.mortgage-payment-line strong { font-size: 1.35rem; color: var(--teal); }
.mortgage-flag-over { color: var(--rust, #b45309); font-weight: 600; }
.mortgage-sensitivity-panel { margin-top: 1rem; }
.mortgage-sensitivity-panel summary { cursor: pointer; font-weight: 600; }
.mortgage-sensitivity-note { margin: 0.5rem 0; }
.mortgage-avd-crosslink { margin-top: 1.25rem; }

/* PRH tool */
.prh-tool {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    min-width: 0;
}

@media (min-width: 768px) {
    .prh-tool { grid-template-columns: 1fr 1fr; }
}

.prh-inputs {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    min-width: 0;
}

.prh-step { margin-bottom: 1.5rem; }
.prh-step:last-child { margin-bottom: 0; }

.prh-step-title {
    font-weight: 700;
    color: var(--slate);
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.category-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.category-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--card);
}

.category-card:hover { border-color: var(--teal-muted); }

.category-card.is-selected {
    border-color: var(--teal);
    background: var(--teal-soft);
}

.category-card input { margin-top: 0.2rem; accent-color: var(--teal); }

.category-card-label {
    font-weight: 600;
    color: var(--slate);
    font-size: 0.92rem;
    line-height: 1.4;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .size-grid { grid-template-columns: repeat(10, 1fr); }
}

.size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.12s;
    text-decoration: none;
}

.size-btn:hover { border-color: var(--teal); color: var(--teal); }

.size-btn.is-selected {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.size-hint { font-size: 0.82rem; color: var(--muted); margin: 0.5rem 0 0; }

.prh-results {
    background: var(--teal-soft);
    border: 1px solid var(--teal-muted);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-width: 0;
}

.prh-results h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--slate);
}

.prh-results h2 em {
    color: var(--teal);
    font-style: normal;
}

.limit-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.limit-value {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.limit-value dt {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0 0 0.25rem;
}

.limit-value dd {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.prh-info {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--muted);
    background: rgba(255,255,255,0.6);
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
}

.effective-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    max-width: 100%;
}

.limit-form { display: none; }

.mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mode-btn {
    flex: 1 1 auto;
    min-width: 10rem;
    padding: 0.65rem 1rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    color: var(--slate);
}

.mode-btn.is-selected {
    border-color: var(--teal);
    background: var(--teal-soft);
    color: var(--teal);
}

.money-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .money-fields { grid-template-columns: 1fr 1fr; }
}

.money-field span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.money-field input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
}

.prh-step.is-hidden { display: none; }

.comparison-panel {
    margin-top: 1rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-sm);
}

.comparison-heading {
    margin: 0 0 0.65rem;
    font-size: 0.92rem;
}

.comparison-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
}

.comparison-row:last-child { border-bottom: 0; }

.comparison-row.is-within .comparison-verdict { color: var(--teal); }
.comparison-row.is-over .comparison-verdict { color: #b45309; }

.income-asset-ymyl ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.92rem;
}

.tools-hub-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: grid;
    gap: 1rem;
}

.tools-hub-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.tools-hub-card--placeholder { opacity: 0.85; }

.tools-hub-card h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
}

.btn-secondary {
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--slate);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.prh-history {
    margin-bottom: 1.5rem;
}

.prh-history-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
}

.prh-history-chart {
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.prh-history-chart-label {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
}

.prh-history-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.prh-history-bars li {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
}

.prh-history-bar-date {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.prh-history-bar-track {
    display: block;
    height: 0.55rem;
    background: var(--line);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.prh-history-bar-fill {
    display: block;
    height: 100%;
    background: var(--teal);
    border-radius: inherit;
}

.prh-history-bar-value {
    font-weight: 600;
    color: var(--slate);
    font-variant-numeric: tabular-nums;
}

.prh-history-table .is-current-period {
    background: var(--teal-soft);
}

/* FAQ */
.faq { margin-top: 2.5rem; }

.faq > h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.faq-item {
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 0;
}

.faq-item h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--slate);
    font-weight: 600;
}

.faq-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.faq-item a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Source */
.source {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
}

.source p { margin: 0.3rem 0; font-size: 0.9rem; }

/* Guides */
.guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0 0 2rem;
}

@media (min-width: 640px) {
    .guide-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .guide-grid { grid-template-columns: repeat(2, 1fr); }
}

.guide-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guide-card.is-placeholder {
    opacity: 0.55;
    border-style: dashed;
}

.guide-card-icon {
    width: 2rem;
    height: 2rem;
    color: var(--teal);
}

.guide-card h2 {
    margin: 0;
    font-size: 1.05rem;
}

.guide-card h2 a {
    color: var(--slate);
    text-decoration: none;
}

.guide-card h2 a:hover { color: var(--teal); }

.guide-card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }

.guide-card-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.guide-card-action {
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 0.25rem;
}

.guide-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--teal);
    background: var(--teal-soft);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
}

.guide-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1rem; }

.guide-list li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
}

.guide-list a { font-weight: 650; color: var(--slate); text-decoration: none; }
.guide-list a:hover { color: var(--teal); }
.guide-list p { margin: 0.4rem 0 0; color: var(--muted); }

.article h2 { margin: 1.5rem 0 0.5rem; font-size: 1.1rem; color: var(--slate); }
.article p { margin: 0.5rem 0; }
.article ul { padding-left: 1.2rem; }
.article code { font-size: 0.9em; background: var(--paper); padding: 0.1rem 0.35rem; border-radius: 0.25rem; }

.guide-waiting-snapshot .guide-waiting-table caption,
.guide-waiting-snapshot .guide-waiting-trend caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    padding: 0 0 0.5rem;
    color: var(--slate);
}

.guide-waiting-snapshot .guide-waiting-disclaimer {
    margin: 0.5rem 0 0.75rem;
}

.guide-waiting-snapshot .guide-waiting-latest-teaser {
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
    background: var(--paper);
    border-radius: 0.5rem;
    border-left: 3px solid var(--teal);
}

.guide-waiting-trend-wrap {
    overflow-x: auto;
}

.guide-waiting-snapshot .guide-waiting-trend th,
.guide-waiting-snapshot .guide-waiting-trend td {
    min-width: 7.5rem;
}

.guide-waiting-snapshot .guide-waiting-trend th[scope="row"] {
    min-width: 11rem;
    font-weight: 600;
}

.estate-application-cta-links {
    margin: 0.75rem 0;
    font-weight: 500;
}

.estate-application-cta-disclaimer {
    margin-top: 0.5rem;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

@media (min-width: 768px) {
    .about-grid { grid-template-columns: repeat(2, 1fr); }
}

.about-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.about-card h2 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.about-card p, .about-card ul {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.about-card ul { padding-left: 1.1rem; }
.about-card li { margin: 0.25rem 0; }

.disclaimer-box {
    background: var(--teal-soft);
    border: 1px solid var(--teal-muted);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    margin: 1rem 0 1.5rem;
}

.disclaimer-box h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--teal);
}

.disclaimer-box p { margin: 0; font-size: 0.92rem; }

/* Legal layout */
.legal-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .legal-layout { grid-template-columns: 14rem 1fr; }
}

.legal-sidebar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    align-self: start;
}

.legal-sidebar-header {
    background: var(--teal);
    color: #fff;
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legal-nav { list-style: none; padding: 0; margin: 0; }

.legal-nav li { border-bottom: 1px solid var(--line); }

.legal-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
}

.legal-nav a:hover, .legal-nav a.is-active {
    background: var(--teal-soft);
    color: var(--teal);
    border-left-color: var(--teal);
}

.legal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.legal-content {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow);
}

.legal-section {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--line);
}

.legal-section:last-child { border-bottom: none; }

.legal-section-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--teal);
}

.legal-section-body h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: var(--teal);
}

.legal-section-body p { margin: 0.35rem 0; color: var(--muted); font-size: 0.92rem; }
.legal-section-body ul { margin: 0.35rem 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.92rem; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover { color: var(--teal); }

.breadcrumb svg { width: 0.85rem; height: 0.85rem; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 1.5rem 0 2rem;
    background: var(--card);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand img { width: 1.75rem; height: 1.75rem; }

.site-footer p { margin: 0.25rem 0; font-size: 0.88rem; color: var(--muted); }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88rem;
}

.footer-links a:hover { color: var(--teal); }

.footer-disclaimer {
    text-align: center;
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.ad-slot {
    border: 1px dashed var(--line);
    padding: 0.75rem 1rem;
    margin: 0 0 1.25rem;
    background: var(--card);
}

/* Responsive nav */
@media (max-width: 900px) {
    .nav-desktop { display: none; }
    .menu-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
    .header-inner { min-height: 3.5rem; }
    main.wrap { padding-top: 1.5rem; }
    .map { height: 14rem; }
    .map-lg { height: 16rem; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .limit-values { grid-template-columns: 1fr; }
    .limit-value dd { font-size: 1.35rem; }
    .prh-inputs,
    .prh-results { padding: 1rem; }
    .page-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .effective-badge { align-self: flex-start; }
    .size-grid { grid-template-columns: repeat(5, 1fr); }
    .list-tab-note { margin-left: 0; flex-basis: 100%; }
    .source-callout { max-width: none; }
}
