:root {
  --bg: #ebe8f6;
  --bg2: #f4eef3;
  --card: #ffffff;
  --ink: #1d1b2e;
  --muted: #77738c;
  --line: #ece9f3;
  --soft: #f6f4fb;
  --rail: #1d1b2e;
  --rail-ink: #ffffff;
  --mads: #c2408f;  --mads-tint: #fdebf4;  --mads-soft: #f9d7e9;
  --cody: #4a5fd8;  --cody-tint: #ebeefd;  --cody-soft: #d8defb;
  --arron: #d97a26; --arron-tint: #fff1e3; --arron-soft: #fde0c4;
  --shop: #23996a;  --shop-tint: #e4f6ee;  --shop-soft: #c6ecd9;
  --sun: #b88a0b;   --sun-tint: #fff6d4;
  --warn: #d6453d;  --warn-soft: #fde4e2;
  --track: rgba(29, 27, 46, .08);
  --shadow: 0 1px 2px rgba(60, 50, 110, .05), 0 8px 24px rgba(60, 50, 110, .07);
  --r: 26px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15131f;
  --bg2: #1b1726;
  --card: #221f30;
  --ink: #ecebf4;
  --muted: #9a96ad;
  --line: #2f2b40;
  --soft: #2a2639;
  --rail: #0d0c14;
  --mads: #f08cc2;  --mads-tint: #33212f;  --mads-soft: #4a2a40;
  --cody: #8fa0f5;  --cody-tint: #232741;  --cody-soft: #2f3560;
  --arron: #f3a766; --arron-tint: #35281d; --arron-soft: #4d3622;
  --shop: #62cf9f;  --shop-tint: #1b3128; --shop-soft: #224536;
  --sun: #ecc85a;   --sun-tint: #342d18;
  --warn: #f2807a;  --warn-soft: #432321;
  --track: rgba(255, 255, 255, .09);
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(135deg, var(--bg), var(--bg2));
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }

.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

