/* ============================================
   SideQuest by Clear Week — Design System
   Brand: Forest Green #173C3A, Cream #F7F3E9, Orange #ED713D
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Brand Colors */
  --forest: #173C3A;
  --forest-light: #245250;
  --forest-dark: #0E2A28;
  --cream: #F7F3E9;
  --cream-warm: #FDFBF5;
  --cream-dim: #EDE7D6;
  --orange: #ED713D;
  --orange-light: #F59163;
  --orange-dark: #D45A26;
  --orange-pale: #FBE8DB;

  /* Semantic */
  --bg: var(--cream);
  --surface: var(--cream-warm);
  --surface-2: #FFFFFF;
  --surface-offset: var(--cream-dim);
  --text: var(--forest);
  --text-muted: #5C7572;
  --text-faint: #8FA09D;
  --border: #D9D2C2;
  --divider: #E5DFD0;
  --primary: var(--forest);
  --primary-hover: var(--forest-light);
  --accent: var(--orange);
  --accent-hover: var(--orange-dark);
  --success: #4A7A2E;
  --success-light: #E8F0DE;
  --warning: #C4881A;
  --warning-light: #FBF0D8;
  --danger: #C04A3A;
  --danger-light: #F8E0DC;
  --info: #3A6B8A;
  --info-light: #DDEBF3;

  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(23, 60, 58, 0.06);
  --shadow-md: 0 4px 16px rgba(23, 60, 58, 0.08);
  --shadow-lg: 0 12px 40px rgba(23, 60, 58, 0.12);

  /* Transitions */
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --nav-h: 60px;
  --sidebar-w: 240px;
  --content-max: 720px;
  --content-wide: 960px;
}

/* Dark Mode */
[data-theme="dark"] {
  --forest: #4A8E89;
  --forest-light: #5DA39E;
  --forest-dark: #3A6B68;
  --cream: #141A19;
  --cream-warm: #1A2120;
  --cream-dim: #1E2625;
  --bg: #141A19;
  --surface: #1A2120;
  --surface-2: #222B29;
  --surface-offset: #1E2625;
  --text: #D4DDD9;
  --text-muted: #8A9D9A;
  --text-faint: #5C6E6B;
  --border: #2E3A38;
  --divider: #252E2C;
  --primary: #4A8E89;
  --primary-hover: #5DA39E;
  --accent: #F59163;
  --accent-hover: #ED713D;
  --orange-pale: #2E2218;
  --success: #7AB84E;
  --success-light: #1E2D18;
  --warning: #E0B04A;
  --warning-light: #2E2818;
  --danger: #E06A5A;
  --danger-light: #2E1815;
  --info: #5A9BC4;
  --info-light: #1A2830;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
}

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background-color: var(--bg);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.2; font-family: var(--font-display); }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
table { border-collapse: collapse; width: 100%; }

a, button, [role='button'], input, textarea, select {
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* --- Typography --- */
.font-display { font-family: var(--font-display); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* --- Layout --- */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.main-content { flex: 1; padding: var(--space-4); padding-bottom: calc(var(--nav-h) + var(--space-6)); max-width: var(--content-wide); margin: 0 auto; width: 100%; }
.main-content--narrow { max-width: var(--content-max); }
.main-content--wide { max-width: var(--content-wide); }

.page-header { margin-bottom: var(--space-6); }
.page-header h1 { font-size: var(--text-xl); margin-bottom: var(--space-1); }
.page-header p { color: var(--text-muted); font-size: var(--text-sm); }

/* --- Bottom Nav (mobile) --- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h);
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  color: var(--text-faint); font-size: var(--text-xs); font-weight: 500;
  min-height: 44px; justify-content: center; flex: 1;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a:active { transform: scale(0.95); }

/* --- Side Nav (desktop) --- */
.side-nav {
  display: none; flex-direction: column; gap: var(--space-1);
  padding: var(--space-6) var(--space-4); position: fixed;
  left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  z-index: 50; overflow-y: auto;
}
.side-nav .brand-lockup { margin-bottom: var(--space-6); }
.side-nav a.nav-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  color: var(--text-muted); font-weight: 500; font-size: var(--text-sm);
}
.side-nav a.nav-link.active { background: var(--primary); color: var(--cream-warm); }
.side-nav a.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.side-nav .nav-footer { margin-top: auto; padding-top: var(--space-6); }

@media (min-width: 900px) {
  .side-nav { display: flex; }
  .bottom-nav { display: none; }
  .main-content { margin-left: var(--sidebar-w); padding-top: var(--space-8); }
}

/* --- Brand Lockup --- */
.brand-lockup { display: flex; align-items: center; gap: var(--space-3); }
.brand-lockup .logo-icon { width: 32px; height: 32px; flex-shrink: 0; }
.brand-lockup .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-lockup .brand-name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--primary); }
.brand-lockup .brand-sub { font-size: var(--text-xs); color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
  min-height: 44px; border: 1.5px solid transparent; text-align: center;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--cream-warm); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--primary); background: var(--surface-offset); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: var(--space-2) var(--space-3); min-height: 36px; font-size: var(--text-xs); }
.btn-lg { padding: var(--space-4) var(--space-8); min-height: 52px; font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.card-elevated { box-shadow: var(--shadow-md); }

/* --- Forms --- */
.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: var(--space-3) var(--space-4); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--text-base);
  min-height: 44px; color: var(--text);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--orange-pale); }
