/* E5-S4: self-hosted via /shared/fonts/datasquiz-fonts.css */
@import url("/shared/fonts/datasquiz-fonts.css");
:root {
  color-scheme: light dark;
   --bg: var(--surface-3, #09111b);
   --panel: var(--surface-2);
   --line: var(--border-subtle);
   --ink: var(--text-primary);
   --muted: var(--text-muted);
  --accent: #00bcd4;
  --accent-strong: #0097a7;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font-body: "Instrument Sans", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(0, 188, 212, 0.14), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(0, 151, 167, 0.12), transparent 28%),
    linear-gradient(165deg, var(--surface-2), var(--surface-3) 58%, var(--surface-2));
  color: var(--ink);
  font-family: var(--font-body);
}

button,
input,
select,
textarea,
summary {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1380px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.topbar,
.actions,
.brand {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 10px 4px;
}

.brand {
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand strong,
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
}

.brand strong {
  display: block;
  font-size: 1.05rem;
}

.brand small,
.muted,
.section-copy p,
.message,
.placeholder {
  color: var(--muted);
}

.mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 62% 28%, #fff7d0 0 18%, #2d6e8f 22% 48%, #162436 50%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.actions {
  gap: 10px;
}

.primary,
.ghost,
.option-pill {
  border: 1px solid var(--line);
  border-radius: 12px;
}

.primary,
.ghost {
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink);
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  font-weight: 800;
}

.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.wide {
  width: 100%;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 520px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.composer {
  display: grid;
  gap: 18px;
  padding: 22px;
  position: sticky;
  top: 18px;
}

.panel-head,
.simple-stack,
.preview-column,
.answer-panel,
.tips-panel {
  display: grid;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

.quick-block {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.quick-copy {
  display: grid;
  gap: 4px;
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-pill {
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.option-pill.selected {
  border-color: rgba(0, 188, 212, 0.45);
  background: rgba(0, 188, 212, 0.12);
}

.composer-actions {
  display: grid;
  gap: 10px;
}

.message {
  min-height: 18px;
  margin: 0;
  color: var(--accent);
}

.answer-content {
  padding: 20px;
}

.answer-text {
  line-height: 1.6;
}

.answer-body {
  font-size: 1.1rem;
  margin: 0 0 16px;
}

.verification-badge {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
}

.verification-badge.real {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.verification-badge.fake {
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.verification-badge strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 8px;
}

.verification-badge.real strong {
  color: #81c784;
}

.verification-badge.fake strong {
  color: #e57373;
}

.verification-badge p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.answer-sources,
.learn-more {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.answer-sources h3,
.learn-more h3 {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 12px;
}

.answer-sources p,
.learn-more p {
  margin: 8px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.tips-list {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.tip-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.tip-item strong {
  font-size: 0.9rem;
}

.tip-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .composer {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 18px, 100%);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

body.child-visual-mode .avatar-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.child-visual-mode .avatar-pick,
body.child-visual-mode .option-pill,
body.child-visual-mode .emoji-btn {
  min-height: 48px;
  min-width: 48px;
  font-size: 1.05rem;
}


/* APP-GRADUATION-CX-01: kid-companion verification journal */
.preset-strip,
.avatar-picker,
.voice-input-row,
.journal-actions,
.journal-card-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.preset-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preset-strip .preset,
.avatar-pick {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-weight: 700;
}

.preset-strip .preset.selected,
.avatar-pick.selected {
  border-color: rgba(0, 188, 212, 0.45);
  background: rgba(0, 188, 212, 0.12);
}

.journal-panel {
  display: grid;
  gap: 14px;
}

.journal-list {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.journal-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.journal-card-head,
.journal-actions,
.voice-input-row {
  align-items: center;
  justify-content: space-between;
}

.journal-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.journal-pill--real,
.verification-summary--real {
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
}

.journal-pill--fake,
.verification-summary--fake {
  background: rgba(244, 67, 54, 0.16);
  color: #ef9a9a;
}

.journal-pill--uncertain,
.verification-summary--uncertain {
  background: rgba(255, 193, 7, 0.16);
  color: #ffe082;
}

.journal-answer,
.journal-meta {
  margin: 0;
}

.journal-meta {
  font-size: 0.84rem;
  color: var(--muted);
}

.verification-summary {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.verification-summary strong {
  display: block;
  margin-bottom: 6px;
}

body.child-visual-mode .avatar-picker {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.child-visual-mode label > input[name="name"] {
  display: none;
}

body:not(.child-visual-mode) .avatar-picker {
  display: none !important;
}

@media (max-width: 720px) {
  .preset-strip {
    grid-template-columns: 1fr;
  }

  .journal-card-head,
  .journal-actions,
  .voice-input-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* MATRIX-MARKER residual: real companion slot + reward rail */
.companion-panel {
  margin: 0.75rem 1rem 0;
  padding: 0.75rem 1rem;
  min-height: 4.5rem;
}
.reward-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0.5rem 1rem 0;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  background: var(--surface-2, #fff8e7);
  border: 1px solid var(--line, #e5dcc8);
  border-radius: 999px;
  min-height: 1.5rem;
}
.tips-panel[data-app-zone="background-context-zone"] {
  margin-top: 0.75rem;
}
