/* PlayQuest הורים — mobile-first, RTL, light/dark. Design system: docs/DESIGN-SYSTEM.md
   Slate Blue: neutral-first, one slate-blue brand, soft-blue support, semantic colour only for meaning. 4px spacing grid. */

@font-face { font-family: "PQ Hebrew"; src: url("../fonts/NotoSansHebrew-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0590-05FF, U+FB1D-FB4F, U+200E-200F, U+2066-2069, U+20AA; }
@font-face { font-family: "PQ Hebrew"; src: url("../fonts/NotoSansHebrew-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0590-05FF, U+FB1D-FB4F, U+200E-200F, U+2066-2069, U+20AA; }
@font-face { font-family: "PQ Hebrew"; src: url("../fonts/NotoSansHebrew-Bold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; unicode-range: U+0590-05FF, U+FB1D-FB4F, U+200E-200F, U+2066-2069, U+20AA; }
@font-face { font-family: "PQ Numbers"; src: url("../fonts/Rubik-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PQ Numbers"; src: url("../fonts/Rubik-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PQ Numbers"; src: url("../fonts/Rubik-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PQ Numbers"; src: url("../fonts/Rubik-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  /* PlayQuest Slate Blue (docs/DESIGN-SYSTEM.md). Semantic tokens first; the older short names below alias them. */
  --color-background: #F5F7FA;
  --color-background-2: #EDF1F6;
  --color-surface: #FFFFFF;
  --color-surface-elevated: #FFFFFF;
  --color-primary: #657FA8;          /* brand: rings, progress, active nav, selection, icons */
  --color-primary-strong: #536D96;   /* brand as text on white/subtle (5.3:1) */
  --color-primary-button: #5A739C;   /* #657FA8 darkened a step so white labels reach 4.8:1 */
  --color-primary-hover: #4E6891;
  --color-primary-text: #FFFFFF;
  --color-accent-soft: #CEDAE9;
  --color-accent-subtle: #E8EEF6;
  --color-text: #1B2536;
  --color-text-secondary: #535F73;   /* #647084 on the grey grounds misses 4.5:1; one step darker */
  --color-text-tertiary: #647084;
  --color-text-muted: #8994A4;       /* placeholders and disabled only (not for reading text) */
  --color-border: #E1E7EF;
  --color-divider: #E8EDF3;
  --color-border-strong: #8994A4;    /* control outlines, 3:1 */
  --color-success: #3F927D;  --color-success-text: #2C735F; --color-success-soft: #E6F2EE;
  --color-warning: #B77D35;  --color-warning-text: #8F5F22; --color-warning-soft: #F8EEDF;
  --color-error: #C76168;    --color-error-text: #A8474E;   --color-error-soft: #F8E6E7;
  --color-info: #657FA8;     --color-info-text: #536D96;    --color-info-soft: #E8EEF6;
  --color-earned: #8EA8D0;           /* time earned through challenges: lighter slate beside the brand */
  --color-earned-text: #536D96;
  --color-earned-soft: #E8EEF6;
  --color-on-earned: #111927;
  --color-focus: #536D96;
  --color-scrim: rgba(17, 25, 39, 0.44);
  --color-toast: #1B2536;  --color-toast-text: #F5F7FB;

  --bg: var(--color-background);
  --bg-elev: rgba(245, 247, 250, 0.86);
  --surface: var(--color-surface);
  --surface-2: #F5F7FA;
  --surface-3: var(--color-background-2);
  --text: var(--color-text);
  --text-2: var(--color-text-secondary);
  --text-3: var(--color-text-tertiary);
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
  --accent: var(--color-primary);
  --accent-ink: var(--color-primary-strong);
  --accent-2: var(--color-primary);
  --accent-soft: var(--color-accent-subtle);
  --accent-soft-2: var(--color-accent-soft);
  --btn-primary: var(--color-primary-button);
  --btn-primary-hover: var(--color-primary-hover);
  --on-accent: var(--color-primary-text);
  --grad: var(--color-primary);
  --success: var(--color-success);
  --success-ink: var(--color-success-text);
  --success-soft: var(--color-success-soft);
  --warning: var(--color-warning);
  --warning-ink: var(--color-warning-text);
  --warning-soft: var(--color-warning-soft);
  --coral: var(--color-error);
  --coral-ink: var(--color-error-text);
  --coral-soft: var(--color-error-soft);
  --info: var(--color-info);
  --info-ink: var(--color-info-text);
  --info-soft: var(--color-info-soft);
  --gold: var(--color-earned);          /* legacy name: earned time (no longer gold) */
  --gold-ink: var(--color-earned-text);
  --gold-soft: var(--color-earned-soft);
  --on-gold: var(--color-on-earned);
  --paper: #F5F7FA;
  --paper-line: var(--color-border);
  --focus: var(--color-focus);
  --neutral-soft: var(--color-background-2);
  --success-solid: #2C735F;
  --on-success: #FFFFFF;
  --coral-solid: #A8474E;
  --on-coral: #FFFFFF;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --fs-xs: 13px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --tap: 44px;
  --shadow-sm: 0 1px 2px rgba(27, 37, 54, 0.06);
  --shadow: 0 1px 2px rgba(27, 37, 54, 0.06), 0 1px 1px rgba(27, 37, 54, 0.03);
  --shadow-lg: 0 12px 40px rgba(27, 37, 54, 0.16), 0 2px 8px rgba(27, 37, 54, 0.06);
  --shadow-accent: none;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --tabbar-h: 60px;
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --font: "PQ Hebrew", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "PQ Numbers", "PQ Hebrew", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "PQ Hebrew", "Noto Sans Hebrew", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "PQ Numbers", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms; --dur: 220ms; --dur-reward: 420ms;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-background: #151C29;
    --color-background-2: #1B2534;
    --color-surface: #232E40;
    --color-surface-elevated: #2B3850;
    --color-primary: #8EA8D0;
    --color-primary-strong: #A0B9DE;
    --color-primary-button: #88A4CE;
    --color-primary-hover: #A0B9DE;
    --color-primary-text: #111927;
    --color-accent-soft: #526B91;
    --color-accent-subtle: #283A53;
    --color-text: #F5F7FB;
    --color-text-secondary: #B4C1D2;
    --color-text-tertiary: #93A3B8;    /* #8798AE lifted slightly for 4.5:1 on elevated surfaces */
    --color-text-muted: #8798AE;
    --color-border: #35445A;
    --color-divider: #2E3C50;
    --color-border-strong: #71849F;
    --color-success: #72C3A9;  --color-success-text: #72C3A9; --color-success-soft: #1F3A38;
    --color-warning: #E2B574;  --color-warning-text: #E2B574; --color-warning-soft: #3A3226;
    --color-error: #ED9399;    --color-error-text: #ED9399;   --color-error-soft: #3D2A33;
    --color-info: #8EA8D0;     --color-info-text: #A0B9DE;    --color-info-soft: #283A53;
    --color-earned: #526B91;
    --color-earned-text: #A0B9DE;
    --color-earned-soft: #283A53;
    --color-on-earned: #F5F7FB;
    --color-focus: #A0B9DE;
    --color-scrim: rgba(5, 9, 16, 0.6);
    --color-toast: #2B3850;  --color-toast-text: #F5F7FB;
    --bg-elev: rgba(21, 28, 41, 0.86);
    --surface-2: #2B3850;
    --surface-3: #1B2534;
    --paper: #1B2534;
    --success-solid: #72C3A9;
    --on-success: #0E2019;
    --coral-solid: #ED9399;
    --on-coral: #2A0E12;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-accent: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --color-background: #151C29;
  --color-background-2: #1B2534;
  --color-surface: #232E40;
  --color-surface-elevated: #2B3850;
  --color-primary: #8EA8D0;
  --color-primary-strong: #A0B9DE;
  --color-primary-button: #88A4CE;
  --color-primary-hover: #A0B9DE;
  --color-primary-text: #111927;
  --color-accent-soft: #526B91;
  --color-accent-subtle: #283A53;
  --color-text: #F5F7FB;
  --color-text-secondary: #B4C1D2;
  --color-text-tertiary: #93A3B8;    /* #8798AE lifted slightly for 4.5:1 on elevated surfaces */
  --color-text-muted: #8798AE;
  --color-border: #35445A;
  --color-divider: #2E3C50;
  --color-border-strong: #71849F;
  --color-success: #72C3A9;  --color-success-text: #72C3A9; --color-success-soft: #1F3A38;
  --color-warning: #E2B574;  --color-warning-text: #E2B574; --color-warning-soft: #3A3226;
  --color-error: #ED9399;    --color-error-text: #ED9399;   --color-error-soft: #3D2A33;
  --color-info: #8EA8D0;     --color-info-text: #A0B9DE;    --color-info-soft: #283A53;
  --color-earned: #526B91;
  --color-earned-text: #A0B9DE;
  --color-earned-soft: #283A53;
  --color-on-earned: #F5F7FB;
  --color-focus: #A0B9DE;
  --color-scrim: rgba(5, 9, 16, 0.6);
  --color-toast: #2B3850;  --color-toast-text: #F5F7FB;
  --bg-elev: rgba(21, 28, 41, 0.86);
  --surface-2: #2B3850;
  --surface-3: #1B2534;
  --paper: #1B2534;
  --success-solid: #72C3A9;
  --on-success: #0E2019;
  --coral-solid: #ED9399;
  --on-coral: #2A0E12;
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-accent: none;
  color-scheme: dark;
}

/* ================================================================== base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); touch-action: manipulation; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--mono); }
/* numbers, times and durations: Rubik with tabular figures */
.num, bdi.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 10px; }

.app { min-height: 100dvh; display: flex; flex-direction: column; }
.main:focus, .main:focus-visible { outline: none; }
.app.chromeless .main { padding: 0; max-width: none; }

/* ================================================================== header (large title, condenses on scroll) */

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 6px) calc(16px + var(--safe-right)) 6px calc(16px + var(--safe-left));
  background: var(--bg-elev);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-height: 48px; }
.topbar-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.topbar.root .topbar-title { text-align: start; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; transition: font-size var(--dur) var(--ease); }
.topbar.root.scrolled .topbar-title { font-size: 20px; }
.topbar-side { display: flex; align-items: center; gap: 4px; min-width: 44px; }
.topbar-side.end { justify-content: flex-end; }
.topbar.root .topbar-side.start { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%;
  border: 0; background: transparent; color: var(--text-2); transition: background var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.tinted { background: var(--surface); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 22px; height: 22px; stroke-width: 1.8; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }

.back-btn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent-ink); font-size: 16px; padding: 8px 4px; min-height: var(--tap); max-width: 38vw; }
.back-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn svg { width: 22px; height: 22px; }

/* computer connection chip: dot + name + "מחובר" / "לא מחובר · עודכן לפני…" */
.computer-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 58vw; min-width: 0;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 4px 10px 4px 14px; min-height: var(--tap); text-align: start;
  box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease);
}
.computer-chip:active { transform: scale(.97); }
.computer-chip .cc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.computer-chip .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.computer-chip .state { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.computer-chip > svg { width: 16px; height: 16px; color: var(--text-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.off { background: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3); }
.dot.wait { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

/* ================================================================== layout */

.main {
  flex: 1; width: 100%; max-width: 720px; margin: 0 auto;
  padding: 4px calc(16px + var(--safe-right)) calc(var(--tabbar-h) + var(--safe-bottom) + 32px) calc(16px + var(--safe-left));
}
.app.no-tabs .main { padding-bottom: calc(var(--safe-bottom) + 32px); }
.view { animation: viewIn var(--dur) var(--ease) both; }
.view.back { animation-name: viewInBack; }
@keyframes viewIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes viewInBack { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.view.fade { animation-name: fadeIn; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 700px) { .cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } }

.section-title { font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: .01em; padding: 8px 4px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 4px 0; min-height: 36px; }
.section-head h2 { font-size: 18px; line-height: 24px; font-weight: 700; }
.section-head + * { margin-top: -6px; }
.link-quiet { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; color: var(--accent-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.xsmall { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 0 4px; }
.greeting { padding: 0 4px; color: var(--text-2); font-size: 15px; margin-top: -4px; }

/* ================================================================== cards & lists */

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; position: relative; }
.card.flat { box-shadow: none; border: 1px solid var(--border); }
.card.tap { transition: transform var(--dur-fast) var(--ease), background var(--dur-fast); cursor: pointer; }
.card.tap:active { transform: scale(.99); }
.card-title { font-size: 17px; font-weight: 600; line-height: 1.35; }

.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list.inset { box-shadow: none; background: var(--surface-2); border-radius: 14px; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px;
  background: none; border: 0; text-align: start; color: inherit; font-size: 16px; position: relative; text-decoration: none;
}
.list-row + .list-row::before { content: ""; position: absolute; top: 0; inset-inline-start: 60px; inset-inline-end: 0; border-top: 1px solid var(--border); }
.list-row.plain + .list-row.plain::before, .list.plain .list-row + .list-row::before { inset-inline-start: 16px; }
button.list-row, a.list-row { cursor: pointer; transition: background var(--dur-fast); }
button.list-row:active, a.list-row:active { background: var(--surface-3); }
.list-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row .label { font-weight: 500; line-height: 1.4; }
.list-row .sub { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.list-row .chev { color: var(--text-3); width: 18px; height: 18px; }
.list-row .value { color: var(--text-2); font-size: 15px; white-space: nowrap; }
.list-row.danger .label { color: var(--coral-ink); }
a.link-row { display: block; text-decoration: none; color: inherit; }

/* row icon tiles: one quiet treatment (no gradients). Legacy colour names map to the palette. */
.row-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.row-icon svg { width: 18px; height: 18px; }
.ri-violet, .ri-blue, .ri-green, .ri-pink { background: var(--accent-soft); color: var(--accent-ink); }
.ri-amber { background: var(--warning-soft); color: var(--warning-ink); }
.ri-coral { background: var(--coral-soft); color: var(--coral-ink); }
.ri-gray { background: var(--surface-3); color: var(--text-2); }

/* ================================================================== buttons */

.btn {
  --spin: currentColor;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius-sm); border: 0;
  font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap;
  background: var(--surface-3); color: var(--text);
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast), background var(--dur-fast);
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--btn-primary); color: var(--on-accent); }
.btn.primary:active:not(:disabled) { background: var(--btn-primary-hover); }
@media (hover: hover) { .btn.primary:hover:not(:disabled) { background: var(--btn-primary-hover); } }
.btn.secondary, .btn.neutral { background: var(--surface-3); color: var(--text); }
.btn.tonal { background: var(--accent-soft); color: var(--accent-ink); }
.btn.outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.btn.ghost, .btn.quiet { background: transparent; color: var(--accent-ink); }
.btn.success { background: var(--success-solid); color: var(--on-success); }
.btn.danger { background: var(--coral-soft); color: var(--coral-ink); }
.btn.danger-solid { background: var(--coral-solid); color: var(--on-coral); }
.btn.sm { min-height: var(--tap); padding: 0 14px; font-size: 15px; }
.btn.xs { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--spin-c, var(--text-2)); border-inline-end-color: transparent; animation: spin .7s linear infinite; }
.btn.primary.loading::after { --spin-c: var(--on-accent); }
.btn.danger-solid.loading::after { --spin-c: var(--on-coral); }
.btn.success.loading::after { --spin-c: var(--on-success); }
.btn.tonal.loading::after, .btn.quiet.loading::after, .btn.ghost.loading::after { --spin-c: var(--accent-ink); }
.btn.danger.loading::after { --spin-c: var(--coral-ink); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); font-size: 14.5px; font-weight: 500;
  white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}
button.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"], .chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.chip svg { width: 16px; height: 16px; }
.chip .count { background: var(--btn-primary); color: var(--on-accent); border-radius: 999px; padding: 0 6px; font-size: 12px; min-width: 20px; text-align: center; font-family: var(--font-num); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 6px; margin: 0 -16px; scroll-padding: 16px; }
.chips::-webkit-scrollbar { display: none; }

/* pills: soft ground, never colour alone */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.45; background: var(--surface-3); color: var(--text-2); }
.pill.wrap { white-space: normal; }
.pill svg { width: 14px; height: 14px; }
/* a removable pill (holiday dates, vacations): a quiet round "x" at the end */
.pill .pill-x { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-block: -3px; margin-inline-end: -6px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.pill .pill-x:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.pill .pill-x:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.pill.green { background: var(--success-soft); color: var(--success-ink); }
.pill.amber { background: var(--warning-soft); color: var(--warning-ink); }
.pill.coral { background: var(--coral-soft); color: var(--coral-ink); }
.pill.violet, .pill.blue { background: var(--accent-soft); color: var(--accent-ink); }
.pill.gray { background: var(--surface-3); color: var(--text-2); }
.pill .live { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
/* status pill: dot + word */
.pill.status { padding: 3px 10px 3px 12px; }
.pill.status .sdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.status .sdot.live { animation: pulse 1.8s ease-in-out infinite; }
.pill.status.play { background: var(--accent-soft); color: var(--accent-ink); }
.pill.status.play .sdot { background: var(--accent); }
.pill.status.idle { background: var(--surface-3); color: var(--text-2); }
.pill.status.idle .sdot { background: var(--success); }
.pill.status.warn { background: var(--warning-soft); color: var(--warning-ink); }
.pill.status.neutral { background: var(--surface-3); color: var(--text-2); }
.pill.status.neutral .sdot { background: var(--text-3); }
.pill.status.ok { background: var(--success-soft); color: var(--success-ink); }
.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--font-num); font-size: 13px; font-weight: 600; }
.earned-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; font-weight: 600; white-space: nowrap; font-family: var(--font-num); }

/* ================================================================== forms */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 14px; font-weight: 500; color: var(--text-2); padding-inline-start: 4px; }
.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.input.code {
  font-family: var(--font-num); font-size: 24px; font-weight: 600; letter-spacing: .12em; text-align: center; direction: ltr;
  text-transform: uppercase; padding: 12px 8px;
}
.input.invalid { border-color: var(--coral); }
select.input { appearance: none; -webkit-appearance: none; background-image: none; padding-inline-end: 40px; }
.select-wrap { position: relative; }
.select-wrap svg { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.hint { font-size: 13.5px; color: var(--text-3); padding-inline-start: 4px; line-height: 1.45; }
.form-error {
  display: flex; gap: 10px; align-items: flex-start; background: var(--coral-soft); color: var(--coral-ink);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 500;
}
.form-error svg { width: 20px; height: 20px; margin-top: 1px; }

/* toggle switch 51×31 */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background var(--dur-fast); }
.switch .thumb { position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.06); transition: transform var(--dur) var(--ease); }
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(-20px); }
[dir="ltr"] .switch input:checked ~ .thumb { transform: translateX(20px); }
.switch input:focus-visible ~ .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled ~ .track, .switch input:disabled ~ .thumb { opacity: .5; }

