/* assets/css/style.css — v15 teal refresh */
:root {
  --primary:       #0F766E;
  --primary-dark:  #0a5954;
  --primary-light: #ccfbf1;
  --accent:        #14B8A6;
  --accent-bright: #2DD4BF;
  --success:       #10B981;
  --warning:       #d97706;
  --danger:        #dc2626;
  --text:          #0F172A;
  --text-muted:    #64748B;
  --bg:            #F8FAFC;
  --bg-white:      #FFFFFF;
  --border:        #E2E8F0;
  --radius:        8px;
  --shadow:        0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(15,118,110,0.12);
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar { background: var(--bg-white); border-bottom: 2px solid var(--primary); position: sticky; top: 0; z-index: 1000; box-shadow: 0 1px 8px rgba(15,118,110,0.1); }
.nav-container { max-width: 1400px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; gap: 0.25rem; min-height: 52px; }
.nav-brand { font-size: 1rem; font-weight: 700; color: var(--text); padding: 0.75rem 0; margin-right: 0.5rem; white-space: nowrap; flex-shrink: 0; text-decoration: none; }
.nav-brand strong { color: var(--primary); }
.nav-menu { display: flex; align-items: center; gap: 0; padding: 0; margin-left: auto; flex-shrink: 0; }
.nav-item { position: relative; }
.nav-link { display: block; padding: 0.65rem 0.5rem; color: var(--text); font-size: 0.82rem; font-weight: 500; white-space: nowrap; border-radius: var(--radius); transition: background 0.2s, color 0.2s; cursor: pointer; }
.nav-link:hover { background: var(--primary-light); text-decoration: none; color: var(--primary); }
.nav-avatar { background: var(--primary); color: white; border-radius: 50%; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; padding: 0.5rem; color: var(--primary); flex-shrink: 0; }

/* ── Dropdowns ───────────────────────────────────────────────────────────────── */
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); min-width: 180px; box-shadow: var(--shadow-md); z-index: 9999; padding: 0.5rem 0; }
.has-dropdown.open > .dropdown { display: block; }
.has-dropdown.open > .dropdown.nav-systems-grid { display: grid; }
.dropdown li { display: block; }
.dropdown a { display: block; padding: 0.5rem 1rem; color: var(--text); font-size: 0.875rem; white-space: nowrap; }
.dropdown a:hover { background: var(--primary-light); text-decoration: none; color: var(--primary); }
.nav-systems-grid { grid-template-columns: 1fr 1fr; min-width: 340px; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1.25rem; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; text-decoration: none; line-height: 1; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-nav { background: var(--primary); color: white !important; padding: 0.4rem 0.9rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 600; }
.btn-teal { background: var(--accent); color: white; border-color: var(--accent); }
.btn-teal:hover { background: var(--primary); border-color: var(--primary); }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.main-content { min-height: calc(100vh - 200px); }
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 2rem 1rem; }
.container-lg { max-width: 1400px; margin: 0 auto; padding: 2rem 1rem; }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(140deg, #0a5954 0%, var(--primary) 45%, #0d7f78 100%);
  color: white;
  padding: 5rem 1rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 115%, rgba(45,212,191,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); font-weight: 800; margin-bottom: 1rem; letter-spacing: -0.02em; line-height: 1.15; }
