/* Mein RUDI – Uebersicht */

.uebersicht-page {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px 14px;
  -webkit-overflow-scrolling: touch;
}

.ub-section { margin-bottom: 22px; }
.ub-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 10px 2px;
}
.ub-section-head h2 {
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .6px;
  margin: 0;
}
.ub-section-meta { font-size: 11px; color: var(--text-tertiary); }

/* ===== REMINDER-LISTE ===== */
.rem-list { display: flex; flex-direction: column; gap: 8px; }
.rem-list .loading, .rem-list .empty {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 22px; text-align: center;
  color: var(--text-secondary); font-size: 13px;
}
.rem-list .empty-icon { font-size: 28px; opacity: .35; margin-bottom: 6px; display: block; }

.rem-item {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 11px 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
  position: relative;
}
.rem-item:hover { background: var(--card-hover-bg); border-color: var(--accent); }
.rem-item:active { transform: scale(.98); }
.rem-item.overdue { border-left: 3px solid #ff3b30; }
.rem-item.faellig { border-left: 3px solid var(--accent); }
.rem-item.zukunft { border-left: 3px solid rgba(0,0,0,0); }
.rem-item.erledigt { opacity: .55; }
.rem-item.erledigt .rem-titel { text-decoration: line-through; }

.rem-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.rem-titel { font-weight: 600; color: var(--text-primary); font-size: 14px; line-height: 1.3; flex: 1; }
.rem-badge {
  flex: 0 0 auto;
  font-size: 10px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}
.rem-badge.overdue { background: rgba(255,59,48,.14); color: #ff3b30; }
.rem-badge.faellig { background: rgba(4,179,214,.14); color: var(--accent); }
.rem-badge.zukunft { background: var(--badge-bg); color: var(--text-secondary); }
.rem-badge.erledigt { background: rgba(52,199,89,.14); color: #34c759; }
[data-theme="dark"] .rem-badge.overdue { background: rgba(255,59,48,.22); }
[data-theme="dark"] .rem-badge.faellig { background: rgba(4,179,214,.22); }
[data-theme="dark"] .rem-badge.erledigt { background: rgba(52,199,89,.22); }

.rem-body-preview { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin: 5px 0 0; }
.rem-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.rem-meta .dot { opacity: .35; }

/* ===== AUTO-ANALYSEN (Mail-Watch-Ergebnisse) ===== */
.wn-list { display: flex; flex-direction: column; gap: 8px; }
.wn-list .loading, .wn-list .empty {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 22px; text-align: center;
  color: var(--text-secondary); font-size: 13px;
}
.wn-item {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 11px 13px;
  cursor: pointer; position: relative;
  transition: background .15s, border-color .15s;
  border-left: 3px solid var(--accent);
}
.wn-item:hover { background: var(--card-hover-bg); border-color: var(--accent); }
.wn-item.gelesen { opacity: .65; border-left-color: rgba(0,0,0,.08); }
[data-theme="dark"] .wn-item.gelesen { border-left-color: rgba(255,255,255,.08); }
.wn-item.error { border-left-color: #ff3b30; }
.wn-head {
  display: flex; align-items: flex-start; gap: 10px; justify-content: space-between;
}
.wn-watch { font-size: 10px; text-transform: uppercase; color: var(--accent); letter-spacing: .5px; font-weight: 700; margin-bottom: 3px; }
.wn-subject { font-weight: 600; font-size: 14px; color: var(--text-primary); line-height: 1.3; }
.wn-preview { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; margin-top: 5px; white-space: pre-wrap; }
.wn-preview.clip { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wn-meta-row { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.wn-badge-neu {
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 7px; border-radius: 6px; text-transform: uppercase;
}

/* Detail-Modal */
.wn-body { margin: 10px 0 14px; max-height: 60vh; overflow-y: auto; }
.wn-meta-modal { font-size: 12px; color: var(--text-tertiary); margin-bottom: 10px; line-height: 1.5; }
.wn-text { font-size: 14px; line-height: 1.55; color: var(--text-primary); }
.wn-text table { margin: 10px 0; }

/* ===== KACHEL-GRID (auf Uebersicht: zwei Spalten statt Scroll) ===== */
.cards-wrap-v2 { flex: 0 0 auto; }
.cards-v2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cards-v2 .card {
  width: auto; flex: none;
  min-height: 86px;
  padding: 11px 13px;
}

/* ===== BOTTOM-NAV ===== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--nav-bg);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-top: 1px solid var(--nav-border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 50;
}

.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px 4px 8px;
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 10px; font-weight: 500; letter-spacing: .2px;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
  min-height: 50px;
}
.bn-item svg { display: block; }
.bn-item.active, .bn-item:hover { color: var(--accent); }
.bn-item.active { font-weight: 600; }

/* App-Layout mit Bottom-Nav (position:fixed):
 * Bottom-Nav  ≈ 56px + safe-area
 * Input-Bar   ≈ 64px (sitzt UEBER der Bottom-Nav)
 * → Chat braucht padding-bottom = Nav + Input + Safe-Area, sonst wird Text verdeckt.
 * Andere Seiten ohne Input-Bar reicht Nav-Hoehe.
 */
.app.has-bottomnav .uebersicht-page,
.app.has-bottomnav .ideen-page,
.app.has-bottomnav .settings-content { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

.app.has-bottomnav .chat-area { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }

/* Chat-Seite: Input-Bar sitzt ueber der Bottom-Nav */
.app.has-bottomnav .input-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom));
  z-index: 49;
  max-width: 900px;
  margin: 0 auto;
}

/* ===== REMINDER-MODAL ===== */
/* Verwendet die modal-Styles aus ideen.css, plus rm-spezifisch */
.rm-body { margin: 10px 0 14px; }
.rm-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.rm-pill {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase;
  background: var(--badge-bg); color: var(--text-secondary);
}
.rm-pill.overdue { background: rgba(255,59,48,.14); color: #ff3b30; }
.rm-pill.faellig { background: rgba(4,179,214,.14); color: var(--accent); }
.rm-pill.erledigt { background: rgba(52,199,89,.14); color: #34c759; }
.rm-time { font-size: 12px; color: var(--text-tertiary); }
.rm-text { font-size: 14px; line-height: 1.5; color: var(--text-primary); white-space: pre-wrap; margin: 0 0 10px; }
.rm-source {
  background: var(--badge-bg); border-radius: 10px; padding: 10px 12px;
  margin-top: 12px;
}
.rm-source-label { font-size: 10px; text-transform: uppercase; color: var(--text-tertiary); letter-spacing: .5px; margin-bottom: 4px; }
.rm-source-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.rm-source-link:hover { text-decoration: underline; }

.rm-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap;
}
.rm-actions .btn-danger { margin-right: auto; }

/* Modal-Basis – uebernommen aus ideen.css falls nicht global */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; padding: 14px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 18px 18px 14px 14px; max-width: 520px; width: 100%;
  padding: 16px; max-height: 88vh; overflow-y: auto;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  animation: slideUp .2s ease;
  margin-bottom: env(safe-area-inset-bottom);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.btn-primary { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 9px 18px; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 14px; }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--input-border); border-radius: 10px; padding: 9px 18px; font-weight: 500; cursor: pointer; font-family: inherit; font-size: 14px; }
.btn-danger { background: transparent; color: #ff3b30; border: 1px solid rgba(255,59,48,.3); border-radius: 10px; padding: 9px 14px; font-weight: 500; cursor: pointer; font-family: inherit; font-size: 13px; }

@media (max-width: 600px) {
  .cards-v2 { grid-template-columns: 1fr; }
  .uebersicht-page { padding: 10px 12px 12px; }
}

/* ===== VOICE-MODUS-OVERLAY ===== */
.voice-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(4,179,214,0.12) 0%, rgba(4,179,214,0.02) 50%, rgba(0,0,0,0.85) 100%);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
  animation: fadeIn .25s ease;
}
.voice-overlay.show { display: flex; }
.voice-content {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  max-width: 480px; width: 100%;
}
.voice-pulse {
  position: relative; width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.voice-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: voicePulse 2.4s cubic-bezier(.4,0,.2,1) infinite;
}
.voice-ring:nth-child(2) { animation-delay: 0.8s; }
.voice-ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes voicePulse {
  0% { transform: scale(0.6); opacity: 0; }
  20% { opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
.voice-core {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 8px 32px rgba(4,179,214,0.4), 0 0 0 8px rgba(4,179,214,0.15);
  transition: transform .15s, box-shadow .15s;
}
.voice-core.speaking {
  background: linear-gradient(135deg, #34c759, #2cb04b);
  box-shadow: 0 8px 32px rgba(52,199,89,0.4), 0 0 0 8px rgba(52,199,89,0.15);
}
.voice-core.muted {
  background: linear-gradient(135deg, #8e8e93, #636366);
  box-shadow: none;
  transform: scale(0.9);
}
.voice-core.thinking {
  background: linear-gradient(135deg, #ff9500, #ff7a00);
  animation: thinkingPulse 1s ease-in-out infinite;
}
@keyframes thinkingPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.voice-status {
  font-size: 18px; font-weight: 600; color: rgba(255,255,255,0.92);
  text-align: center; letter-spacing: -0.2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  min-height: 24px;
}
.voice-transcript {
  font-size: 15px; color: rgba(255,255,255,0.78);
  text-align: center; line-height: 1.4;
  min-height: 48px; max-height: 96px; overflow-y: auto;
  padding: 0 16px; max-width: 100%;
  font-style: italic;
}
.voice-actions {
  display: flex; gap: 16px; margin-top: 8px;
}
.voice-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.voice-btn:hover { background: rgba(255,255,255,0.22); }
.voice-btn:active { transform: scale(0.92); }
.voice-btn-mute.active { background: rgba(255,59,48,0.5); border-color: rgba(255,59,48,0.7); }
.voice-btn-close { background: rgba(255,59,48,0.2); border-color: rgba(255,59,48,0.4); }
.voice-btn-close:hover { background: rgba(255,59,48,0.35); }
.voice-hint {
  font-size: 12px; color: rgba(255,255,255,0.55);
  text-align: center; max-width: 320px;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Analysen-Buttons */
.wn-show-all, .wn-mark-all {
  text-align: center; padding: 10px; color: var(--accent, #04b3d6);
  cursor: pointer; font-size: 13px; border-top: 1px solid var(--border-color, #e5e5ea);
}
.wn-show-all:hover, .wn-mark-all:hover { opacity: 0.7; }
.wn-mark-all { color: var(--text-secondary, #8e8e93); }
