/* ==========================================================================
   TÂM AN LAB — Xưởng Phân Tích Tâm Lý & Kiến Tạo Tự Giác Cho Con
   Design System: Warm Editorial Psychological Studio
   Palette: Alabaster Ivory, Deep Sage Teal, Warm Terracotta, Ochre & Slate
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-canvas: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-surface-subtle: #F4EFE6;
  --bg-surface-hover: #EFE9DD;
  --bg-sidebar: #183C37;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
  --bg-sidebar-active: rgba(255, 255, 255, 0.14);

  /* Brand & Semantic Colors */
  --primary: #1F5B53;
  --primary-hover: #174640;
  --primary-soft: #E8F2F0;
  --primary-border: #C5DDD8;

  --accent: #D16B3C;
  --accent-hover: #B8582D;
  --accent-soft: #FDF0E9;
  --accent-border: #F2CEBC;

  --ochre: #C89228;
  --ochre-soft: #FCF5E4;
  --ochre-border: #EED9A4;

  --plum: #6C4F78;
  --plum-soft: #F3EEF6;

  --danger: #C24646;
  --danger-soft: #FCECEC;
  --danger-border: #F1C5C5;

  --success: #2A7B56;
  --success-soft: #E8F6EE;
  --success-border: #BEE3CE;

  /* Text */
  --text-main: #1F2927;
  --text-secondary: #4D5C58;
  --text-muted: #768581;
  --text-on-dark: #F7F4EE;
  --text-on-dark-muted: #B6C9C5;

  /* Borders & Shadows */
  --border: #E6DFD3;
  --border-strong: #D4CBB9;
  --shadow-xs: 0 1px 2px rgba(24, 60, 55, 0.04);
  --shadow-sm: 0 4px 12px rgba(24, 60, 55, 0.06);
  --shadow-md: 0 10px 28px rgba(24, 60, 55, 0.09);
  --shadow-lg: 0 20px 48px rgba(24, 60, 55, 0.14);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Typography */
  --font-sans: 'Be Vietnam Pro', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Lora', Georgia, serif;

  /* Layout */
  --sidebar-width: 278px;
  --transition: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #D4CBB9;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #B8AD9A;
}

/* ==========================================================================
   App Shell Layout
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  padding: 22px 16px 18px;
  transition: transform 0.28s ease;
  overflow-y: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #D16B3C 0%, #E49354 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(209, 107, 60, 0.32);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-on-dark-muted);
  margin-top: 2px;
}

/* Active Child Switcher Card in Sidebar */
.profile-switcher {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 18px;
}

.profile-switcher-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-on-dark-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-select-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.profile-select {
  flex: 1;
  background: rgba(0, 0, 0, 0.22);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.profile-select option {
  background: #183C37;
  color: #FFF;
}

.btn-icon-light {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-icon-light:hover {
  background: var(--accent);
}

.profile-meta-mini {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--text-on-dark-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.badge-sample {
  font-size: 0.66rem;
  background: rgba(228, 147, 84, 0.24);
  color: #FBD3B3;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* Navigation */
.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-on-dark-muted);
  padding: 0 10px;
  margin: 4px 0 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  color: rgba(247, 244, 238, 0.82);
  font-size: 0.89rem;
  font-weight: 500;
  text-align: left;
  transition: var(--transition);
  position: relative;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #FFF;
}

.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #FFF;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: #E88B59;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  color: #F7F4EE;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-on-dark-muted);
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-sidebar-sub {
  font-size: 0.75rem;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-on-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-sidebar-sub svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-sidebar-sub:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Mobile Header */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 35;
  background: var(--bg-sidebar);
  color: #FFF;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 29, 0.5);
  z-index: 38;
}

/* Main Content Area */
.main-workspace {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 36px 64px;
  max-width: 1380px;
  width: 100%;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}

.page-kicker svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.page-title {
  font-size: 1.78rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
}

.page-subtitle {
  font-size: 0.94rem;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 680px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Buttons & Pills
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #FFF;
  box-shadow: 0 3px 10px rgba(31, 91, 83, 0.22);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #FFF;
  box-shadow: 0 3px 10px rgba(209, 107, 60, 0.24);
}
.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-surface-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-main);
}

