@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Playfair+Display:ital,wght@0,700;1,400;1,700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ═══════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════ */
:root {
  /* Core palette — outback at dusk */
  --ink:        #0F0D0A;
  --ink-mid:    #1C1812;
  --ink-soft:   #28221A;
  --ink-lift:   #352D23;
  --dust:       #5C5247;
  --dust-mid:   #7A6E63;
  --dust-light: #A09489;
  --parch:      #D4C4A8;
  --parch-light:#EAE0CC;
  --cream:      #F5F0E8;

  --rust:       #B83A18;
  --rust-mid:   #D44820;
  --rust-light: #E8633A;
  --rust-glow:  rgba(184,58,24,0.15);

  --ochre:      #C47A18;
  --ochre-mid:  #E08C24;
  --ochre-light:#F0A840;

  --slate:      #2A4A6E;
  --slate-mid:  #3A6090;
  --slate-light:#5080B8;

  --sage:       #2A5A3A;
  --sage-mid:   #3A7A50;
  --sage-light: #4A9A64;

  --danger:     #A02020;
  --warning:    #B07818;
  --info:       var(--slate);

  /* Typography */
  --font-display: 'Bebas Neue', sans-serif;
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing / Radii */
  --r-sm:  3px;
  --r-md:  6px;
  --r-lg:  10px;
  --r-xl:  16px;

  /* Transitions */
  --t-fast: 0.12s ease;
  --t-mid:  0.22s ease;
  --t-slow: 0.4s ease;

  /* Shadows */
  --shadow-sm:  0 1px 6px rgba(0,0,0,0.35);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.55);

  /* Sidebar width */
  --sidebar-w: 252px;
}

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }

body {
  background: var(--ink);
  color: var(--parch);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: overlay;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--ink-mid); }
::-webkit-scrollbar-thumb { background: var(--ink-lift); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--rust); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ═══════════════════════════════════════
   TYPOGRAPHY SCALE
═══════════════════════════════════════ */
.t-display {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  line-height: 0.95;
}
.t-serif { font-family: var(--font-serif); }
.t-mono  { font-family: var(--font-mono); }

.t-label {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dust-light);
}

.t-section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--parch-light);
  letter-spacing: 0.04em;
  line-height: 1;
}

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.main { overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar {
  background: var(--ink-mid);
  border-right: 1px solid rgba(255,255,255,0.055);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Logo */
.sidebar-brand {
  padding: 1.6rem 1.4rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--rust-light);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dust);
  margin-top: 0.25rem;
  display: block;
}

/* Nav scroll area */
.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0 1rem;
}
.sidebar-nav-wrap::-webkit-scrollbar { width: 3px; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: transparent; }
.sidebar-nav-wrap:hover::-webkit-scrollbar-thumb { background: var(--ink-lift); }

.nav-group-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dust);
  padding: 1rem 1.4rem 0.3rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.52rem 1.4rem;
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--dust-mid);
  cursor: pointer;
  transition: all var(--t-fast);
  border-left: 2px solid transparent;
  user-select: none;
  position: relative;
}

.nav-link:hover {
  color: var(--parch);
  background: rgba(255,255,255,0.03);
  border-left-color: var(--rust);
}

.nav-link.active {
  color: var(--rust-light);
  background: rgba(184,58,24,0.08);
  border-left-color: var(--rust-mid);
  font-weight: 500;
}

.nav-link .ico {
  font-size: 0.95rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

/* NEW badge */
.nav-new {
  margin-left: auto;
  background: var(--rust);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  text-transform: uppercase;
}

/* Sidebar footer */
.sidebar-foot {
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 0.9rem 1.4rem;
}

.weather-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.weather-temp {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--ochre-light);
  line-height: 1;
}

.weather-detail { font-size: 0.75rem; color: var(--dust-light); }
.weather-sub { font-family: var(--font-mono); font-size: 0.62rem; color: var(--dust); margin-top: 0.15rem; }

