/* Divotlog – Layout & Komponenten (CD-01: Corporate Design). Nutzt Variablen aus variables.css.
   Funktioniert in hellem und dunklem Theme automatisch. */
* { box-sizing: border-box; }
/* CD-01: Formularelemente erben die Seiten-Schrift (Montserrat) */
input, select, textarea, button { font-family: inherit; }
body {
  margin: 0; font-family: var(--font-family); font-size: var(--font-base);
  line-height: var(--line-height);
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== Grundlayout: Sidebar links, Inhalt rechts ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ----- Sidebar ----- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  border-right: 1px solid var(--sidebar-border);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; min-height: var(--header-height);
  color: var(--sidebar-brand); border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand a { display: inline-flex; color: inherit; text-decoration: none; }

/* ----- Markenzeichen (CD-01, Baustein UI\Brand) -----
   Signet + Wortmarke inline; Wortmarke nutzt die Seiten-Montserrat
   (Guide: Divot in Dunkelgrün/Weiß, "log" in Frischgrün, Bold, eng). */
.brand-logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.brand-signet { display: block; flex: 0 0 auto; }
.brand-word { font-family: var(--font-family); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: inherit; white-space: nowrap; }
.brand-word__accent { color: var(--cd-green); }
.brand-claim { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.sidebar-brand .brand-word { font-size: 21px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-cat {
  color: var(--sidebar-muted); font-size: var(--font-xs); text-transform: uppercase;
  letter-spacing: 0.05em; margin: 16px 10px 6px; font-weight: bold;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0; border-radius: var(--radius-md);
  color: var(--sidebar-text); text-decoration: none; font-size: var(--font-base);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.nav-item .icon { flex-shrink: 0; }
.nav-item .icon svg { width: 21px; height: 21px; }

.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--sidebar-border); }
.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; color: var(--sidebar-muted); font-size: var(--font-sm);
}
.nav-item.logout:hover { background: var(--err-bg); color: var(--err-text); }

/* ----- Hauptbereich ----- */
.main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; }
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-xl); min-height: var(--header-height);
  border-bottom: 1px solid var(--border); background: var(--card-bg);
  position: sticky; top: 0; z-index: 100;
}
.content-title { font-size: var(--font-lg); font-weight: 700; letter-spacing: var(--heading-tracking); color: var(--heading); display: inline-flex; align-items: center; gap: var(--space-sm); }
.content-title .icon { color: var(--brand-primary); }   /* CD-05: Seiten-Icon in Markenfarbe (TS24 .content-header h1 .icon) */
.content-tools { display: inline-flex; align-items: center; gap: 12px; }

.wrap { max-width: 1500px; width: 100%; margin: 0 auto; padding: var(--space-lg) var(--space-xl) var(--space-2xl); }

/* ----- Mobil: Sidebar oben, Inhalt darunter ----- */
@media (max-width: 720px) {
  .app-layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; flex-direction: column; }
  .sidebar-nav { padding: 8px 10px; }
  .main { margin-left: 0; }
}

h1 { font-size: var(--font-xl); margin: 0 0 16px; display:flex; align-items:center; gap:8px; }
h2 { font-size: var(--font-lg); margin: 20px 0 10px; }
h1, h2, h3, h4 { color: var(--heading); font-weight: var(--heading-weight); letter-spacing: var(--heading-tracking); }

.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

/* Stat-Karten (Kennzahlen-Kacheln, z. B. für Auswertungen) */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md); margin-bottom: var(--space-lg);
}
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-lg);
  box-shadow: var(--shadow-sm); display: flex; align-items: flex-start; gap: var(--space-md);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-primary-light); color: var(--brand-primary-text); flex: 0 0 auto;
}
.stat-card .stat-value { font-size: var(--font-2xl); font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; color: var(--heading); }   /* CD-05: TS24-Kennzahl */
.stat-card .stat-label { color: var(--text-muted); font-size: var(--font-sm); margin-top: 2px; }

label { display: block; margin: 10px 0 4px; color: var(--text); font-size: var(--font-sm); }
input[type=text], input[type=email], input[type=password], input[type=file], select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--input-bg); color: var(--text);
  font-size: var(--font-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}
button, .btn {
  background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--btn-border);
  border-radius: var(--radius-md); padding: 9px 16px; font-size: var(--font-base);
  font-weight: 600; cursor: pointer; margin-top: 12px;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background var(--transition-fast), border-color var(--transition-fast),
              box-shadow var(--transition-fast), transform var(--transition-fast);
}
button:hover, .btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover);
  box-shadow: var(--shadow-sm); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--hover-bg); }

/* Link-Farbe NUR dort, wo nackte Links vorkommen (Plaetze-Steckbriefe,
   Karten-Popups, Infofenster) - bewusst KEINE globale a-Regel, die
   wuerde Sidebar/Listen ueberstimmen (a:visited schlaegt Klassen!). */
.pk-body a, .pk-body a:visited,
.leaflet-popup-content a, .leaflet-popup-content a:visited,
.tipbox a, .tipbox a:visited { color: var(--link); }
a.link { color: var(--brand); }

.msg { padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: var(--font-sm); }
.msg.error { background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-text); }
.msg.ok    { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-text); }

.muted { color: var(--text-muted); font-size: var(--font-sm); }

/* Icons */
.icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.icon svg { width: 22px; height: 22px; }   /* CD-05: TORSERVICE-Skala 22 / 18 / 26 / 36 */
.icon-sm svg { width: 18px; height: 18px; }
.icon-lg svg { width: 26px; height: 26px; }
.icon-xl svg { width: 36px; height: 36px; }
/* CD-05: CD-Icons laufen im 24er Raster mit demselben Wrapper wie Lucide –
   keine Sonderregeln für Größe oder Strich mehr. .icon-cd ist nur Marker für
   die Zweitfarbe (--icon-accent) und Drittfarbe (--icon-secondary). */
/* Sidebar: inaktiv gedämpft einfarbig, aktiv mit Frischgrün-Akzent */
.sidebar .nav-item .icon-cd { --icon-accent: var(--sidebar-muted); --icon-secondary: var(--sidebar-muted); }
.sidebar .nav-item.active .icon-cd, .sidebar .nav-item:hover .icon-cd { --icon-accent: var(--cd-green); --icon-secondary: var(--cd-green); }
/* Buttons: einfarbig – auf der Frischgrün-Fläche wäre der Frischgrün-Akzent unsichtbar */
button .icon-cd, .btn .icon-cd, .ui-btn .icon-cd, .btn-small .icon-cd, .filt.on .icon-cd { --icon-accent: currentColor; --icon-secondary: currentColor; }
/* Große Markenflächen (Startseite, Empty States) */
.cd-hero { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: var(--radius-xl); background: var(--brand-primary-light); color: var(--brand-primary-text); }
.cd-hero .icon svg { width: 40px; height: 40px; }

