/* ===========================================================
   Pretzel AAC: Prototype styles

   Brand palette (the "ultra violet" ramp), per .claude/rules/UI_STYLING.md:
   #10002B, #240046, #3C096C, #5A189A, #7B2CBF, #9D4EDD, #C77DFF, #E0AAFF

   Role split:
   - Onboarding, app chrome, the orb, loading states: full dark-to-light
     range, including a deliberate brand gradient. This is where the
     product gets to feel bold and current.
   - The talker grid itself: stays light and legible. Violet shows up
     there only as accent (selected states, the predictive strip, the
     speak button), never as the main background. Confirmed product
     decision, not an oversight.
   =========================================================== */

:root {
  color-scheme: light;

  /* ---- violet ramp, raw values ---- */
  --v-900: #10002b;
  --v-800: #240046;
  --v-700: #3c096c;
  --v-600: #5a189a;
  --v-500: #7b2cbf;
  --v-400: #9d4edd;
  --v-300: #c77dff;
  --v-200: #e0aaff;

  /* ---- talker-grid surface: light, legible, violet as accent only ---- */
  --ink: #1d1030;
  --ink-soft: #655a79;
  --ink-faint: #958aa8;
  --paper: #faf8fd;
  --paper-raised: #ffffff;
  --paper-sunken: #f1ecfa;
  --line: #e7defa;
  --line-strong: #d3c3f0;

  --accent: var(--v-500);
  --accent-deep: var(--v-600);
  --accent-ink: #ffffff;
  --accent-soft: #f1e3ff;

  --focus: var(--v-400);
  --focus-soft: #f6ebff;

  --ok: #2e7d4f;
  --ok-soft: #e3f3e8;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --font-body: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;

  /* ---- dark onboarding/chrome surface ---- */
  --dark-ink: #f3ecff;
  --dark-ink-soft: #c9b8ec;
  --dark-gradient: radial-gradient(120% 140% at 15% 0%, var(--v-700) 0%, var(--v-900) 60%, #0a0019 100%);
  --brand-gradient: linear-gradient(135deg, var(--v-700) 0%, var(--v-600) 45%, var(--v-500) 75%, var(--v-400) 100%);
}

* { box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------------------------------------------------------
   Stage
   --------------------------------------------------------- */

.stage {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.stage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.stage-label__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.stage-footnote {
  max-width: 560px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------
   iPad shell
   --------------------------------------------------------- */

.ipad {
  width: min(100%, 860px);
  aspect-ratio: 820 / 610;
  background: #15101f;
  border-radius: 34px;
  padding: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.3) inset, 0 28px 70px -28px rgba(36, 9, 70, 0.45);
  position: relative;
}

.ipad__camera {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35312a;
}

.ipad__screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--paper);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ipad__home-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.35);
  z-index: 20;
}

/* ---------------------------------------------------------
   Views
   --------------------------------------------------------- */

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.view.is-active { display: flex; }

.view--talker {
  padding: 18px 22px 0;
  overflow-y: hidden;
}

.view--setup {
  padding: 18px 22px 0;
}

/* ---------------------------------------------------------
   Buttons (shared)
   --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  transition: transform 100ms ease, box-shadow 150ms ease, background 150ms ease;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-deep); }

.btn--lg {
  padding: 14px 28px;
  font-size: 15.5px;
  border-radius: 12px;
}

.btn--ghost {
  background: var(--paper-raised);
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
}

/* ===========================================================
   ONBOARDING (dark brand surface, the bold-identity moment)
   =========================================================== */

.view--onboard { color: var(--dark-ink); }

.onboard-bg {
  position: absolute;
  inset: 0;
  background: var(--dark-gradient);
  z-index: 0;
}
.onboard-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 85% 15%, rgba(157, 78, 221, 0.35), transparent 70%);
}
.onboard-bg--complete {
  background: var(--dark-gradient);
}

.onboard-welcome__content,
.onboard-chrome,
.onboard-body {
  position: relative;
  z-index: 1;
}

.onboard-welcome__content {
  margin: auto;
  padding: 40px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 460px;
}

.brandmark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 12px 28px -10px rgba(123, 44, 191, 0.65);
}
.brandmark img { display: block; width: 38px; height: 38px; }

.eyebrow {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v-300);
  margin: 0 0 14px;
}

.onboard-headline {
  font-size: 27px;
  line-height: 1.25;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.onboard-sub {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--dark-ink-soft);
  margin: 0 0 26px;
}

.onboard-trust {
  font-size: 12px;
  color: var(--dark-ink-soft);
  margin: 14px 0 0;
  opacity: 0.85;
}

.onboard-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px 0;
}

.backbtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.backbtn--dark {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--dark-ink);
}

.progressbar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}
.progressbar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--v-400), var(--v-300));
  border-radius: 999px;
  transition: width 320ms ease;
}