/* Air quality pill */
.aqi-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  margin-top: 0.35rem;
}
.aqi-good    { background: rgba(42,90,58,0.3); color: var(--sage-light); border: 1px solid rgba(42,90,58,0.5); }
.aqi-mod     { background: rgba(176,120,24,0.3); color: var(--ochre-light); border: 1px solid rgba(176,120,24,0.4); }
.aqi-poor    { background: rgba(160,32,32,0.3); color: #E05050; border: 1px solid rgba(160,32,32,0.4); }
.aqi-dot     { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Live time */
#live-clock {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--dust);
  margin-top: 0.5rem;
}

/* ═══════════════════════════════════════
   TOPBAR
═══════════════════════════════════════ */
.topbar {
  background: rgba(15,13,10,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0.7rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }

.topbar-section {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--parch);
}

.topbar-crumb {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--dust);
  letter-spacing: 0.1em;
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--dust-light);
}

.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rust-light);
  animation: blink 2.4s ease infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.25} }

/* ═══════════════════════════════════════
   SECTION SYSTEM
═══════════════════════════════════════ */
.section {
  display: none;
  flex: 1;
  padding: 2rem;
  animation: fadeUp 0.25s ease forwards;
}
.section.active { display: block; }

@keyframes fadeUp {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: translateY(0); }
}

/* Section hero band */
.s-hero {
  margin: -2rem -2rem 2rem;
  padding: 2.5rem 2rem 2rem;
  background: var(--ink-mid);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

.s-hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 300px; height: 100%;
  background: radial-gradient(ellipse at right center, rgba(184,58,24,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.s-hero-watermark {
  position: absolute;
  right: 2rem;
  bottom: -0.5rem;
  font-family: var(--font-display);
  font-size: 6rem;
  color: rgba(255,255,255,0.025);
  letter-spacing: 0.1em;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--ink-mid);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
  padding: 1.4rem;
  transition: border-color var(--t-mid);
}
.card:hover { border-color: rgba(184,58,24,0.2); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--parch);
}

/* ═══════════════════════════════════════
   STAT BOXES
═══════════════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px,1fr));
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}

.stat {
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-md);
  padding: 1.1rem 1.3rem;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent, var(--rust));
}
.stat.ochre  { --accent: var(--ochre-mid); }
.stat.slate  { --accent: var(--slate-light); }
.stat.sage   { --accent: var(--sage-light); }
.stat.warn   { --accent: var(--warning); }
.stat.danger { --accent: var(--danger); }

.stat-val {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--parch-light);
  line-height: 1;
  margin-bottom: 0.15rem;
}

.stat-lbl {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dust-light);
}

.stat-chg {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  margin-top: 0.3rem;
}
.stat-chg.up   { color: var(--sage-light); }
.stat-chg.down { color: #E05050; }
.stat-chg.flat { color: var(--dust-light); }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}

.b-rust    { background: rgba(184,58,24,0.2);  color: var(--rust-light);  border: 1px solid rgba(184,58,24,0.3); }
.b-ochre   { background: rgba(196,122,24,0.2); color: var(--ochre-light); border: 1px solid rgba(196,122,24,0.3); }
.b-slate   { background: rgba(42,74,110,0.25); color: var(--slate-light); border: 1px solid rgba(42,74,110,0.4); }
.b-sage    { background: rgba(42,90,58,0.25);  color: var(--sage-light);  border: 1px solid rgba(42,90,58,0.4); }
.b-dust    { background: rgba(92,82,71,0.25);  color: var(--dust-light);  border: 1px solid rgba(92,82,71,0.4); }
.b-danger  { background: rgba(160,32,32,0.2);  color: #E05050;            border: 1px solid rgba(160,32,32,0.35); }
.b-warn    { background: rgba(176,120,24,0.2); color: var(--ochre-light); border: 1px solid rgba(176,120,24,0.35); }
.b-new     { background: var(--rust); color: var(--cream); }

/* ═══════════════════════════════════════
   TABLES
═══════════════════════════════════════ */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.86rem; }

.tbl th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dust);
  padding: 0.55rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: var(--ink);
}

.tbl td {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--parch);
  vertical-align: middle;
}

.tbl tr:hover td { background: rgba(255,255,255,0.025); }
.tbl .mono-cell { font-family: var(--font-mono); font-size: 0.8rem; }

