/* apParently Admin — control-panel layout (on top of styles.css tokens). Font: Inter. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
:root{
  --font:'Inter',-apple-system,system-ui,sans-serif; --font-display:'Inter',sans-serif;
  --bg:#F4F5F7; --card:#FFFFFF; --ink:#1E2430; --ink-2:#5A6472; --ink-3:#8A93A0;
  --line:#EAECEF; --line-2:#E1E4E8;
  --green:#5FBB16; --green-soft:#EAF7DC; --green-deep:#3E8A0A;
  --blue:#1C8AD0; --amber:#F5921E; --purple:#A855F7; --red:#F0574C; --teal:#0FA9A0;
}
*{box-sizing:border-box}
body{margin:0;font-family:var(--font);color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
.wrap{display:flex;min-height:100vh}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.page{padding:22px 26px 40px;max-width:1280px;width:100%;margin:0 auto;display:flex;flex-direction:column;gap:18px}

/* sidebar */
.sidebar{width:218px;flex-shrink:0;background:var(--card);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:16px 12px;gap:2px;position:sticky;top:0;height:100vh;overflow-y:auto}
.brand{display:flex;align-items:center;gap:10px;padding:6px 8px 16px}
.brand .shield{width:30px;height:34px;display:flex;align-items:center;justify-content:center;color:#6B4E00;font-weight:900;font-size:12px;background:linear-gradient(180deg,#FFD86B,#E4A100);border-radius:8px}
.brand .bn{font-weight:800;font-size:15px;letter-spacing:-.02em}.brand .bn b{color:var(--amber);font-weight:800}
.brand .bs{font-size:9px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-3)}
.sidebar .sec{font-size:10px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-3);padding:14px 10px 5px}
.item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:9px;font-weight:600;font-size:13.5px;color:var(--ink-2);text-decoration:none;position:relative}
.item:hover{background:var(--bg)}
.item.active{background:var(--green-soft);color:var(--green-deep);font-weight:700}
.item.active::before{content:'';position:absolute;left:0;top:6px;bottom:6px;width:3px;border-radius:3px;background:var(--green)}
.item .ic{width:18px;height:18px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-size:14px;opacity:.85}
.item .badge{margin-left:auto;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--red);color:#fff;font-size:10.5px;font-weight:800;display:flex;align-items:center;justify-content:center}
.item.child .av{width:22px;height:22px;border-radius:999px;color:#fff;font-weight:800;font-size:11px;display:flex;align-items:center;justify-content:center}
.sb-foot{margin-top:auto;padding:10px 8px;display:flex;align-items:center;gap:9px;border-top:1px solid var(--line)}
.sb-foot .av{width:30px;height:30px;border-radius:999px;color:#fff;font-weight:800;font-size:13px;display:flex;align-items:center;justify-content:center}
.sb-foot .nm{font-weight:700;font-size:12.5px}.sb-foot .rl{font-size:10px;font-weight:700;color:var(--ink-3);text-transform:uppercase;letter-spacing:.05em}
.sb-foot .logout{margin-left:auto;background:none;border:none;color:var(--ink-3);font-size:16px;cursor:pointer}

/* topbar */
.topbar{height:60px;padding:0 26px;background:var(--card);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:14px;position:sticky;top:0;z-index:20}
.tb-title{font-weight:800;font-size:18px;letter-spacing:-.01em}
.tb-sub{font-size:11px;font-weight:700;color:var(--ink-3);text-transform:uppercase;letter-spacing:.05em;margin-top:1px}
.child-chip{display:inline-flex;align-items:center;gap:7px;padding:5px 12px 5px 6px;border-radius:999px;background:var(--green-soft);color:var(--green-deep);font-weight:700;font-size:12.5px}
.child-chip .av{width:22px;height:22px;border-radius:999px;color:#fff;font-weight:800;font-size:11px;display:flex;align-items:center;justify-content:center}
.tb-search{margin-left:auto;display:flex;align-items:center;background:var(--bg);border:1px solid var(--line);border-radius:10px;height:38px;padding:0 12px;max-width:280px;flex:1}
.tb-search input{border:none;background:none;outline:none;font-family:var(--font);font-weight:600;font-size:13px;flex:1;color:var(--ink)}
.tb-bell{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:var(--card);cursor:pointer;font-size:15px}

/* cards + primitives */
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.card-title{font-weight:800;font-size:15px;letter-spacing:-.01em}
.card-sub{font-size:12px;font-weight:600;color:var(--ink-3);margin-top:2px}
.link-sm{font-size:12.5px;font-weight:700;color:var(--blue);text-decoration:none}
.grid{display:grid;gap:16px}.g2{grid-template-columns:1fr 1fr}.g4{grid-template-columns:repeat(4,1fr)}
.g-main{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
@media(max-width:1000px){.g4{grid-template-columns:1fr 1fr}.g-main,.g2{grid-template-columns:1fr}}

/* stat tile */
.stile{display:flex;align-items:center;gap:13px;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px}
.stile .si{width:42px;height:42px;border-radius:12px;flex-shrink:0;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px}
.stile .sn{font-weight:800;font-size:21px;letter-spacing:-.02em;line-height:1}
.stile .sl{font-size:11.5px;font-weight:600;color:var(--ink-3);margin-top:4px}

/* child card */
.kidcard{display:flex;align-items:center;gap:14px;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px}
.kidcard .kav{width:44px;height:44px;border-radius:999px;color:#fff;font-weight:800;font-size:18px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.kidcard .kn{font-weight:800;font-size:15px}
.kidcard .km{font-size:11.5px;font-weight:600;color:var(--ink-3);margin-top:2px}
.kidcard .kview{margin-left:auto;padding:7px 16px;border-radius:9px;border:1px solid var(--line-2);background:var(--card);font-weight:700;font-size:12.5px;cursor:pointer;text-decoration:none;color:var(--ink)}
.dot-on{color:var(--green);font-weight:800}.dot-off{color:var(--ink-3);font-weight:700}

/* pills */
.pill{display:inline-flex;align-items:center;padding:3px 10px;border-radius:7px;font-size:10.5px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;white-space:nowrap}
.pill.neutral{background:var(--bg);color:var(--ink-2)}
.pill.ok,.pill.active,.pill.safe{background:var(--green-soft);color:var(--green-deep)}
.pill.warn,.pill.blocked{background:#FDE7CF;color:#8B5A00}
.pill.danger,.pill.high{background:#FDE3E1;color:#C0392B}
.pill.info{background:#DEEFFB;color:#136AA6}
.pill.purple{background:#F1E5FE;color:#7A2CC0}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:38px;padding:0 16px;border-radius:10px;border:1px solid var(--line-2);background:var(--card);font-family:var(--font);font-weight:700;font-size:13px;cursor:pointer;color:var(--ink);text-decoration:none}
.btn.sm{height:32px;padding:0 12px;font-size:12px;border-radius:8px}
.btn.primary{background:var(--green);border-color:var(--green-deep);color:#fff}
.btn.approve{background:var(--green);border-color:var(--green-deep);color:#fff}
.btn.deny{background:var(--red);border-color:#D03030;color:#fff}
.btn.ghost{background:var(--card)}

/* tables */
.tbl{width:100%;border-collapse:collapse}
.tbl th{text-align:left;font-size:10.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-3);padding:10px 12px;border-bottom:1px solid var(--line)}
.tbl td{padding:12px;font-size:13.5px;font-weight:600;border-bottom:1px solid var(--line);vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}
.row-ic{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:14px}
.cell-main{font-weight:700}.cell-sub{font-size:11.5px;color:var(--ink-3);font-weight:600;margin-top:1px}

/* chips (filters) */
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{padding:7px 14px;border-radius:999px;border:1px solid var(--line-2);background:var(--card);font-weight:700;font-size:12.5px;color:var(--ink-2);cursor:pointer}
.chip.active{background:var(--ink);border-color:var(--ink);color:#fff}

/* simple bars */
.bar-track{height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.bar-fill{height:100%;border-radius:999px;background:var(--blue)}
.mini-bars{display:flex;align-items:flex-end;gap:10px;height:120px}
.mini-bars .b{flex:1;background:var(--blue);border-radius:6px 6px 0 0;min-height:4px}
.mini-bars .lbl{font-size:10.5px;font-weight:700;color:var(--ink-3);text-align:center;margin-top:6px}
.err{color:var(--red);font-weight:700;font-size:13px}

/* Phase 1 (item 11): header child switcher — always shows whose data is on screen */
.kid-switch{display:flex;gap:4px;background:var(--bg);padding:4px;border-radius:999px;flex-shrink:0}
.kid-switch .ks{display:inline-flex;align-items:center;gap:7px;padding:5px 13px 5px 5px;border-radius:999px;font-weight:800;font-size:13px;color:var(--ink-2);white-space:nowrap}
.kid-switch .ks:hover{background:#fff;color:var(--ink)}
.kid-switch .ks.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(30,36,48,.12)}
.kid-switch .av{width:24px;height:24px;border-radius:999px;color:#fff;font-weight:900;font-size:11.5px;display:inline-flex;align-items:center;justify-content:center}
.kid-switch .av.fam{background:#5A6472;font-size:12px}
.tb-who{display:inline-block;margin-left:6px;padding:2px 10px;border-radius:999px;font-size:14px;font-weight:900;vertical-align:2px}
/* Phase 1 (item 14): setup instructions readable, not faint grey */
.setup-steps{color:var(--ink)!important;font-weight:700;font-size:13.5px;line-height:1.85}
.setup-code{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:6px 0 4px}
.setup-code .num{font-size:30px;font-weight:900;letter-spacing:6px;color:var(--ink);font-family:ui-monospace,Menlo,monospace}
/* Phase 2: child name tag on rows that mix children */
.kid-tag{display:inline-flex;align-items:center;gap:6px;padding:2px 10px 2px 3px;border-radius:999px;font-weight:900;font-size:12.5px;white-space:nowrap}
.kid-tag .av{width:20px;height:20px;border-radius:999px;color:#fff;font-size:10.5px;display:inline-flex;align-items:center;justify-content:center}
.kcard{background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:18px;border-top:5px solid var(--line)}
.kcard .kh{display:flex;align-items:center;gap:12px}
.kcard .kav{width:46px;height:46px;border-radius:999px;color:#fff;font-weight:900;font-size:19px;display:flex;align-items:center;justify-content:center}
.kcard .kn{font-weight:900;font-size:17px}
.kcard .km{font-size:12.5px;color:var(--ink-3);font-weight:700}
.kmeter{height:9px;background:var(--bg);border-radius:9px;overflow:hidden;margin:6px 0 2px}
.kmeter i{display:block;height:100%;border-radius:9px}
.kfacts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.kfact{background:var(--bg);border-radius:10px;padding:8px 10px}
.kfact b{display:block;font-size:15px}.kfact span{font-size:11.5px;color:var(--ink-3);font-weight:700}
.gbars{display:flex;align-items:flex-end;gap:10px;height:140px;padding-top:6px}
.gday{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;height:100%;justify-content:flex-end}
.gday .bb{display:flex;gap:3px;align-items:flex-end;height:100%;width:100%;justify-content:center}
.gday .b1{flex:1;max-width:22px;border-radius:5px 5px 2px 2px;min-height:3px}
.gday .dl{font-size:10.5px;font-weight:800;color:var(--ink-3)}
.legend{display:flex;gap:14px;font-size:12px;font-weight:800;color:var(--ink-2);margin-top:4px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}
/* Phase 3: device cards + device page */
.devcard{transition:box-shadow .15s,transform .15s}.devcard:hover{box-shadow:0 6px 22px -8px rgba(30,36,48,.25);transform:translateY(-1px)}
.dtabs{display:flex;gap:4px;border-bottom:2px solid var(--line);margin-bottom:4px;flex-wrap:wrap}
.dtab{padding:10px 16px;font-weight:900;color:var(--ink-3);border-bottom:3px solid transparent;margin-bottom:-2px;display:inline-flex;align-items:center;gap:7px}
.dtab.on{color:var(--blue-deep);border-color:var(--blue)}
.why{background:var(--blue-soft);color:#0E4F7C;border-radius:12px;padding:12px 14px;font-weight:700;font-size:13.5px;line-height:1.5}
.lostgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media(max-width:1000px){.lostgrid{grid-template-columns:1fr}}
.tg{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line)}.tg:first-child{border-top:0}
.tg input[type=checkbox]{width:20px;height:20px;accent-color:var(--green)}

#protTile{display:contents}

/* Phase 5: phone layout (≤ 820 px) — slide-in menu, full-width switcher, single-column cards */
.menu-btn{display:none;border:0;background:var(--bg);border-radius:10px;width:38px;height:38px;font-size:18px;font-weight:900;color:var(--ink);flex-shrink:0;cursor:pointer}
.nav-scrim{display:none}
@media(max-width:820px){
  .wrap{display:block}
  .sidebar{position:fixed;left:0;top:0;bottom:0;height:100vh;z-index:80;transform:translateX(-105%);transition:transform .2s ease;box-shadow:0 10px 40px rgba(0,0,0,.25)}
  body.nav-open .sidebar{transform:none}
  body.nav-open .nav-scrim{display:block;position:fixed;inset:0;background:rgba(20,24,32,.35);z-index:70}
  .menu-btn{display:inline-flex;align-items:center;justify-content:center}
  .topbar{flex-wrap:wrap;height:auto;min-height:0;padding:10px 14px;gap:8px 10px}
  .topbar>div:nth-child(2){flex:1;min-width:0}
  .tb-title{white-space:normal;font-size:17px}
  .tb-sub{white-space:normal}
  .kid-switch{order:5;width:100%;overflow-x:auto;scrollbar-width:none}
  .kid-switch::-webkit-scrollbar{display:none}
  .tb-search{display:none}
  .page{padding:14px 12px 32px;gap:14px}
  .g2,.g3,.g-main,.lostgrid{grid-template-columns:minmax(0,1fr)!important}
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .card,.kcard{padding:14px}
  .card-head{flex-wrap:wrap;gap:8px}
  .tbl{display:block;overflow-x:auto;white-space:nowrap}
  .kcard .kh{flex-wrap:wrap}
  .kfacts{gap:6px}
  .dtabs{overflow-x:auto;flex-wrap:nowrap}
  .dtab{white-space:nowrap;padding:10px 12px}
  .reqrow{flex-wrap:wrap}
  .reqrow>div:nth-child(2){min-width:60%}
}
@media(max-width:820px){
  .tbl.stack{display:block;white-space:normal;overflow:visible}
  .tbl.stack tbody,.tbl.stack tr,.tbl.stack td{display:block}
  .tbl.stack tr:first-child{display:none}
  .tbl.stack tr{padding:12px 0;border-top:1px solid var(--line)}
  .tbl.stack tr:nth-child(2){border-top:0}
  .tbl.stack td{border:0!important;padding:3px 0!important;text-align:left!important}
  .tbl.stack td:last-child{margin-top:6px}
}
@media(max-width:820px){
  .devcard{flex-wrap:wrap}
  .devcard>div:last-child{flex-direction:row!important;align-items:center!important;width:100%;padding-left:58px;flex-wrap:wrap}
}
button:disabled,.btn:disabled{opacity:.5;cursor:not-allowed}
/* Sidebar: sub-menu under the selected child */
.item.child .chev{margin-left:auto;font-size:11px;color:var(--ink-3)}
.item.child.open{color:var(--ink);background:var(--bg)}
.sub-items{display:flex;flex-direction:column;gap:2px;margin:2px 0 6px 22px;padding-left:12px;border-left:2px solid var(--line)}
.item.sub{padding:7px 10px;font-size:13px}
.item.sub{white-space:nowrap;font-size:12.5px}
.item.child .chev{font-size:14px}
.bell-count{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--red);color:#fff;font-size:10.5px;font-weight:900;display:inline-flex;align-items:center;justify-content:center}

.kid-switch .av,.kav,.row-ic,.kid-tag .av,.item .av{letter-spacing:-.04em}
.bell-count[hidden]{display:none!important}

/* + Add child — sidebar row and header switcher button */
.item.add-kid{color:var(--ink-3);font-weight:700}
.item.add-kid .av{width:22px;height:22px;border-radius:999px;border:1.5px dashed var(--line-2);color:var(--ink-3);font-weight:800;font-size:14px;display:flex;align-items:center;justify-content:center;box-sizing:border-box}
.item.add-kid:hover,.item.add-kid.active{color:var(--green-deep)}
.item.add-kid:hover .av,.item.add-kid.active .av{border-color:var(--green);color:var(--green-deep)}
.kid-switch .ks-add{padding:5px}
.kid-switch .ks-add .av{background:transparent;border:1.5px dashed var(--line-2);color:var(--ink-3);font-size:15px;box-sizing:border-box}
.kid-switch .ks-add:hover .av,.kid-switch .ks-add.on .av{border-color:var(--green);color:var(--green-deep)}
.kcard.add-kcard{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:150px;border:2px dashed var(--line-2);border-top:2px dashed var(--line-2);background:transparent;box-shadow:none;color:var(--ink-2);text-decoration:none;text-align:center}
.kcard.add-kcard:hover{border-color:var(--green);color:var(--green-deep)}
.kcard.add-kcard .plus{width:40px;height:40px;border-radius:999px;border:2px dashed currentColor;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:800}

/* Settings on phones: schedules stack, plan table fits the screen instead of scrolling sideways */
.g3{grid-template-columns:repeat(3,1fr)}
@media(max-width:1000px){.g3{grid-template-columns:1fr}}
@media(max-width:820px){
  .tbl.plan-tbl{display:table;white-space:normal;table-layout:fixed}
  .tbl.plan-tbl th{padding:8px 6px}
  .tbl.plan-tbl th:first-child,.tbl.plan-tbl td:first-child{width:42%;padding-left:0}
  .tbl.plan-tbl td{padding:10px 6px;font-size:12.5px;word-break:break-word}
  .tbl.plan-tbl .pill{font-size:9.5px;padding:3px 7px;white-space:nowrap}
}

/* Device tabs: phones get a 2x2 grid so every tab (incl. Lost Phone) is visible; protection shows as a dot */
.tab-dot{display:none;width:9px;height:9px;border-radius:999px;background:var(--ink-3)}
.tab-dot.on{background:var(--green)}.tab-dot.off{background:var(--amber)}
@media(max-width:820px){
  .dtabs{display:grid;grid-template-columns:1fr 1fr;overflow:visible;gap:0}
  .dtab{justify-content:center;padding:11px 6px;font-size:14px;border-bottom-width:3px}
  .dtab .pill{display:none}
  .tab-dot{display:inline-block}
}

/* Laptop widths (821–1300 px): the child switcher shrinks and scrolls instead of pushing the page sideways.
   When the header fits (e.g. 1440 px) nothing changes. */
@media(min-width:1001px){
  .g2{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .g3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .g3 input{min-width:0}
}
/* small laptops: schedule cards stack so the time boxes are never clipped */
@media(min-width:1001px) and (max-width:1279px){ .g3{grid-template-columns:minmax(0,1fr)} }
@media(min-width:821px){
  .kid-switch{flex-shrink:1;min-width:0;overflow-x:auto;scrollbar-width:none}
  .kid-switch::-webkit-scrollbar{display:none}
}

/* ===== Phone polish (≤ 820 px only — laptop/PC layout is untouched) =====
   Same Lucide icons as desktop (REQ-039), tighter header, even 14 px gutters, tables that fit. */
@media(max-width:820px){
  /* page rhythm: header and content share a 14 px gutter */
  .page{padding:14px 14px 32px;gap:12px}
  .grid{gap:12px}
  .card,.kcard{padding:16px;border-radius:14px}
  .card-head{margin-bottom:12px}
  .why{margin-bottom:12px}

  /* header: menu, title, bell on one row, child chips on the next */
  .topbar{padding:10px 14px 10px;gap:10px;align-items:center;box-shadow:0 1px 0 var(--line)}
  .menu-btn,.tb-bell{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--card);display:inline-flex!important;align-items:center;justify-content:center;font-size:0;color:var(--ink);flex-shrink:0;padding:0}
  .tb-bell .bell-count{font-size:10.5px}
  .tb-title{display:flex;flex-wrap:wrap;align-items:center;gap:3px 8px;font-size:17px;line-height:1.25}
  .tb-who{margin:0;font-size:11.5px;padding:2px 9px;vertical-align:0}
  .tb-sub{font-size:10.5px;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;margin-top:3px}
  .kid-switch{background:none;padding:0;gap:6px;margin:0 -14px;padding:0 14px 2px;width:calc(100% + 28px)}
  .kid-switch .ks{padding:4px 12px 4px 4px;font-size:13px;border:1px solid var(--line-2);background:var(--card);box-shadow:none}
  .kid-switch .ks.on{background:var(--ink);border-color:var(--ink);color:#fff;box-shadow:none}
  .kid-switch .ks-add{padding:4px;border-style:dashed}
  .kid-switch .ks-add .av{border:0}

  /* side menu: bigger touch rows */
  .sidebar{width:280px;padding:16px 14px}
  .item{padding:10px 12px;font-size:15px;gap:12px}
  .item .ic{width:32px;height:32px;font-size:0}
  .item.child .av,.item.add-kid .av{width:32px;height:32px;font-size:12.5px}
  .sub-items{margin-left:28px}
  .item.sub{font-size:14px;padding:9px 12px}

  /* stat tiles: icon on top, number, then label — no 3-line squeeze */
  .stile{flex-direction:column;align-items:flex-start;gap:10px;padding:14px;border-radius:14px}
  .stile .si{width:36px;height:36px;border-radius:10px}
  .stile .sn{font-size:22px}
  .stile .sl{font-size:12px;line-height:1.3;margin-top:5px}
  .dev-ic{width:40px;height:40px;border-radius:11px;flex-shrink:0}
  .lost-ic{width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--bg);margin-bottom:10px}
  .lostgrid{gap:12px}

  /* device list cards: icon + text, badges underneath */
  .devcard{gap:12px!important;padding:14px}
  .devcard>div:last-child{padding-left:52px}

  /* child cards on the dashboard */
  .kcard .kav{width:42px;height:42px;font-size:17px}
  .kcard .kn{font-size:16px}
  .kcard .kh>div:nth-child(2){min-width:0}
  .kcard .kh .btn{order:3;width:100%;margin-top:4px}
  /* request rows: text on top, all buttons together underneath */
  div.reqrow>div:nth-child(2){flex:1 1 calc(100% - 50px)!important;min-width:0}
  div.reqrow>.btn:first-of-type{margin-left:46px}
  .kfact{padding:8px 10px}

  /* tables fit the screen: names wrap, status + buttons stay visible */
  .tbl{display:table;white-space:normal;overflow:visible;table-layout:auto}
  .tbl th{padding:8px 6px}
  .tbl td{padding:11px 6px;font-size:13px}
  .tbl th:first-child,.tbl td:first-child{padding-left:0}
  .tbl th:last-child,.tbl td:last-child{padding-right:0}
  /* first column takes the spare width; long package names end with … instead of breaking mid-word */
  .tbl td:first-child{width:100%;max-width:0}
  .tbl .cell-sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tbl.stack td:first-child,.tbl.plan-tbl td:first-child{max-width:none}
  .tbl.stack td:first-child{width:auto}
  .tbl.stack .cell-sub{white-space:normal}
  .tbl .pill,.tbl .btn{white-space:nowrap}
  .tbl .pill{font-size:9.5px;padding:3px 7px}
}

/* v3: Android "Device management" sits in its own card on the device page — drop the divider it had on the old card */
#mgmtCard > div:first-child{margin-top:0!important;padding-top:0!important;border-top:0!important}

/* ===== REQ-037 (UI review fix-first) ===== */
/* H-04: the sidebar is one screen tall; only the menu scrolls, the account card + logout stay pinned at the bottom.
   A soft shadow above the account card shows there is more menu below. */
.sidebar{height:100vh;height:100dvh;overflow:hidden;gap:0}
.sidebar .brand,.sidebar .sb-foot{flex-shrink:0}
.sidebar .sb-nav{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:2px;scrollbar-width:thin;
  background:linear-gradient(rgba(255,255,255,0),var(--card) 70%) 0 100%/100% 26px no-repeat local,
             linear-gradient(rgba(30,36,48,0),rgba(30,36,48,.10)) 0 100%/100% 12px no-repeat scroll}
/* With more than ~5 children, scroll ONLY the children list, not the whole menu (keeps Monitoring/Actions/System visible). */
.kid-list{display:flex;flex-direction:column;gap:2px}
.kid-list.kid-scroll{flex:0 0 auto;max-height:216px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-right:2px}
.kid-list.kid-scroll::-webkit-scrollbar{width:6px}
.kid-list.kid-scroll::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:3px}
/* Styled confirm/prompt modal (H.confirm / H.prompt) — replaces native confirm()/prompt(). */
.hm-overlay{position:fixed;inset:0;background:rgba(16,18,24,.45);display:flex;align-items:center;justify-content:center;z-index:200;padding:16px;animation:hm-in .12s ease}
@keyframes hm-in{from{opacity:0}to{opacity:1}}
.hm-box{background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.25);width:min(430px,100%);padding:20px 22px}
.hm-title{font-weight:800;font-size:16px;margin-bottom:6px;font-family:var(--font-display,inherit)}
.hm-msg{color:var(--ink-2);font-size:14px;line-height:1.5}
.hm-input{width:100%;margin-top:12px;height:38px;border:1px solid var(--line);border-radius:9px;padding:0 10px;font:inherit;font-size:14px;box-sizing:border-box}
.hm-input:focus{outline:none;border-color:var(--green)}
.hm-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.btn.danger{background:var(--red);color:#fff;border:0}
.btn.danger[disabled]{opacity:.5;cursor:not-allowed}
.sidebar .sb-foot{margin-top:0}
/* the pinned logout is always on screen now — give it a proper 32 px tap target */
.sb-foot .logout{min-width:32px;min-height:32px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center}
.sb-foot .logout:hover{background:var(--bg);color:var(--ink)}
/* the white sidebar column runs the full page height, even on long pages / full-page captures */
@media(min-width:821px){ .wrap:has(> .sidebar){background:linear-gradient(90deg,var(--card) 0 217px,var(--line) 217px 218px,transparent 218px)} }

/* H-01: "No devices yet · Pair a device" tile */
.prot-link{color:var(--blue);font-weight:800;white-space:nowrap}

/* H-02: one style for every "yes" cell; the (limit N) pill never wraps */
.plan-ok{color:var(--green-deep);font-weight:900}
.plan-cap{display:inline-block;white-space:nowrap;background:var(--green-soft);border-radius:999px;padding:1px 8px}
@media(max-width:820px){
  .tbl.plan-tbl{table-layout:auto}
  .tbl.plan-tbl td{word-break:normal;overflow-wrap:normal}
}
/* H-03: one card per feature (name, then "Free: …" / "Subscription: …") whenever the Plan card is too narrow for
   three columns — every phone below 480 px, and the two-column laptop layout around 1000–1150 px. */
#plan{container-type:inline-size}
@container (max-width:440px){
  .tbl.plan-tbl,.tbl.plan-tbl tbody,.tbl.plan-tbl tr,.tbl.plan-tbl td{display:block;width:auto}
  .tbl.plan-tbl thead{display:none}
  .tbl.plan-tbl tr{border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin-bottom:8px}
  .tbl.plan-tbl tr:last-child{margin-bottom:0}
  .tbl.plan-tbl td{border:0;padding:4px 0!important;font-size:13px;max-width:none}
  .tbl.plan-tbl td:first-child{width:auto;padding-bottom:6px!important}
  .tbl.plan-tbl td[data-l]{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line)}
  .tbl.plan-tbl td[data-l]::before{content:attr(data-l);font-size:10.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-3)}
  .tbl.plan-tbl td[data-l] .pill{font-size:10px}
}

/* ===== REQ-038 (UI review batch 2) ===== */
/* M-02: real headings — page title is an <h1>, card titles <h2>/<h3>; they keep the old look */
h1.tb-title,h2.card-title,h3.card-title{margin:0;line-height:inherit}
/* M-03: button labels never wrap; the text beside them shrinks instead. Below ~1100 px the setup card's buttons go under the text. */
.btn{white-space:nowrap}
.head-stack .head-acts{flex-shrink:0}
@media(max-width:1100px){.card-head.head-stack{flex-direction:column;align-items:flex-start}}
/* M-05: disabled / locked buttons stay readable (about 4:1) instead of fading to 50 % */
button:disabled,.btn:disabled{opacity:1;background:#F1F3F5;border-color:var(--line-2);color:#6B7480;cursor:not-allowed}
.btn[data-locked]{opacity:1;background:#F1F3F5;border-color:var(--line-2);color:#5A6472}
.btn[data-locked]:hover{opacity:1;background:#E9ECEF}
/* M-08: Settings › "Schedules for <child> ▾" */
.sch-kid{font:inherit;color:var(--ink);background:var(--card);border:1px solid var(--line-2);border-radius:8px;padding:2px 6px;margin-left:2px;cursor:pointer;max-width:100%}
#schTitle label{font:inherit;cursor:pointer}
/* L-03: empty banner slots (notifications / PIN / setup) don't add extra gaps; a lone "Add a child" card fills its row */
.page>div:empty{display:none}
@media(min-width:1001px){
  .g2>.add-kcard:nth-child(odd){grid-column:1/-1;min-height:0;flex-direction:row;padding:14px 18px}
  .g2>.add-kcard:nth-child(odd) .plus{width:32px;height:32px;font-size:18px}
}
/* L-05: one label style; the unit sits on the input's line */
.f-lbl{font-size:13px;font-weight:800;color:var(--ink-2)}
.f-unit{display:inline-flex;align-items:center;height:38px;margin:0}
/* N-02: a card that is only a header (e.g. Apps › "Apps tried to access") — action centred, no empty bottom gap */
.card>.card-head:only-child{margin-bottom:0;align-items:center}
@media(max-width:820px){
  /* L-01: subtitles wrap instead of ending in "…" */
  .tb-sub{white-space:normal!important;overflow:visible;text-overflow:clip}
  /* L-02: no shadow along the left edge while the menu is closed */
  .sidebar{box-shadow:none;visibility:hidden;transition:transform .2s ease,visibility 0s linear .2s}
  body.nav-open .sidebar{box-shadow:0 10px 40px rgba(0,0,0,.25);visibility:visible;transition:transform .2s ease}
  /* N-01: white "+" on the dark selected Add-child chip */
  .kid-switch .ks-add.on .av{color:#fff;font-weight:900}
}
/* M-02: tap targets at least 40 px on phones */
@media(max-width:600px){
  .btn,.btn.sm,.chip,.kid-switch .ks,.link-sm,select,input:not([type=checkbox]):not([type=radio]):not([type=range]){min-height:40px}
  .btn.sm{height:auto}
  .chip,.link-sm{display:inline-flex;align-items:center}
  .kid-switch .ks{align-items:center}
  .sb-foot .logout{min-width:40px;min-height:40px}
  .en-lbl{display:inline-flex;align-items:center;gap:6px;min-height:40px}
  #schedules>.card{padding:12px 8px}
  .dch-row{gap:2px!important}
  .dch{display:flex!important;align-items:center;justify-content:center;min-height:40px;padding:0!important}
}
/* M-03 follow-up: a long child name in "Open <name> ›" ends with … inside the card instead of pushing out of it */
@media(min-width:821px){ .kcard .kh .btn{display:inline-block;line-height:30px;max-width:55%;overflow:hidden;text-overflow:ellipsis} }
.legend{flex-wrap:wrap;row-gap:4px}

/* ===== REQ-039 M-01: one Lucide line-icon set (assets/icons.js), same on desktop and phone ===== */
svg.lucide{flex-shrink:0;display:inline-block;vertical-align:middle}
.item .ic{opacity:1;font-size:0;color:var(--ink-3)}
.item .ic svg{width:18px;height:18px}
.item:hover .ic,.item.active .ic{color:currentColor;background:none;border:0}
.item .ic{background:none;border:0;border-radius:0}
.item.child .chev{display:inline-flex}
.item.add-kid .av svg,.kid-switch .ks-add .av svg{width:14px;height:14px}
.kid-switch .av.fam svg{width:14px;height:14px;color:#fff}
.sb-foot .logout svg{width:18px;height:18px}
.menu-btn svg{width:20px;height:20px}
.tb-bell{display:inline-flex;align-items:center;justify-content:center;color:var(--ink-2)}
.tb-bell:hover{color:var(--ink)}
.tb-bell svg{width:19px;height:19px}
.stile .si svg{width:20px;height:20px;color:#fff}
.qi svg{width:19px;height:19px;color:var(--qc,var(--qa,var(--ink-2)))}
.qa .qi svg{color:var(--qa,var(--ink-2))}
.btn svg{width:15px;height:15px}
.dev-ic svg,.lost-ic svg{width:22px;height:22px;color:var(--ink-2)}
.lost-ic{width:40px;height:40px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--bg);margin-bottom:10px}
.lost-ic[data-i="pin"]{background:#E3F1FB}.lost-ic[data-i="pin"] svg{color:var(--blue)}
.lost-ic[data-i="lock"]{background:#FDE3E1}.lost-ic[data-i="lock"] svg{color:var(--red)}
.card-ic{display:inline-flex;width:40px;height:40px;border-radius:12px;align-items:center;justify-content:center;flex-shrink:0;background:var(--bg);color:var(--ink-2)}
.card-ic svg{width:22px;height:22px}
.card-ic.warn{background:#FFEFD6;color:#A55B00}
.title-ic{display:inline-flex;vertical-align:-3px;margin-right:6px;color:var(--ink-2)}
.title-ic svg{width:17px;height:17px}
.ico-inline{display:inline-flex;vertical-align:-3px;margin-right:4px}
.ico-inline svg{width:15px;height:15px}

/* ===== REQ-039 M-09: one empty state (icon + one line + one action) and one skeleton loader ===== */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:14px 12px;min-height:176px;color:var(--ink-2)}
.empty-state .es-ic{width:44px;height:44px;border-radius:999px;background:var(--bg);color:var(--ink-3);display:flex;align-items:center;justify-content:center}
.empty-state .es-ic svg{width:22px;height:22px}
.empty-state .es-txt{margin:0;font-size:13.5px;font-weight:600;line-height:1.45;max-width:360px;color:var(--ink-2)}
.empty-state .es-act{margin-top:4px}
.gbars>.empty-state{flex:1;align-self:stretch;min-height:0;padding:8px}
.skel{display:flex;flex-direction:column;justify-content:center;gap:12px;padding:14px 0;min-height:176px}
.skel>i{display:block;height:14px;border-radius:7px;background:linear-gradient(90deg,#EEF0F3 25%,#F6F7F9 50%,#EEF0F3 75%);background-size:200% 100%;animation:skel 1.2s ease-in-out infinite}
.skel>i:nth-child(2){width:82%}.skel>i:nth-child(3){width:64%}.skel>i:nth-child(4){width:74%}
.gbars>.skel{flex:1;align-self:stretch;min-height:0;justify-content:flex-end;flex-direction:row;align-items:flex-end;gap:10px;padding:0}
.gbars>.skel>i{flex:1;width:auto!important;height:40%;border-radius:6px 6px 0 0}
.gbars>.skel>i:nth-child(2n){height:65%}.gbars>.skel>i:nth-child(3n){height:30%}
@keyframes skel{0%{background-position:200% 0}100%{background-position:-200% 0}}
@media(prefers-reduced-motion:reduce){.skel>i{animation:none}}
.mini-bars>.empty-state{flex:1;align-self:stretch;min-height:0;padding:8px}
.pill.has-ic::before{display:none}
.pill.has-ic svg{width:13px;height:13px;margin-right:4px}

/* REQ-041: real Family1st Shield logo replaces the "ap" placeholder */
.brand .shield{background:url(logo-shield.png) center/contain no-repeat;border-radius:0;color:transparent;font-size:0}
