:root {
  --bg: #0b1220;
  --panel: #132c44;
  --border: #0e1822;
  --text: #e0e6ed;
  --muted: #9aa6b2;
  --accent: #a4bbd4;
}

* {
  box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    font-family: Arial, sans-serif;
    margin: 16px;
    background: linear-gradient(
        to bottom,
        #dddddd -20%,
        var(--bg) 130%
    );
    color: var(--text);
    font-size: 14px;
}


/* ===== Titel ===== */

.app-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
}

/* ===== GRID ===== */

.sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 16px;
}

.section {
  grid-column: span 2;
}

.section.half {
  grid-column: span 1;
}

.section.full {
  grid-column: span 2;
}

/* ===== SECTION CARD ===== */

.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 20px;
}

.section h2 {
  margin: 0;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent);
}

/* Collapse Pfeil */

.section h2::after {
  content: "▼";
  font-size: 12px;
  transition: transform 0.2s ease;
}

.section.collapsed h2::after {
  transform: rotate(-90deg);
}

.section.collapsed > :not(h2) {
  display: none;
}

/* ===== ACTIONS ===== */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.controls button {
  background: #1e293b;
  color: var(--text);
  border: 1px solid #334155;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.controls button:hover {
  border-color: var(--accent);
}

.controls input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--text);
  width: 220px;
}

/* ===== TEXTAREAS ===== */

textarea {
  width: 100%;
  min-height: 200px;
  margin-top: 12px;
  background: #0b1220;
  color: var(--text);
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* Ausgabe / Log: nur wenige Zeilen */
#log {
  min-height: 60px;
  max-height: 150px;
  resize: vertical;
}

/* ===== PANEL (alte Struktur wiederhergestellt) ===== */

.panel {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.panel label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ===== TREE VIEW (JS-kompatibel) ===== */

#result-tree {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

#result-tree details {
  margin-left: 14px;
}

#result-tree summary {
  cursor: pointer;
  user-select: none;
  color: #93c5fd;
}

#result-tree .tree-leaf {
  margin-left: 18px;
  white-space: pre-wrap;
}

/* ===== SNAPSHOT TABLE ===== */

#snapshot-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.2;
}

#snapshot-table th,
#snapshot-table td {
  padding: 4px 8px;
  text-align: left;
}

#snapshot-table th {
  background: #1e293b;
  color: var(--accent);
  font-weight: bold;
  border-bottom: 1px solid #334155;
}

#snapshot-table td {
  border: none;
}

#snapshot-table tbody tr:nth-child(even) {
  background: #0f172a;
}

#snapshot-table tbody tr:hover {
  background: #1e293b;
}

/* ===== SNAPSHOT PICTURES ===== */

#snapshot-info-picture {
  margin-top: 10px;
}