.onboard-body {
  padding: 22px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.onboard-body--center {
  align-items: center;
  text-align: center;
  justify-content: center;
}
.onboard-body--checklist { padding-bottom: 8px; }

.eyebrow--onboard { margin-bottom: 8px; }

.onboard-h2 {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.onboard-p {
  font-size: 13.5px;
  color: var(--dark-ink-soft);
  margin: 0 0 22px;
  max-width: 46ch;
}

/* ---- method choice ---- */

.method-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.method-card {
  position: relative;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px 14px;
  transition: transform 120ms ease, border-color 150ms ease, background 150ms ease;
}
.method-card:hover {
  border-color: var(--v-400);
  background: rgba(157, 78, 221, 0.12);
}
.method-card:active { transform: scale(0.98); }

.method-card--recommended {
  border-color: var(--v-400);
  background: rgba(157, 78, 221, 0.14);
}

.method-card__badge {
  position: absolute;
  top: -9px;
  right: 14px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
}

.method-card__icon {
  grid-row: 1 / 3;
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.method-card__title {
  font-weight: 800;
  font-size: 15px;
  align-self: end;
}

.method-card__desc {
  font-size: 12.5px;
  color: var(--dark-ink-soft);
  line-height: 1.45;
}

/* ---- checklist ---- */

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 8px;
}

.checklist-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  font-size: 12.5px;
  font-weight: 700;
  transition: transform 110ms ease, border-color 120ms ease, background 120ms ease;
}
.checklist-tile__art { font-size: 24px; }
.checklist-tile:active { transform: scale(0.94); }
.checklist-tile.is-selected {
  border-color: var(--v-300);
  background: rgba(157, 78, 221, 0.22);
}
.checklist-tile.is-selected::after {
  content: "\2713";
  position: absolute;
}

.onboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  position: relative;
  z-index: 1;
}
.onboard-footer__count {
  font-size: 12.5px;
  color: var(--dark-ink-soft);
}

/* ---- survey (lightweight question cards) ---- */

.survey-question {
  margin-bottom: 20px;
}
.survey-question__label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark-ink);
}
.survey-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.survey-option {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  font-size: 13px;
  font-weight: 700;
}
.survey-option.is-selected {
  border-color: var(--v-300);
  background: rgba(157, 78, 221, 0.22);
  color: #fff;
}

/* ---- dictation / orb ---- */

.orb-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 10px 0 20px;
}

.orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 0 0 rgba(157, 78, 221, 0.5);
}
.orb__core {
  width: 36%;
  height: 36%;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
}
.orb.is-listening {
  animation: orb-breathe 1.6s ease-in-out infinite;
}
@keyframes orb-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(157, 78, 221, 0.45); transform: scale(1); }
  50% { box-shadow: 0 0 0 18px rgba(157, 78, 221, 0); transform: scale(1.05); }
}

.orb-btn__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-ink-soft);
}

.dictation__transcript {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-style: italic;
  color: var(--dark-ink);
  border: 1px dashed rgba(255,255,255,0.22);
  max-width: 46ch;
}

/* ---- review & generate ---- */

.review-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 0;
}
.review-loading__bar {
  width: 70%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}
.review-loading__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--v-400), var(--v-300));
  border-radius: 999px;
  animation: review-fill 1.1s ease forwards;
}
@keyframes review-fill { to { width: 100%; } }
.review-loading p {
  font-size: 13px;
  color: var(--dark-ink-soft);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.chip-grid .word-chip {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.16);
  color: var(--dark-ink);
}

/* ---- complete ---- */

.complete-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 14px 30px -10px rgba(123, 44, 191, 0.6);
}

/* ===========================================================
   TALKER GRID (light surface, violet as accent only)
   =========================================================== */

.talkbar {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.talkbar__sentence {
  flex: 1;
  min-height: 56px;
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.talkbar__placeholder {
  color: var(--ink-soft);
  font-size: 15px;
}

.word-chip {
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  animation: chip-in 160ms ease-out;
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.talkbar__actions { display: flex; gap: 8px; }

.iconbtn {
  width: 52px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, transform 100ms ease;
}
.iconbtn:active { transform: scale(0.94); }

#speakBtn {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
#speakBtn.is-speaking { animation: pulse 900ms ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(123, 44, 191, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(123, 44, 191, 0); }
}

.contextbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.contextbar__group { display: flex; align-items: center; gap: 6px; }
.contextbar__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-right: 2px;
}

.pill {
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.pill.is-active {
  background: var(--focus-soft);
  border-color: var(--focus);
  color: var(--v-600);
}
.pill--ghost { margin-left: auto; color: var(--ink-soft); font-weight: 600; }

/* ---- context chip + override sheet ---- */

.ctxchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.ctxchip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.ctxchip.is-manual .ctxchip__dot { background: var(--v-400); }
.ctxchip__mode {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
}
.ctxchip.is-manual .ctxchip__mode { background: var(--accent-soft); color: var(--v-600); }

.ctxsheet {
  margin-top: 10px;
  padding: 12px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ctxsheet[hidden] { display: none; }
.ctxsheet__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ctxsheet__row .contextbar__label { width: 58px; }
.ctxsheet__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.ctxsheet__foot .pill--ghost { margin-left: 0; flex-shrink: 0; }

/* ---- library navigation bar ---- */

.navbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.navbar[hidden] { display: none; }
.navbar__back,
.navbar__home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
}
.navbar__home {
  padding: 0 12px;
  background: var(--paper-raised);
  color: var(--accent-deep);
  border-color: var(--line-strong);
}
.navbar__back:active,
.navbar__home:active { transform: scale(0.95); }
.navbar__crumbs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  overflow: hidden;
  white-space: nowrap;
}
.navbar__crumbs .crumb--current { color: var(--ink); }
.navbar__crumbs .crumb__sep { color: var(--ink-faint); }

/* ---- tile art: photo or illustration ---- */

.tile__art--img {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.tile__art--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile--folder::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  transform: rotate(45deg);
  opacity: 0.7;
}

.journey-note {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--v-600);
  margin-top: 10px;
  font-weight: 700;
}

.grid-scroll {
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  margin-bottom: 14px;
  overflow-y: auto;
  padding-bottom: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 92px;
  grid-auto-flow: dense;
  gap: 10px;
}

