/* Agata: the look. Soft, round, warm: cream canvas, plum ink, peach for actions, pastel bands for the pillars.
   Always light (as the DA page, Dan's choice). Phone first; a wide screen puts the tabs on top and the pane at the side.

   The pieces every tab file uses (see app/page/agata/lib.js for the helpers that build them):
     .card (+ h2 with an icon, .sub for a line under it), .cards a stack of cards, .grid2 two columns on a wide screen
     .list and .row: .rico (icon), .rbody (.rtitle, .rmeta), .rend (what sits at the right), .row.done
     .tick a round tick button (aria-pressed), .wnav a heading with arrows either side
     .chips and .chip (aria-pressed), .seg a segmented control
     button.primary / .ghost / .danger / .iconbtn, .bar a row of buttons, .fab the round add button above the tabs
     .field (label + input), .inline-add (an input with a button), .pfoot the sticky bottom of a pane
     .pill (+ .lilac .sky .mint .lemon .rose .peach .quiet), .band a left colour band, .progress a thin bar
     .muted .small .empty .notice .kv .file .thumb .date-block .badge
   The daily tracker's pieces (check tiles, counters, the week strip, meals, the 14-day grid) went with it on 20 October 2026. */
:root {
  color-scheme: light;
  --bg: #fff8f0; --surface: #ffffff; --ink: #3d2f4f; --muted: #7c7190; --line: #f0e4d8; --line-strong: #e2d3c3;
  --accent: #ff7a59; --accent-ink: #ffffff; --accent-soft: #ffe8df; --accent-deep: #e85f3f;
  --peach: #ffd9c7; --peach-ink: #a3422a; --mint: #cdeee2; --mint-ink: #1f6f55; --sky: #d6e9fb; --sky-ink: #24568a;
  --lemon: #fff1b8; --lemon-ink: #7a5a00; --lilac: #e6dcf7; --lilac-ink: #5b3f8f; --rose: #ffd6e0; --rose-ink: #a02a4e;
  --good-bg: #dff5e7; --good-fg: #0f7a3e; --warn-bg: #fff0d1; --warn-fg: #9a5200; --bad-bg: #ffe3e0; --bad-fg: #b8261b;
  --quiet-bg: #f4ede4; --quiet-fg: #6c6178;
  --font-display: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --radius: 20px; --radius-s: 12px; --shadow: 0 6px 22px rgba(61, 47, 79, 0.08); --tabs: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.45; }
body.has-pane { overflow: hidden; }
a { color: var(--accent-deep); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.ms { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; display: inline-block; vertical-align: middle; -webkit-font-smoothing: antialiased; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; flex: none; }
.ms.fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Sign-in */
#signin { max-width: 420px; margin: 10vh auto 0; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; }
#signin h1 { font-size: 34px; color: var(--accent-deep); }
#signin .msg { min-height: 1.4em; }
.msg.err { color: var(--bad-fg); }

/* Frame */
.app { max-width: 1040px; margin: 0 auto; padding: 14px 16px calc(var(--tabs) + 28px); display: flex; flex-direction: column; gap: 14px; }
header.top { display: flex; align-items: center; gap: 14px; }
.photo { width: 64px; height: 64px; border-radius: 50%; flex: none; border: 3px solid var(--surface); box-shadow: var(--shadow); background: var(--peach) center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--peach-ink); cursor: pointer; padding: 0; }
.photo .ms { font-size: 34px; }
.photo.has-photo .ms { display: none; }
.who { flex: 1; min-width: 0; }
.who h1 { font-size: 30px; line-height: 1.05; color: var(--ink); }
.who p { color: var(--muted); font-size: 14px; }
.who #family { font-family: var(--font-display); color: var(--accent-deep); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.notice { display: flex; gap: 10px; align-items: center; background: var(--warn-bg); color: var(--warn-fg); border-radius: var(--radius-s); padding: 10px 12px; font-size: 14px; }
main { display: flex; flex-direction: column; gap: 14px; min-height: 50vh; }

/* Tabs */
nav#tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; z-index: 20; }
nav#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-family: var(--font-display); font-size: 12px; padding: 6px 0; }
nav#tabs a .ms { font-size: 26px; }
nav#tabs a[aria-current="page"] { color: var(--accent-deep); }
nav#tabs a[aria-current="page"] .ms { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }

/* Cards */
.cards { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card > h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.card > h2 .ms { color: var(--accent-deep); }
.card > h2 .spacer { flex: 1; }
.card .sub { color: var(--muted); font-size: 14px; margin-top: -6px; }
.card.soft { background: var(--accent-soft); box-shadow: none; }
.card.band { border-left: 6px solid var(--band, var(--peach)); }

/* Lists */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-height: 52px; }
.row:first-child { border-top: 0; }
.row.clickable { cursor: pointer; }
.row .rico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--quiet-bg); color: var(--quiet-fg); flex: none; }
.row .rbody { flex: 1; min-width: 0; }
.row .rtitle { font-weight: 700; overflow-wrap: anywhere; }
.row .rmeta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row .rend { flex: none; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.row.done .rtitle { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.date-block { width: 46px; flex: none; text-align: center; background: var(--quiet-bg); border-radius: 12px; padding: 4px 0; line-height: 1.1; }
.date-block b { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.date-block span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.date-block.today { background: var(--accent); color: var(--accent-ink); }
.date-block.today span { color: var(--accent-ink); }

/* Ticks, and the heading with arrows (the quarter in Plan) */
.tick { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); color: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; flex: none; }
.tick .ms { font-size: 20px; }
.tick[aria-pressed="true"] { background: var(--mint-ink); border-color: var(--mint-ink); color: #fff; }
.tick.big { width: 44px; height: 44px; }
.wnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wnav h2 { font-size: 17px; }

/* Chips, segments, pills */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip .ms { font-size: 18px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: flex; background: var(--quiet-bg); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 8px 10px; font: inherit; font-family: var(--font-display); font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(61, 47, 79, 0.12); }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--quiet-bg); color: var(--quiet-fg); white-space: nowrap; }
.pill .ms { font-size: 15px; }
.pill.lilac { background: var(--lilac); color: var(--lilac-ink); } .pill.sky { background: var(--sky); color: var(--sky-ink); } .pill.mint { background: var(--mint); color: var(--mint-ink); }
.pill.lemon { background: var(--lemon); color: var(--lemon-ink); } .pill.rose { background: var(--rose); color: var(--rose-ink); } .pill.peach { background: var(--peach); color: var(--peach-ink); }
.pill.good { background: var(--good-bg); color: var(--good-fg); } .pill.warn { background: var(--warn-bg); color: var(--warn-fg); } .pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; padding: 0 6px; }
.progress { height: 6px; border-radius: 3px; background: var(--quiet-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--mint-ink); border-radius: 3px; }

/* Buttons */
button { font: inherit; }
button.primary, button.ghost, button.danger { border-radius: 999px; padding: 10px 18px; font-family: var(--font-display); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border: 2px solid transparent; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
button.danger { background: transparent; border-color: var(--bad-fg); color: var(--bad-fg); }
button.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; flex: none; }
button.iconbtn:hover { background: var(--quiet-bg); }
button.iconbtn.soft { background: var(--quiet-bg); }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bar .spacer { flex: 1; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 16px); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(232, 95, 63, 0.35); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 15; }
.fab .ms { font-size: 28px; }
.linkbtn { border: 0; background: transparent; color: var(--accent-deep); font: inherit; font-weight: 700; padding: 4px 0; cursor: pointer; text-decoration: underline; }

/* Forms */
input, textarea, select { font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-s); padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; min-height: 44px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .flab { font-size: 13px; font-weight: 700; color: var(--muted); }
.field .fhint { font-size: 12px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-add { display: flex; gap: 6px; align-items: center; }
.inline-add input { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* Pane */
#pane-host { position: fixed; inset: 0; z-index: 30; }
#pane-host::before { content: ""; position: absolute; inset: 0; background: rgba(61, 47, 79, 0.25); }
.pane { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; animation: slide-in 0.18s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.phead { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.phead h2 { flex: 1; font-size: 20px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pactions { display: flex; gap: 4px; }
.pbody { flex: 1; overflow: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.pfoot { position: sticky; bottom: 0; margin: auto -16px calc(-24px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.pfoot .spacer { flex: 1; }

/* Files, images, toast, dialog, empty */
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: inline-flex; align-items: center; gap: 6px; background: var(--quiet-bg); border-radius: 12px; padding: 6px 10px; font-size: 13px; max-width: 100%; text-decoration: none; color: var(--ink); }
.file .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.thumb { width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--radius-s); background: var(--quiet-bg); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-s); background: var(--quiet-bg); cursor: pointer; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px; color: var(--muted); text-align: center; }
.empty .ms { font-size: 36px; color: var(--line-strong); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity 0.2s, transform 0.2s; z-index: 40; max-width: calc(100% - 32px); text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad-fg); }
dialog { border: 0; border-radius: var(--radius); padding: 20px; max-width: 360px; box-shadow: var(--shadow); color: var(--ink); font-family: var(--font-body); }
dialog::backdrop { background: rgba(61, 47, 79, 0.35); }
dialog p { margin-bottom: 14px; }
dialog .bar { justify-content: flex-end; }

/* Wide screen: tabs on top beside the header, two columns of cards, the pane at the right. */
@media (min-width: 900px) {
  :root { --tabs: 0px; }
  .app { padding-bottom: 40px; }
  header.top { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  nav#tabs { position: static; height: auto; border: 0; background: transparent; display: flex; gap: 2px; padding: 0; }
  nav#tabs a { flex: none; flex-direction: row; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 15px; }
  nav#tabs a .ms { font-size: 22px; }
  nav#tabs a[aria-current="page"] { background: var(--accent-soft); }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .fab { bottom: 28px; right: 28px; }
  .pane { left: auto; width: 480px; box-shadow: -8px 0 30px rgba(61, 47, 79, 0.15); }
  .pane.wide { width: 640px; }
  .toast { bottom: 24px; }
}
