/*
 * Taach's Lernwelt – Ergänzungen ab Version 8.3.0
 * Teil A: Verwaltung (Formularfelder, Dashboard-Einstellungen, Wartung)
 * Teil B: Hinweise unten links (Toasts)
 * Teil C: Wartungsbildschirm
 * Der Kinderbereich wird in lernwelt-kids.css gestaltet.
 */

/* ================================================================== */
/* Teil A – Verwaltung                                                  */
/* ================================================================== */

/* Zahl + Einheit nebeneinander (z. B. Backup-Intervall) */
.field-action {
  align-items: stretch;
}
.field-action > input {
  flex: 1 1 90px !important;
  min-width: 80px !important;
  width: auto !important;
}
.field-action > select {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 128px;
}
.field-action > button {
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .field-action {
    flex-direction: row !important;
  }
}

/* Schalterkarten nicht künstlich in die Höhe ziehen */
.settings-grid > .toggle-card,
.settings-grid > label.check {
  align-self: end;
  align-items: center !important;
  min-height: 48px;
}
.settings-grid > .field-wide {
  grid-column: 1 / -1;
}
.settings-grid textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

/* Hervorgehobene Aktionen in der Verwaltung */
#adminModal .admin-inline-actions button.primary-action {
  border-color: var(--admin-accent, #2563eb);
  background: var(--admin-accent, #2563eb);
  color: #fff;
}
#adminModal .admin-inline-actions button.primary-action:hover {
  filter: brightness(1.08);
}
#adminModal .admin-inline-actions button.danger-action {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
#adminModal .admin-inline-actions button.danger-action:hover {
  background: #b91c1c;
}
#adminModal .admin-inline-actions button {
  min-height: 38px;
  padding: 8px 14px;
  font-weight: 700;
}

/* Erfolgsmeldungen erscheinen jetzt unten links */
.toastified {
  display: none !important;
}

