/* JAMES Control Center — Apple × JARVIS */
:root {
  --bg-void: #020408;
  --bg-deep: #060d15;
  --bg-panel: rgba(0, 0, 0, 0.40);
  --cyan-primary: #00d4ff;
  --cyan-glow: #00f5ff;
  --cyan-dim: #004d66;
  --green-online: #00ff88;
  --amber: #ffaa00;
  --red-alert: #ff3355;
  --text: #e8f0f5;
  --text-dim: #4a6070;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-active: rgba(0, 212, 255, 0.35);
}

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

html, body {
  background: var(--bg-void);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(0, 80, 130, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, rgba(0, 50, 90, 0.12) 0%, transparent 60%),
    var(--bg-void);
  position: relative;
}

/* Hexagon-Gitter-Background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 52'><polygon fill='none' stroke='%2300d4ff' stroke-width='0.5' points='30,1 58,15.5 58,38.5 30,52 2,38.5 2,15.5'/></svg>");
  background-size: 60px 52px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

/* Scan-Line */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--cyan-glow) 50%, transparent 100%);
  height: 3px;
  opacity: 0.01;
  pointer-events: none;
  animation: scanline 6s linear infinite;
  z-index: 1;
}
@keyframes scanline {
  0% { top: -3px; }
  100% { top: 100vh; }
}

#root { position: relative; z-index: 2; }

/* === Boot-Sequenz === */
.boot {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.1em;
  transition: opacity 0.6s ease-out;
}
.boot.fading { opacity: 0; pointer-events: none; }
.boot-title {
  font-size: 1.4em;
  color: var(--cyan-primary);
  text-shadow: 0 0 12px var(--cyan-glow);
  margin-bottom: 2em;
  animation: pulse 1.5s ease-in-out infinite;
}
.boot-scanline {
  width: 60vw;
  height: 1px;
  background: var(--cyan-primary);
  box-shadow: 0 0 14px var(--cyan-glow);
  animation: scanlineH 2.5s ease-in-out;
  margin-bottom: 2em;
}
@keyframes scanlineH {
  0% { transform: translateX(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}
.boot-panels {
  display: flex;
  gap: 1.5em;
  margin-bottom: 2em;
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-dim);
  font-size: 0.85em;
}
.boot-panel {
  border: 1px solid var(--cyan-dim);
  padding: 0.6em 1em;
  opacity: 0;
  animation: blink-in 0.3s forwards;
}
.boot-panel:nth-child(1) { animation-delay: 0.4s; }
.boot-panel:nth-child(2) { animation-delay: 0.7s; }
.boot-panel:nth-child(3) { animation-delay: 1.0s; }
.boot-panel:nth-child(4) { animation-delay: 1.3s; }
.boot-panel.ok { color: var(--green-online); border-color: var(--green-online); }
@keyframes blink-in {
  0% { opacity: 0; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}
.boot-greeting {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1em;
  color: var(--text);
  margin-top: 1em;
  min-height: 2.4em;
  text-align: center;
}
.boot-greeting .cursor::after {
  content: "█";
  animation: blink 0.8s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse {
  0%, 100% { text-shadow: 0 0 12px var(--cyan-glow); }
  50% { text-shadow: 0 0 28px var(--cyan-glow), 0 0 40px var(--cyan-primary); }
}

/* === App-Shell === */
.app {
  padding: 1.2em;
  max-width: 1700px;
  margin: 0 auto;
  opacity: 0;
  animation: fadein 0.7s 0.2s forwards;
}
@keyframes fadein { to { opacity: 1; } }

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.08em;
}
.header h1 {
  font-size: 1.4em;
  color: var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-dim);
}
.header h1 .accent { color: var(--green-online); }
.clock {
  font-family: 'Share Tech Mono', monospace;
  text-align: right;
}
.clock .time {
  font-size: 1.6em;
  color: var(--cyan-glow);
  text-shadow: 0 0 8px var(--cyan-dim);
  letter-spacing: 0.05em;
}
.clock .date {
  font-size: 0.85em;
  color: var(--text-dim);
}

/* Apple-Glass Panel */
.panel {
  position: relative;
  background: var(--bg-panel);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1em 1.1em;
  margin-bottom: 1em;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid rgba(0, 212, 255, 0.25);
}
.panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-radius: 3px 0 0 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; border-radius: 0 0 3px 0; }
.panel h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.12em;
  margin-bottom: 0.8em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 0.5em;
  text-transform: uppercase;
}

