/* ============================================================
   Halcyon Health — Knowledge Hub Stylesheet
   Premium Edition — March 2026
   ============================================================ */

/* ----- Custom Properties ----------------------------------- */
:root {
  --psychiatrist: #0B7070;
  --psychiatrist-light: #E6F4F4;
  --psychiatrist-glow: rgba(11, 112, 112, 0.15);
  --psychologist: #B85C45;
  --psychologist-light: #FAF0EE;
  --np: #6B7280;
  --np-light: #F3F4F6;
  --dva: #B45309;
  --dva-light: #FEF3C7;
  --ndis: #1E40AF;
  --ndis-light: #EFF6FF;
  --adhd: #7C3AED;
  --adhd-light: #F5F3FF;
  --adhd-glow: rgba(124, 58, 237, 0.15);
  --crisis: #DC2626;
  --success: #16A34A;
  --warning: #D97706;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-muted: #64748B;
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --crisis-height: 40px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px -10px rgba(0,0,0,0.12);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.5);
}

/* ----- Dark Mode ------------------------------------------- */
[data-theme="dark"] {
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-elevated: #334155;
  --border: #334155;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --psychiatrist-light: #0B3D3D;
  --psychologist-light: #3D2218;
  --np-light: #1F2937;
  --dva-light: #451A03;
  --ndis-light: #172554;
  --adhd-light: #2E1065;
  --glass-bg: rgba(30, 41, 59, 0.85);
  --glass-border: rgba(51, 65, 85, 0.5);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

[data-theme="dark"] .card-critical { background: #2D1215; }
[data-theme="dark"] .card-warning  { background: #2D2305; }
[data-theme="dark"] .card-info     { background: #1A2744; }
[data-theme="dark"] .card-success  { background: #0D2818; }
[data-theme="dark"] .correction-row { background: #2D2305 !important; }
[data-theme="dark"] .correction-banner { background: #2D2305; }
[data-theme="dark"] tbody tr:nth-child(even) { background: rgba(255,255,255,0.03); }
[data-theme="dark"] tbody tr:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] thead { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .search-bar input,
[data-theme="dark"] #global-search,
[data-theme="dark"] #hero-search,
[data-theme="dark"] #glossary-filter { background: var(--surface-elevated); border-color: var(--border); color: var(--text); }

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition-base), color var(--transition-base);
}

::selection { background: var(--psychiatrist); color: #fff; }

/* ----- Typography ------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

a { color: var(--psychiatrist); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: #095e5e; text-decoration: underline; }

blockquote {
  border-left: 3px solid var(--psychiatrist);
  padding: 0.85rem 1.25rem;
  margin: 1rem 0;
  background: var(--psychiatrist-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.6;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  letter-spacing: -0.02em;
}

.text-muted { color: var(--text-muted); }
.text-crisis { color: var(--crisis); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
small, .small { font-size: 0.85rem; }
strong { font-weight: 600; }

/* ----- Top Bar --------------------------------------------- */
.topbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--topbar-height);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

.topbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.5rem;
  gap: 1rem;
  max-width: 100%;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--psychiatrist);
  flex-shrink: 0;
  text-decoration: none;
}
.topbar-logo:hover { text-decoration: none; }
.topbar-logo img { height: 32px; width: auto; }

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-spacer { flex-shrink: 1; }

#global-search, #hero-search, #glossary-filter {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

#global-search:focus, #hero-search:focus, #glossary-filter:focus {
  border-color: var(--psychiatrist);
  box-shadow: 0 0 0 4px var(--psychiatrist-glow);
  background: var(--surface);
}

#global-search::placeholder, #hero-search::placeholder, #glossary-filter::placeholder { color: var(--text-muted); }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.hamburger:hover { background: var(--bg); }

/* Dark mode toggle in topbar */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  color: var(--text);
}
.theme-toggle:hover { background: var(--bg); border-color: var(--psychiatrist); }

/* ----- Crisis Bar ------------------------------------------ */
.crisis-bar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: 100%;
  height: var(--crisis-height);
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  z-index: 99;
  padding: 0 1rem;
  letter-spacing: 0.01em;
}
.crisis-bar a { color: #fff; text-decoration: underline; font-weight: 700; }
.crisis-bar a:hover { opacity: 0.9; }

/* ----- Sidebar --------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding-top: calc(var(--topbar-height) + var(--crisis-height));
  overflow-y: auto;
  z-index: 90;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-header {
  padding: 1rem 1.25rem 0.5rem;
}

.sidebar-brand {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
}
.sidebar-brand:hover { color: var(--psychiatrist); text-decoration: none; }

.nav-list { list-style: none; padding: 0.25rem 0.5rem; }
.nav-list li { margin-bottom: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg);
  text-decoration: none;
}

.nav-item.active {
  background: var(--psychiatrist-light);
  color: var(--psychiatrist);
  font-weight: 600;
  border-color: rgba(11, 112, 112, 0.1);
}

.nav-item.locked { opacity: 0.45; }

.nav-icon { width: 22px; text-align: center; flex-shrink: 0; font-size: 1rem; }

/* ----- Main Content ---------------------------------------- */
.content {
  margin-left: var(--sidebar-width);
  max-width: 1100px;
  padding: 2rem 2.5rem;
  padding-top: calc(var(--topbar-height) + var(--crisis-height) + 2rem);
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section { margin-bottom: 2.5rem; }

/* ----- Hero ------------------------------------------------ */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2rem;
}

.hero h1 {
  margin-bottom: 0.5rem;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--psychiatrist) 0%, #0D9696 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero .search-bar-lg {
  max-width: 540px;
  margin: 0 auto;
  display: block;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: 9999px;
  border: 2px solid var(--border);
  transition: all var(--transition-fast);
}
.hero .search-bar-lg:focus {
  border-color: var(--psychiatrist);
  box-shadow: 0 0 0 6px var(--psychiatrist-glow), var(--shadow-lg);
}

