/* =========================================================================
   NurseCraft Bedside Companion – Apple Light Glass Design System
   Adaptiert aus dem Home Assistant iPad Glass Dashboard (Light Glass Mode)
   ========================================================================= */

:root,
[data-theme="light"],
body.light-mode {
  --bg-color: #e2e8f0;
  --bg-mesh:
    radial-gradient(at 10% 10%, rgba(56, 189, 248, 0.32) 0px, transparent 52%),
    radial-gradient(at 90% 12%, rgba(251, 191, 36, 0.26) 0px, transparent 50%),
    radial-gradient(at 50% 55%, rgba(168, 85, 247, 0.16) 0px, transparent 55%),
    radial-gradient(at 80% 90%, rgba(34, 197, 94, 0.22) 0px, transparent 50%);

  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-shadow: 0 8px 28px 0 rgba(15, 23, 42, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.92);

  --tile-bg: rgba(255, 255, 255, 0.62);
  --tile-bg-hover: rgba(255, 255, 255, 0.82);
  --tile-border: rgba(15, 23, 42, 0.08);
  --tile-icon-bg: rgba(15, 23, 42, 0.07);

  --tab-active-bg: rgba(255, 255, 255, 0.92);
  --tab-active-border: rgba(15, 23, 42, 0.10);

  --text-main: #0f172a;
  --text-sub: #1e293b;
  --text-muted: #475569;
  --clock-grad: linear-gradient(180deg, #0f172a 0%, #334155 100%);

  --accent-amber: #d97706;
  --accent-blue: #0284c7;
  --accent-green: #16a34a;
  --accent-purple: #7e22ce;
  --accent-red: #dc2626;
  --accent-cyan: #0891b2;

  /* NurseCraft Variable Mappings for Compatibility */
  --pri: #0284c7;
  --pri-dark: #0369a1;
  --pri-light: rgba(2, 132, 199, 0.14);
  --pri-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  --bg: var(--bg-color);
  --sf: var(--glass-bg);
  --sf-card: var(--glass-bg);
  --fg: var(--text-main);
  --fg-heading: #0f172a;
  --mu: var(--text-muted);
  --mu-light: #64748b;
  --ln: var(--glass-border);
  --ln-light: var(--tile-bg);

  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.14);
  --success-border: rgba(22, 163, 74, 0.35);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.14);
  --warning-border: rgba(217, 119, 6, 0.35);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.14);
  --danger-border: rgba(220, 38, 38, 0.35);

  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: var(--glass-shadow);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.14), inset 0 1px 0 0 rgba(255, 255, 255, 0.95);

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-height: 64px;
}

/* =========================================================================
   RESET & AMBIENT GLASS BASE
   ========================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 16px) + 32px);
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.35s ease, color 0.25s ease;
}

input, textarea, select, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

/* Reusable Apple Glass Surface */
.glass,
.bedside-section-card,
.guidance-card,
.gauge-card,
.qr-korthagen-card,
.bedside-empty-card,
.live-topbar,
.auth-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

/* =========================================================================
   APP HEADER (APPLE GLASS FLOATING TOPBAR)
   ========================================================================= */
.bedside-header {
  position: sticky;
  top: 10px;
  z-index: 100;
  max-width: 616px;
  margin: 10px auto 4px auto;
  width: calc(100% - 24px);
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bedside-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
  min-width: 0;
}

.bedside-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.bedside-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bedside-brand-text {
  min-width: 0;
}

.bedside-brand-text h1 {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--clock-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bedside-brand-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bedside-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* iOS Pill Button in Header */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--tile-bg);
  color: var(--text-main);
  border: 1px solid var(--tile-border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sync-pill:active {
  transform: scale(0.95);
}

.sync-pill.synced {
  background: var(--tile-bg);
  color: var(--text-main);
  border-color: var(--tile-border);
}

.sync-pill.syncing {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.45);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.sync-pill.syncing .sync-dot {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.sync-dot.pulse {
  animation: pulseDot 1.6s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.65; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.65; }
}

.btn-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

.header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-header-icon:active {
  transform: scale(0.93);
  background: var(--tab-active-bg);
}

/* =========================================================================
   MAIN CONTAINER & SCREENS
   ========================================================================= */
.bedside-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 14px;
}

.screen {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Active guidance banner on top of Screen 1 */
.active-guidance-callout {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24) 0%, rgba(34, 197, 94, 0.18) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: var(--radius-lg);
  padding: 15px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.active-callout-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.active-callout-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
}

