/* ============================================================
   DIR Case Study Wiki — Shared Stylesheet
   ============================================================ */

/* === DESIGN TOKENS (Steadfast Theme) === */
:root {
  --ink: #181d27;
  --paper: #f2f3f5;
  --accent: #c8962d;
  --accent-light: #f5edd8;
  --accent-dark: #8a6520;
  --muted: #6e7178;
  --border: #dcdfe4;
  --sidebar-bg: #e8eaed;
  --highlight: #fef3c7;
  --tag-todo: #fbbf24;
  --tag-ref: #f87171;
  --success: #059669;
  --card-bg: #fcfcfd;
  --stallion: #1e2330;
  --card-shadow: 0 1px 3px 0 rgba(30,35,48,0.06), 0 1px 2px -1px rgba(30,35,48,0.06);
  --card-hover-shadow: 0 10px 25px -5px rgba(30,35,48,0.1), 0 8px 10px -6px rgba(30,35,48,0.08);
}

/* === RESET === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

/* Gold text gradient utility */
.text-gradient-gold {
  background-image: linear-gradient(135deg, hsl(38, 75%, 55%), hsl(28, 70%, 45%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === TOP BAR === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(30,35,48,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 48px;
  font-size: 13px;
  border-bottom: 1px solid rgba(200,150,45,0.1);
}
.topbar-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-logo a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-logo .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
.topbar-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 13px;
  font-weight: 500;
}
.topbar-nav a { display: inline-flex; align-items: center; gap: 4px; }
.topbar-nav svg { width: 14px; height: 14px; flex-shrink: 0; }
.topbar-nav a {
  color: #fff;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.topbar-nav a:hover { opacity: 1; }
.topbar-nav a.active { opacity: 1; color: var(--accent); }

/* === HERO === */
.hero {
  background: var(--stallion) url('hero-abstract.jpg') right center/contain no-repeat;
  min-height: 200px;
  padding: 4rem 2rem 3.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--stallion) 25%, rgba(30,35,48,0.7) 55%, rgba(30,35,48,0.15) 100%);
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: 16px;
  opacity: 0.7;
  max-width: 540px;
  line-height: 1.6;
}
.hero-accent-line {
  width: 64px;
  height: 2px;
  background: var(--accent);
  margin-top: 1.5rem;
}
.hero-breadcrumb {
  font-size: 13px;
  opacity: 0.6;
  margin-bottom: 1rem;
  font-weight: 500;
}
.hero-breadcrumb a { color: #fff; text-decoration: none; }
.hero-breadcrumb a:hover { text-decoration: underline; }
.hero-breadcrumb span { opacity: 0.7; }
.hero-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.hero-tag {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* === STAT BAR (case study pages) === */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}
.stat-item {
  padding: 1.1rem 1.25rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  background-image: linear-gradient(135deg, hsl(38, 75%, 55%), hsl(28, 70%, 45%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* === LAYOUT (case study: TOC + content) === */
.layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  padding: 2rem;
  align-items: start;
}

/* === TABLE OF CONTENTS === */
.toc {
  position: sticky;
  top: 64px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  font-size: 13px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.toc-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.toc-toggle {
  display: none;
}
.toc a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  padding: 5px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: all 0.15s;
  line-height: 1.4;
}
.toc a:hover,
.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
  border-radius: 0 4px 4px 0;
}

/* === CONTENT AREA === */
.content { min-width: 0; }

/* === INFOBOX === */
.infobox {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
}
.infobox-header {
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Playfair Display', Georgia, serif;
}
.infobox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.infobox-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.infobox-item:nth-child(odd) { border-right: 1px solid var(--border); }
.infobox-item.full { grid-column: 1 / -1; border-right: none; }
.infobox-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}
.infobox-value {
  font-size: 14px;
  line-height: 1.55;
}

/* === COLLAPSIBLE SECTIONS === */
.section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  scroll-margin-top: 68px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.section-header:hover { background: var(--accent-light); }
.section-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.section-icon svg { width: 16px; height: 16px; }
.section-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: 1;
}
.section-toggle {
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.25s;
  display: flex;
  align-items: center;
}
.section-toggle svg { width: 18px; height: 18px; }
.section.collapsed .section-toggle { transform: rotate(-90deg); }
.section-body {
  padding: 1.25rem 1.5rem;
  line-height: 1.75;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.section.collapsed .section-body {
  max-height: 0;
  padding: 0 1.5rem;
}
.section-body p { margin-bottom: 0.85rem; }
.section-body p:last-child { margin-bottom: 0; }

/* === PRINCIPLE CARDS === */
.principle-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--paper);
  position: relative;
  padding-left: 1.5rem;
}
.principle-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--accent);
}
.principle-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--accent-dark);
}
.principle-card p {
  font-size: 13.5px;
  margin-bottom: 0 !important;
  color: #444;
}

/* === STATUS TAGS === */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}
.status-tag.todo { background: #fef3c7; color: #92400e; }

/* === TAPS GRID (China Hydraulic) === */
.taps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

/* === PAGE CONTENT (homepage + about) === */
.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}
.page-content.narrow {
  max-width: 800px;
}

