/* Tunas Bicara — "calm modern" design system.
   Sensory-friendly: muted tints, no flashing, large targets, reduced-motion support.
   Light + dark themes follow the phone setting. No web fonts (privacy + speed). */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --ink: #1e2833;
  --muted: #606b77;
  --line: #e6e1d8;

  --primary: #3c6d9a;
  --primary-ink: #ffffff;
  --primary-soft: #e4edf6;
  --ok: #427352;
  --ok-soft: #e2efe4;
  --warn-soft: #fbf1d6;
  --warn-line: #ecdcaa;
  --danger: #a24d46;
  --danger-soft: #f8e4e1;
  --danger-ink: #ffffff;
  --hurt: #eeaa9e; /* body map: the part that hurts */

  /* Soft tint / deep tint pairs (tiles, categories, feelings) */
  --blue: #e4edf6;    --blue-d: #3c6d9a;
  --green: #e2efe3;   --green-d: #427352;
  --yellow: #faf0d2;  --yellow-d: #886614;
  --peach: #f9e6db;   --peach-d: #995734;
  --pink: #f6e2e5;    --pink-d: #994e60;
  --purple: #ebe5f4;  --purple-d: #6d5a9c;
  --teal: #ddefed;    --teal-d: #2d7370;
  --lime: #ebf0da;    --lime-d: #597327;
  /* Learning games: clear but muted colours for colour sorting */
  --g-red: #d0665a; --g-blue: #4f86c6; --g-yellow: #e0b43a; --g-green: #579a6b;
  --grey: #ecebe6;    --grey-d: #5f6670;

  --calm-bg: linear-gradient(180deg, #eef1f7 0%, #e7eef4 100%);
  --breathe-a: #c5d7e8; --breathe-b: #86aacb;

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --tap: 64px;
  --header-h: 68px;
  --shadow-sm: 0 1px 2px rgba(30, 40, 51, .06);
  --shadow: 0 1px 2px rgba(30, 40, 51, .05), 0 6px 18px rgba(30, 40, 51, .06);
  --shadow-lg: 0 10px 40px rgba(30, 40, 51, .18);
  --ease: cubic-bezier(.2, .7, .3, 1);
  font-size: 17px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12171d;
    --surface: #1b222a;
    --surface-2: #242c35;
    --ink: #e8ecf0;
    --muted: #9aa6b2;
    --line: #2d3640;

    --primary: #86b4dc;
    --primary-ink: #0f1a24;
    --primary-soft: #1f3245;
    --ok: #7fbf92;
    --ok-soft: #1f3327;
    --warn-soft: #332b17;
    --warn-line: #4a3f22;
    --danger: #e08a82;
    --danger-soft: #3a2220;
    --danger-ink: #1e1110;
    --hurt: #8a4038;

    --blue: #1f2f3f;    --blue-d: #8db8de;
    --green: #1f3226;   --green-d: #86c39a;
    --yellow: #332c18;  --yellow-d: #e3c26a;
    --peach: #382519;   --peach-d: #e7a27c;
    --pink: #37222a;    --pink-d: #e099aa;
    --purple: #2a2438;  --purple-d: #b9a7e6;
    --teal: #1a3332;    --teal-d: #7fcac4;
    --lime: #252d18;    --lime-d: #b4cc78;
    --g-red: #d97a6e; --g-blue: #6c9ed6; --g-yellow: #e6c25a; --g-green: #6fb184;
    --grey: #262c33;    --grey-d: #aab3bd;

    --calm-bg: linear-gradient(180deg, #161d26 0%, #121a22 100%);
    --breathe-a: #3d5a78; --breathe-b: #2a4560;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* `hidden` must win over any display rule */
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; } /* the app moves focus here on each screen change */
input, select {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); width: 100%; min-height: 50px;
}
input:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
h1, h2, h3, h4 { margin: .4em 0; line-height: 1.2; letter-spacing: -.01em; }
main { max-width: 980px; margin: 0 auto; padding: 8px 16px 48px; outline: none; }

