/* Nannarone – Familienkalender */
:root {
  --paper: #f6f7f2; --surface: #fff; --sunk: #edf1eb;
  --ink: #182d26; --ink-2: #56675f; --line: #ccd5ce; --line-2: #e7ece7;
  --accent: #17553f; --accent-soft: #e0efe6; --on-accent: white;
  --today: #ffbc78; --on-today: #39200b; --danger: #ae3023;
  --rosa: #b83d73; --gruen: #08785e; --orange: #bf530d; --blau: #276cb4; --familie: #57549d;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hh: 46px; --chip: 21px; --radius: 12px; --nav-h: 0px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111815; --surface: #1a2420; --sunk: #131c18;
    --ink: #f3f6ef; --ink-2: #b4c3b9; --line: #405149; --line-2: #303d36;
    --accent: #a7e3bb; --accent-soft: #263f32; --on-accent: #102e21;
    --danger: #ff9988;
    --rosa: #f39abb; --gruen: #67d6b3; --orange: #ffac65; --blau: #87c6ff; --familie: #bcb5ff;
  }
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-text-size-adjust: 100%; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.boot { padding: 3rem 1.5rem; text-align: center; color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.c-rosa { --pc: var(--rosa); } .c-gruen { --pc: var(--gruen); } .c-orange { --pc: var(--orange); } .c-blau { --pc: var(--blau); } .c-familie { --pc: var(--familie); }

.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 720; letter-spacing: -.045em; }
.wordmark img { width: 38px; height: 38px; border-radius: 12px; }
h1, h2 { letter-spacing: -.035em; }

/* ---------- Bedienelemente ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: 0 .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { background: var(--accent-soft); }
.btn.danger { color: var(--danger); }
.btn.icon { padding: 0; width: 40px; }
.btn[disabled] { opacity: .5; cursor: default; }
.field { display: grid; gap: .3rem; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 42px; padding: .45rem .65rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.hint { font-size: 13px; color: var(--ink-2); }
.error { color: var(--danger); font-weight: 600; }
.error:empty { display: none; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px); padding: .6rem 1rem; background: var(--ink); color: var(--paper); border-radius: var(--radius); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.on { opacity: 1; }

/* ---------- Anmeldung / Einrichtung ---------- */
.gate { min-height: 100%; display: grid; place-items: center; padding: clamp(18px,4vw,64px); }
.gate-box { width: min(100%,1080px); display: grid; grid-template-columns: 46% minmax(0,1fr); overflow: hidden;
  background: var(--surface); border-radius: 30px; box-shadow: 0 20px 70px #11291916, 0 0 0 1px #73857921; }
.gate-head { background: #ffedbf url('/casa.webp') center 15% / cover no-repeat; color: #143928;
  text-align: center; min-height: 540px; padding-top: 4.4rem; }
.gate-head p { font-size: 12px; font-weight: 750; letter-spacing: .21em; text-transform: uppercase; }
.gate-head strong { display: block; font-size: clamp(42px,5.6vw,76px); line-height: 1.1; letter-spacing: -.072em; font-weight: 700; }
.gate form { align-self: center; display: grid; gap: 17px; padding: clamp(28px,4vw,60px); min-width: 0; }
.gate h1 { font-size: clamp(28px,3vw,38px); line-height: 1.1; letter-spacing: -.055em; }
.gate h1 + .hint { font-size: 15px; line-height: 1.55; margin-top: -7px; }
.gate .field, .passwords > * { min-width: 0; }
.gate .field > span, .profiles legend { color: var(--ink); font-size: 14px; font-weight: 600; }
.gate input:not([type=radio]) { min-width: 0; height: 46px; background: var(--paper); padding-inline: 13px; font-size: 16px; }
.gate .btn { min-height: 50px; margin-top: 3px; gap: 12px; font-size: 16px; }
.gate .btn.primary:hover { filter: brightness(.93); }
.login-link { color: var(--accent); font-size: 14px; }
.gate .btn .ic { width: 17px; }
.passwords, .who { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: start; }
.profiles { border: 0; padding: 0; margin: 0; min-width: 0; }
.profiles legend { padding: 0 0 7px; }
.who label { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; cursor: pointer; }
.who .check { margin-left: auto; visibility: hidden; }
.who input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.who label:hover { border-color: var(--pc); }
.who label:has(input:checked) { border-color: var(--pc); box-shadow: inset 0 0 0 1px var(--pc); background: color-mix(in srgb,var(--pc) 9%,var(--surface)); }
.who input:checked ~ .check { visibility: visible; }
.who label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 761px) and (max-height: 860px) {
  .gate { padding-block: 18px; }
  .gate form { padding-block: 30px; gap: 14px; }
  .gate-head { padding-top: 46px; }
}
@media (max-width: 950px) {
  .gate-box { grid-template-columns: 40% minmax(0,1fr); }
  .gate-head { background-size: cover; padding-top: 64px; }
}
@media (max-width: 760px) {
  .gate { padding: 0; background: var(--surface); align-items: start; }
  .gate-box { display: block; max-width: 560px; border-radius: 0; box-shadow: none; }
  .gate-head { min-height: 0; height: clamp(174px,48vw,245px); padding-top: 19px;
    background-size: cover; background-position: center 48%; text-align: left; padding-left: 6%; }
  .gate-head p { font-size: 10px; }
  .gate-head strong { font-size: 36px; }
  .gate form { padding: 26px clamp(18px,5vw,32px) calc(28px + env(safe-area-inset-bottom)); }
  .who label { padding: 6px 8px; gap: 7px; font-size: 14px; }
}
@media (max-width: 490px) { .passwords { grid-template-columns: 1fr; gap: 16px; } }
@media (max-width: 350px) { .who .check { display: none; } }