.form-input::placeholder { color: var(--text-faint); }
.form-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.form-error { font-size: var(--text-xs); color: var(--danger); margin-top: var(--space-1); }
.form-row { display: flex; gap: var(--space-3); }
.form-row > * { flex: 1; }

select.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235C7572' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem;
}

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 600;
}
.badge-overdue { background: var(--danger-light); color: var(--danger); }
.badge-today { background: var(--warning-light); color: var(--warning); }
.badge-soon { background: var(--info-light); color: var(--info); }
.badge-done { background: var(--success-light); color: var(--success); }
.badge-neutral { background: var(--surface-offset); color: var(--text-muted); }
.badge-accent { background: var(--orange-pale); color: var(--accent-hover); }

/* --- Assignment Cards --- */
.assignment-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-4); display: flex; gap: var(--space-3); align-items: flex-start;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.assignment-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.assignment-card .checkbox {
  width: 24px; height: 24px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  flex-shrink: 0; margin-top: 2px; cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.assignment-card .checkbox.checked { background: var(--success); border-color: var(--success); }
.assignment-card .checkbox.checked svg { display: block; }
.assignment-card .checkbox svg { display: none; width: 16px; height: 16px; color: #fff; }
.assignment-card .assignment-info { flex: 1; min-width: 0; }
.assignment-card .assignment-title { font-weight: 600; font-size: var(--text-base); }
.assignment-card .assignment-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.assignment-card .meta-item { font-size: var(--text-xs); color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.assignment-card .progress-bar { height: 4px; background: var(--surface-offset); border-radius: var(--radius-full); margin-top: var(--space-2); overflow: hidden; }
.assignment-card .progress-fill { height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width var(--transition); }

/* --- Empty States --- */
.empty-state {
  text-align: center; padding: var(--space-12) var(--space-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
}
.empty-state .empty-icon { width: 64px; height: 64px; opacity: 0.5; }
.empty-state h3 { font-size: var(--text-lg); color: var(--text-muted); }
.empty-state p { color: var(--text-faint); font-size: var(--text-sm); }

/* --- Mission Card --- */
.mission-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-offset) 100%);
  border: 2px solid var(--accent); border-radius: var(--radius-xl);
  padding: var(--space-6); margin-bottom: var(--space-4);
}
.mission-card .mission-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: var(--space-2); }
.mission-card .mission-title { font-family: var(--font-display); font-size: var(--text-lg); margin-bottom: var(--space-2); }
.mission-card .mission-reason { font-size: var(--text-sm); color: var(--text-muted); }
.mission-card .mission-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }

/* --- Timer --- */
.timer-display {
  font-family: var(--font-display); font-size: clamp(3rem, 15vw, 5rem);
  font-weight: 700; text-align: center; line-height: 1; color: var(--primary);
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.timer-ring { width: 240px; height: 240px; margin: 0 auto; position: relative; display: flex; align-items: center; justify-content: center; }
.timer-ring svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring .ring-bg { fill: none; stroke: var(--surface-offset); stroke-width: 8; }
.timer-ring .ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 200ms linear; }
.timer-controls { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-6); }
.timer-scratchpad { width: 100%; min-height: 120px; padding: var(--space-4); border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); resize: vertical; font-size: var(--text-sm); }

/* --- Study Room --- */
.room-container {
  background: linear-gradient(180deg, var(--cream-dim) 0%, var(--cream) 100%);
  border-radius: var(--radius-xl); overflow: hidden; position: relative;
  aspect-ratio: 16/10; min-height: 280px; max-height: 420px;
  border: 1px solid var(--border);
}
.room-scene { width: 100%; height: 100%; position: relative; }
.room-scene svg { width: 100%; height: 100%; display: block; }
.room-info { margin-top: var(--space-4); }
.room-decorations { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.decoration-chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 500;
  background: var(--surface-offset); color: var(--text-muted);
}
.decoration-chip.earned { background: var(--success-light); color: var(--success); }

/* --- Progress --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); text-align: center; }
.stat-card .stat-value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }

.history-list { display: flex; flex-direction: column; gap: var(--space-2); }
.history-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.history-item .h-icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--success-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.history-item .h-info { flex: 1; min-width: 0; }
.history-item .h-title { font-weight: 600; font-size: var(--text-sm); }
.history-item .h-meta { font-size: var(--text-xs); color: var(--text-muted); }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: var(--space-4);
  animation: fadeIn 150ms ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius-xl); max-width: 500px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header { padding: var(--space-5) var(--space-5) var(--space-3); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: var(--text-lg); }
.modal-body { padding: 0 var(--space-5) var(--space-5); }
.modal-footer { padding: var(--space-3) var(--space-5) var(--space-5); display: flex; gap: var(--space-3); justify-content: flex-end; }

/* --- Toast --- */
.toast-container { position: fixed; bottom: calc(var(--nav-h) + var(--space-4)); left: 50%; transform: translateX(-50%); z-index: 300; pointer-events: none; }
.toast {
  background: var(--forest); color: var(--cream-warm); padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--shadow-lg); white-space: nowrap; animation: toastIn 200ms ease;
  pointer-events: auto;
}
.toast.success { background: var(--success); color: #fff; }
.toast.warning { background: var(--warning); color: #fff; }

/* --- Landing Page --- */
.landing { min-height: 100dvh; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-6); max-width: var(--content-wide); margin: 0 auto; }
.landing-nav .brand-lockup .brand-name { font-size: var(--text-base); }
.landing-nav .nav-links { display: flex; gap: var(--space-4); align-items: center; }
.landing-nav .nav-links a { font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); }
.landing-nav .nav-links a:hover { color: var(--primary); }
@media (max-width: 600px) { .landing-nav .nav-links .nav-link-text { display: none; } }

