/* =========================================================
   StundenCheck – Design "Apple Pro (dunkel)"
   Tiefes Schwarz, ein blauer Akzent, weiche Bewegungen
   ========================================================= */

:root {
  --bg: #000;
  --surface: #141416;          /* Karten, Listen */
  --surface-2: #1d1d1f;        /* Eingabefelder, Avatar */
  --surface-3: #2c2c2e;        /* aktiver Umschalter */
  --line: rgba(255, 255, 255, 0.08);
  --hairline: #262628;         /* Trennlinien in Listen */
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --text-faint: #86868b;

  --accent: #2997ff;           /* Apple-Blau auf Schwarz */
  --accent-strong: #0071e3;    /* Buttons */
  --accent-glow: rgba(41, 151, 255, 0.35);
  --signal: #30d158;           /* frei */
  --amber: #ff9f0a;            /* belegt */
  --red: #ff6961;              /* Entfall */

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 800ms;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 26px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

.hidden { display: none !important; }
[hidden] { display: none !important; } /* eigene display-Regeln dürfen „hidden“ nicht überstimmen */
input, button, select { font-family: inherit; }
::selection { background: var(--accent-glow); }

/* Sichtbarer Fokus nur bei Tastatur-Bedienung */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Grund-Bewegungen ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes ping {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(3); opacity: 0; }
}
@keyframes drift { to { transform: translate(-40px, 40px) scale(1.1); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ======================= Login ======================= */
#login-view.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}

/* weicher, langsam wandernder Lichtschein im Hintergrund */
#login-view::before {
  content: "";
  position: absolute;
  width: 720px; height: 720px;
  top: -320px; left: 50%;
  margin-left: -360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 151, 255, 0.22), transparent 62%);
  animation: drift 12s ease-in-out infinite alternate;
  pointer-events: none;
}

.login-box {
  width: 100%;
  max-width: 360px;
  position: relative;
  text-align: center;
}

.login-box > * { animation: rise var(--dur-slow) var(--ease-out) backwards; }
.login-box > :nth-child(1) { animation-delay: 0.05s; }
.login-box > :nth-child(2) { animation-delay: 0.13s; }
.login-box > :nth-child(3) { animation-delay: 0.2s; }
.login-box > :nth-child(4) { animation-delay: 0.28s; }

.login-mark {
  display: block;
  width: 64px; height: 64px;
  margin: 0 auto 26px;
  border-radius: 15px;             /* passt zur Rundung im Logo (23 von 100) */
  box-shadow: 0 18px 40px -10px var(--accent-glow);
}

.login-box h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 8px;
  background: linear-gradient(180deg, #fff 35%, #8e8e93);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-sub { color: var(--text-faint); font-size: 1rem; margin: 0 0 36px; }

#login-form { text-align: left; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 15px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur) var(--ease-out), background var(--dur-fast) ease;
}

input::placeholder { color: var(--text-faint); }

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.18);
}

button {
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur) ease,
              box-shadow var(--dur) var(--ease-out), color var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
button:active { transform: scale(0.96); }

#login-form button {
  width: 100%;
  padding: 15px;
  margin-top: 8px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 1rem;
  border-radius: 999px;
}

#login-form button:hover,
.search-btn:hover {
  background: #0a84ff;
  box-shadow: 0 10px 30px -8px rgba(10, 132, 255, 0.6);
}

.error { color: var(--red); min-height: 1.3em; margin: 14px 0 0; font-size: 0.88rem; text-align: center; }
.error:not(:empty) { animation: shake 0.4s var(--ease-out); }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ======================= App-Rahmen ======================= */
#app-view.screen { min-height: 100vh; padding-bottom: 120px; }
#app-view:not(.hidden) { animation: fade 0.5s ease; }