/* ---------- Side rail ---------- */
.rail {
  background: var(--rail);
  border-radius: 32px;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 12px;
}
.rail .logo { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 22px; }
.faces { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; flex: 1; }
.face {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff;
  position: relative;
}
.face[data-who="Madison"] { background: var(--mads); }
.face[data-who="Cody"] { background: var(--cody); }
.face[data-who="Arron"] { background: var(--arron); }
.face[data-who="April"] { background: #8b62c9; }
.face .st { position: absolute; right: -4px; bottom: -4px; font-size: 14px; background: var(--rail); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.rail-add {
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: #fff; color: var(--rail); font-size: 28px; font-weight: 600; line-height: 1;
}

.app { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-width: 0; min-height: 0; }
.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  min-width: 0;
}
h2 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.tag {
  font-size: 14px; font-weight: 700; padding: 5px 14px; border-radius: 99px;
  border: 1.5px solid currentColor;
}
.mads .tag { color: var(--mads); } .cody .tag { color: var(--cody); }
.arron .tag { color: var(--arron); } .shop .tag { color: var(--shop); }
h2 .count { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Top row ---------- */
.top { display: grid; grid-template-columns: 280px 1fr 290px; gap: 12px; }
.hello { padding: 4px 4px 0; display: flex; flex-direction: column; justify-content: center; }
.hello .greet { font-size: 22px; font-weight: 700; }
.hello .time { font-size: 66px; font-weight: 800; letter-spacing: -.03em; line-height: 1.02; font-variant-numeric: tabular-nums; }
.hello .time small { font-size: 22px; font-weight: 700; margin-left: 6px; color: var(--muted); letter-spacing: 0; }
.hello .date { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.hello .date span:first-child { color: var(--ink); }

.morning { background: var(--sun-tint); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.morning::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 0, .35), rgba(255, 196, 0, 0) 70%); }
.morning .mlabel { font-size: 13px; font-weight: 800; color: var(--sun); text-transform: uppercase; letter-spacing: .06em; }
.morning .mtext { font-size: 20px; font-weight: 700; margin-top: 6px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; position: relative; z-index: 1; }
.morning.waiting .mtext { color: var(--muted); font-weight: 600; }
.morning .note { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }

.weather { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; background: var(--cody-tint); }
.weather .wicon { font-size: 50px; line-height: 1; }
.weather .wnow { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.weather .wdesc { font-size: 13px; color: var(--muted); font-weight: 500; }
.weather .wdays { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; }
.weather .wday { flex: 1; text-align: center; font-size: 12px; color: var(--muted); background: var(--card); border-radius: 14px; padding: 5px 0; font-weight: 600; }
.weather .wday b { display: block; color: var(--ink); font-size: 14px; }
.weather .wday span { font-size: 18px; display: block; }

/* ---------- Main grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1.05fr .95fr; gap: 12px; min-height: 0; }
.col { display: grid; grid-template-rows: 1.1fr 1fr; gap: 12px; min-height: 0; }
.person, .shop { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.person > div, .shop-list { min-height: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* Progress rings */
.ring {
  --p: 0; --c: var(--ink);
  width: 92px; height: 92px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0);
  display: grid; place-items: center; position: relative;
}
.ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.ring > * { position: relative; text-align: center; line-height: 1; }
.ring b { display: block; font-size: 28px; font-weight: 800; }
.ring i { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 700; }
.ring.sm { width: 40px; height: 40px; margin-left: auto; }
.ring.sm::before { inset: 5px; }
.ring.sm b { font-size: 12px; }
.ring:empty { visibility: hidden; }
.mads .ring { --c: var(--mads); }
.cody .ring { --c: var(--cody); }

/* Madison */
.when { font-size: 14px; color: var(--muted); font-weight: 700; }
.uniform {
  display: flex; align-items: center; gap: 14px;
  background: var(--mads-tint); border-radius: 20px; padding: 14px; margin: 8px 0 12px;
}
.uniform .uicon { font-size: 46px; line-height: 1; width: 66px; height: 66px; border-radius: 18px; background: var(--card); display: grid; place-items: center; flex: none; }
.uniform .uicon:has(img) { width: auto; height: auto; padding: 8px 12px; }
.uniform .uicon img { display: block; height: 128px; width: auto; }
.page .uniform .uicon img { height: 170px; }
.uniform .ulabel { font-size: 23px; font-weight: 800; color: var(--mads); line-height: 1.1; }
.uniform .unote { font-size: 13px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.checks li button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--soft); border: 0; border-radius: 16px; padding: 12px 14px; font-size: 19px; font-weight: 700;
}
.checks .box {
  flex: none; width: 30px; height: 30px; border-radius: 10px; border: 3px solid var(--mads);
  display: grid; place-items: center; font-size: 17px; color: #fff;
}
.checks .done { background: var(--mads-tint); }
.checks .done .box { background: var(--mads); }
.checks .done .txt { text-decoration: line-through; color: var(--muted); }
.allset { font-size: 16px; color: var(--muted); padding: 8px 2px; font-weight: 600; }

/* Cody */
.cody-top { display: flex; align-items: center; gap: 14px; }
.cody-top .lbl { font-size: 17px; font-weight: 800; }
.rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.rows li { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 14px; padding: 8px 12px; font-size: 15px; }
.cody .rows li { background: var(--cody-tint); }
.arron .rows li { background: var(--arron-tint); }
.rows li .t { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows li .t small { font-weight: 500; color: var(--muted); }
.pill { flex: none; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--card); color: var(--cody); }
.pill.soon { background: var(--warn-soft); color: var(--warn); }
.arron .pill { color: var(--arron); }
.foot { margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }

/* Arron */
.status { display: flex; align-items: center; gap: 14px; }
.status .sicon { font-size: 36px; width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--arron-tint); flex: none; }
.status .slabel { font-size: 23px; font-weight: 800; line-height: 1.1; }
.status .splace { font-size: 13px; color: var(--muted); margin-top: 3px; font-weight: 600; }

