/* ================================================================ THEME VARIABLES */
:root {
  --font-sans: 'Archivo', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* DARK THEME (Default) */
  --bg-base: #030303;
  --bg-panel: #0a0a0a;
  --bg-hover: #111827;
  --text-heading: #ffffff;
  --text-main: #f3f4f6;
  --text-main-border: rgba(243, 244, 246, 0.5);
  --text-muted: #cacfd9; --color-text-secondary: #cacfd9;
  --text-dim: #6b7280;
  --border-color: #1f2937; --color-border-secondary: #1f2937;
  --border-light: #374151;

  /* AGENT COLORS also update in 3d.js */
  --agt-opt: #3b82f6;
  --agt-sym: #22c55e;
  --agt-spe: #ef4444;
  --agt-arc: #f59e0b;
  --agt-eth: #a855f7;

  /* DNA COLORS */
  --dna-pla: #5fd1a8;
  --dna-ani: #ff6f7d;
  --dna-fun: #e7b96b;
  --dna-rob: #5fa9ff;
  --dna-gli: #cfcfcf;

  /* STATUS COLORS */
  --stat-dead-bg: #1c0a0a;
  --stat-dead-border: #7f1d1d;
  --stat-dead-text: #fca5a5;
  --stat-dead-str: #f87171;
  
  /* UI ELEMENTS */
  --line: rgba(140, 164, 179, 0.3);
  --panel: rgba(255, 255, 255, 0.02);
  
  --scrollbar-track: #303030;
  --scrollbar-thumb: #bebebe;
  --scrollbar-thumb-hover: #e7e7e7;
}

[data-theme="light"] {
  --bg-base: #f4f4f5;
  --bg-panel: #f4f4f5;
  --bg-hover: #e4e4e7;
  --text-heading: #09090b;
  --text-main: #18181b;
  --text-main-border: rgba(24, 24, 27, 0.5);
  --text-muted: #52525b;  --color-text-secondary: #52525b;
  --text-dim: #71717a;
  --border-color: #d4d4d8; --color-border-secondary: #d4d4d8;
  --border-light: #e4e4e7;
  
  --stat-dead-bg: #fef2f2;
  --stat-dead-border: #fca5a5;
  --stat-dead-text: #b91c1c;
  --stat-dead-str: #dc2626;
  
  --line: rgba(64, 84, 98, 0.14);
  --panel: rgba(0, 0, 0, 0.02);
  
  --scrollbar-track: #e4e4e4;
  --scrollbar-thumb: #c1c1c1;
  --scrollbar-thumb-hover: #a1a1aa;
}

/* ================================================================= BASE */
html, body { overflow-x: hidden; width: 100%; position: relative; }
body { font-family: var(--font-mono); background: var(--bg-base); color: var(--text-main); min-height: 100vh; line-height: 1.4; transition: background 0.3s, color 0.3s; }
button, header, .tag, .rel-label, .status-name, .system-module-grid, .system-panel { font-family: var(--font-mono); }
#about, #analysis { font-family: var(--font-sans); }


/* ================================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: auto; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
  border: 2px solid var(--scrollbar-track);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ============================================================== HEADER / TOOLBAR */
.site-header, #toolbar { position: sticky; top: 0; z-index: 50; background: var(--bg-panel); border-bottom: 1px solid var(--border-color); padding: 10px 40px; display: flex; align-items: center; gap: 24px; }
#toolbar { width: 100%; padding: 6px 12px; gap: 16px;}
.site-title { font-family: var(--font-sans); font-size: 11px; letter-spacing: .14em; color: var(--text-heading); font-weight: 700; text-decoration: none; text-transform: uppercase; }
.era-tag { font-size: 0.5em; vertical-align: super; position: relative; top: 0; margin-left: 2px; opacity: 0.9; letter-spacing: .14em; color: var(--text-heading); }
.header-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.header-link, .mode-btn { font-size: 11px; color: var(--text-muted); text-decoration: none; padding: 5px 12px; border: 1px solid transparent; border-radius: 2px; transition: all .15s; cursor: pointer; background: transparent; text-transform: uppercase; }
.header-link:hover, .header-link.active, .mode-btn:hover, .mode-btn.active { color: var(--text-heading); border-color: var(--border-color); background: var(--bg-hover); }