.hero p { font-size: 1.1rem; opacity: 0.88; max-width: 600px; margin: 0 auto 2rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-btns .btn { font-size: 1rem; padding: 0.8rem 1.9rem; }
.hero-btns .btn-primary { background: var(--accent); border-color: var(--accent); }
.hero-btns .btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.hero-btns .btn-outline { color: white; border-color: rgba(255,255,255,0.55); }
.hero-btns .btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; }
.page-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; padding: 1.5rem 1rem 1.25rem; border-bottom: 3px solid rgba(255,255,255,0.1); }
.page-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.25rem; }
.page-header p { opacity: 0.8; margin-top: 0.25rem; font-size: 0.9rem; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card { background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.card-body { padding: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.card-text { font-size: 0.875rem; color: var(--text-muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }

/* ── System cards ────────────────────────────────────────────────────────────── */
.system-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; display: block; color: var(--text); }
.system-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); text-decoration: none; border-color: var(--accent-bright); }
.system-card .icon, .system-card-icon { font-size: 2rem; margin-bottom: 0.6rem; }
.system-card h3, .system-card-name { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.system-card p, .system-card-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.system-card-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.4rem; }

/* ── Stat cards (homepage) ───────────────────────────────────────────────────── */
.stat-feature-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-feature-card .sfc-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.stat-feature-card .sfc-val { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin: 0.15rem 0; line-height: 1; }
.stat-feature-card .sfc-val.coming { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); background: var(--primary-light); border-radius: 20px; padding: 3px 10px; display: inline-block; }
.stat-feature-card .sfc-label { font-size: 0.8rem; color: var(--text-muted); }

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.tab { padding: 0.75rem 1.25rem; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.form-control { width: 100%; padding: 0.6rem 0.85rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; font-family: var(--font); background: var(--bg-white); color: var(--text); transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,0.12); }
.form-text, .form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ── Alerts & Badges ─────────────────────────────────────────────────────────── */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.875rem; border: 1px solid transparent; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger, .alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--primary-light); border-color: #99f6e4; color: var(--primary-dark); }
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #f0fdf4; color: #166534; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-secondary { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--border); }
th { font-weight: 700; background: var(--bg); color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: var(--bg); }

/* ── Condition / disease pages ───────────────────────────────────────────────── */
.condition-layout { display: grid; grid-template-columns: 1fr 260px; gap: 2rem; }
.condition-sidebar { position: sticky; top: 80px; }
.section-anchor { padding-top: 1rem; margin-bottom: 1.5rem; }
.section-anchor h2 { font-size: 1.25rem; font-weight: 700; color: var(--primary); border-bottom: 2px solid var(--primary-light); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.toc { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.toc h4 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.75rem; }
.toc li { margin-bottom: 0.35rem; }
.toc a { font-size: 0.8rem; color: var(--text-muted); }
.toc a:hover { color: var(--primary); }

/* ── MLA callouts ────────────────────────────────────────────────────────────── */
/* .mla-highlight is used by the conditions-data render branch (kept here as it's
   shared with non-topic-template condition pages). .mla-notes-block has moved to
   assets/css/topic.css since it's topic-page-specific and was redesigned there. */
.mla-highlight {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: 1.25rem;
}
.mla-highlight h3 { color: #92400e; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }
.mla-tag { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.75rem; font-weight: 700; }

/* ── Profile ─────────────────────────────────────────────────────────────────── */
.profile-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; padding: 3rem 1rem; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; }
.profile-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.profile-card h3 { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; letter-spacing: 0.05em; }
.profile-section { margin-bottom: 2rem; }
.profile-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border); }
.profile-empty { font-size: 0.875rem; color: var(--text-muted); font-style: italic; }

/* ── Auth ────────────────────────────────────────────────────────────────────── */
.auth-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-box, .auth-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 460px; box-shadow: var(--shadow-md); }
.auth-box h1, .auth-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.75rem; }
.auth-wrapper { max-width: 460px; margin: 3rem auto; padding: 0 1rem; }
.auth-form .form-group { margin-bottom: 1.1rem; }
.auth-form label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }
.auth-form input, .auth-form select { width: 100%; padding: 0.6rem 0.85rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; font-family: var(--font); }
.auth-form input:focus, .auth-form select:focus { outline: none; border-color: var(--primary); }
.auth-links { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; }
.auth-links a { display: block; margin-bottom: 0.4rem; }