/* Theme-/Sprach-Umschalter (rechts oben im Content-Header) */
.theme-toggle {
  display: inline-flex; align-items: center;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 8px; margin: 0; cursor: pointer;
  text-decoration: none;
}
.theme-toggle:hover { background: var(--hover-bg); border-color: var(--brand); color: var(--brand); }
.langsw { font-size: var(--font-sm); }
.langsw a { color: var(--text-muted); text-decoration: none; margin: 0 3px; }
.langsw a:hover { color: var(--brand); }
.langsw strong { color: var(--brand); margin: 0 3px; }

.footer {
  text-align: center; color: var(--text-muted); font-size: var(--font-xs);
  padding: 20px; border-top: 1px solid var(--border); margin-top: 30px;
}

/* Tabellen (TORSERVICE-Look): .utable ist die zentrale Tabellen-Klasse
   des Divotlogs, .data-table der TORSERVICE-Name - beide identisch. */
.utable, .data-table { width: 100%; border-collapse: collapse; }
.utable th, .data-table th {
  text-align: left; padding: var(--space-sm) 10px;
  font-size: var(--font-xs); font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border); white-space: nowrap;
  vertical-align: bottom;
}
.utable td, .data-table td {
  text-align: left; padding: var(--space-sm) 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle; font-size: var(--font-sm);
}
.utable tbody tr, .data-table tbody tr { transition: background var(--transition-fast); }
.utable tbody tr:hover, .data-table tbody tr:hover { background: var(--hover-bg); }
.utable tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: none; }
.action-cell { white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.inline { display: inline; margin: 0; }
.btn-small {
  background: transparent; color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 10px; font-size: var(--font-xs);
  font-weight: bold; cursor: pointer; margin: 2px 2px 2px 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-small:hover { background: var(--hover-bg); border-color: var(--brand); }
.btn-small.danger { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: var(--font-xs); font-weight: 600; white-space: nowrap;
  background: var(--brand-primary-light); color: var(--brand-primary-text);
  margin-left: 6px;
}
.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-danger  { background: var(--danger-light);  color: var(--danger-text); }
.badge-info    { background: var(--info-light);    color: var(--info-text); }
.badge-neutral { background: var(--bg); color: var(--text-secondary); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: currentColor; opacity: .8; }
.ok-dot { color: var(--brand); font-weight: bold; }
.off-dot { color: var(--err-text); font-weight: bold; }
.utable select { padding: 5px 6px; font-size: var(--font-sm); width: auto; }
.pwrow { margin-top: 6px; }
.pwrow input { width: 200px; padding: 5px 8px; }

/* Dropzone (für späteren Upload) */
.dropzone {
  border: 1px solid var(--brand); border-radius: var(--radius-lg); background: var(--hover-bg);
  padding: 22px; text-align: center; cursor: pointer;
}
.dropzone:hover { border-color: var(--brand-hover); }

/* Rechte-Matrix */
.matrix { width: 100%; border-collapse: collapse; font-size: var(--font-sm); }
.matrix th, .matrix td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.matrix thead th { text-align: center; color: var(--text); vertical-align: bottom; }
.matrix .mcol { min-width: 70px; }
.matrix .mrole { font-size: var(--font-xs); color: var(--text-muted); }
.matrix .mperm { text-align: left; min-width: 220px; }
.matrix .mcheck { text-align: center; }
.matrix .marea td {
  background: var(--hover-bg); font-weight: bold; color: var(--brand);
  text-transform: uppercase; font-size: var(--font-xs); letter-spacing: 0.03em;
}
.matrix input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
.mono { font-family: var(--font-mono); font-size: 11px; }

/* Icon-Auswahl */
.icon-picker, .color-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.icon-option, .color-option { cursor: pointer; }
.icon-option input, .color-option input { display: none; }
.icon-pick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 2px solid var(--border); border-radius: var(--radius);
  color: var(--text); background: var(--input-bg);
}
.icon-option input:checked + .icon-pick { border-color: var(--brand); color: var(--brand); }
.color-pick { background: var(--swatch, var(--border));
  display: inline-block; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border);
}
.color-option input:checked + .color-pick { border-color: var(--card-bg); box-shadow: 0 0 0 2px var(--brand); }

/* Login/Bare-Layout: zentriert, ohne Sidebar */
body.bare { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.bare-wrap { width: 100%; max-width: 400px; padding: 24px; }
.bare-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 0 22px; color: var(--heading); }
.bare-brand .brand-word { font-size: 34px; }
.bare-brand .brand-logo { gap: 14px; }
.bare-wrap h1 { justify-content: center; color: var(--heading); }

/* Zielwerte-Tool */
.bench-form { margin: 12px 0; }
.bench-fields { display: flex; flex-wrap: wrap; gap: 14px; }
.bench-field { flex: 1 1 180px; min-width: 160px; }
.bench-field label { font-size: var(--font-xs); color: var(--text-muted); margin-bottom: 3px; }
.bench-summary {
  margin-top: 14px; padding: 14px; border-left: 4px solid var(--brand);
  background: var(--hover-bg); border-radius: 0 var(--radius) var(--radius) 0;
}
.bench-head { margin-bottom: 12px; font-size: var(--font-base); }
.bench-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bench-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 20px;
  background: var(--card-bg); border: 1px solid var(--border);
  font-size: var(--font-sm);
}
.bench-chip-icon { display: inline-flex; }
.bench-note { margin-top: 12px; font-size: var(--font-xs); color: var(--text-muted); line-height: 1.5; }

/* kleiner Gefahr-Knopf (z.B. Session löschen) */
.btn-danger-small {
  background: transparent; border: 1px solid var(--border);
  color: var(--danger); padding: 4px 8px; border-radius: var(--radius);
  cursor: pointer; display: inline-flex; align-items: center;
}
.btn-danger-small:hover { background: var(--danger-light); border-color: var(--danger); }