.ico { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* Gentle press feedback (disabled by reduce-motion rules at the bottom). */
.tile, .card, .btn, .icon-btn, .tab, .step-main, .ft-card, .back-btn, .lock-btn {
  transition: transform .14s var(--ease), background-color .2s, box-shadow .2s, border-color .2s;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}
.app-header.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; flex: 1; letter-spacing: -.01em; }
.brand img { border-radius: 10px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 0 16px 0 10px; min-height: 48px; font-weight: 700;
}
.back-btn:active { transform: scale(.96); }
.view-title { flex: 1; min-width: 0; font-size: 1.25rem; font-weight: 800; margin: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Parent mode with the child chip: on a narrow phone the screen title gives way so nothing overflows. */
@media (max-width: 480px) { .app-header:has(.child-chip) .view-title { display: none; } .app-header:has(.child-chip) .back-btn { margin-right: auto; } }
.lock-btn {
  position: relative; width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 1.15rem;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.lock-btn.active { background: var(--yellow); border-color: var(--warn-line); color: var(--yellow-d); }
.lock-icon { display: inline-flex; }
.lock-ring { position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent; pointer-events: none; }
.lock-btn.holding .lock-ring { border-color: var(--primary); animation: ring 2s linear forwards; }
@keyframes ring { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
body.parent .app-header { background: var(--bg); }

/* ---------- Home ---------- */
.hero { padding: 6px 4px 14px; }
.hero-date { color: var(--muted); font-weight: 600; font-size: .9rem; text-transform: capitalize; }
.hero-title { font-size: 1.85rem; font-weight: 800; margin: 2px 0 0; letter-spacing: -.02em; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.tile {
  position: relative; border: 0; border-radius: var(--r-lg); padding: 16px; min-height: 156px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px;
  text-align: left; background: var(--t-soft); color: var(--ink);
}
.tile:active { transform: scale(.97); }
.tile-icon {
  width: 64px; height: 64px; border-radius: 20px; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; font-size: 2.2rem; line-height: 1;
  box-shadow: var(--shadow-sm);
}
.tile-text { display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.2; }
.tile-sub { font-size: .82rem; font-weight: 600; color: var(--t-deep); line-height: 1.25; }
.tile-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; min-height: 120px; gap: 16px; }
.tile-wide .tile-icon { width: 80px; height: 80px; font-size: 2.8rem; border-radius: 24px; }
.tile-wide .tile-label { font-size: 1.4rem; }
.tile-slim { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; min-height: 76px; padding: 10px 16px; gap: 14px; }
.tile-slim .tile-icon { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 16px; }
@media (min-width: 700px) { .tile-wide { grid-column: span 2; } }
.tile-lock { position: absolute; top: 14px; right: 14px; color: var(--t-deep); opacity: .8; }
.tile-slim .tile-lock { position: static; margin-left: auto; }
.tile-progress { width: 100%; display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--t-deep); }
.tile-progress-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.tile-progress-bar > span { display: block; height: 100%; background: var(--t-deep); border-radius: 999px; }

.tile-blue   { --t-soft: var(--blue);   --t-deep: var(--blue-d); }
.tile-green  { --t-soft: var(--green);  --t-deep: var(--green-d); }
.tile-yellow { --t-soft: var(--yellow); --t-deep: var(--yellow-d); }
.tile-pink   { --t-soft: var(--pink);   --t-deep: var(--pink-d); }
.tile-purple { --t-soft: var(--purple); --t-deep: var(--purple-d); }
.tile-grey   { --t-soft: var(--grey);   --t-deep: var(--grey-d); }
.tile-peach  { --t-soft: var(--peach);  --t-deep: var(--peach-d); }
.tile-row { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; min-height: 96px; gap: 16px; }
.tile-row .tile-icon { width: 60px; height: 60px; font-size: 2rem; }

.disclaimer { color: var(--muted); font-size: .82rem; text-align: center; margin: 28px auto 0; max-width: 46ch; }

/* ---------- Cards (Talk board, pickers) ---------- */
/* Each category gets a calm tint behind the picture, so cards are easy to group by colour. */
.card { --c-soft: var(--surface-2); --c-deep: var(--muted); }
.card[data-cat="want"]     { --c-soft: var(--green);  --c-deep: var(--green-d); }
.card[data-cat="food"]     { --c-soft: var(--peach);  --c-deep: var(--peach-d); }
.card[data-cat="drink"]    { --c-soft: var(--blue);   --c-deep: var(--blue-d); }
.card[data-cat="activity"] { --c-soft: var(--purple); --c-deep: var(--purple-d); }
.card[data-cat="people"]   { --c-soft: var(--yellow); --c-deep: var(--yellow-d); }
.card[data-cat="places"]   { --c-soft: var(--teal);   --c-deep: var(--teal-d); }
.card[data-cat="body"]     { --c-soft: var(--pink);   --c-deep: var(--pink-d); }
.card[data-cat="help"]     { --c-soft: var(--danger-soft); --c-deep: var(--danger); }
.card[data-cat="feelings"] { --c-soft: var(--pink);   --c-deep: var(--pink-d); }
.card[data-cat="core"]     { --c-soft: var(--yellow); --c-deep: var(--yellow-d); }

.card {
  position: relative; border: 2px solid transparent; background: var(--surface); border-radius: var(--r);
  min-height: 116px; padding: 8px 6px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow-sm); font-weight: 700; text-align: center;
}
.card:active { border-color: var(--c-deep); transform: scale(.96); }
.card .pic { background: var(--c-soft); border-radius: 16px; }
.card .pic.has-photo { background: none; }
.card-label { font-size: 1rem; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }

.pic, .pic-sm, .pic-lg, .pic-xl { display: inline-flex; align-items: center; justify-content: center; line-height: 1; flex: none; }
.pic { font-size: 2.4rem; width: 68px; height: 68px; }
.pic-sm { font-size: 1.3rem; width: 30px; height: 30px; }
.pic-lg { font-size: 3.4rem; width: 92px; height: 92px; }
.pic-xl { font-size: 5.6rem; width: 160px; height: 160px; }
.pic img, .pic-sm img, .pic-lg img, .pic-xl img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.pic-sm img { border-radius: 8px; }

.edit-badge {
  position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
  background: var(--yellow); color: var(--yellow-d); border: 1px solid var(--warn-line);
}
.card-add { border: 2px dashed var(--line); background: transparent; box-shadow: none; color: var(--muted); }
.card-add .pic { background: var(--surface-2); font-size: 1.6rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(6, 1fr); } }
.grid-small { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid-small .card { min-height: 96px; }
.grid-small .pic { font-size: 1.8rem; width: 48px; height: 48px; border-radius: 12px; }
.grid-small .card-label { font-size: .85rem; }

/* ---------- Talk board ---------- */
.strip {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 5;
  display: flex; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 8px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.strip-cards { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; min-height: 56px; align-items: center; scrollbar-width: none; padding-left: 4px; }
.strip-cards::-webkit-scrollbar { display: none; }
.strip-empty { color: var(--muted); padding-left: 6px; font-weight: 600; }
.strip-card {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--ink);
  border: 0; border-radius: 14px; padding: 6px 12px 6px 6px; min-height: 48px; flex: none; font-weight: 700; white-space: nowrap;
}
.strip-card:active { transform: scale(.95); background: var(--danger-soft); }
.strip-actions { display: flex; gap: 6px; flex: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--surface-2); color: var(--ink); border-radius: 16px;
  min-width: 48px; min-height: 48px; font-size: 1.15rem;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.big { background: var(--primary); color: var(--primary-ink); min-width: 64px; min-height: 56px; border-radius: 20px; font-size: 1.3rem; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.core-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
@media (min-width: 700px) { .core-row { grid-template-columns: repeat(8, 1fr); } }
.card-core { background: var(--yellow); min-height: 88px; box-shadow: none; }
.card-core .pic { font-size: 1.7rem; width: 42px; height: 42px; background: var(--surface); border-radius: 12px; }
.card-core .card-label { font-size: .9rem; overflow-wrap: normal; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 0 16px; min-height: 48px; font-weight: 700; white-space: nowrap;
}
.tab.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Grid size chosen by the parent (Talk board). 6 columns falls back to 4 on phones
   so cards stay at least ~64px wide (child tap-target rule). */
.board-grid.cols-2 { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
.board-grid.cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.board-grid.cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
.board-grid.cols-6 { grid-template-columns: repeat(4, 1fr) !important; }
@media (min-width: 600px) { .board-grid.cols-6 { grid-template-columns: repeat(6, 1fr) !important; } }
.board-grid.cols-2 .card { min-height: 168px; }
.board-grid.cols-2 .pic { width: 112px; height: 112px; font-size: 4rem; border-radius: 24px; }
.board-grid.cols-2 .card-label { font-size: 1.25rem; }
.board-grid.cols-4 .card, .board-grid.cols-6 .card { min-height: 96px; }
.board-grid.cols-4 .pic, .board-grid.cols-6 .pic { width: 52px; height: 52px; font-size: 1.9rem; border-radius: 14px; }
.board-grid.cols-4 .card-label, .board-grid.cols-6 .card-label { font-size: .88rem; }

/* Pictogram images (img/cards/…) sit on the tint like emoji; photos fill the box. */
.pic.has-img img, .pic-lg.has-img img, .pic-xl.has-img img { object-fit: contain; padding: 8%; }

/* Most-used row */
.most-used { margin-bottom: 14px; }
.row-title { display: flex; align-items: center; gap: 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 2px 8px; }
.row-title .ico { color: var(--yellow-d); }

/* Hidden cards: only parents see them, greyed out */
.card.is-hidden { opacity: .45; border: 2px dashed var(--line); box-shadow: none; }
.card.is-hidden .pic { filter: grayscale(1); }
.hidden-badge {
  position: absolute; top: 6px; left: 6px; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); font-size: .9rem;
}

/* Arrange mode (parent): grip to drag, eye to hide, ◀ ▶ to move */
.card.arranging { cursor: default; padding-top: 40px; padding-bottom: 52px; outline: 2px dashed var(--line); outline-offset: -2px; }
.card.arranging.is-hidden { opacity: .6; }
.drag-handle {
  position: absolute; top: 4px; left: 4px; width: 40px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: grab; touch-action: none;
  background: var(--surface-2);
}
.arrange-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 40px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 1rem; padding: 0;
}
.arrange-btn:disabled { opacity: .3; }
.arrange-eye { position: absolute; top: 4px; right: 4px; width: 40px; height: 36px; }
.arrange-row { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; justify-content: space-between; gap: 4px; }
.card.dragging { z-index: 20; box-shadow: var(--shadow-lg); opacity: .92; transition: none; }
.card.drop-target { border-color: var(--primary); background: var(--primary-soft); }
.arrange-notice { display: flex; align-items: center; gap: 6px; }

.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 8px; }

