/* ============================================================
   StudyHub — Portal design system
   Extends the AP sites' paper/serif tokens (framework/templates/landing.html).
   Mobile-first: kid views are a single ~460px column (a "phone" even on
   desktop). Only the parent overview widens to a multi-column grid.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* --- carried over from landing.html (the frozen family aesthetic) --- */
  --paper: #FAF8F4; --paper-2: #F2EFE8; --paper-3: #E8E4DA;
  --rule: #E4E0D6; --rule-s: #D8D3C6;
  --ink: #141413; --ink-2: #3A3935; --ink-3: #6B6962; --ink-4: #9A968C;
  --ok: #5D7A4F; --danger: #A8524A; --warn: #B8883A;

  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* --- portal additions --- */
  /* The hub itself is quiet (ink + paper). Colour comes from subjects. */
  --accent: #3E7C74; --accent-ink: #2F615A;      /* used sparingly for hub chrome */

  /* Per-subject colours (mirror ap_subjects.color). Subjects carry the palette. */
  --c-calc:   #3AA99F;   /* AP Calculus — teal   */
  --c-euro:   #B8883A;   /* AP Euro History — amber (warm, historical) */
  --c-french: #5B7BB0;   /* French — blue        */
  --c-sat:    #8A6BA8;   /* SAT — plum           */
  --c-phys:   #6E8B4F;   /* AP Physics 1 — green */
  --c-neutral:#9A968C;   /* screen-time / non-subject */

  --radius: 10px; --radius-s: 7px;
  --shadow: 0 4px 16px rgba(20,20,19,0.06);
  --shadow-up: 0 6px 22px rgba(20,20,19,0.10);
  --app-w: 460px;
}

* , *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink-2);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* Signature tangent-arc background from the AP sites (very subtle) */
body::before, body::after {
  content: ''; position: fixed; pointer-events: none; z-index: 0;
  border-radius: 50%; border: 1.5px solid var(--rule);
}
body::before { top: -260px; right: -320px; width: 1100px; height: 1100px; opacity: 0.5; }
body::after  { top: -60px;  right: -140px; width: 720px;  height: 720px;  opacity: 0.35; border-width: 1px; }

/* ============================================================
   App shell — the phone column
   ============================================================ */
.app {
  position: relative; z-index: 1;
  max-width: var(--app-w); margin: 0 auto;
  padding: 0 18px calc(78px + env(safe-area-inset-bottom, 0px));  /* room for tab bar */
  min-height: 100vh;
}

/* Top bar ------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 2px 12px;
  background: linear-gradient(var(--paper) 78%, rgba(250,248,244,0));
}
.topbar-id { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-size: 17px; line-height: 1;
}
.topbar-name { font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1; }
.topbar-sub  { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.streak {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--warn);
  background: rgba(184,136,58,0.12); border-radius: 20px; padding: 5px 10px;
}
.iconbtn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-3);
  border: 1px solid var(--rule);
}
.iconbtn:hover { color: var(--ink); border-color: var(--rule-s); }

/* Page heading (serif) ---------------------------------------- */
.eyebrow { font-family: var(--mono); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-4); }
.page-h { font-family: var(--serif); font-size: 30px; color: var(--ink); letter-spacing: -0.015em; line-height: 1.08; }
.page-h em { font-style: italic; }
.section-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 24px 2px 10px;
}
.section-label .eyebrow { color: var(--ink-3); }
.muted { color: var(--ink-3); }
.tiny { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-4); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card + .card { margin-top: 10px; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--rule-s); }
.card.flat { background: var(--paper-2); }
.card.tint { border-left: 3px solid var(--subj, var(--accent)); }

/* subject colour hook: set style="--subj:var(--c-calc)" on a card/row */
.subj-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--subj, var(--ink-4)); flex: none; }
.subj-name { font-family: var(--sans); font-weight: 600; color: var(--ink); }

/* ============================================================
   Provenance chips (why is this on Today?)
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 8.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 3px 7px; border-radius: 4px; white-space: nowrap;
}
.chip-plan    { background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule); }
.chip-retry   { background: rgba(168,82,74,0.10); color: var(--danger); }
.chip-handout { background: rgba(138,107,168,0.14); color: var(--c-sat); }
.chip-parent  { background: rgba(93,122,79,0.13); color: var(--ok); }
.chip-exam    { background: rgba(184,136,58,0.14); color: var(--warn); }

/* ============================================================
   Badges (status)
   ============================================================ */
