/* ============================================================
   UK Water Sector Legal 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;
}

/* --- 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; }
}

/* ============================================================
   OUTCOMES PAGE
   ============================================================ */
.outcomes-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}
.outcomes-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 80px;
}
.outcome-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.4;
}
.outcome-list-item:hover { background: rgba(0,101,189,0.06); }
.outcome-list-item.active {
  background: #0065bd;
  color: #fff;
  font-weight: 600;
}
.outcome-list-id {
  font-size: 11px;
  font-weight: 700;
  min-width: 26px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}
.outcome-list-item.active .outcome-list-id { opacity: 1; }

.outcomes-detail {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  min-height: 300px;
}
.outcomes-detail h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}
.outcomes-detail h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.outcomes-detail p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
}
.outcome-signals {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #f0fdf4;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #065f46;
}
.outcome-signals strong { color: #047857; }
.outcome-sources {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.outcome-sources li a {
  font-size: 13.5px;
  color: #0065bd;
  text-decoration: none;
}
.outcome-sources li a:hover { text-decoration: underline; }
.outcome-cases {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.outcome-case-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
  border: 1px solid transparent;
}
.outcome-case-link:hover {
  border-color: var(--border);
  box-shadow: var(--card-shadow);
}
.outcome-case-link strong { font-size: 14px; }
.outcome-case-meta {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .outcomes-layout {
    grid-template-columns: 1fr;
  }
  .outcomes-list {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .outcome-list-item {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ============================================================
   THEMES PAGE
   ============================================================ */
.themes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.theme-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: box-shadow 0.15s;
}
.theme-card:hover { box-shadow: var(--card-hover-shadow); }
.theme-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.75rem;
}
.theme-card-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: #0065bd;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.theme-card-header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.theme-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 1rem;
}
.theme-card-outcomes {
  margin-bottom: 1rem;
  font-size: 13px;
}
.theme-card-cases {
  font-size: 13px;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.theme-case-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0.5rem;
}
.theme-case-link {
  display: block;
  padding: 8px 12px;
  background: var(--paper);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.theme-case-link:hover {
  border-color: var(--border);
  background: #fff;
}
.theme-case-link .muted { font-size: 12px; }

/* ============================================================
   TAG VARIANTS (outcome + theme pills)
   ============================================================ */
.outcome-tag {
  background: #dbeafe !important;
  color: #1e40af !important;
}
.theme-tag {
  background: #e0e7ff !important;
  color: #3730a3 !important;
}

/* ============================================================
   CASE DETAIL PAGE (querystring-based)
   ============================================================ */
.case-hero {
  padding: 3rem 2rem 2.5rem;
  color: #fff;
}
.case-hero-inner {
  max-width: 960px;
  margin: 0 auto;
}
.case-hero-breadcrumb {
  font-size: 13px;
  opacity: 0.8;
  margin-bottom: 1rem;
}
.case-hero-breadcrumb a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.case-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.case-hero-citation {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
}
.case-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}
.case-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.case-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.case-stat strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.case-stat span {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.case-section {
  margin-bottom: 2rem;
}
.case-section h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}
.case-section p {
  font-size: 14.5px;
  line-height: 1.75;
}
.case-section ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}
.case-section li {
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

/* --- Ontology tags --- */
.ontology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.ontology-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ontology-group strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.ontology-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  margin-right: 4px;
  margin-bottom: 4px;
}
.ontology-tag.asset { background: #dbeafe; color: #1e40af; }
.ontology-tag.process { background: #d1fae5; color: #065f46; }
.ontology-tag.hazard { background: #fee2e2; color: #991b1b; }
.ontology-tag.impact { background: #fef3c7; color: #92400e; }
.ontology-tag.governance { background: #ede9fe; color: #5b21b6; }
.ontology-tag.legal { background: #e0e7ff; color: #3730a3; }

/* Source link */
.source-link {
  display: inline-block;
  font-size: 13.5px;
  color: #0065bd;
  text-decoration: none;
  word-break: break-all;
}
.source-link:hover { text-decoration: underline; }
.source-type {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  text-transform: capitalize;
}
.full-study-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #0065bd;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
.full-study-link:hover { background: #004c8c; }

.muted { color: var(--muted); }

@media (max-width: 600px) {
  .case-hero { padding: 2rem 1rem 1.5rem; }
  .case-hero h1 { font-size: 1.4rem; }
  .case-content { padding: 0 1rem 2rem; }
  .ontology-grid { grid-template-columns: 1fr; }
  .case-stats-bar { gap: 1rem; }
}