/* ---------- Schedule ---------- */
.schedule { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.step { position: relative; display: flex; align-items: center; gap: 8px; }
/* Timeline line joining the step numbers */
.step + .step::before { content: ""; position: absolute; left: 32px; top: -14px; width: 2px; height: 16px; background: var(--line); }
.step-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 2px solid transparent; background: var(--surface);
  border-radius: var(--r); padding: 10px 14px; min-height: 88px; box-shadow: var(--shadow-sm); text-align: left;
}
.step-main:active { transform: scale(.98); }
.step-main .pic { background: var(--surface-2); border-radius: 16px; width: 60px; height: 60px; font-size: 2.1rem; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none;
}
.step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.step-label { font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.step-check {
  width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--line); flex: none;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem;
}
.step.now .step-main { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow); min-height: 104px; }
.step.now .step-main .pic { background: var(--surface); width: 72px; height: 72px; font-size: 2.6rem; }
.step.now .step-num { background: var(--primary); color: var(--primary-ink); }
.step.now .step-check { border-color: var(--primary); }
.now-badge { background: var(--primary); color: var(--primary-ink); border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
.step.done .step-main { opacity: .6; box-shadow: none; }
.step.done .step-check { background: var(--ok); border-color: var(--ok); }
.step.done .step-num { background: var(--ok-soft); color: var(--ok); }
/* Parent tools sit in a compact row under each step, so rows stay short. */
body.parent .step { flex-wrap: wrap; }
body.parent .step + .step::before { display: none; }
.step-tools { display: flex; gap: 6px; width: 100%; justify-content: flex-end; }
.step-tools .icon-btn { min-width: 48px; min-height: 40px; font-size: 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.celebrate {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ok-soft); color: var(--ink); border-radius: var(--r); padding: 18px; text-align: center;
  font-size: 1.3rem; font-weight: 800; margin-bottom: 14px;
}
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

.sched-name { font-size: 1.05rem; font-weight: 800; color: var(--muted); margin: 2px 4px 12px; }
.step-minutes { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.step-timer { width: 100%; padding: 10px 4px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-timer .timer { margin-top: 8px; width: 100%; }
.step-tools .drag-handle { position: static; width: 48px; height: 40px; border: 1px solid var(--line); background: var(--surface); }
.step-tools { align-items: center; flex-wrap: wrap; }
.step-minutes-select { width: auto; min-height: 40px; padding: 6px 10px; border-radius: 12px; font-size: .9rem; }
.step.dragging { z-index: 20; opacity: .92; }
.step.dragging .step-main { box-shadow: var(--shadow-lg); }
.step.drop-target .step-main { border-color: var(--primary); background: var(--primary-soft); }

/* Schedule switcher (parent) */
.sched-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sched-chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 48px; padding: 0 16px; font-weight: 700;
}
.sched-chip.active { background: var(--green-d); border-color: var(--green-d); color: #fff; }
.reward-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; background: var(--surface); border-radius: 999px; padding: 6px 12px 6px 6px; }

/* One at a time: Now (huge) + Next */
.one-at-a-time { display: flex; flex-direction: column; align-items: stretch; gap: 14px; max-width: 560px; margin: 0 auto; }
.one-progress { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.one-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.one-dot.done { background: var(--ok); }
.one-dot.now { background: var(--primary); width: 26px; border-radius: 999px; }
.one-now {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: min(56vh, 480px); padding: 20px; border: 3px solid var(--primary); border-radius: var(--r-lg);
  background: var(--primary-soft); box-shadow: var(--shadow); text-align: center;
}
.one-now:active { transform: scale(.98); }
.one-now .pic-xl { width: min(56vw, 220px); height: min(56vw, 220px); font-size: min(30vw, 8rem); background: var(--surface); border-radius: 32px; }
.one-now .pic-xl.has-photo { background: none; }
.one-label { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; }
.one-tap { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: .95rem; }
.one-next {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px dashed var(--line); opacity: .8;
}
.one-next-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--muted); }
.one-next .pic-lg { width: 72px; height: 72px; font-size: 2.6rem; background: var(--surface-2); border-radius: 18px; }
.one-next-label { font-size: 1.2rem; font-weight: 700; }

/* Finished + reward */
.done-view { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 14px; }
.done-view .celebrate { width: 100%; margin: 0; }
.reward-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 360px);
  padding: 22px 16px; border: 3px solid var(--yellow-d); border-radius: var(--r-lg); background: var(--yellow);
}
.reward-card .pic-xl { background: var(--surface); border-radius: 28px; }
.reward-card .pic-xl.has-photo { background: none; }
.reward-star { position: absolute; top: -18px; right: -10px; font-size: 2.6rem; }
.reward-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--yellow-d); }

/* ---------- First–Then ---------- */
.ft { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; margin-top: 6px; }
.ft-panel {
  background: var(--surface); border-radius: var(--r-lg); padding: 16px 10px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 12px; border: 2px solid transparent;
}
.ft-first { --ft: var(--blue-d); --ft-soft: var(--blue); }
.ft-then  { --ft: var(--green-d); --ft-soft: var(--green); }
.ft-title {
  font-size: 1.05rem; font-weight: 800; background: var(--ft-soft); color: var(--ft);
  padding: 6px 16px; border-radius: 999px; letter-spacing: .01em;
}
.ft-card { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; padding: 0; }
.ft-card:active { transform: scale(.97); }
.ft-card .pic-xl { background: var(--ft-soft); border-radius: 28px; }
.ft-card .pic-xl.has-photo { background: none; }
.ft-card.empty { font-size: 4rem; color: var(--muted); }
.ft-arrow {
  align-self: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.2rem; box-shadow: var(--shadow-sm);
}
@media (max-width: 520px) {
  .pic-xl { width: 116px; height: 116px; font-size: 4.2rem; }
  .ft { gap: 6px; } .ft-arrow { width: 34px; height: 34px; font-size: 1rem; }
  .ft-card { font-size: 1.1rem; }
}
.timer { margin: 18px auto 0; max-width: 520px; text-align: center; background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.timer-bar { height: 28px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--primary); border-radius: 999px; transition: width .25s linear; }
.timer-text { font-size: 2rem; font-weight: 800; margin-top: 10px; font-variant-numeric: tabular-nums; }
.timer.finished .timer-text { color: var(--ok); }
.timer.finished .timer-fill { background: var(--ok); }

