/* Komponenten. Abgeleitet aus der Website: Glas-Karten mit feiner Linie, weiche blaue Schatten,
   Pill-Elemente, Verlauf Blau→Cyan, Mono-Tags in Großbuchstaben. */

/* ---------- Sektion ---------- */
.section {
  margin-top: var(--space-7);
}
.section:first-child {
  margin-top: 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.section-head h2 {
  margin-top: var(--space-1);
}

/* ---------- Karten ---------- */
.card {
  position: relative;
  display: block;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-xl);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  overflow: hidden;
}
.card.compact {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.card.interactive {
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: transform var(--motion-base) ease, box-shadow var(--motion-base) ease, border-color var(--motion-base) ease;
}
.card.interactive:active {
  transform: scale(var(--motion-press));
  border-color: var(--c-line-strong);
}
@media (hover: hover) {
  .card.interactive:hover {
    transform: translateY(var(--motion-lift));
    box-shadow: var(--shadow-lg);
    border-color: var(--c-line-strong);
  }
}
.card h3 {
  font-size: 1.0625rem;
  line-height: 1.3;
}
.card p {
  margin-top: var(--space-1);
  color: var(--c-muted);
  font-size: var(--type-small-size);
  line-height: var(--type-small-line);
}

/* Hero: Website-Hero mit weichgezeichneten Farbflächen, für Mobilgeräte kompakter */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-2xl);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
  padding: var(--space-6) var(--space-5);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(42px);
  z-index: 0;
  pointer-events: none;
}
.hero::before {
  width: 220px;
  height: 220px;
  right: -70px;
  top: -90px;
  background: var(--c-glow-primary);
}
.hero::after {
  width: 170px;
  height: 170px;
  left: -50px;
  bottom: -70px;
  background: var(--c-glow-accent);
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero h1 {
  margin-top: var(--space-3);
}
.hero p {
  margin-top: var(--space-2);
  color: var(--c-muted);
}

/* ---------- Eyebrow / Pills / Status ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-primary);
  font-size: var(--type-small-size);
  font-weight: 700;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.71875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pill.live {
  background: var(--c-accent-soft);
  color: var(--c-accent-text);
}
.pill.progress {
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.pill.soon,
.pill.neutral {
  background: var(--c-neutral-soft);
  color: var(--c-muted);
}
.pill.success {
  background: var(--c-success-soft);
  color: var(--c-success-text);
}
.pill.danger {
  background: var(--c-danger-soft);
  color: var(--c-danger-text);
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--size-touch);
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--type-button-family);
  font-size: var(--type-button-size);
  font-weight: var(--type-button-weight);
  cursor: pointer;
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease, opacity var(--motion-fast) ease;
}
.btn svg {
  width: var(--size-icon-sm);
  height: var(--size-icon-sm);
}
.btn:active {
  transform: scale(var(--motion-press));
}
.btn.primary {
  background: var(--c-primary-fill);
  color: var(--c-on-primary);
  box-shadow: var(--shadow-button);
}
.btn.ghost {
  background: var(--c-surface);
  border-color: var(--c-line);
  color: var(--c-ink);
}
.btn.quiet {
  background: transparent;
  color: var(--c-primary);
  padding: 0 var(--space-3);
}
.btn.block {
  width: 100%;
}
.btn.danger {
  background: var(--c-surface);
  border-color: var(--c-danger);
  color: var(--c-danger-text);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  box-shadow: none;
  cursor: default;
  transform: none;
}
.icon-btn {
  width: var(--size-touch);
  height: var(--size-touch);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--c-ink);
  cursor: pointer;
}
.icon-btn:active {
  background: var(--c-primary-soft);
}
.icon-btn svg {
  width: var(--size-icon);
  height: var(--size-icon);
}

/* ---------- Chips (Schnelleinstiege) ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  font-size: var(--type-small-size);
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
  transition: transform var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.chip svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.chip:active {
  transform: scale(var(--motion-press));
  border-color: var(--c-line-strong);
}
.chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient-brand);
}

/* ---------- Raster ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.stack {
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 600px) {
  .grid-2.wide-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 340px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Fach-Kachel ---------- */
.glyph {
  font-size: 26px;
  line-height: 1;
}
.glyph-tile {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--c-primary-soft);
  font-size: 22px;
}
.glyph-tile.brand {
  background: var(--gradient-brand);
  color: var(--c-on-primary);
}
.glyph-tile svg {
  width: var(--size-icon);
  height: var(--size-icon);
}
.subject-card h3 {
  margin-top: var(--space-3);
}
.subject-card .pin {
  font-size: 0.8em;
}
/* Meine Fächer (ADR-0055) */
.subject-pref-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.subject-pref-head .glyph {
  font-size: 22px;
}
.subject-pref-head .t-muted {
  margin-left: auto;
}
/* Fach ohne Lernpakete: gleiche Karte, zurückgenommen (Website-Verweise bleiben erreichbar) */
.subject-card.is-empty {
  background: transparent;
  box-shadow: none;
}
.subject-card.is-empty .glyph {
  opacity: 0.6;
}
.subject-card.is-empty p {
  color: var(--c-muted);
}

