/* Shared Omavu surfaces, type and controls. Palette values follow the approved Omavu brand boards. */
@font-face {
  font-family: "Omavu Lato";
  src: url("/fonts/Lato-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Omavu Lato";
  src: url("/fonts/Lato-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  --om-blue: #0d76f8;
  --om-indigo: #5638e9;
  --om-violet: #9a2bf2;
  --om-iris: #6848ef;
  --om-hero: linear-gradient(118deg, #096de6 0%, var(--om-indigo) 51%, #8724d8 100%);
  --om-primary: linear-gradient(115deg, #125fd0, #5833d6 62%, #7927c3);
  --om-radius-s: 11px;
  --om-radius-m: 15px;
  --om-radius-l: 21px;
  --om-radius-xl: 25px;
  --om-card-space: clamp(16px, 2vw, 25px);
  --om-gutter: clamp(16px, 4.1vw, 52px);
  --om-gap: clamp(12px, 1.5vw, 18px);
  --om-title: clamp(1.68rem, 3vw, 2.6rem);
  --om-heading: clamp(1.1rem, 1.6vw, 1.32rem);
  --om-metric: clamp(2.15rem, 5vw, 3.25rem);
  --om-type: "Omavu Lato", Rubik, "Noto Sans", system-ui, sans-serif;
  font-family: var(--om-type);
  font-synthesis: none;
}
:root, :root[data-omavu-theme="light"] {
  --paper: #f4f5fb;
  --surface: #fff;
  --ink: #17192e;
  --muted: #545971;
  --line: #dcdeea;
  --accent: #5332c4;
  --soft: #efedff;
  --focus: #4931cb;
  --danger: #a32b47;
  --on-accent: #fff;
  --om-faint: #f1f2f9;
  --om-track: #e7e5f3;
  --om-border: #e3e5ef;
  --om-success: #16614c;
  --om-success-bg: #e2f4eb;
  --om-pending: #76500d;
  --om-pending-bg: #fff0cd;
  --om-shadow: 0 3px 15px -7px #22214a22;
  --om-header: #f7f7fc;
  --om-chart-top: #6d9cfc;
  --om-chart-mid: #797ae9;
  --om-chart-base: #8873e3;
  --om-chart-grid: #e5e6f2;
  --button: var(--om-primary);
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}
:root[data-omavu-theme="dark"] {
  --paper: #101123;
  --surface: #1a1c32;
  --ink: #f4f4ff;
  --muted: #b9bad0;
  --line: #43465f;
  --accent: #b7a5ff;
  --soft: #302a50;
  --focus: #c1ddff;
  --danger: #ffa1b5;
  --om-faint: #23253e;
  --om-track: #3b3858;
  --om-border: #35374f;
  --om-success: #9ce2c8;
  --om-success-bg: #193c37;
  --om-pending: #ffda92;
  --om-pending-bg: #443522;
  --om-shadow: 0 5px 18px -8px #0708179c;
  --om-header: #141529;
  --om-chart-grid: #37384f;
  --om-chart-top: #90b8ff;
  --om-chart-mid: #9396ff;
  --om-chart-base: #a28bf5;
  color-scheme: dark;
}
html, body { min-height: 100%; }
body, .kids-body { background: var(--paper); color: var(--ink); }
.kids-body { --paper:inherit; }
body { line-height: 1.45; -webkit-text-size-adjust:100%; }
.rh { --rh-accent:var(--accent); --rh-tint:var(--soft); --rh-track:var(--om-track); --rh-hero:var(--om-hero); }
h1, .authHeading h1, .kids-join h1 {
  background: none; color:var(--ink); -webkit-text-fill-color:currentColor;
  font-size:var(--om-title); line-height:1.1; letter-spacing:-.032em; font-weight:700;
}
h2, .rh .rh-heading, .community .cm-card h2, .om-theme h2 {
  font-size:var(--om-heading); line-height:1.25; color:var(--ink); letter-spacing:-.018em;
}
:lang(ar) { letter-spacing:normal; }
main p, .rh .rh-help, .rh .rh-empty, .cm-card .cm-help { line-height:1.48; }
body > header, .kids-frame > .kids-header {
  min-height:70px; gap:12px; background:var(--om-header); color:var(--ink);
  border:0; border-bottom:1px solid var(--om-border);
}
body > header { padding:9px max(var(--om-gutter), calc((100vw - 1200px) / 2)); }
.brand, .kids-brand { gap:10px; align-items:center; }
.brand .brandLockup, .kids-brand img {
  width:38px; height:38px; object-fit:contain; border-radius:11px;
}
.brand .productName, .kids-brand { color:var(--ink); font-size:1.29rem; font-weight:700; letter-spacing:-.025em; line-height:1.12; }
.kids-brand small { font-size:.77rem; margin-block-start:2px; color:var(--muted); line-height:1.2; letter-spacing:0; }
header #tools select, header .helpButton, header .profileButton, .kids-header select {
  color:var(--ink); background-color:var(--surface); border:1px solid var(--om-border);
  border-radius:13px; box-shadow:none;
}
header .helpButton, header .profileButton {
  display:grid; place-items:center; padding:0; min-height:44px; width:44px; height:44px;
  color:var(--accent); background:var(--soft); border-color:transparent;
}
header .helpButton { font-size:1.22rem; }
header .profileButton svg { width:20px; height:20px; }
#tools > label { display:block; }
header #tools { gap:6px; }
header #tools select, .kids-header select { min-height:44px; font-size:.9rem; }
button, input:not([type=checkbox]), textarea, select { border-radius:var(--om-radius-s); line-height:1.3; }
button:not([disabled]):focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline:3px solid var(--focus); outline-offset:2px;
}
button { font-weight:700; }
button:enabled:active { box-shadow:inset 0 0 0 1px currentColor; }
.primary, button.active { color:white; border-color:transparent; background:var(--om-primary); }
select {
  appearance:none; cursor:pointer; padding-inline:13px 35px;
  background-color:var(--surface);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23656a85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:18px 18px;
}
[dir=rtl] select { background-position:left 10px center; }
body > header #tools select, .kids-header select { padding-inline:10px 26px; background-position:right 5px center; }
[dir=rtl] body > header #tools select, [dir=rtl] .kids-header select { background-position:left 5px center; }
:root[data-omavu-theme="dark"] select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23bbc0d8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); }
main, .parentContent, section, .rh-area, .rh-row-text, .rh-field, .om-theme { min-inline-size:0; }
main > section, .rh .rh-section, .rh .rh-editor, .rh-pair, .kids-join, .rh .community .cm-card, .om-theme {
  background:var(--surface); border:1px solid var(--om-border); border-radius:var(--om-radius-l);
  box-shadow:var(--om-shadow); padding:var(--om-card-space);
}
main > section { margin:0 0 var(--om-gap); }
.shell { max-width:1320px; gap:clamp(24px,3.5vw,48px); padding:clamp(22px,3vw,42px) var(--om-gutter) 50px; grid-template-columns:minmax(150px,185px) minmax(0,1fr); }
#main > h1 { margin:0 0 clamp(14px,2vw,22px); }
#nav { align-content:start; gap:5px; }
#nav button { font-weight:700; min-height:46px; color:var(--muted); }
#nav button.active { background:var(--soft); color:var(--accent); }
#nav button svg, .kids-tabs button svg { width:21px; height:21px; }
#nav path, .rh svg path, .profileButton svg path { stroke-linejoin:round; stroke-linecap:round; }
#nav path { stroke-width:1.75px; }
.scopeSelect select { background-color:var(--surface); height:44px; min-height:44px; font-weight:700; }
#main .hero, .rh .rh-hero {
  color:white; background:var(--om-hero); border:0; border-radius:var(--om-radius-xl);
  box-shadow:0 7px 19px -10px #4424ac77; padding:clamp(18px,2.9vw,35px);
}
.hero .row { align-items:center; justify-content:start; gap:10px; }
.hero .row > strong, .rh .rh-hero-label { color:#fff; font-size:.91rem; font-weight:700; line-height:1.25; }
.hero .metric, .rh .kids-hero strong, .rh .rh-score strong, .metric {
  font-variant-numeric:tabular-nums; font-size:var(--om-metric); letter-spacing:-.045em; line-height:1.04; font-weight:700;
}
.hero .metric { margin-block:10px 5px; }
.hero > p:not(.metric), .hero > small { color:#fff; font-size:.88rem; line-height:1.35; }
.hero .viewProgress { margin:13px 0 6px; height:6px; }
.hero .chip { color:white; background:#ffffff20; font-size:.76rem; }
.hero .chip::before { color:#9effd0; }
.hero .chip.off::before { color:#ebe7ff; }
.heroActions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-block-start:17px; }
.heroActions > button { min-height:44px; padding:9px 8px; border:1px solid #ffffff83; border-radius:var(--om-radius-s); background:#1a17644a; color:white; font-size:.9rem; line-height:1.23; overflow-wrap:anywhere; }
.heroActions > .primary { color:#36218b; background:white; border-color:white; }
.heroActions > button:focus-visible { outline-color:white; }
.chip:not(.off,.pending) { background:var(--om-success-bg); color:var(--om-success); }
.chip.pending { background:var(--om-pending-bg); color:var(--om-pending); }
.hero .chip:not(.off,.pending) { color:#fff; background:#ffffff25; }
.homeSummaries { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--om-gap); margin-bottom:var(--om-gap); }
.summaryCard { border:1px solid var(--om-border); box-shadow:var(--om-shadow); border-radius:var(--om-radius-m); gap:12px; }
.summaryCard svg, .deviceCard .row > svg, .deviceControls .row > svg {
  box-sizing:content-box; width:21px; height:21px; flex:none; padding:9px;
  color:var(--accent); background:var(--soft); border-radius:12px;
}
.summaryCard span { font-size:.98rem; line-height:1.3; }
.hero + section p, .deviceCard p { font-size:.92rem; }
.deviceControls .row h2, .deviceCard .row h2, .requestCard h2 { margin-block:0; }
.deviceCard .row, .deviceControls .row { margin-bottom:10px; }
.deviceControls .actions, .requestCard .actions { margin-bottom:0; }
#main .deviceCard .row > strong { font-size:1.15rem; }
#main .deviceCard .actions { margin-bottom:0; }
.item:last-child { border-bottom-color:transparent; }
#main .item { font-size:.96rem; }
.roleCard { --om-role-space:clamp(20px,4.2vw,40px); overflow:hidden; max-width:690px; padding:var(--om-role-space); }
.roleCard::before {
  content:""; display:block; height:clamp(76px,10vw,108px);
  margin:calc(0px - var(--om-role-space)) calc(0px - var(--om-role-space)) var(--om-role-space);
  background:url("/omavu-lockup.png") center / min(60%,204px) auto no-repeat,
    radial-gradient(ellipse at 100% 120%,#3e1983,transparent 55%),
    linear-gradient(115deg,#102681,#0b0b29 57%,#17103b);
}
.roleCard > h1 { margin:0 0 19px; }
.roleChoices { gap:12px; }
.roleChoice { border:1px solid var(--om-border); border-radius:var(--om-radius-m); padding:15px; background:var(--om-faint); }
.roleChoice strong { color:var(--ink); margin-bottom:3px; font-size:1.05rem; }
.roleChoice small { color:var(--muted); }
.roleChoice img { width:48px; height:48px; border-radius:13px; }
.roleChoice:hover { background:var(--soft); }
.auth { border-radius:var(--om-radius-xl); }
.auth .fields { gap:14px; }
.auth .primary { min-height:46px; }
.statsTools { gap:8px; }
.statsTools .periodControl, .om-segment, .rh-parent .rh-tabs:not(.kids-tabs) {
  border:1px solid var(--om-border); background:var(--om-faint); border-radius:13px; padding:3px;
}
.periodControl button, .om-segment button, .rh-parent .rh-tabs:not(.kids-tabs) button {
  color:var(--muted); border:0; border-radius:10px; background:transparent; font-weight:700;
}
.periodControl button.active, .rh-parent .rh-tabs:not(.kids-tabs) button[aria-pressed="true"], .om-segment button[aria-pressed="true"] {
  color:var(--accent); background:var(--surface); box-shadow:0 1px 5px #151e4123;
}
.calendarTrigger { background:var(--soft); color:var(--accent); border-color:transparent; }
.calendarTrigger.active { color:white; background:var(--om-primary); }
#main section:has(.statsTools) > .metric { margin:7px 0; color:var(--ink); }
.periodCaption { color:var(--accent); margin-top:17px; font-size:.94rem; }
.bars { border-bottom-color:var(--om-border); background:repeating-linear-gradient(to top,transparent 0 31px,var(--om-chart-grid) 31px 32px) 0 calc(100% - 34px) / 100% 96px no-repeat; margin:15px 0 14px; }
.bars button { border-radius:7px; font-weight:400; }
.bars button .barValue { font-variant-numeric:tabular-nums; font-weight:700; }
.bars button .barLabel { color:var(--muted); }
.bars .barSky { stop-color:var(--om-chart-top); }
.bars .barBlue { stop-color:var(--om-chart-mid); }
.bars .barIndigo { stop-color:var(--om-chart-base); }
.bars [aria-current=date] .barSky { stop-color:#479afc; }
.bars [aria-current=date] .barBlue { stop-color:#5f5be4; }
.bars [aria-current=date] .barIndigo { stop-color:var(--om-iris); }
.statAppRow { display:grid; grid-template-columns:1fr auto; gap:5px 12px; padding-block:10px; }
.statAppRow progress { width:100%; height:5px; border:0; appearance:none; color:var(--om-iris); background:var(--om-track); border-radius:20px; grid-column:1/-1; }
.statAppRow progress::-webkit-progress-bar { background:var(--om-track); border-radius:20px; }
.statAppRow progress::-webkit-progress-value { background:var(--om-primary); border-radius:20px; }
.statAppRow progress::-moz-progress-bar { background:var(--om-primary); border-radius:20px; }
dialog { padding:clamp(18px,3vw,30px); border:1px solid var(--om-border); border-radius:var(--om-radius-xl); box-shadow:0 24px 66px #090c2c35; }
dialog::backdrop { background:#12163179; }
.calendarToolbar { margin:12px 0 8px; }
.calendarToolbar button { background:var(--soft); color:var(--accent); border:0; border-radius:12px; }
.calendarTable { border-spacing:3px; }
.calendarTable th { font-size:.79rem; font-weight:700; }
button.calendarDay { background:var(--om-faint); color:var(--ink); font-size:.98rem; font-weight:700; }
button.calendarDay:disabled { background:transparent; }
button.calendarDay[aria-pressed=true] { color:white; background:var(--om-primary); }
.calendarDay[aria-current=date]:not([aria-pressed=true]) { color:var(--accent); }
.calendarFooter button { border:0; background:var(--soft); color:var(--accent); }
.weekgrid { gap:5px; }
.weekgrid button { background:var(--om-faint); border-color:transparent; border-radius:10px; padding:7px 2px; }
.weekgrid button.active { background:var(--om-primary); color:white; }
.kids-frame { max-width:680px; padding-inline:clamp(14px,3vw,25px); }
.kids-frame > .kids-header { padding:9px 0; background:transparent; border:0; }
.kids-frame > main { padding:0 0 max(99px,calc(env(safe-area-inset-bottom) + 84px)); }
.rh .rh-area { gap:var(--om-gap); }
.rh .kids-hero { gap:5px; }
.rh .kids-hero strong { margin:1px 0; }
.rh .kids-hero > span:not(.rh-hero-label) { font-size:.91rem; color:white; }
.rh .kids-hero .rh-progress { margin-top:9px; }
.rh .kids-hero .kids-remaining { padding-top:6px; }
.rh .rh-section > .rh-editor { background:none; border:0; padding:0; box-shadow:none; }
.rh .rh-line { border:1px solid var(--om-border); border-radius:var(--om-radius-m); padding:13px; box-shadow:none; }
.rh-kids .rh-section { padding:0; border:0; background:none; box-shadow:none; }
.rh .rh-row-head { align-items:center; }
.rh-kids .rh-line:has(.rh-row-actions) { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.rh-kids .rh-line:has(.rh-row-actions) > .rh-row-head { flex:1 1 11rem; min-inline-size:min(100%,11rem); }
.rh-kids .rh-line:has(.rh-row-actions) > .rh-row-actions { max-inline-size:100%; }
.rh-kids .rh-line > .rh-progress { flex-basis:100%; }
.rh-kids .rh-area[data-screen=messages] .rh-line { display:block; }
.rh-kids .rh-area[data-screen=messages] .rh-row-actions { margin-block-start:11px; margin-inline-start:49px; }
.rh-kids .rh-line .rh-row-actions button { min-height:44px; }
.rh .rh-icon { color:var(--accent); background:var(--soft); width:38px; height:38px; border-radius:12px; }
.rh .rh-row-text h3 { font-size:.99rem; line-height:1.26; letter-spacing:-.01em; }
.rh .rh-meta { font-size:.87rem; gap:3px 7px; color:var(--muted); }
.rh-line button, .rh .kids-inbox { border-color:var(--om-border); }
.rh .rh-badge { border-radius:7px; padding:2px 6px; font-size:.78rem; }
.rh .rh-badge[data-status=approved], .rh .rh-badge[data-status=read] { color:var(--om-success); background:var(--om-success-bg); }
.rh .rh-badge[data-status=submitted], .rh .rh-badge[data-status=pending], .rh .rh-badge[data-status=scheduled] { color:var(--om-pending); background:var(--om-pending-bg); }
.rh .kids-inbox { color:var(--accent); background:var(--surface); }
.rh .rh-section > .rh-empty { border:1px solid var(--om-border); border-radius:var(--om-radius-m); }
.rh .rh-receipts { padding-inline-start:50px; }
.rh .rh-family-stat { background:var(--om-faint); border:1px solid var(--om-border); }
.rh .rh-progress::-webkit-progress-value { background:var(--om-primary); }
.rh .rh-progress::-moz-progress-bar { background:var(--om-primary); }
.rh .rh-hero .rh-progress::-webkit-progress-value { background:#fff; }
.rh .rh-hero .rh-progress::-moz-progress-bar { background:#fff; }
.rh .kids-tabs { width:min(680px,100%); grid-template-columns:none; grid-auto-columns:minmax(0,1fr); grid-auto-flow:column; border-radius:18px 18px 0 0; border:1px solid var(--om-border); border-bottom:0; box-shadow:0 -3px 13px -8px #20204b3a; }
.rh .kids-tabs button { min-height:50px; color:var(--muted); font-size:.78rem; letter-spacing:0; }
.rh .kids-tabs button[aria-pressed=true] { background:transparent; color:var(--accent); font-weight:700; }
.rh .kids-tabs button[aria-pressed=true] svg { color:var(--accent); }
.rh .rh-family-stat b, .community .cm-metric strong { color:var(--accent); }
.community .cm-metrics { gap:15px 10px; }
.community .cm-card .cm-goal { font-size:.98rem; }
.community .cm-card .cm-boundary { border:1px solid var(--om-border); background:var(--om-faint); }
.om-theme { margin:0 0 var(--om-gap); }
.om-theme h2 { margin:0 0 12px; }
.om-segment { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:2px; max-width:440px; }
.om-segment button { min-width:0; min-height:44px; padding:5px; font-size:.93rem; }
#main[data-screen=home]:has(> .hero) { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--om-gap); align-items:start; }
#main[data-screen=home]:has(> .hero) > * { grid-column:1 / -1; margin:0; }
#main[data-screen=home]:has(> .hero) > h1 { grid-row:1; grid-column:1; align-self:center; }
#main[data-screen=home]:has(> .hero) > .scopeSelect { grid-row:1; grid-column:2; justify-self:end; min-width:0; width:min(100%,240px); }
@media(min-width:900px) {
  #main[data-screen=home]:has(> .hero) { grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr); }
  #main[data-screen=home]:has(> .hero) > .hero { grid-column:1; }
  #main[data-screen=home]:has(> .hero) > .deviceControls { grid-column:2; grid-row:2; height:100%; }
  #main[data-screen=home]:has(> .hero) > .homeSummaries { grid-column:2; }
  #main[data-screen=home]:has(> .hero) > .requestCard { grid-column:1; }
  #main[data-screen=home]:has(> .hero) > .homeSummaries:not(:has(:only-child)) { grid-template-columns:1fr; }
  .kids-frame { max-width:960px; }
  .rh .kids-tabs { width:min(910px,calc(100% - 50px)); }
  .rh-kids .rh-area:not([data-screen=home],[data-screen=progress]) { max-width:720px; margin-inline:auto; }
  .rh-kids .rh-area:is([data-screen=home],[data-screen=progress]) { grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr); column-gap:clamp(20px,2.4vw,32px); align-items:start; }
  .rh-kids .rh-area:is([data-screen=home],[data-screen=progress]) > .kids-hero { grid-column:1; grid-row:1; }
  .rh-kids .rh-area[data-screen=home] > .rh-section { grid-column:2; }
  .rh-kids .rh-area[data-screen=progress] > .rh-section:last-of-type { grid-column:2; grid-row:1 / span 2; }
  .rh-kids .rh-area[data-screen=home] > :is(.kids-inbox,.rh-empty), .rh-kids .rh-area[data-screen=progress] > .rh-section:not(:last-of-type) { grid-column:1; }
}
@media (max-width:760px) {
  .shell { display:flex; padding:14px var(--om-gutter) 92px; gap:0; }
  .shell:has(nav:not(:empty)) { padding-bottom:calc(90px + env(safe-area-inset-bottom)); }
  .shell:has(nav:empty) { padding-bottom:32px; }
  body > header { padding-inline:var(--om-gutter); min-height:65px; }
  nav#nav:not(:empty) { border:0; border-top:1px solid var(--om-border); border-radius:0; background:var(--surface); box-shadow:0 -3px 13px -9px #181b442a; padding:4px max(5px,env(safe-area-inset-left)) max(5px,env(safe-area-inset-bottom)); }
  #nav button { border-radius:11px; gap:4px; min-height:51px; line-height:1.15; font-size:.76rem; padding:3px 1px; font-weight:400; }
  #nav button.active { background:transparent; color:var(--accent); font-weight:700; }
  #nav button.active svg { color:var(--accent); }
  .brand .brandLockup, .kids-brand img { width:34px; height:34px; border-radius:10px; }
  .brand, .kids-brand { gap:8px; }
  .brand .productName, .kids-brand { font-size:clamp(1.02rem,4.6vw,1.3rem); }
  #main .homeSummaries { grid-template-columns:1fr; gap:7px; }
  .summaryCard { padding:12px 14px; min-height:57px; }
  .summaryCard svg { width:19px; height:19px; padding:7px; border-radius:10px; }
  #main[data-screen=home]:has(> .hero) > .hero { grid-row:2; }
  #main[data-screen=home]:has(> .hero) > .requestCard { order:2; }
  #main[data-screen=home]:has(> .hero) > .homeSummaries { order:3; }
  #main[data-screen=home]:has(> .hero) > .deviceControls { order:4; }
  #main[data-screen=home]:has(> .hero) > .eventCard { order:5; }
  .kids-frame { padding-inline:var(--om-gutter); }
  .kids-frame > .kids-header { min-height:65px; }
  .rh .kids-tabs { width:min(680px,100%); border-radius:0; border-inline:0; }
  .rh .rh-line { padding:12px; }
}
@media(max-width:479px) {
  .roleCard { margin-block:clamp(12px,4vh,32px); }
  header #tools > label[data-iso] { display:flex; align-items:center; position:relative; min-width:55px; width:55px; max-width:none; min-height:44px; border:1px solid var(--om-border); background:var(--surface); color:var(--ink); border-radius:13px; }
  header #tools > label[data-iso]::before { content:attr(data-iso); margin-inline:9px 2px; font-size:.84rem; font-weight:700; }
  header #tools > label[data-iso]::after { content:""; width:6px; height:6px; margin-inline-start:auto; margin-inline-end:9px; margin-block-end:3px; border:solid var(--muted); border-width:0 1.7px 1.7px 0; transform:rotate(45deg); }
  /* The actual native control still exposes every language name, handles the keyboard and receives touch. */
  header #tools > label[data-iso] select { position:absolute; inset:0; width:100%; height:100%; opacity:0; }
  header #tools > label[data-iso]:focus-within { outline:3px solid var(--focus); outline-offset:2px; }
}
@media (max-width:400px) {
  :root { --om-gutter:13px; --om-card-space:15px; }
  body > header, .kids-frame > .kids-header {gap:6px; }
  header #tools {gap:4px;}
  header #tools select { font-size:.82rem; }
  #nav button, .rh .kids-tabs button { font-size:.71rem; }
  #main .statsTools { display:grid; grid-template-columns:1fr; }
  #main .statsTools .calendarTrigger { justify-self:start; min-height:42px; }
  .weekgrid { gap:3px; } .weekgrid button { font-size:.73rem; }
}
@media(max-width:345px) {
  :root { --om-gutter:10px; --om-card-space:13px; }
  .brand { gap:5px; }
  .brand .brandLockup {width:29px;height:29px;border-radius:9px;}
  .brand .productName {font-size:1rem;}
  #nav button, .rh .kids-tabs button { font-size:.65rem; }
  .rh .kids-tabs button { padding-inline:0; }
}
@media(forced-colors:active) {
  .brand .brandLockup, .roleCard::before {forced-color-adjust:none;}
  .rh .rh-hero, #main .hero {border:1px solid CanvasText;}
  .rh .rh-icon, .summaryCard svg {color:ButtonText;}
  .periodControl button.active, .om-segment button[aria-pressed=true], #nav button.active, .rh-tabs button[aria-pressed=true] { outline:2px solid Highlight; }
}
@media print {
  :root, body, .kids-body { color:black; background:white; }
  #main[data-screen=home]:has(> .hero) { display:block; }
  .om-theme, .kids-tabs { display:none !important; }
  main > section { box-shadow:none; }
}

.scopeSelect { position:relative; }
.scopeSelect .scopeName { display:none; }
@media(max-width:600px) {
  body > header, .shell, .parentContent, #main { inline-size:100%; min-inline-size:0; }
  #main[data-screen=home]:has(> .hero) > h1 { grid-column:1/-1; grid-row:auto; }
  #main[data-screen=home]:has(> .hero) > .scopeSelect { grid-column:1/-1; grid-row:auto; width:100%; max-width:none; }
  .scopeSelect .scopeName { display:block; padding:10px 38px 10px 14px; border:1px solid var(--om-border); border-radius:14px; background:var(--surface); color:var(--ink); min-height:44px; overflow-wrap:anywhere; font-weight:700; }
  .scopeSelect::after { content:""; position:absolute; inset-inline-end:16px; top:calc(50% - 5px); width:7px; height:7px; border:solid var(--muted); border-width:0 2px 2px 0; transform:rotate(45deg); pointer-events:none; }
  .scopeSelect select { position:absolute; inset:0; width:100%; height:100%; opacity:0; z-index:1; }
  .scopeSelect:focus-within { outline:2px solid var(--focus); border-radius:14px; }
  #main :is(input,select,textarea), #sheet :is(input,select,textarea), header #tools select { font-size:max(16px,1rem); min-inline-size:0; max-inline-size:100%; }
  #main .hero .row, #main .deviceCard .row { flex-wrap:wrap; }
  #main .hero strong, #main .deviceCard strong, #sheet p { min-inline-size:0; overflow-wrap:anywhere; }
  body > .shell #nav:not(:empty) { inset-inline:0; width:auto; max-width:none; box-sizing:border-box; grid-template-columns:repeat(5,minmax(0,1fr)); }
  #nav button { white-space:normal; min-width:0; overflow-wrap:anywhere; }
}
.guardReport { margin:8px 0 12px; padding:14px; border:1px solid var(--om-border); border-radius:15px; background:var(--om-faint); }
.guardReport h3 { margin:0 0 6px; } .guardReport p { margin:0; }
.guardTechnical { padding:8px 0; } .guardTechnical summary { cursor:pointer; font-weight:650; }
#sheet [hidden] { display:none; }

.updateLink { display:inline-flex; align-items:center; justify-content:center; min-height:44px; border-radius:12px; padding:6px 16px; font-weight:650; text-decoration:underline; }

/* Shared parent controls for a child and for the selected TV. */
.settingsCard, .settingGroup, .familyMembers, .profileActions {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:10px;
}
.settingsCard h2, .settingsCard h3, .settingsCard p { margin:0; }
.settingsCard h3, .settingGroup, .familyMembers + button { margin-block-start:4px; }
.settingsCard h3, .settingGroup { border-block-start:1px solid var(--line); padding-block-start:16px; }
.settingsCard h3 { font-size:1rem; }
.settingsDeviceName, .profileOwner { color:var(--muted); overflow-wrap:anywhere; }
.settingsCard .familyMembers .item { padding:0; min-height:0; border:0; }
.settingsCard label { margin:0; }
.settingsCard button, .rh .profileAction, .rh .profileDisclosure > summary, .rh .profileAdd > summary {
  box-sizing:border-box;
  width:100%;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:11px 14px;
  margin:0;
  font:inherit;
  font-weight:700;
  line-height:1.35;
  text-align:start;
  overflow-wrap:anywhere;
  border-radius:var(--om-radius-s);
}
.settingsCard .removeTVAction { color:var(--danger); }
.rh .profileOwner { margin:-6px 0 14px; }
.rh .profileActions > .profileDisclosure, .rh .profileAdd {
  padding:0;
  border:0;
  border-radius:var(--om-radius-s);
  background:none;
  box-shadow:none;
}
.rh .profileDisclosure > summary, .rh .profileAdd > summary {
  list-style:none;
  background:var(--surface);
  border:1px solid var(--line);
}
.rh .profileDisclosure > summary::-webkit-details-marker, .rh .profileAdd > summary::-webkit-details-marker { display:none; }
.rh .profileDisclosure > summary::after, .rh .profileAdd > summary::after {
  content:""; flex:none; margin-inline-start:auto; width:7px; height:7px;
  border:solid currentColor; border-width:0 2px 2px 0; transform:rotate(45deg);
}
.rh .profileDisclosure[open] > summary::after, .rh .profileAdd[open] > summary::after { transform:rotate(225deg); }
.rh .profileDisclosure form, .rh .profileAdd form { padding:10px 12px 14px; }
.rh .profileAction svg, .rh .profileDisclosure svg, .rh .profileAdd svg { width:20px; height:20px; flex:none; }
.rh .rh-section > .profileAction { margin-block-start:12px; }
.rh .profileActions:has(> .profileAction):not(:has(details[open])) { grid-auto-rows:1fr; }
.rh .profileDisclosure:not([open]) > summary { height:100%; }

#sheet.ruleSheet { box-sizing:border-box; width:min(540px,calc(100vw - 24px)); max-width:calc(100% - 24px); max-height:88vh; max-height:88dvh; padding:clamp(14px,3vw,24px); }
#sheet.ruleSheet #sheetForm, .rulePane, .ruleTarget, .targetPicker, .targetList, .ruleReview { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:12px; }
#sheetForm .targetPicker { display:block; border:1px solid var(--line); border-radius:12px; background:var(--surface); padding:0 12px; }
.targetPicker summary { min-height:46px; padding:12px 0; font-weight:700; cursor:pointer; overflow-wrap:anywhere; }
#sheet .targetList { max-height:min(35vh,260px); overflow:auto; gap:0; margin:8px 0; }
#sheet .targetList label { display:flex; flex-flow:row nowrap; align-items:center; justify-content:flex-start; gap:10px; min-height:42px; border-block-start:1px solid var(--line); margin:0; padding:8px 0; overflow-wrap:anywhere; }
#sheet .targetList input, #sheet .ruleDays input { flex:none; }
.ruleSteps, .ruleDays { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
.ruleSteps { border-radius:12px; background:var(--surface2,var(--line)); padding:3px; }
.ruleSteps button { border:0; background:transparent; font-size:.87rem; padding:7px 3px; min-height:44px; overflow-wrap:anywhere; }
.ruleSteps button[aria-current=step] { background:var(--surface); color:var(--accent); box-shadow:0 1px 4px #19143624; }
.rulePane h3 { font-size:1rem; margin:3px 0 0; }
.ruleDays { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
#sheet .ruleDays label { position:relative; display:grid; place-items:center; padding:8px 2px; margin:0; min-height:44px; border:1px solid var(--line); border-radius:10px; font-weight:700; cursor:pointer; }
.ruleDays input { position:absolute; opacity:0; }
#sheet .ruleDays label:has(:checked) { background:var(--om-primary); border-color:transparent; color:white; }
.ruleDays label:focus-within { outline:2px solid var(--focus); }
#sheet .rulePane :is(.two,.fields,.two > label), #sheet .rulePane input { min-width:0; max-width:100%; }
.rulePane .two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ruleReview { gap:4px; margin:0; }
.ruleReview dt { font-size:.88rem; color:var(--muted); }
.ruleReview dd { margin:0 0 9px; font-weight:700; overflow-wrap:anywhere; }
.ruleProblem:empty { display:none; }
.ruleProblem { color:var(--danger); }
#sheet .ruleFooter { display:flex; flex-wrap:wrap; gap:6px; }
#sheet .ruleFooter button { flex:1 1 auto; min-width:0; }
.rh .quotaRow { display:grid; grid-column:1/-1; gap:4px; border-block-start:1px solid var(--line); padding-block-start:9px; min-width:0; overflow-wrap:anywhere; }

#sheet .targetList label[hidden], #sheet .rulePane[hidden], #sheet .ruleFooter [hidden] {display:none!important}
#sheet.ruleSheet { overflow:hidden; }
#sheet.ruleSheet #sheetForm { display:flex; flex-flow:column nowrap; max-height:calc(88vh - 2 * clamp(14px,3vw,24px) - 2px); max-height:calc(88dvh - 2 * clamp(14px,3vw,24px) - 2px); }
#sheet.ruleSheet #sheetForm > :not(.ruleBody) { flex:none; }
.ruleBody { min-height:0; min-width:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; padding:3px; }
#sheet .ruleFooter { margin:0; padding-top:6px; border-top:1px solid var(--line); }
@media(min-width:370px) { .ruleDays {grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;} }

/* A native date/time control can set the intrinsic width of its entire grid track. */
#sheet { box-sizing:border-box; max-inline-size:calc(100% - 24px); overflow-x:hidden; overscroll-behavior-x:none; }
#sheetForm, #sheetForm .fields, #sheetForm label:not(.check) { grid-template-columns:minmax(0,1fr); }
#sheetForm, #sheetForm > *, #sheetForm .fields > *, #sheetForm .two > *, #sheetForm label { min-inline-size:0; max-inline-size:100%; }
#sheetForm :is(input[type="time"],input[type="date"],select) { box-sizing:border-box; inline-size:100%; min-inline-size:0; max-inline-size:100%; }
#sheet .targetList { overflow-x:hidden; overflow-y:auto; }
#sheet .ruleSteps, #sheet .ruleBody, #sheet .ruleFooter { align-self:stretch; }
@media (max-width:430px) {
  #sheet .rulePane .two { grid-template-columns:minmax(0,1fr); }
  #sheet .ruleFooter button { overflow-wrap:anywhere; }
}

html.dialogOpen { overflow:hidden; overscroll-behavior:none; }
html.dialogOpen body { position:fixed; top:var(--dialog-page-offset); inset-inline:0; width:100%; overflow:hidden; }
dialog[open] { overflow-x:hidden; overscroll-behavior:contain; max-inline-size:calc(100% - 24px); }
#sheet .pickerResults { min-block-size:0; min-inline-size:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; scrollbar-gutter:stable; padding-inline:3px; }
#sheet .pickerResults .targetList { max-height:none; overflow:visible; margin:0; }
#sheet .appPickerPanel { display:none; }
#sheet.pickingTargets { position:fixed; inset-inline:0; top:calc(var(--dialog-view-top,0px) + 8px); bottom:auto; margin:0 auto; width:min(540px,calc(100% - 16px)); height:min(680px,calc(var(--dialog-view-height,100dvh) - 16px)); max-height:calc(var(--dialog-view-height,100dvh) - 16px); }
#sheet.pickingTargets #sheetForm { height:100%; max-height:none; }
#sheet.pickingTargets #sheetForm > :not(.appPickerPanel) { display:none!important; }
#sheet.pickingTargets #sheetForm > .appPickerPanel { display:grid; flex:1; min-height:0; gap:10px; grid-template: auto auto minmax(0,1fr) auto / minmax(0,1fr); padding:2px; border:0; box-shadow:none; margin:0; }
#sheet .appPickerPanel input[type=search] { width:100%; min-height:52px; padding:10px 14px; font-size:1rem; }
#sheet .appPickerPanel .targetList label { min-height:48px; }
#sheet .pickerDone { width:100%; min-height:46px; }
.catalogRow { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,14rem); align-items:center; gap:8px 16px; }
.catalogRow .appIdentity, .catalogRow .appIdentity > div, .catalogRow label { min-width:0; overflow-wrap:anywhere; }
@media(max-width:680px) {
  .item.catalogRow { display:grid; grid-template-columns:minmax(0,1fr); }
  .catalogRow label, .catalogRow select { width:100%; max-width:100%; }
}

.brand .familyChoice { background:var(--surface);color:var(--ink);filter:none;opacity:1; }
body > header { background:var(--surface); backdrop-filter:none; -webkit-backdrop-filter:none; padding-top:max(9px,env(safe-area-inset-top)); }
#main .deviceCard > .actions {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; align-items:stretch; margin:0;
}
#main .deviceCard > .actions > button {
  display:grid; place-items:center; min-width:0; min-height:48px; height:100%;
  padding:10px 8px; white-space:normal; overflow-wrap:break-word; line-height:1.22;
}
#main .deviceCard .setupDevicePin {grid-column:1 / -1;width:100%}
.deviceTime { background:var(--soft); color:var(--accent); border-color:transparent; }
.deviceTop { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; align-items:center; }
.deviceName { font-size:1.1rem; line-height:1.27; overflow-wrap:anywhere; }
.deviceTop .chip {grid-column:1;grid-row:2;justify-self:start}
.deviceTop .deviceMenu {grid-column:2;grid-row:1 / span 2;align-self:start;display:grid;place-items:center;width:44px;height:44px;padding:0}
.deviceMenu svg {width:23px;height:23px;stroke-width:3;stroke-linecap:round}
.deviceWarning { color:var(--om-pending); }
#main .pairDevice { margin:0 0 var(--om-gap); min-height:46px; }
#sheetForm > button.remove { color:var(--danger,#ac293d); }
.sessionEntry { padding:8px 0; border-bottom:1px solid var(--om-border); }
.sessionEntry p { margin:2px 0; }
.packageName { color:var(--muted); overflow-wrap:anywhere; }
#sheet .inboxItem {display:grid;gap:10px;padding:14px;margin-block:8px;}
#sheet .inboxItem > p {margin:0;line-height:1.45;}
#sheet .inboxItem > button {justify-self:start;width:auto;min-height:44px;padding:6px 16px;}
.tvViewer {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:3px 12px;
  width:100%; margin:14px 0; padding:11px 14px; text-align:start;
  border:1px solid var(--om-border); border-radius:var(--om-radius-s); background:var(--om-faint); color:var(--ink);
}
.viewerLabel { grid-column:1; color:var(--muted); font-size:.82rem; font-weight:500; }
.viewerName { grid-column:1; overflow-wrap:anywhere; }
.tvViewer > svg { grid-column:2; grid-row:1 / span 2; width:20px; height:20px; color:var(--accent); }
@media screen and (max-width:760px) {
  body:has(#nav:not(:empty)) {
    display:flex; flex-direction:column; height:100vh; height:100dvh; min-height:0; overflow:hidden;
  }
  body:has(#nav:not(:empty)) > header {
    flex:0 0 auto; position:relative; z-index:3; isolation:isolate;
    padding-block:calc(env(safe-area-inset-top,0px) + 10px) 10px;
    padding-inline:max(var(--om-gutter),env(safe-area-inset-left,0px)) max(var(--om-gutter),env(safe-area-inset-right,0px));
    background:var(--surface);
  }
  body:has(#nav:not(:empty)) > .shell {
    flex:1 1 0%; min-height:0; width:100%; margin:0 auto;
    overflow-y:auto; overscroll-behavior-y:contain;
  }
  #main .pairDevice { width:100%; }
  #notice:not(:empty) { inset-block-start:calc(env(safe-area-inset-top,0px) + 8px); }
}
.rh .rh-cap-note {display:block;margin-top:6px;line-height:1.45;}
.rh .rh-highlight {outline:3px solid var(--focus,#6753d9);outline-offset:-3px;scroll-margin:90px;}
.task-photo {display:block;max-width:100%;max-height:70vh;object-fit:contain;}
.rh .rh-row-actions > .rh-editor {max-width:100%;}
.rh .rh-row-actions .rh-form {width:100%;margin:0;}
.rh .rh-badge[data-status="unread"] {background:var(--om-primary,#6048ba);color:white;}
.brand .familyChoice {
  position:relative; display:inline-flex; align-items:center; gap:4px;
  min-inline-size:0; max-inline-size:min(46vw, 16rem); min-height:38px;
  padding:5px 12px; border-radius:24px;
  font-family:inherit; font-size:1rem; font-weight:650; line-height:1.35;
}
.brand .familyChoice bdi { min-inline-size:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.brand .familyChoice::before { content:""; position:absolute; inset:-3px 0; }
.inboxBell { position:relative; }
.bellCount { position:absolute; top:-3px; inset-inline-end:-3px; min-width:18px; padding-inline:3px; border-radius:12px; font-size:12px; background:#6935c5; color:#fff; }
.rh-kids .rh-time { grid-template-columns:minmax(0,1fr); }
.rh-kids .rh-time strong { grid-column:1/-1; }
.kids-hero strong { text-wrap:balance; }
#sheet .minutePresets {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));}
#sheet .minutePresets button {padding-inline:2px;}
#sheet .minutePresets [aria-pressed=true] {background:var(--om-primary,#4d43ce);color:white;}
.bonusPreview {font-weight:650;}
@media(max-width:600px){#sheet.bonusSheet {position:fixed;inset:auto 0 0;margin:0 auto;width:100%;max-width:100%;border-radius:22px 22px 0 0;padding-bottom:max(16px,env(safe-area-inset-bottom));}}
dialog.guidedTour[open]{position:fixed;inset:0;margin:0;padding:0;border:0;width:100%;height:100%;max-width:none;max-height:none;overflow:hidden;background:transparent;box-shadow:none;color:inherit}
.guidedTour::backdrop{background:transparent}
.tourRing{position:absolute;pointer-events:none;border:2px solid #a7a1ff;border-radius:12px;box-shadow:0 0 0 300vmax rgb(13 15 31 / 72%)}
.tourCard{position:absolute;box-sizing:border-box;width:min(320px,calc(100% - 20px));padding:16px;border-radius:16px;background:Canvas;color:CanvasText;box-shadow:0 8px 32px #0004}
.tourCard h2,.tourCard p{margin:0 0 9px}.tourCard p{line-height:1.45}.tourActions{display:flex;gap:8px;justify-content:flex-end}.tourActions button{min-height:42px}

.modePanel .actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
.modePanel .actions button {width:100%;height:100%;min-height:46px}
.modeStatus {display:grid;gap:.25rem;margin:.65rem 0 1rem}
.modeStatus span,.sectionHint {color:var(--muted,#565b73);font-size:.9rem}
.modeStatus strong {font-size:1.2rem}
.watchDevice {margin:1rem 0 .5rem;font-size:1rem}
@media(max-width:360px){.modePanel .actions{grid-template-columns:1fr}}
.tvViewer .viewerPrevious {grid-column:1;color:var(--muted);font-size:.78rem;font-weight:400}

/* Buttons sharing one decision occupy equal tracks, including outside the hub root. */
#sheetForm > .dialogActions:not(.ruleFooter), .rh-dialog .dialogActions {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch;
  gap:12px; margin:4px 0 0;
}
#sheetForm > .dialogActions:not(.ruleFooter) > button, .rh-dialog .dialogActions > button {
  width:100%; min-width:0; min-height:46px; margin:0; line-height:1.25;
  padding:10px 8px; white-space:normal; overflow-wrap:anywhere;
}
.rh-dialog button:focus-visible {outline-offset:-4px}
.rh-dialog .destructiveConfirm {background:var(--danger);color:var(--surface);border-color:transparent}
.rh-dialog p {margin-block:0 18px}
.rh .rh-section > .rh-clear {display:block;width:100%;min-height:46px;margin-block:14px 0}
#main .deviceCard {display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
#main .deviceCard > p {margin:0}
.deviceTop {row-gap:8px}
#sheetForm .profileGroup, .templateRules {display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
#sheetForm .profileGroup {margin-block:2px}
#sheetForm .profileGroup h3, .templateRules h3 {margin:0 0 2px}
#sheetForm .profileGroup button {width:100%;min-height:44px}
.profileGroup .addChildChoice {color:var(--accent);background:var(--soft);border-color:transparent}
.modePanel > .actions {gap:10px;margin:0 0 12px}
.modePanel > .actions button:only-child {grid-column:1/-1}
.modePanel .sectionHint, .templateRules .sectionHint {margin:8px 0 0;line-height:1.4}
.templateListItem, .templateRuleEdit {display:flex;align-items:center;gap:12px;width:100%;min-width:0;text-align:start}
.templateListItem {justify-content:space-between;padding:12px 2px;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;box-shadow:none}
.templateCaption,.templateRuleEdit {display:grid;gap:3px;overflow-wrap:anywhere}
.templateCaption small,.templateRuleEdit small,.rewardCopy small {color:var(--muted);font-weight:400}
.templateEdit {color:var(--accent);font-size:.9rem}
.templateRule {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch}
.templateRuleEdit,.addTemplateRule,.templateRule .removeRule {min-height:44px}
.templateRule .removeRule {padding-inline:10px;color:var(--danger)}
.templateRules .addTemplateRule {width:100%;color:var(--accent);background:var(--soft);border-color:transparent}
.homeRewards {
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px 12px;
  width:100%;padding:14px var(--om-card-space);text-align:start;background:var(--surface);
  border:1px solid var(--om-border);border-radius:var(--om-radius-m);box-shadow:var(--om-shadow);
}
.homeRewards svg {grid-row:1 / -1;box-sizing:content-box;width:22px;height:22px;padding:9px;color:var(--accent);background:var(--soft);border-radius:12px}
.rewardCopy {display:grid;gap:3px;min-width:0;overflow-wrap:anywhere}
.rewardCount {color:var(--accent);font-size:.95rem;font-variant-numeric:tabular-nums}
.homeRewards progress {grid-column:2/-1;display:block;margin:0;width:100%;height:5px;accent-color:var(--accent)}
@media(max-width:340px){
  #sheetForm > .dialogActions:not(.ruleFooter),.rh-dialog .dialogActions {grid-template-columns:1fr}
  .templateRule{grid-template-columns:minmax(0,1fr)}
}

.rh .rh-task > .rh-row-actions, .rh .kids-viewer > .rh-row-actions {
  display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch;
  gap:10px; margin:14px 0 0; padding:0;
}
.rh .rh-task .rh-row-actions > button, .rh .rh-task .rh-row-actions > .rh-editor > summary,
.rh .kids-viewer .rh-row-actions > button {
  box-sizing:border-box; display:flex; align-items:center; justify-content:center;
  min-height:46px; width:100%; margin:0; padding:9px 12px; text-align:center;
}
.rh .rh-task .rh-row-actions > .rh-editor {margin:0; padding:0; background:transparent; border:0; box-shadow:none}
.rh .rh-task .rh-row-actions > .rh-editor > summary {
  border:1px solid var(--om-border); border-radius:var(--om-radius-m); list-style:none; cursor:pointer;
}
.rh .rh-task .rh-row-actions > .rh-editor > summary::-webkit-details-marker {display:none}
.rh .rh-task .rh-row-actions > .rh-editor[open] > form {margin-block-start:10px}
.rh .rh-task .rh-row-actions > .rh-remove {order:1}
.rh .rh-section > .rh-empty {box-sizing:border-box; padding:12px 14px; margin:10px 0 0}
.rh .kids-viewer .rh-row-actions > button {
  font-size:1rem; font-weight:700;
}
.rh .kids-viewer .rh-row-actions > .primary:enabled {color:var(--on-accent,#fff)}
.rh .kids-viewer .rh-row-actions > button:disabled {
  opacity:1; color:var(--accent); background:var(--soft); border-color:transparent;
}
.rh .kids-viewer .rh-row-actions > [hidden] {display:none}
.rh .kids-inbox {width:100%}
.modePanel .scheduleChoice {display:grid;gap:10px;padding-block:16px;border-bottom:1px solid var(--line)}
.modePanel .scheduleChoice .actions {margin:0}
.modePanel .scheduleChoice .actions button:only-child {grid-column:1/-1}
.modePanel > .createTemplate,.modePanel > .createTemplate + button {width:100%;margin-top:12px}
#main > section:has(> .scheduleMore:not([open])) {padding-block:6px}
#main > section > .scheduleMore:not([open]) {margin-block:0}
.scheduleMore > summary {min-height:44px;align-content:center;cursor:pointer;font-weight:650}
.scheduleMore > :not(summary),.commonRules {margin-top:12px}
#sheet .exportDownload {display:flex;justify-content:center;align-items:center;min-height:46px;background:var(--om-primary);color:white;border-radius:12px;text-decoration:none;font-weight:650}
.rh .rh-parent-hero > .rh-cap-note {margin-block-start:12px}

.modePanel .scheduleChoice .actions {grid-template-columns:1fr;gap:8px}
.modePanel .scheduleChoice .actions .remove {justify-self:stretch;width:100%;min-height:44px;border:1px solid var(--line);background:transparent;color:var(--danger,#a4323a)}
.modePanel > .sectionHint {margin-bottom:14px}

.rh-kids .kids-viewer {display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.rh-kids .kids-viewer > :is(h2,label,p,.rh-row-actions) {margin:0}
.rh-kids .kids-viewer .rh-field {display:grid;gap:6px}
.rh-kids .kids-viewer :is(strong,button) {white-space:normal;overflow-wrap:anywhere}

#main > .backToDevices {display:block;justify-self:start;min-height:44px;margin-block:8px 20px}
.tvPreferences .settingGroup h3 {margin:0;border:0;padding:0}
#sheet .ruleValidity {
  display:grid; grid-template-columns:minmax(0,1fr); gap:10px;
  margin:18px 0 0; padding:0; border:0; box-shadow:none; background:transparent;
}
#sheet .ruleValidity :is(h3,p,label) {margin:0}
#sheet .ruleWeekdayOption {margin-block-start:20px}
#sheet .rulePickerFrame {
  display:grid; grid-template-columns:minmax(0,1fr); min-width:0; overflow:hidden;
  border:1px solid var(--line); border-radius:var(--om-radius-s); background:var(--surface);
}
#sheet .rulePickerFrame:focus-within {outline:2px solid var(--focus);outline-offset:1px}
#sheet .rulePickerFrame input {
  appearance:none; -webkit-appearance:none; width:100%; min-width:0;
  margin:0; padding:8px; border:0; border-radius:0; background:transparent;
}
#sheet .rulePickerFrame input::-webkit-date-and-time-value {margin:0;text-align:start}

.scheduleMore[data-app-access] > button {width:100%;margin-block:10px 16px}
.appGroups {display:grid;gap:10px;min-width:0}
.appGroups > h3,.appGroups > p {margin:0}
.appGroupList {list-style:none;margin:0;padding:0}
.appGroupRow {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.appGroupCopy {display:grid;gap:3px;min-width:0;overflow-wrap:anywhere}
.appGroupCopy small {color:var(--muted)}
.appGroupRow button {min-height:44px}

.appGroupActions {display:flex;flex-wrap:wrap;gap:8px}
.appGroupActions .removeGroup {color:var(--danger)}
@media(max-width:520px){
  .appGroupRow {grid-template-columns:minmax(0,1fr);gap:8px}
}

.ruleChoices {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:12px}
.ruleChoice {position:relative;display:grid;align-content:start;gap:6px;text-align:start;padding:17px 38px 17px 16px}
.ruleChoice strong {font-size:1.08rem}
.ruleChoice small {font-weight:400}
.ruleChoice:first-child {border-color:var(--om-iris)}
.ruleChoice::after {content:"›";position:absolute;inset-inline-end:15px;top:14px;color:var(--muted);font-size:1.4rem}
.dailyLimitRow {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:10px;padding:10px 0;border-top:1px solid var(--line)}
.dailyLimitRow strong,.dailyLimitRow p {grid-column:1;margin:0;overflow-wrap:anywhere}
.dailyLimitRow button {grid-column:2;grid-row:1/3}
#sheet .simpleLimitDays[hidden] {display:none}

#main > .ruleChoices + section {margin-block-start:20px}

.taskSuccess {display:grid;gap:5px;padding:14px 16px;margin-block:10px;background:var(--surface);color:var(--ink);border:1px solid var(--om-border);border-radius:var(--om-radius-m);box-shadow:var(--om-shadow)}
.taskSuccessHead,.successGoal {display:flex;align-items:center;gap:8px}
.taskSuccessHead button {margin-inline-start:auto;min-width:36px;min-height:36px;padding:0}
.successTick {background:var(--om-success-bg);color:var(--om-success);padding:3px 7px;border-radius:50%}
.successMinutes {font-size:1.65rem;color:var(--accent)}
.successGoal {border-top:1px solid var(--line);margin-top:5px;padding-top:8px}
.successGoal svg {width:18px;height:18px;color:var(--accent)}
.taskSuccess progress {width:100%;height:5px;accent-color:var(--accent)}
.taskSuccess small {color:var(--muted)}

.rh .rh-task-more { min-width:44px; min-height:44px; padding:0; line-height:1; font-size:1.4rem; }
.rh-task-options:not([hidden]) {
  display:flex; flex-wrap:wrap; align-items:center; gap:2px 10px;
  padding-block-start:4px; border-block-start:1px solid var(--line);
}
.rh .rh-task-options button {
  width:auto; min-height:42px; padding:5px 4px; font-size:.875rem;
  background:transparent; border-color:transparent; color:var(--accent);
}
.rh .rh-task-options .rh-remove { color:var(--danger); }
#main .statsTools .periodControl button { min-height:42px; padding:7px 8px; }
@media screen and (max-width:700px) {
  #main .statsTools { display:flex; flex-wrap:nowrap; gap:6px; width:100%; }
  #main .statsTools .periodControl { flex:1 1 0%; width:auto; min-width:0; padding-block:2px; }
  #main .statsTools .periodControl button { min-width:0; min-height:32px; padding:3px 6px; overflow-wrap:anywhere; }
  #main .statsTools .calendarTrigger { flex:none; width:44px; min-height:38px; height:38px; padding:0; }
}

.familyRoster { gap:16px; }
.familyRoster .rosterGroup { display:grid; gap:4px; min-width:0; }
.familyRoster .rosterGroup + .rosterGroup { border-block-start:1px solid var(--line); padding-block-start:14px; }
.familyRoster .rosterGroup h3 { border:0; margin:0; padding:0; font-size:.88rem; color:var(--muted); overflow-wrap:anywhere; }
.familyRoster .rosterRow { display:grid; grid-template-columns:32px minmax(0,1fr) auto; gap:10px; align-items:center; min-height:46px; }
.rosterAvatar { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:rgba(135,124,240,.19); font-weight:700; }
.rosterName { overflow-wrap:anywhere; font-weight:600; }
.familyRoster button.rosterRemove { width:44px; min-height:44px; padding:0; justify-content:center; color:var(--muted); background:transparent; border:0; }
.rosterControls { display:flex; align-items:center; }
.familyRoster button.rosterEdit { display:grid; place-items:center; width:44px; min-height:44px; padding:0; background:transparent; border:0; color:var(--muted); }
.rosterEdit svg, .rosterRemove svg { width:19px; height:19px; }
.familyRoster button.rosterRemove:hover,.familyRoster button.rosterRemove:focus-visible { color:var(--danger); }
.familyRoster button.rosterAction { width:fit-content; max-width:100%; min-height:44px; border:0; background:transparent; padding:4px 0; font-size:.92rem; }
.rosterAction::before { content:"+"; font-size:1.2em; }

.noticeDialogTitle:focus { outline:none; }
