/* ==========================================================================
   Are We Open? — 대한민국 공공 웹사이트 LLM 친화성 평가
   Design: "Digital Hanji" — Korean traditional aesthetics meets modern data
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Noto+Sans+KR:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Background & Surface */
  --bg: #F5F1EB;
  --bg-warm: #EDE8DF;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;

  /* Text */
  --text-primary: #1C1C1E;
  --text-secondary: #5A5A5A;
  --text-tertiary: #8A8A8E;
  --text-inverse: #FFFFFF;

  /* Brand */
  --navy: #1B2A4A;
  --navy-light: #2D4A73;
  --vermillion: #C93545;
  --jade: #2A7F62;
  --gold: #B8860B;

  /* Grade Colors */
  --grade-aplus: #1A6B4A;
  --grade-a: #2A8F62;
  --grade-bplus: #2C6FB0;
  --grade-b: #5B9BD5;
  --grade-c: #C4963A;
  --grade-d: #D4763C;
  --grade-f: #C93545;

  /* Severity */
  --severity-critical: #C93545;
  --severity-major: #D4763C;
  --severity-minor: #C4963A;
  --severity-info: #5B9BD5;

  /* Border & Divider */
  --border: #E5E0D5;
  --border-light: #F0EBE3;
  --divider: #D5CFC3;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.06);
  --shadow-md: 0 4px 12px rgba(27, 42, 74, 0.08);
  --shadow-lg: 0 8px 24px rgba(27, 42, 74, 0.12);
  --shadow-xl: 0 16px 48px rgba(27, 42, 74, 0.16);

  /* Typography */
  --font-display: 'Black Han Sans', sans-serif;
  --font-body: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.2s;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--navy);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--vermillion); }

img { max-width: 100%; display: block; }

/* --- Texture Overlay (subtle hanji paper feel) --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 241, 235, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-logo .seal {
  width: 32px;
  height: 32px;
  background: var(--navy);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  transform: rotate(-2deg);
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-sm) 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--vermillion);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  margin: 4px 0;
  transition: all 0.3s var(--ease);
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section + .section {
  border-top: 1px solid var(--border-light);
}

/* --- Hero Section --- */
.hero {
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--divider));
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

.hero-title .accent {
  color: var(--vermillion);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.8;
}

/* Rotating Quotes */
.quote-carousel {
  position: relative;
  height: 3em;
  overflow: hidden;
  margin-bottom: var(--space-2xl);
}

.quote-carousel blockquote {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--ease);
  padding: 0 var(--space-lg);
}

.quote-carousel blockquote.active {
  opacity: 1;
  transform: translateY(0);
}

.quote-carousel cite {
  display: block;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-style: normal;
  margin-top: var(--space-xs);
}

/* Hero CTA */
.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--duration) var(--ease);
}

.btn-primary {
  background: var(--navy);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background: var(--navy-light);
  color: var(--text-inverse);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--navy);
  color: var(--navy);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text-primary); }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-flat {
  box-shadow: none;
}

.card-flat:hover {
  box-shadow: var(--shadow-sm);
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.stat-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

/* --- Grade Badge --- */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-inverse);
  transform: rotate(-2deg);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.grade-badge-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.grade-badge-lg {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

.grade-badge-xl {
  width: 96px;
  height: 96px;
  font-size: 2.5rem;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.grade-aplus { background: var(--grade-aplus); }
.grade-a { background: var(--grade-a); }
.grade-bplus { background: var(--grade-bplus); }
.grade-b { background: var(--grade-b); }
.grade-c { background: var(--grade-c); }
.grade-d { background: var(--grade-d); }
.grade-f { background: var(--grade-f); }

/* --- Grade Distribution Bar --- */
.grade-dist {
  display: flex;
  height: 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-warm);
}

.grade-dist-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  min-width: 24px;
  transition: flex 0.5s var(--ease);
}

/* --- Score Bar --- */
.score-bar-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.score-bar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: right;
}

.score-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-warm);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s var(--ease);
  background: var(--navy);
}

.score-bar-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 50px;
}

/* --- Table --- */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg-warm);
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
}

th:hover { color: var(--text-primary); }

th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  font-size: 0.7rem;
}

th.sorted .sort-icon { opacity: 1; }

td {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

tr:hover td { background: rgba(27, 42, 74, 0.02); }

tr:last-child td { border-bottom: none; }

.td-name {
  font-weight: 500;
  white-space: normal;
  max-width: 200px;
}

.td-name a {
  display: flex;
  flex-direction: column;
}

.td-name .name-en {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.td-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.td-mini-bar {
  width: 80px;
}

.mini-bar {
  height: 6px;
  background: var(--bg-warm);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease);
}

/* --- Severity Badges --- */
.severity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.severity-critical {
  background: rgba(201, 53, 69, 0.1);
  color: var(--severity-critical);
}
.severity-major {
  background: rgba(212, 118, 60, 0.1);
  color: var(--severity-major);
}
.severity-minor {
  background: rgba(196, 150, 58, 0.1);
  color: var(--severity-minor);
}
.severity-info {
  background: rgba(91, 155, 213, 0.1);
  color: var(--severity-info);
}

/* --- Issue Count Chips --- */
.issue-chips {
  display: flex;
  gap: var(--space-xs);
}

.issue-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0 6px;
}

