:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #121417;
  --muted: #5b626b;
  --line: #d7dce2;
  --green: #0f6b57;
  --green-strong: #094d3e;
  --red: #b42318;
  --yellow: #f2c94c;
  --shadow: 0 16px 34px rgba(18, 20, 23, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand,
.topnav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
}

.topnav {
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

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

main {
  padding: 28px 0 46px;
}

.intro-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 22px;
  align-items: stretch;
}

.intro-copy,
.hero-media,
.home-photo,
.controls,
.rate-panel,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intro-copy,
.home-photo,
.controls,
.rate-panel {
  min-width: 0;
}

.intro-copy {
  display: grid;
  align-content: center;
  min-height: 270px;
  padding: 36px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 22px;
  font-size: 5.2rem;
  line-height: 1.02;
  text-wrap: balance;
}

.intro-copy #page-title {
  font-size: 5.2rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.16;
}

.intro-copy p:last-child {
  max-width: 920px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.55rem;
  overflow-wrap: break-word;
}

.hero-media {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-photo {
  height: 100%;
  min-height: 338px;
  margin: 0;
  overflow: hidden;
  background: #dce3df;
}

.home-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 338px;
  object-fit: cover;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 520px) auto;
  gap: 14px;
  align-items: end;
  justify-content: start;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(15, 107, 87, 0.24);
  outline-offset: 2px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--green-strong);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 22px;
}

.metric {
  display: grid;
  min-height: 92px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  align-self: end;
  font-size: 1.55rem;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.rate-panel {
  min-width: 0;
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

#status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.source-note {
  margin: 0;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff9e8;
  color: #5d4200;
  font-size: 0.92rem;
}

.stale-disclaimer {
  margin: 0;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff4db;
  color: #5d4200;
  font-size: 0.92rem;
  font-weight: 750;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

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

th {
  background: #f9fafb;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

th:nth-child(1) {
  width: 12%;
}

th:nth-child(2) {
  width: 21%;
}

th:nth-child(3) {
  width: 17%;
}

th:nth-child(4) {
  width: 8%;
}

th:nth-child(5) {
  width: 8%;
}

th:nth-child(6),
th:nth-child(7) {
  width: 12%;
}

th:nth-child(8) {
  width: 10%;
}

td {
  color: var(--ink);
  font-size: 0.94rem;
}

th:nth-child(8),
td:nth-child(8) {
  overflow-wrap: normal;
  white-space: nowrap;
}

.stale-row {
  background: #fff9e8;
}

.bank-cell {
  font-weight: 850;
}

.muted,
.product-meta {
  color: var(--muted);
}

.product-name {
  display: block;
  font-weight: 750;
}

.product-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
}

.rate-value {
  min-width: 76px;
  color: var(--green-strong);
  font-weight: 900;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-links a {
  color: var(--green-strong);
  font-weight: 800;
}

.stale-badge {
  display: block;
  width: max-content;
  margin-top: 5px;
  padding: 2px 6px;
  border: 1px solid #d89a00;
  border-radius: 6px;
  color: #7a4b00;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.empty-state {
  margin: 0;
  padding: 28px;
  color: var(--muted);
}

.site-footer {
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .intro-shell {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3.5rem;
  }

  .intro-copy #page-title {
    font-size: 3.5rem;
  }

  .intro-copy p:last-child {
    font-size: 1.2rem;
  }

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

@media (max-width: 720px) {
  .topbar {
    position: static;
    padding: 12px 16px;
  }

  .topnav {
    gap: 10px;
    font-size: 0.86rem;
  }

  main,
  .site-footer {
    width: calc(100% - 22px);
  }

  main {
    padding-top: 14px;
  }

  .intro-copy {
    min-height: auto;
    padding: 24px;
  }

  h1 {
    font-size: 2.55rem;
  }

  .intro-copy #page-title {
    font-size: 2.55rem;
  }

  .title-line {
    display: block;
  }

  .eyebrow {
    font-size: 0.9rem;
  }

  .intro-copy p:last-child {
    width: 100%;
    max-width: 28ch;
    font-size: 1.08rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls,
  .metrics {
    grid-template-columns: 1fr;
  }

  #status {
    text-align: left;
  }

  table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
  }

  tr {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  td {
    display: grid;
    grid-template-columns: minmax(94px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 0;
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  td > span,
  .product-name,
  .product-meta,
  .stale-badge {
    grid-column: 2;
  }

  td:nth-child(8) {
    white-space: normal;
  }

  .rate-value {
    min-width: 0;
  }
}