/* ----- Cards ----------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

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

.card-psychiatrist { border-left: 4px solid var(--psychiatrist); }
.card-psychologist { border-left: 4px solid var(--psychologist); }
.card-np { border-left: 4px solid var(--np); }
.card-dva { border-left: 4px solid var(--dva); }
.card-ndis { border-left: 4px solid var(--ndis); }
.card-adhd { border-left: 4px solid var(--adhd); }

.card-critical {
  border-left: 4px solid var(--crisis);
  background: #FEF2F2;
}

.card-warning {
  border-left: 4px solid var(--warning);
  background: #FFFBEB;
}

.card-info {
  border-left: 4px solid #3B82F6;
  background: #EFF6FF;
}

.card-success {
  border-left: 4px solid var(--success);
  background: #F0FDF4;
}

/* Subtle gradient accent on colored cards */
.card-psychiatrist::before,
.card-adhd::before,
.card-ndis::before,
.card-dva::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.card-psychiatrist::before { background: linear-gradient(90deg, var(--psychiatrist), transparent); }
.card-adhd::before { background: linear-gradient(90deg, var(--adhd), transparent); }
.card-ndis::before { background: linear-gradient(90deg, var(--ndis), transparent); }
.card-dva::before { background: linear-gradient(90deg, var(--dva), transparent); }
.card-psychiatrist:hover::before,
.card-adhd:hover::before,
.card-ndis:hover::before,
.card-dva:hover::before { opacity: 1; }

/* ----- Tables ---------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead {
  background: var(--bg);
}

thead th { font-weight: 600; font-family: 'DM Sans', sans-serif; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
td, th { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
tbody tr { transition: background var(--transition-fast); }
tbody tr:nth-child(even) { background: rgba(248,250,252,0.5); }
tbody tr:hover { background: rgba(241,245,249,0.8); }
.correction-row { background: #FEF9C3 !important; }
.correction-row td { font-weight: 500; }

/* ----- Accordion ------------------------------------------- */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}
.accordion:hover { box-shadow: var(--shadow-sm); }

.accordion-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.93rem;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  transition: background var(--transition-fast);
}
.accordion-header:hover { background: var(--bg); }