.landing-hero { padding: var(--space-12) var(--space-6) var(--space-16); text-align: center; max-width: var(--content-max); margin: 0 auto; }
.landing-hero h1 { font-size: var(--text-2xl); margin-bottom: var(--space-4); }
.landing-hero .hero-tagline { font-size: var(--text-lg); color: var(--text-muted); margin-bottom: var(--space-8); }
.landing-hero .hero-cta { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

.landing-section { padding: var(--space-12) var(--space-6); max-width: var(--content-wide); margin: 0 auto; }
.landing-section h2 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.landing-section .section-sub { color: var(--text-muted); margin-bottom: var(--space-8); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); }
.feature-card .f-icon { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--orange-pale); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-4); color: var(--accent); }
.feature-card h3 { font-size: var(--text-base); margin-bottom: var(--space-2); }
.feature-card p { font-size: var(--text-sm); color: var(--text-muted); }

.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--divider); font-size: var(--text-sm); }
.compare-table th { font-weight: 700; color: var(--primary); }
.compare-table .check { color: var(--success); }
.compare-table .x { color: var(--text-faint); }

.faq-item { border-bottom: 1px solid var(--divider); padding: var(--space-4) 0; }
.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; font-size: var(--text-base); display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; font-size: var(--text-lg); color: var(--text-muted); }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item .faq-answer { margin-top: var(--space-3); color: var(--text-muted); font-size: var(--text-sm); }

.landing-footer { padding: var(--space-8) var(--space-6); text-align: center; border-top: 1px solid var(--border); }
.landing-footer .footer-links { display: flex; gap: var(--space-4); justify-content: center; margin-bottom: var(--space-3); flex-wrap: wrap; }
.landing-footer .footer-links a { font-size: var(--text-sm); color: var(--text-muted); }
.landing-footer .footer-links a:hover { color: var(--primary); }
.landing-footer p { font-size: var(--text-xs); color: var(--text-faint); }

/* --- Demo Banner --- */
.demo-banner {
  background: var(--orange-pale); border-bottom: 1px solid var(--accent);
  padding: var(--space-2) var(--space-4); text-align: center;
  font-size: var(--text-xs); color: var(--accent-hover); font-weight: 600;
}
.demo-banner a { text-decoration: underline; font-weight: 700; }

/* --- Utility --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.hidden { display: none !important; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius-md); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes bounce-in { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }

.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce-in { animation: bounce-in 400ms cubic-bezier(0.16, 1, 0.3, 1); }

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

/* --- Responsive --- */
@media (max-width: 400px) {
  .main-content { padding: var(--space-3); }
  .landing-hero { padding: var(--space-8) var(--space-4) var(--space-12); }
  .landing-section { padding: var(--space-8) var(--space-4); }
  .timer-ring { width: 200px; height: 200px; }
}

@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface-offset); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* --- Tutorial Overlay --- */
.tutorial-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(23, 60, 58, 0.85);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: var(--space-4); box-sizing: border-box;
}
.tutorial-card {
  background: var(--surface); border-radius: var(--radius-xl);
  max-width: 420px; width: 100%; padding: var(--space-8);
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.tutorial-step { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.tutorial-step h2 { font-size: var(--text-xl); font-family: var(--font-display); }
.tutorial-step p { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.6; }
.tutorial-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: var(--surface-offset); display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: var(--space-2);
}
.tutorial-icon svg { width: 28px; height: 28px; }
.tutorial-dots { display: flex; gap: var(--space-2); margin: var(--space-2) 0; }
.tutorial-dots .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
  transition: background 200ms;
}
.tutorial-dots .dot.active { background: var(--accent); }
.tutorial-step .btn { margin-top: var(--space-2); }

/* --- Mobile improvements --- */
@media (max-width: 480px) {
  .tutorial-card { padding: var(--space-6); }
  .tutorial-step h2 { font-size: var(--text-lg); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }
  .form-row .form-group { width: 100%; }
  .compare-table { font-size: 12px; }
  .compare-table th, .compare-table td { padding: var(--space-1) var(--space-2); }
  .modal { margin: 0; width: 100%; height: 100%; border-radius: 0; max-height: 100vh; }
  .modal-body { max-height: calc(100vh - 60px); }
  .hero-title { font-size: var(--text-xl); }
  .hero-subtitle { font-size: var(--text-sm); }
  .landing-nav { gap: var(--space-2); }
  .landing-nav .btn { font-size: var(--text-sm); }
}

/* --- Color warning helper --- */
:root {
  --color-warning: #B45309;
}
[data-theme="dark"] {
  --color-warning: #FBBF24;
}