/* First–Then: done / current panels, three-panel layout, favourites */
.ft-panel.ft-current { border-color: var(--ft); box-shadow: var(--shadow); }
.ft-panel.ft-done { opacity: .7; }
.ft-card { position: relative; }
.ft-check {
  position: absolute; top: 50%; left: 50%; width: 96px; height: 96px; margin: -78px 0 0 -48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
  background: var(--ok); color: #fff; box-shadow: var(--shadow-lg); animation: pop-in .35s var(--ease);
}
.ft-next { --ft: var(--purple-d); --ft-soft: var(--purple); }
.ft.ft-three { grid-template-columns: 1fr auto 1fr auto 1fr; gap: 6px; }
.ft.ft-three .pic-xl { width: 120px; height: 120px; font-size: 4.2rem; }
.ft.ft-three .ft-title { font-size: .85rem; padding: 4px 10px; }
.ft.ft-three .ft-check { width: 64px; height: 64px; margin: -52px 0 0 -32px; font-size: 2rem; }
@media (max-width: 520px) {
  .ft.ft-three { gap: 3px; } .ft.ft-three .ft-panel { padding: 10px 4px; }
  .ft.ft-three .pic-xl { width: 76px; height: 76px; font-size: 2.8rem; border-radius: 18px; }
  .ft.ft-three .ft-arrow { width: 22px; height: 22px; font-size: .7rem; }
  .ft.ft-three .ft-card { font-size: .95rem; }
}
.fav-list { display: flex; flex-direction: column; gap: 8px; }
.fav { display: flex; align-items: center; gap: 8px; }
.fav-apply { flex: 1; text-align: left; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 700; }
.fav.active .fav-apply { border-color: var(--primary); background: var(--primary-soft); }

/* Token board */
.tokens-goal { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 16px; font-weight: 800; font-size: 1.15rem; }
.tokens-goal-reward { display: inline-flex; align-items: center; gap: 8px; background: var(--yellow); border-radius: 999px; padding: 6px 16px 6px 6px; }
.tokens-goal-reward .pic-sm { width: 44px; height: 44px; font-size: 1.8rem; background: var(--surface); border-radius: 50%; }
.tokens { --size: min(27vw, 128px); display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 640px; margin: 8px auto 6px; }
.tokens.tokens-10 { --size: min(16vw, 92px); gap: 10px; }
.tokens .token {
  width: var(--size); height: var(--size); flex: none; border-radius: 50%; border: 3px dashed var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: calc(var(--size) * .5);
}
.tokens .token.filled { border: 3px solid var(--yellow-d); background: var(--yellow); }
.tokens .token .pic-sm { width: 76%; height: 76%; }
.tokens .token .pic-sm img { border-radius: 50%; }
.tokens .token.new { animation: pop-in .45s var(--ease); }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.token-add { min-width: 240px; min-height: 72px; font-size: 1.25rem; }

/* ---------- Feelings ---------- */
.grid-feelings { grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .grid-feelings { grid-template-columns: repeat(4, 1fr); } }
.card-feeling { min-height: 156px; background: var(--c-soft); box-shadow: none; border-radius: var(--r-lg); }
.card-feeling .pic-lg { background: var(--surface); border-radius: 24px; }
.card-feeling .pic-lg.has-photo { background: none; }
.card-feeling .card-label { font-size: 1.15rem; }
.card-feeling[data-id="e-gembira"]  { --c-soft: var(--yellow); --c-deep: var(--yellow-d); }
.card-feeling[data-id="e-sedih"]    { --c-soft: var(--blue);   --c-deep: var(--blue-d); }
.card-feeling[data-id="e-marah"]    { --c-soft: var(--peach);  --c-deep: var(--peach-d); }
.card-feeling[data-id="e-takut"]    { --c-soft: var(--purple); --c-deep: var(--purple-d); }
.card-feeling[data-id="e-penat"]    { --c-soft: var(--teal);   --c-deep: var(--teal-d); }
.card-feeling[data-id="e-sakit"]    { --c-soft: var(--green);  --c-deep: var(--green-d); }
.card-feeling[data-id="e-bosan"]    { --c-soft: var(--grey);   --c-deep: var(--grey-d); }
.card-feeling[data-id="e-terkejut"] { --c-soft: var(--pink);   --c-deep: var(--pink-d); }
.btn-break { background: var(--blue); border-color: transparent; }
.btn-calm { background: var(--purple); border-color: transparent; }
.calm-body { background: var(--calm-bg); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.breathe { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; min-height: 380px; }
.breathe-circle {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, var(--breathe-a), var(--breathe-b));
  box-shadow: 0 0 0 18px rgba(134, 170, 203, .12), 0 0 0 36px rgba(134, 170, 203, .07);
  transform: scale(1); transition: transform var(--breath, 4s) ease-in-out;
}
.breathe-circle.expand { transform: scale(1.6); }
.breathe-text { font-size: 1.6rem; font-weight: 800; color: var(--muted); margin-top: 40px; }

/* Feelings v2 */
.checkin { text-align: center; margin: 0 0 12px; }
.checkin-title { font-size: 1.6rem; font-weight: 800; margin: 4px 0 0; }
.card-feeling.picked { border-color: var(--c-deep); box-shadow: var(--shadow); }
.intensity { margin: 16px 0 4px; }
.intensity-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.intensity-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; min-height: 140px;
  border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--surface); font-weight: 800; font-size: 1.2rem; padding: 12px;
}
.intensity-btn .pic-sm { width: 40px; height: 40px; font-size: 1.8rem; }
.feel-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0; }
.btn-hurt { background: var(--peach); border-color: transparent; }
.toggle-chip { gap: 6px; }

