/* 家长助手 — design tokens
   Palette rooted in the school's heraldry: deep navy, a gold that marks "today / new / important",
   cool paper greys. Light and dark share the same structure. */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --line: #e1e5eb;
  --line-strong: #cfd5de;
  --ink: #152033;
  --ink-2: #4a5468;
  --ink-3: #848da0;
  --primary: #213e98;
  --primary-hover: #2b4cb3;
  --on-primary: #ffffff;
  --primary-soft: #e6ebf8;
  --primary-text: #213e98;
  --gold: #8f6a2a;
  --gold-mark: #c59a50;
  --gold-soft: #f7efe0;
  --red: #b4232f;
  --red-soft: #fbe8ea;
  --green: #2b7550;
  --green-soft: #e1f1e7;
  --cat-junior: #3a7bc8;
  --cat-whole: #7050b0;
  --cat-senior: #a0a7b3;
  --cat-holiday: #2b7550;
  --shadow-1: 0 1px 2px rgba(21, 32, 51, 0.06);
  --shadow-pop: 0 12px 40px rgba(21, 32, 51, 0.18);
  --r-panel: 16px;
  --r-ctl: 10px;
  --sidebar-w: 236px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c111b;
  --surface: #131a26;
  --surface-2: #19222f;
  --line: #222d3d;
  --line-strong: #2e3b4f;
  --ink: #e7ebf2;
  --ink-2: #aab3c3;
  --ink-3: #737e92;
  --primary: #2c4db3;
  --primary-hover: #3659c6;
  --on-primary: #ffffff;
  --primary-soft: #1a2650;
  --primary-text: #a3b8f2;
  --gold: #d9b878;
  --gold-mark: #d2ad68;
  --gold-soft: #2c2414;
  --red: #ff8d98;
  --red-soft: #3a1b21;
  --green: #7ccf9b;
  --green-soft: #15301f;
  --cat-junior: #6aa3e0;
  --cat-whole: #a88ae6;
  --cat-senior: #5d6779;
  --cat-holiday: #7ccf9b;
  --shadow-1: none;
  --shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold-mark); outline-offset: 2px; border-radius: 6px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: -3px; }
