
:root {
  color-scheme: light;
  --bg: #eef7ff;
  --child-bg: #071a46;
  --panel: #ffffff;
  --ink: #102047;
  --muted: #647391;
  --line: #cfe0f5;
  --accent: #0867d8;
  --accent-2: #2fd3ff;
  --accent-3: #ff9d2e;
  --sun: #ffd93d;
  --success: #4ac66f;
  --warn: #b35a13;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.app-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 20px;
}
.child-shell {
  max-width: 960px;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px;
  background:
    radial-gradient(circle at 16% 12%, rgba(47, 211, 255, 0.22), transparent 24%),
    radial-gradient(circle at 84% 8%, rgba(255, 217, 61, 0.2), transparent 20%),
    linear-gradient(180deg, #082a68 0%, #0a6ed8 46%, #eaf7ff 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}
.child-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255,217,61,0.7) 0 1px, transparent 1.8px);
  background-size: 78px 78px, 124px 124px;
  background-position: 12px 18px, 42px 30px;
  opacity: 0.55;
}
.child-shell > * {
  position: relative;
  z-index: 1;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}
.parent-hero {
  align-items: stretch;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 18%, rgba(47, 211, 255, 0.18), transparent 22%),
    linear-gradient(135deg, #ffffff 0%, #f1f8ff 100%);
  box-shadow: 0 18px 40px rgba(25, 57, 102, 0.1);
}
.parent-hero-copy {
  flex: 1 1 360px;
  align-self: center;
}
.parent-hero-copy h1 {
  max-width: 520px;
  font-size: 34px;
}
.parent-hero-note {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}
.parent-hero-image {
  width: min(38vw, 380px);
  min-width: 280px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(8, 103, 216, 0.18);
  box-shadow: 0 12px 30px rgba(16, 32, 71, 0.14);
}
.parent-hero .text-button {
  align-self: center;
  flex: 0 0 auto;
}
.eyebrow { margin: 0 0 4px; color: var(--sun); font-weight: 900; font-size: 13px; text-transform: uppercase; }
h1 { margin: 0; font-size: 40px; line-height: 1.06; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: 0; }
.child-hero {
  min-height: 236px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(90deg, rgba(4, 19, 64, 0.88) 0%, rgba(7, 39, 107, 0.68) 42%, rgba(7, 39, 107, 0.1) 78%),
    url("/assets/web/hero-child-concept-v1.webp") center right / cover no-repeat,
    linear-gradient(135deg, #082a68, #0a6ed8);
  box-shadow: 0 20px 46px rgba(4,18,58,0.2);
}
.child-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 21% 36%, rgba(47,211,255,0.18), transparent 28%),
    linear-gradient(180deg, transparent 62%, rgba(5,34,101,0.18) 100%);
}
.child-hero > * {
  position: relative;
  z-index: 1;
}
.child-hero-content {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  max-width: 560px;
}
.brand-lockup { position: relative; width: 88px; height: 80px; }
.companion-mark {
  width: 82px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid #41d8ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #114fc4, #08317f);
  color: var(--sun);
  font-size: 42px;
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.1), 0 10px 24px rgba(0,0,0,0.24);
}
.brand-spark {
  position: absolute;
  right: -4px;
  top: -6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--sun);
  font-size: 16px;
}
.hero-copy { min-width: 0; }
.hero-note {
  max-width: 560px;
  margin: 8px 0 0;
  color: rgba(255,255,255,0.9);
  font-size: 16px;
  line-height: 1.45;
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.icon-button, .text-button, .composer button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}
.text-button { display: inline-flex; align-items: center; text-decoration: none; }
.pause-button { width: 48px; padding: 0; background: rgba(255,255,255,0.92); }
.learning-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.learning-chip {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.36);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(4,18,58,0.12);
}
.chip-icon {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff7cf;
  color: #0b70dc;
  font-weight: 900;
}
.chip-icon img {
  width: 28px;
  height: 28px;
  display: block;
}
.learning-chip strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}
.learning-chip small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.mode-chip .chip-icon { background: #dff6ff; color: #0b70dc; }
.mission-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255,217,61,0.45);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.9) 42%, rgba(255,255,255,0.22) 82%),
    url("/assets/web/mission-explore.webp") center / cover no-repeat;
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(4,18,58,0.12);
}
.mission-strip.mission-school-help {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.9) 42%, rgba(255,255,255,0.18) 82%),
    url("/assets/web/mission-school.webp") center / cover no-repeat;
}
.mission-copy {
  max-width: 560px;
  padding: 6px 0;
}
.mission-strip strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}
.mission-kicker {
  display: block;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}
