:root {
  --ink: #142126;
  --muted: #647075;
  --paper: #f5f3ed;
  --panel: #fffefa;
  --line: #d9d7ce;
  --navy: #163f4b;
  --teal: #18847a;
  --done: #16806a;
  --native: #6c63b8;
  --processing: #d99422;
  --partial: #4f89a7;
  --none: #a9afb0;
  --unknown: #726c68;
  --shadow: 0 14px 32px rgba(28, 39, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 92% 0%, rgba(24, 132, 122, 0.11), transparent 28rem),
    var(--paper);
}

a { color: inherit; }

.site-header,
main,
.site-footer {
  width: min(1480px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 44px 0 26px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.84rem;
  text-decoration: none;
}

.back-link:hover,
.header-links a:hover,
.landing-footer a:hover { color: var(--teal); }

.eyebrow,
.section-label {
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.header-links {
  display: flex;
  gap: 20px;
  padding-bottom: 5px;
}

.header-links a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

main { padding: 28px 0 60px; }

.case-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.64);
}

.case-switch button {
  padding: 9px 17px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}

.case-switch button.active {
  color: white;
  background: var(--navy);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.summary-card {
  min-height: 122px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.35rem;
  font-weight: 500;
  line-height: 1;
}

.summary-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.progress-panel,
.browser-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.progress-panel { padding: 20px; }

.progress-heading,
.browser-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.progress-heading strong,
.browser-heading strong {
  display: block;
  margin-top: 5px;
  font-size: 0.95rem;
}

.snapshot-time {
  color: var(--muted);
  font-size: 0.77rem;
}

.progress-bar {
  display: flex;
  height: 13px;
  margin-top: 17px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e4dc;
}

.progress-segment { min-width: 0; }
.status-done { background: var(--done); }
.status-done-native-island { background: var(--native); }
.status-processing { background: var(--processing); }
.status-partial { background: var(--partial); }
.status-none { background: var(--none); }
.status-unknown { background: var(--unknown); }

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.browser-panel { overflow: hidden; }
.browser-heading { padding: 20px 20px 0; }

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  padding: 18px 20px 20px;
}

.filters label span {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 0.84rem;
  outline: none;
}

input { padding: 0 12px; }
select { padding: 0 30px 0 10px; }
input:focus,
select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(24, 132, 122, 0.12); }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.79rem; }
th,
td { padding: 12px 14px; border-bottom: 1px solid #e7e4dc; text-align: left; vertical-align: top; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f0eee7;
  font-size: 0.68rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:hover { background: #f8f7f2; }
.numeric { text-align: right; white-space: nowrap; }
.routine-name { color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.source-path { max-width: 460px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; overflow-wrap: anywhere; }
.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  color: white;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  white-space: nowrap;
  text-transform: uppercase;
}
.date-cell { color: var(--muted); white-space: nowrap; }
.empty-state { padding: 40px 20px; color: var(--muted); text-align: center; }

.site-footer {
  padding: 0 0 40px;
  color: var(--muted);
  font-size: 0.76rem;
}

.error-message {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid #d8a6a0;
  border-radius: 6px;
  color: #813a33;
  background: #fff1ef;
}

.landing {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(22, 63, 75, 0.06), transparent 46%),
    radial-gradient(circle at 100% 0%, rgba(24, 132, 122, 0.18), transparent 35rem),
    var(--paper);
}

.landing-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  width: min(1120px, calc(100% - 48px));
  padding: 70px 0 44px;
}

.landing-intro {
  max-width: 570px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.destination-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 52px;
}

.destination-card {
  display: grid;
  min-height: 300px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.destination-card:hover { transform: translateY(-4px); box-shadow: 0 20px 42px rgba(28, 39, 42, 0.13); }
.destination-number { color: var(--teal); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.destination-title { align-self: end; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.15rem); letter-spacing: -0.035em; }
.destination-copy { align-self: end; max-width: 420px; color: var(--muted); line-height: 1.55; }
.destination-action { align-self: end; margin-top: 26px; color: var(--teal); font-size: 0.83rem; font-weight: 750; }
.destination-coverage { background: var(--navy); }
.destination-coverage .destination-title { color: #fff; }
.destination-coverage .destination-copy { color: #c9d4d6; }
.destination-coverage .destination-number,
.destination-coverage .destination-action { color: #7ed5c9; }

.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.landing-footer a { text-decoration: none; }

@media (max-width: 960px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1200px) and (min-width: 961px) {
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer,
  .landing-shell { width: min(100% - 28px, 1480px); }
  .site-header { align-items: flex-start; flex-direction: column; padding-top: 28px; }
  .header-links { flex-wrap: wrap; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { min-height: 104px; }
  .filters,
  .destination-grid { grid-template-columns: 1fr; }
  .progress-heading { align-items: flex-start; flex-direction: column; }
  .destination-card { min-height: 250px; }
  .landing-footer { flex-direction: column; }
}

@media (max-width: 430px) {
  .summary-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
}