.num { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar { display: none; }
main#app { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 10px) 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface);
  }
  main#app { max-width: 1240px; width: 100%; padding: 28px 40px 48px; margin: 0; }
  .tabbar { display: none !important; }
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { display: block; font-size: 15px; }
.brand span { display: block; font-size: 12px; color: var(--ink-3); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: var(--ink-2); font-weight: 550; font-size: 14.5px; position: relative;
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.on { background: var(--primary-soft); color: var(--primary-text); }
.side-nav a .pip { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold-mark); color: #1b1404; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13.5px; }
.side-user .avatar { width: 30px; height: 30px; font-size: 13px; }

/* ---------- tab bar (phone) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b); display: flex;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--ink-3); font-weight: 600; position: relative; }
.tabbar .ic { width: 22px; height: 22px; }
.tabbar a.on { color: var(--primary-text); }
.tabbar a .pip { position: absolute; top: 8px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--gold-mark); }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -0.015em; font-weight: 700; }
.page-head .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.page-head .tools { display: flex; gap: 8px; align-items: center; }
@media (min-width: 1024px) { .page-head h1 { font-size: 30px; } }

.back { display: inline-flex; align-items: center; gap: 4px; color: var(--primary-text); font-weight: 600; font-size: 14px; margin: 4px 0 8px; }

/* ---------- term ruler: the signature element ---------- */
.term {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: end;
  padding: 16px 18px; margin-bottom: 18px; border-radius: var(--r-panel);
  background: var(--primary); color: #fff;
}
.term .t1 { font-size: 17px; font-weight: 700; }
.term .t2 { font-size: 13px; opacity: 0.8; }
.term .tcount { text-align: right; line-height: 1; }
.term .tcount b { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; }
.term .tcount span { display: block; font-size: 12px; opacity: 0.8; margin-top: 4px; }
.ruler { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 10px; }
.ruler i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); }
.ruler i.past { background: rgba(255, 255, 255, 0.55); }
.ruler i.now { background: var(--gold-mark); }
.ruler-labels { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11.5px; opacity: 0.75; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-1); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 4px; }
.panel-head h2 { font-size: 15.5px; margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 650; }
.panel-head h2 .ic { color: var(--ink-3); }
.panel-head a, .panel-head .link { font-size: 13.5px; color: var(--primary-text); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; cursor: pointer; padding: 0; }
.panel-body { padding: 6px 18px 16px; }
.panel.flush .panel-body { padding: 0; }
.empty { color: var(--ink-3); font-size: 14px; padding: 8px 0; }
.count { font-size: 11.5px; font-weight: 700; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 7px; }
:root[data-theme="dark"] .count { color: #2a0b0f; }

.grid-home { display: grid; gap: 0 20px; }
@media (min-width: 1024px) { .grid-home { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; } }

/* ---------- chips & buttons ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 0; }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.blue { background: var(--primary-soft); color: var(--primary-text); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip .ic { width: 13px; height: 13px; }
button.chip { cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: var(--r-ctl); padding: 10px 16px; font-weight: 600; font-size: 14.5px; cursor: pointer; background: var(--primary); color: var(--on-primary); }
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: 13.5px; border-radius: 9px; }
.btn.icon { padding: 8px; }
.btn.block { width: 100%; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.input, .field input, .field select {
  width: 100%; font-size: 16px; padding: 11px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); outline: none;
}
.input:focus, .field input:focus, .field select:focus { border-color: var(--primary-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-text) 20%, transparent); }
.row-inline { display: flex; gap: 8px; }
.row-inline > :first-child { flex: 1; min-width: 0; }
.note { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; }
.note.err { background: var(--red-soft); color: var(--red); }
.note.ok { background: var(--green-soft); color: var(--green); }
.note.info { background: var(--primary-soft); color: var(--primary-text); }
.fine { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }

/* ---------- attention list ---------- */
.todo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.todo:first-child { border-top: 0; }
.todo .mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--red-soft); color: var(--red); }
.todo.event .mark { background: var(--gold-soft); color: var(--gold); }
.todo.info .mark { background: var(--primary-soft); color: var(--primary-text); }
.todo .tx { flex: 1; min-width: 0; }
.todo .t { font-weight: 620; font-size: 14.5px; line-height: 1.4; }
.todo .d { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.todo .act { margin-top: 8px; }
.todo .x { border: 0; background: none; color: var(--ink-3); padding: 4px; cursor: pointer; border-radius: 6px; }
.todo .x:hover { background: var(--surface-2); color: var(--ink); }
.done-line { font-size: 13px; color: var(--green); padding: 10px 0 0; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }

/* ---------- diary (day-anchored agenda) ---------- */
.diary-day { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 0 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.diary-day:first-child { border-top: 0; }
.dd { text-align: left; position: relative; padding-left: 10px; }
.dd::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: transparent; }
.diary-day.today .dd::before { background: var(--gold-mark); }
.dd b { display: block; font-size: 26px; line-height: 1; font-weight: 720; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dd span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.diary-day.today .dd span { color: var(--gold); font-weight: 650; }
.dd small { display: block; font-size: 11px; color: var(--ink-3); }
.ev { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 3px 0 9px; cursor: pointer; border-radius: 8px; }
.ev:last-child { padding-bottom: 0; }
.ev:hover .title { color: var(--primary-text); }
.ev .tm { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 1px; display: flex; gap: 7px; }
.ev .tm::before { content: ""; width: 3px; border-radius: 2px; background: var(--cat-senior); flex: none; }
.ev.cat-junior .tm::before { background: var(--cat-junior); }
.ev.cat-whole .tm::before { background: var(--cat-whole); }
.ev.holiday .tm::before { background: var(--cat-holiday); }
.ev .tm em { font-style: normal; display: block; color: var(--ink-3); font-size: 12px; }
.ev .title { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.ev .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ev .meta .ic { width: 13px; height: 13px; vertical-align: -2px; }
.ev .tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.ev.past { opacity: 0.5; }
.new-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-mark); margin-right: 6px; vertical-align: 2px; }

/* ---------- calendar ---------- */
.cal-layout { display: grid; gap: 16px; }
@media (min-width: 1024px) { .cal-layout { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); align-items: start; } .cal-side { position: sticky; top: 20px; } }
.cal-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.cal-tools .search { flex: 1; min-width: 180px; position: relative; }
.cal-tools .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.cal-tools .search input { padding-left: 34px; font-size: 15px; padding-top: 8px; padding-bottom: 8px; }
.month-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.month-head h3 { margin: 0; font-size: 16px; }
.month-head .nav { display: flex; gap: 4px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 8px 10px; }
.month .wd { font-size: 12px; color: var(--ink-3); text-align: center; padding: 4px 0 6px; }
.month .cell { min-height: 46px; border-radius: 9px; padding: 5px 4px; cursor: pointer; border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; }
.month .cell:hover { background: var(--surface-2); }
.month .cell .n { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.month .cell.out .n { color: var(--ink-3); opacity: 0.5; }
.month .cell.weekend .n { color: var(--ink-3); }
.month .cell.today .n { background: var(--gold-mark); color: #1b1404; }
.month .cell.sel { border-color: var(--primary-text); background: var(--primary-soft); }
.month .cell.holiday .n { color: var(--green); }
.month .dots { display: flex; gap: 2px; height: 5px; }
.month .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--cat-junior); }
.month .dots i.whole { background: var(--cat-whole); }
.month .dots i.senior { background: var(--cat-senior); }
.month .dots i.hl { background: var(--gold-mark); }
.month .lines { display: none; }
@media (min-width: 1024px) {
  .month .cell { min-height: 92px; align-items: stretch; padding: 6px; }
  .month .cell .n { width: 24px; height: 24px; font-size: 13px; }
  .month .dots { display: none; }
  .month .lines { display: flex; flex-direction: column; gap: 2px; }
  .month .lines span { font-size: 11px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); border-left: 2px solid var(--cat-junior); text-align: left; }
  .month .lines span.whole { border-left-color: var(--cat-whole); }
  .month .lines span.senior { border-left-color: var(--cat-senior); }
  .month .lines span.hl { background: var(--gold-soft); color: var(--gold); }
  .month .lines span.more { background: none; border: 0; color: var(--ink-3); }
}
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); padding: 0 14px 12px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }

/* ---------- child ---------- */
.profile { display: flex; gap: 14px; align-items: center; padding: 18px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-weight: 700; font-size: 21px; flex: none; }
.profile h2 { margin: 0; font-size: 19px; }
.profile .p-sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--ink-2); }
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink-2); padding-bottom: 6px; }
.fixture { padding: 10px 0; border-top: 1px solid var(--line); }
.fixture:first-child { border-top: 0; }
.grid-2 { display: grid; gap: 0 20px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- services ---------- */
.svc { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.svc:first-child { border-top: 0; }
.svc .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.svc .tx { flex: 1; min-width: 0; }
.svc .t { font-weight: 600; font-size: 14.5px; }
.svc .d { font-size: 12.5px; color: var(--ink-3); }
.svc .go { color: var(--ink-3); }
a.svc:hover { background: var(--surface-2); }
.svc-group h3 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 22px 4px 8px; }
.svc-cols { display: grid; gap: 0 20px; }
@media (min-width: 1024px) { .svc-cols { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- news ---------- */
.news-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.news-item:first-child { border-top: 0; }
.news-item .t { font-weight: 650; font-size: 15.5px; line-height: 1.4; }
.news-item .o { font-size: 12.5px; color: var(--ink-3); }
.news-item .x { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-item .d { font-size: 12.5px; color: var(--ink-3); }
.news-item:hover .t { color: var(--primary-text); }
.reader { max-width: 720px; }
.reader .cover { width: 100%; max-height: 320px; object-fit: cover; display: block; border-radius: var(--r-panel) var(--r-panel) 0 0; }
.reader h1 { font-size: 24px; line-height: 1.35; margin: 0 0 6px; letter-spacing: -0.01em; }
.reader p { margin: 0 0 14px; line-height: 1.8; font-size: 16px; }
.reader h3 { font-size: 17px; margin: 20px 0 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 12px 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }

/* ---------- magazines ---------- */
.mag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px 12px; }
.mag { display: flex; flex-direction: column; gap: 6px; }
.mag img { width: 100%; aspect-ratio: 0.72; object-fit: cover; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.mag span { font-size: 13px; color: var(--ink-2); }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 22, 0.42); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 22px calc(24px + var(--safe-b));
  max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-pop); animation: up 0.18s ease-out;
}
@media (min-width: 1024px) { .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 18px; animation: none; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
@media (min-width: 1024px) { .sheet .grab { display: none; } .sheet { padding-top: 22px; } }
.sheet h3 { font-size: 20px; margin: 0 0 8px; line-height: 1.35; }
.sheet .rows { margin: 14px 0 18px; }
.sheet .row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.sheet .row:first-child { border-top: 0; }
.sheet .row .k { color: var(--ink-3); }
.sheet .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; max-width: 90vw; }
@media (min-width: 1024px) { .toast { bottom: 24px; } }

.boot { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary-text); animation: spin 0.8s linear infinite; }
.spinner.sm { width: 13px; height: 13px; border-width: 2px; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 18px; }
.login { width: 100%; max-width: 400px; }
.login .brand { padding: 0 0 28px; }
.login .brand img { width: 52px; height: 52px; border-radius: 13px; }
.login .brand b { font-size: 24px; }
.login .brand span { font-size: 13.5px; }

.foot { text-align: center; color: var(--ink-3); font-size: 12px; margin: 28px 0 8px; }
.foot a { text-decoration: underline; }
@media (min-width: 1024px) { .foot { display: none; } }
@media (max-width: 600px) {
  .diary-day { grid-template-columns: 44px minmax(0, 1fr); gap: 0 10px; }
  .ev { grid-template-columns: 60px minmax(0, 1fr); gap: 8px; }
  .dd b { font-size: 24px; }
  .page-head h1 { font-size: 24px; }
}
