/* ================================================================= */
/* 🌐 אפיון שפת הבסיס - ווידג'טים תלת ממדיים מוארים (iOS Layout) */
/* ================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

:root { 
    --bg: #f2f4f8; 
    --text: #1f2937;
    --admin: #5c6bc0;
    --max-width: 1100px;

    /* Design tokens (v4 step 4). Literal values live only here; values equal the pre-token look. */
    --surface: #fff;
    --surface-2: #f1f3f5;
    --ink: #2c3e50;
    --line: #cfd8dc;
    --muted: #546e7a;
    --muted-2: #78909c;
    --muted-3: #90a4ae;
    --ok: #4caf50;
    --danger: #c62828;
    --primary: #1976d2;
    /* Kid colours (defaults = Kids sheet defaults; app.js overrides from the Kids data via ThemeLogic) */
    --kid-itay: #3b82f6;
    --kid-yuval: #f43f5e;
    --kid-amit: #ff9800;
    --r-xs: 10px;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 24px;
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-6: 24px;
    /* Type scale per area; ThemeLogic.sizeTokens sets these from the Display settings (M = 1rem = today). */
    --fs-home: 1rem;
    --fs-kid: 1rem;
    --fs-parents: 1rem;

    --font-kid: 'Assistant', sans-serif;
    --kid-accent: var(--ok);
    --kid-card-bg: var(--surface);
    --kid-border-radius: var(--r-lg);
    --kid-shadow: 0 10px 25px rgba(0, 0, 0, 0.04), inset 0 1.5px 0 rgba(255,255,255,0.8);
    
    --widget-blur: blur(12px);
    --widget-bg: rgba(255, 255, 255, 0.45);
    --widget-border: 1px solid rgba(255, 255, 255, 0.4);
}

