/* Physio-Portal – ruhiges, flaches Design in #2b4a66 */
:root {
  --brand: #2b4a66; --brand-2: #223c54; --brand-soft: #e9eef3;
  --bg: #f3f5f7; --surface: #fff; --surface-2: #f0f3f6; --text: #16212c; --muted: #5b6876; --faint: #8a96a3; --line: #e3e7ec;
  --ok: #2f8a4c; --ok-soft: #e3f3e8; --ok-ink: #1d6b3a;
  --bad: #c2412d; --bad-soft: #fbe4e0; --bad-ink: #a33224;
  --warn: #d48a12; --warn-soft: #fdf1dc; --warn-ink: #8a5200;
  --info: #2f6fa8; --info-soft: #e4eff9; --info-ink: #1f5689;
  --priv: #7a4fb0; --priv-soft: #efe7f8; --priv-ink: #5f3a8f;
  --radius: 14px; --shadow: 0 1px 2px rgba(22, 33, 44, .05); --shadow-lg: 0 24px 60px -18px rgba(22, 33, 44, .35);
  --side-w: 248px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f161e; --surface: #17212c; --surface-2: #1f2b38; --text: #e6edf3; --muted: #9eabb8; --faint: #6f7d8b; --line: rgba(255,255,255,.08);
  --brand-soft: rgba(127,166,201,.16);
  --ok-soft: rgba(47,138,76,.2); --ok-ink: #7fd69b; --bad-soft: rgba(194,65,45,.22); --bad-ink: #ff9b8a;
  --warn-soft: rgba(212,138,18,.2); --warn-ink: #ffc76b; --info-soft: rgba(80,150,210,.2); --info-ink: #9cc8ef;
  --priv-soft: rgba(150,100,210,.22); --priv-ink: #cfb2f2; --shadow: 0 1px 2px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] {
  --bg: #0f161e; --surface: #17212c; --surface-2: #1f2b38; --text: #e6edf3; --muted: #9eabb8; --faint: #6f7d8b; --line: rgba(255,255,255,.08);
  --brand-soft: rgba(127,166,201,.16);
  --ok-soft: rgba(47,138,76,.2); --ok-ink: #7fd69b; --bad-soft: rgba(194,65,45,.22); --bad-ink: #ff9b8a;
  --warn-soft: rgba(212,138,18,.2); --warn-ink: #ffc76b; --info-soft: rgba(80,150,210,.2); --info-ink: #9cc8ef;
  --priv-soft: rgba(150,100,210,.22); --priv-ink: #cfb2f2; --shadow: 0 1px 2px rgba(0,0,0,.35);
  color-scheme: dark;
} }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 16px; margin: 0; font-weight: 650; }
h3 { font-size: 14px; margin: 0; font-weight: 650; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.boot { padding: 40px; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--brand); color: #fff; display: flex; flex-direction: column; padding: 18px 14px; z-index: 30; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.side .logo img { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12); }
.side .logo b { display: block; font-size: 15px; }
.side .logo span { font-size: 12px; opacity: .65; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .5; padding: 16px 10px 6px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: rgba(255,255,255,.82); font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side nav a.on { background: rgba(255,255,255,.16); color: #fff; }
.side nav a svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.side nav a .cnt { margin-left: auto; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side .foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.side .foot .av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side .foot .who { min-width: 0; flex: 1; font-size: 13px; }
.side .foot .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .foot .who span { opacity: .6; font-size: 12px; }
.side .foot button { background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; padding: 6px; border-radius: 8px; }
.side .foot button:hover { background: rgba(255,255,255,.1); color: #fff; }
.side .foot svg { width: 18px; height: 18px; display: block; }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; }
.page { max-width: 1440px; margin: 0 auto; padding: 30px 34px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.page-head .eyebrow a:hover { color: var(--text); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mtop { display: none; }
.tabbar { display: none; }

/* ---------- Elemente ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; }
.card-b { padding: 0 18px 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.g-res { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 550; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
:root[data-theme="dark"] .btn-primary { background: #3d6a92; border-color: #3d6a92; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.9); background: var(--ok); }
.btn-bad { color: var(--bad-ink); }
.btn-bad:hover { background: var(--bad-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: none; }
.icon-btn { border: 0; background: none; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-soft); color: var(--ok-ink); }
.b-warn { background: var(--warn-soft); color: var(--warn-ink); }
.b-bad { background: var(--bad-soft); color: var(--bad-ink); }
.b-info { background: var(--info-soft); color: var(--info-ink); }
.b-priv { background: var(--priv-soft); color: var(--priv-ink); }
.b-rx { background: var(--brand-soft); color: var(--info-ink); }
.type { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); background: var(--surface); letter-spacing: .01em; }
.days { display: inline-flex; gap: 3px; }
.days i { font-style: normal; font-size: 11px; font-weight: 700; width: 24px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--faint); }
.days i.on { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .days i.on { background: #3d6a92; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.stat { padding: 16px 18px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; background: var(--brand); color: #fff; }
.stat:first-child .lbl, .stat:first-child .sub { color: rgba(255,255,255,.75); }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat .val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat .sub { font-size: 12.5px; color: var(--faint); }
.stat.alert .val { color: var(--warn); }

/* Listen */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; }
.row .s { font-size: 13px; color: var(--muted); }
a.row:hover .t { text-decoration: underline; }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.home-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.home-tag::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--hc, var(--brand)); }

/* Heute-Liste */
.today-home { margin-top: 10px; }
.today-home:first-child { margin-top: 0; }
.today-home > h3 { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; color: var(--muted); }
.today-home > h3::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--hc); }
.check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; flex: none; color: transparent; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.check svg { width: 16px; height: 16px; }
.check:disabled { cursor: default; opacity: .4; }

/* Heime */
.homes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.home-card { position: relative; overflow: hidden; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s; }
.home-card:hover { border-color: color-mix(in srgb, var(--hc) 50%, var(--line)); }
.home-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--hc); }
.home-card .addr { font-size: 13px; color: var(--muted); }
.home-card .nums { display: flex; gap: 18px; margin-top: 4px; }
.home-card .nums div { font-size: 12.5px; color: var(--muted); }
.home-card .nums b { display: block; font-size: 20px; color: var(--text); }
.home-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; flex-wrap: wrap; }

