/* =====================================================================
   PlotWarden — base styles
   ===================================================================== */

:root {
  --bg:           #f6f7f5;
  --surface:      #ffffff;
  --border:       #e2e5e1;
  --text:         #1d2521;
  --text-muted:   #6a716c;
  --brand:        #1e6f3a;
  --brand-hover:  #195a30;
  --brand-soft:   #e8f1ea;
  --danger:       #b8351a;
  --danger-soft:  #faeae6;
  --warn:         #a26a08;
  --warn-soft:    #fbf2dc;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.03);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --radius-sm:    6px;
  --radius-md:    10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.brand-mark svg { display: block; }
.brand-name {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.topnav.hidden { display: none; }
.user-email { color: var(--text-muted); }
.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.link-btn:hover { background: var(--brand-soft); }

/* --- main layout --- */
main {
  max-width: 880px;
  margin: 32px auto;
  padding: 0 24px 64px;
}

/* --- auth view --- */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 420px;
  margin: 64px auto;
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}
.auth-card p.lede {
  margin: 0 0 24px;
  color: var(--text-muted);
}

/* --- landing page (logged-out marketing view) --- */
.landing {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 64px;
}
.landing-hero {
  display: flex;
  justify-content: center;
  padding: 56px 0 24px;
}
.landing-hero-copy {
  max-width: 680px;
  text-align: center;
}
.landing-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.landing-title {
  font-size: 40px;
  line-height: 1.12;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.landing-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 32px;
}
.landing-cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 28px;
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
}
.landing-cta-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}
.landing-cta-card .lede {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.landing-fineprint {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.landing-footer-links { display: block; margin-top: 6px; }
.landing-footer-links a { color: var(--text-muted); }

/* Beta paywall (signups closed) */
.paywall {
  text-align: center;
  padding: 8px 4px;
}
.paywall h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }

/* Sign up / Log in tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  padding: 8px 0;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}
.auth-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.payment-note {
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text);
  margin: 12px 0 4px;
}

/* Consent checkboxes (signup + account) */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  cursor: pointer;
}
.consent-row input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  flex: 0 0 auto;
}
.consent-row span { line-height: 1.4; }

/* Public legal pages (privacy / terms) */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px 64px;
  line-height: 1.6;
}
.legal-page h1 { font-size: 28px; margin: 12px 0 4px; }
.legal-page h2 { font-size: 18px; margin: 28px 0 6px; }
.legal-page p { margin: 8px 0; }
.legal-draft { margin: 16px 0 8px; }
.legal-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* Pricing page + calculator */
.pricing-hero { text-align: center; margin: 20px 0 8px; }
.pricing-amount { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; }
.pricing-amount .pricing-per { font-size: 18px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.pricing-calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 16px 0 8px;
}
.pricing-calc-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pricing-calc-row input {
  width: 90px; text-align: center; font-size: 18px; padding: 8px;
}
.pricing-calc-row button.secondary { width: 44px; font-size: 20px; line-height: 1; padding: 8px 0; }
.pricing-cta { text-align: center; margin: 24px 0 8px; }

/* Account billing card */
.billing-price { margin: 6px 0; }
.billing-amount { font-size: 30px; font-weight: 700; }

/* Admin pricing editor */
.pricing-editor {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  margin-top: 10px;
  max-width: 520px;
}
.pricing-editor label { font-size: 13px; color: var(--text-muted); }
.pricing-editor input { margin-top: 4px; }
@media (max-width: 600px) { .pricing-editor { grid-template-columns: 1fr; } }

/* Danger button (account deletion) */
button.danger {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
  margin-top: 8px;
}
button.danger:disabled { opacity: 0.5; cursor: not-allowed; }

.landing-section-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 56px 0 28px;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.landing-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.landing-feature-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 10px;
}
.landing-feature h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.landing-feature p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.landing-step {
  text-align: center;
  padding: 8px;
}
.landing-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
}
.landing-step h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.landing-step p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.landing-closing {
  text-align: center;
  background: var(--brand-soft);
  border-radius: var(--radius-md);
  padding: 44px 24px;
  margin-top: 56px;
}
.landing-closing h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}
.landing-closing p {
  margin: 0 0 20px;
  color: var(--text-muted);
}
.landing-closing-btn {
  font-size: 16px;
  padding: 12px 28px;
}

