/* ============================================================
   Propertia.nz — Property Development Feasibility
   Investment-memo style: dark hero, white content, premium feel
   ============================================================ */

/* ----- Design Tokens ----- */
:root {
  color-scheme: light;
  --ink: #111111;
  --ink-secondary: #555555;
  --ink-tertiary: #888888;
  --line: #e0e0e0;
  --line-light: #f2f2f2;
  --surface: #fafafa;
  --paper: #ffffff;
  --hero-bg: #0a0a0a;
  --hero-text: #f0f0f0;
  --hero-muted: #999999;
  --accent: #b08d57;
  --accent-soft: #f5f0e6;
  --blue: #3d6b8e;
  --blue-soft: #e8f0f5;
  --gold: #b08d57;
  --gold-soft: #f5f0e6;
  --red: #c0392b;
  --red-soft: #fce8e6;
  --purple: #6c5b7b;
  --purple-soft: #ede8f0;
  --shadow-sm: 0 1px 3px rgba(17, 17, 17, 0.06);
  --shadow-md: 0 4px 16px rgba(17, 17, 17, 0.08);
  --shadow-lg: 0 12px 40px rgba(17, 17, 17, 0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --transition: 200ms ease;
  --max-width: 1120px;
  --gutter: clamp(20px, 4vw, 56px);
  --gap: 24px;
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Inter,
    ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

/* ----- Typography ----- */
h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 780;
  line-height: 1.15;
}

h3 {
  font-size: 1.05rem;
  font-weight: 720;
}

p {
  color: var(--ink-secondary);
  line-height: 1.65;
  max-width: 720px;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 8px;
}

.eyebrow + h2 {
  margin-bottom: 12px;
}

.feature-number {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 860;
}

/* ----- Hero Section ----- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--hero-bg);
  color: var(--hero-text);
  display: flex;
  flex-direction: column;
}

.hero-top {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 24px var(--gutter);
}

.hero-brand,
.brand {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.1rem;
}

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 var(--gutter) 80px;
}

.hero-body h1 {
  color: white;
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--hero-muted);
  font-size: 1.1rem;
  margin-bottom: 48px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
  width: 100%;
}

.metric-tile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.metric-tile .metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.metric-tile .metric-label {
  font-size: 0.8rem;
  color: var(--hero-muted);
  margin-bottom: 2px;
}

.metric-tile .metric-note {
  font-size: 0.75rem;
  color: var(--hero-muted);
  opacity: 0.7;
}

/* ----- Sections ----- */
.section {
  padding: 80px var(--gutter);
}

.section > * {
  max-width: var(--max-width);
  margin-inline: auto;
}

.section:nth-of-type(even) {
  background: var(--paper);
}

.section:nth-of-type(odd) {
  background: var(--surface);
}

/* ----- Section Headers ----- */
.section-header {
  margin-bottom: 48px;
}

.section-header .eyebrow {
  margin-bottom: 8px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  color: var(--ink-secondary);
  max-width: 800px;
}

/* ----- Cards ----- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.card h3 {
  margin-bottom: 16px;
}

/* ----- Two-column & Three-column Layouts ----- */
.two-column {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.two-column.wide-left {
  grid-template-columns: 1.4fr 0.6fr;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ----- Option Cards ----- */
.option-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.option-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}

.option-card .option-letter {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.option-card .option-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.option-card .option-role {
  font-size: 0.75rem;
  color: var(--ink-tertiary);
}

.option-card.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.option-card.active .option-role {
  color: rgba(255, 255, 255, 0.7);
}

.option-card:hover:not(.active) {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ----- Option Detail ----- */
.option-detail {
  margin-top: 24px;
}

.option-detail:empty {
  display: none;
}

.option-detail-inner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.option-detail-inner:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.option-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.option-detail .mini-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mini-stat span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-tertiary);
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

/* ----- Status Pills ----- */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 720;
}

.status-good {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-watch {
  background: var(--gold-soft);
  color: var(--gold);
}

.status-risk {
  background: var(--red-soft);
  color: var(--red);
}

.status-option {
  background: var(--purple-soft);
  color: var(--purple);
}

/* ----- Badge ----- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 720;
  background: var(--blue-soft);
  color: var(--blue);
}

/* ----- Fact Table ----- */
.fact-table {
  display: grid;
  gap: 0;
}

.fact-table > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-light);
  gap: 12px;
}

.fact-table > div:last-child {
  border-bottom: none;
}

.fact-table > div span {
  font-size: 0.82rem;
  color: var(--ink-tertiary);
}

.fact-table > div strong {
  font-size: 0.9rem;
  color: var(--ink);
}

/* ----- Location Stack ----- */
.location-stack {
  display: grid;
  gap: 12px;
}

.location-stack > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.location-stack > div strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.location-stack > div span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* ----- Callout List ----- */
.callout-list {
  display: grid;
  gap: 10px;
}

.callout-list > * {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}

/* ----- Timeline ----- */
.timeline {
  display: grid;
  gap: 10px;
}

.timeline > * {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}

.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-item span {
  font-size: 0.8rem;
  color: var(--ink-tertiary);
  font-weight: 700;
}

.timeline-item strong {
  font-size: 0.88rem;
}

/* ----- Risk Matrix ----- */
.risk-matrix {
  display: grid;
  gap: 10px;
}

.risk-matrix > * {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.risk-item {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.risk-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.risk-item span {
  font-size: 0.8rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* ----- Gate Stack ----- */
.gate-stack {
  display: grid;
  gap: 10px;
}

.gate-stack > * {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}

/* ----- Persona List ----- */
.persona-list {
  display: grid;
  gap: 10px;
}

.persona-list > * {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}

.persona-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ----- Tables ----- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th {
  padding: 10px 8px;
  text-align: left;
  font-size: 0.75rem;
  color: var(--ink-tertiary);
  text-transform: uppercase;
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
}

td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-light);
  font-size: 0.85rem;
  vertical-align: top;
}

td.numeric,
th.numeric {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

tbody tr:hover {
  background: rgba(17, 17, 17, 0.03);
}

/* ----- Bar Charts (waterfall, DSCR, PC120) ----- */
.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.bar-row span {
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.bar-row strong {
  font-size: 0.85rem;
  text-align: right;
}

.bar-track {
  height: 14px;
  background: var(--line-light);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.bar-fill.negative {
  background: var(--red);
}

.bar-fill.warn {
  background: var(--gold);
}

.bar-fill.blue {
  background: var(--blue);
}

/* ----- Heatmap ----- */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(48px, 1fr));
  gap: 4px;
}

.heat-cell {
  min-height: 52px;
  border-radius: var(--radius-sm);
  padding: 8px;
  display: grid;
  align-content: center;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.heat-cell span {
  font-size: 0.68rem;
  color: var(--ink-secondary);
}

.heat-cell strong {
  font-size: 0.78rem;
}

/* ----- KPI Grid ----- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.kpi-item .kpi-value {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  margin: 8px 0 4px;
}

.kpi-item .kpi-label {
  font-size: 0.78rem;
  color: var(--ink-tertiary);
}

.kpi-item .kpi-note {
  font-size: 0.72rem;
  color: var(--ink-tertiary);
  opacity: 0.7;
}

/* ----- Radar Chart ----- */
.radar {
  width: 100%;
  min-height: 260px;
}

/* ----- SVG Diagrams ----- */
.site-svg,
.service-svg,
.location-svg,
.yield-svg {
  display: block;
  width: 100%;
}

.svg-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.svg-label.green {
  fill: var(--accent);
}

.svg-label.blue {
  fill: var(--blue);
}

.svg-label.red {
  fill: var(--red);
}

/* ----- Map Image ----- */
.map-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 760;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ----- Mini Note ----- */
.mini-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--ink-tertiary);
  line-height: 1.5;
}

/* ----- Check Grid ----- */
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.check-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-secondary);
  background: var(--surface);
}

