/**
 * IOTA Life Forms — Panel-Inhalte (Layout, Formulare, Tabellen)
 */

/* ── Panel-Kopf ── */
.panel-head {
  margin-bottom: 1.15rem;
}

.panel-head__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.panel-head__lead {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 52rem;
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Card-Varianten ── */
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.card-head .card-title {
  margin: 0;
}

.card-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.card--nested {
  margin-top: 1rem;
  background: var(--bg-primary);
  border-color: var(--border);
  box-shadow: none;
}

.card--danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.04);
}

.card--accent {
  border-color: rgba(56, 189, 248, 0.22);
}

.card--full {
  grid-column: 1 / -1;
}

.card--compact {
  padding: 0.85rem 1rem;
}

.card-lead {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
}

.card-lead:last-child {
  margin-bottom: 0;
}

.card-lead code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ── Toolbar & Formulare ── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.toolbar--tight {
  margin-bottom: 0.5rem;
}

.toolbar--spaced {
  margin-top: 0.75rem;
}

.toolbar__grow {
  flex: 1 1 12rem;
  min-width: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.form-field label.meta {
  margin: 0;
  font-size: 0.75rem;
}

.form-field--sm {
  flex: 0 0 auto;
}

.form-field--grow {
  flex: 1 1 10rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.65rem 0.85rem;
  align-items: end;
}

.input-grow {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.input-sm {
  width: 5.5rem;
}

.input-md {
  min-width: 9rem;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

.checkbox-field input {
  accent-color: var(--accent);
}

/* ── Charts ── */
.chart-panel {
  position: relative;
}

.chart-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-primary);
}

.chart-wrap canvas.chart-canvas {
  height: auto;
}

.chart-wrap--tall canvas.chart-canvas {
  min-height: 220px;
}

.chart-wrap--xl canvas.chart-canvas {
  min-height: 280px;
}

.chart-caption {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.chart-tooltip {
  display: none;
  position: fixed;
  z-index: 40;
  padding: 0.35rem 0.55rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.chart-center {
  display: block;
  margin: 0 auto;
}

/* ── Insight / Alerts ── */
.insight-box {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius);
  background: rgba(56, 189, 248, 0.06);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.alert-box {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.alert-box--warn {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
}

.alert-box--info {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--muted);
}

/* ── Live-Panel ── */
.live-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.live-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.live-metric-row strong {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.live-grid-secondary {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .live-grid-secondary {
    grid-template-columns: 1.2fr 1fr;
  }
}

.wm-placeholder {
  font-size: 0.75rem;
  color: var(--muted);
}

.mini-fill--wake {
  background: linear-gradient(90deg, var(--green), #6ee7b7) !important;
}

/* ── MIA ── */
.mia-score-line {
  text-align: center;
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.mia-score-line strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.mia-message {
  margin: 0;
  line-height: 1.55;
  color: var(--text-secondary);
}

.mia-constitution {
  white-space: pre-wrap;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Record / Replay ── */
.rec-status {
  margin-left: auto;
  font-size: 0.8125rem;
}

.playback-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.playback-scrub {
  width: 100%;
  margin: 0.5rem 0;
}

.playback-readout {
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary);
  overflow-x: auto;
}

.playback-stats {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Genetik ── */
.dna-line {
  margin: 0.35rem 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
}

.info-box {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.data-table th,
.data-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.status-text--warn {
  color: var(--amber);
}

.inline-link {
  color: var(--cyan);
  text-decoration: underline;
  cursor: pointer;
}

.neat-settings-msg {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Stammbaum ── */
.tree-viewport {
  overflow: auto;
  min-height: 280px;
  padding: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Umgebung ── */
.env-canvas-wrap canvas#envCanvas {
  display: block;
  width: 100%;
  height: 320px;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--habitat-bg, var(--chart-bg));
  border: 1px solid var(--border);
}

.btn-segment {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-segment .ilf-btn {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
}

.btn-segment .ilf-btn:last-child {
  border-right: none;
}

.event-log {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--muted);
  max-height: 140px;
  overflow-y: auto;
}

.env-stats-row {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ── Delegation ── */
.delegation-card {
  max-width: 42rem;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.link-btn--market {
  border-color: rgba(167, 139, 250, 0.35) !important;
  background: rgba(167, 139, 250, 0.1) !important;
  color: #e9d5ff !important;
}

/* ── Social ── */
.social-summary-card .card-lead {
  margin: 0;
}

/* ── Modal ── */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.modal-actions {
  margin-top: 0.85rem;
}

/* ── Grid-Erweiterungen ── */
.grid-3 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-analysis {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1100px) {
  .grid-analysis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Chem-Liste (verfeinert) ── */
.chem-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.chem-row {
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

.chem-row:last-child {
  border-bottom: none;
}

.chem-bar {
  height: 6px;
  background: var(--bg-primary);
}

.chem-fill {
  box-shadow: none;
}

/* ── Log-Liste ── */
.log-list {
  font-size: 0.75rem;
  line-height: 1.45;
}

.log-item {
  border-left-width: 2px;
  background: var(--bg-subtle);
}

/* ── Warnings ── */
.warnings-live h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.warnings-live ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ── Compare (JS-generiert) ── */
.compare-toolbar {
  align-items: flex-end;
}

.compare-result {
  margin-top: 0.85rem;
}

/* ── Timeline (JS) ── */
.timeline-summary .card-title {
  margin-bottom: 0.35rem;
}

.timeline-expert {
  margin-top: 0.85rem;
}

.timeline-expert-list {
  margin: 0.65rem 0 0 1rem;
  padding: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* ── NEAT root padding fix ── */
.neat-panel-root {
  padding: 0;
}