.tile {
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px -2px rgba(29, 16, 48, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  transition: border-color 120ms ease, transform 90ms ease, box-shadow 150ms ease;
  position: relative;
}
.tile:active { transform: scale(0.94); box-shadow: 0 1px 2px rgba(29,16,48,0.1); }
.tile:hover { border-color: var(--line-strong); box-shadow: 0 6px 16px -6px rgba(29, 16, 48, 0.18); }

.tile--featured {
  grid-column: span 2;
  grid-row: span 2;
}
.tile--featured .tile__art { font-size: 34px; }
.tile--featured .tile__label { font-size: 15px; }

.tile__art {
  width: 40%;
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.tile__label {
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}
.tile--core .tile__art { background: var(--accent-soft); }
.tile.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* ---- predictive strip ---- */

.predictive-strip {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--focus-soft);
  border: 1.5px solid var(--v-200);
  animation: strip-in 200ms ease-out;
}
@keyframes strip-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.predictive-strip__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.predictive-strip__sparkle { font-size: 13px; }
.predictive-strip__label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--v-600);
}
.predictive-strip__tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.predictive-tile {
  background: var(--paper-raised);
  border: 1.5px solid var(--v-200);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: transform 100ms ease, background 120ms ease;
}
.predictive-tile:active { transform: scale(0.94); }
.predictive-tile:hover { background: var(--accent-soft); }

/* ---------------------------------------------------------
   Dock
   --------------------------------------------------------- */

.dock {
  display: flex;
  border-top: 1.5px solid var(--line);
  padding: 10px 4px 14px;
  gap: 4px;
}
.dock__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 0;
  border-radius: var(--radius-sm);
}
.dock__item.is-active { color: var(--accent); }
.dock__icon { font-size: 18px; }

/* ---------------------------------------------------------
   Caregiver (shared light panels)
   --------------------------------------------------------- */

.panelhead { padding-top: 4px; }
.panelhead h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.panelhead p {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  max-width: 480px;
  line-height: 1.5;
}
.panelhead--back { display: flex; align-items: center; gap: 10px; }
.panelhead--back h1 { margin: 0; }


.setup-card {
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}
.setup-card__row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.setup-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.setup-card__name { font-weight: 800; font-size: 15px; }
.setup-card__meta { font-size: 12.5px; color: var(--ink-soft); }
.setup-card__title { font-size: 15px; margin: 0 0 2px; }
.setup-card__subtitle { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 12px; }

.suggestion-list { display: flex; flex-direction: column; gap: 8px; }
.suggestion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
}
.suggestion-row__word { font-weight: 800; font-size: 13.5px; flex: 1; }
.suggestion-row__reason { font-size: 11.5px; color: var(--ink-soft); flex: 1.4; }
.suggestion-row__actions { display: flex; gap: 6px; }
.suggestion-row__btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.suggestion-row__btn--accept { border-color: var(--accent); color: var(--accent); }
.suggestion-row.is-resolved { opacity: 0.4; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .predictive-strip__tiles { grid-template-columns: repeat(2, 1fr); }
  .checklist-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================================================
   Photos and illustrations in tiles (no emoji)
   =========================================================== */

.art-img, .art-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.art-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-img.art-illo { background: var(--accent-soft); }
.art-img.art-illo img { object-fit: contain; padding: 4%; }
.art-initial {
  background: var(--accent-soft);
  color: var(--v-600);
  font-weight: 800;
  font-size: 22px;
}

.tile__art--img, .tile__art--initial {
  width: 100%;
  height: auto;
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 10px;
}
.tile { padding: 6px 6px 6px; gap: 5px; }
.tile--featured .tile__art--initial { font-size: 40px; }
.tile--favorite::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--paper-raised);
  z-index: 1;
}

.checklist-tile { position: relative; }
.checklist-tile__art--img, .checklist-tile__art--initial {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  font-size: 24px;
}
.checklist-tile__art--initial { background: rgba(255,255,255,0.1); color: var(--dark-ink); }
.checklist-tile.is-selected::after {
  content: "\2713";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--v-400);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===========================================================
   Onboarding: about, profile, vocab, favorites
   =========================================================== */

.view--onboard { overflow: hidden; }
.view--onboard .onboard-body { overflow-y: auto; min-height: 0; }

.about-box {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  padding: 10px;
}
.about-box:focus-within { border-color: var(--v-300); }
.about-text {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--dark-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 6px;
}
.about-text::placeholder { color: rgba(201, 184, 236, 0.6); }
.about-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--dark-ink);
  font-weight: 700;
  font-size: 13.5px;
}
.orb--sm { width: 30px; height: 30px; }
.linkbtn {
  background: none;
  border: 0;
  color: var(--v-300);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn--dark { color: var(--dark-ink-soft); }
.onboard-trust--left { text-align: left; margin-top: 14px; max-width: 52ch; }
.onboard-p--small { font-size: 12.5px; margin-top: 4px; }
.onboard-footer .btn[disabled] { opacity: 0.4; pointer-events: none; }

.build-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.build-steps li {
  font-size: 14px;
  color: var(--dark-ink-soft);
  padding-left: 28px;
  position: relative;
  transition: color 200ms ease;
}
.build-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
}
.build-steps li.is-done { color: var(--dark-ink); }
.build-steps li.is-done::before { background: var(--v-400); border-color: var(--v-400); }
.view--onboard-profile .review-loading { align-items: flex-start; padding: 12px 0; }

/* ---- profile editor (shared by onboarding and Profile tab) ---- */