.badge {
  font-family: var(--mono); font-size: 8.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 7px; border-radius: 4px;
}
.badge-progress { background: rgba(58,169,159,0.14); color: var(--accent-ink); }
.badge-complete { background: rgba(93,122,79,0.12); color: var(--ok); }
.badge-none     { background: var(--paper-2); color: var(--ink-4); }
.badge-due      { background: rgba(168,82,74,0.12); color: var(--danger); }
.badge-soon     { background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule); }
.badge-grad     { background: rgba(93,122,79,0.12); color: var(--ok); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 11px 16px; border-radius: var(--radius-s);
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-up); }
.btn-ghost { color: var(--ink-3); border: 1px solid var(--rule); }
.btn-ghost:hover { color: var(--ink); border-color: var(--rule-s); }
.btn-sm { padding: 8px 12px; font-size: 10px; }
.btn-block { width: 100%; }
.btn-accent { background: var(--subj, var(--accent)); color: #fff; }

/* Check circle (Today / plan slot completion) ----------------- */
.check {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--rule-s); display: grid; place-items: center;
  color: transparent; transition: .15s;
}
.check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.check svg { width: 14px; height: 14px; }

/* ============================================================
   Progress
   ============================================================ */
.bar { height: 6px; border-radius: 3px; background: var(--paper-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--subj, var(--accent)); }

.ring { --p: 0; --size: 54px; width: var(--size); height: var(--size); flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p)*1%), var(--paper-3) 0);
  display: grid; place-items: center;
}
.ring::before { content: ''; position: absolute; width: calc(var(--size) - 10px); height: calc(var(--size) - 10px); border-radius: 50%; background: var(--paper); }
.ring span { position: relative; font-family: var(--serif); font-size: 16px; color: var(--ink); }
.ring-wrap { position: relative; display: grid; place-items: center; }

/* ============================================================
   Today rows
   ============================================================ */
.slot { display: flex; align-items: flex-start; gap: 12px; }
.slot-body { flex: 1; min-width: 0; }
.slot-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.slot-title { font-family: var(--serif); font-size: 18px; color: var(--ink); line-height: 1.15; }
.slot-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.slot-meta b { color: var(--ink-3); font-weight: 500; }
.slot.is-done .slot-title { color: var(--ink-4); text-decoration: line-through; text-decoration-color: var(--rule-s); }

/* ============================================================
   Mistake-book cards
   ============================================================ */
.q-text { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 8px 0 12px; }
.answer { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; padding: 7px 10px; border-radius: var(--radius-s); }
.answer + .answer { margin-top: 5px; }
.answer .a-label { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; flex: none; padding-top: 2px; }
.answer.wrong   { background: rgba(168,82,74,0.07); color: var(--ink-2); }
.answer.wrong .a-label   { color: var(--danger); }
.answer.correct { background: rgba(93,122,79,0.08); color: var(--ink-2); }
.answer.correct .a-label { color: var(--ok); }

/* filter chips (scroll row) */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; white-space: nowrap;
  padding: 6px 12px; border-radius: 20px; border: 1px solid var(--rule); color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
}
.filter.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============================================================
   Week plan
   ============================================================ */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 6px 0 4px; }
.wday {
  text-align: center; padding: 8px 2px 9px; border-radius: var(--radius-s);
  border: 1px solid transparent;
}
.wday .wd-name { font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-4); }
.wday .wd-num  { font-family: var(--serif); font-size: 18px; color: var(--ink-2); margin-top: 2px; line-height: 1; }
.wday .wd-dots { display: flex; gap: 3px; justify-content: center; margin-top: 6px; height: 6px; }
.wday .wd-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--subj, var(--ink-4)); display: inline-block; }
.wday.today { background: var(--ink); }
.wday.today .wd-name { color: rgba(250,248,244,0.6); }
.wday.today .wd-num  { color: var(--paper); }
.wday.rest .wd-num { color: var(--ink-4); }

.dayblock { margin-top: 18px; }
.dayblock-h { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; }
.dayblock-h .d-name { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.dayblock-h .d-sum  { font-family: var(--mono); font-size: 10px; color: var(--ink-4); margin-left: auto; }
.planrow { display: flex; align-items: center; gap: 11px; padding: 11px 14px; }
.planrow .p-mins { font-family: var(--mono); font-size: 10.5px; color: var(--ink-4); margin-left: auto; white-space: nowrap; }
.planrow .p-actual { color: var(--ok); }
.planrow .p-actual.miss { color: var(--danger); }

/* ============================================================
   Subject cards
   ============================================================ */
.subj-card { display: block; }
.subj-card .sc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.subj-card .sc-title { font-family: var(--serif); font-size: 21px; color: var(--ink); line-height: 1.1; }
.subj-card .sc-count { font-family: var(--mono); font-size: 9.5px; color: var(--ink-4); margin-left: auto; white-space: nowrap; text-align: right; }
.subj-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.stat-mini { text-align: left; }
.stat-mini .sm-val { font-family: var(--serif); font-size: 22px; color: var(--ink); line-height: 1; }
.stat-mini .sm-val small { font-size: 12px; color: var(--ink-3); }
.stat-mini .sm-lab { font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-4); margin-top: 5px; }

