:root {
  --bg:        #06080a;
  --bg-grad:   #080b0a;
  --panel:     #0a0e0c;
  --panel-2:   #0e1410;
  --line:      #1c3a28;
  --line-soft: #142a1d;
  --text:      #c8f5d6;
  --ink:       #e3fff0;
  --muted:     #7fb89a;
  --dim:       #5d8f76;
  --accent:    #2bff86;   /* phosphor green */
  --accent-dim:#0c2a1a;
  --amber:     #ffb454;
  --warn:      #ffb454;
  --red:       #ff5f56;
  --blue:      #57d9ff;
  --new:       #2bff86;
  --added:     #57d9ff;
  --reduced:   #ffb454;
  --sold:      #ff5f56;
  --mono:  "IBM Plex Mono", ui-monospace, "Courier New", monospace;
  --pixel: "DotGothic16", "IBM Plex Mono", monospace;
  --tiny:  "Silkscreen", "IBM Plex Mono", monospace;
  --sans:  var(--mono);
  --serif: var(--pixel);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  letter-spacing: 0.01em;
  text-shadow: 0 0 1px rgba(43,255,134,0.07);
}
::selection { background: var(--accent); color: var(--bg); text-shadow:none; }

/* ---- CRT overlay: scanlines + vignette + faint flicker ---- */
.crt { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
.crt::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom,
     rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px,
     rgba(0,0,0,0.16) 3px, rgba(0,0,0,0) 4px);
  mix-blend-mode: multiply; opacity: 0.55;
  animation: crtflicker 8s steps(60) infinite;
}
.crt::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 58%, rgba(0,0,0,0.55) 100%);
}
@keyframes crtflicker { 0%,100% { opacity:0.55; } 50% { opacity:0.48; } }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--accent); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 22px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ---- Header ---- */
header { border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand .prompt { color: var(--accent); font-size: 18px; animation: blink 1.1s steps(1) infinite; }
.brand .mark { font-family: var(--pixel); font-size: 24px; letter-spacing: 0.06em; color: var(--text); }
.brand .mark b { color: var(--accent); font-weight: 400; }
.brand .tag { font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--muted); }
nav { display: flex; gap: 6px; margin-left: auto; font-family: var(--mono); font-size: 14px; flex-wrap: wrap; }
nav a { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em;
  padding: 5px 9px; border: 1px solid transparent; transition: .08s; }
nav a:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); text-shadow:none; }

main { padding: 34px 0 70px; }

/* ---- Hero / search ---- */
.hero { margin-bottom: 32px; }
.hero h1 { font-family: var(--pixel); font-weight: 400; font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.12; letter-spacing: 0.01em; margin-bottom: 12px; color: var(--ink); }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero h1::after { content: "▮"; color: var(--accent); margin-left: 6px;
  animation: blink 1.1s steps(1) infinite; }
.hero p { color: var(--muted); max-width: 640px; font-size: 13px; }
@keyframes blink { 50% { opacity: 0; } }

form.search { display: flex; gap: 0; margin: 22px 0; max-width: 660px; }
form.search input {
  flex: 1; background: #04060a; border: 1px solid var(--line); border-right: none;
  color: var(--text); font-family: var(--mono); font-size: 14px; padding: 13px 15px;
  outline: none; caret-color: var(--accent);
}
form.search input::placeholder { color: var(--dim); }
form.search input:focus { border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 14px rgba(43,255,134,0.22); }
form.search button {
  background: var(--accent); color: var(--bg); border: 1px solid var(--accent);
  font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; padding: 0 22px; cursor: pointer; transition: .1s; text-shadow:none;
}
form.search button::before { content: "> "; }
form.search button:hover { background: var(--bg); color: var(--accent); }

.hint { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: 0.03em; }
.hint b { color: var(--muted); font-weight: 400; }