/* ═══════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.fbtn {
  padding: 0.32rem 0.8rem;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--dust-light);
}
.fbtn:hover, .fbtn.on {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--cream);
}

/* ═══════════════════════════════════════
   ALERTS
═══════════════════════════════════════ */
.alert {
  display: flex;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.83rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.alert-warn   { background: rgba(176,120,24,0.12); border: 1px solid rgba(176,120,24,0.28); color: var(--ochre-light); }
.alert-danger { background: rgba(160,32,32,0.12);  border: 1px solid rgba(160,32,32,0.28);  color: #E05050; }
.alert-info   { background: rgba(42,74,110,0.15);  border: 1px solid rgba(42,74,110,0.35);  color: var(--slate-light); }
.alert-sage   { background: rgba(42,90,58,0.12);   border: 1px solid rgba(42,90,58,0.3);    color: var(--sage-light); }
.alert-icon   { flex-shrink: 0; font-size: 1.1rem; }

/* ═══════════════════════════════════════
   TIMELINE
═══════════════════════════════════════ */
.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--rust) 0%, rgba(184,58,24,0.1) 100%);
}

.tl-item {
  position: relative;
  padding: 0 0 1.4rem 1rem;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -1.4rem;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rust-mid);
  border: 1.5px solid var(--ink);
}

.tl-item.flag::before { background: var(--danger); }
.tl-item.note::before { background: var(--ochre-mid); }
.tl-item.good::before { background: var(--sage-mid); }

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--dust);
  margin-bottom: 0.15rem;
}

.tl-title { font-size: 0.88rem; font-weight: 500; color: var(--parch); margin-bottom: 0.2rem; }
.tl-body  { font-size: 0.79rem; color: var(--dust-light); line-height: 1.6; }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 1.1rem;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  text-decoration: none;
}

.btn-rust    { background: var(--rust);    color: var(--cream); }
.btn-rust:hover { background: var(--rust-mid); }
.btn-ghost   { background: transparent; color: var(--parch); border: 1px solid rgba(255,255,255,0.14); }
.btn-ghost:hover { border-color: var(--rust); color: var(--rust-light); }

/* ═══════════════════════════════════════
   GRID HELPERS
═══════════════════════════════════════ */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.g-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1.2rem; }
.g-auto-sm { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 1rem; }

/* ═══════════════════════════════════════
   PROGRESS BARS
═══════════════════════════════════════ */
.prog-row {
  display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.55rem;
}
.prog-lbl { font-size: 0.78rem; color: var(--dust-light); min-width: 130px; }
.prog-track { flex: 1; height: 4px; background: var(--ink); border-radius: 2px; overflow: hidden; }
.prog-fill  { height: 100%; border-radius: 2px; transition: width 1.2s cubic-bezier(0.25,1,0.5,1); }
.prog-val { font-family: var(--font-mono); font-size: 0.7rem; color: var(--parch); min-width: 40px; text-align: right; }

/* ═══════════════════════════════════════
   SPECIFIC COMPONENTS
═══════════════════════════════════════ */

/* Event card */
.ev-card {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem;
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.ev-card:hover { border-color: rgba(184,58,24,0.25); background: var(--ink-lift); }

.ev-date {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--rust);
}
.ev-day   { font-family: var(--font-display); font-size: 1.3rem; line-height: 1; color: var(--cream); }
.ev-mon   { font-family: var(--font-mono); font-size: 0.52rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.7); text-transform: uppercase; }

.ev-info  { flex: 1; min-width: 0; }
.ev-title { font-size: 0.87rem; font-weight: 500; color: var(--parch); margin-bottom: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-venue { font-size: 0.77rem; color: var(--dust-light); }
.ev-time  { font-family: var(--font-mono); font-size: 0.67rem; color: var(--ochre-mid); margin-top: 0.25rem; }

/* Property card */
.prop-card {
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-mid);
}
.prop-card:hover { border-color: rgba(184,58,24,0.25); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.prop-thumb {
  height: 160px;
  background: var(--ink-mid);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.prop-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(15,13,10,0.5) 100%);
}