body.kid-itay {
    --bg: #090d16;
    --text: #f1f5f9;
    --font-kid: 'Orbitron', sans-serif;
    --kid-accent: var(--kid-itay); /* עודכן לכחול כדי שיתאים לתגית היומן */
    --kid-card-bg: #141a29;
    --kid-border-radius: var(--r-md); 
    --kid-shadow: 0 0 15px rgba(59, 130, 246, 0.12), inset 0 1px 1px rgba(255,255,255,0.05);
    --widget-bg: rgba(20, 26, 41, 0.35);
    --widget-border: 1px solid rgba(59, 130, 246, 0.1);
    background-image: radial-gradient(circle, #1a2333 1px, transparent 1px);
    background-size: 30px 30px;
}

body.kid-yuval {
    --bg: #faf6ff;
    --text: #4c1d95;
    --font-kid: 'Assistant', sans-serif;
    --kid-accent: var(--kid-yuval); 
    --kid-card-bg: rgba(255, 255, 255, 0.95);
    --kid-border-radius: 28px; 
    --kid-shadow: 0 12px 28px rgba(244, 63, 94, 0.05), inset 0 1.5px 0 var(--surface);
    --widget-bg: rgba(255, 255, 255, 0.5);
    --widget-border: 1px solid rgba(244, 63, 94, 0.1);
    background-image: radial-gradient(#fbcfe8 1px, transparent 1px);
    background-size: 20px 20px;
}

body.kid-עמית {
    --bg: #fffbeb; 
    --text: #78350f;
    --font-kid: 'Fredoka One', cursive; 
    --kid-accent: var(--kid-amit); 
    --kid-card-bg: var(--surface);
    --kid-border-radius: 32px; 
    --kid-shadow: 0 10px 0px rgba(255, 152, 0, 0.12), 0 4px 10px rgba(0,0,0,0.02); 
    --widget-bg: rgba(255, 255, 255, 0.7);
    --widget-border: 2.5px solid var(--kid-amit);
    background-image: radial-gradient(#fde68a 1.5px, transparent 1.5px);
    background-size: 25px 25px;
}

body {
    font-family: var(--font-kid);
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 15px;
    user-select: none;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.dynamic-bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

.main-container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding-bottom: 90px; }

.sticky-nav { 
    position: sticky; 
    top: 0; 
    background-color: var(--bg); 
    z-index: 100; 
    padding-bottom: 14px; 
    border-bottom: 2px solid rgba(0,0,0,0.04); 
    margin-bottom: 15px;
    transition: background-color 0.4s ease;
}

.utility-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
    padding: 5px; 
    direction: ltr !important; 
}

.icon-btn { font-size: calc(var(--fs-kid) * 1.5); color: var(--muted-2); cursor: pointer; padding: 5px; }

/* Screens (router.js): the hidden screen is removed from layout. */
.screen-hidden { display: none !important; }
#home-screen { height: calc(100dvh - 30px); width: 100%; box-sizing: border-box; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--sp-3); padding: 12px 16px; overflow: hidden; text-align: center; }
.home-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; font-size: 1rem; margin: 0; }
.home-header { display: flex; align-items: center; gap: var(--sp-4); width: 100%; }
.home-clock { font-size: calc(var(--fs-home) * 2.6); font-weight: 800; direction: ltr; }
.home-header-text { flex: 1; text-align: start; }
.home-date { font-weight: 600; }
.home-weather { opacity: 0.85; font-size: max(1rem, calc(var(--fs-home) * 0.95)); }
.home-stale { font-size: max(1rem, calc(var(--fs-home) * 0.75)); opacity: 0.7; border: 1px solid currentColor; border-radius: var(--r-xs); padding: 2px 8px; }
.home-parents-btn { min-height: 56px; min-width: 56px; padding: 0 18px; border: 2px solid var(--line, #ccc); border-radius: var(--r-sm); background: var(--surface, #fff); font-size: max(1rem, calc(var(--fs-home) * 1.1)); font-weight: 700; cursor: pointer; }
.home-panel { background: rgba(255,255,255,0.85); border-radius: 18px; padding: 8px 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); text-align: start; min-width: 0; }
.home-panel-title { font-size: max(1rem, calc(var(--fs-home) * 1.1)); margin: 0 0 6px; }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list li { padding: 3px 0; }
.home-add-btn { font-size: 1rem; margin-top: 6px; min-height: 48px; padding: 6px 14px; border-radius: var(--r-sm); border: 1px solid #ccc; background: var(--surface); }
.home-card-bar { display: block; direction: rtl; width: 100%; height: 12px; background: rgba(0,0,0,0.12); border-radius: 6px; overflow: hidden; }
.home-card-head { display: flex; flex-direction: column; gap: var(--sp-1); align-items: center; padding: 10px 12px 6px; }
.home-card-name { font-size: calc(var(--fs-home) * 1.4); font-weight: 800; }
.home-card-progress { font-size: calc(var(--fs-home) * 1.2); font-weight: 700; }
.home-card-next { font-size: 1rem; opacity: 0.8; }
.home-card-tasks { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 6px 12px 10px; }
.home-task-row { display: flex; align-items: center; gap: 10px; min-height: 56px; direction: rtl; text-align: start; }
.home-tick { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--ok); background: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0; }
.home-task-row.is-done .home-tick { background: var(--ok); color: #fff; }
.home-task-row.is-done .home-task-name { opacity: 0.55; text-decoration: line-through; }
.home-task-name { font-size: 1.25rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.home-more { min-height: 48px; min-width: 48px; border-radius: var(--r-sm); border: 2px dashed currentColor; background: transparent; font-size: 1.25rem; font-weight: 800; cursor: pointer; }
.home-band { max-height: 30dvh; overflow: hidden; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home-band-top { display: flex; gap: 8px; }
.home-band-top > * { flex: 1 1 0; min-width: 0; }
.home-band-panels { display: flex; flex-direction: row; gap: 8px; min-height: 0; overflow: hidden; }
.home-band-panels > * { flex: 1 1 0; min-width: 0; }
.home-card-fill { display: block; height: 100%; margin-inline-start: 0; background: var(--ok); }
.home-card-meta { font-size: max(1rem, calc(var(--fs-home) * 0.9)); font-weight: 600; }
.home-motto { margin: 0; padding: 0; border: 0; font-size: 1rem; }
.home-motto p { margin: 0; font-size: 1rem; }
html.home-night #home-screen { opacity: 0.55; }
.home-kids { display: flex; flex-direction: row; direction: rtl; gap: 14px; width: 100%; min-height: 0; }
.home-kids > * { flex: 1 1 0; min-width: 0; }
@media (max-width: 600px) { .home-kids { flex-direction: column; overflow: hidden; } }
.home-kid-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; font-size: calc(var(--fs-home) * 1.5); font-weight: 800; padding: 0; border-radius: var(--r-lg); border: none; background: white; box-shadow: 0 4px 14px rgba(0,0,0,0.1); cursor: pointer; }
button.home-kid-card { padding: 22px; justify-content: center; align-items: center; }

h2#date-display { 
    font-size: max(1rem, calc(var(--fs-kid) * 1.05));
    opacity: 0.6; 
    margin: 0; 
    text-align: center; 
    flex-grow: 1; 
    font-weight: 800; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; 
    direction: rtl !important;
}

.weather-inline-tag {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-weight: 800;
    color: var(--text);
}

.btn-group { display: flex; gap: var(--sp-2); width: 100%; margin: 10px auto; direction: ltr !important; }

#kid-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 600px;
    z-index: 1000;
    background: var(--widget-bg);
    backdrop-filter: var(--widget-blur);
    -webkit-backdrop-filter: var(--widget-blur);
    padding: 10px;
    border-radius: 30px;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    border: var(--widget-border);
}

button {
    flex: 1; 
    padding: 14px 5px; 
    border-radius: var(--kid-border-radius); 
    border: 1px solid rgba(0,0,0,0.06); 
    background: var(--kid-card-bg);
    color: var(--text);
    font-weight: 800; 
    font-family: var(--font-kid);
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; justify-content: center; gap: 5px; direction: initial;
    box-shadow: var(--kid-shadow);
}
button:active { transform: scale(0.96); }

.calendar-nav-btn {
    background: rgba(0,0,0,0.03) !important;
    border: 1px dashed rgba(0,0,0,0.15) !important;
    color: var(--text) !important;
    box-shadow: none !important;
    flex: 0.8;
}
body.kid-itay .calendar-nav-btn {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.routine-btn {
    flex-direction: column;
    gap: 2px;
    padding: 12px 5px;
}

#kid-nav button.active { background: var(--kid-accent) !important; color: white !important; border-color: var(--kid-accent) !important; }
.routine-btn.active { background: var(--admin) !important; color: white !important; border-color: var(--admin) !important; }
.avatar-icon { font-size: calc(var(--fs-kid) * 1.2); margin-left: 4px; }

/* ================================================================= */
/* 🔋 עיצוב ה-Power Meter המשחקי */
/* ================================================================= */
.power-meter-wrapper { width: 100%; max-width: var(--max-width); margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.power-meter-status { display: flex; align-items: center; gap: var(--sp-2); padding: 0 4px; }
.status-emoji-bounce { font-size: calc(var(--fs-kid) * 1.3); animation: emojiBounce 1s infinite alternate cubic-bezier(0.455, 0.03, 0.515, 0.955); }
@keyframes emojiBounce { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.status-text-tag { font-size: calc(var(--fs-kid) * 0.9); font-weight: 800; opacity: 0.8; }

.progress-track-wrapper { width: 100%; height: 10px; background: rgba(0, 0, 0, 0.06); border-radius: 50px; overflow: hidden; position: relative; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); }
body.kid-itay .progress-track-wrapper { background: rgba(255,255,255,0.08); }
.progress-fill-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--kid-accent), #a3e635); border-radius: 50px; transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
body.kid-itay .progress-fill-bar { background: linear-gradient(90deg, var(--kid-itay), #00f0ff); box-shadow: 0 0 12px var(--kid-accent); }

/* ================================================================= */
/* 🍏 המהפכה הא-סימטרית: פתק צד ימין, לו"ז צד שמאל - ללא חפיפות */
/* ================================================================= */
.info-fluid-row { 
    display: grid; 
    grid-template-columns: 1fr;
    gap: 20px; 
    width: 100%; 
    margin: 10px auto 20px auto; 
}
@media screen and (min-width: 768px) {
    .info-fluid-row { 
        grid-template-columns: 1fr 1fr;
        align-items: start; 
    }
}

.avatar-speech-bubble {
    display: none;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    position: relative;
}
.bubble-avatar-wrapper { width: 48px; height: 48px; background: var(--kid-card-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--kid-shadow); font-size: calc(var(--fs-kid) * 1.6); flex-shrink: 0; border: 1px solid rgba(0,0,0,0.04); }
.bubble-content-text { background: var(--widget-bg); backdrop-filter: var(--widget-blur); -webkit-backdrop-filter: var(--widget-blur); border: var(--widget-border); border-radius: 20px; padding: 14px 18px; box-shadow: var(--kid-shadow); position: relative; transform: rotate(-0.5deg); flex-grow: 1; }
.bubble-content-text::before { content: ""; position: absolute; top: 15px; right: -8px; border-width: 8px 0 8px 8px; border-style: solid; border-color: transparent transparent transparent rgba(255,255,255,0.4); pointer-events: none; }
body.kid-itay .bubble-content-text::before { border-color: transparent transparent transparent rgba(20, 26, 41, 0.35); }
.bubble-header-label { font-size: calc(var(--fs-kid) * 0.75); font-weight: 800; opacity: 0.4; margin-bottom: 4px; }
.bubble-text-main { font-size: calc(var(--fs-kid) * 1.15); font-weight: 800; line-height: 1.3; white-space: pre-wrap; }

.floating-timeline-container {
    display: none;
    flex-direction: column;
    width: 100%;
}
.timeline-top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 4px; }
.timeline-title { font-size: calc(var(--fs-kid) * 0.75); font-weight: 800; opacity: 0.4; text-transform: uppercase; }
.timeline-stack { display: flex; flex-direction: column; gap: var(--sp-2); position: relative; padding-right: 4px; }

.calendar-badge-mini { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); background: var(--widget-bg); backdrop-filter: var(--widget-blur); -webkit-backdrop-filter: var(--widget-blur); border: var(--widget-border); border-radius: var(--r-sm); padding: 4px 10px; min-width: 60px; box-shadow: var(--kid-shadow); }

/* צבע הטקסט ביומן הקטן שואב כעת ישירות מהצבע האישי של הילד! (כחול, ורוד, כתום) */
.calendar-badge-dayname { font-size: calc(var(--fs-kid) * 0.7); font-weight: 900; color: var(--kid-accent); }
.calendar-badge-num { font-size: calc(var(--fs-kid) * 0.95); font-weight: 900; color: var(--text); }
.event-item { display: flex; align-items: center; padding: 2px 0; border-bottom: none !important; }
.event-text-content-wrap { font-weight: 800; padding: 0 12px; font-size: calc(var(--fs-kid) * 1.05); color: var(--text); opacity: 0.9; display: flex; align-items: center; gap: var(--sp-2);}

/* עיצוב לאירועי היום! */
.event-item.is-today, .event-card-premium.is-today { background: rgba(255, 235, 59, 0.2); border-radius: var(--r-sm); border: 1.5px dashed #fbc02d; padding: 4px; }
body.kid-itay .event-item.is-today { background: rgba(255, 255, 0, 0.1); border-color: yellow; }
.calendar-badge-mini.is-today { background: #fffde7; border-color: #fdd835; }
.today-tag { font-size: calc(var(--fs-kid) * 0.75); font-weight: 900; color: #d84315; background: #ffcc80; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
body.kid-itay .today-tag { color: #000; background: yellow; }

/* ================================================================= */
/* 💎 גריד משימות יציב ומסך 'סיימת הכל' */
/* ================================================================= */
#task-list { 
    display: grid; 
    grid-template-columns: 1fr;
    gap: 15px; 
    width: 100%;
}
@media screen and (min-width: 768px) {
    #task-list { grid-template-columns: 1fr 1fr; }
}

.card { 
    background: var(--kid-card-bg); 
    padding: 18px 22px; 
    border-radius: var(--kid-border-radius); 
    display: flex; align-items: center; justify-content: space-between; 
    box-shadow: var(--kid-shadow); 
    min-height: 72px; 
    border: 1px solid rgba(0,0,0,0.03); 
    cursor: pointer; 
    position: relative;
    width: 100%;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, filter 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.card:active { transform: scale(0.96) translateY(1.5px); }
.card .speak-btn { position: absolute; top: 6px; inset-inline-end: 6px; }
.speak-btn { border: 0; background: #e3f2fd; border-radius: 50%; width: 44px; height: 44px; min-width: 44px; font-size: calc(var(--fs-kid) * 1.4); cursor: pointer; line-height: 1; }
.speak-btn:active { background: #bbdefb; }

.card.is-completed { 
    opacity: 0.85 !important; 
    filter: none !important; 
    background: #f0fdf4; 
    border: 2px solid var(--ok); 
    transform: scale(0.95); 
}
.card.is-completed .task-label span:first-child { text-decoration: none; color: var(--ok); opacity: 1; }

body.kid-itay .card.is-completed { background: rgba(59, 130, 246, 0.08); border-color: var(--kid-itay); }
body.kid-itay .card.is-completed .task-label span:first-child { color: var(--kid-itay); }

body.kid-yuval .card.is-completed { background: #fff0f2; border-color: var(--kid-yuval); }
body.kid-yuval .card.is-completed .task-label span:first-child { color: var(--kid-yuval); }

body.kid-עמית .card.is-completed { background: #fff8e1; border-color: var(--kid-amit); }
body.kid-עמית .card.is-completed .task-label span:first-child { color: var(--kid-amit); }

.check { 
    width: 65px; 
    height: 65px; 
    border-radius: 50%; 
    border: 2.5px solid rgba(0,0,0,0.08); 
    display: flex; align-items: center; justify-content: center; 
    font-size: calc(var(--fs-kid) * 2); 
    flex-shrink: 0; background: var(--surface); 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
body.kid-itay .check { background: #141a29; border-color: rgba(255,255,255,0.1); }
.check.done { background: linear-gradient(135deg, var(--kid-accent), #a3e635) !important; color: white !important; border-color: transparent !important; transform: scale(1.06); }
body.kid-itay .check.done { background: linear-gradient(135deg, var(--kid-itay), #00f0ff) !important; box-shadow: 0 0 12px var(--kid-accent); }

.timestamp { font-size: calc(var(--fs-kid) * 0.8); font-weight: 800; background: rgba(0,0,0,0.05); color: var(--text); padding: 4px 10px; border-radius: var(--r-sm); margin: 0 6px; }
.task-label { display: flex; align-items: center; gap: 14px; font-size: calc(var(--fs-kid) * 1.25); font-weight: 800; }

.task-label span:last-child { 
    font-size: calc(var(--fs-kid) * 3); 
    transition: transform 0.2s; 
}
.card:hover .task-label span:last-child { transform: scale(1.15) rotate(5deg); }
.card.toggle-error { border-color: #ef9a9a; background: #fff8f8; }

/* עיצוב באנר סיום משימות */
.all-done-banner { background: var(--kid-card-bg); border-radius: var(--kid-border-radius); box-shadow: var(--kid-shadow); border: 2px dashed var(--kid-accent); padding: 40px 20px; text-align: center; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.all-done-icon { font-size: calc(var(--fs-kid) * 5); animation: tada 1s ease infinite alternate; }
@keyframes tada { from { transform: scale(1) rotate(-5deg); } to { transform: scale(1.1) rotate(5deg); } }
.show-tasks-btn { background: rgba(0,0,0,0.05); border: none; padding: 10px 20px; border-radius: var(--r-sm); font-weight: 800; cursor: pointer; margin-top: 15px; color: var(--text); }
.completed-tasks-wrapper { display: grid; gap: 15px; grid-template-columns: 1fr; width: 100%; margin-top: 20px; }
@media screen and (min-width: 768px) { .completed-tasks-wrapper { grid-template-columns: 1fr 1fr; } }

.footer-motto { margin-top: 50px; padding: 30px 10px; border-top: 1px solid rgba(0,0,0,0.04); text-align: center; width: 100%; }
.motto-primary { font-size: calc(var(--fs-kid) * 1.2); font-weight: 800; color: #607d8b; margin: 0 0 8px 0; }
.motto-secondary { font-size: calc(var(--fs-kid) * 0.9); color: var(--muted-3); font-style: italic; margin: 0; }

#completion-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.96); z-index: 1000; flex-direction: column; align-items: center; justify-content: center; }
body.kid-itay #completion-overlay { background: rgba(9, 13, 22, 0.96); }

#admin-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; z-index: 2000; padding: 40px 20px; overflow-y: auto; color: var(--ink); }
.admin-form { display: flex; flex-direction: column; gap: 10px; margin: 20px auto; width: 100%; max-width: 500px; }

/* Parents area shell (plan step 14): side menu on tablet, bottom tabs on phone */
.parents-shell { display: flex; flex-direction: row; gap: 20px; max-width: 1100px; margin: 0 auto; min-height: 100%; }
#parents-menu { display: flex; flex-direction: column; gap: var(--sp-2); width: 210px; flex-shrink: 0; }
.parents-title { color: var(--admin); text-align: center; margin: 0 0 8px; }
.parents-content { flex: 1; min-width: 0; }
.parents-tab { display: flex; align-items: center; gap: 10px; padding: 14px; border: none; border-radius: var(--r-md); background: var(--surface-2); font-family: inherit; font-size: max(1rem, calc(var(--fs-parents) * 1)); font-weight: 700; color: var(--ink); cursor: pointer; text-align: start; }
.parents-tab.active { background: var(--admin); color: white; }
.parents-lock-btn { margin-top: 12px; background: #ffe4e1; }
.parents-close-btn { background: #eee; justify-content: center; }
.parents-pane h3 { color: var(--admin); text-align: center; }
.home-grocery-form { display: flex; gap: 6px; margin-top: 6px; }
.home-grocery-form input, .grocery-add-row input { flex: 1; min-width: 0; min-height: 48px; padding: 8px 10px; border: 1px solid #ccc; border-radius: var(--r-xs); font-size: calc(var(--fs-parents) * 1); }
.grocery-error { color: var(--danger); font-weight: 700; margin: 6px 0; }
.grocery-add-row { display: flex; gap: var(--sp-2); margin: 10px 0; }
.grocery-btn { padding: 8px 16px; border: none; border-radius: var(--r-xs); background: var(--admin); color: var(--surface); font-weight: 700; cursor: pointer; }
.grocery-clear { margin-top: 12px; background: var(--muted-2); }
.grocery-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.grocery-chip { padding: 5px 12px; border-radius: var(--r-md); border: 1px solid var(--admin); background: var(--surface); cursor: pointer; }
.grocery-group-title { margin: 12px 0 4px; font-size: calc(var(--fs-parents) * 1); color: var(--muted); }
.grocery-items { list-style: none; margin: 0; padding: 0; }
.grocery-item { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 0; border-bottom: 1px solid #eceff1; }
.grocery-item.pending { opacity: 0.55; }
.grocery-item.bought .grocery-name { text-decoration: line-through; color: var(--muted-3); }
.grocery-tick { width: 22px; height: 22px; }
.grocery-name { flex: 1; }
.grocery-by { font-size: calc(var(--fs-parents) * 0.8); color: var(--muted-2); }
.grocery-bought { margin-top: 12px; }
.parents-placeholder { text-align: center; padding: 60px 20px; color: var(--muted-2); font-weight: 700; }
.parent-only { display: none; }
html.parents-unlocked .parent-only { display: flex; }
#parents-bar { display: none; position: fixed; top: 8px; left: 8px; z-index: 1100; gap: var(--sp-2); }
html.parents-unlocked #parents-bar { display: flex; }
html.parents-open #parents-bar { display: none; }
.parents-bar-btn { padding: 10px 14px; border: none; border-radius: 14px; background: var(--ink); color: white; font-family: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
@media screen and (max-width: 767px) {
    #admin-modal { padding-bottom: 90px; }
    .parents-shell { flex-direction: column; }
    .parents-title { display: none; }
    #parents-menu { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; flex-direction: row; gap: var(--sp-1); padding: 6px; background: white; border-top: 1px solid #ddd; z-index: 2100; overflow-x: auto; }
    .parents-tab { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: calc(var(--fs-parents) * 0.7); min-width: 56px; flex: 1; align-items: center; text-align: center; }
    .parents-lock-btn { margin-top: 0; }
    .parents-close-btn { font-size: calc(var(--fs-parents) * 0.7); }
}
textarea, input, select { padding: 14px; border-radius: var(--r-md); border: 1.5px solid #ddd; font-family: 'Assistant', sans-serif; font-weight: 600; width: 100%; font-size: calc(var(--fs-parents) * 1); }
textarea:focus, input:focus, select:focus { border-color: var(--admin); outline: none; }

#pin-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(5px); z-index: 3000; align-items: center; justify-content: center; }
#pin-modal.open { display: flex; }
.pin-box { background: white; border-radius: var(--r-lg); padding: 34px 24px; width: 290px; display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); box-shadow: 0 10px 40px rgba(0,0,0,0.12); color: var(--ink); }
.pin-box h3 { margin: 0; font-size: calc(var(--fs-parents) * 1.15); font-weight: 800; }
.pin-box { width: min(340px, 92vw); padding: 24px 20px; }
.pin-hidden-input { position: absolute; opacity: 0; width: 1px; height: 1px; border: 0; padding: 0; pointer-events: none; }
.pin-dots { display: flex; gap: 14px; direction: ltr; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--admin); background: transparent; }
.pin-dots i.on { background: var(--admin); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; direction: ltr; }
.pin-pad button { min-height: 64px; font-family: inherit; border-radius: var(--r-sm); border: 2px solid var(--line, #ddd); background: var(--surface-2, #f4f4f4); color: var(--ink); font-size: 1.6rem; font-weight: 800; cursor: pointer; }
.pin-pad button:active { background: #e3e6f7; }
.pin-pad .pin-key-ok { background: var(--admin); color: white; border-color: var(--admin); }
#pin-cancel { min-height: 56px; font-size: 1.1rem; width: 100%; border-radius: var(--r-sm); border: none; background: var(--surface-2); color: #495057; font-weight: 800; cursor: pointer; }
.pin-box.shake { animation: pinShake 0.4s; }
@keyframes pinShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-12px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-8px); } 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .pin-box.shake { animation: none; } }
@media (max-height: 640px) { .pin-box { padding: 14px 16px; gap: 8px; } .pin-pad button { min-height: 48px; } }
#pin-error { color: #e53935; font-size: calc(var(--fs-parents) * 0.85); display: none; font-weight: 700; }

#calendar-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #fdfdfd; z-index: 1000; overflow-y: auto; color: var(--ink); }
.modal-header-premium { position: sticky; top: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); padding: 10px 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.05); z-index: 1010; }
.close-btn-premium { background: var(--surface-2); border: none; width: 34px; height: 34px; border-radius: 50%; font-size: calc(var(--fs-parents) * 0.9); cursor: pointer; display: flex; align-items: center; justify-content: center; color: #495057; justify-self: end; }
.event-card-premium { background: white; border-radius: 20px; padding: 18px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 6px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.03); }
.date-section-premium { min-width: 75px; text-align: center; border-left: 2px solid #edf2f7; margin-left: 15px; }
.day-label { font-size: calc(var(--fs-parents) * 0.7); font-weight: 700; color: #adb5bd; text-transform: uppercase; }
.date-label { font-size: calc(var(--fs-parents) * 1.2); font-weight: 800; color: #212529; }
.content-section-premium { flex-grow: 1; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.event-name-text { font-size: calc(var(--fs-parents) * 1.1); font-weight: 700; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); }
.kid-tag-premium { display: inline-block; font-size: calc(var(--fs-parents) * 0.7); font-weight: 800; padding: 2px 10px; border-radius: 50px; color: white; margin-top: 4px; }
.action-icon-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: #f8f9fa; border-radius: var(--r-xs); cursor: pointer; }

.kids-checkbox-group { display: flex; gap: var(--sp-2); width: 100%; }
.checkbox-container { flex: 1; cursor: pointer; }
.checkbox-container input { display: none; }
.checkmark-btn { display: flex; align-items: center; justify-content: center; padding: 12px; background: white; border: 1.5px solid #ddd; border-radius: var(--r-sm); font-weight: 800; color: #555; text-align: center; transition: all 0.2s ease; }
.checkbox-container input:checked + .checkmark-btn { background: var(--admin); color: white; border-color: var(--admin); box-shadow: 0 4px 12px rgba(92, 107, 192, 0.2); }

.sticky-notes-board { display: grid; grid-template-columns: 1fr; gap: 15px; width: 100%; margin-top: 8px; }
@media screen and (min-width: 600px) { .sticky-notes-board { grid-template-columns: 1fr 1fr 1fr; } }
.sticky-note { border-radius: 18px; padding: 18px; min-height: 150px; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05); border: 1px solid rgba(0,0,0,0.03); }
.note-header { font-size: calc(var(--fs-parents) * 1.1); font-weight: 800; margin-bottom: 10px; border-bottom: 1px solid rgba(0, 0, 0, 0.06); padding-bottom: 4px; opacity: 0.8; }
.note-body { flex-grow: 1; font-size: calc(var(--fs-parents) * 1.05); font-weight: 700; line-height: 1.4; outline: none; cursor: text; white-space: pre-wrap; }

/* Calendar week/month view + add/edit panel (step 19) */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.cal-btn { padding: 7px 12px; border: 1px solid var(--admin); border-radius: var(--r-xs); background: var(--surface); color: var(--admin); font-weight: 700; cursor: pointer; }
.cal-btn.active, .cal-btn[aria-pressed="true"], .cal-save, .cal-add { background: var(--admin); color: var(--surface); }
.cal-delete { border-color: var(--danger); color: var(--danger); }
.cal-title { font-weight: 800; flex: 1; text-align: center; min-width: 120px; }
.cal-grid { display: grid; gap: var(--sp-1); margin: 8px 0; }
.cal-grid.cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid.cal-month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { min-height: 70px; border: 1px solid #e0e0e0; border-radius: 8px; padding: 3px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-month .cal-day { min-height: 56px; }
.cal-day.is-today { border-color: var(--admin); box-shadow: 0 0 0 2px var(--admin) inset; }
.cal-day.other-month { opacity: 0.45; }
.cal-day-head { font-size: calc(var(--fs-parents) * 0.8); font-weight: 800; color: var(--muted); }
.cal-chip { font-size: calc(var(--fs-parents) * 0.75); text-align: start; border: none; border-inline-start: 4px solid #999; border-radius: 4px; background: #f1f5f8; padding: 2px 4px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-status { color: var(--danger); font-weight: 700; margin: 6px 0; }
.cal-form { display: flex; flex-direction: column; gap: var(--sp-2); padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fafafa; margin: 8px 0; }
.cal-form input[type="text"], .cal-form input[type="date"], .cal-form input[type="time"], .cal-form select { padding: 6px 8px; border: 1px solid #ccc; border-radius: 8px; font-size: calc(var(--fs-parents) * 1); }
.cal-check { display: flex; align-items: center; gap: 6px; }
.cal-form-error { color: var(--danger); font-weight: 700; margin: 0; }
.cal-form-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.cal-list-title { margin: 16px 0 6px; color: var(--muted); }
.td-box { margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.td-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.td-item { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-xs); }
.td-label { flex: 1; font-weight: 700; }
.set-grid { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.set-grid label, .set-wide { display: flex; flex-direction: column; gap: 2px; font-weight: 700; font-size: calc(var(--fs-parents) * 0.9); }
.set-wide { margin: 6px 0; }
.set-grid input { width: 110px; }
.set-wide input[type="text"] { width: 100%; box-sizing: border-box; }
.set-split { display: flex; gap: var(--sp-3, 16px); align-items: flex-start; }
.set-nav { display: flex; flex-direction: column; gap: 8px; flex: 0 0 190px; }
.set-nav-btn { min-height: 48px; padding: 8px 12px; font-size: 1rem; font-weight: 700; text-align: start; border: 1px solid var(--admin); border-radius: var(--r-xs); background: var(--surface); color: var(--admin); cursor: pointer; }
.set-nav-btn.is-active { background: var(--admin); color: var(--surface); }
.set-body { flex: 1 1 auto; min-width: 0; }
.set-cat-pane h4 { margin: 4px 0; }
.set-cat-pane .cal-btn, .set-cat-pane select, .set-cat-pane input { min-height: 48px; font-size: 1rem; }
.set-cat-pane input[type="checkbox"] { min-height: 0; width: 28px; height: 28px; }
.set-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 1rem; font-weight: 700; min-height: 48px; }
.set-kids { display: flex; flex-direction: column; gap: var(--sp-2); }
.set-kid { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.set-kid .sk-name { width: 110px; }
.set-kid .sk-initial, .set-kid .sk-age { width: 56px; }
.set-kid .sk-color { width: 48px; height: 48px; padding: 0; }
.set-kid { gap: 4px; }
.set-kid input, .set-kid select { padding: 8px 6px; }
.set-kid .sk-name { width: 100px; }
.set-kid .sk-initial { width: 52px; }
.set-kid .sk-age { width: 60px; }
.set-kid select { width: auto; }
.set-kid .cal-btn { padding: 8px 10px; }
.tsk-manager { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tsk-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.tsk-tab { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: calc(var(--fs-parents) * 1); cursor: pointer; }
.tsk-tab.active { background: var(--primary); color: var(--surface); border-color: var(--primary); }
.tsk-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tsk-item { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface); cursor: grab; }
.tsk-item-icon { font-size: calc(var(--fs-parents) * 1.4); }
.tsk-item-title { flex: 1; text-align: start; border: none; background: none; font-size: calc(var(--fs-parents) * 1); font-weight: 700; cursor: pointer; }
.tsk-item-meta { font-size: calc(var(--fs-parents) * 0.8); color: var(--muted); }
.tsk-move { border: 1px solid var(--line); border-radius: 6px; background: #f1f5f8; cursor: pointer; }
.tsk-move:disabled { opacity: 0.35; cursor: default; }
.tsk-empty { color: var(--muted-2); padding: 6px; }
.tsk-bar { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; margin: 6px 0; }
.tsk-icons, .tsk-days { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.tsk-icon-btn { font-size: calc(var(--fs-parents) * 1.3); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.tsk-day { display: inline-flex; align-items: center; gap: 2px; }
.home-reminders { border: 2px solid #f9a825; background: #fffde7; }

/* Step 26: kid screen profile variants (picture / mixed / focus) and the extras block */
#kid-extras { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
#kid-extras:empty { display: none; }
.kx-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.kx-chip { background: var(--surface); border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: calc(var(--fs-kid) * 1.2); box-shadow: var(--kid-shadow); }
.kx-jar { position: relative; width: 120px; height: 140px; margin: 0 auto; border: 5px solid #90caf9; border-radius: 18px 18px 40px 40px; background: var(--surface); overflow: hidden; }
.kx-jar-fill { position: absolute; bottom: 0; left: 0; right: 0; background: #ffe082; transition: height 0.5s ease; }
.kx-jar-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--fs-kid) * 1.8); font-weight: 900; }
.kx-prize { display: flex; align-items: center; gap: var(--sp-2); direction: ltr; }
.kx-prize-track { flex: 1; height: 14px; border-radius: 8px; background: #e0e0e0; overflow: hidden; }
.kx-prize-fill { height: 100%; background: #66bb6a; }
.kx-now { background: var(--surface); border-radius: 20px; padding: 16px; text-align: center; box-shadow: var(--kid-shadow); border: 3px solid #42a5f5; }
.kx-now-label { font-size: calc(var(--fs-kid) * 0.9); font-weight: 800; color: #1e88e5; text-transform: uppercase; }
.kx-now-task { font-size: calc(var(--fs-kid) * 1.8); font-weight: 900; margin: 4px 0; }
.kx-now-count { font-weight: 700; color: #455a64; margin-bottom: 8px; }
.kx-now-count.late { color: #d32f2f; }
.kx-done-btn { min-height: 56px; min-width: 160px; font-size: calc(var(--fs-kid) * 1.3); font-weight: 900; border: 0; border-radius: var(--r-md); background: var(--ok); color: var(--surface); cursor: pointer; }
.kx-strip { display: flex; gap: 6px; justify-content: center; direction: ltr; }
.kx-day { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; background: #eceff1; color: var(--muted-2); }
.kx-done { background: #c8e6c9; color: #2e7d32; }
.kx-partly { background: #fff3c4; color: #f57f17; }
.kx-missed { background: #ffcdd2; color: var(--danger); }
.kx-today { outline: 3px solid #42a5f5; }
.profile-picture #task-list { grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-picture .card { min-height: 140px; flex-direction: column; justify-content: center; text-align: center; gap: var(--sp-2); font-size: calc(var(--fs-kid) * 1.4); }
.profile-mixed #task-list { grid-template-columns: 1fr; }
.profile-focus #task-list { grid-template-columns: 1fr; gap: var(--sp-2); }
.profile-focus .card { min-height: 60px; padding: 10px 16px; }
.rw-kids { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin: 6px 0; }
.rw-kids .cal-btn.active { background: var(--primary); color: var(--surface); }
.rw-balance { font-size: calc(var(--fs-parents) * 1.4); font-weight: 800; margin: 6px 0; }
.rw-form { display: flex; flex-direction: column; gap: var(--sp-2); margin: 8px 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface); }
.rw-form label { display: flex; flex-direction: column; gap: var(--sp-1); font-weight: 600; }
.rw-form label.rw-check, .rw-checks label.rw-check { flex-direction: row; align-items: center; gap: 6px; }
.rw-checks { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.rw-archived { opacity: 0.55; }
html.home-glance #home-clock { font-size: min(22vmin, 14vh); }
html.home-glance #home-screen { font-size: 1.15em; }
html.home-glance .home-add-btn { display: none; }

/* Pager (v4 step 5): dots + prev/next, every target >= 48px */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
.pager[hidden] { display: none; }
.pager-btn { min-width: 48px; min-height: 48px; border: none; border-radius: var(--r-xs); background: transparent; font-size: 1.25rem; cursor: pointer; color: inherit; }
.pager-btn:disabled { opacity: 0.35; cursor: default; }
.pager-dots { display: flex; align-items: center; }
.pager-dot { position: relative; width: 48px; height: 48px; border: none; background: transparent; cursor: pointer; padding: 0; }
.pager-dot::before { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: currentColor; opacity: 0.3; }
.pager-dot.active::before { opacity: 1; }

/* ===== v4 step 8: kid screens fit one iPad screen (no page scroll). B tiles for focus/mixed, C picture steps for picture. ===== */
html.kid-screen, html.kid-screen body { height: 100dvh; overflow: hidden; }
html.kid-screen body { display: flex; flex-direction: column; padding: 6px 12px 0; box-sizing: border-box; }
html.kid-screen .sticky-nav { position: static; flex: none; padding-bottom: 4px; margin-bottom: 4px; }
html.kid-screen .utility-bar { padding: 0 5px; gap: 8px; }
html.kid-screen .utility-bar .icon-btn, html.kid-screen #home-btn, html.kid-screen #refresh-icon { min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; font-size: 1.5rem; padding: 0; }
html.kid-screen .btn-group { margin: 4px auto; gap: 8px; }
html.kid-screen .routine-btn { flex-direction: row; gap: 8px; padding: 0 6px; min-height: 52px; max-height: 56px; }
html.kid-screen .routine-btn > * { font-size: 1rem !important; line-height: 1.1; }
html.kid-screen .routine-btn > span:first-child { font-size: 1.6rem !important; }
html.kid-screen .power-meter-wrapper { margin-top: 4px; flex-direction: row; align-items: center; gap: 10px; }
html.kid-screen .power-meter-status { flex: none; }
html.kid-screen .power-meter-wrapper .progress-track-wrapper { flex: 1; }
html.kid-screen .status-text-tag, html.kid-screen .bubble-header-label, html.kid-screen .timeline-title, html.kid-screen .calendar-badge-dayname, html.kid-screen .calendar-badge-num, html.kid-screen .today-tag, html.kid-screen .timestamp, html.kid-screen .kx-now-label, html.kid-screen .kx-now-count, html.kid-screen .motto-secondary, html.kid-screen .motto-primary, html.kid-screen .weather-inline-tag { font-size: max(16px, 1rem); }
html.kid-screen .main-container { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
html.kid-screen .info-fluid-row { flex: none; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 auto 6px; max-height: 17dvh; overflow: hidden; align-items: start; }
html.kid-screen .bubble-content-text { padding: 6px 12px; transform: none; }
html.kid-screen .bubble-text-main { font-size: max(16px, 1rem); line-height: 1.25; }
html.kid-screen .bubble-avatar-wrapper { width: 40px; height: 40px; }
html.kid-screen .timeline-top-nav { margin-bottom: 2px; }
html.kid-screen .timeline-stack { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
html.kid-screen .event-text-content-wrap { font-size: max(16px, 1rem); padding: 0 6px; }
html.kid-screen .calendar-badge-mini { padding: 2px 8px; }
html.kid-screen .footer-motto { margin-top: 0; padding: 2px 10px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.kid-screen .motto-primary { margin: 0; overflow: hidden; text-overflow: ellipsis; }
html.kid-screen .motto-secondary { display: none; }
html.kid-screen #kid-nav { position: static; transform: none; flex: none; width: 100%; max-width: 600px; margin: 4px auto 6px; padding: 4px 8px; border-radius: 24px; box-sizing: border-box; }
html.kid-screen #kid-nav button { min-height: 52px; padding: 4px 5px; font-size: max(16px, 1rem); }
html.kid-screen #kid-extras { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; margin-bottom: 6px; max-height: 18dvh; overflow: hidden; }
html.kid-screen .kx-now { display: flex; align-items: center; gap: 12px; padding: 6px 14px; border-radius: 16px; flex: 1 1 100%; text-align: start; justify-content: space-between; }
html.kid-screen .kx-now-task { font-size: 1.4rem; margin: 0; }
html.kid-screen .kx-now-count { margin: 0; }
html.kid-screen .kx-done-btn { min-height: 48px; min-width: 120px; font-size: 1.1rem; }
html.kid-screen .kx-chip { padding: 2px 12px; font-size: 1.1rem; }
html.kid-screen .kx-day { width: 30px; height: 30px; font-size: 16px; }
html.kid-screen .kx-jar { width: 56px; height: 64px; border-width: 3px; }
html.kid-screen .kx-jar-label { font-size: 1rem; }
html.kid-screen .kx-prize { flex: 1 1 200px; max-width: 360px; font-size: 16px; }

/* Task grid: driven by fitKidTasks() (--kid-cols / --kid-row / --kid-gap) */
html.kid-screen #task-list { display: grid !important; }
html.kid-screen #task-list, html.kid-screen .completed-tasks-wrapper { grid-template-columns: repeat(var(--kid-cols, 2), minmax(0, 1fr)); grid-auto-rows: var(--kid-row, 96px); gap: var(--kid-gap, 10px); align-content: start; width: 100%; margin: 0; }
html.kid-screen #task-list { flex: 1 1 0; min-height: 0; overflow: hidden; }
html.kid-screen #task-pager { flex: none; }
html.kid-screen .card { min-height: 0; height: 100%; box-sizing: border-box; overflow: hidden; padding: 8px 14px; gap: 8px; }
html.kid-screen .card.is-completed { transform: none; }
html.kid-screen .check { width: 48px; height: 48px; font-size: 1.5rem; }
html.kid-screen .check.done { transform: none; }
html.kid-screen .task-label { font-size: 1.25rem; min-width: 0; gap: 10px; flex: 1; justify-content: flex-end; }
html.kid-screen .task-label span:first-child { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; }
html.kid-screen .task-label span:last-child { font-size: 2rem; flex: none; }
html.kid-screen .kx-now .speak-btn { width: 48px; height: 48px; min-width: 48px; flex: none; }
html.kid-screen .card .speak-btn { width: 48px; height: 48px; min-width: 48px; top: 4px; font-size: 1.3rem; }

/* B: quadrant tiles, big icon on top (focus and mixed) */
html.kid-screen .profile-focus .card, html.kid-screen .profile-mixed .card { flex-direction: column; justify-content: center; text-align: center; padding: 6px 10px; gap: 2px; }
html.kid-screen .profile-focus .card > div:first-child, html.kid-screen .profile-mixed .card > div:first-child { position: absolute; top: 6px; inset-inline-start: 6px; }
html.kid-screen .profile-focus .task-label, html.kid-screen .profile-mixed .task-label { flex-direction: column-reverse; align-items: center; justify-content: center; gap: 0; flex: none; }
html.kid-screen .profile-focus .task-label span:last-child, html.kid-screen .profile-mixed .task-label span:last-child { font-size: 2.2rem; line-height: 1; }
html.kid-screen .profile-mixed .task-label span:last-child { font-size: 2.6rem; }

/* C: picture steps (Amit), large picture first, bigger name */
html.kid-screen .profile-picture .card { flex-direction: column; justify-content: center; text-align: center; padding: 6px 10px; gap: 2px; }
html.kid-screen .profile-picture .card > div:first-child { position: absolute; top: 6px; inset-inline-start: 6px; }
html.kid-screen .profile-picture .task-label { flex-direction: column-reverse; align-items: center; justify-content: center; gap: 0; flex: none; font-size: 1.5rem; }
html.kid-screen .profile-picture .task-label span:last-child { font-size: 4rem; line-height: 1; }

/* Done banner and empty state */
html.kid-screen .all-done-banner { padding: 10px 14px; gap: 4px; height: 100%; box-sizing: border-box; overflow: hidden; grid-column: 1 / -1; justify-content: center; }
html.kid-screen .all-done-icon { font-size: 3rem; line-height: 1; }
html.kid-screen .all-done-banner h3, html.kid-screen .all-done-banner p { margin: 0; }
html.kid-screen .show-tasks-btn { margin-top: 4px; min-height: 48px; }
html.kid-screen .all-done-banner.banner-open { justify-content: flex-start; }
html.kid-screen .all-done-banner.banner-open .all-done-icon, html.kid-screen .all-done-banner.banner-open h3, html.kid-screen .all-done-banner.banner-open p, html.kid-screen .all-done-banner.banner-open .show-tasks-btn { display: none; }
html.kid-screen .all-done-banner.banner-open .completed-tasks-wrapper { flex: 1 1 0; min-height: 0; overflow: hidden; }
html.kid-screen .empty-state { padding: 10px; grid-column: 1 / -1; }

/* ---- v4 step 11: parents sections and family calendar fit (paged lists, no page scroll) ---- */
.pg-host { flex: none; }
.pg-off { display: none !important; }
@media (min-width: 768px) {
    #admin-modal, #calendar-modal { overflow: hidden; }
    #admin-modal { padding: 12px 16px; }
    .parents-shell { height: 100%; min-height: 0; }
    #parents-menu { overflow: hidden; }
    .parents-content { display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; }
    .parents-pane:not(.screen-hidden) { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
    .parents-pane h3 { margin: 0 0 6px; font-size: max(1rem, calc(var(--fs-parents) * 1.1)); }
    .parents-pane h4 { margin: 6px 0; font-size: max(1rem, calc(var(--fs-parents) * 1)); }
    .parents-pane > .td-box, .parents-pane > .tsk-manager { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; margin-bottom: 8px; padding: 8px 12px; }
    .parents-pane .td-list, .parents-pane .tsk-list, .parents-pane .grocery-items, #parents-calendar-list { flex: 1; min-height: 0; overflow: hidden; margin: 4px 0; }
    .parents-pane .td-list > *, .parents-pane .tsk-list > *, .parents-pane .grocery-items > * { flex-shrink: 0; }
    #td-needs-en-box { flex: 0 0 34%; }
    #td-needs-en-box.screen-hidden { display: none; }
    #parents-calendar-list > * { flex-shrink: 0; }
    #parents-calendar-list { display: flex; flex-direction: column; gap: 6px; }
    .cal-btn, .cal-save, .grocery-btn, .grocery-chip, .tsk-tab, .tsk-move, .tsk-icon-btn, .tsk-bar button, #tsk-form button, .rw-form button, .td-box > button, .pg-btn {
        font-size: max(1rem, calc(var(--fs-parents) * 1)); min-height: 48px; min-width: 48px; }
    .tsk-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
    .tsk-bar input, .tsk-bar select, #tsk-form input[type=text], #tsk-form select, .cal-form input, .cal-form select, .rw-form input, .rw-form select { min-height: 48px; font-size: max(1rem, calc(var(--fs-parents) * 1)); width: auto; padding: 6px 10px; }
    input[type=checkbox], .grocery-tick { min-width: 48px; min-height: 48px; width: 48px; height: 48px; }
    .tsk-item-meta, .grocery-by, .set-wide, .set-grid label, .rw-form label, .cal-form label, .cal-check, .cal-day-head, .cal-chip, .cal-status { font-size: max(1rem, calc(var(--fs-parents) * 1)); }
    .cal-chip { min-height: 48px; padding: 0 6px; }
    .cal-more { display: block; font-size: 1rem; padding: 0 6px; color: var(--c-muted, #666); }
    .cal-day { min-height: 0; padding: 2px; }
    #cal-grid { flex: none; }
    .cal-grid.cal-week { grid-auto-rows: auto; }
    .cal-grid.cal-month { grid-auto-rows: minmax(0, 1fr); }
    .cal-grid.cal-month .cal-day { min-height: 0; }
    .cal-grid.cal-month .cal-chip { min-height: 48px; }
    .cal-toolbar { gap: 6px; margin: 4px 0; }
    .cal-list-title { margin: 6px 0 4px; }
    .sticky-notes-board { gap: 8px; }
    .sticky-note { min-height: 0; padding: 8px; }
    .sticky-note .note-body { max-height: 20vh; overflow: hidden; }
    .rw-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
    .rw-sub { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
    .rw-sub.screen-hidden { display: none; }
    .parents-pane .td-box:not(.screen-hidden) .rw-sub:not(.screen-hidden) { flex: 1; }
    .close-btn-premium { width: 48px; height: 48px; font-size: 1rem; }
    .modal-header-premium { padding: 6px 20px; }
    .day-label, .kid-tag-premium { font-size: 1rem; }
    .action-icon-btn { width: 48px; height: 48px; }
    #calendar-modal .event-card-premium { padding: 8px 14px; margin-bottom: 6px; }
    #full-event-list { height: calc(100dvh - 140px); overflow: hidden; display: flex; flex-direction: column; padding: 0 20px !important; }
    #full-event-list > * { flex-shrink: 0; }
    #calendar-modal .pg-host { max-width: 700px; margin: 0 auto; }
}
@media (min-width: 768px) {
    .cal-grid.cal-month .cal-day { flex-direction: row; align-items: center; gap: 4px; }
    .cal-grid.cal-month .cal-day-head { flex: none; min-width: 1.6em; }
    .cal-grid.cal-month .cal-chip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cal-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 8px 12px; margin: 4px 0; }
    .cal-form > h4, .cal-form > .cal-form-error, .cal-form > .cal-form-actions, .cal-form > #cal-f-grocery-row { grid-column: 1 / -1; }
    .cal-form label { display: flex; align-items: center; gap: 8px; }
    .cal-form label input[type=text], .cal-form label input[type=date], .cal-form label input[type=time], .cal-form label select { flex: 1; min-width: 0; }
    .parents-pane:has(#cal-form:not(.screen-hidden)) #cal-grid,
    .parents-pane:has(#cal-form:not(.screen-hidden)) .cal-list-title,
    .parents-pane:has(#cal-form:not(.screen-hidden)) #parents-calendar-list,
    .parents-pane:has(#cal-form:not(.screen-hidden)) .pg-host,
    .parents-pane:has(#tsk-form:not(.screen-hidden)) #tsk-list,
    .parents-pane:has(#tsk-form:not(.screen-hidden)) .pg-host,
    .parents-pane:has(#tsk-form:not(.screen-hidden)) .tsk-bar { display: none; }
}
@media (min-width: 768px) {
    .legacy-task-form { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; padding: 8px 12px !important; border-radius: 16px !important; }
    .legacy-task-form > label:first-child { grid-column: 1 / 3; margin: 0 !important; font-size: 1rem; }
    .legacy-task-form > div { grid-column: 3 / -1; margin: 0 !important; }
    .legacy-task-form > div > span { display: none !important; }
    .legacy-task-form select, .legacy-task-form input[type=text] { margin: 0 !important; min-height: 48px; font-size: 1rem; padding: 6px 10px; }
    .legacy-task-form .checkmark-btn { min-height: 48px; padding: 6px; font-size: 1rem; }
    .legacy-task-form > button { grid-column: 1 / -1; margin: 0 !important; min-height: 48px; padding: 6px !important; font-size: 1rem; }
}
@media (min-width: 768px) {
    .legacy-task-form > div > span { display: inline !important; font-size: 1rem !important; margin: 0 !important; white-space: nowrap; }
    .legacy-task-form > div { display: flex; align-items: center; gap: 8px; }
}
@media (min-width: 768px) {
    .rw-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
    .rw-sec { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
    .rw-sec > .td-list { flex: 1; min-height: 0; }
    .rw-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .rw-form label { display: flex; align-items: center; gap: 6px; }
    .rw-form input[type=text], .rw-form input[type=number], .rw-form input[type=date] { width: 9em; }
    .rw-checks { display: flex; flex-wrap: wrap; gap: 6px; }
    .rw-checks label { display: flex; align-items: center; }
    .rw-kids { display: flex; flex-wrap: wrap; gap: 6px; }
    .rw-kids button { min-height: 48px; font-size: 1rem; }
    .rw-balance { font-size: 1rem; }
    .rw-sec .set-grid { display: flex; flex-wrap: wrap; gap: 6px; }
    .rw-sec .set-grid input { width: 9em; min-height: 48px; font-size: 1rem; }
    .td-box:has(.rw-form:not(.screen-hidden)) .rw-sec:not(:has(.rw-form:not(.screen-hidden))) { display: none; }
    .td-box:has(.rw-form:not(.screen-hidden)) .rw-sec:has(.rw-form:not(.screen-hidden)) { grid-column: 1 / -1; grid-row: 1 / -1; }
    .rw-sec:has(.rw-form:not(.screen-hidden)) > .td-list,
    .rw-sec:has(.rw-form:not(.screen-hidden)) > .pg-host,
    .rw-sec:has(.rw-form:not(.screen-hidden)) > .tsk-empty,
    .rw-sec:has(.rw-form:not(.screen-hidden)) > .cal-btn { display: none; }
    .td-item, .td-list li { font-size: max(1rem, calc(var(--fs-parents) * 1)); }
    .td-item button { min-height: 48px; min-width: 48px; font-size: 1rem; }
    .sticky-notes-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (orientation: portrait) {
    .cal-grid.cal-month .cal-day { flex-direction: column; align-items: stretch; }
    .cal-grid.cal-month .cal-chip { flex: none; width: 100%; }
}
@media (min-width: 768px) {
    .event-name-text, .note-header, .tsk-item-title, .grocery-group-title, .date-label, .today-tag { font-size: max(1rem, calc(var(--fs-parents) * 1.1)); }
    #ann-text, #parents-pane-messages input[type=text] { min-height: 48px; font-size: 1rem; }
    .cal-grid.cal-month .cal-chip { min-width: 48px; }
}

/* Auth gate (step 17) */
.auth-gate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: var(--sp-3); background: var(--bg); }
.auth-card { width: min(92vw, 420px); padding: 24px; border-radius: var(--r-xs); background: var(--surface); border: 1px solid var(--admin); text-align: center; display: flex; flex-direction: column; gap: 14px; }
.auth-logo { font-size: 3rem; }
.auth-title { margin: 0; font-size: 1.6rem; }
.auth-sub { margin: 0; font-size: 1rem; }
.auth-msg { margin: 0; font-size: 1.05rem; font-weight: 700; color: #b3261e; }
.auth-btn { min-height: 52px; padding: 8px 16px; font-size: 1.1rem; font-weight: 700; border: 0; border-radius: var(--r-xs); background: var(--admin); color: var(--surface); cursor: pointer; }
.auth-btn:disabled { opacity: .6; cursor: default; }
.set-account { font-size: 1rem; }
.mig-box { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,.12); font-size: 1rem; }
.mig-box .cal-btn { min-height: 48px; }
.mig-table { border-collapse: collapse; margin-top: .75rem; font-size: 1rem; width: 100%; max-width: 28rem; }
.mig-table th, .mig-table td { padding: .5rem .75rem; text-align: start; border-bottom: 1px solid rgba(0,0,0,.1); }