/* segmented */
.segmented { display: flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; position: relative; }
.segmented button {
  flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--text-2);
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast); padding: 0 6px;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(27,37,54,.12), 0 0 0 .5px rgba(27,37,54,.06); }
.segmented.levels button { min-width: 0; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.segmented button .sug { display: block; font-family: var(--font); font-size: 10px; font-weight: 600; color: var(--accent-ink); line-height: 1; margin-top: -2px; }

/* stepper for minutes: + value − */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-3); color: var(--text); display: grid; place-items: center; transition: transform var(--dur-fast) var(--ease); }
.stepper button:active { transform: scale(.92); }
.stepper button:disabled { opacity: .35; }
.stepper button svg { width: 20px; height: 20px; }
.stepper output { min-width: 88px; text-align: center; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }

.setting-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 60px; position: relative; }
.setting-row + .setting-row::before, .setting-block + .setting-row::before, .setting-row + .setting-block::before, .setting-block + .setting-block::before { content: ""; position: absolute; top: 0; inset-inline: 16px; border-top: 1px solid var(--border); }
.setting-row .grow { flex: 1; min-width: 0; }
.setting-row .label { font-weight: 500; }
.setting-row .sub { font-size: 13.5px; color: var(--text-2); line-height: 1.4; margin-top: 2px; }
.setting-block { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.setting-block .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setting-block .label { font-weight: 500; }
.hours-select { width: 92px; flex: none; }
.hours-select select.input { padding-inline: 10px 28px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.hours-select svg { inset-inline-end: 8px; width: 16px; height: 16px; }

/* choice cards (radio cards with a one-line explanation) */
.choices { display: flex; flex-direction: column; gap: var(--sp-2); }
.choice {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: 10px 14px; text-align: start;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.choice:active { transform: scale(.99); }
.choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); position: relative; }
.choice[aria-checked="true"] .choice-mark { border-color: var(--accent); }
.choice[aria-checked="true"] .choice-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-title { font-weight: 600; font-size: var(--fs-md); }
.choice-sub { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.choices.two { display: grid; grid-template-columns: 1fr 1fr; }
/* hook points filled by other views — invisible while empty */
.slot:empty { display: none; }
.learning-lead { font-size: var(--fs-sm); color: var(--text-2); padding: 0 4px; }

/* colour picker ("צבע במחשב"): flat swatches */
.avatar-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); justify-items: center; }
.avatar-picker button { border: 0; background: none; padding: 0; border-radius: 50%; min-width: var(--tap); min-height: var(--tap); display: grid; place-items: center; }
.avatar-picker button[aria-checked="true"] .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.avatar-picker .avatar { width: 36px; height: 36px; font-size: 15px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--font-num); background: var(--accent-soft); color: var(--accent-ink); }
.swatch.t1 { background: var(--gold-soft); color: var(--gold-ink); }
.swatch.t2 { background: var(--surface-3); color: var(--text); }

