:root {
  --bg: #f4f1e8;
  --panel: #fffdf8;
  --panel-soft: #f8f4eb;
  --ink: #213124;
  --muted: #5d695d;
  --line: #ddd5c4;
  --line-strong: #cfc6b2;
  --accent: #4f6f4e;
  --accent-soft: #deead8;
  --warm: #8b673e;
  --warn: #8a4b3a;
  --shadow: 0 16px 36px rgba(24, 35, 28, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(143, 176, 124, 0.16), transparent 24%),
    linear-gradient(180deg, #eeece4 0, #eeece4 104px, var(--bg) 104px, var(--bg) 100%);
  font-family: "Segoe UI Variable", "Aptos", system-ui, sans-serif;
}

a { color: inherit; }

.page-shell {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(23, 34, 27, 0.04);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  color: var(--accent);
  text-decoration: none;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.94rem;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 999px;
  background: #fafbf9;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.portal-nav a.active {
  color: #fffefb;
  background: var(--accent);
  border-color: transparent;
}

.hero,
.section-card,
.metric-card,
.split-card,
.summary-card,
.download-card,
.portal-footer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 22px;
  padding: 32px;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), #35553a);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--warm);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  margin-bottom: 12px;
}

.hero-text,
.section-note,
.muted-text,
.summary-card p,
.download-card p,
.toolbar label,
.empty-state {
  color: var(--muted);
}

.hero-panel,
.metric-grid,
.comparison-grid,
.doc-grid,
.tier-grid,
.summary-grid,
.audit-grid,
.advanced-grid {
  display: grid;
  gap: 16px;
}

.hero-panel,
.metric-grid,
.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card,
.summary-card,
.download-card {
  padding: 18px;
}

.metric-card .label,
.summary-card .label {
  font-size: 0.86rem;
  color: var(--muted);
}

.metric-card .value,
.summary-card .value {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

.section-card {
  padding: 24px;
  margin-bottom: 22px;
}

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

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-nav button {
  appearance: none;
  border: 1px solid var(--line);
  background: #fbfaf6;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.tab-nav button.active {
  background: var(--accent);
  color: #fffefb;
  border-color: transparent;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}

input[type="search"],
select {
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

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

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

th {
  position: sticky;
  top: 0;
  background: #f5f8f6;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 0.84rem;
}

.chip.warn {
  background: #f7e9e2;
  color: var(--warn);
}

.tier-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.tier-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.tier-card h3 {
  margin-bottom: 6px;
}

.callout {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #d6e3d3;
  background: #f8fbf7;
  margin-bottom: 16px;
}

.callout strong {
  color: var(--accent);
}

.note-box {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.download-card a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.portal-footer {
  display: grid;
  gap: 12px;
  padding: 18px 22px;
}

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

.footer-item {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-item strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

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

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .portal-header,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 20px;
  }

  .hero,
  .section-card {
    padding: 20px;
  }
}