/* Zielwerte-Vergleich in der Session */
.cmp-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: 10px; font-size: var(--font-xs); font-weight: 600;
}
.cmp-green  { background: var(--success-light); color: var(--success-text); border: 1px solid var(--success-border); }
.cmp-yellow { background: var(--warning-light); color: var(--warning-text); border: 1px solid var(--warning-border); }
.cmp-red    { background: var(--danger-light);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
[data-theme="dark"] .cmp-green  { color: var(--success-text); }
[data-theme="dark"] .cmp-yellow { color: var(--warning-text); }
[data-theme="dark"] .cmp-red    { color: var(--danger-text); }

/* aus der Wertung genommene Schläge */
.shot-excluded td { opacity: .45; }
.shot-excluded td:first-child { text-decoration: line-through; }

/* neutraler kleiner Umschalt-Knopf */
.btn-toggle-small {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: 3px 7px; border-radius: var(--radius);
  cursor: pointer; display: inline-flex; align-items: center;
}
.btn-toggle-small:hover { border-color: var(--brand); color: var(--brand); }

/* kompakte Schlag-Tabelle: Einheiten im Kopf, Zellen nur Zahlen -> passt ohne Scrollen */
.shots-table { font-size: var(--font-xs); }
.shots-table th, .shots-table td { padding: 4px 6px; white-space: nowrap; }
.shots-table th { line-height: 1.25; vertical-align: bottom; }
.shots-table .unit-sub {
  display: block; font-weight: normal; color: var(--text-muted);
  font-size: 10px; margin-top: 1px;
}
.shots-table .btn-toggle-small { padding: 2px 5px; }

/* Tendenz-Anzeige in der Session-Liste */
.trend-up   { color: var(--success-text); font-weight: 600; white-space: nowrap; }
.trend-down { color: var(--danger-text); font-weight: 600; white-space: nowrap; }
.trend-flat { color: var(--text-muted); white-space: nowrap; }
[data-theme="dark"] .trend-up   { color: var(--success-text); }
[data-theme="dark"] .trend-down { color: var(--danger-text); }

/* Zielprofile: schmale Zahleneingaben */
.targets-table .tgt-in { width: 90px; text-align: right; }
.targets-table td, .targets-table th { vertical-align: middle; }

/* Verlaufs-Diagramm */
.chart-wrap { margin-top: 12px; }
.legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  vertical-align: middle; margin-right: 4px;
}
.legend-line {
  display: inline-block; width: 22px; height: 0; vertical-align: middle;
  border-top: 2px dashed; margin-right: 4px;
}

/* Garmin-Runden: Loch-Kacheln nebeneinander */
.holes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-top: 10px;
}
.hole-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.hole-box h3 { margin: 0 0 6px; font-size: var(--font-md); }
.bookmarklet { cursor: grab; }
.hole-map { width: 100%; height: auto; border-radius: 8px; display: block; margin-bottom: 8px; }

/* Runden im HTA-Stil: geteilte Ansicht */
.garmin-split { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .garmin-split { grid-template-columns: 1fr; } }
.round-list { position: relative; max-height: 68vh; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.round-item { display: block; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
              text-decoration: none; color: inherit; }
.round-item:hover { border-color: var(--brand); }
.round-item.active { border-color: var(--brand); background: var(--ok-bg); }
.hole-btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 10px; }
.hole-btn { display: flex; flex-direction: column; align-items: center; min-width: 44px; padding: 4px 6px;
            border: 1px solid var(--border); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.hole-btn .hole-no { font-weight: bold; font-size: 15px; }
.hole-btn .hole-sub { font-size: 11px; color: var(--text-muted); }
.hole-btn.active { border-color: var(--brand); background: var(--ok-bg); }
.hole-flex { display: grid; grid-template-columns: minmax(280px, 46%) 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .hole-flex { grid-template-columns: 1fr; } }

/* Scorecard im Garmin-Stil */
.sc-wrap { overflow-x: auto; margin-top: 14px; }
.sc-table { border-collapse: collapse; min-width: 100%; }
.sc-table th, .sc-table td { padding: 4px 8px; text-align: center; border-bottom: 1px solid var(--border); font-size: 13px; }
.sc-table th:first-child { text-align: left; color: var(--text-muted); font-weight: normal; }
.sc-table th:last-child { border-left: 2px solid var(--border); }
.sc-table td:last-child { border-left: 2px solid var(--border); }
.sc-badge { display: inline-flex; align-items: center; justify-content: center;
            min-width: 24px; height: 24px; border-radius: 4px; border: 2px solid transparent; }
.sc-eagle  { border-color: var(--score-eagle); border-radius: 50%; box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--score-eagle); }
.sc-birdie { border-color: var(--score-birdie); border-radius: 50%; }
.sc-bogey  { border-color: var(--score-bogey); }
.sc-double { border-color: var(--score-double); }
.sc-pen { color: var(--danger-text); }
.sc-legend { margin-top: 8px; }
.sc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.sc-table td[data-h] { cursor: pointer; }
.sc-table td.sc-hover { background: var(--ok-bg); }
.sc-table td.sc-active { background: var(--ok-bg); box-shadow: inset 0 -2px 0 var(--brand); }
.sc-hint { font-size: 12px; }
.sc-ico { vertical-align: middle; display: inline-block; }

/* Statistik-Leiste oben in der Runde */
.stat-strip { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; margin: 14px 0 4px; }
.ring-tile, .stat-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; min-width: 96px; }
.ring-tile > :first-child, .stat-tile > :first-child { margin-top: auto; }
.ring-label { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: auto; }
.stat-big { font-size: 22px; font-weight: bold; line-height: 1.1; }
.score-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px;
  border: 2px solid var(--swatch, var(--border)); font-size: 12px; }
.chip-blue  { border-color: var(--score-birdie); }
.chip-green { border-color: var(--cd-green); }
.chip-amber { border-color: var(--score-bogey); }
.chip-red   { border-color: var(--score-double); }
.stat-ratings { flex: 1 1 260px; max-width: none; }

/* Aufklappbare Schläger-Tabelle (jetzt oberhalb der Scorecard) */
.club-details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; margin: 12px 0 4px; }
.club-details summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.club-details summary::-webkit-details-marker { display: none; }
.club-details summary:hover { color: var(--brand); }
.chev-wrap { margin-left: auto; display: inline-flex; color: var(--text-muted); transition: transform .15s; }
.club-details[open] .chev-wrap { transform: rotate(90deg); }
.club-details[open] summary .when-closed { display: none; }
.club-details:not([open]) summary .when-open { display: none; }
.club-details > .stat-strip, .club-details > .hole-pane, .club-details > .hole-btns { margin-top: 10px; }
.club-details summary:hover .chev-wrap { color: var(--brand); }

/* Info-Fragezeichen + schwebendes Erklaerfenster */
.sc-table th:first-child { white-space: nowrap; }
.th-flex { display: inline-flex; align-items: center; gap: 6px; }
.qtip { display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--hover-bg); color: var(--text-muted); font-size: 11px; font-weight: bold;
  cursor: help; margin-left: 0; padding: 0; line-height: 1; flex: 0 0 auto;
  box-shadow: var(--shadow-xs); }
