/* Ski Team Schorschi – sachlich, mobil zuerst, große Bedienflächen, hell & dunkel */
:root {
  --bg: #F3F5F8; --card: #FFFFFF; --line: #E2E6EC; --line2: #EEF1F4;
  --text: #0F172A; --text2: #334155; --muted: #475569; --faint: #64748B;
  --accent: #1D4ED8; --accent-d: #1E40AF; --accent-bg: #EEF3FF;
  --ok-bg: #ECFDF5; --ok-fg: #065F46; --err-bg: #FEF2F2; --err-fg: #991B1B;
  --warn-bg: #FFF7ED; --warn-fg: #9A3412; --warn-line: #FED7AA;
  --r: 12px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 14px; margin: 0; color: var(--text2); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Kopfzeile */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand .lbl { display: none; }
@media (min-width: 520px) { .brand .lbl { display: inline; } }
.topsearch { flex: 1 1 200px; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; min-width: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; max-width: 460px; }
.topsearch input { border: 0; background: transparent; font: inherit; flex: 1; outline: none; min-width: 0; height: 40px; padding: 0; color: var(--text); }
.topsearch:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.topnav { display: none; gap: 2px; margin-left: auto; align-items: center; }
.topnav a, .topnav button { padding: 8px 10px; border-radius: 8px; color: var(--text2); font-weight: 600; font-size: 14px; }
.topnav a.on { background: var(--accent-bg); color: var(--accent-d); }
.topnav a:hover { background: var(--bg); text-decoration: none; }
.user { font-size: 13px; color: var(--muted); padding: 0 6px; }

/* Navigation unten (Handy) */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--muted); font-weight: 500; }
.bottomnav a.on { color: var(--accent); font-weight: 700; }
.bottomnav a:hover { text-decoration: none; }
main { padding: 16px 0 100px; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  main { padding-bottom: 40px; }
}