/* ----- Three-Waters Status Cards ----- */
.waters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.water-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
}

.water-card.water-ok {
  border-color: var(--accent);
}

.water-card.water-warn {
  border-color: var(--gold);
}

.water-card.water-risk {
  border-color: var(--red);
}

.water-card h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.water-card p {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin: 0;
}

.water-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.water-ok .water-indicator {
  background: var(--accent);
}

.water-warn .water-indicator {
  background: var(--gold);
}

.water-risk .water-indicator {
  background: var(--red);
}

/* ----- Stress Grid ----- */
.stress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.stress-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.stress-item span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-tertiary);
}

.stress-item strong {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
}

/* ----- Selected Read (Drawer) ----- */
.selected-read {
  display: grid;
  gap: 0;
}

.read-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
}

.read-line:last-child {
  border-bottom: 0;
}

.read-line span {
  color: var(--ink-tertiary);
  font-size: 0.78rem;
}

.read-line strong {
  text-align: right;
  font-size: 0.84rem;
}

/* ----- Drawer ----- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}

.drawer-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.drawer-close {
  appearance: none;
  border: none;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink-secondary);
  padding: 4px;
}

/* Drawer Body */
.drawer-body {
  padding: 20px 24px;
}

/* Drawer Section */
.drawer-section {
  margin-bottom: 28px;
}

.drawer-section h3 {
  font-size: 0.85rem;
  color: var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

/* Option Picker (in drawer) */
.option-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.option-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 6px;
  cursor: pointer;
  font-weight: 780;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.option-btn.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.option-btn:hover:not(.active) {
  border-color: var(--accent);
}

/* Range Controls (in drawer) */
.range-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin-bottom: 16px;
}

.range-control span {
  color: var(--ink-secondary);
  font-size: 0.8rem;
}

.range-control strong {
  font-size: 0.84rem;
  font-weight: 700;
}

.range-control input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
}

