:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #dbe2ea;
  --navy: #12314f;
  --blue: #2563a9;
  --green: #147855;
  --amber: #a66000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px clamp(16px, 4vw, 40px);
  background: var(--navy);
  color: white;
}

.topbarActions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.homeLink {
  display: inline-grid;
  gap: 1px;
  min-width: 156px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.09);
  color: white;
  text-align: right;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.homeLink:hover,
.homeLink:focus-visible {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.homeLinkLabel {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.homeLinkMeta {
  color: #b9cce0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: #b9cce0;
  font-size: 12px;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

.updated {
  color: #d7e4ef;
  font-size: 13px;
  white-space: nowrap;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 28px) 36px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.archiveControls,
.filterControls {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.archiveControls[hidden],
.filterControls[hidden] {
  display: none;
}

.archiveControls label,
.filterControls label {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archiveControls select,
.filterControls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.summary h2 {
  font-size: 18px;
}

.summary p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.dateGroup {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.dateHeading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border-bottom: 2px solid var(--navy);
}

.dateHeading h3 {
  color: var(--navy);
  font-size: 18px;
}

.dateHeading span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.dateCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.card {
  min-height: 240px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cardHead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.symbolGroup {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.symbol {
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.exchangeBadge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.exchangeBadge.nasdaq {
  background: #eaf2fb;
  color: var(--blue);
}

.exchangeBadge.nyse {
  background: #e7f4ee;
  color: var(--green);
}

.exchangeBadge.unknown {
  background: #fff4d5;
  color: var(--amber);
}

.timeBadge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.timeBadge.pre {
  background: #e5f6ef;
  color: var(--green);
}

.timeBadge.after {
  background: #eef4fa;
  color: var(--blue);
}

.timeBadge.during {
  background: #eef7e7;
  color: #4f7d1f;
}

.timeBadge.unknown {
  background: #fff4d5;
  color: var(--amber);
}

h3 {
  font-size: 17px;
  line-height: 1.45;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.metrics div {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #f9fbfd;
}

.metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: white;
}

@media (max-width: 720px) {
  .topbar,
  .summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbarActions {
    align-items: flex-start;
  }

  .homeLink {
    min-width: 0;
    text-align: left;
  }

  .updated {
    white-space: normal;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

  .archiveControls,
  .filterControls {
    align-items: stretch;
    flex-direction: column;
  }

  .archiveControls label,
  .filterControls label {
    min-width: 0;
  }
}