.qtip:hover { border-color: var(--brand); color: var(--brand); background: var(--hover-bg); }
/* DQ-01h: Tooltip am Element selbst (statt ?-Knopf) */
.has-tip { cursor: help; }
.has-tip:hover { color: var(--brand); }
.tipbox .sc-ico { vertical-align: -3px; margin: 0 1px; }
.tipbox { position: fixed; z-index: 200; max-width: 280px; padding: 9px 12px;
  background: var(--card-bg); border: 1px solid var(--brand); border-radius: 8px;
  font-size: 12.5px; line-height: 1.45; color: var(--text);
  box-shadow: var(--shadow-lg); }
tr.shot-off td { opacity: .45; }
tr.shot-off td:first-child { opacity: 1; }

/* Info-Boxen als Zeilen-Raster + Abstand Scorecard -> Lochkarte */
.tip-intro { margin-bottom: 7px; }
.tip-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.tip-sym { display: inline-flex; justify-content: center; min-width: 26px; }
.tip-note { margin-top: 8px; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--border); padding-top: 6px; }
.sc-wrap { margin-bottom: 18px; }

/* Runden-Schalter (Wertung / HC) + Listen-Kennzeichen */
.flag-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); }
.flag-label input { accent-color: var(--brand); }
.flag-label.flag-on-red { border-color: var(--danger); color: var(--danger-text); }
.flag-label.flag-on-green { border-color: var(--success); color: var(--success-text); }
.mini-flag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 999px;
  margin-left: 6px; vertical-align: 1px; border: 1px solid; }
.mini-red { border-color: var(--danger); color: var(--danger-text); }
.mini-green { border-color: var(--success); color: var(--success-text); }

/* Dokumente-Block */
.doc-upload { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.dropzone { display: flex; align-items: center; gap: 10px; padding: 16px 14px; border: 2px dashed var(--border);
  border-radius: 10px; cursor: pointer; color: var(--text-muted); position: relative; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--brand); color: var(--brand); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-file { font-size: 12px; }
.doc-upload-row { display: flex; gap: 10px; align-items: center; }
.doc-badge { display: inline-block; font-size: 10px; font-weight: bold; padding: 2px 7px;
  border: 1.5px solid var(--swatch, var(--border)); color: var(--swatch, var(--text));
  border-radius: 6px; letter-spacing: .3px; }

/* Dokumente-Tabelle: aufgeraeumt */
.doc-table td, .doc-table th { vertical-align: middle; padding: 8px 10px; }
.doc-table th:first-child, .doc-table td:first-child { width: 58px; text-align: center; padding-left: 0; }
.doc-table td:nth-child(2) a { color: var(--brand); text-decoration: none; }
.doc-table td:nth-child(2) a:hover { text-decoration: underline; }
.doc-table td:nth-child(2) a:visited { color: var(--brand); }
.doc-table th:last-child, .doc-table td:last-child { width: 46px; text-align: right; }
.doc-table td:nth-child(4), .doc-table th:nth-child(4),
.doc-table td:nth-child(5), .doc-table th:nth-child(5) { white-space: nowrap; }

/* Anhang-Hinweis in der Runden-Liste */
.mini-doc { border-color: var(--border); color: var(--text-muted); display: inline-flex; align-items: center; gap: 3px; }

/* Muelleimer in der Dokument-Zeile exakt mittig */
.doc-table td:last-child form { margin: 0; display: inline-flex; align-items: center; }
.doc-table td:last-child .btn-danger-small { margin: 0; }

/* Lightbox (Bild-Modal) */
.lightbox { position: fixed; inset: 0; z-index: 500; background: var(--overlay-strong);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.lb-inner { max-width: min(94vw, 1100px); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--lightbox-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-xl); }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: bold; }
.lb-close { background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; line-height: 1; }
.lb-close:hover { border-color: var(--brand); color: var(--brand); }
.lightbox img { display: block; max-width: 100%; max-height: calc(92vh - 56px); object-fit: contain; }
.round-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.round-sub .mini-flag { margin-left: 0; flex: 0 0 auto; }
.round-badges { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.mini-cross { display: inline-flex; align-items: center; }
.round-item.r-off { opacity: .55; }
.round-item.r-off:hover, .round-item.r-off.active { opacity: .85; }

/* ============================================================
   FARB-AUSWAHL (Akzentfarbe in den Einstellungen)
   Muster aus TORSERVICE24: runde Swatches, Auswahl mit Ring.
   ============================================================ */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.color-option { cursor: pointer; }
.color-option input { display: none; }
.color-swatch-pick {
    display: block; width: 32px; height: 32px; border-radius: 50%;
    border: 3px solid transparent;
    /* Farbe kommt als CSS-Variable --swatch aus dem Markup (kein Inline-background) */
    background: var(--swatch, var(--brand)); color: var(--swatch, var(--brand));
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.color-option:hover .color-swatch-pick { transform: scale(1.08); }
.color-option input:checked + .color-swatch-pick {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px currentColor;
    transform: scale(1.15);
}


/* ============================================================
   LISTEN-TOOLBAR (Suche + Filter) - aus TORSERVICE24
   ============================================================ */
.list-toolbar { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.search-box { position: relative; display: flex; align-items: center; flex: 1 1 280px; min-width: 220px; }
.search-box .icon { position: absolute; left: 10px; color: var(--text-muted); pointer-events: none; }
.search-box .icon svg { width: 16px; height: 16px; }
.search-box input { padding-left: 34px; }

/* ============================================================
   EMPTY STATE (leere Listen freundlich erklaeren)
   ============================================================ */
.empty-state {
  text-align: center; padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}
.empty-state .icon svg { width: 40px; height: 40px; opacity: .5; }
.empty-state h3 { margin: 10px 0 4px; color: var(--text); font-size: var(--font-md); }
.empty-state p { margin: 0; font-size: var(--font-sm); }

/* ============================================================
   AKKORDEON (global wiederverwendbar) - aus TORSERVICE24
   <div class="accordion"><div class="accordion-item open">
     <button class="accordion-header"><span class="accordion-title">..</span>
       <span class="accordion-chevron">SVG</span></button>
     <div class="accordion-body">..</div></div></div>
   ============================================================ */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 12px 16px; background: var(--bg-subtle); border: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: var(--font-sm); color: var(--text);
  transition: background var(--transition-fast); text-align: left; gap: 8px;
  margin: 0; box-shadow: none; border-radius: 0;
}
.accordion-header:hover { background: var(--hover-bg); transform: none; box-shadow: none; }
.accordion-chevron { display: inline-flex; transition: transform var(--transition-fast); color: var(--text-muted); }
.accordion-item.open .accordion-chevron { transform: rotate(90deg); }
.accordion-body { padding: var(--space-md); display: none; background: var(--card-bg); }
.accordion-item.open .accordion-body { display: block; }


/* Rechte-Matrix: Bereichs-Beschreibung + dreistufige Rechte-Zellen */
.marea-title { color: var(--brand); font-weight: 700; font-size: var(--font-sm);
  text-transform: uppercase; letter-spacing: .5px;
  display: flex; align-items: center; gap: 7px; }
.marea-ico { display: inline-flex; color: var(--text-secondary); }
.marea-ico svg { width: 16px; height: 16px; }
.marea-desc { color: var(--text-secondary); font-size: var(--font-sm); margin-top: 2px;
  font-weight: normal; text-transform: none; letter-spacing: 0; }
.mperm-name { font-weight: 600; font-size: var(--font-base); }
.mperm-desc { color: var(--text-secondary); font-size: var(--font-sm); margin-top: 2px; line-height: 1.45; }
.mperm-key  { color: var(--text-muted); font-size: var(--font-xs); font-family: var(--font-mono); margin-top: 3px; }


/* Rechte-Matrix als Bereichs-Akkordeon */
.marea-toggle { cursor: pointer; user-select: none; }
.marea-toggle:hover td { background: var(--hover-bg); }
.marea-head { display: flex; gap: 8px; align-items: flex-start; }
.marea-chev { display: inline-flex; margin-top: 2px; color: var(--text-muted);
  transition: transform var(--transition-fast); }
.marea-toggle.open .marea-chev { transform: rotate(90deg); }
.marea-count { color: var(--text-muted); font-weight: normal; font-size: var(--font-xs);
  text-transform: none; letter-spacing: 0; margin-left: 8px; }


/* Runden-Kategorien: farbige Pills (Randfarbe frei waehlbar) */
.cat-pill { display: inline-flex; align-items: center; gap: 4px;
  border: 1.5px solid var(--swatch, var(--border)); color: var(--swatch, var(--text));
  border-radius: var(--radius-full);
  padding: 2px 10px; font-size: var(--font-sm); font-weight: 600;
  background: var(--card-bg); line-height: 1.4; white-space: nowrap; }
.cat-pill-mini { padding: 0 7px; font-size: 11px; border-width: 1.5px; }
.cat-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.cat-x { border: 0; background: none; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 0 0 2px; margin: 0; opacity: .7; }
.cat-x:hover { opacity: 1; background: none; transform: none; box-shadow: none; }
.cat-addform select { padding: 3px 8px; font-size: var(--font-sm); border-radius: var(--radius-full); }
.cat-manage { display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-muted); font-size: var(--font-sm); text-decoration: none; }
.cat-manage:hover { color: var(--text); }
.cat-create { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat-color-label { display: inline-flex; align-items: center; cursor: pointer; }
.cat-color-label input[type=color] { width: 38px; height: 32px; padding: 2px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card-bg); cursor: pointer; }


/* Kategorie-Farb-Vorauswahl (Feinjustierung daneben per Farbwaehler) */
.cat-swatches { display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.cat-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; margin: 0; }
.cat-swatch:hover { transform: scale(1.15); }
.cat-swatch.on { box-shadow: 0 0 0 2px var(--text); }


/* Kategorien in der Runden-Liste: EIGENE Zusatz-Zeile unter dem
   Eintrag - Badge-Zeile (HC/Wertung/Dokumente) bleibt unberuehrt */
.round-cats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px;
  justify-content: flex-end; }   /* von rechts nach links, wie die Badges */