/* "זמין רק במחשב, מטעמי אבטחה" */
.pc-only { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); color: var(--text-2); font-size: var(--fs-sm); }
.pc-only-head { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; color: var(--text-2); }
.pc-only-head svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.pc-only ul { margin: 6px 0 0; padding-inline-start: 22px; line-height: 1.6; }
.warn-note { background: var(--warning-soft); color: var(--warning-ink); border-radius: var(--radius-xs); padding: 8px 12px; font-size: 13.5px; font-weight: 500; }

.days-picker { display: flex; gap: 6px; justify-content: space-between; }
.days-picker button { flex: 1; aspect-ratio: 1; max-width: 44px; min-height: 40px; border-radius: 50%; border: 1px solid var(--border-strong); background: transparent; font-weight: 600; font-size: 14px; color: var(--text-2); transition: background var(--dur-fast), color var(--dur-fast); }
.days-picker button[aria-pressed="true"] { background: var(--btn-primary); border-color: var(--btn-primary); color: var(--on-accent); }

/* ================================================================== tab bar */

.tabbar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30;
  padding: 4px calc(8px + var(--safe-right)) calc(4px + var(--safe-bottom)) calc(8px + var(--safe-left));
  background: var(--bg-elev);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--border);
}
.tabbar-inner { max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
  color: var(--text-3); text-decoration: none; font-size: 11px; font-weight: 500; position: relative; border-radius: 12px;
  transition: color var(--dur-fast);
}
.tab svg { width: 24px; height: 24px; stroke-width: 1.8; transition: transform var(--dur-fast) var(--ease); }
.tab[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tab:active svg { transform: scale(.9); }
.tab .badge {
  position: absolute; top: 3px; inset-inline-start: calc(50% + 5px); min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--btn-primary); color: var(--on-accent); font-family: var(--font-num); font-size: 11px; font-weight: 600; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ================================================================== banners */

.banner-host { margin-bottom: 4px; }
.banner-host:empty { display: none; }
.banner {
  display: flex; align-items: center; gap: 12px; border-radius: 14px; padding: 10px 12px 10px 14px; font-size: 14px; line-height: 1.4;
  animation: slideDown var(--dur) var(--ease); background: var(--surface-3); color: var(--text-2);
}
.banner > svg { width: 20px; height: 20px; flex: none; }
.banner b { display: block; font-weight: 600; color: var(--text); }
.banner.offline { background: var(--surface-3); color: var(--text-2); }
.banner.warning { background: var(--warning-soft); color: var(--warning-ink); }
.banner.warning b, .banner.info b, .banner.error b { color: inherit; }
.banner.info { background: var(--accent-soft); color: var(--accent-ink); }
.banner.error { background: var(--coral-soft); color: var(--coral-ink); }
.banner .grow { flex: 1; min-width: 0; }
.banner .btn.xs { flex: none; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ================================================================== facts */

.fact { display: flex; flex-direction: column-reverse; gap: 1px; min-width: 0; }
.fact-k { font-size: 13px; color: var(--text-2); line-height: 1.35; display: inline-flex; align-items: center; gap: 6px; }
.fact-v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--text); white-space: nowrap; }
.fact.gold .fact-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.fact.gold .fact-v { color: var(--gold-ink); }
.fact.accent .fact-v { color: var(--accent-ink); }
.fact.warn .fact-v { color: var(--warning-ink); }

/* ================================================================== time ring */