/* Keep recovery/status messages readable on narrow phones. */
.toast-container { width: max-content; max-width: calc(100vw - 24px); }
.toast { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* The small-start loop: a single visual language for learning and action. */
.perch-eyebrow {font-size:.8rem;font-weight:800;letter-spacing:.11em;color:var(--accent);margin-bottom:1rem;}
.perch-feature {border:1px solid var(--color-primary);border-left:5px solid var(--accent);border-radius:var(--radius-lg);padding:clamp(1.2rem,4vw,2rem);background:var(--bg-card, var(--bg));}
.perch-feature h2 {font-size:clamp(1.6rem,4vw,2.2rem);margin-bottom:.8rem;}
.perch-feature p {margin-bottom:1rem;}
.perch-feature a,.perch-guide-grid a {color:var(--text);font-weight:700;text-decoration:underline;text-underline-offset:4px;}
.perch-loop {display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0;counter-reset:loop;}
.perch-loop span {padding:.55rem .8rem;border:1px solid var(--border);border-radius:999px;font-size:.875rem;counter-increment:loop;}
.perch-loop span::before {content:counter(loop) ' · ';font-weight:800;color:var(--accent);}
.perch-guide-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;}
.perch-guide-grid h2 {font-size:1.35rem;margin:.5rem 0;}
.perch-guide-grid p,.perch-guide-grid li {line-height:1.7;margin-bottom:.75rem;}
.perch-guide-grid ol {padding-left:1.2rem;}
.perch-number {font-size:1.5rem;font-weight:800;color:var(--accent);}
.perch-example,.perch-note {border-left:3px solid var(--accent);padding:.9rem 1rem;background:var(--bg-secondary);border-radius:0 10px 10px 0;overflow-wrap:anywhere;}
.perch-note p {margin-top:.5rem;}
.perch-actions {display:flex;flex-wrap:wrap;gap:.75rem;margin-top:1rem;}
.perch-practice {max-height:90dvh;overflow:auto;text-align:left;}
.perch-practice h2 {font-size:clamp(1.7rem,5vw,2.4rem);margin:1rem 0;line-height:1.2;}
.perch-practice p {line-height:1.7;margin-bottom:1rem;}
.perch-practice-top {display:flex;align-items:center;justify-content:space-between;gap:1rem;font-size:.875rem;}
.perch-practice progress {width:100%;height:7px;accent-color:var(--accent);margin-top:1rem;}
.perch-choices {display:grid;gap:.8rem;margin:1.3rem 0;}
.perch-choices .btn {white-space:normal;text-align:left;}
.perch-practice-clock {font-size:3.5rem;font-weight:800;text-align:center;padding:1rem;border:2px solid var(--accent);border-radius:1rem;margin:1rem 0;}
.perch-practice-clock span {display:block;font-size:1rem;font-weight:500;}
.perch-win {font-size:3rem;color:var(--accent);}
.main-content details {padding:.75rem 0;}
.main-content details summary {cursor:pointer;font-weight:700;}
.main-content details p {margin:.7rem 0;line-height:1.7;}
.btn:disabled {opacity:.65;cursor:default;}
@media(max-width:640px){.perch-guide-grid{grid-template-columns:1fr}.perch-practice{padding:1.2rem}.perch-loop span{flex:1;text-align:center}.perch-actions .btn{width:100%}.landing-nav .nav-links{flex-wrap:wrap;justify-content:flex-end}}

/* Assignment work shelf and purchase route */
.work-shelf h3 {font-size:1rem;margin-bottom:.6rem;}
.work-link {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1rem;margin:.5rem 0;border:1px solid var(--border);border-radius:12px;background:var(--surface);text-decoration:none;color:var(--text);font-size:1rem;overflow-wrap:anywhere;}
.work-link:hover {border-color:var(--accent);background:var(--surface-offset);}
.work-link span:first-child {min-width:0;}
.work-link small {display:block;font-size:.875rem;color:var(--text-muted);margin-top:.25rem;}
.work-shelf-compact {margin-top:1rem;}
.work-shelf-compact .work-link {padding:.5rem .75rem;}
.work-link-preview:empty {display:none;}
.checkout-frame {width:100%;height:760px;border:1px solid var(--border);border-radius:12px;background:white;margin-top:1rem;}
.sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

.companion-card {text-align:center;background:linear-gradient(160deg,var(--surface),var(--surface-offset));}
.pet-header {display:flex;align-items:center;justify-content:space-between;gap:1rem;text-align:left;}
.seed-balance {padding:.6rem 1rem;background:var(--primary);color:var(--cream);border-radius:18px;min-width:80px;text-align:center;}
.seed-balance strong,.seed-balance span {display:block;}.seed-balance strong{font-size:1.8rem;}
.perch-pet-portrait {position:relative;width:280px;max-width:100%;margin:0 auto;}
.perch-pet-portrait img {width:100%;height:auto;object-fit:contain;animation:perch-breathe 4s ease-in-out infinite;}
.pet-mint img {filter:hue-rotate(95deg);}.pet-berry img {filter:hue-rotate(290deg);}
.pet-accessory {position:absolute;font-size:3rem;top:18%;right:27%;transform:rotate(12deg);}
.pet-stage {font-weight:700;margin:.2rem 0;}.pet-progress{width:100%;height:9px;accent-color:var(--accent);margin:1rem 0;}
.pet-customize {text-align:left;margin-top:1.5rem;}.pet-customize summary{cursor:pointer;font-weight:700;}
.pet-shop {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;}
.pet-shop-item {padding:1rem;background:var(--surface);border:1px solid var(--border);border-radius:12px;color:var(--text);cursor:pointer;}
.pet-shop-item span,.pet-shop-item strong,.pet-shop-item small{display:block;}.pet-shop-item span{font-size:1.8rem;}.pet-shop-item small{font-size:.875rem;margin-top:.4rem;}
.pet-shop-item[aria-pressed=true] {border:2px solid var(--accent);}.pet-shop-item:disabled{opacity:.65;cursor:default;}
.pet-customize .form-input{flex:1;min-width:140px;}.companion-card .perch-actions{justify-content:center;}
@keyframes perch-breathe {50%{transform:translateY(-5px) rotate(1deg)}}
@media(prefers-reduced-motion:reduce){.perch-pet-portrait img{animation:none;}}
.reduced-motion .perch-pet-portrait img{animation:none;}