/* --- Filters / Search --- */
.toolbar {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--duration) var(--ease);
}

.search-input:focus {
  outline: none;
  border-color: var(--navy);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.filter-group {
  display: flex;
  gap: var(--space-xs);
}

.filter-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.filter-btn:hover {
  border-color: var(--navy);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--text-inverse);
}

/* --- Section Headers --- */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --- Org Detail Page --- */
.org-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xl);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.org-header-info {
  flex: 1;
}

.org-header-info h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: var(--space-xs);
}

.org-header-info .org-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.org-header-info .org-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.org-score-summary {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
}

.org-total-score {
  text-align: center;
}

.org-total-score .score-number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.org-total-score .score-max {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* Category scores in detail */
.category-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.category-score-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.category-score-card .cat-name {
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 110px;
}

.category-score-card .cat-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-warm);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.category-score-card .cat-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s var(--ease);
}

.category-score-card .cat-score {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

/* --- Issues List --- */
.issue-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}

.issue-item:last-child { border-bottom: none; }

.issue-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 120px;
}

.issue-content {
  flex: 1;
}

.issue-content p {
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
}

.issue-content .issue-detail {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* --- Code Block (for suggested configs) --- */
.code-block {
  position: relative;
  background: #1E1E2E;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.code-block-title {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-mono);
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.btn-copy:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.btn-copy.copied {
  color: var(--jade);
  border-color: var(--jade);
}

.code-block pre {
  padding: var(--space-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #E0DEF4;
}

/* --- Crawler Status Grid --- */
.crawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
}

.crawler-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.crawler-status {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.crawler-status.allowed { background: var(--jade); }
.crawler-status.partial { background: var(--gold); }
.crawler-status.blocked { background: var(--vermillion); }
.crawler-status.unknown { background: var(--text-tertiary); }

.crawler-name {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
}

/* --- Info Box --- */
.info-box {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  margin: var(--space-xl) 0;
}

.info-box.warning {
  background: rgba(196, 150, 58, 0.06);
  border-left-color: var(--gold);
}

.info-box.info {
  background: rgba(91, 155, 213, 0.06);
  border-left-color: var(--severity-info);
}

.info-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: var(--space-3xl) 0;
  margin-top: var(--space-4xl);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: var(--space-md);
}

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  max-width: 400px;
}

.footer h4 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li { margin-bottom: var(--space-sm); }

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Disclaimers --- */
.disclaimer {
  padding: var(--space-lg);
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* --- Content Prose --- */
.prose {
  max-width: 720px;
  line-height: 1.9;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
  margin: var(--space-2xl) 0 var(--space-md);
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-md);
}

.prose p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.prose ul, .prose ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.prose li {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

/* --- Loading --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl);
  color: var(--text-tertiary);
}

.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: var(--space-md);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.6s var(--ease) both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-xl);
}

.tab {
  padding: var(--space-md) var(--space-lg);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
  font-family: var(--font-body);
  transition: color var(--duration) var(--ease);
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); }
.tab.active::after { transform: scaleX(1); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Update History --- */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 4px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--bg);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-xs);
}

.timeline-title {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .hero-title { font-size: 2rem; }
  .hero { padding: var(--space-2xl) 0; }
  .hero::before { height: 40px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .org-header { flex-direction: column; }
  .org-score-summary { width: 100%; justify-content: center; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom { flex-direction: column; gap: var(--space-sm); }

  .toolbar { flex-direction: column; align-items: stretch; }
  .filter-group { overflow-x: auto; padding-bottom: var(--space-sm); }

  table { font-size: 0.8rem; }
  th, td { padding: var(--space-sm) var(--space-md); }

  .category-scores { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .grade-badge-xl { width: 72px; height: 72px; font-size: 2rem; }
}

/* --- Page-specific: About scoring table --- */
.scoring-table {
  width: 100%;
  margin: var(--space-lg) 0;
}

.scoring-table th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}

.scoring-table td {
  white-space: normal;
  font-size: 0.85rem;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
  color: var(--text-tertiary);
}

.empty-state p {
  font-size: 1rem;
}

/* --- Tab panel transitions --- */
.tab-content {
  animation: fadeInUp 0.3s var(--ease) both;
}

/* --- Back link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  padding-top: var(--space-xl);
}

.back-link:hover { color: var(--navy); }

/* --- Donut chart (CSS-only for grade distribution) --- */
.donut-container {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  justify-content: center;
  flex-wrap: wrap;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-count {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-left: auto;
  padding-left: var(--space-md);
}