/* Body-pain map */
.bodymap-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bodymap { width: min(100%, 300px); }
.bodymap-svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.bodymap-svg .zone { cursor: pointer; fill: var(--peach); stroke: var(--peach-d); stroke-width: 2.5; outline: none; }
.bodymap-svg .zone .hit { fill: transparent; stroke: none; }
.bodymap-svg .zone .feature { fill: var(--peach-d); stroke: none; }
.bodymap-svg .zone .feature.line { fill: none; stroke: var(--peach-d); stroke-width: 4; stroke-linecap: round; }
.bodymap-svg .zone:focus-visible { stroke: var(--primary); stroke-width: 4; }
.bodymap-svg .zone.active { fill: var(--hurt); stroke: var(--danger); stroke-width: 4; }
.bodymap-svg .zone.small.active .hit { fill: var(--hurt); stroke: var(--danger); stroke-width: 3; }
.bodymap-svg .zone.active .feature { fill: var(--danger); }
.bodymap-svg .zone.active .feature.line { fill: none; stroke: var(--danger); }
.bodymap-status { font-weight: 800; font-size: 1.2rem; margin: 0; min-height: 1.5em; text-align: center; }
.pain-scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.pain-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 96px; padding: 8px;
  border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 700;
}
.pain-btn.active { border-color: var(--danger); background: var(--danger-soft); }
.pain-face { font-size: 2.4rem; line-height: 1; }
.part-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.part-buttons .btn.active { background: var(--danger-soft); border-color: var(--danger); }

