/* ============================================================
   AI Command Deck — ruhiges, editoriales Dark-Dashboard.
   Warmes Schwarz, Orange NUR als Akzent (Links, aktiver Filter,
   Gauge). Kein Glow, keine Mono-Caps-Flut, flache Flächen,
   Hierarchie über Größe/Gewicht/Abstand statt Deko.
   ============================================================ */

:root {
  color-scheme: dark;

  --bg:        #0b0a08;
  --surface:   #141210;
  --surface-2: #191510;
  --line:      rgba(255, 238, 222, 0.09);
  --line-2:    rgba(255, 238, 222, 0.16);

  --ink:       #efe9df;
  --ink-2:     #b0a89b;
  --ink-3:     #7b7466;
  --ink-4:     #524c41;

  --acc:       #f07d24;          /* etwas entsättigtes Orange */
  --acc-hover: #ff8f3d;
  --acc-ink:   #1c1206;          /* Text auf Orange */
  --acc-soft:  rgba(240, 125, 36, 0.12);
  --acc-line:  rgba(240, 125, 36, 0.30);
  --live:      #4fbf7a;

  --r:   14px;
  --r-sm: 9px;
  --r-pill: 999px;

  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding:
    env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* dezente Wärme oben, sonst flach */
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 55% at 50% -15%, rgba(240,125,36,.06), transparent 60%);
}
.orb, .grid-overlay, .scanline { display: none; }