/* ---------- Dashboard-Einstellungen ---------- */
.dashboard-customizer > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  cursor: pointer;
  list-style: none;
}
.dashboard-customizer > summary::-webkit-details-marker {
  display: none;
}
.dashboard-customizer > summary::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
  align-self: center;
}
.dashboard-customizer[open] > summary::before {
  transform: rotate(45deg);
}
.customizer-summary-title {
  font-weight: 800;
}
.customizer-summary-hint {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}
.dashboard-customizer[open] > summary {
  margin-bottom: 6px;
}
.customizer-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 14px;
}
.customizer-group {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px 16px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.customizer-group h4 {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.customizer-group .field {
  margin: 0;
}
.customizer-group .field > label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 700;
}
.customizer-group output {
  color: var(--admin-accent, #2563eb);
  font-variant-numeric: tabular-nums;
}
.customizer-group select {
  width: 100%;
}
.customizer-group input[type="range"] {
  width: 100%;
  accent-color: var(--admin-accent, #2563eb);
}
.range-scale {
  display: flex;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 11px;
}
.visually-hidden-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
.theme-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
}
.theme-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.theme-swatch:hover {
  border-color: #94a3b8;
}
.theme-swatch.selected {
  border-color: var(--admin-accent, #2563eb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--admin-accent, #2563eb) 25%, transparent);
}
.theme-swatch-dot {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--swatch-accent) 0 50%, var(--swatch-surface) 50% 100%);
  box-shadow: inset 0 0 0 1px #0f172a26;
}
.color-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.color-field input[type="color"] {
  flex: 0 0 auto;
  width: 34px !important;
  height: 34px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-field input[type="color"]::-webkit-color-swatch {
  border: 1px solid #0f172a26;
  border-radius: 8px;
}
.color-field input[type="color"]::-moz-color-swatch {
  border: 1px solid #0f172a26;
  border-radius: 8px;
}
.color-field > span {
  display: grid;
  line-height: 1.2;
}
.color-field b {
  font-size: 13px;
}
.color-field code {
  color: #64748b;
  font-size: 12px;
}
.customizer-tiles {
  margin-bottom: 14px;
}
.customizer-tiles .section-help {
  margin: -4px 0 0;
}
.dashboard-widget-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}
.dashboard-widget-option {
  display: grid !important;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.dashboard-widget-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--admin-accent, #2563eb);
}
.dashboard-widget-option span {
  font-weight: 600;
}
.dashboard-widget-option:has(input:not(:checked)) span {
  color: #94a3b8;
}
.dashboard-widget-option button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.dashboard-widget-option button:disabled {
  opacity: 0.35;
  cursor: default;
}
.customizer-actions {
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
@media (max-width: 980px) {
  .customizer-layout {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .customizer-layout,
  .color-fields {
    grid-template-columns: 1fr;
  }
}

/* ---------- Wartungsmodus in der Verwaltung ---------- */
.maintenance-panel {
  border-left: 4px solid #94a3b8 !important;
}
.maintenance-panel.is-active {
  border-left-color: #dc2626 !important;
  background: #fff7f7 !important;
}
.maintenance-panel.is-scheduled {
  border-left-color: #d97706 !important;
  background: #fffbeb !important;
}
.maintenance-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.maintenance-badge {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.is-active .maintenance-badge {
  background: #dc2626;
  color: #fff;
}
.is-scheduled .maintenance-badge {
  background: #f59e0b;
  color: #1f1300;
}
.maintenance-panel .admin-inline-actions {
  margin-top: 12px;
}
.admin-maintenance-top {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.admin-maintenance-top.scheduled {
  background: #f59e0b;
  color: #1f1300;
}
.admin-maintenance-top[hidden] {
  display: none;
}

/* ================================================================== */
/* Teil B – Hinweise unten links                                        */
/* ================================================================== */
.toast-region {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 100001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 12px 10px 12px 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 12px 30px #0f172a40, 0 2px 6px #0f172a26;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  animation: toast-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast p {
  margin: 1px 0 0;
  overflow-wrap: anywhere;
}
.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  color: #052e16;
  font-size: 13px;
  font-weight: 900;
}
.toast-error .toast-icon {
  background: #f87171;
  color: #450a0a;
}
.toast-info .toast-icon {
  background: #60a5fa;
  color: #0c1f3f;
  font-family: Georgia, serif;
  font-style: italic;
}
.toast-close {
  width: 26px;
  height: 26px;
  margin: -3px 0 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover {
  background: #ffffff1a;
  color: #fff;
}
.toast-leave {
  animation: toast-out 0.26s ease forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(-16px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast-leave {
    animation: none;
  }
}

/* ================================================================== */
/* Teil C – Wartungsbildschirm für Kinder und Eltern                    */
/* ================================================================== */
.maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 19; /* unter allen Dialogen, damit Eltern- und Entwicklerbereich erreichbar bleiben */
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 20% 15%, #fff4c7 0 18%, transparent 19%),
    radial-gradient(circle at 85% 80%, #d8f3ff 0 22%, transparent 23%),
    #fdf8ef;
  overflow-y: auto;
}
.maintenance-screen[hidden] {
  display: none;
}
.maintenance-card {
  width: min(560px, 100%);
  padding: 28px 24px 22px;
  border: 3px solid #1f2a44;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 8px 0 #1f2a44;
  text-align: center;
  color: #1f2a44;
}
.maintenance-illustration {
  position: relative;
  height: 110px;
  margin-bottom: 6px;
  font-size: 58px;
}
.maintenance-illustration span {
  position: absolute;
  line-height: 1;
}
.mt-gear-a {
  left: calc(50% - 78px);
  top: 8px;
  animation: mt-spin 6s linear infinite;
}
.mt-gear-b {
  left: calc(50% + 14px);
  top: 42px;
  font-size: 44px;
  animation: mt-spin 4.5s linear infinite reverse;
}
.mt-tool {
  left: calc(50% - 22px);
  top: 40px;
  animation: mt-wiggle 2.4s ease-in-out infinite;
}
@keyframes mt-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes mt-wiggle {
  50% {
    transform: rotate(-12deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .maintenance-illustration span {
    animation: none;
  }
}
.maintenance-card h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.15;
}
.maintenance-card p {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.45;
}
.maintenance-until {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff1c2;
  font-weight: 800;
}
.maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 14px;
}
.maintenance-actions button {
  min-height: 48px;
  padding: 10px 18px;
  border: 3px solid #1f2a44;
  border-radius: 16px;
  background: #fff;
  color: #1f2a44;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 0 #1f2a44;
  cursor: pointer;
}
.maintenance-actions button:first-child {
  background: #ffd84d;
}
.maintenance-actions button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1f2a44;
}
.maintenance-card .maintenance-note {
  margin: 0;
  color: #5b6478;
  font-size: 14px;
}
.maintenance-banner {
  position: relative;
  z-index: 3;
  margin: 8px auto;
  width: min(1100px, calc(100% - 24px));
  padding: 10px 16px;
  border: 2px solid #b45309;
  border-radius: 14px;
  background: #fff7e0;
  color: #5b3200;
  font-weight: 700;
  text-align: center;
}
.maintenance-banner[hidden] {
  display: none;
}

/* ---------- Backups ---------- */
.backup-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 14px;
}
.backup-groups .field input,
.backup-groups .field select {
  width: 100%;
}
.backup-groups .mini {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}
.backup-groups .mini.hint-error {
  color: #b91c1c;
  font-weight: 700;
}
.switch-row {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.switch-row input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.16s;
}
.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0f172a40;
  transition: transform 0.16s;
}
.switch-row input:checked {
  background: var(--admin-accent, #2563eb);
}
.switch-row input:checked::after {
  transform: translateX(18px);
}
.switch-row input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--admin-accent, #2563eb) 40%, transparent);
  outline-offset: 2px;
}
.switch-row > span {
  display: grid;
  line-height: 1.25;
}
.switch-row small {
  color: #64748b;
  font-size: 12px;
}
.check-list {
  display: grid;
  gap: 2px;
  padding: 4px 0;
}
.check-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.check-line:hover {
  background: #eef2f7;
}
.check-line input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--admin-accent, #2563eb);
}
.backup-schedule {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #e2e8f0;
}
.backup-schedule > div {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  background: #fff;
}
.backup-schedule span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.backup-schedule b {
  font-size: 15px;
}
.backup-schedule.on > div:first-child b {
  color: #15803d;
}
@media (max-width: 980px) {
  .backup-groups {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .backup-groups {
    grid-template-columns: 1fr;
  }
}

/* ---------- Update-Kanal ---------- */
.channel-section {
  border-left: 4px solid var(--admin-accent, #2563eb) !important;
}
.channel-status {
  margin: 12px 0;
}
.channel-actions {
  margin-bottom: 12px;
}
.channel-error {
  margin: -4px 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
}
.channel-empty {
  margin: 4px 0 12px;
  color: #64748b;
}
.channel-releases {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.release-card {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}
.release-card.state-available {
  border-color: color-mix(in srgb, var(--admin-accent, #2563eb) 45%, #e2e8f0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-accent, #2563eb) 10%, transparent);
}
.release-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 14px;
}
.release-version {
  font-size: 18px;
  margin-right: 8px;
}
.release-date {
  color: #64748b;
  font-size: 13px;
}
.release-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rbadge {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.rbadge.state.available {
  background: var(--admin-accent, #2563eb);
  color: #fff;
}
.rbadge.state.staged {
  background: #f59e0b;
  color: #1f1300;
}
.rbadge.state.applied {
  background: #fde68a;
  color: #5b3a00;
}
.rbadge.comp.hard {
  background: #fee2e2;
  color: #991b1b;
}
.rbadge.sig.ok {
  background: #dcfce7;
  color: #166534;
}
.rbadge.sig.bad {
  background: #dc2626;
  color: #fff;
}
.release-title {
  margin: 10px 0 4px;
  font-size: 15px;
}
.release-summary {
  margin: 0 0 8px;
  color: #334155;
  line-height: 1.5;
}
.release-details > summary,
.channel-past > summary {
  cursor: pointer;
  color: var(--admin-accent, #2563eb);
  font-weight: 700;
  padding: 4px 0;
}
.release-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.release-group,
.release-testing {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}
.release-group h5,
.release-testing h5 {
  margin: 0 0 6px;
  font-size: 13px;
}
.release-group ul,
.release-testing ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.45;
  font-size: 14px;
}
.release-group li + li,
.release-testing li + li {
  margin-top: 4px;
}
.release-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.release-shots img {
  display: block;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.release-actions {
  margin-top: 10px;
  align-items: center;
}
.release-password {
  min-width: 200px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}
.channel-past {
  margin-top: 4px;
}
.channel-past .release-card {
  margin-top: 8px;
  opacity: 0.85;
}
.channel-settings {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
.channel-settings > summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  cursor: pointer;
}
.channel-fingerprint {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.channel-token-state {
  padding: 9px 11px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
}
.channel-token-state.ok {
  background: #f0fdf4;
  color: #166534;
}
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f59e0b;
  color: #1f1300;
  font-size: 12px;
  font-weight: 800;
}
.release-summary {
  font-size: 14px;
}
#adminModal .admin-inline-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Fehlermeldungen an Claude ---------- */
.claude-bug-section {
  border-left: 4px solid var(--admin-accent, #2563eb) !important;
}
.claude-bug-chip {
  display: inline-flex;
  width: max-content;
  margin: 6px 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.claude-bug-chip.progress {
  background: #fef3c7;
  color: #854d0e;
}
.claude-bug-chip.question {
  background: #fee2e2;
  color: #991b1b;
}
.claude-bug-chip.fixed {
  background: #dcfce7;
  color: #166534;
}
.claude-bug-chip.closed {
  background: #f1f5f9;
  color: #475569;
}
.claude-handover-btn {
  border-color: var(--admin-accent, #2563eb) !important;
  color: var(--admin-accent, #2563eb) !important;
  font-weight: 700;
}
.claude-question {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
}
.claude-question p {
  margin: 0;
  white-space: pre-wrap;
}
.claude-question textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}
.claude-question button {
  justify-self: start;
}
.handover-box {
  max-width: 720px;
  text-align: left;
}
.handover-box textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
}
.handover-shot-toggle {
  margin: 8px 0;
}
.handover-shot {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 0 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.handover-preview summary {
  cursor: pointer;
  font-weight: 700;
  color: #2563eb;
}
.handover-preview pre {
  max-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  white-space: pre-wrap;
}
.channel-check-hint {
  align-self: center;
  color: #9a3412 !important;
  font-weight: 700;
}

/* ---------- Elternbereich: Nutzung von heute ---------- */
.device-log-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
}

/* Begleitfiguren-Auswahl (Entwicklung → System, ab 8.10.0) */
.lw-companion-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 10px 0 14px;
}
.lw-companion-option {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 12px 12px;
  border: 2px solid #dbe6f1;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  text-align: center;
}
.lw-companion-option:has(input:checked) {
  border-color: #3aa7f0;
  box-shadow: 0 0 0 3px #3aa7f033;
  background: #f3f9ff;
}
.lw-companion-option input {
  position: absolute;
  top: 10px;
  left: 10px;
}
.lw-companion-figs {
  display: flex;
  gap: 2px;
  height: 64px;
}
.lw-companion-figs svg {
  width: 60px;
  height: 64px;
}
.lw-companion-option small {
  color: #5d6b80;
}
.lw-companion-figs .lw-eyes-happy,
.lw-companion-figs .lw-lids,
.lw-companion-figs .lw-tongue {
  display: none;
}

/* ---------- Elternbereich: Nutzung – Zeitraum, ältere Einträge, einzeln löschen (ab 8.11.0) ---------- */
.device-log-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.device-log-period select {
  width: auto;
  min-width: 180px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
}
#deviceLogRange {
  font-weight: 600;
}
.device-log-older {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: -2px 0 10px;
  padding: 8px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 14px;
}
.device-log-older[hidden] {
  display: none;
}
.device-day {
  margin: 10px 2px 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #475569;
}
#deviceLogs .device-entry {
  position: relative;
  padding-right: 96px;
}
.device-entry-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.device-entry-remove:hover,
.device-entry-remove:focus-visible {
  background: #fef2f2;
}
#clearDeviceLogs:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Interner Änderungsverlauf ein-/ausblendbar (ab 8.12.0) */
.lw-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lw-history-head button {
  margin: 0;
  font-size: 13px;
}
.lw-history-collapsed {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
}
.lw-history-more {
  justify-self: start;
  margin-top: 4px;
}

/* ---------- Unterstützung (PayPal), Elternbereich + Entwicklung (ab 8.12.0) ---------- */
.lw-donate-card {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  text-align: left;
}
.lw-donate-card.compact {
  margin-top: 22px;
  padding: 12px 14px;
  background: #fafcff;
  border-style: dashed;
}
.lw-donate-card.compact .lw-donate-qr {
  width: 96px;
  height: 96px;
}
.lw-donate-qr {
  flex: none;
  width: 132px;
  height: 132px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}
.lw-donate-body h4 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #0f172a;
}
.lw-donate-body h4 span {
  color: #ef5b93;
}
.lw-donate-body p {
  margin: 0 0 10px;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}
.lw-donate-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: #1f2d4d;
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.lw-donate-link:hover,
.lw-donate-link:focus-visible {
  background: #2b3d66;
}
.lw-donate-body small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}
.lw-donate-footer {
  margin-right: auto;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lw-donate-footer span {
  color: #ef5b93;
}
.lw-donate-footer:hover,
.lw-donate-footer:focus-visible {
  color: #1f2d4d;
  text-decoration: underline;
}
#parentModal .parent-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.lw-donate-tab span {
  color: #ef5b93;
}
.lw-donate-dialog .lw-donate-box {
  width: min(560px, calc(100% - 32px));
  text-align: right;
}
.lw-donate-dialog .lw-donate-card {
  margin: 0 0 14px;
}
.lw-donate-places,
.lw-donate-qr-setting {
  margin: 12px 0;
  padding: 10px 14px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.lw-donate-places legend,
.lw-donate-qr-setting legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 14px;
}
.lw-donate-places small {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.lw-donate-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}
.lw-donate-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lw-donate-preview img {
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}
@media (max-width: 600px) {
  .lw-donate-card {
    flex-direction: column;
    text-align: center;
  }
}

/* Live-Aktualisierung der Entwicklerverwaltung (ab 8.17.0) */
.lw-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 4px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.lw-live-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: lw-live-pulse 1.6s ease-in-out infinite;
}
.lw-live-chip.off {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}
.lw-live-chip.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b42318;
}
@keyframes lw-live-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}
.admin-tab.lw-has-new {
  position: relative;
}
.admin-tab.lw-has-new::after {
  content: attr(data-new-bugs);
  position: absolute;
  right: 8px;
  top: 50%;
  min-width: 20px;
  height: 20px;
  margin-top: -10px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  animation: lw-live-pulse 1.6s ease-in-out infinite;
}

/* Azure-Sprachausgabe mit Reserve-Schlüssel (ab 8.29.0) */
.speech-key-title {
  margin: 14px 0 4px;
  font-size: 15px;
}
#adminAzureHealth {
  white-space: pre-line;
}

/* Neustart direkt nach einem Update (ab 8.29.0) */
.lw-restart-prompt {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}
.lw-restart-box {
  display: grid;
  gap: 10px;
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--text, #1f2d4d);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}
.lw-restart-box h3 {
  margin: 0;
}
.lw-restart-box p {
  margin: 0;
  line-height: 1.45;
}
.lw-restart-label {
  font-weight: 600;
  font-size: 14px;
}
.lw-restart-box input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
}
.lw-restart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.lw-restart-actions button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lw-restart-actions .primary-action {
  background: var(--admin-accent, #2563eb);
  color: #fff;
}
.lw-restart-actions .secondary-action {
  background: #e8edf5;
  color: #1f2d4d;
}
.lw-restart-actions button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.lw-restart-box .error {
  min-height: 1.2em;
  color: #c0392b;
  font-size: 14px;
}

/* ===== 8.30.0: Selbstregistrierung ===== */
body:not(.lw-registration-open) .lw-register-cta { display: none; }
.lw-register-cta { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #cbd5e1; }
.lw-register-cta span { color: #475569; font-weight: 700; }
.lw-register-cta .big-btn { margin: 0; }
.lw-register-box { width: min(560px, 100%); }
.lw-register-box form { display: grid; gap: 4px; }
.lw-register-lead { margin-top: 0; }
.lw-register-codes { gap: 10px; }
.lw-register-meter { height: 6px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin: -2px 0 8px; }
.lw-register-meter i { display: block; height: 100%; width: 0; background: #ef5b93; transition: width 0.25s, background 0.25s; }
.lw-register-meter i[data-level="2"] { background: #ffcf3f; }
.lw-register-meter i[data-level="3"], .lw-register-meter i[data-level="4"] { background: #5fbf3f; }
/* Lockfeld für Programme: für Menschen unsichtbar, aber nicht per display:none (das überspringen Bots) */
.lw-register-website { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.lw-register-check { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: 6px 0; font-size: 14px; color: #334155; cursor: pointer; }
.lw-register-check input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; accent-color: #3aa7f0; }
.lw-register-box #regBack { margin-top: 4px; }
.lw-register-done { text-align: center; }
.lw-register-done-icon { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: #5fbf3f; color: #fff; font-size: 34px; font-weight: 800; }
.lw-register-done h3 { color: #1f2d4d; margin: 4px 0 8px; }
.lw-register-code { display: flex; flex-direction: column; gap: 2px; margin: 10px auto; padding: 12px 16px; border-radius: 14px; background: #fff7d6; border: 2px solid #ffcf3f; max-width: 340px; }
.lw-register-code span { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #6b5b16; }
.lw-register-code b { font-size: 26px; letter-spacing: 0.06em; color: #1f2d4d; font-family: ui-monospace, Consolas, monospace; user-select: all; }
.lw-register-code.small { background: #eef7fe; border-color: #3aa7f0; }
.lw-register-code.small b { font-size: 18px; }
.lw-register-code.small span { color: #1f5f8a; }
@media (max-width: 520px) {
  .lw-register-cta { flex-direction: column; }
  .lw-register-code b { font-size: 21px; }
}

/* Entwickler: Registrierungen */
.lw-reg-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: #ef5b93; color: #fff; font-size: 12px; font-weight: 800; }
.lw-reg-badge[hidden] { display: none; }
.lw-reg-filter { flex-wrap: wrap; align-items: center; }
.lw-reg-filter .admin-list-search { flex: 1 1 220px; min-width: 0; }
.lw-reg-card { display: grid; gap: 10px; }
.lw-reg-card.lw-reg-pending { border-left: 4px solid #ffcf3f; }
.lw-reg-card.lw-reg-approved { border-left: 4px solid #5fbf3f; }
.lw-reg-card.lw-reg-rejected, .lw-reg-card.lw-reg-released { opacity: 0.75; border-left: 4px solid #94a3b8; }
.lw-reg-card.lw-reg-banned { border-left: 4px solid #ef4444; }
.lw-reg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 14px; }
.lw-reg-meta { display: flex; flex-direction: column; min-width: 0; }
.lw-reg-meta span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.lw-reg-meta b { font-weight: 600; overflow-wrap: anywhere; }
.lw-reg-chip { align-self: flex-start; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.lw-reg-chip.danger { background: #fee2e2; color: #b91c1c; }
.lw-reg-chip.warn { background: #fef3c7; color: #92400e; }
.lw-reg-takeover { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lw-reg-takeover input { flex: 1 1 200px; min-width: 0; }
.lw-reg-approve { background: #16a34a !important; color: #fff !important; border-color: #16a34a !important; }
.danger-lite { color: #b91c1c !important; }
.lw-reg-takeover input, .lw-reg-takeover select, .lw-reg-filter select { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; min-height: 38px; }
.lw-reg-takeover .lw-reg-approve { padding: 8px 14px; border-radius: 8px; font-weight: 700; min-height: 38px; }

/* ===== 8.30.1: Impressum, Datenschutz, Kontakt (Taach-IT) – nur Eltern- und Anmeldebereich ===== */
.lw-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 14px; font-size: 13px; }
.lw-legal a { color: #64748b; text-decoration: none; font-weight: 600; }
.lw-legal a:hover, .lw-legal a:focus-visible { color: #1f2d4d; text-decoration: underline; }
#parentModal .parent-footer .lw-legal { margin: 0 auto 0 0; justify-content: flex-start; }
.lw-register-check a { color: #1f5f8a; font-weight: 700; }
@media (max-width: 640px) {
  #parentModal .parent-footer { flex-wrap: wrap; }
  #parentModal .parent-footer .lw-legal { width: 100%; justify-content: center; margin: 0; order: 9; }
}

/* ===== 8.31.0: E-Mail an Eltern ===== */
.lw-mail-status { display: grid; gap: 6px; }
.lw-mail-state { padding: 8px 12px; border-radius: 8px; border-left: 4px solid #94a3b8; background: #f8fafc; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.lw-mail-state.ok { border-color: #16a34a; background: #f0fdf4; }
.lw-mail-state.warn { border-color: #f59e0b; background: #fffbeb; }
.lw-mail-state.bad { border-color: #dc2626; background: #fef2f2; }
.lw-mail-state small { color: #64748b; overflow-wrap: anywhere; }
.lw-mail-dns { display: grid; gap: 6px; margin-top: 10px; }
.lw-mail-bulk { flex-wrap: wrap; align-items: center; margin: 6px 0; }
.lw-mail-bulk .lw-reg-approve, .lw-mail-bulk .danger-lite { padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.lw-mail-pick { width: 20px; height: 20px; flex: 0 0 auto; margin-right: 8px; accent-color: #3aa7f0; }
.lw-reg-card.lw-mail-pending { border-left: 4px solid #ffcf3f; }
.lw-reg-card.lw-mail-sending { border-left: 4px solid #3aa7f0; }
.lw-reg-card.lw-mail-sent { border-left: 4px solid #5fbf3f; }
.lw-reg-card.lw-mail-failed { border-left: 4px solid #dc2626; }
.lw-reg-card.lw-mail-discarded { opacity: 0.7; border-left: 4px solid #94a3b8; }
.lw-reg-chip:not(.danger):not(.warn) { background: #e0f2fe; color: #075985; }
.lw-mail-details summary { cursor: pointer; font-weight: 700; color: #1f5f8a; }
.lw-mail-details input, .lw-mail-details textarea { display: block; width: 100%; box-sizing: border-box; margin: 8px 0; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.lw-mail-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; font: 14px/1.5 ui-monospace, Consolas, monospace; margin: 8px 0 0; max-height: 360px; overflow: auto; }
.lw-mail-recipients { display: grid; gap: 8px; }
.lw-mail-recipient-list { display: grid; gap: 4px; max-height: 200px; overflow: auto; padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.lw-mail-recipient-list label, .lw-mail-bulk label { display: flex; gap: 8px; align-items: center; }
.lw-mail-auto-list { display: grid; gap: 8px; margin: 8px 0; }
.lw-mail-auto { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.lw-mail-auto.on { border-color: #f59e0b; background: #fffbeb; }
.lw-mail-auto div { display: flex; flex-direction: column; }
.lw-mail-auto span { color: #64748b; font-size: 13px; }
.lw-mail-howto { margin: 0 0 12px; padding: 10px 14px; border: 1px solid #bae6fd; border-radius: 10px; background: #f0f9ff; }
.lw-mail-howto summary { cursor: pointer; font-weight: 700; color: #075985; }
.lw-mail-howto ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.lw-mail-howto code { background: #e0f2fe; padding: 1px 5px; border-radius: 4px; }
@media (max-width: 640px) { .lw-mail-auto { flex-direction: column; align-items: stretch; } }
.lw-mail-card .admin-family-head { justify-content: flex-start; align-items: flex-start; gap: 10px; }
.lw-mail-card .admin-family-head > div { flex: 1 1 auto; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.lw-mail-card .admin-family-head > div > span { text-align: left; overflow-wrap: anywhere; }
.lw-mail-card > .section-help { margin: 0; }
.lw-mail-howto p { font-size: 14px; margin: 6px 0 0; color: #334155; }

/* ===== 8.31.2: Unterstützung rechtlich sauber ===== */
.lw-donate-body .lw-donate-legal { display: block; margin-top: 8px; font-size: 12px; line-height: 1.4; color: #64748b; }
.lw-donate-body .lw-donate-legal a { color: #475569; text-decoration: underline; }
.lw-donate-legal-admin { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid #3aa7f0; border-radius: 8px; background: #f0f9ff; font-size: 13px; line-height: 1.45; color: #1e3a5f; }
.lw-donate-warn { color: #b45309 !important; font-weight: 600; }
.lw-donate-warn[hidden] { display: none; }
#parentModal .parent-footer .lw-donate-footer:has(+ .lw-legal) { margin-right: 0; }
.lw-guide-setting-title { margin: 16px 0 6px; }
/* 8.32.1: Figuren in der Auswahl ohne Weltausrüstung; Vorleser-Reihe gedimmt bei „Nur Katze Soja“ */
.lw-companion-figs .lw-gear,
.lw-companion-figs .lw-cos {
  display: none !important;
}
.lw-companion-choice.lw-guide-off {
  opacity: 0.5;
}
.lw-guide-soja-note {
  color: #b45309 !important;
  font-weight: 600;
}

/* Bug-Knöpfe in Entwicklung → Fehlermeldungen (ab 8.34.0) */
.lw-bugbtn-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid #1f2d4d1f;
  border-radius: 14px;
  background: #fbfcff;
  cursor: pointer;
}
.lw-bugbtn-toggle input {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: #3aa7f0;
}
.lw-bugbtn-toggle span {
  display: grid;
  gap: 3px;
}
.lw-bugbtn-toggle small {
  color: #52607a;
  font-size: 13px;
  line-height: 1.4;
}
.lw-bugbtn-warn {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff4d6;
  color: #7a4b00;
  font-size: 13px;
  line-height: 1.45;
}

/* Als App installieren – Elternbereich (ab 8.36.0) */
.lw-app-install ol {
  margin: 6px 0 10px;
  padding-left: 22px;
  line-height: 1.55;
}
.lw-app-install .lw-app-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border: 1px solid #c9d4e3;
  border-radius: 8px;
  background: #f4f7fb;
  font-weight: 600;
  white-space: nowrap;
}
.lw-app-install .lw-app-key svg {
  width: 15px;
  height: 15px;
}
.lw-app-install .lw-app-ok {
  margin: 4px 0;
  color: #2d7a1e;
  font-weight: 600;
}

/* App-Symbol im Entwicklerbereich (ab 8.37.2) */
.lw-appicon-asset .lw-appicon-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 2px 8px #0f172a26;
  object-fit: cover;
}
.lw-appicon-asset .lw-appicon-choice,
.lw-appicon-asset .lw-appicon-bg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.lw-appicon-asset .lw-appicon-bg input {
  width: 44px;
  height: 28px;
  padding: 0;
  border: 1px solid #c9d4e3;
  border-radius: 6px;
}
.lw-appicon-asset .lw-appicon-note {
  color: #5b6474;
  font-size: 12px;
  line-height: 1.4;
}

/* Als App ablegen – Knopf, Tipp und Anleitung (ab 8.39.1) */
.parent-head .lw-app-headbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid #bcd7f0;
  border-radius: 999px;
  background: #eaf6ff;
  color: #134e7c;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.parent-head .lw-app-headbtn[hidden] {
  display: none;
}
.lw-app-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #bcd7f0;
  border-radius: 14px;
  background: #f2f9ff;
}
.lw-app-tip[hidden] {
  display: none;
}
.lw-app-tip > span {
  font-size: 24px;
}
.lw-app-tip p {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}
.lw-app-tip .lw-app-tipclose {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #52607a;
  cursor: pointer;
}
.lw-app-dialog {
  z-index: 1260;
}
.lw-app-box {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  text-align: left;
}
.lw-app-box .lw-app-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f8;
  font-size: 16px;
  cursor: pointer;
}
.lw-app-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 40px 12px 0;
}
.lw-app-head h2 {
  margin: 0 0 4px;
}
.lw-app-head p {
  margin: 0;
  color: #52607a;
  font-size: 14px;
  line-height: 1.4;
}
.lw-app-iconpreview {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 15px;
  box-shadow: 0 2px 8px #0f172a33;
}
.lw-app-now {
  width: 100%;
  margin: 6px 0 4px;
}
.lw-app-or {
  margin: 4px 0;
  color: #52607a;
  font-size: 13px;
  text-align: center;
}
.lw-app-where {
  margin: 8px 0 4px;
  line-height: 1.45;
}
.lw-app-steps-list {
  margin: 6px 0 10px;
  padding-left: 24px;
  line-height: 1.6;
}
.lw-app-steps-list li {
  margin-bottom: 6px;
}
.lw-app-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid #c9d4e3;
  border-radius: 8px;
  background: #f4f7fb;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: baseline;
}
.lw-app-ico {
  display: inline-block;
  width: 17px;
  height: 17px;
  vertical-align: -3px;
}
.lw-app-other {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #f8fafc;
}
.lw-app-other summary {
  font-weight: 700;
  cursor: pointer;
}
.lw-app-ok {
  color: #2d7a1e;
  font-weight: 700;
}
/* Pfeil zum Teilen-Symbol bzw. Menü */
.lw-app-arrow {
  position: fixed;
  z-index: 1270;
  color: #ef5b93;
  font-size: 44px;
  line-height: 1;
  text-shadow: 0 2px 0 #fff, 0 0 12px #fff;
  pointer-events: none;
  animation: lw-app-bounce 1s ease-in-out infinite;
}
.lw-app-arrow[hidden] {
  display: none;
}
.lw-app-arrow[data-where="bottom"] {
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  translate: -50% 0;
}
.lw-app-arrow[data-where="bottom-right"] {
  right: 18px;
  bottom: max(8px, env(safe-area-inset-bottom));
}
.lw-app-arrow[data-where="top-right"] {
  top: max(6px, env(safe-area-inset-top));
  right: 18px;
  rotate: 180deg;
}
@keyframes lw-app-bounce {
  50% {
    transform: translateY(10px);
  }
}
.lw-app-head h2 {
  font-size: 24px;
  line-height: 1.15;
}
@media (max-width: 560px) {
  #parentModal .parent-head {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .parent-head .lw-app-headbtn {
    order: 3;
    margin-left: 0;
    padding: 7px 12px;
    font-size: 13px;
  }
  .lw-app-head h2 {
    font-size: 21px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lw-app-arrow {
    animation: none;
  }
}

/* 8.40.0: E-Mail-Bestätigung (Double-Opt-in) */
.lw-register-mailstep { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0 12px; padding: 12px 14px; border-radius: 14px; background: #e8f5fe; border: 2px solid #3aa7f0; text-align: left; }
.lw-register-mailstep > span { font-size: 28px; line-height: 1; }
.lw-register-mailstep p { margin: 0; color: #1f2d4d; line-height: 1.45; }
.lw-register-mailstep b { overflow-wrap: anywhere; }
.lw-register-confirmbox { text-align: center; min-height: 0 !important; height: auto !important; align-self: center; }
.lw-register-confirmbox p { line-height: 1.5; color: #1f2d4d; }
#regConfirmModal[data-state="error"] .lw-register-done-icon { background: #ff6f4f; }
#regConfirmModal:not([data-state]) .lw-register-done-icon { background: #3aa7f0; }
.lw-reg-chip.ok:not(.danger) { background: #dcfce7; color: #166534; }
.lw-reg-card .lw-reg-chip { white-space: normal; }
.lw-reg-card.lw-reg-expired { opacity: 0.8; border-left: 4px solid #94a3b8; }
.lw-reg-confirm-state { display: grid; gap: 6px; margin: 8px 0 10px; }
.lw-reg-confirm-line { display: grid; grid-template-columns: 22px auto 1fr; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 10px; background: #f0fdf4; }
.lw-reg-confirm-line.warn { background: #fffbeb; }
.lw-reg-confirm-line > span { font-weight: 800; color: #166534; text-align: center; }
.lw-reg-confirm-line.warn > span { color: #b45309; }
.lw-reg-confirm-line small { color: #475569; }
.lw-reg-confirm-actions { flex-wrap: wrap; }
.lw-reg-confirm-actions input { flex: 0 1 260px; min-width: 200px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; min-height: 38px; }
@media (max-width: 640px) {
  .lw-reg-confirm-line { grid-template-columns: 22px 1fr; }
  .lw-reg-confirm-line small { grid-column: 2; }
  .lw-reg-confirm-actions input { min-width: 0; width: 100%; }
}

/* 8.41.0: Auge zum Anzeigen von Login-Code und Passwort */
.lw-reveal { position: relative; display: block; }
.lw-reveal > input { width: 100%; padding-right: 50px !important; box-sizing: border-box; }
.lw-reveal-btn { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #4a5a78; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; box-shadow: none; min-height: 0; }
.lw-reveal-btn svg { width: 24px; height: 24px; }
.lw-reveal-btn:hover { background: #eef5fc; color: #1f2d4d; }
.lw-reveal-btn:focus-visible { outline: 3px solid #3aa7f0; outline-offset: -2px; }
.lw-reveal-btn[aria-pressed="true"] { color: #2b86c9; }

/* 8.41.0: Rechenrätsel statt Rechenfrage */
.lw-register-shield { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: #eef7fe; border: 2px solid #cfe7fb; color: #1f2d4d; font-size: 14px; line-height: 1.35; }
.lw-register-shield-icon { font-size: 20px; line-height: 1; }
.lw-register-shield[data-state="work"] .lw-register-shield-icon { animation: lw-shield-pulse 1.2s ease-in-out infinite; }
.lw-register-shield[data-state="done"] { background: #eefaea; border-color: #bfe6b2; }
.lw-register-shield[data-state="off"] { background: #fff4f1; border-color: #ffd2c6; }
@keyframes lw-shield-pulse { 50% { transform: scale(0.85); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .lw-register-shield[data-state="work"] .lw-register-shield-icon { animation: none; } }

/* 8.41.1: Login-Code vorschlagen und Live-Hinweis */
.lw-register-codetools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0 2px; }
.lw-register-suggest { padding: 9px 14px; border: 2px solid #3aa7f0; border-radius: 12px; background: #fff; color: #1f5f8a; font: 700 15px/1.2 inherit; cursor: pointer; touch-action: manipulation; min-height: 44px; }
.lw-register-suggest:hover { background: #eef7fe; }
.lw-register-suggest:focus-visible { outline: 3px solid #ffcf3f; outline-offset: 2px; }
.lw-register-codehint { flex: 1 1 200px; font-size: 14px; line-height: 1.35; color: #475569; overflow-wrap: anywhere; }
.lw-register-codehint[data-state="warn"] { color: #b45309; font-weight: 600; }
.lw-register-codehint[data-state="ok"] { color: #166534; font-weight: 600; }
.lw-register-code.small b#regDoneLogin { font-size: 17px; letter-spacing: 0.02em; }

/* 8.41.1: Updateverlauf – neueste zuerst, einklappbar */
.lw-uh details > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; padding: 2px 0 8px; }
.lw-uh details > summary::-webkit-details-marker { display: none; }
.lw-uh-title { font-size: 1.17em; font-weight: 800; color: #1f2d4d; }
.lw-uh-summary { color: #64748b; font-size: 13px; }
.lw-uh-toggle { margin-left: auto; font-size: 13px; font-weight: 700; color: #2563eb; }
.lw-uh-toggle::after { content: "Einklappen ▴"; }
.lw-uh details:not([open]) .lw-uh-toggle::after { content: "Anzeigen ▾"; }
.lw-uh details > summary:focus-visible { outline: 3px solid #3aa7f0; outline-offset: 2px; border-radius: 6px; }
.lw-uh-entry { display: grid; gap: 2px; }
.lw-uh-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.lw-uh-head b { min-width: 52px; font-variant-numeric: tabular-nums; }
.lw-uh-head span { color: #475569; }
.lw-uh-chip { padding: 1px 8px; border-radius: 10px; background: #dcfce7; color: #166534 !important; font-size: 12px; font-weight: 800; }
.lw-uh-note { color: #64748b; font-size: 13px; }
.lw-uh-more { margin-top: 8px; }

/* 8.41.2: eigene Rückfrage-, Hinweis- und Eingabefenster statt Browser-Fenster (public/lernwelt-dialog.js) */
.lw-dialog { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 16px; background: rgba(31, 45, 77, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.lw-dialog[hidden] { display: none; }
.lw-dialog-box { width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px 22px 18px; border-radius: 22px; background: #fffdf7; color: #1f2d4d; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35); text-align: center; font-family: var(--lw-font, Fredoka, system-ui, sans-serif); animation: lw-dialog-in 0.18s ease-out; }
.lw-dialog.admin .lw-dialog-box { background: #fff; border-radius: 16px; font-family: inherit; text-align: left; }
.lw-dialog-icon { width: 54px; height: 54px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 50%; background: #e6f4fd; font-size: 28px; }
.lw-dialog.admin .lw-dialog-icon { margin: 0 0 10px; width: 44px; height: 44px; font-size: 22px; }
.lw-dialog.danger .lw-dialog-icon { background: #fff1ec; }
.lw-dialog-title { margin: 0 0 6px; font-size: 21px; line-height: 1.25; color: #1f2d4d; }
.lw-dialog.admin .lw-dialog-title { font-size: 18px; }
.lw-dialog-text { margin: 0; font-size: 16px; line-height: 1.45; color: #334155; white-space: pre-line; overflow-wrap: anywhere; }
.lw-dialog.admin .lw-dialog-text { font-size: 15px; }
.lw-dialog-details { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #f1f5f9; color: #334155; font-size: 14px; text-align: left; white-space: pre-line; overflow-wrap: anywhere; max-height: 160px; overflow: auto; }
.lw-dialog-field { display: grid; gap: 6px; margin-top: 12px; text-align: left; }
.lw-dialog-field[hidden] { display: none; }
.lw-dialog-label { font-size: 13px; font-weight: 700; color: #475569; }
.lw-dialog-label:empty { display: none; }
.lw-dialog-input, .lw-dialog-area { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 2px solid #cfe0f0; border-radius: 12px; font: inherit; font-size: 16px; background: #fff; color: #1f2d4d; }
.lw-dialog-input:focus, .lw-dialog-area:focus { outline: none; border-color: #3aa7f0; box-shadow: 0 0 0 3px rgba(58, 167, 240, 0.25); }
.lw-dialog-input[hidden], .lw-dialog-area[hidden] { display: none; }
.lw-dialog-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap-reverse; }
.lw-dialog.admin .lw-dialog-actions { justify-content: flex-end; }
.lw-dialog-actions button { flex: 1 1 140px; max-width: 220px; min-height: 48px; padding: 10px 16px; border-radius: 14px; font: 700 16px/1.2 inherit; cursor: pointer; touch-action: manipulation; border: 2px solid transparent; }
.lw-dialog.admin .lw-dialog-actions button { flex: 0 1 auto; min-height: 40px; border-radius: 10px; font-size: 14px; }
.lw-dialog-actions button[hidden] { display: none; }
.lw-dialog-cancel { background: #eef2f7; color: #1f2d4d; border-color: #d7e0ea !important; }
.lw-dialog-cancel:hover { background: #e2e8f0; }
.lw-dialog-ok { background: #3aa7f0; color: #fff; box-shadow: 0 4px 0 #2b86c9; }
.lw-dialog.admin .lw-dialog-ok { background: #2563eb; box-shadow: none; }
.lw-dialog.danger .lw-dialog-ok { background: #e2493a; box-shadow: 0 4px 0 #b9372a; }
.lw-dialog.admin.danger .lw-dialog-ok { box-shadow: none; }
.lw-dialog-actions button:focus-visible { outline: 3px solid #ffcf3f; outline-offset: 2px; }
@keyframes lw-dialog-in { from { transform: translateY(8px) scale(0.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lw-dialog-box { animation: none; } }

/* 8.42.0: Azure-Verbrauch und Gratis-Kontingent */
.lw-su-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.lw-su-card { border: 1px solid #dbe4ee; border-left: 4px solid #22c55e; border-radius: 12px; padding: 12px 14px; background: #fff; display: grid; gap: 10px; }
.lw-su-card.status-warning { border-left-color: #f59e0b; }
.lw-su-card.status-exhausted { border-left-color: #dc2626; }
.lw-su-card.status-paid { border-left-color: #2563eb; }
.lw-su-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lw-su-card-head b { font-size: 15px; }
.lw-su-tier { margin-left: auto; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 13px; background: #fff; }
.lw-su-chip { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 800; background: #dcfce7; color: #166534; }
.lw-su-chip.warning { background: #fef3c7; color: #92400e; }
.lw-su-chip.exhausted { background: #fee2e2; color: #b91c1c; }
.lw-su-chip.paid { background: #dbeafe; color: #1e40af; }
.lw-su-metric { display: grid; gap: 5px; }
.lw-su-metric-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.lw-su-metric-head span { color: #475569; font-variant-numeric: tabular-nums; }
.lw-su-bar { position: relative; height: 10px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.lw-su-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.lw-su-proj { background: repeating-linear-gradient(135deg, #bfdbfe 0 4px, #dbeafe 4px 8px); }
.lw-su-used { background: #2563eb; }
.status-warning .lw-su-used { background: #d97706; }
.status-exhausted .lw-su-used { background: #dc2626; }
#adminSpeechUsage .lw-su-note { margin: 0; font-size: 13px; line-height: 1.4; color: #475569; }
#adminSpeechUsage .lw-su-note.warn { color: #b45309; font-weight: 600; }
#adminSpeechUsage .lw-su-cost { margin: 0; font-size: 13px; line-height: 1.4; color: #1e3a8a; font-weight: 600; }
.lw-su-chart { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px 6px; background: #fff; }
.lw-su-chart-title { font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.lw-su-plot { position: relative; height: 110px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid #cbd5e1; }
.lw-su-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; cursor: default; outline: none; }
.lw-su-col i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: #2563eb; }
.lw-su-col i.over { background: #d97706; }
.lw-su-col:hover i, .lw-su-col:focus-visible i { filter: brightness(0.85); }
.lw-su-col:focus-visible { box-shadow: inset 0 0 0 2px #93c5fd; border-radius: 4px; }
.lw-su-share { position: absolute; left: 0; right: 0; border-top: 1px dashed #94a3b8; pointer-events: none; }
.lw-su-share span { position: absolute; right: 0; bottom: 2px; font-size: 11px; color: #64748b; background: rgba(255, 255, 255, 0.85); padding: 0 4px; }
.lw-su-axis { display: flex; justify-content: space-between; font-size: 11px; color: #64748b; padding-top: 3px; }
.lw-su-cache { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 12px 0 6px; font-size: 14px; }
.lw-su-cache span { color: #475569; }
.lw-su-more { margin-top: 8px; }
.lw-su-more summary { cursor: pointer; font-weight: 700; color: #2563eb; padding: 4px 0; }
.lw-su-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.lw-su-table th, .lw-su-table td { padding: 6px 8px; border-bottom: 1px solid #e2e8f0; text-align: right; }
.lw-su-table th:first-child, .lw-su-table td:first-child { text-align: left; }
.lw-su-table th { color: #475569; font-weight: 700; }
@media (max-width: 600px) { .lw-su-slots { grid-template-columns: 1fr; } .lw-su-plot { height: 90px; gap: 1px; } }
.lw-su-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: #64748b; margin-top: 4px; }
.lw-su-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
/* 8.43.0: Ansagen-Speicher */
.lw-su-ratio { display: grid; gap: 5px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; width: 100%; }
.lw-su-ratio > span { color: #475569; font-size: 14px; }
.lw-su-ratio .lw-su-used { background: #16a34a; }
.lw-su-storeinfo { display: grid; gap: 3px; margin-top: 8px; width: 100%; }
.lw-su-storeinfo span { color: #475569; font-size: 14px; }
.lw-su-disk.warn { color: #b45309; font-weight: 600; }
.lw-su-store { margin: 10px 0 6px; display: grid; gap: 6px; }
.lw-su-store label { font-size: 14px; }
.lw-su-store label span { color: #475569; }
.lw-su-store input[type="range"] { width: 100%; max-width: 560px; accent-color: #2563eb; }
.lw-su-store-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.lw-su-store-row .section-help { flex: 1 1 320px; margin: 0; }
/* 8.44.0: Vorrat aus Restkontingent */
.lw-su-pregen { margin: 14px 0 6px; padding: 12px 14px; border: 1px solid #dbe4ee; border-left: 4px solid #2563eb; border-radius: 12px; background: #fff; }
.lw-su-pregen h4 { margin: 0 0 4px; font-size: 15px; }
.lw-su-pregen .section-help { margin: 0 0 8px; }
.lw-su-pregen-state { display: grid; gap: 4px; margin-bottom: 10px; }
.lw-su-pregen-line { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 8px; font-size: 14px; }
.lw-su-pregen-line span { color: #475569; overflow-wrap: anywhere; }
.lw-su-pregen-line.warn span { color: #b45309; }
.lw-su-pregen-line.ok span { color: #166534; }
.lw-su-pregen-actions { flex-wrap: wrap; align-items: center; }
.lw-su-pregen-actions select { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
@media (max-width: 600px) { .lw-su-pregen-line { grid-template-columns: 1fr; gap: 0; } }