/* === OVERVIEW STATS (homepage) === */
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.overview-stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.overview-stat-icon { color: var(--accent); margin-bottom: 6px; }
.overview-stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  background-image: linear-gradient(135deg, hsl(38, 75%, 55%), hsl(28, 70%, 45%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.overview-stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* === FILTER GROUPS (homepage) === */
.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.filter-group:last-of-type {
  margin-bottom: 2rem;
}
.filter-group label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.filter-btn:hover { border-color: rgba(200,150,45,0.4); color: var(--ink); }
.filter-btn.active {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 600;
}

/* === WORLD MAP (homepage) === */
.map-section {
  margin-bottom: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.map-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.map-section-header label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.map-reset-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.map-reset-btn:hover { border-color: var(--accent); color: var(--accent); }
.map-reset-btn.hidden { display: none; }
.world-map-container {
  display: flex;
  justify-content: center;
}
.world-map-container svg { max-width: 100%; height: auto; }
.map-region {
  fill: #d4d0ca;
  stroke: #fff;
  stroke-width: 0.5;
  cursor: pointer;
  transition: fill 0.2s, opacity 0.2s;
}
.map-region:hover { fill: var(--accent); opacity: 0.7; }
.map-region.active { fill: var(--accent); opacity: 1; }
.map-region.dimmed { opacity: 0.3; }
.map-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 4px;
  font-weight: 600;
  fill: var(--muted);
  pointer-events: none;
  text-anchor: middle;
}
.map-label.active { fill: var(--accent-dark); font-weight: 700; }
.map-count {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 3.2px;
  fill: var(--muted);
  pointer-events: none;
  text-anchor: middle;
}
.map-count.active { fill: var(--accent); }

/* === CASE STUDY CARDS (homepage) === */
.studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.study-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.study-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-hover-shadow);
}
.study-card-banner { height: 3px; flex-shrink: 0; }
.study-card-body {
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.study-card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.study-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.2s;
}
.study-card:hover .study-card-title { color: var(--accent); }
.study-card-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}
.study-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.study-card-tag {
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.study-card-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.study-card-footer .status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.active { background: #059669; }
.status-dot.draft { background: #f59e0b; }
.status-dot.planned { background: #94a3b8; }

/* === NO RESULTS (homepage) === */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  display: none;
}
.no-results h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.no-results p { font-size: 14px; }

/* === ABOUT SECTIONS === */
.about-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
}
.about-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.about-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.about-section-icon svg { width: 16px; height: 16px; }
.about-section-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.about-section-body {
  padding: 1.25rem 1.5rem;
  line-height: 1.75;
}
.about-section-body p { margin-bottom: 0.85rem; }
.about-section-body p:last-child { margin-bottom: 0; }
.about-section-body a { color: var(--accent); text-decoration: none; }
.about-section-body a:hover { text-decoration: underline; }
.structure-list {
  list-style: none;
  margin: 0.75rem 0;
}
.structure-list li {
  padding: 0.6rem 0 0.6rem 1.25rem;
  border-left: 3px solid var(--accent);
  margin-bottom: 0.5rem;
  background: var(--paper);
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  line-height: 1.55;
}
.structure-list li strong { color: var(--accent-dark); }

/* === FOOTER === */
.footer {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* === RESPONSIVE === */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
  .toc {
    position: static;
    max-height: none;
  }
  .toc-links { display: none; }
  .toc.open .toc-links { display: block; }
  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
  }
  .toc-toggle::after {
    content: '\25BE';
    font-size: 16px;
    transition: transform 0.2s;
  }
  .toc.open .toc-toggle::after { transform: rotate(180deg); }
  .infobox-grid { grid-template-columns: 1fr; }
  .infobox-item:nth-child(odd) { border-right: none; }
  .stat-bar { grid-template-columns: 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
  .hero { padding: 2rem 1.5rem; min-height: auto; background-image: none; }
  .hero::before { background: none; }
  .page-content { padding: 1.5rem 1rem; }
  .overview-stats { grid-template-columns: repeat(2, 1fr); }
  .studies-grid { grid-template-columns: 1fr; }
  .taps-grid { grid-template-columns: 1fr; }
  .map-section { padding: 1rem; }
  .related-grid { grid-template-columns: 1fr; }
  .principles-grid { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .search-bar input { width: 100%; }
}

/* === PRINT === */
@media print {
  .topbar, .toc, .map-section, .filter-group, .no-results { display: none !important; }
  .layout { grid-template-columns: 1fr; gap: 1rem; }
  .hero { background: #1e2330 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section { break-inside: avoid; page-break-inside: avoid; }
  .section.collapsed .section-body { max-height: none; padding: 1.25rem 1.5rem; }
  .section-toggle { display: none; }
  .study-card { break-inside: avoid; page-break-inside: avoid; }
  body { font-size: 12px; }
}

/* === SEARCH BAR (homepage) === */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}
.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--ink);
  transition: border-color 0.15s;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,101,189,0.12);
}
.reset-filters-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.reset-filters-btn:hover { border-color: var(--accent); color: var(--accent); }