.prop-body { padding: 1rem; }
.prop-price {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ochre-light);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.prop-addr  { font-size: 0.84rem; font-weight: 500; color: var(--parch); margin-bottom: 0.15rem; }
.prop-agent { font-size: 0.75rem; color: var(--dust-light); }
.prop-specs {
  display: flex; gap: 0.9rem; flex-wrap: wrap;
  margin-top: 0.7rem; padding-top: 0.7rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--dust-light);
}

/* Cinema sessions */
.cin-session {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.45rem;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 0.67rem;
  color: var(--ochre-light);
  margin: 0.18rem;
  cursor: pointer;
  transition: all var(--t-fast);
}
.cin-session:hover { border-color: var(--rust); color: var(--rust-light); }

/* Mine dot on SVG map */
.mine-dot { cursor: pointer; transition: r 0.2s ease; }
.mine-dot:hover { opacity: 0.9; }

#map-tip {
  position: absolute;
  background: var(--ink-mid);
  border: 1px solid rgba(184,58,24,0.4);
  border-radius: var(--r-md);
  padding: 0.5rem 0.8rem;
  font-size: 0.76rem;
  color: var(--parch);
  pointer-events: none;
  display: none;
  z-index: 20;
  max-width: 180px;
  box-shadow: var(--shadow-sm);
}

/* Anomaly card */
.anom-card {
  background: rgba(160,32,32,0.07);
  border: 1px solid rgba(160,32,32,0.22);
  border-radius: var(--r-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.7rem;
}
.anom-title { font-weight: 500; color: #E05050; font-size: 0.86rem; margin-bottom: 0.2rem; }
.anom-body  { font-size: 0.79rem; color: var(--dust-light); line-height: 1.6; }

/* On This Day */
.otd-card {
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
}
.otd-year {
  font-family: var(--font-display);
  font-size: 4rem;
  color: rgba(255,255,255,0.04);
  position: absolute;
  right: 1rem; bottom: -0.5rem;
  line-height: 1;
  user-select: none;
}
.otd-headline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--parch);
  line-height: 1.5;
  margin: 0.5rem 0;
}

/* Business obituary */
.biz-item {
  display: flex;
  gap: 1rem;
  padding: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--t-fast);
}
.biz-item:hover { background: rgba(255,255,255,0.02); }
.biz-years {
  flex-shrink: 0;
  width: 90px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--dust);
  line-height: 1.4;
}
.biz-name  { font-size: 0.86rem; font-weight: 500; color: var(--parch); }
.biz-desc  { font-size: 0.77rem; color: var(--dust-light); margin-top: 0.1rem; }

/* Oral history */
.oral-card {
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
  padding: 1.2rem;
  transition: all var(--t-mid);
}
.oral-card:hover { border-color: rgba(196,122,24,0.3); }
.oral-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.93rem;
  color: var(--parch);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.oral-meta { display: flex; align-items: center; gap: 0.6rem; }
.oral-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--rust);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 0.9rem; color: var(--cream);
  flex-shrink: 0;
}
.oral-name  { font-size: 0.8rem; font-weight: 500; color: var(--parch); }
.oral-place { font-size: 0.72rem; color: var(--dust-light); }

/* Water tracker */
.water-gauge {
  position: relative;
  height: 140px;
  background: var(--ink);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.water-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(42,74,110,0.8), rgba(80,128,184,0.4));
  transition: height 1.5s cubic-bezier(0.25,1,0.5,1);
}
.water-label {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.water-pct {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--parch-light);
}

/* Search input */
.search-wrap {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--r-md);
  padding: 0.45rem 0.9rem;
}
.search-wrap input {
  background: none; border: none; outline: none;
  color: var(--parch); font-size: 0.86rem; flex: 1;
}
.search-wrap input::placeholder { color: var(--dust); }
.search-ico { color: var(--dust); font-size: 0.9rem; }

