* { box-sizing: border-box; }
body {
  font-family: -apple-system, system-ui, sans-serif;
  margin: 0;
  background: #0f1218;
  color: #e6e6e6;
}
header {
  padding: 1rem 2rem;
  background: #1a1f2b;
  border-bottom: 1px solid #2a3040;
}
header h1 { margin: 0; font-size: 1.2rem; }
main { padding: 1rem 2rem; max-width: 1400px; }
.panel {
  background: #1a1f2b;
  border: 1px solid #2a3040;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.panel h2 { margin-top: 0; font-size: 1.05rem; }
.muted { color: #8892a6; font-size: 0.85rem; }
.err { color: #ff6b6b; font-size: 0.8rem; }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1em 0.5em;
  margin-left: 0.4em;
  background: #2a3040;
  border-radius: 3px;
  color: #8892a6;
}

table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #2a3040;
  vertical-align: top;
}
th { color: #8892a6; font-weight: 500; }
.ticker-table .drag { cursor: grab; user-select: none; color: #8892a6; }
.ticker-table .cell { min-width: 110px; }

.special-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #2a3040;
}
.special-row .special-label {
  color: #8892a6;
  font-size: 0.8rem;
  min-width: 80px;
}
.special-row input[type=text] {
  font-weight: 600;
  width: 120px;
}
.ticker-list { margin-top: 0.75rem; width: auto; }
.ticker-list .drag { cursor: grab; user-select: none; color: #8892a6; width: 1.5em; }
.ticker-list td { border: none; padding: 0.25rem 0.5rem; }

.download-table .cell { min-width: 160px; }
.download-table .range { font-size: 0.8rem; margin-bottom: 0.15rem; }
.download-row { margin: 0.5rem 0; }
.subsection {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2a3040;
}

.collapsible > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary::before {
  content: "▸";
  color: #8892a6;
  font-size: 0.85rem;
  transition: transform 0.15s ease;
  display: inline-block;
}
.collapsible[open] > summary::before { transform: rotate(90deg); }
.collapsible > summary .section-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.beta-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
}
.beta-controls input[type=number] { width: 5em; }
.beta-hint { font-style: italic; }

.job-grid td { min-width: 120px; vertical-align: top; }
.cell-status { font-weight: 600; }
.cell-last { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.status-queued .cell-status { color: #8892a6; }
.status-running .cell-status { color: #f5a623; }
.status-done .cell-status { color: #4caf50; }
.status-failed .cell-status { color: #ff6b6b; }
.status-queued, .status-running, .status-done, .status-failed, .status-partial { }
.status-running { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.55 } }

.job-meta { margin: 0.75rem 0; }
.progress-bar {
  position: relative;
  height: 22px;
  background: #0f1218;
  border: 1px solid #2a3040;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2a3d6b, #3a5091);
  transition: width 0.4s ease;
}
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e6e6e6;
  font-size: 0.8rem;
  font-weight: 500;
}

form fieldset { border: 1px solid #2a3040; border-radius: 4px; padding: 0.5rem 1rem; }
form label { margin-right: 1rem; }
input[type=text], input[type=date] {
  background: #0f1218;
  border: 1px solid #2a3040;
  color: #e6e6e6;
  padding: 0.35rem 0.5rem;
  border-radius: 3px;
}
button {
  background: #2a3d6b;
  color: #fff;
  border: 1px solid #3a5091;
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  cursor: pointer;
}
button:hover { background: #355088; }

.log {
  background: #0f1218;
  padding: 0.5rem;
  max-height: 300px;
  overflow: auto;
  font-size: 0.75rem;
}
