:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f1f6f3;
  --ink: #17201f;
  --muted: #64716e;
  --line: #dbe2df;
  --primary: #0f6b5f;
  --primary-strong: #0a4f47;
  --accent: #b64636;
  --blue: #4056a1;
  --gold: #c6922e;
  --shadow: 0 18px 48px rgba(28, 42, 39, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(15, 107, 95, 0.09), transparent 320px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--primary-strong);
  font-weight: 700;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.2em;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
  gap: 28px;
  align-items: end;
  min-height: 210px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.method-mark {
  display: grid;
  place-items: center;
  flex: 0 0 74px;
  width: 74px;
  height: 74px;
  border: 2px solid rgba(15, 107, 95, 0.26);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 35%, transparent 36%),
    conic-gradient(from 215deg, var(--primary), var(--gold), var(--accent), var(--blue), var(--primary));
  color: var(--primary-strong);
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: 0;
}

.eyebrow,
.panel-label {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.1;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 5.2vw, 5.8rem);
}

h2 {
  font-size: clamp(1.15rem, 2vw, 1.6rem);
}

.intro-copy {
  max-width: 440px;
  margin: 0;
  color: #364642;
  font-size: 1.05rem;
}

.control-surface,
.summary-panel,
.table-panel,
.timeline-panel,
.source-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.control-surface {
  margin-top: 28px;
  padding: 18px;
}

.location-form {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto auto auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #2c3b38;
  font-size: 0.9rem;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd6d2;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.field input:focus,
.field select:focus,
.segment:focus-visible,
button:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.18);
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 116px;
  min-height: 46px;
  border: 1px solid #cbd6d2;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.segment {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.segment.is-active {
  background: var(--primary);
  color: #fff;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover,
.segment.is-active:hover {
  background: var(--primary-strong);
}

.secondary-button {
  border-color: #b9c6c2;
  background: #fff;
  color: var(--primary-strong);
}

.secondary-button:hover {
  background: var(--panel-soft);
}

.status-row {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.status-message {
  color: var(--muted);
  font-size: 0.94rem;
}

.status-message.is-error {
  color: var(--accent);
  font-weight: 800;
}

.dashboard,
.times-layout {
  display: grid;
  gap: 18px;
}

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

.summary-panel,
.table-panel,
.timeline-panel,
.source-panel {
  padding: 20px;
}

.large-time {
  margin: 14px 0 4px;
  color: var(--primary-strong);
  font-size: clamp(2rem, 6vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.quiet {
  margin: 0;
  color: var(--muted);
}

.times-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  margin-top: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.meta-chip {
  flex: 0 0 auto;
  max-width: 220px;
  border: 1px solid rgba(15, 107, 95, 0.18);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--primary-strong);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #40504c;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #24302e;
  font-weight: 700;
}

td:nth-child(4) {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

tr.is-active td {
  background: rgba(15, 107, 95, 0.08);
}

tr:last-child td {
  border-bottom: 0;
}

.timeline {
  position: relative;
  height: 310px;
  border: 1px solid #d8e0dd;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(64, 86, 161, 0.1), rgba(15, 107, 95, 0.08) 46%, rgba(198, 146, 46, 0.16) 70%, rgba(182, 70, 54, 0.12)),
    #fff;
  overflow: hidden;
}

.timeline::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: rgba(23, 32, 31, 0.16);
}

.timeline-segment {
  position: absolute;
  min-width: 34px;
  top: calc(50% - 20px);
  height: 40px;
  border-radius: 7px;
  border: 1px solid rgba(23, 32, 31, 0.1);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-segment:nth-child(2) {
  background: var(--gold);
}

.timeline-segment:nth-child(3) {
  background: var(--blue);
}

.timeline-segment:nth-child(4) {
  background: var(--accent);
}

.timeline-segment:nth-child(5) {
  background: #2d3a45;
}

.timeline-point {
  position: absolute;
  top: calc(50% + 32px);
  transform: translateX(-50%);
  color: #34423f;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.timeline-point::before {
  content: "";
  display: block;
  width: 2px;
  height: 26px;
  margin: -31px auto 5px;
  background: rgba(23, 32, 31, 0.36);
}

.timeline-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.source-panel {
  margin-top: 18px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.source-grid a {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: #20312e;
  text-decoration: none;
}

.source-grid a:hover {
  border-color: rgba(15, 107, 95, 0.45);
  background: var(--panel-soft);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .intro,
  .dashboard,
  .times-layout,
  .source-grid {
    grid-template-columns: 1fr;
  }

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

  .span-2 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  .intro {
    min-height: 0;
    gap: 16px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .method-mark {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
    font-size: 1.05rem;
  }

  .location-form {
    grid-template-columns: 1fr;
  }

  .control-surface,
  .summary-panel,
  .table-panel,
  .timeline-panel,
  .source-panel {
    padding: 14px;
  }

  .section-head {
    display: grid;
  }

  .meta-chip {
    max-width: 100%;
  }

  .timeline {
    height: 250px;
  }

  .timeline-segment {
    font-size: 0.7rem;
    padding: 0 5px;
  }
}