/* Layout: 3-Spalten (Desktop) */
.grid-main {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 1em;
  align-items: start;
}

/* Status-Reihe */
.status-row { display: flex; flex-direction: column; gap: 0.6em; font-family: 'Share Tech Mono', monospace; font-size: 0.9em; }
.status-row .row { display: flex; justify-content: space-between; align-items: center; }
.status-row .row .lbl { color: var(--text-dim); }
.status-row .row .val { color: var(--text); }
.dot {
  display: inline-block;
  width: 0.7em; height: 0.7em;
  border-radius: 50%;
  margin-right: 0.4em;
  vertical-align: middle;
}
.dot.green { background: var(--green-online); box-shadow: 0 0 8px var(--green-online); }
.dot.amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.red   { background: var(--red-alert); box-shadow: 0 0 8px var(--red-alert); }
.dot.cyan  { background: var(--cyan-glow); box-shadow: 0 0 8px var(--cyan-glow); }
.dot.dim   { background: var(--text-dim); }

/* === Reaktor-Kern === */
.reactor-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1em 0;
}
.reactor {
  position: relative;
  width: 240px; height: 240px;
  margin: 1em auto;
}
.ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--cyan-primary);
  border-radius: 50%;
}
.ring.outer  { border-color: var(--cyan-dim); animation: spin 20s linear infinite; border-top-color: var(--cyan-primary); border-right-color: transparent; }
.ring.middle { inset: 22px; animation: spin-rev 12s linear infinite; border-color: var(--cyan-dim); border-left-color: var(--cyan-glow); border-bottom-color: transparent; }
.ring.inner  { inset: 50px; border-color: var(--cyan-glow); animation: pulse-ring 2.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 18px var(--cyan-glow), inset 0 0 18px var(--cyan-glow); transform: scale(1); }
  50%      { box-shadow: 0 0 38px var(--cyan-glow), inset 0 0 28px var(--cyan-glow); transform: scale(1.04); }
}
.reactor.error .ring.inner  { border-color: var(--red-alert); animation: pulse-ring-red 1.5s ease-in-out infinite; }
.reactor.error .ring.middle { border-left-color: var(--red-alert); }
.reactor.error .ring.outer  { border-top-color: var(--red-alert); }
@keyframes pulse-ring-red {
  0%, 100% { box-shadow: 0 0 18px var(--red-alert), inset 0 0 18px var(--red-alert); transform: scale(1); }
  50%      { box-shadow: 0 0 38px var(--red-alert), inset 0 0 28px var(--red-alert); transform: scale(1.05); }
}
.reactor-core {
  position: absolute;
  inset: 50%;
  width: 60px; height: 60px;
  margin: -30px 0 0 -30px;
  background: radial-gradient(circle, var(--cyan-glow) 0%, var(--cyan-primary) 40%, var(--cyan-dim) 100%);
  border-radius: 50%;
  box-shadow: 0 0 22px var(--cyan-glow);
}
.reactor.error .reactor-core {
  background: radial-gradient(circle, #ffccd5 0%, var(--red-alert) 40%, #660014 100%);
  box-shadow: 0 0 24px var(--red-alert);
}

.greeting {
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  font-size: 1.1em;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-top: 0.5em;
}
.greeting .sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7em;
  color: var(--cyan-glow);
  margin-top: 0.5em;
  letter-spacing: 0.15em;
}