.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg) scaleY(-1); }
.ring .track { stroke: var(--surface-3); }
.ring .fill { stroke: var(--accent); transition: stroke-dashoffset .8s var(--ease); }
.ring .fill.empty { stroke: transparent; }
.ring.warn .fill { stroke: var(--warning); }
.ring .track-in { stroke: var(--gold-soft); }
.ring .earn { stroke: var(--gold); transition: stroke-dashoffset .8s var(--ease); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.ring .big { font-family: var(--font-num); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; unicode-bidi: isolate; }
.ring.warn .big { color: var(--warning-ink); }
/* The label stays inside the inner (earned) arc: at most ~56% of the ring, wrapping to two short lines. */
.ring .lbl { font-size: 12px; color: var(--text-2); font-weight: 500; margin-top: 3px; max-width: 56%; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }

/* ================================================================== home: child card */

.home { gap: 14px; }
.child-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.cc-head {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer;
  border-radius: 14px; margin: -4px; padding: 4px;
}
.cc-head:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cc-head .who { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cc-head .name { font-size: 19px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.child-card .who { flex: 1; min-width: 0; }
.cc-body { display: flex; align-items: center; gap: 18px; }
.cc-facts { flex: 1; min-width: 0; display: grid; gap: 10px; }
.cc-meta { display: flex; flex-direction: column; gap: 6px; margin-top: -2px; }
.cc-learn {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 12px;
  border-radius: 12px; background: var(--surface-2); font-size: 14px; color: var(--text-2); cursor: pointer; line-height: 1.4;
}
.cc-learn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cc-learn > svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; }
.cc-learn .grow { flex: 1; min-width: 0; }
.cc-learn-k { color: var(--text); font-weight: 600; }
.cc-learn .chev { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.card-actions { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; }
.card-actions .btn { min-height: var(--tap); padding: 0 8px; font-size: 15px; gap: 6px; }
.card-actions .btn svg { width: 18px; height: 18px; }
.chev-ic { width: 20px; height: 20px; color: var(--text-3); }

/* the play-hours / "נעצר להיום" line: quiet text, not a coloured box */
.hours-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.hours-line svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--text-3); }
.hours-line b { color: var(--text); font-weight: 600; }
.hours-line.stopped svg { color: var(--warning); }
.day-rule-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.day-rule-line svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--text-3); }
.day-rule { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.day-rule svg { width: 18px; height: 18px; flex: none; }

/* "what comes next" line (child overview) */
.next-line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); line-height: 1.4; }
.next-line > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--accent-ink); }
.next-line .grow { flex: 1; min-width: 0; }
.next-line .nl-main { font-size: 14.5px; font-weight: 600; }
.next-line .nl-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.next-line.muted > svg { color: var(--text-3); }

/* legacy card pieces still used by other screens */
.stat { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; column-gap: 8px; font-size: 14.5px; }
.stat .k { color: var(--text-2); }
.stat .v { margin-inline-start: auto; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--font-num); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s var(--ease); }
.meter.thin { height: 6px; margin-top: 8px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick .btn { min-height: 44px; padding: 0 4px; font-size: 15px; font-variant-numeric: tabular-nums; }
.quick-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-2 .btn { min-height: 44px; font-size: 15px; }

/* security alerts: one compact row on home, details in a sheet */
.alert-row {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px;
  border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
}
.alert-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.alert-row .alert-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--coral-soft); color: var(--coral-ink); flex: none; }
.alert-row .alert-ic svg { width: 18px; height: 18px; }
.alert-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.alert-row b { font-size: 15px; font-weight: 600; }
.alert-row .alert-sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-row .chev { width: 18px; height: 18px; color: var(--text-3); }
.alert-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.alert-list li { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; line-height: 1.45; }

/* quiet things at the bottom of home */
.home-quiet { display: flex; flex-direction: column; margin-top: 4px; }
.home-quiet:empty { display: none; }
.home-quiet > * + * { border-top: 1px solid var(--border); }
.home-quiet .suggest-card, .quiet-row {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 4px;
  background: transparent; box-shadow: none; border-radius: 0; color: var(--text); cursor: pointer; text-decoration: none;
}
.home-quiet .suggest-card[hidden] { display: none; }
.home-quiet > [hidden] + *, .home-quiet > :first-child { border-top: 0; }
.quiet-row:disabled { opacity: .5; cursor: default; }
.home-quiet .grow, .quiet-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.home-quiet .suggest-card b, .quiet-row .label { font-size: 15px; font-weight: 500; }
.quiet-row .sub { font-size: 13px; color: var(--text-2); }
.home-quiet .suggest-card .count-badge { background: var(--surface-3); color: var(--text-2); }
.quiet-row .chev, .home-quiet .chev-ic { width: 18px; height: 18px; color: var(--text-3); }
.suggest-card:focus-visible, .quiet-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 12px; }

/* iPhone add-to-home-screen hint */
.a2hs { display: flex; align-items: flex-start; gap: var(--sp-3); }
.a2hs .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.a2hs b { font-weight: 500; }
.a2hs .inline-ic { width: 15px; height: 15px; vertical-align: -3px; color: var(--accent-ink); }
.a2hs .link-sm { font-size: 14px; font-weight: 600; color: var(--accent-ink); align-self: flex-start; padding: 6px 0; min-height: var(--tap); display: inline-flex; align-items: center; }
.a2hs-x { margin: -6px 0 0 -8px; color: var(--text-3); flex: none; }

/* ================================================================== avatars */

.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 18px; line-height: 1;
}
.avatar.t1 { background: var(--gold-soft); color: var(--gold-ink); }
.avatar.t2 { background: var(--surface-3); color: var(--text); }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.avatar.lg { width: 60px; height: 60px; font-size: 26px; }

/* ================================================================== time requests */

.request-card { border-radius: var(--radius); padding: 16px; background: var(--surface); box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column; gap: 12px; }
.request-card.compact { padding: 14px; gap: 10px; }
.rq-head { display: flex; align-items: center; gap: 12px; }
.rq-head .grow { flex: 1; min-width: 0; }
.rq-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.rq-when { font-size: 13px; color: var(--text-3); }
.request-card .note, .approve-sheet .note { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; font-size: 15px; color: var(--text); line-height: 1.45; }
.rq-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rq-facts .fact { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.rq-facts .fact-v { font-size: 16px; }
.rq-facts .fact-k { font-size: 12px; }
.rq-factline { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.rq-factline .num { color: var(--text); font-weight: 600; }
.rq-factline .warn { color: var(--warning-ink); }
.rq-factline .sep { color: var(--text-3); }
.request-card.compact .note { font-size: 14px; padding: 6px 10px; }
.request-card .actions { display: flex; gap: 8px; }
.request-card .actions .btn { flex: 1; min-height: var(--tap); }
.request-card .actions .btn.primary { flex: 1.4; }
.request-card.resolved { animation: settle var(--dur) var(--ease); }
@keyframes settle { from { opacity: .6; } to { opacity: 1; } }
.rq-dismiss { display: flex; justify-content: flex-end; margin: -6px 0 -6px; }
.resolution { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.45; }
.resolution > svg { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.resolution .grow { flex: 1; min-width: 0; }
.resolution.approved { background: var(--success-soft); color: var(--success-ink); }
.resolution.denied { background: var(--surface-2); color: var(--text-2); }
.resolution.expired { background: var(--surface-2); color: var(--text-3); }
.resolution .xsmall { opacity: .9; }
.res-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.res-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--text-2); }
.res-tag svg { width: 13px; height: 13px; }
.res-tag.info { background: var(--accent-soft); color: var(--accent-ink); }
.rq-row { align-items: flex-start; }
.rq-row .avatar { margin-top: 2px; }
.rq-row .granted { color: var(--success-ink); font-weight: 500; }
.rq-row .pill { margin-top: 2px; }

/* the approve sheet: amount, facts, explicit over-the-limit step */
.approve-sheet { display: flex; flex-direction: column; gap: 12px; }
.approve-sheet .sheet-head { margin-bottom: 0; }
.approve-sheet .actions { margin-top: 8px; }
.override-box { background: var(--warning-soft); color: var(--warning-ink); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; animation: slideDown var(--dur) var(--ease); }
.ov-head { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.ov-head svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.ov-check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.ov-check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--warning); }
.ov-check span { display: flex; flex-direction: column; line-height: 1.35; }
.ov-check b { font-weight: 600; font-size: 15px; }
.ov-sub { font-size: 13px; color: var(--text-2); }