.avatar-bar {
  display: flex; justify-content: flex-end;
  max-width: 680px; margin: 0 auto;
  padding: 20px 20px 0;
}

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px #333;
}
.avatar:hover { box-shadow: inset 0 0 0 1px #555, 0 0 0 4px rgba(255, 255, 255, 0.06); }

.content { max-width: 680px; margin: 0 auto; padding: 4px 20px 20px; }

/* Seitenwechsel: Inhalte gleiten gestaffelt herein */
.page > * { animation: rise 0.7s var(--ease-out) backwards; }
.page > :nth-child(1) { animation-delay: 0.02s; }
.page > :nth-child(2) { animation-delay: 0.08s; }
.page > :nth-child(3) { animation-delay: 0.14s; }
.page > :nth-child(4) { animation-delay: 0.2s; }
.page > :nth-child(5) { animation-delay: 0.26s; }
.page > :nth-child(n+6) { animation-delay: 0.32s; }

.page h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.1;
  margin: 0 0 24px;
  background: linear-gradient(180deg, #fff 30%, #a1a1a6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-date {
  color: var(--text-faint);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.hint-panel {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.hint-panel strong { color: var(--text); }

.hint-panel.accent-ok {
  color: var(--signal);
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.hint-panel.accent-ok::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 12px var(--signal);
}

/* ======================= "Jetzt"-Karte ======================= */
.now-readout {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease;
}

.now-readout::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 300px; height: 300px;
  right: -100px; top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  animation: drift 8s ease-in-out infinite alternate;
}

.now-readout:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 24px 48px -24px var(--accent-glow);
}

.now-readout-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.now-live-dot {
  order: -1;
  margin-right: auto;
  display: inline-flex; align-items: center; gap: 7px;
}
.now-live-dot::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: livePulse 2s var(--ease-out) infinite;
}
.now-live-dot::after { content: "Jetzt"; }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(41, 151, 255, 0.6); }
  100% { box-shadow: 0 0 0 9px rgba(41, 151, 255, 0); }
}

.now-subject {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 18px 0 4px;
}
.now-meta { color: var(--text-dim); font-size: 0.98rem; }

.now-bar {
  height: 6px;
  margin-top: 22px;
  background: #2a2a2d;
  border-radius: 3px;
  overflow: hidden;
}
.now-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  box-shadow: 0 0 14px rgba(41, 151, 255, 0.6);
  transition: width 1.4s var(--ease-out) 0.25s;
}

.now-foot {
  display: flex; justify-content: space-between;
  margin-top: 9px;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ======================= "Als Nächstes" ======================= */
.next-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius);
}
.next-strip-label { color: var(--text-faint); font-size: 0.82rem; font-weight: 500; }
.next-strip-subject { font-weight: 600; flex: 1; }
.next-strip-time {
  color: var(--text-dim); font-size: 0.85rem; font-variant-numeric: tabular-nums;
  background: var(--surface-2); padding: 4px 10px; border-radius: 999px;
}

/* ======================= Listen ======================= */
.list-heading {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--text);
  margin: 30px 0 12px;
}

.lesson-list {
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
}
.lesson-list:empty { display: none; }

.lesson-row, .klasse-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  position: relative;
  transition: background var(--dur-fast) ease;
  animation: rise 0.6s var(--ease-out) backwards;
  animation-delay: calc(0.04s * var(--i, 0) + 0.15s);
}
.lesson-row + .lesson-row::before,
.klasse-row + .klasse-row::before {
  content: "";
  position: absolute; top: 0; right: 0;
  left: 18px;
  height: 1px;
  background: var(--hairline);
}
.lesson-row:hover, .klasse-row:hover { background: rgba(255, 255, 255, 0.03); }

/* vorbei: zurückgenommen, aber noch gut lesbar (Kontrast > 4.5:1) */
.lesson-row.done .row-subject,
.lesson-row.done .row-period { color: var(--text-faint); font-weight: 500; }
.lesson-row.current .row-subject { color: var(--accent); }
.lesson-row.current::after {
  content: "";
  position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.lesson-row.cancelled .row-subject { text-decoration: line-through; color: var(--text-faint); }

.row-time {
  width: 96px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 1px;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.row-period { color: var(--text); font-size: 0.92rem; font-weight: 600; }

.row-body { flex: 1; min-width: 0; }
.row-subject { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--text-faint); font-size: 0.85rem; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-tag {
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 159, 10, 0.16); color: var(--amber);
  flex-shrink: 0;
}
.row-tag.cancel { background: rgba(255, 69, 58, 0.16); color: var(--red); }
.row-tag.exam { background: rgba(41, 151, 255, 0.16); color: var(--accent); }
.row-tag.changed { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }

.empty-row {
  color: var(--text-faint);
  padding: 28px 20px;
  font-size: 0.95rem;
  text-align: center;
  animation: fade 0.5s ease;
}

/* ======================= Such-Seiten ======================= */
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

.search-input {
  flex: 1; min-width: 140px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur) var(--ease-out);
}
.search-input.narrow { flex: 0 1 160px; min-width: 120px; }

input[type="number"], input[type="time"] { font-variant-numeric: tabular-nums; }
input[type="time"], input[type="date"], select { color-scheme: dark; }