/* Bausteine */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cols { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.cols > * { min-width: 0; }
@media (min-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr) 380px; } }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 800px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; background: #F1F5F9; color: var(--text2); }
.b-verliehen { background: #DBEAFE; color: #1E40AF; }
.b-lager { background: #DCFCE7; color: #166534; }
.b-defekt { background: #FEE2E2; color: #991B1B; }
.b-fehlt { background: #FFEDD5; color: #9A3412; }
.b-verkauft, .b-ausgeschieden { background: #E5E7EB; color: #374151; }
.b-entwurf { background: #F1F5F9; color: #334155; }
.b-offen { background: #FFEDD5; color: #9A3412; }
.b-bezahlt { background: #DCFCE7; color: #166534; }
.b-storniert { background: #E5E7EB; color: #6B7280; text-decoration: line-through; }
.typ { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: #EEF2F7; color: var(--text2); }
.typ-SL { background: #E0E7FF; color: #3730A3; }
.typ-GS { background: #CFFAFE; color: #155E75; }
.typ-GSL { background: #FCE7F3; color: #9D174D; }
.nr { font-family: var(--mono); font-weight: 700; font-size: 15px; min-width: 34px; display: inline-block; }

/* Knöpfe & Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid #CBD5E1; background: var(--card); color: var(--text2); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); }
.btn-ok { background: #15803D; border-color: #15803D; color: #fff; }
.btn-ok:hover { background: #166534; }
.btn-danger { color: var(--err-fg); border-color: #FCA5A5; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn-big { height: 52px; font-size: 16px; width: 100%; }
.btn-block { width: 100%; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-d); cursor: pointer; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0; }
label.check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 40px; cursor: pointer; }
label.check input { width: 20px; height: 20px; flex: none; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], input[type=time], input[type=email], input[type=tel], input:not([type]), select, textarea {
  height: 44px; border: 1px solid #CBD5E1; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--text); background: #fff; width: 100%; min-width: 0; }
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.formgrid > * { min-width: 0; }
.formgrid .full { grid-column: 1 / -1; }
@media (min-width: 700px) { .formgrid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.fold > summary { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
details.fold > summary::after { content: "▾"; color: var(--faint); }
details.fold[open] > summary::after { content: "▴"; }
details.fold[open] > summary { margin-bottom: 12px; }

/* Meldungen */
.flash { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash-error { background: var(--err-bg); color: var(--err-fg); border-color: #FECACA; }
.flash-info { background: var(--accent-bg); color: var(--accent-d); }
.warnbox { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #7C2D12; border-radius: var(--r); padding: 12px 14px; font-size: 14px; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpis > * { min-width: 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: flex; flex-direction: column; color: var(--text); }
.kpi:hover { text-decoration: none; border-color: #C7D2FE; }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #CBD5E1; background: var(--card);
  color: var(--text2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--line); border-radius: 12px; }
.seg a { height: 36px; display: grid; place-items: center; padding: 0 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg a.on { background: #fff; color: var(--text); }
.seg a:hover { text-decoration: none; }

/* Listen */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mrow { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 12px; color: var(--text); border-top: 1px solid var(--line2); }
.mrow:first-child { border-top: 0; }
a.mrow:hover { background: #FAFBFC; text-decoration: none; }
.mrow .sub { font-size: 13px; color: var(--muted); }
.mrow .meta { display: none; gap: 14px; font-size: 13px; color: var(--muted); }
@media (min-width: 760px) { .mrow .meta { display: flex; } }
.grouphead { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--faint); padding: 10px 12px 6px; background: #F8FAFC; border-top: 1px solid var(--line2); text-transform: uppercase; }
.grouphead:first-child { border-top: 0; }

/* Zeitleiste */
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line2); }
.tl-item:first-child { border-top: 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-top: 7px; flex: none; }
.tl-dot.auto { background: #CBD5E1; }
.saisonhead { font-size: 12px; font-weight: 700; color: var(--accent-d); margin-top: 8px; }

/* Tabellen */
.tablebox { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; background: #F8FAFC; padding: 10px 12px; white-space: nowrap; }
td { padding: 9px 12px; border-top: 1px solid var(--line2); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: #F8FAFC; }
@media (max-width: 600px) {
  .hide-s { display: none; }
  .postab td, .postab th { padding: 8px 6px; }
  .postab td:first-child { min-width: 150px; }
}

/* Handy-Karten für die Abrechnung */
.billcard { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-top: 1px solid var(--line2); color: var(--text); }
.billcard:first-child { border-top: 0; }
a.billcard:hover { background: #FAFBFC; text-decoration: none; }

/* Anmeldung */
.authwrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 20px; max-width: 420px; margin: 0 auto; gap: 24px; }

/* Große Kopfzeile auf Artikelseite */
.hero { display: flex; gap: 14px; align-items: center; }
.hero .bignr { width: 64px; height: 64px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center;
  font: 700 24px/1 var(--mono); flex: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }

/* Etiketten (Druck) */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.label { border: 1px dashed #94A3B8; border-radius: 8px; padding: 8px; text-align: center; background: #fff; break-inside: avoid; }
.label svg { width: 100%; height: auto; max-width: 120px; }
.label b { display: block; font: 700 18px/1.2 var(--mono); }
@media print {
  .top, .bottomnav, .noprint, .flash { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .label { border-color: #ccc; }
}

/* Termine */
.bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: #E5E7EB; }
.bar > div { height: 100%; }
.tcard { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--text); }
a.tcard:hover { text-decoration: none; border-color: #C7D2FE; }
.tcard.abgesagt { opacity: .65; }
.tcard.abgesagt .ttitel { text-decoration: line-through; }
.ttitel { font-weight: 700; font-size: 16px; }
.art { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.art-training { background: #CCFBF1; color: #115E59; }
.art-rennen { background: #EDE9FE; color: #5B21B6; }
.art-sonstiges { background: #F1F5F9; color: #334155; }
.datebox { width: 52px; flex: none; text-align: center; border-radius: 10px; background: var(--accent-bg); color: var(--accent-d); padding: 5px 0; line-height: 1.1; }
.datebox b { display: block; font-size: 20px; }
.datebox span { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.rsvp { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line2); }
.rsvp:first-child { border-top: 0; padding-top: 0; }
.rsvp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.btn-no { background: #DC2626; border-color: #DC2626; color: #fff; }
details.absage > summary { list-style: none; }
details.absage[open] > summary { margin-bottom: 8px; }
.brand .lbl.lbl-immer { display: inline; }
.rsvp-btns details.absage[open] { grid-column: 1 / -1; }
.absage-pop { display: flex; flex-direction: column; gap: 6px; }
.namelist { display: flex; flex-wrap: wrap; gap: 6px; }
.namelist span { font-size: 13px; padding: 4px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.anw { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border-top: 1px solid var(--line2); cursor: pointer; }
.anw:first-child { border-top: 0; }
.anw input { width: 24px; height: 24px; flex: none; }

/* Ski-Regal */
.regal { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 64px; border-radius: 10px; padding: 4px 2px; text-align: center; color: inherit; border: 1px solid transparent; }
.tile:hover { text-decoration: none; border-color: #1E40AF; }
.tile b { font: 700 17px/1.1 var(--mono); }
.tile span { font-size: 11px; font-weight: 600; }
.tile i { font-style: normal; font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-verliehen { background: #DBEAFE; color: #1E3A8A; }
.t-lager { background: #DCFCE7; color: #14532D; }
.t-defekt { background: #FEE2E2; color: #7F1D1D; }
.t-fehlt { background: #FFEDD5; color: #7C2D12; }
.t-verkauft, .t-ausgeschieden { background: #E5E7EB; color: #374151; }
.tile-leg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

/* Schorschi-Logo */
.brandimg { width: 40px; height: 36px; object-fit: contain; flex: none; }
.logobox { background: #fff; border-radius: 18px; padding: 8px; display: flex; justify-content: center; width: 170px; margin: 0 auto; }
.logobox img { width: 100%; height: auto; }
.ja-text { color: #166534; }
.themesw { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--line); border-radius: 12px; }
.themesw button { height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.themesw button.on { background: var(--card); color: var(--text); }

/* ---------------- Dunkel ---------------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220; --card: #121B2C; --line: #26334A; --line2: #1B263A;
  --text: #E6EAF1; --text2: #CBD5E1; --muted: #9AA8BC; --faint: #7D8BA1;
  --accent: #3B82F6; --accent-d: #93C5FD; --accent-bg: #172A55;
  --ok-bg: #0F2E22; --ok-fg: #86EFAC; --err-bg: #3B1416; --err-fg: #FCA5A5;
  --warn-bg: #36200F; --warn-fg: #FDBA74; --warn-line: #7C3A12;
}
[data-theme="dark"] input[type=text], [data-theme="dark"] input[type=search], [data-theme="dark"] input[type=password],
[data-theme="dark"] input[type=number], [data-theme="dark"] input[type=date], [data-theme="dark"] input[type=time],
[data-theme="dark"] input[type=email], [data-theme="dark"] input[type=tel], [data-theme="dark"] input:not([type]),
[data-theme="dark"] select, [data-theme="dark"] textarea { background: #0E1626; border-color: #34425A; color: var(--text); }
[data-theme="dark"] .btn { background: #18233A; border-color: #34425A; color: var(--text2); }
[data-theme="dark"] .btn:hover { background: #1F2C47; }
[data-theme="dark"] .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .btn-primary:hover { background: #2563EB; }
[data-theme="dark"] .btn-ok { background: #15803D; border-color: #15803D; color: #fff; }
[data-theme="dark"] .btn-no { background: #B91C1C; border-color: #B91C1C; color: #fff; }
[data-theme="dark"] .btn-danger { color: #FCA5A5; border-color: #7F1D1D; }
[data-theme="dark"] .chip { border-color: #34425A; }
[data-theme="dark"] .chip.on { background: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .seg a.on { background: var(--card); color: var(--text); }
[data-theme="dark"] a.mrow:hover, [data-theme="dark"] a.billcard:hover { background: #172238; }
[data-theme="dark"] .grouphead, [data-theme="dark"] th, [data-theme="dark"] tfoot td { background: #0F1828; }
[data-theme="dark"] .badge { background: #1E293B; color: #CBD5E1; }
[data-theme="dark"] .b-verliehen { background: #1E3A8A; color: #BFDBFE; }
[data-theme="dark"] .b-lager { background: #14532D; color: #BBF7D0; }
[data-theme="dark"] .b-defekt { background: #7F1D1D; color: #FECACA; }
[data-theme="dark"] .b-fehlt { background: #7C2D12; color: #FED7AA; }
[data-theme="dark"] .b-verkauft, [data-theme="dark"] .b-ausgeschieden { background: #334155; color: #CBD5E1; }
[data-theme="dark"] .typ { background: #1E293B; color: #CBD5E1; }
[data-theme="dark"] .typ-SL { background: #312E81; color: #C7D2FE; }
[data-theme="dark"] .typ-GS { background: #164E63; color: #A5F3FC; }
[data-theme="dark"] .typ-GSL { background: #831843; color: #FBCFE8; }
[data-theme="dark"] .art-training { background: #134E4A; color: #99F6E4; }
[data-theme="dark"] .art-rennen { background: #4C1D95; color: #DDD6FE; }
[data-theme="dark"] .art-sonstiges { background: #1E293B; color: #CBD5E1; }
[data-theme="dark"] .bar { background: #1E293B; }
[data-theme="dark"] .ja-text { color: #86EFAC; }
[data-theme="dark"] .t-verliehen { background: #1E3A8A; color: #DBEAFE; }
[data-theme="dark"] .t-lager { background: #14532D; color: #DCFCE7; }
[data-theme="dark"] .t-defekt { background: #7F1D1D; color: #FEE2E2; }
[data-theme="dark"] .t-fehlt { background: #7C2D12; color: #FFEDD5; }
[data-theme="dark"] .t-verkauft, [data-theme="dark"] .t-ausgeschieden { background: #334155; color: #E2E8F0; }
[data-theme="dark"] .tile:hover { border-color: #93C5FD; }
[data-theme="dark"] .kpi:hover, [data-theme="dark"] a.tcard:hover { border-color: #3B4E72; }
[data-theme="dark"] .flash-error { border-color: #7F1D1D; }
[data-theme="dark"] .warnbox { color: #FED7AA; }
[data-theme="dark"] .label { background: #fff; color: #111; }
@media print { [data-theme="dark"] { --bg: #fff; --card: #fff; --text: #000; } }

/* Tarif: Sammelzahlung */
.list > .row + .row { border-top: 1px solid var(--line2); }
.wahlbox { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 58px; padding-top: 4px; cursor: pointer; flex: none; }
.wahlbox input { width: 20px; height: 20px; }
.sammelbar { position: sticky; top: 66px; z-index: 5; }