:root,
[data-theme="boss"] {
  --bg0: #0c0c0e;
  --bg1: #16161a;
  --ink: #f4f4f0;
  --muted: #9a9a92;
  --line: #2a2a2e;
  --accent: #e8e4d4;
  --accent-ink: #111;
  --warn: #d4a017;
  --danger: #c44;
  --ok: #3a9a5c;
  --bubble-user: #222228;
  --bubble-bot: #1a1a1e;
  --font-display: "Pixelify Sans", monospace;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

[data-theme="parent_light"] {
  --bg0: #f6f4ef;
  --bg1: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b66;
  --line: #ddd8ce;
  --accent: #1a1a1a;
  --accent-ink: #f6f4ef;
  --bubble-user: #ebe7df;
  --bubble-bot: #ffffff;
}

[data-theme="parent_dark"] {
  --bg0: #12141a;
  --bg1: #1c2030;
  --ink: #e8ecf4;
  --muted: #8b93a7;
  --line: #2c3348;
  --accent: #7eb8ff;
  --accent-ink: #0e1218;
  --bubble-user: #252b3d;
  --bubble-bot: #1a1f2c;
}

[data-theme="girls"] {
  --bg0: #fbf0f5;
  --bg1: #fff7fb;
  --ink: #4a2340;
  --muted: #9a6a88;
  --line: #efd0df;
  --accent: #d46a9a;
  --accent-ink: #fff8fb;
  --bubble-user: #f5d6e6;
  --bubble-bot: #ffffff;
  --font-display: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
}

[data-theme="space"] {
  --bg0: #070b18;
  --bg1: #121933;
  --ink: #e8eefc;
  --muted: #8b9bc4;
  --line: #2a365f;
  --accent: #6ec8ff;
  --accent-ink: #061018;
  --bubble-user: #1a2448;
  --bubble-bot: #0e152c;
  --font-display: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
}

[data-theme="school"] {
  --bg0: #f4f7f2;
  --bg1: #ffffff;
  --ink: #1e3324;
  --muted: #6a7d6f;
  --line: #cfdccf;
  --accent: #2f6b45;
  --accent-ink: #f4faf5;
  --bubble-user: #e2ede3;
  --bubble-bot: #ffffff;
  --font-display: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
}

[data-theme="animals"] {
  --bg0: #f7f1e6;
  --bg1: #fffaf2;
  --ink: #3a2a18;
  --muted: #8a7358;
  --line: #e2d2b8;
  --accent: #c4782c;
  --accent-ink: #fff8ee;
  --bubble-user: #f0e0c4;
  --bubble-bot: #ffffff;
  --font-display: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
}

[data-theme="cartoon"] {
  --bg0: #fff9e8;
  --bg1: #ffffff;
  --ink: #1d1a3a;
  --muted: #6d6790;
  --line: #ffe08a;
  --accent: #ff5c5c;
  --accent-ink: #fff8f0;
  --bubble-user: #ffe9a8;
  --bubble-bot: #ffffff;
  --font-display: "Pixelify Sans", monospace;
}

[data-theme="anime"] {
  --bg0: #12081c;
  --bg1: #221133;
  --ink: #f3e9ff;
  --muted: #b39bc9;
  --line: #4a3166;
  --accent: #ff6ad5;
  --accent-ink: #1a0a22;
  --bubble-user: #3a1f55;
  --bubble-bot: #1a0f28;
  --font-display: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg0);
  color: var(--ink);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.04), transparent 50%),
    linear-gradient(180deg, transparent, rgba(0,0,0,.15));
}

a { color: inherit; }
.wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px 64px; }
.brand {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: .04em;
  margin: 0;
}
.tag { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 28px; }
.btn, button, .ghost {
  font: inherit;
  cursor: pointer;
  border: 2px solid var(--line);
  background: var(--bg1);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
.ghost { background: transparent; }
.card {
  background: var(--bg1);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.card h2, .card h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 600; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
input, textarea, select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--bg0);
  color: var(--ink);
  margin-bottom: 12px;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: .9rem; }
.error { color: var(--danger); margin: 8px 0; }
.ok { color: var(--ok); }
.bar {
  height: 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width .3s ease;
}
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }
.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .8rem;
  color: var(--muted);
}
.cred {
  font-family: ui-monospace, monospace;
  background: var(--bg0);
  border: 2px dashed var(--line);
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
}
.kid-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.kid-item:last-child { border-bottom: 0; }
.theme-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.theme-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: .9rem;
  color: var(--ink);
}
.theme-check input { width: auto; margin: 0; }
.report {
  border-left: 3px solid var(--warn);
  padding-left: 12px;
  margin: 12px 0;
}
.app-chat {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 12px;
}
.messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 16px;
}
.bubble-row { display: flex; }
.bubble-row.user { justify-content: flex-end; }
.bubble {
  max-width: min(92%, 520px);
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}
.bubble.user { background: var(--bubble-user); }
.bubble.assistant { background: var(--bubble-bot); }
.bubble .report-btn {
  margin-top: 8px;
  font-size: .75rem;
  padding: 4px 8px;
}
.composer {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--bg1);
  padding: 10px;
}
.composer .row { align-items: flex-end; }
.composer textarea {
  flex: 1;
  margin: 0;
  min-height: 44px;
  max-height: 140px;
  resize: none;
}
.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  font-size: 1.1rem;
  padding: 0;
}
.theme-select {
  width: auto;
  min-width: 110px;
  margin: 0;
  padding: 8px 10px;
}
.bubble img {
  max-height: 180px;
  max-width: 100%;
  display: block;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.pending { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pending:empty { display: none; }
.pending-item { position: relative; }
.pending-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.pending-item button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0;
  font-size: .8rem;
  line-height: 1;
}
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40;
}
.modal {
  background: var(--bg1); border: 2px solid var(--line); border-radius: 12px;
  padding: 18px; width: min(420px, 100%);
}
.hidden { display: none !important; }
.hero-links { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 640px) { .hero-links { grid-template-columns: 1fr 1fr; } }
.hero-card {
  display: block; text-decoration: none;
  background: var(--bg1); border: 2px solid var(--line); border-radius: 14px; padding: 22px;
  transition: transform .15s ease, border-color .15s;
}
.hero-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.hero-card strong { font-family: var(--font-display); font-size: 1.3rem; display: block; margin-bottom: 6px; }
.disclaimer { margin-top: 40px; font-size: .8rem; color: var(--muted); line-height: 1.45; }
