/* ============ My Day — design system ============ */
:root {
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --brand-soft: #eef2ff;
    --bg: #f5f6fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e7e9f2;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --sidebar-w: 256px;
    --kids: #14b8a6; --health: #ef4444; --money: #22c55e; --home: #f59e0b;
    --car: #64748b; --projects: #8b5cf6; --learning: #3b82f6; --leisure: #ec4899;
    --bs-primary: var(--brand);
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: var(--brand);
    --bs-border-radius: 12px;
}

html { font-size: 15px; }
body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
body.rtl { font-family: "Cairo", "Inter", system-ui, sans-serif; }

a { text-decoration: none; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: #0f172a;
    color: #cbd5e1;
    position: fixed; inset-block: 0; inset-inline-start: 0;
    padding: 20px 14px;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff; font-size: 1.15rem;
}
.brand-mark.lg { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; margin-bottom: 18px; }
.brand-text { font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.brand-text small { display: block; font-size: .8rem; color: #94a3b8; font-family: "Cairo", sans-serif; font-weight: 600; }

.side-nav .nav-group {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
    color: #64748b; padding: 16px 12px 6px;
}
.side-nav a {
    display: flex; align-items: center; gap: 12px;
    color: #cbd5e1; padding: 9px 12px; border-radius: 10px;
    font-weight: 500; margin-bottom: 2px;
}
.side-nav a i { font-size: 1.1rem; width: 20px; text-align: center; opacity: .85; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }

.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 28px;
    background: rgba(245, 246, 251, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title .household { font-size: .78rem; color: var(--muted); font-weight: 500; }
.topbar-title h1 { font-size: 1.35rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content { padding: 24px 28px 110px; max-width: 1400px; width: 100%; }

.btn-icon {
    width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center;
    background: var(--card); border: 1px solid var(--border); font-size: 1.2rem;
}
.avatar { background: var(--brand); color: #fff; border: 0; font-weight: 700; font-size: 1rem; border-radius: 50%; }
.btn-soft { background: var(--brand-soft); color: var(--brand); border: 0; font-weight: 600; border-radius: 10px; }
.btn-soft:hover { background: #e0e7ff; color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); font-weight: 600; }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; }
.btn { border-radius: 10px; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.rtl .sidebar { transform: translateX(100%); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 1030; }
    .main { margin-inline-start: 0; }
    .topbar { padding: 12px 16px; }
    .content { padding: 16px 14px 120px; }
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card);
}
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-header .ms-auto a, .card-header a.small { font-weight: 500; }
.card-body { padding: 18px; }

.section-title { font-weight: 700; font-size: 1.05rem; margin: 6px 0 12px; display: flex; align-items: center; gap: 8px; }

/* Stat tiles */
.stat {
    padding: 18px; border-radius: var(--radius); background: var(--card);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    display: flex; gap: 14px; align-items: center; height: 100%;
}
.stat .icon {
    width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 1.3rem; color: #fff;
}
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat .value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.stat .sub { font-size: .78rem; color: var(--muted); }

.bg-brand { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.bg-kids { background: var(--kids); } .bg-health { background: var(--health); } .bg-money { background: var(--money); }
.bg-home { background: var(--home); } .bg-car { background: var(--car); } .bg-projects { background: var(--projects); }
.bg-learning { background: var(--learning); } .bg-leisure { background: var(--leisure); }

/* Life area status grid */
.area-tile {
    border-radius: 14px; padding: 14px; background: var(--card); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.area-tile .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-green { background: #22c55e; } .dot-yellow { background: #f59e0b; } .dot-red { background: #ef4444; }

/* Lists */
.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean > li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.list-clean > li:last-child { border-bottom: 0; }
.item-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.item-title { font-weight: 600; }
.item-meta { font-size: .8rem; color: var(--muted); }

.chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
    background: #f1f5f9; color: #334155;
}
.chip-red { background: #fee2e2; color: #b91c1c; }
.chip-amber { background: #fef3c7; color: #b45309; }
.chip-green { background: #dcfce7; color: #15803d; }
.chip-blue { background: #dbeafe; color: #1d4ed8; }
.chip-purple { background: #ede9fe; color: #6d28d9; }

/* Task row */
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); margin-bottom: 8px; }
.task-row.done .item-title { text-decoration: line-through; color: var(--muted); }
.task-check {
    width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff;
    display: grid; place-items: center; color: transparent; flex-shrink: 0; padding: 0;
}
.task-check:hover { border-color: var(--money); color: var(--money); }
.task-row.done .task-check { background: var(--money); border-color: var(--money); color: #fff; }
.area-bar { width: 4px; align-self: stretch; border-radius: 4px; }

/* Tables */
.table { --bs-table-bg: transparent; margin: 0; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #f1f5f9; }
.thumb-lg { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; }

/* Forms */
.form-control, .form-select { border-radius: 10px; border-color: var(--border); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }
.form-card { max-width: 900px; }

/* Date range bar */
.range-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.range-bar .btn { font-size: .82rem; }
.range-bar .btn.active { background: var(--brand); color: #fff; }

/* Empty state */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty i { font-size: 2.6rem; color: #c7d2fe; display: block; margin-bottom: 10px; }

/* Floating quick add */
.fab-wrap { position: fixed; inset-inline-end: 24px; bottom: 24px; z-index: 1050; }
.fab {
    width: 58px; height: 58px; border-radius: 50%; border: 0;
    background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
    font-size: 1.6rem; box-shadow: 0 10px 24px rgba(79, 70, 229, .45);
}
.quick-add .dropdown-item { display: flex; gap: 10px; align-items: center; padding: 10px 16px; font-weight: 500; }
@media (max-width: 991.98px) { .fab-wrap { bottom: 84px; inset-inline-end: 16px; } }

/* Bottom nav (mobile) */
.bottom-nav {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 1045;
    display: flex; justify-content: space-around;
    background: #fff; border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .7rem; font-weight: 600; padding: 4px 10px; border-radius: 10px; }
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--brand); }

/* Now screen */
.now-card {
    max-width: 640px; margin: 20px auto; text-align: center;
    background: linear-gradient(160deg, #ffffff, #eef2ff);
    border-radius: 28px; padding: 36px 28px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.now-card h2 { font-size: 1.9rem; font-weight: 700; margin: 14px 0 8px; }
.timer { font-size: 3.4rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); letter-spacing: .02em; }
.now-actions .btn { min-width: 120px; padding: 12px 18px; font-weight: 600; border-radius: 14px; }

/* Child profile */
.profile-head { display: flex; gap: 18px; align-items: center; }
.avatar-xl { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; color: #fff; font-size: 2rem; font-weight: 700; object-fit: cover; }
.nav-pills .nav-link { border-radius: 10px; font-weight: 600; color: var(--muted); }
.nav-pills .nav-link.active { background: var(--brand); }

.progress { height: 8px; border-radius: 99px; background: #eef0f6; }
.progress-bar { border-radius: 99px; }

/* Auth */
.auth-body { background: var(--bg); }
.auth-wrap { display: flex; min-height: 100vh; }
.auth-hero {
    flex: 1; align-items: center; justify-content: center; padding: 60px;
    background: radial-gradient(circle at 20% 20%, #6366f1, #312e81 60%, #1e1b4b);
    color: #fff;
}
.auth-hero h1 { font-weight: 700; font-size: 2.6rem; }
.auth-hero h1 span { font-family: "Cairo", sans-serif; opacity: .8; }
.auth-hero p { font-size: 1.15rem; opacity: .85; max-width: 440px; }
.hero-list { list-style: none; padding: 0; margin-top: 28px; }
.hero-list li { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 1.02rem; }
.hero-list i { font-size: 1.3rem; color: #fbbf24; }
.auth-panel { width: 100%; max-width: 520px; padding: 40px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; }
.auth-panel h2 { font-weight: 700; }

.flash { border-radius: 12px; border: 0; }

@media print {
    .sidebar, .topbar, .fab-wrap, .bottom-nav { display: none !important; }
    .main { margin: 0; }
}

/* ============ Stat tiles: never let numbers spill out ============ */
.stat > div:last-child { min-width: 0; }
.stat .value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(1.05rem, 1rem + .9vw, 1.45rem); }
.stat .label, .stat .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) {
    .stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
    .stat .icon { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
    .stat .label { font-size: .72rem; }
    .stat .value { font-size: 1.05rem; }
    .stat .sub { font-size: .68rem; }
    .stat .progress { width: 100%; }
}

/* ============ Mobile polish ============ */
@media (max-width: 575.98px) {
    html { font-size: 14px; }
    .topbar-title h1 { font-size: 1.15rem; }
    .card-header { padding: 12px 14px; flex-wrap: wrap; }
    .card-body { padding: 14px; }
    .range-bar .btn { font-size: .75rem; padding: 4px 10px; }
    .range-bar form { width: 100%; }
    .range-bar form input[type=date] { flex: 1; width: auto !important; min-width: 0; }
    .table td, .table th { font-size: .82rem; }
    .fab { width: 52px; height: 52px; font-size: 1.4rem; }
}
.tabs-scroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row > * { flex: 1 1 140px; }
.filter-row > .btn { flex: 0 0 auto; }

/* ============ Tasks ============ */
.capture-bar {
    display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow);
}
body.rtl .capture-bar { padding: 8px 16px 8px 8px; }
.capture-bar i { color: #f59e0b; font-size: 1.3rem; }
.capture-bar input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1rem; min-width: 0; }

.task-card {
    --task-color: #4f46e5;
    background: var(--card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px;
    border-inline-start: 5px solid var(--task-color); box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: box-shadow .15s, transform .15s;
}
.task-card:hover { box-shadow: var(--shadow); }
.task-card-main { display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; }
.task-card .task-check { margin-top: 2px; border-color: var(--task-color); }
.task-card .task-check:hover { background: var(--task-color); color: #fff; }
.task-card.done { opacity: .7; }
.task-card.done .task-check { background: var(--task-color); color: #fff; }
.task-card.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-card.late { background: linear-gradient(90deg, #fff5f5, var(--card) 40%); }
body.rtl .task-card.late { background: linear-gradient(-90deg, #fff5f5, var(--card) 40%); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 700; color: var(--text); display: block; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.task-meta i { color: var(--task-color); }
.task-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.task-chips:empty { display: none; }
.task-thumb { position: relative; flex-shrink: 0; }
.task-thumb img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.task-thumb span { position: absolute; bottom: 2px; inset-inline-end: 2px; background: rgba(15, 23, 42, .7); color: #fff; font-size: .65rem; padding: 0 5px; border-radius: 6px; }
.task-checklist { padding: 0 14px 12px 52px; }
body.rtl .task-checklist { padding: 0 52px 12px 14px; }
.check-toggle { display: block; }
.check-item {
    display: flex; gap: 8px; align-items: center; width: 100%; text-align: start; background: transparent; border: 0;
    padding: 4px 0; font-size: .88rem; color: var(--text);
}
.check-item i { color: var(--task-color, var(--brand)); font-size: 1.05rem; }
.check-item.on span { text-decoration: line-through; color: var(--muted); }

.day-head { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; }
.day-head .day-num {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
    background: var(--card); border: 1px solid var(--border);
}
.day-head.today .day-num { background: var(--brand); color: #fff; border-color: var(--brand); }
.day-head b { display: block; line-height: 1.1; }
.day-head small { color: var(--muted); font-size: .75rem; }

/* Task form */
.task-form { --task-color: #4f46e5; }
.task-hero { overflow: hidden; }
.task-hero-bar { height: 6px; background: var(--task-color); transition: background .2s; }
.task-title-input { font-weight: 700; border-width: 2px; }
.task-title-input:focus { border-color: var(--task-color); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--task-color) 20%, transparent); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; cursor: pointer; margin: 0; }
.swatch input[type=radio] { position: absolute; opacity: 0; }
.swatch > span {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff;
    border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); transition: transform .1s;
}
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text); transform: scale(1.08); }
.swatch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch-custom > span { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #0ea5e9, #8b5cf6, #ec4899, #ef4444); overflow: hidden; }
.swatch-custom input[type=color] { opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-btn {
    border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: 3px 12px; font-size: .78rem; font-weight: 600; color: #334155;
}
.chip-btn:hover { border-color: var(--task-color, var(--brand)); color: var(--task-color, var(--brand)); }
.seg-pri { display: flex; background: #eef0f6; border-radius: 10px; padding: 3px; gap: 3px; }
.seg-pri input { display: none; }
.seg-pri label { flex: 1; text-align: center; font-size: .78rem; font-weight: 600; padding: 6px 4px; border-radius: 8px; cursor: pointer; color: var(--muted); margin: 0; }
.seg-pri input:checked + label { background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .1); color: var(--text); }
.seg-pri input:checked + label.pri-high { color: #ea580c; }
.seg-pri input:checked + label.pri-urgent { color: #fff; background: #ef4444; }
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.check-row .form-check-input { margin: 0; flex-shrink: 0; width: 1.2em; height: 1.2em; }
.check-row .form-check-input:checked { background-color: var(--task-color); border-color: var(--task-color); }
.check-row .form-check-input:checked ~ .check-text { text-decoration: line-through; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photo-grid:empty { display: none; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #f1f5f9; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile.removing { opacity: .35; outline: 2px solid #ef4444; }
.photo-remove {
    position: absolute; top: 4px; inset-inline-end: 4px; width: 28px; height: 28px; border-radius: 8px; margin: 0;
    background: rgba(15, 23, 42, .65); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.photo-remove input { display: none; }
.photo-new { position: absolute; top: 4px; inset-inline-start: 4px; background: var(--task-color); color: #fff; font-size: .7rem; font-weight: 800; padding: 1px 7px; border-radius: 6px; }
.sticky-actions { position: sticky; top: 90px; }
@media (max-width: 1199.98px) {
    .sticky-actions { position: fixed; bottom: 64px; inset-inline: 0; top: auto; z-index: 1040; background: rgba(245, 246, 251, .95); backdrop-filter: blur(8px); padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
    .sticky-actions .btn { margin: 0 !important; }
    .sticky-actions .btn-light { max-width: 110px; }
    .task-form { padding-bottom: 70px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) { .sticky-actions { bottom: 0; inset-inline-start: var(--sidebar-w); } }

/* Now screen extras */
.now-photos { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.now-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
.now-checklist { max-width: 360px; margin: 16px auto 0; text-align: start; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 8px 14px; }

/* Reminder toast */
.reminder-toast {
    position: fixed; top: 16px; inset-inline-end: 16px; z-index: 2000; max-width: 340px;
    background: #0f172a; color: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, .35);
    display: flex; gap: 12px; align-items: flex-start; animation: toastIn .25s ease;
}
.reminder-toast i { color: #fbbf24; font-size: 1.3rem; }
.reminder-toast a { color: #c7d2fe; font-weight: 600; }
.reminder-toast button { background: transparent; border: 0; color: #94a3b8; margin-inline-start: auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Inside the installed app (PWA or native), hide "Get the app" links */
html.in-app .get-app-link { display: none !important; }
html.in-native-app .fab-wrap { bottom: 84px; }

/* ===================== Documents vault ===================== */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.doc-card { display: block; background: var(--card, #fff); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 18px rgba(15,23,42,.06); transition: transform .15s, box-shadow .15s; text-decoration: none; border: 1px solid rgba(15,23,42,.06); }
.doc-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,23,42,.12); }
.doc-card.soon { outline: 2px solid #f59e0b; }
.doc-card.expired { outline: 2px solid #ef4444; }
.doc-face { position: relative; aspect-ratio: 1.586; color: #fff; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.doc-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doc-face img + .doc-face-top, .doc-face img ~ .doc-face-num { text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.doc-face img ~ * { position: relative; }
.doc-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 40%, transparent 60%, rgba(0,0,0,.35)); pointer-events: none; }
.doc-face > * { position: relative; z-index: 1; }
.doc-face-top { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .85rem; }
.doc-face-top i { font-size: 1.3rem; }
.doc-face-num { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 1.05rem; letter-spacing: .12em; }
.doc-info { padding: 12px 14px 14px; }
.doc-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-doc { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px; background: var(--card, #fff); border: 1px solid rgba(15,23,42,.1); font-size: .85rem; font-weight: 500; color: inherit; text-decoration: none; white-space: nowrap; }
.quick-doc:hover { border-color: var(--brand, #4f46e5); color: var(--brand, #4f46e5); }
.quick-doc i { color: var(--brand, #4f46e5); }
.hint-row { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: #64748b; background: rgba(79,70,229,.06); border-radius: 12px; padding: .7rem .9rem; }
.doc-preview { position: relative; border-radius: 20px; color: #fff; padding: 20px 22px; aspect-ratio: 1.586; max-width: 440px; display: flex; flex-direction: column; box-shadow: 0 14px 34px rgba(15,23,42,.22); overflow: hidden; }
.doc-preview::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; right: -20%; top: -35%; background: rgba(255,255,255,.12); }
.doc-preview > * { position: relative; }
.doc-preview .dp-top { display: flex; align-items: center; gap: .5rem; font-weight: 600; opacity: .95; }
.doc-preview .dp-top i { font-size: 1.5rem; }
.doc-preview .dp-title { font-size: 1.3rem; font-weight: 700; margin-top: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-preview .dp-num { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; letter-spacing: .14em; margin: .35rem 0 .7rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.doc-preview .dp-bottom { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; opacity: .9; }
.doc-preview .dp-btn { font: 600 .75rem/1 Inter, Cairo, sans-serif; letter-spacing: 0; background: rgba(255,255,255,.2); border: 0; color: #fff; border-radius: 999px; padding: .35rem .7rem; }
.doc-preview.big { max-width: 520px; }
.scan-slot { position: relative; aspect-ratio: 1.586; border-radius: 14px; border: 2px dashed rgba(15,23,42,.18); background: #f8fafc; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.scan-slot img { width: 100%; height: 100%; object-fit: cover; }
.scan-empty i { font-size: 2.2rem; color: #94a3b8; }
.scan-slot .photo-remove { position: absolute; top: 6px; inset-inline-end: 6px; }
.pdf-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; width: 100%; height: 100%; background: #fef2f2; color: #b91c1c; text-decoration: none; font-size: .7rem; padding: .3rem; text-align: center; word-break: break-all; }
.pdf-tile i { font-size: 1.6rem; }
.pdf-tile.big { aspect-ratio: .773; border-radius: 12px; }
.doc-scans { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.doc-scans figure { margin: 0; }
.doc-scans img { width: 100%; border-radius: 12px; box-shadow: 0 2px 10px rgba(15,23,42,.12); background: #f1f5f9; }
.doc-scans figcaption { font-size: .8rem; color: #64748b; margin-top: .35rem; text-align: center; }
.quick-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip-btn { border: 1px solid rgba(15,23,42,.12); background: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; }
.chip-btn:hover { border-color: var(--brand, #4f46e5); color: var(--brand, #4f46e5); }
@media (max-width: 575.98px) {
    .doc-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
    .doc-face { padding: 9px 10px; }
    .doc-face-top { font-size: .72rem; }
    .doc-face-top i { font-size: 1rem; }
    .doc-face-num { font-size: .78rem; letter-spacing: .06em; }
    .doc-info { padding: 9px 10px 11px; }
    .doc-info .chip { font-size: .68rem; }
    .doc-preview { padding: 16px 18px; }
    .doc-preview .dp-title { font-size: 1.1rem; }
}

/* ===================== Photo & scan tool ===================== */
body.pt-open { overflow: hidden; }
.pt-overlay, .pt-cam { position: fixed; inset: 0; z-index: 3000; background: #0b1020; color: #fff; display: flex; flex-direction: column; font-family: Inter, Cairo, sans-serif; -webkit-user-select: none; user-select: none; }
.pt-head { display: flex; align-items: center; gap: .75rem; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
.pt-title { font-weight: 700; flex: 1; }
.pt-count { font-size: .8rem; opacity: .7; }
.pt-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.05rem; }
.pt-stage { position: relative; flex: 1; min-height: 0; touch-action: none; overflow: hidden; background: repeating-conic-gradient(#121831 0 25%, #0e1429 0 50%) 0 0/24px 24px; }
.pt-canvas { position: absolute; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.pt-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.pt-mask { fill: rgba(5,8,20,.62); }
.pt-edge { fill: none; stroke: #facc15; stroke-width: 2.5; }
.pt-grid { stroke: rgba(250,204,21,.45); stroke-width: 1; stroke-dasharray: 4 4; }
.pt-handle { fill: rgba(250,204,21,.25); stroke: #facc15; stroke-width: 3; cursor: grab; }
.pt-loupe { position: absolute; top: 12px; left: 12px; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #facc15; display: none; background: #000; box-shadow: 0 6px 20px rgba(0,0,0,.5); pointer-events: none; }
.pt-loupe.right { left: auto; right: 12px; }
.pt-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: .35rem .8rem; border-radius: 999px; font-size: .8rem; white-space: nowrap; pointer-events: none; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.pt-busy { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .6rem; align-items: center; justify-content: center; background: rgba(11,16,32,.7); }
.pt-tools { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.pt-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 2px; }
.pt-row > :first-child { margin-inline-start: auto; }
.pt-row > :last-child { margin-inline-end: auto; }
.pt-row::-webkit-scrollbar { display: none; }
.pt-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #e2e8f0; border-radius: 999px; padding: .42rem .8rem; font-size: .82rem; font-weight: 500; }
.pt-chip.active { background: #facc15; border-color: #facc15; color: #111827; }
.pt-icon { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font-size: 1.1rem; }
.pt-foot { display: flex; gap: 10px; padding: 10px 14px max(14px, env(safe-area-inset-bottom)); }
.pt-btn { flex: 1; border: 0; border-radius: 14px; padding: .8rem 1rem; font-weight: 600; font-size: .95rem; }
.pt-alt { background: rgba(255,255,255,.12); color: #fff; }
.pt-main { background: #4f46e5; color: #fff; }
.pt-cam { background: #000; }
.pt-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pt-frame { position: absolute; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); }
.pt-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #facc15; }
.pt-frame i:nth-child(1) { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.pt-frame i:nth-child(2) { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.pt-frame i:nth-child(3) { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.pt-frame i:nth-child(4) { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.pt-cam-hint { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-weight: 600; text-shadow: 0 1px 6px #000; padding: 0 64px; }
.pt-cam-x { position: absolute; top: max(10px, env(safe-area-inset-top)); inset-inline-end: 12px; }
.pt-cam-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; padding-bottom: env(safe-area-inset-bottom); display: flex; align-items: center; justify-content: space-around; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.pt-shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 4px; }
.pt-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.pt-shutter:active span { transform: scale(.88); }
.pt-round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.3rem; }
.pt-round.active { background: #facc15; color: #111; }
.pt-cam-err { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.pt-cam-err i { font-size: 3rem; opacity: .7; }
.pt-cam-err .pt-btn { flex: 0 0 auto; }

.validation-summary-valid { display: none !important; }


/* ===================== Phone polish (Nov 2026) =====================
   Less scrolling before the content: one-row date chips, filters behind a button, compact stat tiles,
   no floating + over form buttons (see _Layout), safe areas for the phone app's notch and home bar. */
.range-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.range-custom-toggle { display: none; }
.search-box { position: relative; }
.search-box > i { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.search-box > .form-control { padding-inline-start: 2rem; }
@media (min-width: 992px) {
    .range-bar .range-custom { margin-inline-start: .5rem; }
    .list-search { flex: 0 1 260px; }
}
@media (max-width: 991.98px) {
    /* Date range: chips in one sideways-scrolling row; From–To only after "Custom". */
    .range-bar { display: block; }
    .range-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding: 2px 14px; scroll-snap-type: x proximity; }
    .range-chips::-webkit-scrollbar { display: none; }
    .range-chips .btn { flex: none; white-space: nowrap; scroll-snap-align: start; border-radius: 999px; padding: 5px 12px; }
    .range-custom-toggle { display: inline-flex; align-items: center; }
    .range-bar .range-custom { display: none !important; margin-top: 8px; width: 100%; }
    .range-bar.show-custom .range-custom { display: flex !important; }
    .range-bar .range-custom input[type=date] { flex: 1; width: auto !important; min-width: 0; }

    /* List filters: search + filter button on one line; the dropdowns open below. */
    .list-filters { width: 100%; }
    .list-search { width: 100%; }
    .list-filters .filter-more { display: none; max-width: none !important; flex: 1 1 45%; }
    .list-filters.open .filter-more { display: block; }
    .filter-toggle.active { background: var(--brand); color: #fff; }

    /* Tighter page header and spacing. */
    .topbar { padding: 10px 14px; }
    .topbar-title h1 { font-size: 1.15rem; }
    .content { padding-top: 12px; }
    .card, .stat { border-radius: 14px; }
}
@media (max-width: 575.98px) {
    /* Stat tiles: small icon beside the number instead of a tall card. */
    .stat { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
    .stat .icon { width: 32px; height: 32px; border-radius: 9px; font-size: .95rem; }
    .stat .label { font-size: .72rem; }
    .stat .value { font-size: 1.05rem; }
    .stat .sub { font-size: .68rem; }
    /* Three tiles in a row (e.g. Purchases) are too narrow for icon + text: stack them, icon smaller. */
    .col-4 > .stat { flex-direction: column; align-items: flex-start; gap: 6px; }
    .col-4 > .stat .icon { width: 28px; height: 28px; font-size: .85rem; }
    .row.g-3 { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
    .empty { padding: 28px 16px; }
}
/* Never let the floating + cover a form's Save / Cancel bar (also covered server-side in _Layout). */
body:has(.sticky-actions) .fab-wrap { display: none; }
/* Notch / home-bar safe areas (iPhone app and installed web app). */
@media (max-width: 991.98px) {
    .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
}

/* ===================== Friendlier look (Nov 2026) =====================
   Colourful app icons for every section (same list everywhere: Services/AppNav.cs), big tiles,
   a bell with a badge, a phone tab bar with an "All" screen, and a playful kid portal (Kotchina-style tabs). */
.tone-indigo { --t1: #818cf8; --t2: #4f46e5; }
.tone-violet { --t1: #a78bfa; --t2: #7c3aed; }
.tone-orange { --t1: #fdba74; --t2: #ea580c; }
.tone-amber  { --t1: #fcd34d; --t2: #d97706; }
.tone-blue   { --t1: #93c5fd; --t2: #2563eb; }
.tone-yellow { --t1: #fde047; --t2: #f59e0b; }
.tone-teal   { --t1: #5eead4; --t2: #0d9488; }
.tone-pink   { --t1: #f9a8d4; --t2: #db2777; }
.tone-green  { --t1: #86efac; --t2: #16a34a; }
.tone-rose   { --t1: #fda4af; --t2: #e11d48; }
.tone-purple { --t1: #d8b4fe; --t2: #9333ea; }
.tone-sky    { --t1: #7dd3fc; --t2: #0284c7; }
.tone-red    { --t1: #fca5a5; --t2: #dc2626; }
.tone-slate  { --t1: #cbd5e1; --t2: #475569; }
.tone-dark   { --t1: #475569; --t2: #0f172a; }
.tone-sun    { --t1: #fde68a; --t2: #f97316; }

/* App icon: white glyph on a glossy rounded square */
.app-ic, .nav-ic {
    position: relative; display: inline-grid; place-items: center; flex-shrink: 0; color: #fff;
    background: linear-gradient(145deg, var(--t1, #a5b4fc), var(--t2, #4f46e5));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px color-mix(in srgb, var(--t2, #4f46e5) 35%, transparent);
}
.app-ic { width: 58px; height: 58px; border-radius: 18px; font-size: 1.6rem; }
.app-ic.sm { width: 40px; height: 40px; border-radius: 13px; font-size: 1.1rem; }
.app-ic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.25), transparent 50%); pointer-events: none; }
.nav-ic { width: 30px; height: 30px; border-radius: 9px; font-size: .95rem; }
.app-badge, .tab-badge, .bell-count, .nav-count, .gnav-count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff;
    font-size: .7rem; font-weight: 800; line-height: 20px; text-align: center; font-style: normal; box-shadow: 0 0 0 2px #fff;
}
.app-badge { position: absolute; top: -6px; inset-inline-end: -6px; z-index: 1; }

/* Sidebar with coloured icons */
.side-nav a { gap: 10px; padding: 6px 10px; }
.side-nav a .nav-ic i { width: auto; opacity: 1; font-size: .95rem; }
.side-nav a.active { background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 #fbbf24; }
body.rtl .side-nav a.active { box-shadow: inset -3px 0 0 #fbbf24; }
.nav-count { box-shadow: none; }
.quick-add .dropdown-item .nav-ic { width: 28px; height: 28px; font-size: .9rem; }

/* Bell in the top bar */
.bell { position: relative; color: #f59e0b; }
.bell:hover { color: #d97706; }
.bell-count { position: absolute; top: -5px; inset-inline-end: -5px; }

/* Tiles: "All" screen and dashboard strip */
.tile-group-title { font-weight: 800; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 6px 2px 10px; }
body.rtl .tile-group-title { text-transform: none; letter-spacing: 0; font-size: .95rem; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 8px; }
.app-tile {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px 10px; border-radius: 18px;
    color: var(--text); text-align: center; background: transparent; border: 0; transition: transform .12s, background .15s;
}
.app-tile:hover { background: rgba(79,70,229,.06); color: var(--text); }
.app-tile:active { transform: scale(.93); }
.app-tile-label { font-size: .8rem; font-weight: 700; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
.app-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 8px; box-shadow: var(--shadow); }
@media (max-width: 991.98px) {
    .app-strip { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; margin-inline: -14px; border-radius: 0; border-inline: 0; padding: 8px 10px; }
    .app-strip::-webkit-scrollbar { display: none; }
    .app-strip .app-tile { flex: 0 0 82px; scroll-snap-align: start; }
    .app-strip .app-ic { width: 52px; height: 52px; font-size: 1.4rem; border-radius: 16px; }
}
.kids-waiting {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; color: #831843;
    background: linear-gradient(135deg, #fdf2f8, #fce7f3); border: 1px solid #fbcfe8; animation: pop-in .4s cubic-bezier(.2,.9,.3,1.3) both;
}
.kids-waiting:hover { color: #9d174d; box-shadow: 0 8px 22px rgba(219,39,119,.15); }

/* Phone tab bar */
.bottom-nav { padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(15,23,42,.06); }
.bottom-nav a { flex: 1; gap: 3px; padding: 4px 2px; min-width: 0; }
.bottom-nav a > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab-ic { position: relative; display: grid; place-items: center; width: 44px; height: 30px; border-radius: 999px; transition: background .15s; }
.tab-ic i { font-size: 1.2rem; }
.tab-badge { position: absolute; top: -4px; inset-inline-end: 2px; min-width: 18px; height: 18px; line-height: 18px; font-size: .62rem; padding: 0 5px; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active .tab-ic { background: var(--brand-soft); }
body[data-kid="1"] .bottom-nav a.active { color: #db2777; }
body[data-kid="1"] .bottom-nav a.active .tab-ic { background: #fce7f3; }

/* Notices list */
.notice { align-items: flex-start !important; }
.notice.unread .item-title { font-weight: 800; }
.notice.unread { background: linear-gradient(90deg, rgba(79,70,229,.05), transparent 70%); margin-inline: -18px; padding-inline: 18px !important; }
body.rtl .notice.unread { background: linear-gradient(-90deg, rgba(79,70,229,.05), transparent 70%); }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 8px; flex-shrink: 0; }
.text-wrap { white-space: normal; overflow-wrap: anywhere; }

/* Requests (parents) */
.ask-card { border-top: 4px solid var(--kid, var(--brand)); animation: pop-in .4s cubic-bezier(.2,.9,.3,1.3) both; }
.kid-dot { width: 40px; height: 40px; border-radius: 13px; color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }

/* Kid portal */
.kid-hero {
    position: relative; overflow: hidden; color: #fff; border-radius: 26px; padding: 18px 18px 14px;
    background: radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--kid, #14b8a6) 70%, #fff), var(--kid, #14b8a6) 45%, #4f46e5);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--kid, #14b8a6) 35%, transparent);
}
.kid-hero-bubbles span { position: absolute; font-size: 1.8rem; opacity: .35; animation: floaty 6s ease-in-out infinite; }
.kid-hero-bubbles span:nth-child(1) { top: 10%; inset-inline-end: 6%; }
.kid-hero-bubbles span:nth-child(2) { bottom: 14%; inset-inline-end: 30%; animation-delay: -1.5s; }
.kid-hero-bubbles span:nth-child(3) { top: 12%; inset-inline-end: 42%; animation-delay: -3s; }
.kid-hero-bubbles span:nth-child(4) { bottom: 8%; inset-inline-start: 40%; animation-delay: -4.5s; }
.kid-avatar { background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.6); }
.kid-hello { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.kid-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.kid-stats > div { background: rgba(255,255,255,.18); border-radius: 16px; padding: 8px 6px; text-align: center; backdrop-filter: blur(4px); }
.kid-stats b { display: block; font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kid-stats span { font-size: .72rem; opacity: .85; }
.kid-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kid-quick-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 20px;
    color: #fff; font-weight: 800; font-size: .85rem; text-align: center;
    background: linear-gradient(145deg, var(--t1), var(--t2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--t2) 35%, transparent);
    transition: transform .12s;
}
.kid-quick-tile:hover { color: #fff; transform: translateY(-2px); }
.kid-quick-tile:active { transform: scale(.94); }
.kid-quick-tile > span { font-size: 1.8rem; line-height: 1; }
.kid-quick-tile > b { position: absolute; top: 6px; inset-inline-end: 8px; background: #fff; color: var(--t2); border-radius: 999px; min-width: 22px; height: 22px; line-height: 22px; font-size: .75rem; }

/* Kotchina-style tab bar */
.gnav { display: flex; gap: 8px; overflow-x: auto; padding: 6px; background: #fff; border-radius: 18px; border: 1px solid var(--border);
        box-shadow: var(--shadow); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gnav::-webkit-scrollbar { display: none; }
.gnav-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 13px;
            color: var(--text); background: #f1f3fb; font-weight: 700; font-size: .92rem; white-space: nowrap;
            border: 1.5px solid transparent; transition: background .15s, transform .1s; }
.gnav-tab:hover { background: #e7e9fb; color: var(--brand); }
.gnav-tab:active { transform: scale(.96); }
.gnav-tab.on { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; box-shadow: 0 6px 14px rgba(139,92,246,.35); }
.gnav-ic { font-size: 1.1rem; line-height: 1; }
.gnav-count { min-width: 18px; height: 18px; line-height: 18px; font-size: .65rem; padding: 0 5px; box-shadow: none; }

/* Ask form */
.ask-form { border: 2px solid #fbcfe8; }
.ask-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.ask-kind { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; cursor: pointer;
            background: #f8fafc; border: 2px solid var(--border); font-weight: 700; font-size: .8rem; text-align: center; margin: 0; transition: transform .1s; }
.ask-kind span { font-size: 1.6rem; line-height: 1.1; }
.ask-kind:active { transform: scale(.95); }
.btn-check:checked + .ask-kind { border-color: #ec4899; background: #fdf2f8; color: #9d174d; box-shadow: 0 4px 12px rgba(236,72,153,.2); }
.ask-amount { display: none; }
.ask-form:has(#ask-Money:checked) .ask-amount, .ask-form:has(#ask-BuySomething:checked) .ask-amount { display: block; }

/* Gentle motion (off when the phone asks for less motion) */
.card { animation: pop-in .35s ease both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .card, .kids-waiting, .ask-card, .kid-hero-bubbles span { animation: none !important; } }
@media (max-width: 575.98px) {
    .app-grid { grid-template-columns: repeat(4, 1fr); gap: 10px 2px; }
    .app-ic { width: 54px; height: 54px; font-size: 1.45rem; border-radius: 17px; }
    .app-tile-label { font-size: .72rem; }
    .kid-hello { font-size: 1.3rem; }
    .kid-stats b { font-size: 1rem; }
    .kid-quick-tile { font-size: .75rem; padding: 10px 2px; }
    .kid-quick-tile > span { font-size: 1.5rem; }
}

/* ---------- Voice notes: recorder, dictation buttons, players ---------- */
.voice-stage { text-align: center; padding: 8px 0 18px; }
.voice-btn {
    width: 96px; height: 96px; border-radius: 50%; border: 0; color: #fff; font-size: 2.4rem;
    background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 12px 28px rgba(225, 29, 72, .35);
    display: inline-flex; align-items: center; justify-content: center; transition: transform .15s ease;
}
.voice-btn:active { transform: scale(.95); }
.voice-form.recording .voice-btn { background: #0f172a; animation: voicePulse 1.4s ease-in-out infinite; }
.voice-clock { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 10px 0 8px; color: var(--muted); }
.voice-form.recording .voice-clock { color: #e11d48; }
.voice-form [data-voice-lang].active { background: var(--brand); border-color: var(--brand); color: #fff; }
@keyframes voicePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .45); } 50% { box-shadow: 0 0 0 18px rgba(225, 29, 72, 0); } }
.voice-player { height: 40px; max-width: 520px; }
.voice-snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dictate-btn.listening { background: #e11d48; color: #fff; animation: voicePulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .voice-form.recording .voice-btn, .dictate-btn.listening { animation: none; } }

/* ---------- Calls: "did you talk to them?" sheet, review card ---------- */
.call-sheet {
    position: fixed; inset-inline: 12px; bottom: 96px; z-index: 2000; max-width: 460px; margin-inline: auto;
    background: #0f172a; color: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, .4);
    display: flex; gap: 12px; align-items: flex-start; animation: toastIn .25s ease;
}
.call-sheet-ic { width: 38px; height: 38px; border-radius: 12px; background: #f59e0b; display: flex; align-items: center; justify-content: center; flex: none; }
.call-sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.call-sheet-x { background: transparent; border: 0; color: #94a3b8; }
.review-card { border-color: #fde68a; background: #fffbeb; }

/* ---------- "Still to do" screen ---------- */
.nudge-card { overflow: hidden; }
.nudge-card .task-hero-bar { height: 6px; background: var(--task-color, var(--brand)); }
.nudge-group { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
