/* Copied from hcs-library-portal/library-portal/HubStyles.html (the Hub family tokens; keep in step with
   hcs-facts-apps/apps/parent-portal/public/styles.css). Regenerate rather than hand-edit. */
:root {
  color-scheme: light dark;
  --red: #8E1420; --red-deep: #6d0f18; --gold: #F2B705; --gold-ink: #3a2a00;
  --page: #f4f4f6; --header: #8E1420; --title: #fff; --who: #eccfd3;
  --card: #ffffff; --card-border: #e2e2e7; --line: #ececef; --dt: #6b7280; --dd: #1d1d1f; --label: #6b7280;
  --now-bg: #FFF8E1; --now-t: #6b5400;
  --bar: #ffffff; --bar-line: #e2e2e7; --bar-fg: #6b7280; --bar-on: #8E1420;
  --overdue: #b3261e; --overdue-bg: #fdecea; --daybar: #f7f7f9; --daybar-fg: #1d1d1f; --daybar-b: #8E1420;
  --miss: #b3261e; --miss-bg: #fdecea; --late: #6b5400; --late-bg: #FFF3CD; --up: #4b5563; --up-bg: #eef0f2;
  --seg: #f4f4f6; --ok-bg: #E7F6EC; --ok: #14532d;
  --btn-bg: #F2B705; --btn-fg: #3a2a00; --chip-mix: 14%; --chip-text-mix: 100%; --focus: #8E1420;
  --shade: rgba(16, 16, 20, .45);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #121216; --header: #5c0d15; --who: #e3c6ca;
    --card: #1b1b20; --card-border: #2a2a31; --line: #2a2a31; --dt: #9a9aa6; --dd: #ececf1; --label: #9a9aa6;
    --now-bg: #2a2410; --now-t: #f2d27a;
    --bar: #17171b; --bar-line: #2a2a31; --bar-fg: #9a9aa6; --bar-on: #F2B705;
    --overdue: #ff8a80; --overdue-bg: #33191c; --daybar: #202026; --daybar-fg: #ececf1; --daybar-b: #F2B705;
    --miss: #ff8a80; --miss-bg: #33191c; --late: #f2d27a; --late-bg: #2a2410; --up: #c9c9d3; --up-bg: #26262d;
    --seg: #202026; --ok-bg: #1d3a26; --ok: #b7efc5; --chip-mix: 24%; --chip-text-mix: 65%; --focus: #F2B705;
    --shade: rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100vh; background: var(--page); color: var(--dd);
  font: 16px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--red); }
@media (prefers-color-scheme: dark) { a { color: var(--gold); } }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--gold); color: var(--gold-ink); padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 8px; }
svg.i { width: 20px; height: 20px; flex: none; }