/* Calm corner */
.calm-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 0; }
.calm-choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 140px;
  border: 0; border-radius: var(--r-lg); background: var(--surface); font-weight: 800; font-size: 1.1rem; box-shadow: var(--shadow-sm);
}
.calm-choice-emoji { font-size: 2.6rem; line-height: 1; }
.calm-top { display: flex; }
.calm-activity { min-height: 300px; display: flex; align-items: center; justify-content: center; }
.calm-end { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 16px 0 4px; }
.calm-body .timer { background: transparent; box-shadow: none; padding: 8px 0 0; }
.count { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.count-number { font-size: 9rem; font-weight: 800; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.count-number.appear { animation: soft-fade 1.2s ease-out; }
@keyframes soft-fade { from { opacity: 0; } to { opacity: 1; } }
.calm-sounds { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.sound-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.sound-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 110px; padding: 10px;
  border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 700;
}
.sound-btn.active { border-color: var(--primary); background: var(--primary-soft); }
.sound-emoji { font-size: 2.2rem; line-height: 1; }
.volume { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 360px; }
.volume input { flex: 1; min-height: 44px; padding: 0; border: 0; background: transparent; accent-color: var(--primary); }
.squeeze { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.squeeze-blob {
  width: min(70vw, 260px); height: min(70vw, 260px); border-radius: 46% 54% 52% 48% / 50% 45% 55% 50%;
  background: radial-gradient(circle at 40% 35%, var(--purple), var(--purple-d)); opacity: .85;
  transition: transform 1.4s var(--ease), border-radius 1.4s var(--ease), opacity .6s; touch-action: none; user-select: none; -webkit-user-select: none;
}
.squeeze-blob.pressed { transform: scale(.9); border-radius: 50%; opacity: 1; transition: transform .25s ease-out, border-radius .25s, opacity .25s; }

/* Reduce motion: no growing / shrinking — slow fades or a colour change instead. */
body.reduce-motion .breathe-circle { transform: none !important; opacity: .45; transition: opacity var(--breath, 4s) ease-in-out !important; }
body.reduce-motion .breathe-circle.expand { transform: none !important; opacity: 1; }
body.reduce-motion .squeeze-blob.pressed { transform: none !important; background: var(--purple-d); }
@media (prefers-reduced-motion: reduce) {
  .breathe-circle { transform: none !important; opacity: .45; transition: opacity var(--breath, 4s) ease-in-out !important; }
  .breathe-circle.expand { transform: none !important; opacity: 1; }
  .squeeze-blob.pressed { transform: none !important; background: var(--purple-d); }
}

/* Parents: feelings week */
.checkin-week { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow-sm); margin: 6px 0 12px; }
.week-feelings { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week-feeling { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; }
.week-feeling.today { background: var(--primary-soft); }
.wf-day { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.wf-face { font-size: 1.6rem; line-height: 1.2; color: var(--muted); }
.wf-level { font-size: .55rem; color: var(--muted); letter-spacing: 1px; }

/* ---------- Parents ---------- */
.intro { font-size: 1.05rem; margin: 4px 2px 12px; }
.notice {
  background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r-sm);
  padding: 10px 14px; font-size: .9rem; margin: 8px 0;
}
.activity { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm); margin: 10px 0; overflow: hidden; border: 1px solid transparent; }
.activity[open] { border-color: var(--line); box-shadow: var(--shadow); }
.activity summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px; cursor: pointer; min-height: 76px; }
.activity summary::-webkit-details-marker { display: none; }
.act-emoji {
  width: 52px; height: 52px; border-radius: 16px; background: var(--purple);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; flex: none;
}
.act-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-title { font-weight: 800; font-size: 1.08rem; }
.act-meta { color: var(--muted); font-size: .84rem; font-weight: 600; }
.act-done { background: var(--ok); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.activity.done-today .act-emoji { background: var(--ok-soft); }
.act-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.act-body h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 16px; }
.act-body ol, .act-body ul { padding-left: 1.3em; } .act-body li { margin: 6px 0; }
.week { display: flex; align-items: center; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
.week-label { color: var(--muted); font-size: .85rem; font-weight: 700; margin-right: 4px; }
.week-dot { width: 26px; height: 10px; border-radius: 999px; background: var(--surface-2); }
.week-dot.on { background: var(--ok); }

/* Parent coach v2 */
.loading { color: var(--muted); text-align: center; padding: 40px 0; }
.parent-tabs { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 4; background: var(--bg); padding-top: 4px; }
.section-title { font-size: 1.05rem; font-weight: 800; margin: 18px 2px 8px; }
.draft-badge { display: inline-block; vertical-align: middle; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--yellow-d); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 999px; padding: 1px 8px; }
.evidence { font-size: .85rem; color: var(--muted); }
.notice-info { background: var(--primary-soft); border-color: transparent; }
.cta { background: var(--primary-soft); border-radius: var(--r); padding: 14px 16px; margin: 8px 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cta p { margin: 0; }
.safety-notice { background: var(--yellow); border: 2px solid var(--warn-line); border-radius: var(--r); padding: 14px 16px; margin: 8px 0 14px; }
.safety-notice h2 { font-size: 1.1rem; margin-top: 0; }
.safety-notice ul { margin: 6px 0; padding-left: 1.2em; } .safety-notice li { margin: 4px 0; font-weight: 600; }
.today-picks .activity summary { min-height: 84px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 48px; padding: 0 14px; font-weight: 700; white-space: nowrap; }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.guide-help { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.video-block { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; margin: 10px 0; }
.video-block h4 { margin-top: 0; }
.video-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.video-status { color: var(--muted); font-weight: 700; font-size: .9rem; }
.coach-video { width: 100%; border-radius: var(--r-sm); background: #000; margin-bottom: 8px; }

/* Progress: simple CSS bars (no chart library) */
.progress-card { background: var(--surface); border-radius: var(--r); padding: 4px 14px 14px; box-shadow: var(--shadow-sm); margin: 12px 0; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.bar { width: 100%; max-width: 44px; min-height: 4px; background: var(--ok); border-radius: 8px 8px 3px 3px; }
.bar.bar-zero { background: var(--surface-2); }
.bar-value { font-size: .8rem; font-weight: 800; min-height: 1em; }
.bar-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-align: center; text-transform: capitalize; line-height: 1.1; min-height: 2.2em; }
.compare { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.cmp-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px; align-items: center; }
.cmp-area { font-weight: 700; font-size: .9rem; }
.cmp-bars { display: flex; flex-direction: column; gap: 3px; }
.cmp-bar { display: block; min-width: 2.6em; padding: 2px 6px; border-radius: 6px; font-size: .75rem; font-weight: 800; color: var(--ink); }
.cmp-bar.before { background: var(--grey); }
.cmp-bar.after { background: var(--green); }
.cmp-select select { width: auto; min-height: 44px; padding: 6px 10px; }

/* Skills check */
.check-area { margin-bottom: 8px; }
.question { background: var(--surface); border-radius: var(--r); padding: 12px 14px; margin: 8px 0; box-shadow: var(--shadow-sm); }
.question.safety { border: 2px solid var(--warn-line); }
.q-text { margin: 0 0 8px; font-weight: 600; }
.question .segmented button { font-size: .9rem; padding: 0 4px; }
.check-save {
  position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; box-shadow: var(--shadow); margin-top: 16px;
}
.check-count { font-weight: 800; color: var(--muted); }

/* Printable report */
.report-actions { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.report { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.report h1 { font-size: 1.4rem; margin-top: 0; }
.report h2 { font-size: 1.05rem; margin: 18px 0 6px; }
.report table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 6px 0; }
.report th, .report td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.report th { font-size: .8rem; color: var(--muted); }
.report-note, .report .small, .report-foot { font-size: .82rem; color: var(--muted); }
.report-foot { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.report-flags { background: var(--warn-soft); border-radius: var(--r-sm); padding: 2px 12px 8px; }

@media print {
  @page { size: A4; margin: 14mm; }
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --ink: #111; --muted: #444; --line: #ccc; --warn-soft: #f5f5f5; }
  html, body { background: #fff !important; color: #111; font-size: 11pt; }
  .app-header, .no-print, #toast, .modal-backdrop { display: none !important; }
  main { max-width: none; padding: 0; }
  .report { box-shadow: none; padding: 0; border-radius: 0; }
  .report section { break-inside: avoid; }
  .report h1 { font-size: 16pt; } .report h2 { font-size: 12pt; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 16px; padding: 10px 18px; min-height: 50px; font-weight: 700;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.btn-ghost { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn-lg { min-height: var(--tap); font-size: 1.1rem; padding: 14px 24px; border-radius: 20px; }
.btn-selected { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.center { justify-content: center; margin: 20px 0; }

.parent-panel {
  margin-top: 24px; background: var(--warn-soft); border: 1px solid var(--warn-line);
  border-radius: var(--r-lg); padding: 16px;
}
.parent-panel h2 { font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-top: 0; }
.parent-panel h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 18px; }

/* ---------- Stories (Cerita) ---------- */
.story-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .story-list { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.story-item { display: flex; flex-direction: column; gap: 8px; }
.story-item.is-hidden .story-tile { opacity: .5; }
.story-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 150px; padding: 16px 10px; border: 0; border-radius: var(--r-lg); background: var(--teal); color: var(--ink);
  box-shadow: var(--shadow-sm); font: inherit; cursor: pointer; transition: transform .15s var(--ease);
}
.story-tile:active { transform: scale(.97); }
.story-tile .pic-lg { background: var(--surface); border-radius: 22px; }
.story-tile .pic-lg.has-photo { background: none; }
.story-title { font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.story-add { background: var(--surface); border: 2px dashed var(--line); box-shadow: none; }
.story-add .pic-lg { background: var(--surface-2); color: var(--teal-d); }
.story-add .pic-lg .ico svg { width: 36px; height: 36px; }
.story-hidden-tag { font-size: .75rem; font-weight: 700; color: var(--muted); }
.story-tools { display: flex; gap: 6px; justify-content: center; }
.story-tools .btn { flex: 1; justify-content: center; font-size: .85rem; padding: 8px 8px; min-height: 44px; }
.story-tools .icon-btn { flex: none; }
.story-tips { background: var(--surface); border-radius: var(--r); padding: 12px 16px; margin: 14px 0; box-shadow: var(--shadow-sm); }
.story-tips summary { font-weight: 800; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.story-tips ul { margin: 8px 0 0; padding-left: 20px; }
.story-tips li { margin: 4px 0; }

/* Reader: one page at a time. Big picture, big text, big ◀ ▶ (nothing small for small fingers). */
.view-stories:has(.story-reader) { display: flex; flex-direction: column; }
.story-reader { display: flex; flex-direction: column; gap: 14px; min-height: calc(100dvh - var(--header-h) - 40px); }
.story-top { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.story-name { font-size: 1.05rem; font-weight: 800; margin: 0; color: var(--muted); text-align: center; }
.story-dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.story-dots .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.story-dots .dot.seen { background: var(--teal); }
.story-dots .dot.on { background: var(--teal-d); }
.story-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--surface); border-radius: var(--r-lg); padding: 24px 18px; box-shadow: var(--shadow);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer;
}
.story-pic { display: flex; align-items: center; justify-content: center; font-size: 7rem; line-height: 1; width: min(70vw, 300px); aspect-ratio: 1; background: var(--teal); border-radius: var(--r-lg); }
.story-pic.has-photo { background: none; width: min(84vw, 420px); aspect-ratio: auto; }
.story-pic img { width: 100%; height: 100%; max-height: 46dvh; object-fit: contain; border-radius: var(--r); pointer-events: none; }
.story-text { font-size: 1.45rem; font-weight: 700; line-height: 1.45; text-align: center; margin: 0; max-width: 34ch; }
.story-text-only { font-size: 1.8rem; }
@media (min-width: 700px) { .story-text { font-size: 1.7rem; } .story-pic { font-size: 9rem; } }
.story-end { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.story-end-badge { font-weight: 800; font-size: 1.15rem; color: var(--teal-d); }
.story-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding-bottom: env(safe-area-inset-bottom); }
.story-nav .icon-btn.big { min-height: 80px; width: 100%; border-radius: 24px; background: var(--teal-d); color: var(--bg); }
.story-nav .icon-btn.big .ico svg { width: 36px; height: 36px; }
.story-listen { min-height: 80px; border-radius: 24px; gap: 8px; }

/* Builder */
.story-editor { display: flex; flex-direction: column; gap: 12px; }
.editor-bar { justify-content: space-between; }
.field-inline input { max-width: 8ch; font-size: 1.4rem; text-align: center; }
textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical;
}
textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.page-edit { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.page-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-num { font-weight: 800; color: var(--teal-d); }
.page-edit-body { display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 700px) { .page-edit-body { flex-direction: row; gap: 18px; } .page-edit-fields { flex: 1; } }
.page-edit-pic { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; }
.page-edit-pic .pic-lg { background: var(--teal); border-radius: 18px; }
.page-edit-pic .pic-lg.has-photo { background: none; }
.story-hints { display: flex; flex-direction: column; gap: 4px; }
.story-hint { margin: 0; font-size: .88rem; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r-sm); padding: 6px 10px; }

.tile-teal { --t-soft: var(--teal); --t-deep: var(--teal-d); }

.tile-lime { --t-soft: var(--lime); --t-deep: var(--lime-d); }
/* Tablet (3 columns): Stories takes 2 columns so Stories + Games fill the row, like Talk + Schedule. */
@media (min-width: 700px) { .tile-tabwide { grid-column: span 2; } }

/* ---------- Games (Permainan) ---------- */
.games-intro { color: var(--muted); font-weight: 600; margin: 4px 2px 14px; }
.game-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .game-list { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
.game-tile {
  display: flex; align-items: center; gap: 16px; min-height: 96px; padding: 14px 18px; text-align: left;
  border: 0; border-radius: var(--r-lg); background: var(--lime); color: var(--ink); font: inherit; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease);
}
.game-tile:active { transform: scale(.98); }
.game-emoji { width: 64px; height: 64px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; background: var(--surface); border-radius: 20px; }
.game-text { display: flex; flex-direction: column; gap: 2px; }
.game-title { font-weight: 800; font-size: 1.15rem; }
.game-sub { font-size: .85rem; font-weight: 600; color: var(--lime-d); }

.game { position: relative; display: flex; flex-direction: column; gap: 14px; }
.game-time { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.game-time-fill { display: block; height: 100%; width: 100%; background: var(--lime-d); border-radius: 999px; transition: width 1s linear; }
.game-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 6px 0 24px; }
.game-prompt { font-size: 1.35rem; font-weight: 800; text-align: center; margin: 4px 0 0; }
.game-turn { font-weight: 700; color: var(--muted); text-align: center; margin: 0; }
.game-repeat { margin: 0; }
.match-target .pic-xl { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.match-target .pic-xl.has-photo { background: none; }

.game-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 520px; }
.game-choices[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-choice { min-height: 120px; justify-content: center; }
.game-choice .pic-lg { background: var(--c-soft, var(--surface-2)); border-radius: 18px; }
.game-choice .pic-lg.has-photo { background: none; }
.game-choices[data-n="3"] .game-choice .pic-lg { width: 76px; height: 76px; font-size: 2.8rem; }
.card[data-cat="game"] { --c-soft: var(--lime); --c-deep: var(--lime-d); }
/* Errorless help: the right answer glows softly, the others fade. Never red, never shaking. */
.game-choice.hint, .sort-box.hint { box-shadow: 0 0 0 4px var(--lime-d); }
.game-choice.faded, .sort-box.faded { opacity: .35; }
.game-choice.right, .sort-box.right { box-shadow: 0 0 0 4px var(--ok); }

.game-feedback {
  position: absolute; inset: 30% 10% auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg);
  animation: fb-in .35s var(--ease); pointer-events: none; z-index: 5;
}
.fb-star { font-size: 3.4rem; line-height: 1; }
.fb-text { font-size: 1.3rem; font-weight: 800; }
@keyframes fb-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

.sort-item { width: 130px; height: 130px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.sort-item.dragging { cursor: grabbing; position: relative; z-index: 4; }
.shape-box, .shape-box svg { display: block; width: 100%; height: 100%; }
.sort-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 520px; }
.sort-boxes[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sort-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 130px;
  border: 2px dashed var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer;
}
.sort-box .shape-box { width: 64px; height: 64px; }
.swatch { display: block; width: 64px; height: 64px; border-radius: 18px; }
.shape-red { fill: var(--g-red); background: var(--g-red); }
.shape-blue { fill: var(--g-blue); background: var(--g-blue); }
.shape-yellow { fill: var(--g-yellow); background: var(--g-yellow); }
.shape-green { fill: var(--g-green); background: var(--g-green); }
svg.shape { background: none; }
.shape-outline { fill: none; stroke: var(--ink); stroke-width: 6; }

.copy-action { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.copy-action .pic-xl { background: var(--lime); border-radius: var(--r-lg); }
.copy-label { display: block; font-size: 1.6rem; font-weight: 800; }
.copy-label::first-letter { text-transform: uppercase; }
.copy-buttons { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; width: 100%; max-width: 520px; }
.copy-buttons .btn { min-height: 80px; justify-content: center; }

.game-over { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 16px; }
.game-over-emoji { font-size: 5rem; line-height: 1; }
.game-over h2 { font-size: 1.8rem; margin: 6px 0 0; }
.game-over p { font-size: 1.15rem; margin: 0; }
.game-over .btn { margin-top: 18px; min-width: 200px; justify-content: center; }

.games-week { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.games-week li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.games-week-n { color: var(--muted); font-weight: 600; }

/* ---------- Settings ---------- */
.settings { display: flex; flex-direction: column; gap: 10px; }
.settings h2 { font-size: 1.1rem; margin-top: 18px; }
.setting { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-sm); }
.setting p { margin: 0; }
.setting-label { font-weight: 800; }
.segmented { display: flex; background: var(--surface-2); border-radius: 16px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; border: 0; background: transparent; border-radius: 12px; min-height: 48px; font-weight: 700; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Voice packs */
.pack-list { display: flex; flex-direction: column; gap: 8px; }
.pack-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm); }
.pack-name { font-weight: 800; }
.pack-status { flex: 1; color: var(--muted); font-size: .9rem; min-width: 10ch; }

/* ---------- Modal (bottom sheet on phones) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 24, 31, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .modal-backdrop { align-items: center; } }
.modal {
  background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 700px) { .modal { border-radius: var(--r-lg); } }
.modal-head { position: sticky; top: 0; background: var(--bg); display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; z-index: 1; }
.modal-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 999px; background: var(--line); }
@media (min-width: 700px) { .modal-head::before { display: none; } }
.modal-head h2 { font-size: 1.2rem; font-weight: 800; margin: 0; }
.modal-body { padding: 6px 16px 22px; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field > span { font-weight: 700; font-size: .9rem; color: var(--muted); }
.editor-preview { display: flex; justify-content: center; padding: 6px 0; }
.card-preview { width: 140px; box-shadow: var(--shadow); }
.picker-cat { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--danger); }

/* ---------- v9: children, PIN, welcome, backup, accessibility ---------- */
.child-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 36vw; min-width: 0; min-height: 48px; padding: 0 14px 0 8px;
  border: 1px solid var(--warn-line); background: var(--yellow); color: var(--yellow-d); border-radius: 999px; font-weight: 800; flex: none;
}
.child-chip-emoji { font-size: 1.4rem; line-height: 1; }
.child-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.child-pick { display: flex; flex-direction: column; gap: 10px; }
.child-pick-btn {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 8px 16px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 800; font-size: 1.1rem;
}
.child-pick-btn[aria-current="true"] { border-color: var(--primary); background: var(--primary-soft); }
.child-pick-btn .ico { margin-left: auto; color: var(--primary); }
.child-pick-emoji { font-size: 1.8rem; }
.child-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.child-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.child-row.active { background: var(--primary-soft); }
.child-row-emoji { font-size: 1.8rem; flex: none; }
.child-row-name { flex: 1 1 7em; min-width: 0; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.child-row-badge { font-size: .75rem; font-weight: 800; color: var(--primary); background: var(--surface); border-radius: 999px; padding: 2px 8px; }
.child-row-tools { display: flex; gap: 6px; flex: none; align-items: center; margin-left: auto; }
.child-add { align-self: flex-start; }
.settings-for { margin: 14px 4px 0; color: var(--muted); }
.emoji-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.emoji-pick button { min-height: 52px; font-size: 1.6rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.emoji-pick button.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }

.pin-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pin-dots { display: flex; gap: 16px; margin-top: 6px; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dot.on { background: var(--ink); border-color: var(--ink); }
.pin-note { min-height: 1.4em; margin: 0; color: var(--muted); text-align: center; font-weight: 600; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pin-key {
  min-height: 64px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  font-size: 1.5rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.pin-key:active { background: var(--surface-2); }
.pin-forgot { text-align: center; }
.pin-forgot .hint { max-width: 36ch; margin: 4px auto 10px; }
.hold-btn { position: relative; overflow: hidden; min-height: var(--tap); padding: 14px 26px; font-size: 1.1rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.hold-fill { position: absolute; inset: 0; width: 0; background: var(--primary-soft); pointer-events: none; }
.hold-btn.holding .hold-fill { animation: hold-fill linear forwards; }
.hold-label { position: relative; }
@keyframes hold-fill { to { width: 100%; } }
/* Reduced motion: no growing bar, just a steady "holding" colour. */
body.reduce-motion .hold-btn.holding .hold-fill { animation: none !important; width: 100%; }
@media (prefers-reduced-motion: reduce) { .hold-btn.holding .hold-fill { animation: none !important; width: 100%; } }

.view-welcome { max-width: 560px; }
.welcome { display: flex; flex-direction: column; gap: 10px; }
.welcome-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.welcome-dots { display: flex; gap: 8px; }
.welcome-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.welcome-dots span.on { background: var(--primary); width: 26px; border-radius: 999px; }
.welcome-body { display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; }
.welcome-body h2 { font-size: 1.6rem; font-weight: 800; }
.welcome-body p { margin: 0; }
.welcome-emoji { font-size: 3.6rem; line-height: 1; margin-top: 8px; }
.welcome-langs { display: flex; flex-direction: column; gap: 10px; }
.welcome-name { font-size: 1.3rem; text-align: center; }
.welcome-done { font-weight: 700; color: var(--ok); }
.welcome-body .hold-btn { align-self: center; }

.backup-preview { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.backup-preview li { background: var(--surface); border-radius: var(--r-sm); padding: 10px 14px; overflow-wrap: anywhere; }
.import-choice { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.import-choice .hint { margin: 0; }
.backup-last { color: var(--muted); font-weight: 600; }
.backup-due { margin-bottom: 12px; }
.backup-due p { margin: 0 0 10px; }
.storage-use { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.storage-use li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.storage-use li:last-child { border-bottom: 0; }

/* Left-handed: Talk board sentence buttons on the left of the strip. */
body.left-handed .strip { flex-direction: row-reverse; }
body.left-handed .strip-actions { flex-direction: row-reverse; }
@media (max-width: 480px) { body.left-handed .strip, body.left-handed .strip-actions { flex-direction: row; } } /* ▶ on the left */

/* Bigger text: everything is sized in rem, so one root size scales the whole app. */
html.large-text { font-size: 20px; }

/* High contrast: plain backgrounds, dark text, clear outlines (light and dark). */
html.high-contrast {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #eeeeee;
  --ink: #000000; --muted: #2b2b2b; --line: #4a4a4a;
  --primary: #1d4f7c; --primary-soft: #d6e6f5;
}
html.high-contrast .card, html.high-contrast .tile, html.high-contrast .btn, html.high-contrast .setting, html.high-contrast .icon-btn { border: 2px solid var(--line); }
@media (prefers-color-scheme: dark) {
  html.high-contrast {
    --bg: #000000; --surface: #000000; --surface-2: #1c1c1c;
    --ink: #ffffff; --muted: #e0e0e0; --line: #bdbdbd;
    --primary: #9fd0ff; --primary-ink: #000000; --primary-soft: #12324f;
  }
}

/* ---------- Child tap targets (release check: ≥ 64px on child screens) ---------- */
.strip-actions .icon-btn { min-width: 64px; min-height: 64px; }
.strip-actions .icon-btn.big { min-width: 72px; }
/* Narrow phones: the sentence gets the whole width; the buttons sit below it, with a wide ▶. */
@media (max-width: 480px) {
  .strip { flex-wrap: wrap; }
  .strip-cards { flex: 1 1 100%; }
  .strip-actions { flex: 1 1 100%; }
  .strip-actions { flex-direction: row-reverse; } /* ▶ on the right, under the right thumb */
  .strip-actions .icon-btn.big { flex: 1; }
}
.view-board .tab { min-height: 64px; padding: 0 18px; }
.view-schedule .btn, .view-firstthen .btn, .view-tokens .btn, .view-feelings .btn { min-height: 64px; }
body.parent .view-schedule .btn, body.parent .view-firstthen .btn, body.parent .view-tokens .btn, body.parent .view-feelings .btn { min-height: 50px; }
.welcome-body .privacy-link { align-self: center; }

/* ---------- Privacy notice (privacy.html) ---------- */
.privacy { max-width: 720px; }
.privacy h1 { font-size: 1.7rem; font-weight: 800; margin-top: 18px; }
.privacy h2 { font-size: 1.15rem; margin-top: 24px; }
.privacy ul { padding-left: 1.2em; }
.privacy li { margin: 6px 0; }
.privacy article + article { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 12px; }
.privacy a, .privacy-link { color: var(--primary); font-weight: 700; }
.privacy-page .back-btn { text-decoration: none; color: var(--ink); }
.privacy-link { display: inline-flex; align-items: center; min-height: 48px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600;
  opacity: 0; pointer-events: none; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .25s var(--ease); z-index: 100; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
body.reduce-motion :active:not(.dragging) { transform: none !important; }
@media (prefers-reduced-motion: reduce) { :active:not(.dragging) { transform: none !important; } }