/* SYSTEM_LOG */
.log {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78em;
  max-height: 220px;
  overflow-y: auto;
}
.log .ln { padding: 0.15em 0; color: var(--text-dim); border-bottom: 1px dashed rgba(0, 77, 102, 0.3); }
.log .ln.warn  { color: var(--amber); }
.log .ln.err   { color: var(--red-alert); }
.log .ln.info  { color: var(--cyan-glow); }

/* === Tasks / Cards === */
.tasks-section {
  margin-top: 1em;
}
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 0.7em;
}
.task {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75em 0.9em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
}
.task:hover { border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.05); }
.task.expanded { border-color: var(--border-active); box-shadow: 0 0 12px rgba(0, 212, 255, 0.1); }
.task.note-done { opacity: 0.45; }
.task.note-done .note-title { text-decoration: line-through; }
.task-head {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  font-size: 0.95em;
}
.task-cb {
  width: 1.2em; height: 1.2em;
  border: 1.5px solid var(--cyan-primary);
  display: inline-block;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  margin-top: 0.1em;
}
.task-cb:hover { background: rgba(0, 245, 255, 0.15); }
.task-cb.checked { background: var(--green-online); border-color: var(--green-online); }
.task-cb.checked::after {
  content: "✓";
  position: absolute;
  inset: -2px 0 0 2px;
  color: var(--bg-void);
  font-weight: bold;
  font-size: 0.9em;
}
.task-text { flex: 1; color: var(--text); line-height: 1.35; word-break: break-word; }
.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72em;
  color: var(--text-dim);
}
.task-folder { color: var(--cyan-dim); }
.task-due { color: var(--amber); }
.task-toggle { color: var(--cyan-primary); }
.task-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s;
  opacity: 0;
  font-size: 0.85em;
  border-top: 1px solid var(--cyan-dim);
  margin-top: 0;
  padding: 0;
}
.task.expanded .task-content {
  max-height: 600px;
  overflow-y: auto;
  opacity: 1;
  margin-top: 0.7em;
  padding-top: 0.7em;
}
.task-content h1, .task-content h2, .task-content h3 { color: var(--cyan-primary); margin: 0.6em 0 0.3em; font-family: 'Orbitron', sans-serif; }
.task-content h1 { font-size: 1.1em; }
.task-content h2 { font-size: 1em; }
.task-content h3 { font-size: 0.95em; }
.task-content ul, .task-content ol { padding-left: 1.4em; }
.task-content li { margin: 0.2em 0; }
.task-content code { background: rgba(0, 77, 102, 0.3); padding: 0.1em 0.3em; border-radius: 2px; font-family: 'Share Tech Mono', monospace; }
.task-content strong { color: var(--cyan-glow); }
.task-content a { color: var(--cyan-glow); text-decoration: none; border-bottom: 1px dashed var(--cyan-dim); }

/* Apple-Sektion */
.apple-section {
  background: rgba(255, 255, 255, 0.02);
}
.apple-section .raw {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.88em;
  white-space: pre-wrap;
  max-height: 380px;
  overflow-y: auto;
  color: var(--text);
}

/* Wetter */
.weather {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85em;
}
.weather .temp { font-size: 1.4em; color: var(--amber); font-weight: bold; }

/* Priority badges */
.badge {
  display: inline-block;
  padding: 0.1em 0.4em;
  border: 1px solid;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7em;
  margin-left: 0.4em;
}
.badge.red   { border-color: var(--red-alert); color: var(--red-alert); }
.badge.amber { border-color: var(--amber); color: var(--amber); }
.badge.green { border-color: var(--green-online); color: var(--green-online); }

/* === Steuerungs-Panel === */
.ctrl-panel {
  margin-bottom: 1em;
}
.ctrl-panel h2 {
  color: rgba(255, 200, 80, 0.55);
  border-bottom-color: rgba(255, 170, 0, 0.12);
}
.ctrl-panel::before, .ctrl-panel::after {
  border-color: rgba(255, 170, 0, 0.2);
}