/* Strafschlaege im Score: (+15/3) - die 3 in Rot */
.pen-red { color: var(--danger); font-weight: 600; }


/* Runden-Kopf: vier Info-Bloecke in einer Reihe */
.head-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 4px; }
@media (max-width: 1250px) { .head-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .head-grid { grid-template-columns: 1fr; } }
.hblock { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--card-bg); }
.hblock-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.hblock-label svg { color: var(--text-secondary); }
.hb-main { font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.hb-line { font-size: 13.5px; color: var(--text-secondary); margin-top: 6px;
  line-height: 20px; min-height: 20px; }
.hb-line b { color: var(--text); }
.hb-links { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.hb-links a { color: var(--link); font-size: 13px; text-decoration: none;
  display: inline-flex; gap: 4px; align-items: center; }
.hb-links a:hover { text-decoration: underline; }
.hb-big { font-size: 16.5px; font-weight: 700; margin-top: 0; line-height: 1.3; }  /* wie hb-main */
.hb-big .pen-red { font-size: inherit; }
.hb-big .qtip { vertical-align: middle; }
.hb-big small { font-size: 13px; font-weight: 700; color: var(--text); }  /* ganze Zeile fett */
.hb-flags { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }


/* Wertung-Block: Loeschen rechts in der Ueberschrift, Schalter als
   schlichter Text (keine Pill-Umrandungen), Kategorien-Haekchen darunter */
.hblock-label-row { justify-content: space-between; }
.hblock-label-row .btn-danger-small { margin: -4px 0; }
.hb-flags-plain .flag-label { border: none; background: none; padding: 0;
  border-radius: 0; box-shadow: none; font-size: var(--font-sm); }
.hb-cats-sep { border-top: 1px solid var(--border-light); margin: 2px 0; width: 100%; }


/* Platz-Block: Konstellation klein unter dem Stammplatz */
.hb-sub { font-size: var(--font-sm); color: var(--text-muted); margin-top: 6px;
  line-height: 20px; min-height: 20px; }
/* Wertung: Schalter-Schrift IMMER neutral (kein Rot/Gruen), Zustand zeigt das Haekchen */
.hb-flags-plain .flag-label,
.hb-flags-plain .flag-label.flag-on-red,
.hb-flags-plain .flag-label.flag-on-green { color: var(--text-secondary); }
/* Wetter-Zeilen: Icons dezent */
.hb-line .icon { color: var(--text-muted); vertical-align: -3px; display: inline-flex; }
.hb-line .icon svg { width: 17px; height: 17px; }
.hb-line > span[style*="font-size:15px"] { line-height: 20px; display: inline-block; }


/* Kategorien-Zeile: "verwalten" ganz nach rechts */
.cat-row .cat-manage { margin-left: auto; }


/* GLOBAL: Haekchen ueberall in Markenfarbe (Wertung-Block, Lochkarte,
   Sessions, Matrix ... ein Verhalten fuer die ganze Anwendung) */
input[type="checkbox"] { accent-color: var(--brand); }

/* Wertung-Block: gleicher Zeilen-Rhythmus wie die anderen Bloecke */
.hb-flags { gap: 6px; }   /* EIN Zeilen-Rhythmus fuer alle vier Bloecke (wie hb-line) */
.hb-flags form { line-height: 20px; }
.hb-flags-plain .flag-label { font-size: 13.5px; line-height: 20px; height: 20px; margin: 0; gap: 6px; }
.hb-flags-plain input[type="checkbox"] { width: 14px; height: 14px; margin: 0; }

/* Listen-Badges als SVG-Icons (Pokal = Turnier, Medaille = HC) */
.mini-ico { display: inline-flex; align-items: center; }
.mini-ico svg { width: 17px; height: 17px; }


/* Handicap-Kopf: grosse Kennzahlen-Leiste + kompakte Meta-Zeile */
.hcp-hero { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-end;
  margin-top: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-light); }
.hcp-kpi-val { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--text); }
.hcp-kpi-name { font-size: 30px; }
.hcp-kpi-lab { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-muted); margin-top: 4px; }
.hcp-meta { display: flex; gap: 22px; flex-wrap: wrap; align-items: center;
  margin-top: 12px; font-size: 13.5px; color: var(--text-secondary); }
