/* AEON · Clarity. Lesbarkeit und Übersicht für die ganze App, ohne Daten oder Logik zu ändern.
   Schicht über Scene: höherer Kontrast, klare Seitenköpfe, ruhige Karten, große Tippflächen,
   einklappbare Karten (Titel bleiben als Inhaltsverzeichnis sichtbar).
   Abschalten: localStorage "aeon.clarity" = "0". Eine Akzentfarbe (Amber), Inter + JetBrains Mono. */

html.clarity {
  --sc-text-2: rgba(245, 245, 247, .76);
  --sc-text-3: rgba(245, 245, 247, .58);
  --sc-glass: rgba(18, 19, 18, .78);
  --sc-shadow: 0 14px 34px -20px rgba(0, 0, 0, .7);
  --cl-gap: 14px;
  --cl-pad: 18px;
}
html.clarity #aeon-dash { --t2: rgba(245, 245, 247, .76); --t3: rgba(245, 245, 247, .58); }

/* Grundtext */
html.clarity.shell main.app { font-size: 15px; line-height: 1.5; }
html.clarity.shell main.app :is(p, li, .sub, .faint, .muted, .note) { color: var(--sc-text-2); }
html.clarity.shell main.app :is(.faint, .muted, .sub) { font-size: 13px; }
html.clarity.shell main.app :is(.eyebrow, .kicker, .cap, .sec-title, .group-title, th) {
  font-size: 11.5px !important; letter-spacing: .07em !important; color: var(--sc-text-3) !important;
}

/* Seitenkopf */
html.clarity.shell main.app header.top h1 {
  font-weight: 600 !important; letter-spacing: -.03em !important;
  font-size: clamp(26px, 6.4vw, 34px) !important; line-height: 1.1 !important; margin: 4px 0 16px !important;
}
html.clarity.shell main.app header.top .meta { font-size: 13px; color: var(--sc-text-2); letter-spacing: 0; }

/* Abstände */
html.clarity.shell main.app .stack { gap: var(--cl-gap); }

/* Karten */
html.clarity.shell main.app :is(.card, .panel, .weekboard, .aeon-cockpit, .ironman-card, .swim-hero, .diag-hero, .goal-coach-card, .rp-hero, .ss-glass) {
  background: var(--sc-glass) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important; backdrop-filter: blur(18px) saturate(150%) !important;
  border-radius: 22px !important;
}
html.clarity.shell main.app .card { padding: var(--cl-pad); }
html.clarity.shell main.app .card > h3 {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; min-height: 28px;
}
html.clarity.shell main.app .card > h3 .label {
  font: 600 16px/1.3 Inter, system-ui, sans-serif !important; letter-spacing: -.01em !important;
  text-transform: none !important; color: var(--sc-text) !important;
}
html.clarity.shell main.app .card > h3 .faint { font-size: 12.5px !important; color: var(--sc-text-2); text-align: right; }

/* Einklappbare Karten */
html.clarity .card.cl-fold > h3 { cursor: pointer; margin-bottom: 0; min-height: 44px; -webkit-tap-highlight-color: transparent; border-radius: 12px; }
html.clarity .card.cl-fold:not(.cl-closed) > h3 { margin-bottom: 12px; }
html.clarity .card.cl-fold > h3::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-left: 4px;
  border-right: 2px solid var(--sc-text-3); border-bottom: 2px solid var(--sc-text-3);
  transform: translateY(-2px) rotate(45deg); transition: transform .28s var(--sc-ease, ease);
}
html.clarity .card.cl-fold.cl-closed > h3::after { transform: translateY(1px) rotate(-45deg); }
html.clarity .card.cl-fold > h3 .faint { margin-left: auto; }
html.clarity .card.cl-closed > :not(h3) { display: none !important; }

/* Tippflächen */
html.clarity.shell :is(.btn, button.action, a.action, .go-back, .back) { min-height: 44px; padding-inline: 18px; font-size: 14px !important; display: inline-flex; align-items: center; justify-content: center; }
html.clarity.shell .btn.sm { min-height: 40px; padding-inline: 15px; }
html.clarity.shell .iconbtn { min-width: 44px; min-height: 44px; }
html.clarity.shell :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select, textarea) { min-height: 46px; font-size: 16px !important; }
html.clarity.shell :is(.chip, .tag) { font-size: 12.5px !important; padding: 4px 11px !important; }

/* Navigation */
html.clarity .sh-sub button, html.clarity.shell .training-directory a { height: 40px; font-size: 14px; color: rgba(245, 245, 247, .84); }
html.clarity .sh-sub .sh-ind { height: 44px; }
html.clarity .sh-sub button[aria-selected="true"], html.clarity.shell .training-directory a[aria-current="page"] { color: #1a1206; }
html.clarity .sh-dock a { font-size: 11px; color: rgba(245, 245, 247, .68); min-height: 56px; }
html.clarity .sh-dock a[aria-current="page"] { color: #F5F5F7; font-weight: 600; }
html.clarity .sh-rail a { color: rgba(245, 245, 247, .72); }
html.clarity .sh-search { color: rgba(245, 245, 247, .66); }

/* Fokus */
html.clarity :is(a, button, summary, [role="button"], input, select, textarea):focus-visible { outline: 2px solid var(--accent, #E9A35B); outline-offset: 2px; }

@media (max-width: 759px) {
  html.clarity { --cl-gap: 12px; --cl-pad: 16px; }
  html.clarity.shell main.app :is(.card, .panel) { border-radius: 20px !important; }
  html.clarity.shell main.app table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (min-width: 1100px) { html.clarity.shell main.app > .stack { max-width: 980px; } }
@media (prefers-contrast: more) {
  html.clarity { --sc-text-2: rgba(245, 245, 247, .9); --sc-text-3: rgba(245, 245, 247, .74); --sc-glass: rgba(10, 10, 10, .92); }
}
@media (prefers-reduced-motion: reduce) { html.clarity .card.cl-fold > h3::after { transition: none; } }

@media (max-width: 759px) {
  html.clarity.shell main.app .stack > .card.cl-fold {
    padding: 8px 0;
    border: 0;
    border-top: 1px solid rgba(245,245,247,.16);
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
