:root {
  --ink: #14213d;
  --muted: #5d6978;
  --line: #d9e1e8;
  --soft-line: #e8eef3;
  --page: #f4f7f9;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --hero: #0f2f29;
  --hero-soft: #19453b;
  --brand: #0b6e4f;
  --gold: #b7791f;
  --shadow: 0 22px 50px rgba(20, 33, 61, 0.08);
  --radius: 26px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(11, 110, 79, 0.09), transparent 30%),
    linear-gradient(180deg, #eef4f5 0%, #f9fbfc 100%);
  font-family: "Aptos", "Segoe UI", sans-serif;
  line-height: 1.55;
}

body[data-portal-protected="true"]:not(.portal-ready) {
  visibility: hidden;
}

body.portal-gate-active {
  overflow: hidden;
}

a { color: var(--brand); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(249, 251, 252, 0.86);
  border-bottom: 1px solid rgba(217, 225, 232, 0.8);
}

.site-header-inner, .page, .site-footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 14px 0;
}

.header-actions {
  margin-left: auto;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
}

.brand-lockup .eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.brand-lockup strong {
  font-size: 18px;
  line-height: 1.1;
}

.top-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.top-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--soft-line);
  background: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.top-nav a:hover {
  border-color: #c7e6da;
  color: var(--brand);
  background: #f5fbf8;
}

.top-nav a.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.portal-lock-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.portal-lock-button:hover {
  border-color: #c7e6da;
  color: var(--brand);
  background: #f5fbf8;
}

.page { padding: 24px 0 64px; }

.hero {
  padding: 34px;
  border-radius: 30px;
  color: #ffffff;
  background:
    radial-gradient(circle at top right, rgba(183, 121, 31, 0.22), transparent 26%),
    linear-gradient(140deg, var(--hero) 0%, var(--hero-soft) 76%);
  box-shadow: 0 26px 60px rgba(15, 47, 41, 0.16);
}

.hero .kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b9e0d4;
}

.hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero p {
  max-width: 820px;
  margin: 14px 0 0;
  font-size: 18px;
  color: #e4f0eb;
}

.hero.compact {
  padding: 26px 28px;
  border-radius: 24px;
}

.hero.compact h1 {
  font-size: 36px;
}

.hero.compact p {
  font-size: 17px;
}

.hero-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pill.brand {
  color: #dff6ee;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pill.gold {
  color: #f9e8bf;
  background: rgba(183, 121, 31, 0.16);
  border: 1px solid rgba(183, 121, 31, 0.32);
}

.section { margin-top: 24px; }

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

.card {
  grid-column: span 12;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card.soft { background: linear-gradient(180deg, #fafdfc 0%, #f5faf8 100%); }

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

h2 { margin: 0 0 12px; font-size: 28px; line-height: 1.1; }
h3 { margin: 0 0 10px; font-size: 18px; }
h4 { margin: 0 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
p, li, td, th { font-size: 15px; }
ul, ol { margin: 0; padding-left: 18px; }
.lede { margin: 0; color: var(--muted); font-size: 16px; }

.quick-grid, .mini-grid, .split, .tile-grid, .timeline, .checklist {
  display: grid;
  gap: 16px;
}

.rule-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split, .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.quick-card, .mini-card, .tile {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--panel-strong);
}

.quick-card:hover { border-color: #c7e6da; transform: translateY(-1px); }
.quick-card strong, .mini-card strong { display: block; font-size: 18px; margin-bottom: 6px; }
.quick-card span, .mini-card span { color: var(--muted); font-size: 14px; }

.timeline-item, .check-item, .flag-box, .notice {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.timeline-item, .check-item, .flag-box { padding: 18px; }

.timeline-item {
  position: relative;
  padding-left: 22px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 5px;
  border-radius: 999px;
  background: var(--brand);
}

.timeline-item.manual::before { background: var(--gold); }
.timeline-item.warn::before { background: #8a1c1c; }
.flag-box.manual { background: #fffaf2; border-color: #f0d5a1; }
.flag-box.auto { background: #f5fbf8; border-color: #c7e6da; }
.flag-box.warn { background: #fff8f8; border-color: #edc2c2; }

.notice {
  padding: 16px 18px;
  border-left: 5px solid var(--brand);
  background: #f8fcfa;
}

.notice.warn { border-left-color: #8a1c1c; background: #fff8f8; }
.notice.gold { border-left-color: var(--gold); background: #fffaf2; }

.breadcrumb {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rule {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.rule strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.rule span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.tag-table td:first-child {
  width: 23%;
}

.tag-table td:first-child strong {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3f7fa;
}

.two-col-list {
  columns: 2;
  column-gap: 28px;
}

.two-col-list li {
  break-inside: avoid;
  margin-bottom: 8px;
}

.section-gap {
  margin-top: 16px;
}

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

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

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

code {
  padding: 1px 6px;
  border-radius: 7px;
  background: #f2f5f7;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer { padding: 0 0 40px; }
.site-footer-inner { color: var(--muted); font-size: 13px; }
.site-footer-inner .shell { border-top: 1px solid var(--line); padding-top: 18px; }

.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(11, 110, 79, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(15, 47, 41, 0.82), rgba(20, 33, 61, 0.7));
  backdrop-filter: blur(14px);
}

.portal-shell {
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  padding: 30px 28px 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 80px rgba(7, 16, 33, 0.28);
}

.portal-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(11, 110, 79, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-shell h1 {
  margin: 16px 0 10px;
  font-size: 40px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.portal-shell p {
  margin: 0;
  color: var(--muted);
}

.portal-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.portal-form label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hero);
}

.portal-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
}

.portal-form input:focus {
  outline: none;
  border-color: rgba(11, 110, 79, 0.48);
  box-shadow: 0 0 0 4px rgba(11, 110, 79, 0.08);
}

.portal-form button {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 15px 16px;
  background: linear-gradient(135deg, var(--hero) 0%, var(--brand) 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.portal-helper {
  font-size: 13px;
}

.portal-error {
  min-height: 20px;
  color: #a2352b;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .site-header-inner, .page, .site-footer-inner { width: min(var(--max), calc(100% - 20px)); }
  .site-header-inner { align-items: flex-start; flex-direction: column; }
  .header-actions { margin-left: 0; }
  .hero { padding: 26px; }
  .hero h1 { font-size: 36px; }
  .quick-grid, .mini-grid, .split, .tile-grid, .rule-grid { grid-template-columns: 1fr; }
  .two-col-list { columns: 1; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
}
