/* Mobile mode uses the cabinet's data and controls; desktop rules stay intact. */
.mobile-cabinet { --mobile-accent:#805bc7; --mobile-bg:#f4f0f8; }
.mobile-cabinet[data-theme=dark] { --mobile-accent:#b89ae9; --mobile-bg:#1c1927; }
.mobile-cabinet body { background:var(--mobile-bg); }
.mobile-cabinet .mobile-pane[hidden] { display:none!important; }
.mobile-cabinet .cabinet-shell { display:block; min-height:100dvh; }
.mobile-cabinet .sidebar,.mobile-cabinet .skip,.mobile-cabinet .topbar>strong { display:none; }
.mobile-cabinet .main,.mobile-cabinet .mobile-static { width:100%;max-width:680px;margin:auto;padding:16px 22px 28px;min-width:0; }
.mobile-cabinet .topbar { margin:0 0 8px;padding:0;min-height:44px;justify-content:flex-end;border:0; }
.mobile-cabinet .topbar>span { display:none; }
.mobile-cabinet .child-heading .eyebrow,.mobile-cabinet .child-heading .subtitle { display:none; }
.mobile-cabinet h1 { font-size:26px;line-height:1.25; }
.mobile-cabinet .child-heading { margin:16px 0; }
.mobile-cabinet .child-name { min-width:0; }
.mobile-cabinet .child-name h1 { overflow-wrap:anywhere; }
.mobile-cabinet .group-editor { min-width:0; }
.mobile-cabinet .app-selection { background:transparent;box-shadow:none;border:0;padding:0; }
.mobile-cabinet .group-chips { flex-wrap:nowrap;overflow:auto;scrollbar-width:none;margin:18px -22px;padding:0 22px;gap:8px; }
.mobile-cabinet .group-chip { flex-shrink:0;min-height:44px;border:0;border-radius:14px;background:var(--surface,#fff);padding:12px 16px;font-size:15px; }
.mobile-cabinet .group-chip.selected { background:var(--mobile-accent);color:#fff; }
.mobile-cabinet .group-toolbar { display:flex;flex-wrap:wrap;gap:8px; }
.mobile-cabinet .group-toolbar input[type=search] { flex:1 0 100%;width:100%;min-height:48px;border:0;border-radius:14px;font-size:17px; }
.mobile-cabinet .group-toolbar .styled-select { flex:1 1 40%;min-width:0; }
.mobile-cabinet .group-toolbar .select-trigger { font-size:12px;min-height:40px; }
.mobile-cabinet .exact-search { font-size:13px;min-height:36px; }
.mobile-cabinet .selection-toolbar { margin:12px 0;flex-wrap:wrap;gap:10px; }
.mobile-cabinet .selection-toolbar .text-button { margin-left:auto;background:var(--surface,#fff);border-radius:12px;padding:10px 14px;color:var(--mobile-accent); }
.mobile-cabinet .group-app-row { display:flex;align-items:center;gap:12px;padding:14px 0;min-height:88px;background:transparent;border:0; }
.mobile-cabinet .selection-app-info { flex:1;min-width:0; }
.mobile-cabinet .selection-app-info .group-app-identity { gap:12px;min-width:0; }
.mobile-cabinet .selection-app-info .group-app-identity img { width:48px;height:48px;border-radius:13px;flex-shrink:0; }
.mobile-cabinet .selection-app-info .group-app-identity>div { min-width:0; }
.mobile-cabinet .selection-app-info strong { font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block; }
.mobile-cabinet .selection-app-info .package { display:none; }
.mobile-cabinet .selection-app-info .current-group { margin:4px 0 0 60px;font-size:11px; }
.mobile-cabinet .group-app-row>.styled-select { flex:0 0 104px;width:104px;min-width:0; }
.mobile-cabinet .group-app-row>.styled-select .select-trigger { white-space:normal;font-size:11px;border:0;border-radius:14px;min-height:44px;padding:8px 23px 8px 8px; }
.mobile-cabinet .selection-footer { position:sticky;top:8px;z-index:3;background:var(--surface,#fff);padding:12px;border-radius:14px;box-shadow:0 5px 20px #0001; }
.mobile-cabinet .selection-footer .button { background:var(--mobile-accent);color:#fff; }
.mobile-cabinet .group-tile { border-radius:22px;overflow:hidden; }
.mobile-cabinet .save-bar { bottom:0; }
.mobile-cabinet dialog { max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px);border-radius:24px;padding:20px; }
.mobile-cabinet .move-dialog { margin:auto 0 0;width:100%;max-width:100%;border-radius:24px 24px 0 0;padding:28px 24px; }
.mobile-cabinet .move-destination { width:100%;min-height:56px;margin:8px 0; }
.mobile-cabinet .mobile-menu-item { display:block;text-align:left;width:100%;padding:22px 18px;border:0;border-radius:16px;margin:12px 0;background:var(--surface,#fff);color:inherit;font-size:18px; }
.mobile-cabinet .login-story { display:none; }
.mobile-cabinet .login-layout { display:block;padding:16px; }
.mobile-cabinet .auth-header { padding:16px 22px; }
.mobile-cabinet .stats-chart-grid { grid-template-columns:1fr; }
@media(max-width:360px){.mobile-cabinet .main{padding-left:16px;padding-right:16px}.mobile-cabinet .selection-app-info strong{font-size:15px}.mobile-cabinet .group-app-row>.styled-select{flex-basis:90px;width:90px}}

@media(max-width:360px){.mobile-cabinet .group-chips{margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:16px}}
.mobile-cabinet .group-app-row { flex-direction:row;flex-wrap:nowrap;text-align:left;justify-content:space-between; }
.mobile-cabinet .group-app-row .group-app-identity { flex-direction:row;align-items:center; }
.mobile-cabinet .selection-app-info { width:auto; }
.mobile-cabinet .group-app-row>.styled-select { flex:0 0 72px;width:72px;margin:0;align-self:center; }
.mobile-cabinet .group-app-row>.styled-select .select-trigger { font-size:0;width:72px;padding:8px;position:relative; }
.mobile-cabinet .group-app-row>.styled-select .select-trigger::before { content:'';display:block;width:22px;height:22px;margin-left:7px;background:currentColor;mask:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1v11H6V10zm2 0h6V7a3 3 0 0 0-6 0z'/%3E%3C/svg%3E"); }
.mobile-cabinet .group-app-row[data-group-kind=ALLOW] .select-trigger { color:#28b995; }
.mobile-cabinet .group-app-row[data-group-kind=BLOCK] .select-trigger { color:#d66886; }
.mobile-cabinet .group-app-row[data-group-kind=LIMIT] .select-trigger { color:var(--mobile-accent); }
.mobile-cabinet .group-app-row[data-group-kind=LIMIT] .select-trigger::before { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1 4h2v6l4 2-1 2-5-3z'/%3E%3C/svg%3E"); }
.mobile-cabinet .main { position:relative; }
.mobile-cabinet .topbar { position:static;min-height:56px;height:auto;margin-bottom:18px; }
.mobile-cabinet .main>.text-button { margin:0 52px 8px 0;min-height:44px; }
.mobile-cabinet .child-heading { margin:8px 0 12px; }
.mobile-cabinet .group-editor[data-tab=apps]>div>h2 { display:none; }
.mobile-cabinet .tabs .tab.selected { background:var(--mobile-accent);color:#fff; }
.mobile-cabinet .selection-app-info strong { overflow:hidden;max-width:100%; }
.mobile-cabinet .group-app-row>.small { flex:0 0 72px;font-size:10px;overflow-wrap:anywhere;text-align:center; }
.mobile-cabinet .mobile-app-filters { width:100%;font-size:13px;color:var(--muted); }
.mobile-cabinet .mobile-app-filters summary { min-height:40px;cursor:pointer;padding:10px 0; }
.mobile-cabinet .mobile-app-filters .group-toolbar { padding-bottom:8px; }
.mobile-cabinet .selection-toolbar { border:0;padding:0;margin:8px 0; }
.mobile-cabinet .selection-app-info .current-group { max-width:calc(100% - 60px); }
.mobile-cabinet .selection-app-info .group-app-identity img { object-fit:contain; }
.mobile-cabinet .group-app-row[data-group-kind=ALLOW] .select-trigger::before { mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0h-2a3 3 0 0 0-6 0v3h9v11H6V10z'/%3E%3C/svg%3E"); }
.mobile-cabinet,.mobile-cabinet body,.mobile-cabinet #app{min-height:100dvh;background:var(--mobile-bg)}
.mobile-family-back{display:none}
.mobile-cabinet .mobile-family-back{display:grid;flex-shrink:0;font-size:28px;width:32px;border:0;background:transparent}
.mobile-cabinet .main:has(.child-heading)>.text-button{display:none}
.mobile-cabinet .child-heading-row{gap:6px}
.mobile-cabinet .child-heading-row .child-name{flex:1}
.mobile-cabinet .group-toolbar{padding:8px 0;border:0}
.mobile-cabinet .group-chips{margin-top:8px;margin-bottom:8px}
.mobile-cabinet .tabs{margin:8px 0}
.mobile-cabinet .selection-feedback{border-radius:12px}
:root.mobile-cabinet[data-theme=dark] .app-selection{background:transparent}
:root.mobile-cabinet[data-theme=dark] .group-chip.selected{background:#805bc7;color:white}
:root.mobile-cabinet[data-theme=dark] .tab.selected{background:#805bc7;color:white}
:root.mobile-cabinet[data-theme=dark] .selection-footer .button{background:#805bc7;color:white}
/* Weekly limits and immediate group actions, shared across cabinet layouts. */
.week-summary-day{display:inline-flex;align-items:center;gap:7px;background:transparent;border:1px solid transparent;color:inherit;border-radius:12px;padding:4px;cursor:pointer;font:inherit}
.week-summary-day.today,.schedule-day.today{border-color:var(--primary,#5076db);background:color-mix(in srgb,var(--primary,#5076db) 12%,transparent)}
.schedule-days{border:0;margin:18px 0;padding:0;display:grid;gap:12px;min-width:0}
.schedule-dialog .schedule-day{display:grid;grid-template-columns:42px minmax(0,1fr) auto 40px;align-items:center;gap:12px;padding:15px;border:1px solid var(--border,#ccd2df);border-radius:18px}
.schedule-day strong{font-size:16px;overflow-wrap:anywhere}.schedule-day input{width:36px;height:22px;accent-color:var(--primary,#5076db)}
.schedule-unset,.week-all{display:flex;align-items:center;gap:12px;padding:12px 0}.week-all{justify-content:space-between}
.schedule-days:disabled{opacity:.45}.schedule-dialog{width:min(560px,calc(100vw - 24px))}
.time-wheels{display:flex;justify-content:center;gap:24px;padding:24px 0}.time-wheels label{display:grid;gap:12px;text-align:center}
.time-wheel{height:156px;min-width:110px;max-width:100%;font-size:24px;line-height:1.5;text-align:center;border-radius:18px;overflow-y:auto;padding:4px;background:var(--surface,#fff);color:inherit;scrollbar-width:thin}
.time-wheel option{padding:8px 18px}.time-wheel option:checked{font-weight:700;background:var(--primary,#5076db);color:#fff}.time-dialog>.time-wheel{display:block;width:100%;margin:24px 0}
.time-dialog>.button{width:100%;margin:12px 0}.time-dialog>.text-button{display:block;margin:12px auto}
.screen-remaining{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:22px 0 12px}.screen-remaining>strong{font-size:clamp(22px,3vw,36px)}.screen-remaining>p{flex-basis:100%;margin:0}.screen-block{width:100%;margin-top:12px}
.group-title-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.group-title-row .group-heading-actions{margin-left:auto;display:flex;gap:8px}.group-name-row{min-width:0}.group-name-row input{min-width:0;width:min(300px,100%)}
.new-group-tile{display:grid;gap:12px;border:1px solid var(--border,#ccd2df);border-radius:12px;padding:14px;margin:12px 0}.move-dialog .move-destination[aria-pressed=true]{outline:2px solid var(--primary,#5076db)}
.family-adults .parent-grid,.children-list{display:grid;grid-template-columns:1fr;gap:12px}.family-adults .parent-card,.family-name{display:block;width:100%;min-width:0;padding:22px;text-align:left;color:var(--text);font:inherit;font-size:18px;font-weight:600;text-decoration:none;overflow-wrap:anywhere;border:1px solid var(--line);border-radius:18px;background:var(--surface,#fff)}.family-name:hover,.family-adults .parent-card:hover{border-color:var(--green);background:var(--light)}.family-name:focus-visible,.family-adults .parent-card:focus-visible{outline:2px solid var(--green);outline-offset:3px}.family-adults .parent-card{min-height:0}.children-list{margin:0 0 20px}.parent-children .owner-child-actions{flex-wrap:wrap}.parent-children .owner-child-name{padding-left:0}.parent-children .owner-child-row:last-child{padding-bottom:0}
.sidebar-lower{margin-top:16px;width:100%}.sidebar-divider{border:0;border-top:1px solid var(--border,#ccd2df);margin:16px 0}.sidebar-lower>.logout{border-top:1px solid var(--border,#ccd2df);padding-top:18px;width:100%;margin-top:20px}.sidebar-lower>.nav-item{width:100%;justify-content:flex-start;text-align:left}
.cabinet-footer{grid-column:1/-1;padding:24px;max-width:100%;border-top:1px solid var(--border,#ccd2df)}.cabinet-footer[hidden]{display:none}.cabinet-footer .sidebar-lower{max-width:600px;margin:auto}.cabinet-footer .sidebar-note{display:block}.cabinet-footer .sidebar-download{max-width:280px}.cabinet-footer .nav-item{color:inherit}.topbar>a{color:inherit;text-decoration:none}.brand{display:block}.topbar>a:hover{text-decoration:underline}
@media(max-width:850px){.group-title-row{align-items:flex-start}.group-title-row .group-heading-actions{flex-wrap:wrap}.schedule-dialog .schedule-day{grid-template-columns:32px minmax(0,1fr) auto 32px;padding:12px 8px;gap:7px}.schedule-day strong{font-size:14px}.schedule-day input{width:28px}.cabinet-footer{padding-bottom:calc(32px + env(safe-area-inset-bottom))}}
.mobile-cabinet .cabinet-footer{display:block;padding:20px 22px calc(100px + env(safe-area-inset-bottom));max-width:680px;margin:auto}.mobile-cabinet .cabinet-footer[hidden]{display:none}.mobile-cabinet .schedule-day{display:grid}.mobile-cabinet .group-title-row .group-heading-actions{margin-left:auto}.mobile-cabinet .topbar>a{display:block;margin-right:auto}

:is(.schedule-day,.week-all) input[role=switch]{appearance:none;-webkit-appearance:none;position:relative;width:38px;height:24px;border:0;border-radius:20px;background:#a1a8b6;cursor:pointer;flex-shrink:0}
:is(.schedule-day,.week-all) input[role=switch]::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .15s}
:is(.schedule-day,.week-all) input[role=switch]:checked{background:var(--primary,#5076db)}:is(.schedule-day,.week-all) input[role=switch]:checked::after{transform:translateX(14px)}
:is(.schedule-day,.week-all) input[role=switch]:focus-visible{outline:2px solid var(--primary,#5076db);outline-offset:3px}
.schedule-dialog>.dialog-actions{position:sticky;bottom:-24px;padding:14px 0;background:var(--surface,#fff);z-index:2}
@media(max-width:430px){.schedule-dialog .schedule-day{grid-template-columns:38px minmax(0,1fr) auto 32px}}

:root[data-theme=dark] .time-dialog{background:var(--surface);color:inherit;border-color:var(--line)}
:root[data-theme=dark] .new-group-tile,:root[data-theme=dark] .schedule-day,:root[data-theme=dark] .cabinet-footer,:root[data-theme=dark] .sidebar-divider{border-color:var(--line)}
:root[data-theme=dark] .schedule-day.today{border-color:#83baff}

.time-dialog{width:440px;max-width:calc(100vw - 28px);max-height:calc(100dvh - 28px);overflow:auto;padding:24px;border:1px solid var(--line);border-radius:24px;background:var(--surface,#fff);color:inherit;box-shadow:0 24px 80px #0003}
.time-dialog h2{text-align:center;line-height:1.3}.time-dialog .week-all{font-size:14px}.time-dialog::backdrop{background:#07133e66}

/* Match the schedule inset to the surrounding group card content. */
.group-tile>.week-summary,.group-tile>.text-button{margin:0 24px 22px}
@media(max-width:600px){.group-tile>.week-summary,.group-tile>.text-button{margin:0 18px 18px}}