/* Scroll helper */
.scroll-x { overflow-x: auto; }
.scroll-x::-webkit-scrollbar { height: 3px; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
/* ═══════════════════════════════════════
   MOBILE NAV
═══════════════════════════════════════ */
.mob-bar {
  display: none !important;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--ink-mid);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  z-index: 300;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.mob-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--rust-light);
  letter-spacing: 0.05em;
}
.mob-menu-btn {
  width: 44px; height: 44px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0;
}
.mob-menu-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--parch); border-radius: 2px;
  transition: all 0.22s ease;
}
.mob-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mob-menu-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.mob-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 250;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mob-overlay.visible { display: block; }

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    padding-top: 52px;
  }
  .mob-bar { display: flex !important; }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 280 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.6) !important;
    overflow-y: auto !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }

  .main { padding: 1rem; }
  .topbar { display: none; }
  .g2, .g3, .g4, .g-auto { grid-template-columns: 1fr; }
  .g-auto-sm { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  #bizdir-layout { grid-template-columns: 1fr; }
  .s-hero-watermark { font-size: 4rem; }
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tables — make them scroll horizontally */
  .tbl { font-size: 0.72rem; }
  .tbl th, .tbl td { padding: 0.4rem 0.5rem; white-space: nowrap; }
  .card > .scroll-x, .card .tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }

  /* Charts — full width */
  canvas { width: 100% !important; max-width: 100%; }

  /* Commodities section — stack everything */
  #s-commodities .g2 { grid-template-columns: 1fr; }
  #commodity-stats { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  #commodity-stats .stat { padding: 0.6rem; }
  #commodity-stats .stat-val { font-size: 1.2rem; }

  /* ADSB radar — shorter on mobile */
  #adsb-radar { max-height: 280px; }
  #adsb-main { grid-template-columns: 1fr !important; }
  #adsb-lower { grid-template-columns: 1fr !important; }

  /* Stat row small fixes */
  .stat { padding: 0.7rem 0.6rem; }
  .stat-val { font-size: 1.4rem; }
  .stat-lbl { font-size: 0.62rem; }

  /* Cards */
  .card { padding: 0.9rem; }
  .card-head { flex-wrap: wrap; gap: 0.4rem; }

  /* Filter bar — scroll horizontally */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.25rem; }
  .fbtn { white-space: nowrap; flex-shrink: 0; }

  /* Hero section */
  .s-hero { padding: 1.2rem 0 1rem; }
  .t-section-title { font-size: 2.2rem; }

  /* Business directory map — hide on mobile, show cards only */
  #bizdir-layout > div:last-child { display: none; }

  /* Timeline */
  .timeline { padding-left: 0.5rem; }
  .tl-item { padding-left: 1rem; }

  /* Petrol chart */
  #fuel-chart { height: 120px !important; }

  /* Biz directory grid */
  #biz-grid { grid-template-columns: 1fr; }

  /* Sport section */
  #s-sport .g-auto { grid-template-columns: 1fr; }

  /* Food menus */
  #s-food .g-auto { grid-template-columns: 1fr; }

  /* Welfare cards */
  #s-welfare .g-auto { grid-template-columns: 1fr 1fr; }

  /* Emergency cards */
  #s-emergency .g-auto { grid-template-columns: 1fr 1fr; }

  /* Garbage bins grid */
  #s-garbage .g2 { grid-template-columns: 1fr; }
  #s-garbage .g3 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   CHART WRAPPERS
═══════════════════════════════════════ */
.chart-wrap {
  background: var(--ink);
  border-radius: var(--r-md);
  padding: 0.75rem;
  width: 100%;
}
canvas.w100 { display: block; width: 100% !important; }

/* Mayor comparison card */
.mayor-card {
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-md);
  padding: 1rem;
  display: flex; align-items: flex-start; gap: 0.9rem;
}
.mayor-av {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.1rem; color: var(--cream);
  flex-shrink: 0;
}
.mayor-name  { font-weight: 500; color: var(--parch); font-size: 0.88rem; }
.mayor-term  { font-size: 0.74rem; color: var(--dust-light); margin-bottom: 0.35rem; }
.mayor-stats { font-family: var(--font-mono); font-size: 0.68rem; color: var(--dust-light); }

/* Divider */
hr.div { border: none; border-top: 1px solid rgba(255,255,255,0.05); margin: 1.2rem 0; }

/* ═══════════════════════════════════════
   LOADING SHIMMER
═══════════════════════════════════════ */
.shimmer {
  background: linear-gradient(90deg, var(--ink-soft) 25%, var(--ink-lift) 50%, var(--ink-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
