/* SkiOrg – mobile-first styles, no external resources. */
:root {
  --navy: #123047;
  --teal: #19b8c4;
  --snow: #f4f8fc;
  --ink: #123047;
  --muted: #36556c;
  --bg: #f4f8fc;
  --surface: #ffffff;
  --border: #c9d6e2;
  --ok: #17663a;
  --warn: #8a5300;
  --error: #a3172b;
  --focus: #0b6f77;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f8fc;
    --muted: #b8c9d8;
    --bg: #0c2131;
    --surface: #123047;
    --border: #2d4c64;
    --ok: #7fd6a2;
    --warn: #ffc56b;
    --error: #ff9aa8;
    --focus: #19b8c4;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: anywhere;
}

a { color: inherit; text-decoration-color: var(--teal); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.sr-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .5rem 1rem;
  background: var(--surface);
  border-bottom: 4px solid var(--club-primary, var(--teal));
}
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 1 1 auto; }
.brand-link { display: inline-flex; min-height: 44px; align-items: center; }
.logo-wide { display: none; height: 45px; width: auto; }
.logo-icon { height: 40px; width: 40px; }
.tagline { display: none; color: var(--muted); font-size: .875rem; }
.club-badge { margin: 0; font-size: .95rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; min-width: 0; }
.club-logo { height: 36px; width: auto; max-width: 120px; object-fit: contain; }
.club-badge-super { padding: .15rem .5rem; border: 2px dashed var(--warn); border-radius: 8px; }
.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin-left: auto; }
.user-box { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.user-display { font-weight: 600; }
.user-short { display: none; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 700; border: 2px solid var(--ink); }
.badge-super { border-color: var(--warn); color: var(--warn); }
@media (prefers-color-scheme: dark) {
  /* Club logos are made for light backgrounds; a light plate keeps them visible. */
  .club-logo { background: #ffffff; border-radius: 6px; padding: 2px; }
}
@media (max-width: 480px) {
  .user-full { display: none; }
  .user-short { display: inline; letter-spacing: .05em; }
  .tagline { display: none; }
}
.top-nav a, .top-nav .link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; }
.lang-switch { display: flex; align-items: center; gap: .25rem; }
.lang-switch select { min-height: 44px; }

.club-nav, .platform-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .25rem 1rem;
  background: var(--club-primary, var(--navy));
}
.platform-nav { background: var(--navy); border-bottom: 1px solid var(--teal); }
.platform-nav a { color: var(--snow); display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; border-radius: 8px; text-decoration: none; }
.platform-nav a:hover, .platform-nav a:focus-visible { background: rgba(255, 255, 255, .12); }
.club-nav a {
  color: var(--club-primary-text, var(--snow));
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .75rem;
  border-radius: 8px;
  text-decoration: none;
}
.club-nav a:hover, .club-nav a:focus-visible { background: rgba(255, 255, 255, .12); }
.club-nav a[aria-current="page"], .platform-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* Smartphone: hamburger menu (details/summary, works without JavaScript). */
.nav-mobile { display: none; background: var(--club-primary, var(--navy)); color: var(--club-primary-text, var(--snow)); }
.nav-mobile > summary {
  display: flex; align-items: center; gap: .6rem; min-height: 48px; padding: 0 1rem;
  font-weight: 600; cursor: pointer; list-style: none;
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.hamburger, .hamburger::before, .hamburger::after {
  display: block; width: 22px; height: 2px; background: currentColor; border-radius: 1px; position: relative;
}
.hamburger::before, .hamburger::after { content: ""; position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.nav-mobile[open] .hamburger { background: transparent; }
.nav-mobile[open] .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-mobile[open] .hamburger::after { top: 0; transform: rotate(-45deg); }
.nav-mobile-section { display: flex; flex-direction: column; padding: 0 .5rem .5rem; }
.nav-mobile-section + .nav-mobile-section { border-top: 1px solid currentColor; padding-top: .5rem; }
.nav-mobile-title { margin: .25rem .5rem; font-size: .85rem; font-weight: 700; opacity: .85; }
.nav-mobile-section a {
  display: flex; align-items: center; min-height: 48px; padding: 0 .75rem; border-radius: 8px;
  color: inherit; text-decoration: none;
}
.nav-mobile-section a:hover, .nav-mobile-section a:focus-visible { background: rgba(255, 255, 255, .12); }
.nav-mobile-section a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 6px; }
@media (max-width: 719px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
}

@media (min-width: 720px) {
  .logo-wide { display: block; }
  .logo-icon { display: none; }
  .tagline { display: inline; }
}

/* One content width for all pages (18.11.2026): 90rem = 1440 px, four group cards side by side. */
:root { --page-width: 90rem; }
main { max-width: var(--page-width); margin: 0 auto; padding: 1rem; }
.site-footer { max-width: var(--page-width); margin: 2rem auto 1rem; padding: 0 1rem; color: var(--muted); font-size: .875rem; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: .5rem 0 1rem; }
h2, .h3 { font-size: 1.2rem; margin: 0 0 .5rem; }
h3 { font-size: 1.05rem; margin: 0 0 .25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin: 0 0 1rem;
}
.card.narrow { max-width: 32rem; margin-left: auto; margin-right: auto; }
.card.highlight { border: 2px solid var(--teal); }

.cards { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; }
.card-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem; }
.cards .card-item form { margin-top: .5rem; }
/* Active club under "Mein Konto": frame in the club's accent colour. */
.card-item.card-current { border: 3px solid var(--club-accent, var(--teal)); }
.tiles { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.tiles a {
  display: flex; align-items: center; min-height: 56px; padding: .5rem 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font-weight: 600; text-decoration: none;
}
.big-link { display: flex; align-items: center; min-height: 48px; font-size: 1.15rem; font-weight: 600; }
.tags { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.tags li { border: 1px solid var(--border); border-radius: 999px; padding: .1rem .6rem; font-size: .875rem; }
.meta { display: block; color: var(--muted); font-size: .875rem; }
.hint { color: var(--muted); font-size: .925rem; }
.facts { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .25rem 1rem; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.log { padding-left: 1.1rem; font-size: .9rem; }
.log li { margin-bottom: .35rem; }
.code-display { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2rem; letter-spacing: .15em; margin: .25rem 0; }

/* Status: always text + symbol, never colour alone */
.status { font-weight: 600; }
.status-ok { color: var(--ok); }
.status-warn, .status-wait { color: var(--warn); }
.status-error, .error { color: var(--error); }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg { padding: .75rem 1rem; border-radius: 10px; margin-bottom: .5rem; border: 2px solid var(--border); background: var(--surface); }
.msg-success { border-color: var(--ok); }
.msg-error { border-color: var(--error); }
.msg-warning { border-color: var(--warn); }
.msg-label { font-weight: 700; }

/* Forms */
form > div { margin-bottom: .9rem; }
label { display: block; font-weight: 600; margin-bottom: .2rem; }
input[type="checkbox"] + label, label:has(input[type="checkbox"]) { display: inline; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  max-width: 32rem;
  min-height: 44px;
  padding: .5rem .65rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
}
.lang-switch select { width: auto; }
input[type="checkbox"] { width: 1.4rem; height: 1.4rem; vertical-align: middle; margin-right: .4rem; }
.confirmation { display: flex; align-items: center; gap: .4rem; }
.confirmation input[type="checkbox"] { flex: 0 0 auto; margin: 0; }
.confirmation label { font-weight: 400; margin: 0; }
.helptext { display: block; color: var(--muted); font-size: .875rem; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0; color: var(--error); font-weight: 600; }
.errorlist li::before { content: "✖ "; }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: .5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--muted);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  margin: .25rem .25rem .25rem 0;
}
/* Club accent colour (checked on the server for 4.5:1 text contrast); the
   border keeps a fixed colour so the control stays visible in both modes. */
button.primary, .button.primary {
  background: var(--club-accent, var(--teal));
  border-color: var(--ink);
  color: var(--club-accent-text, #123047);
}
button.danger { border-color: var(--error); color: var(--error); }
button.small { min-height: 44px; padding: .25rem .6rem; font-weight: 400; }
button.link { background: none; border: none; padding: 0 .25rem; font-weight: 400; text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 3px; margin: 0; }
form.inline { display: inline; margin: 0; }
form.stacked { border-top: 1px solid var(--border); padding-top: .75rem; margin-top: .75rem; }
.captcha { margin: 1rem 0; }

/* Club colour preview and swatches */
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.swatch { display: inline-flex; align-items: center; min-height: 44px; padding: .25rem .75rem; border-radius: 8px; border: 2px solid var(--ink); font-weight: 600; }
.swatch-primary { background: var(--club-primary, var(--navy)); color: var(--club-primary-text, var(--snow)); }
.swatch-accent { background: var(--club-accent, var(--teal)); color: var(--club-accent-text, #123047); }
.logo-preview { max-height: 96px; width: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; background: #ffffff; padding: .25rem; }
input[type="color"] { width: 5rem; min-height: 44px; padding: .15rem; border: 1px solid var(--muted); border-radius: 8px; background: var(--surface); }
input[type="file"] { min-height: 44px; }

/* Phase 3: preparation on the PC (tables, filters, event navigation) */
.crumbs { margin: 0 0 .25rem; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.event-meta { display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .95rem; }
.subnav { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; padding: 0; border-bottom: 2px solid var(--border); }
.subnav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem;
  border-radius: 8px 8px 0 0; text-decoration: none; font-weight: 600;
}
.subnav a[aria-current="page"] { background: var(--surface); border: 2px solid var(--border); border-bottom-color: var(--surface); margin-bottom: -2px; text-decoration: underline; text-underline-offset: 6px; }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: .45rem .5rem; border-bottom: 1px solid var(--border); }
.data-table thead th { border-bottom: 2px solid var(--muted); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .meta { font-weight: 400; }
.data-table input, .data-table select { min-width: 5rem; }
.sort-controls { display: inline-flex; vertical-align: middle; }
.sort-controls a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: .7rem; color: var(--muted); text-decoration: none; }
.sort-controls a.active { color: var(--ink); text-decoration: underline; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; margin: 0 0 1rem; }
.filters > div { margin: 0; flex: 0 1 14rem; }
.filters input, .filters select { width: 100%; }
.filters input[type="checkbox"], .filters input[type="radio"] { width: 1.4rem; flex: 0 0 auto; }
.data-table th[scope="row"] { white-space: nowrap; }
.filters fieldset.choice { flex-basis: 100%; }
.filter-actions { flex: 0 0 auto !important; }
fieldset.choice { border: 1px solid var(--border); border-radius: 8px; padding: .25rem .75rem; margin: 0; }
fieldset.choice label { display: inline-flex; align-items: center; min-height: 44px; margin-right: 1rem; font-weight: 400; }
.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin: .25rem 0; }
.inline-form > * { margin: 0; }
.inline-form input[type="text"], .inline-form input[type="date"] { width: auto; min-height: 44px; }
input[type="date"], input[type="search"] {
  min-height: 44px; padding: .5rem .65rem; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--muted); border-radius: 8px; max-width: 32rem;
}
input[type="search"] { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin: .5rem 0; }
.nowrap { white-space: nowrap; }
.compact { margin: .25rem 0 .75rem; padding-left: 1.2rem; }
.plain { list-style: none; padding: 0; }
.plain label { display: flex; align-items: center; min-height: 44px; font-weight: 400; }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.checklist .status { display: inline-block; min-width: 6.5rem; }
.summary { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.card.highlight-error { border: 2px solid var(--error); }
.card-emergency { border-left: 6px solid var(--error); }
.conflict { margin: 0 0 1rem; }
.banner-provisional { padding: .75rem 1rem; border: 3px dashed var(--warn); border-radius: 10px; color: var(--warn); }
.badge + .badge { margin-left: .25rem; }

/* CSV import: PC only (usage rule via breakpoint, not a security limit; SPEC §10) */
.mobile-only { display: none; }
@media (max-width: 719px) {
  .pc-only { display: none !important; }
  .mobile-only { display: block; }
  /* PC tables scroll inside themselves instead of widening the page. */
  .data-table { display: block; overflow-x: auto; }
  .data-table th, .data-table td { overflow-wrap: normal; }
}

/* Print views (person lists, provisional demand) */
.print-view main { max-width: none; }
@media print {
  .site-header .top-nav, .club-nav, .platform-nav, .nav-mobile, .subnav, .site-footer, .skip, .no-print, .actions, .filters { display: none !important; }
  body { background: #ffffff; color: #000000; }
  main { max-width: none; padding: 0; }
  .card { border: none; padding: 0; }
  .data-table th, .data-table td { border-bottom: 1px solid #999999; }
  .banner-provisional { color: #000000; border-color: #000000; }
}

/* Required fields: "*" after the label, note "* Pflichtfeld" at the bottom of pages with such fields. */
label.required::after, legend.required::after { content: " *"; color: var(--error); font-weight: 700; }
.required-note { display: none; }
body:has(label.required, legend.required) .required-note { display: block; font-weight: 600; color: var(--ink); }
@media print { .required-note { display: none !important; } }

/* Phase 4: course groups (PC overview, smartphone day view) */
.day-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 .5rem; }
.day-tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); text-decoration: none; font-weight: 600;
}
.day-tabs a[aria-current="page"] { border: 2px solid var(--club-accent, var(--teal)); text-decoration: underline; text-underline-offset: 5px; }
.day-title { margin: .5rem 0; }
.group-board { grid-template-columns: 1fr; }
@media (min-width: 720px) { .group-board { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); } }
.group-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.group-own { border: 3px solid var(--club-accent, var(--teal)); }
.member-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.member-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; min-height: 44px; border-top: 1px solid var(--border); padding: .2rem 0; }
.member-list li > span:first-child, .member-check { flex: 1 1 6rem; min-width: 0; }
.member-list .meta { display: inline; }
.member-list .member-check { display: flex; align-items: center; gap: .4rem; min-height: 44px; font-weight: 400; margin: 0; }
.member-list .member-check input[type="checkbox"] { flex: 0 0 auto; margin: 0; }
.member-list .button.small { min-height: 44px; padding: .25rem .6rem; margin: 0; font-weight: 600; }
.target-list { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .5rem; }
button.target { width: 100%; flex-direction: column; align-items: flex-start; text-align: left; min-height: 56px; margin: 0; }
button.target .meta { display: block; }
.bulk-bar { border: 2px solid var(--club-accent, var(--teal)); }
.bulk-bar > div, .bulk-bar fieldset { margin-bottom: .5rem; }
/* Preview of the automatic assignment: one table, a thin line below every group header,
   a slightly thicker line only below the last group. */
.plan-table .num { text-align: right; white-space: nowrap; }
.plan-table .plan-head th { border-bottom: 1px solid var(--muted); font-weight: 700; padding-top: 1rem; }
.plan-table tbody:first-child .plan-head th { padding-top: .45rem; }
.plan-table tbody:last-child tr:last-child th, .plan-table tbody:last-child tr:last-child td { border-bottom: 2px solid var(--muted); }
.day-tabs a.day-back { border-style: dashed; }

/* Event menu: tabs on the PC, hamburger left of the event name on smartphones (no JavaScript). */
.event-title { position: relative; display: flex; align-items: center; gap: .5rem; }
.event-title h1 { margin: .5rem 0; min-width: 0; }
.event-menu { display: none; }
.event-menu > summary {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer;
  list-style: none; border: 2px solid var(--muted); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.event-menu > summary::-webkit-details-marker { display: none; }
.event-menu > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.event-menu[open] .hamburger { background: transparent; }
.event-menu[open] .hamburger::before { top: 0; transform: rotate(45deg); }
.event-menu[open] .hamburger::after { top: 0; transform: rotate(-45deg); }
.event-menu-links {
  position: absolute; left: 0; top: calc(100% + .25rem); z-index: 5; width: min(20rem, calc(100vw - 2rem));
  display: flex; flex-direction: column; padding: .25rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.event-menu-links a { display: flex; align-items: center; min-height: 48px; padding: 0 .75rem; border-radius: 8px; text-decoration: none; font-weight: 600; }
.event-menu-links a:hover, .event-menu-links a:focus-visible { background: var(--bg); }
.event-menu-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
@media (max-width: 719px) {
  .event-menu { display: block; flex: 0 0 auto; }
  .subnav { display: none; }
}
@media print { .event-menu { display: none !important; } }
/* Jump target "ohne Gruppe" in the day view: highlighted when reached via the overview link. */
#unassigned { scroll-margin-top: 1rem; }
#unassigned:target { border: 2px solid var(--warn); }

/* Confirmed deviation in the day view: own colour plus "≠" (not colour alone), explained in a legend. */
:root { --deviation: #6b2fa3; }
@media (prefers-color-scheme: dark) { :root { --deviation: #d7b8ff; } }
.member-deviation .member-check > span, .member-deviation > span:first-child, .member-deviation-text { color: var(--deviation); font-weight: 700; }
.legend { margin: 0 0 .75rem; font-size: .925rem; color: var(--muted); }
.legend-swatch { display: inline-block; padding: .05rem .4rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
