/* KidsTube parent dashboard + public site (redesign, Nov 2026). Self-hosted: no web fonts, no CDN, no JavaScript needed.
   Visual system from the design canvas: zinc ink, white cards, orange brand (#F97316 shapes, #C2410C text), blue links. */
:root {
  --bg: #F7F7F8; --surface: #FFFFFF; --surface-2: #FAFAFA; --surface-3: #F4F4F5; --ink: #18181B; --ink-2: #3F3F46;
  --muted: #52525B; --sub: #71717A; --line: #E4E4E7; --line-2: #F1F1F3;
  --brand: #F97316; --brand-ink: #C2410C; --brand-soft: #FFF7ED; --cream: #FFF8F1;
  --link: #1D4ED8; --link-2: #1E40AF; --blue-soft: #EFF4FF; --blue: #2563EB;
  --ok: #15803D; --ok-soft: #ECFDF3; --warn: #B45309; --warn-soft: #FFF7ED; --bad: #B91C1C; --bad-soft: #FEF2F2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05); --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --r: 12px; --r-sm: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Nastaliq Urdu", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-2); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); } .sub { color: var(--sub); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16px; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.logo { width: 30px; height: 30px; flex: none; display: block; }
.logo svg { width: 100%; height: 100%; display: block; }
.env { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-3); color: var(--sub); border-radius: 6px; padding: 1px 7px; }

