/* CIS Enhanced - mobile Ansicht.
   Eigene Schicht über style.css, aktiv nur über das media-Attribut in base.html.
   m-only = gibt es nur hier, d-only = gibt es nur am Desktop. */

:root {
  --m-bar: 58px;
  --m-tabs: 60px;
  --m-pad: 14px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --navy: #083f6b;
  --gold: #e9b949;
  --bg: #eef2f7;
  --muted: #56657a;
  --line: #e3e9f1;
  --lift: 0 1px 2px rgba(8, 63, 107, .06), 0 8px 24px -8px rgba(8, 63, 107, .14);
}
@view-transition { navigation: auto; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; min-height: 100dvh;
  padding-bottom: calc(var(--m-tabs) + var(--sb) + 12px);
  -webkit-tap-highlight-color: transparent;
}
[hidden], .d-only, .topbar, .footer, .page-title, .js-filter { display: none !important; }
a:hover { text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid #6bb0e6; outline-offset: 2px; }
.i {
  width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block;
}
main.container {
  max-width: 680px; min-height: 0;
  padding: var(--m-pad) calc(var(--m-pad) + var(--sr)) 20px calc(var(--m-pad) + var(--sl));
}

/* ---------- Ladebalken: in der App fehlt die Browser-Anzeige ---------- */
.m-progress {
  position: fixed; inset: 0 0 auto; height: 3px; z-index: 90; pointer-events: none;
  display: block; opacity: 0; background: var(--gold); transform-origin: left; transform: scaleX(0);
}
.m-loading .m-progress { opacity: 1; animation: m-load 9s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes m-load { to { transform: scaleX(.94); } }

/* ---------- Kopfzeile ---------- */
.m-bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 4px;
  min-height: calc(var(--m-bar) + var(--st));
  padding: var(--st) calc(6px + var(--sr)) 0 calc(var(--m-pad) + var(--sl));
  background: var(--navy); color: #fff; view-transition-name: m-bar;
}
.m-bar > .m-ib:first-child { margin-left: -10px; }
.m-bar-text { flex: 1; min-width: 0; }
.m-bar-title, .m-bar-sub { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-bar-title { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
.m-bar-sub { font-size: 13px; line-height: 1.3; color: rgba(255, 255, 255, .78); }
.m-bar-actions { display: flex; align-items: center; }
.m-bar-actions form { margin: 0; }
.m-ib {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; flex: none;
  border-radius: 14px; background: none; color: inherit; cursor: pointer;
}
.m-ib:active { background: rgba(255, 255, 255, .16); }
.m-ib-star .i { fill: var(--gold); stroke: var(--gold); }
.m-ib-text { width: auto; padding: 0 12px; font-size: 15px; font-weight: 600; }
.m-bar :focus-visible, .m-cal :focus-visible { outline-color: #fff; }

/* ---------- Tableiste ---------- */
.m-tabs {
  position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--m-tabs) + var(--sb)); padding: 0 var(--sr) var(--sb) var(--sl);
  background: rgba(255, 255, 255, .95); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); view-transition-name: m-tabs;
}
.m-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: -.01em;
}
.m-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.m-tab .i { width: 50px; height: 28px; padding: 3px 0; border-radius: 14px; transition: background .2s; }
.m-tab.on { color: var(--navy); }
.m-tab.on .i { background: #d9e8f5; }
.m-tab:active .i { background: #e8eff6; }

/* ---------- Karten, Formulare, Knöpfe ---------- */
.card { border: 0; border-radius: 20px; padding: 18px; box-shadow: var(--lift); }
.card + .card { margin-top: 14px; }
.card h2 { font-size: 18px; letter-spacing: -.01em; }
.m-flat { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.m-flat > h2 { margin: 2px 2px 12px; font-size: 16px; }
.hint { font-size: 14.5px; line-height: 1.5; }
.form-row { gap: 14px; flex-direction: column; align-items: stretch; }
.field { gap: 6px; }
.field label { font-size: 13px; text-transform: none; letter-spacing: 0; }
.field input, .field select, .login-form .field input {
  width: 100%; min-width: 0; min-height: 50px; padding: 0 14px; font-size: 16px;   /* <16px zoomt iOS */
  border: 1px solid #cfd9e5; border-radius: 14px; background-color: #fff; color: var(--ink);
}
.field input[type=file] { padding: 12px 14px; }
.field input:focus, .field select:focus { outline: 3px solid #cfe4f6; border-color: var(--blue); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 0 18px; border-radius: 14px; font-size: 16px; border-color: #cfd9e5; transition: transform .12s;
}
.btn-primary { border-color: var(--blue); }
.btn:active { transform: scale(.98); }
.btn-sm { min-height: 40px; font-size: 15px; padding: 0 14px; }
.badge { font-size: 12.5px; }
.empty { padding: 28px 12px; }

/* ---------- Bodenblätter ---------- */
dialog.m-sheet {
  position: fixed; inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 560px;
  max-height: min(88dvh, 88vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 0 18px calc(18px + var(--sb)); border: 0; border-radius: 26px 26px 0 0;
  background: #fff; color: var(--ink); box-shadow: 0 -12px 50px rgba(6, 32, 56, .28);
}
.m-grab:focus { outline: 0; }
dialog.m-sheet[open], .modal-back.open .modal { animation: m-up .26s cubic-bezier(.2, .8, .2, 1); }
dialog.m-sheet::backdrop { background: rgba(6, 32, 56, .5); animation: m-fade .2s; }
@keyframes m-up { from { transform: translateY(60%); opacity: .4; } }
@keyframes m-fade { from { opacity: 0; } }
.m-grab { position: sticky; top: 0; z-index: 2; display: block; height: 30px; margin: 0 -18px; background: inherit; touch-action: none; }
.m-grab::before {
  content: ""; position: absolute; left: 50%; top: 10px; width: 40px; height: 5px;
  margin-left: -20px; border-radius: 3px; background: #cdd7e3;
}
.m-sheet h2 { margin: 2px 0 16px; font-size: 21px; letter-spacing: -.015em; }
.m-sheet .form-row { margin-bottom: 4px; }
.m-sheet .btn-primary { min-height: 52px; margin-top: 4px; }
.m-dec { margin: -4px 0 0 !important; padding: 6px 12px; border-radius: 12px; line-height: 1.4; }
.m-menu { list-style: none; margin: 0 0 12px; padding: 4px 0; background: #f3f6fa; border-radius: 18px; }
.m-menu li + li { border-top: 1px solid #e4eaf2; margin-left: 54px; }
.m-menu a, .m-menu button, .m-menu-note {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 54px; margin: 0; padding: 0 16px;
  border: 0; background: none; color: var(--ink); font-size: 16.5px; font-weight: 500; text-align: left; cursor: pointer;
}
.m-menu li + li > *, .m-menu li + li > form > button { margin-left: -54px; width: calc(100% + 54px); }
.m-menu form { margin: 0; }
.m-menu li + li > form { width: 100%; margin-left: 0; }
.m-menu .i { color: var(--blue); }
.m-menu a:active, .m-menu button:active { background: #e6edf5; border-radius: 16px; }
.m-menu .m-danger, .m-menu .m-danger .i { color: var(--red); }
.m-menu-note { padding: 12px 16px; font-size: 15px; line-height: 1.4; cursor: default; }
.m-who-am { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.m-who-am span { min-width: 0; overflow-wrap: anywhere; }
.m-who-am b { color: var(--ink); }
.m-source { margin: 4px 2px 0; font-size: 13px; color: var(--muted); }
.m-dl { margin: 0 0 14px; }
.m-dl div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.m-dl div:last-child { border: 0; }
.m-dl dt { color: var(--muted); font-size: 14.5px; flex: none; }
.m-dl dd { margin: 0; font-weight: 600; font-size: 15px; text-align: right; overflow-wrap: anywhere; }

/* Vorschläge im Suchblatt: im Fluss statt schwebend, sonst schneidet das Blatt sie ab */
.suggest { position: static; box-shadow: none; border-radius: 16px; margin-top: 2px; }
.suggest a { min-height: 50px; padding: 8px 14px; font-size: 15.5px; white-space: normal; border-top: 1px solid var(--line); }
.suggest a:first-child { border-top: 0; }
.suggest a .mono { font-size: 13px; flex: none; }

/* ---------- Anmelden / Offline ---------- */
body.m-plain { padding: 0; background: linear-gradient(#0e548c, #063054 60%) fixed; }
.m-plain main.container { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding-top: calc(24px + var(--st)); padding-bottom: calc(28px + var(--sb)); }
.m-hero { display: block; text-align: center; color: #fff; margin-bottom: 24px; }
.m-hero img { border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.m-hero p { margin: 0; }
.m-hero-name { font-size: 27px; font-weight: 750; letter-spacing: -.02em; margin-top: 12px !important; }
.m-hero-sub { color: rgba(255, 255, 255, .8); font-size: 15px; }
.login-wrap { padding: 0; }
.login-card { max-width: 440px; border: 0; padding: 24px 22px 20px; border-radius: 26px; box-shadow: 0 24px 60px rgba(0, 16, 34, .4); }
.login-title { font-size: 23px; letter-spacing: -.015em; }
.login-sub { font-size: 15px; margin-bottom: 18px; }
.login-submit { min-height: 52px; font-size: 16.5px; }
.login-note { font-size: 13px; color: var(--muted); }
.offline { color: #fff; }
.offline p { color: rgba(255, 255, 255, .84); }
.offline .btn { background: #fff; color: var(--navy); border-color: #fff; }

/* ---------- Start ---------- */
.m-home { display: block; }
.m-cta {
  display: flex; align-items: center; gap: 16px; padding: 20px 18px; border-radius: 22px; color: #fff;
  background: linear-gradient(140deg, #0f5f9e, #083f6b 70%); box-shadow: 0 14px 30px -12px rgba(8, 63, 107, .6);
}
.m-cta > span { flex: 1; min-width: 0; font-size: 14.5px; color: rgba(255, 255, 255, .82); }
.m-cta b { display: block; font-size: 20px; letter-spacing: -.015em; color: #fff; }
.m-cta > .i:first-child { width: 30px; height: 30px; }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.m-tiles a { background: #fff; border-radius: 20px; padding: 16px; box-shadow: var(--lift); color: var(--ink); }
.m-tiles .i { width: 26px; height: 26px; color: var(--blue); margin-bottom: 22px; }
.m-tiles b { display: block; font-size: 16.5px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.m-tiles span { color: var(--muted); font-size: 13.5px; }
.m-cta:active, .m-tiles a:active { transform: scale(.985); }
.m-install {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 14px; padding: 14px 16px; text-align: left;
  border: 1px dashed #a9c4dc; border-radius: 18px; background: #f6fafd; color: var(--muted); font-size: 14px;
}
.m-install .i { color: var(--blue); }
.m-install b { display: block; color: var(--ink); font-size: 15.5px; }
.decoder-result.card { padding: 12px; border-radius: 16px; }
.kv { grid-template-columns: 1fr 1fr; }
.kv .item { border-radius: 14px; padding: 10px 12px; min-width: 0; }
.kv .item .k { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.kv .item .v { overflow-wrap: anywhere; }
.kv .item .btn { width: 100%; padding: 0 8px; white-space: nowrap; }

/* ---------- Plan ---------- */
.m-plan { display: block; }
.m-cal {
  position: sticky; top: calc(var(--m-bar) + var(--st) - 1px); z-index: 30; background: var(--navy); color: #fff;
  margin: calc(-1 * var(--m-pad) - 1px) calc(-1 * (var(--m-pad) + var(--sr))) 0 calc(-1 * (var(--m-pad) + var(--sl)));
  padding: 0 calc(8px + var(--sr)) 10px calc(8px + var(--sl)); border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 24px -14px rgba(8, 63, 107, .8);
}
.m-cal.off { display: none; }
.m-week { display: flex; align-items: center; }
.m-week-text { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; font-variant-numeric: tabular-nums; }
.m-week-text b { font-size: 16px; }
.m-week-text span { font-size: 13.5px; color: rgba(255, 255, 255, .78); white-space: nowrap; }
.m-today {
  min-height: 34px; margin: 0 6px 0 2px; padding: 0 13px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 12px;
  background: none; color: #fff; font-size: 14px; font-weight: 600; position: relative;
}
.m-today::after { content: ""; position: absolute; inset: -6px; }
.m-today:active { background: rgba(255, 255, 255, .16); }
.m-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.m-day {
  display: flex; flex-direction: column; align-items: center; min-height: 58px; padding: 6px 0 5px; border: 0; border-radius: 16px;
  background: none; color: #fff; font-variant-numeric: tabular-nums;
}
.m-day span { font-size: 12px; color: rgba(255, 255, 255, .76); }
.m-day b { font-size: 17px; line-height: 1.25; }
.m-day.we b { color: rgba(255, 255, 255, .72); font-weight: 600; }
.m-day.today b { color: var(--gold); }
.m-day i { display: flex; gap: 3px; height: 6px; margin-top: 3px; }
.m-day i u { width: 6px; height: 6px; border-radius: 3px; background: currentColor; opacity: .85; }
.m-day.on { background: #fff; color: var(--navy); }
.m-day.on span { color: var(--muted); }
.m-day.on b, .m-day.on.we b { color: var(--navy); font-weight: 750; }
.m-day.on.today b { color: #a36a00; }

.m-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 14px 0; padding: 4px; border-radius: 16px; background: #dde6f0; }
.m-seg button {
  min-height: 40px; border: 0; border-radius: 12px; background: none; color: #43546a; font-size: 15px; font-weight: 600;
}
.m-seg button[aria-pressed=true] { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(8, 63, 107, .18); }
.m-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--m-pad)) 12px; padding: 2px var(--m-pad); scrollbar-width: none; }
.m-chips::-webkit-scrollbar { display: none; }
.m-chips button {
  flex: none; min-height: 40px; padding: 0 15px; border: 1px solid #cbd7e4; border-radius: 13px; background: #fff;
  color: #43546a; font-size: 14.5px; font-weight: 600;
}
.m-chips button[aria-pressed=true] { background: var(--navy); border-color: var(--navy); color: #fff; }

.m-view { display: block; touch-action: pan-y pinch-zoom; min-height: 40dvh; }
.m-view.in { animation: m-in .22s cubic-bezier(.2, .8, .2, 1); }
.m-view.in-l { --from: 22px; } .m-view.in-r { --from: -22px; }
@keyframes m-in { from { opacity: 0; transform: translateX(var(--from, 0)); } }
.m-dayhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin: 2px 2px 10px; }
.m-dayhead h2 { margin: 0; font-size: 18px; letter-spacing: -.015em; }
.m-dayhead span { color: var(--muted); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-dayhead.today h2::after { content: "heute"; margin-left: 8px; padding: 2px 8px; border-radius: 8px; background: #fbeccb; color: #7a5200; font-size: 12px; letter-spacing: 0; vertical-align: 2px; }

.m-ev {
  position: relative; display: grid; grid-template-columns: 54px 1fr; gap: 14px; width: 100%; padding: 14px 16px 14px 14px;
  border: 0; border-radius: 18px; background: #fff; box-shadow: var(--lift); color: var(--ink); text-align: left; overflow: hidden;
}
.m-ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.m-ev + .m-ev { margin-top: 10px; }
.m-ev:active { transform: scale(.985); }
.m-ev-time { display: flex; flex-direction: column; padding-left: 4px; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); }
.m-ev-time b { font-size: 16px; color: var(--ink); }
.m-ev-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.m-ev-lv { font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.m-ev-meta { display: flex; align-items: flex-start; gap: 6px; font-size: 14.5px; color: var(--muted); overflow-wrap: anywhere; }
.m-ev-meta .i { width: 17px; height: 17px; margin-top: 2px; }
.m-ev-room { color: var(--ink); font-weight: 600; }
.m-ev.past { box-shadow: none; background: #f8fafc; }
.m-ev.past .m-ev-lv, .m-ev.past .m-ev-time b, .m-ev.past .m-ev-room { color: #5b6a7e; font-weight: 600; }
.m-ev.past::before { opacity: .45; }
.m-ev.now { box-shadow: 0 0 0 2px var(--blue), var(--lift); }
.m-ev-now { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 13.5px; font-weight: 700; color: var(--green); }
.m-ev-now::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--green); animation: m-pulse 1.8s infinite; }
@keyframes m-pulse { 50% { opacity: .35; } }
.m-meter { display: block; height: 5px; margin-top: 6px; border-radius: 3px; background: #e3eaf2; overflow: hidden; }
.m-meter i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--blue)); }
.m-past { margin-bottom: 10px; }
.m-past summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none;
  border: 1px dashed #c6d3e0; border-radius: 16px; color: var(--muted); font-size: 15px; font-weight: 600;
}
.m-past summary::-webkit-details-marker { display: none; }
.m-past summary::after, .m-month summary::after {
  content: ""; width: 8px; height: 8px; margin: -4px 3px 0 12px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); flex: none;
}
.m-past[open] summary::after, .m-month[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.m-past[open] summary { margin-bottom: 10px; }
.m-month summary span { margin-left: auto; }
.m-gap { display: flex; align-items: center; gap: 10px; margin: 8px 0 8px 22px; color: var(--muted); font-size: 13.5px; }
.m-gap::before { content: ""; width: 2px; height: 20px; border-radius: 1px; background: #cbd7e4; }
.m-gap.par { color: #8a4b00; font-weight: 600; }
.m-gap.par::before { background: var(--gold); }

.m-free { padding: 34px 20px; text-align: center; background: #fff; border-radius: 22px; box-shadow: var(--lift); }
.m-free .i { width: 40px; height: 40px; margin: 0 auto 10px; color: #8fb3d1; }
.m-free b { display: block; font-size: 18px; letter-spacing: -.01em; }
.m-free p { margin: 4px 0 16px; color: var(--muted); font-size: 15px; }
.m-free .btn { width: 100%; height: auto; padding: 10px 14px; }

.m-sec { margin: 0 0 18px; }
.m-sec .m-ev { padding-top: 11px; padding-bottom: 11px; border-radius: 16px; }
.m-sec .m-ev + .m-ev { margin-top: 8px; }
.m-sec-free { display: flex; justify-content: space-between; margin: 0 2px 16px; padding: 10px 14px; border: 1px dashed #c6d3e0; border-radius: 14px; color: var(--muted); font-size: 14.5px; }

.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.m-stats div { padding: 14px 8px; border-radius: 18px; background: #fff; box-shadow: var(--lift); text-align: center; }
.m-stats b { display: block; font-size: 23px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.m-stats span { font-size: 13px; color: var(--muted); }
.m-h { margin: 20px 2px 10px; font-size: 18px; letter-spacing: -.015em; }
.m-lv { position: relative; padding: 14px 16px 14px 20px; border-radius: 18px; background: #fff; box-shadow: var(--lift); overflow: hidden; }
.m-lv + .m-lv { margin-top: 10px; }
.m-lv::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.m-lv-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.m-lv-top b { font-size: 17px; letter-spacing: -.01em; overflow-wrap: anywhere; min-width: 0; }
.m-lv-top span { flex: none; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.m-lv p { margin: 3px 0 0; font-size: 14.5px; color: var(--muted); overflow-wrap: anywhere; }
.m-month { margin-top: 10px; border-radius: 18px; background: #fff; box-shadow: var(--lift); overflow: hidden; }
.m-month summary { display: flex; justify-content: space-between; align-items: center; min-height: 54px; padding: 0 16px; font-weight: 700; font-size: 16.5px; cursor: pointer; list-style: none; }
.m-month summary::-webkit-details-marker { display: none; }
.m-month summary span { font-weight: 500; font-size: 14px; color: var(--muted); }
.m-row {
  display: grid; grid-template-columns: 42px 1fr; gap: 14px; width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--ink); text-align: left; font-size: 14.5px;
}
.m-row:active { background: #f3f7fb; }
.m-row-d { text-align: center; line-height: 1.2; color: var(--muted); font-size: 12.5px; }
.m-row-d b { display: block; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.m-row-t { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.m-row-t b { display: block; color: var(--ink); font-size: 15.5px; }
.m-row-t b::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 3px; background: var(--c); }
.m-row.past { opacity: .72; }

/* ---------- LV-Details als Bodenblatt ---------- */
.modal-back { padding: 0; background: rgba(6, 32, 56, .5); }
.modal-back.open { align-items: flex-end; }
.modal {
  max-width: 560px; max-height: min(88dvh, 88vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 0 18px calc(22px + var(--sb)); border-radius: 26px 26px 0 0;
}
.modal h3 { font-size: 21px; letter-spacing: -.015em; padding-top: 2px; }
.modal .close { position: relative; z-index: 3; width: 44px; height: 44px; margin: -8px -10px 0 0; font-size: 28px; line-height: 1; border-radius: 14px; }
.modal table, .modal tbody, .modal tr, .modal td { display: block; width: auto !important; }
.modal table tr { padding: 9px 0; border-bottom: 1px solid var(--line); }
.modal table tr:last-child { border: 0; }
.modal table td { padding: 0; border: 0; font-size: 16.5px; overflow-wrap: anywhere; }
.modal table td:first-child { font-size: 13.5px; }

/* ---------- Favoriten ---------- */
.fav-list { padding: 0; background: none; box-shadow: none; border-radius: 0; }
.fav-row { position: relative; align-items: center; padding: 14px; margin-bottom: 10px; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--lift); }
.fav-row.fav-now { box-shadow: 0 0 0 2px #8fd0a5, var(--lift); }
.fav-main { flex: 1; }
.fav-name { font-size: 16.5px; letter-spacing: -.01em; color: var(--ink); }
.fav-name::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.fav-line { font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.fav-line strong { color: var(--ink); }
.fav-row form { display: none; margin: 0; position: relative; z-index: 1; }
.fav-list.editing .fav-row form { display: block; }
.fav-list.editing .btn { width: 44px; min-height: 44px; padding: 0; color: var(--red); border-color: #f0c4c4; background: #fef5f5; }
.fav-list.editing .fav-name::after { content: none; }
.m-ava { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 16px; background: #dfebf6; color: var(--navy); font-weight: 700; font-size: 16px; }
.fav-now .m-ava { background: #d8f2e0; color: #14532d; }
.fav-note { margin: 14px 4px 0; }
.m-blank { text-align: center; padding: 34px 22px; }
.m-blank > .i { width: 44px; height: 44px; margin: 0 auto 12px; color: #8fb3d1; }
.m-flat .empty, .card > .empty { margin: 0; }
.card > .empty + .btn { width: 100%; }
.m-blank-btns { display: grid; gap: 10px; margin-top: 18px; }

/* ---------- Namensliste: Tabelle als Personenliste ---------- */
.m-searchbar { position: sticky; top: calc(var(--m-bar) + var(--st)); z-index: 20; margin: 0 calc(-1 * var(--m-pad)) 10px !important; padding: 8px var(--m-pad); background: var(--bg); }
.m-searchbar .field { position: relative; }
.m-searchbar .i { position: absolute; left: 14px; top: 14px; color: var(--muted); }
.m-searchbar .field input { padding-left: 46px; -webkit-appearance: none; appearance: none; }
table.m-people, .m-people tbody { display: block; }
.m-people thead, .m-people .c-hide { display: none; }
.m-people tbody { border-radius: 20px; background: #fff; box-shadow: var(--lift); overflow: hidden; }
.m-people tr { position: relative; display: grid; grid-template-columns: 34px auto 1fr 44px 44px; grid-template-areas: "nr name name plan mail" "nr mat start plan mail"; align-items: center; column-gap: 8px; padding: 11px 8px 11px 12px; border-bottom: 1px solid var(--line); }
.m-people tr:last-child { border: 0; }
.m-people td { padding: 0 !important; border: 0 !important; background: none !important; min-width: 0; }
.m-people td.empty { grid-column: 1 / -1; padding: 26px 8px !important; }
.m-people .c-nr { grid-area: nr; text-align: center !important; color: var(--muted); font-size: 14px; }
.m-people .c-name { grid-area: name; font-size: 16.5px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.3; }
.m-people .c-name a { color: var(--ink); }
.m-people .c-name a::after { content: ""; position: absolute; inset: 0; }
.m-people .c-name .m-only { display: inline; font-weight: 500; }
.m-people .c-mat { grid-area: mat; font-size: 13.5px; }
.m-people .c-mat a { color: var(--muted); }
.m-people .c-start { grid-area: start; }
.m-people .c-start .badge { font-size: 11.5px; padding: 1px 8px; white-space: nowrap; }
.m-people .c-mail { grid-area: mail; }
.m-people .c-plan { grid-area: plan; display: block; }
.m-people .c-mail a, .m-people .c-plan a { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--blue); }
.m-people .c-mail a:active, .m-people .c-plan a:active { background: var(--blue-light); }

/* ---------- Fotos ---------- */
.photo-wall { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 14px 10px; }
.photo-tile { position: relative; }
.photo-frame { border: 0; border-radius: 18px; box-shadow: var(--lift); margin-bottom: 7px; }
.photo-tile.is-own .photo-frame { box-shadow: 0 0 0 3px #57b77a; }
.photo-name { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.photo-name a::after { content: ""; position: absolute; inset: 0; }
.photo-tile:active .photo-frame { transform: scale(.97); }
.match-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
.match-tile { border-radius: 18px; }
.match-name { overflow-wrap: anywhere; }

/* ---------- Profil ---------- */
.person-card { flex-direction: column; align-items: stretch; gap: 0; padding: 0; background: none; border: 0; box-shadow: none; text-align: center; }
.person-photo { flex: none; display: grid; place-items: center; margin: 8px 0 16px; }
.person-photo img, .person-photo .avatar-initials { width: 148px; aspect-ratio: 4 / 5; border: 0; border-radius: 34px; box-shadow: 0 16px 34px -14px rgba(8, 63, 107, .5); }
.person-photo .avatar-initials { font-size: 44px; }
.person-name { font-size: 23px; line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.person-info { display: flex; flex-direction: column; }
.person-badges { justify-content: center; margin-bottom: 16px; }
.person-actions { order: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.person-actions .btn { flex-direction: column; gap: 3px; min-height: 64px; padding: 8px 6px; font-size: 14px; border: 0; border-radius: 18px; box-shadow: var(--lift); text-align: center; line-height: 1.15; }
.person-actions .m-act { display: inline-flex; color: var(--blue); }
.person-kv { order: 2; display: block; margin: 0; padding: 4px 18px; border-radius: 20px; background: #fff; box-shadow: var(--lift); text-align: left; }
.person-kv tbody, .person-kv tr, .person-kv td { display: block; width: auto !important; }
.person-kv tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
.person-kv tr:last-child { border: 0; }
.person-kv td { padding: 0; border: 0; font-size: 16px; overflow-wrap: anywhere; }
.person-kv td:first-child { font-size: 13.5px; font-weight: 500; }
.person-kv td a { display: inline-block; padding: 9px 0; margin: -6px 0 -9px; }

/* ---------- Tabellen ohne eigene Ansicht (Security, nur lokal) ---------- */
table.m-stack, .m-stack tbody, .m-stack tr, .m-stack td { display: block; width: 100%; }
.m-stack thead { display: none; }
.m-stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
.m-stack tr:last-child { border: 0; }
.m-stack td { padding: 3px 0 !important; border: 0 !important; background: none !important; overflow-wrap: anywhere; text-align: left !important; }
.m-stack td.num { display: none; }
.m-stack td:first-of-type, .m-stack td.num + td { font-weight: 700; }

@media (min-width: 560px) {
  .m-tiles { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 350px) {
  .m-week-text span { font-size: 12px; }
  .m-tab { font-size: 10px; }
  .m-flat > h2 { font-size: 14.5px; }
  .m-people tr { grid-template-columns: 24px 1fr 42px 42px; column-gap: 6px; grid-template-areas: "nr name plan mail" "nr mat plan mail" "nr start plan mail"; }
  .m-ev { grid-template-columns: 48px 1fr; gap: 10px; }
}
/* Querformat: Höhe ist knapp */
@media (max-height: 520px) {
  :root { --m-bar: 48px; --m-tabs: 50px; }
  .m-cal { position: static; }
  .m-tab .i { height: 24px; padding: 1px 0; }
  .m-tiles .i { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after, ::backdrop { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
