/* ===========================================================
   FokusFlow – Lern-App Stylesheet
   =========================================================== */

:root {
  --accent: #9775fa;          /* wird je nach Methode/Phase überschrieben */
  --accent-soft: rgba(151, 117, 250, 0.18);
  --break-accent: #ffa94d;    /* Pausen-Akzent (warm/pepig) */

  --bg-0: #0a0a14;
  --bg-1: #12121f;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --text: #f4f4fb;
  --text-dim: #a7a7c0;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, #1d1733 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.8s ease;
}

/* Hintergrund-Farbe je Phase leicht verschieben */
body[data-phase="break"] {
  background: radial-gradient(1200px 800px at 80% -10%, #2a1c12 0%, #1a1410 45%, #0f0b08 100%);
}

/* ---------- Hintergrund-Lichter ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; transition: background 0.8s ease; }
.orb-1 { width: 420px; height: 420px; top: -120px; left: -80px; background: var(--accent); animation: float1 18s ease-in-out infinite; }
.orb-2 { width: 360px; height: 360px; bottom: -100px; right: -60px; background: #4dabf7; animation: float2 22s ease-in-out infinite; }
.orb-3 { width: 300px; height: 300px; top: 40%; left: 55%; background: var(--break-accent); opacity: 0.25; animation: float1 26s ease-in-out infinite reverse; }

@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(40px,30px) scale(1.08);} }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1);} 50% { transform: translate(-50px,-30px) scale(1.12);} }

/* ---------- Topbar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(18px, 5vw, 48px);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-logo { font-size: 1.4rem; filter: drop-shadow(0 0 10px var(--accent)); }
.brand-name span { color: var(--accent); }

.audio-controls { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(12px); }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--text); display: grid; place-items: center; }
.icon-btn .music-off { display: none; }
.icon-btn[aria-pressed="false"] .music-on { display: none; }
.icon-btn[aria-pressed="false"] .music-off { display: block; }

.volume { -webkit-appearance: none; appearance: none; width: 110px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.18); cursor: pointer; }
.volume::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); cursor: pointer; }
.volume::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: var(--accent); cursor: pointer; }

/* ---------- Motivationsspruch ---------- */
.quote-banner {
  position: relative; z-index: 2;
  max-width: 760px; margin: 8px auto 0; padding: 0 24px;
  text-align: center; font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.5rem); font-weight: 500; line-height: 1.4;
  color: var(--text);
  animation: fadeUp 0.8s ease both;
}
.quote-banner cite { display: block; margin-top: 8px; font-family: var(--font-body); font-style: normal; font-size: 0.85rem; font-weight: 500; color: var(--text-dim); }
.quote-banner cite:not(:empty)::before { content: "— "; }

/* ---------- Layout ---------- */
.container { position: relative; z-index: 2; flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) 24px; }
.view { animation: fadeUp 0.5s ease both; }

.headline { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.03em; text-align: center; }
.accent-text { color: var(--accent); }
.subline { text-align: center; color: var(--text-dim); margin-top: 10px; font-size: 1.02rem; }

/* ---------- Methoden-Karten ---------- */
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 40px; }

.method-card {
  position: relative; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; color: var(--text);
  backdrop-filter: blur(14px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.method-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s ease;
  background: radial-gradient(400px 200px at 50% -40%, var(--card-accent), transparent 70%);
}
.method-card:hover { transform: translateY(-6px); border-color: var(--card-accent); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.method-card:hover::before { opacity: 0.5; }
.method-icon { font-size: 2rem; display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--card-accent-soft); border: 1px solid var(--card-accent); margin-bottom: 16px; }
.method-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.method-timing { display: inline-block; margin: 8px 0 12px; font-size: 0.82rem; font-weight: 600; color: var(--card-accent); letter-spacing: 0.02em; background: var(--card-accent-soft); padding: 3px 10px; border-radius: 999px; }
.method-card p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; }