.landing-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.landing-footer .brand-mark {
  color: var(--brand);
  margin-right: 6px;
}

@media (max-width: 760px) {
  .landing-title { font-size: 30px; }
  .landing-sub { font-size: 16px; }
  .landing-grid { grid-template-columns: 1fr; }
  .landing-steps { grid-template-columns: 1fr; gap: 20px; }
}

/* --- forms --- */
label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  margin-top: 12px;
}
input[type="email"],
input[type="text"],
textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; min-height: 60px; }

button.primary,
button.secondary {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease;
}
button.primary {
  background: var(--brand);
  color: white;
}
button.primary:hover:not(:disabled) { background: var(--brand-hover); }
button.primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}
button.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
button.secondary:hover { background: var(--bg); }

/* --- alerts (in-page status messages) --- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  font-size: 14px;
}
.alert.success { background: var(--brand-soft); color: var(--brand); }
.alert.error   { background: var(--danger-soft); color: var(--danger); }
.alert.warning { background: var(--warn-soft); color: var(--warn); }
.alert.info    { background: #eef2f6; color: #4a5563; }

/* --- properties list --- */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.list-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.property-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.1s;
}
.property-card:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.property-card .label {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}
.property-card .meta {
  color: var(--text-muted);
  font-size: 13px;
}
.property-card .status-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-badge.active         { background: var(--brand-soft); color: var(--brand); }
.status-badge.pending_review { background: var(--warn-soft); color: var(--warn); }
.status-badge.rejected       { background: var(--danger-soft); color: var(--danger); }
.status-badge.paused         { background: #eef2f6; color: #4a5563; }

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

/* --- claim flow --- */
.claim-steps {
  display: flex;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 13px;
}
.claim-steps li {
  flex: 1;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--border);
}
.claim-steps li.active {
  color: var(--brand);
  border-color: var(--brand);
  font-weight: 500;
}
.claim-steps li.done {
  color: var(--brand);
  border-color: var(--brand-soft);
}

#map {
  height: 480px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.geocode-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.geocode-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.geocode-results button:last-child { border-bottom: none; }
.geocode-results button:hover { background: var(--bg); }

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.button-row .spacer { flex: 1; }

.hidden { display: none !important; }
.muted  { color: var(--text-muted); }

.loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- property detail view ----------------------------------------- */

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin: 16px 0 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.detail-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.detail-header p { margin: 0; }
.detail-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
}
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.detail-actions button { white-space: nowrap; }
button.danger-btn {
  color: var(--danger);
  border-color: var(--danger-soft);
}
button.danger-btn:hover { background: var(--danger-soft); }

.detail-section {
  margin: 32px 0;
}
.detail-section h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}

#detail-map {
  height: 360px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* --- documents vault --- */
.doc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.doc-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 6px;
}
.doc-list li .link-btn:first-child { flex: 1; text-align: left; font-weight: 500; }
.doc-delete { color: var(--danger) !important; }

.upload-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.upload-form label { margin-top: 8px; }
.upload-form select,
.upload-form input[type="file"] {
  display: block;
  margin-top: 4px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: inherit;
}
.upload-form .primary { margin-top: 14px; }

/* --- alerts table --- */
.alerts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 14px;
}
.alerts-table th,
.alerts-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.alerts-table th {
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.alerts-table tr:last-child td { border-bottom: none; }
.status-badge.high { background: var(--danger-soft); color: var(--danger); }
.status-badge.med  { background: var(--warn-soft); color: var(--warn); }
.status-badge.low  { background: var(--brand-soft); color: var(--brand); }

/* --- nearby grid (permits / roadworks / sale / rent) --- */
.nearby-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .nearby-grid { grid-template-columns: 1fr; }
}

/* ---- Status banner (top of property page) -------------------------- */
.status-banner {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: center;
  margin: 16px 0 24px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}