.hcp-meta b { color: var(--text); }
.hcp-meta-import { color: var(--text-muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 560px) { .hcp-kpi-val, .hcp-kpi-name { font-size: 24px; } .hcp-hero { gap: 24px; } }


/* Menue-Akkordeon (Sidebar-Gruppen) */
.nav-grp-head { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  padding: 9px 14px; margin: 2px 0; border-radius: var(--radius-sm);
  color: var(--sidebar-muted); font-size: var(--font-sm); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  transition: background var(--transition-fast), color var(--transition-fast); }
.nav-grp-head:hover { color: var(--sidebar-text); background: var(--sidebar-hover); }
.nav-grp-title { flex: 1; }
.nav-grp-chev { margin-left: auto; }
/* Eintraege in Gruppen leicht eingerueckt */
.nav-grp-body .nav-item { padding-left: 26px; }
.nav-grp-title { flex: 1; }
.nav-grp-chev { display: inline-flex; transition: transform var(--transition-fast); }
.nav-grp-chev svg { width: 13px; height: 13px; }
.nav-grp.open .nav-grp-chev { transform: rotate(90deg); }
.nav-grp:not(.open) .nav-grp-body { display: none; }
.nav-divider { height: 1px; background: var(--sidebar-border); margin: 10px 14px 2px; }


/* ============================================================
   TOAST-Meldungen (kurz aufpoppend, nach TORSERVICE-Vorbild)
   ============================================================ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: var(--radius-md); background: var(--card-bg); color: var(--text);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  font-size: var(--font-sm); font-weight: 500; min-width: 280px;
  animation: toastSlideIn .3s ease; }
.toast .icon { flex-shrink: 0; }
.toast .icon svg { width: 18px; height: 18px; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success .icon { color: var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-error .icon { color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .icon { color: var(--warning); }
.toast-info    { border-left: 3px solid var(--brand); }
.toast-info .icon { color: var(--brand); }
.toast.removing { animation: toastSlideOut .3s ease forwards; }
@keyframes toastSlideIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastSlideOut { to { transform: translateX(110%); opacity: 0; } }


/* ============================================================
   Auswertung / Strokes Gained
   ============================================================ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filt { font-size: 12.5px; padding: 6px 13px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary);
  text-decoration: none; transition: all var(--transition-fast); }
.filt:hover { border-color: var(--brand); color: var(--brand); }
.filt.on { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }

.sg-diag { display: flex; gap: 14px; align-items: flex-start; margin: 14px 0;
  background: linear-gradient(135deg, var(--warning-light), var(--danger-light)); border: 1px solid var(--warning-border);
  border-radius: 12px; padding: 16px 20px; }

.sg-diag-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--warning);
  color: var(--brand-contrast); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.sg-diag h3 { font-size: 16px; margin: 0 0 4px; }
.sg-diag > div > p { margin: 0; font-size: 13.5px; color: var(--text-secondary); }
.sg-diag .hl { background: var(--highlight-bg); padding: 1px 5px; border-radius: 4px; font-weight: 600; color: var(--highlight-text); }

.sg-row { display: grid; grid-template-columns: 120px 1fr 62px; align-items: center; gap: 12px; margin: 12px 0; }
.sg-lab { font-size: 14px; font-weight: 600; }
.sg-track { position: relative; height: 28px; background: var(--border-light); border-radius: 6px; }
.sg-zero { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--text-muted); z-index: 2; }
.sg-bar { position: absolute; top: 4px; height: 20px; border-radius: 4px; z-index: 1;
  width: var(--w, 0%); }
.sg-bar.sg-neg { left: var(--l, 50%); }
.sg-pos { background: linear-gradient(90deg, var(--cd-light), var(--cd-green)); left: 50%; }
.sg-neg { background: linear-gradient(90deg, var(--danger), var(--danger-soft)); }
.sg-val { font-size: 14px; font-weight: 700; text-align: right; }
.sg-val.pos { color: var(--success-text); } .sg-val.neg { color: var(--danger-text); }
.sg-legend { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; }

.sg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .sg-two { grid-template-columns: 1fr; } }
.sg-rings { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.sg-ring { text-align: center; }
.sg-ring .rl { font-size: 11px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .4px; }

.sg-spark { display: flex; align-items: flex-end; gap: 6px; height: 100px; border-bottom: 2px solid var(--border); padding-top: 16px; }
.sg-sbar { flex: 1; background: linear-gradient(180deg, var(--cd-light), var(--cd-green)); border-radius: 3px 3px 0 0; position: relative; min-height: 6px;
  height: var(--h, 6px); }
.sg-sbar.neg { background: linear-gradient(180deg, var(--danger-soft), var(--danger)); }
.sg-sbar span { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font-size: 9.5px; font-weight: 700; color: var(--text-secondary); }
.sg-spark-x { display: flex; gap: 6px; margin-top: 4px; }
.sg-spark-x div { flex: 1; text-align: center; font-size: 9px; color: var(--text-muted); }

.sg-reco { background: var(--info-light); border: 1px solid var(--info-border);
  border-radius: 10px; padding: 14px 18px; font-size: 13.5px; line-height: 1.55; color: var(--info-text); }
.sg-reco b { color: var(--info-text); }
[data-theme="dark"] .sg-reco { color: var(--info-text); }
.sg-reco .hl { background: var(--highlight-bg); padding: 1px 5px; border-radius: 4px; font-weight: 600; color: var(--highlight-text); }


/* ===== UI-06: kleine Utility-/Bausteinklassen (ersetzen Inline-Styles in runden.php) ===== */
.ui-mt    { margin-top: 10px; }
.ui-mt-sm { margin-top: 8px; }
.ui-mt-xs { margin-top: 6px; }
.ui-ml-sm { margin-left: 8px; }
.ui-w100  { width: 100%; }
.ui-flex1 { flex: 1; }
.ui-nowrap { white-space: nowrap; }
.ui-inline-form { margin: 0; display: inline; }
.ui-hint-sm { margin: 6px 0 0; font-size: 12px; }
.ui-iconrow { display: inline-flex; align-items: center; gap: 6px; }
.ui-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wx-sym { font-size: 15px; }
.flag-row { display: flex; gap: 16px; flex-wrap: wrap; }
.ring-label--row { display: inline-flex; align-items: center; gap: 5px; }
.th-flex { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hole-view-btns { display: flex; gap: 6px; margin-bottom: 8px; }
.hole-view-btns .btn-toggle-small { margin-top: 0; }
.hole-title { margin-top: 0; }
.hole-meta { margin: 0 0 6px; }
.hole-sat { aspect-ratio: 1 / 1; }
/* hidden-Attribut gewinnt IMMER – auch gegen Klassen mit eigenem display
   (Fix: leeres 1:1-Quadrat unter der Lochkarte, weil .hole-map display:block
   das Browser-hidden übersteuert hatte) */
[hidden] { display: none !important; }
.mini-ico--slate { color: var(--text-muted); }
.mini-ico--amber { color: var(--warning); }
.mini-ico--brand { color: var(--brand); }
/* DQ-01: Herkunfts-Icons (Datenquelle) – gedaempft, je Quelle leicht getoent */
.src-ico { color: var(--text-secondary); cursor: help; }
.src-ico--skytrak        { color: var(--src-skytrak); }
.src-ico--garmin_lm      { color: var(--src-garmin); }
.src-ico--launch_monitor { color: var(--src-skytrak); }
.src-ico--garmin_ct10    { color: var(--src-garmin); }
.src-ico--golfde         { color: var(--src-golfde); }
.src-ico--manual         { color: var(--src-manual); }
.src-line { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.src-line .mini-ico svg { width: 14px; height: 14px; }
.hblock .btn-small { margin-top: 0; }  /* nur im Runden-Kopf */

/* UI-07 */
.ui-ico-brand { color: var(--brand); }
.ui-fs-sm { font-size: 12px; }
.ui-m0 { margin: 0; }
.hb-main--big { font-size: 28px; }
.hb-line--dim { font-size: 12px; color: var(--text-muted); }

/* UI-08: Platz-Filter als Pillen-Select in der Chip-Zeile */
.filt-select { font-size: 12.5px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text); }
.filt-select:hover { border-color: var(--brand); }

/* UI-09 */
.bm-code { width: 100%; font-size: 11px; }
.ui-row--center { align-items: center; }

/* UI-10: Fusszeile mit Build-Angabe */
.site-build { max-width: 1400px; margin: 18px auto 10px; padding: 0 20px; text-align: right; }
.site-build .ui-muted { font-size: 11px; }

/* FJ-01: Überschriften-Icons als TORSERVICE-Kacheln (Vorbild .stat-icon):
   abgerundetes Quadrat, getönter Marken-Hintergrund, Markenfarbe.
   h1 = 34px-Kachel, h2/h3 = 28px, Aufklapp-Summaries = 24px. */
h1 .icon, h2 .icon, h3 .icon, .club-details summary .icon {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); background: var(--brand-primary-light);
  color: var(--brand-primary-text); vertical-align: middle; margin-right: 2px;
}
h1 .icon { width: 40px; height: 40px; }
h1 .icon svg { width: 22px; height: 22px; }
h2 .icon, h3 .icon { width: 34px; height: 34px; }
h2 .icon svg, h3 .icon svg { width: 19px; height: 19px; }
.club-details summary .icon { width: 30px; height: 30px; }
.club-details summary .icon svg { width: 17px; height: 17px; }
/* Kleine Beschriftungs-Icons (hblock-Köpfe) bleiben bewusst schlicht/gedämpft
   wie die Rechte-Matrix (.marea-ico) – Kachel nur für echte Überschriften. */

/* Strokes-Gained-Kachel im Statistik-Block (ersetzt die Garmin-Wertung) */
.stat-sg .sg-total { font-size: 22px; font-weight: 700; margin-top: 6px; line-height: 1.1; }
.stat-sg .sg-total small { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.stat-sg .sg-total.pos { color: var(--success-text); }
.stat-sg .sg-total.neg { color: var(--danger-text); }
.stat-sg { min-width: 300px; text-align: left; align-items: stretch; }   /* Zeilen auf volle Kachelbreite, sonst kollabiert die Balkenspur */
.stat-sg > :first-child { margin-top: 0; }
.stat-sg .sg-row--mini { display: grid; width: 100%; grid-template-columns: 92px minmax(120px, 1fr) 46px; gap: 8px; margin: 5px 0; cursor: default; }
.stat-sg .sg-row--mini .sg-track { min-width: 120px; }
.stat-sg .sg-row--mini .sg-lab { font-size: 12.5px; }
.stat-sg .sg-row--mini .sg-track { height: 16px; }
.stat-sg .sg-row--mini .sg-bar { top: 3px; height: 10px; }
.stat-sg .sg-row--mini .sg-val { font-size: 12.5px; }
.stat-sg .sg-total { text-align: center; font-size: 18px; }
.stat-sg .ring-label { text-align: center; }

/* Statistik-Kacheln mit Ueberschrift oben (wie die Kopfkarten) */
.stat-strip--labeled .stat-tile { align-items: stretch; justify-content: flex-start; padding: 12px 14px; gap: 0; }
.stat-strip--labeled .stat-tile > :first-child { margin-top: 0; }
.stat-strip--labeled .hblock-label { margin-bottom: 8px; }
.stat-strip--labeled .stat-body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.stat-strip--labeled .stat-body .ring-tile { border: 0; padding: 0; min-width: 0; }
.stat-strip--labeled .stat-tile--stack .stat-body { justify-content: space-evenly; gap: 10px; }
.stat-strip--labeled .stat-row { text-align: center; }
.stat-strip--labeled .stat-row .ring-label { margin-top: 2px; }
.stat-strip--labeled .stat-sg .stat-body { align-items: stretch; }

/* Anwendungs-Stand unter "Abmelden" (PL-01c) */
.sidebar-build { display: block; padding: 8px 12px 0; font-size: 10.5px; color: var(--sidebar-muted); opacity: .8; white-space: nowrap; }
.sidebar.collapsed .sidebar-build { display: none; }

/* FJ-02: Bewertung-Karte - Segment-Schalter + Spielform-Select */
.flag-row--between { justify-content: space-between; align-items: center; width: 100%; gap: 10px; flex-wrap: nowrap; }
/* Segment-Schalter und Spielform-Select: gleiche Breite und Hoehe -> "aus einem Guss" */
.seg { display: inline-flex; width: 118px; flex: 0 0 118px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg__btn { flex: 1 1 0; text-align: center; border: 0; background: transparent; color: var(--text-secondary); font-size: 12px; line-height: 18px;
  padding: 0 4px; cursor: pointer; }
.seg__btn + .seg__btn { border-left: 1px solid var(--border); }
.seg__btn.on { background: var(--brand-primary-light); color: var(--brand-primary-text); font-weight: 600; }
.seg__btn:hover:not(:disabled) { color: var(--brand); }
.seg--off { opacity: .45; } .seg--off .seg__btn { cursor: default; }
.hb-select { font-size: 12px; line-height: 16px; height: 20px; padding: 0 4px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text); width: 118px; flex: 0 0 118px; box-sizing: border-box; }
.hb-flags-plain .flag-row--between > .flag-label,
.hb-flags-plain .flag-row--between > form { flex: 0 0 auto; }
.hb-flags-plain .flag-row--between .flag-label { white-space: nowrap; }
.hb-flags-plain .flag-row--between .flag-label { cursor: default; }

/* FJ-02: Karten-Ueberschriften - Icon als getoente Kachel (TORSERVICE-Muster wie Panel-Titel) */
.hblock-label > .icon:first-child,
.hblock-label > .ui-iconrow > .icon:first-child { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; background: var(--brand-primary-light); color: var(--brand-primary-text); }
.hblock-label > .icon:first-child svg,
.hblock-label > .ui-iconrow > .icon:first-child svg { width: 16px; height: 16px; color: inherit; }
/* Zusatz-Icons rechts (Herkunft, Bedingungen) bleiben schlicht - sie sind Ergaenzung, keine Ueberschrift */
.hblock-label .hb-tools { display: inline-flex; align-items: center; gap: 6px; }

/* FJ-02e: Platzbedingungen im Block "Datum & Wetter" (Icons + Auswahl-Popover) */
.hblock-label-row .src-ico { margin-right: 2px; }
.cond-wrap { display: inline-flex; align-items: center; gap: 4px; position: relative; }
.cond-ico { color: var(--warning); }   /* Farbe wird inline aus der Kategorie gesetzt */
.cond-ico svg { width: 14px; height: 14px; }
.cond-pop { position: relative; }
.cond-pop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 4px 8px; border-radius: var(--radius); margin: -4px 0; }   /* = .btn-danger-small, nur neutral */
.cond-pop > summary::-webkit-details-marker { display: none; }
.cond-pop > summary:hover, .cond-pop[open] > summary { color: var(--brand); border-color: var(--brand); background: var(--hover-bg); }
.cond-pop > summary svg { width: 14px; height: 14px; }
.cond-menu { position: absolute; right: 0; top: 30px; z-index: 50; min-width: 200px; padding: 8px 10px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg);
  text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; color: var(--text); }