.active-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseRing 1.6s infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.active-callout-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.active-callout-sub {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.active-callout-btn {
  background: var(--tab-active-bg);
  border: 1px solid var(--tab-active-border);
  color: var(--text-main);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Section Headline Bar */
.section-headline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-headline-bar h2 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
}

/* iOS Segmented Filter Pills */
.filter-pills {
  display: flex;
  gap: 4px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  padding: 4px;
  border-radius: 13px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.filter-pill {
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: var(--tab-active-bg);
  color: var(--text-main);
  border-color: var(--tab-active-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* =========================================================================
   LARGE GUIDANCE CARDS (APPLE GLASS KACHELN)
   ========================================================================= */
.bedside-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.guidance-card {
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.guidance-card:active {
  transform: scale(0.99);
}

.guidance-card.status-geplant {
  border-color: rgba(251, 191, 36, 0.32);
}

.guidance-card.status-running {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, var(--glass-bg) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.guidance-card.status-done {
  border-color: rgba(34, 197, 94, 0.35);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 99px;
}

.status-badge.geplant {
  background: rgba(251, 191, 36, 0.16);
  color: var(--accent-amber);
  border: 1px solid rgba(251, 191, 36, 0.38);
}

.status-badge.running {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.status-badge.done {
  background: rgba(34, 197, 94, 0.16);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.38);
}

.card-time-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

.card-trainee-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}

.trainee-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--tile-icon-bg);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  border: 1px solid var(--tile-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.trainee-meta {
  display: flex;
  flex-direction: column;
}

.trainee-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.trainee-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Inner Glass Tile inside Guidance Card */
.card-topic-box {
  margin: 10px 0 14px 0;
  background: var(--tile-bg);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  border: 1px solid var(--tile-border);
}

.topic-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.method-tag {
  font-size: 0.78rem;
  color: var(--accent-blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-steps-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

/* =========================================================================
   APPLE GLASS BUTTONS
   ========================================================================= */
.btn-bedside {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 10px 16px;
  text-decoration: none;
  font-family: inherit;
}

.btn-bedside:active {
  transform: scale(0.97);
}

.btn-bedside-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-bedside-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-bedside-secondary {
  background: var(--tile-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-bedside-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* Empty State */
.bedside-empty-card {
  text-align: center;
  padding: 34px 20px;
  margin-bottom: 18px;
}

.empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.25));
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 18px auto;
  line-height: 1.45;
}

/* =========================================================================
   SCREEN 2: LIVE-BEGLEITUNG AM KRANKENBETT
   ========================================================================= */
.live-topbar {
  padding: 15px 18px;
  margin-bottom: 14px;
}

.live-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: transparent;
  border: none;
  cursor: pointer;
  margin-bottom: 8px;
  padding: 4px 0;
}

.live-header-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-trainee-topic {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

/* Diskreter Status: KEINE Stoppuhr! */
.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.38);
  padding: 6px 12px;
  border-radius: 99px;
  margin-top: 6px;
  align-self: flex-start;
}

.live-green-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseRing 1.8s infinite;
}

/* Phasen-Checkliste & Section Cards */
.bedside-section-card {
  padding: 16px;
  margin-bottom: 14px;
}

.section-card-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-sub);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Interactive Apple Glass Checklist Tiles (analog .light-tile in HA) */
.live-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.live-step-item:active {
  transform: scale(0.985);
}

.live-step-item.checked {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.22) 0%, rgba(34, 197, 94, 0.07) 100%);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 4px 18px rgba(34, 197, 94, 0.12);
}

.step-checkbox {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s ease;
  background: var(--tile-icon-bg);
}

.live-step-item.checked .step-checkbox {
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}

.step-content {
  flex: 1;
}