.status-banner-icon {
  font-size: 28px;
  text-align: center;
  line-height: 1;
}
.status-banner-headline {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 2px;
}
.status-banner-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}
.status-quiet   { background: #ecf6ed; border-color: #b8dcc2; }
.status-quiet   .status-banner-headline { color: #1e6f3a; }
.status-watch   { background: #fdf6e3; border-color: #ead9a3; }
.status-watch   .status-banner-headline { color: #8a6a07; }
.status-alarm   { background: #fbe9e3; border-color: #f0b8a4; }
.status-alarm   .status-banner-headline { color: #b04a2c; }
.status-pending { background: #f4f0fa; border-color: #d9c7ec; }
.status-pending .status-banner-headline { color: #6b3aa0; }
.status-paused  { background: var(--surface); border-color: var(--border); }
.status-waiting { background: #eef3fa; border-color: #c5d5ea; }
.status-waiting .status-banner-headline { color: #2c5b97; }
.status-loading { background: var(--surface); border-color: var(--border); }

/* ---- Alert cards --------------------------------------------------- */
.alerts-empty p { color: var(--text-muted); margin: 0; }
.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.alert-card.alert-conf-high  { border-left: 4px solid #b04a2c; }
.alert-card.alert-conf-med   { border-left: 4px solid #c89308; }
.alert-card.alert-conf-low   { border-left: 4px solid #5f7ba1; }
.alert-card.alert-resolved   { opacity: 0.6; border-left-color: var(--border); }
.alert-card-head {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}
.alert-card-icon { font-size: 24px; line-height: 1.2; }
.alert-card-headline { font-size: 16px; font-weight: 700; margin: 0; }
.alert-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.alert-card-sub .dot { opacity: 0.5; }
.alert-card-body {
  margin: 12px 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.alert-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.confidence-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.confidence-high { background: #fbe9e3; color: #b04a2c; }
.confidence-med  { background: #fdf6e3; color: #8a6a07; }
.confidence-low  { background: #eef3fa; color: #2c5b97; }

/* ---- Compare-today-to-N-weeks-ago widget --------------------------- */
.compare-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.compare-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.compare-label select {
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
}
.compare-result { flex: 1 1 320px; min-width: 0; }
.compare-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compare-dates {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.compare-then, .compare-now { font-weight: 600; color: var(--text); }
.compare-arrow { opacity: 0.5; }
.compare-caveat { font-style: italic; opacity: 0.75; }
.compare-rows {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) minmax(180px, 1.5fr);
  gap: 4px 12px;
  font-size: 13px;
}
.compare-row { display: contents; }
.compare-row > * { padding: 2px 0; }
.compare-key   { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.compare-vals  { font-variant-numeric: tabular-nums; }
.compare-delta { font-variant-numeric: tabular-nums; }
.compare-up    .compare-delta { color: #1e6f3a; }
.compare-down  .compare-delta { color: #b04a2c; }
.compare-flat  .compare-delta { color: var(--text-muted); }
.compare-summary {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
}
.summary-quiet { color: #1e6f3a; }
.summary-warn  { color: #8a6a07; }

/* ---- Nearby: deep-link footer link --------------------------------- */
.nearby-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
}
.designation-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

/* ---- Signatures: chart wrap + toggle ------------------------------- */
.signatures-chart-wrap {
  position: relative;
  height: 220px;
  margin: 0 0 16px;
}
.signatures-chart-wrap[hidden] { display: none; }
.chart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  cursor: pointer;
  user-select: none;
}
.chart-toggle input { cursor: pointer; }

/* ---- Signatures: scan strip (per-date photo cards) ----------------- */
.scan-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.scan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 120ms ease, transform 120ms ease;
}
.scan-card:hover {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
  transform: translateY(-1px);
}
.scan-card.scan-alert { border-color: #f0b8a4; }
.scan-thumb {
  aspect-ratio: 1 / 1;
  background: #ebeef2;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.scan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Nearest-neighbour upscaling preserves the satellite-pixel feel even
     though the source thumbnail was already 256px. */
  image-rendering: pixelated;
}
.scan-thumb-missing {
  color: var(--text-muted);
  font-size: 12px;
}
.scan-card-meta {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scan-card-date {
  font-size: 13px;
  font-weight: 600;
}
.scan-card-readings {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.scan-card-readings .dot { opacity: 0.5; }
.scan-card-status {
  position: absolute;
  top: 6px;
  right: 8px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.nearby-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.nearby-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nearby-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.nearby-item:last-child { border-bottom: none; }
.nearby-item a {
  font-weight: 500;
  color: var(--brand);
}

/* =====================================================================
   Crime stats card (Phase 18A)
   ===================================================================== */
.crime-loading, .news-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  font-size: 13px;
}
.crime-summary { margin-bottom: 18px; }
.crime-headline { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.crime-section { margin-bottom: 18px; }
.crime-section-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.crime-map {
  height: 320px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.crime-chart-wrap { height: 280px; margin-bottom: 6px; }
.crime-empty {
  padding: 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}
.crime-recent summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--brand);
  padding: 6px 0;
}
.crime-recent-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 13px;
}
.crime-recent-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.crime-recent-list li:last-child { border-bottom: none; }

/* =====================================================================
   Construction nearby (Phase 18D)
   ===================================================================== */
.permit-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin: 0 2px 0 6px;
  vertical-align: middle;
}
.permit-approved { background: #b04a2c; }
.permit-pending  { background: #c89308; }
.permit-rejected { background: #9a9d97; }

.permit-list { list-style: none; padding: 0; margin: 0; }
.permit-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.permit-item:last-child { border-bottom: none; }
.permit-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.permit-status {
  font-weight: 600;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eeeeed;
  color: var(--text);
}
.permit-band-approved .permit-status { background: #fbe9e3; color: #b04a2c; }
.permit-band-pending  .permit-status { background: #fdf6e3; color: #8a6a07; }
.permit-band-rejected .permit-status { background: #eeeeed; color: var(--text-muted); }
.permit-item-desc { font-size: 13px; line-height: 1.45; margin-bottom: 4px; }
.permit-item-meta { font-size: 11px; }
.permit-item-meta a { color: var(--brand); }

/* =====================================================================
   Local news cards (Phase 18C)
   ===================================================================== */
.news-list {
  display: grid;
  gap: 10px;
}
.news-card {
  display: block;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms ease, background 120ms ease;
}
.news-card:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}
.news-card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 4px;
}
.news-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.news-source { font-weight: 500; color: var(--text); }
.news-card-meta .dot { opacity: 0.5; margin: 0 4px; }

/* =====================================================================
   Evidence pack toast (Phase 14C)
   ===================================================================== */
.evidence-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.4;
  border: 1px solid;
}
.evidence-toast-info    { background: #eef3fa; border-color: #c8d6ea; color: #2c5b97; }
.evidence-toast-success { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.evidence-toast-error   { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* =====================================================================
   Ground movement / subsidence card (Phase 16C)
   ===================================================================== */
.subsidence-empty {
  padding: 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
.subsidence-empty .muted { color: var(--text-muted); font-size: 13px; }

.subsidence-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}
.subsidence-stable      { border-left: 4px solid #2e7d3a; }
.subsidence-mild        { border-left: 4px solid #c89308; }
.subsidence-significant { border-left: 4px solid #b04a2c; }

.subsidence-headline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.subsidence-light {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.08);
}
.light-stable      { background: radial-gradient(circle at 30% 30%, #4baa5b, #2e7d3a); }
.light-mild        { background: radial-gradient(circle at 30% 30%, #e8b94a, #b88505); }
.light-significant { background: radial-gradient(circle at 30% 30%, #d96b4a, #a8341c); }
.light-unknown     { background: #d9d9d6; }

.subsidence-status { font-weight: 700; font-size: 16px; }
.subsidence-headline-sub { font-size: 12px; margin-top: 2px; }

.subsidence-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.subs-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.subs-stat-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.subs-stat-value.small, .subs-stat .small { font-size: 12px; font-weight: 500; }
.subs-stat-value .muted { font-weight: 500; }

.subsidence-chart-wrap {
  height: 220px;
  margin-bottom: 14px;
}
.subsidence-explainer p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.subsidence-explainer .small { font-size: 12px; }

/* =====================================================================
   "Confirm with HD" modal (Phase 10C)
   ===================================================================== */
/* Reused soft-primary button style — visually distinct from primary
   action ("Looks right" / "Looks wrong") but clearly a CTA. */
.primary-soft {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.primary-soft:hover:not(:disabled) {
  background: var(--brand);
  color: #fff;
}
.primary-soft:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.hd-modal {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.hd-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.hd-modal-head h3 { margin: 0; font-size: 20px; }
.hd-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
}
.hd-modal-close:hover { color: var(--text); }
.hd-modal-sub {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.hd-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
  justify-content: center;
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: hd-spin 0.8s linear infinite;
}
@keyframes hd-spin { to { transform: rotate(360deg); } }

.hd-modal-error, .hd-modal-empty {
  padding: 24px 16px;
  text-align: center;
}
.hd-modal-error { color: var(--danger); }
.hd-modal-error .small,
.hd-modal-empty .muted { color: var(--text-muted); }
.small { font-size: 12px; }

.hd-pricing-note {
  background: var(--warn-soft);
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}
.hd-pricing-note p { margin: 0; }
.hd-pricing-note .muted { color: var(--text-muted); font-size: 12px; }

.hd-cap-indicator {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: right;
}
.hd-cap-indicator .muted { color: var(--text-muted); }
.hd-cap-banner {
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.hd-cap-banner strong { display: block; margin-bottom: 4px; }
.hd-cap-banner a { color: var(--brand); font-weight: 600; }

.hd-archive-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hd-archive-card {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}
.hd-archive-top {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.hd-archive-pick {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hd-archive-thumb {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ededeb;
}
.hd-archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hd-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
}
.hd-archive-title { font-weight: 600; font-size: 14px; }
.hd-archive-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.hd-archive-sub .dot { opacity: 0.5; margin: 0 4px; }
.hd-archive-price {
  font-size: 16px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hd-archive-order {
  align-self: stretch;
  white-space: nowrap;
}
.hd-modal-footer {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.hd-modal-footer .small { font-size: 12px; }
.hd-modal-footer .muted { color: var(--text-muted); }

@media (max-width: 600px) {
  .hd-archive-card {
    grid-template-columns: 80px 1fr;
  }
  .hd-archive-thumb { width: 80px; height: 80px; }
  .hd-archive-order { grid-column: 1 / -1; }
}

/* ============================================================
   Phase 19 — six new public-data cards
   ============================================================ */

/* Re-usable "risk summary" hero block used by flood + air-quality */
.risk-summary {
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft, #fafbf9);
}
.risk-summary-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.risk-summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.risk-summary-band {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}
.risk-summary-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.risk-ok    { background: #f3f9f3; border-color: #d6e6d6; }
.risk-info  { background: #f0f6fb; border-color: #c8dcec; }
.risk-warn  { background: #fef6ea; border-color: #f0d39a; }
.risk-alarm { background: #fdeceb; border-color: #ecaca8; }

/* Hazard chips row (flood storage / AQMA / airport PSZ) */
.hazard-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.hazard-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
}
.hazard-warn  { background: #fef6ea; border-color: #f0d39a; color: #7a5300; }
.hazard-alarm { background: #fdeceb; border-color: #ecaca8; color: #7a1a17; }

/* Met Office weather warnings */
.weather-warnings { margin-top: 10px; }
.weather-warnings-heading {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.weather-warning {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 4px solid #cbd2cc;
  background: #f8faf8;
  text-decoration: none;
  color: inherit;
  margin-bottom: 6px;
}
.weather-warning:hover { background: #f0f4f0; }
.weather-warning-title { font-weight: 600; font-size: 14px; }
.weather-warning-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.weather-yellow { border-left-color: #d6a909; background: #fff8e0; }
.weather-amber  { border-left-color: #d97900; background: #ffeed1; }
.weather-red    { border-left-color: #c1322b; background: #fbe2e0; }

/* Air-quality grid (PM2.5 / PM10 / NO2 / O3) */
.aq-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.aq-cell {
  text-align: center;
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.aq-cell-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.aq-cell-val   { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.aq-cell-unit  { font-size: 10px; color: var(--text-muted); }
.aq-ok    { background: #f3f9f3; border-color: #d6e6d6; }
.aq-info  { background: #f0f6fb; border-color: #c8dcec; }
.aq-warn  { background: #fef6ea; border-color: #f0d39a; }
.aq-muted { background: #f5f6f4; }
@media (max-width: 480px) {
  .aq-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Roadworks list */
.roadworks-summary { font-size: 14px; margin-bottom: 8px; }
.roadworks-list { list-style: none; padding: 0; margin: 0; }
.roadwork-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 6px;
  border-left-width: 4px;
}
.roadwork-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.roadwork-dist { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roadwork-comment { font-size: 13px; margin-top: 4px; color: var(--text); }
.roadwork-minimal,
.roadwork-moderate { border-left-color: #d6a909; }
.roadwork-serious,
.roadwork-severe   { border-left-color: #c1322b; background: #fdf5f5; }

/* Sold-prices table */
.sales-summary { font-size: 14px; margin-bottom: 8px; color: var(--text-muted); }
.sales-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sales-table th, .sales-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.sales-table th {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sales-table .t-right { text-align: right; font-variant-numeric: tabular-nums; }

/* UKHPI year-over-year colour cues */
.yoy { font-size: 13px; font-weight: 600; margin-left: 6px; }
.yoy-up   { color: #1e6f3a; }
.yoy-down { color: #c1322b; }
.yoy-flat { color: var(--text-muted); }

/* Roadwork distance badge colour cues */
.roadwork-dist-near { color: #c1322b; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12px; }
.roadwork-dist-mid  { color: #7a5300; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12px; }
.roadwork-dist-far  { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 12px; }

/* =====================================================================
   Phase 21A — refined-minimalism property detail
   Tabs + panel grid + consistent card surfaces
   ===================================================================== */

/* --- detail header refresh --- */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 18px 0 14px;
}
.detail-header h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  color: var(--text);
}
.detail-header p.muted {
  font-size: 14px;
  margin: 0;
  color: var(--text-muted);
}
.detail-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* --- always-visible map strip --- */
.map-strip {
  margin: 14px 0 18px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.map-strip #detail-map {
  height: 240px;
  width: 100%;
}

/* --- tabs --- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 18px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px 13px;
  margin-bottom: -1px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.tab svg { color: currentColor; flex-shrink: 0; }
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.tab:focus-visible {
  outline: none;
  background: var(--brand-soft);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* --- tab panels --- */
.tab-panel {
  padding-top: 20px;
  animation: panel-in 180ms ease;
}
.tab-panel[hidden] { display: none; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- 2-column panel grid that collapses to 1 on narrow viewports --- */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}
.panel-card:hover {
  box-shadow: var(--shadow-md);
}
.panel-card-wide {
  grid-column: 1 / -1;
}
.panel-card-header {
  margin: -2px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.panel-card-header h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 2px;
  color: var(--text);
}
.panel-card-header .muted.small {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 700px) {
  .panel-grid { grid-template-columns: 1fr; }
  .map-strip #detail-map { height: 200px; }
  .detail-header { flex-direction: column; }
  .detail-actions { width: 100%; }
  .detail-actions button { flex: 1; }
}

/* --- legacy .detail-section retained for any view that still uses it --- */
.detail-section + .detail-section { margin-top: 22px; }

/* --- status banner refinement: tighter, more elegant --- */
.status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 14px 0;
  box-shadow: var(--shadow-sm);
  transition: background 200ms ease, border-color 200ms ease;
}
.status-banner-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.status-banner-text { flex: 1; min-width: 0; }
.status-banner-headline {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.status-banner-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.status-banner.status-ok    { background: #f3f9f3; border-color: #c8dfcc; }
.status-banner.status-watch { background: #fef6ea; border-color: #f0d39a; }
.status-banner.status-alarm { background: #fdeceb; border-color: #ecaca8; }


/* Roadworks map — same elevated card treatment as the boundary map */
.roadworks-map {
  height: 360px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
@media (max-width: 700px) {
  .roadworks-map { height: 280px; }
}

/* =====================================================================
   Phase 22C — Admin dashboard
   ===================================================================== */

.admin-title {
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  margin: 12px 0 4px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-card.stat-warn  { background: #fef6ea; border-color: #f0d39a; }
.stat-card.stat-alarm { background: #fdeceb; border-color: #ecaca8; }

.admin-section {
  margin: 22px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.admin-section h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.005em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-prop {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.admin-prop:last-child { border-bottom: none; }
.admin-prop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.admin-checklist { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.admin-check-info { color: var(--text); }
.admin-check-warn { color: #7a5300; font-weight: 500; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left;
}
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; }
.queue-failed     { background: #fdeceb; }
.queue-processing { background: #fef6ea; }
.queue-done       { color: var(--text-muted); }

.admin-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.admin-list li { padding: 4px 0; }
.admin-list.small { font-size: 13px; }
.admin-list.small li { padding: 3px 0; color: var(--text-muted); }
.admin-list.small strong { color: var(--text); }

/* Usage panel (Phase 24E) */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}
.usage-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.usage-block h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.usage-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  margin: 12px 0 2px;
}
.usage-bar {
  flex: 1;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

@media (max-width: 700px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .usage-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   Phase 22D — My Map tab
   ===================================================================== */

.mymap-card { padding-bottom: 14px; }
.mymap-map {
  height: 600px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.mymap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  font-size: 12px;
}
.legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  border: 1.5px solid currentColor;
}
.legend-construction { background: #c4713955; color: #c47139; }
.legend-crime        { background: #b04a2c55; color: #b04a2c; }
.legend-roadworks    { background: #d6a90955; color: #d6a909; }
.legend-flood        { background: #3a78c255; color: #3a78c2; }
.legend-property     { background: #1e6f3a;   color: #1e6f3a; }

/* Tighten the default Leaflet layer control to fit our minimalist style */
.leaflet-control-layers-expanded {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  font-size: 12px;
  margin: 1px 0;
}

@media (max-width: 700px) {
  .mymap-map { height: 460px; }
}

/* Phase 22E — map-strip is now nested inside a panel-card on the Monitor
   tab (no longer always-visible). Strip its standalone border/shadow so
   we don't double-up on the card's existing chrome. */
.panel-card.map-strip {
  padding: 0;
  overflow: hidden;
}
.panel-card.map-strip #detail-map {
  height: 320px;
  border-radius: var(--radius-md);
}

/* Phase 22E — My Map fullscreen toggle.
   When the panel-card has .mymap-fullscreen, we lift it out of normal
   flow and pin it to the viewport. The map element fills 100% height. */
.mymap-card.mymap-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
  border: none;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mymap-card.mymap-fullscreen .panel-card-header { flex: 0 0 auto; }
.mymap-card.mymap-fullscreen .mymap-map {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0;
}
.mymap-card.mymap-fullscreen .mymap-legend,
.mymap-card.mymap-fullscreen #mymap-status {
  flex: 0 0 auto;
}
/* Small visual touch on the fullscreen control button */
.mymap-fs-control a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
}
.mymap-fs-control a:hover { background: var(--brand-soft); color: var(--brand); }

/* Phase 23C — fixes for SL5 9JF bug sweep round 2
   --------------------------------------------------------------- */

/* My Map legend — solid colour dots, more readable */
.legend-construction { background: #c47139 !important; color: #c47139; }
.legend-crime        { background: #b04a2c !important; color: #b04a2c; }
.legend-roadworks    { background: #d6a909 !important; color: #b88300; }
.legend-flood        { background: #3a78c2 !important; color: #3a78c2; }
.legend-property     { background: #1e6f3a !important; color: #1e6f3a; }
.legend-dot {
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}
.mymap-legend { font-size: 13px; }

/* My Map: dots show a pointer cursor + soft hover ring so the user
   knows they're clickable. */
.mymap-card .leaflet-interactive {
  cursor: pointer;
  transition: filter 120ms ease;
}
.mymap-card .leaflet-interactive:hover { filter: brightness(1.15) saturate(1.2); }

/* Permit list — show address line */
.permit-item-addr {
  font-size: 12px;
  color: var(--text);
  margin-top: 2px;
  font-style: italic;
  opacity: 0.85;
}

.nearby-card-wide { grid-column: 1 / -1; }