.btn-danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.btn-danger-soft:hover {
  background: #F9DADA;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.81rem;
  border-radius: 9px;
}

/* Tags & Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-ochre { background: var(--ochre-soft); color: #966B14; }
.tag-plum { background: var(--plum-soft); color: var(--plum); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-neutral { background: var(--bg-surface-subtle); color: var(--text-secondary); }

/* ==========================================================================
   Cards & Grid Primitives
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.card-subtle {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.grid-asymmetric {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}

.stack-md { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }

/* ==========================================================================
   Dashboard & Hero Archetype Card
   ========================================================================== */
.archetype-hero {
  background: linear-gradient(135deg, #1A4B44 0%, #24635A 60%, #2C7368 100%);
  color: #FFF;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.archetype-hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 139, 89, 0.28) 0%, rgba(232, 139, 89, 0) 70%);
  pointer-events: none;
}

.archetype-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 24px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.archetype-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.76rem;
  font-weight: 600;
  color: #FCE2CE;
  margin-bottom: 10px;
}

.archetype-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.archetype-desc {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
  margin-bottom: 16px;
}

.archetype-mantra {
  font-family: var(--font-serif);
  font-style: italic;
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid #E88B59;
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  color: #FAF7F2;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-metric-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.hero-metric-val {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
}

.hero-metric-lbl {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 4px;
}

/* Radar Chart Container */
.radar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.radar-svg {
  width: 100%;
  max-width: 390px;
  height: auto;
  overflow: visible;
}

.pillar-bars {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.pillar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pillar-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
}

.pillar-name {
  font-weight: 600;
  color: var(--text-main);
}

.pillar-score {
  font-weight: 700;
  font-size: 0.84rem;
}

.progress-track {
  height: 9px;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

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

/* ==========================================================================
   Tabs & Filter Chips
   ========================================================================== */
.tab-bar {
  display: inline-flex;
  background: var(--bg-surface-subtle);
  padding: 5px;
  border-radius: 13px;
  border: 1px solid var(--border);
  gap: 4px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
}

/* ==========================================================================
   Diagnostic Assessment & Iceberg Model
   ========================================================================== */
.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-text {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

.question-hint {
  font-size: 0.81rem;
  color: var(--text-muted);
}

.likert-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.likert-option {
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.likert-option:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.likert-option.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
  box-shadow: 0 4px 10px rgba(31, 91, 83, 0.22);
}

.likert-num {
  font-size: 0.92rem;
  font-weight: 700;
}

.likert-lbl {
  font-size: 0.7rem;
  line-height: 1.25;
  opacity: 0.9;
}

/* Symptom Selector Grid */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.symptom-card {
  text-align: left;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.symptom-card:hover {
  border-color: var(--accent);
  background: #FFFBF8;
}

.symptom-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 4px 12px rgba(209, 107, 60, 0.14);
}

.symptom-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: var(--transition);
}

.symptom-card.selected .symptom-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFF;
}

.symptom-title {
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.symptom-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Iceberg Diagram */
.iceberg-visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.iceberg-above {
  background: linear-gradient(180deg, #FDF6EE 0%, #F9EADB 100%);
  padding: 20px 24px;
  border-bottom: 3px dashed #3A8D99;
  position: relative;
}

.iceberg-waterline {
  position: absolute;
  right: 18px;
  bottom: -12px;
  background: #2C7A85;
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}

.iceberg-below {
  background: linear-gradient(180deg, #E8F3F5 0%, #D9ECEF 55%, #CBE3E8 100%);
  padding: 24px;
}

.iceberg-layer-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.iceberg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.iceberg-pill-surface {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--accent-border);
  color: #9A411B;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
}

.iceberg-root-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.iceberg-root-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 91, 83, 0.16);
  border-radius: 13px;
  padding: 14px 16px;
}