/* Shopping */
.shop-add { display: flex; gap: 8px; margin-bottom: 8px; }
.shop-add input {
  flex: 1; min-width: 0; border: 0; background: var(--shop-tint); border-radius: 16px; padding: 11px 14px; font-size: 17px; font-weight: 600;
  -webkit-user-select: text; user-select: text; outline: none;
}
.shop-add input::placeholder { color: var(--muted); font-weight: 500; }
.shop-add input:focus { box-shadow: 0 0 0 2px var(--shop); }
.shop-add button { width: 48px; border: 0; border-radius: 50%; background: var(--shop); color: #fff; font-size: 26px; font-weight: 600; line-height: 1; }
.shop-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.shop-list li button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 10px 2px; font-size: 18px; font-weight: 700;
}
.shop-list .box { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--shop); display: grid; place-items: center; color: #fff; font-size: 13px; }
.shop-list .done .box { background: var(--shop); }
.shop-list .done .txt { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.shop-list .by { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 700; background: var(--soft); padding: 2px 8px; border-radius: 99px; }
.shop-list .empty { color: var(--muted); padding: 10px 2px; font-size: 15px; }
.link { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 8px 0 0; text-align: left; text-decoration: underline; font-weight: 600; }

/* ---------- Bottom strip ---------- */
.bottom { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coming-label { font-size: 15px; font-weight: 800; flex: none; }
.coming { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.coming::-webkit-scrollbar { display: none; }
.chip {
  flex: none; background: var(--card); border-radius: 99px; padding: 8px 14px; font-size: 14px; font-weight: 600; white-space: nowrap;
  border: 1.5px solid var(--line);
}
.chip b { margin-right: 6px; font-weight: 800; }
.chip.c-mads { border-color: var(--mads-soft); } .chip.c-cody { border-color: var(--cody-soft); }
.chip.c-arron { border-color: var(--arron-soft); } .chip.c-school { border-color: var(--shop-soft); }
.chip.today { background: var(--sun-tint); border-color: var(--sun); }

/* ---------- Dialogs ---------- */
dialog { border: 0; border-radius: 26px; padding: 22px; width: min(560px, 92vw); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(20,15,50,.3); }
dialog::backdrop { background: rgba(20, 16, 40, .45); }
dialog h3, .pin h3 { margin: 0 0 12px; font-size: 22px; font-weight: 800; }
.who { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.who button { border: 1.5px solid var(--line); background: var(--soft); border-radius: 99px; padding: 6px 14px; font-weight: 700; }
.who button.on { border-color: var(--ink); background: var(--ink); color: var(--card); }
textarea, .pin input {
  width: 100%; border: 0; background: var(--soft); border-radius: 16px; padding: 12px 14px; font-size: 18px; resize: none; outline: none; font-weight: 600;
  -webkit-user-select: text; user-select: text;
}
textarea:focus, .pin input:focus { box-shadow: 0 0 0 2px var(--ink); }
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.examples button { border: 0; background: var(--soft); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.add-result { min-height: 22px; font-weight: 700; color: var(--shop); }
.add-result.bad { color: var(--warn); }
.row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.primary, .ghost { border: 0; border-radius: 99px; padding: 12px 24px; font-weight: 800; font-size: 16px; }
.primary { background: var(--ink); color: var(--card); }
.ghost { background: var(--soft); }
.pin { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.pin form { width: min(380px, 100%); display: grid; gap: 12px; }
.pin p { margin: 0; }
.offline { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--warn); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 99px; }

/* ---------- Portrait / phones: stack and scroll ---------- */
@media (max-width: 900px), (orientation: portrait) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; grid-template-columns: 1fr; }
  .rail { flex-direction: row; border-radius: 99px; padding: 8px 12px; position: sticky; top: 8px; z-index: 5; }
  .faces { flex-direction: row; margin: 0; }
  .face { width: 38px; height: 38px; }
  .rail .logo { width: 38px; height: 38px; }
  .rail-add { width: 42px; height: 42px; }
  .top { grid-template-columns: 1fr 1fr; }
  .morning { grid-column: 1 / -1; order: 3; }
  .grid { grid-template-columns: 1fr; }
  .col { grid-template-rows: auto auto; }
  .person > div, .shop-list { overflow: visible; }
  .bottom { flex-wrap: wrap; }
  .coming { flex-basis: 100%; }
}
@media (max-width: 560px) {
  .top { grid-template-columns: 1fr; }
  .hello .time { font-size: 54px; }
}

/* ---------- Person pages (tabs) ---------- */
.rail .logo { border: 0; color: #fff; }
.rail .logo.on, .face.on { box-shadow: 0 0 0 3px var(--rail), 0 0 0 5px #fff; }
.page { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-height: 0; }
.page.p-April { grid-template-columns: 1fr; }
.page .person h2 .ring.sm { margin-left: auto; }
.sub-h { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 8px; }
.uniform.none { background: var(--soft); }
.uniform.none .ulabel { color: var(--ink); }
.x { flex: none; border: 0; background: none; color: var(--muted); font-size: 14px; width: 28px; height: 28px; border-radius: 50%; }
.x:active { background: var(--card); }
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.msgs li { background: var(--sun-tint); border-radius: 16px; padding: 10px 12px; font-weight: 600; font-size: 15px; }
.week { display: flex; flex-direction: column; min-height: 0; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; flex: 1; min-height: 0; }
.wk { background: var(--soft); border-radius: 18px; padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.wk.today { background: var(--sun-tint); box-shadow: inset 0 0 0 2px var(--sun); }
.wk-h { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.wk-h b { color: var(--ink); font-size: 15px; display: block; }
.wk-i { font-size: 12.5px; font-weight: 600; background: var(--card); border-radius: 10px; padding: 6px 7px; line-height: 1.25; border-left: 3px solid var(--line); }
.wk-i.c-mads { border-left-color: var(--mads); } .wk-i.c-cody { border-left-color: var(--cody); }
.wk-i.c-arron { border-left-color: var(--arron); } .wk-i.c-school { border-left-color: var(--shop); }
@media (max-width: 900px), (orientation: portrait) {
  .page { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
}
.cody .checks .box { border-color: var(--cody); } .cody .checks .done .box { background: var(--cody); } .cody .checks .done { background: var(--cody-tint); }
.arron .checks .box { border-color: var(--arron); } .arron .checks .done .box { background: var(--arron); }
#codyBig .ring { width: 130px; height: 130px; } #codyBig .ring b { font-size: 40px; }
#codyBig .cody-top { flex-direction: column; align-items: flex-start; }

.checks .pic { height: 40px; width: auto; border-radius: 6px; flex: none; }

/* Cody's timetable */
.now-line { margin-top: 8px; font-size: 14px; background: var(--cody-tint); border-radius: 12px; padding: 7px 10px; font-weight: 600; }
.tt { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.tt li { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; background: var(--cody-tint); font-size: 15px; }
.tt .tm { color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tt .sj { font-weight: 700; }
.tt .rm { font-size: 12px; color: var(--muted); font-weight: 700; }
.tt li.brk { background: none; padding: 2px 10px; font-size: 12px; }
.tt li.brk .sj { color: var(--muted); font-weight: 600; }
.tt li.sport { background: var(--shop-tint); }
.tt li.on { background: var(--cody); color: #fff; }
.tt li.on .tm, .tt li.on .rm { color: rgba(255,255,255,.8); }

.subjects { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; }
.subjects .small { font-weight: 700; margin-right: 2px; }
.subj { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--cody-tint); color: var(--cody); }
.subj.sport { background: var(--shop-tint); color: var(--shop); }
.subj.on { background: var(--cody); color: #fff; }

#cody .ring { width: 70px; height: 70px; }
#cody .ring::before { inset: 8px; }
#cody .ring b { font-size: 22px; }
#cody .ring i { font-size: 9px; }
#cody .cody-top .lbl { font-size: 15px; }
#cody .rows { margin-top: 8px; }
.col { grid-template-rows: 1.2fr 1fr; }

.sub-day { font-size: 13px; font-weight: 800; color: var(--muted); margin: 10px 0 6px; }
.subj-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.subj-rows li { background: var(--cody-tint); border-radius: 12px; padding: 8px 12px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subj-rows li.sport { background: var(--shop-tint); color: var(--shop); }
.subj-rows li.on { background: var(--cody); color: #fff; }
.exam-line { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--cody); }
.exam-line.soon { color: var(--warn); }

.hello .date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.daybadge { font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 10px; border-radius: 99px; color: #fff; }
.daybadge.school { background: var(--cody); }
.daybadge.weekend { background: #8b62c9; }
.daybadge.holidays { background: var(--shop); }

/* Weather card: Oakdale on top, Mount Annan + Dad underneath */
.weather { display: flex; flex-direction: column; gap: 6px; }
.weather .wplace { font-size: 13px; font-weight: 800; color: var(--cody); letter-spacing: .02em; }
.weather .wmain { display: flex; align-items: center; gap: 12px; }
.weather .wicon { font-size: 42px; }
.weather .wnow { font-size: 36px; }
.weather .wminis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.weather .wmini { background: var(--card); border-radius: 12px; padding: 5px 8px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; font-size: 12px; }
.weather .wm-i { grid-row: 1 / 3; font-size: 20px; }
.weather .wm-n { font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather .wmini b { font-size: 16px; grid-row: 1 / 3; grid-column: 3; }
.weather .wm-r { color: var(--muted); font-weight: 600; }
.weather .wdays { margin-top: 0; }
.weather .wday { padding: 3px 0; }
.weather .wday span { font-size: 15px; }
.top { grid-template-columns: 270px 1fr 380px; }
.weather { display: grid; grid-template-columns: minmax(0, 1fr) 150px; grid-template-areas: "place minis" "main minis" "days days"; gap: 4px 10px; align-items: center; }
.weather .wplace { grid-area: place; }
.weather .wmain { grid-area: main; }
.weather .wminis { grid-area: minis; grid-template-columns: 1fr; align-self: stretch; align-content: center; }
.weather .wmini { grid-template-columns: auto minmax(0, 1fr) auto; padding: 6px 9px; }
.weather .wdays { grid-area: days; margin-top: 4px; }
.weather .wday { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 0; font-size: 12px; }
.weather .wday span { display: inline; font-size: 15px; }
.weather .wday b { display: inline; font-size: 13px; }
@media (max-width: 900px), (orientation: portrait) {
  .top { grid-template-columns: 1fr 1fr; }
}
.top { grid-template-columns: 260px 1fr 400px; }
.weather { grid-template-columns: minmax(0, 1fr) 182px; }
.weather .wm-n { font-size: 11.5px; }
.weather .wdays { gap: 5px; }
.hello .greet { font-size: 19px; white-space: nowrap; }

/* ---------- Weather: three equal columns in the header ---------- */
.weather { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: none; gap: 8px; align-items: start; padding: 12px; }
.weather .wcol { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.wname { display: inline-block; background: #ffd23f; color: #1d1b2e; font-weight: 800; font-size: 13px; padding: 2px 9px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.weather .wicon { font-size: 30px; line-height: 1.1; margin-top: 2px; }
.weather .wnow { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.weather .wdesc { font-size: 11.5px; line-height: 1.35; color: var(--muted); font-weight: 600; }

/* ---------- Weather tab ---------- */
.page.p-weather { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wbig { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; background: var(--cody-tint); }
.wbig .wname { font-size: 15px; align-self: flex-start; }
.wbig .wtop { display: flex; gap: 12px; align-items: center; }
.wbig .wicon { font-size: 56px; line-height: 1; }
.wbig .wnow { font-size: 52px; font-weight: 800; line-height: 1; }
.wbig .wdesc { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.45; }
.whours { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.whours::-webkit-scrollbar { display: none; }
.wh { flex: none; width: 52px; background: var(--card); border-radius: 14px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 700; }
.wh i { font-style: normal; font-size: 18px; }
.wh b { color: var(--ink); font-size: 14px; }
.wh small { color: var(--cody); font-size: 10px; }
.wweek { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wweek li { display: grid; grid-template-columns: 44px 24px 28px 1fr 30px 42px; align-items: center; gap: 6px; background: var(--card); border-radius: 12px; padding: 6px 10px; font-size: 13px; }
.wweek .wd { font-weight: 800; }
.wweek i { font-style: normal; font-size: 17px; }
.wweek .wr { color: var(--muted); font-weight: 700; text-align: right; }
.wweek b { font-weight: 800; }
.wweek small { color: var(--cody); font-weight: 700; font-size: 11px; }
.wbar { height: 6px; border-radius: 99px; background: var(--track); position: relative; overflow: hidden; }
.wbar span { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #5aa9f0, #ffb347, #f46b45);
  left: calc(var(--a) / 40 * 100%); right: calc((40 - var(--b)) / 40 * 100%); }
@media (max-width: 900px), (orientation: portrait) {
  .page.p-weather { grid-template-columns: 1fr; }
}

/* ---------- Mum's tab ---------- */
.page.p-April { grid-template-columns: 1fr 1fr 1.15fr; }
.mum-day, .mum-rest { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.mum-day > div { min-height: 0; overflow-y: auto; }
.mum-day h2 { flex-wrap: wrap; }
.mum-day h2 .daybadge { margin-left: auto; }
.mum-day .tag, .mum-rest .tag { color: #8b62c9; }
.mum-day .rows li { font-size: 16px; padding: 10px 12px; border-left: 4px solid var(--line); }
.mum-day .rows li.c-mads { border-left-color: var(--mads); }
.mum-day .rows li.c-cody { border-left-color: var(--cody); }
.mum-day .rows li.c-arron { border-left-color: var(--arron); }
.mum-day .rows li.c-school { border-left-color: var(--shop); }
.mum-day .rows li .t { white-space: normal; }
.wk-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; overflow-y: auto; }
.wk-lines li { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: start; background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.wl-h { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.wl-t { font-size: 14px; font-weight: 600; line-height: 1.4; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.dot.school { background: var(--cody); } .dot.weekend { background: #8b62c9; } .dot.holidays { background: var(--shop); }

/* Mum's tab: Today/Tomorrow stacked · rest of week · reminders */
.page.p-April { grid-template-columns: 1fr 1fr 1fr; }
.page.p-April .col { grid-template-rows: 1fr 1fr; }
.mum-rem { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: #f6f0ff; }
:root[data-theme="dark"] .mum-rem { background: #2a2140; }
.mum-rem .tag { color: #8b62c9; }
.rem-add input { background: var(--card); }
.rem-add input:focus { box-shadow: 0 0 0 2px #8b62c9; }
.rem-add button { background: #8b62c9; }
.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; overflow-y: auto; }
.rem-list li { display: flex; align-items: center; gap: 4px; background: var(--card); border-radius: 14px; padding: 4px 6px 4px 4px; }
.rem-tick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; text-align: left; padding: 8px; font-size: 16px; font-weight: 700; }
.rem-tick .txt { flex: 1; min-width: 0; }
.rem-tick .box { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid #8b62c9; display: grid; place-items: center; color: #fff; font-size: 13px; }
.rem-tick .pill { color: #8b62c9; background: #f6f0ff; }
.rem-tick .pill.soon { color: var(--warn); background: var(--warn-soft); }
.rem-list .done .box { background: #8b62c9; }
.rem-list .done .txt { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.rem-list .empty { color: var(--muted); font-size: 14px; padding: 10px; background: none; }
.mum-day .rows li.c-mum { border-left-color: #8b62c9; }
.mum-day h2 .small { flex: 1; }
.mum-day .rows li { padding: 8px 12px; font-size: 15px; }

/* ---------- Fire danger + alerts ---------- */
.fire { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12px; }
.fdr { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 9px; border-radius: 6px; color: #fff; background: #8a8f98; }
.fdr-moderate { background: #64bf30; } .fdr-high { background: #fedd3a; color: #1d1b2e; }
.fdr-extreme { background: #f78100; } .fdr-catastrophic { background: #ad0909; }
.ban { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: #ad0909; color: #fff; }
.ban.soft { background: var(--warn-soft); color: var(--warn); }
.fire-near { flex-basis: 100%; color: var(--muted); font-weight: 600; font-size: 12px; }
.morning.fire-alert { background: #fff3c4; box-shadow: inset 0 0 0 3px #f2a900; }
.morning.fire-alert .mlabel { color: #9a5b00; }
.morning.fire-alert.emergency { background: #ffe1df; box-shadow: inset 0 0 0 3px #d61f1f; animation: pulse 1.6s infinite; }
.morning.fire-alert.emergency .mlabel { color: #b00000; }
:root[data-theme="dark"] .morning.fire-alert { background: #3a2c08; }
:root[data-theme="dark"] .morning.fire-alert.emergency { background: #3d1212; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 6px #d61f1f; } }

/* ---------- Timers in the bottom strip ---------- */
.coming-wrap { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.timer { flex: 1; position: relative; height: 54px; border-radius: 99px; background: var(--card); overflow: hidden; box-shadow: var(--shadow); }
.tbar { position: absolute; inset: 0 auto 0 0; transition: width 1s linear, background .5s; }
.t-green .tbar { background: #bfe8cf; } .t-amber .tbar { background: #ffdf8f; } .t-red .tbar { background: #ffb3ab; }
.t-now .tbar { background: #8b62c9; } .t-now { animation: glow 1.5s infinite; }
:root[data-theme="dark"] .t-green .tbar { background: #1f4a33; } :root[data-theme="dark"] .t-amber .tbar { background: #5a4710; } :root[data-theme="dark"] .t-red .tbar { background: #5c2420; }
.tlabel { position: relative; display: flex; align-items: center; gap: 12px; height: 100%; padding: 0 20px; font-size: 20px; font-weight: 700; }
.t-now .tlabel { color: #fff; }
.ticon { font-size: 26px; }
.tat { margin-left: auto; font-size: 15px; color: var(--muted); font-weight: 700; }
.t-now .tat { color: rgba(255,255,255,.85); }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(139, 98, 201, .35); } }

/* ---------- Homework tab ---------- */
.stars { display: grid; gap: 6px; }
.st-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(7, minmax(0, 1fr)); gap: 4px; align-items: center; }
.st-head span { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.st-head span.today { color: var(--mads); }
.st-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cell { height: 34px; border-radius: 10px; background: var(--mads-tint); display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.st-cell:empty { background: transparent; }
.st-cell.today { box-shadow: inset 0 0 0 2px var(--mads); }
.big-stars { margin-top: 14px; font-size: 22px; font-weight: 800; color: var(--mads); text-align: center; }
.checks .pill { margin-left: auto; color: var(--mads); background: var(--mads-tint); }

/* ---------- Learning tab ---------- */
.learn-main { background: var(--cody-tint); }
.fact-big { font-size: 24px; font-weight: 700; line-height: 1.4; margin: 6px 0 18px; }
.fact-next { align-self: flex-start; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.facts li { background: var(--cody-tint); border-radius: 14px; padding: 10px 12px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.facts li b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--cody); margin-bottom: 2px; }
.rail { gap: 10px; }

/* ---------- Madison's routines ---------- */
.routine { border-radius: 18px; padding: 10px; margin-bottom: 10px; background: var(--soft); }
.routine.now { background: var(--mads-tint); box-shadow: inset 0 0 0 2px var(--mads); }
.routine.done { opacity: .75; }
.r-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin: 0 2px 8px; }
.r-head .small { font-weight: 600; }
.r-star { margin-left: auto; font-size: 18px; }
.routine .checks li button { background: var(--card); padding: 10px 12px; font-size: 17px; }
.routine .checks .done { background: var(--mads-tint); }
.all-done { text-align: center; font-size: 30px; font-weight: 800; color: var(--mads); padding: 22px 0; background: var(--mads-tint); border-radius: 20px; }
.all-done small { display: block; font-size: 15px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.st-icon { font-size: 20px; text-align: center; overflow: visible; }
.p-Madison .st-row { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
.st-cell:empty { box-shadow: none; }

/* ---------- Picture cards (get ready for tomorrow) ---------- */
.kit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.kit-card { position: relative; border: 0; border-radius: 16px; background: #fff; padding: 6px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: inset 0 0 0 2px var(--mads-soft); }
.kit-card img { width: 100%; max-width: 86px; aspect-ratio: 1; object-fit: contain; }
.kit-card span { font-size: 12px; font-weight: 800; color: #1d1b2e; }
.kit-card.done { box-shadow: inset 0 0 0 3px var(--mads); }
.kit-card.done img { opacity: .35; }
.kit-card i { position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%;
  background: var(--mads); color: #fff; font-style: normal; font-size: 24px; font-weight: 800; display: grid; place-items: center; }
.sub-day { display: flex; align-items: center; gap: 8px; }
.cody-uni { margin-left: auto; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--cody-tint); color: var(--cody); }
.cody-uni.sport { background: var(--shop-tint); color: var(--shop); }
.subj-rows { gap: 5px; } .subj-rows li { padding: 6px 10px; font-size: 14px; } .sub-day { margin: 8px 0 5px; }

/* Madison's uniform: the separate pieces in a row */
.uniform { flex-direction: column; align-items: stretch; gap: 10px; }
.u-pieces { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 6px; }
.u-pieces figure { margin: 0; background: #fff; border-radius: 12px; padding: 4px 2px 3px; text-align: center; }
.u-pieces img { width: 100%; max-width: 64px; aspect-ratio: 1; object-fit: contain; display: block; margin: 0 auto; }
.u-pieces figcaption { font-size: 10.5px; font-weight: 800; color: #1d1b2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Cody's uniform tile on the front card */
.cody-uni-big { margin-left: auto; flex: none; width: 74px; height: 74px; border-radius: 18px; background: var(--cody-tint); color: var(--cody);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.cody-uni-big span { font-size: 36px; line-height: 1; }
.cody-uni-big b { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.cody-uni-big.sport { background: var(--shop-tint); color: var(--shop); }
#cody .cody-top { gap: 10px; }
#cody .cody-uni-big { width: 70px; height: 70px; border-radius: 50%; } #cody .cody-uni-big span { font-size: 32px; } #cody .cody-uni-big b { font-size: 10px; }

/* Cody's tab: uniform circle the same size as the big countdown ring */
.ring-row { display: flex; align-items: center; gap: 14px; }
#codyBig .cody-uni-big { margin-left: 0; width: 130px; height: 130px; border-radius: 50%; }
#codyBig .cody-uni-big span { font-size: 60px; }
#codyBig .cody-uni-big b { font-size: 14px; }
.weather .wcol { align-items: center; text-align: center; }

/* Live status pill at the top of each person's tab */
.where { margin-left: auto; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.where small { font-weight: 600; color: var(--muted); }

/* ---------- Phones and portrait: clock and weather share a row, weather drops below on small phones ---------- */
@media (max-width: 900px), (orientation: portrait) {
  .top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .top > * { min-width: 0; }
}
@media (max-width: 600px) {
  .top { grid-template-columns: minmax(0, 1fr); }
  .hello .greet { white-space: normal; }
  .weather { gap: 6px; padding: 10px; }
  .weather .wnow { font-size: 30px; }
  .weather .wdesc { font-size: 11px; }
}
@media (max-width: 600px) {
  .shell > *, .app { min-width: 0; }
  .rail { min-width: 0; max-width: 100%; gap: 4px; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .faces { gap: 4px; }
  .face, .rail .logo { width: 32px; height: 32px; flex: none; }
  .rail-add { width: 36px; height: 36px; flex: none; }
}