.ctrl-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65em;
  margin-bottom: 0.75em;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.52em 1.05em;
  background: transparent;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan-primary);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82em;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 4px;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.15s;
  position: relative;
}
.ctrl-btn:hover:not(:disabled) {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.22);
  transform: translateY(-1px);
}
.ctrl-btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.ctrl-btn.loading {
  border-color: var(--cyan-glow);
  color: var(--cyan-glow);
  animation: ctrl-pulse 0.85s ease-in-out infinite;
}
@keyframes ctrl-pulse {
  0%, 100% { box-shadow: 0 0 5px var(--cyan-glow); }
  50%       { box-shadow: 0 0 18px var(--cyan-glow), 0 0 32px rgba(0,245,255,0.28); }
}

.ctrl-btn.success {
  border-color: var(--green-online);
  color: var(--green-online);
  box-shadow: 0 0 9px rgba(0, 255, 136, 0.3);
}
.ctrl-btn.error {
  border-color: var(--red-alert);
  color: var(--red-alert);
  box-shadow: 0 0 9px rgba(255, 51, 85, 0.3);
}

.ctrl-btn.restart-btn {
  border-color: var(--amber);
  color: var(--amber);
}
.ctrl-btn.restart-btn:hover:not(:disabled) {
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.28);
}
.ctrl-btn.restart-btn.loading {
  border-color: var(--amber);
  color: var(--amber);
  animation: ctrl-pulse-amber 0.85s ease-in-out infinite;
}
@keyframes ctrl-pulse-amber {
  0%, 100% { box-shadow: 0 0 5px var(--amber); }
  50%       { box-shadow: 0 0 18px var(--amber), 0 0 32px rgba(255,170,0,0.28); }
}

.ctrl-output {
  margin-top: 0.55em;
  background: rgba(0, 8, 22, 0.75);
  border: 1px solid var(--cyan-dim);
  border-left: 3px solid var(--cyan-dim);
  padding: 0.6em 0.85em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.77em;
  color: var(--text-dim);
  max-height: 110px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  transition: border-left-color 0.3s, color 0.3s;
  line-height: 1.5;
}
.ctrl-output.success { border-left-color: var(--green-online); color: var(--green-online); }
.ctrl-output.error   { border-left-color: var(--red-alert);   color: var(--red-alert); }

.ctrl-spinner {
  display: inline-block;
  width: 0.75em; height: 0.75em;
  border: 1.5px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* === Notiz-Karten === */
.note-card {
  position: relative;
}
.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5em;
}
.note-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
  flex: 1;
}
.note-actions {
  display: flex;
  gap: 0.3em;
  flex-shrink: 0;
  margin-left: 0.4em;
}
.note-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  padding: 0.1em 0.25em;
  border-radius: 4px;
  opacity: 0.3;
  transition: opacity 0.2s, transform 0.15s;
  line-height: 1;
}
.note-btn:hover { opacity: 0.75; transform: scale(1.15); }
.note-btn.fav-active  { opacity: 1; }
.note-btn.done-active { opacity: 1; }
.note-tag {
  display: inline-block;
  font-size: 0.68em;
  font-family: 'Inter', system-ui, sans-serif;
  color: rgba(0, 212, 255, 0.55);
  letter-spacing: 0.04em;
  margin-top: 0.25em;
}

/* === Kalender-Modal === */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.cal-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.cal-modal-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(12, 14, 20, 0.97);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px 18px 0 0;
  padding: 1.4em 1.5em 2em;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  max-height: 75vh;
  overflow-y: auto;
}
.cal-modal-sheet.open {
  transform: translateY(0);
}
.cal-modal-drag {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin: 0 auto 1.2em;
}
.cal-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
}
.cal-modal-date {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05em;
  color: var(--cyan-primary);
  letter-spacing: 0.05em;
}
.cal-modal-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.5);
  border-radius: 50%;
  width: 2em;
  height: 2em;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-modal-close:hover { background: rgba(255,255,255,0.14); color: var(--text); }
.cal-modal-empty {
  color: var(--text-dim);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9em;
  padding: 0.8em 0;
}
.cal-modal-event {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  padding: 0.65em 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cal-modal-event:last-child { border-bottom: none; }
.cal-event-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82em;
  color: var(--cyan-primary);
  min-width: 3.5em;
  flex-shrink: 0;
}
.cal-event-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.92em;
  color: var(--text);
}