/* Fokus: sichtbar, konsistent, tastaturfreundlich */
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* ============ HUD ============ */
.hud {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  padding: 16px clamp(18px, 3vw, 40px);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hud-brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-glyph { width: 30px; height: 30px; display: grid; place-items: center; color: var(--acc); }
.brand-glyph svg { width: 30px; height: 30px; }
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-label {
  margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 650;
  letter-spacing: -.01em; color: var(--ink);
}
.brand-sub { margin: 0; font-size: 12px; color: var(--ink-3); }

.hud-stats { display: flex; align-items: center; gap: 26px; margin-left: 8px; flex: 1 1 auto; }
.stat { display: flex; align-items: baseline; gap: 7px; }
.stat-val { font-family: var(--mono); font-size: 16px; font-weight: 550; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-key { font-size: 12.5px; color: var(--ink-3); }

.hud-live { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; margin-left: auto; }
.clock { font-family: var(--mono); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.conn[data-state="live"] { color: var(--live); }
.conn[data-state="live"] .conn-dot { background: var(--live); animation: blink 2.4s ease-in-out infinite; }
.conn[data-state="connecting"] .conn-dot { background: var(--acc); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ============ Steuerleiste ============ */
.control {
  position: sticky; top: 63px; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(18px, 3vw, 40px);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 7px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; cursor: pointer; user-select: none;
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); background: transparent;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip[aria-pressed="true"] {
  color: var(--acc-ink); font-weight: 600;
  background: var(--acc); border-color: var(--acc);
}
.chip .count { font-family: var(--mono); font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }

.search { position: relative; flex: 0 0 auto; width: min(260px, 42vw); }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; padding: 9px 13px 9px 34px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: 13px; outline: none;
  transition: border-color .15s ease;
}
.search input::placeholder { color: var(--ink-3); }
.search input:hover { border-color: var(--line-2); }
.search input:focus-visible { border-color: var(--acc); outline: none; box-shadow: 0 0 0 3px var(--acc-soft); }

/* ============ Deck ============ */
.deck { padding: 26px clamp(18px, 3vw, 40px) 48px; max-width: 1500px; margin: 0 auto; }

/* ---------- Featured ---------- */
.featured { margin-bottom: 30px; }
.feat-card {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface);
}
.feat-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.feat-tagrow { display: flex; align-items: center; gap: 12px; }
.feat-kicker { font-size: 12px; font-weight: 600; color: var(--acc); letter-spacing: .01em; }
.feat-cat { font-size: 12.5px; color: var(--ink-3); }
.feat-title {
  margin: 0; font-family: var(--font-display); font-weight: 680;
  font-size: clamp(24px, 2.8vw, 38px); line-height: 1.12; letter-spacing: -.02em;
  color: var(--ink); text-wrap: balance;
}
.feat-sum, .feat-explain { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; max-width: 60ch; }
.feat-explain { color: var(--ink); }
.feat-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.feat-foot .src { color: var(--ink-2); font-weight: 550; }
.feat-foot .sep { color: var(--ink-4); }

.feat-side { flex: 0 0 auto; }
.gauge { position: relative; width: min(168px, 38vw); aspect-ratio: 1; display: grid; place-items: center; }
.gauge svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge .track { stroke: var(--line); }
.gauge .fill { stroke: var(--acc); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.gauge-num { position: absolute; text-align: center; }
.gauge-num b { font-family: var(--mono); font-size: 38px; font-weight: 500; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-num small { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-3); }

/* ---------- Stream ---------- */
.stream { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 18px 15px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
  animation: rise .45s ease both;
}
.card:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card.fresh { animation: rise .45s ease both, freshTint 1.6s ease both; }
@keyframes freshTint { 0% { border-color: var(--acc-line); } 100% { border-color: var(--line); } }

.card-top { display: flex; align-items: center; gap: 10px; }
.card-cat { font-size: 12px; color: var(--ink-3); }
.card-breaking { font-size: 11px; font-weight: 650; color: var(--acc); letter-spacing: .04em; text-transform: uppercase; }
.card-title {
  margin: 0; font-family: var(--font-display); font-weight: 620;
  font-size: 16px; line-height: 1.32; letter-spacing: -.01em; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sum { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 11px; border-top: 1px solid var(--line); }
.card-src { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.card-src .name { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; color: var(--ink-3); }
.card-time { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-chev { width: 15px; height: 15px; color: var(--ink-4); transition: transform .24s ease, color .16s ease; }
.card.open .card-chev { transform: rotate(180deg); color: var(--ink-2); }
.card.open { background: var(--surface-2); border-color: var(--line-2); }

/* Aufklappen: deutsche Erklärung + Quell-Link */
.card-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease; }
.card.open .card-reveal { grid-template-rows: 1fr; }
.card-reveal-in { overflow: hidden; min-height: 0; }
.card.open .card-reveal-in { padding-top: 2px; }
.card-explain { margin: 0 0 12px; color: var(--ink); font-size: 13px; line-height: 1.6; }
.de-flag {
  display: inline-block; margin-right: 8px; padding: 1px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .04em;
  color: var(--acc); border: 1px solid var(--acc-line); vertical-align: 1.5px;
}
.card-open, .feat-open {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 550; color: var(--acc); text-decoration: none;
  padding: 6px 0; transition: color .15s ease;
}
.card-open:hover, .feat-open:hover { color: var(--acc-hover); }
.card-open svg, .feat-open svg { width: 14px; height: 14px; }
.feat-open { margin-left: auto; }

/* ---------- Empty / Skeleton ---------- */
.empty { text-align: center; padding: 80px 20px; color: var(--ink-3); }
.empty-glyph { display: none; }
.skeleton { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.sk-card { height: 150px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); opacity: .6; animation: sk 1.4s ease-in-out infinite; }
.sk-card:nth-child(2) { animation-delay: .1s; } .sk-card:nth-child(3) { animation-delay: .2s; }
@keyframes sk { 0%, 100% { opacity: .35; } 50% { opacity: .7; } }

/* ---------- Footer ---------- */
.foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 22px clamp(18px, 3vw, 40px) 34px; margin: 0 auto; max-width: 1500px;
  font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line);
}
.foot-count { color: var(--ink-2); }
.foot-count::after { content: " Signale"; color: var(--ink-3); }
.foot b { color: var(--ink-2); font-weight: 550; }
.foot-pipe { margin-left: auto; color: var(--ink-4); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(14px); z-index: 60;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink);
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  display: inline-flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .tled { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .feat-card { grid-template-columns: 1fr; gap: 24px; }
  .feat-side { display: grid; place-items: center; }
  .gauge { width: 150px; }
}

/* ---------- Handy ---------- */
@media (max-width: 620px) {
  /* Kompakte, einzeilige Kopfzeile: Marke links, Live rechts. */
  .hud { gap: 12px; padding: 11px 16px; }
  .brand-sub, .hud-stats, .clock { display: none; }
  .hud-live { margin-left: auto; gap: 0; }
  .brand-label { font-size: 15px; }
  .brand-glyph { width: 26px; height: 26px; }
  .brand-glyph svg { width: 26px; height: 26px; }

  /* Filterleiste scrollt mit weg (mehr Platz fürs Feed), größere Tipp-Ziele. */
  .control { position: static; flex-direction: column; align-items: stretch; gap: 11px; padding: 12px 16px; }
  .chips { gap: 8px; }
  .chip { padding: 10px 15px; font-size: 13.5px; }
  .search { width: 100%; }
  .search input { padding-top: 11px; padding-bottom: 11px; }

  .deck { padding: 20px 16px 40px; }
  .stream { grid-template-columns: 1fr; gap: 12px; }
  .feat-card { padding: 22px 20px; }
  .feat-title { font-size: 22px; }
  .foot-pipe { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