/* ---------- Session / Timer ---------- */
#session { display: flex; flex-direction: column; align-items: center; }
.back-btn { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 9px 16px; border-radius: 999px; cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: background 0.2s ease; }
.back-btn:hover { background: var(--surface-strong); }

.session-head { text-align: center; margin-top: 20px; }
.session-head h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; }
.session-head p { color: var(--text-dim); margin-top: 6px; max-width: 460px; }

/* Fach-Eingabe in der Session */
.session-subject { display: flex; align-items: center; gap: 10px; margin-top: 18px; background: var(--surface); border: 1px solid #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.22); border-radius: 999px; padding: 6px 8px 6px 16px; backdrop-filter: blur(12px); }
.session-subject .ss-label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.session-subject input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; padding: 8px 10px; border-radius: 999px; }
.session-subject input::placeholder { color: rgba(167, 167, 192, 0.6); }
.session-subject input:focus { outline: none; }
.session-subject:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.phase-badge {
  margin-top: 22px; padding: 8px 22px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent);
  transition: all 0.4s ease;
}

/* Großer Timer */
.timer-wrap { position: relative; width: min(70vw, 380px); aspect-ratio: 1; margin: 28px 0 8px; display: grid; place-items: center; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 14; }
.ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round;
  filter: drop-shadow(0 0 14px var(--accent));
  transition: stroke-dashoffset 0.4s linear, stroke 0.4s ease;
}
.time-display { position: absolute; text-align: center; }
#timeText {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3.4rem, 14vw, 6rem); line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 40px var(--accent-soft);
}
.round-text { display: block; margin-top: 10px; color: var(--text-dim); font-size: 0.95rem; font-weight: 500; }

/* Steuerung */
.controls { display: flex; align-items: center; gap: 20px; margin-top: 8px; }
.primary-btn {
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  color: #0a0a14; background: var(--accent); border: none; cursor: pointer;
  padding: 16px 52px; border-radius: 999px; min-width: 180px;
  box-shadow: 0 10px 30px var(--accent-soft); transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.4s ease;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px var(--accent-soft); }
.primary-btn:active { transform: translateY(0); }
.primary-btn.running { background: transparent; color: var(--accent); border: 2px solid var(--accent); }

.icon-btn-lg {
  width: 58px; height: 58px; border-radius: 50%; cursor: pointer; font-size: 1.4rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: grid; place-items: center; transition: background 0.2s ease, transform 0.15s ease;
}
.icon-btn-lg:hover { background: var(--surface-strong); transform: translateY(-2px); }

/* Zyklus-Punkte */
.cycle-dots { display: flex; gap: 12px; margin-top: 28px; }
.cycle-dots .dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.15); transition: all 0.3s ease; }
.cycle-dots .dot.done { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.cycle-dots .dot.active { background: var(--accent); transform: scale(1.3); box-shadow: 0 0 16px var(--accent); }

/* Pulsieren während aktiver Phase */
body.is-running .ring-fg { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { filter: drop-shadow(0 0 14px var(--accent)); } 50% { filter: drop-shadow(0 0 26px var(--accent)); } }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 2; text-align: center; padding: 18px; color: var(--text-dim); font-size: 0.85rem; }
.footer-legal { margin-top: 6px; }
.footer-legal a { color: var(--text-dim); text-decoration: underline; }
.footer-legal a:hover { color: var(--text); }

/* ---------- Rechtsseiten (Impressum / Datenschutz) ---------- */
.legal { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; padding: 28px 24px 80px; }
.legal .back-btn { display: inline-block; margin-bottom: 26px; }
.legal h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; }
.legal h2 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-top: 30px; margin-bottom: 8px; }
.legal p { color: var(--text-dim); line-height: 1.65; }
.legal a { color: var(--accent); }
.legal .ph { color: #ffd43b; font-weight: 600; }
.legal .legal-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 18px; font-size: 0.9rem; }

/* ===========================================================
   Pro / Bezahl-Schranke
   =========================================================== */