select.search-input {
  appearance: none;
  -webkit-appearance: none;
  flex-basis: 200px;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.date-field {
  display: flex; align-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur) var(--ease-out);
}
.date-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.18); }

.date-field input[type="date"] {
  border: none; background: transparent; color: var(--text);
  padding: 13px 4px;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.date-field input[type="date"]:focus { box-shadow: none; }

.date-step {
  background: transparent;
  color: var(--text-dim);
  width: 40px; min-height: 46px;
  padding: 0;
  font-size: 1.25rem;
  border-radius: 0;
}
.date-step:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.search-btn {
  background: var(--accent-strong);
  color: #fff;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.98rem;
}

.status-readout {
  font-size: 0.95rem;
  color: var(--text-dim);
  min-height: 1.4em;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.status-readout:not(:empty) { animation: rise 0.5s var(--ease-out); }
.status-readout.free, .status-readout.busy {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-weight: 600;
}
.status-readout.free { color: var(--signal); background: rgba(48, 209, 88, 0.1); }
.status-readout.busy { color: var(--amber); background: rgba(255, 159, 10, 0.1); }
.status-readout.free::before, .status-readout.busy::before {
  content: ""; flex-shrink: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 12px currentColor;
}

.result-heading:empty { display: none; }

.cache-status {
  color: var(--text-faint);
  font-size: 0.75rem;
  text-align: center;
  margin-top: 44px;
  font-variant-numeric: tabular-nums;
}

/* ======================= Segment-Umschalter ======================= */
.mode-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 16px;
  gap: 2px;
  max-width: 100%;
}
.mode-toggle.small { margin-bottom: 0; }

.mode-btn {
  background: transparent;
  color: var(--text-dim);
  padding: 8px 16px;
  min-height: 36px;
  border-radius: 9px;
  font-size: 0.88rem;
  white-space: nowrap;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

/* ======================= Freie Räume / Klassen ======================= */
.room-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }

.room-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.92rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 999px;
  animation: rise 0.5s var(--ease-out) backwards;
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) ease;
}
.room-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 8px var(--signal);
}
.room-chip:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(48, 209, 88, 0.4); }

.klasse-name { font-weight: 700; width: 72px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.klasse-status { color: var(--text-faint); font-size: 0.9rem; flex: 1; min-width: 0; }
.klasse-status.busy { color: var(--text-dim); }
.klasse-status.free { color: var(--signal); }
.klasse-row .klasse-status.busy::before, .klasse-row .klasse-status.free::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-right: 8px; vertical-align: 2px;
  background: currentColor;
}
.klasse-row .klasse-status.busy::before { background: var(--amber); }

/* ======================= Anmeldung: Untis, Einladung, Warten ======================= */
.field-label {
  display: block;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-dim);
  margin: 0 0 6px 4px;
}
.login-invite {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(41, 151, 255, 0.12);
  color: #8ec8ff;
  font-size: 0.9rem;
  text-align: center;
}
.login-invite.invalid { background: rgba(255, 159, 10, 0.12); color: var(--amber); }
.login-note {
  margin: 18px 4px 0;
  color: var(--text-faint);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}
#login-form button:disabled { opacity: 0.6; cursor: progress; }

.pending-box { text-align: center; }
.pending-box h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 10px; }
.pending-box p { color: var(--text-dim); margin: 0 0 26px; }
.pending-icon {
  width: 56px; height: 56px; margin: 0 auto 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(41, 151, 255, 0.25);
  position: relative;
}
.pending-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--accent);
  animation: spin 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================= Heute: Hinweise ======================= */
.hint-panel.accent-warn { color: var(--amber); background: rgba(255, 159, 10, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 159, 10, 0.2); }

.absence-card {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 10, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.absence-head { display: flex; align-items: center; gap: 12px; }
.absence-count {
  min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber); color: #1d1d1f;
  font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums;
}
.absence-title { font-weight: 600; }
.absence-list {
  list-style: none; margin: 10px 0 0; padding: 0 0 0 40px;
  color: var(--text-dim); font-size: 0.9rem; font-variant-numeric: tabular-nums;
}
.absence-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.absence-list li + li { margin-top: 4px; }
.absence-due { color: var(--text-faint); }
.absence-due.today { color: var(--amber); font-weight: 600; }
.absence-due.overdue { color: var(--red); font-weight: 600; }

