/* The parent console (UI-1a). Palette and type follow lockdown/specs/ux/console.html; fonts are served from this origin. */
@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/dm-sans-400.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/dm-sans-500.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/dm-sans-700.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/fraunces-500.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/fraunces-600.woff2) format('woff2'); }
:root {
  --paper: #F6F1E6; --card: #FFFCF5; --ink: #1E2B24; --muted: #66716A; --faint: #8F968F; --line: #E6DECD;
  --forest: #1F4D3A; --forest-soft: #DFE9DF; --marigold: #E3A02F; --clay: #B9573A; --clay-soft: #F5E0D6;
  --shadow: 0 5px 14px rgba(59, 49, 32, .08);
  --serif: 'Fraunces', Georgia, serif; --sans: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

/* Phone first: one narrow column. */
.app { max-width: 480px; margin: 0 auto; padding: 0 16px 60px; }
.loading, .empty { color: var(--muted); padding: 24px 0; }
header { display: flex; align-items: center; gap: 8px; padding: 16px 0 6px; position: relative; }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--forest); }
.grow { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; box-shadow: var(--shadow); }
.icon-btn svg { width: 18px; height: 18px; }
.menu { position: absolute; right: 0; top: 62px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 8px; min-width: 200px; z-index: 5; }
.menu .who { padding: 8px 10px; color: var(--muted); font-size: 13.5px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px; border-radius: 8px; font-weight: 500; }
.menu button:hover { background: var(--forest-soft); }

.navrow { display: block; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; } /* a phone swipes the row; a desktop scrollbar under it read as broken */
.chip { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 700; white-space: nowrap; }
.chip.on { border-width: 2px; border-color: var(--forest); background: var(--forest-soft); }
.chip.fam { padding: 8px 16px; color: var(--forest); }
.face { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 16px; flex: none; }
nav.tabs { display: flex; background: #ECE5D6; border-radius: 12px; padding: 4px; margin: 4px 0 16px; }
nav.tabs button { flex: 1; background: none; border: 0; padding: 8px 10px; border-radius: 9px; font-weight: 500; color: var(--muted); }
nav.tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-weight: 700; }