/* ---------- Gerüst ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100%; }
.side { display: flex; flex-direction: column; gap: 1.4rem; padding: 1.1rem 1rem 1rem; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: grid; gap: .35rem; text-decoration: none; color: inherit; border: 0; background: none; padding: 0; text-align: left; }
.brand small { font: 500 12px/1 var(--sans); color: var(--ink-2); margin: -9px 0 8px 48px; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: .65rem; min-height: 40px; padding: 0 .6rem; border: 0; border-radius: var(--radius); background: none; text-align: left; font-weight: 600; color: var(--ink-2); }
.nav button:hover { background: var(--accent-soft); color: var(--ink); }
.nav button[aria-current=page] { background: var(--accent-soft); color: var(--accent); }
.filter { display: grid; gap: 2px; }
.filter .label { padding: 0 .6rem .3rem; }
.filter button { display: flex; align-items: center; gap: .65rem; min-height: 36px; padding: 0 .6rem; border: 0; border-radius: var(--radius); background: none; text-align: left; }
.filter button:hover { background: var(--accent-soft); }
.filter button[aria-pressed=false] { color: var(--ink-2); text-decoration: line-through; }
.side-foot { margin-top: auto; display: grid; gap: 2px; }
.side-foot .me { display: flex; align-items: center; gap: .5rem; padding: 0 .6rem .4rem; font-size: 13px; color: var(--ink-2); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.top { display: flex; align-items: center; gap: .5rem; padding: .8rem 1.2rem; }
.top h1 { font: 700 1.7rem/1.1 var(--sans); margin-right: auto; display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.top h1 small { font: 600 13px/1 var(--sans); color: var(--ink-2); white-space: nowrap; }
.top .search { width: 210px; }
.mobile-brand, .tabbar, .fab, .filter-row { display: none; }
.content { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.content > * { flex: none; width: 100%; }

/* ---------- Monat ---------- */
.month { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; padding: 0 1.2rem 1.2rem; }
.wdays { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.wdays span { padding: 0 6px 5px; }
.weeks { flex: 1; display: grid; grid-auto-rows: 1fr; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); min-height: 0; }
.week { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 27px; grid-auto-rows: var(--chip); row-gap: 2px; border-top: 1px solid var(--line); padding-bottom: 3px; min-height: 0; }
.week:first-child { border-top: 0; }
.day { grid-row: 1 / -1; border: 0; border-left: 1px solid var(--line-2); background: none; padding: 0; text-align: left; display: block; position: relative; }
.day:first-child { border-left: 0; }
.day:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.day.other { background: var(--paper); }
.day.other .num { color: var(--ink-2); opacity: .7; }
.day.we:not(.other) { background: color-mix(in srgb, var(--paper) 55%, var(--surface)); }
.day .num { position: absolute; top: 3px; left: 4px; min-width: 22px; height: 22px; padding: 0 4px; display: grid; place-items: center; font-size: 13px; font-weight: 600; border-radius: 11px; }
.day.today .num { background: var(--today); color: var(--on-today); }
.day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.chip { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; min-width: 0; height: var(--chip); margin: 0 3px; padding: 0 5px; border: 0; border-radius: 4px; background: none; font-size: 12.5px; line-height: var(--chip); text-align: left; color: var(--ink); }
.chip:hover { background: color-mix(in srgb, var(--pc) 22%, var(--surface)); }
.chip.bar { background: color-mix(in srgb, var(--pc) 17%, var(--surface)); }
.chip.bar.cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.chip.bar.cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip .badges { display: inline-flex; gap: 1px; flex: none; }
.chip .stripe { display: none; flex: none; width: 3px; align-self: stretch; margin: 2px 0; border-radius: 2px; background: var(--pc); }
.chip time { color: var(--ink-2); flex: none; }
.chip .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.more { position: relative; z-index: 1; height: var(--chip); margin: 0 3px; padding: 0 5px; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: left; border-radius: 4px; }
.more:hover { background: var(--accent-soft); color: var(--ink); }
.daylist { display: none; }