.accordion-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--psychiatrist);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.accordion-icon {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.accordion.active .accordion-icon { transform: rotate(45deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.25rem;
}

.accordion.active .accordion-body {
  max-height: 2000px;
  padding: 0 1.25rem 1.25rem;
}

/* ----- Badges ---------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2em 0.65em;
  border-radius: 9999px;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-purple { background: #F3E8FF; color: #6B21A8; }

/* ----- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--psychiatrist); color: #fff; border-color: var(--psychiatrist); }
.btn-primary:hover { background: #095e5e; box-shadow: 0 4px 12px var(--psychiatrist-glow); }

.btn-secondary { background: transparent; color: var(--psychiatrist); border-color: var(--psychiatrist); }
.btn-secondary:hover { background: var(--psychiatrist-light); }

.btn-adhd { background: var(--adhd); color: #fff; }
.btn-adhd:hover { background: #6D28D9; box-shadow: 0 4px 12px var(--adhd-glow); }

.btn-ndis { background: var(--ndis); color: #fff; }
.btn-ndis:hover { background: #1E3A8A; }

.btn-dva { background: var(--dva); color: #fff; }
.btn-dva:hover { background: #92400E; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }

/* Wizard choice buttons — large interactive */
.btn-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  flex: 1;
  min-width: 160px;
}
.btn-choice:hover {
  border-color: var(--psychiatrist);
  background: var(--psychiatrist-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.btn-choice.selected {
  border-color: var(--psychiatrist);
  background: var(--psychiatrist-light);
  box-shadow: 0 0 0 3px var(--psychiatrist-glow);
}
.btn-choice-icon { font-size: 2rem; }
.btn-choice-label { font-weight: 600; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; }
.btn-choice-desc { font-size: 0.78rem; color: var(--text-muted); }

.choice-group { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }

/* ----- Tabs ------------------------------------------------ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  position: relative;
}
.tab:hover { color: var(--text); }

.tab.active {
  color: var(--psychiatrist);
  border-bottom-color: var(--psychiatrist);
  font-weight: 600;
}

.tabs-sm .tab { padding: 0.5rem 1rem; font-size: 0.82rem; }

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ----- Tile Grid ------------------------------------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.tile-grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }

.tile {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.tile::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--psychiatrist);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}
.tile:hover::after { transform: scaleX(1); }

.tile:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  text-decoration: none;
  border-color: transparent;
}

.tile-icon { font-size: 1.75rem; line-height: 1; flex-shrink: 0; }

.tile-body { flex: 1; min-width: 0; }

.tile-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.tile-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.tile-sm {
  padding: 0.75rem;
  gap: 0.5rem;
  align-items: center;
}
.tile-sm .tile-icon { font-size: 1.2rem; }
.tile-label { font-weight: 500; font-size: 0.85rem; }

/* ----- Search UI ------------------------------------------- */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  max-height: 380px;
  overflow-y: auto;
  z-index: 110;
  display: none;
}
.search-dropdown.open { display: block; animation: slideDown 0.2s ease; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.search-result {
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg); }
.search-result .result-title { font-weight: 600; font-size: 0.9rem; }
.search-result .result-page { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-left: 0.5rem; }
.search-result .result-snippet { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; line-height: 1.4; }
.search-result mark { background: #FEF08A; color: inherit; padding: 0 2px; border-radius: 2px; }

.search-recent { padding: 0.5rem 1rem; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }

/* ----- Progress Bar ---------------------------------------- */
.progress-bar-container { margin-bottom: 1.5rem; }

.progress-bar {
  height: 10px;
  border-radius: 9999px;
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--psychiatrist), #0D9696);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ----- Wizard ---------------------------------------------- */
.wizard { margin-bottom: 1.5rem; }

.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.wizard-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.wizard-indicator.active { color: var(--psychiatrist); font-weight: 600; }
.wizard-indicator.active .step-num { border-color: var(--psychiatrist); background: var(--psychiatrist); color: #fff; box-shadow: 0 0 0 4px var(--psychiatrist-glow); }
.wizard-indicator.completed .step-num { border-color: var(--success); background: var(--success); color: #fff; }

.wizard-connector { flex: 1; height: 2px; background: var(--border); margin: 0 0.75rem; transition: background var(--transition-base); }
.wizard-connector.completed { background: var(--success); }

.wizard-step { display: none; animation: fadeInUp 0.3s ease; }
.wizard-step.active { display: block; }

/* Result card from wizard */
.result-card {
  background: linear-gradient(135deg, var(--psychiatrist-light) 0%, var(--surface) 100%);
  border: 2px solid var(--psychiatrist);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}
.result-card h4 { color: var(--psychiatrist); margin-bottom: 0.75rem; }
.result-card .result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.result-item { text-align: center; }
.result-item .result-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.result-item .result-value { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 1.3rem; color: var(--psychiatrist); }
.result-item .result-value.mono { font-family: 'JetBrains Mono', monospace; }

/* ----- Checklist ------------------------------------------- */
.checklist { display: flex; flex-direction: column; gap: 0.25rem; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.checklist-item:hover { background: var(--bg); }

.checklist-item input[type="checkbox"] {
  accent-color: var(--psychiatrist);
  width: 18px; height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.checklist-item span { font-size: 0.9rem; line-height: 1.5; }
.checklist-item input:checked + span { text-decoration: line-through; color: var(--text-muted); }

/* ----- Alert / Correction Banner --------------------------- */
.correction-banner {
  background: #FEF9C3;
  border-left: 4px solid var(--warning);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ----- Locked Overlay -------------------------------------- */
.locked-overlay { position: relative; }
.locked-overlay::after {
  content: '🔒 Locked — complete activation checklist';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ----- Chatbot --------------------------------------------- */
.chatbot-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--psychiatrist), #0D9696);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 20px var(--psychiatrist-glow);
  z-index: 50;
  transition: all var(--transition-base);
}
.chatbot-btn:hover { transform: scale(1.1) rotate(5deg); box-shadow: 0 8px 30px var(--psychiatrist-glow); }

.chatbot-panel {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 380px;
  max-height: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 51;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chatbot-panel.open { display: flex; animation: slideUp 0.3s ease; }

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.chatbot-header {
  padding: 1rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--psychiatrist-light), var(--surface));
}

.chatbot-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); padding: 0.25rem; border-radius: 50%; transition: all var(--transition-fast); }
.chatbot-close:hover { background: var(--bg); color: var(--text); }

.chatbot-body { flex: 1; overflow-y: auto; padding: 1rem; }

.chatbot-footer {
  padding: 0.85rem;
  border-top: 1px solid var(--border);
}

.chatbot-footer input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition-fast);
}
.chatbot-footer input:focus { border-color: var(--psychiatrist); }

/* ----- Flow Diagram ---------------------------------------- */
.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 1.5rem 0;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-base);
}
.flow-step:hover { border-color: var(--psychiatrist); box-shadow: var(--shadow-md); }

