/* ZIBADIS Design System — Dark Gold — world-signals harmonized */
* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%,  rgba(201,162,61,.15), transparent 28%),
    radial-gradient(circle at 80% 0%,  rgba(180,122,50,.10), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(44,101,255,.07), transparent 32%),
    linear-gradient(180deg, #050607 0%, #07090b 52%, #050607 100%);
  color: #f4eee0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .025;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.shell { width: min(1220px, calc(100% - 32px)); margin: 32px auto; }

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.095);
  background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  padding: 28px;
  border-radius: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.48);
  backdrop-filter: blur(20px);
}

.eyebrow {
  color: #c9a23d;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
}

h1 {
  margin: 6px 0;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 300;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f4eee0;
}

h2 { margin: 0 0 4px; font-weight: 400; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; color: #c9a23d; }
h3 { margin: 0 0 8px; font-weight: 400; font-size: .9rem; color: #f4eee0; letter-spacing: .06em; }

.sub, .panel-head p { color: #9c9588; max-width: 720px; margin: 0; font-size: .9rem; }

button {
  border: 1px solid rgba(201,162,61,.36);
  background: linear-gradient(135deg, rgba(201,162,61,.22), rgba(180,122,50,.18));
  color: #f4eee0;
  padding: 10px 16px;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: border-color .2s, background .2s;
}

button:hover {
  border-color: rgba(234,210,139,.5);
  background: linear-gradient(135deg, rgba(201,162,61,.32), rgba(180,122,50,.28));
}

button:disabled { opacity: .55; cursor: wait; }

select, input {
  border: 1px solid rgba(255,255,255,.095);
  background: rgba(255,255,255,.04);
  color: #f4eee0;
  padding: 10px 12px;
  border-radius: 0;
  font: inherit;
  font-size: .85rem;
  outline: none;
  transition: border-color .2s;
}

select:focus, input:focus { border-color: rgba(201,162,61,.5); }
option { background: #0b0b0a; color: #f4eee0; }

.toolbar { display: flex; gap: 10px; margin: 18px 0; }
.toolbar input { flex: 1; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat, .card, .panel {
  border: 1px solid rgba(255,255,255,.095);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
  border-radius: 0;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.32);
}

.panel { margin: 16px 0; }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.stat b {
  display: block;
  font-size: 30px;
  font-weight: 250;
  margin-top: 6px;
  color: #ead28b;
}

.status { min-height: 24px; color: #c9a23d; margin: 12px 0; font-size: .82rem; letter-spacing: .06em; }

.data-health {
  margin: 10px 0;
  padding: 10px 14px;
  border: 1px solid rgba(114,165,255,.22);
  background: rgba(114,165,255,.06);
  color: #a9c4ff;
  font-size: .76rem;
  letter-spacing: .055em;
}
.data-health.is-live { border-color: rgba(100,214,154,.24); background: rgba(100,214,154,.055); color: #83dba9; }
.data-health.is-unavailable { border-color: rgba(224,122,106,.35); background: rgba(224,122,106,.075); color: #ef9b8d; }

.refresh-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(201,162,61,.18);
  background: rgba(201,162,61,.055);
  color: #9c9588;
  font-size: .76rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.refresh-policy span {
  border-right: 1px solid rgba(255,255,255,.08);
  padding-right: 10px;
}

.refresh-policy span:last-child { border-right: 0; }
.refresh-policy b { color: #ead28b; font-weight: 500; }
.refresh-state { color: #c9a23d; }

.timeline-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.025);
}

.range-controls, .gain-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-controls button { padding: 7px 10px; font-size: .66rem; }
.range-label { color: #9c9588; font-size: .72rem; letter-spacing: .04em; margin-left: 4px; }
.gain-control { color: #9c9588; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.gain-control input[type="range"] { width: 130px; padding: 0; border: 0; accent-color: #c9a23d; }
.gain-control output { min-width: 28px; color: #ead28b; font-variant-numeric: tabular-nums; }

.timeline-wrap { position: relative; }

#timeline {
  width: 100%;
  display: block;
  border-radius: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    rgba(5,6,7,.8);
  background-size: 100% 25%, 8.333% 100%;
}

#timeline.is-dragging { cursor: grabbing; }

.timeline-tooltip {
  position: absolute;
  z-index: 4;
  max-width: min(420px, calc(100% - 16px));
  padding: 8px 10px;
  border: 1px solid rgba(234,210,139,.34);
  background: rgba(5,6,7,.96);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  color: #f4eee0;
  font-size: .72rem;
  letter-spacing: .035em;
  line-height: 1.45;
  pointer-events: none;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #9c9588;
  font-size: 11px;
  letter-spacing: .06em;
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 0;
  margin-right: 5px;
}

.red    { background: #e07a6a; }
.yellow { background: #e6b75a; }
.green  { background: #64d69a; }

.signals { display: grid; gap: 12px; max-height: 520px; overflow: auto; }

.card .meta {
  color: #6f6a61;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.card h3 { margin: 0 0 6px; font-size: 15px; }
.card p { color: #9c9588; margin: 0 0 8px; line-height: 1.55; font-size: .88rem; }
.card a { color: #ead28b; text-decoration: none; }
.card a:hover { color: #c9a23d; text-decoration: underline; }

.badge {
  color: #050607;
  background: linear-gradient(135deg, #c9a23d, #b47a32);
  border-radius: 0;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.impact {
  border-radius: 0;
  padding: 3px 8px;
  font-size: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.095);
  color: #9c9588;
  letter-spacing: .06em;
}

.signals::-webkit-scrollbar { width: 4px; }
.signals::-webkit-scrollbar-track { background: transparent; }
.signals::-webkit-scrollbar-thumb { background: rgba(201,162,61,.3); }

.source-chip {
  border-radius: 0;
  padding: 3px 8px;
  font-size: 10px;
  background: rgba(114,165,255,.12);
  border: 1px solid rgba(114,165,255,.28);
  color: #a9c4ff;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.timestamp { color: #6f6a61; }

.card.new-item {
  border-color: rgba(201,162,61,.5);
  background: linear-gradient(180deg, rgba(201,162,61,.12), rgba(255,255,255,.02));
  animation: newItemFade 4s ease-out forwards;
}
@keyframes newItemFade {
  from { box-shadow: 0 0 0 1px rgba(201,162,61,.4); }
  to   { box-shadow: 0 0 0 0 rgba(201,162,61,0); }
}

.sources-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin: 10px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(114,165,255,.16);
  background: rgba(114,165,255,.045);
  font-size: .76rem;
  letter-spacing: .05em;
}

.sources-panel .sources-label {
  color: #9c9588;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
  margin-right: 4px;
}

.sources-panel .ai-disclosure {
  width: 100%;
  color: #6f6a61;
  font-size: .7rem;
  margin-top: 6px;
  letter-spacing: .04em;
  text-transform: none;
}

@media (max-width: 820px) {
  .hero, .panel-head { flex-direction: column; align-items: stretch; }
  .refresh-policy { flex-direction: column; align-items: flex-start; }
  .refresh-policy span { border-right: 0; padding-right: 0; }
  .toolbar { flex-direction: column; }
  .timeline-controls, .range-controls { flex-wrap: wrap; align-items: flex-start; }
  .timeline-controls { flex-direction: column; }
  .gain-control { width: 100%; }
  .gain-control input[type="range"] { flex: 1; width: auto; }
  .range-label { width: 100%; margin: 2px 0 0; }
  h1 { font-size: clamp(28px, 9vw, 48px); }
  #timeline { max-height: 56vw; }
  .signals { max-height: 360px; }
}
@media (max-width: 520px) {
  #timeline { max-height: 52vw; }
  .toolbar select, .toolbar input, .toolbar button { width: 100%; }
}
