/* Farben hier anpassen, z. B. mit den Werten aus dem Wix-Editor der Hauptseite */
:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #2c2a25;
  --muted: #6f6a5f;
  --line: #e2dccf;
  --primary: #4d5c3f;      /* Moosgrün */
  --primary-ink: #ffffff;
  --accent: #9a7b4f;       /* Sattelbraun */
  --free: #e7efdd;
  --full: #efe9e1;
  --mine: #dfe8f3;
  --danger: #a33a2b;
  --warn-bg: #fbf1dc;
  --ok-bg: #e6f0dc;
  --err-bg: #f8e3df;
  --radius: 10px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--primary); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }

h1, h2, h3 { font-family: var(--serif); font-weight: normal; text-transform: uppercase; letter-spacing: .08em; line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.8em 0 .6em; color: var(--primary); }
h3 { font-size: 1rem; margin: 1.2em 0 .4em; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.lead { color: var(--muted); margin-top: -.4em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.neg { color: var(--danger); }
.pos { color: var(--primary); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }

/* Kopf */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 12px; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand-name { font-family: var(--serif); font-size: 1.6rem; letter-spacing: .22em; }
.brand-slogan { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: .95rem; }
.header-user { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.main-nav { border-top: 1px solid var(--line); }
.main-nav .wrap { display: flex; flex-wrap: wrap; gap: 4px 24px; padding-top: 6px; padding-bottom: 6px; }
.nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-right: 6px; }
.main-nav a { text-decoration: none; color: var(--ink); padding: 6px 10px; border-radius: 6px; font-size: .92rem; text-transform: uppercase; letter-spacing: .05em; }
.main-nav a:hover { background: var(--bg); }
.main-nav a.active { background: var(--primary); color: var(--primary-ink); }

.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 20px 0; font-size: .85rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-links a { margin-left: 14px; color: var(--muted); }

/* Bausteine */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 16px 0; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 20px; }
.hero { background: linear-gradient(rgba(40,45,30,.45), rgba(40,45,30,.45)), url('hero.jpg') center/cover, var(--primary); color: #fff; border-radius: var(--radius); padding: 40px 28px; margin-bottom: 8px; }
.hero h1 { color: #fff; margin: 0 0 .3em; }
.hero p { margin: 0; max-width: 560px; }

.flash { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; background: var(--ok-bg); }
.flash-error { background: var(--err-bg); }
.flash-warn { background: var(--warn-bg); }

.btn { display: inline-block; border: 1px solid var(--primary); background: var(--card); color: var(--primary); padding: 9px 16px; border-radius: 8px; font: inherit; font-size: .95rem; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--free); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #3e4b33; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-small { padding: 5px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
button.link.danger, .danger { color: var(--danger); }
form.inline { display: inline; }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
.form label.check, label.check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--ink); font-size: .95rem; }
label.check input { margin-top: 4px; }
input, select, textarea { font: inherit; color: var(--ink); padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
input[type=checkbox], input[type=radio] { padding: 0; width: 18px; height: 18px; accent-color: var(--primary); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: .85rem; color: var(--muted); padding: 0 4px; }
.row2, .row3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
.terms { background: var(--bg); border-radius: 8px; padding: 10px 14px; font-size: .9rem; }
.terms ul { margin: 6px 0 0; padding-left: 18px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 8px 0 16px; }
.inline-label { display: flex; align-items: center; gap: 8px; }
.week-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.tile-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tile-value { font-family: var(--serif); font-size: 1.6rem; }
.tile-action { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.tile-action .tile-label { color: rgba(255,255,255,.8); }

.list { padding-left: 18px; }
.list li { margin: 4px 0; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0 16px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: normal; background: #fbfaf6; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { white-space: nowrap; }
.table .actions > * { margin-right: 10px; }
.table tfoot td { background: #fbfaf6; }

.badge { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--full); }
.badge-attended { background: var(--free); }
.badge-noshow, .badge-late { background: var(--warn-bg); }
.badge-school_cancelled, .badge-cancelled, .badge-late_replaced { background: #eee; color: var(--muted); }

/* Kalender */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }
.day-head { font-family: var(--serif); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.day-head span { color: var(--muted); }
.day-empty { color: var(--line); text-align: center; padding-top: 10px; }
.day-closed { font-size: .8rem; background: var(--warn-bg); border-radius: 6px; padding: 4px 6px; }
.slot { display: flex; gap: 8px; text-decoration: none; color: var(--ink); border-radius: 8px; padding: 6px 8px; font-size: .82rem; line-height: 1.35; border: 1px solid transparent; }
.slot:hover { border-color: var(--primary); }
.slot-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.slot-free { background: var(--free); }
.slot-full { background: var(--full); color: var(--muted); }
.slot-mine { background: var(--mine); }
.slot-nofit { background: #f4f4f2; color: #aaa; }
.slot-cancelled { background: #f4f4f2; color: #999; text-decoration: line-through; }
.legend { color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.dot.free { background: var(--free); } .dot.full { background: var(--full); } .dot.mine { background: var(--mine); }

.cards { display: flex; flex-direction: column; gap: 10px; }
.booking { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.booking.highlight { border-color: var(--primary); box-shadow: 0 0 0 2px var(--free); }
.booking-main { display: flex; flex-direction: column; gap: 2px; }
.booking-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.teach-list { display: flex; flex-direction: column; gap: 6px; }
.date-head { margin-top: 1.2em; }
.teach-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; text-decoration: none; color: var(--ink); }
.teach-row:hover { border-color: var(--primary); }
.danger-zone { border-color: #e7c7c1; }

@media (max-width: 860px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .day-empty { display: none; }
  .row3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .brand-name { font-size: 1.25rem; letter-spacing: .16em; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .slot { font-size: .95rem; padding: 10px 12px; }
  .btn { padding: 11px 16px; }
  .card { padding: 16px; }
  .footer-links a { margin: 0 14px 0 0; }
}

.form > .btn, .form > button { align-self: flex-start; }
@media (max-width: 860px) { .day.day-none { display: none; } }
@media (max-width: 560px) { .form > .btn, .form > button { align-self: stretch; } }
.test-banner { background: #a33a2b; color: #fff; text-align: center; font-size: .85rem; padding: 6px 12px; letter-spacing: .05em; }
.sub-group { align-items: flex-start; }
.sub-slots { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); width: 100%; display: flex; flex-direction: column; gap: 6px; }
.sub-slots li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .92rem; }
.date-sub { font-family: var(--sans); text-transform: none; letter-spacing: 0; margin-left: 10px; }
.custom-time { margin-left: 26px; }

/* Nachrichten */
.pill { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .75rem; text-align: center; line-height: 1.5; }
.msg-link { text-decoration: none; }
.msg-link.has-unread { font-weight: 600; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin: 0; }
.conv-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.conv { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; color: var(--ink); }
.conv:hover { border-color: var(--primary); }
.conv.unread { border-left: 4px solid var(--primary); }
.conv-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.conv-snippet { grid-column: 1; color: var(--muted); font-size: .92rem; }
.conv .pill { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.thread { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; max-width: 760px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.msg.own { align-self: flex-end; background: var(--free); border-color: #d3dfc4; border-bottom-right-radius: 4px; }
.msg.other { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-context { font-size: .78rem; color: var(--accent); margin-bottom: 4px; }
.msg-meta { font-size: .75rem; color: var(--muted); margin-top: 4px; text-align: right; }
.reply { max-width: 760px; }
@media (max-width: 560px) { .msg { max-width: 92%; } }
.temp-pw { border-color: var(--primary); }
.temp-pw-value { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .08em; background: var(--bg); padding: 10px 14px; border-radius: 8px; display: inline-block; user-select: all; margin: 4px 0; }

/* Wochenvorlage als Raster */
.tgrid-toolbar { gap: 8px 10px; }
.tpick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink); background: var(--card); font-size: .92rem; }
.tpick .dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--tc); }
.tpick.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.tpick.active .dot { background: #fff; }
.c1 { --tc: #4d5c3f; } .c2 { --tc: #9a7b4f; } .c3 { --tc: #3d6b8c; } .c4 { --tc: #a3543b; }
.c5 { --tc: #6b4f8c; } .c6 { --tc: #2f7d6b; } .c7 { --tc: #8c7a2f; } .c8 { --tc: #8c3d63; }
.tgrid-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.tgrid { border-collapse: collapse; width: 100%; min-width: 760px; table-layout: fixed; }
.tgrid th { font-family: var(--serif); font-weight: normal; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; padding: 8px 4px; color: var(--muted); background: #fbfaf6; position: sticky; top: 0; }
.tgrid th.tgrid-time { width: 58px; font-family: var(--sans); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; text-align: right; padding-right: 8px; vertical-align: top; background: #fbfaf6; position: sticky; left: 0; }
.tgrid tbody th.tgrid-time { font-size: .78rem; padding-top: 4px; }
.tgrid tr.half-hour th.tgrid-time { color: #b8b1a3; }
.tgrid td { padding: 0; border-left: 1px solid var(--line); height: 30px; }
.tgrid tr.full-hour td, .tgrid tr.full-hour th { border-top: 1px solid var(--line); }
.tgrid tr.half-hour td { border-top: 1px dashed #eee8dc; }
.tcell form { height: 100%; }
.tcell button { width: 100%; height: 100%; min-height: 30px; border: 0; background: transparent; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 2px 4px; font: inherit; text-align: left; position: relative; }
.tcell button:disabled { cursor: default; }
.tcell button:not(:disabled):hover { background: var(--free); outline: 1px solid var(--primary); outline-offset: -1px; }
.tcell.is-sel button { background: #dfe8d3; }
.tcell.sel-run button { background: #eef3e7; }
.tcell.busy { opacity: .4; }
.tchip { display: inline-block; font-size: .72rem; line-height: 1.2; padding: 2px 6px; border-radius: 4px; color: #fff; background: var(--tc, #888); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tchip-sel { background: var(--primary); font-weight: 600; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--primary); }
.tnote { font-size: .68rem; color: var(--muted); }
.trun { display: inline-block; width: 8px; align-self: stretch; min-height: 22px; border-radius: 2px; background: var(--tc, #888); opacity: .35; }
.trun-sel { background: var(--primary); opacity: .6; }
.tplus { color: transparent; font-size: 1rem; margin: auto; }
.tcell button:not(:disabled):hover .tplus { color: var(--primary); }
.tplus-legend { display: inline-block; width: 18px; text-align: center; border: 1px dashed var(--primary); border-radius: 4px; color: var(--primary); }
.legend .tchip { margin-left: 8px; }
details.card summary { cursor: pointer; font-family: var(--serif); text-transform: uppercase; letter-spacing: .08em; color: var(--primary); }
.assign-row { margin: 2px 0; }

/* Stunde eintragen: Wochenkalender */
.bgrid { min-width: 860px; }
.bgrid th.today { color: var(--primary); font-weight: 600; }
.closed-note { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: .7rem; color: var(--danger); }
.bgrid td.bcell { height: 34px; vertical-align: top; padding: 1px 2px; }
.bcell.past { background: #f6f5f1; }
.bcell.closed { background: repeating-linear-gradient(45deg, transparent, transparent 6px, #f8ebe8 6px, #f8ebe8 8px); }
.bcell.selected { outline: 2px solid var(--primary); outline-offset: -2px; }
.bfree { display: block; height: 100%; min-height: 30px; text-decoration: none; color: transparent; text-align: center; line-height: 30px; border-radius: 4px; }
.bfree:hover, .bfree:focus { color: var(--primary); background: var(--free); outline: 1px dashed var(--primary); }
.blesson { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; text-decoration: none; color: var(--ink); border-radius: 5px; padding: 3px 6px; font-size: .76rem; line-height: 1.25; margin-bottom: 1px; border-left: 3px solid var(--primary); }
.blesson.full { background: #e4e9dc; }
.blesson.open { background: #fff; border: 1px dashed var(--primary); border-left-width: 3px; border-left-style: solid; }
.blesson.open:hover { background: var(--free); }
.blesson.offline { border-left-color: var(--accent); }
.bcell.past .blesson { opacity: .6; }
.bl-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.bl-names em { color: var(--primary); font-style: normal; }
.bl-tag { font-size: .65rem; color: var(--muted); }
.brun { display: block; height: 30px; border-left: 3px solid var(--primary); background: #eef2e8; border-radius: 0 0 5px 5px; margin-top: -2px; }
.blesson-legend { display: inline-block; font-size: .72rem; padding: 1px 6px; border-radius: 4px; border-left: 3px solid var(--primary); margin-left: 8px; }
.blesson-legend.open { border: 1px dashed var(--primary); border-left: 3px solid var(--primary); }
.blesson-legend.full { background: #e4e9dc; }
.book-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; width: min(480px, 94vw); box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.book-dialog::backdrop { background: rgba(30, 32, 25, .35); }
.book-dialog h2 { margin-top: 0; }
dialog.book-dialog[open]:not(:modal) { position: static; margin: 16px 0; box-shadow: none; }

/* Termine: Wochenraster aller Reitlehrer */
.tlegend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .85rem; }
.tpick-mini { display: inline-flex; align-items: center; gap: 5px; }
.tpick-mini .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); }
.tlesson { display: flex; flex-wrap: wrap; gap: 0 5px; align-items: baseline; text-decoration: none; color: var(--ink); border-radius: 5px; padding: 3px 6px; font-size: .74rem; line-height: 1.25; margin-bottom: 2px; border-left: 4px solid var(--tc); background: color-mix(in srgb, var(--tc) 16%, #fff); }
.tlesson.open { background: #fff; outline: 1px dashed var(--tc); outline-offset: -1px; }
.tlesson.open .bl-names em { color: var(--tc); font-style: normal; font-weight: 600; }
.tlesson.offline { background-image: repeating-linear-gradient(135deg, transparent, transparent 5px, rgba(154,123,79,.12) 5px, rgba(154,123,79,.12) 7px); }
.tlesson.cancelled { opacity: .45; text-decoration: line-through; background: #f2f2f0; }
.tlesson:hover { filter: brightness(.96); outline: 1px solid var(--tc); }
.bl-teacher { font-weight: 600; color: var(--tc); }
.bl-sub { flex-basis: 100%; font-size: .66rem; color: var(--danger); font-weight: 600; }
.bcell.past .tlesson { opacity: .55; }
.brun-t { display: block; height: 26px; border-left: 4px solid var(--tc); background: color-mix(in srgb, var(--tc) 10%, #fff); border-radius: 0 0 5px 5px; margin: -2px 0 2px; }
.brun-t.cancelled { opacity: .3; }
.blesson-legend.offline { background-image: repeating-linear-gradient(135deg, transparent, transparent 5px, rgba(154,123,79,.2) 5px, rgba(154,123,79,.2) 7px); }
.icon-sub { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--danger); border-radius: 50%; width: 18px; height: 18px; vertical-align: middle; flex: none; }
.icon-sub svg { width: 12px; height: 12px; }

/* Termin-Detailseite */
.slot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.slot-head h1 { margin-bottom: .2em; }
.slot-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; text-align: center; display: flex; flex-direction: column; min-width: 120px; }
.slot-stat strong { font-family: var(--serif); font-size: 1.6rem; font-weight: normal; }
.slot-stat span { font-size: .8rem; color: var(--muted); }
.slot-stat.cancelled { border-color: var(--danger); color: var(--danger); }
.slot-section { margin-top: 26px; }
.slot-section > h2 { margin-top: 0; }
.teacher-head { color: var(--muted); margin: 14px 0 6px; }
.rider-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 10px; }
.rider-main { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.rider-name { font-size: 1.08rem; margin-right: 10px; }
.rider-facts { color: var(--muted); font-size: .9rem; }
.rider-contact { margin: 4px 0 0; }
.rider-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.rider-actions form { display: inline-flex; margin: 0; }
.act-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; border-right: 1px solid var(--line); background: #fff; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--ink); }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--bg); }
.seg-btn.on { color: #fff; font-weight: 600; }
.seg-btn.seg-attended { background: var(--primary); }
.seg-btn.seg-noshow { background: var(--danger); }
.seg-btn.seg-booked { background: var(--muted); }
.free-card { border-style: dashed; background: transparent; }
.free-card summary { cursor: pointer; color: var(--primary); font-weight: 600; list-style: none; }
.free-card summary::-webkit-details-marker { display: none; }
.free-plus { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--primary); align-items: center; justify-content: center; margin-right: 6px; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.inline-form label { flex: 1 1 200px; }
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; }
.action summary { cursor: pointer; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.action summary::-webkit-details-marker { display: none; }
.action summary strong { color: var(--primary); }
.action summary strong::before { content: '›'; display: inline-block; width: 14px; transition: transform .15s; }
.action[open] summary strong::before { transform: rotate(90deg); }
.action summary span { font-size: .85rem; color: var(--muted); padding-left: 14px; }
.action > form { padding: 0 16px 16px 30px; }
.action-danger summary strong { color: var(--danger); }
.history summary { cursor: pointer; color: var(--muted); }

/* ================= Version 5: Icons, Handy-Ansicht ================= */
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; }
.btn-small { min-height: 34px; }
.btn .i { width: 18px; height: 18px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.btn-small.btn-icon { width: 34px; height: 34px; }
.btn-icon.plain { border-color: transparent; background: transparent; }
.btn-icon.plain:hover { background: var(--free); }
.btn-danger.btn-primary { background: var(--danger); color: #fff; }
.icon-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.warn-ico { color: #b5651d; }
.warn-ico .i { width: 16px; height: 16px; vertical-align: -3px; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; padding: 2px 8px; border-radius: 99px; background: var(--warn-bg); color: #7a4a12; }
.flag .i { width: 14px; height: 14px; }

/* Kopf */
.header-user { gap: 4px; }
.header-user form { margin: 0; }
.hbtn { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; }
.hbtn:hover { background: var(--bg); }
.hbtn .pill { position: absolute; top: 2px; right: 0; font-size: .65rem; min-width: 16px; padding: 0 4px; }
.main-nav a { display: inline-flex; align-items: center; gap: 6px; }
.main-nav a .i { width: 17px; height: 17px; opacity: .8; }
.main-nav a.active .i { opacity: 1; }
.nav-mobile-only { display: none !important; }
.tabbar { display: none; }

/* Wochennavigation kompakt */
.week-nav { gap: 6px; }
.week-nav strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.week-nav input[type=date] { padding: 6px 8px; }
.daytabs { display: none; }

/* Formular-Zeile mit Icon-Knopf */
.field-row { display: flex; gap: 8px; align-items: flex-end; }
.field-row > label, .field-row > select, .field-row > input { flex: 1; }

/* Pferde */
.horse-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.horse-line form { display: flex; gap: 6px; align-items: center; flex: 1 1 220px; margin: 0; }
.horse-line select { flex: 1; }
.horse-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.horse-warn { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.horse-list { display: flex; flex-direction: column; gap: 8px; }
.horse-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 10px 16px; }
.horse-row.inactive { opacity: .55; }
.horse-row .grow { flex: 1; min-width: 0; }
.horse-row .facts { color: var(--muted); font-size: .88rem; }
.tl-warn { display: inline-flex; color: #b5651d; }
.tl-warn .i { width: 14px; height: 14px; }

/* Listen-Karten (Handy-Tabellen) */
.rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 16px; }
.row-card { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 10px 16px; color: var(--ink); text-decoration: none; }
a.row-card:hover { border-color: var(--primary); }
.row-card .grow { flex: 1; min-width: 0; }
.row-card .sub { color: var(--muted); font-size: .86rem; }
.row-card .end { text-align: right; white-space: nowrap; }

@media (min-width: 761px) {
  .hide-lg { display: none !important; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  body.has-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .hide-sm { display: none !important; }
  .wrap { padding: 0 12px; }
  main.wrap { padding-top: 14px; padding-bottom: 24px; }
  h1 { font-size: 1.2rem; letter-spacing: .06em; margin-bottom: .5em; }
  h2 { font-size: 1rem; margin-top: 1.4em; }
  .header-inner { flex-direction: row; align-items: center; padding-top: 8px; padding-bottom: 8px; }
  .brand-name { font-size: 1.02rem; letter-spacing: .16em; }
  .brand-slogan, .hname { display: none; }
  .site-footer { font-size: .78rem; padding: 14px 0; }
  .site-footer .wrap { flex-direction: column; gap: 6px; }
  .footer-links a { margin: 0 12px 0 0; }
  .test-banner { font-size: .72rem; padding: 3px 8px; }

  /* Menü als Blatt über der Leiste */
  .has-tabs .main-nav { display: none; position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 40; max-height: 72vh; overflow-y: auto; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -12px 30px rgba(0,0,0,.15); border-radius: 16px 16px 0 0; }
  .menu-open .main-nav { display: block; }
  .menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(30,32,25,.3); z-index: 30; }
  .main-nav .wrap { flex-direction: column; gap: 4px; padding: 12px; }
  .nav-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .nav-label { grid-column: 1 / -1; margin: 8px 0 2px 4px; }
  .main-nav a { padding: 12px 10px; font-size: .9rem; text-transform: none; letter-spacing: 0; background: var(--bg); border-radius: 10px; }
  .nav-mobile-only { display: grid !important; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 6px; min-height: 56px; justify-content: center; text-decoration: none; color: var(--muted); font: inherit; font-size: .68rem; background: none; border: 0; position: relative; border-radius: 10px; cursor: pointer; }
  .tabbar .i { width: 24px; height: 24px; }
  .tabbar .active { color: var(--primary); font-weight: 600; }
  .tabbar .active .i { stroke-width: 2.2; }
  .tabbar .pill { position: absolute; top: 3px; left: 50%; margin-left: 6px; font-size: .62rem; min-width: 16px; padding: 0 4px; }

  /* Bausteine */
  .card { padding: 14px; border-radius: 12px; }
  .toolbar { gap: 8px; margin: 6px 0 10px; }
  .title-row { flex-wrap: nowrap; }
  .title-row h1 { flex: 1; min-width: 0; }
  .btn { min-height: 44px; }
  .btn-small { min-height: 38px; }
  .btn-icon { width: 44px; height: 44px; }
  .btn-small.btn-icon { width: 38px; height: 38px; }
  input, select, textarea { font-size: 16px; padding: 10px; }
  .table th, .table td { padding: 8px 10px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 12px; }
  .tile-value { font-size: 1.3rem; }
  .booking { padding: 12px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form label { flex: none; }

  /* Wochenraster: auf dem Handy ein Tag */
  .daytabs { display: flex; gap: 4px; margin: 0 0 8px; overflow-x: auto; }
  .daytabs button { flex: 1 0 auto; min-width: 44px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 4px; font: inherit; font-size: .78rem; line-height: 1.2; color: var(--ink); cursor: pointer; }
  .daytabs button b { display: block; font-size: .95rem; }
  .daytabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
  .daytabs button.today:not(.on) { border-color: var(--primary); color: var(--primary); }
  .daytabs button.closed:not(.on) { background: #f8ebe8; }
  .tgrid.daygrid { min-width: 0; }
  .tgrid.daygrid th.tgrid-time { width: 52px; }
  .tgrid.daygrid thead { display: none; }
  .daygrid[data-day="1"] tr > :not(:first-child):not(:nth-child(2)),
  .daygrid[data-day="2"] tr > :not(:first-child):not(:nth-child(3)),
  .daygrid[data-day="3"] tr > :not(:first-child):not(:nth-child(4)),
  .daygrid[data-day="4"] tr > :not(:first-child):not(:nth-child(5)),
  .daygrid[data-day="5"] tr > :not(:first-child):not(:nth-child(6)),
  .daygrid[data-day="6"] tr > :not(:first-child):not(:nth-child(7)),
  .daygrid[data-day="7"] tr > :not(:first-child):not(:nth-child(8)) { display: none; }
  .daygrid td.bcell { height: 40px; }
  .daygrid .bfree { min-height: 38px; line-height: 38px; color: #cfc8b8; }
  .daygrid .blesson, .daygrid .tlesson { font-size: .9rem; padding: 6px 10px; gap: 2px 8px; }
  .daygrid .bl-tag, .daygrid .bl-sub { font-size: .75rem; }
  .daygrid .tcell button { min-height: 40px; }
  .daygrid .tchip { font-size: .85rem; padding: 4px 8px; }
  .daygrid .tplus { color: #cfc8b8; }
  .tgrid-scroll { border-radius: 12px; }

  /* Termin-Detail */
  .slot-head { flex-wrap: nowrap; align-items: center; }
  .slot-stat { min-width: 0; padding: 6px 12px; }
  .slot-stat strong { font-size: 1.2rem; }
  .rider-card { padding: 12px; }
  .rider-actions { gap: 8px; }
  .seg-btn { padding: 8px 12px; min-height: 40px; }
  .action summary { padding: 12px 14px; }
  .action > form { padding: 0 14px 14px; }
  .book-dialog { padding: 16px; width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .msg { max-width: 92%; }
}
.week-pick { position: relative; display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; min-height: 34px; }
.week-pick input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.week-pick input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
@media (max-width: 760px) { .week-pick { min-height: 38px; } }
.teach-row .grow { flex: 1; min-width: 0; }
.teach-row .i-horse { width: 15px; height: 15px; vertical-align: -3px; margin: 0 2px 0 4px; }
.date-head.title-row { font-size: .95rem; margin-bottom: 4px; }
.date-head .btn-icon { margin-left: auto; }
.row-card > .i-right { color: var(--muted); }
@media (max-width: 760px) { .teach-row { gap: 10px; padding: 12px; } }
.rider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.rider-grid .rider-card { margin: 0; }
.chip-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 5px 10px; font: inherit; font-size: .85rem; color: var(--ink); cursor: pointer; min-height: 32px; list-style: none; }
.chip-btn::-webkit-details-marker { display: none; }
.chip-btn .i { width: 15px; height: 15px; }
.chip-btn.on { background: var(--free); border-color: #c7d6b5; color: var(--primary); }
.chip-btn.teacher { background: #fff; }
.chip-btn.teacher .i { opacity: .5; }
.add-teacher[open] { flex-basis: 100%; }
.add-teacher form { margin-top: 8px; }
.next-lesson { margin-left: auto; }
.filter-bar input[type=search] { flex: 1 1 160px; }
.filter-bar select { flex: 0 1 auto; }
@media (max-width: 760px) { .rider-grid { grid-template-columns: 1fr; } .filter-bar { display: grid; grid-template-columns: 1fr 1fr auto; } .filter-bar input[type=search] { grid-column: 1 / -1; } }
.reply-bar { display: flex; gap: 8px; align-items: flex-end; max-width: 760px; }
.reply-bar textarea { flex: 1; resize: vertical; }
.chips { gap: 6px; }
a.chip-btn { text-decoration: none; }
.slot-head .btn-icon { align-self: center; }
.title-row .btn-icon.plain { margin-left: -8px; }
.free-plus .i { width: 14px; height: 14px; }
.seg-btn .i { width: 18px; height: 18px; vertical-align: -4px; }
.action summary strong { display: inline-flex; align-items: center; gap: 8px; }
.action summary strong::before { content: none; }
.action summary strong .i { width: 18px; height: 18px; }
.badge .i { width: 14px; height: 14px; vertical-align: -3px; }
.horse-name .i, .horse-line > form > .i { width: 20px; height: 20px; color: var(--accent); }
.history summary { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: .9rem; }
.sum-sm { white-space: nowrap; }
.booking-main .i-horse { width: 16px; height: 16px; color: var(--accent); }
.horse-row { text-decoration: none; color: var(--ink); } .horse-row:hover { border-color: var(--primary); } .horse-row > .i-edit { color: var(--muted); }
.horse-line form { max-width: 420px; }
.seg-btn.seg-level-on { background: var(--accent); } .seg-level { margin-left: auto; }
.hero-claim { font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; margin: 0; } @media (max-width: 760px) { .hero { padding: 24px 18px; } .hero-claim { font-size: 1.1rem; } }
/* Interne Notiz */
.staff-note { margin-top: 10px; border-radius: 10px; background: #fbf6e6; border: 1px solid #efe2b8; padding: 8px 10px; }
.staff-note:not(.has-note) { background: transparent; border-style: dashed; border-color: var(--line); }
.staff-note summary { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; list-style: none; font-size: .92rem; }
.staff-note summary::-webkit-details-marker { display: none; }
.staff-note summary .i { width: 16px; height: 16px; margin-top: 2px; color: #a08a3c; flex: none; }
.staff-note details[open] summary .note-text { display: none; }
.staff-note details[open] summary::after { content: 'Interne Notiz'; font-size: .8rem; color: var(--muted); }
.staff-note details[open] summary .muted { display: none; }
.note-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.note-form textarea { flex: 1; min-height: 70px; }
.note-meta { display: block; font-size: .75rem; color: var(--muted); margin: 4px 0 0 24px; }
.note-preview .i { width: 13px; height: 13px; color: #a08a3c; vertical-align: -2px; }
.rider-name a { color: inherit; text-decoration: none; }
.rider-name a:hover { text-decoration: underline; }
.row-card .sub .i-horse { width: 14px; height: 14px; vertical-align: -2px; }
.game-teaser { display: flex; align-items: center; gap: 14px; margin-top: 14px; text-decoration: none; color: var(--ink); }
.game-teaser:hover { border-color: var(--primary); }
.game-teaser .grow { flex: 1; }
.game-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--free); color: var(--primary); flex: none; }
.game-icon .i { width: 26px; height: 26px; }