/* ======================= Konto-Seite ======================= */
.card {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card-text { margin: 0 0 12px; color: var(--text); font-size: 0.95rem; }
.card-text strong { font-weight: 600; }
.dim, .card-text.dim { color: var(--text-faint); font-size: 0.85rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.card-msg { margin: 0; min-height: 1.2em; color: var(--text-dim); font-size: 0.88rem; }

.btn-secondary, .btn-danger {
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  background: var(--surface-3);
  color: var(--text);
}
.btn-secondary:hover { background: #3a3a3c; }
.btn-danger { background: rgba(255, 69, 58, 0.16); color: var(--red); }
.btn-danger:hover { background: rgba(255, 69, 58, 0.26); }
.search-btn.small, .btn-secondary.small { padding: 9px 16px; font-size: 0.86rem; }

.toggle-list { border-top: 1px solid var(--hairline); margin-top: 4px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0;
  cursor: pointer;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--hairline); }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row strong { font-weight: 600; }
.toggle-row small { color: var(--text-faint); font-size: 0.82rem; }

/* iOS-artiger Schalter */
.switch {
  appearance: none; -webkit-appearance: none;
  flex-shrink: 0;
  width: 51px; height: 31px; margin: 0;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative; cursor: pointer;
  transition: background var(--dur) ease;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform var(--dur) var(--ease-spring);
}
.switch:checked { background: var(--signal); }
.switch:checked::after { transform: translateX(20px); }

.invite-result input { margin-bottom: 10px; font-size: 0.85rem; color: var(--text-dim); }
.mini-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.85rem; }
.mini-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 8px 0; border-top: 1px solid var(--hairline);
}
.mini-list li > span:first-child { flex: 1; min-width: 120px; }
.link-btn { background: none; padding: 4px 0; color: var(--accent); font-size: 0.85rem; font-weight: 500; }

.user-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; position: relative;
}
.user-row + .user-row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 18px; height: 1px; background: var(--hairline);
}
.user-row.pending { background: rgba(41, 151, 255, 0.06); }
.user-row.rejected .row-subject { color: var(--text-faint); }
.user-row .row-meta { white-space: normal; }
.user-actions { display: flex; gap: 8px; }

/* ======================= Bestätigungsfenster ======================= */
dialog.sheet {
  width: min(400px, calc(100% - 32px));
  border: none; padding: 26px 24px 20px;
  border-radius: var(--radius-lg);
  background: #1c1c1e; color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog.sheet[open] { animation: sheetIn 0.35s var(--ease-out); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.6); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
dialog.sheet h2 { margin: 0 0 8px; font-size: 1.2rem; letter-spacing: -0.015em; }
dialog.sheet p { margin: 0 0 22px; color: var(--text-dim); font-size: 0.95rem; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions button { flex: 1; padding: 13px 10px; white-space: nowrap; }

/* ======================= Navigation unten ======================= */
.bottom-nav {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: 2px;
  padding: 6px;
  background: rgba(30, 30, 32, 0.72);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px rgba(0, 0, 0, 0.5);
  border-radius: 28px;
  z-index: 50;
  animation: navIn 0.9s var(--ease-out) 0.2s backwards;
}
@keyframes navIn { from { opacity: 0; transform: translate(-50%, 30px); } }

/* gleitende Markierung hinter dem aktiven Menüpunkt */
.nav-pill {
  position: absolute;
  top: 6px; bottom: 6px; left: 0;
  width: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.5s var(--ease-spring), width 0.5s var(--ease-spring);
  pointer-events: none;
}

.nav-item {
  position: relative;
  background: transparent;
  color: var(--text-faint);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 14px;
  min-width: 62px; min-height: 52px;
  border-radius: 22px;
  font-size: 0.68rem; font-weight: 600;
}
.nav-item svg { width: 22px; height: 22px; transition: transform var(--dur) var(--ease-spring); }
.nav-item:hover { color: var(--text-dim); }
.nav-item:hover svg { transform: translateY(-1px); }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { transform: scale(1.06); }

@media (max-width: 460px) {
  .nav-item { min-width: 54px; padding: 8px 6px; }
  .content { padding: 4px 16px 20px; }
  .avatar-bar { padding: 16px 16px 0; }
  .page h1 { font-size: 2rem; }
  .row-time { width: 86px; font-size: 0.74rem; }
  .lesson-row, .klasse-row { gap: 12px; padding: 13px 16px; }
  .search-btn { flex: 1; }
}

/* Wer am Gerät "weniger Bewegung" eingestellt hat, bekommt keine Animationen */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
