/* Termine: Wochenansicht und „Auswählen“ (mehrere absagen) – geladen nach styles.css. Artfarben über --k / --k-soft
   (Klassen .t-* in styles.css), Bedeutungsfarben nur für den Zusage-Stand, immer mit Wort und Zeichen. */

/* ---------------------------------------------------------------- Kopf der Termine
   Eine Leiste über Liste, Woche und Monat: links die Art (Reiter), rechts Liste · Woche · Monat. Ist die Leiste zu
   schmal für beides (Handy, schmales Fenster), steht die Art als Auswahlfeld neben dem Umschalter – eine Zeile statt
   zwei, nichts wird unbemerkt abgeschnitten. Die Breite der Leiste entscheidet (container query), nicht die des Geräts. */
.term-bar { container-type:inline-size; margin:0 0 16px; }
.term-row { display:flex; align-items:flex-end; gap:8px 12px; border-bottom:1px solid var(--line); }
.term-row .tabs { flex:1 1 auto; min-width:0; margin:0; border-bottom:0; }
.term-kind { display:none; }
.term-seg { flex:none; align-self:center; margin:4px 0; }
@container (max-width:700px) {
  .term-row { align-items:center; border-bottom:0; }
  .term-row .tabs { display:none; }
  .term-seg { order:1; margin:0; }
  .term-kind { display:block; order:2; flex:0 1 190px; width:auto; min-width:0; margin-left:auto; }
}
/* Handy: „Kalender abonnieren“ rechts neben dem Titel, die Beschreibung „Trainings, Spiele und Turniere“ entfällt. */
@media (max-width:660px) {
  .term-title { display:flex; align-items:baseline; gap:4px 12px; flex-wrap:wrap; flex:1 1 100%; min-width:0; }
  /* rechts 6 px Luft: die unsichtbar vergrößerte Tippfläche des Links (::after, styles.css) ragt sonst über den Rand */
  .term-title p { margin:0 0 0 auto; padding-right:6px; }
  .term-sub { display:none; }
  .term-head { gap:10px; margin-bottom:10px; }
  .term-bar { margin-bottom:12px; }
  .term-kind { min-height:44px; }
}

/* ---------------------------------------------------------------- Woche */
.wv-head { gap:8px; flex-wrap:wrap; }
.wv-head h3 { min-width:220px; text-align:center; }
.wv-short, .wv-run { display:none; }
.wv-kw { color:var(--ink-3); font-weight:600; }
.wv-grid { border-top:1px solid var(--line); }
/* Computer, je Tag eine Spalte */
.wv-days { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); }
.wv-col { border-right:1px solid var(--line); padding:6px; display:flex; flex-direction:column; gap:6px; min-width:0; min-height:140px; }
.wv-col:last-child { border-right:0; }
/* Computer, je Mannschaft eine Spalte (jede Zeile ein eigenes Raster mit gleich vielen Zellen → Spalten fluchten) */
.wv-teams { overflow-x:auto; }
.wv-row { display:grid; grid-template-columns:104px; grid-auto-flow:column; grid-auto-columns:minmax(118px, 1fr); border-bottom:1px solid var(--line); }
.wv-row:last-child { border-bottom:0; }
.wv-hrow { background:var(--surface-2); }
.wv-corner, .wv-th { padding:6px 8px; font-size:var(--fs-foot); font-weight:600; color:var(--ink-3); }
.wv-th { border-left:1px solid var(--line); overflow-wrap:anywhere; }
.wv-cell { border-left:1px solid var(--line); padding:6px; display:flex; flex-direction:column; gap:6px; min-width:0; }
.wv-cell-team { display:none; }
.wv-teams .wv-dayh { padding:8px; }
.wv-dayh { font-size:var(--fs-sub); color:var(--ink-2); }
.wv-wd { font-weight:700; color:var(--ink); }
.wv-is-today .wv-dayh .wv-wd { color:var(--accent); }
.wv-today { font-size:var(--fs-cap); font-weight:700; color:var(--on-color); background:var(--accent); border-radius:999px; padding:0 7px; }
.wv-none { display:none; color:var(--ink-3); }
/* Eintrag: Artfarbe als Fläche und Strich links, Kürzel als Schildchen – die Farbe steht nie allein */
.wv-ev { display:flex; flex-direction:column; gap:2px; text-align:left; width:100%; min-width:0; border:0; border-radius:8px; padding:6px 8px;
  font:inherit; font-size:var(--fs-sub); color:var(--ink); cursor:pointer;
  background:var(--k-soft, var(--kind-training-soft)); box-shadow:inset 3px 0 0 var(--k, var(--kind-training)); }