/* === PRINCIPLE CARD LINKS (principles page) === */
.principle-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.principle-card-links a {
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.principle-card-links a:hover {
  background: var(--accent);
  color: var(--ink);
}

/* === PRINCIPLES GRID (principles page) === */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.principles-grid .principle-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  padding: 0;
  margin-bottom: 0;
  border-left: none;
}
.principles-grid .principle-card::before { display: none; }
.principle-card-accent { height: 6px; }
.principle-card-body { padding: 1.25rem 1.5rem; flex: 1; }
.principle-card-icon {
  width: 40px; height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 0.75rem;
}
.principle-card-icon svg { width: 20px; height: 20px; }
.principle-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.principle-card-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.principle-card-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  font-size: 12px;
  color: var(--muted);
}

/* === RELATED STUDIES (case study pages) === */
.related-studies {
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.related-studies-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}
.related-studies h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.related-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--card-shadow);
}
.related-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-hover-shadow);
}
.related-card-banner {
  height: 6px;
  flex-shrink: 0;
}
.related-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-card-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.related-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.related-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

/* === GLOSSARY (glossary page) === */
.glossary-search {
  margin-bottom: 1.5rem;
}
.glossary-search input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--ink);
  transition: border-color 0.15s;
}
.glossary-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,101,189,0.12);
}
.glossary-list {
  margin: 0;
}
.glossary-group {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.5rem;
  margin-bottom: 0.75rem;
}
.glossary-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
  letter-spacing: -0.01em;
}
.glossary-list dt {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-dark);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.glossary-letter + dt {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.glossary-list dd {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0.25rem 0 0 0;
}
.glossary-ref {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}
.glossary-ref a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.glossary-ref a:hover { text-decoration: underline; }
.glossary-no-results {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 14px;
}

/* === TRANSLATE WIDGET === */
.translate-widget {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 200;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 12px;
}
.translate-widget .goog-te-gadget { font-size: 0; }
.translate-widget .goog-te-gadget > span { display: none; }
.translate-widget select { font-size: 12px; }

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.study-card,
.section,
.infobox,
.stat-bar,
.about-section {
  animation: fadeUp 0.5s ease both;
}
.study-card:nth-child(2),
.section:nth-child(2),
.about-section:nth-child(2) { animation-delay: 0.05s; }
.study-card:nth-child(3),
.section:nth-child(3),
.about-section:nth-child(3) { animation-delay: 0.1s; }
.study-card:nth-child(4),
.section:nth-child(4),
.about-section:nth-child(4) { animation-delay: 0.15s; }
.study-card:nth-child(5) { animation-delay: 0.2s; }
.study-card:nth-child(6) { animation-delay: 0.25s; }
.study-card:nth-child(7) { animation-delay: 0.3s; }
.study-card:nth-child(8) { animation-delay: 0.35s; }
.study-card:nth-child(9) { animation-delay: 0.4s; }
.study-card:nth-child(10) { animation-delay: 0.45s; }

/* ============================================================
   7-MINUTE RESILIENCE DIAGNOSTIC
   ============================================================ */

/* --- Container --- */
.assess-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* --- Demo tag --- */
.assess-demo-tag {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Landing page --- */
.diag-landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.diag-landing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.diag-landing-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.diag-card-icon {
  font-size: 32px;
  margin-bottom: 1rem;
  color: var(--accent);
}
.diag-card-icon svg { width: 32px; height: 32px; }
.diag-landing-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.diag-landing-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.diag-card-action {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-top: auto;
}
.diag-card-start:hover .diag-card-action { text-decoration: underline; }
.diag-card-explore { cursor: default; }

/* Case study tiles */
.diag-case-tiles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.diag-case-tile {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s;
  width: 100%;
}
.diag-case-tile:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.diag-case-tile-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.diag-case-tile-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.diag-landing-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.diag-landing-footer a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.diag-landing-footer a:hover { color: var(--accent); text-decoration: underline; }

/* Case study diagnostic walkthrough */
.diag-case-overview {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.diag-dx-header {
  margin-bottom: 1.5rem;
}
.diag-dx-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
.diag-dx-header p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.diag-dx-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.diag-dx-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.diag-dx-title-left h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.diag-dx-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.diag-dx-case-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.diag-dx-case-link:hover { text-decoration: underline; }
.diag-dx-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.diag-dx-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.diag-dx-section:nth-child(2) { border-right: none; }
.diag-dx-section:nth-child(n+3) {
  grid-column: 1 / -1;
  border-right: none;
}
.diag-dx-section:last-child { border-bottom: none; }
.diag-dx-step-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}
.diag-dx-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.diag-dx-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1px;
}
.diag-dx-field-value {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}
.diag-dx-sub-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
  margin-top: 10px;
}
.diag-dx-sub-label:first-of-type { margin-top: 0; }
.diag-dx-outcomes {
  margin: 0 0 0 1.1rem;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.diag-dx-outcomes li { margin-bottom: 2px; }
.diag-dx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.diag-dx-tag {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}
.diag-dx-stakeholders {
  margin: 0 0 0 1.1rem;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.diag-dx-stakeholders li { margin-bottom: 2px; }
.diag-dx-principle-row {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.diag-dx-principle-row:last-child { border-bottom: none; }
.diag-dx-principle-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.diag-dx-p-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.diag-dx-p-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 140px;
}
.diag-dx-p-score-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.diag-dx-p-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.diag-dx-p-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.diag-dx-p-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  min-width: 28px;
}
.diag-dx-p-conf {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.diag-dx-p-conf.conf-high { background: #d1fae5; color: #065f46; }
.diag-dx-p-conf.conf-medium { background: #fef3c7; color: #92400e; }
.diag-dx-p-conf.conf-low { background: #fee2e2; color: #991b1b; }
.diag-dx-p-reflection {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 4px 0 0 36px;
  line-height: 1.5;
}
.diag-dx-decision-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.diag-dx-d-label {
  font-size: 13px;
  font-weight: 600;
  min-width: 100px;
  color: var(--ink);
}
.diag-dx-d-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.diag-dx-d-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.diag-dx-d-val {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.diag-dx-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--paper);
}
.diag-dx-view-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.diag-dx-view-btn:hover { color: var(--accent-dark); text-decoration: underline; }

@media (max-width: 800px) {
  .diag-dx-sections { grid-template-columns: 1fr; }
  .diag-dx-section { border-right: none !important; }
  .diag-dx-field-grid { grid-template-columns: 1fr; }
  .diag-dx-principle-header { flex-wrap: wrap; }
  .diag-dx-p-name { min-width: auto; }
  .diag-dx-p-score-group { width: 100%; margin-left: 36px; }
  .diag-dx-title-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* --- Progress bar --- */
.assess-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0;
  flex-wrap: wrap;
}
.assess-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  cursor: default;
}
.assess-progress-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--card-bg);
  transition: all 0.2s;
}
.assess-progress-step.active .assess-progress-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.assess-progress-step.completed .assess-progress-dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.assess-progress-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}
.assess-progress-step.active .assess-progress-label { color: var(--accent); }
.assess-progress-step.completed .assess-progress-label { color: var(--success); }
.assess-progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: 16px;
  min-width: 20px;
  max-width: 60px;
}