/* what approving does: "אחרי אישור: עוד 15 דק׳ – עד 22:47" (card and sheet) */
.rq-effect, .approve-result { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; line-height: 20px; }
.rq-effect svg, .approve-result svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.approve-result { font-size: 15px; line-height: 22px; font-weight: 500; }
.approve-result[hidden] { display: none; }
.rq-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pill.rq-old { padding: 1px 8px; font-size: 12px; gap: 4px; }
.pill.rq-old svg { width: 12px; height: 12px; }
.rq-stale { font-size: 14px; line-height: 20px; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 8px 12px; }
.rq-stale b { color: var(--text); font-weight: 600; }
/* amounts: the request, half an hour, an hour, "זמן אחר", "עד שעה מסוימת" */
.option-grid.amounts { grid-template-columns: repeat(3, 1fr); }
.option-grid .amount-more { font-size: 14.5px; line-height: 1.25; }
.amount-extra { display: flex; justify-content: center; padding: 4px 0; }
.amount-extra[hidden] { display: none; }
.amount-stepper output { min-width: 120px; font-size: 18px; }
.until-label { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-2); }
.until-input { width: 132px; min-height: 48px; font-family: var(--font-num); font-variant-numeric: tabular-nums; text-align: center; direction: ltr; }
.until-error { margin: 0; font-size: 14px; line-height: 20px; color: var(--warning-ink); padding-inline-start: 4px; }
.until-error[hidden] { display: none; }
.quick-note { font-size: 14px; }
/* deny: an optional message to the child */
.deny-sheet { display: flex; flex-direction: column; gap: 12px; }
.deny-sheet h2 { margin-bottom: 0; }
.deny-sheet .sheet-sub { margin-bottom: 0; }
.deny-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.deny-presets .chip[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.deny-custom[hidden] { display: none; }
.deny-preview { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-2); padding-inline-start: 4px; }
.deny-sheet .actions { margin-top: 4px; }
.res-msg { margin-top: 4px; }
.rq-msg, .res-msg { overflow-wrap: anywhere; }
/* "בקשות קודמות": filter per child, the last 7 days in one line, the rules of expiry */
.rq-filter { padding-top: 0; }
.rq-summary { margin: 0; padding: 0 4px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.rq-rules { display: flex; gap: 6px; align-items: flex-start; }
.rq-rules svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.rq-empty .btn { margin-top: 4px; }
/* a heading that only receives focus for screen readers (sheets, screens) is not a control: no focus box around it */
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus, h2[tabindex="-1"]:focus-visible { outline: none; }

/* ================================================================== child profile */

.hero { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.hero-head { display: flex; align-items: center; gap: 14px; }
.hero-head .grow { flex: 1; min-width: 0; }
.hero-name { font-size: 24px; line-height: 1.25; font-weight: 700; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hero-body { display: flex; align-items: center; gap: 16px; }
.hero .ring .big { font-size: 32px; }
.hero .ring .lbl { max-width: 56%; }
.hero-facts { flex: 1; min-width: 0; display: grid; gap: 8px; }
.hero-facts .fact { flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 8px; }
.hero-facts .fact + .fact { border-top: 1px solid var(--border); padding-top: 8px; }
.hero-facts .fact-v { font-size: 16px; }
.hero-lines { display: flex; flex-direction: column; gap: 8px; }
.hero-lines:empty { display: none; }
.time-actions { display: flex; flex-direction: column; gap: 12px; }
.ta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ta-grid .btn { min-height: 48px; padding: 0 10px; }
.learning-card { display: flex; flex-direction: column; gap: 0; padding-block: 12px; }
.learn-today { display: flex; align-items: center; gap: 8px; font-size: 14.5px; padding-bottom: 12px; line-height: 1.4; }
.learn-today > svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; }
.learn-today b { font-weight: 600; }
.learn-today .earned-chip { margin-inline-start: auto; }
.subject-row { padding: 12px 0; border-top: 1px solid var(--border); }
.subject-head { display: flex; align-items: center; gap: 12px; }
.subject-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.subject-head .label { font-weight: 600; }
.subject-head .sub { font-size: 13px; color: var(--text-2); }
.subject-acc { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; text-align: end; max-width: 45%; }
.subject-acc b { font-size: 17px; font-weight: 600; }
.subject-acc span { font-size: 12px; color: var(--text-3); }
.learning-card .motivation-stat { border-top: 1px solid var(--border); padding: 12px 0; }
.learning-card .nq-line { margin-top: 4px; }
.empty-inline { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14.5px; }
.empty-inline svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.activity-row .grow { gap: 1px; }
.activity-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-rows .list-row .label { font-weight: 500; }

.tabs { display: flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: 12px; position: sticky; top: calc(var(--safe-top) + 62px); z-index: 5; box-shadow: 0 0 0 4px var(--bg); }
.tabs button { flex: 1; min-height: 40px; border: 0; background: none; border-radius: 10px; font-weight: 500; color: var(--text-2); font-size: 14.5px; transition: background var(--dur-fast), color var(--dur-fast); padding: 0 4px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(27,37,54,.12); }

.save-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); z-index: 6; display: flex; gap: 8px;
  padding: 8px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); animation: slideUp var(--dur) var(--ease);
}
.save-bar .btn { flex: 1; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.progress-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px; min-width: 0; }
.kpi b { display: block; font-size: 20px; font-weight: 600; font-family: var(--font-num); font-variant-numeric: tabular-nums; unicode-bidi: plaintext; }
.kpi span { font-size: 13px; color: var(--text-2); }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .bar-limit { fill: var(--surface-3); }
.chart .bar-used { fill: var(--accent); }
.chart .bar-over { fill: var(--warning); }
.chart .axis { fill: var(--text-3); font-size: 10px; font-family: var(--font); }
.chart .today { fill: var(--accent-ink); font-weight: 700; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; row-gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.legend .lg-used { background: var(--accent); }
.legend .lg-limit { background: var(--surface-3); }
.legend .lg-over { background: var(--warning); }

/* ================================================================== learning journal (history) */

.day-head { position: sticky; top: calc(var(--safe-top) + 56px); z-index: 4; padding: 10px 4px 6px; font-size: 14px; font-weight: 700; color: var(--text-2); background: var(--bg); }
.h-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; text-align: start; width: 100%; border: 0; color: inherit; }
.subj { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.subj svg { width: 24px; height: 24px; }
.subj.reading { background: var(--accent-soft); color: var(--accent-ink); }
.subj.math { background: var(--surface-3); color: var(--text-2); }
.subj.english { background: var(--surface-3); color: var(--text-2); }
.subj.dictation { background: var(--surface-3); color: var(--text-2); }
.subj.sm { width: 36px; height: 36px; border-radius: 10px; }
.subj.sm svg { width: 20px; height: 20px; }
/* "הקראה" / "הכתבה" */
.speech-novoice { background: var(--warning-soft); color: var(--warning-ink); border-radius: 12px; }
.speech-novoice .row { gap: 6px; align-items: center; }
.speech-novoice .hint { color: inherit; }
.english-novoice { background: var(--warning-soft); color: var(--warning-ink); border-radius: 12px; }
.english-novoice .row { gap: 6px; align-items: center; }
.english-novoice .hint { color: inherit; }
/* A switch that works only with another choice ("להקריא מעצמו" in "רק כרמז", listening without the English voice). */
.setting-row[data-disabled="true"] .grow { opacity: .62; }
.nq-dictation p { font-size: 1.1em; }
/* "איך עונים בקריאה" / "מקלדת על המסך" and the read-aloud tip */
.read-aloud-tip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--info-soft); color: var(--info-ink); }
.read-aloud-tip svg { width: 18px; height: 18px; flex: none; }
.read-aloud-tip a { color: inherit; font-weight: 700; text-decoration: underline; }
.h-input { color: var(--text-2); font-size: 13px; }
.h-item .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.h-item .title { font-weight: 700; font-size: 16px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.h-item .meta { font-size: 13.5px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.h-item .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.h-item .reward { font-weight: 600; color: var(--gold-ink); font-family: var(--font-num); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.h-list { display: flex; flex-direction: column; gap: 10px; }

.passage {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px;
  font-family: var(--font-read); font-size: 19px; line-height: 1.85; color: var(--text);
}
.passage h3 { font-family: var(--font-read); font-size: 22px; font-weight: 700; margin-bottom: 10px; line-height: 1.5; }
.passage p { margin: 0 0 12px; text-wrap: pretty; }
.passage p:last-child { margin-bottom: 0; }
.passage .pnum { font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--surface-3); border-radius: 6px; padding: 1px 6px; margin-inline-end: 8px; vertical-align: 3px; }

.q-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.q-head { display: flex; gap: 10px; align-items: flex-start; }
.q-sub { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-inline-start: 38px; margin-top: -4px; }
.q-num { width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; flex: none; font-size: 14px; }
.q-prompt { font-family: var(--font-read); font-size: 18px; font-weight: 700; line-height: 1.6; flex: 1; }
.expr { font-family: var(--mono); font-size: 26px; font-weight: 700; text-align: center; background: var(--surface-2); border-radius: 14px; padding: 12px; direction: ltr; unicode-bidi: isolate; letter-spacing: .02em; }
.opts { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border-strong); border-radius: 14px; padding: 10px 12px; font-family: var(--font-read); font-size: 17px; line-height: 1.5; }
.opt .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-3); font-family: var(--font); font-size: 13px; font-weight: 700; }
.opt .mark svg { width: 16px; height: 16px; }
.opt .txt { flex: 1; }
.opt .tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.opt.correct { border-color: var(--success); background: var(--success-soft); }
.opt.correct .mark { background: var(--success); color: var(--on-success); }
.opt.chosen-wrong { border-color: var(--border-strong); background: var(--surface-3); }
.opt.chosen-wrong .mark { background: var(--text-3); color: var(--surface); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.tl { display: flex; gap: 10px; position: relative; padding-bottom: 12px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; top: 28px; bottom: 0; inset-inline-start: 13px; width: 2px; background: var(--border-strong); border-radius: 1px; }
.tl:last-child::before { display: none; }
.tl .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; z-index: 1; }
.tl .ic svg { width: 16px; height: 16px; }
.tl.ok .ic { background: var(--success); color: var(--on-success); }
.tl.no .ic { background: var(--surface-3); color: var(--text-2); }
.tl.tl-hint .ic { background: var(--gold-soft); color: var(--gold-ink); }
.tl.shown .ic { background: var(--neutral-soft); color: var(--text-2); }
.tl .tx { flex: 1; min-width: 0; font-size: 15px; line-height: 1.5; padding-top: 3px; }
.tl .tx .when { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl .tx .ans { font-weight: 700; }
.tl.tl-hint .tx .htext { display: block; background: var(--gold-soft); border-radius: 10px; padding: 6px 10px; margin-top: 4px; font-family: var(--font-read); }
.explain { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 15px; color: var(--text-2); }
.explain b { color: var(--text); }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-grid .kpi { text-align: center; padding: 10px 6px; }
.summary-grid .kpi b { font-size: 16px; white-space: nowrap; }
.summary-grid .kpi span { font-size: 12px; display: block; line-height: 1.35; }

/* ------------------------------------------------------------------ welcome */

.welcome { min-height: 100dvh; display: flex; flex-direction: column; }
.welcome-hero {
  position: relative; overflow: hidden; color: var(--on-accent); background: var(--btn-primary);
  padding: calc(var(--safe-top) + 48px) 24px 56px; border-radius: 0 0 36px 36px; text-align: center;
}
.welcome-hero .blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); }
.welcome-hero .b1 { width: 260px; height: 260px; top: -110px; inset-inline-start: -80px; }
.welcome-hero .b2 { width: 180px; height: 180px; bottom: -70px; inset-inline-end: -40px; background: rgba(255,255,255,.08); }
.welcome-hero .b3 { width: 12px; height: 12px; top: 38%; inset-inline-end: 22%; background: var(--gold); }
.logo { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 18px; display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(255,255,255,.18); position: relative; }
.logo img { width: 88px; height: 88px; border-radius: 22px; display: block; }
.welcome-hero h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; position: relative; }
.welcome-hero p { font-size: 17px; opacity: .92; margin-top: 8px; position: relative; line-height: 1.5; }
.welcome-body { flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 24px 20px calc(var(--safe-bottom) + 24px); display: flex; flex-direction: column; gap: 16px; }
.feature { display: flex; gap: 14px; align-items: center; }
.feature .fi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.feature .fi svg { width: 22px; height: 22px; }
.feature b { display: block; font-size: 16px; }
.feature span { font-size: 14px; color: var(--text-2); }

