/* Plaud — dunkles, minimalistisches Mobile-Theme. Cards-Layout, flexibel. */
:root {
  --bg: #0a0c10;
  --panel: #12161d;
  --panel-2: #161b24;
  --border: #1f2630;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4fd1c5;
  --accent-dim: rgba(79, 209, 197, 0.16);
  --ok: #3fb950;
  --err: #f85149;
  --radius: 14px;
  --top-inset: env(safe-area-inset-top, 0px);
  --bottom-inset: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }

.login-screen {
  min-height: 100%; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: min(100%, 390px); display: flex; flex-direction: column; gap: 10px;
  padding: 26px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.login-card h1 { font-size: 24px; }
.login-card > p { color: var(--muted); margin-bottom: 10px; }
.login-card label { font-size: 13px; color: var(--muted); }
.login-card input {
  width: 100%; padding: 12px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; user-select: text;
}
.login-card .primary { margin-top: 8px; min-height: 44px; }
.login-status { min-height: 1.25em; color: var(--err) !important; font-size: 13px; margin: 2px 0 0 !important; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-logout { color: var(--muted); font-size: 13px; padding: 7px 8px; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: calc(var(--top-inset) + 41px);
  padding-top: var(--top-inset);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 14px;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.brand { font-weight: 700; letter-spacing: 0.02em; font-size: 17px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #333c48; transition: background 0.3s; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px rgba(63, 185, 80, 0.5); }
.dot.off { background: var(--err); }
.health-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; font-size: 14px; }
.mode-btn-center { align-self: center; margin: 10px auto 0; }

main {
  padding: calc(var(--top-inset) + 54px) 12px calc(var(--bottom-inset) + 20px) 12px;
  max-width: 1900px;
  margin: 0 auto;
}

/* ---------- Mikrofon ---------- */
.mic-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 0 8px;
}
.mic {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1c2530, #12161d);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.2s;
  overflow: visible;
}
.mic:active { transform: scale(0.96); }
.mic.recording {
  color: var(--err);
  border-color: rgba(248, 81, 73, 0.45);
  box-shadow: 0 0 0 6px rgba(248, 81, 73, 0.08);
}
.mic.busy:not(.recording) { opacity: 0.6; }
.mic-pulse {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid rgba(248, 81, 73, 0.55);
  opacity: 0;
  pointer-events: none;
}
.mic.recording .mic-pulse { animation: pulse 1.6s ease-out infinite; }
.mic.recording .mic-pulse.p2 { animation-delay: 0.8s; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.75); opacity: 0; }
}
.mic-timer {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mic-status { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- Eingabezeile ---------- */
.inputrow {
  display: flex;
  gap: 8px;
  margin: 10px 0 6px;
}
.inputrow input {
  flex: 1;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  user-select: text;
}
.inputrow .send {
  width: 46px;
  border-radius: 12px;
  background: var(--accent);
  color: #04211f;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inputrow .send:disabled { opacity: 0.4; }
/* Mode-Button: echter Button mit Status-Dot (Sekretär=teal, Hermes=lila) */
.mode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.mode-btn:active { transform: scale(0.96); }
.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(79, 209, 197, 0.55);
  flex: none;
}
.mode-btn.alt .mode-dot {
  background: #a78bfa;
  box-shadow: 0 0 6px rgba(167, 139, 250, 0.55);
}
.mode-btn.alt { border-color: rgba(167, 139, 250, 0.35); }

/* ---------- Verlauf-Head (Chat-Log) ---------- */
.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 6px;
  padding: 0 2px;
}
.output-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 20px;
  padding: 4px 12px;
}
.chip:active { color: var(--err); border-color: rgba(248, 81, 73, 0.4); }
.q-line {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  user-select: text;
  overflow-wrap: anywhere;
}