/* --- Steps --- */
.assess-step {
  display: none;
  animation: fadeUp 0.3s ease both;
}
.assess-step.active { display: block; }

.assess-step-header {
  margin-bottom: 1.5rem;
}
.assess-iso-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.assess-step-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.assess-step-header p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* --- Form fields --- */
.assess-field {
  margin-bottom: 1.25rem;
}
.assess-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}
.assess-field input,
.assess-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--ink);
  transition: border-color 0.15s;
}
.assess-field input:focus,
.assess-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,101,189,0.12);
}

/* --- List sections --- */
.assess-list-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.assess-list-section h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.assess-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  font-family: 'Source Sans 3', system-ui, sans-serif;
}
.assess-list-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.assess-list-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--paper);
}
.assess-list-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* --- Concerns grid --- */
.diag-concern-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.diag-concern-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.diag-concern-item:hover { border-color: var(--accent); }
.diag-concern-item input { accent-color: var(--accent); }

/* --- Principle cards (Step 3) --- */
.diag-principle-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.diag-principle-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.diag-principle-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.diag-principle-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.diag-principle-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Score buttons */
.assess-score-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.assess-score-btn {
  flex: 1;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.assess-score-btn:hover { border-color: var(--accent); }
.assess-score-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.assess-score-num {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1;
}
.assess-score-text {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.8;
}
.assess-score-btn.active .assess-score-text { opacity: 1; }

/* Confidence */
.assess-confidence-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.assess-confidence-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.assess-confidence-btn {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--card-bg);
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  transition: all 0.15s;
}
.assess-confidence-btn:hover { border-color: var(--accent); }
.assess-confidence-btn.active.conf-high { background: #d1fae5; color: #065f46; border-color: #059669; }
.assess-confidence-btn.active.conf-medium { background: #fef3c7; color: #92400e; border-color: #d97706; }
.assess-confidence-btn.active.conf-low { background: #fee2e2; color: #991b1b; border-color: #dc2626; }

/* Reflection toggle */
.diag-refl-toggle {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
}
.diag-refl-toggle:hover { color: var(--accent); }
.diag-refl-wrap {
  margin-top: 8px;
}

/* Reflection textarea */
.assess-reflection-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
  min-height: 50px;
  line-height: 1.6;
  transition: border-color 0.15s;
}
.assess-reflection-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,101,189,0.12);
}

/* --- Decision cards (Step 4) --- */
.diag-decision-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}
.diag-decision-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.diag-decision-prompt {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* --- Results --- */
.results-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.results-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
}
.results-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--ink);
}
.results-chart-col canvas {
  max-width: 100%;
}