/* Tabelle */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.inactive td { opacity: .55; }
.tbl .name { font-weight: 600; }
.prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); } .bar.info > i { background: var(--info); }

/* Filter */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 18px 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 12px; min-width: 200px; }

/* Bewohner */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rx-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.rx-big { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.rx-big b { font-size: 34px; letter-spacing: -.02em; line-height: 1; }
.rx-big span { color: var(--muted); }
.rx-units { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 4px; }
.rx-units i { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.rx-units i.used { background: var(--ok); border-color: var(--ok); }
.rx-units i.warnz { border-color: var(--warn); border-style: dashed; }
.hint { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-top: 12px; }
.hint svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.hint.warn { background: var(--warn-soft); color: var(--warn-ink); }
.hint.bad { background: var(--bad-soft); color: var(--bad-ink); }
.hint.info { background: var(--info-soft); color: var(--info-ink); }
.hint.priv { background: var(--priv-soft); color: var(--priv-ink); }
.hint .grow { flex: 1; }
.hint .btn { margin-top: 8px; }
.tr-row .date { font-weight: 600; width: 92px; flex: none; }

/* Wochenplan */
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav .lbl { font-weight: 600; min-width: 190px; text-align: center; }
.week { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 12px; align-items: start; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 160px; }
.day-h { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.day-h b { font-size: 15px; } .day-h span { font-size: 12.5px; color: var(--muted); }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.day.today .day-h { background: var(--brand); color: #fff; } .day.today .day-h span { color: rgba(255,255,255,.8); }
.day-b { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.slot { border-radius: 10px; background: color-mix(in srgb, var(--hc) 9%, var(--surface)); border-left: 4px solid var(--hc); padding: 8px 8px 6px 10px; }
.slot-h { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.slot-h span { font-weight: 500; color: var(--muted); }
.pers { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px dashed color-mix(in srgb, var(--hc) 25%, var(--line)); }
.pers:first-of-type { border-top: 0; }
.pers .grow { flex: 1; min-width: 0; }
.pers .n { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.pers .n:hover { text-decoration: underline; }
.pers .m { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pers .check { width: 26px; height: 26px; }
.pers .check svg { width: 14px; height: 14px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.s-ok { background: var(--ok); } .s-warn { background: var(--warn); } .s-bad { background: var(--bad); } .s-info { background: var(--info); } .s-priv { background: var(--priv); }
.day-tabs { display: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Formulare / Fenster */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 22, 30, .45); z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 600px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-h { padding: 18px 22px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-h h2 { font-size: 18px; }
.modal-b { padding: 4px 22px 18px; overflow-y: auto; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.fields .full { grid-column: 1 / -1; }
.field label, .lbl-t { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 76px; }
input[type=color] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--surface); cursor: pointer; }
.section-t { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 6px 11px; cursor: pointer; font-weight: 600; font-size: 13px; }
.pick button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .pick button.on { background: #3d6a92; border-color: #3d6a92; }
.pick.payer button.on[data-v=privat] { background: var(--priv); border-color: var(--priv); }
.pick.colors button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 3px solid transparent; }
.pick.colors button.on { border-color: var(--text); }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input[type=number] { width: 90px; }
.err { color: var(--bad-ink); font-size: 13.5px; margin-top: 10px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }

/* Hinweis-Meldung (Toast) */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #16212c; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: tin .2s ease; }
.toast.bad { background: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--brand); }
.auth-card { background: var(--surface); width: 100%; max-width: 400px; border-radius: 20px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card .logo { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.auth-card .logo img { width: 44px; height: 44px; }
.auth-card .logo b { font-size: 18px; display: block; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .btn { padding: 11px; }

/* Einstellungen */
.type-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; margin-bottom: 8px; }

/* ---------- Druck ---------- */
#print-root { display: none; }
@media print {
  body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; color: #000; font: 11pt/1.4 Arial, sans-serif; }
  @page { size: A4; margin: 14mm; }
  .p-h { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #2b4a66; padding-bottom: 8px; margin-bottom: 14px; }
  .p-h h1 { font-size: 18pt; }
  .p-tbl { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .p-tbl th { text-align: left; background: #eef2f5; padding: 6px; border: 1px solid #ccd5dd; }
  .p-tbl td { padding: 6px; border: 1px solid #ccd5dd; vertical-align: top; }
  .p-home { margin: 16px 0 6px; font-size: 12pt; font-weight: 700; }
  .p-foot { margin-top: 18px; font-size: 9pt; color: #555; }
}

/* ---------- Tablet / Handy ---------- */
@media (max-width: 1180px) {
  .g-main, .g-res { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  body.side-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .main { margin-left: 0; padding-bottom: 70px; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .mtop button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; }
  .mtop svg { width: 24px; height: 24px; display: block; }
  .mtop b { font-size: 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; padding: 8px 0 7px; color: var(--muted); font-weight: 600; position: relative; }
  .tabbar a.on { color: var(--brand); }
  :root[data-theme="dark"] .tabbar a.on { color: #9cc8ef; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .cnt { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--warn); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 99px; }
  .page { padding: 18px 14px 40px; }
  h1 { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .g2 { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .week { grid-template-columns: 1fr; }
  .week .day:not(.sel) { display: none; }
  .day-tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
  .day-tabs button { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 4px; cursor: pointer; font-weight: 600; font-size: 13px; min-width: 50px; }
  .day-tabs button small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
  .day-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
  .day-tabs button.on small { color: rgba(255,255,255,.8); }
  .day-tabs button.today:not(.on) { border-color: var(--brand); }
  .week-nav .lbl { min-width: 0; font-size: 14px; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .hide-m { display: none !important; }
  .tbl .hide-t { display: none; }
  .search { min-width: 0; flex: 1; }
  .type-row { grid-template-columns: 90px 1fr auto; }
}