/* ============================================================
   Heatmap (subject detail)
   ============================================================ */
.heat { display: grid; gap: 4px; }
.heat-row { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; }
.heat-row .hr-lab { font-family: var(--mono); font-size: 9.5px; color: var(--ink-4); }
.heat-cells { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.heat-cell { height: 22px; border-radius: 4px; background: var(--paper-3); display: grid; place-items: center;
  font-family: var(--mono); font-size: 9px; color: var(--ink-4); }
/* intensity via rgba of danger */
.h0 { background: var(--paper-2); }
.h1 { background: rgba(168,82,74,0.14); }
.h2 { background: rgba(168,82,74,0.28); color: var(--ink-2); }
.h3 { background: rgba(168,82,74,0.45); color: #fff; }
.h4 { background: rgba(168,82,74,0.68); color: #fff; }

/* ============================================================
   Empty states
   ============================================================ */
.empty { text-align: center; padding: 30px 20px; color: var(--ink-4); }
.empty .e-mark { font-family: var(--serif); font-size: 40px; color: var(--rule-s); line-height: 1; }
.empty .e-title { font-family: var(--serif); font-size: 19px; color: var(--ink-3); margin-top: 10px; }
.empty .e-desc { font-size: 13px; max-width: 260px; margin: 6px auto 0; line-height: 1.5; }

/* ============================================================
   Bottom tab bar
   ============================================================ */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 30;
  width: 100%; max-width: var(--app-w);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(250,248,244,0.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--ink-4); }
.tab svg { width: 21px; height: 21px; }
.tab span { font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.tab.active { color: var(--ink); }
.tab.active .tab-cn { color: var(--accent-ink); }

/* ============================================================
   Banner / note (parent note, handout hero)
   ============================================================ */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(93,122,79,0.07); border: 1px solid rgba(93,122,79,0.22);
  border-radius: var(--radius); padding: 14px 15px;
}
.note .n-from { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ok); margin-bottom: 4px; }
.note .n-text { font-size: 14px; color: var(--ink-2); line-height: 1.5; }

.hero-handout {
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 18px 16px; position: relative; overflow: hidden;
}
.hero-handout .hh-eyebrow { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-sat); margin-bottom: 8px; }
.hero-handout .hh-title { font-family: var(--serif); font-size: 22px; line-height: 1.12; margin-bottom: 6px; }
.hero-handout .hh-desc { font-size: 13px; color: rgba(250,248,244,0.62); line-height: 1.45; margin-bottom: 14px; }
.hero-handout .btn-primary { background: var(--paper); color: var(--ink); }

/* summary hero (Today greeting) */
.today-hero { display: flex; align-items: center; gap: 16px; padding: 4px 2px 4px; }
.today-hero .th-body { flex: 1; }
.today-hero .th-line { font-family: var(--serif); font-size: 23px; color: var(--ink); line-height: 1.15; letter-spacing: -0.01em; }
.today-hero .th-sub  { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

/* keypad (gate) */
.gate-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.gate { width: 100%; max-width: 320px; text-align: center; }
.gate-brand { font-family: var(--serif); font-size: 34px; color: var(--ink); letter-spacing: -0.02em; }
.gate-brand em { font-style: italic; color: var(--accent-ink); }
.gate-sub { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-4); margin-top: 6px; }
.code-boxes { display: flex; gap: 8px; justify-content: center; margin: 34px 0 22px; }
.code-box { width: 40px; height: 52px; border: 1px solid var(--rule-s); border-radius: var(--radius-s); background: var(--paper);
  display: grid; place-items: center; font-family: var(--serif); font-size: 26px; color: var(--ink); }
.code-box.filled { border-color: var(--ink); }
.code-box.cursor { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62,124,116,0.12); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto; }
.key { height: 56px; border-radius: var(--radius-s); background: var(--paper); border: 1px solid var(--rule);
  font-family: var(--serif); font-size: 24px; color: var(--ink); display: grid; place-items: center; }