/* Maturity card */
.diag-maturity-card {
  margin-bottom: 1rem;
  background: var(--stallion);
  color: #fff;
  border: none;
}
.diag-maturity-card h3 { color: #fff; }
.diag-maturity-header {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.diag-maturity-bar-wrap {
  flex: 1;
}
.maturity-score {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.maturity-label {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.5rem;
}
.maturity-bar {
  height: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}
.maturity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, hsl(38, 75%, 60%), hsl(38, 75%, 50%), hsl(28, 70%, 45%));
  border-radius: 5px;
  transition: width 0.5s ease;
}
.maturity-pct {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

/* Gap rows */
.diag-gap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.diag-gap-row:last-child { border-bottom: none; }
.diag-gap-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.diag-gap-name {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.diag-gap-score {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* PDCA grid */
.diag-pdca-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.diag-pdca-cell {
  padding: 10px;
  background: var(--paper);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.diag-pdca-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 4px;
}
.diag-pdca-score {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.diag-pdca-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.diag-pdca-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.diag-pdca-desc {
  font-size: 10px;
  color: var(--muted);
}

/* Decision confidence map */
.diag-decision-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.diag-decision-row:last-child { margin-bottom: 0; }
.diag-decision-row-label {
  font-size: 13px;
  font-weight: 600;
  min-width: 100px;
}
.diag-decision-bar-wrap {
  flex: 1;
}
.diag-decision-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 3px;
}
.diag-decision-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.diag-decision-bar-text {
  font-size: 11px;
  color: var(--muted);
}

/* Case study link card */
.diag-case-link {
  margin-bottom: 1rem;
}
.diag-case-read-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
.diag-case-read-btn:hover { background: var(--accent-dark); }

/* Suggestions */
.suggestions-list {
  margin: 0;
  padding: 0 0 0 1.25rem;
}
.suggestions-list li {
  margin-bottom: 0.5rem;
  font-size: 14px;
  line-height: 1.6;
}

.assess-muted { color: var(--muted); font-size: 14px; }

/* --- Export --- */
.export-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.assess-export-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s;
}
.assess-export-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.export-icon {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  align-self: flex-start;
}
.export-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.export-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* --- SDG Inference --- */
.sdg-inference { margin-top: 1.5rem; padding: 1rem 1.2rem; background: #faf9f7; border-radius: 8px; border: 1px solid #e5e3df; }
.sdg-inference h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.sdg-inference p { font-size: 0.88rem; color: #6b6560; line-height: 1.6; margin-bottom: 0.75rem; }
.sdg-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sdg-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 600; color: #fff; white-space: nowrap; }

/* --- Navigation --- */
.assess-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.assess-nav-btn {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  background: var(--card-bg);
  color: var(--ink);
}
.assess-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.assess-nav-next {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.assess-nav-next:hover { background: var(--accent-dark); color: #fff; }
.assess-nav-status {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* --- Storage controls --- */
.assess-storage {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 0 2rem;
}
.assess-storage-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--muted);
  transition: all 0.15s;
}
.assess-storage-btn:hover { border-color: var(--accent); color: var(--accent); }
.assess-storage-btn.saved { border-color: var(--success); color: var(--success); }
.assess-storage-clear:hover { border-color: #dc2626; color: #dc2626; }

/* --- Assessment responsive --- */
@media (max-width: 800px) {
  .assess-container { padding: 1.5rem 1rem; }
  .diag-landing-cards { grid-template-columns: 1fr; }
  .assess-progress { gap: 2px; }
  .assess-progress-line { min-width: 8px; }
  .assess-score-selector { flex-wrap: wrap; }
  .assess-score-btn { min-width: 48px; }
  .results-layout { grid-template-columns: 1fr; }
  .export-actions { grid-template-columns: 1fr; }
  .diag-concern-grid { grid-template-columns: 1fr; }
  .diag-pdca-grid { grid-template-columns: 1fr; }
  .diag-maturity-header { flex-direction: column; gap: 1rem; }
  .diag-decision-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .diag-decision-row-label { min-width: auto; }
}

/* --- Assessment print --- */
@media print {
  .assess-progress, .assess-nav, .assess-storage,
  .assess-export-btn, .diag-refl-toggle, .diag-case-tiles,
  .diag-landing-footer, #step0 { display: none !important; }
  .assess-step { display: block !important; page-break-inside: avoid; }
  .assess-step-header { page-break-after: avoid; }
  .assess-score-btn { border: 1px solid #ccc; }
  .assess-score-btn.active { background: #c8962d !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .diag-maturity-card { background: #1e2330 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   WATER QUALITY ONTOLOGY EXPLORER
   ============================================================ */

/* --- Tabs --- */
.wq-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.wq-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.wq-tab:hover { color: var(--ink); }
.wq-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* --- Panels --- */
.wq-panel { display: none; }
.wq-panel.active { display: block; animation: fadeUp 0.3s ease both; }

.wq-intro {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* --- Search --- */
.wq-search {
  margin-bottom: 1rem;
}
.wq-search input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--ink);
  transition: border-color 0.15s;
}
.wq-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,101,189,0.12);
}

/* --- Determinand grid --- */
.wq-det-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.wq-det-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.15s;
}
.wq-det-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.wq-det-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.wq-det-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.wq-det-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.wq-det-def {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* --- Threshold bar --- */
.wq-threshold-bar {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.wq-th-segment {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  min-width: 0;
}
.wq-th-good { background: #d1fae5; }
.wq-th-moderate { background: #fef3c7; }
.wq-th-poor { background: #fee2e2; }
.wq-th-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.wq-th-good .wq-th-label { color: #065f46; }
.wq-th-moderate .wq-th-label { color: #92400e; }
.wq-th-poor .wq-th-label { color: #991b1b; }
.wq-th-value {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.wq-th-good .wq-th-value { color: #047857; }
.wq-th-moderate .wq-th-value { color: #b45309; }
.wq-th-poor .wq-th-value { color: #dc2626; }

/* --- Determinand meta --- */
.wq-det-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.wq-det-source, .wq-det-stat {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.wq-det-onto {
  margin-top: 4px;
}
.wq-det-onto code {
  font-size: 11px;
  background: var(--paper);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--muted);
}

/* --- Category filter buttons --- */
.wq-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.wq-cat-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--card-bg);
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  transition: all 0.15s;
}
.wq-cat-btn:hover { border-color: var(--accent); color: var(--accent); }
.wq-cat-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* --- Glossary items --- */
.wq-gloss-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.wq-gloss-item:hover { border-color: var(--accent); }
.wq-gloss-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.wq-gloss-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 2px 8px;
  border-radius: 3px;
}
.wq-gloss-head h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.wq-gloss-code {
  font-size: 11px;
  background: var(--paper);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--muted);
}
.wq-gloss-item > p {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.wq-gloss-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.wq-gloss-meta code {
  font-size: 11px;
  background: var(--paper);
  padding: 1px 4px;
  border-radius: 3px;
}
.wq-gloss-notes {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.25rem;
}

/* --- Section 82 --- */
.wq-s82-content {
  max-width: 720px;
}
.wq-s82-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.wq-s82-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 1.5rem 0 0.5rem;
}
.wq-s82-content p {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

/* --- Live monitoring --- */
.wq-live-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.wq-live-controls select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--ink);
}
.wq-live-controls select:focus {
  outline: none;
  border-color: var(--accent);
}
.wq-btn {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.wq-btn:hover { background: var(--accent-dark); }

.wq-live-status {
  margin-bottom: 1rem;
  font-size: 13px;
}
.wq-loading { color: var(--accent); font-weight: 600; }
.wq-loading::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: wq-spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes wq-spin { to { transform: rotate(360deg); } }
.wq-live-card--pending { opacity: 0.6; animation: wq-pulse 1.5s ease-in-out infinite; }
@keyframes wq-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 0.8; } }
.wq-ok { color: #059669; font-weight: 600; }
.wq-warn { color: #d97706; font-weight: 600; }

.wq-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.wq-live-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.15s;
}
.wq-live-card:hover { border-color: var(--accent); }
.wq-live-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.wq-live-river {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.wq-live-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.wq-live-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.wq-live-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}
.wq-live-param {
  color: var(--accent);
}
.wq-live-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* --- WQ live card determinands --- */
.wq-live-dets {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.wq-live-det {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  line-height: 1.6;
  gap: 6px;
}
.wq-live-det-name {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.wq-live-det-thresholds {
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10px;
}
.wq-th-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 2px;
  margin-left: 6px;
  vertical-align: 1px;
}
.wq-th-dot--good { background: #16a34a; }
.wq-th-dot--mod { background: #d97706; }
.wq-th-dot--poor { background: #dc2626; }

/* --- WQ responsive --- */
@media (max-width: 800px) {
  .wq-tabs { overflow-x: auto; }
  .wq-tab { white-space: nowrap; padding: 8px 14px; font-size: 13px; }
  .wq-det-grid { grid-template-columns: 1fr; }
  .wq-live-grid { grid-template-columns: 1fr; }
  .wq-live-controls { flex-direction: column; }
}


/* ============================================================
   WATER QUALITY DASHBOARD (from DIRwiki)
   Appended for water-dashboard.html
   Conflicting selectors (.wq-search, .wq-btn, .wq-loading)
   are scoped under .wq-dashboard-page
   ============================================================ */

   WATER QUALITY DASHBOARD
   ============================================================ */

/* --- Freshness Bar --- */
.wq-freshness-bar {
  background: var(--stallion); color: #fff; font-size: 12px; padding: 6px 2rem;
  border-bottom: 1px solid rgba(200,150,45,0.15);
}
.wq-freshness-inner { display: flex; align-items: center; gap: 8px; max-width: 1400px; margin: 0 auto; }
.wq-freshness-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wq-freshness-dot.wq-fresh { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.wq-freshness-dot.wq-stale { background: #f59e0b; }
.wq-freshness-dot.wq-old { background: #ef4444; }
.wq-freshness-right { margin-left: auto; opacity: 0.7; }

/* --- Hero --- */
.wq-hero {
  background: linear-gradient(135deg, var(--stallion) 0%, #2a3142 100%);
  color: #fff; padding: 2.5rem 2rem 2rem; text-align: center;
}
.wq-hero-inner { max-width: 700px; margin: 0 auto; }
.wq-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem;
  background-image: linear-gradient(135deg, hsl(38,75%,55%), hsl(28,70%,45%));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.wq-hero-sub { font-size: 14px; opacity: 0.7; line-height: 1.5; }

/* --- Flood Panel --- */
.wq-flood-panel { background: #fef2f2; border-bottom: 2px solid #fca5a5; padding: 1rem 2rem; }
.wq-section-inner { max-width: 1400px; margin: 0 auto; }
.wq-flood-panel h2 { font-size: 16px; margin-bottom: 0.75rem; color: #991b1b; }
.wq-flood-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.75rem; }
.wq-flood-card { padding: 0.75rem 1rem; border-radius: 8px; font-size: 13px; }
.wq-flood-severe { background: #fee2e2; border-left: 4px solid #ef4444; }
.wq-flood-warning { background: #fff7ed; border-left: 4px solid #f59e0b; }
.wq-flood-alert { background: #fefce8; border-left: 4px solid #eab308; }
.wq-flood-header { font-weight: 600; margin-bottom: 4px; }
.wq-flood-msg { opacity: 0.8; margin-bottom: 4px; }
.wq-flood-time { font-size: 11px; opacity: 0.6; }

/* --- Dashboard Layout --- */
.wq-dashboard { padding: 1.5rem 2rem; background: var(--paper); }
.wq-dashboard-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* --- Cards --- */
.wq-card {
  background: var(--card-bg); border-radius: 10px; border: 1px solid var(--border);
  box-shadow: var(--card-shadow); overflow: hidden;
}
.wq-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); gap: 0.75rem;
}
.wq-card-header h3 { font-size: 14px; font-weight: 700; margin: 0; }
.wq-badge { background: var(--accent); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }

/* --- Map --- */
.wq-map { height: 420px; }
.wq-map-controls { display: flex; gap: 0.5rem; flex-shrink: 0; }
.wq-select {
  font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-family: inherit; max-width: 200px;
}
.wq-dashboard-page .wq-search {
  font-size: 12px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-family: inherit; width: 180px;
}
.wq-summary-bar {
  display: flex; gap: 1rem; padding: 8px 1rem; background: #f8f9fa; font-size: 12px; font-weight: 600;
}
.wq-summary-item { display: flex; align-items: center; gap: 4px; }
.wq-summary-item.wq-good::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #059669; }
.wq-summary-item.wq-moderate::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.wq-summary-item.wq-info::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #6366f1; }

/* --- Station Cards Grid --- */
.wq-station-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem; padding: 1rem; max-height: 500px; overflow-y: auto;
}
.wq-station-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 0.75rem; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
  font-size: 13px;
}
.wq-station-card:hover { box-shadow: var(--card-hover-shadow); border-color: var(--accent); }
.wq-sc-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.wq-sc-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.wq-dot-active { background: #059669; }
.wq-dot-inactive { background: #9ca3af; }
.wq-sc-river { font-size: 11px; color: var(--muted); }
.wq-sc-reading { font-size: 18px; font-weight: 700; margin: 6px 0; color: var(--ink); }
.wq-sc-value { color: var(--accent-dark); }
.wq-sc-nodata { font-size: 12px; color: var(--muted); font-weight: 400; }
.wq-sc-trend { font-size: 14px; opacity: 0.5; }
.wq-sc-catchment { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.wq-sc-footer { font-size: 10px; color: var(--muted); margin-top: 4px; border-top: 1px solid var(--border); padding-top: 4px; }

/* --- Pagination --- */
.wq-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.75rem; font-size: 13px; }
.wq-pagination button {
  background: var(--accent); color: #fff; border: none; padding: 4px 12px;
  border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.wq-pagination button:hover { background: var(--accent-dark); }

/* --- Station Detail --- */
.wq-btn-close {
  background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted);
  padding: 0 4px; line-height: 1;
}
.wq-detail-body { padding: 1rem; }
.wq-dm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1rem; font-size: 12px; }
.wq-dm-grid strong { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }

/* --- Sections --- */
.wq-section { padding: 0 2rem; margin-bottom: 1rem; }
.wq-section-toggle {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.wq-section-toggle h2 { font-size: 16px; margin: 0; }
.wq-toggle-icon { transition: transform 0.2s; width: 20px; height: 20px; }
.wq-collapsible { display: none; padding: 1rem 0; }
.wq-collapsible.wq-open { display: block; }

/* --- Determinands Table --- */
.wq-det-controls { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.wq-table-wrap { overflow-x: auto; }
.wq-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wq-table th {
  background: var(--stallion); color: #fff; padding: 8px 12px; text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
  position: sticky; top: 0;
}
.wq-table th:hover { background: #2a3142; }
.wq-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.wq-table td small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.wq-table tbody tr:hover { background: var(--accent-light); }
.wq-table-sm { font-size: 12px; }
.wq-table-sm th, .wq-table-sm td { padding: 6px 8px; }
.wq-th-good { color: #10b981 !important; }
.wq-th-mod { color: #f59e0b !important; }
.wq-th-poor { color: #ef4444 !important; }
.wq-td-good { color: #059669; font-weight: 600; }
.wq-td-mod { color: #d97706; font-weight: 600; }
.wq-td-poor { color: #dc2626; font-weight: 600; }
.wq-cat-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.wq-cat-physical { background: #dbeafe; color: #1e40af; }
.wq-cat-chemical { background: #fef3c7; color: #92400e; }
.wq-cat-biological { background: #d1fae5; color: #065f46; }

/* --- Export --- */
.wq-export-section { padding-bottom: 2rem; }
.wq-export-section h2 { font-size: 16px; margin-bottom: 0.75rem; }
.wq-export-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.wq-dashboard-page .wq-btn {
  background: var(--card-bg); border: 1px solid var(--border); padding: 8px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.wq-dashboard-page .wq-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Attribution --- */
.wq-attribution {
  background: var(--stallion); color: rgba(255,255,255,0.5); font-size: 11px;
  padding: 1rem 2rem; text-align: center; line-height: 1.5;
}

/* --- Loading state --- */
.wq-dashboard-page .wq-loading { padding: 2rem; text-align: center; color: var(--muted); font-size: 13px; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .wq-dashboard-inner { grid-template-columns: 1fr; }
  .wq-map { height: 300px; }
  .wq-dm-grid { grid-template-columns: repeat(2, 1fr); }
  .wq-map-controls { flex-direction: column; }
  .wq-dashboard-page .wq-search { width: 100%; }
  .wq-station-grid { grid-template-columns: 1fr 1fr; }
  .wq-freshness-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .wq-freshness-right { margin-left: 0; }
}
@media (max-width: 500px) {
  .wq-hero h1 { font-size: 1.5rem; }
  .wq-station-grid { grid-template-columns: 1fr; }
  .wq-dm-grid { grid-template-columns: 1fr; }
  .wq-export-buttons { flex-direction: column; }
  .wq-det-controls { flex-direction: column; }
}

/* ============================================================
   SDG Layer — Badges, Contribution Section, Mapping Page
   ============================================================ */

/* --- SDG Badges (reusable chips) --- */
.sdg-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sdg-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 12px;
  font-size: 0.72rem; font-weight: 600; color: #fff;
  white-space: nowrap; line-height: 1.4;
}

/* --- SDG Contribution Section (case study detail) --- */
.sdg-contribution { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid #e5e3df; }
.sdg-contribution-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.sdg-contribution-intro { font-size: 0.88rem; color: #6b6560; margin-bottom: 1.5rem; line-height: 1.6; }

.sdg-goal-grid { display: grid; gap: 1rem; }
.sdg-goal-card {
  background: #faf9f7; border-radius: 8px; padding: 1rem 1.2rem;
  border: 1px solid #e5e3df;
}
.sdg-goal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 0.6rem; }
.sdg-goal-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sdg-goal-name { font-weight: 600; font-size: 0.92rem; }

.sdg-target-item { display: flex; gap: 8px; margin-top: 0.5rem; font-size: 0.84rem; line-height: 1.5; }
.sdg-target-num {
  flex-shrink: 0; font-weight: 600; color: #4a4540;
  min-width: 70px;
}
.sdg-target-text { color: #6b6560; }

/* --- SDG Mapping Page --- */
.sdg-mapping-page h2 { margin-top: 2rem; margin-bottom: 0.75rem; font-size: 1.3rem; }
.sdg-mapping-intro { margin-bottom: 2rem; }
.sdg-mapping-intro p { font-size: 0.92rem; color: #4a4540; line-height: 1.7; margin-bottom: 0.8rem; }
.sdg-mapping-note { font-size: 0.85rem; color: #6b6560; margin-bottom: 1.2rem; font-style: italic; }

.sdg-crosswalk { display: grid; gap: 1rem; margin-bottom: 2rem; }
.sdg-crosswalk-row {
  display: grid; grid-template-columns: 200px 1fr; gap: 1rem;
  padding: 1rem; background: #faf9f7; border-radius: 8px; border: 1px solid #e5e3df;
  align-items: start;
}
.sdg-crosswalk-principle { font-size: 0.92rem; padding-top: 2px; }
.sdg-crosswalk-targets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sdg-crosswalk-target-list {
  width: 100%; font-size: 0.8rem; color: #6b6560; margin-top: 4px;
}

.sdg-goal-overview { display: grid; gap: 0.75rem; margin-bottom: 2rem; }
.sdg-overview-card {
  display: flex; align-items: center; gap: 12px;
  padding: 0.75rem 1rem; background: #faf9f7; border-radius: 8px;
  border: 1px solid #e5e3df;
}
.sdg-overview-card.sdg-secondary { opacity: 0.75; }
.sdg-overview-label {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 1px 8px; border-radius: 10px; margin-left: 8px;
  background: #e8e6e2; color: #6b6560;
}

.sdg-case-matrix { display: grid; gap: 0.5rem; margin-bottom: 2rem; }
.sdg-matrix-row {
  display: grid; grid-template-columns: 200px 1fr; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid #eae8e4;
  align-items: center;
}
.sdg-matrix-goal { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.sdg-matrix-studies { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.88rem; }
.sdg-matrix-link { color: var(--accent, #b45309); text-decoration: none; }
.sdg-matrix-link:hover { text-decoration: underline; }
.sdg-matrix-count { font-size: 0.78rem; color: #6b6560; }

/* --- SDG Filter (homepage) --- */
.sdg-filter-group { margin-top: 8px; }

/* --- SDG in assessment results --- */
.sdg-inference { margin-top: 1.5rem; padding: 1rem 1.2rem; background: #faf9f7; border-radius: 8px; border: 1px solid #e5e3df; }
.sdg-inference h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.sdg-inference p { font-size: 0.88rem; color: #6b6560; line-height: 1.6; margin-bottom: 0.75rem; }
.sdg-inference .sdg-badges { margin-top: 8px; }

/* --- Responsive --- */
@media (max-width: 700px) {
  .sdg-crosswalk-row { grid-template-columns: 1fr; }
  .sdg-matrix-row { grid-template-columns: 1fr; }
  .sdg-goal-grid { grid-template-columns: 1fr; }
}

/* SDG link styling */
.sdg-badge { text-decoration: none; cursor: pointer; transition: opacity 0.15s; }
.sdg-badge:hover { opacity: 0.85; }
.sdg-goal-name-link { color: inherit; text-decoration: none; }
.sdg-goal-name-link:hover { text-decoration: underline; }