.perch-pet-portrait[data-stage="New companion"]{width:225px;}.perch-pet-portrait[data-stage="Curious fledgling"]{width:260px;}.perch-pet-portrait[data-stage="Confident flyer"]{width:300px;}

.landing-companion{display:flex;gap:2rem;align-items:center;text-align:left;}.landing-companion img{object-fit:contain;width:260px;height:auto;}.landing-companion h2{text-align:left;}.landing-companion p{margin-bottom:1rem;}@media(max-width:650px){.landing-companion{flex-direction:column;}.landing-companion img{width:190px;}}

@font-face{font-family:Syne;src:url('../assets/fonts/Syne.ttf') format('truetype');font-weight:400 800;font-display:swap}.brand-sub{font-family:var(--font-body);font-size:1.1rem;font-weight:800;letter-spacing:-.025em;text-transform:none}.capture-box{padding:1rem;margin-bottom:1.5rem;background:var(--surface-offset);border:1px solid var(--border);border-radius:16px}.file-drop{display:block;padding:.8rem;border:1px dashed var(--accent);border-radius:10px;margin:.8rem 0;font-weight:700}.file-drop input{display:block;width:100%;margin-top:.5rem;font-size:.875rem}.coach-answer{white-space:pre-wrap;line-height:1.8;margin-top:1rem;font-size:1rem}.capture-box .form-hint{margin:.7rem 0}.work-link{width:100%;text-align:left}

.companion-room{position:relative;margin:1rem 0;overflow:hidden;border-radius:22px}.companion-room .room-scene{width:100%;}.room-resident{position:absolute;width:23%;left:63%;bottom:7%;pointer-events:none}.room-resident .perch-pet-portrait{width:100%!important}.room-resident .pet-accessory{font-size:clamp(1.1rem,3vw,2rem);top:15%;right:24%}.room-swatch{height:56px;border-radius:8px;margin-bottom:.6rem}.pet-ocean img{filter:hue-rotate(170deg)}.pet-sunshine img{filter:hue-rotate(25deg) saturate(1.15)}.companion-card{padding:1.3rem}.pet-header h2{font-size:1.4rem}.companion-card .perch-actions .btn{flex:1}.room-customize{border-top:1px solid var(--border);padding-top:1rem!important}
.companion-room{width:100%;min-width:0;min-height:0;max-height:none;aspect-ratio:8/5}.companion-room .room-scene{position:absolute;inset:0}.companion-card{min-width:0;max-width:100%}.pet-header>div:first-child{min-width:0}.room-resident{left:68%;bottom:8%}

