/* attribution.css — page-specific styles for attribution.html */

/* Layout */
#main { flex: 1; display: flex; overflow: hidden; }
#chart-area {
  flex: 1; display: flex; flex-direction: column;
  background: #111820; border-right: 1px solid #243040;
  overflow-y: auto;
}

/* Chart controls bar */
#chart-controls {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-bottom: 1px solid #1a2838;
  flex-shrink: 0;
}
.highlight-btn {
  font-size: 13px; color: #7a90a8; background: #0d1118;
  border: 1px solid #243040; border-radius: 4px;
  padding: 3px 12px; cursor: pointer; transition: all 0.12s;
}
.highlight-btn:hover { color: #b0c4d8; border-color: #3a5060; }
.highlight-btn.active {
  color: #e0eaf4; background: #1a3050;
  border-color: #3a6090; font-weight: 600;
}
.highlight-btn:focus-visible { outline: 2px solid #5090e0; outline-offset: 2px; }
.norm-btn {
  margin-left: auto; font-size: 12px; color: #7a90a8;
  background: transparent; border: 1px solid #243040;
  border-radius: 4px; padding: 3px 10px; cursor: pointer;
}
.norm-btn.active { color: #b0c4d8; border-color: #3a5060; }
.norm-btn:focus-visible { outline: 2px solid #5090e0; outline-offset: 2px; }

/* Four stacked chart panels */
#charts-stack {
  flex: 1; display: flex; flex-direction: column;
  gap: 0; padding: 0;
}
.chart-row {
  border-bottom: 1px solid #1a2838; flex-shrink: 0;
  transition: opacity 0.15s, border-color 0.15s;
  padding: 6px 16px 0;
  border-left: 3px solid transparent;
}
.chart-row:last-child { border-bottom: none; }
.chart-row svg { display: block; }
.chart-label .chart-lag {
  font-size: 11px; margin-left: 8px; font-weight: 400;
}

/* Side panel */
#side-panel {
  width: 280px; flex-shrink: 0;
  overflow-y: auto; padding: 16px;
  font-size: 14px;
}

/* Timeline bar */
#timeline-bar { flex-shrink: 0; }

/* Loading overlay */
#loading {
  position: fixed; inset: 0; background: rgba(13,17,24,0.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #8fa4b8; z-index: 10;
}
#loading.hidden { display: none; }

/* Attribution note */
.attribution-note {
  background: #111820; border-radius: 6px;
  border-left: 3px solid #4a6080;
  padding: 10px 12px;
}

/* Correlation bars */
.corr-bar-container {
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px 0;
}
.corr-bar-row {
  display: flex; align-items: center; gap: 8px;
}
.corr-bar-label {
  width: 32px; font-size: 12px; color: #7a90a8;
  text-align: right; flex-shrink: 0;
}
.corr-bar-track {
  flex: 1; background: #111820; border-radius: 2px;
  overflow: hidden; height: 14px;
}
.corr-bar {
  height: 14px; border-radius: 2px;
  transition: width 0.15s;
  min-width: 0;
}

/* Diagnostic panel */
#diag-panel {
  flex-shrink: 0;
  border-top: 1px solid #1a2838;
  background: #0d1118;
  font-size: 12px;
}
#diag-panel summary {
  padding: 6px 16px; cursor: pointer;
  color: #4a6070; user-select: none;
  list-style: none;
}
#diag-panel summary::-webkit-details-marker { display: none; }
#diag-panel[open] summary { color: #7a90a8; }
#diag-panel summary:focus-visible { outline: 2px solid #5090e0; outline-offset: -2px; }
#diag-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 16px 6px; border-bottom: 1px solid #1a2838;
}
#diag-controls label { color: #7a90a8; }
#diag-level {
  background: #111820; border: 1px solid #243040;
  color: #b0c4d8; border-radius: 3px;
  padding: 2px 6px; font-size: 12px; font-family: inherit;
}
#diag-log { max-height: 180px; overflow-y: auto; padding: 6px 16px 10px; }
.diag-table {
  width: 100%; border-collapse: collapse;
  font-family: ui-monospace, monospace; font-size: 11px; color: #7a90a8;
}
.diag-table th {
  text-align: left; color: #4a6070; font-weight: 600;
  padding: 1px 8px 3px 0; border-bottom: 1px solid #1a2838;
}
.diag-table td { padding: 1px 8px 1px 0; }
.diag-event { color: #5090e0; }
.diag-gate  { color: #8fa4b8; }
.diag-ms    { color: #4a6070; text-align: right; }
.diag-rep   { color: #e0a040; text-align: center; }
.diag-note  { color: #3a5060; font-size: 11px; padding-top: 4px; font-family: ui-monospace, monospace; }

/* ── Info button ──────────────────────────────────────────────────────── */
.info-btn {
  margin-left: 6px; width: 26px; height: 26px;
  font-size: 14px; font-weight: 700; line-height: 1;
  color: #7a90a8; background: transparent;
  border: 1px solid #243040; border-radius: 50%;
  cursor: pointer; transition: all 0.12s;
  flex-shrink: 0;
}
.info-btn:hover { color: #b0c4d8; border-color: #3a5060; background: #111820; }
.info-btn:focus-visible { outline: 2px solid #5090e0; outline-offset: 2px; }

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 8, 14, 0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}
.modal-overlay.modal-hidden { display: none; }

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: #111820; border: 1px solid #243040;
  border-radius: 10px; max-width: 560px; width: 100%;
  max-height: calc(100vh - 40px); overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.25s ease;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid #1a2838;
}
.modal-header h2 {
  font-size: 18px; font-weight: 700; color: #e0eaf4;
  letter-spacing: 0.3px;
}
.modal-close {
  background: none; border: none; color: #7a90a8;
  font-size: 24px; line-height: 1; cursor: pointer;
  padding: 2px 6px; border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.modal-close:hover { color: #e0eaf4; background: #1a2838; }
.modal-close:focus-visible { outline: 2px solid #5090e0; outline-offset: 2px; }

.modal-body { padding: 18px 22px 22px; }

.modal-intro {
  font-size: 14px; color: #8fa4b8; line-height: 1.65;
  margin-bottom: 16px;
}
.modal-intro em {
  color: #b0c4d8; font-style: normal; font-weight: 500;
}

/* ── Accordions ───────────────────────────────────────────────────────── */
.modal-accordion {
  border: 1px solid #1a2838; border-radius: 6px;
  margin-bottom: 6px; overflow: hidden;
}
.modal-accordion summary {
  padding: 10px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #b0c4d8;
  background: #0d1118; user-select: none;
  list-style: none; display: flex; align-items: center;
  transition: background 0.12s;
}
.modal-accordion summary:hover { background: #151e28; }
.modal-accordion summary:focus-visible { outline: 2px solid #5090e0; outline-offset: -2px; }
.modal-accordion summary::-webkit-details-marker { display: none; }

.modal-accordion summary::before {
  content: '▸'; margin-right: 10px; font-size: 11px;
  color: #4a6070; transition: transform 0.15s;
  flex-shrink: 0;
}
.modal-accordion[open] summary::before { transform: rotate(90deg); }
.modal-accordion[open] summary { border-bottom: 1px solid #1a2838; }

.accordion-body {
  padding: 12px 14px 14px; font-size: 13px;
  color: #8fa4b8; line-height: 1.65;
}
.accordion-body p { margin-bottom: 8px; }
.accordion-body p:last-child { margin-bottom: 0; }
.accordion-body strong { color: #b0c4d8; font-weight: 600; }
.accordion-body code {
  font-family: ui-monospace, monospace; font-size: 12px;
  background: #0d1118; padding: 1px 5px; border-radius: 3px;
  color: #7ec8e3;
}
.acc-label { font-weight: 600; }

/* ── Get started button ───────────────────────────────────────────────── */
.modal-start {
  display: block; width: 100%; margin-top: 16px;
  padding: 11px 20px; font-size: 14px; font-weight: 600;
  color: #e0eaf4; background: #1e3a52;
  border: 1px solid #2d5a7a; border-radius: 6px;
  cursor: pointer; transition: background 0.15s;
}
.modal-start:hover { background: #254a66; }
.modal-start:focus-visible { outline: 2px solid #5090e0; outline-offset: 2px; }