.cond-title { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.cond-item { display: flex; align-items: center; gap: 7px; padding: 3px 0; cursor: pointer; white-space: nowrap; }
.cond-item .icon { display: inline-flex; }
.cond-item .icon svg { width: 14px; height: 14px; }
.cond-item input { width: 14px; height: 14px; margin: 0; }

/* FJ-03: Icon-Auswahl auf der Kategorien-Seite */
.ui-iconpick { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.ui-iconpick label { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--text-secondary); background: var(--card-bg); }
.ui-iconpick label:hover { border-color: var(--brand); color: var(--brand); }
.ui-iconpick input { position: absolute; opacity: 0; width: 0; height: 0; }
.ui-iconpick input:checked + .icon, .ui-iconpick label.on { color: var(--brand-primary-text); background: var(--brand-primary-light); border-color: var(--brand); }
.ui-iconpick label.none { font-size: 11px; width: auto; padding: 0 8px; }
.ui-iconpick svg { width: 15px; height: 15px; }
.cat-meta { display: inline-flex; align-items: center; gap: 6px; }
.cat-meta select { font-size: 12px; padding: 1px 4px; }
.cat-icon-cell { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; }

/* FJ-04: Bereichs-Checkboxen und Icon-Dropdown mit Vorschau (Kategorien) */
.ui-scopeboxes { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ui-scopegrp { display: inline-flex; flex-direction: column; gap: 2px; }
.ui-scopegrp__t { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); }
.ui-scopegrp label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.ui-scopegrp input { margin: 0; }
/* Icon-Dropdown mit Symbol vor jedem Eintrag (FJ-04b) */
.ui-iconsel { position: relative; display: inline-block; }
.ui-iconsel > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 3px 6px 3px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); font-size: 12.5px; min-width: 190px; }
.ui-iconsel > summary::-webkit-details-marker { display: none; }
.ui-iconsel > summary:hover, .ui-iconsel[open] > summary { border-color: var(--brand); }
.ui-iconsel__prev { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; border: 1px dashed var(--border); flex: 0 0 22px; }
.ui-iconsel__prev svg { width: 14px; height: 14px; }
.ui-iconsel__lbl { flex: 1 1 auto; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-iconsel__menu { position: absolute; z-index: 60; left: 0; top: calc(100% + 4px); min-width: 230px; max-height: 300px; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.ui-iconsel__menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--text); font-size: 12.5px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.ui-iconsel__menu button:hover { background: var(--hover-bg); }
.ui-iconsel__menu button.on { background: var(--brand-primary-light); color: var(--brand-primary-text); font-weight: 600; }
.ui-iconsel__ico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-secondary); }
.ui-iconsel__ico svg { width: 15px; height: 15px; }
.ui-iconsel__menu button.on .ui-iconsel__ico { color: inherit; }
.cond-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }

/* FJ-05: Gruppen-Zwischenzeilen im Zuordnen-Popover, Inline-Eingabe */
.cond-grp { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); margin: 6px 0 2px; }
.cond-grp:first-child { margin-top: 0; }
.ui-input-inline { font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); max-width: 180px; }