/* Gesperrte Custom-Karte */
.method-card.is-locked .plus { filter: grayscale(0.2); }
.method-card.is-locked .label { opacity: 0.9; }
.pro-chip {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.08em;
  color: #0a0a14; background: linear-gradient(100deg, var(--card-accent), #ffd43b);
  padding: 3px 9px; border-radius: 999px;
}

/* Pro-Dialog */
#proModal { --accent: #9775fa; --accent-soft: rgba(151, 117, 250, 0.18); max-width: 440px; }
.pro-panel {
  position: relative; text-align: center;
  background: linear-gradient(180deg, #1b1630, #11111c); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow);
}
.pro-x { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--text-dim); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.pro-x:hover { color: var(--text); }
.pro-emblem { font-size: 2rem; width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent); filter: drop-shadow(0 0 16px var(--accent-soft)); }
.pro-panel h3 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.pro-panel h3 span { color: var(--accent); }
.pro-sub { color: var(--text-dim); margin: 8px 0 18px; }
.pro-trial { font-size: 0.92rem; font-weight: 600; margin: 0 auto 16px; max-width: 340px; padding: 10px 14px; border-radius: 12px; line-height: 1.4; }
.pro-trial.is-active { color: #51cf66; background: rgba(81, 207, 102, 0.12); border: 1px solid rgba(81, 207, 102, 0.35); }
.pro-trial.is-expired { color: #ffd43b; background: rgba(255, 212, 59, 0.10); border: 1px solid rgba(255, 212, 59, 0.35); }
.pro-benefits { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 9px; margin: 0 auto 22px; max-width: 320px; }
.pro-benefits li { color: var(--text); padding-left: 28px; position: relative; }
.pro-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
#proBuy { display: inline-block; min-width: 200px; }
.pro-hint { color: #ffd43b; font-size: 0.82rem; margin-top: 8px; }
.pro-hint code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 5px; }
.pro-activate { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.pro-activate > p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 10px; }
#proForm { display: flex; gap: 8px; }
#proForm input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; }
#proForm input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#proForm button { white-space: nowrap; }
.pro-msg { margin-top: 12px; font-size: 0.9rem; }
.pro-msg.ok { color: #51cf66; }
.pro-msg.err { color: #ff8787; }
#proActive .ghost-btn { margin-top: 8px; }

/* ---------- Animationen ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

[hidden] { display: none !important; }

/* ---------- Responsiv ---------- */
@media (max-width: 540px) {
  .audio-controls .volume { width: 80px; }
  .controls { gap: 14px; }
  .primary-btn { min-width: 150px; padding: 15px 38px; }
  .method-grid { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===========================================================
   Eigene Lernmodelle (3 freie Felder)
   =========================================================== */
.method-card.is-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; min-height: 210px;
  border-style: dashed; border-color: var(--border); background: transparent;
}
.method-card.is-empty:hover { background: var(--surface); border-color: var(--card-accent); transform: translateY(-4px); }
.method-card.is-empty .plus {
  font-size: 1.9rem; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  background: var(--card-accent-soft); border: 1px solid var(--card-accent); color: var(--card-accent);
}
.method-card.is-empty .label { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.method-card.is-empty .hint { color: var(--text-dim); font-size: 0.85rem; }

/* Gefülltes eigenes Modell – wie normale Karte, plus "Neu"-Button unten rechts */
.method-card.filled-custom { cursor: pointer; padding-top: 48px; padding-bottom: 62px; }
.method-card.filled-custom:focus-visible { outline: 2px solid var(--card-accent); outline-offset: 3px; }
.method-card .reconfig-btn {
  position: absolute; bottom: 16px; right: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--card-accent-soft); border: 1px solid var(--card-accent); color: var(--card-accent);
  cursor: pointer; font-family: var(--font-body); font-weight: 600; font-size: 0.82rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.method-card .reconfig-btn:hover { background: var(--card-accent); color: #0a0a14; transform: translateY(-1px); }
.custom-badge {
  position: absolute; top: 18px; left: 24px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--card-accent); opacity: 0.85;
}

/* ---------- Formular-Dialog ---------- */
.modal {
  border: none; padding: 0; background: transparent; color: var(--text);
  max-width: 440px; width: calc(100% - 36px);
  --accent: #fab005; --accent-soft: rgba(250, 176, 5, 0.18);
}
.modal::backdrop { background: rgba(6, 6, 14, 0.62); backdrop-filter: blur(6px); }
.modal[open] { animation: fadeUp 0.28s ease both; }

.custom-form {
  background: linear-gradient(180deg, #181826, #11111c);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow);
}
.custom-form h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.custom-form label { display: flex; flex-direction: column; gap: 7px; font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.custom-form .field { display: flex; flex-direction: column; gap: 9px; }
.custom-form .field-label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }

/* Icon-Auswahl */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-picker button {
  width: 44px; height: 44px; border-radius: 12px; font-size: 1.3rem; line-height: 1;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; display: grid; place-items: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.icon-picker button:hover { background: var(--surface-strong); transform: translateY(-2px); }
.icon-picker button.selected {
  border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft);
}
.custom-form input {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; color: var(--text); font-size: 1rem; font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.custom-form input::placeholder { color: rgba(167,167,192,0.6); }
.custom-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: flex; gap: 14px; }
.form-row label { flex: 1; }
.form-error { color: #ff8787; font-size: 0.85rem; margin-top: -4px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.form-actions .spacer { flex: 1; }
.ghost-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 11px 18px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 0.95rem;
  transition: background 0.2s ease;
}
.ghost-btn:hover { background: var(--surface-strong); }
.ghost-btn.danger { color: #ff8787; border-color: rgba(255,135,135,0.35); }
.primary-btn.small { min-width: auto; padding: 11px 26px; font-size: 1rem; box-shadow: none; }

/* ===========================================================
   Tabs + Kalender + Tages-Detail
   =========================================================== */
:root { --cal-accent: #9775fa; --cal-accent-soft: rgba(151, 117, 250, 0.18); }

/* ---------- Tab-Navigation ---------- */
.tabbar { position: relative; z-index: 2; display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.tab {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  padding: 9px 20px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.95rem;
  font-family: var(--font-body); transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tab:hover { background: var(--surface-strong); color: var(--text); }
.tab.active { background: var(--cal-accent-soft); border-color: var(--cal-accent); color: #fff; }

/* ---------- Statistik-Leiste ---------- */
.cal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 12px; text-align: center; backdrop-filter: blur(12px); }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.stat-card span { color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Monats-Kopf ---------- */
.cal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-header h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; text-transform: capitalize; min-width: 210px; }
.cal-nav-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; transition: background 0.2s ease; }
.cal-nav-btn:hover { background: var(--surface-strong); }
.cal-header .ghost-btn.small { margin-left: auto; padding: 9px 16px; font-size: 0.9rem; }

/* ---------- Kalender-Gitter ---------- */
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-weekdays { margin-bottom: 8px; }
.cal-weekday { text-align: center; color: var(--text-dim); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.cal-day {
  position: relative; min-height: clamp(62px, 9vw, 92px); border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  padding: 8px 10px; cursor: pointer; font: inherit; text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
button.cal-day:hover { transform: translateY(-3px); border-color: var(--cal-accent); background: var(--surface-strong); }
.cal-day.other { background: transparent; border-color: transparent; color: rgba(167, 167, 192, 0.32); cursor: default; }
.cal-day.today { border-color: var(--cal-accent); box-shadow: inset 0 0 0 1px var(--cal-accent); }
.cal-day.has-min { background: linear-gradient(180deg, var(--cal-accent-soft), var(--surface)); }
.cal-daynum { font-weight: 600; font-size: 0.95rem; }
.cal-marks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; }
.cal-min { font-size: 0.72rem; font-weight: 700; color: var(--cal-accent); }
/* farbige Fach-Punkte in der Tageszelle */
.cal-dots { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.cal-subdot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); }
.cal-more { font-size: 0.62rem; font-weight: 700; color: var(--text-dim); }
.cal-done { font-size: 0.66rem; font-weight: 800; color: #51cf66; margin-left: 1px; }

/* Fächer-Aufschlüsselung unter dem Kalender */
.cal-breakdown { margin-top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; }
.bd-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 14px; text-transform: capitalize; }
.bd-list { display: flex; flex-direction: column; gap: 14px; }
.bd-row { display: flex; flex-direction: column; gap: 6px; }
.bd-head { display: flex; align-items: center; gap: 9px; }
.bd-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.bd-name { font-weight: 600; font-size: 0.95rem; }
.bd-stats { margin-left: auto; font-size: 0.85rem; color: var(--text-dim); white-space: nowrap; }
.bd-stats strong { color: var(--text); font-weight: 700; }
.bd-bar { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bd-bar span { display: block; height: 100%; border-radius: 999px; transition: width 0.4s ease; min-width: 2px; }

.cal-tip { text-align: center; color: var(--text-dim); font-size: 0.85rem; margin-top: 18px; }

/* ---------- Tages-Detail (Dialog) ---------- */
#dayModal { --accent: var(--cal-accent); --accent-soft: var(--cal-accent-soft); max-width: 480px; }
.day-panel {
  background: linear-gradient(180deg, #181826, #11111c); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px;
}
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.day-head h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.day-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.day-stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 8px; text-align: center; }
.day-stats strong { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--cal-accent); }
.day-stats span { color: var(--text-dim); font-size: 0.74rem; }
.day-subhead { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; margin-top: 2px; }

.goal-list { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.goal-empty { color: var(--text-dim); font-size: 0.9rem; text-align: center; padding: 16px; background: var(--surface); border-radius: 12px; }
.goal-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.goal-check { width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; border: 2px solid var(--cal-accent); background: transparent; color: #0a0a14; cursor: pointer; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; transition: background 0.15s ease; }
.goal-item.done .goal-check { background: var(--cal-accent); }
.goal-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-subject-chip { font-size: 0.76rem; font-weight: 700; color: #0a0a14; background: var(--cal-accent); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.goal-item.done .goal-subject-chip { opacity: 0.6; }
.goal-text { font-size: 0.95rem; word-break: break-word; }
.goal-item.done .goal-text { text-decoration: line-through; color: var(--text-dim); }
.goal-min { font-size: 0.76rem; font-weight: 700; color: var(--cal-accent); background: var(--cal-accent-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.goal-del { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.9rem; padding: 4px; line-height: 1; }
.goal-del:hover { color: #ff8787; }

/* Formular: zwei Spalten – Thema/Fach + Zeit oben, Lernziel + Hinzufügen unten */
.goal-form {
  display: grid; gap: 8px;
  grid-template-columns: 1fr 92px;
  grid-template-areas:
    "subject time"
    "detail  add";
}
#goalSubject { grid-area: subject; }
#goalTarget { grid-area: time; width: 100%; }
#goalText { grid-area: detail; }
.goal-form button { grid-area: add; width: 100%; }
.goal-form input { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text); font-size: 0.95rem; font-family: var(--font-body); transition: border-color 0.2s ease, box-shadow 0.2s ease; min-width: 0; }
.goal-form input::placeholder { color: rgba(167, 167, 192, 0.6); }
.goal-form input:focus { outline: none; border-color: var(--cal-accent); box-shadow: 0 0 0 3px var(--cal-accent-soft); }

@media (max-width: 540px) {
  .cal-stats { grid-template-columns: repeat(2, 1fr); }
  .cal-weekdays, .cal-grid { gap: 5px; }
  .cal-day { min-height: 54px; padding: 5px 7px; border-radius: 10px; }
  .cal-min { font-size: 0.6rem; }
  .cal-header h2 { min-width: auto; font-size: 1.2rem; }
}