.key:hover { border-color: var(--rule-s); background: var(--paper-2); }
.key.blank { border: none; background: none; }

/* utility */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--rule); margin: 16px 0; }
.pill-count { font-family: var(--mono); font-size: 10px; color: var(--ink-4); background: var(--paper-2); border-radius: 20px; padding: 2px 8px; }

/* ============================================================
   Parent overview — responsive: single column on iPhone,
   multi-column on a computer. Parents use both.
   ============================================================ */
.parent-page { max-width: 1080px; margin: 0 auto; padding: 0 24px 60px; position: relative; z-index: 1; }
.parent-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 0 8px; flex-wrap: wrap; }
.pt-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pt-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kid-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.kpi .k { text-align: left; }
.kpi .k-val { font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1; }
.kpi .k-lab { font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-4); margin-top: 4px; }
.cross { background: var(--paper-2); border-radius: var(--radius-s); padding: 11px 12px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.cross b { color: var(--ink); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.spark i { width: 6px; background: var(--subj, var(--accent)); border-radius: 2px 2px 0 0; display: inline-block; }
.admin-panel { border: 1px dashed var(--rule-s); border-radius: var(--radius); padding: 16px; }
.applist { display: grid; gap: 6px; }
.approw { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot-off  { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); display: inline-block; }

/* Parent overview on a phone — stack the header, don't let it overflow */
@media (max-width: 640px) {
  .parent-page { padding: 0 16px 48px; }
  .parent-topbar { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 0 4px; }
  .pt-actions { justify-content: flex-start; }
  .pt-long { display: none; }                 /* drop the long subtitle tail on mobile */
  .kpi { gap: 6px; }
  .kpi .k-val { font-size: 19px; }
  /* app registry rows: name on its own line, [last-seen | Disable] below */
  .approw { grid-template-columns: 1fr auto; row-gap: 6px; }
  .approw > :first-child { grid-column: 1 / -1; }
}

/* ============================================================
   Screen-time (kid-facing) — self-awareness, neutral, data-honest.
   Only what GuardTime actually gives us: social total + per-app.
   No study-hours split yet (study_social_min is null); missing
   day renders as "no reading", never zero.
   ============================================================ */
.st-hero { display: flex; align-items: flex-end; gap: 16px; padding: 6px 2px; }
.st-big { font-family: var(--serif); font-size: 46px; color: var(--ink); line-height: 0.9; }
.st-big small { font-family: var(--serif); font-size: 24px; color: var(--ink-3); }
.st-note { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.measured-badge { font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 4px; background: rgba(93,122,79,0.12); color: var(--ok); }
.measured-badge.threshold { background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule); }

.wbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; margin-top: 4px; }
.wbars .wb { display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.wbars .wb i { width: 100%; max-width: 26px; border-radius: 5px 5px 0 0; background: var(--c-neutral); min-height: 3px; }
.wbars .wb b { font-family: var(--mono); font-size: 8.5px; color: var(--ink-4); font-weight: 400; }
.wbars .wb.today i { background: var(--ink); }
.wbars .wb.today b { color: var(--ink); }
/* a day with no reading — hollow slot, unmistakably NOT a zero bar */
.wbars .wb.nodata i { height: 12px !important; background: transparent; border: 1px dashed var(--rule-s); border-radius: 4px; }
.wbars .wb.nodata b { color: var(--ink-4); }
.wbars .wb.future { opacity: 0.35; }

.app-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--rule); }
.app-row:first-child { border-top: none; }
.app-ico { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 15px; background: var(--paper-2); }
.app-row .a-name { flex: 1; font-weight: 500; color: var(--ink-2); }
.app-row .a-min { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* ============================================================
   Desktop framing — the kid app becomes a centered panel so it
   reads as intentional in a wide browser; iPhone stays full-bleed.
   (The parent overview is the only genuinely wide layout.)
   ============================================================ */
@media (min-width: 640px) {
  body.kidview { background: var(--paper-2); }
  body.kidview::before, body.kidview::after { display: none; }  /* arcs off behind the panel */

  .app {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 26px 26px 0 0;
    box-shadow: 0 20px 60px rgba(20,20,19,0.13);
    margin: 26px auto 0;
    min-height: calc(100vh - 26px);
  }
  .topbar { border-radius: 26px 26px 0 0; }

  /* tab bar hugs the panel: same width, side borders continue the frame */
  .tabbar {
    max-width: var(--app-w);
    border-left: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
    box-shadow: 0 -1px 0 var(--rule);
    background: rgba(250,248,244,0.97);
  }
}
