/* ── App Shell ──────────────────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: var(--hdr-h) 1fr var(--ftr-h);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 22px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--bdr);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 300;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

/* KfW official wordmark */
.header__logo-svg {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.header__title {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.05px;
}


.header__end {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Main Layout ────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--pan-w) 1fr;
  min-height: 0;
  overflow: hidden;
}

/* ── Left Panel ─────────────────────────────────────────────────────────── */
.panel-left {
  display: flex;
  flex-direction: column;
  padding: 14px 11px;
  border-right: 1px solid var(--bdr);
  background: rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  gap: 18px;
}

.panel-left::-webkit-scrollbar         { width: 3px; }
.panel-left::-webkit-scrollbar-track   { background: transparent; }
.panel-left::-webkit-scrollbar-thumb   { background: var(--bdr-b); border-radius: 4px; }

.section-hdr {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 3px;
  margin-bottom: 9px;
}

.summary-section { flex: 1; }

/* Pre-entrance: hide sidebar blocks until first data paint */
body.awaiting-entrance .panel-left > div:first-child > .section-hdr,
body.awaiting-entrance .kpi-card,
body.awaiting-entrance .summary-section .section-hdr,
body.awaiting-entrance .summary-table tr {
  opacity: 0;
  transform: translateY(8px);
}

.panel-left > div:first-child > .section-hdr.hdr-enter,
.kpi-card.kpi-enter {
  animation: a-panel-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.summary-section.summary-enter .section-hdr,
.summary-section.summary-enter .summary-table tr {
  animation: a-panel-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Chart Area ─────────────────────────────────────────────────────────── */
.chart-area {
  position: relative;      /* anchor for the overlay panel */
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── Chart Title ─────────────────────────────────────────────────────────── */
.chart-title {
  flex-shrink: 0;
  padding: 10px 24px 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  pointer-events: none;
}

.chart-title__range {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.6px;
  color: var(--faint);
  margin-top: 1px;
}

/* ── Chart Legend — group toggles pinned below the chart ────────────────── */
.chart-legend {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 20px;
  border-top: 1px solid var(--bdr);
  background: rgba(0, 0, 0, 0.12);
}

/* ── Settings Panel — floats as overlay above the chart ─────────────────── */
.settings-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;          /* invisible → not interactive */
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1),
              opacity    0.22s ease;
  /* backdrop-filter here samples the chart pixels behind this panel.
     will-change is intentionally omitted: it would create an isolated
     compositing layer whose backdrop contains no chart content, making
     the blur invisible. */
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.settings-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chart-wrapper {
  flex: 1;
  position: relative;
  min-height: 0;
  transition: opacity 0.18s ease;
}

.chart-wrapper.refreshing { opacity: 0.25; }

#main-chart {
  width: 100%;
  height: 100%;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  height: 38px;
  border-top: 1px solid var(--bdr);
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
  color: var(--faint);
}

.footer__left,
.footer__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__date  { font-weight: 500; color: var(--muted); }
.footer__age   { font-variant-numeric: tabular-nums; }
.footer__age.stale { color: var(--kfw-yel); }
.footer__rows  { font-variant-numeric: tabular-nums; color: var(--muted); }
.footer__sep   { width: 1px; height: 12px; background: var(--bdr-b); flex-shrink: 0; }

/* Poll countdown + pause in footer — inherit small font, no extra min-width */
.footer .poll-countdown {
  font-size: 12px;
  min-width: unset;
  gap: 4px;
}

/* Pause button in footer — compact icon-only */
.footer .btn-pause {
  width: 26px;
  height: 26px;
  font-size: 11px;
  border-radius: var(--r-sm);
}