/* ---------- Zeitraster (Woche, Wer wann wo) ---------- */
.tg { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; padding: 0 1.2rem 1.2rem; }
.tg-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.tg-head, .tg-allday, .tg-body { display: grid; grid-template-columns: 46px repeat(var(--cols), minmax(0, 1fr)); }
.tg-head { border-bottom: 1px solid var(--line); }
.tg-head button { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; border: 0; border-left: 1px solid var(--line-2); background: none; font-weight: 600; min-width: 0; }
.tg-head button:hover { background: var(--accent-soft); }
.tg-head .dnum { min-width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 13px; padding: 0 5px; }
.tg-head .today .dnum { background: var(--today); color: var(--on-today); }
.tg-head .wd { color: var(--ink-2); font-weight: 600; }
.tg-allday { border-bottom: 1px solid var(--line); }
.tg-allday > div { border-left: 1px solid var(--line-2); padding: 3px 0; display: grid; gap: 2px; align-content: start; min-height: 8px; min-width: 0; }
.tg-allday > div:first-child, .tg-head > span:first-child { border-left: 0; }
.tg-allday .gut { font-size: 11px; color: var(--ink-2); text-align: right; padding: 5px 6px 0 0; }
.tg-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.tg-body { position: relative; height: calc(24 * var(--hh)); }
.tg-hours { position: relative; }
.tg-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--ink-2); }
.tg-col { position: relative; border-left: 1px solid var(--line-2); background-image: linear-gradient(to bottom, var(--line-2) 1px, transparent 1px); background-size: 100% var(--hh); min-width: 0; }
.tg-col.we { background-color: color-mix(in srgb, var(--paper) 55%, var(--surface)); }
.tg-slot { position: absolute; inset: 0; border: 0; background: none; padding: 0; width: 100%; }
.blk { position: absolute; overflow: hidden; display: block; padding: 2px 5px 2px 8px; border: 0; border-radius: 4px; background: color-mix(in srgb, var(--pc) 18%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 45%, var(--surface)); text-align: left; font-size: 12.5px; line-height: 1.25; color: var(--ink); }
.blk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stripe, var(--pc)); }
.blk:hover { background: color-mix(in srgb, var(--pc) 28%, var(--surface)); z-index: 2; }
.blk b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.blk span { display: block; color: var(--ink-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--today); z-index: 3; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--today); }