/* ---- header band (the Hub header) ---- */
.hdr { background: var(--header); position: sticky; top: 0; z-index: 20; }
.hin { max-width: 60rem; margin: 0 auto; padding: 10px 16px 6px; display: flex; flex-direction: column; gap: 2px; }
.hrow { display: flex; align-items: center; gap: 10px; }
.mark { width: 36px; height: 36px; flex: none; object-fit: contain; }
.hdr h1 { font-size: 1.2rem; margin: 0; color: var(--title); font-weight: 700; flex: 1; white-space: nowrap; }
.hdr h1 b { color: var(--gold); }
.who { color: var(--who); font-size: .8rem; display: flex; justify-content: space-between; align-items: center; min-height: 32px; gap: 8px; flex-wrap: wrap; }
.who b { color: #fff; }
#who-right { display: inline-flex; align-items: center; gap: 6px; }
.who a.link, button.link { color: var(--gold); font-weight: 600; font-size: .78rem; min-height: 44px; padding: 0 4px; text-decoration: underline; display: inline-flex; align-items: center; }
nav.top { display: none; gap: 4px; margin-left: 18px; }
nav.top a { color: #fff; font-weight: 600; font-size: .95rem; min-height: 44px; padding: 0 14px; border-radius: 10px; opacity: .8; text-decoration: none; display: inline-flex; align-items: center; }
nav.top a.on { opacity: 1; box-shadow: inset 0 -3px 0 var(--gold); }
.loadbar { height: 3px; background: transparent; overflow: hidden; }
.loadbar.on::after { content: ''; display: block; height: 100%; width: 30%; background: var(--gold); animation: lb 1.1s ease-in-out infinite; }
@keyframes lb { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* ---- layout ---- */
main, .main { max-width: 60rem; margin: 0 auto; padding: 12px 16px 96px; }
.view { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; }
.panel { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 16px; max-width: 34rem; margin: 12px auto; }
.panel h2 { margin: 0 0 8px; font-size: 1.1rem; color: var(--red); }
@media (prefers-color-scheme: dark) { .panel h2 { color: var(--gold); } }
.panel p { margin: 6px 0; }
.muted { color: var(--dt); font-size: .88rem; }
.small { font-size: .8rem; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--btn-bg); color: var(--btn-fg); font-weight: 700;
  font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.alt { background: var(--up-bg); color: var(--up); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
a.btn { color: var(--btn-fg); }
a.btn.alt { color: var(--up); }
.grouplabel { color: var(--label); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  margin: 10px 2px -2px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grouplabel .cnt { background: var(--up-bg); color: var(--up); font-size: .66rem; padding: 1px 7px; border-radius: 999px; }
.empty { padding: 22px 14px; color: var(--dt); font-size: .92rem; text-align: center; }
.empty b { color: var(--dd); }
.note { color: var(--dt); font-size: .76rem; padding: 2px 4px; }
.ttl, .meta, .empty, .note { overflow-wrap: anywhere; word-break: break-word; }
input[type="email"], input[type="password"], input[type="text"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--card-border);
  background: var(--card); color: var(--dd); font: inherit; font-size: 1rem; }
textarea { padding: 10px 12px; min-height: 84px; resize: vertical; }
select { width: auto; padding-right: 28px; }

/* skeleton: structure on the first frame instead of the word "Loading" */
.skel-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); min-height: 58px; }
.skel-row:last-child { border-bottom: 0; }
.skel-chip { width: 38px; height: 18px; border-radius: 999px; background: var(--line); flex: none; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skel-line { height: 11px; border-radius: 5px; background: var(--line); }
.skel-line.short { width: 45%; height: 9px; }
.skel { animation: skelpulse 1.4s ease-in-out infinite; }
@keyframes skelpulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .skel, .loadbar.on::after { animation: none; } }

/* ---- chips ---- */
.chips { display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { --c: #6b7280; font-size: .78rem; font-weight: 700; padding: 0 12px; border-radius: 999px; white-space: nowrap; flex: none;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 1px solid transparent; opacity: .7;
  background: color-mix(in srgb, var(--c) var(--chip-mix), var(--card)); color: color-mix(in srgb, var(--c) var(--chip-text-mix), white); }
.chip.on, .chip[aria-pressed="true"] { opacity: 1; border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.chip.plain { --c: #6b7280; background: var(--card); color: var(--dt); border-color: var(--card-border); opacity: 1; }
.chip.plain.on, .chip.plain[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.chip small { font-weight: 600; opacity: .8; }
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .chip { background: var(--c); color: #fff; }
  .chip.plain { background: var(--card); color: var(--dt); }
  .chip.plain.on { background: var(--gold); color: var(--gold-ink); }
}

/* ---- list rows ---- */
.item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); min-height: 58px; width: 100%; text-align: left; background: none; }
.item:last-child { border-bottom: 0; }
.txt { flex: 1; min-width: 0; }
.ttl { font-size: .93rem; font-weight: 600; color: var(--dd); line-height: 1.25; }
.meta { font-size: .74rem; color: var(--dt); display: flex; gap: 5px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.pill { font-size: .64rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.miss { background: var(--miss-bg); color: var(--miss); }
.pill.late { background: var(--late-bg); color: var(--late); }
.pill.up { background: var(--up-bg); color: var(--up); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.chev { color: var(--dt); flex: none; }
.thumb { width: 40px; height: 60px; flex: none; border-radius: 6px; overflow: hidden; background: var(--up-bg); display: grid; place-items: center; color: var(--dt); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg { width: 18px; height: 18px; }
.stat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stat > div { min-height: 60px; border-radius: 10px; background: var(--card); border: 1px solid var(--card-border); color: var(--dt);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; font-weight: 600; line-height: 1.1; text-align: center; padding: 4px; }
.stat > div b { font-size: 1.1rem; color: var(--dd); }
.stat > div.warn b { color: var(--overdue); }
.hello { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.hello .hi { font-size: 1.15rem; font-weight: 800; color: var(--dd); }
.hello .sub { color: var(--dt); font-size: .82rem; }

/* ---- bottom tabs (phone) / top nav (desktop) ---- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bar); border-top: 1px solid var(--bar-line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--bar-fg);
  font-size: .66rem; font-weight: 600; min-height: 60px; text-decoration: none; }
.tab .ic { display: grid; place-items: center; padding: 3px 14px; border-radius: 999px; }
.tab.on { color: var(--bar-on); }
.tab.on .ic { background: var(--gold); color: var(--gold-ink); }
.tab svg { width: 20px; height: 20px; }
@media (min-width: 768px) {
  .tabs { display: none; }
  nav.top { display: flex; }
  main, .main { padding-bottom: 32px; }
  .hin { padding: 12px 24px 8px; }
}
@media (max-width: 380px) { .hdr h1 { font-size: 1.05rem; } .ttl { font-size: .88rem; } main, .main { padding-left: 12px; padding-right: 12px; } }

/* ---- toast ---- */
#toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%) translateY(16px); opacity: 0; transition: all .2s;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .88rem; z-index: 60; max-width: 92%;
  background: var(--dd); color: var(--page); box-shadow: 0 6px 20px rgba(0,0,0,.2); pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--miss); color: #fff; }
@media (min-width: 768px) { #toast { bottom: 28px; } }