.step-text {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.live-step-item.checked .step-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.step-didactic-tip {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 8px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-add-step {
  margin-top: 10px;
  background: var(--tile-bg);
  border: 1px dashed var(--glass-border);
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 9px 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-step:active {
  transform: scale(0.98);
}

/* Transkription & Sprachnotiz */
.voice-notes-area {
  width: 100%;
  min-height: 110px;
  border-radius: var(--radius-md);
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 11px 13px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.voice-notes-area::placeholder {
  color: var(--text-muted);
}

.voice-notes-area:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.voice-recording-bar {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-mic-record {
  min-height: 48px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(2, 132, 199, 0.35) 100%);
  color: var(--text-main);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.btn-mic-record.recording {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45);
  animation: pulseRecording 1.5s infinite;
}

@keyframes pulseRecording {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.mic-status-active {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  text-align: center;
}

.mic-wave-indicator {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.wave-bar {
  width: 3px;
  height: 12px;
  background: var(--danger);
  border-radius: 2px;
  animation: waveMotion 1s infinite ease-in-out;
}
.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 18px; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 10px; }

@keyframes waveMotion {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.voice-security-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

/* Huge Stop Button */
.live-finish-box {
  margin-top: 20px;
  position: sticky;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 16px) + 18px);
  z-index: 90;
}

/* =========================================================================
   SCREEN 3: REFLEXION & ABSCHLUSS
   ========================================================================= */
.feedback-hero-card {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, rgba(56, 189, 248, 0.16) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(34, 197, 94, 0.45);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  text-align: center;
  margin-bottom: 16px;
}

.feedback-success-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: var(--accent-green);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.feedback-duration-badge {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--clock-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.feedback-duration-adjust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.btn-adjust-min {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-adjust-min:active {
  transform: scale(0.92);
  background: var(--tab-active-bg);
}

.www-field-group {
  margin-bottom: 14px;
}

.www-field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.www-input {
  width: 100%;
  min-height: 72px;
  border-radius: var(--radius-md);
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.www-input::placeholder {
  color: var(--text-muted);
}

.www-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.qr-korthagen-card {
  text-align: center;
  padding: 20px;
  margin-bottom: 18px;
}

.qr-mount-wrap {
  width: 184px;
  height: 184px;
  margin: 12px auto;
  padding: 10px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.qr-mount-wrap:active {
  transform: scale(0.96);
}

.qr-mount-wrap svg, .qr-mount-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 290px;
  margin: 0 auto 12px auto;
  line-height: 1.45;
}

/* =========================================================================
   SCREEN 4: 10%-ANLEITUNGSNACHWEIS & QUOTE (APPLE GLASS GAUGE)
   ========================================================================= */
.stats-trainee-selector {
  margin-bottom: 16px;
}

.stats-select-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.select-bedside {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: var(--text-main);
  font-size: 0.94rem;
  font-weight: 700;
  padding: 8px 14px;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.select-bedside option {
  background: #1e293b;
  color: #f8fafc;
}

[data-theme="light"] .select-bedside option {
  background: #ffffff;
  color: #0f172a;
}

.gauge-card {
  padding: 22px 18px;
  text-align: center;
  margin-bottom: 16px;
}

.gauge-percentage {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 0.98;
  background: var(--clock-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.gauge-target-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
}

.gauge-progress-bar {
  width: 100%;
  height: 16px;
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #22c55e 100%);
  border-radius: 99px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}

.gauge-metrics-row > div {
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.metric-item-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.metric-item-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-sub);
  margin-top: 2px;
}

/* History Card List */
.history-entry-item {
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.hist-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hist-date {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hist-duration-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
}

.hist-topic {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

/* =========================================================================
   BOTTOM TAB BAR NAVIGATION (APPLE GLASS FLOATING DOCK)
   ========================================================================= */
.bedside-bottom-nav {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 616px;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 5px;
  box-shadow: var(--glass-shadow);
}

.nav-tabs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 56px;
}

.nav-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.nav-tab-btn.active {
  background: var(--tab-active-bg);
  color: var(--text-main);
  border-color: var(--tab-active-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.nav-tab-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-tab-btn.active svg {
  stroke: var(--accent-blue);
}

.live-pulse-badge {
  position: absolute;
  top: 6px;
  right: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: none;
  animation: pulseDot 1.4s infinite;
}

.live-pulse-badge.active {
  display: block;
}

/* =========================================================================
   MODALS (APPLE GLASS SHEETS)
   ========================================================================= */
.bedside-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 20, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.bedside-modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.bedside-modal-sheet {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border-top: 1px solid var(--glass-border);
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 20px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 16px));
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-modal {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Form Groups in Modal */
.modal-form-group {
  margin-bottom: 16px;
}

.modal-form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.modal-input {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  padding: 8px 14px;
  outline: none;
}

.modal-input::placeholder {
  color: var(--text-muted);
}

.modal-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* Quick Topic Chips */
.quick-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-btn {
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: 99px;
  padding: 6px 11px;
  font-size: 0.78rem;
  color: var(--text-sub);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.chip-btn:active {
  background: var(--tab-active-bg);
  color: var(--accent-blue);
  border-color: rgba(56, 189, 248, 0.45);
}

/* Toast Message */
.bedside-toast {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 16px) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  text-align: center;
  max-width: 90%;
}

.bedside-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================================================
   AUTH OVERLAY (APPLE GLASS LOGIN SCREEN)
   ========================================================================= */
.bedside-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background-color: var(--bg-color);
  background-image: var(--bg-mesh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.auth-card {
  padding: 32px 24px;
  width: 100%;
  max-width: 410px;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.auth-logo-wrap {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 auto 16px auto;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.28);
  background: #ffffff;
}

.auth-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--clock-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 22px;
}

.auth-field-group {
  margin-bottom: 16px;
  text-align: left;
}

.auth-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.auth-error-msg {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-top: 10px;
  text-align: left;
  line-height: 1.4;
}

.auth-footer-note {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

/* Account Details Modal */
.account-info-card {
  text-align: center;
  padding: 12px 0;
}

.account-avatar-large {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-blue);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
  overflow: hidden;
  padding: 0;
}

.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-name-large {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.account-email-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.account-meta-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
  text-align: left;
}

.account-meta-box {
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: 14px;
  padding: 11px 13px;
}

/* ============================================================
   DESKTOP IN-APP ANSICHT & ZURÜCK-LEISTE (SCREEN 5)
   ============================================================ */
.desktop-return-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
}

.btn-back-to-bedside {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(2, 132, 199, 0.35);
  background: linear-gradient(135deg, #0284c7, #059669);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-back-to-bedside:active {
  transform: scale(0.96);
}

.btn-desktop-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-desktop-fullscreen:active {
  transform: scale(0.96);
}

.desktop-iframe-card {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  height: calc(100vh - 245px);
  min-height: 460px;
}

.desktop-portal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #ffffff;
}