.pe { display: flex; flex-direction: column; gap: 16px; }
.pe__row { display: flex; gap: 12px; }
.pe__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pe__field--grow { flex: 1; }
.pe__label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pe__hint { font-size: 11.5px; }
.pe input[type="text"], .pe select, .pe__add input, .fav input {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  min-width: 0;
  outline: 0;
}
.pe__stages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pe-stage {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.pe-stage strong { font-size: 13.5px; }
.pe__chips, .fav__chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pe__group { display: flex; flex-direction: column; gap: 8px; }
.pe__add { display: flex; gap: 8px; }
.pe__add input { flex: 1; }
.pe__addbtn {
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
}
.pe-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
}
.pe-chip__x {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pe-school {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  min-height: 70px;
}
.pe-school[hidden] { display: none; }
.pe-school__photo { width: 104px; height: 78px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.pe-school__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-school__illo { width: 100%; height: 100%; }
.pe-school__caption { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.pe-school__caption strong { font-size: 13.5px; }
.pe-school__status { font-size: 13px; font-weight: 700; animation: status-pulse 1s ease-in-out infinite; }
@keyframes status-pulse { 50% { opacity: 0.45; } }

/* dark theme (onboarding) */
.view--onboard .pe__label { color: var(--dark-ink-soft); }
.view--onboard .pe__hint, .view--onboard .pe-school__caption span { color: var(--dark-ink-soft); }
.view--onboard .pe input[type="text"], .view--onboard .pe select, .view--onboard .pe__add input, .view--onboard .fav input, .view--onboard .chip-add input {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.18);
  color: var(--dark-ink);
}
.view--onboard .pe select option { color: #1d1030; }
.view--onboard .pe input:focus, .view--onboard .pe select:focus, .view--onboard .fav input:focus { border-color: var(--v-300); }
.view--onboard .pe-stage { border: 1.5px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.05); color: var(--dark-ink-soft); }
.view--onboard .pe-stage strong { color: var(--dark-ink); }
.view--onboard .pe-stage.is-active { border-color: var(--v-300); background: rgba(157,78,221,0.22); }
.view--onboard .pe-chip { background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.16); color: var(--dark-ink); }
.view--onboard .pe-chip__x { background: rgba(255,255,255,0.12); color: var(--dark-ink); }
.view--onboard .pe__addbtn { background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.18); color: var(--dark-ink); }
.view--onboard .pe-school { background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.14); color: var(--dark-ink); }
.view--onboard .fav__time { color: var(--dark-ink-soft); }
.view--onboard .fav .pill { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); color: var(--dark-ink-soft); }
.view--onboard .fav .pill.is-active { background: rgba(157,78,221,0.28); border-color: var(--v-300); color: #fff; }
.view--onboard .fav__time em { background: var(--v-400); color: #fff; }

/* light theme (Profile tab) */
.view--setup .pe__label { color: var(--ink-soft); }
.view--setup .pe__hint, .view--setup .pe-school__caption span { color: var(--ink-soft); }
.view--setup .pe input[type="text"], .view--setup .pe select, .view--setup .pe__add input, .view--setup .fav input {
  background: var(--paper-raised);
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
}
.view--setup .pe input:focus, .view--setup .pe select:focus, .view--setup .fav input:focus { border-color: var(--accent); }
.view--setup .pe-stage { border: 1.5px solid var(--line); background: var(--paper-raised); color: var(--ink-soft); }
.view--setup .pe-stage strong { color: var(--ink); }
.view--setup .pe-stage.is-active { border-color: var(--accent); background: var(--accent-soft); }
.view--setup .pe-chip { background: var(--accent-soft); color: var(--ink); }
.view--setup .pe-chip__x { background: #fff; color: var(--accent-deep); }
.view--setup .pe__addbtn { background: var(--paper-raised); border: 1.5px solid var(--line-strong); color: var(--ink); }
.view--setup .pe-school { background: var(--paper-sunken); border: 1.5px solid var(--line); }

/* ---- favorites by time and place ---- */

.fav { display: flex; flex-direction: column; gap: 14px; }
.fav__places { display: flex; flex-wrap: wrap; gap: 6px; }
.fav__rows { display: flex; flex-direction: column; gap: 10px; }
.fav__row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: start; }
.fav__time { font-size: 12.5px; font-weight: 700; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; color: var(--ink-soft); }
.fav__time em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
}
.fav input { width: 96px; padding: 5px 10px; font-size: 13px; border-radius: 999px; }
.view--setup .pill { margin: 0; }

/* ---- vocab chips (editor inside chip-grid) ---- */

.chip-grid { display: block; margin-bottom: 14px; }
.chip-grid--light { display: block; }
.view--onboard .chip-grid .pe__group { gap: 10px; }

/* ---- Profile tab layout ---- */

.view--setup { overflow: hidden; }
.setup-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 10px;
  padding-bottom: 6px;
}
.setup-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.setup-card__subtitle--tight { margin: 10px 0 0; }
.btn--sm { padding: 8px 14px; font-size: 13px; }