/* ---------- Agenda / Listen / Einstellungen ---------- */
.page { max-width: 820px; margin: 0 auto; padding: 0 1.2rem 2rem; }
.ag-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: .25rem 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.ag-day:first-child { border-top: 0; }
.ag-date { font-weight: 600; line-height: 1.25; padding-top: .45rem; }
.ag-date small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.ag-date.today span { background: var(--today); color: var(--on-today); padding: 1px 7px; border-radius: 10px; margin-left: -7px; }
.ag-month { font: 700 1.15rem/1.2 var(--sans); padding: 1.3rem 0 .4rem; }
.ag-list { display: grid; gap: 4px; min-width: 0; }
.row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: .6rem; align-items: start; width: 100%; min-height: 44px; padding: .45rem .6rem; border: 0; border-radius: var(--radius); background: color-mix(in srgb, var(--pc) 9%, var(--surface)); text-align: left; position: relative; overflow: hidden; }
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stripe, var(--pc)); }
.row:hover { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.row time { color: var(--ink-2); font-size: 13.5px; padding-left: 4px; }
.row b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.row .meta { display: flex; flex-wrap: wrap; gap: .15rem .7rem; font-size: 13px; color: var(--ink-2); }
.row .meta span { display: inline-flex; align-items: center; gap: .3rem; }
.empty { padding: 2.2rem 0; color: var(--ink-2); text-align: center; }
.free { color: var(--ink-2); padding: .45rem 0; }
.center { display: flex; justify-content: center; padding: 1rem 0; }

.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; max-width: 980px; margin: 0 auto; padding: 0 1.2rem 2rem; }
.lists section, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.lists h2, .card h2 { font: 700 1.2rem/1.2 var(--sans); margin-bottom: .7rem; }
.addrow { display: flex; gap: .4rem; margin-bottom: .6rem; }
.todo { display: flex; align-items: center; gap: .3rem; min-height: 44px; border-top: 1px solid var(--line-2); }
.todo label { flex: 1; display: flex; align-items: center; gap: .65rem; min-height: 44px; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.todo input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.todo.done label { color: var(--ink-2); text-decoration: line-through; }
.todo .who-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; flex: none; }
.todo .who-btn:hover, .todo .del:hover { background: var(--accent-soft); }
.todo .del { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; color: var(--ink-2); flex: none; }
.cards { display: grid; gap: 1.2rem; max-width: 720px; margin: 0 auto; padding: 0 1.2rem 2rem; }
.card form, .card .stack { display: grid; gap: .8rem; }
.fam { display: flex; align-items: center; gap: .6rem; min-height: 46px; border-top: 1px solid var(--line-2); flex-wrap: wrap; padding: .3rem 0; }
.fam:first-of-type { border-top: 0; }
.fam .name { font-weight: 600; min-width: 84px; }
.fam .st { color: var(--ink-2); font-size: 13px; margin-right: auto; overflow-wrap: anywhere; }
.copy { display: flex; gap: .4rem; width: 100%; }
.copy input { font-size: 13px; }