/* ── Admin ───────────────────────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--primary-dark); color: white; padding: 0 0 2rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar h2 { padding: 0.75rem 1.25rem 0.3rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.45); margin-top: 0.5rem; }
.admin-sidebar a { display: block; padding: 0.5rem 1.25rem; color: rgba(255,255,255,0.8); font-size: 0.85rem; text-decoration: none; transition: background 0.15s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.1); color: white; }
.admin-content { padding: 2rem; background: var(--bg); min-height: 100vh; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }
.admin-subheading { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }
.admin-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { background: var(--bg); padding: 0.6rem 0.75rem; text-align: left; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.admin-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg); }
.admin-table .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.table-responsive { overflow-x: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.stat-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; }
.stat-num { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-highlight .stat-num { color: var(--success); }
.stat-warn .stat-num { color: var(--warning); }
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--text-muted); }
.form-group label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; font-family: var(--font); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group small { color: var(--text-muted); font-size: 0.75rem; }

/* ── Cookie banner ───────────────────────────────────────────────────────────── */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--text); color: white; z-index: 9999; padding: 1rem; }
.cookie-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cookie-inner p { font-size: 0.875rem; flex: 1; margin: 0; }
.cookie-inner a { color: var(--accent-bright); }
.cookie-btns { display: flex; gap: 0.5rem; }