.toggle { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  flex-shrink: 0;
  transition: background 150ms ease;
}
.toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 150ms ease;
}
.toggle input:checked + .toggle__track { background: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle__text { font-size: 14px; font-weight: 600; }
.dock__icon { display: inline-flex; }

[hidden] { display: none !important; }

.setting-block { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 10px; }
.setting-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- People manager (Profile tab) ---- */
.person-row { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.person-row:first-child { border-top: 0; }
.person-row__thumb { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; }
.person-row__art { width: 100%; height: 100%; }
.person-row__main { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-soft); }
.person-row__main strong { font-size: 14.5px; color: var(--ink); }
.person-row__photo { position: relative; cursor: pointer; }
.person-row__file { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.toggle--compact { padding: 0; gap: 8px; }
.toggle--compact .toggle__text { font-size: 12px; }

/* ---- square tile pictures: show the whole image, not a strip ---- */
.grid { grid-auto-rows: 128px; }
.tile__art--img, .tile__art--initial {
  flex: 1 1 0;
  min-height: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
}
.tile__art--img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile--featured .tile__art--img, .tile--featured .tile__art--initial { max-width: 80%; }
.tile__label { min-height: 2.3em; display: flex; align-items: center; justify-content: center; }

/* ===========================================================
   Profile-building screen: read, pick out, find pictures, build
   =========================================================== */

.build-stage { display: flex; flex-direction: column; gap: 18px; padding: 4px 0 12px; }
.build-hero { display: flex; align-items: center; gap: 16px; }
.build-orb { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.build-orb span { position: absolute; inset: 0; border-radius: 50%; background: var(--brand-gradient); }
.build-orb span:nth-child(2), .build-orb span:nth-child(3) { opacity: 0.35; animation: build-ripple 2s ease-out infinite; }
.build-orb span:nth-child(3) { animation-delay: 1s; }
.build-orb span:first-child { animation: orb-breathe 1.6s ease-in-out infinite; }
@keyframes build-ripple { from { transform: scale(1); opacity: 0.4; } to { transform: scale(2.1); opacity: 0; } }
.build-status { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

.build-words { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 13.5px; line-height: 1.4; max-height: 96px; overflow: hidden; }
.build-word { color: var(--dark-ink-soft); opacity: 0.28; transition: opacity 160ms ease, color 160ms ease; }
.build-word.is-lit { opacity: 1; }
.build-word.is-key.is-lit { color: #fff; background: rgba(157, 78, 221, 0.4); border-radius: 6px; padding: 0 5px; }

.build-facts { display: flex; flex-wrap: wrap; gap: 8px; min-height: 8px; }
.build-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.18);
  font-size: 13px;
  font-weight: 700;
  animation: fact-in 380ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.build-fact small { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--v-300); font-weight: 800; }
@keyframes fact-in { from { opacity: 0; transform: translateY(-14px) scale(0.85); } to { opacity: 1; transform: none; } }

.build-pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.build-pic {
  position: relative;
  aspect-ratio: 1 / 0.82;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.14);
  animation: fact-in 300ms ease-out;
}
.build-pic.is-searching::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(199, 125, 255, 0.35) 50%, transparent 70%);
  animation: build-sweep 1s linear infinite;
}
@keyframes build-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.build-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: pic-flip 520ms ease-out; }
@keyframes pic-flip { from { transform: perspective(400px) rotateY(90deg); opacity: 0; } to { transform: perspective(400px) rotateY(0); opacity: 1; } }
.build-pic__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  padding: 14px 6px 4px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(16, 0, 43, 0.75));
}
.build-pic.is-searching .build-pic__label { background: none; color: var(--dark-ink-soft); top: 40%; padding: 0 6px; }
.build-note { margin: 0; font-size: 12px; color: var(--dark-ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .build-orb span, .build-fact, .build-pic, .build-pic img, .build-pic.is-searching::after { animation: none !important; }
}

/* ===========================================================
   Photo buttons, sheets, standard-library note
   =========================================================== */

.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.photo-btn { position: relative; gap: 8px; cursor: pointer; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.photo-actions__hint { font-size: 12px; color: var(--ink-soft); }
.view--onboard .photo-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); color: var(--dark-ink); }
.view--onboard .photo-actions__hint { color: var(--dark-ink-soft); }

.photo-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.photo-strip:empty { display: none; }
.photo-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 66px; font-size: 11.5px; font-weight: 700; }
.photo-chip__art--img, .photo-chip__art--initial { width: 58px; height: 58px; border-radius: 10px; }

.std-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.std-note p { margin: 0; color: var(--dark-ink-soft); line-height: 1.45; }
.pe-chip--locked { padding: 5px 12px; }
.view--onboard .pe-chip--locked { background: rgba(157,78,221,0.18); border-color: rgba(199,125,255,0.4); }
.view--setup .pe-chip--locked { background: var(--paper-sunken); border: 1.5px dashed var(--line-strong); }

.sheet {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(16, 0, 43, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}
.sheet[hidden] { display: none; }
.sheet__panel {
  background: var(--paper-raised);
  color: var(--ink);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--line);
  padding: 18px;
  width: 100%;
  max-width: 580px;
  max-height: 92%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: strip-in 200ms ease-out;
}
.sheet__title { margin: 0; font-size: 17px; }
.sheet__lead { margin: 0 0 4px; font-size: 13.5px; color: var(--ink-soft); }
.sheet__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.sheet .pe__label { color: var(--ink-soft); }
.sheet input[type="text"] {
  font: inherit; font-size: 15px; font-weight: 700; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong); background: var(--paper-raised); color: var(--ink); outline: 0;
}
.sheet input[type="text"]:focus { border-color: var(--accent); }
.sheet .pe-chip { background: var(--accent-soft); color: var(--ink); }
.sheet .btn[disabled] { opacity: 0.4; pointer-events: none; }
.photo-sheet__top { display: flex; align-items: center; gap: 14px; }
.photo-preview { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--paper-sunken); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-status { margin: 0; font-size: 14.5px; font-weight: 700; }
.photo-status.is-working { animation: status-pulse 1s ease-in-out infinite; }

/* ===========================================================
   Audio, voice, location, weekend tabs
   =========================================================== */

