
:root {
  color-scheme: light;
  --bg: #f7f3e8;
  --child-bg: #fff8e8;
  --panel: #ffffff;
  --ink: #17201f;
  --muted: #69706c;
  --line: #ded7c8;
  --accent: #28785f;
  --accent-2: #3659a6;
  --accent-3: #b24d69;
  --sun: #f2c94c;
  --warn: #9b4b1f;
}
* { 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: 880px;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 12px;
  background:
    linear-gradient(180deg, var(--child-bg), rgba(255, 255, 255, 0));
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}
.eyebrow { margin: 0 0 4px; color: var(--accent); font-weight: 700; 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 {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 0 10px;
}
.companion-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid #1f6b55;
  border-radius: 8px;
  background: #fff1b8;
  color: #174536;
  font-size: 36px;
  font-weight: 900;
  box-shadow: 6px 6px 0 #dbe8ff;
}
.hero-copy { min-width: 0; }
.hero-note {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}
.icon-button, .text-button, .composer button, .prompt-row 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; }
.mission-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e7cf83;
  border-radius: 8px;
  background: #fff6d5;
}
.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: #ffffff;
  border: 1px solid #e7cf83;
  text-align: center;
  font-weight: 800;
}
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-grid div, .dashboard-card, .list-panel, .chat-panel, .composer, .prompt-row button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.status-grid div { padding: 12px; min-height: 72px; }
.child-status div:nth-child(1) { border-left: 5px solid var(--accent); }
.child-status div:nth-child(2) { border-left: 5px solid var(--sun); }
.child-status div:nth-child(3) { border-left: 5px solid var(--accent-2); }
.status-grid span { display: block; font-weight: 800; font-size: 18px; }
.status-grid small { display: block; color: var(--muted); margin-top: 4px; }
.prompt-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.prompt-row button {
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  color: var(--accent-2);
}
.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, #f2c94c, #6bbf9d, #8fa8f2) border-box;
  border: 2px solid transparent;
}
.message { max-width: 86%; padding: 12px 14px; border-radius: 8px; line-height: 1.45; }
.message p { margin: 0; }
.assistant { background: #edf8f1; align-self: flex-start; border: 1px solid #cce9d8; }
.child { background: #eaf0ff; align-self: flex-end; border: 1px solid #cfdcff; }
.system { background: #fff5e8; align-self: center; color: var(--warn); }
.composer { display: grid; grid-template-columns: 44px 1fr 44px auto; gap: 8px; padding: 8px; }
.composer input { min-width: 0; border: 0; font-size: 16px; padding: 0 10px; outline: none; }
.composer .send-button { background: var(--accent); color: white; border-color: var(--accent); }
.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; }
.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: 14px; }
  h1 { font-size: 30px; }
  .topbar { align-items: flex-start; }
  .child-hero { grid-template-columns: 56px 1fr auto; gap: 10px; }
  .companion-mark { width: 56px; height: 56px; font-size: 28px; box-shadow: 4px 4px 0 #dbe8ff; }
  .hero-note { font-size: 15px; }
  .mission-strip { align-items: flex-start; flex-direction: column; }
  .status-grid { grid-template-columns: 1fr; }
  .prompt-row { grid-template-columns: 1fr; }
  .composer { grid-template-columns: 40px minmax(0, 1fr) 40px 82px; gap: 6px; }
  .composer .send-button { grid-column: auto; padding: 0 10px; }
  .tool-button { width: 40px; }
  .message { max-width: 100%; }
}