/* ---------- Dialog ---------- */
dialog { border: 0; padding: 0; background: var(--surface); color: var(--ink); border-radius: 12px; width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); box-shadow: 0 18px 50px rgba(10, 16, 50, .35); }
dialog::backdrop { background: rgba(12, 18, 50, .45); }
dialog.small { width: min(400px, calc(100vw - 2rem)); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); }
.dlg-head { display: flex; align-items: flex-start; gap: .5rem; padding: 1rem 1rem .4rem 1.2rem; }
.dlg-head h2 { font: 700 1.4rem/1.2 var(--sans); margin-right: auto; padding-top: .3rem; overflow-wrap: anywhere; min-width: 0; }
.dlg-body { padding: .4rem 1.2rem 1rem; overflow-y: auto; display: grid; gap: .9rem; }
.dlg-foot { display: flex; gap: .5rem; justify-content: flex-end; padding: .8rem 1.2rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .5rem; }
.checks { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; font-weight: 600; cursor: pointer; }
.checks input { width: 20px; height: 20px; accent-color: var(--accent); }
.pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.pick button { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); font-weight: 600; }
.pick button[aria-pressed=true] { border-color: var(--pc); box-shadow: inset 0 0 0 1px var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--surface)); }
.facts { display: grid; gap: .55rem; }
.facts > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: .6rem; align-items: start; }
.facts svg.ic { color: var(--ink-2); margin-top: 1px; }
.facts .notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.tags span { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.comments { border-top: 1px solid var(--line); padding-top: .8rem; display: grid; gap: .6rem; }
.comments h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cmt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .5rem; padding: .45rem .7rem; border-radius: 8px; background: color-mix(in srgb, var(--pc) 10%, var(--surface)); }
.cmt .by { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: .35rem; }
.cmt p { grid-column: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt button { grid-row: 1 / span 2; grid-column: 2; align-self: center; width: 32px; height: 32px; border: 0; background: none; color: var(--ink-2); border-radius: 50%; display: grid; place-items: center; }
.cmt button:hover { background: var(--accent-soft); }
.choice { display: grid; gap: .5rem; }
.choice .btn { justify-content: flex-start; min-height: 46px; }

/* ---------- Telefon ---------- */
@media (max-width: 899px) {
  :root { --chip: 15px; --nav-h: 58px; --hh: 44px; }
  .shell { display: block; }
  .side { display: none; }
  .main { height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .mobile-brand { display: flex; align-items: center; justify-content: space-between; padding: .55rem .75rem .1rem; padding-top: calc(.55rem + env(safe-area-inset-top)); }
  .mobile-brand .wordmark { font-size: 19px; }
  .mobile-brand .btn { min-height: 44px; width: 44px; }
  .top { padding: .3rem .75rem .5rem; gap: .2rem; }
  .top h1 { font-size: 1.3rem; flex-wrap: wrap; gap: 0 .5rem; }
  .top .search, .top .new { display: none; }
  .top .btn { min-height: 44px; }
  .top .btn.icon { width: 44px; }
  .filter-row { display: flex; gap: .4rem; overflow-x: auto; padding: 0 .75rem .55rem; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row button { display: inline-flex; align-items: center; gap: .4rem; flex: none; min-height: 34px; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); font-size: 13.5px; font-weight: 600; }
  .filter-row button[aria-pressed=false] { color: var(--ink-2); text-decoration: line-through; background: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar button { display: grid; place-items: center; align-content: center; gap: 2px; border: 0; background: none; font-size: 11px; font-weight: 600; color: var(--ink-2); min-width: 0; }
  .tabbar button[aria-current=page] { color: var(--accent); }
  .tabbar button[aria-current=page] svg { stroke-width: 2.3; }
  .fab { display: grid; place-items: center; position: fixed; right: 14px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 21; width: 56px; height: 56px; border: 0; border-radius: 16px; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px rgba(10, 16, 50, .35); }
  .fab svg.ic { width: 26px; height: 26px; }
  .month { padding: 0; flex: none; }
  .wdays span { text-align: center; padding: 0 0 4px; }
  .weeks { flex: none; border-radius: 0; border-left: 0; border-right: 0; grid-auto-rows: auto; }
  .week { grid-template-rows: 26px; row-gap: 1px; padding-bottom: 2px; min-height: 80px; }
  .day .num { left: 50%; transform: translateX(-50%); top: 2px; }
  .chip { margin: 0 1px; padding: 0 2px; gap: 2px; font-size: 10px; border-radius: 3px; pointer-events: none; }
  .chip time, .chip .badges .person-emoji:not(:first-child) { display: none; }
  .chip .badges .person-emoji { font-size: 11px; }
  .chip .stripe { display: block; margin: 1px 0; }
  .chip.bar .stripe { display: none; }
  .chip .t { text-overflow: clip; }
  .more { margin: 0 1px; padding: 0 2px; font-size: 10px; pointer-events: none; text-align: center; }
  .daylist { display: block; padding: .8rem .75rem 5.5rem; }
  .daylist h2 { font: 700 1.1rem/1.2 var(--sans); margin-bottom: .5rem; }
  .tg { padding: 0; }
  .tg-frame { border-radius: 0; border-left: 0; border-right: 0; }
  .tg-head, .tg-allday, .tg-body { grid-template-columns: 34px repeat(var(--cols), minmax(0, 1fr)); }
  .tg-head button { flex-direction: column; gap: 1px; font-size: 12.5px; padding: 3px 0; }
  .tg-hours span { right: 4px; font-size: 10px; }
  .blk { padding: 2px 3px 2px 7px; font-size: 11.5px; }
  .page { padding: 0 .75rem 6rem; }
  .ag-day { grid-template-columns: 62px minmax(0, 1fr); gap: .25rem .5rem; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .row time { padding-left: 4px; }
  .lists { grid-template-columns: 1fr; gap: 1rem; padding: 0 .75rem 6rem; }
  .cards { padding: 0 .75rem 6rem; }
  dialog, dialog.small { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  dialog:not(.small) { height: 100dvh; border-radius: 0; }
  .dlg { max-height: 100dvh; height: 100%; }
  .dlg-body { flex: 1; }
  .dlg-foot { padding-bottom: calc(.8rem + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { min-height: 46px; }
  input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea { font-size: 16px; min-height: 46px; }
}
@media (max-width: 380px) { .top h1 { font-size: 1.15rem; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[hidden] { display: none !important; }

.person-emoji, .emoji-grid button, .emoji-card input[name=emoji] {
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-weight: 400;
}
.person-emoji { display: inline-block; font-size: 1.22em; line-height: 1; flex: none; }
.blk .person-emoji { display: inline; font-size: 1em; }
.chip .person-emoji { font-size: 14px; }
button[aria-pressed=false] .person-emoji { opacity: .55; filter: grayscale(.8); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(46px,1fr)); gap: 6px; }
.emoji-grid button { font-size: 25px; min-height: 48px; border: 1px solid transparent; border-radius: 12px; background: var(--paper); }
.emoji-grid button:hover { border-color: var(--accent); }
.emoji-grid button[aria-pressed=true] { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.emoji-card input[name=emoji] { font-size: 28px; text-align: center; width: 100%; }
.emoji-card .primary { min-height: 46px; }