.talkbar__sentence { transition: background 160ms ease, border-color 160ms ease; }
.talkbar__sentence.is-speaking { background: var(--accent-soft); border-color: var(--accent); }

.voice-pill { position: relative; cursor: pointer; }
.voice-pill input { position: absolute; opacity: 0; pointer-events: none; }
.voice-pill:has(input:checked) { background: var(--focus-soft); border-color: var(--focus); color: var(--v-600); }
.voice-pill:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.ctxchip__geo {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--v-600);
}
.ctxsheet__custom { display: contents; }

.geo-banner {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--focus-soft);
  border: 1.5px solid var(--v-200);
  animation: strip-in 200ms ease-out;
}
.geo-banner[hidden] { display: none; }
.geo-banner p { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; }
.geo-banner__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.geo-banner input {
  flex: 1; min-width: 180px; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); background: var(--paper-raised); color: var(--ink); outline: 0;
}
.geo-banner .linkbtn { color: var(--ink-soft); }

.geo-panel { margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--paper-sunken); border: 1.5px solid var(--line); }
.geo-panel[hidden] { display: none; }
.geo-panel__status { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--v-600); }
.geo-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.geo-row:first-child { border-top: 0; }
.geo-row__ok { color: var(--ok); font-weight: 700; }
.geo-row__no { color: var(--ink-faint); }
.geo-panel__sim { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.geo-panel__sim select { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong); background: var(--paper-raised); color: var(--ink); }

.fav__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.fav__tab { display: inline-flex; align-items: center; gap: 6px; }
.fav__tab .fav__now { font-style: normal; font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.fav__sections { display: flex; flex-direction: column; }
.fav__section { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.fav__section:first-child { border-top: 0; }
.fav__place { font-size: 13px; font-weight: 800; padding-top: 7px; }
.fav__more { padding-top: 10px; }
.fav__more select { font: inherit; font-size: 13px; font-weight: 700; padding: 7px 10px; border-radius: 999px; }
.view--onboard .fav__place { color: var(--dark-ink); }
.view--onboard .fav__more select { background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.18); color: var(--dark-ink); }
.view--onboard .fav__more select option { color: #1d1030; }
.view--setup .fav__place { color: var(--ink); }
.view--setup .fav__section { border-top-color: var(--line); }
.view--setup .fav__more select { background: var(--paper-raised); border: 1.5px solid var(--line-strong); color: var(--ink); }

.view--onboard .onboard-body { padding-bottom: 40px; }

/* One-time nudge toward the first tap */
.tile--attention { animation: tile-nudge 1.8s ease-in-out infinite; border-color: var(--accent); }
@keyframes tile-nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(123, 44, 191, 0.35); }
  50% { box-shadow: 0 0 0 9px rgba(123, 44, 191, 0); }
}
@media (prefers-reduced-motion: reduce) { .tile--attention { animation: none; box-shadow: 0 0 0 3px var(--accent-soft); } }

/* ---- Setup mode header ---- */
.rp-head { display: flex; align-items: center; gap: 12px; }
.rp-head__text { display: flex; flex-direction: column; }
.rp-head__text h1 { margin: 0; font-size: 20px; }
.rp-count { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* The Talk screen gives its bottom bar back to the grid; the gear in the chip opens time, place and navigation. */
.ctxchip__gear { color: var(--ink-soft); margin-left: 2px; flex-shrink: 0; }
.ctxchip[aria-expanded="true"] .ctxchip__gear { color: var(--accent); transform: rotate(45deg); }
.ctxchip__gear { transition: transform 200ms ease, color 120ms ease; }
.pill--nav { display: inline-flex; align-items: center; gap: 6px; }
.view--talker { padding-bottom: 12px; }

/* ---- dynamic More and learned shortcuts ---- */
.tile--dynamic::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  width: 8px;
  height: 8px;
  background: var(--v-400);
  transform: rotate(45deg);
  border-radius: 2px;
  z-index: 1;
}
.tile--shortcut { border-color: var(--v-300); background: var(--focus-soft); }
.tile--shortcut::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  width: 8px;
  height: 8px;
  background: var(--v-400);
  transform: rotate(45deg);
  border-radius: 2px;
  z-index: 1;
}
.tile--shortcut .tile__label { font-size: 11px; line-height: 1.15; }
.tile__x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  z-index: 2;
}

.learned-list { margin-top: 8px; }
.learn-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.learn-row:first-child { border-top: 0; }
.learn-row__main { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-soft); }
.learn-row__main strong { font-size: 14px; color: var(--ink); }
.view--setup .learn-row .pe-chip__x { background: var(--paper-sunken); color: var(--accent-deep); }

/* ===========================================================
   Setup mode, settings groups, recommendations, growth
   =========================================================== */