/* Drawer Backdrop */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer Toggle Button */
.drawer-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 20px 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.drawer-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(17, 17, 17, 0.2);
}

.drawer-toggle-icon {
  font-size: 1.1rem;
}

/* ----- Dot Navigation ----- */
.dot-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dot-nav button {
  position: relative;
  appearance: none;
  border: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition);
}

.dot-nav button.active {
  background: var(--accent);
  transform: scale(1.4);
}

.dot-nav button:hover:not(.active) {
  background: var(--ink-secondary);
}

.dot-nav button::after {
  content: attr(title);
  position: absolute;
  right: 22px;
  white-space: nowrap;
  background: var(--ink);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.dot-nav button:hover::after {
  opacity: 1;
}

/* ----- Section Subtitle ----- */
.section-subtitle {
  color: var(--ink-secondary);
  font-size: 0.95rem;
  max-width: 800px;
  margin-bottom: 32px;
}

/* ----- Card Head ----- */
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-head h3 {
  margin-bottom: 0;
}

/* ----- Quick Facts Grid ----- */
.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.fact-tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.fact-tile span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-tertiary);
  margin-bottom: 4px;
}

.fact-tile strong {
  display: block;
  font-size: 0.88rem;
}

/* ----- Option Narrative Grid ----- */
.option-narrative-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

/* ----- Risk List (in option detail) ----- */
.risk-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.risk-list > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-secondary);
  background: var(--surface);
}

/* ----- Risk Cell (in risk matrix) ----- */
.risk-cell {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.risk-cell strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.risk-cell p {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ----- Waterfall / PC120 rows (aliases for bar-row) ----- */
.waterfall-row,
.pc-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.waterfall-row span,
.pc-row span {
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.waterfall-row strong,
.pc-row strong {
  font-size: 0.85rem;
  text-align: right;
}

/* ----- Waters Status ----- */
.waters-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.waters-status .card h3 {
  margin-bottom: 8px;
}

.waters-status .card p {
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0;
}

.waters-status .water-warn {
  border-color: var(--gold);
  border-width: 2px;
}

.waters-status .water-risk {
  border-color: var(--red);
  border-width: 2px;
}

.waters-status .water-ok {
  border-color: var(--accent);
  border-width: 2px;
}

/* ----- Source List ----- */
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-item {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-soft);
  transition: background var(--transition);
}

.source-item:hover {
  background: var(--accent);
  color: white;
}

/* ----- Caveat List ----- */
.caveat-list {
  display: grid;
  gap: 8px;
}

.caveat-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-secondary);
  background: var(--surface);
  line-height: 1.5;
}

/* ----- Active Row ----- */
.active-row {
  background: var(--accent-soft) !important;
}

/* ----- Site Footer ----- */
.site-footer {
  padding: 40px var(--gutter);
  text-align: center;
  display: flex;
  justify-content: center;
}

.site-footer .brand-name {
  color: var(--ink-tertiary);
}

/* ----- Hero Actions ----- */
.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--hero-text);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.link-button {
  color: var(--hero-muted);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.link-button:hover {
  color: white;
}

.brand-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--hero-muted);
}

/* ----- Utility Classes ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.gap-sm {
  gap: 10px;
}

.gap-md {
  gap: 20px;
}

.gap-lg {
  gap: 32px;
}

.mt-sm {
  margin-top: 12px;
}

.mt-md {
  margin-top: 24px;
}

.mt-lg {
  margin-top: 40px;
}

/* ----- Responsive (Mobile) ----- */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding-bottom: 60px;
  }

  .hero-content {
    padding: 40px var(--gutter);
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px var(--gutter);
  }

  .two-column,
  .two-column.wide-left,
  .three-col,
  .kpi-grid,
  .check-grid,
  .risk-grid,
  .risk-list,
  .option-detail-grid,
  .option-narrative-grid,
  .quick-facts,
  .waters-grid,
  .waters-status {
    grid-template-columns: 1fr;
  }

  .option-cards {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .option-picker {
    grid-template-columns: repeat(4, 1fr);
  }

  .bar-row,
  .waterfall-row,
  .pc-row {
    grid-template-columns: 1fr;
  }

  .bar-row span,
  .waterfall-row span,
  .pc-row span {
    font-size: 0.78rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .fact-table > div {
    grid-template-columns: 1fr;
  }

  .heatmap-grid {
    grid-template-columns: repeat(3, minmax(48px, 1fr));
  }

  .dot-nav {
    display: none;
  }

  .drawer {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .drawer-toggle {
    bottom: 16px;
    right: 16px;
  }

  .stress-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 600px;
  }

  .section-header p {
    max-width: 100%;
  }
}

/* ----- Print ----- */
@media print {
  .drawer,
  .drawer-toggle,
  .drawer-backdrop,
  .dot-nav {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 40px;
    break-after: page;
  }

  .section {
    padding: 24px 0;
    break-inside: avoid-page;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body {
    background: white;
  }
}