/* ── Question Bank ───────────────────────────────────────────────────────────── */
.question-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.question-text { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.option-btn { display: block; width: 100%; text-align: left; padding: 0.65rem 1rem; margin-bottom: 0.5rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--bg-white); cursor: pointer; font-size: 0.875rem; transition: all 0.2s; }
.option-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.option-btn.correct { border-color: var(--success); background: #f0fdf4; color: #166534; }
.option-btn.wrong { border-color: var(--danger); background: #fef2f2; color: #991b1b; }
.explanation { margin-top: 1rem; padding: 1rem; background: var(--primary-light); border-radius: var(--radius); font-size: 0.875rem; display: none; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer { background: #0a1628; color: rgba(255,255,255,0.8); padding: 3rem 1rem 1.5rem; }
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: white; font-size: 0.9rem; font-weight: 700; margin-bottom: 1rem; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.footer-col ul li a:hover { color: var(--accent-bright); text-decoration: none; }
.footer-col p { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem; }
.footer-bottom p { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-bottom: 0.4rem; }
.footer-legal { font-size: 0.75rem !important; }

/* ── Content pages ───────────────────────────────────────────────────────────── */
/* .page-hero moved to assets/css/topic.css (redesigned, compact version) — it was
   only ever used by the topic template, not other content-type pages. */
.page-main { min-height: 70vh; }
.content-grid { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; max-width: 1200px; margin: 0 auto; padding: 0 1rem 3rem; }
.content-section { margin-bottom: 2rem; }
.content-section h2 { font-size: 1.2rem; font-weight: 700; color: var(--primary); border-bottom: 2px solid var(--primary-light); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.content-section h3 { font-size: 1rem; font-weight: 700; margin: 1rem 0 0.5rem; }
.content-section ul, .content-section ol { padding-left: 1.25rem; line-height: 1.8; }
.content-section p { margin-bottom: 0.75rem; line-height: 1.7; }
.sidebar-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.sidebar-card h3 { font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }
.sidebar-links { padding: 0; }
.sidebar-links li { margin-bottom: 0.4rem; }
.sidebar-links a { font-size: 0.875rem; }
.mla-card { background: #fffbeb; border-color: #f59e0b; }
/* .prose moved to assets/css/topic.css — used only within t/index.php content branches. */
.formula-box { background: var(--primary-light); border-left: 4px solid var(--primary); padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; font-family: monospace; margin: 0.75rem 0; }
.empty-state-box { text-align: center; padding: 3rem; color: var(--text-muted); border: 2px dashed var(--border); border-radius: var(--radius); }
.info-banner { background: var(--primary-light); border: 1px solid #99f6e4; border-radius: var(--radius); padding: 2rem; }
.info-banner h2 { font-size: 1.2rem; font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 1.5rem; padding: 0 1rem 2rem; max-width: 1200px; margin: 0 auto; }
.feature-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; transition: box-shadow 0.2s, transform 0.2s; }
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card .card-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }
.card-locked { opacity: 0.6; }
code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.1rem 0.4rem; font-size: 0.85em; }
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--primary); }
.detail-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.detail-table th { text-align: left; width: 140px; padding: 0.4rem 0.75rem 0.4rem 0; color: var(--text-muted); font-weight: 600; vertical-align: top; white-space: nowrap; }
.detail-table td { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }

/* ── Legal pages ─────────────────────────────────────────────────────────────── */
.legal-page { max-width: 760px; margin: 0 auto; padding: 3rem 1rem; }
.legal-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.legal-date { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 2rem; }
.legal-page h2 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 0.75rem; color: var(--primary); }
.legal-page p { margin-bottom: 0.75rem; line-height: 1.7; }
.legal-page ul, .legal-page ol { padding-left: 1.5rem; margin-bottom: 1rem; line-height: 1.8; }
.legal-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
.legal-table th { background: var(--bg); padding: 0.6rem; text-align: left; border: 1px solid var(--border); font-weight: 700; }
.legal-table td { padding: 0.6rem; border: 1px solid var(--border); }

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .w-full { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .nav-search-wrap, .nav-search { max-width: 180px; }
  .nav-link { padding: 0.65rem 0.4rem; font-size: 0.78rem; }
  .nav-brand-ext { display: none; }
}
@media (max-width: 1020px) {
  .nav-search-wrap, .nav-search { max-width: 130px; }
  .nav-link { padding: 0.6rem 0.35rem; font-size: 0.75rem; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu { display: none; flex-direction: column; align-items: stretch; width: 100%; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-white); border-top: 1px solid var(--border); border-bottom: 2px solid var(--primary); box-shadow: var(--shadow-md); padding: 0.5rem 0; margin-left: 0; }
  .nav-menu.open { display: flex; }
  .nav-item { width: 100%; }
  .nav-link { padding: 0.75rem 1rem; border-radius: 0; }
  .has-dropdown.open > .dropdown { position: static; box-shadow: none; border: none; background: var(--bg); padding-left: 1rem; display: block; }
  .nav-systems-grid { grid-template-columns: 1fr; min-width: unset; }
  .condition-layout { grid-template-columns: 1fr; }
  .condition-sidebar { position: static; }
  .profile-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 3rem 1rem; }
  .hero h1 { font-size: 1.7rem; }
  .cookie-inner { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CURRICULUM STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
.section-panel-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.5rem; flex-wrap:wrap; }
.section-panel-title { font-size:1.2rem; font-weight:700; margin-bottom:0.2rem; }
.section-panel-count { font-size:0.8rem; color:var(--text-muted); }

.curriculum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.curriculum-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1rem 1rem 1.1rem; border-left: 3px solid var(--primary); transition: box-shadow 0.15s, border-left-color 0.15s, transform 0.15s; cursor: pointer; color: var(--text); display: block; }
.curriculum-card:hover { box-shadow: var(--shadow-md); border-left-color: var(--accent-bright); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.curriculum-card-stub { opacity: 0.65; border-left-style: dashed; }
.curriculum-card-stub:hover { opacity: 0.9; }
.curriculum-card-name { font-size: 0.9rem; font-weight: 600; line-height: 1.35; }
.curriculum-card-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.35rem; line-height: 1.4; }

/* .topic-layout, .topic-sidebar*, .topic-main, .topic-section, .topic-summary
   moved to assets/css/topic.css (redesigned) — used only by t/index.php. */