label[for="toggleTheme"] { font-size: 11px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 4px; }
#frame-text{position:absolute; bottom:50px; left:20px; font-size:10px; color:var(--text-dim); width: calc(100% - 440px); pointer-events:none; align-items: flex-end;}
#frame-question{color:var(--text-dim); margin-top:4px;}

/* timeline-panel */

#timeline-panel{display:none; position:absolute; top:36px; left:6px; width:240px; background:var(--bg-panel); border:1px solid var(--border-color); padding:14px; pointer-events:auto; z-index:40;}
#timeline-slider { min-width: 100px;  }
#timeline-panel .close-btn { position:absolute; top:4px; right:8px; font-size:18px; cursor:pointer; color:var(--text-dim); line-height:1; padding:2px 6px; }
#timeline-panel .close-btn:hover { color:var(--text-heading); }
#tl-year{font-size:12px; font-weight:700; color:var(--text-heading); margin-bottom:4px;}
#tl-season{font-size:10px; font-weight:600; color:var(--text-dim); margin-bottom:12px;}
#tl-new-species{margin-bottom:12px; font-size:10px;}
#tl-question{color:var(--text-muted); font-style:italic; font-size:11px; border-top:1px dashed var(--border-light); padding-top:8px;}

#sb-description{font-size: 13px; color: var(--text-muted); margin-top: 6px;}
#sb-tree-container-a{padding:20px; color:var(--text-dim); font-size:10px;}

/* ========================================================== THEME TOGGLE (CLINICAL TERMINAL) */
.theme-toggle-btn { background: var(--text-muted); color: var(--bg-base); border: none; cursor: pointer; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 1px; transition: all 0.3s ease; position: relative; overflow: hidden; }
.theme-toggle-btn:hover { background: var(--text-heading); color: var(--bg-base); }
.theme-toggle-btn svg { width: 14px; height: 14px; fill: currentColor; transition: transform 0.4s ease, opacity 0.4s ease; position: absolute; }
.icon-sun { opacity: 1; transform: translateY(0) rotate(0); }
.icon-moon { opacity: 0; transform: translateY(-20px) rotate(90deg); }
html[data-theme="light"] .icon-sun { opacity: 0; transform: translateY(20px) rotate(-90deg); }
html[data-theme="light"] .icon-moon { opacity: 1; transform: translateY(0) rotate(0); }


/* ============================================================= LAYOUT (ABOUT) */
.page { max-width: 860px; margin: 0 auto; padding: clamp(24px, 5vw, 64px) clamp(12px, 4vw, 40px) clamp(60px, 8vw, 120px); }
.section { margin-bottom: 64px; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; }

h1 { font-size: 32px; font-weight: 600; line-height: 1.3; color: var(--text-heading); margin-bottom: 16px; }
h1 a { color: inherit; text-decoration: none; }
h1 a:hover, h1 a:focus, h1 a:active { color: inherit; text-decoration: none; }
h2 { font-size: 16px; font-weight: 600; color: var(--text-heading); margin-bottom: 10px; margin-top: 32px; }
h4 { font-size: 12px; font-weight: 600; color: var(--text-heading); margin-bottom: 6px; margin-top: 12px;}
p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
strong { font-weight: 600; color: var(--text-heading); }
em { font-style: italic; color: var(--text-muted); }

.lead { font-size: 16px; color: var(--text-main); margin-bottom: 24px; border-left: 2px solid var(--border-color); padding-left: 20px; }
.divider { height: 1px; background: var(--border-color); margin: 48px 0; }

.time-table { color: var(--text-muted);  width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }
.time-table td { font-size:11px; padding: 4px; border-bottom: 1px solid var(--border-light); font-family:var(--font-sans);}
.time-table td:first-child { width: 120px; vertical-align:top; font-family:var(--font-mono); }