/* ---- Panels & tables ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 0; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.panel-head h2 { font-family: var(--pixel); font-size: 16px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.panel-head h2::before { content: "▌ "; color: var(--accent); }
.panel-head .meta { font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; }

table { width: 100%; border-collapse: collapse; }
th { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line);
  font-weight: 500; }
th.r, td.r { text-align: right; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .08s; }
tbody tr:hover { background: var(--accent-dim); }
td .issuer { font-weight: 500; color: var(--text); }
td .sub { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.accent { color: var(--accent); }

/* portfolio weight bar (blocky) */
.weight { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.weight .barwrap { width: 70px; height: 8px; background: #04060a; border: 1px solid var(--line); overflow: hidden; }
.weight .bar { height: 100%; background: var(--accent); }
.weight .val { font-family: var(--mono); font-size: 12px; min-width: 48px; text-align: right; }

/* ---- Result list ---- */
.results { list-style: none; }
.results li { border-bottom: 1px solid var(--line-soft); }
.results li:last-child { border: none; }
.results a { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; transition: background .08s; }
.results a::before { content: "› "; color: var(--dim); margin-right: 2px; }
.results a:hover { background: var(--accent-dim); }
.results a:hover::before { color: var(--accent); }
.results .name { font-weight: 500; color: var(--text); }
.results .cik { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.results .go { font-family: var(--mono); font-size: 11px; color: var(--accent); opacity: 0; transition: .12s; }
.results a:hover .go { opacity: 1; }

/* ---- Fund header / stat cards ---- */
.fund-top { margin-bottom: 26px; }
.fund-top .crumb { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.fund-top .crumb a:hover { color: var(--accent); }
.fund-top h1 { font-family: var(--pixel); font-weight: 400; font-size: 34px; letter-spacing: 0.01em; color: var(--ink); }
.fund-top .cik { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); padding: 15px 16px; }
.stat .k { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.stat .v { font-family: var(--mono); font-size: 25px; margin-top: 7px; color: var(--text); }
.stat .v.accent { color: var(--accent); }

/* quarter selector */
.quarters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.quarters a { font-family: var(--mono); font-size: 12px; padding: 6px 12px; border: 1px solid var(--line);
  color: var(--muted); transition: .08s; }
.quarters a:hover { border-color: var(--accent); color: var(--text); }
.quarters a.active { background: var(--accent); border-color: var(--accent); color: var(--bg); text-shadow:none; }

/* status pills -> bracketed terminal tags */
.pill { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; display: inline-block; background: none; padding: 0 2px; }
.pill::before { content: "["; } .pill::after { content: "]"; }
.pill.new     { color: var(--new); }
.pill.added   { color: var(--added); }
.pill.reduced { color: var(--reduced); }
.pill.sold    { color: var(--sold); }
.delta.up { color: var(--accent); }
.delta.down { color: var(--red); }

.changesummary { display: flex; gap: 14px; flex-wrap: wrap; }
.changesummary span { font-family: var(--mono); font-size: 11px; }

/* notice / disclaimer */
.notice { border: 1px solid var(--line); border-left: 3px solid var(--amber); background: var(--panel);
  padding: 13px 16px; font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.notice b { color: var(--amber); font-weight: 600; }

.empty { padding: 46px 20px; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 13px; }
.empty::before { content: "// "; color: var(--line); }

footer { border-top: 1px solid var(--line); padding: 18px 0; margin-top: 40px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.tabs a { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-color: var(--accent); }

/* ---- Sector matrix ---- */
.seclabel { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 0; display: inline-block; flex: none; image-rendering: pixelated; }
.sector-matrix td, .sector-matrix th { padding: 10px 14px; }

/* movers */
.movers { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; }
.mover { display: flex; align-items: center; gap: 10px; background: var(--panel-2);
  border: 1px solid var(--line); padding: 10px 14px; }
.mover.up { border-left: 3px solid var(--accent); }
.mover.down { border-left: 3px solid var(--red); }
.mover .s { font-weight: 500; }
.mover .d { font-family: var(--mono); font-size: 13px; }

/* stacked bar */
.stackbar { display: flex; width: 100%; height: 24px; overflow: hidden; border: 1px solid var(--line); background: #04060a; }
.stackbar .seg { height: 100%; transition: opacity .12s; image-rendering: pixelated; }
.stackbar .seg:hover { opacity: .7; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.legend .leg { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend .leg b { color: var(--text); margin-left: 2px; }

/* ---- Heat-Map ---- */
.heatscroll { overflow-x: auto; }
table.heatmap { border-collapse: separate; border-spacing: 0; }
table.heatmap th { position: sticky; top: 0; background: var(--panel-2); white-space: nowrap; font-size: 10px; }
table.heatmap th.sticky, table.heatmap td.sticky { position: sticky; left: 0; z-index: 2;
  background: var(--panel); min-width: 210px; white-space: nowrap; border-right: 1px solid var(--line); }
table.heatmap td.sticky a { font-weight: 500; }
table.heatmap td.sticky a:hover { color: var(--accent); }
table.heatmap td.sticky .sub { display: block; font-family: var(--mono); font-size: 10px; color: var(--dim); }
td.heat { text-align: center; font-size: 12px; min-width: 50px;
  border-bottom: 1px solid var(--bg); border-right: 1px solid var(--bg); transition: outline .1s; }
td.heat:hover { outline: 1px solid var(--accent); outline-offset: -1px; }

/* scale legend */
.scalebar { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; }
.scalebar .lab { font-family: var(--mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.scalebar .grad { height: 10px; width: 220px; border: 1px solid var(--line); }
.grad-seq { background: linear-gradient(90deg, rgba(43,255,134,0.06), rgba(43,255,134,0.9)); }
.grad-div { background: linear-gradient(90deg, rgba(255,95,86,0.85), #04060a 50%, rgba(43,255,134,0.85)); }

/* ---- Sector focus / flows bars + pills ---- */
.sectorbar { display:flex; flex-wrap:wrap; gap:6px; margin:16px 0 24px; align-items:center; }
.sectorbar .pill { text-decoration:none; padding:6px 11px; border:1px solid var(--line); border-radius:0;
  color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:0.06em;
  background:transparent; transition:.08s; }
.sectorbar .pill::before, .sectorbar .pill::after { content:""; }
.sectorbar .pill:hover { color:var(--accent); border-color:var(--accent); }
.sectorbar .pill.active { color:var(--bg); background:var(--accent); border-color:var(--accent);
  font-weight:600; text-shadow:none; }

.bar-wrap { position:relative; height:18px; background:#04060a; border:1px solid var(--line);
  border-radius:0; min-width:160px; overflow:hidden; }
.bar-wrap .bar { position:absolute; top:0; left:0; height:100%; opacity:.6; border-radius:0; image-rendering:pixelated; }
.bar-label { position:relative; z-index:1; font-family:var(--mono); font-size:12px;
  line-height:18px; padding-left:8px; color:var(--ink); }

.two-col { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:760px){ .two-col { grid-template-columns:1fr; } }

/* stale marker */
.badge-stale { display:inline-block; margin-left:8px; padding:0 6px; border-radius:0;
  font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--warn); border:1px solid var(--warn); vertical-align:middle; }
.stale-note { margin-top:10px; padding:8px 12px; border-left:3px solid var(--warn);
  background:rgba(255,180,84,.07); color:var(--muted); font-size:13px; }

/* pagination */
.pager { display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:13px 16px; border-top:1px solid var(--line); font-size:13px; }
.pager a { color:var(--accent); text-decoration:none; font-family:var(--mono); text-transform:uppercase; letter-spacing:.06em; }
.pager a:hover { background:var(--accent); color:var(--bg); text-shadow:none; padding:2px 6px; }
.pager .off { color:var(--line); font-family:var(--mono); text-transform:uppercase; letter-spacing:.06em; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  nav { gap: 4px; }
  th.hide, td.hide { display: none; }
  .brand .tag { display:none; }
  .wrap { padding: 0 12px; }
  /* breite Tabellen scrollen INNERHALB ihres Panels statt über den Bildschirmrand */
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  td { padding: 8px 9px; font-size: 12px; }
  th { padding: 7px 9px; }
  .stat { padding: 12px 12px; }
  .stat .v { font-size: 20px; }
  .fund-top h1 { font-size: 24px; }
}
@media (max-width: 440px) {
  .stats { grid-template-columns: 1fr; }
  nav { font-size: 11px; gap: 3px; }
  nav a { padding: 3px 6px; letter-spacing: .06em; }
  td { padding: 7px 7px; font-size: 11.5px; }
  th { padding: 6px 7px; }
  .wrap { padding: 0 10px; }
  .tmticker { font-size: 11px; }
}

/* clickable stock links in fund holdings */
.stocklink { text-decoration:none; }
.stocklink .issuer { border-bottom:1px dotted var(--dim); transition:.08s; }
.stocklink:hover .issuer { color:var(--accent); border-color:var(--accent); }

/* sector stock treemap */
.treemap { position:relative; width:100%; padding-bottom:62%; margin-top:14px;
  border:1px solid var(--line); background:var(--panel); }
.tmtile { position:absolute; overflow:hidden; text-decoration:none;
  border:1px solid rgba(0,0,0,.45); box-sizing:border-box; padding:4px 5px;
  display:flex; flex-direction:column; justify-content:flex-start; gap:1px;
  font-family:var(--mono); line-height:1.05; transition:filter .08s; }
.tmtile:hover { filter:brightness(1.25); z-index:5; outline:1px solid var(--accent); }
.tmticker { font-weight:700; font-size:12px; letter-spacing:.02em;
  white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.tmnums { font-size:10px; opacity:.92; white-space:nowrap; }
.tmpct  { font-size:10px; opacity:.85; white-space:nowrap; }