.content-coming { }
.content-coming-header { display:flex; align-items:center; gap:1rem; margin-bottom:2rem; padding-bottom:1.25rem; border-bottom:2px solid var(--border); }
.content-coming-icon { font-size:2.5rem; }
.content-coming-header h2 { font-size:1.4rem; font-weight:700; margin-bottom:0.2rem; }
.content-coming-header p { color:var(--text-muted); font-size:0.875rem; margin:0; }
.coming-sections { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:1rem; }
.coming-section { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:1.25rem; }
.coming-section h3 { font-size:0.9rem; font-weight:700; margin-bottom:0.4rem; }
.coming-soon-text { font-size:0.825rem; color:var(--text-muted); margin:0; font-style:italic; }

/* .topic-prevnext and .prevnext-* moved to assets/css/topic.css (redesigned). */

.topic-card { display: flex; align-items: center; gap: 0.75rem; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; transition: box-shadow 0.15s, transform 0.15s; color: var(--text); }
.topic-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.topic-card-num { font-size: 1.4rem; flex-shrink:0; }
.topic-card-body { flex: 1; min-width: 0; }
.topic-card-name { font-size: 0.9rem; font-weight: 600; }
.topic-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.topic-card-arrow { color: var(--text-muted); font-size: 1.25rem; flex-shrink:0; }