h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.1; margin: 2px 0 6px; }
.sub { color: var(--muted); margin-bottom: 14px; font-size: 14.5px; }
.card { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
/* A card is a button so a tap opens the child; a button centres its content, so pin it to the top. */
button.card { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; text-align: left; border: 0; }
.cards { display: flex; flex-direction: column; gap: 14px; }
.kid { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.kid .face { width: 44px; height: 44px; font-size: 20px; }
.kid .nm { font-family: var(--serif); font-size: 22px; }
.kid .meta { color: var(--muted); font-size: 13.5px; }
.big { font-family: var(--serif); font-size: 30px; }
.bar { height: 10px; border-radius: 99px; background: #EEE7D8; overflow: hidden; display: flex; margin: 10px 0 8px; }
.bar span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.apps { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.apps div { display: flex; justify-content: space-between; gap: 12px; }
.apps div span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apps div span:last-child { color: var(--muted); flex: none; }
.status { margin-top: 14px; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; background: var(--forest-soft); color: var(--forest); }
.status.warn { background: var(--clay-soft); color: var(--clay); }
.later { color: var(--faint); font-size: 13.5px; border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 18px; }
.stale { color: var(--clay); font-size: 13px; padding: 6px 0; }

/* Activity tab (UI-1b) */
.split { display: flex; flex-direction: column; gap: 14px; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.card h2.gap { margin-top: 22px; }
.tracks { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: center; font-size: 14px; }
.trow.day { grid-template-columns: 38px minmax(0, 1fr) auto; }
.trow .tt { display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .tt small, .what small { color: var(--faint); font-size: 12px; white-space: normal; }
.trow .tm { color: var(--muted); text-align: right; white-space: nowrap; }
.track { height: 8px; border-radius: 99px; background: #EEE7D8; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--forest); border-radius: 99px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.ask, .rrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 14px; }
.what { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.pill { flex: none; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #ECE5D6; color: var(--muted); text-align: right; }
.pill.ok { background: var(--forest-soft); color: var(--forest); }
.pill.no { background: var(--clay-soft); color: var(--clay); }
.pill.wait { background: #F8EBC9; color: #8A6410; }
.btn.small { padding: 6px 14px; font-size: 13.5px; flex: none; }
.panel { margin-top: 10px; padding: 12px; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 4px 0 8px; }
.chips.wrap .chip { padding: 7px 14px; }
.panel .actions { display: flex; gap: 8px; margin-top: 6px; }

/* Sign in */
.signin { max-width: 380px; margin: 60px auto 0; }
.signin h1 { margin-bottom: 18px; }
.signin form { display: flex; flex-direction: column; gap: 12px; }
.signin label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
.signin input { border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; }
.btn { background: var(--forest); color: #fff; border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.soft { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.err { color: var(--clay); font-size: 14px; min-height: 1.2em; }
.link { background: none; border: 0; color: var(--forest); text-decoration: underline; padding: 0; font-size: 14px; align-self: flex-start; }
.note { color: var(--muted); font-size: 13.5px; }
.note.ok { color: var(--forest); font-weight: 500; margin: 10px 0; }
.picker { display: flex; flex-direction: column; gap: 10px; }

/* iPad and larger: chips and tabs share a row, cards sit two across. */
@media (min-width: 768px) {
  .app { max-width: 920px; padding: 0 32px 60px; }
  header { padding-top: 22px; }
  .menu { top: 68px; }
  .navrow { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
  .navrow .chips { padding: 0; }
  .navrow nav.tabs { margin: 0 0 0 auto; width: 280px; }
  h1 { font-size: 36px; }
  .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
}

/* Bell and answer view (UI-1c) */
.icon-btn.bell { position: relative; }
.badge { position: absolute; top: -4px; right: -4px; background: var(--clay); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.scrim { position: fixed; inset: 0; background: rgba(20, 28, 24, .25); z-index: 8; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(100vw, 480px); background: var(--paper); box-shadow: -10px 0 30px rgba(0,0,0,.12); padding: 22px 24px; overflow-y: auto; z-index: 9; }
.drawer h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 14px; }
.drawer .x { float: right; background: none; border: 0; font-size: 26px; color: var(--muted); }
.nlist { display: flex; flex-direction: column; gap: 10px; }
.nrow { text-align: left; width: 100%; background: var(--card); border: 0; border-left: 4px solid var(--marigold); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.nrow.device { border-left-color: var(--clay); }
.nrow .t { font-weight: 700; margin-bottom: 4px; overflow-wrap: anywhere; }
.nrow .w { color: var(--muted); font-size: 12.5px; }
.big.small { font-size: 22px; overflow-wrap: anywhere; }
.quote { color: var(--muted); font-style: italic; margin: 6px 0; overflow-wrap: anywhere; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; margin: 10px 0; }
.fld input { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.fld small { color: var(--faint); font-weight: 400; }
.card .pill { display: inline-block; margin: 8px 0; text-align: left; }
.pill.wait, .pill.ok, .pill.no { display: inline-block; margin: 8px 0; text-align: left; }

/* Content tab (UI-2a) */
.ctools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
/* The search box takes its own row on a phone, so the three buttons do not squeeze it to nothing. */
.search { flex: 1 1 100%; min-width: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font: inherit; }
@media (min-width: 700px) { .search { flex-basis: 0; } }
.clist { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.cgroup h2 { display: flex; align-items: center; gap: 6px; }
.cgroup h2 .count { margin-left: auto; font-weight: 500; color: var(--faint); }
.citem { padding: 10px 0; border-top: 1px solid var(--line); }
.citem:first-of-type { border-top: 0; }
.citem.hidden .what { opacity: .55; }
.citem .cnote { font-style: italic; }
.heads { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #F8EBC9; color: #6B4D0B; font-size: 13.5px; }
.heads.quiet { background: #ECE5D6; color: var(--muted); }
.heads .actions { display: flex; gap: 8px; margin-top: 8px; }
.sub.gap { margin: 14px 0 6px; font-weight: 700; }
.limitrow { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.limitrow .fld { margin: 0; }
.limitrow input { width: 90px; }
.limitrow .wide { flex: 1 1 160px; }
.limitrow .wide input { width: 100%; box-sizing: border-box; }
.limitrow select, .fld select, .fld textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font: inherit; }
.chips.wrap .chip.swatch, .chip.swatch { padding: 6px; }
.dot.sw { width: 22px; height: 22px; border-radius: 6px; margin: 0; vertical-align: middle; }
.cgroup h2 .btn { margin-left: 6px; font-size: 13px; }
.panelcard { margin-top: 10px; }
.panelcard .actions { display: flex; gap: 8px; margin-top: 8px; }
@media (min-width: 768px) { .clist { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 18px; } }

/* Schedule tab (UI-2b1) */
.weekpick { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.weeklabel { flex: 1; text-align: center; font-weight: 700; }
.weeklabel small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.scat { padding: 10px 0; border-top: 1px solid var(--line); }
.scat:first-of-type { border-top: 0; }
.scathead { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 4px 0; text-align: left; font-weight: 700; font-size: 15.5px; }
.scathead small { color: var(--muted); font-weight: 400; }
.scathead .chev { color: var(--faint); }
.days { display: flex; flex-direction: column; gap: 5px; margin: 6px 0 2px; }
.dayline { display: grid; grid-template-columns: 34px 1fr; grid-template-areas: "dn track" ". dt"; gap: 0 8px; align-items: center; font-size: 12.5px; }
.dayline .dn { grid-area: dn; color: var(--muted); font-weight: 700; }
.dayline .today { color: var(--marigold); }
.dayline .dt { grid-area: dt; color: var(--muted); font-size: 12px; }
.wtrack { grid-area: track; position: relative; height: 12px; background: #EEE7D8; border-radius: 6px; overflow: hidden; }
.wbar { position: absolute; top: 0; bottom: 0; background: var(--c); border-radius: 4px; min-width: 3px; }
.sitems { margin: 6px 0 0 12px; padding-left: 10px; border-left: 2px solid var(--line); }
.sitem { padding: 8px 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 768px) {
  .split.sched { grid-template-columns: 1.4fr 1fr; }
  .dayline { grid-template-columns: 34px 1fr 130px; grid-template-areas: "dn track dt"; }
}
.rowline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.rowline:last-child { border-bottom: 0; }
/* One-off buttons and their dialog (UI-2c1) */
.oneoffs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.oneoff-block { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.oneoff-dialog { margin: 0 0 12px; max-width: 460px; }
.oneoff-dialog .fld select, .oneoff-dialog .fld input { width: 100%; box-sizing: border-box; }
.rowline small { margin-left: 4px; }

/* Settings: children and PCs (UI-2c2) */
.settings-cards { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.settings-cards .card h2 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.settings-cards .nm { font-family: var(--serif); font-size: 22px; }
.pcrow { border-bottom: 1px solid var(--line); }
.pcrow:last-child { border-bottom: 0; }
.pcrow .rowline { border-bottom: 0; flex-wrap: wrap; }
.invite-made .code { font-family: var(--serif); font-size: 34px; letter-spacing: .08em; margin: 4px 0 8px; overflow-wrap: anywhere; }
.invite-made .link-text { overflow-wrap: anywhere; min-width: 0; font-size: 13.5px; }
.addchild { margin: 14px 0 24px; max-width: 640px; }
.settings-cards .actions { display: flex; gap: 8px; margin-top: 10px; }

/* Admin view (UI-4a) */
.admin-page { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.admin-page .card h2 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.admin-fams { display: flex; flex-direction: column; gap: 8px; }
.admin-fams .btn { text-align: left; }
.admin-page .enf { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.admin-page .enf .pill, .admin-page .pcrow .pill { margin: 0; }
.admin-page .levelform { align-items: flex-end; }
.admin-page .levelform .fld { flex: 1; margin: 0; min-width: 0; }
.admin-page .levelform .fld input, .admin-page .levelform .fld select, .admin-page .panel .fld select, .admin-page .panel .fld input { width: 100%; box-sizing: border-box; }
.admin-page .panel .actions { display: flex; gap: 8px; margin-top: 8px; }
.admin-page .logrow { border-bottom: 1px solid var(--line); padding: 4px 0; }
.admin-page .logrow:last-child { border-bottom: 0; }
.admin-page .logrow.dim { opacity: .55; }
.admin-table { overflow-x: auto; margin-top: 10px; }
.admin-table table { border-collapse: collapse; font-size: 13.5px; width: 100%; }
.admin-table th, .admin-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
/* All PCs table (UI-4b1) */
.admin-page.wide { max-width: 1100px; }
.viewtabs { display: flex; gap: 8px; margin: 10px 0; }
.admin-page .filters { gap: 18px; justify-content: flex-start; }
.admin-page .chk { display: inline-flex; align-items: center; gap: 4px; }
.admin-table.pcs-table th, .admin-table.pcs-table td { white-space: normal; vertical-align: top; }
.pcs-table .enf { margin: 0; }
.admin-fams .famid { display: block; font-weight: 400; font-size: 11.5px; opacity: .7; }
