/* ========================================================
   SPECTRUMSTARS - SENSORY DESIGN SYSTEM & STYLESHEET
   ======================================================== */

/* --- CSS Root Variables & Themes --- */
:root {
  /* Default Theme: Calm Pastel */
  --bg-primary: #f4f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e9f0f8;
  --bg-accent: #e0ebf7;
  --surface-card: rgba(255, 255, 255, 0.95);
  --surface-border: #d4e2f0;

  --text-primary: #2d3748;
  --text-secondary: #5a6a80;
  --text-muted: #8c9ba5;

  --brand-primary: #5c7cfa;
  --brand-primary-hover: #4263eb;
  --brand-gradient: linear-gradient(135deg, #748ffc 0%, #4dabf7 50%, #63e6be 100%);
  --star-gold: #fcc419;
  --star-shadow: rgba(252, 196, 25, 0.4);

  /* Semantic Action Colors */
  --color-success: #38d9a9;
  --color-warning: #ffa94d;
  --color-danger: #ff8787;
  --color-info: #4dabf7;

  /* Typography */
  --font-family-base: 'Lexend', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', 'Segoe UI', Roboto, sans-serif;
  --font-family-heading: 'Fredoka', 'Lexend', 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  --letter-spacing: 0.02em;

  /* Elevation & Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --shadow-sm: 0 2px 8px rgba(33, 49, 78, 0.06);
  --shadow-md: 0 6px 20px rgba(33, 49, 78, 0.08);
  --shadow-lg: 0 12px 32px rgba(33, 49, 78, 0.12);
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme: Playful & Bright */
[data-theme="playful"] {
  --bg-primary: #fff9db;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ffe3e3;
  --bg-accent: #d3f9d8;
  --surface-card: #ffffff;
  --surface-border: #ffd43b;

  --text-primary: #1e1e24;
  --text-secondary: #495057;
  --brand-primary: #ff6b6b;
  --brand-primary-hover: #fa5252;
  --brand-gradient: linear-gradient(135deg, #ff922b 0%, #ff6b6b 50%, #cc5de8 100%);
}

/* Theme: High Contrast Dark */
[data-theme="high-contrast"] {
  --bg-primary: #12141a;
  --bg-secondary: #1a1d24;
  --bg-tertiary: #242933;
  --bg-accent: #2e3440;
  --surface-card: #1e222b;
  --surface-border: #4c566a;

  --text-primary: #ffffff;
  --text-secondary: #e5e9f0;
  --text-muted: #d8dee9;

  --brand-primary: #88c0d0;
  --brand-primary-hover: #81a1c1;
  --brand-gradient: linear-gradient(135deg, #88c0d0 0%, #81a1c1 50%, #b48ead 100%);
  --star-gold: #ebcb8b;
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Theme: Warm Sunset Glow */
[data-theme="warm-night"] {
  --bg-primary: #2b211f;
  --bg-secondary: #3b2d2a;
  --bg-tertiary: #4a3834;
  --bg-accent: #5e4540;
  --surface-card: #3b2d2a;
  --surface-border: #73534c;

  --text-primary: #fff0e6;
  --text-secondary: #fcd5c1;
  --text-muted: #dfb29e;

  --brand-primary: #f08c00;
  --brand-primary-hover: #e8590c;
  --brand-gradient: linear-gradient(135deg, #f76707 0%, #e8590c 50%, #d9480f 100%);
  --star-gold: #ffd43b;
}

/* Font Toggle: Dyslexia Friendly */
[data-font="dyslexic"] {
  --font-family-base: 'OpenDyslexic', 'Lexend', 'Comic Sans MS', sans-serif !important;
  --font-family-heading: 'OpenDyslexic', 'Fredoka', sans-serif !important;
  --line-height-base: 1.85 !important;
  --letter-spacing: 0.06em !important;
}

/* --- Base Resets & Layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  letter-spacing: var(--letter-spacing);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  -webkit-text-size-adjust: 100%;
}

/* Accessible Reading Focus Ruler */
.reading-ruler {
  position: fixed;
  left: 0;
  width: 100vw;
  height: 44px;
  background: rgba(255, 235, 59, 0.18);
  border-top: 2px dashed rgba(245, 158, 11, 0.6);
  border-bottom: 2px dashed rgba(245, 158, 11, 0.6);
  pointer-events: none;
  z-index: 99999;
  transition: top 0.05s ease-out;
}

.reading-ruler.hidden {
  display: none;
}

/* --- Header & Sensory Controls --- */
.app-header {
  background: var(--surface-card);
  border-bottom: 2px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, opacity 0.2s ease;
  user-select: none;
}

.brand-group:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

.brand-group:hover .logo-icon {
  box-shadow: var(--shadow-md);
  transform: scale(1.08) rotate(6deg);
}

.brand-group:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 4px;
}

.logo-icon {
  font-size: 2.2rem;
  background: var(--bg-tertiary);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  animation: gentle-bob 3s ease-in-out infinite alternate;
}

@keyframes gentle-bob {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-4px) rotate(4deg); }
}

.brand-title {
  font-family: var(--font-family-heading);
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

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

/* Sensory Controls Toolbar */
.sensory-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-border);
}

.control-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.control-select {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.sensory-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sensory-btn:hover {
  background: var(--bg-accent);
  transform: translateY(-2px);
}

.sensory-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.pwa-install-btn {
  background: linear-gradient(135deg, rgba(92, 124, 250, 0.15) 0%, rgba(77, 171, 247, 0.2) 100%);
  border: 1px solid rgba(92, 124, 250, 0.4);
  color: var(--brand-primary);
  font-weight: 700;
  animation: pulseInstall 3s infinite ease-in-out;
}

.pwa-install-btn:hover {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

@keyframes pulseInstall {
  0%, 100% { box-shadow: 0 0 0 0 rgba(92, 124, 250, 0); }
  50% { box-shadow: 0 0 0 4px rgba(92, 124, 250, 0.25); }
}

.star-jar-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #fff3bf 0%, #ffe066 100%);
  color: #d9480f;
  border: 2px solid #fab005;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--star-shadow);
  transition: var(--transition-smooth);
}

.star-jar-badge:hover {
  transform: scale(1.06);
}

.star-icon {
  font-size: 1.2rem;
  animation: star-pulse 2s infinite alternate;
}

@keyframes star-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}

/* --- Main Navigation Tabs --- */
.main-nav {
  background: var(--bg-secondary);
  border-top: 1px solid var(--surface-border);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.nav-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(92, 124, 250, 0.35);
}

.nav-emoji {
  font-size: 1.2rem;
}

/* --- Main Content Sections --- */
.main-content {
  flex: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.tab-section {
  display: none;
  animation: fadeIn 0.35s ease-in-out;
}

.tab-section.active {
  display: block;
}

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

.section-hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero-badge {
  display: inline-block;
  background: var(--bg-accent);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
  border: 1px solid var(--surface-border);
}

.section-title {
  font-family: var(--font-family-heading);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* --- Common Button Styles --- */
.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 14px rgba(92, 124, 250, 0.28);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(92, 124, 250, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--bg-accent);
  transform: translateY(-2px);
}

.btn-primary.small, .btn-secondary.small {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* ========================================================
   SECTION 1: AAC TALK BOARD STYLES
   ======================================================== */
.aac-sentence-bar {
  background: var(--surface-card);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  min-height: 84px;
}

.sentence-display {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.empty-placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05rem;
}

.sentence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-accent);
  border: 2px solid var(--brand-primary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.sentence-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-speak {
  background: #38d9a9;
  color: #0b4938;
  box-shadow: 0 4px 14px rgba(56, 217, 169, 0.35);
}

.btn-speak:hover {
  background: #20c997;
  transform: translateY(-2px);
}

.btn-backspace {
  background: #ffe066;
  color: #7950f2;
}

.btn-clear {
  background: #ffdbe0;
  color: #e03131;
}

/* AAC Voice Controls */
.aac-voice-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.voice-slider-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.voice-dropdown {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 260px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.voice-dropdown:hover,
.voice-dropdown:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(92, 124, 250, 0.18);
}

.voice-dropdown optgroup {
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--bg-secondary);
}

.voice-dropdown option {
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface-card);
  padding: 4px;
}

.btn-voice-test {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(92, 124, 250, 0.25);
  transition: var(--transition-smooth);
}

.btn-voice-test:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 12px rgba(92, 124, 250, 0.35);
  background: var(--brand-hover);
}

.btn-voice-test:active {
  transform: scale(0.96);
}

/* AAC Category Filter Pills */
.aac-category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 24px;
  padding-bottom: 6px;
}

.cat-pill {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

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

.cat-pill.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(92, 124, 250, 0.25);
}