.flow-step-adhd { border-color: var(--adhd); }
.flow-step-psychiatrist { border-color: var(--psychiatrist); }

.flow-step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--psychiatrist);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  flex-shrink: 0;
}

.flow-step-adhd .flow-step-num { background: var(--adhd); }

.flow-step-content { flex: 1; }
.flow-step-content strong { display: block; font-size: 0.92rem; }
.flow-step-detail { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }

.flow-arrow {
  text-align: center;
  padding: 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  position: relative;
}
.flow-arrow::before {
  content: '↓';
  display: block;
  font-size: 1.2rem;
  color: var(--psychiatrist);
  margin-bottom: 0.1rem;
}

/* ----- Step Cards ------------------------------------------ */
.step-cards { display: flex; flex-direction: column; gap: 0.75rem; }

.step-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-base);
}
.step-card:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }

.step-number {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--adhd);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-content { flex: 1; }
.step-content h4 { margin-bottom: 0.2rem; }
.step-content p { margin-bottom: 0; color: var(--text-muted); font-size: 0.88rem; }

/* ----- Cheat Sheet Cards ----------------------------------- */
.cheat-card { page-break-inside: avoid; }
.cheat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.cheat-header h3 { margin-bottom: 0; }

/* ----- Glossary -------------------------------------------- */
.alpha-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.5rem; }
.alpha-nav a {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.alpha-nav a:hover { background: var(--psychiatrist); color: #fff; border-color: var(--psychiatrist); text-decoration: none; }

.glossary-card { padding: 1rem 1.25rem; }
.glossary-term { color: var(--psychiatrist); margin-bottom: 0.25rem; font-size: 1rem; }
.glossary-card p { margin-bottom: 0; font-size: 0.9rem; }

.letter-heading { font-size: 1.1rem; color: var(--text-muted); margin: 1.5rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border); }

/* ----- Toast Notifications --------------------------------- */
.toast-container { position: fixed; top: calc(var(--topbar-height) + var(--crisis-height) + 1rem); right: 1.5rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; }

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s;
  min-width: 260px;
  max-width: 380px;
}