@media (max-width: 900px) {
  /* .topic-layout, .topic-sidebar, .topic-main, .prevnext-btn responsive rules
     moved to assets/css/topic.css */
  .curriculum-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .coming-sections { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH, DASHBOARD, LEARNING ENGINE
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-search-wrap { position:relative;flex:1;max-width:240px;margin:0 .4rem; }
.nav-search { display: flex; align-items: center; gap: 0; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; flex: 1; max-width: 240px; margin: 0 .4rem; }
.nav-search input { border: none; background: transparent; padding: .4rem .75rem; font-size: .85rem; flex: 1; min-width: 0; outline: none; font-family: var(--font); }
.nav-search button { background: none; border: none; padding: .4rem .6rem; cursor: pointer; font-size: 1rem; color: var(--text-muted); }
.nav-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }

#navSuggestDrop { position:absolute;top:100%;left:0;right:0;background:white;border:1px solid var(--border);border-top:none;border-radius:0 0 var(--radius) var(--radius);box-shadow:var(--shadow-md);z-index:9999;overflow:hidden;display:none; }
#navSuggestDrop a { display:flex;align-items:center;gap:.5rem;padding:.55rem .85rem;font-size:.82rem;color:var(--text);text-decoration:none;border-bottom:1px solid var(--border); }
#navSuggestDrop a:last-child { border-bottom:none; }
#navSuggestDrop a:hover { background:var(--primary-light);color:var(--primary); }
#navSuggestDrop .sug-icon { font-size:1rem;flex-shrink:0; }
#navSuggestDrop .sug-type { font-size:.65rem;color:var(--text-muted);margin-left:auto;flex-shrink:0; }

.heatmap-wrap { display:flex;gap:3px;flex-wrap:wrap; }
.heatmap-day { width:13px;height:13px;border-radius:3px; }
mark { background:#fef08a;color:inherit;border-radius:2px;padding:0 1px; }
.topic-complete-btn { display:inline-flex;align-items:center;gap:.4rem;padding:.45rem .9rem;border-radius:var(--radius);font-size:.82rem;font-weight:600;cursor:pointer;border:1.5px solid var(--border);background:var(--bg-white);color:var(--text);transition:all .15s; }
.topic-complete-btn.completed { background:#f0fdf4;color:#166534;border-color:#bbf7d0; }
.topic-complete-btn:hover { border-color:var(--primary); }

/* .topic-linked-cards, .related-topic-link, .objectives-block, .references-block
   moved to assets/css/topic.css (redesigned) — used only by t/index.php. */
.fc-browse-card { position:relative; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .nav-search-wrap { max-width:100%;margin:.5rem 0 0;order:10; }
  .nav-search { max-width: 100%; margin: .5rem 0 0; order: 10; }
  /* Mobile: override order:10 to keep search inline — see @media(max-width:430px) block below */
}

/* ═══════════════════════════════════════════════════════════════════════════
   MARKDOWN CONTENT
   .md-content moved to assets/css/topic.css (redesigned) — used only by
   t/index.php's render_markdown() output.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   TOPIC NOT YET POPULATED
   Moved to assets/css/topic.css (redesigned) — used only by t/index.php.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Systems grid ────────────────────────────────────────────────────────────── */
.systems-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTRIBUTORS PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.contributors-hero {
  background: linear-gradient(140deg, #0a5954 0%, var(--primary) 55%, #117a72 100%);
  color: white;
  padding: 3.5rem 1rem;
  position: relative;
  overflow: hidden;
}
.contributors-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 80% 50%, rgba(45,212,191,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.contributors-hero h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: 0.75rem; }
.contributors-hero .lead { font-size: 1.05rem; opacity: 0.88; max-width: 620px; }

.contributors-section { padding: 2.5rem 0; }
.contributors-section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--border); }
.contributors-section-header h2 { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.contributors-section-header .section-icon { font-size: 1.5rem; }

.contributor-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.contributor-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.contributor-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
  flex-shrink: 0;
}
.contributor-name { font-weight: 700; font-size: 0.95rem; }
.contributor-role { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.contributor-meta { font-size: 0.8rem; color: var(--text-muted); }
.contributor-summary { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; }
.contributor-linkedin { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 600; color: #0a66c2; }
.contributor-linkedin:hover { text-decoration: underline; }

.contributor-cta {
  background: linear-gradient(135deg, var(--primary-light), #e0faf7);
  border: 1px solid #99f6e4;
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  margin: 2rem 0 3rem;
}
.contributor-cta h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--primary-dark); }
.contributor-cta p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; max-width: 480px; margin-left: auto; margin-right: auto; }

.linkedin-notice { font-size: 0.78rem; color: var(--text-muted); margin-top: 1.5rem; display: flex; align-items: center; gap: 0.4rem; justify-content: center; }

/* Contributors grid */
.contributors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE HEADER — 320px to 430px
   Layout: Logo | Search (flex:1) | ☰
   Desktop and tablet layouts are completely unaffected.
   ═════════════════════════════════════════════════════════════════════════ */
@media (max-width: 430px) {

  /* Single-row flex container — no wrapping */
  .nav-container {
    padding: 0 0.75rem;
    gap: 0;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 52px;
  }

  /* Logo: compact, no shrink, drop the emoji on smallest screens */
  /* Hide entire logo on mobile phones — search expands to fill the space */
  .nav-brand {
    display: none;
  }

  .nav-brand-emoji {
    display: none;
  }

  /* Search wrap: flex:1 fills all available space between logo and toggle */
  .nav-search-wrap {
    flex: 1;
    max-width: none;
    margin: 0;
    order: 2;
    min-width: 0;
  }

  /* Search form: full width of its container, single row */
  .nav-search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0;
    order: 2;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    overflow: hidden;
    height: 36px;
  }

  .nav-search input {
    flex: 1;
    min-width: 0;
    padding: 0 0.6rem;
    font-size: 0.82rem;
    height: 100%;
    border: none;
    background: transparent;
    outline: none;
  }

  .nav-search button {
    padding: 0 0.5rem;
    flex-shrink: 0;
    height: 100%;
    font-size: 0.9rem;
  }

  .nav-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(15,118,110,0.12);
  }

  /* Hamburger: far right, consistent size */
  .nav-toggle {
    order: 3;
    flex-shrink: 0;
    margin-left: 0.5rem;
    padding: 0.35rem 0.4rem;
    font-size: 1.4rem;
    line-height: 1;
  }

  /* Subtle shadow under header on mobile */
  .navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  }

  /* Suggestion dropdown: full width under search */
  #navSuggestDrop {
    left: 0;
    right: 0;
    border-radius: 10px;
    top: calc(100% + 4px);
  }
}
