/* Stall-App: ein Stylesheet, keine Build-Kette. */
@font-face { font-family: 'Nunito'; src: url('vendor/nunito.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; }

:root {
  --green: #2F7A32; --green-d: #1F5A22; --green-l: #E3F0E1;
  --blue: #2B2F7F; --blue-l: #E6E7F5;
  --yellow: #E3E336; --yellow-l: #FFF7C2; --brown: #2B1D14;
  --bg: #F6F4EC; --card: #FFFFFF; --line: #E2DFD2; --text: #1F2A24; --muted: #66665A;
  --danger: #B3261E; --radius: 16px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 'Nunito', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-height: 44px; font-size: 16px; color: var(--text); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.stale { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }

/* Rahmen */
.top { background: var(--green); color: #fff; padding: calc(var(--safe-t) + 16px) 16px 40px; position: relative; overflow: hidden; }
.top-row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.top .logo { width: 56px; height: 56px; border-radius: 50%; background: #fff; object-fit: contain; flex: none; }
.logo-link { display: block; flex: none; border-radius: 50%; } /* Logo führt immer zur Startseite */
.top small { opacity: .85; }
main { padding: 16px 16px calc(96px + var(--safe-b)); display: grid; gap: 12px; max-width: 640px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding: 6px 0 calc(6px + var(--safe-b)); z-index: 5; }
.tabbar a { display: grid; justify-items: center; font-size: 12px; color: var(--muted); text-decoration: none; min-width: 64px; min-height: 44px; }
.tabbar a.on { color: var(--green); font-weight: 800; }
.tabbar svg { width: 24px; height: 24px; }
.auth { max-width: 420px; margin: 0 auto; padding: calc(var(--safe-t) + 32px) 16px 32px; display: grid; gap: 12px; }
.auth-head { display: flex; gap: 10px; align-items: center; color: var(--green); }
.auth-head svg { width: 40px; height: 40px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; font-size: 14px; }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }

/* Bausteine */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; position: relative; }
.row + .row { border-top: 1px solid var(--line); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.person + .person { border-top: 1px solid var(--line); } /* Weitere Personen am Pferd: Name + Rechte-Schalter */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 16px; min-height: 44px; cursor: pointer; font-weight: 700; text-align: center; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 12px; min-height: 44px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.btn:active { transform: scale(.97); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--green-l); color: var(--green-d); font-size: 14px; border: 0; justify-self: start; }
.chip.blue { background: var(--blue-l); color: var(--blue); }
.chip.warn { background: var(--yellow-l); color: #5C4E00; }
.chip.mine { cursor: pointer; min-height: 44px; }
.chip.time { background: var(--blue-l); color: var(--blue); min-height: 44px; }
.chip-group .chip { white-space: nowrap; }
.chip-group { display: inline-flex; gap: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.seg button, .seg a { border: 0; background: none; padding: 6px 12px; min-height: 44px; font-size: 14px; cursor: pointer; color: inherit; text-decoration: none; display: grid; place-items: center; }
.seg .on { background: var(--blue); color: #fff; }
.seg.wide { display: flex; }
.seg.wide > * { flex: 1; min-height: 44px; }
/* Auswahl mit beliebig vielen, langen Einträgen (z. B. Bereiche): bricht um statt abgeschnitten zu werden. */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills.center { justify-content: center; }
.pills button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; min-height: 44px; font-size: 14px; cursor: pointer; color: inherit; }
.pills .on { background: var(--blue); border-color: var(--blue); color: #fff; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar.ph { display: inline-grid; place-items: center; background: var(--blue-l); color: var(--blue); font-weight: 800; }
.horse { display: flex; align-items: center; gap: 10px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 6px; display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--blue); font-size: 14px; font-weight: 700; position: relative; }
.tile svg { width: 44px; height: 38px; }
/* Bleibt die letzte Kachel allein in ihrer Reihe (7 Kacheln = 3+3+1), nimmt sie die ganze Breite: Symbol neben dem Text. */
.tile:last-child:nth-child(3n + 1) { grid-column: 1 / -1; grid-auto-flow: column; justify-content: center; align-items: center; gap: 12px; padding: 8px 6px; }
.horse svg { width: 40px; height: 36px; }
.badge { position: absolute; top: 6px; right: 8px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 7px; font-weight: 800; }
.pinned { border-left: 5px solid var(--yellow); }
/* Geburtstagspferd des Tages */
.birthday { display: flex; align-items: center; gap: 10px; border-left: 5px solid #E89AB8; }
.birthday > span:first-child { font-size: 28px; line-height: 1; }
.form { display: grid; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.two > button { grid-column: 1 / -1; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input { flex: 1; }
.inline input[type=date] { flex: none; width: auto; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); min-height: 44px; } /* ganze Zeile antippbar, auch mit Handschuhen */
.tap { display: inline-flex; align-items: center; min-height: 44px; } /* alleinstehender Textlink als Tippfläche */
/* Abhakliste: Kästchen größer. */
.checklist .check input { width: 22px; height: 22px; }
.check input { width: auto; min-height: 0; }
/* Hinweis auf eine neue Version: bleibt stehen, bis man tippt; kurze Meldungen rücken solange darüber. */
.update { position: fixed; left: 16px; right: 16px; bottom: calc(84px + var(--safe-b)); max-width: 608px; margin: 0 auto; min-height: 48px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font: inherit; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); z-index: 9; cursor: pointer; animation: pop .25s ease-out; }
.has-update .toast { bottom: calc(144px + var(--safe-b)); }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + var(--safe-b)); max-width: 608px; margin: 0 auto; background: var(--text); color: #fff; padding: 12px 16px; border-radius: 14px; z-index: 10; animation: pop .25s ease-out; }
.toast.error { background: var(--danger); }
details.card > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
/* „Heute im Stall“ zugeklappt: Titel plus Kurzstand, mit Pfeil rechts. */
.today > summary { list-style: none; justify-content: space-between; gap: 8px; }
.today > summary::-webkit-details-marker { display: none; }
.today > summary::after { content: '▾'; font-size: 18px; transition: transform .2s; }
.today[open] > summary::after { transform: rotate(180deg); }
.today[open] > summary { margin-bottom: 4px; }
.today-sum { display: grid; gap: 2px; }
.today-sum .muted { font-weight: 400; font-size: 14px; }
/* Ankündigungen: Überschrift, Text klappt auf; 💡 = auf diesem Gerät noch nicht gelesen. */
details.ann > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 400; }
.ann > summary::-webkit-details-marker { display: none; }
.ann.card { gap: 0; padding-block: 4px; } /* zugeklappt keine Lücke unter der Überschrift */
.ann > .row-actions { margin-bottom: 10px; }
.ann > summary::after { content: '▾'; font-size: 18px; margin-left: auto; transition: transform .2s; }
.ann[open] > summary::after { transform: rotate(180deg); }
.ann-head { display: grid; gap: 2px; padding: 4px 0; }
.ann-body { margin: 0 0 8px; white-space: pre-wrap; }
.bulb { font-size: 20px; flex: none; }
.anns .ann + .ann { border-top: 1px solid var(--line); }
.ann.card.urgent { border-left: 5px solid var(--danger); }
.urgent-tag { color: var(--danger); font-weight: 700; }
.care { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; margin-bottom: 10px; }
.care summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.care[open] { padding-bottom: 14px; }
.care[open] summary { margin-bottom: 4px; }
.wish { display: grid; gap: 4px; padding: 8px 0; }
.wish + .wish { border-top: 1px solid var(--line); }
.horse-edit { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px 0; }
.horse-edit + .horse-edit, .horse-edit + form, .care + .horse-edit, .care + form { border-top: 1px solid var(--line); padding-top: 10px; }
.photo { display: grid; justify-items: center; gap: 2px; cursor: pointer; text-align: center; font-size: 12px; }
.avatar-pick button { grid-auto-flow: column; gap: 8px; }
.booking { display: grid; gap: 6px; padding: 8px 0; }
.booking + .booking { border-top: 1px solid var(--line); }
.card-head > svg { width: 34px; height: 30px; flex: none; }
.iconhead { display: flex; align-items: center; gap: 10px; margin: 0; }
.iconhead > svg { width: 34px; height: 30px; flex: none; color: var(--green); }
.advice p { margin: 0; }
.advice > .btn { justify-self: start; }

/* Wetterkarte: zwei Spalten (Heute/Morgen), je mit animierter Wettergrafik, groß/klein-Temperatur und
   kompakter Kennzahlen-Zeile; darunter die Deckenempfehlung hervorgehoben mit der stillen Decken-Illustration. */
.weather-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; text-align: center; }
.weather-col { display: grid; justify-items: center; gap: 2px; }
.weather-col .wx { width: 88px; height: 66px; }
.weather-temp { font-size: 22px; font-weight: 800; }
.weather-temp .min { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.weather-meta { display: grid; gap: 2px; font-size: 13px; color: var(--muted); justify-items: center; margin-top: 2px; }
.weather-meta span { display: inline-flex; align-items: center; gap: 4px; }
.weather-meta svg { width: 14px; height: 14px; flex: none; }
.weather-tip { display: flex; align-items: center; gap: 10px; background: var(--green-l); border-radius: 12px; padding: 8px 10px; }
.weather-tip svg { width: 30px; height: 26px; flex: none; }
.weather-tip p { margin: 0; }
.attr { font-size: 12px; color: var(--muted); justify-self: start; display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0 -14px; }
.big { font-size: 22px; font-weight: 800; line-height: 1.25; }
.crown { width: 18px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.iconhead > .crown { width: 30px; height: 25px; margin: 0; }
.offer { position: relative; color: inherit; text-decoration: none; }
.offer p { margin: 0; }
.back { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: none; }
.row > a { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px; }
.edit { padding: 10px 0; }
.row + .edit, .edit + .row { border-top: 1px solid var(--line); }
.row.past { min-height: 32px; color: var(--muted); }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }

/* Tage, Monat, Balken */
.weeknav { display: flex; align-items: center; gap: 4px; touch-action: pan-y; }
.weeknav .icon { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; color: var(--text); }
.weeknav .icon:disabled { opacity: .35; cursor: default; }
.weeknav .mid { flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; text-align: center; }
.card.past { background: transparent; }
.card.past > .card-head h3 { color: var(--muted); }
.monthnav { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.month .wd { font-size: 12px; color: var(--muted); }
.month button { aspect-ratio: 1; min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; font-size: 14px; padding: 0; }
.month button:disabled { opacity: .4; cursor: default; }
.month .bestaetigt { background: #4E4B42; color: #fff; border-color: #4E4B42; text-decoration: line-through; }
.month .angefragt { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #E8C500 4px, #E8C500 8px); border-color: #B89B00; }
.month .picked { background: var(--blue); color: #fff; border-color: var(--blue); }
.month.cal button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; line-height: 1; }
.month.cal .today { border: 2px solid var(--blue); font-weight: 800; }
.month.cal .past { background: transparent; color: var(--muted); }
.month.cal .off { background: #ECE9DE; color: var(--muted); }
.month.cal .past > span { opacity: .6; }
.dots { display: flex; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--green); }
.dots i.on { background: var(--green); }
.count { min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; line-height: 16px; }
.seg.center { justify-self: center; }
.card.focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); scroll-margin-top: 12px; }
.bar { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 8px; font-size: 14px; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { height: 10px; background: var(--green-l); border-radius: 999px; overflow: hidden; }
.fill { height: 100%; background: var(--green); border-radius: 999px; transform-origin: left; animation: grow .8s ease-out; }

/* Deckenwunsch-Tabelle: eigenes horizontales Scrollen, die Seite selbst bleibt fest. */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
.wishtable { border-collapse: collapse; width: 100%; }
.wishtable th, .wishtable td { padding: 4px 6px; text-align: center; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.wishtable thead th { font-weight: 700; }
.wishtable thead th span { display: block; }
.wishtable tbody th { text-align: left; font-weight: 700; max-width: 7em; overflow: hidden; text-overflow: ellipsis; }
.wishtable th:first-child, .wishtable td:first-child { position: sticky; left: 0; background: var(--card); }
.wishtable th.today, .wishtable td.today { background: var(--blue-l); }
.wishtable td span { display: block; font-weight: 800; }
.wishtable .wish-an { color: var(--green-d); }
.wishtable .wish-aus { color: var(--blue); }

/* Animationen aus der Pferdewelt */
.trail { position: absolute; left: 0; right: 0; bottom: 8px; height: 30px; color: var(--bg); }
.print { position: absolute; width: 20px; height: 24px; opacity: 0; animation: print 6s linear infinite; }
@keyframes print { 0% { opacity: 0; } 4% { opacity: .5; } 55% { opacity: .5; } 75%, 100% { opacity: 0; } }
.drape { transform-box: fill-box; transform-origin: top center; animation: drape 3.2s ease-in-out infinite; }
@keyframes drape { 0%, 100% { transform: skewX(0) scaleY(1); } 50% { transform: skewX(-6deg) scaleY(.98); } }
.blade { transform-box: fill-box; transform-origin: bottom center; animation: sway 2.6s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.flower { transform-box: fill-box; transform-origin: bottom center; animation: sway 3.4s ease-in-out infinite; }
.roll { animation: roll 1.4s cubic-bezier(.2, .8, .3, 1) both; }
.wheel { transform-box: fill-box; transform-origin: center; animation: spin 1.4s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes roll { from { transform: translateX(-160%); } }
@keyframes spin { from { transform: rotate(-900deg); } }
/* Willkommenskarte über der App (einmalig) */
.welcome { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .45); animation: pop .25s ease-out; }
.welcome .card { width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; }
.welcome .gallop { padding: 8px 0 0; }
.welcome p { margin: 0 0 8px; }
.gallop { display: grid; place-items: center; padding: 48px 0; color: var(--green); }
.gallop.full { min-height: 100vh; }
.gallop .horse { width: 120px; height: 80px; background: url(icons/gallop.png) 0 0/1800px 80px no-repeat; animation: gallop .9s steps(15) infinite; }
@keyframes gallop { to { background-position: -1800px 0; } }
.gallop .shadow { width: 70px; height: 6px; border-radius: 50%; background: rgba(47, 122, 50, .15); margin-top: -4px; }
}
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }
@keyframes grow { from { transform: scaleX(0); } }

/* Wettergrafiken (lib/icons.js WeatherIcon): Farben über die Tokens oben, nicht fest verdrahtet.
   Die globale prefers-reduced-motion-Regel unten schaltet alle diese Animationen ebenfalls ab. */
.wx-sun { fill: var(--yellow); stroke: var(--yellow); }
.wx-rays { transform-box: fill-box; transform-origin: center; animation: wx-spin 16s linear infinite; }
.wx-cloud { fill: var(--blue-l); stroke: var(--blue); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: wx-drift 4s ease-in-out infinite; }
.wx-cloud2 { animation-delay: -2s; animation-duration: 5s; }
.wx-drop { stroke: var(--blue); fill: none; animation: wx-fall 1.1s linear infinite; }
.wx-drop-light { opacity: .6; animation-duration: 1.6s; }
.wx-flake line { stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.wx-flake { transform-box: fill-box; transform-origin: center; animation: wx-flake 2.6s linear infinite; }
.wx-fog { stroke: var(--muted); fill: none; opacity: .55; animation: wx-fog 3.6s ease-in-out infinite; }
.wx-bolt { fill: var(--yellow); animation: wx-flicker 4s ease-in-out infinite; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes wx-fall { 0% { transform: translateY(-3px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(9px); opacity: 0; } }
@keyframes wx-flake { 0% { transform: translateY(-3px) rotate(0); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(9px) rotate(90deg); opacity: 0; } }
@keyframes wx-fog { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes wx-flicker { 0%, 90%, 100% { opacity: .35; } 93%, 96% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .print { opacity: .5; }
}

/* iOS gibt Datums-/Zeitfeldern eine Mindestbreite – ohne das ragen sie rechts aus der Karte. */
input[type="date"], input[type="time"] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; }
.two > * { min-width: 0; }

/* Burger-Menü */
.burger { margin-left: auto; flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; cursor: pointer; }
.burger svg { width: 26px; height: 26px; }
.menu-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .4); animation: pop .2s ease-out; }
.menu { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(300px, 85vw); overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  padding: calc(var(--safe-t) + 12px) 12px calc(var(--safe-b) + 12px); background: var(--card); box-shadow: -8px 0 24px rgba(0, 0, 0, .18); animation: menu-in .2s ease-out; }
@keyframes menu-in { from { transform: translateX(100%); } to { transform: none; } }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head .icon { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text); }
.menu a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 8px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; }
.menu a svg { width: 28px; height: 28px; flex: none; color: var(--blue); }
.menu a.on { background: var(--blue-l); color: var(--blue); }
.menu-logout { margin-top: auto; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--red, #B3261E); font: inherit; font-weight: 600; cursor: pointer; }

/* Äppeldienst-Stundenplan (views/aeppeln.js): Wochentage × gerade/ungerade Woche, je Feld bis zu zwei Chips + „Ich"-Knopf. */
.choretable { border-collapse: collapse; width: 100%; }
.choretable th, .choretable td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 14px; }
.choretable thead th { text-align: center; }
.choretable tbody th { font-weight: 700; white-space: nowrap; }
.choretable tr.today td, .choretable tr.today th { background: var(--blue-l); }
.cell-wrap { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
/* Anhänger: Tag nur teilweise belegt (mit Uhrzeit) – bleibt wählbar */
.month .teilweise { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #8C887A 4px, #8C887A 8px); border-color: #6F6B5E; }
/* Kompakte Dienstzeilen: Vornamen, kleines „+ Ich“, Abhakliste als kleine Zeile unter dem Dienst. */
.today[open] { gap: 0; }
/* Bezeichnung höchstens zweizeilig: reicht der Platz nicht (viele Namen mit Uhrzeit), rutschen die Namen in eine
   eigene Zeile darunter (rechtsbündig), statt die Bezeichnung auf vier Zeilen zu quetschen. */
.row.duty { flex-wrap: wrap; row-gap: 4px; padding: 4px 0; }
.row.duty > span:first-child { flex: 1 1 0; min-width: 8em; }
.row.duty .row-actions { align-items: center; gap: 6px; margin-left: auto; }
.btn.plus { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 6px 12px; border-color: var(--blue); color: var(--blue); white-space: nowrap; }
.choretable .btn.plus { font-size: 24px; line-height: 1; padding: 0; }
.sub { margin: -6px 0 0; font-size: 14px; color: var(--muted); }
p.sub { padding-bottom: 8px; }
.sub summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.sub summary::-webkit-details-marker { display: none; }
.sub summary::after { content: '›'; font-size: 18px; transition: transform .2s; }
.sub[open] summary::after { transform: rotate(90deg); }
.sub .check { font-size: 16px; }
.sub + .row { border-top: 1px solid var(--line); }
.sub[open] { padding-bottom: 10px; }

/* Ausdrucke (views/ausdrucke.js): Druckvorschau ist am Bildschirm schon sichtbar, @media print unten passt
   sie fürs A4-Blatt an (Rahmen weg, volle Breite). */
.printhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: center; }
.printhead img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.printdesc { display: grid; gap: 2px; justify-items: center; }
.printdesc small { color: var(--muted); font-size: 12px; }
.printtable { border-collapse: collapse; width: 100%; font-size: 14px; }
.printtable th, .printtable td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.printtable thead th { background: var(--blue-l); }
.printtable .weekhead td { font-weight: 800; background: var(--bg); border-top: 3px solid var(--text); }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  .top, .tabbar, .update, .toast, .no-print { display: none !important; }
  html, body { background: #fff; }
  main { max-width: none; margin: 0; padding: 0; gap: 8px; font-size: 11pt; }
  .tablewrap { overflow: visible; margin: 0; padding: 0; }
  .printtable { font-size: 10pt; }
  .printtable thead { display: table-header-group; }
  .printtable tr { break-inside: avoid; page-break-inside: avoid; }
}
.menu-search { display: grid; gap: 2px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-search input { margin-bottom: 4px; }
.menu .menu-search a span { display: grid; }
.menu .menu-search a small { color: var(--muted); font-weight: 400; font-size: 13px; }
.menu .menu-search p { margin: 4px 8px 0; font-size: 14px; }
.menu .menu-search a.inline { display: inline; min-height: 0; padding: 0; color: var(--blue); }
.menu-legal { display: flex; gap: 16px; margin: 8px 0 0; padding: 0 8px; }
.menu .menu-legal a { display: inline-flex; min-height: 44px; padding: 0; font-weight: 400; font-size: 14px; color: var(--muted); }
.card.legal > p, .card.legal > ul { margin: 0; }
.card.legal ul { padding-left: 20px; display: grid; gap: 6px; }
.weather-tip .rule summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; list-style: none; }
.weather-tip .rule summary::-webkit-details-marker { display: none; }
.weather-tip .rule summary::after { content: "›"; font-size: 18px; transition: transform .2s; }
.weather-tip .rule[open] summary::after { transform: rotate(90deg); }
.weather-tip .rule span { display: block; font-size: 14px; padding-bottom: 4px; }
/* Sehr schmale Handys (z. B. 320 px): Tagesknöpfe nicht quadratisch erzwingen, sonst laufen sie über die Spalten. */
@media (max-width: 380px) { .month button { aspect-ratio: auto; min-width: 0; } }
/* Gebuchte Tage deutlich erkennbar: nicht durch die Deckkraft gesperrter Tage verblassen lassen (Kontrast). */
.month .bestaetigt:disabled { opacity: 1; }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin: 0 4px 0 10px; border: 1px solid var(--line); }
.legend i:first-child { margin-left: 0; }
.legend .bestaetigt { background: #4E4B42; border-color: #4E4B42; }
.legend .angefragt { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #E8C500 3px, #E8C500 6px); border-color: #B89B00; }
.legend .teilweise { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #8C887A 3px, #8C887A 6px); border-color: #6F6B5E; }
.month .angefragt, .month .teilweise { font-weight: 800; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
/* Alte Adresse (workers.dev): Hinweis auf die neue Hauptadresse stall-orga.app. */
.moved { display: block; margin: 0; padding: 10px 16px; padding-top: calc(10px + var(--safe-t)); background: var(--yellow-l); color: #3D3300; text-align: center; font-weight: 700; text-decoration: none; }
.assign-others { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 8px; margin: 0; display: flex; flex-wrap: wrap; gap: 0 16px; }
.assign-others legend { font-size: 14px; color: var(--muted); padding: 0 4px; }
.consent { align-items: flex-start; } .consent input { margin-top: 3px; }
/* Meine Pferde: geplante Deckenwünsche an den Tages-Knöpfen – linke Hälfte morgens, rechte abends. */
.pills button.mark-morgens { background: linear-gradient(90deg, #C5C9F0 50%, #fff 50%); }
.pills button.mark-abends { background: linear-gradient(90deg, #fff 50%, #C5C9F0 50%); }
.pills button.mark-morgens.mark-abends { background: #C5C9F0; }
.pills button.on.mark-morgens { background: linear-gradient(90deg, #6A6FD0 50%, var(--blue) 50%); }
.pills button.on.mark-abends { background: linear-gradient(90deg, var(--blue) 50%, #6A6FD0 50%); }
.pills button.on.mark-morgens.mark-abends { background: #6A6FD0; }
.mark-legend { margin: 0; font-size: 13px; }
.mark-legend i { display: inline-block; width: 22px; height: 14px; border-radius: 7px; border: 1px solid var(--line); vertical-align: -2px; margin: 0 4px 0 8px; }
.mark-legend i:first-child { margin-left: 0; }
.mark-legend i.mark-morgens { background: linear-gradient(90deg, #C5C9F0 50%, #fff 50%); }
.mark-legend i.mark-abends { background: linear-gradient(90deg, #fff 50%, #C5C9F0 50%); }
/* Termine mit mehreren Pferden: Avatare nebeneinander, bei Bedarf umbrechen. */
.horses { display: flex; flex-wrap: wrap; gap: 6px 14px; }
/* Animierte Installations-Anleitung: vier Szenen à 3 s im Wechsel, Tipp-Kreis pulsiert, App-Symbol ploppt auf. */
.howto { display: grid; justify-items: center; gap: 4px; }
.howto svg { width: min(200px, 60vw); height: auto; }
.howto .sc, .howto .cap > span { opacity: 0; animation: howto-show 12s infinite both; }
.howto .sc2, .howto .cap > span:nth-child(2) { animation-delay: 3s; }
.howto .sc3, .howto .cap > span:nth-child(3) { animation-delay: 6s; }
.howto .sc4, .howto .cap > span:nth-child(4) { animation-delay: 9s; }
@keyframes howto-show { 0% { opacity: 0; } 2%, 23% { opacity: 1; } 25%, 100% { opacity: 0; } }
.howto .tap { fill: #0A84FF; transform-box: fill-box; transform-origin: center; animation: howto-tap 1.2s infinite; }
@keyframes howto-tap { 0% { transform: scale(.3); opacity: 0; } 30% { opacity: .55; } 100% { transform: scale(1.4); opacity: 0; } }
.howto .pop { transform-box: fill-box; transform-origin: center; animation: howto-pop 12s 9s infinite both; }
@keyframes howto-pop { 0% { transform: scale(0); } 4% { transform: scale(1.2); } 6%, 100% { transform: scale(1); } }
.howto .cap { display: grid; margin: 0; min-height: 2.8em; text-align: center; font-weight: 700; }
.howto .cap > span { grid-area: 1 / 1; }
@media (prefers-reduced-motion: reduce) { .howto { display: none; } }
/* Kopf je Jahreszeit (lib/ui.js SeasonFx): Farbverlauf (weiße Schrift überall ≥ 4,5:1) und Deko-Ebene hinter dem Text. */
.top.fruehling { background: linear-gradient(135deg, #2F7A32, #2A6B45); }
.top.sommer { background: radial-gradient(circle at 88% 0%, rgba(255, 210, 80, .5), transparent 42%), linear-gradient(135deg, #2F7A32, #5C7A1F); }
.top.herbst { background: linear-gradient(135deg, #2F7A32, #8A5A12); } /* goldener Herbst (Marius) */
.top.winter { background: linear-gradient(135deg, #2F5D8C, #1E3D5C); }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx i { position: absolute; top: 0; font-style: normal; line-height: 1; color: #fff; opacity: .85; animation: fx-fall linear infinite; }
.fx.flutter i { top: 20px; animation-name: fx-flutter; animation-timing-function: ease-in-out; }
@keyframes fx-fall { from { transform: translate(0, -30px) rotate(0); } to { transform: translate(var(--dx), 190px) rotate(var(--rot)); } }
@keyframes fx-flutter {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(calc(var(--dx) * 2), -12px) rotate(6deg); }
  50% { transform: translate(calc(var(--dx) * 4), 10px) rotate(-6deg); }
  75% { transform: translate(calc(var(--dx) * 2), -6px) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) { .fx i { animation: none; transform: translateY(50px); } }
/* Kleine Freude beim Eintragen (lib/ui.js cheer): Konfetti in den Stallfarben und zwei Hufeisen. */
.cheer { position: fixed; z-index: 30; width: 0; height: 0; pointer-events: none; }
.cheer i { position: absolute; left: -5px; top: -5px; width: 10px; height: 6px; border-radius: 2px; animation: cheer .9s cubic-bezier(.2, .7, .4, 1) forwards; }
.cheer i.c0 { background: var(--green); } .cheer i.c1 { background: #E8C500; } .cheer i.c2 { background: var(--blue); }
.cheer i.hoof { left: -12px; top: -12px; width: 24px; height: 24px; color: var(--green); }
.cheer i.hoof svg { width: 100%; height: 100%; }
@keyframes cheer {
  0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 26px)) scale(1) rotate(var(--r)); opacity: 0; }
}
/* Easter Egg (lib/ui.js useGallopEgg): weißes Galopp-Pferd quer über die Hufspuren. */
.egg { position: absolute; left: 0; bottom: 2px; z-index: 2; pointer-events: none; animation: egg-run 2.8s linear forwards; }
.egg .steed { width: 96px; height: 64px; background: url(icons/gallop.png) 0 0/1440px 64px no-repeat; filter: brightness(0) invert(1); animation: gallop-egg .6s steps(15) infinite; }
@keyframes gallop-egg { to { background-position: -1440px 0; } }
@keyframes egg-run { from { transform: translateX(-280px); } to { transform: translateX(110vw); } } /* Platz für die Credits */
.top h1 { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
@media (prefers-reduced-motion: reduce) { .egg { display: none; } }
/* Start: Meine Woche, Pferd des Tages, Countdown */
.countdowns { display: flex; flex-wrap: wrap; gap: 6px; }
.week-list { display: grid; }
.week-row { display: grid; grid-template-columns: 82px 1fr; gap: 8px; align-items: center; min-height: 44px; padding: 4px 0; color: inherit; text-decoration: none; }
.week-row + .week-row { border-top: 1px solid var(--line); }
.week-row.same { border-top: 0; } /* weitere Einträge desselben Tages ohne Trennlinie */
.week-day { font-size: 14px; font-weight: 700; color: var(--blue); }
.horse-day { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.horse-day > span:last-child { display: grid; gap: 2px; }
/* Hallenregeln (stalls.hall_rules) oben in der Halle; Zeilenumbrüche aus dem Admin-Textfeld bleiben erhalten. */
.hall-rules { gap: 4px; border-left: 5px solid var(--yellow); }
.hall-rules p { margin: 0; white-space: pre-line; }
/* Äppeldienst-Plan nie breiter als der Bildschirm (Marius, 16.10.): feste Spalten, Namen dürfen umbrechen,
   „+“-Auswahl schmal (sonst so breit wie der längste Name darin), auf schmalen Handys Tage gekürzt. */
.choretable { table-layout: fixed; }
.choretable thead th:first-child { width: 6.2em; }
.choretable .cell-wrap .chip { font-size: 13px; padding: 4px 8px; overflow-wrap: anywhere; }
.choretable select.plus { width: 48px; min-width: 48px; text-align: center; text-align-last: center; }
.choretable .day-short { display: none; }
@media (max-width: 400px) {
  .choretable thead th:first-child { width: 2.4em; }
  .choretable th, .choretable td { padding: 6px 4px; }
  .choretable .day-long { display: none; }
  .choretable .day-short { display: inline; }
}
/* Aktuelle Gruppe immer sichtbar (lib/bereich.js AreaBar). */
.area-bar { display: grid; gap: 8px; justify-items: center; }
.area-bar .chip { justify-self: center; }
/* Versteckte Credits: laufen beim Easter Egg wie ein kleines Banner hinter dem Pferd her (Marius, 17.10.2026). */
.egg { display: flex; align-items: flex-end; gap: 6px; }
.egg-credit { margin-bottom: 18px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--green-d); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Stundenplan der Halle: Stundenspalte + 7 Tage, eine Stunde = --hour hoch, Einträge absolut im Tag. */
.hallplan { gap: 10px; }
.plan { --hour: 44px; display: grid; grid-template-columns: 24px repeat(7, minmax(0, 1fr)); grid-template-rows: auto calc(var(--rows) * var(--hour)); font-size: 12px; }
.plan-dh { display: grid; justify-items: center; padding-bottom: 6px; line-height: 1.2; color: var(--muted); }
.plan-dh b { color: var(--text); }
.plan-dh.today, .plan-dh.today b { color: var(--blue); }
.plan-hours { display: grid; grid-template-rows: repeat(var(--rows), var(--hour)); color: var(--muted); font-size: 11px; line-height: 1; }
.plan-day { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, rgba(31, 42, 36, .1) 0 1px, transparent 1px var(--hour)); }
.plan-day.today { background-color: var(--blue-l); }
.plan-day.past { opacity: .55; }
.plan-b { position: absolute; margin: 1px; padding: 2px 3px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--green); border-radius: 6px; background: var(--green-l); color: var(--green-d); font: inherit; font-size: 11px; line-height: 1.15; text-align: left; cursor: pointer; }
.plan-b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-b.mine { border: 2px solid var(--green-d); font-weight: 700; }
