/* Paddock-Buchung Gut Mankartzhof
   Leitidee: die Magnetwand. Waldgrüne Tafel, weiße Namensschilder, gestrichelte freie Plätze. */

:root {
  --forest: #1d570d;
  --board: #143d09;
  --board-line: rgba(255, 255, 255, .22);
  --stall: #c9ccc9;
  --mist: #eef1ec;
  --sage: #def7d7;
  --plate: #ffffff;
  --ink: #15200f;
  --ink-soft: #46523f;
  --line: #d5dad2;
  --field-line: #7d8a77;
  --alert: #a3261b;
  --alert-bg: #fbeae7;
  --ok-bg: #e4f4dd;
  --info-bg: #e9eef6;
  --brass: #e8c14a;
  --focus: #0a58ca;
  --r: 6px;
  --tap: 56px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1.125rem/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
body.app { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0; }
h1 { font-size: 1.75rem; }
p { margin: 0; }
a { color: var(--forest); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .16em; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 1.1rem; height: 1.1rem; stroke-width: 2.5; }
.ico-lg { width: 2.4rem; height: 2.4rem; stroke-width: 1.6; }
.ico-xl { width: 4rem; height: 4rem; stroke-width: 2.2; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: .75rem; top: -4rem; background: #fff; color: var(--ink); padding: .75rem 1rem; border-radius: var(--r); z-index: 100; }
.skip:focus { top: .75rem; }
.muted { color: var(--ink-soft); }

/* ---------- Kopfzeile und Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  background: var(--forest); color: #fff;
  padding: .5rem 1rem; padding-top: calc(.5rem + env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; min-width: 0; }
.brand img { border-radius: var(--r); display: block; }
.brand-text { display: grid; line-height: 1.15; min-width: 0; }
.brand-name { font: 700 1.25rem/1.15 var(--serif); }
.brand-sub { font-size: .9rem; color: #dbe8d6; }
.me {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: 0 .85rem;
  color: #fff; text-decoration: none; border: 2px solid rgba(255, 255, 255, .55); border-radius: var(--r);
  font-weight: 600; max-width: 11rem; transition: background-color .15s, transform .1s;
}
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me:hover, .me.is-active { background: rgba(255, 255, 255, .16); }
.me:active { transform: translateY(1px); }
.topbar :focus-visible { outline-color: #fff; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-height: var(--nav-h); padding: .4rem .15rem; text-align: center;
  color: var(--ink-soft); text-decoration: none; font-size: .8rem; line-height: 1.15; font-weight: 600;
  border-top: 4px solid transparent; transition: background-color .15s;
}
.tab:hover { background: var(--mist); }
.tab.is-active { color: var(--forest); border-top-color: var(--forest); background: var(--sage); }
.tab:active { background: var(--sage); }

.main { max-width: 1400px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.page-head { display: grid; gap: .9rem; margin-bottom: 1rem; }

/* ---------- Hinweise ---------- */
.banner {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .9rem 1rem; margin-bottom: 1rem;
  border-radius: var(--r); border-left: 6px solid var(--forest); background: var(--ok-bg);
}
.banner .ico { margin-top: .1rem; }
.banner-error { background: var(--alert-bg); border-left-color: var(--alert); }
.banner-error .ico { color: var(--alert); }
.banner-info { background: var(--info-bg); border-left-color: #2a5ea8; }
.banner-success .ico { color: var(--forest); }

/* ---------- Wetter ---------- */
.weather { display: flex; align-items: center; gap: .85rem; padding: .75rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--forest); }
.weather-temp { color: var(--ink); }
.weather-note { color: var(--ink-soft); font-size: .9rem; line-height: 1.35; }

/* ---------- Wochenwahl ---------- */
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.weeknav-label { display: grid; text-align: center; line-height: 1.25; }
.weeknav-label span { color: var(--ink-soft); }
.btn-icon { width: var(--tap); padding: 0; flex: none; }
.is-disabled { opacity: .35; pointer-events: none; }

.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; margin-bottom: 1rem; }
.daytab {
  display: grid; justify-items: center; gap: 0; min-height: 64px; padding: .35rem 0;
  font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: var(--r);
  cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s;
}
.daytab-wd { font-size: .95rem; font-weight: 600; }
.daytab-num { font: 700 1.35rem/1.2 var(--serif); }
.daytab:hover { border-color: var(--forest); }
.daytab:active { transform: translateY(1px); }
.daytab.is-today .daytab-num { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.daytab.is-selected { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ---------- Die Wand ---------- */
.wall { display: block; }
.day { display: none; background: var(--board); color: #fff; border-radius: var(--r); padding: 1rem; }
.day.is-selected { display: block; }
.day-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; font-size: 1.6rem; color: #fff; padding-bottom: .75rem; }
.day-dt { font-weight: 400; color: #dbe8d6; }
.day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; padding-bottom: .75rem; }
.day-head .day-title { padding-bottom: 0; }
.today-tag { font: 700 .95rem var(--sans); background: var(--sage); color: var(--board); padding: .1rem .55rem; border-radius: var(--r); }
.day.is-today { box-shadow: none; border-top: 6px solid var(--brass); }
.day-empty { color: #dbe8d6; padding: .5rem 0; }
.day-gap { display: none; }

.slot { border-top: 1px solid var(--board-line); padding: .9rem 0 .35rem; }
.slot-time { font-size: 1.45rem; color: #fff; display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .7rem; margin-bottom: .6rem; }
.slot-flag { font: 600 .95rem var(--sans); color: #dbe8d6; border: 1px solid rgba(255, 255, 255, .5); padding: 0 .5rem; border-radius: var(--r); }
.slot-rain { display: inline-flex; align-items: center; gap: .25rem; font: 700 .9rem/1.3 var(--sans); color: var(--board); background: #cfe3f5; padding: .1rem .45rem; border-radius: var(--r); }
.slot.is-past { opacity: .7; }
.slot.is-past .slot-time { font-size: 1.15rem; margin-bottom: .3rem; }
.past-list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .2rem; color: #e6efe1; font-size: 1rem; }
.past-list b { font-weight: 700; }

/* Jedes Paddock als eigene, leicht helle Flaeche mit Namen und Status-Schild */
.row { margin-bottom: .6rem; padding: .55rem .6rem .65rem; background: rgba(255, 255, 255, .08); border-radius: var(--r); }
.row-head { display: flex; justify-content: space-between; gap: .4rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; color: #fff; }
.row-name { font-weight: 800; font-size: 1.1rem; }
.row-state { font: 700 .9rem/1.3 var(--sans); padding: .1rem .5rem; border-radius: var(--r); white-space: nowrap; }
.state-free { background: var(--sage); color: var(--board); }
.state-full { background: rgba(255, 255, 255, .16); color: #e6efe1; }
.state-blocked { background: #f1c4bd; color: #5c130c; }
.plates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.plates li { display: flex; }
.plate-note { grid-column: 1 / -1; padding: .6rem .8rem; border: 2px solid #f1c4bd; border-radius: var(--r); background: rgba(163, 38, 27, .3); color: #fff; font-weight: 600; }

.plate {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  min-height: var(--tap); padding: .5rem .85rem .5rem 1.45rem;
  font: 700 1.15rem/1.2 var(--sans); text-align: left; text-decoration: none;
  background: var(--plate); color: var(--ink); border: 3px solid var(--plate); border-radius: var(--r);
  transition: transform .15s, background-color .15s, border-color .15s;
}
.plate::before { content: ""; position: absolute; left: .55rem; top: 50%; width: .5rem; height: .5rem; margin-top: -.25rem; border-radius: 50%; background: var(--stall); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.plate-name { overflow-wrap: anywhere; }
button.plate { cursor: pointer; }
button.plate:hover { transform: translateY(-2px); }
button.plate:active { transform: translateY(1px); }

.plate.is-mine { background: var(--sage); border-color: var(--brass); }
button.plate.is-mine:hover { background: #ecfbe7; }
.plate.is-free { justify-content: flex-start; gap: .35rem; background: rgba(255, 255, 255, .12); color: #fff; border: 2px dashed #fff; font-weight: 700; padding-left: .7rem; }
.plate.is-free::before { display: none; }
button.plate.is-free:hover { background: rgba(255, 255, 255, .26); border-style: solid; }
.plate.is-free.is-off { background: transparent; border-color: rgba(255, 255, 255, .35); color: #c9d6c3; font-weight: 600; }
.row.is-blocked .plates { margin-top: .25rem; }

.legend { margin-top: 1rem; color: var(--ink-soft); font-size: 1rem; max-width: 60ch; }

/* ---------- Dialog ---------- */
.dlg { width: min(32rem, calc(100% - 1.5rem)); border: 0; border-radius: var(--r); padding: 0; background: #fff; color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.dlg::backdrop { background: rgba(10, 25, 6, .62); }
.dlg[open] { animation: dlg-in .14s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dlg-body { padding: 1.4rem 1.25rem 1.25rem; display: grid; gap: 1rem; }
.dlg-title { font-size: 1.6rem; }
.dlg-when { font-size: 1.2rem; font-weight: 600; }
.dlg-text { color: var(--ink-soft); }
.dlg-actions { display: grid; gap: .6rem; margin-top: .25rem; }
.horse-pick { border: 0; margin: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.horse-pick legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.pick { display: flex; align-items: center; gap: .75rem; min-height: var(--tap); padding: .5rem 1rem; border: 2px solid var(--field-line); border-radius: var(--r); cursor: pointer; font-weight: 600; transition: background-color .15s, border-color .15s; }
.pick:hover { border-color: var(--forest); }
.pick input { width: 1.4rem; height: 1.4rem; accent-color: var(--forest); flex: none; }
.pick:has(input:checked) { border-color: var(--forest); background: var(--sage); }
.pick:has(input:disabled) { opacity: .5; cursor: not-allowed; background: var(--mist); }
.pick small { font-weight: 400; color: var(--ink-soft); margin-left: auto; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: 0 1.4rem; font: 700 1.1rem/1.2 var(--sans); text-align: center; text-decoration: none;
  border: 2px solid transparent; border-radius: var(--r); cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--board); }
.btn-secondary { background: #fff; color: var(--forest); border-color: var(--forest); }
.btn-secondary:hover { background: var(--sage); }
.btn-danger { background: var(--alert); color: #fff; }
.btn-danger:hover { background: #7f1c13; }
.btn-cancel { background: #fff; color: var(--alert); border-color: var(--alert); }
.btn-cancel:hover { background: var(--alert-bg); }
.btn-block { display: flex; width: 100%; }
.btn-stack { display: grid; gap: .6rem; }
.push-status { font-weight: 700; }
.text-alert { color: var(--alert); }
.push-status.is-on { color: var(--forest); }
@media (min-width: 640px) { .btn-stack { grid-template-columns: 1fr 1fr; } }
.btn-small { min-height: 48px; padding: 0 1rem; font-size: 1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.back { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; min-width: 0; }
.field label, .field > label { font-weight: 700; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], select, textarea, input[type="file"] {
  width: 100%; min-height: var(--tap); padding: .6rem .85rem; font: 400 1.1rem/1.4 var(--sans); color: var(--ink);
  background: #fff; border: 2px solid var(--field-line); border-radius: var(--r);
}
textarea { min-height: 9rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); }
input[type="file"] { padding: .85rem; }
.help { color: var(--ink-soft); font-size: .95rem; }
.pw { display: flex; }
.pw input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.pw-toggle { flex: none; min-width: 6.2rem; padding: 0 .9rem; font: 700 1rem var(--sans); color: var(--forest); background: var(--sage); border: 2px solid var(--field-line); border-radius: 0 var(--r) var(--r) 0; cursor: pointer; }
.pw-toggle:hover { background: #cdeec4; }
.check { display: flex; align-items: center; gap: .75rem; min-height: 48px; cursor: pointer; }
.check input { width: 1.5rem; height: 1.5rem; accent-color: var(--forest); flex: none; }
.check-bottom { align-self: end; }
.form-link { text-align: center; }
.form-link a { display: inline-block; padding: .6rem; }
.lead { color: var(--ink-soft); margin-bottom: 1.1rem; max-width: 60ch; }
.grid-2 { display: grid; gap: 1.1rem; }
.inline-form { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.inline-form select { width: auto; min-width: 12rem; }

/* ---------- Flaechen und Listen ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; margin-bottom: 1.1rem; display: grid; gap: 1rem; }
.panel-title { font-size: 1.35rem; }
.panel-danger { border-color: #e7b3ab; }
.panel-quiet { background: transparent; border-style: dashed; justify-items: start; }
.feedback-text { margin: .3rem 0; max-width: 70ch; }
.subhead { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.panel .subhead { margin: .75rem 0 0; }
.facts { margin: 0; display: grid; gap: .6rem; }
.facts div { display: grid; }
.facts dt { color: var(--ink-soft); font-size: .95rem; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts-row { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem 2rem; }

.entries { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.entries-date { margin-top: .6rem; }
.entries-date h2 { font-size: 1.25rem; }
.entry { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--forest); border-radius: var(--r); padding: .9rem 1rem; }
.entry.is-off { border-left-color: var(--stall); color: var(--ink-soft); }
.entry-main { min-width: 0; display: grid; gap: .1rem; }
.entry-horse { font: 700 1.35rem/1.25 var(--serif); }
.entry-when { font-weight: 600; }
.entry-by, .entry-note { color: var(--ink-soft); font-size: .95rem; }
.entry-note { max-width: 24rem; }
.entry-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.entries-past .entry { border-left-color: var(--stall); color: var(--ink-soft); }
.tag { display: inline-block; font: 600 .8rem/1.4 var(--sans); padding: 0 .5rem; margin-left: .3rem; border: 1px solid var(--field-line); border-radius: var(--r); vertical-align: middle; color: var(--ink-soft); }

.empty { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem 1.1rem; display: grid; gap: .75rem; justify-items: start; }
.empty-title { font: 700 1.3rem var(--serif); }
.sent { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 2rem 1.1rem; display: grid; gap: .9rem; justify-items: center; text-align: center; }
.sent .ico { color: var(--forest); }
.sent .btn { width: 100%; max-width: 22rem; }

.notices { display: grid; gap: .9rem; align-items: start; }
.notice { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; display: grid; gap: .5rem; }
.notice.is-pinned { border-left: 6px solid var(--brass); }
.notice-title { display: flex; align-items: center; gap: .5rem; font-size: 1.4rem; }
.notice-title .ico { color: var(--forest); }
.notice-date { color: var(--ink-soft); font-size: .95rem; }
.notice-body { max-width: 65ch; }
.notice.kind-important { border-left: 6px solid var(--alert); }
.notice.kind-important.is-pinned { border-left-color: var(--alert); }
.notice-kind { justify-self: start; font: 700 .9rem/1.3 var(--sans); background: var(--alert-bg); color: var(--alert); border: 1px solid #e7b3ab; padding: .05rem .5rem; border-radius: var(--r); }
.notice-event { display: flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--forest); }
.notice-img-link { display: block; justify-self: start; }
.notice-img { display: block; max-width: 100%; max-height: 22rem; border-radius: var(--r); border: 1px solid var(--line); }
.kind-pick { border: 0; margin: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.kind-pick legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.kind-pick .pick small { margin-left: auto; text-align: right; }

/* ---------- Admin ---------- */
.subnav { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1.1rem; padding-bottom: .25rem; }
.subnav-link { flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 1rem; color: var(--ink); text-decoration: none; font-weight: 600; background: #fff; border: 2px solid var(--line); border-radius: var(--r); transition: background-color .15s, border-color .15s; }
.subnav-link:hover { border-color: var(--forest); }
.subnav-link.is-active { background: var(--forest); border-color: var(--forest); color: #fff; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .95rem; color: var(--ink-soft); font-weight: 600; padding: .4rem .6rem; border-bottom: 2px solid var(--line); }
.tbl td { padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl-action { text-align: right; }
.row-form { display: grid; gap: .8rem; align-items: end; padding: .9rem 0; border-top: 1px solid var(--line); }
.row-form:first-of-type { border-top: 0; }
.field-narrow { max-width: 12rem; }

/* ---------- Anmeldung ---------- */
body.auth { background: var(--forest); min-height: 100vh; }
.auth-main { max-width: 30rem; margin: 0 auto; padding: 1.75rem 1rem 2.5rem; padding-top: calc(1.75rem + env(safe-area-inset-top)); display: grid; gap: 1.5rem; }
.auth-crest { display: grid; justify-items: center; text-align: center; gap: .2rem; color: #fff; }
.auth-crest img { border-radius: var(--r); margin-bottom: .6rem; }
.auth-name { font: 700 1.8rem/1.2 var(--serif); }
.auth-app { color: #dbe8d6; }
.auth-panel { background: #fff; color: var(--ink); border-radius: var(--r); padding: 1.5rem 1.25rem; display: grid; gap: 1rem; }
.auth-title { font-size: 1.7rem; }

/* ---------- Breite Bildschirme ---------- */
@media (min-width: 640px) {
  .page-head { grid-template-columns: 1fr auto; align-items: center; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .dlg-actions { grid-template-columns: 1fr 1fr; }
  .row-form { grid-template-columns: 1fr auto auto auto; }
  .row-form-add { grid-template-columns: auto auto 1fr; }
}

@media (min-width: 900px) {
  body.app { padding-bottom: 0; }
  .topbar { padding: .5rem 1.5rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; }
  .tabs { position: static; display: flex; justify-content: center; gap: .25rem; background: transparent; border: 0; padding: 0; }
  .tab { flex-direction: row; gap: .5rem; min-height: 48px; padding: 0 1rem; color: #fff; font-size: 1rem; border: 2px solid transparent; border-radius: var(--r); }
  .tab:hover { background: rgba(255, 255, 255, .14); }
  .tab.is-active { background: #fff; color: var(--forest); border-color: #fff; }
  .main { padding: 1.75rem 1.5rem 3rem; }
}

@media (min-width: 1000px) {
  .notices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entries-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entries-grid .entry { align-self: stretch; }
  .mine-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; align-items: start; }
  .mine-cols .subhead { margin-top: .6rem; }
  .daystrip { display: none; }
  /* Raster: Spalten = Tage, Zeilen = Uhrzeiten der Woche. Jeder Tag nutzt die Zeilen der Wand (subgrid),
     so steht z. B. 16 Uhr an allen Tagen auf derselben Höhe. */
  .wall { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: .75rem; row-gap: 0; align-items: stretch; }
  .wall.rows-1 { grid-template-rows: auto repeat(1, auto); }
  .wall.rows-2 { grid-template-rows: auto repeat(2, auto); }
  .wall.rows-3 { grid-template-rows: auto repeat(3, auto); }
  .wall.rows-4 { grid-template-rows: auto repeat(4, auto); }
  .wall.rows-5 { grid-template-rows: auto repeat(5, auto); }
  .wall.rows-6 { grid-template-rows: auto repeat(6, auto); }
  .wall.rows-7 { grid-template-rows: auto repeat(7, auto); }
  .wall.rows-8 { grid-template-rows: auto repeat(8, auto); }
  .wall.rows-9 { grid-template-rows: auto repeat(9, auto); }
  .wall.rows-10 { grid-template-rows: auto repeat(10, auto); }
  .wall.rows-11 { grid-template-rows: auto repeat(11, auto); }
  .wall.rows-12 { grid-template-rows: auto repeat(12, auto); }
  .wall.rows-13 { grid-template-rows: auto repeat(13, auto); }
  .wall.rows-14 { grid-template-rows: auto repeat(14, auto); }
  .wall.rows-15 { grid-template-rows: auto repeat(15, auto); }
  .wall.rows-16 { grid-template-rows: auto repeat(16, auto); }
  .day, .day.is-selected { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; align-content: start; padding: .85rem .7rem; }
  .day > .day-head { grid-row: 1; }
  .day > .day-empty { grid-row: 2; }
  .day > .day-gap { display: block; grid-row: 2; align-self: start; border-top: 1px solid var(--board-line); padding-top: .9rem; color: #dbe8d6; font-size: 1rem; }
  .slot.r-2 { grid-row: 2; }
  .slot.r-3 { grid-row: 3; }
  .slot.r-4 { grid-row: 4; }
  .slot.r-5 { grid-row: 5; }
  .slot.r-6 { grid-row: 6; }
  .slot.r-7 { grid-row: 7; }
  .slot.r-8 { grid-row: 8; }
  .slot.r-9 { grid-row: 9; }
  .slot.r-10 { grid-row: 10; }
  .slot.r-11 { grid-row: 11; }
  .slot.r-12 { grid-row: 12; }
  .slot.r-13 { grid-row: 13; }
  .slot.r-14 { grid-row: 14; }
  .slot.r-15 { grid-row: 15; }
  .slot.r-16 { grid-row: 16; }
  .slot.r-17 { grid-row: 17; }
  .day-title { font-size: 1.15rem; }
  .day-head { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .slot-time { font-size: 1.2rem; }
  .plates { grid-template-columns: 1fr; }
  .plate { font-size: 1.05rem; padding-left: 1.3rem; }
  .row { padding: .5rem .45rem .55rem; }
  .row-name { font-size: 1rem; }
  .weeknav { justify-content: flex-start; }
  .weeknav-label { min-width: 13rem; }
}

@media (max-width: 899px) {
  .tab span { max-width: 100%; }
}

@media (max-width: 380px) {
  .brand-sub { display: none; }
  .me span { display: none; }
  .me { padding: 0 .75rem; }
  .plate { font-size: 1.05rem; }
}

/* Auswertung */
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.stat-bar { display: block; height: 4px; margin-top: .3rem; max-width: 14rem; background: var(--mist); border-radius: 2px; }
.stat-fill { display: block; height: 4px; background: var(--forest); border-radius: 2px; }
.stat-fill.w0 { width: 0%; }
.stat-fill.w5 { width: 5%; }
.stat-fill.w10 { width: 10%; }
.stat-fill.w15 { width: 15%; }
.stat-fill.w20 { width: 20%; }
.stat-fill.w25 { width: 25%; }
.stat-fill.w30 { width: 30%; }
.stat-fill.w35 { width: 35%; }
.stat-fill.w40 { width: 40%; }
.stat-fill.w45 { width: 45%; }
.stat-fill.w50 { width: 50%; }
.stat-fill.w55 { width: 55%; }
.stat-fill.w60 { width: 60%; }
.stat-fill.w65 { width: 65%; }
.stat-fill.w70 { width: 70%; }
.stat-fill.w75 { width: 75%; }
.stat-fill.w80 { width: 80%; }
.stat-fill.w85 { width: 85%; }
.stat-fill.w90 { width: 90%; }
.stat-fill.w95 { width: 95%; }
.stat-fill.w100 { width: 100%; }

/* Buchungsliste im Admin: Tage als Gruppen */
.tbl-group th { padding: 1.1rem .6rem .4rem; font: 700 1.15rem/1.3 var(--serif); color: var(--ink); border-bottom: 2px solid var(--line); }
.tbl-group:first-child th { padding-top: .2rem; }
.tbl-sep, .tbl-paddock-inline, .tbl-by-inline { display: none; }
.toolbar { margin-bottom: 1.1rem; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.toolbar-row .btn { flex: 1 1 9rem; }
@media (min-width: 640px) { .toolbar-row .btn { flex: 0 0 auto; } }
.notice-admin { margin-top: .4rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.notice.is-expired { color: var(--ink-soft); }
.lead-figures { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin-bottom: 1.1rem; }
.lead-figures p { display: grid; line-height: 1.25; }
.lead-figures b { font: 700 1.6rem/1.2 var(--serif); }
.lead-figures span { color: var(--ink-soft); font-size: 1rem; }

/* Tabellen auf dem Handy: jede Zeile wird zu einem Block */
@media (max-width: 719px) {
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { padding: .65rem 0; border-bottom: 2px solid var(--line); }
  .tbl td { border: 0; padding: .15rem 0; }
  .tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-soft); font-size: .9rem; }
  .tbl-action { text-align: left; padding-top: .5rem !important; }
  .tbl-stats td.num { text-align: left; }
  .tbl-bookings tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .75rem; }
  .tbl-bookings td[data-label]::before { content: none; }
  .tbl-bookings td.tbl-when { grid-column: 1; color: var(--ink-soft); }
  .tbl-bookings .tbl-paddock, .tbl-bookings .tbl-by { display: none; }
  .tbl-bookings .tbl-sep, .tbl-bookings .tbl-paddock-inline, .tbl-bookings .tbl-by-inline { display: inline; }
  .tbl-bookings .tbl-by-inline { color: var(--ink-soft); }
  .tbl-bookings td.tbl-horse { grid-column: 1; }
  .tbl-bookings td.tbl-action { grid-column: 2; grid-row: 1 / span 2; padding-top: 0 !important; }
  .tbl-bookings .tbl-group { display: block; }
  .tbl-bookings .tbl-group th { display: block; padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  button.plate:hover { transform: none; }
}

@media print {
  .topbar, .tabs, .daystrip, .weeknav, .legend { display: none; }
  .day { display: block; break-inside: avoid; background: #fff; color: #000; border: 1px solid #000; }
}
