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

* {
  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;
}

.homeLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  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.62);
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.homeLink:focus-visible {
  outline: 3px solid rgba(185, 204, 224, 0.75);
  outline-offset: 2px;
}

.homeLinkArrow {
  font-weight: 900;
}

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

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

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

.updated {
  margin-left: auto;
  font-size: 13px;
  color: #d7e4ef;
  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(6, 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;
}

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

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

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

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

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

.searchLabel {
  width: min(520px, 100%);
}

.summary h2 {
  font-size: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.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(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.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;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

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

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

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

.card.released {
  border-left-color: var(--green);
}

.card.needs_check,
.card.missing {
  border-left-color: var(--red);
}

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

.time,
.move,
.period {
  color: var(--muted);
  font-size: 13px;
}

.badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

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

.country {
  background: #eef4fa;
  color: var(--navy);
}

.importance {
  background: #fff4d5;
  color: #7c4a00;
}

.status.scheduled {
  background: #eaf1f8;
  color: var(--blue);
}

.status.released {
  background: #e5f6ef;
  color: var(--green);
}

.status.needs_check,
.status.missing {
  background: #fde8e7;
  color: var(--red);
}

.card h3 {
  font-size: 16px;
  line-height: 1.38;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font-weight: 700;
}

.summary h2::before,
.summary h2::after,
.dateHeading h3::before,
.dateHeading h3::after,
.card h3::before,
.card h3::after {
  content: none;
  display: none;
}

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

.metrics div {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 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;
}

.metrics .stronger {
  background: #e9f8f1;
  border-color: #b7e2ce;
}

.metrics .weaker {
  background: #fff0ef;
  border-color: #f0beb9;
}

.metrics .inline {
  background: #f3f5f7;
}

.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;
  }

  .updated {
    margin-left: 0;
    white-space: normal;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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