/* ================================================================ ARCHETYPES */
.arch-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.arch-btn { padding: 6px 14px; border: 1px solid var(--border-color); background: var(--bg-panel); cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-muted); transition: all .2s; text-transform: uppercase; }
.arch-btn.on { border-color: currentColor; background: var(--bg-hover); color: var(--text-heading); }

.arch-card { display: none; border: 1px solid var(--border-color); background: var(--bg-panel); }
.arch-card.on { display: block; }
.arch-top { padding: 20px 24px 16px; border-bottom: 1px solid var(--border-color); }
.arch-num { font-size: 10px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; }
.arch-name { font-size: 24px; font-weight: 600; margin-bottom: 6px; color: var(--text-heading); }
.arch-weltbild { font-size: 13px; color: var(--text-muted); font-style: italic; margin-bottom: 6px; border-left: 2px solid var(--border-light); padding-left: 12px; }
.arch-ziel { font-size: 13px; color: var(--text-muted); line-height: 1.65; margin-top: 10px;}

.arch-body { display: grid; grid-template-columns: 1fr 1fr; }
.arch-col {  padding: clamp(12px, 2vw, 20px) clamp(12px, 3vw, 24px); border-right: 1px solid var(--border-color); }
.arch-col:last-child { border-right: none; }

.alabel { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { font-size: 9px; padding: 2px 6px; border: 1px solid currentColor; background: var(--bg-base); text-transform: uppercase; }
.attr { padding: 6px 0; border-bottom: 1px dashed var(--border-light); font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.arch-quote { font-size: 11px; line-height: 1.6; color: var(--text-main); border-left: 2px solid; padding-left: 12px; margin-top: 16px; white-space: pre-wrap; }

.prob-box { background: var(--bg-base); border: 1px solid var(--border-color); border-radius: 2px; padding: 10px 12px; margin-bottom: 10px; }
.prob-label { font-size: 10px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; }
.prob-text { font-size: 12px; color: var(--text-muted); line-height: 1.65; }

.arch-relations { padding: 12px 24px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rel-label { font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; }
.rel-chip { font-size: 9px; padding: 2px 8px; border: 1px dashed var(--border-light); color: var(--text-muted); background: transparent; cursor: pointer; transition: all .15s; text-transform: uppercase;}
.rel-chip:hover { border-style: solid; color: var(--text-heading); background: var(--bg-hover); }



/* ================================================================ Process diagram  */
*{box-sizing:border-box;margin:0;padding:0}
.wrap{font-family:var(--font-mono);padding:0}
.tabs{display:flex;gap:4px;flex-wrap:wrap}
.tab{font-family:var(--font-mono);color:var(--color-text-secondary)}
.tab.on{background:var(--color-background-secondary);color:var(--color-text-primary);border-color:var(--color-border-primary)}
.tab.current{color:#22c55e;border-color:#22c55e40}
.tab.current.on{background:#22c55e18}
.tab { padding: 6px 14px; border: 1px solid var(--color-border-secondary); background: var(--bg-panel); cursor: pointer; font-size: 11px; font-weight: 600; color: var(--text-muted); transition: all .2s; }

.ver{display:none}
.ver.on{display:block}
.meta{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-top:20px}

.meta {   display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.meta-cell{background:var(--color-background-secondary);border:0.5px solid var(--color-border-secondary);padding:10px 12px;}
.meta-label{font-size:9px;letter-spacing:.12em;color:var(--color-text-tertiary);text-transform:uppercase;margin-bottom:5px}
.meta-text{ font-family:var(--font-sans); color: var(--text-muted); font-weight: normal; font-size: 12px;}
.diagram{border:0.5px solid var(--color-border-secondary);padding:16px;display:flex;flex-direction:column;align-items:center;gap:0}
.box{border:0.5px solid var(--color-border-secondary);padding:8px 16px;font-size:10px;letter-spacing:.08em;color:var(--color-text-secondary);text-align:center;}
.box small{display:block;font-size:9px;color:var(--color-text-tertiary);letter-spacing:.04em;margin-top:2px;letter-spacing:0}
.arrow{font-size:14px;color:var(--color-text-tertiary);line-height:1;padding:2px 0}
.branch{width:100%;max-width:340px;border:0.5px solid var(--color-border-secondary);padding:10px;margin:2px 0}
.branch-title{font-size:9px;letter-spacing:.1em;margin-bottom:8px;text-transform:uppercase}
.branch-row{display:flex;align-items:center;gap:8px;margin-bottom:5px;font-size:10px}
.branch-label{color:var(--color-text-tertiary);flex:1;font-size:10px}
.branch-val{padding:2px 8px;border:0.5px solid;font-size:9px;letter-spacing:.06em;white-space:nowrap}
.tag-new{display:inline-block;font-size:8px;padding:1px 5px;background:#22c55e22;color:#22c55e;border:0.5px solid #22c55e40;letter-spacing:.05em;margin-left:4px;vertical-align:middle}
.tag-fix{display:inline-block;font-size:8px;padding:1px 5px;background:#f59e0b22;color:#f59e0b;border:0.5px solid #f59e0b40;letter-spacing:.05em;margin-left:4px;vertical-align:middle}
.tag-bug{display:inline-block;font-size:8px;padding:1px 5px;background:#ef444422;color:#ef4444;border:0.5px solid #ef444440;letter-spacing:.05em;margin-left:4px;vertical-align:middle}
.box.accent{border-color:#22c55e40;color:var(--color-text-secondary)}
.changed{border-color:#22c55e80 !important}


/* ================================================================ GRAPH (INDEX) */
#graph-container { flex: 1; position: relative; cursor: grab; display: flex; height: 100vh; overflow: hidden; background-color: var(--bg-base); }
#graph-container:active { cursor: grabbing; }
#graph { width: 100%; height: 100%; }

/* D3 Graph Overrides */
.link { stroke-opacity: 0.8; }
.link-lineage { stroke: var(--text-dim); stroke-width: 1.5px; }
.link-conflict { stroke-width: 1.5px; stroke-dasharray: 4 3; }
.node-missing rect { stroke-dasharray: 3 3; opacity: 0.5; }

/* Timeline UI Elements — immer sichtbar in Toolbar */
#timeline-wrap { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: nowrap;}
#timeline-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; min-width: 55px; }
.sys-info { font-size: 11px; color: var(--text-muted); margin-left: auto; display: flex; gap: 12px; align-items: center;}

/* Tooltip */
#tooltip { position: absolute; pointer-events: none; padding: 6px 10px; background: var(--bg-panel) !important; border: 1px solid var(--border-color) !important; color: var(--text-main) !important; font-size: 10px; opacity: 0; z-index: 100; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.tt-lin-header{font-size:11px; color:var(--text-heading); }
.tt-lin-lable{font-weight:bold; margin-top:2px; text-transform:uppercase; }

.tt-glitch{font-size:9px;margin-top:4px;}
.tt-grund{font-size:10px;color:var(--text-secondary);line-height:1.5;margin-top:4px;font-style:italic;}
.tt-aglabel{font-weight:600;font-size:10px;}

/* CONFLICT TOOLTIP */
.tt-header {font-size: 12px; font-weight: 600; color: var(--text-heading); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--border-light); }
.tt-label {font-size: 10px; color: var(--text-dim); letter-spacing: 0.08em; margin-top: 7px; padding-top: 5px; }
.tt-label.bordered { border-top: 1px dashed var(--border-light); }
.tt-text { font-size: 11px; color: var(--text-main); margin-top: 4px; }
.tt-agent-row { font-size: 10px; margin-bottom: 2px; color: var(--text-dim); }
.tt-agent-val { color: var(--text-main); font-weight: 400; margin-left: 4px; }
.tt-name { font-size: 11px; font-weight: 600; color: var(--text-heading); }
.tt-empty-msg { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

/* SIDEBAR */
#sidebar { width: 420px; background: var(--bg-panel); border-left: 1px solid var(--border-color); position: absolute; right: 0; top: 38px; bottom: 0; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.25,1,0.5,1); z-index: 20; overflow-y: auto; }
#sidebar.active { transform: translateX(0); }

.sb-header { padding: 14px 16px 10px; position: relative; border-bottom: 1px solid var(--border-color); }
.close-btn { position: absolute; top: 0px; right: 12px; cursor: pointer; color: var(--text-dim); font-size: 30px; }
#sb-name { font-size: 18px; font-weight: 700; color: var(--text-heading); line-height: 1.2; text-transform: uppercase;}
#sb-latin { font-size: 11px; color: var(--text-muted); font-style: italic; margin-bottom: 6px; }
#sb-status-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 6px; border: 1px solid currentColor; margin-bottom: 8px; }

/* SIDEBAR CONTENT */
#sb-tree-container { background: var(--bg-base); padding: 24px 0; overflow-x: auto; min-height: 80px; border-bottom: 1px solid var(--border-color); }
.meta-section { margin: 0; padding: 16px; border-bottom: 1px dashed var(--border-light); }
.meta-section-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.meta-section-title-slim { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom:3px; }
.meta-section-sub-title { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.meta-row { display: flex; font-size: 11px; align-items: flex-start; gap: 8px; margin-bottom: 6px;}
.meta-key { min-width: 120px; color: var(--text-dim); font-size: 11px; text-transform: uppercase; font-weight: 600;}
.meta-val { color: var(--text-muted); word-break: break-word; }

/* DNA Bar */
.dna-bar { height: 2px; display: flex; margin-bottom: 8px; background: var(--bg-base); }
.dna-seg { height: 100%; transition: width .4s; }
.dna-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.dna-legend-item { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.dna-sub-legend{ padding-top:10px; color: var(--text-muted); font-size: 11px;}

/* Agent Grid */
.agent-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.agent-cell { text-align: center; background: var(--bg-base); border: 1px solid var(--border-color); padding: 6px 4px; font-size: 9px; font-weight: 600; color: var(--text-dim); position: relative; cursor: default; }
.agent-vote { font-size: 14px; font-weight: 700; display: block; margin-bottom: 2px; }

/* Eco Functions & Dynamic Values */
.eco-list { display: flex; flex-wrap: wrap; gap: 5px; }
.eco-chip { font-size: 10px; padding: 2px 6px; border: 1px solid var(--border-color); background: var(--bg-base); display: flex; gap: 4px; }
.eco-chip-key { color: var(--text-dim); font-weight: 600; }
.eco-chip-val { font-weight: 700; }
.val-high   { color: var(--agt-sym); } 
.val-medium { color: var(--agt-arc); } 
.val-low    { color: var(--text-muted); } 
.val-none   { color: var(--border-light); }
.val-unknown, .val-monitoring { color: var(--agt-spe); } 

/* Dialog */
.dialog-wrap { padding: 4px 0 0; }
.dialog-turn { display: grid; grid-template-columns: 80px 1fr; gap: 10px; margin-bottom: 12px; border-left: 2px solid var(--border-light); padding-left: 8px; }
.d-agent { font-size: 10px; font-weight: 600; text-transform: uppercase; display: flex; flex-direction: column;}
.d-phase { font-size: 8px; color: var(--text-dim); letter-spacing: .05em; margin-top: 2px; font-weight: 400;}
.d-text { font-size: 10px; color: var(--text-muted);}

/* Death Box */
.death-box { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--stat-dead-border); background: var(--stat-dead-bg); border-radius: 2px; font-size: 11px; color: var(--stat-dead-text);}
.death-box strong { color: var(--stat-dead-str); display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .1em; font-weight: 700;}

/* ============================================================== GRIDS & SYSTEM MODULES */
.network-grid, .status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.network-card, .status-item, .absent-panel { border: 1px solid var(--line); background: var(--panel); padding: 16px; }
.network-card-title, .status-name { font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--text-heading); margin-bottom: 6px; text-transform: uppercase; }
.status-name { font-size: 13px; }
.status-desc { font-size: 13px; color: var(--text-muted); margin-top: 3px;}
.absent-panel { margin-top: 28px; padding: 18px; }
.system-module-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; margin-top: 18px; }
.system-panel { border: 1px solid var(--line); padding: 18px; background: var(--panel); }
.system-panel-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 14px; }
.system-flow { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.system-box { border: 1px solid var(--line); padding: 4px 8px; font-size: 12px; }
.system-box-small {font-size:9px;color:var(--text-dim);font-weight:400};
.system-arrow { text-align: center; color: var(--text-muted); line-height: 1.2; }
.system-outcome { border: 1px solid var(--line); padding: 14px; background: rgba(255,255,255,0.015); }
.system-outcome-grid { display: grid; gap: 10px; }
.system-outcome-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.system-outcome-label { font-size: 11px; }
.system-outcome-box { border: 1px solid var(--line); padding: 4px 8px; font-size: 12px; }
.system-outcome-box.glitch { border: 1px dashed rgba(168, 85, 247, 0.28); background: rgba(168, 85, 247, 0.06); }

.ch_wrapper { position: relative; display: inline-block; padding: 10px; }
/* Conflict-Tooltip: breiter für reiche Inhalte */
/*#tooltip { max-width: 340px !important; }*/
/* Status History */
.history-list { padding: 4px 0; }
.h-event { display: grid; grid-template-columns: 18px 1fr; gap: 6px; padding: 7px 0; border-bottom: 1px dashed var(--border-light); align-items: flex-start; }
.h-event:last-child { border-bottom: none; }
.h-icon { font-size: 11px; padding-top: 1px; text-align: center; flex-shrink: 0; }
.h-body { font-size: 11px; color: var(--text-muted);}
.h-desc { font-size: 10px; font-weight: 600; }
.h-reason { font-size: 10px; color: var(--text-dim); margin-top: 2px; font-weight: 400;}
.h-time { font-size: 9px; color: var(--text-dim); margin-top: 2px; }
#ch_svg-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.ch_tree-container { position: relative; z-index: 2; }
.ch_branch { display: flex; flex-direction: column; align-items: center; margin: 0 4px; }
.ch_parents-row { display: flex; flex-direction: row; justify-content: center; margin-top: 18px; }
.ch_node { border-radius: 2px; border: 1px solid transparent; display: inline-block; transition: transform .2s; cursor: pointer; }
.ch_node:hover { transform: scale(1.01); }
.ch_node img { display: block; width: 38px; height: 38px; object-fit: cover; filter: grayscale(50%); transition: filter 0.3s;}
.ch_node:hover img { filter: grayscale(0%); }
.ch_is_target img { width: 260px !important; height: auto !important; object-fit: contain; filter: grayscale(0%);}
.ch_label { display: none; }

/* ========================================================== STEALTH LINKS */
.stealth-link { text-decoration: none; color: inherit; cursor: pointer; transition: opacity 0.2s, text-shadow 0.2s; }
.stealth-link:hover { opacity: 0.8; text-shadow: 0 0 8px currentColor; }

/* ========================================================== STATUS Page */
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; height: calc(100vh - 120px); margin-top: 65px; }
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr 1fr; height: auto; } }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; height: auto; } }
.panel { background: var(--bg-panel); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 400px; max-height: 100%; }
.panel-header { background: var(--border-light); color: var(--bg-text); padding: 5px; font-weight: bold; display: flex; justify-content: space-between; }
.panel.crit .panel-header { background: var(--agt-spe); color: #fff; }
.panel-content { padding: 12px; overflow-y: auto; flex: 1; }
.trigger-item { border-left: 3px solid var(--text-dim); padding: 10px; margin-bottom: 15px; font-size: 12px; }
.trig-meta { color: var(--text-dim); font-size: 10px; margin-bottom: 5px; display: flex; justify-content: space-between; }
.trig-title { color: var(--text-main); font-weight: bold; text-transform: uppercase; margin-bottom: 5px; display: block; }
.trig-desc { color: var(--text-main); line-height: 1.3; }
.trig-impact { margin-top: 8px; font-style: italic; color: var(--text-main); opacity: 0.8; }
.mode-switch { background: var(--bg-panel); color: var(--text-main); border: 1px solid var(--text-dim); padding: 5px 10px; cursor: pointer; font-family: inherit; font-size: 11px; }
.entity-card { display: flex; gap: 12px; padding: 8px; border: 1px solid var(--line); margin-bottom: 8px; text-decoration: none; color: inherit; transition: all 0.2s; }
.entity-card:hover { background: var(--bg-base); transform: translateX(4px); }
.entity-thumb img { width: 100px; height: 100px; }
.entity-data { font-size: 10px; }
.e-name { font-size: 13px; font-weight: bold; color: var(--text-main); display: block; margin: 2px 0; }
.status-crit { color: var(--agt-spe); }
.e-id{color:var(--text-dim)}
.e-typ{}

/* ========================================================== Google translate  */
#gt_float_wrapper { position: static !important; zoom: .5; }
.gt_float_switcher .gt-selected .gt-current-lang { padding: 0 !important; color: #fff !important; font-weight: normal !important; font-size: 0.1px !important; }
.gt_float_switcher-arrow, .gt-lang-code, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf-ti6hGc { display: none !important; }
.gt-current-lang img { margin: 0 !important; }
.gt_float_switcher .gt_options a, .gt_float_switcher, .gt_options, .gt-current-lang { padding: 0 important; color: #fff !important; font-weight: normal !important; font-size: 0.1px !important; background: transparent !important; }
.system-module-grid > * { min-width: 0; }

/* ====================================================================== */
/* 2D / 3D VIEW TOGGLE                                                    */
/* ====================================================================== */
#view-toggle { position: absolute; top: 6px; left: 6px; z-index: 30; display: flex; background: var(--bg-panel); }
.vt-btn { padding: 5px 10px; border: none; background: var(--text-muted); color: var(--border-light); font-family: inherit; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; cursor: pointer; transition: all 0.2s; border-radius: 1px; min-width: 32px; }
.vt-btn:hover { color: var(--border-light); background: var(--text-heading); }
.vt-btn.active { background: var(--border-light); color: var(--text-heading); }

/* ====================================================================== */
/* 3D NETWORK CONTAINER                                                   */
/* ====================================================================== */
#vision3d-wrap { overflow: hidden; }
#network-3d canvas { outline: none; }

/* ====================================================================== */
/* ANALYSIS PAGE                                                          */
/* ====================================================================== */
#analysis main.page { max-width: 760px; margin: 0 auto; padding: 40px 24px 80px; }
.analysis-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.analysis-card { display: block; padding: 20px 24px; background: var(--bg-panel); border: 1px solid var(--border-color); text-decoration: none; color: var(--text-main); transition: border-color 0.2s, transform 0.2s; }
.analysis-card:hover { border-color: var(--text-heading); transform: translateY(-2px); }
.analysis-card-num { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-heading); text-transform: uppercase; margin-bottom: 4px; }
.analysis-card-period { font-size: 11px; color: var(--text-dim); margin-bottom: 12px; }

/* Single Report */
.analysis-single { padding-top: 20px; }
.analysis-meta { display: flex; flex-direction: column; gap: 4px; padding-bottom: 18px; }
.analysis-num { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--text-heading); text-transform: uppercase; }
.analysis-period, .analysis-date { font-size: 11px; color: var(--text-muted); }
.analysis-body { font-size: 14px; line-height: 1.75; color: var(--text-muted); }
.analysis-body h2 { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-heading); padding-top: 8px; }
.analysis-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.analysis-body p { margin: 0 0 14px; }
.analysis-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border-color); font-size: 12px; letter-spacing: 0.06em; }
.analysis-link { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.analysis-link:hover { color: var(--text-heading); }
.empty-state { font-size: 13px; color: var(--text-dim); font-style: italic; padding: 40px 0; text-align: center; }

/* Trigger-Highlight wenn via /status/{id} aufgerufen */
.trigger-highlight { outline: 1px solid var(--text-heading); outline-offset: 4px; background: var(--bg-panel); animation: trigger-pulse 1.6s ease-in-out 1; }
@keyframes trigger-pulse { 0% { outline-color: var(--text-heading); } 50% { outline-color: transparent; } 100% { outline-color: var(--text-heading); } }

/* Inline-Markup im Analysis-Body */
.analysis-body a, .about-link a{ color: var(--text-muted); text-decoration: underline; text-decoration-color: var(--text-dim); text-underline-offset: 2px; }
.analysis-body a:hover, .about-link a:hover { text-decoration-color: var(--text-heading); }
.analysis-body em { color: var(--text-muted); font-style: normal; font-size: 0.92em; letter-spacing: 0.02em; }
.analysis-body .agent-opt { color: var(--agt-opt); font-weight: 600; }
.analysis-body .agent-sym { color: var(--agt-sym); font-weight: 600; }
.analysis-body .agent-spe { color: var(--agt-spe); font-weight: 600; }
.analysis-body .agent-arc { color: var(--agt-arc); font-weight: 600; }
.analysis-body .agent-eth { color: var(--agt-eth); font-weight: 600; }
.trig-clear { font-size: 10px; color: var(--text-dim); text-decoration: none; letter-spacing: 0.05em; }
.trig-clear:hover { color: var(--text-heading); }
.analysis-card-snippet { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.analysis-lead { padding-left: 8px; border-left: 2px solid var(--text-dim);}


/* ====================================================================== */
/* MOBILE                                                                 */
/* ====================================================================== */
@media (max-width: 980px) {
  .network-grid, .status-grid { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 900px) {
  .system-module-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 640px) {
  .network-card, .status-item, .absent-panel { padding: 14px; }
  .network-card-title, .status-name { font-size: 10px; }
  .status-desc { font-size: 14px;}
}
@media (max-width: 560px) {
  .system-outcome-row { grid-template-columns: 1fr; gap: 6px; }
}


@media (max-width: 920px) {
#toolbar { flex-wrap: wrap; padding: 8px 10px; gap: 8px; row-gap: 6px; min-height: auto; height: auto; }
#analysis main.page { padding: 24px 14px 60px; }
.analysis-card { padding: 16px; }
.analysis-body { font-size: 13px; }
.analysis-nav { flex-direction: column; gap: 16px; align-items: stretch; text-align: center; }
}

@media (max-width: 480px) {
#about .about, #analysis .analysis{ display:none; }
#toolbar .site-title { font-size: 14px; flex: 0 1 auto; margin-right: auto; order: 0; }
#toolbar .header-link { font-size: 11px; padding: 4px 8px; }
#toolbar .mode-btn { font-size: 10px; padding: 5px 10px; letter-spacing: 0.04em; white-space: nowrap; flex: 0 0 auto; }
#toolbar .sys-info { gap: 8px; font-size: 10px; margin-left: 0; flex: 0 0 auto; flex-wrap: nowrap; }
#toolbar .sys-info .stealth-link { font-size: 10px; white-space: nowrap; }
#toolbar .theme-toggle-btn { padding: 4px; }
.gtranslate_wrapper { font-size: 11px; }
#btn-lineage { margin-left: 0; }
#timeline-wrap { flex: 1 1 0; min-width: 80px; max-width: none; display: flex; align-items: center; gap: 8px; padding: 0; margin-top: 0; border-top: none; }
#timeline-slider { flex: 1; min-width: 0; }
#timeline-label { font-size: 10px; min-width: 50px; }
#graph-container { top: 0; }
#frame-text { font-size: 10px; padding: 6px 10px; }
#frame-question { font-size: 11px; }
#sidebar { width: 100vw; max-width: 100vw; top: 0; height: 100vh; height: 100dvh; bottom: auto; z-index: 100; border-left: none; overscroll-behavior: contain; }
.sb-header { padding-top: max(16px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.close-btn { font-size: 28px !important; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; top: 6px !important; right: 6px !important; }
.sb-content { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
body.sidebar-open { overflow: hidden; position: fixed; width: 100%; }
body.sidebar-open #toolbar, body.sidebar-open #graph-container { visibility: hidden; }
}

/* Noch kleiner: sehr schmale Geräte */
@media (max-width: 380px) {
#toolbar { padding: 6px 8px; gap: 6px; }
#toolbar .site-title { font-size: 13px; }
#toolbar .mode-btn { font-size: 9px; padding: 4px 8px; }
#toolbar .sys-info { font-size: 9px; gap: 6px; }
}
