:root { --ink:#1b2a30; --muted:#66777c; --line:#e1e7e9; --bg:#f4f6f6; --card:#fff; --brand:#1f4e5f; --brand2:#2d6a7e; --ok:#2e7d4f; --okbg:#e3f3ea; --warn:#b3541e; --warnbg:#fbeae2; --wait:#8a6d1f; --waitbg:#f6f1e1; --accent:#e8f1f3; }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { margin:0; font:15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color:var(--ink); background:var(--bg); padding-bottom:calc(68px + env(safe-area-inset-bottom)); }
header { position:sticky; top:0; z-index:5; background:var(--brand); color:#fff; padding:calc(12px + env(safe-area-inset-top)) 16px 12px; display:flex; align-items:center; justify-content:space-between; gap:8px; }
header h1 { font-size:18px; margin:0; font-weight:600; }
header .back { background:none; color:#fff; padding:4px 8px 4px 0; font-size:22px; }
main { max-width:720px; margin:0 auto; padding:12px; }
h3 { margin:6px 0 10px; font-size:17px; }
h4 { margin:18px 4px 8px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-bottom:10px; }
.tap { cursor:pointer; }
.muted { color:var(--muted); } .small { font-size:12.5px; }
.mono { font-family:ui-monospace, Menlo, monospace; font-size:10.5px; word-break:break-all; color:var(--muted); }
button, .btn { font:inherit; border:0; border-radius:10px; padding:10px 14px; background:var(--brand); color:#fff; cursor:pointer; text-decoration:none; display:inline-block; text-align:center; }
button:disabled { opacity:.5; }
.ghost { background:var(--accent) !important; color:var(--brand) !important; }
.danger { background:var(--warnbg) !important; color:var(--warn) !important; }
.okbtn { background:var(--ok) !important; }
header button { background:rgba(255,255,255,.18); padding:7px 12px; }
input, textarea, select { font:inherit; width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fff; margin:3px 0 10px; color:var(--ink); }
input[type=checkbox] { width:auto; margin:0 6px 0 0; }
textarea { min-height:120px; resize:vertical; }
label { font-size:13px; color:var(--muted); display:block; }
.row { display:flex; gap:8px; align-items:center; }
.row > * { flex:1; min-width:0; }
.err { color:var(--warn); font-size:14px; min-height:1em; margin-bottom:6px; }
.hint { font-size:12.5px; color:var(--muted); background:var(--accent); border-radius:8px; padding:8px 10px; margin:4px 0 12px; }
#tabs { position:fixed; bottom:0; left:0; right:0; display:flex; background:#fff; border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); z-index:10; }
#tabs a { flex:1; color:var(--muted); text-decoration:none; padding:7px 0 9px; font-size:11px; display:flex; flex-direction:column; align-items:center; gap:1px; position:relative; }
#tabs a span { font-size:20px; line-height:1.1; }
#tabs a.on { color:var(--brand); font-weight:600; }
.badge { position:absolute; top:4px; left:calc(50% + 6px); background:var(--warn); color:#fff; font-style:normal; font-size:10px; min-width:16px; height:16px; border-radius:8px; padding:0 4px; line-height:16px; }
.pill { display:inline-block; font-size:11.5px; padding:2px 8px; border-radius:99px; background:var(--accent); color:var(--brand); white-space:nowrap; }
.pill.ok { background:var(--okbg); color:var(--ok); } .pill.wait { background:var(--waitbg); color:var(--wait); } .pill.bad { background:var(--warnbg); color:var(--warn); } .pill.grey { background:#eee; color:#666; }
.top { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.title { font-weight:600; }
.unread { border-left:4px solid var(--brand); }
.mine { background:#fbfcfc; }
.pre { white-space:pre-wrap; }
.stamps { display:grid; grid-template-columns:7.2em 1fr; gap:3px 12px; font-size:13px; color:var(--muted); margin:8px 0; }
.stamps b { font-weight:500; color:var(--ink); }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.big { padding:14px 8px; font-size:14px; line-height:1.2; }
.big small { display:block; font-size:11px; opacity:.85; margin-top:2px; }
.stat { text-align:center; } .stat b { display:block; font-size:20px; } .stat span { font-size:12px; color:var(--muted); }
.list-item { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px 0; border-top:1px solid var(--line); cursor:pointer; }
.list-item:first-child { border-top:0; }
.chev { color:var(--muted); }
.cal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.dow { font-size:11px; text-align:center; color:var(--muted); }
.day { aspect-ratio:1; background:#fff; border:1px solid var(--line); border-radius:8px; padding:3px; font-size:12px; cursor:pointer; overflow:hidden; }
.day.out { opacity:.35; } .day.today { border-color:var(--brand); font-weight:700; } .day.sel { background:var(--accent); }
.dots { display:flex; flex-wrap:wrap; gap:2px; margin-top:2px; } .dot { width:6px; height:6px; border-radius:50%; }
.c-parenting{background:#1f4e5f}.c-exchange{background:#7b4fa0}.c-school{background:#2e7d4f}.c-medical{background:#c0392b}.c-activity{background:#d68910}.c-holiday{background:#2471a3}.c-other{background:#888}
.ev { display:flex; gap:10px; } .ev .bar { width:4px; border-radius:2px; flex:0 0 4px; } .ev.cancelled { opacity:.5; } .ev.cancelled b { text-decoration:line-through; }
#sheet { position:fixed; inset:0; background:rgba(0,0,0,.38); z-index:20; display:flex; align-items:flex-end; justify-content:center; }
#sheet[hidden] { display:none; }
.sheet-body { background:#fff; width:100%; max-width:720px; max-height:92vh; overflow:auto; border-radius:16px 16px 0 0; padding:16px 16px calc(18px + env(safe-area-inset-bottom)); }
#toast { position:fixed; left:50%; transform:translateX(-50%); bottom:calc(80px + env(safe-area-inset-bottom)); background:#1b2a30; color:#fff; padding:10px 16px; border-radius:10px; z-index:30; font-size:14px; max-width:90vw; }
.ok { color:var(--ok); font-weight:600; } .bad { color:var(--warn); font-weight:600; }
.login { max-width:380px; margin:10vh auto; padding:0 16px; }
.empty { text-align:center; color:var(--muted); padding:24px 10px; }
.chips { display:flex; gap:6px; overflow-x:auto; padding-bottom:6px; margin-bottom:6px; }
.chips button { flex:0 0 auto; padding:6px 12px; font-size:13px; background:#fff; color:var(--ink); border:1px solid var(--line); }
.chips button.on { background:var(--brand); color:#fff; border-color:var(--brand); }
.kv { display:grid; grid-template-columns:7.2em 1fr; gap:4px 12px; font-size:14px; margin:8px 0; } .kv dt { color:var(--muted); } .kv dd { margin:0; white-space:pre-wrap; }
.menu button { display:block; width:100%; text-align:left; background:#fff; color:var(--ink); border-bottom:1px solid var(--line); border-radius:0; padding:13px 4px; }
.menu button small { display:block; color:var(--muted); font-size:12px; }