/* Normal-width typography; local font works offline and never scales horizontally. */
@font-face{font-family:'Plus Jakarta Sans';src:url('../assets/fonts/PlusJakartaSans.ttf') format('truetype');font-weight:200 800;font-display:swap}
html{font-synthesis:none}button,input,textarea,select{font-family:inherit}h1,h2,h3{letter-spacing:-.025em;line-height:1.18}h1{font-size:clamp(1.8rem,4vw,2.8rem)}.brand-sub{font-weight:750;letter-spacing:-.035em}.timer-display{font-variant-numeric:tabular-nums;letter-spacing:-.03em} .legacy-restore{margin-top:1.2rem}.legacy-restore summary{cursor:pointer;font-size:.875rem;margin-bottom:1rem}
.has-coach-dock .main-content{padding-bottom:11rem}#coach-dock{position:fixed;right:24px;bottom:24px;z-index:90;max-width:calc(100vw - 32px)}#coach-dock[hidden],.coach-panel[hidden]{display:none}.coach-launch{display:flex;align-items:center;gap:14px;border:1px solid #b7cdd8;border-radius:99px;padding:12px 20px;background:linear-gradient(115deg,#e6f3f5,#ede9ff 60%,#fce6ec);box-shadow:0 5px 24px #18383a18;color:#173c3a;font:600 14px var(--font-body);cursor:pointer}.coach-mark{color:#5750ad;font-size:22px}.coach-panel{position:absolute;bottom:65px;right:0;width:390px;max-width:calc(100vw - 32px);height:min(690px,calc(100dvh - 130px));background:var(--surface);border:1px solid var(--border);border-radius:22px;box-shadow:0 15px 70px #142d3930;display:flex;flex-direction:column;overflow:hidden}.coach-panel header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--border);background:var(--surface-offset)}.coach-panel header p{font-size:13px;margin:3px 0 0}.coach-scroll{flex:1;min-height:0;overflow:auto;padding:18px}.coach-welcome h2{font-size:1.3rem}.coach-welcome p{font-size:14px}.coach-setup{font-size:14px;padding:12px;background:var(--surface-offset);border-radius:12px;margin:16px 0}.coach-setup summary{cursor:pointer;font-weight:600}.coach-setup p{margin:12px 0;line-height:1.5}.coach-message{padding:12px 14px;border-radius:14px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.6}.coach-message--user{background:var(--surface-offset);margin-left:22px}.coach-message--assistant{border:1px solid var(--border);margin-right:12px}.coach-compose{padding:12px 16px;border-top:1px solid var(--border)}.coach-compose textarea{margin-top:10px;resize:vertical;max-height:120px}.coach-compose .form-label{font-size:14px}.coach-send{display:flex;align-items:center;gap:6px;margin-top:8px}.coach-send span{font-size:12px;margin-right:auto}.coach-send button{padding:8px 12px}.coach-compose #coach-status{font-size:12px;max-height:55px;overflow:auto;margin:8px 0 0}.coach-compose select{padding:8px;font-size:14px}.checkout-frame{width:100%;height:760px;border:0;border-radius:16px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
@media(max-width:767px){#coach-dock{right:16px;bottom:calc(76px + env(safe-area-inset-bottom))}.coach-panel{height:min(640px,calc(100dvh - 175px));bottom:62px}.coach-launch{padding:10px 16px}.coach-panel header{padding:12px 16px}.coach-scroll{padding:14px}}
.brand-lockup .brand-name{font-family:var(--font-body);font-size:12px;letter-spacing:.08em;font-weight:600}.brand-lockup .brand-sub{font-size:20px;letter-spacing:-.035em;font-weight:800;text-transform:none;color:var(--primary)}
.coach-scroll:has(.coach-message) .coach-welcome{display:none}

/* Nest palette: beige foundations, saturated teal, apricot and violet accents. */
:root{--cream:#f2e6d5;--cream-warm:#fffaf1;--cream-dim:#ecddc8;--forest:#18484c;--forest-light:#286269;--orange:#bb4f27;--orange-dark:#9a3d1b;--orange-pale:#ffe0c7;--border:#d9c7af;--divider:#e7d7c2;--text-muted:#596762;--text-faint:#697772;--shadow-md:0 8px 28px #4d34200b}
body{background-image:radial-gradient(ellipse at 100% 0,#dbcdee66,transparent 40%),radial-gradient(ellipse at 0 80%,#abd4ca55,transparent 45%);background-attachment:fixed}.side-nav{background:var(--surface);border-right:1px solid var(--border)}.brand-lockup{gap:10px;text-decoration:none}.brand-lockup img{width:56px;height:56px;object-fit:contain;border-radius:18px}.brand-lockup>span{display:flex;flex-direction:column}.brand-lockup .brand-name{order:2;text-transform:none;letter-spacing:0;font-size:12px}.brand-lockup .brand-sub{order:1;color:var(--primary);font-size:21px}.main-content{padding-top:32px}.card,.assignment-card{box-shadow:0 5px 20px #3a29120a;border-radius:20px}.perch-feature{background:radial-gradient(circle at 100% 0,#d5c6e7 0,transparent 45%),linear-gradient(125deg,#ffefd8,#f1e4d2);border:1px solid #d9c7af;border-radius:24px}.btn-accent{color:#fff}.mission-card{border-radius:22px;border-left:5px solid var(--accent);box-shadow:0 7px 26px #194b4210}.school-hero{padding:26px;border-radius:24px;background:linear-gradient(115deg,#d2e7df,#eee1c9 70%,#f5d2b9);margin-bottom:22px}.school-hero h1{margin:12px 0}.school-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.school-card{padding:22px;border:1px solid var(--border);border-radius:22px;background:var(--surface)}.school-card:nth-child(3n+2){background:#ece5f4}.school-card:nth-child(3n){background:#e6eddf}.school-card h2{font-size:1.25rem;margin:12px 0 20px}.school-provider{font-size:13px;font-weight:700;color:var(--text-muted)}.school-shortcut{display:flex;flex-direction:column;gap:8px;padding:20px;text-decoration:none;background:linear-gradient(120deg,#e2ebdc,#f4dfcf);color:var(--text)}.school-shortcut span{font-size:14px}#coach-dock{display:flex;align-items:center;gap:6px;padding:5px;border:1px solid var(--border);border-radius:99px;background:var(--surface);box-shadow:0 6px 25px #173c3a20}.coach-launch{box-shadow:none;border:0;font-size:14px;gap:8px}.hotbar-premium{padding:12px 15px;border-radius:99px;color:#674500;background:#f4dfaa;font-size:14px;font-weight:700;text-decoration:none;white-space:nowrap}.coach-panel{bottom:76px}.companion-card{background:linear-gradient(135deg,var(--surface),#e8e4d4);border-radius:24px}.premium-points{display:grid;gap:14px;padding:0;list-style:none}.premium-points li{padding:15px;border:1px solid var(--border);border-radius:14px;background:var(--surface)}.premium-points strong{display:block;margin-bottom:4px}.premium-points span{font-size:14px}.brand-nest-intro{width:100px;height:100px;border-radius:28px;object-fit:contain;float:right;margin:0 0 15px 15px}
[data-theme=dark]{--cream:#172626;--cream-warm:#213231;--cream-dim:#293d3a;--forest:#bbdcd5;--forest-light:#d2eee7;--text-muted:#b0c4bd;--text-faint:#99afa6;--border:#47605a;--divider:#3a514c;--orange:#b64f2a;--orange-dark:#98401e}[data-theme=dark] .perch-feature,[data-theme=dark] .school-hero,[data-theme=dark] .school-shortcut,[data-theme=dark] .companion-card,[data-theme=dark] .school-card{background:linear-gradient(120deg,#293e3c,#363842);color:var(--text)}[data-theme=dark] .hotbar-premium{color:#f8e3ad;background:#594720}
@media(max-width:767px){#coach-dock{left:50%;right:auto;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 24px)}.coach-launch{padding:10px 14px}.hotbar-premium{padding:11px 14px}.coach-panel{right:0;max-width:calc(100vw - 24px);width:370px;bottom:72px}.school-hero{padding:22px}.main-content{padding-top:24px}}

.welcome-shell{max-width:1100px;min-height:100dvh;display:grid;grid-template-columns:1fr 1fr;gap:60px;margin:auto;align-items:center;padding:48px 30px}.welcome-art img{width:100%;border-radius:48px;box-shadow:0 24px 90px #a6815320}.welcome-art p{font-size:2rem;margin-top:24px;line-height:1.3}.welcome-form h1{font-size:clamp(2.5rem,5vw,4rem);margin:18px 0}.welcome-form h2{font-size:1.1rem;margin-top:30px}.welcome-form p{margin:20px 0}.welcome-form .btn{width:100%;margin:16px 0}.test-payment-label{padding:10px 12px;border-radius:10px;background:#fff0b8;color:#654500;font-size:14px;font-weight:700}#payment-element{margin-top:20px}@media(max-width:700px){.welcome-shell{display:block;padding:24px}.welcome-art img{width:110px;border-radius:28px}.welcome-art p{display:none}.welcome-form h1{font-size:2.5rem}.welcome-form .perch-eyebrow{margin-top:20px}}

body:has(#tutorial-overlay) #coach-dock,body:has(#welcome-title) #coach-dock{display:none}[data-theme=dark] .brand-lockup .brand-sub{color:#c6e5dd}

/* Individual spaces, one coherent FocusPerch identity. */
body[data-page="school"] .school-hero:after {content:"";position:absolute;width:220px;height:220px;border:28px solid #d5ba7430;border-radius:50%;right:-85px;top:-70px;pointer-events:none;}
.settings-group {padding:26px;background:var(--surface);border:1px solid var(--color-border);border-radius:18px;margin-bottom:20px;}
.settings-group h2 {font-size:1.15rem;margin-bottom:16px;}
.setting-row {display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 0;border-top:1px solid var(--color-border);color:var(--text);text-decoration:none;}
.setting-row>span:first-child {flex:1;min-width:0;}.setting-row small {display:block;color:var(--text-muted);font-size:.84rem;margin-top:5px;line-height:1.6;}.setting-row select {width:auto;max-width:46%;}.setting-row input[type=checkbox] {width:21px;height:21px;accent-color:#28635d;}
.settings-shortcuts {display:flex;gap:10px;flex-wrap:wrap;margin-bottom:24px;}.settings-shortcuts a {padding:9px 14px;border-radius:30px;background:var(--surface);border:1px solid var(--color-border);color:var(--text);}
.profile-hero {display:flex;align-items:center;gap:24px;padding:24px 0 36px;}.profile-hero img {border-radius:24px;}.profile-hero h1 {font-size:clamp(1.8rem,4vw,2.8rem);overflow-wrap:anywhere;}
.assignment-tools {display:flex;gap:8px;flex-wrap:wrap;margin:12px 0;}.tiny-steps {font-size:.88rem;margin:12px 0;}.tiny-steps li {margin:10px 0;line-height:1.6;}.tiny-steps ol {padding-left:24px;}
.calendar-page {max-width:1250px;}.week-controls {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px;}.cal-week {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin-bottom:24px;}.cal-day {border:1px solid var(--color-border);background:var(--surface);color:var(--text);padding:16px 7px;border-radius:16px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:5px;}.cal-day strong {font-size:1.5rem;}.cal-day small {font-size:.7rem;}.cal-day.selected {background:#244e4b;color:#fff6e6;border-color:#244e4b;box-shadow:0 5px 0 #b0c1b6;}.calendar-grid {display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:20px;align-items:start;}.calendar-block {border-left:3px solid #bf8c6e;padding:15px 18px;margin-top:18px;background:var(--surface-offset);border-radius:0 14px 14px 0;}.calendar-block h3 {font-size:1rem;}.calendar-block p {margin:6px 0;}.cal-form {display:grid;gap:16px;margin-top:16px;}.cal-form label {display:block;font-size:.85rem;font-weight:600;}.cal-form input,.cal-form select {margin-top:6px;width:100%;}.cal-form .form-row {display:grid;grid-template-columns:1fr 1fr;gap:12px;}.cal-empty {padding:30px 0;color:var(--text-muted);}.deadline-chip {padding:9px 12px;border-radius:10px;background:#b7582918;font-size:.9rem;}.schedule-preview {padding:20px;margin-top:20px;background:var(--surface-offset);border-radius:16px;}.schedule-preview>p {padding:12px 0;border-bottom:1px solid var(--color-border);font-size:.86rem;}.school-hero .perch-eyebrow {color:#f0c894;}
[data-theme="dark"] body[data-page="school"] .school-card {background:var(--surface);}[data-theme="dark"] .cal-day.selected {background:#679690;color:#102e2d;}
@media(max-width:700px){.calendar-grid{grid-template-columns:1fr;}.cal-week{gap:4px;}.cal-day{padding:12px 3px;border-radius:10px;}.cal-day small{font-size:.58rem;}.cal-day strong{font-size:1.1rem;}.cal-day span{font-size:.75rem;}.week-controls strong{font-size:.8rem;}.week-controls .btn{padding:8px;font-size:.75rem;}.profile-hero{gap:14px;}.profile-hero img{width:70px;height:70px;}.setting-row{gap:10px;}.settings-group{padding:20px;}.setting-row small{font-size:.75rem;}}
@media(min-width:900px){.main-content{width:calc(100% - var(--sidebar-w));min-width:0;}.calendar-page{max-width:1250px;}}
/* The original warm light and lilac/teal glow, shared across app pages. */
body[data-page]{background-color:var(--bg);background-image:radial-gradient(ellipse at 100% 0,#dbcdee66,transparent 40%),radial-gradient(ellipse at 0 80%,#abd4ca55,transparent 45%);background-attachment:fixed;}
.pet-page{max-width:1380px}.pet-page-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.pet-page-header h1{font-size:clamp(1.8rem,3.6vw,2.8rem);margin:.3rem 0}.pet-wallet{display:flex;gap:8px;align-items:center;padding:12px 18px;background:var(--surface);border:1px solid var(--border);border-radius:99px;white-space:nowrap;font-size:14px}.pet-play-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(230px,1fr);gap:22px;align-items:start}.pet-playground{border:1px solid var(--border);border-radius:28px;background:radial-gradient(ellipse at 50% 20%,#fff8ebc9,transparent 70%);padding:16px}.pet-canvas{width:100%;height:390px;cursor:pointer;outline-offset:3px;position:relative;overflow:hidden;border-radius:24px;touch-action:pan-y}.pet-canvas canvas{display:block;width:100%;height:100%}.pet-canvas>img{height:80%;width:auto;margin:auto;object-fit:contain}.pet-hint{text-align:center;font-size:14px;color:var(--text-muted);margin:0 0 18px}.care-toolbar{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.pet-reaction-message{min-height:44px;text-align:center;margin:18px 0 0;font-size:14px}.pet-details h2{font-size:1.3rem}.pet-details p{margin:12px 0}.pet-details label{display:block;margin-top:24px;font-weight:600}.pet-details .form-input{margin-top:8px}.pet-shop-panel{margin-top:30px;border-radius:24px;border:1px solid var(--border);padding:26px;background:var(--surface)}.pet-shop-tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:22px}.cosmetic-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:16px}.cosmetic-card{padding:18px;text-align:center;background:var(--surface-offset);border:1px solid var(--border);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px}.cosmetic-card h3{font-size:1rem;margin:0}.cosmetic-card p{font-size:14px;margin:0}.cosmetic-card button{margin-top:auto}.cosmetic-preview,.decor-preview{width:72px;height:72px;background:radial-gradient(circle,#fff7dc,#e7ded6);border-radius:22px;font-size:36px;display:grid;place-items:center;color:#8b7c90}.style-cozy{background:#dcc9e0}.style-night{background:#343653;color:#e6d897}.feather-swatch{height:72px;width:72px;border-radius:50%;box-shadow:inset -10px -10px 20px #0002,inset 8px 8px 15px #fff6}.seed-pack-art{font-size:42px}.room-stage-wrap .pet-canvas{height:460px}.room-studio{background:radial-gradient(ellipse,#fff8e599,transparent);border-radius:28px;border:1px solid var(--border)}.welcome-gift{display:flex;align-items:center;gap:18px;background:linear-gradient(120deg,#f5e6bd,#e4ead5)}.welcome-gift>span{font-size:32px}.welcome-gift h2{font-size:1.15rem}.welcome-gift p{font-size:14px}.welcome-gift>div{flex:1}.pet-shop-panel .room-swatch{width:90px;height:60px}.seeds-explainer>p{margin:12px 0 20px}
@media(max-width:1000px){.pet-play-layout{grid-template-columns:1fr}.pet-details{display:block}}@media(max-width:600px){.pet-canvas{height:320px}.room-stage-wrap .pet-canvas{height:350px}.pet-page-header{gap:10px}.pet-page-header h1{font-size:1.7rem}.pet-wallet{padding:9px 12px;font-size:13px}.pet-shop-panel{padding:16px}.cosmetic-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.cosmetic-card{padding:13px 10px}.cosmetic-card .btn{white-space:normal}.care-toolbar .btn{font-size:14px;padding:10px 12px}.welcome-gift{flex-wrap:wrap}.pet-shop-tabs .btn{font-size:14px;padding:10px 12px}}
[data-theme="dark"] .pet-playground{background:radial-gradient(ellipse at 50% 20%,#778a6c22,transparent 70%)}[data-theme="dark"] .welcome-gift{background:linear-gradient(120deg,#4c4933,#26423c)}

/* Woodland companion and nest collection. */
.emote-toolbar{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:18px}.emote-toolbar button{font:500 14px var(--font-body);padding:8px 12px;border:1px solid var(--border);border-radius:99px;background:var(--surface);color:var(--text);cursor:pointer}.emote-toolbar button:hover{background:var(--surface-offset);transform:translateY(-1px)}.premium-cosmetic{background:linear-gradient(145deg,#ebe0fb,#f8eccb);color:#30314f}.collection-note{max-width:68ch;margin:0 0 20px;line-height:1.7}.room-studio{background:radial-gradient(ellipse at 65% 15%,#e8daac9c,transparent 50%),radial-gradient(ellipse at 20% 70%,#a4d8c58a,transparent 60%)}.pet-canvas{cursor:default}.pet-canvas[data-hover="bird"]{cursor:pointer}.pet-playground{background:radial-gradient(ellipse at 50% 65%,#dfedd099,transparent 70%)}
