/* =========================================================================
   Seitenaufbau: Hintergrund, Handy- und Desktop-Layout
   Handy = Figma V7.2 / Einrichten (390 breit) · Desktop = Figma Seite 04/05 (1440 × 900)
   ========================================================================= */

.seite { position: relative; min-height: 100dvh; isolation: isolate; }

/* ---------- Hintergrund Handy: Salbei-Verlauf oben → hell */
.hintergrund { position: absolute; inset: 0 0 auto 0; height: 844px; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--salbei-1) 0%, var(--salbei-2) 36%, var(--salbei-3) 56%, var(--grund) 70%, var(--grund) 100%); }
.hintergrund--einrichten { background: linear-gradient(180deg, var(--salbei-1) 0%, var(--salbei-2) 28%, var(--salbei-3) 42%, var(--grund) 52%, var(--grund) 100%); }
.hintergrund--wahl { background: linear-gradient(180deg, var(--salbei-1) 0%, var(--salbei-2) 24%, var(--salbei-3) 36%, var(--grund) 46%, var(--grund) 100%); }
.farbflaeche { position: absolute; border-radius: 50%; filter: blur(100px); }
.farbflaeche--a { width: 260px; height: 260px; left: calc(50% + 25px); top: -80px; background: #C9E0D8; opacity: .55; }
.farbflaeche--b { width: 260px; height: 220px; left: calc(50% - 315px); top: 180px; background: #5E8279; opacity: .45; }
.hintergrund--einrichten .farbflaeche--b, .hintergrund--wahl .farbflaeche--b { top: 140px; height: 200px; }

/* ---------- Handy-Rahmen: Inhalte 350 breit (20 px Rand), auf größeren Handys/Tablets mittig */
.spalte { width: 100%; max-width: 470px; margin: 0 auto; padding: 0 20px; }

/* ---------- Sichtbarkeit je Gerät */
.nur-desktop { display: none !important; }
@media (min-width: 1100px) { .nur-desktop { display: revert !important; } .nur-handy { display: none !important; } }

/* ---------- Plan (Tag/Woche) – Handy */
.plan { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.plan__kopf { display: block; }
.plan__logo { display: none; }
.plan__jetzt { margin-top: 44px; }
.plan__kacheln { margin-top: 32px; }
.plan__liste { margin-top: 48px; display: flex; flex-direction: column; gap: 14px; }
.plan__banner { margin-top: 20px; }
.plan__stand { margin-top: 18px; text-align: center; }

.steuerung { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(30px + env(safe-area-inset-bottom)); pointer-events: none; }
.steuerung .spalte { display: flex; justify-content: space-between; align-items: center; }
.steuerung button, .steuerung .umschalter { pointer-events: auto; }
.kursknopf__lang { display: none; }
.ausblendung { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; height: 150px; pointer-events: none;
  background: linear-gradient(180deg, rgba(246,248,247,0) 0%, rgba(246,248,247,.95) 55%, var(--grund) 100%); }

/* ---------- Einrichten – Handy */
.einrichten { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
.einrichten__zurueck { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 14px; color: #fff; margin-left: -4px; }
.einrichten__kopf { display: flex; flex-direction: column; gap: 6px; padding: 0; color: #fff; }
.einrichten__abstand { height: 30px; }
.einrichten__abstand--klein { height: 14px; }
.einrichten__schritt { font-weight: 700; font-size: 12px; color: rgba(255,255,255,.85); text-transform: uppercase; }
.einrichten__titel { font-weight: 700; font-size: 34px; line-height: 1.2; }
.einrichten__unter { font-weight: 500; font-size: 14px; color: rgba(255,255,255,.9); }
.einrichten__unter button { font-weight: 700; color: #fff; }
.einrichten__suche { margin-top: 22px; }
.einrichten__hinweis-suche { display: none; }
.einrichten__listen { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.einrichten__label { font-weight: 700; font-size: 12px; color: var(--mut); text-transform: uppercase; padding: 0 4px; }
.einrichten__label + .liste, .einrichten__label + .chips { margin-top: 0; }
.einrichten__listen .einrichten__label:not(:first-child) { margin-top: 18px; }
.einrichten .spalte, .wahl .spalte { padding: 0 24px; }
.az { position: fixed; z-index: 5; right: max(2px, calc(50% - 233px)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 3px; align-items: center; }
.az button { font-weight: 700; font-size: 10px; color: var(--gruen); opacity: .8; padding: 0 4px; line-height: 1.2; }
.az button:hover { opacity: 1; }
.gruppen { margin-top: 30px; display: flex; flex-direction: column; gap: 18px; padding: 0; }
.einrichten__aktion { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(34px + env(safe-area-inset-bottom)); pointer-events: none; }
.einrichten__aktion .spalte { padding: 0 24px; }
.einrichten__aktion button { pointer-events: auto; }
.einrichten__desktop-mitte, .einrichten__desktop-rechts { display: contents; }
.einrichten__intro-logo { display: none; }

/* Wahlfächer */
.wahl { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
.wahl__inhalt { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; padding: 0; }
.wahlkarte { background: #fff; border-radius: 20px; box-shadow: var(--schatten-liste); overflow: hidden; }
.wahlkarte__kopf { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; text-align: left; }
.wahlkarte__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wahlkarte__titel { font-weight: 700; font-size: 16px; }
.wahlkarte__info { font-weight: 500; font-size: 12px; color: var(--mut); }
.wahlkarte__zeile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-top: 1px solid var(--linie); text-align: left; font-weight: 500; font-size: 14px; color: var(--mut); }
.wahlkarte__zeile[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.wahlkarte__mehr { display: block; padding: 12px 16px; font-weight: 600; font-size: 13px; color: var(--gruen); border-top: 1px solid var(--linie); width: 100%; text-align: left; }
.wahlkarte--katalog .wahlkarte__kopf { padding: 14px 16px; }
.wahlkarte--katalog .wahlkarte__kopf + .wahlkarte__kopf { border-top: 1px solid var(--linie); }
.wahlkarte__titel--normal { font-size: 15px; font-weight: 600; }

/* =========================================================================
   Tablet (761–1099): Handy-Aufbau, etwas breiter
   ========================================================================= */
@media (min-width: 761px) {
  .spalte { max-width: 560px; }
  .jetzt__titel { font-size: 48px; }
  .jetzt__titel--lang { font-size: 40px; }
  .jetzt__titel--sehrlang { font-size: 32px; }
  .kachel { padding: 20px 8px; }
  .kachel__wert { font-size: 26px; }
  .farbflaeche--a { width: 420px; height: 420px; }
  .farbflaeche--b { width: 420px; height: 340px; left: calc(50% - 480px); }
  .blatt { border-radius: 32px; margin-bottom: 24px; max-width: 460px; }
  .blatt-huelle { align-items: center; }
  .blatt { transform: translateY(24px) scale(.98); opacity: 0; transition: transform var(--dauer) var(--weich), opacity var(--dauer) var(--weich); }
  .blatt-huelle.ist-offen .blatt { transform: none; opacity: 1; }
  .blatt__griff { display: none; }
  .az { right: calc(50% - 300px); }
}

/* =========================================================================
   Desktop / Laptop (ab 1100): Figma Seite 04 + 05
   Verlauf von links (Salbei) nach rechts (hell), zwei Spalten
   ========================================================================= */
@media (min-width: 1100px) {
  .seite--plan, .seite--einrichten-desktop {
    background: linear-gradient(90deg, var(--salbei-1) 0%, #93B2A9 30%, #DDE8E4 46%, var(--grund) 56%, var(--grund) 100%) fixed;
  }
  .seite--einrichten-desktop { background: linear-gradient(90deg, var(--salbei-1) 0%, #93B2A9 22%, #DDE8E4 34%, var(--grund) 42%, var(--grund) 100%) fixed; }
  :is(.seite--plan, .seite--einrichten-desktop) .hintergrund { position: fixed; height: 100%; background: none; }
  :is(.seite--plan, .seite--einrichten-desktop) .farbflaeche { filter: blur(120px); }
  :is(.seite--plan, .seite--einrichten-desktop) .farbflaeche--a { left: -160px; top: -160px; width: 620px; height: 520px; background: #5E8279; opacity: .5; }
  :is(.seite--plan, .seite--einrichten-desktop) .farbflaeche--b { left: 180px; top: 420px; width: 520px; height: 520px; background: #C9E0D8; opacity: .55; }
  :is(.seite--plan, .seite--einrichten-desktop) .farbflaeche--c { position: absolute; border-radius: 50%; filter: blur(120px); left: -120px; top: 620px; width: 480px; height: 380px; background: #7FA59B; opacity: .4; }
  :is(.seite--plan, .seite--einrichten-desktop) .ausblendung { display: none; }

  .plan { padding: 0; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
  .plan > .spalte { max-width: none; }
  .plan > .plan__kopf { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 24px 56px 0; min-height: 89px; }
  .plan__logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; }
  .plan__logo i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.9); }
  .plan__kopf .karussell { grid-column: 2; gap: 10px; }
  .plan__kopf .karussell__tag:not(.ist-gewaehlt) { color: var(--ink); }
  .karussell__tag[data-abstand="1"] { --px: 12px; }
  .karussell__tag[data-abstand="2"] { --px: 10px; }
  .karussell__tag[data-abstand="3"] { --px: 8px; }
  .karussell__tag.ist-gewaehlt { --px: 20px; }

  .plan > .plan__haupt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(500px, 624px); column-gap: clamp(48px, 6vw, 128px); align-items: center; padding: 40px 56px 64px 72px; }
  .plan__links { position: sticky; top: 140px; align-self: center; }
  .plan__jetzt { margin-top: 0; }
  .jetzt { align-items: flex-start; text-align: left; }
  .jetzt__marke { font-size: 14px; gap: 8px; }
  .jetzt__punkt { width: 9px; height: 9px; }
  .jetzt__titel { font-size: clamp(48px, 5vw, 72px); margin-top: 14px; line-height: 1.12; }
  .jetzt__titel--lang { font-size: clamp(40px, 3.8vw, 56px); }
  .jetzt__titel--sehrlang { font-size: clamp(34px, 3.1vw, 46px); }
  .jetzt__fortschritt { width: 460px; max-width: 100%; height: 6px; margin-top: 14px; }
  .plan__kacheln { margin-top: 40px; }
  .kacheln { grid-template-columns: repeat(3, minmax(0, 160px)); gap: 14px; }
  .kachel { --radius: 24px; padding: 22px 8px; gap: 6px; }
  .kachel__name { font-size: 14px; }
  .kachel__wert { font-size: 30px; }
  .kachel__wert--klein { font-size: 22px; }
  .plan__detail { margin-top: 24px; }
  .plan__rechts { min-width: 0; }
  .plan__liste { margin-top: 0; }
  .abschnitt-kopf { padding-bottom: 6px; }
  .abschnitt-kopf__titel { font-size: 30px; }
  .abschnitt-kopf__info { font-size: 14px; font-weight: 500; }
  .vorbei { padding: 10px 14px; font-size: 13px; background: rgba(15,26,23,.04); }
  .vorbei__punkt { width: 7px; height: 7px; }
  .stunde { min-height: 84px; }
  .stunde__karte { padding: 16px 18px; }
  .stunde__titel { font-size: 17px; }
  .stunde__info { font-size: 13px; }
  .luecke__text { font-size: 13px; padding: 4px 14px; }
  .luecke--frei .luecke__text { padding: 12px 14px; }
  .plan__stand { margin-top: 28px; text-align: left; }

  .steuerung { position: absolute; top: 36px; bottom: auto; left: auto; right: 56px; }
  .steuerung .spalte { gap: 10px; padding: 0; max-width: none; }
  .umschalter { padding: 4px; --glas-schatten: var(--schatten-glas); }
  .umschalter__knopf { padding: 10px 22px; font-size: 14px; }
  .kursknopf { padding: 10px 18px 10px 16px; font-size: 14px; --glas-schatten: var(--schatten-glas); }
  .kursknopf__kurz { display: none; }
  .kursknopf__lang { display: inline; }

  /* Woche auf dem Desktop: Liste bekommt mehr Platz, 5 Spalten */
  .seite--woche .plan > .plan__haupt { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); column-gap: clamp(40px, 4vw, 72px); align-items: start; padding-top: 48px; }
  .seite--woche .plan__links { top: 120px; }
  .seite--woche .jetzt__titel { font-size: clamp(36px, 3vw, 46px); }
  .seite--woche .jetzt__titel--lang, .seite--woche .jetzt__titel--sehrlang { font-size: clamp(30px, 2.5vw, 38px); }
  .seite--woche .kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .seite--woche .kachel { padding: 18px 6px; }
  .seite--woche .kachel__wert { font-size: 24px; }
  .seite--woche .jetzt__fortschritt { width: 100%; }
  .wochenraster { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .wochenraster .woche-tag + .woche-tag { margin-top: 0; }
  .wochenraster .woche-tag__kopf { padding: 8px 10px; border-radius: 12px; text-align: center; }
  .wochenraster .woche-tag.ist-heute .woche-tag__kopf { background: #fff; box-shadow: 0 4px 14px rgba(13,38,31,.1); }
  .wochenraster .stunde { grid-template-columns: 1fr; min-height: 0; }
  .wochenraster .stunde__zeit { flex-direction: row; justify-content: flex-start; gap: 4px; padding: 0 2px; font-size: 12px; }
  .wochenraster .stunde__beginn, .wochenraster .stunde__ende { font-size: 12px; }
  .wochenraster .stunde__ende::before { content: "– "; }
  .wochenraster .stunde__karte { padding: 10px 10px; gap: 8px; }
  .wochenraster .stunde__titel { font-size: 13px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
  .wochenraster .stunde__info { font-size: 11px; }
  .wochenraster .woche-tag__leer { padding: 8px 4px; text-align: center; }
  .wochenraster .luecke, .wochenraster .vorbei { display: none; }

  /* Einrichten Desktop: drei Spalten (Figma Seite 05, Frame 6) */
  .einrichten { padding: 0; min-height: 100dvh; display: grid; grid-template-columns: 380px 400px minmax(380px, 436px); column-gap: 64px; justify-content: start; padding: 120px 56px 56px; align-items: start; }
  .einrichten > .spalte { display: contents; }
  .einrichten__intro-logo { display: flex; position: absolute; left: 56px; top: 40px; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #fff; }
  .einrichten__intro-logo i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.9); }
  .einrichten__links { grid-column: 1; align-self: start; position: sticky; top: clamp(120px, calc(50vh - 190px), 260px); margin-top: clamp(0px, calc(50vh - 310px), 140px); }
  .einrichten__kopf { padding: 0; gap: 10px; }
  .einrichten__titel { font-size: 44px; }
  .einrichten__unter { font-size: 15px; }
  .einrichten__schritt { font-size: 13px; }
  .einrichten__hinweis-suche { display: block; margin-top: 10px; font-weight: 500; font-size: 13px; color: rgba(255,255,255,.85); }
  .einrichten__suche { margin-top: 28px; }
  .einrichten__desktop-mitte { display: block; grid-column: 2; }
  .einrichten__desktop-rechts { display: block; grid-column: 3; }
  .einrichten__listen { margin-top: 0; }
  .einrichten__desktop-mitte .einrichten__listen > .einrichten__label:first-child { display: none; }
  .einrichten__desktop-rechts { position: sticky; top: 120px; }
  .gruppen { margin-top: 0; padding: 0; }
  .gruppen-abschnitt__titel--desktop { text-transform: none; color: var(--ink); font-size: 13px; font-weight: 600; }
  .seite--einrichten-desktop .einrichten__aktion { position: fixed; left: auto; right: 0; bottom: 56px; width: calc(436px + 56px); }
  .seite--einrichten-desktop .einrichten__aktion .spalte { padding: 0 56px 0 0; max-width: none; }
  .az { display: none; }
  .einrichten--schritt2 .einrichten__zurueck { display: none; }
}

@media (min-width: 1100px) and (max-width: 1360px) {
  .einrichten { grid-template-columns: 300px 360px minmax(320px, 1fr); column-gap: 40px; padding-left: 40px; padding-right: 40px; }
  .einrichten__titel { font-size: 38px; }
  .seite--einrichten-desktop .einrichten__aktion { width: calc(100vw - 40px - 300px - 360px - 80px + 40px); }
  .seite--einrichten-desktop .einrichten__aktion .spalte { padding-right: 40px; }
  .plan > .plan__haupt { padding-left: 56px; padding-right: 40px; }
  .plan > .plan__kopf { padding-left: 40px; padding-right: 40px; }
  .steuerung { right: 40px; }
}