.mission-pill {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7cf;
  border: 1px solid #f1c94a;
  color: #704500;
  text-align: center;
  font-weight: 800;
}
.dashboard-card, .list-panel, .chat-panel, .composer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
.chat-panel {
  padding: 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 380px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, var(--sun), var(--accent-2), #7c9cff) border-box;
  border: 2px solid transparent;
  box-shadow: 0 18px 40px rgba(4,18,58,0.12);
}
.message { max-width: 86%; padding: 12px 14px; border-radius: 8px; line-height: 1.45; }
.message p { margin: 0; }
.assistant { background: #eaf7ff; align-self: flex-start; border: 1px solid #bee9ff; }
.child { background: #eaf0ff; align-self: flex-end; border: 1px solid #cfdcff; }
.system { background: #fff7cf; align-self: center; color: var(--warn); }
.composer { display: grid; grid-template-columns: 44px 1fr 44px 54px; gap: 8px; padding: 8px; }
.composer input { min-width: 0; border: 0; font-size: 16px; padding: 0 10px; outline: none; }
.composer .send-button { background: #0b70dc; color: white; border-color: #0b70dc; padding: 0; font-size: 22px; }
.tool-button {
  width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  font-size: 18px;
}
.attach-button { font-size: 28px; line-height: 1; color: var(--accent); }
.voice-button { color: var(--accent-3); }
.tool-button[aria-pressed="true"] { border-color: var(--accent-3); color: var(--accent-3); }
.dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dashboard-card { padding: 16px; min-height: 112px; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 12px; }
.dashboard-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef7ff;
}
.dashboard-icon img {
  width: 32px;
  height: 32px;
  display: block;
}
.dashboard-card strong { display: block; font-size: 28px; margin-bottom: 6px; }
.dashboard-card span, .skeleton { color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.list-panel { padding: 12px; min-height: 240px; }
.list-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item strong { display: block; }
.list-item span { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .app-shell { padding: 12px 14px; }
  .child-shell { min-height: 100dvh; gap: 8px; }
  h1 { font-size: 28px; }
  .topbar { align-items: flex-start; }
  .parent-hero {
    display: grid;
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .parent-hero-copy h1 { font-size: 28px; }
  .parent-hero-note { font-size: 14px; }
  .parent-hero-image {
    width: 100%;
    min-width: 0;
    max-height: 220px;
    order: 2;
  }
  .parent-hero .text-button {
    justify-self: start;
    order: 3;
  }
  .child-hero {
    min-height: 172px;
    grid-template-columns: 1fr 48px;
    gap: 8px;
    padding: 12px;
    background:
      linear-gradient(90deg, rgba(4, 19, 64, 0.9) 0%, rgba(7, 39, 107, 0.72) 56%, rgba(7, 39, 107, 0.08) 100%),
      url("/assets/web/hero-child-concept-v1.webp") 63% center / cover no-repeat,
      linear-gradient(135deg, #082a68, #0a6ed8);
  }
  .child-hero-content { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; max-width: 300px; }
  .brand-lockup { width: 56px; height: 54px; }
  .companion-mark { width: 52px; height: 50px; font-size: 26px; }
  .brand-spark { width: 22px; height: 22px; font-size: 13px; }
  .hero-note { margin-top: 4px; font-size: 14px; line-height: 1.3; }
  .pause-button { width: 48px; }
  .learning-ribbon { grid-template-columns: 1.2fr 0.8fr 0.9fr; gap: 6px; }
  .learning-chip {
    min-height: 46px;
    grid-template-columns: 24px 1fr;
    column-gap: 6px;
    padding: 7px 8px;
  }
  .chip-icon { width: 24px; height: 24px; font-size: 13px; }
  .learning-chip strong { font-size: 14px; }
  .learning-chip small { font-size: 11px; line-height: 1.1; }
  .mission-strip { padding: 10px 12px; }
  .mission-strip {
    min-height: 78px;
    background:
      linear-gradient(90deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.92) 58%, rgba(255,255,255,0.24) 100%),
      url("/assets/web/mission-explore.webp") 62% center / cover no-repeat;
  }
  .mission-strip.mission-school-help {
    background:
      linear-gradient(90deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.92) 58%, rgba(255,255,255,0.2) 100%),
      url("/assets/web/mission-school.webp") 62% center / cover no-repeat;
  }
  .mission-copy { max-width: 260px; padding: 0; }
  .mission-strip strong { font-size: 15px; line-height: 1.25; }
  .mission-kicker { font-size: 11px; }
  .mission-pill { min-width: 70px; padding: 6px 8px; font-size: 13px; }
  .chat-panel { min-height: 0; padding: 10px; }
  .message { padding: 10px 12px; line-height: 1.38; }
  .dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-card {
    min-height: 96px;
    grid-template-columns: 36px 1fr;
    gap: 8px;
    padding: 12px;
  }
  .dashboard-icon { width: 36px; height: 36px; }
  .dashboard-icon img { width: 28px; height: 28px; }
  .dashboard-card strong { font-size: 24px; margin-bottom: 3px; }
  .dashboard-card span { font-size: 14px; line-height: 1.25; }
  .composer { grid-template-columns: 40px minmax(0, 1fr) 40px 48px; gap: 6px; }
  .composer .send-button { grid-column: auto; padding: 0 10px; }
  .tool-button { width: 40px; }
  .message { max-width: 100%; }
}