.wv-ev:hover { filter:brightness(.97); }
.wv-ev:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.wv-ev.cancelled .wv-title, .wv-ev.cancelled .wv-time { text-decoration:line-through; }
.wv-line { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.wv-k { display:inline-block; font-style:normal; font-size:var(--fs-cap); font-weight:700; line-height:1.35; padding:0 3px; border-radius:4px;
  background:var(--surface); color:var(--k, var(--kind-training)); box-shadow:inset 0 0 0 1px var(--k, var(--kind-training)); }
.wv-time { font-weight:700; }
.wv-team { font-weight:600; color:var(--ink-2); }
.wv-title { font-weight:600; overflow-wrap:anywhere; }
.wv-loc { color:var(--ink-2); font-size:var(--fs-foot); overflow-wrap:anywhere; }
.wv-sts { display:flex; flex-wrap:wrap; gap:2px 8px; }
.wv-st { font-size:var(--fs-foot); font-weight:600; color:var(--ink-2); }
.wv-st-yes { color:var(--green); }
.wv-st-no { color:var(--red); }
.wv-st-open, .wv-st-wait, .wv-st-maybe { color:var(--amber); }
.wv-leg-st { color:var(--ink-2); }

/* Handy: Liste je Tag – leere Tage in einer Zeile, Mannschaft als kleine Überschrift über ihren Terminen */
@media (max-width:700px) {
  /* Kopf in einer Zeile: ‹ KW 47 · 16.–22.11. › Heute */
  .wv-head, .mv-head { flex-wrap:wrap; gap:6px; padding:8px 10px; }
  .wv-head h3, .mv-head h3 { min-width:0; flex:1 1 0; text-align:center; font-size:var(--fs-body); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .wv-head .btn, .mv-head .btn { min-width:44px; padding-inline:10px; }
  .wv-head .spacer, .mv-head .spacer { display:none; }
  .wv-head [data-week-print], .mv-head .mv-clash-toggle { flex:1 1 100%; justify-content:center; }
  .mv-noclash { display:none; }
  .wv-long { display:none; }
  .wv-short { display:inline; }
  .wv-days, .wv-teams { display:block; overflow:visible; }
  .wv-col, .wv-row { display:block; border-right:0; border-bottom:1px solid var(--line); padding:8px 12px; min-height:0; }
  .wv-hrow { display:none; }
  .wv-teams .wv-dayh { padding:0; }
  .wv-dayh { font-size:var(--fs-body); margin-bottom:6px; }
  /* Freie Tage leise und niedrig; mehrere hintereinander in einer Zeile („Mo–Mi 16.–18.11. · keine Termine“). */
  .wv-col.wv-empty, .wv-row.wv-empty { padding-block:6px; }
  .wv-empty .wv-dayh { margin-bottom:0; color:var(--ink-3); font-size:var(--fs-sub); }
  .wv-empty .wv-wd { color:var(--ink-2); }
  .wv-run-first .wv-one { display:none; }
  .wv-run-first .wv-run { display:inline; }
  .wv-col.wv-run-more, .wv-row.wv-run-more { display:none; }
  .wv-none { display:inline; }
  .wv-cell { border-left:0; padding:0; margin-bottom:6px; }
  .wv-cell-empty { display:none; }
  .wv-cell-team { display:block; font-size:var(--fs-foot); font-weight:600; color:var(--ink-3); }
  .wv-col > .wv-ev + .wv-ev, .wv-cell > .wv-ev + .wv-ev { margin-top:6px; }
  .wv-ev { min-height:44px; padding:8px 10px; font-size:var(--fs-body); }
}

/* Wochenplan drucken (Leitung): Druckbereich .print-box.wv-print (print.js), A4 quer – hier nur das Blatt */
@media print {
  .wv-print { color:#000; font:9pt/1.3 var(--sans); }
  .wv-print h1 { font-size:14pt; margin:0 0 6px; }
  .wv-print table { width:100%; border-collapse:collapse; table-layout:fixed; }
  .wv-print th, .wv-print td { border:1px solid #888; padding:3px 4px; vertical-align:top; text-align:left; }
  .wv-print thead th { background:#eee; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .wv-print tbody th { width:24mm; }
  .wv-print .wvp-ev + .wvp-ev { margin-top:3px; }
  .wv-print .wvp-ev.cancelled { text-decoration:line-through; }
  .wv-print p { margin:6px 0 0; font-size:8pt; }
}

/* ---------------------------------------------------------------- Auswählen: mehrere Termine absagen */
.bd-hint { border-bottom:1px solid var(--line); }
.bd-row { display:flex; gap:12px; align-items:flex-start; padding:12px 16px; border-bottom:1px solid var(--line); cursor:pointer; min-height:44px; }
.bd-row:last-child { border-bottom:0; }
.bd-row:hover { background:var(--surface-2); }
.bd-row.bd-on { background:var(--accent-soft); }
.bd-row.bd-off { cursor:default; opacity:.7; }
.bd-row .cb { margin-top:3px; flex:none; }
.bd-main { display:flex; flex-direction:column; gap:2px; min-width:0; }
.bd-title { font-weight:600; overflow-wrap:anywhere; }
.bd-meta { font-size:var(--fs-sub); color:var(--ink-2); overflow-wrap:anywhere; }
.bd-why { font-size:var(--fs-foot); color:var(--ink-3); }
/* Leiste unten: Zahl der markierten Termine und die eine Hauptaktion */
.bd-bar { position:sticky; bottom:12px; z-index:5; margin-top:12px; display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:10px 12px; border-radius:12px; background:var(--surface); box-shadow:0 4px 18px rgba(0, 0, 0, .14); }
.bd-count { font-weight:600; }
.bd-list { margin:0; padding-left:18px; }
.bd-result { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.bd-result li { display:flex; gap:10px; align-items:flex-start; overflow-wrap:anywhere; }
.bd-mark { flex:none; width:1.4em; text-align:center; font-weight:700; }
.bd-ok .bd-mark { color:var(--green); }
.bd-req .bd-mark { color:var(--amber); }
.bd-fail .bd-mark { color:var(--red); }
.bd-same .bd-mark { color:var(--ink-3); }
@media (max-width:900px) {
  /* über der Tab-Leiste */
  .bd-bar { bottom:calc(72px + env(safe-area-inset-bottom)); }
  .bd-bar .btn { min-height:44px; }
}
.bd-hint .linkish { color:var(--accent); font-weight:500; }
.bd-hint .linkish:hover { text-decoration:underline; }
@media (max-width:600px) {
  .bd-count { flex:1 1 100%; }
  .bd-bar .spacer { display:none; }
  .bd-bar .btn { flex:1; }
  .wv-cols-note { display:none; }
}