.cat-pill[data-cat="favorites"].active {
  background: linear-gradient(135deg, #fab005 0%, #f59f00 100%);
  border-color: #f59f00;
  box-shadow: 0 4px 14px rgba(245, 159, 0, 0.35);
  color: #ffffff;
}

.cat-pill[data-cat="recent"].active {
  background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
  border-color: #228be6;
  box-shadow: 0 4px 14px rgba(34, 139, 230, 0.35);
  color: #ffffff;
}

.cat-pill[data-cat="cities"].active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border-color: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  color: #ffffff;
}

/* AAC Grid */
.aac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.aac-card {
  position: relative;
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.2s ease, background 0.2s ease;
  user-select: none;
  animation: cardFadePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.card-fav-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  font-size: 1rem;
  opacity: 0.28;
  cursor: pointer;
  padding: 3px 5px;
  line-height: 1;
  transition: var(--transition-smooth);
  z-index: 2;
  border-radius: var(--radius-pill);
}

.card-fav-toggle:hover {
  opacity: 0.9;
  transform: scale(1.2);
}

.card-fav-toggle.is-fav {
  opacity: 1;
  filter: drop-shadow(0 2px 5px rgba(250, 176, 5, 0.55));
}

.aac-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 44px 20px;
  background: var(--surface-card);
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-lg);
  margin: 10px 0;
}

.aac-empty-state .empty-icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 12px;
  animation: gentle-bob 3s ease-in-out infinite alternate;
}