@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(100%); } }

/* ----- Keyboard shortcut hint ------------------------------ */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0.1em 0.4em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
  color: var(--text-muted);
}

/* ----- Footer ---------------------------------------------- */
.hub-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.hub-footer p { margin-bottom: 0.35rem; }

/* ----- OOP Calculator specific ----------------------------- */
.calc-display {
  background: linear-gradient(135deg, var(--psychiatrist-light), var(--surface));
  border: 2px solid var(--psychiatrist);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  text-align: center;
}
.calc-display .calc-oop { font-family: 'DM Sans', sans-serif; font-size: 2.5rem; font-weight: 700; color: var(--psychiatrist); }
.calc-display .calc-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.calc-item { text-align: center; padding: 0.75rem; background: var(--bg); border-radius: var(--radius-sm); }
.calc-item-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.calc-item-value { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 1.1rem; margin-top: 0.2rem; }

/* Select dropdown styling */
select {
  padding: 0.55rem 2rem 0.55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color var(--transition-fast);
}
select:focus { border-color: var(--psychiatrist); box-shadow: 0 0 0 3px var(--psychiatrist-glow); }

input[type="number"] {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 120px;
  transition: border-color var(--transition-fast);
}
input[type="number"]:focus { border-color: var(--psychiatrist); box-shadow: 0 0 0 3px var(--psychiatrist-glow); }

/* ----- Scroll to top --------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  z-index: 45;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}
.scroll-top.visible { display: flex; }
.scroll-top:hover { background: var(--psychiatrist); color: #fff; border-color: var(--psychiatrist); }

/* ----- Responsive Helpers ---------------------------------- */
.hide-mobile { }
.hide-desktop { display: none; }

/* ----- Print ----------------------------------------------- */
@media print {
  .sidebar, .topbar, .crisis-bar, .chatbot-btn, .chatbot-panel,
  .search-bar, .search-dropdown, .hamburger, .no-print, .theme-toggle,
  .scroll-top, .toast-container { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }

  .content { margin-left: 0; padding: 0; max-width: 100%; }

  .accordion-body { max-height: none !important; display: block !important; padding: 0 1.25rem 1.25rem !important; }
  .accordion-icon { display: none; }

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

  a { color: #000; }
  table { font-size: 9pt; }

  .tab-panel { display: block !important; }
  .tab-panel::before { content: attr(data-tab-title); font-weight: 700; display: block; margin-bottom: 0.5rem; }
}

/* ----- Mobile (max-width: 768px) --------------------------- */
@media (max-width: 768px) {
  :root { --sidebar-width: 280px; }

  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.2); }

  .content { margin-left: 0; padding: 1rem; padding-top: calc(var(--topbar-height) + var(--crisis-height) + 1rem); }

  .hamburger { display: flex; }

  .topbar-search { max-width: 200px; }

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

  .table-wrap { margin: 0 -0.5rem; padding: 0 0.5rem; }

  .hero { padding: 2rem 0.5rem; }
  .hero h1 { font-size: 1.6rem; }

  .chatbot-panel { width: calc(100vw - 2rem); right: 1rem; }

  .wizard-steps { overflow-x: auto; padding-bottom: 0.5rem; }

  .choice-group { flex-direction: column; }

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

  .flow-step { max-width: 100%; }

  .hide-mobile { display: none; }
  .hide-desktop { display: block; }

  .crisis-bar { font-size: 0.72rem; gap: 0.3rem; }
}

@media (max-width: 480px) {
  .tile-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .topbar-search { display: none; }
}