.setup-card--hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--focus-soft); border-color: var(--v-200); }
.setup-card--hero .setup-card__subtitle { margin: 2px 0 0; max-width: 46ch; }
.setting-group { display: flex; flex-direction: column; gap: 4px; padding: 10px 0 8px; border-top: 1px solid var(--line); }
.setting-group__title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.view--teach { overflow: hidden; }
.teach-scroll { flex: 1; min-height: 0; overflow-y: auto; margin-top: 10px; padding-bottom: 12px; }
.teach-box { border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); padding: 10px; background: var(--paper-raised); }
.teach-box:focus-within { border-color: var(--accent); }
.teach-box textarea { width: 100%; border: 0; outline: 0; resize: none; font: inherit; font-size: 15px; line-height: 1.45; color: var(--ink); background: transparent; }
.teach-tools { display: flex; align-items: center; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.teach-tools .btn { margin-left: auto; }
.mic-btn--light { background: var(--paper-raised); border-color: var(--line-strong); color: var(--ink); }
.teach-results { margin-top: 14px; }
.teach-row, .rec-row { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.rec-row { grid-template-columns: 52px 1fr auto; }
.teach-row:first-child, .rec-row:first-child { border-top: 0; }
.teach-row.is-existing { opacity: 0.55; }
.teach-row__pic--img, .teach-row__pic--initial, .rec-row__pic--img, .rec-row__pic--initial { width: 52px; height: 52px; border-radius: 12px; }
.teach-row__main, .rec-row__main { display: flex; flex-direction: column; min-width: 0; font-size: 12px; color: var(--ink-soft); }
.teach-row__main strong, .rec-row__main strong { font-size: 15px; color: var(--ink); }
.rec-row__actions { display: flex; gap: 8px; }
.view--teach .teach-row .pe-chip__x { background: var(--paper-sunken); color: var(--accent-deep); }
.growth-meter { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.growth-meter__bar { height: 10px; border-radius: 999px; background: var(--paper-sunken); overflow: hidden; border: 1px solid var(--line); }
.growth-meter__bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 400ms ease; }
.growth-status { margin: 6px 0 10px; font-size: 14.5px; font-weight: 700; }
.pe-chip--art { padding: 4px 12px 4px 4px; gap: 8px; }
.pe-chip__art--img, .pe-chip__art--initial { width: 34px; height: 34px; border-radius: 8px; }
.view--setup .pe-chip--art, .view--teach .pe-chip--art { background: var(--accent-soft); color: var(--ink); }
#qsWords.is-active, #qsSentences.is-active { background: var(--focus-soft); border-color: var(--focus); color: var(--v-600); }

/* ---- suggestion bar: one row pinned under the grid, three next words (PRD 4.4a) ---- */
.suggest-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--focus-soft);
  border: 1.5px solid var(--v-200);
  animation: suggest-in 220ms ease-out;
}
.suggest-bar[hidden] { display: none; }
@keyframes suggest-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.suggest-bar__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 64px;
  flex-shrink: 0;
  color: var(--v-600);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.15;
}
.suggest-bar__tiles {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.suggest-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 72px;
  padding: 6px 8px;
  background: var(--paper-raised);
  border: 1.5px solid var(--v-200);
  border-radius: var(--radius-sm);
  transition: transform 90ms ease, background 120ms ease;
}
.suggest-tile:hover { background: var(--accent-soft); }
.suggest-tile:active { transform: scale(0.95); }
.suggest-tile__art {
  height: 100%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  position: relative;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--v-600);
}
.suggest-tile__art--img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.suggest-tile__label { font-size: 13px; font-weight: 700; line-height: 1.15; text-align: left; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .suggest-bar__label span { display: none; }
  .suggest-bar__label { width: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .suggest-bar { animation: none; }
}

/* ---- describing words: follow-up chips, divider, color swatches (PRD 4.4b) ---- */
.chip-divider { width: 1.5px; align-self: stretch; margin: 4px 2px; background: var(--v-200); border-radius: 2px; }
.word-chip--followup { background: var(--paper-raised); border: 1.5px solid var(--accent); color: var(--v-700, var(--ink)); }
.tile__art--swatch, .suggest-tile__art--swatch { border: 1.5px solid var(--line-strong, var(--line)); }
.suggest-bar.is-describing .suggest-tile { border-color: var(--accent); }

/* -----------------------------------------------------------
   Conversation mode (PRD 4.4d)
   The Conversation button uses the brand orb treatment while listening.
   ----------------------------------------------------------- */
.iconbtn--mic { color: var(--accent-deep); }
.iconbtn--mic.is-listening {
  background: var(--brand-gradient);
  border-color: var(--v-600);
  color: #fff;
  animation: orb-breathe 1.6s ease-in-out infinite;
}
.iconbtn--mic.is-settling { animation: none; box-shadow: 0 0 0 3px var(--focus-soft); }

@keyframes conv-dot { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes conv-settle { from { width: 100%; } to { width: 0; } }
.convopt {
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  margin-left: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .iconbtn--mic.is-listening { animation: none; }
}

.convsim {
  width: min(100%, 860px);
  background: var(--paper-raised);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.convsim[hidden] { display: none; }
.convsim__title { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.convsim__form { display: flex; gap: 8px; }
.convsim__input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
}
.convsim__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.convsim__chip {
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  padding: 5px 9px;
  text-align: left;
}
.convsim__chip:active { background: var(--accent-soft); }
.convsim__mic { padding: 0; }
.convsim__mic .toggle__text { font-size: 13px; }
.convsim__mic.is-unavailable { opacity: 0.55; pointer-events: none; }

.setting-note { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
#settleBlock[hidden] { display: none; }

/* ---------------------------------------------------------
   Conversation mode screen (PRD 4.4d). The parent drives, the child answers.
   Replaces the grid while the parent is listening, so the child has
   one place to look. The normal grid is untouched when it is off.
   --------------------------------------------------------- */
.iconbtn--mic { width: auto; padding: 0 14px; gap: 8px; font-weight: 800; font-size: 13.5px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; flex: none; }
.iconbtn--mic .iconbtn__label { white-space: nowrap; }
.view--talker.is-conv .navbar,
.view--talker.is-conv .journey-note,
.view--talker.is-conv .grid-scroll,
.view--talker.is-conv .suggest-bar,
.view--talker.is-conv #speakBtn,
.view--talker.is-conv #clearBtn { display: none !important; }
.view--talker.is-conv .talkbar__sentence { color: var(--ink-soft); font-weight: 700; }

.convpanel {
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.convpanel[hidden] { display: none; }

/* The question the parent asked, at the top, the way a chat shows the last message. */
.convasked {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 18px;
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  animation: conv-in 260ms ease both;
}
.convasked[hidden] { display: none; }
.convasked__who { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.convasked__text { font-size: 24px; font-weight: 800; line-height: 1.25; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Blank screen before the first question: one instruction, nothing for the child to tap. */
.convempty { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 0 24px 24px; }
.convempty[hidden] { display: none; }
.convempty__orb { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-deep); border: 1.5px solid var(--v-200); margin-bottom: 8px; }
.convempty__title { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink); }
.convempty__sub { margin: 0; max-width: 430px; font-size: 15px; line-height: 1.4; color: var(--ink-soft); }

.convprompt:empty { display: none; }
.convprompt { flex: none; min-height: 18px; font-size: 12.5px; font-weight: 700; color: var(--v-600); }

.convpanel .convboard[hidden] { display: none; }
.convpanel .convboard { flex: 1; min-height: 0; overflow-y: auto; grid-auto-rows: 108px; align-content: start; }
.convboard .tile { min-height: 0; }
.convboard .tile--yes { border-color: var(--ok); background: var(--ok-soft); }
.convboard .tile--no { border-color: var(--ink-faint); }
.convboard .tile--said { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-soft); background: var(--accent-soft); }
.convboard .tile--cue { border-color: var(--accent); }
.convboard.is-fresh .tile { animation: conv-in 260ms ease both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes conv-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.convmore { flex: none; display: flex; align-items: center; gap: 10px; }
.convmore[hidden] { display: none; }
.convmore__label { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.convmore__tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.convmore__tiles .pill { font-size: 15px; padding: 8px 16px; }

.convstatus {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px 4px;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.convstatus__orb { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-gradient); flex: none; animation: conv-dot 1.4s ease-in-out infinite; }
.convstatus__text { flex: 1; font-weight: 700; color: var(--ink-soft); }
.convstatus__text em { font-style: italic; font-weight: 500; color: var(--ink-faint); }
.convstatus.is-turn .convstatus__orb { animation: none; background: var(--ok); }
@media (prefers-reduced-motion: reduce) {
  .convstatus__orb, .convboard.is-fresh .tile { animation: none; }
}

.convsim__scen { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.convsim__scenlabel { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.convsim__scenpills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.convsim__scenpills .pill[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }

/* The mic shows when the conversation screen is open, so a tap reads as "close". */
.iconbtn--mic.is-open:not(.is-listening) { background: var(--accent-soft); border-color: var(--accent); }
.iconbtn--mic.is-listening { transform: scale(1.04); }

/* Listening, the way a voice chat does it: the whole screen becomes the listening view, so the
   child has nothing to tap. The mic stays on top, lit, under the parent's finger. */
.convlisten {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 90px 48px 56px;
  text-align: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  animation: conv-fade 180ms ease both;
}
.convlisten[hidden] { display: none; }
.view--talker.is-holding .iconbtn--mic { position: relative; z-index: 31; }
@keyframes conv-fade { from { opacity: 0; } to { opacity: 1; } }
.convlisten__orb {
  width: 172px;
  height: 172px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orb-breathe 1.6s ease-in-out infinite;
  margin-bottom: 6px;
}
.convlisten__state { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-deep); }
.convlisten__text { margin: 0; max-width: 680px; font-size: 34px; font-weight: 800; line-height: 1.2; color: var(--ink); min-height: 41px; }
.convlisten__text.is-empty { color: var(--ink-faint); font-weight: 600; }
.convlisten__hint { margin: 0; font-size: 14px; color: var(--ink-soft); }
.convlisten.is-thinking .convlisten__orb { animation: conv-think 900ms ease-in-out infinite; }
.convlisten.is-thinking .convlisten__text { color: var(--ink-soft); }
@keyframes conv-think { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.convwave { display: inline-flex; align-items: center; gap: 3px; height: 22px; }
.convwave i { width: 4px; height: 8px; border-radius: 2px; background: var(--brand-gradient); animation: conv-wave 900ms ease-in-out infinite; }
.convwave i:nth-child(2) { animation-delay: 120ms; }
.convwave i:nth-child(3) { animation-delay: 240ms; }
.convwave i:nth-child(4) { animation-delay: 360ms; }
.convwave i:nth-child(5) { animation-delay: 480ms; }
.convwave i:nth-child(6) { animation-delay: 220ms; }
.convwave i:nth-child(7) { animation-delay: 60ms; }
@keyframes conv-wave { 0%, 100% { height: 6px; } 50% { height: 20px; } }
.convwave--big { gap: 7px; height: 80px; }
.convwave--big i { width: 9px; border-radius: 5px; background: #fff; animation-name: conv-wave-big; }
@keyframes conv-wave-big { 0%, 100% { height: 14px; } 50% { height: 70px; } }
.convlisten.is-thinking .convwave--big i { animation: none; height: 14px; opacity: 0.8; }

.convchips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 30px; }
.convchip { font-size: 14px; font-weight: 800; padding: 4px 13px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); border: 1px solid var(--accent); animation: chip-in 160ms ease-out; }
.convchip--shape { background: none; border-color: var(--line-strong); color: var(--ink-soft); font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .convwave i, .convlisten__orb, .convlisten.is-thinking .convlisten__orb, .convlisten, .convasked { animation: none; }
}