.aac-empty-state p {
  font-family: var(--font-family-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

@keyframes cardFadePop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.aac-card:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 12px 24px var(--card-glow, rgba(92, 124, 250, 0.2)), var(--shadow-md);
  border-color: var(--brand-primary);
}

.aac-card:active {
  transform: scale(0.94) translateY(0);
}

.aac-card-icon {
  font-size: 2.6rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aac-card:hover .aac-card-icon {
  transform: scale(1.2) rotate(6deg);
}

.aac-card:active .aac-card-icon {
  transform: scale(0.9) rotate(-6deg);
}

.aac-card.card-speaking {
  animation: cardSpeakPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(92, 124, 250, 0.35), var(--shadow-lg);
}

@keyframes cardSpeakPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.12) translateY(-4px); }
  70% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.aac-card-label {
  font-family: var(--font-family-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* AAC Card Specific Category Color Borders */
.aac-card[data-cat="starters"] { border-top: 5px solid #ff922b; }
.aac-card[data-cat="needs"] { border-top: 5px solid #4dabf7; }
.aac-card[data-cat="feelings"] { border-top: 5px solid #ff6b6b; }
.aac-card[data-cat="actions"] { border-top: 5px solid #51cf66; }
.aac-card[data-cat="food"] { border-top: 5px solid #fcc419; }
.aac-card[data-cat="clothes"] { border-top: 5px solid #339af0; }
.aac-card[data-cat="family"] { border-top: 5px solid #f06595; }
.aac-card[data-cat="school"] { border-top: 5px solid #845ef7; }
.aac-card[data-cat="body"] { border-top: 5px solid #22b8cf; }
.aac-card[data-cat="colors"] { border-top: 5px solid #e599f7; }
.aac-card[data-cat="time"] { border-top: 5px solid #ffd43b; }
.aac-card[data-cat="questions"] { border-top: 5px solid #12b886; }
.aac-card[data-cat="first-then"] { border-top: 5px solid #4c6ef5; }
.aac-card[data-cat="events"] { border-top: 5px solid #fd7e14; }
.aac-card[data-cat="toys"] { border-top: 5px solid #ff79c6; }
.aac-card[data-cat="animals"] { border-top: 5px solid #20c997; }
.aac-card[data-cat="cities"] { border-top: 5px solid #0ea5e9; }
.aac-card[data-cat="quick"] { border-top: 5px solid #cc5de8; }

/* ========================================================
   SECTION 2: VISUAL ROUTINE BUILDER STYLES
   ======================================================== */
.routine-header-panel {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.routine-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 18px;
}

.routine-tab {
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.routine-tab.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.routine-progress-box {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 12px 18px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.progress-bar-track {
  height: 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38d9a9 0%, #4dabf7 100%);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* Custom Task Input Box */
.custom-task-panel {
  background: var(--bg-secondary);
  border: 2px dashed var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
}

.custom-task-panel.hidden {
  display: none;
}

.task-form-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.task-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
}

.task-select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
}

/* Routine Cards List */
.routine-cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.routine-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.routine-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
}

.routine-card.completed {
  background: rgba(56, 217, 169, 0.12);
  border-color: #38d9a9;
}

.routine-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.routine-card-icon {
  font-size: 2.2rem;
}

.routine-card-title {
  font-family: var(--font-family-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.routine-card.completed .routine-card-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.routine-checkbox {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--bg-secondary);
  transition: var(--transition-smooth);
}

.routine-card.completed .routine-checkbox {
  background: #38d9a9;
  border-color: #38d9a9;
  color: #ffffff;
}

.routine-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========================================================
   SECTION 3: SENSORY CALM ZONE STYLES
   ======================================================== */
.calm-tools-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.calm-nav-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.calm-nav-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
}

.calm-nav-card.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.calm-nav-card.active h4, .calm-nav-card.active p {
  color: #ffffff;
}

.calm-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
}

.calm-nav-card h4 {
  font-family: var(--font-family-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.calm-nav-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.calm-display-panel {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-md);
  min-height: 480px;
}

.calm-tool-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.calm-tool-view.active {
  display: block;
}

/* 1. Guided Breathing Orb */
.breathing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
}

.breathing-orb-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.breathing-orb {
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #4dabf7 0%, #63e6be 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(77, 171, 247, 0.5);
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1), background 2s ease;
  z-index: 2;
}

.breathing-prompt {
  font-family: var(--font-family-heading);
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 700;
}

.orb-aura {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px dashed rgba(77, 171, 247, 0.4);
  animation: rotateSlow 20s linear infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.timer-countdown {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.breath-cycle-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.pacer-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.pacer-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* --- Crystal Sound Harp Fidget --- */
.harp-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.harp-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.harp-mode-pickers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.harp-mode-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.harp-mode-btn:hover {
  background: var(--bg-accent);
}

.harp-mode-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(92, 124, 250, 0.3);
}

.harp-canvas-wrapper {
  width: 100%;
  height: 140px;
  background: radial-gradient(ellipse at center, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.95) 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

#harpHaloCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crystal-tines-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  background: var(--bg-tertiary);
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  align-items: end;
  min-height: 220px;
  user-select: none;
  touch-action: none;
}

.crystal-tine {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, var(--tine-color, #4dabf7) 100%);
  border-radius: var(--radius-pill);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 20px var(--tine-shadow, rgba(77, 171, 247, 0.4)), inset 0 2px 6px rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.15s ease, box-shadow 0.15s ease;
  height: var(--tine-height, 180px);
}

.crystal-tine:hover {
  transform: translateY(-8px) scale(1.04);
  filter: brightness(1.15);
  box-shadow: 0 14px 28px var(--tine-shadow, rgba(77, 171, 247, 0.6)), 0 0 20px var(--tine-color, #4dabf7);
}

.crystal-tine:active, .crystal-tine.playing {
  transform: translateY(-2px) scale(0.96);
  filter: brightness(1.3);
  box-shadow: 0 4px 12px var(--tine-shadow, rgba(77, 171, 247, 0.4)), 0 0 30px var(--tine-color, #4dabf7);
}

.tine-note {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: #1e293b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.tine-icon {
  font-size: 1.2rem;
}

/* --- Sleeping Animal Breath Pal --- */
.animal-pal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.animal-pal-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.animal-picker-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.animal-select-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.animal-select-btn:hover {
  background: var(--bg-accent);
}

.animal-select-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 14px rgba(92, 124, 250, 0.3);
}

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

.animal-stage {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 260px;
  background: linear-gradient(135deg, rgba(224, 235, 247, 0.6) 0%, rgba(244, 247, 251, 0.9) 100%);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

[data-theme="high-contrast"] .animal-stage {
  background: linear-gradient(135deg, #1e2430 0%, #171a21 100%);
}

.animal-illustration {
  position: relative;
  width: 220px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animal-graphic-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
}

.belly-animated {
  transform-origin: 110px 105px;
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1);
}

.belly-animated.inhale {
  transform: scale(1.18);
}

.belly-animated.hold {
  transform: scale(1.18);
}

.belly-animated.exhale {
  transform: scale(1.0);
}

.sleeping-zzz {
  position: absolute;
  top: 15px;
  right: 35px;
  font-family: var(--font-family-heading);
  font-size: 1.4rem;
  color: #748ffc;
  font-weight: 700;
  animation: floatZzz 3s infinite ease-in-out;
}

@keyframes floatZzz {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  50% { opacity: 0.9; transform: translate(12px, -15px) scale(1.1); }
  100% { opacity: 0; transform: translate(24px, -30px) scale(1.3); }
}

.animal-breath-phase-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-card);
  border: 2px solid var(--brand-primary);
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  z-index: 2;
  margin-top: -10px;
}

.animal-breath-phase-badge .phase-text {
  font-family: var(--font-family-heading);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.animal-breath-phase-badge .phase-timer {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
}

.animal-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.animal-speed-picker {
  display: flex;
  gap: 8px;
}

.animal-speed-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.animal-speed-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* --- Liquid Color Lava Lamp --- */
.lava-lamp-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lava-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.lava-theme-pickers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lava-theme-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lava-theme-btn:hover {
  background: var(--bg-accent);
}

.lava-theme-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(92, 124, 250, 0.3);
}

.lava-lamp-frame {
  width: 100%;
  height: 400px;
  background: radial-gradient(ellipse at 50% 100%, #1e1b4b 0%, #0f172a 70%, #020617 100%);
  border: 4px solid var(--surface-border);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 8px 30px rgba(0, 0, 0, 0.2);
  position: relative;
}

#lavaLampCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.lava-actions-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* 2. Bubble Wrap Pop Fidget */
.bubbles-fidget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pop-counter {
  font-family: var(--font-family-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.bubble-wrap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 14px;
  background: var(--bg-tertiary);
  padding: 24px;
  border-radius: var(--radius-lg);
}

.bubble-item {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #a5d8ff 50%, #4dabf7 100%);
  box-shadow: 0 4px 10px rgba(77, 171, 247, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bubble-item:hover {
  transform: scale(1.08);
}

.bubble-item.popped {
  background: radial-gradient(circle at 50% 50%, #dee2e6 0%, #ced4da 100%);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.2);
  transform: scale(0.92);
  opacity: 0.65;
}

/* 3. Starlight Canvas */
.canvas-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.palette-pickers {
  display: flex;
  gap: 6px;
}

.starlight-color-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.starlight-color-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
}

.canvas-wrapper {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0b0f19;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

#starlightCanvas {
  display: block;
  width: 100%;
  height: 380px;
  cursor: crosshair;
}

/* 4. 5-4-3-2-1 Sensory Grounding */
.grounding-guide-box {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.grounding-progress {
  margin-bottom: 18px;
}

.step-badge {
  background: var(--bg-accent);
  color: var(--brand-primary);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
}

.grounding-progress h3 {
  font-family: var(--font-family-heading);
  font-size: 1.5rem;
  margin-top: 8px;
  color: var(--text-primary);
}

.grounding-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 24px;
}

.grounding-visual {
  font-size: 4.5rem;
  margin-bottom: 14px;
  animation: floatEmoji 3s ease-in-out infinite alternate;
}

@keyframes floatEmoji {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.grounding-instruction {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.grounding-check-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.star-check-btn {
  background: var(--bg-secondary);
  border: 2px solid var(--surface-border);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.star-check-btn.checked {
  background: #ffd43b;
  border-color: #fab005;
  color: #d9480f;
  transform: scale(1.1);
}

.grounding-nav-btns {
  display: flex;
  justify-content: center;
  gap: 14px;
}

/* 5. Soundscape Machine */
.soundscape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.sound-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  border: 2px solid var(--surface-border);
  transition: var(--transition-smooth);
}

.sound-card.playing {
  border-color: #38d9a9;
  background: rgba(56, 217, 169, 0.1);
}

.sound-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.sound-card h4 {
  font-family: var(--font-family-heading);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.sound-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sound-slider {
  margin-bottom: 12px;
}

.sound-slider input[type="range"] {
  width: 100%;
}

.sound-play-btn {
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--brand-primary);
  color: #ffffff;
  font-family: var(--font-family-heading);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sound-play-btn:hover {
  opacity: 0.9;
}

.soundscape-footer {
  text-align: center;
}

/* ========================================================
   SECTION 4: EMOTION CHECK-IN STYLES
   ======================================================== */
.mood-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.mood-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.mood-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.mood-card.active {
  border-color: var(--brand-primary);
  background: var(--bg-accent);
  transform: scale(1.04);
  box-shadow: var(--shadow-lg);
}

.mood-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}

.mood-name {
  font-family: var(--font-family-heading);
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mood-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: block;
}

.coping-toolbox-panel {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.coping-header {
  text-align: center;
  margin-bottom: 20px;
}

.coping-badge {
  display: inline-block;
  background: var(--bg-tertiary);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
}

.coping-header h3 {
  font-family: var(--font-family-heading);
  font-size: 1.4rem;
  color: var(--text-primary);
}

.coping-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.coping-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--surface-border);
  transition: var(--transition-smooth);
}

.coping-card:hover {
  transform: translateY(-2px);
  background: var(--bg-secondary);
}

.coping-card-icon {
  font-size: 2rem;
  background: var(--surface-card);
  padding: 8px;
  border-radius: var(--radius-sm);
}

.coping-card-content h4 {
  font-family: var(--font-family-heading);
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.coping-card-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ========================================================
   SECTION 5: VISUAL SOCIAL STORIES STYLES
   ======================================================== */
.story-selector-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.story-thumb-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.story-thumb-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
}

.story-thumb-card.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.story-thumb-card.active h4, .story-thumb-card.active span {
  color: #ffffff;
}

.story-thumb-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
}

.story-thumb-card h4 {
  font-family: var(--font-family-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.story-thumb-card span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.story-reader-frame {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  max-width: 840px;
  margin: 0 auto;
}

.story-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--surface-border);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.story-header-bar h3 {
  font-family: var(--font-family-heading);
  font-size: 1.4rem;
  color: var(--text-primary);
}

.story-controls-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.story-counter {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.story-card-viewport {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 24px;
}

.story-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.story-slide-image {
  font-size: 5rem;
  background: var(--bg-tertiary);
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.story-slide-text {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text-primary);
  max-width: 620px;
  font-weight: 500;
}

.story-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-dots {
  display: flex;
  gap: 8px;
}

.story-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface-border);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.story-dot.active {
  background: var(--brand-primary);
  transform: scale(1.3);
}

/* ========================================================
   SECTION 6: CAREGIVER HUB STYLES
   ======================================================== */
.caregiver-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.resource-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

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

.res-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.resource-card h3 {
  font-family: var(--font-family-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.resource-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.res-list {
  padding-left: 18px;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.res-list li {
  margin-bottom: 8px;
}

.print-tools-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* ========================================================
   MODALS & OVERLAYS
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 24, 38, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 2px solid var(--surface-border);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-tertiary);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.jar-container {
  width: 130px;
  height: 160px;
  margin: 0 auto 18px;
  position: relative;
}

.jar-lid {
  width: 90px;
  height: 18px;
  background: #fab005;
  border-radius: 8px 8px 2px 2px;
  margin: 0 auto;
  border: 2px solid #e67700;
}

.jar-glass {
  width: 130px;
  height: 142px;
  border: 4px solid #a5d8ff;
  border-radius: 12px 12px 28px 28px;
  background: rgba(208, 235, 255, 0.25);
  box-shadow: inset 0 0 14px rgba(77, 171, 247, 0.3);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}

.jar-star {
  font-size: 1.4rem;
  animation: starDrop 0.4s ease-out;
}

@keyframes starDrop {
  from { transform: translateY(-40px) scale(0.2); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-title {
  font-family: var(--font-family-heading);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.reward-options-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
  text-align: left;
}

.reward-options-box h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.reward-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reward-item {
  background: var(--surface-card);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  border: 1px solid var(--surface-border);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-card);
  border: 2px solid var(--brand-primary);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-family-heading);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlide 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastSlide {
  from { transform: translateX(80px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========================================================
   SECTION 5.5: LEARNING GAMES
   ======================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-primary);
}

.game-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.game-title {
  font-family: var(--font-family-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  margin: 0;
}

.game-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--brand-primary);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.game-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.game-play-area {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
}

.game-prompt {
  font-family: var(--font-family-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.color-target-label,
.shape-display,
.animal-display,
.emotion-display {
  font-size: 1.5rem;
  display: inline-block;
  margin-left: 6px;
}

.animal-display,
.emotion-display {
  font-size: 3rem;
  display: block;
  text-align: center;
}

.animal-prompt {
  text-align: center;
}

.city-landmark-clue {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-top: 4px;
  background: var(--surface-hover);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
  border: 1px solid var(--surface-border);
}

.counting-stars {
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 2px;
  min-height: 40px;
}

.game-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.game-choice-btn {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-family: var(--font-family-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.game-choice-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: scale(1.05);
}

.game-choice-btn.correct {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.game-choice-btn.wrong {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

.game-feedback {
  text-align: center;
  font-family: var(--font-family-heading);
  font-size: 1rem;
  font-weight: 700;
  min-height: 24px;
  color: var(--text-primary);
}

.game-score {
  font-family: var(--font-family-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

/* Memory grid */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.memory-card {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--surface-border);
  background: var(--brand-primary);
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  user-select: none;
}

.memory-card.flipped,
.memory-card.matched {
  background: var(--surface-card);
  border-color: var(--brand-primary);
}

.memory-card.matched {
  background: var(--color-success);
  border-color: var(--color-success);
  cursor: default;
}

/* Big vs Small layout */
.big-small-pair {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.big-small-choice {
  border: 3px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  line-height: 1;
}

.big-small-choice:hover {
  border-color: var(--brand-primary);
  transform: scale(1.06);
}

.big-small-choice.correct {
  border-color: var(--color-success);
  background: rgba(56, 217, 169, 0.15);
}

.big-small-choice.wrong {
  border-color: var(--color-danger);
  background: rgba(255, 135, 135, 0.15);
}

/* Finger Tracing & Sparkle Trails */
@media (min-width: 900px) {
  .game-card.game-card-wide {
    grid-column: span 2;
  }
}

.tracing-pattern-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}

.tracing-pill-btn {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: var(--font-family-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.tracing-pill-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-2px);
}

.tracing-pill-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.tracing-canvas-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  border: 2px solid var(--surface-border);
  background: #0d1527;
  position: relative;
  touch-action: none;
}

#tracingCanvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

.tracing-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

/* Activity Spinner */
.spinner-play-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 12px;
}

.spinner-wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.spinner-pointer-indicator {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  color: #ff4757;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  z-index: 10;
  pointer-events: none;
}

#activitySpinnerCanvas {
  display: block;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.spinner-result-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.spinner-result-card.highlight {
  border-color: var(--brand-primary);
  background: rgba(108, 92, 231, 0.12);
  transform: scale(1.02);
}

.spinner-result-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.spinner-result-text {
  font-family: var(--font-family-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.spinner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.spinner-editor-panel {
  width: 100%;
  max-width: 480px;
  background: var(--surface-card);
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.spinner-editor-title {
  font-family: var(--font-family-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.spinner-editor-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.spinner-add-form {
  display: flex;
  gap: 8px;
}

.spinner-icon-input {
  width: 54px;
  text-align: center;
  font-size: 1.25rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 6px;
}

.spinner-text-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.88rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.spinner-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.spinner-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.spinner-tag-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-danger);
  font-size: 0.95rem;
  padding: 0 2px;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-tag-del:hover {
  background: rgba(255, 135, 135, 0.2);
}

/* ========================================================
   SECTION 7: PERSONAL PICTURES & AAC PHOTOS
   ======================================================== */
.aac-card-photo-wrap {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  border: 2px solid var(--surface-border);
  background: var(--bg-tertiary);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aac-card:hover .aac-card-photo-wrap {
  transform: scale(1.1) rotate(4deg);
}

.aac-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sentence-chip-photo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid var(--brand-primary);
}

.privacy-banner {
  margin-top: 14px;
}

.privacy-banner span {
  display: inline-block;
  background: rgba(56, 217, 169, 0.15);
  border: 1.5px solid #38d9a9;
  color: #0b4938;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
}

[data-theme="high-contrast"] .privacy-banner span {
  background: rgba(56, 217, 169, 0.2);
  color: #a9e34b;
}

.personal-photos-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.personal-photos-header h3 {
  font-family: var(--font-family-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.custom-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 2px dashed var(--surface-border);
}

.custom-photos-header h3 {
  font-family: var(--font-family-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
}

.custom-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.personal-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.personal-photo-slot-card {
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
}

.personal-photo-slot-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.personal-photo-slot-card.has-photo {
  border-color: var(--color-success);
}

.slot-img-frame {
  width: 128px;
  height: 128px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 3px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.08);
  position: relative;
}

.slot-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slot-default-icon {
  font-size: 4.2rem;
  line-height: 1;
}

.slot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.slot-title {
  font-family: var(--font-family-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.slot-badge {
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-accent);
  color: var(--brand-primary);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.slot-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.btn-upload-photo {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-family-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-upload-photo:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
}

.btn-remove-photo {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-remove-photo:hover {
  background: #ffdbe0;
  color: #e03131;
  border-color: #ffc9c9;
}

/* Custom Photo Modal Styling */
.form-group-personal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 16px;
}

.form-group-personal label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.personal-input,
.personal-select,
.personal-file-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.personal-input:focus,
.personal-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(92, 124, 250, 0.15);
}

.modal-photo-preview {
  margin: 14px 0 20px;
  display: flex;
  justify-content: center;
}

.preview-box {
  width: 110px;
  height: 110px;
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-placeholder {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cat-pill[data-cat="personal"].active {
  background: linear-gradient(135deg, #20c997 0%, #099268 100%);
  border-color: #099268;
  box-shadow: 0 4px 14px rgba(32, 201, 151, 0.35);
  color: #ffffff;
}

/* --- Footer --- */
.app-footer {
  background: var(--surface-card);
  border-top: 1px solid var(--surface-border);
  padding: 24px;
  margin-top: auto;
}

.footer-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand .footer-logo {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-primary);
}

.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.footer-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-item {
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
}

/* --- Print Styles for Teachers & Parents --- */
@media print {
  .app-header, .main-nav, .aac-voice-settings, .routine-picker, .routine-footer-actions, .app-footer, .sensory-controls {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .main-content {
    padding: 0 !important;
  }
  .tab-section {
    display: block !important;
    page-break-after: always;
  }
}

/* ========================================================
   TABLET & IPAD MODE OPTIMIZATIONS (iOS / iPadOS & Android Tablets)
   ======================================================== */

/* Touch Ergonomics & Anti-Lag */
@media (hover: none) and (pointer: coarse), (max-width: 1366px) {
  button, 
  select, 
  input, 
  .aac-card, 
  .mood-card, 
  .bubble-item, 
  .cat-pill, 
  .routine-tab, 
  .nav-tab, 
  .sensory-btn, 
  .crystal-tine, 
  .story-thumb-card,
  .star-check-btn,
  .animal-select-btn,
  .animal-speed-btn,
  .lava-theme-btn,
  .harp-mode-btn,
  .pacer-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Smooth touch momentum scrolling */
  .nav-container,
  .aac-category-filter,
  .routine-picker,
  .story-selector-row,
  .calm-nav-row {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

/* Tablet Portrait & Landscape Mode (iPad Mini, iPad 10.2", iPad Air, iPad Pro 11", iPad Pro 12.9") */
@media screen and (min-width: 768px) and (max-width: 1280px), 
       screen and (min-width: 768px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  
  /* Container & Page Sizing */
  .main-content {
    padding: 24px 20px;
    max-width: 100%;
  }

  .header-container {
    padding: 12px 20px;
    gap: 12px;
  }

  .brand-title {
    font-size: 1.45rem;
  }

  .logo-icon {
    width: 44px;
    height: 44px;
    font-size: 2rem;
  }

  .sensory-controls {
    gap: 8px;
  }

  .control-group {
    padding: 4px 8px;
  }

  .sensory-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .star-jar-badge {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  /* Main Navigation Bar on Tablet */
  .main-nav {
    position: sticky;
    top: 68px;
    z-index: 990;
    box-shadow: var(--shadow-sm);
  }

  .nav-container {
    padding: 8px 14px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .nav-tab {
    padding: 8px 14px;
    font-size: 0.9rem;
    min-height: 42px;
  }

  /* Section Title & Description */
  .section-hero {
    margin-bottom: 22px;
  }

  .section-title {
    font-size: 1.85rem;
  }

  .section-desc {
    font-size: 0.98rem;
  }

  /* AAC Board Tablet Mode */
  .aac-sentence-bar {
    padding: 14px 18px;
    min-height: 80px;
    gap: 12px;
    position: sticky;
    top: 124px;
    z-index: 900;
    background: var(--surface-card);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
  }

  .sentence-chip {
    font-size: 1.05rem;
    padding: 6px 12px;
    min-height: 40px;
  }

  .action-btn {
    padding: 10px 16px;
    font-size: 0.92rem;
    min-height: 44px;
  }

  .aac-voice-settings {
    padding: 10px 16px;
    gap: 16px;
  }

  .voice-dropdown {
    max-width: 220px;
    min-height: 40px;
  }

  .aac-category-filter {
    padding-bottom: 8px;
    gap: 8px;
  }

  .cat-pill {
    padding: 10px 18px;
    font-size: 0.92rem;
    min-height: 44px;
  }

  /* Tablet AAC Grid: perfectly balanced 4-6 cards per row */
  .aac-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
  }

  .aac-card {
    padding: 16px 10px;
    min-height: 120px;
    border-radius: var(--radius-md);
  }

  .aac-card-icon {
    font-size: 2.7rem;
  }

  .aac-card-label {
    font-size: 0.98rem;
  }

  /* Touch Active State for AAC Cards */
  .aac-card:active {
    transform: scale(0.95);
    background: var(--bg-accent);
  }

  /* Calm Zone on Tablet */
  .calm-nav-row {
    gap: 10px;
  }

  .calm-nav-card {
    padding: 14px 18px;
    min-height: 72px;
  }

  .breathing-orb-container {
    padding: 30px 20px;
  }

  .breathing-orb {
    width: 190px;
    height: 190px;
  }

  .crystal-tines-grid {
    gap: 8px;
    padding: 18px 12px;
    min-height: 210px;
  }

  .crystal-tine {
    padding: 10px 4px;
  }

  .tine-note {
    font-size: 1rem;
  }

  .lava-lamp-frame {
    height: 380px;
  }

  .bubble-wrap-grid {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 12px;
    padding: 20px;
  }

  .bubble-item {
    width: 64px;
    height: 64px;
  }

  #starlightCanvas {
    height: 340px;
  }

  /* Visual Routines on Tablet */
  .routine-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
  }

  .routine-card {
    padding: 16px 18px;
    min-height: 76px;
  }

  /* Emotion Check-in on Tablet */
  .mood-selection-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .mood-card {
    padding: 18px 12px;
  }

  .mood-emoji {
    font-size: 2.8rem;
  }

  /* Social Stories on Tablet */
  .story-selector-row {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
  }

  .story-reader-frame {
    padding: 24px;
  }

  .story-card-viewport {
    min-height: 260px;
  }

  .story-slide-text {
    font-size: 1.2rem;
  }

  /* Caregiver Hub on Tablet */
  .caregiver-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Personal Pictures on Tablet */
  .personal-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

/* Tablet Portrait Orientation Enhancements (768px - 900px wide) */
@media screen and (min-width: 768px) and (max-width: 900px) and (orientation: portrait) {
  .aac-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .aac-card {
    padding: 14px 8px;
    min-height: 112px;
  }

  .aac-card-icon {
    font-size: 2.5rem;
  }

  .aac-card-label {
    font-size: 0.92rem;
  }

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

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

/* Responsive adjustments for mobile devices */
@media (max-width: 767px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .sensory-controls {
    width: 100%;
    justify-content: space-between;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .aac-sentence-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-container {
    padding: 6px 10px;
    gap: 6px;
  }
  .nav-tab {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  .sentence-actions {
    justify-content: flex-end;
  }
  .personal-photos-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   SIDE FEATURES: SOUND GARDEN & ZEN GLOW DOODLE
   ======================================================== */

/* --- Floating Side Edge Tabs --- */
.side-floating-tab {
  position: fixed;
  top: 45%;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--font-family-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, filter 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.side-floating-tab.left-tab {
  left: 0;
  transform: translateY(-50%) translateX(0);
  border-radius: 0 20px 20px 0;
  background: linear-gradient(135deg, #059669 0%, #0d9488 50%, #0284c7 100%);
  color: #fff;
  border-right: 3px solid #6ee7b7;
  border-top: 2px solid rgba(255, 255, 255, 0.4);
  border-bottom: 2px solid rgba(0, 0, 0, 0.2);
  animation: gardenTabPulse 3.5s infinite ease-in-out;
}

.side-floating-tab.left-tab:hover {
  transform: translateY(-50%) translateX(6px) scale(1.05);
  box-shadow: 0 12px 30px rgba(13, 148, 136, 0.55);
  filter: brightness(1.12);
}

@keyframes gardenTabPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
  }
  50% {
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.6), 0 0 16px rgba(110, 231, 183, 0.4);
  }
}

.side-floating-tab.right-tab {
  right: 0;
  transform: translateY(-50%) translateX(0);
  border-radius: 20px 0 0 20px;
  background: linear-gradient(135deg, #7928ca 0%, #ff0080 50%, #0070f3 100%);
  color: #fff;
  border-left: 3px solid #79ffe1;
  border-top: 2px solid rgba(255,255,255,0.4);
  border-bottom: 2px solid rgba(0,0,0,0.2);
  animation: zenTabPulse 3s infinite ease-in-out;
}

.side-floating-tab.right-tab:hover {
  transform: translateY(-50%) translateX(-6px) scale(1.05);
  box-shadow: 0 12px 30px rgba(255, 0, 128, 0.5);
  filter: brightness(1.12);
}

@keyframes zenTabPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(121, 40, 202, 0.35);
  }
  50% {
    box-shadow: 0 8px 30px rgba(255, 0, 128, 0.65), 0 0 16px rgba(121, 255, 225, 0.4);
  }
}

.side-tab-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.side-tab-badge {
  background: #fef08a;
  color: #854d0e;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.side-tab-sparkle {
  font-size: 1.1rem;
  animation: spinSparkle 4s linear infinite;
}

@keyframes spinSparkle {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

/* --- Side Drawers & Panels --- */
.side-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100vw;
  max-width: 490px;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.35s ease;
}

.side-drawer.open {
  visibility: visible;
  pointer-events: auto;
}

.side-drawer-left {
  left: 0;
}

.side-drawer-right {
  right: 0;
}

.side-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.side-drawer.open .side-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.side-drawer-left .side-drawer-panel {
  left: 0;
  transform: translateX(-100%);
  border-right: 2px solid var(--surface-border);
}

.side-drawer-left.open .side-drawer-panel {
  transform: translateX(0);
}

.side-drawer-right .side-drawer-panel {
  right: 0;
  transform: translateX(100%);
  border-left: 2px solid var(--surface-border);
}

.side-drawer-right.open .side-drawer-panel {
  transform: translateX(0);
}

.side-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.side-drawer-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-badge {
  display: inline-block;
  align-self: flex-start;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #fde68a;
}

.side-badge.zen-badge-pill {
  background: linear-gradient(135deg, rgba(121, 40, 202, 0.2), rgba(0, 240, 255, 0.2));
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.side-title {
  font-family: var(--font-family-heading);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin: 0;
}

.side-close-btn {
  background: var(--bg-tertiary);
  border: none;
  font-size: 1.2rem;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.side-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: scale(1.1);
}

.side-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  line-height: 1.45;
}

/* ========================================================
   FEATURE 5: 🎵 HARMONIC PENTATONIC SOUND GARDEN STYLING
   ======================================================== */
.sound-garden-panel {
  background: radial-gradient(circle at 50% 20%, #0f2b2b 0%, #071919 60%, #030d0d 100%);
  border-right: 2px solid rgba(16, 185, 129, 0.35);
  color: #f0fdf4;
}

.sound-garden-badge-pill {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.sound-garden-panel .side-title {
  color: #f0fdf4;
  text-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
}

.sound-garden-panel .side-desc {
  color: #a7f3d0;
}

.sound-garden-panel .side-close-btn {
  background: #064e3b;
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.sound-garden-panel .side-close-btn:hover {
  background: #047857;
  color: #ecfdf5;
}

/* Garden Controls */
.sound-garden-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.garden-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.garden-control-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6ee7b7;
  min-width: 44px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.garden-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.garden-pill-btn {
  background: rgba(6, 78, 59, 0.55);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 16px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.garden-pill-btn:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.garden-pill-btn.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border-color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

/* Action Bar */
.garden-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-garden-breeze {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 118, 110, 0.5);
  color: #ccfbf1;
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
}

.btn-garden-breeze:hover {
  background: rgba(13, 148, 136, 0.7);
  transform: scale(1.02);
}

.btn-garden-breeze.active {
  background: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  border-color: #5eead4;
  color: #fff;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.55);
}

.btn-garden-breeze.active .breeze-icon {
  display: inline-block;
  animation: leafSway 1.5s infinite ease-in-out;
}

@keyframes leafSway {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(18deg) scale(1.15); }
}

.garden-sweep-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: #6ee7b7;
  opacity: 0.9;
  user-select: none;
}

/* Chimes Stage */
.sound-garden-stage {
  position: relative;
  flex: 1;
  min-height: 480px;
  background: radial-gradient(circle at 50% 15%, rgba(6, 78, 59, 0.25) 0%, rgba(2, 44, 34, 0.4) 60%, rgba(0, 0, 0, 0.6) 100%);
  border: 2px solid rgba(52, 211, 153, 0.25);
  border-radius: 18px;
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.6), 0 8px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  touch-action: none;
}

/* Hanging Beam */
.chime-beam {
  position: relative;
  width: 90%;
  margin-top: 14px;
  z-index: 5;
}

.chime-beam-wood {
  position: relative;
  height: 18px;
  background: linear-gradient(180deg, #92400e 0%, #78350f 45%, #451a03 100%);
  border-radius: 9px;
  border: 2px solid #b45309;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(254, 240, 138, 0.3);
}

.chime-beam-rope {
  position: absolute;
  width: 3px;
  height: 18px;
  top: -18px;
  background: repeating-linear-gradient(45deg, #d97706, #d97706 2px, #78350f 2px, #78350f 4px);
}
.rope-left { left: 14%; }
.rope-right { right: 14%; }

/* Chimes Rack */
.chimes-rack {
  position: relative;
  width: 92%;
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 0;
  z-index: 10;
}

/* Individual Chime Tube Unit */
.chime-tube-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform-origin: 50% 0;
  transition: filter 0.2s ease;
  padding: 0 4px;
}

.chime-string {
  width: 2px;
  height: 22px;
  background: rgba(254, 240, 138, 0.65);
  box-shadow: 0 0 4px rgba(254, 240, 138, 0.4);
}

/* Chime Tube */
.chime-tube {
  position: relative;
  width: 28px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 2px 0 4px rgba(255, 255, 255, 0.6), inset -2px 0 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

/* Timbre visual themes */
.sound-garden-stage[data-timbre="bamboo"] .chime-tube {
  background: linear-gradient(90deg, #78350f 0%, #ca8a04 25%, #fef08a 50%, #ca8a04 75%, #451a03 100%);
  border: 1.5px solid #a16207;
}

.sound-garden-stage[data-timbre="crystal"] .chime-tube {
  background: linear-gradient(90deg, #0284c7 0%, #67e8f9 30%, #ffffff 50%, #c084fc 75%, #4338ca 100%);
  border: 1.5px solid #a5f3fc;
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.4), inset 0 0 8px rgba(255, 255, 255, 0.8);
}

.sound-garden-stage[data-timbre="kalimba"] .chime-tube {
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 25%, #99f6e4 50%, #14b8a6 75%, #134e4a 100%);
  border: 1.5px solid #5eead4;
}

.sound-garden-stage[data-timbre="raindrops"] .chime-tube {
  background: linear-gradient(90deg, #1e3a8a 0%, #38bdf8 25%, #f0fdfa 50%, #0ea5e9 75%, #0f172a 100%);
  border: 1.5px solid #7dd3fc;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

/* Striker Clapper disc at bottom */
.chime-clapper {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fef08a 45%, #b45309 100%);
  border: 1.5px solid #fef08a;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
  margin-top: 6px;
  transition: transform 0.2s ease;
}

/* Note Tag Label */
.chime-tag {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(110, 231, 183, 0.35);
  border-radius: 10px;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.chime-note-name {
  font-family: var(--font-family-heading);
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.chime-solfege {
  font-size: 0.65rem;
  font-weight: 700;
  color: #6ee7b7;
  margin-top: 1px;
}

/* Striking Active State & Animations */
.chime-tube-unit.striking {
  animation: chimePendulumSway 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.chime-tube-unit.striking .chime-tube {
  filter: brightness(1.4) drop-shadow(0 0 16px rgba(52, 211, 153, 0.9));
  transform: scale(1.06);
}

.chime-tube-unit.striking .chime-clapper {
  transform: scale(1.3) rotate(15deg);
  box-shadow: 0 0 12px #fef08a;
}

@keyframes chimePendulumSway {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(5.5deg); }
  40% { transform: rotate(-4deg); }
  60% { transform: rotate(2.5deg); }
  80% { transform: rotate(-1deg); }
  100% { transform: rotate(0deg); }
}

/* Resonance Expanding Ring Wave */
.chime-ripple-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(110, 231, 183, 0.85);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.5);
  animation: rippleExpand 0.75s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
  z-index: 2;
}

@keyframes rippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3.8);
    opacity: 0;
  }
}

/* Canvas for floating sparkles/petals */
.garden-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* ========================================================
   FEATURE 6: ZEN GLOW DOODLE MARGINS STYLING
   ======================================================== */
.zen-glow-panel {
  background: #090d16;
  border-left: 2px solid rgba(0, 240, 255, 0.25);
  color: #f8fafc;
}

.zen-glow-panel .side-title {
  color: #f8fafc;
}

.zen-glow-panel .side-desc {
  color: #94a3b8;
}

.zen-glow-panel .side-close-btn {
  background: #1e293b;
  color: #94a3b8;
}

.zen-glow-panel .side-close-btn:hover {
  background: #334155;
  color: #f8fafc;
}

/* Neon Doodle Toolbar */
.zen-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.zen-color-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #131b2e;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
}

.zen-color-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.zen-color-btn:hover {
  transform: scale(1.15);
}

.zen-color-btn.active {
  border-color: #ffffff;
  transform: scale(1.2);
}

.zen-tool-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.zen-brush-sizes {
  display: flex;
  background: #131b2e;
  border-radius: 10px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.zen-size-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zen-size-btn.active {
  background: #223254;
  color: #00f0ff;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.btn-zen-clear {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(121, 40, 202, 0.6), rgba(255, 0, 128, 0.6));
  color: #ffffff;
  border: 1px solid rgba(255, 0, 128, 0.4);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(255, 0, 128, 0.25);
}

.btn-zen-clear:hover {
  transform: scale(1.04);
  box-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
  background: linear-gradient(135deg, rgba(121, 40, 202, 0.9), rgba(255, 0, 128, 0.9));
}

/* Velvet Dark Glowing Canvas Wrapper */
.zen-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 520px;
  height: 560px;
  background: radial-gradient(circle at 50% 50%, #0d1322 0%, #050811 100%);
  border-radius: 18px;
  border: 2px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
}

#zenGlowCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.zen-canvas-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  transition: opacity 0.5s ease;
  white-space: nowrap;
}

.zen-canvas-hint.hidden-hint {
  opacity: 0;
}

/* ========================================================
   FEATURE: VISUAL TRANSITION COUNTDOWN TIMER ("Time Timer" & Sandglass)
   ======================================================== */
.transition-timer-card {
  background: var(--surface);
  border: 2px solid var(--surface-border);
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.transition-timer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.timer-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  margin-bottom: 4px;
}

.timer-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.timer-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  line-height: 1.45;
}

.timer-view-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timer-view-btn {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-view-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-float-timer {
  background: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-float-timer:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

/* Presets Bar */
.timer-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 14px;
  margin-bottom: 20px;
}

.timer-preset-btn {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.timer-preset-btn.active {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.timer-custom-dial {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.custom-dial-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.timer-slider {
  width: 110px;
  accent-color: #ef4444;
  cursor: pointer;
}

.custom-dial-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ef4444;
  min-width: 32px;
}

/* Stage Wrapper */
.timer-stage-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  min-height: 330px;
}

/* View 1: Time Timer Disc */
.timer-disc-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.time-timer-svg {
  width: 290px;
  height: 290px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
}

.clock-outer-rim {
  fill: #1e293b;
  stroke: #475569;
  stroke-width: 4;
}

.clock-face {
  fill: #ffffff;
  stroke: #e2e8f0;
  stroke-width: 2;
}

[data-theme="dark"] .clock-face {
  fill: #0f172a;
  stroke: #334155;
}

.clock-tick-line {
  stroke: #94a3b8;
  stroke-width: 2;
}

.clock-tick-major {
  stroke: #475569;
  stroke-width: 3.5;
}

.clock-tick-text {
  font-family: var(--font-family-heading);
  font-size: 11px;
  font-weight: 800;
  fill: #64748b;
  text-anchor: middle;
  dominant-baseline: central;
}

.clock-wedge {
  fill: #ef4444;
  transition: fill 0.3s ease;
}

.clock-wedge.warning-phase {
  fill: #f59e0b;
}

.clock-wedge.almost-phase {
  fill: #a855f7;
  animation: wedgePulse 1s infinite alternate ease-in-out;
}

@keyframes wedgePulse {
  0% { opacity: 0.9; }
  100% { opacity: 1; filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.7)); }
}

.clock-center-hub {
  fill: #1e293b;
  stroke: #ffffff;
  stroke-width: 3;
}

.clock-time-display {
  font-family: var(--font-family-heading);
  font-size: 21px;
  font-weight: 800;
  fill: #ffffff;
}

/* View 2: Sandglass Hourglass */
.timer-sand-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sandglass-svg {
  width: 210px;
  height: 280px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.18));
}

.sand-wood-bar {
  fill: #854d0e;
  stroke: #a16207;
  stroke-width: 2;
}

.sand-pillar {
  fill: #ca8a04;
}

.sandglass-glass {
  fill: rgba(255, 255, 255, 0.08);
  stroke: #94a3b8;
  stroke-width: 3;
}

.sand-top-level {
  fill: #f59e0b;
  transition: height 0.5s ease;
}

.sand-stream {
  stroke: #f59e0b;
  stroke-width: 3.5;
  stroke-dasharray: 6, 4;
  animation: sandFallAnim 0.35s infinite linear;
}

@keyframes sandFallAnim {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 10; }
}

.sand-bottom-pile {
  fill: #f59e0b;
  transition: all 0.5s ease;
}

.sandglass-digital {
  font-family: var(--font-family-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 4px 18px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
}

/* Status Banner */
.timer-status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Timer Action Controls */
.timer-controls-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.timer-start-btn {
  min-width: 150px;
  font-size: 1.05rem;
  font-weight: 800;
}

.timer-reset-btn {
  min-width: 100px;
  font-size: 1rem;
}

/* Floating Mini Timer Widget */
.floating-timer-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  border: 2px solid #ef4444;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 30px;
  padding: 6px 12px 6px 8px;
  color: #fff;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.floating-timer-widget.hidden {
  display: none !important;
}

.floating-timer-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.mini-timer-disc {
  width: 32px;
  height: 32px;
  transform: rotate(-90deg);
}

.mini-timer-bg {
  fill: #1e293b;
  stroke: #475569;
  stroke-width: 2;
}

.mini-timer-wedge {
  fill: none;
  stroke: #ef4444;
  stroke-width: 18;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s linear;
}

.mini-timer-time {
  font-family: var(--font-family-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
}

.mini-timer-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mini-timer-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ========================================================
   FEATURE: SENSORY SQUISH JELLY & LIQUID FLOOR TILE
   ======================================================== */
.squish-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.squish-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-radius: 14px;
  border: 1px solid var(--surface-border);
}

.squish-palette-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.squish-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.squish-pill-btn {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.squish-pill-btn.active {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #fff;
  border-color: #c084fc;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

.squish-action-group {
  display: flex;
  gap: 8px;
}

.btn-squish-sound {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-squish-sound.active {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.btn-squish-reset {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-squish-reset:hover {
  background: var(--bg-accent);
  color: var(--text-primary);
}

/* Squish Tile Frame */
.squish-tile-frame {
  position: relative;
  width: 100%;
  height: 480px;
  min-height: 440px;
  border-radius: 24px;
  border: 6px solid #334155;
  box-shadow: inset 0 6px 20px rgba(0, 0, 0, 0.5), 0 16px 36px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: pointer;
  background: #090d16;
}

.squish-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.squish-glass-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.03) 40%, transparent 60%);
  pointer-events: none;
  border-radius: 18px;
}

.squish-prompt-overlay {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 20px;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  pointer-events: none;
  transition: opacity 0.5s ease;
  white-space: nowrap;
}

.squish-prompt-overlay.hidden-prompt {
  opacity: 0;
}

/* Responsive side tabs on smaller displays / iPad */
@media (max-width: 640px) {
  .side-floating-tab {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .side-floating-tab.left-tab {
    top: 38%;
  }
  .side-floating-tab.right-tab {
    top: 38%;
  }
  .side-drawer-panel {
    max-width: 100vw;
    padding: 14px;
  }
  .transition-timer-card {
    padding: 14px;
  }
  .time-timer-svg {
    width: 240px;
    height: 240px;
  }
  .timer-custom-dial {
    width: 100%;
    margin-left: 0;
  }
  .squish-tile-frame {
    height: 400px;
    min-height: 360px;
  }
}

/* ========================================================
   FEATURE: PRINTABLE AAC BOARDS & TOKEN STUDIO
   ======================================================== */
.btn-print-board {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-print-board:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(168, 85, 247, 0.28));
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Modal sizing and layout */
.printable-aac-modal-card {
  max-width: 1140px;
  width: 95vw;
  height: 92vh;
  max-height: 880px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 24px;
  background: var(--bg-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.printable-modal-header {
  margin-bottom: 14px;
  flex-shrink: 0;
}

.printable-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  margin-bottom: 6px;
}

.printable-modal-header .modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.printable-modal-header .modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Studio 2-Column Body */
.printable-studio-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left Sidebar Controls */
.printable-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 8px;
  min-height: 0;
}

.printable-controls-panel::-webkit-scrollbar {
  width: 6px;
}
.printable-controls-panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 6px;
}

.print-control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.print-control-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.print-select,
.print-text-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.print-select:focus,
.print-text-input:focus {
  outline: none;
  border-color: #6366f1;
}

.print-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-tertiary);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.print-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.print-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #6366f1;
}

.print-header-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-tertiary);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.print-header-inputs.hidden-header-inputs {
  display: none;
}

/* Studio Actions */
.printable-studio-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-print-now {
  flex: 1;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-print-now:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  transform: translateY(-1px);
}

/* Right Side: Preview Stage */
.printable-preview-stage {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  min-height: 0;
  position: relative;
}

.preview-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.12);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.preview-tip-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 2px 8px;
  border-radius: 10px;
}

.printable-sheet-scroller {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  min-height: 0;
}

/* The A4 Printable Sheet (Simulated on Screen) */
.printable-aac-sheet {
  width: 100%;
  max-width: 580px;
  aspect-ratio: 1 / 1.414; /* Standard A4 aspect ratio */
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  box-sizing: border-box;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
}

/* Sheet Header */
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.sheet-title-group {
  flex: 1;
}

.sheet-main-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 2px 0;
  letter-spacing: -0.01em;
}

.sheet-sub-title {
  font-size: 0.72rem;
  color: #4b5563;
  margin: 0;
}

.sheet-meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #374151;
}

.meta-label {
  font-size: 0.65rem;
  color: #6b7280;
  margin-right: 4px;
}

.meta-line {
  display: inline-block;
  min-width: 90px;
  border-bottom: 1px solid #9ca3af;
  text-align: center;
}

/* Hide header on sheet when checkbox is unchecked */
.printable-aac-sheet.no-header .sheet-header {
  display: none !important;
}

/* Grid of Cards on Printable Sheet */
.printable-cards-grid {
  display: grid;
  gap: 10px;
  flex: 1;
  min-height: 0;
  align-content: stretch;
}

/* Grid Layout Dimensions */
.printable-aac-sheet[data-grid="2x3"] .printable-cards-grid {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.printable-aac-sheet[data-grid="3x3"] .printable-cards-grid {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.printable-aac-sheet[data-grid="3x4"] .printable-cards-grid {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
}
.printable-aac-sheet[data-grid="4x4"] .printable-cards-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
}
.printable-aac-sheet[data-grid="5x4"] .printable-cards-grid {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 6px;
}

/* Individual Printable Card */
.print-sheet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 2.5px solid #d1d5db;
  background: #ffffff;
  padding: 6px 4px;
  box-sizing: border-box;
  text-align: center;
  position: relative;
  overflow: hidden;
  break-inside: avoid;
}

.print-sheet-card .print-card-icon {
  font-size: 2.2rem;
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.printable-aac-sheet[data-grid="2x3"] .print-sheet-card .print-card-icon {
  font-size: 3.4rem;
}
.printable-aac-sheet[data-grid="3x3"] .print-sheet-card .print-card-icon {
  font-size: 2.8rem;
}
.printable-aac-sheet[data-grid="4x4"] .print-sheet-card .print-card-icon {
  font-size: 1.9rem;
}
.printable-aac-sheet[data-grid="5x4"] .print-sheet-card .print-card-icon {
  font-size: 1.6rem;
  margin-bottom: 2px;
}

.print-card-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.printable-aac-sheet[data-grid="2x3"] .print-card-img {
  width: 72px;
  height: 72px;
}

.print-sheet-card .print-card-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.15;
  word-break: break-word;
  max-width: 100%;
}

.printable-aac-sheet[data-grid="2x3"] .print-sheet-card .print-card-label {
  font-size: 1.25rem;
}
.printable-aac-sheet[data-grid="3x3"] .print-sheet-card .print-card-label {
  font-size: 1.05rem;
}
.printable-aac-sheet[data-grid="5x4"] .print-sheet-card .print-card-label {
  font-size: 0.72rem;
}

.print-sheet-card .print-card-sublabel {
  font-size: 0.7rem;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.1;
  margin-top: 2px;
}

.printable-aac-sheet[data-grid="2x3"] .print-sheet-card .print-card-sublabel {
  font-size: 0.95rem;
}
.printable-aac-sheet[data-grid="5x4"] .print-sheet-card .print-card-sublabel {
  font-size: 0.62rem;
}

/* Fitzgerald Color Coding Styles */
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="actions"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="starters"] {
  border-color: #059669;
  background: #f0fdf4;
}
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="food"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="clothes"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="toys"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="animals"] {
  border-color: #d97706;
  background: #fffbeb;
}
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="family"] {
  border-color: #ca8a04;
  background: #fefce8;
}
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="needs"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="body"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="colors"] {
  border-color: #2563eb;
  background: #eff6ff;
}
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="feelings"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="quick"] {
  border-color: #e11d48;
  background: #fff1f2;
}
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="school"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="time"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="cities"],
.printable-aac-sheet[data-style="color"] .print-sheet-card[data-cat="questions"] {
  border-color: #7c3aed;
  background: #f5f3ff;
}

/* Ink Saver Black & White Mode */
.printable-aac-sheet[data-style="ink_saver"] .print-sheet-card {
  border-color: #111827 !important;
  background: #ffffff !important;
}

/* Dotted Scissor Guidelines (PECS Token Cut-Outs) */
.printable-aac-sheet.has-cut-lines .print-sheet-card {
  border-style: dashed !important;
  border-width: 2px !important;
}
.printable-aac-sheet.has-cut-lines .print-sheet-card::after {
  content: '✂';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.65rem;
  color: #6b7280;
  opacity: 0.65;
}

/* Sheet Footer */
.sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e5e7eb;
  padding-top: 6px;
  margin-top: 10px;
  font-size: 0.65rem;
  color: #9ca3af;
  font-weight: 600;
  flex-shrink: 0;
}

/* Responsive modal behavior on tablet / mobile */
@media (max-width: 860px) {
  .printable-aac-modal-card {
    height: 95vh;
    padding: 16px;
  }
  .printable-studio-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .printable-preview-stage {
    min-height: 420px;
  }
}

/* ========================================================
   DEDICATED PRINT STYLES FOR AAC BOARDS
   ======================================================== */
@media print {
  body.printing-aac-board {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-aac-board * {
    visibility: hidden !important;
  }

  body.printing-aac-board #printableAACSheet,
  body.printing-aac-board #printableAACSheet * {
    visibility: visible !important;
  }

  body.printing-aac-board #printableAACModal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 999999 !important;
  }

  body.printing-aac-board .printable-aac-modal-card {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.printing-aac-board .printable-modal-header,
  body.printing-aac-board .printable-controls-panel,
  body.printing-aac-board .modal-close-btn,
  body.printing-aac-board .preview-stage-header {
    display: none !important;
  }

  body.printing-aac-board .printable-studio-body,
  body.printing-aac-board .printable-preview-stage,
  body.printing-aac-board .printable-sheet-scroller {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
  }

  body.printing-aac-board #printableAACSheet {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    max-width: none !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 10mm 12mm !important;
    box-shadow: none !important;
    border: none !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-after: avoid !important;
    break-inside: avoid !important;
  }
}





/* ========================================================
   FEATURE: CAREGIVER & EDUCATOR DASHBOARD
   ======================================================== */

.caregiver-session-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  color: #10b981;
  margin-top: 6px;
  margin-bottom: 12px;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Child Profile Card */
.caregiver-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.2s ease;
}

.profile-header-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar-wrap {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  flex-shrink: 0;
}

.profile-main-meta {
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.profile-child-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.profile-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.profile-focus-goal {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.btn-edit-profile {
  flex-shrink: 0;
}

/* Profile Edit Drawer */
.profile-edit-drawer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-color);
  animation: fadeInDown 0.25s ease;
}

.profile-edit-drawer.hidden {
  display: none !important;
}

/* Global Hidden Class */
.hidden {
  display: none !important;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-input-group.full-width {
  grid-column: 1 / -1;
}

.profile-input-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-input,
.dashboard-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.dashboard-input:focus,
.dashboard-textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.profile-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}

/* Profile Tags Row */
.profile-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-tag-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.profile-age-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Detailed Profile Grid Overview (8 Attributes) */
.profile-attributes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.profile-attr-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.profile-attr-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.attr-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.attr-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.attr-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.attr-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.attr-custom-photos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.photo-count-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: var(--brand-primary);
  padding: 2px 8px;
  border-radius: 10px;
}

.btn-attr-link {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-attr-link:hover {
  background: var(--brand-primary);
  color: #fff;
}

/* Dashboard Section Headers & Subheadings */
.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.dashboard-section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-subheading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.dashboard-subheading-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px;
  border-radius: 14px;
  letter-spacing: 0.04em;
}

.progress-framing-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Real-Time Today's Dashboard KPI Grid */
.caregiver-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.kpi-icon-wrap {
  font-size: 1.6rem;
  margin-bottom: 10px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-number {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 4px;
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.kpi-card.kpi-stars { border-left: 4px solid #f59e0b; }
.kpi-card.kpi-aac { border-left: 4px solid #3b82f6; }
.kpi-card.kpi-sentences { border-left: 4px solid #8b5cf6; }
.kpi-card.kpi-routine { border-left: 4px solid #10b981; }
.kpi-card.kpi-mood { border-left: 4px solid #ec4899; }
.kpi-card.kpi-calm { border-left: 4px solid #06b6d4; }

/* Progress Insights Section & Cards */
.caregiver-progress-section {
  margin-top: 32px;
}

.progress-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.progress-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.progress-card-title-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.progress-card-title-group .card-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 2px;
}

.progress-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.progress-card-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 2px 0 12px 0;
  line-height: 1.35;
}

/* Words Chip Lists */
.progress-words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  align-content: flex-start;
}

.progress-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.progress-word-chip:hover {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.progress-word-chip .chip-count {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.18);
  color: var(--brand-primary);
  padding: 1px 7px;
  border-radius: 8px;
}

.progress-word-chip.new-word {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #047857;
}

.progress-word-chip.new-word .chip-count {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}

/* Favorite Categories Meter List */
.progress-categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-meter-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.category-name {
  color: var(--text-primary);
}

.category-stat {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.category-meter-track {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.category-meter-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.4s ease;
}

/* Routine Completion Breakdown */
.progress-routines-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.routine-breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.routine-name {
  font-weight: 700;
  color: var(--text-primary);
}

.routine-count {
  font-size: 0.78rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 8px;
  border-radius: 8px;
}

.progress-empty-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px 0;
  text-align: center;
  width: 100%;
}

/* Communication History Card & Filter Pills */
.communication-history-card {
  margin-bottom: 28px;
}

.comm-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.history-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-filter-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-filter-pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.history-filter-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* Main 2-Column Dashboard Layout */
.caregiver-main-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

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

.dashboard-card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.dashboard-card-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Mood & Regulation Form */
.caregiver-log-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-tertiary);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.log-form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-section-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* State Pill Radio Selector */
.state-pill-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.state-pill {
  cursor: pointer;
  display: block;
}

.state-pill input[type="radio"] {
  display: none;
}

.state-pill span {
  display: block;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.state-pill {
  cursor: pointer;
  display: block;
  user-select: none;
}

.state-pill input[type="radio"]:focus-visible + span {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.state-pill.green input[type="radio"]:checked + span {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.22);
  color: #047857;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  font-weight: 800;
}
.state-pill.yellow input[type="radio"]:checked + span {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  font-weight: 800;
}
.state-pill.red input[type="radio"]:checked + span {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.22);
  color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
  font-weight: 800;
}
.state-pill.blue input[type="radio"]:checked + span {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.22);
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  font-weight: 800;
}

/* Triggers Chips */
.triggers-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trigger-chip {
  cursor: pointer;
}

.trigger-chip input[type="checkbox"] {
  display: none;
}

.trigger-chip span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.trigger-chip input[type="checkbox"]:checked + span {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #f59e0b;
  font-weight: 700;
}

/* Log History Entries */
.log-entries-history .history-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.log-entries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-entry-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all 0.2s;
}

.log-entry-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.log-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-entry-state-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 10px;
}
.log-entry-state-badge.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.log-entry-state-badge.yellow { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.log-entry-state-badge.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.log-entry-state-badge.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

.log-entry-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.log-entry-meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.log-entry-note {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-style: italic;
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid #6366f1;
}

.btn-delete-log {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.75;
}
.btn-delete-log:hover {
  opacity: 1;
  text-decoration: underline;
}

.log-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Timeline Card */
.live-tag {
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 0.05em;
}

.session-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  font-size: 0.84rem;
}

.timeline-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.timeline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-text {
  color: var(--text-primary);
  font-weight: 600;
}

.timeline-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Evidence Toolkit Accordion */
.evidence-toolkit-card .toolkit-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.toolkit-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolkit-item {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-tertiary);
  overflow: hidden;
  transition: all 0.2s ease;
}

.toolkit-item summary {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-primary);
  user-select: none;
  font-weight: 700;
}

.toolkit-item .item-content {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.toolkit-item .item-content p {
  margin: 0 0 8px 0;
}

.toolkit-item .res-list {
  margin: 0;
  padding-left: 20px;
}

.toolkit-print-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
}

.print-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.toolkit-print-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

/* Mobile Responsiveness for Caregiver Dashboard */
@media (max-width: 960px) {
  .caregiver-main-layout {
    grid-template-columns: 1fr;
  }
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }
  .state-pill-selector {
    grid-template-columns: 1fr;
  }
  .profile-attributes-grid {
    grid-template-columns: 1fr;
  }
  .progress-insights-grid {
    grid-template-columns: 1fr;
  }
  .comm-history-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================================
   CAREGIVER IEP REPORT PRINT STYLES
   ======================================================== */
@media print {
  body.printing-caregiver-report {
    background: #ffffff !important;
    color: #000000 !important;
  }
  body.printing-caregiver-report .app-header,
  body.printing-caregiver-report .main-nav,
  body.printing-caregiver-report .app-footer,
  body.printing-caregiver-report .sensory-controls,
  body.printing-caregiver-report .side-floating-tab,
  body.printing-caregiver-report .side-drawer,
  body.printing-caregiver-report #section-aac,
  body.printing-caregiver-report #section-routine,
  body.printing-caregiver-report #section-calm,
  body.printing-caregiver-report #section-emotions,
  body.printing-caregiver-report #section-stories,
  body.printing-caregiver-report #section-games,
  body.printing-caregiver-report #section-personal {
    display: none !important;
  }
  body.printing-caregiver-report #section-caregiver {
    display: block !important;
  }
  body.printing-caregiver-report .btn-edit-profile,
  body.printing-caregiver-report #caregiverLogForm,
  body.printing-caregiver-report #btnExportLogReport,
  body.printing-caregiver-report .btn-delete-log,
  body.printing-caregiver-report .evidence-toolkit-card {
    display: none !important;
  }
}