/* ---------- Buttons and fields ---------- */
input, select, textarea, button { font: inherit; color: var(--ink); }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 12px; min-height: 36px; max-width: 100%; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 16px; height: 16px; padding: 0; accent-color: var(--ink); vertical-align: -3px; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
input[aria-invalid=true] { border-color: var(--bad); }
label { color: var(--ink-2); font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.field > span.hint, .hint { font-size: 12.5px; font-weight: 400; color: var(--sub); }
.field .ferr { font-size: 12.5px; color: var(--bad); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
/* default button = primary (ink) */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; min-height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: var(--ink); color: #FFFFFF; font-weight: 500; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background .15s; }
button:hover, .btn:hover { background: #27272A; color: #FFFFFF; }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); color: var(--ink); }
button.danger, .btn.danger { background: var(--bad); color: #fff; } button.danger:hover, .btn.danger:hover { background: #991B1B; }
button.danger-soft, .btn.danger-soft { background: var(--surface); color: var(--bad); border-color: #FECACA; }
button.danger-soft:hover, .btn.danger-soft:hover { background: var(--bad-soft); color: var(--bad); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--link); font-weight: 500; }
button.link:hover { background: none; color: var(--link-2); text-decoration: underline; }
button[disabled], .btn[aria-disabled=true] { color: var(--sub); background: var(--surface-3); border-color: var(--line); box-shadow: none; cursor: default; }
.btn.lg, button.lg { min-height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn.block, button.block { width: 100%; }
button.sm, .btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

/* "⋯" menu without JavaScript (details/summary) */
details.more { position: relative; display: inline-block; }
details.more > summary { list-style: none; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
details.more .menu { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; text-align: left; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: 6px; color: var(--ink); font-size: 13px; font-weight: 500; background: none; border: 0; text-align: left; justify-content: flex-start; white-space: normal; }
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--ink); }
.menu .danger-item, .menu button.danger-item { color: var(--bad); }
.menu .mh { font-size: 11.5px; font-weight: 600; color: var(--sub); padding: 6px 10px 4px; }
.menu .ms { display: block; font-size: 12px; font-weight: 400; color: var(--sub); }
.menu .sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.menu form { margin: 0; }
/* confirm box (inline, opened from a ⋯ menu) */
details.confirm > summary { list-style: none; cursor: pointer; }
details.confirm > summary::-webkit-details-marker { display: none; }
.confirm-box { margin-top: 10px; border: 1px solid #FECACA; background: var(--bad-soft); border-radius: 10px; padding: 14px 16px; color: var(--ink); }
.confirm-box b { display: block; margin-bottom: 4px; }
.confirm-box p { color: var(--muted); font-size: 13px; }

/* ---------- Generic pieces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin: 0 0 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: visible; }
.card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head p { margin: 3px 0 0; color: var(--sub); font-size: 13px; }
.card.flush > .card-head { padding: 16px 18px; margin: 0; border-bottom: 1px solid var(--line-2); }
.card-foot { border-top: 1px solid var(--line-2); margin: 16px -20px -18px; padding: 12px 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }
.card.flush > .card-foot { margin: 0; }
.ch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.ch-row:first-child, .card-head + .ch-row { border-top: 0; }
.ch-row .grow { flex: 1 1 260px; min-width: 0; }
.ch-row.attn { background: #FFFCF8; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.grid > .card { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row label { display: inline-flex; align-items: center; gap: 8px; }
.pill, .badge { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 1.6; border: 0; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.brand, .badge.blue { background: var(--blue-soft); color: var(--link); }
.badge svg.i { width: 13px; height: 13px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.bar.full > i { background: var(--bad); }
.thumb { width: 112px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 8px; background: var(--surface-3); display: block; flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; flex: none; font-size: 14px; background: var(--blue-soft); color: var(--link); }
.avatar.alt { background: var(--ok-soft); color: var(--ok); }
.avatar.c2 { background: #F5F3FF; color: #6D28D9; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; border-radius: 12px; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
.avatar.me { border-radius: 99px; background: var(--ink); color: #fff; width: 30px; height: 30px; font-size: 12px; }
.iconbox { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); }
.iconbox.warn { background: var(--warn-soft); color: var(--warn); } .iconbox.ok { background: var(--ok-soft); color: var(--ok); }
.iconbox.bad { background: var(--bad-soft); color: var(--bad); } .iconbox.blue { background: var(--blue-soft); color: var(--link); }
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: 10px; padding: 12px 14px; margin: 0 0 20px; font-weight: 500; border: 1px solid transparent; }
.notice svg.i { margin-top: 2px; }
.notice > div { min-width: 0; }
.notice.msg { background: var(--ok-soft); color: var(--ok); border-color: #BBF7D0; }
.notice.err { background: var(--bad-soft); color: var(--bad); border-color: #FECACA; }
.notice.warnbox { background: var(--warn-soft); color: #92400E; border-color: #FED7AA; }
.notice.info { background: var(--surface); color: var(--ink-2); border-color: var(--line); font-weight: 400; }
.notice a { color: inherit; font-weight: 600; text-decoration: underline; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty svg.i { width: 28px; height: 28px; color: var(--sub); display: block; margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kv div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; }
.kv span { display: block; font-size: 12px; color: var(--sub); font-weight: 500; }
.kv b { font-size: 15px; font-weight: 600; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.status .s { display: inline-flex; align-items: center; gap: 8px; }
.status .s .dot { width: 8px; height: 8px; }
.status a.s { font-weight: 600; color: var(--warn); }
.status .sep { color: #A1A1AA; }
.big { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 9px; flex-wrap: wrap; }
.seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 7px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.seg .n { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--line); border-radius: 5px; padding: 0 6px; line-height: 18px; }
.seg a.on .n { background: var(--warn-soft); color: var(--warn); }
.ichip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.ichip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.checklist li:first-child { border-top: 0; }
.checklist .tick { width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; flex: none; border: 1.5px solid var(--line); color: transparent; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist li.done .t { color: var(--muted); }
.checklist .t { flex: 1; min-width: 0; } .checklist .t b { display: block; font-weight: 600; }

/* Video thumbnail placeholder (no image yet) */
.tn { position: relative; width: 112px; height: 63px; border-radius: 8px; overflow: hidden; flex: none; background: linear-gradient(135deg, var(--a, #60A5FA), var(--b, #1E3A8A)); color: #fff; }
.tn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tn .d { position: absolute; right: 5px; bottom: 5px; font: 600 10.5px/16px var(--font); padding: 0 5px; border-radius: 4px; background: rgba(24, 24, 27, .85); color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.card.flush .table-wrap { margin: 0; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; }
th { font-weight: 500; font-size: 12px; color: var(--sub); background: var(--surface-2); border-bottom-color: var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr.muted td { color: var(--sub); }
tr.muted td b, tr.muted td a { color: var(--muted); }
td form { margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; color: var(--ink); }
a.stat:hover { color: var(--ink); background: var(--surface-2); }
.stat .ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--link); flex: none; }
.stat .ic.mint { background: var(--ok-soft); color: var(--ok); } .stat .ic.sun { background: var(--warn-soft); color: var(--warn); } .stat .ic.coral { background: var(--bad-soft); color: var(--bad); }
.stat b { display: block; font-size: 20px; font-weight: 650; line-height: 1.25; }
.stat span { font-size: 13px; color: var(--sub); }

/* ---------- App shell (signed in) ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface-2); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { padding: 4px 8px 14px; }
.side .fam { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 500; font-size: 13.5px; color: var(--ink); }
.side .fam span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); padding: 0 10px; margin: 18px 0 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: #F0F0F2; color: var(--ink); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.nav a .count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--link); background: var(--blue-soft); border-radius: 6px; padding: 1px 7px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 4px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; flex: 1; line-height: 1.3; }
.side-foot .who b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { display: block; font-size: 12px; color: var(--sub); }
.side-foot form { margin: 0; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 60px; padding: 10px 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.topbar .crumbs b { font-weight: 600; }
.topbar .search { margin-left: auto; position: relative; flex: 0 1 320px; min-width: 180px; }
.topbar .search svg.i { position: absolute; left: 11px; top: 10px; color: var(--sub); }
.topbar .search input { width: 100%; padding-left: 34px; background: var(--surface-2); }
.topbar .me-link, .topbar .tb-brand { display: none; }
.page { max-width: 1240px; width: 100%; margin: 0; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.crumb { font-size: 13px; color: var(--sub); margin-bottom: 8px; display: inline-flex; gap: 6px; align-items: center; }
.foot { color: var(--sub); font-size: 12px; margin-top: 32px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.tabbar { display: none; }

/* ---------- Child card ---------- */
.kid { display: flex; flex-direction: column; gap: 12px; }
.kid-head { display: flex; gap: 12px; align-items: center; }
.kid-head > div { min-width: 0; flex: 1; }
.kid-head h2 { margin: 0 0 2px; font-size: 15px; }
.kid-head h2 a { color: var(--ink); }
.kid-time { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.kid-time b { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.kid-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.playing { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--ok-soft); color: var(--ok); border-radius: 10px; font-size: 13.5px; font-weight: 500; }
.idle { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; }

/* ---------- Video list ---------- */
.vid { display: flex; gap: 14px; align-items: center; min-width: 280px; }
.vid b { display: block; font-weight: 600; line-height: 1.35; margin-bottom: 3px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; margin: 0 0 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; }

/* ---------- Public site (landing v2) ---------- */
.pub { background: var(--cream); color: var(--ink); }
.pub-nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 248, 241, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #F3E3D3; }
.pub-nav .in { max-width: 1160px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.pub-nav .links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.pub-nav .links a:not(.btn) { color: var(--ink-2); font-weight: 500; font-size: 14px; }
.pub-nav .links .short { display: none; }
.pub a:not(.btn) { color: var(--brand-ink); }
.pub .brand, .pub .brand:hover { color: var(--ink); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 80px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--brand-ink); background: #FFEDD5; padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -.035em; font-weight: 750; margin-bottom: 20px; }
.grad { color: var(--brand-ink); }
.lead { font-size: 18px; color: var(--muted); max-width: 560px; margin-bottom: 28px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.trust { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; color: var(--muted); font-size: 14px; }
.trust span { display: inline-flex; gap: 8px; align-items: center; }
.trust svg.i { color: var(--ok); }
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(120, 53, 15, .12); padding: 18px; }
.mock-top { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; color: var(--sub); font-size: 12px; font-weight: 500; }
.mock-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-top span { margin-left: auto; }
.mock .kid + .kid { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 14px; }
.section { padding: 72px 0; }
.section.alt { background: var(--surface); border-top: 1px solid #F3E3D3; border-bottom: 1px solid #F3E3D3; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -.03em; font-weight: 700; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.section.alt .feature { background: var(--cream); border-color: #F3E3D3; }
.feature .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; background: #FFEDD5; color: var(--brand-ink); }
.feature .ic svg.i { width: 20px; height: 20px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.step { padding: 26px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.step::before { counter-increment: s; content: counter(s); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand); color: #fff; margin-bottom: 14px; }
.step h3 { font-size: 16px; margin-bottom: 6px; } .step p { color: var(--muted); margin: 0; }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.band { margin: 0 auto; max-width: 1112px; border-radius: 22px; padding: 48px 52px; color: #fff; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--ink); }
.band h2 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.band p { color: #D4D4D8; margin: 0; font-size: 16px; }
.band .btn { background: var(--brand); color: #fff; } .band .btn:hover { background: #EA580C; }
.pub-foot { padding: 36px 0 44px; color: var(--muted); font-size: 14px; }
.pub-foot .in { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.pub-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Auth and onboarding (sign in, sign up, invite, verify, reset): cream, orange-700 links ---------- */
.auth { min-height: 100vh; background: var(--cream); display: flex; flex-direction: column; align-items: center; padding: 40px 16px 48px; }
.auth a:not(.btn) { color: var(--brand-ink); font-weight: 500; }
.auth .brand { margin-bottom: 28px; }
.auth input:focus { border-color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(194, 65, 12, .18); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid #F3E3D3; border-radius: 16px; padding: 28px; box-shadow: 0 8px 24px rgba(120, 53, 15, .06); }
.auth-card.wide { max-width: 520px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); margin-bottom: 22px; }
.auth-card .help { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.auth-card .notice { margin-bottom: 16px; }
.auth .below { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; }
.devlink { background: var(--warn-soft); border: 1px dashed #FDBA74; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 13px; color: #92400E; }
.devlink a { word-break: break-all; }
.code-input { font: 600 22px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .3em; text-align: center; }

/* ---------- Reports, requests, account ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; margin: 4px 0 16px; }
.week .d { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 12px; color: var(--sub); min-width: 0; }
.week .d i { display: block; width: 100%; max-width: 40px; background: var(--blue); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.week .d i.lim { background: #F59E0B; }
.week .d b { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--sub); margin-top: -8px; margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--blue); margin-right: 6px; vertical-align: -1px; }
.legend i.lim { background: #F59E0B; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.list li:first-child { border-top: 0; }
.list li span:last-child { color: var(--sub); white-space: nowrap; }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-2); }
.switch:first-of-type { border-top: 0; }
.switch input { margin-top: 3px; }
.switch b { display: block; font-weight: 600; }
.switch span { font-size: 13px; color: var(--sub); }
.linkbox { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }
.weeknav { display: flex; gap: 8px; align-items: center; }
.dev-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.danger-zone { border-color: #FECACA; }
.danger-zone h2 { color: var(--bad); }

/* ---------- Phone (under 900 px): top bar + bottom tab bar ---------- */
@media (max-width: 900px) {
  body { font-size: 15px; }
  .shell { display: block; padding-bottom: 76px; }
  .side { display: none; }
  .topbar { position: sticky; top: 0; z-index: 20; min-height: 56px; padding: 0 12px 0 16px; flex-wrap: nowrap; }
  .topbar .crumbs, .topbar .search { display: none; }
  .topbar .tb-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; color: var(--ink); min-width: 0; }
  .topbar .tb-brand .logo { width: 28px; height: 28px; }
  .topbar .tb-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .me-link { display: flex; margin-left: auto; width: 44px; height: 44px; align-items: center; justify-content: center; }
  .page { padding: 20px 16px 28px; }
  h1 { font-size: 22px; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  button, .btn { min-height: 44px; font-size: 15px; border-radius: 10px; }
  button.sm, .btn.sm { min-height: 36px; font-size: 14px; }
  .iconbtn { width: 44px; height: 44px; }
  .card { padding: 16px; } .table-wrap { margin: 0 -16px; padding: 0 16px; } .card-foot { margin: 16px -16px -16px; padding: 12px 16px; }
  .ch-row { padding: 14px 16px; }
  .ch-row > .row:last-child { width: 100%; } .ch-row > .row:last-child > * { flex: 1; }
  .thumb, .tn { width: 96px; height: 54px; }
  .badge { white-space: normal; font-size: 13px; }
  .nav a { min-height: 44px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: var(--sub); font-size: 11.5px; font-weight: 500; position: relative; }
  .tabbar a svg.i { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--ink); font-weight: 600; }
  .tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; border-radius: 99px; min-width: 18px; line-height: 18px; text-align: center; padding: 0 5px; }
  .hero { padding: 44px 0 40px; } .hero-grid, .features, .steps { grid-template-columns: 1fr; }
  .hero-grid { gap: 32px; }
  .pub-nav .links { gap: 14px; }
  .pub-nav .links a:not(.btn):not(.signin) { display: none; }  /* section links hide; Sign in stays */
  .pub-nav .links .signin { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; }
  .pub-nav .links .long { display: none; } .pub-nav .links .short { display: inline; }
  .section { padding: 52px 0; } .band { padding: 30px 22px; margin: 0 16px; }
  .wrap, .pub-nav .in { padding-left: 16px; padding-right: 16px; }
  .auth { padding-top: 28px; } .auth-card { padding: 22px 18px; }
}

/* ---------- Operator console (server operator only, apart from the family dashboard) ---------- */
.op-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 56px; padding: 8px 32px; background: #18181B; color: #F4F4F5; }
.op-bar .brand { color: #fff; }
.op-bar .chip { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #FDBA74; border: 1px solid #52525B; border-radius: 6px; padding: 2px 8px; }
.op-bar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.op-bar a { color: #E4E4E7; }
.op-bar button.ghost { color: #E4E4E7; }
.op-page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 48px; }
@media (max-width: 760px) { .op-bar, .op-page { padding-left: 16px; padding-right: 16px; } }

/* UX quick wins: folding cards, sticky bulk-action bar, device status */
details.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; color: var(--muted); margin-left: 4px; }
details.fold[open] > summary::after { content: "▴"; }
.actionbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 8px; padding: 10px 0; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.online { color: var(--ok); font-weight: 600; }
.online .dot { color: var(--ok); }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.steps li { margin: 3px 0; }
.dev-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); flex: none; }

/* Child page: tabs, mode cards, picks strip, day rules, history day headers */
.seg.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; margin: 0 0 20px; scrollbar-width: none; }
.seg.tabs::-webkit-scrollbar { display: none; }
.seg.tabs a { white-space: nowrap; min-height: 36px; font-size: 14px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mode { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.mode > span { display: flex; flex-direction: column; gap: 4px; }
.mode input { margin-top: 3px; }
.mode:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--surface-2); }
.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.picks img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; background: var(--surface-3); }
.dayrule { padding: 14px 0; border-top: 1px solid var(--line-2); }
.dayrule:first-of-type { border-top: 0; }
.dayrule fieldset { border: 0; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; }
.dayrule fieldset:disabled { opacity: .5; }
.dayrule .field { margin-bottom: 8px; }
.dayhead { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 18px 6px; background: var(--surface-2); border-top: 1px solid var(--line-2); }
@media (max-width: 600px) { .picks { grid-template-columns: repeat(2, 1fr); } }

/* Round 1: row actions, quiet destructive buttons, tables that stack on phones */
td.rowact { white-space: nowrap; text-align: right; }
td.rowact button + button { margin-left: 6px; }
.danger-text { color: var(--bad) !important; }
.switch.muted { opacity: .6; }
@media (max-width: 700px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:has(> th) { display: none; }
  table.stack tr { padding: 12px 0; border-top: 1px solid var(--line-2); }
  table.stack tr:first-child, table.stack tr:has(> th) + tr { border-top: 0; }
  table.stack td { border: 0 !important; padding: 2px 0 !important; text-align: left !important; white-space: normal !important; }
  table.stack td:empty { display: none; }
  table.stack td .row { flex-wrap: wrap !important; }
  td.rowact { padding-top: 8px !important; }
  .status .sep { display: none; }
  .status { gap: 4px 12px; }
  .hide-phone { display: none !important; }
}
@media (max-width: 700px) {
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--sub); font-size: 12.5px; font-weight: 500; }
  .ch-row .grow { flex-basis: 180px; }
  .ch-row .tn { width: 96px; height: 54px; }
}

/* Round 3 */
.mode input, .modes input[type=radio] { width: auto !important; flex: none; }
.chgroups { margin: 0 0 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.chgroup { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-2); }
.chgroup:first-of-type { border-top: 0; }
.week .d.future span { color: var(--sub); font-style: italic; }
@media (max-width: 700px) {
  .homeflow { display: flex; flex-direction: column; }
  .homeflow .kids { order: -1; }
  table.libtable tr { display: grid !important; grid-template-columns: 30px 1fr; gap: 4px 8px; }
  table.libtable td:nth-child(n+3) { grid-column: 1 / -1; padding-left: 38px !important; }
  table.libtable td:first-child { padding-top: 6px !important; }
  table.libtable .vid { align-items: flex-start; }
  table.libtable .vid .thumb { width: 96px; height: 54px; }
}
.week .d i { flex: none; }  /* bar heights are a share of the space left after the labels */
.show-phone { display: none; }
@media (max-width: 700px) { .show-phone { display: inline; } }

/* Library bulk bar only once something is ticked */
.actionbar .bulk { display: none; }
form:has(input[name=video_id]:checked) .actionbar .bulk { display: flex; }
form:has(input[name=video_id]:checked) .actionbar .bulk-hint { display: none; }
@media (max-width: 700px) {
  .seg.tabs { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 24px; }
  details.fold > summary { flex-wrap: nowrap; }
  details.fold > summary > .small.muted { display: none; }
}

/* Library: channel cards (To review) */
.chcard { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; background: var(--surface); }
.chcard.dim { background: var(--surface-2); }
.chcard-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 12px 14px; }
.chcard-head .grow { flex: 1 1 260px; min-width: 0; }
.chcard .chages { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
details.agesform { display: inline-block; }
details.agesform > summary { cursor: pointer; color: var(--blue); list-style: none; }
details.agesform > summary::-webkit-details-marker { display: none; }
details.chvideos { border-top: 1px solid var(--line-2); padding: 8px 14px; }
details.chvideos > summary { cursor: pointer; color: var(--sub); }
details.chvideos .table-wrap { margin-top: 6px; }
.grouphead { margin: 14px 0 8px; font-size: 14px; }
.grouphead:first-of-type { margin-top: 4px; }
@media (max-width: 430px) {
  .seg.tabs a { padding: 0 9px; font-size: 13px; }
  .seg.tabs .n { padding: 0 4px; }
}

/* Round 9 */
.picks .pick { display: block; color: var(--ink); min-width: 0; }
.picks .pt { display: block; font-size: 12.5px; font-weight: 600; margin-top: 4px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.picks .pc { display: block; font-size: 11.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid span.small { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .seg.tabs.wrap { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-right: 3px; }
  .checklist li { flex-wrap: wrap; }
  .checklist li .btn { margin-left: 34px; }
}
@media (max-width: 700px) { .checklist li .t { flex: 1 1 220px; } }
@media (max-width: 700px) { .show-phone.btn { display: flex; } }
.vid > div { min-width: 0; flex: 1 1 auto; }
.vid .small a { white-space: normal; }
@media (max-width: 700px) {
  .vid { min-width: 0; }
  .ch-row .row > details.more > summary.btn, .ch-row form.row button { flex: 1 1 auto; }
}

/* Polish for 9/10 */
.childrule .usefam { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: 8px; font-size: 14px; }
.childrule fieldset, .childrule .ownnote { display: none; }
.childrule.own fieldset { display: grid; }
.childrule.own .ownnote { display: block; }
.childrule.own .usefam { display: none; }
label.linkish { color: var(--blue); cursor: pointer; }
.childrule fieldset:disabled { opacity: 1; }
@media (max-width: 700px) {
  .history-row { flex-wrap: nowrap !important; }
  .history-row .grow { flex: 1 1 auto; min-width: 0; }
  .history-row details.more > summary { padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
  .kv.compact { grid-template-columns: 1fr; gap: 6px; }
  .kv.compact div { padding: 8px 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; }
  .kv.compact span { display: inline; }
  .kv.compact b { font-size: 14px; }
  .dayrule fieldset { grid-template-columns: 1fr 1fr; }
  .dayrule fieldset .field:first-child { grid-column: 1 / -1; }
}

/* Accessibility: links inside text are underlined, not told apart by colour alone (WCAG 1.4.1) */
p a:not(.btn), li a:not(.btn), .small a:not(.btn), .hint a, .notice a:not(.btn), td a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }

/* Phones: menus open as a sheet above the tab bar, always fully on screen */
@media (max-width: 700px) {
  details.more .menu { position: fixed; left: 8px; right: 8px; top: auto; bottom: calc(68px + env(safe-area-inset-bottom)); width: auto !important; max-height: 65vh; overflow: auto; z-index: 60; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
  details.more .menu button { min-height: 44px; }
}

/* Round 14 */
details.more .menu button.real { justify-content: center; background: var(--ink); color: #fff; border-radius: 8px; min-height: 40px; padding: 0 16px; font-weight: 600; }
details.more .menu button.real.secondary { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
details.more .menu button.real.danger-text { color: var(--bad); }
.seg.tabs { width: fit-content; }
.ferr { display: block; color: var(--bad); font-size: 12.5px; font-weight: 500; margin-top: 4px; }
html { scroll-padding-top: 76px; }

.starter { display: grid; gap: 2px; }
.starter button { justify-self: start; margin-top: 8px; }

.devq { flex-basis: 100%; margin: 4px 0 0 54px; }
.devq-btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) { .devq { margin-left: 0; } .devq-btns button { flex: 1 1 140px; } }