/* ---------- Antwort-Cards ---------- */
.output { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.card.error { border-color: rgba(248, 81, 73, 0.4); }
.card-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.card-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.card-time { font-size: 11px; color: var(--muted); }
.reply { font-size: 15px; line-height: 1.45; user-select: text; }
.transcript { margin-top: 8px; font-size: 12px; color: var(--muted); user-select: text; }
.acts { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.acts-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.act { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.act-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.act.error .act-badge { background: rgba(248, 81, 73, 0.16); color: var(--err); }
.act-body { flex: 1; min-width: 0; }
.act-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-detail { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.act.error .act-dot { background: var(--err); }

/* ---------- Übersicht: Cards-Grid ---------- */
.ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
  padding: 0 2px;
}
.ov-head h2 { font-size: 15px; color: var(--muted); font-weight: 600; }
.ghost { color: var(--muted); padding: 6px; border-radius: 8px; }
.ghost:hover { color: var(--text); background: var(--panel-2); }

.cards {
  /* Grid-Masonry: feste Zeilenraster (22px), Cards spannen so viele Zeilen wie nötig */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 22px;
  gap: 14px;
  align-items: start;
}

.card-ov {
  grid-row: span var(--span, 30);
  contain: layout; /* isoliert Layout, damit span korrekt gemessen wird */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  break-inside: avoid;
  margin-bottom: 12px;
  display: inline-block;
  width: 100%;
}
.card-ov-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  background: var(--panel-2);
  border: none;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.card-ov-head .chev {
  margin-left: auto;
  transition: transform 0.2s;
  color: var(--muted);
  flex: none;
}
.card-ov.open .card-ov-head .chev { transform: rotate(180deg); }
.card-ov-title { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.card-ov-count {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 8px;
  border-radius: 10px;
}
.card-ov-add {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-ov-add:active { transform: scale(0.92); }
.card-ov-clear {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #8b93a7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.card-ov-clear:active { transform: scale(0.92); opacity: 1; }
.settings-btn {
  border: none;
  background: transparent;
  color: var(--muted, #8b93a7);
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  display: flex;
  align-items: center;
  opacity: 0.8;
}
.settings-btn:active { opacity: 1; transform: rotate(30deg); }
.settings-hint { font-size: 12px; color: var(--muted, #8b93a7); margin: 10px 0 0; }
/* --- Settings: Modell-Katalog-Browser --- */
.settings-section { margin: 0 0 16px; }
.settings-head { font-weight: 600; font-size: 13px; margin: 8px 0 8px; display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.settings-current { font-weight: 400; font-size: 11px; color: var(--muted, #8b93a7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.ptab {
  border: 1px solid var(--line, #232a36); background: transparent; color: var(--muted, #8b93a7);
  border-radius: 8px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.ptab.active { background: var(--accent, #19c8a6); color: #04211f; border-color: transparent; font-weight: 600; }
#settings-model-search { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.model-list {
  max-height: 340px; overflow-y: auto; border: 1px solid var(--line, #232a36);
  border-radius: 10px; margin-bottom: 10px; font-size: 13px;
}
.model-head {
  display: grid;
  grid-template-columns: 1fr 74px 74px 56px 48px 48px 54px 54px 72px;
  gap: 6px;
  padding: 7px 10px;
  position: sticky; top: 0;
  background: var(--panel-2, #161b24);
  border-bottom: 1px solid var(--line, #232a36);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #8b93a7);
  font-weight: 700;
  cursor: default;
  z-index: 1;
}
.model-head [data-sort] { cursor: pointer; user-select: none; }
.model-head [data-sort]:active { color: var(--text); }
.mh-col { text-align: right; white-space: nowrap; }
.model-item {
  display: grid;
  grid-template-columns: 1fr 74px 74px 56px 48px 48px 54px 54px 72px;
  gap: 6px;
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--line, #1a2029);
  align-items: center;
}
.model-item:last-child { border-bottom: none; }
.model-item.selected { background: rgba(25, 200, 166, 0.14); }
.model-item:active { background: rgba(25, 200, 166, 0.22); }
.model-item .mi-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
.mi-cur {
  color: var(--accent, #19c8a6);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}
.mi-cell-main { min-width: 0; }
.model-item .mi-meta {
  font-size: 10px; color: var(--muted, #8b93a7);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mi-ctx {
  text-align: right;
  font-size: 11px;
  color: var(--muted, #8b93a7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.model-item .mi-price {
  text-align: right;
  font-size: 11px;
  color: var(--accent, #19c8a6);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}
.mi-name { font-size: 13px; font-weight: 500; }
.mi-reason {
  display: inline-block; font-size: 9px; font-weight: 700; color: #c47f17;
  border: 1px solid #c47f17; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px;
}
.mi-meta { font-size: 10.5px; color: var(--muted, #8b93a7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-price { font-size: 11px; color: var(--accent, #19c8a6); font-variant-numeric: tabular-nums; }
.flag-row { display: flex; flex-direction: column; gap: 4px; }
.settings-section label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; font-size: 12px; color: var(--muted, #8b93a7); }
.voice-mute {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}
.voice-mute[aria-pressed="true"] { opacity: 0.45; }

.card-ov-head { cursor: grab; }
.card-ov-head:active { cursor: grabbing; }
.drag-src { opacity: 0.35; }
.drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.9;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  border-radius: var(--radius);
  transform: rotate(1.5deg);
}
body.dragging-active { user-select: none; -webkit-user-select: none; }
.card-ov-body { display: none; flex-direction: column; }
.card-ov.open .card-ov-body { display: flex; }
.card-ov.open .card-ov-head { border-bottom: 1px solid var(--border); }

.entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.entry:last-child { border-bottom: none; }
.entry.tappable { cursor: pointer; }
.entry.tappable:active { background: var(--panel-2); }
.entry.done { opacity: 0.55; }
.entry.done .entry-title { text-decoration: line-through; }
.entry.overdue .entry-due { color: var(--err); }
.entry-kind { flex: none; width: 18px; height: 18px; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.entry-main { flex: 1; min-width: 0; }
.entry-title { font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; }
.entry-meta { font-size: 11px; color: var(--muted); margin-top: 1px; display: flex; gap: 4px; }
.entry-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: #04211f;
  display: flex;
  align-items: center;
  justify-content: center;
}
.entry-check.checked { background: var(--ok); border-color: var(--ok); }
.trash { flex: none; color: var(--muted); padding: 4px; }
.trash:hover { color: var(--err); }
.placeholder { padding: 12px 14px; font-size: 13px; color: var(--muted); }

/* ---------- Dialoge (Edit + Settings): zentriert, Dark-Theme, wie Rest der Seite ---------- */
dialog {
  margin: auto;              /* Fix: *{margin:0}-Reset killt sonst die UA-Zentrierung */
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #151a23, var(--panel));
  color: var(--text);
  padding: 20px;
  width: min(92vw, 420px);
  max-width: 92vw;
  max-height: min(84vh, 720px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
}
dialog::backdrop {
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
}
dialog h3 { font-size: 17px; margin-bottom: 14px; }
dialog#settings-dialog { width: min(94vw, 460px); }
dialog#settings-dialog label { display: block; font-size: 13px; color: var(--muted); }
dialog select,
dialog input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color-scheme: dark;
  user-select: text;
}
dialog .placeholder { text-align: center; padding: 18px 14px; }

/* ---------- Edit-Dialog ---------- */
dialog#edit-dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: min(92vw, 420px);
  max-width: 92vw;
}
dialog#edit-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog#edit-dialog h3 { font-size: 17px; margin-bottom: 14px; }
dialog#edit-dialog label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
dialog#edit-dialog input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color-scheme: dark;
  user-select: text;
}
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; }
.dlg-actions .danger { color: var(--err); font-weight: 600; padding: 8px 10px; }
.dlg-actions .primary { background: var(--accent); color: #04211f; font-weight: 600; padding: 9px 16px; border-radius: 10px; }
.dlg-actions .ghost { color: var(--muted); padding: 8px 10px; }

/* Repeat / Kanäle / Day-Picker */
#edit-repeat-row .repeat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}
.day-picker { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.day-picker .day {
  display: block;
  margin: 0;
}
.day-picker .day input { display: none; }
.day-picker .day span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.day-picker .day input:checked + span {
  background: var(--accent);
  color: #04211f;
  border-color: var(--accent);
}
.chan-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.chan-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 0;
}
.chan-picker input { width: auto; margin: 0; display: inline-block; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-inset) + 24px);
  transform: translateX(-50%) translateY(20px);
  background: #1d2430;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 50;
  max-width: 88vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(63, 185, 80, 0.4); }
.toast.error { border-color: rgba(248, 81, 73, 0.4); }

/* ---------- Desktop-Verfeinerung ---------- */
@media (min-width: 720px) {
  .mic-zone { padding-top: 26px; }
  .mic { width: 96px; height: 96px; }
  .entry-title { white-space: normal; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  .mic-pulse { animation: none; }
  * { transition: none !important; }
}
.task-group {
  margin: 10px 0 2px;
  padding: 3px 2px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.task-group:first-child { margin-top: 0; }

.check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.check-row:hover { background: rgba(255,255,255,0.04); }
.check-row input[type="checkbox"] { accent-color: var(--accent, #2dd4bf); }
.check-row .check-id {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

/* Day-Picker: Buttons ohne sichtbare Checkbox */
#edit-repeat-days { display: flex; flex-wrap: wrap; gap: 6px; }
#edit-repeat-days label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  background: var(--panel-2);
  transition: all 0.12s ease;
}
#edit-repeat-days label:has(input:checked) {
  background: var(--accent, #2dd4bf);
  border-color: var(--accent, #2dd4bf);
  color: #04211d;
  font-weight: 700;
}
#edit-repeat-days label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Entry-Checkbox (Tasks/Einkauf: als erledigt markieren) */
.entry-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: transparent;
  transition: all 0.12s ease;
}
.entry-check.on {
  background: #22c55e;
  border-color: #22c55e;
  color: #05230f;
}
.entry-check.on::after { content: '✓'; font-weight: 900; font-size: 13px; }
.entry-check:disabled { opacity: 0.4; }

/* ---------------- Termine / Aufgaben ---------------- */
.planner-card {
  margin: 22px 0 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.planner-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.planner-card-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 3px;
}
.planner-picker input {
  max-width: 210px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
}
.planner-picker input::-webkit-calendar-picker-indicator { display: none; }
.planner-nav { display: flex; gap: 8px; flex: none; }
.planner-card-actions { display: flex; margin-top: 10px; }
.planner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.planner-head h3 { margin: 0; font-size: 15px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--panel-3, rgba(255,255,255,0.08)); }
.planner-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.planner-tabs button {
  flex: 1;
  padding: 7px 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.planner-tabs button.active {
  background: var(--accent, #2dd4bf);
  border-color: var(--accent, #2dd4bf);
  color: #04211d;
  font-weight: 700;
}
.planner-body {
  min-height: 220px;
  max-height: min(62dvh, 640px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}
.planner-body > .placeholder { margin: auto; }
.planner-btn {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.planner-btn:hover { background: var(--panel-2); }

/* ---------------- Planner: Tagweise + Monatsgrid ---------------- */
.daywise-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 100%;
  padding: 8px;
}
.day-column {
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
  min-height: 204px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  overflow: hidden;
  scroll-snap-align: center;
}
.day-column.selected {
  border-color: var(--accent, #2dd4bf);
  box-shadow: 0 0 0 1px var(--accent, #2dd4bf) inset;
}
.day-column-head {
  padding: 8px 9px 7px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.day-column.selected .day-column-head { color: var(--accent, #2dd4bf); font-weight: 700; }
.day-column-items { display: flex; flex-direction: column; gap: 2px; padding: 4px; }
.day-column-empty { padding: 14px 9px; color: var(--muted); font-size: 12px; }
.planner-body.daywise { overflow: hidden; }
.planner-body.daywise > .daywise-strip { min-height: 100%; }
.planner-body.monthwise { max-height: none; overflow: visible; }
.planner-body.slide-next > * { animation: planner-slide-next 180ms ease-out; }
.planner-body.slide-prev > * { animation: planner-slide-prev 180ms ease-out; }
@keyframes planner-slide-next { from { opacity: .35; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes planner-slide-prev { from { opacity: .35; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
.day-sep {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px 4px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, var(--panel, #0f1216) 78%, transparent);
  z-index: 2;
}
.day-sep .ds-wd { font-weight: 800; color: var(--text); }
.day-sep .ds-date { color: var(--text); }
.day-sep .ds-rel { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.75; }
.day-sep.today { color: var(--accent, #2dd4bf); }
.day-sep.today .ds-wd, .day-sep.today .ds-date { color: var(--accent, #2dd4bf); }
.day-sep.flash { animation: dayflash 1.2s ease 1; }
@keyframes dayflash { 0% { background: rgba(45, 212, 191, 0.16); } 100% { background: transparent; } }

.mgrid-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 0 2px 4px;
  font-size: 10.5px;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
}
.mgrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;              /* Kachelhöhe = verfügbare Fläche / Zeilen */
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: stretch;
}
.mcell {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 5px;
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  background: var(--panel-2);
}
.mcell.outside {
  background: var(--panel);
  opacity: 0.45;
  border-style: dashed;
}
.mcell.today {
  border-color: var(--accent, #2dd4bf);
  border-width: 1.5px;
  background: rgba(45, 212, 191, 0.07);
}
.mc-date { font-weight: 700; margin-bottom: 3px; font-size: 13px; color: var(--text); }
.mcell .mchip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.35;
  padding: 2px 5px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.mgrid .mchip .mc-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; }
.mchip .mc-title { overflow: hidden; text-overflow: ellipsis; }
.mchip.done .mc-title { text-decoration: line-through; opacity: 0.6; }
.mchip.more { color: var(--muted); font-weight: 600; }
@media (max-width: 540px) {
  .mgrid, .mgrid-weekdays { grid-template-columns: repeat(1, 1fr); }
    .mgrid-weekdays { display: none; }
  .mcell.outside { display: none; }
}

/* Planner-Add: rrule-builder + selects */
.dlg-row select, .rrule-builder select, .rrule-builder input {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.rrule-builder { display: flex; gap: 6px; flex-wrap: wrap; }
#edit-type-row, #edit-calendar-row, #edit-rrule-row, #edit-desc-row, #edit-duration-row {
  display: flex; align-items: center; gap: 10px; margin: 10px 0;
}
#edit-type-row > label, #edit-calendar-row > label, #edit-rrule-row > label,
#edit-desc-row > label, #edit-duration-row > label {
  flex: 0 0 92px;
  font-size: 12px;
  color: var(--muted);
}
#edit-type-row select, #edit-calendar-row select { flex: 1; }

/* Monat: Zellen füllen die Zellhöhe */
.mgrid 
/* ---------- Hermes Sessions ---------- */
.hs-card { padding: 12px 14px; cursor: pointer; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.hs-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.hs-row { display: flex; align-items: center; gap: 8px; }
.hs-dot { width: 8px; height: 8px; border-radius: 50%; background: #333c48; flex: 0 0 8px; }
.hs-card.active .hs-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.hs-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-info { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hs-row2 { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.hs-row2 select { flex: 0 1 190px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; font-size: 13px; }
.hs-row2 .chip { font-size: 12px; }
#hs-dialog { width: min(96vw, 760px); max-height: 88vh; }
#hs-dialog[open] { display: flex; flex-direction: column; }
.hs-transcript { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; min-height: 160px; }
.hs-turn { max-width: 92%; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.hs-turn.me { align-self: flex-end; background: var(--accent); color: #04211f; }
.hs-turn.bot { align-self: flex-start; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); }
.hs-steps { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.hs-step { font-size: 12px; color: var(--muted); }
.hs-step summary { cursor: pointer; list-style: none; }
.hs-step[open] summary { margin-bottom: 4px; }
.hs-text { white-space: pre-wrap; word-break: break-word; }
.hs-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
@media (max-width: 540px) {
  .hs-info { display: none; }
  #hs-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
}

/* ---------- Hermes Sessions: Section-Collapse + Dialog-Mic ---------- */

.hs-inputzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 2px; }
.mic-big { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.mic-big.rec { background: var(--danger, #e5484d); color: #fff; border-color: transparent; }

.mode-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.hs-manage-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 120px; max-height: 60vh; }
#hs-manage { width: min(96vw, 560px); }
.hs-model-tag { font-size: 12px; color: var(--muted); }
.hs-microw { display: flex; align-items: center; justify-content: center; gap: 12px; }

.hs-dot.live { background: var(--accent); animation: hspulse 1.1s ease-in-out infinite; }
@keyframes hspulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(48, 178, 168, 0.5); } 50% { box-shadow: 0 0 0 5px rgba(48, 178, 168, 0); } }
.hs-running { font-size: 12px; color: var(--accent); margin-right: 6px; }

.hs-think { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.hs-think summary { cursor: pointer; list-style: none; }
.hs-think-body { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--border); padding-left: 8px; }
.hs-think-line { white-space: pre-wrap; word-break: break-word; }
.hs-text .hs-code, .hs-code { background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; overflow-x: auto; font-size: 12px; margin: 6px 0; }
.hs-inline { background: rgba(0, 0, 0, 0.35); border-radius: 5px; padding: 1px 5px; font-size: 12px; }
.hs-quote { border-left: 2px solid var(--accent); margin: 4px 0; padding-left: 8px; color: var(--muted); }
.hs-text a { color: var(--accent); }
.hs-text pre { margin: 6px 0; }

.hs-model-select { max-width: 220px; font-size: 12px; padding: 5px 8px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; color-scheme: dark; }
.hs-row2 { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.hs-table { border-collapse: collapse; margin: 6px 0; font-size: 12px; width: 100%; }
.hs-table th, .hs-table td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.hs-table th { background: rgba(0, 0, 0, 0.25); }
.hs-hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* hs-model-btn + picker im Session-Overlay */
.hs-model-btn { font-size: 12px; padding: 5px 10px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-model-btn:disabled { opacity: 0.6; }
.hs-model-picker { display: flex; flex-direction: column; min-height: 0; }
.hs-model-picker input[type="search"] { width: 100%; margin-bottom: 8px; padding: 8px 10px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color-scheme: dark; }.hs-model-picker .model-head [data-sort] { cursor: pointer; user-select: none; }
.hs-model-picker .model-list { overflow-y: auto; }.hs-model-picker .model-item:hover { background: rgba(255, 255, 255, 0.04); }
.hs-model-picker .model-item.selected .mi-name { color: var(--accent); }
/* hs-model-dialog: großer Model-Picker-Popup (NUR [open]-Styles!) */
#hs-model-dialog { width: min(96vw, 860px); max-height: 88vh; }
#hs-model-dialog[open] { display: flex; flex-direction: column; }
#hs-model-dialog .planner-head { margin-bottom: 10px; }
#hs-model-picker { flex: 1; overflow: hidden; }
.mi-score { font-size: 11px; color: var(--muted); text-align: right; }
.hs-model-picker 
.hs-model-picker 

.mi-tier { font-size: 10px; padding: 2px 7px; border-radius: 8px; background: var(--panel-2, #161b24); border: 1px solid var(--line, #232a36); color: var(--muted, #8b93a7); }
.mi-tier.tier-high { color: #4ade80; border-color: rgba(74, 222, 128, .35); }
.mi-tier.tier-medium { color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.mi-tier.tier-low { color: #94a3b8; }
@media (max-width: 640px) {
  .model-head, .model-item { grid-template-columns: 1fr 58px 58px 40px 42px 42px 44px 44px 60px; }
  .mi-ctx { display: none; }
}

/* Sessions-Card: Delete pro Eintrag (v60) */
.entry-del {
  background: none; border: none; color: var(--muted, #8b93a7);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.entry-del svg { width: 15px; height: 15px; }
.entry-del:hover { color: #e5484d; background: rgba(229, 72, 77, 0.08); }


/* ================= Design-Refresh v61 =================
   Ziel: weniger "KI-Grey-Panel", mehr handgemachter, ruhiger Look.
   Regeln liegen bewusst am Dateiende und überschreiben die Basis. */

:root {
  --bg: #0b0d11;
  --panel: #13161c;
  --panel-2: #171b23;
  --border: #232a35;
  --border-soft: #1c222b;
  --text: #e8eef5;
  --muted: #93a0b0;
  --accent: #5eead4;
  --accent-dim: rgba(94, 234, 212, 0.12);
  --err: #f16a6a;
  --danger: #e5484d;
  --radius: 16px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 3px rgba(94, 234, 212, 0.14);
}

body {
  background:
    radial-gradient(1200px 500px at 50% -180px, rgba(94, 234, 212, 0.05), transparent 60%),
    var(--bg);
  font-feature-settings: "cv11", "ss01";
}

/* --- Interaktive Grundfläche: sanftere Hover, echte Focus-Ringe --- */
button { transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: none; box-shadow: var(--ring);
}

.chip {
  background: var(--panel-2);
  border-color: var(--border-soft);
  letter-spacing: .02em;
}
.chip:hover { color: var(--text); border-color: #2c3542; }

.ghost:hover { background: rgba(255, 255, 255, 0.045); }

/* --- Cards: ruhiger Kopf, Icons in Tint-Kreisen --- */
.card-ov {
  border-color: var(--border-soft);
  box-shadow: var(--shadow-1);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card-ov:hover {
  border-color: #2a323e;
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.card-ov-head { padding: 12px 14px 10px; }
.card-ov-title {
  font-weight: 650;
  letter-spacing: .01em;
}
.card-ov-head > span:first-child {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 14px;
}
.card-ov-count {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

/* --- Entries: dezente Hover-Zeile, linke Streifen bleiben CI --- */
.entry { transition: background .14s ease; border-radius: 8px; }
.entry:hover { background: rgba(255, 255, 255, 0.022); }
.entry-kind {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  flex: 0 0 auto;
}
.entry-title { font-size: 13.5px; font-weight: 550; }
.entry-meta { color: var(--muted); font-size: 11px; letter-spacing: .01em; }

/* --- DELETE-BUTTONS: einheitlicher roter Hover (sanft, mit fade + scale) --- */
.entry-del, .card-ov-clear, .hs-del, .entry-check {
  transition: color .15s ease, background .15s ease, transform .12s ease, opacity .15s ease, box-shadow .15s ease;
}
.entry-del:hover, .card-ov-clear:hover, .hs-del:hover {
  color: var(--danger);
  background: rgba(229, 72, 77, 0.10);
  transform: scale(1.06);
}
.entry-del:active, .card-ov-clear:active, .hs-del:active { transform: scale(0.94); }
.entry-del:focus-visible, .card-ov-clear:focus-visible, .hs-del:focus-visible {
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18);
}

/* --- Primäre Fläche: Mikro-Details --- */
.mic-big {
  width: 68px; height: 68px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.mic-big:hover { border-color: #2c3542; box-shadow: var(--shadow-2); }
.mic-big.rec {
  background: linear-gradient(180deg, #ef5a5f, #d93f45);
  box-shadow: 0 6px 24px -6px rgba(229, 72, 77, 0.55);
}

/* --- Dialoge: weiche Schatten statt harter Kanten --- */
dialog {
  border-color: var(--border);
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.02);
  padding: 18px;
}
dialog::backdrop { background: rgba(4, 6, 10, 0.62); backdrop-filter: blur(3px); }
.planner-head h3 { font-size: 15px; font-weight: 650; letter-spacing: .01em; }

/* --- Inputs: ruhiger, mit klarer Focus-Spur --- */
input[type="search"], input[type="text"], input[type="time"], input[type="datetime-local"], textarea, select {
  background: var(--panel-2);
  border-color: var(--border-soft);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: var(--ring);
}

/* --- Scrollbars dezent --- */
* { scrollbar-width: thin; scrollbar-color: #2a323e transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #2a323e; border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* --- Model-Picker: Kopfzeile leiser, Score-Spalten tabular --- */
.model-head { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mi-score, .mi-price, .mi-ctx { font-variant-numeric: tabular-nums; }
.mh-col:hover { color: var(--text); }
.model-item:hover { background: rgba(255, 255, 255, 0.025); }
.mi-tier { border-radius: 6px; }

/* --- Toast: gedämpfter --- */
.toast { border: 1px solid var(--border); background: var(--panel-2); box-shadow: var(--shadow-2); }
.toast.ok { border-color: rgba(63, 185, 80, 0.35); }

/* --- Edit-Dialog: Löschen-Button (danger) mit rotem Hover --- */
.danger {
  border-radius: 10px;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease;
}
.danger:hover {
  color: #fff;
  background: rgba(229, 72, 77, 0.16);
  border-color: rgba(229, 72, 77, 0.45);
}
.danger:active { transform: scale(0.98); }

/* --- Settings-Modell-Browser: eigener breiter Dialog (v61) --- */
#settings-model-dialog { width: min(96vw, 860px); max-height: 88vh; }
#settings-model-dialog[open] { display: flex; flex-direction: column; }
#settings-model-dialog .provider-tabs { margin: 10px 0 8px; }
#settings-model-dialog input[type="search"] { width: 100%; margin-bottom: 8px; }
#settings-model-dialog .model-list { flex: 1; min-height: 0; max-height: none; }
#settings-model-open { margin: 8px 0 2px; }

/* --- v64/v66: arbeitende Session — GOLDENER animierter Rahmen + Sanduhr --- */
@keyframes hsWorkPulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.00), 0 0 0 1px rgba(212,175,55,0.25); }
  50%  { box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.16), 0 0 14px 1px rgba(212,175,55,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.00), 0 0 0 1px rgba(212,175,55,0.25); }
}
.entry.hs-working {
  animation: hsWorkPulse 2s ease-in-out infinite;
  border-left: 3px solid rgba(212, 175, 55, 0.9) !important;
}
.hs-live-snippet {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(212, 175, 55, 0.95);
  font-variant-numeric: tabular-nums;
}
.hs-live-status {
  font-size: 11.5px;
  color: var(--accent, #26a69a);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

/* --- v72: Sprachausgabe-Toggle im Verlauf-Header (neben Verlauf leeren) --- */
.output-head .head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.output-head .voice-mute {
  position: static;
  width: 30px;
  height: 30px;
  font-size: 14px;
  opacity: 1;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a7f4b; /* grün = Sprachausgabe an */
  background: color-mix(in srgb, #1a7f4b 10%, transparent);
  border: 1px solid color-mix(in srgb, #1a7f4b 35%, transparent);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.output-head .voice-mute:hover { transform: scale(1.06); }
.output-head .voice-mute.muted {
  color: #b3261e; /* rot = stumm */
  background: color-mix(in srgb, #b3261e 10%, transparent);
  border-color: color-mix(in srgb, #b3261e 35%, transparent);
  opacity: 0.95;
}

/* Responsive controls and predictable content sizing. */
:root { color-scheme: dark; }
[hidden] { display: none !important; }
body { user-select: auto; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .5; }
input, select, textarea { min-width: 0; max-width: 100%; }
.inputrow input { min-width: 0; font-size: 16px; }
.inputrow .send { flex: 0 0 46px; }
main { max-width: 1500px; }
.output-head, .head-actions, .planner-head, .dlg-actions { flex-wrap: wrap; gap: 8px; }
.planner-head h3 { min-width: 0; overflow-wrap: anywhere; }
.audio-output { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; background: var(--panel); }
.audio-output span { flex: 1 1 180px; font-size: 13px; color: var(--muted); }
.audio-output audio { width: min(100%, 350px); height: 40px; }
.reply, .transcript, .act-title, .act-detail, .hs-text { overflow-wrap: anywhere; user-select: text; }
.card-ov { min-width: 0; margin-bottom: 0; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card-ov-head { flex-wrap: wrap; padding: 10px; gap: 6px; }
.card-ov-title { min-width: 0; overflow-wrap: anywhere; }
.card-ov-add, .card-ov-clear, .planner-btn, .entry-check, .trash, .settings-btn, .voice-mute { min-width: 36px; min-height: 36px; }
.entry-title { white-space: normal; overflow-wrap: anywhere; }
.entry-meta { flex-wrap: wrap; }
dialog { overflow: auto; overscroll-behavior: contain; max-height: calc(100dvh - 32px); }
dialog input:not([type=checkbox]), dialog select { font-size: 16px; }
.rrule-builder { flex-wrap: wrap; }
.hs-transcript, .model-list, .hs-model-picker { min-height: 0; }
.hs-code { max-width: 100%; overflow-x: auto; }
.hs-table { display: block; max-width: 100%; overflow-x: auto; }
.toast { max-width: min(92vw, 600px); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  main { padding-left: 10px; padding-right: 10px; }
  dialog { padding: 16px; }
  .planner-head { align-items: center; }
  #hs-dialog .planner-head h3 { flex-basis: 100%; margin-bottom: 0; }
  #hs-dialog { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .dlg-actions button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 650px) {
  .cards { grid-auto-rows: auto; gap: 14px; }
  .card-ov { grid-row: auto; }
}