.iceberg-root-item h4 {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 5px;
}

.iceberg-root-item p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 4-Week Roadmap */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.roadmap-week {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-num {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.week-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
}

.week-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.week-list li {
  padding-left: 15px;
  position: relative;
}

.week-list li::before {
  content: '•';
  position: absolute;
  left: 3px;
  color: var(--accent);
  font-weight: 700;
}

/* ==========================================================================
   Communication Lab (Say This Not That + Simulator)
   ========================================================================== */
.script-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.script-card-head {
  padding: 12px 18px;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.script-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.script-col {
  padding: 18px 20px;
}

.script-col-bad {
  background: #FFF9F9;
  border-right: 1px solid var(--border);
}

.script-col-good {
  background: #F6FBF9;
}

.script-col-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.script-quote {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-main);
  margin-bottom: 10px;
}

.script-why {
  font-size: 0.81rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Simulator */
.sim-scene-box {
  background: linear-gradient(135deg, #FAF3EB 0%, #F4ECE1 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.sim-choice {
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sim-choice:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.sim-choice-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-surface-subtle);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sim-choice.chosen-optimal {
  border-color: var(--success);
  background: var(--success-soft);
}
.sim-choice.chosen-optimal .sim-choice-letter {
  background: var(--success);
  color: #FFF;
}

.sim-choice.chosen-suboptimal {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.sim-choice.chosen-suboptimal .sim-choice-letter {
  background: var(--danger);
  color: #FFF;
}

.sim-choice.chosen-mixed {
  border-color: var(--ochre);
  background: var(--ochre-soft);
}
.sim-choice.chosen-mixed .sim-choice-letter {
  background: var(--ochre);
  color: #FFF;
}

.sim-feedback-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

.impact-meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}

.meter-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
}

/* ==========================================================================
   Methods Library
   ========================================================================== */
.method-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: var(--transition);
}

.method-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.method-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.method-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.method-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

/* ==========================================================================
   Routine & Contract Builder
   ========================================================================== */
.routine-slot {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.contract-paper {
  background: #FFFEFB;
  border: 2px solid #D9CBB5;
  border-radius: var(--radius-md);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.contract-paper::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px dashed #E5DAC8;
  border-radius: 10px;
  pointer-events: none;
}

.contract-title {
  font-family: var(--font-serif);
  text-align: center;
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.contract-sub {
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.contract-section {
  margin-bottom: 16px;
}

.contract-section h4 {
  font-size: 0.88rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.contract-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.contract-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.contract-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.sig-line {
  margin-top: 44px;
  border-top: 1px dashed var(--text-muted);
  padding-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Habit Tracker & ABC Journal
   ========================================================================== */
.tracker-table {
  width: 100%;
  border-collapse: collapse;
}

.tracker-table th, .tracker-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.tracker-table th:first-child, .tracker-table td:first-child {
  text-align: left;
  padding-left: 4px;
}

.tracker-table th {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.day-toggle {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-canvas);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.day-toggle:hover {
  border-color: var(--primary);
}

.day-toggle.done {
  background: var(--success);
  border-color: var(--success);
  color: #FFF;
}

.day-toggle.parent-habit.done {
  background: var(--accent);
  border-color: var(--accent);
}

.journal-entry {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px 18px;
}

.abc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.abc-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 0.83rem;
}

.abc-label {
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 91, 83, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 76px;
}

/* ==========================================================================
   Modal & Toast
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 38, 35, 0.56);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-canvas);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #183C37;
  color: #FFF;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.87rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.symptom-check svg {
  width: 13px;
  height: 13px;
}

.day-toggle svg {
  width: 16px;
  height: 16px;
}

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

/* Info Callout */
.callout {
  padding: 15px 18px;
  border-radius: 13px;
  font-size: 0.86rem;
  line-height: 1.55;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.callout-primary {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: #184740;
}

.callout-accent {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: #8A3F1D;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.84rem; }
.text-xs { font-size: 0.76rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flex-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   FLAGSHIP TAB: GÓC HỌC TẬP CỦA CON (Student Personal Study Cockpit)
   ========================================================================== */

/* Highlighted Student Tab in Sidebar */
.nav-item.nav-student-special {
  background: linear-gradient(135deg, rgba(209, 107, 60, 0.24) 0%, rgba(232, 139, 89, 0.14) 100%);
  border: 1px solid rgba(232, 139, 89, 0.36);
  color: #FFF4EC;
  margin-bottom: 8px;
}

.nav-item.nav-student-special:hover {
  background: linear-gradient(135deg, rgba(209, 107, 60, 0.36) 0%, rgba(232, 139, 89, 0.22) 100%);
}

.nav-item.nav-student-special.active {
  background: linear-gradient(135deg, #D16B3C 0%, #DF7D4D 100%);
  border-color: transparent;
  color: #FFF;
  box-shadow: 0 6px 16px rgba(209, 107, 60, 0.32);
}

.nav-item.nav-student-special.active::before {
  display: none;
}

/* Distraction-Free Focus Mode (for when child sits at desk!) */
body.focus-mode .sidebar,
body.focus-mode .mobile-topbar {
  display: none !important;
}

body.focus-mode .main-workspace {
  margin-left: 0;
  max-width: 1320px;
  margin-inline: auto;
  padding: 24px 32px 56px;
}

/* Student Welcome Banner */
.student-hero {
  background: linear-gradient(135deg, #FFFDF9 0%, #F7EFE3 55%, #ECF5F2 100%);
  border: 1.5px solid #E3D7C5;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.student-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.student-greeting {
  font-size: 1.68rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.student-stats-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spark-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: #FFF;
  border: 1px solid var(--border-strong);
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

/* Energy & Prep Check-in Strip */
.checkin-strip {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #DCD0BE;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.energy-pill {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: #FFF;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.energy-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.energy-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
}

.prep-toggle {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: #FFF;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.prep-toggle.ready {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}

/* Khi - Thi Reward Banner */
.reward-banner {
  margin-top: 14px;
  background: linear-gradient(90deg, #1E5850 0%, #2B7066 100%);
  color: #FFF;
  border-radius: 13px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

/* Sync Info Bar (shows how Parent Studio feeds this tab) */
.sync-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Main 2-Column Student Cockpit */
.cockpit-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: start;
}

/* Circular Adaptive Focus Timer */
.timer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
}

.timer-layout {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 22px;
  align-items: center;
}

.timer-ring-wrap {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 0 auto;
}

.timer-ring-svg {
  width: 176px;
  height: 176px;
  transform: rotate(-90deg);
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.timer-digits {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.timer-mode-lbl {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

.timer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.timer-preset-btn {
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.timer-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.timer-preset-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.timer-preset-btn.micro-highlight {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #9A411B;
}

/* Mission Chunking Board */
.mission-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--bg-canvas);
  transition: var(--transition);
}

.mission-item.active-mission {
  border-color: var(--primary);
  background: #F3FAF8;
  box-shadow: 0 3px 10px rgba(31, 91, 83, 0.08);
}

.mission-item.done-mission {
  opacity: 0.7;
  background: var(--bg-surface-subtle);
}

.mission-item.done-mission .mission-title-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.mission-chk {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  background: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  color: transparent;
  transition: var(--transition);
}

.mission-chk.checked {
  background: var(--success);
  border-color: var(--success);
  color: #FFF;
}

.mission-chk svg {
  width: 14px;
  height: 14px;
}

/* Personalized Toolkit Grid */
.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toolkit-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.toolkit-card-title {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 7px;
}

.toolkit-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.48;
  flex: 1;
}

/* Parent Encouraging Note Card */
.parent-note-card {
  background: linear-gradient(135deg, #FDF6EE 0%, #FAF0E4 100%);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  padding: 15px 18px;
}

.parent-note-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.93rem;
  color: #6B361C;
  line-height: 1.55;
  margin-top: 5px;
}

/* ==========================================================================
   SOCRATIC AI LEARNING MENTOR PANEL
   ========================================================================== */
.ai-studio-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 760px;
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.ai-studio-header {
  background: linear-gradient(135deg, #183C37 0%, #235951 100%);
  color: #FFF;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #E88B59 0%, #F4B47C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

.ai-status-dot.live {
  background: #5EE59F;
  box-shadow: 0 0 0 3px rgba(94, 229, 159, 0.25);
}

.ai-status-dot.offline {
  background: #F4C46B;
}

.ai-context-strip {
  background: var(--primary-soft);
  border-bottom: 1px solid var(--primary-border);
  padding: 9px 16px;
  font-size: 0.76rem;
  color: #1A4E46;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #FCFBF8;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.chat-msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble {
  padding: 12px 15px;
  border-radius: 15px;
  font-size: 0.88rem;
  line-height: 1.58;
}

.chat-msg.user .chat-bubble {
  background: var(--primary);
  color: #FFF;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant .chat-bubble {
  background: #FFF;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-xs);
}

.chat-bubble p {
  margin: 0;
}

.chat-list {
  margin: 5px 0 5px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-code {
  background: var(--bg-surface-subtle);
  padding: 1px 5px;
  border-radius: 5px;
  font-family: Consolas, monospace;
  font-size: 0.84em;
}

.chat-meta {
  font-size: 0.69rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

/* Typing dots */
.typing-dots {
  display: inline-flex;
  gap: 5px;
  padding: 4px 2px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.4;
  animation: dotPulse 1.1s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.1); }
}

.ai-quick-prompts {
  padding: 10px 14px 6px;
  border-top: 1px solid var(--border);
  background: #FFF;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.quick-prompt-chip {
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}

.quick-prompt-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.ai-composer {
  padding: 10px 14px 14px;
  background: #FFF;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-composer-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ai-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 110px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-canvas);
  font-size: 0.88rem;
  line-height: 1.45;
  resize: none;
  outline: none;
}

.ai-textarea:focus {
  border-color: var(--primary);
  background: #FFF;
}

.ai-rule-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1100px) {
  .grid-asymmetric, .archetype-hero-grid, .cockpit-grid {
    grid-template-columns: 1fr;
  }
  .ai-studio-card {
    position: static;
    height: 620px;
  }
  .roadmap-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .timer-layout, .toolkit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .mobile-topbar {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.open {
    display: block;
  }
  .main-workspace {
    margin-left: 0;
    padding: 20px 18px 56px;
  }
  .grid-2, .grid-3, .script-compare, .abc-grid, .impact-meters {
    grid-template-columns: 1fr;
  }
  .script-col-bad {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .likert-scale {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .likert-lbl {
    font-size: 0.63rem;
  }
}

@media (max-width: 600px) {
  .roadmap-grid, .contract-signatures {
    grid-template-columns: 1fr;
  }
  .routine-slot {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   Print / PDF Report Styling
   ========================================================================== */
#printArea {
  display: none;
}

@media print {
  body {
    background: #FFF !important;
    color: #111 !important;
  }
  .app-shell, .mobile-topbar, .modal-overlay, .toast-container {
    display: none !important;
  }
  #printArea {
    display: block !important;
    padding: 12px 18px;
    font-size: 11pt;
    line-height: 1.5;
  }
  .print-header {
    border-bottom: 2px solid #1F5B53;
    padding-bottom: 12px;
    margin-bottom: 18px;
  }
  .print-section {
    margin-bottom: 18px;
    page-break-inside: avoid;
  }
  .print-section h2 {
    font-size: 13pt;
    color: #1F5B53;
    border-bottom: 1px solid #DDD;
    padding-bottom: 4px;
    margin-bottom: 10px;
  }
  .print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .print-box {
    border: 1px solid #D5D5D5;
    border-radius: 8px;
    padding: 10px 12px;
  }
}