/* === Mobile === */
@media (max-width: 768px) {
  .app { padding: 0.6em; }
  .grid-main { grid-template-columns: 1fr; }
  .reactor { width: 160px; height: 160px; }
  .ring.middle { inset: 14px; }
  .ring.inner  { inset: 32px; }
  .reactor-core { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .header h1 { font-size: 1em; }
  .clock .time { font-size: 1.2em; }
  .tasks-grid { grid-template-columns: 1fr; }
  .panel.system-log { display: none; }
  .status-chips {
    display: flex; flex-wrap: wrap; gap: 0.4em;
    font-family: 'Share Tech Mono', monospace; font-size: 0.75em;
  }
  .chip { border: 1px solid var(--cyan-dim); padding: 0.2em 0.6em; }
}

/* === Status Strip (kompakt, oben) === */
.status-strip-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2,4,8,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.status-strip {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.45em 1.2em;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78em;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.status-strip:hover { background: rgba(0,212,255,0.04); }
.status-strip .strip-sep { opacity: 0.3; }
.status-strip .strip-expand { margin-left: auto; opacity: 0.45; }
.status-strip-detail {
  padding: 0.5em 1.2em 0.7em;
  background: rgba(0,20,40,0.7);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.3em 1.5em;
}
.strip-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75em;
  color: var(--text-dim);
  padding: 0.2em 0;
}
.strip-row span:last-child { color: var(--text); }

/* === Reaktor + Chat Sektion === */
.reactor-chat-section {
  display: flex;
  justify-content: center;
  padding: 1em 1em 0;
}
.reactor-panel {
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5em;
}

/* === James Chat === */
.james-chat {
  width: 100%;
}
.james-input-row {
  display: flex;
  gap: 0.5em;
  align-items: center;
}
.james-input {
  flex: 1;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid var(--border-active);
  border-radius: 8px;
  padding: 0.7em 1em;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.james-input:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 12px rgba(0,212,255,0.25);
}
.james-input::placeholder { color: var(--text-dim); }
.james-input:disabled { opacity: 0.5; }
.james-send-btn {
  background: rgba(0,212,255,0.15);
  border: 1px solid var(--border-active);
  border-radius: 8px;
  color: var(--cyan-primary);
  font-size: 1.1em;
  padding: 0.6em 1em;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.james-send-btn:hover:not(:disabled) {
  background: rgba(0,212,255,0.3);
  box-shadow: 0 0 12px rgba(0,212,255,0.3);
}
.james-send-btn:disabled { opacity: 0.35; cursor: default; }
.james-loading {
  margin-top: 0.7em;
  color: var(--text-dim);
  font-size: 0.85em;
  font-family: 'Share Tech Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.james-answer {
  margin-top: 0.9em;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1em 1.1em;
  position: relative;
}
.james-answer-text {
  font-size: 0.9em;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}
.james-clear-btn {
  margin-top: 0.7em;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.75em;
  padding: 0.3em 0.8em;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
}
.james-clear-btn:hover { border-color: var(--cyan-dim); color: var(--cyan-primary); }

/* Verlauf löschen — kleines X rechts vom Send-Button */
.james-clear-hist-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.8em;
  padding: 0 0.55em;
  height: 36px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  transition: all 0.15s;
  flex-shrink: 0;
}
.james-clear-hist-btn:hover { border-color: #f87171; color: #f87171; }

/* Gesprächsverlauf — einzelner Q&A-Block */
.james-hist-item {
  margin-top: 0.75em;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.65em;
}
.james-hist-old {
  opacity: 0.65;
}
.james-hist-frage {
  font-size: 0.75em;
  color: var(--cyan-dim);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.03em;
  margin-bottom: 0.35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.james-hist-antwort {
  font-size: 0.82em;
  line-height: 1.6;
  color: var(--text);
  max-height: 320px;
  overflow-y: auto;
}
.james-hist-antwort p { margin: 0.25em 0; }
.james-hist-antwort h1,.james-hist-antwort h2,.james-hist-antwort h3 {
  font-size: 0.95em; color: var(--cyan-primary); margin: 0.5em 0 0.2em;
}
.james-hist-antwort table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.james-hist-antwort th,.james-hist-antwort td {
  border: 1px solid rgba(255,255,255,0.1); padding: 0.25em 0.5em; text-align: left;
}
.james-hist-antwort th { color: var(--cyan-primary); background: rgba(0,212,255,0.05); }
.james-hist-antwort code { background: rgba(255,255,255,0.08); padding: 0.1em 0.3em; border-radius: 3px; }
.james-hist-antwort hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 0.4em 0; }

/* "X ältere im Kontext" Hinweis */
.james-hist-more {
  margin-top: 0.5em;
  font-size: 0.7em;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  text-align: center;
  padding: 0.3em;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 6px;
}

/* === Entscheidungsbaum-Link === */
.tree-link-strip {
  display: flex;
  justify-content: center;
  padding: 0.8em 1em;
}
.tree-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: rgba(45, 30, 95, 0.5);
  border: 1px solid rgba(120, 80, 200, 0.4);
  border-radius: 8px;
  color: #a78bfa;
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85em;
  padding: 0.55em 1.4em;
  transition: all 0.2s;
}
.tree-link-btn:hover {
  background: rgba(45, 30, 95, 0.8);
  border-color: rgba(167, 139, 250, 0.7);
  box-shadow: 0 0 16px rgba(120, 80, 200, 0.35);
  color: #c4b5fd;
}

/* === CollapsiblePanel (System-Info unten) === */
.collapsible-panel {
  margin: 0.5em 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7em 1.2em;
  background: rgba(0,0,0,0.3);
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82em;
  color: var(--text-dim);
  user-select: none;
  transition: background 0.2s;
}
.collapsible-header:hover { background: rgba(0,212,255,0.05); color: var(--cyan-primary); }
.collapsible-body { padding: 0; }

/* === James-Tree-Link (automatisch nach IAOM-Antwort) === */
.james-tree-link {
  display: inline-block;
  margin-top: 0.6em;
  padding: 0.35em 0.9em;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 6px;
  color: #3b82f6;
  font-size: 0.82em;
  font-family: 'Share Tech Mono', monospace;
  text-decoration: none;
  transition: all 0.2s;
}
.james-tree-link:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* === Speech Toggle Button === */
.speech-btn {
  margin-left: 0.8em;
  background: transparent;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan-primary);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.speech-btn:hover {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.25);
}
.speech-btn.muted {
  border-color: var(--border-subtle);
  color: var(--text-dim);
}
.speech-btn.muted:hover {
  border-color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════ */
/* VAPI Voice Panel                                                 */
/* ═══════════════════════════════════════════════════════════════ */
#voice-panel {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 48px;
  padding: 10px 20px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}
.mic-btn, .mute-btn {
  background: #1e1e25;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 64px;
  height: 64px;
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mic-btn:hover, .mute-btn:hover {
  background: #2a2a35;
  transform: scale(1.05);
}
#voice-status {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: #888;
  min-width: 110px;
  text-align: center;
}
/* Reaktor-Core-Pulse bei Vapi-Aktivität */
.reactor-core.pulse-red {
  animation: vapiPulseRed 1.2s ease infinite;
}
.reactor-core.pulse-blue {
  animation: vapiPulseBlue 1.2s ease infinite;
}
@keyframes vapiPulseRed {
  0%, 100% { box-shadow: 0 0 20px rgba(248, 113, 113, 0.4); }
  50%       { box-shadow: 0 0 55px rgba(248, 113, 113, 0.9); }
}
@keyframes vapiPulseBlue {
  0%, 100% { box-shadow: 0 0 20px rgba(96, 165, 250, 0.4); }
  50%       { box-shadow: 0 0 55px rgba(96, 165, 250, 0.9); }
}