/* ---------- Bereichskarten (Dashboard) ---------- */
.area-card {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.area-card .body {
  flex: 1;
  min-width: 0;
}
.area-card .meta {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chevron {
  flex: none;
  align-self: center;
  color: var(--c-muted);
}
.chevron svg {
  width: var(--size-icon-sm);
  height: var(--size-icon-sm);
}

/* ---------- Listen ---------- */
.list {
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 60px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--c-line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.row:last-child {
  border-bottom: 0;
}
.row:active {
  background: var(--c-primary-soft);
}
.row[aria-disabled="true"] {
  cursor: default;
  opacity: 0.6;
}
.row[aria-disabled="true"]:active {
  background: transparent;
}
.row .text {
  flex: 1;
  min-width: 0;
}
.row .title {
  display: block;
  font-weight: 600;
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .sub {
  display: block;
  color: var(--c-muted);
  font-size: var(--type-small-size);
}
.row .value {
  color: var(--c-muted);
  font-size: var(--type-small-size);
  white-space: nowrap;
}

/* ---------- Segmentauswahl (Einstellungen) ---------- */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--c-surface-sunken);
  border: 1px solid var(--c-line);
}
.segmented button {
  min-height: var(--size-touch);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-muted);
  font-weight: 600;
  font-size: var(--type-small-size);
  cursor: pointer;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.segmented button[aria-checked="true"] {
  background: var(--c-surface-solid);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm);
}
.setting {
  padding: var(--space-4);
  border-bottom: 1px solid var(--c-line);
}
.setting:last-child {
  border-bottom: 0;
}
.setting-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-weight: 600;
  color: var(--c-ink);
}
.setting-label.inline {
  margin-bottom: 0;
}
.setting .hint {
  margin-top: var(--space-2);
  color: var(--c-muted);
  font-size: var(--type-small-size);
}

/* Schalter: die ganze Zeile ist das Touch-Ziel, die Spur ist nur Anzeige */
.switch-row {
  display: flex;
  width: 100%;
  min-height: var(--size-touch);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 600;
  color: var(--c-ink);
  text-align: left;
  cursor: pointer;
}
.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--c-neutral-soft);
  box-shadow: inset 0 0 0 1px var(--c-line-strong);
  transition: background var(--motion-base) ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-surface-solid);
  box-shadow: var(--shadow-sm);
  transition: transform var(--motion-base) var(--motion-easing);
}
.switch-row[aria-checked="true"] .switch {
  background: var(--c-primary-fill);
}
.switch-row[aria-checked="true"] .switch::after {
  transform: translateX(20px);
}

/* ---------- Zustände ---------- */
.banner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  font-size: var(--type-small-size);
}
.banner svg {
  flex: none;
  width: var(--size-icon-sm);
  height: var(--size-icon-sm);
  margin-top: 2px;
}
.banner.info {
  background: var(--c-primary-soft);
  color: var(--c-ink);
}
.banner.info svg {
  color: var(--c-primary);
}
.banner.warning {
  background: var(--c-warning-soft);
  color: var(--c-ink);
}
.banner.warning svg {
  color: var(--c-warning);
}
.banner.danger {
  background: var(--c-danger-soft);
  color: var(--c-ink);
}
.banner.danger svg {
  color: var(--c-danger-text);
}

.empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--c-muted);
  font-size: var(--type-small-size);
}
.empty .glyph {
  margin: 0 auto var(--space-2);
  font-size: 28px;
}
.empty strong {
  display: block;
  color: var(--c-ink);
  font-size: var(--type-body-size);
  margin-bottom: var(--space-1);
}

.skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--c-neutral-soft) 0%, var(--c-primary-soft) 50%, var(--c-neutral-soft) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  min-height: 92px;
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* Kennzahlen */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.stat {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--c-surface-sunken);
  border: 1px solid var(--c-line);
}
.stat .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--c-ink);
}
.stat .label {
  margin-top: 2px;
  font-size: var(--type-caption-size);
  color: var(--c-muted);
}

.progress-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--c-neutral-soft);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-brand);
  transition: width var(--motion-slow) var(--motion-easing);
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  font-size: var(--type-small-size);
}
.kv dt {
  color: var(--c-muted);
}
.kv dd {
  margin: 0;
  color: var(--c-ink);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* Anzeige „Alles gesichert“ in der Kopfzeile (ADR-0057) */
.icon-btn.sync-state[data-kind="saved"] {
  color: var(--c-success);
}
.icon-btn.sync-state[data-kind="pending"],
.icon-btn.sync-state[data-kind="waiting"],
.icon-btn.sync-state[data-kind="local"] {
  color: var(--c-muted);
}
.icon-btn.sync-state[data-kind="attention"] {
  color: var(--c-warning);
}