.auth-wrap { max-width: 440px; margin: 0 auto; padding-top: 8px; }
.auth-title { font-size: 28px; font-weight: 700; margin: 8px 4px 4px; }

/* pairing */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; line-height: 1.5; }
.steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; flex: none; font-size: 14px; }
.kbd { display: inline-block; background: var(--surface-3); border-radius: 7px; padding: 0 7px; font-weight: 650; font-size: 14.5px; }
.success-mark { width: 84px; height: 84px; border-radius: 50%; margin: 8px auto 4px; display: grid; place-items: center; background: var(--success-soft); color: var(--success-ink); animation: pop var(--dur-reward) var(--ease); }
.success-mark svg { width: 44px; height: 44px; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- weekly summary */
.week-hero { display: flex; flex-direction: column; gap: 12px; }
.week-hero .row { display: flex; align-items: center; gap: 12px; }
.insights { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.insights li { position: relative; padding-inline-start: 18px; font-size: 14.5px; line-height: 1.45; }
.insights li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.kpi .xsmall { margin-top: 4px; }
.delta { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.delta.up { color: var(--success-ink); }
.delta.down { color: var(--text-2); }
.delta.same { color: var(--text-3); font-weight: 500; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.wb-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.wb-val { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; min-height: 15px; }
.wb-area { position: relative; width: 100%; max-width: 34px; height: 120px; }
.wb-area span { position: absolute; bottom: 0; inset-inline: 0; border-radius: 7px; }
.wb-limit { background: var(--surface-3); }
.wb-area .wb-used { background: var(--accent); inset-inline: 5px; transition: height .6s var(--ease); }
.wb-area .wb-used.over { background: var(--warning); }
.wb-day { font-size: 12px; color: var(--text-3); }
.wb-col.today .wb-day { color: var(--accent-ink); font-weight: 700; }
.wb-ch { font-size: 11px; color: var(--gold-ink); min-height: 14px; font-family: var(--font-num); font-weight: 600; }
.acc-row { display: grid; gap: 6px; }
.acc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14.5px; }
.acc-head .value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter.acc { height: 10px; border-radius: 5px; position: relative; overflow: visible; }
.meter.acc > span { border-radius: 5px; }
.meter.acc.good > span { background: var(--accent); }
.meter.acc.mid > span { background: var(--accent); }
.meter.acc.low > span { background: var(--warning); }
.meter.acc .prev { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-inline-start: -1.5px; border-radius: 2px; background: var(--text-2); opacity: .7; }
.weak-card .row { display: flex; align-items: center; gap: 12px; }
/* the parents' cards: highlights, practice, hard questions, comparison; then the numbers behind a <details> */
.wk-card { display: grid; gap: 12px; }
.wk-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin: 0; }
.wk-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.wk-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15.5px; line-height: 1.5; overflow-wrap: anywhere; }
.wk-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.wk-ic svg { width: 16px; height: 16px; }
.wk-calm { margin: 0; font-size: 15.5px; line-height: 1.5; }
.wk-skill { display: grid; gap: 6px; }
.wk-skill + .wk-skill { border-top: 1px solid var(--border); padding-top: 12px; }
.wk-skill-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.wk-tip { display: flex; gap: 8px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--radius-xs); padding: 10px 12px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.wk-tip span[dir="ltr"], .wk-hq-prompt span[dir="ltr"] { white-space: nowrap; } /* an exercise wrapped over two lines loses its order */
.wk-tip-ic { flex: none; color: var(--accent-ink); margin-top: 2px; }
.wk-tip-ic svg { width: 16px; height: 16px; }
.wk-hq-list { display: grid; gap: 10px; }
.wk-hq { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--color-background-2); color: inherit; text-decoration: none; min-width: 0; }
.wk-hq:active { background: var(--surface-3); }
.wk-hq .pill.gray { background: var(--color-surface); } /* the neutral pill would vanish on the inset ground */
.wk-hq-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wk-hq-skill { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-hq-head .chev { width: 18px; height: 18px; color: var(--text-3); flex: none; margin-inline-start: auto; }
.wk-hq-prompt { font-size: 15.5px; font-weight: 650; line-height: 1.5; text-align: start; overflow-wrap: anywhere; }
.wk-hq-expr { font-family: var(--font-num); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; overflow-wrap: anywhere; }
.wk-hq-ans { margin: 0; display: grid; gap: 4px; font-size: 14.5px; }
.wk-hq-ans div { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.wk-hq-ans dt { color: var(--text-2); }
.wk-hq-ans dt::after { content: ":"; }
.wk-hq-ans dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.wk-hq-ans dd.ok { color: var(--success-ink); }
.wk-hq-ans dd.no { color: var(--text-2); }
.wk-hq-out { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.wk-hq-out svg { width: 15px; height: 15px; flex: none; }
.wk-hq-out.later svg { color: var(--success-ink); }
.wk-trend { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--neutral-soft); color: var(--text-2); font-weight: 700; }
.wk-trend svg { width: 16px; height: 16px; }
.wk-trend.down svg { transform: rotate(180deg); }
.wk-details { display: grid; gap: 12px; }
.wk-details-sum { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; list-style: none; }
.wk-details-sum::-webkit-details-marker { display: none; }
.wk-details-sum .grow { flex: 1; min-width: 0; }
.wk-details-sum .chev { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s var(--ease); }
.wk-details[open] > .wk-details-sum .chev { transform: rotate(180deg); }
.wk-details[open] > .wk-details-sum { margin-bottom: 12px; }

/* ===== Usage statistics ("במה שיחק"): categorical series in a fixed order (CVD-checked), "other" in gray ===== */
.usage-card, .usage-report { --s1: #536D96; --s2: #9DB2D3; --s3: #3F927D; --s4: #B77D35; --s5: #8C6F5A; --s-other: #B7C0CC; } /* categorical, slate-led; CVD-distinct by lightness */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .usage-card, :root:not([data-theme="light"]) .usage-report { --s1: #8EA8D0; --s2: #526B91; --s3: #72C3A9; --s4: #E2B574; --s5: #C9A68C; --s-other: #56657B; }
}
:root[data-theme="dark"] .usage-card, :root[data-theme="dark"] .usage-report { --s1: #8EA8D0; --s2: #526B91; --s3: #72C3A9; --s4: #E2B574; --s5: #C9A68C; --s-other: #56657B; }
:is(.usage-card, .usage-report) .c1 { --c: var(--s1); } :is(.usage-card, .usage-report) .c2 { --c: var(--s2); } :is(.usage-card, .usage-report) .c3 { --c: var(--s3); }
:is(.usage-card, .usage-report) .c4 { --c: var(--s4); } :is(.usage-card, .usage-report) .c5 { --c: var(--s5); } :is(.usage-card, .usage-report) .c0 { --c: var(--s-other); }
.usage-summary { font-size: 13px; color: var(--text-2); }
.usage-list { display: grid; gap: 12px; }
.usage-row { display: grid; gap: 5px; }
.usage-row .acc-head .label { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.usage-row .kind { font-size: 12px; color: var(--text-3); font-weight: 500; }
.usage-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; min-width: 4px; border-radius: 5px; background: var(--c); transition: width .6s var(--ease); }
.usage-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.ud-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.ud-val { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; min-height: 15px; white-space: nowrap; }
.ud-area { display: flex; flex-direction: column-reverse; width: 100%; max-width: 30px; height: 120px; border-bottom: 1px solid var(--border-strong); }
.ud-area > span { display: block; width: 100%; background: var(--c); border-radius: 4px; margin-top: 2px; }
.ud-day { font-size: 12px; color: var(--text-3); }
.ud-col.today .ud-day { color: var(--accent-ink); font-weight: 700; }
.usage-card .legend { flex-wrap: wrap; row-gap: 6px; }
.usage-card .legend i { background: var(--c); }

/* ===== "הצעות לשיפור" (home card + list) and "ייצוא נתונים לשיפור" ===== */
.suggest-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.suggest-card .grow { flex: 1; min-width: 0; }
.count-badge { min-width: 24px; height: 24px; border-radius: 12px; padding: 0 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 13px; font-family: var(--font-num); }
.suggest-item { display: flex; flex-direction: column; gap: 8px; }
.suggest-head { display: flex; gap: 6px; flex-wrap: wrap; }
.suggest-title { margin: 0; font-size: 17px; line-height: 1.35; }
.suggest-text { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.suggest-advice { margin: 0; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.suggest-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.suggest-actions .btn.primary { flex: 1 1 100%; }
.recent-list li { background: var(--surface-2); display: flex; align-items: center; gap: 10px; }
.recent-list li > .grow { flex: 1; min-width: 0; }
.toast-action { flex: none; margin-inline-start: 4px; min-height: 36px; padding: 6px 12px; border-radius: var(--radius-sm); border: 0; background: color-mix(in srgb, var(--color-toast-text) 16%, transparent); color: var(--color-toast-text); font: inherit; font-weight: 600; cursor: pointer; }
.improve-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.improve-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; }
.improve-list svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.improve-list.included svg { color: var(--success-ink); }
.improve-list.excluded svg { color: var(--text-3); }

/* ===== "איפה חזק ואיפה כדאי לחזק" (learner profile card on the child's learning tab) ===== */
.profile-card .profile-summary p { margin: 0; line-height: 1.5; color: var(--text-2); }
.profile-card .profile-summary { display: grid; gap: 4px; }
.skill-list { display: grid; gap: 14px; }
.skill-row { display: grid; gap: 5px; }
.skill-row .label { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.skill-tags { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.skill-row .pill { font-size: 12px; padding: 2px 8px; }
.trend { font-size: 12px; font-weight: 700; white-space: nowrap; }
.trend.up { color: var(--success-ink); }
.trend.down { color: var(--text-2); }
.trend.steady { color: var(--text-3); }
.meter.acc.skill { height: 8px; }
.meter.acc.skill.ok > span { background: var(--accent); }
.meter.acc.skill.good > span { background: var(--accent); }
.meter.acc.skill.mid > span { background: var(--warning); }
.meter.acc.skill.none > span { background: var(--border-strong); }
.profile-advice { border-radius: 14px; padding: 10px 12px; }
.profile-advice.practice { background: var(--warning-soft); }
.profile-advice.strong { background: var(--success-soft); }
.profile-advice .advice-title { font-weight: 700; font-size: 14.5px; }
.profile-advice.practice .advice-title { color: var(--warning-ink); }
.profile-advice.strong .advice-title { color: var(--success-ink); }
.profile-advice ul { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 6px; }
.profile-advice li { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.focus-block .chip { font-size: 13.5px; }
.focus-block .segmented { flex-wrap: wrap; }
.focus-skills { display: grid; gap: 10px; margin-top: 6px; }

/* ------------------------------------------------------------------ "השאלה הבאה" (next-question.js) */

.nq-line {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px;
  min-height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 14px; line-height: 1.4; cursor: pointer;
}
.nq-line:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.nq-line > svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.nq-line .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nq-title { font-weight: 700; font-size: 16px; }
.nq-text p { margin: 0 0 6px; line-height: 1.6; }
.nq-text.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nq-text.clamped p { display: inline; margin: 0; }
.nq-text.clamped p + p::before { content: " "; }
.nq-question { font-size: 16px; line-height: 1.5; }
.nq-expr { font-size: 22px; font-weight: 700; margin-top: 4px; }
.nq-options { margin: 6px 0 0; padding-inline-start: 22px; color: var(--text-2); font-size: 14.5px; }
.nq-answer { padding: 10px 12px; border-radius: 12px; background: var(--success-soft); color: var(--text); display: grid; gap: 6px; }
.nq-steps { margin: 0; padding-inline-start: 22px; font-size: 14.5px; }
.nq-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nq-actions .btn { flex: 1 1 180px; min-width: 0; }
.nq-topics { gap: 8px; }
.nq-topics .chip[disabled] { opacity: .45; }

/* "תחומי עניין" (views/interests.js) */
.interest-chips { gap: 8px; }
.interest-chips .chip[disabled] { opacity: .45; }
.interest-own { padding-inline-end: 4px; }
.interest-own bdi { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.chip-x { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: inherit; background: transparent; border: 0; }
.chip-x:focus-visible { outline: 2px solid var(--accent); }
.interest-count { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 22px; }
.interest-count svg { width: 16px; height: 16px; }
.hint.error { color: var(--coral-ink, var(--coral-solid)); }
.interest-note a { color: var(--accent-ink); font-weight: 600; }

/* "ספרי לימוד" (views/textbooks.js) */
.textbook-card .card-title { display: flex; align-items: center; gap: 6px; }
.textbook-card .card-title svg { width: 18px; height: 18px; }
.tb-ai { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--success-soft); color: var(--success-ink); }
.tb-ai.warn { background: var(--warning-soft); color: var(--warning-ink); }
.tb-ai svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.tb-ai a { color: var(--accent-ink); font-weight: 600; }
.tb-status:empty { display: none; }
.tb-job { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; }
.tb-job.done { background: var(--success-soft); color: var(--success-ink); }
.tb-job.failed { background: var(--warning-soft); color: var(--warning-ink); }
.tb-job svg { width: 18px; height: 18px; flex: none; }
.tb-job .spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
.tb-pages { display: flex; flex-direction: column; gap: 10px; }
.tb-page { display: flex; align-items: flex-start; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.tb-page .grow { min-width: 0; }
.tb-page .sub { overflow-wrap: anywhere; }
.tb-note { display: flex; gap: 4px; align-items: flex-start; color: var(--warning-ink); }
.tb-note svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.tb-steps { margin: 0; padding-inline-start: 20px; line-height: 1.7; }

/* "מוטיבציה" (views/motivation.js) */
.motivation-card .kpi b { display: flex; align-items: center; gap: 4px; }
.motivation-card .kpi b svg, .motivation-stat svg { width: 16px; height: 16px; color: var(--gold-ink); vertical-align: -2px; }
.motivation-card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.goal-block { display: grid; gap: 6px; }
.meter.goal { height: 10px; border-radius: 5px; }
.meter.goal > span { border-radius: 5px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.badge { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; opacity: .6; min-width: 0; }
.badge.on { opacity: 1; background: var(--accent-soft); }
.badge-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); }
.badge.on .badge-ic { background: var(--gold); color: var(--on-gold); }
.badge-ic svg { width: 20px; height: 20px; }
.badge-name { font-size: 13px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.badge-sub { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* "גיבוי ושחזור" */
.bk-details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.bk-details[open] summary { margin-bottom: 10px; }
.bk-details .improve-list + .improve-list { margin-top: 12px; }
.bk-rules { margin: 0; padding-inline-start: 20px; line-height: 1.7; }
.bk-row { align-items: flex-start; }
.bk-row .grow { min-width: 0; }
.bk-row .sub { overflow-wrap: anywhere; }
.bk-progress:empty { display: none; }
/* ------------------------------------------------------------------ onboarding step indicator */

.setup-steps { list-style: none; margin: 0 0 4px; padding: 0 4px; display: flex; align-items: flex-start; gap: 0; counter-reset: none; }
.setup-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; font-size: 13px; color: var(--text-3); font-weight: 650; text-align: center; }
.setup-steps li + li::before { content: ""; position: absolute; top: 14px; inset-inline-end: calc(50% + 18px); inset-inline-start: calc(-50% + 18px); height: 2px; border-radius: 1px; background: var(--border-strong); }
.setup-steps li.done + li::before, .setup-steps li.done + li.done::before { background: var(--accent); }
.setup-steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.setup-steps .n svg { width: 16px; height: 16px; }
.setup-steps li.active { color: var(--text); }
.setup-steps li.active .n { background: var(--btn-primary); color: var(--on-accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.setup-steps li.done { color: var(--text-2); }
.setup-steps li.done .n { background: var(--accent-soft); color: var(--accent-ink); }


/* ================================================================== sheets */

.backdrop { position: fixed; inset: 0; z-index: 50; background: var(--color-scrim); opacity: 0; transition: opacity var(--dur) var(--ease); }
.backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 51; inset-inline: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
  padding: 6px calc(20px + var(--safe-right)) calc(var(--safe-bottom) + 20px) calc(20px + var(--safe-left));
  transform: translateY(105%); transition: transform var(--dur) var(--ease), bottom var(--dur-fast) var(--ease);
  overscroll-behavior: contain;
}
.sheet.open { transform: none; }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 14px; }
.sheet h2 { font-size: 20px; line-height: 26px; font-weight: 700; margin-bottom: 4px; }
.sheet .sheet-sub { color: var(--text-2); font-size: 14.5px; margin-bottom: 16px; line-height: 1.5; }
.sheet .sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet .sheet-head .grow { flex: 1; min-width: 0; }
.sheet .sheet-head h2 { margin-bottom: 0; }
.sheet .sheet-head .sheet-sub { margin-bottom: 0; }
.sheet .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.sheet .field-label { display: block; margin-bottom: 8px; }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: 20px; transform: translateY(-46%) scale(.98); opacity: 0; transition: transform var(--dur) var(--ease), opacity var(--dur-fast); max-width: 480px; padding-bottom: 20px; }
  .sheet.open { transform: translateY(-50%); opacity: 1; }
}
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.option-grid button { min-height: 56px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 15px; transition: background var(--dur-fast), border-color var(--dur-fast); padding: 4px; }
.option-grid button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.option-grid button small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.option-grid button[aria-checked="true"] small { color: var(--accent-ink); }
.time-sheet .quick { grid-template-columns: repeat(4, 1fr); margin-bottom: 10px; }
.time-sheet .time-opt { min-height: 64px; flex-direction: column; gap: 0; border-radius: 14px; }
.time-sheet .time-opt .num { font-size: 22px; font-weight: 600; line-height: 1.1; }
.time-sheet .time-opt small { font-size: 12px; font-weight: 500; opacity: .85; }
.time-sheet .btn.block.secondary { margin-top: 12px; }
.time-sheet .actions { margin-top: 12px; }
.alerts-sheet .alert-list { margin-top: 4px; }

/* ================================================================== toast */

.toast-host { position: fixed; z-index: 60; top: calc(var(--safe-top) + 10px); inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 12px 16px; border-radius: 14px;
  background: var(--color-toast); color: var(--color-toast-text); font-size: 15px; font-weight: 500; box-shadow: var(--shadow-lg); pointer-events: auto;
  animation: toastIn var(--dur) var(--ease); line-height: 1.4;
}
.toast .toast-ic { display: grid; place-items: center; flex: none; }
.toast svg { width: 20px; height: 20px; }
.toast.ok svg { color: #72C3A9; }
.toast.info svg { color: #A0B9DE; }
.toast.err svg { color: #ED9399; }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ================================================================== skeleton, empty, pull to refresh */

.skel { background: var(--surface-3); border-radius: 10px; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.skel.circle { border-radius: 50%; }
.skel.line { height: 14px; }
.child-card.skeleton .cc-head .stack-sm { flex: 1; }

.empty { text-align: center; padding: 40px 24px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty.compact { padding: 24px 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty .art { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); margin-bottom: 4px; }
.empty .art svg { width: 28px; height: 28px; stroke-width: 1.8; }
.empty b { color: var(--text); font-size: 17px; font-weight: 600; }
.empty .empty-text, .empty .small { font-size: 14.5px; max-width: 34ch; line-height: 1.5; }
.empty .btn { margin-top: 8px; }
.boot-error { min-height: 80dvh; justify-content: center; }

.ptr { height: 0; overflow: visible; display: flex; justify-content: center; position: relative; z-index: 3; }
.ptr .ptr-spin { position: absolute; top: -8px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-lg); display: grid; place-items: center; color: var(--accent); opacity: 0; transform: translateY(-20px); }
.ptr .ptr-spin svg { width: 20px; height: 20px; }
.ptr.active .ptr-spin { opacity: 1; }
.ptr.loading .ptr-spin svg { animation: spin .8s linear infinite; }

.code-box { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; word-break: break-all; user-select: all; -webkit-user-select: all; text-align: left; }
.audit-item { display: flex; gap: 12px; padding: 12px 16px; position: relative; }
.audit-item + .audit-item::before { content: ""; position: absolute; top: 0; inset-inline: 16px; border-top: 1px solid var(--border); }
.audit-item .when { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.inline-ic { width: 16px; height: 16px; vertical-align: -3px; }
.sas { font-family: var(--font-num); font-size: 40px; font-weight: 600; letter-spacing: .12em; direction: ltr; unicode-bidi: isolate; background: var(--accent-soft); color: var(--accent-ink); border-radius: 16px; padding: 14px 8px; margin: 4px 0; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .icon-btn.spin svg, .btn.loading::after, .ptr.loading .ptr-spin svg, .tb-job .spinner { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  .skel { animation: none !important; }
  .view, .view.back { animation-name: fadeIn !important; }
}


/* "אין קול עברי במחשב" (views/speech.js): a small icon next to the title, the steps under it */
.speech-novoice { display: grid; gap: 6px; }
.speech-novoice .row { display: flex; align-items: center; gap: 8px; }
.speech-novoice .row svg { width: 18px; height: 18px; flex: none; }
.speech-novoice .row b { flex: 1; min-width: 0; }
