:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-muted: #eef3f7;
  --text: #172033;
  --muted: #5f6d7d;
  --border: #d7dee8;
  --primary: #176b5b;
  --primary-strong: #0f4c41;
  --accent: #5b4aa5;
  --warn: #9a5b12;
  --danger: #a43b3b;
  --focus: #0f766e;
  --shadow: 0 12px 28px rgba(21, 31, 50, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12161e;
  --surface: #1b2230;
  --surface-muted: #252f3d;
  --text: #edf2f7;
  --muted: #a8b5c6;
  --border: #3a4657;
  --primary: #4bb89e;
  --primary-strong: #7bd8c2;
  --accent: #a99bf2;
  --warn: #e0a04f;
  --danger: #f08484;
  --focus: #7dd3c7;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

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

a:hover {
  color: var(--primary-strong);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
}

button:hover,
.button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 0.85rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 1.1rem;
  min-height: 1.1rem;
  margin-right: 0.45rem;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.invest-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.invest-header-inner,
.page-shell,
.invest-footer-inner {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
}

.invest-header-inner {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  font-weight: 900;
}

.invest-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.invest-nav a {
  min-height: 2.5rem;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.invest-nav a[aria-current="page"],
.invest-nav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.icon-button {
  width: 2.75rem;
  padding: 0;
}

.page-shell {
  padding: 2rem 0 3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.hero-main,
.panel,
.card,
.notice,
.doc-shell,
.form-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-main,
.panel,
.doc-shell,
.form-panel {
  padding: clamp(1rem, 2.2vw, 1.75rem);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

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

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.05rem;
}

.lede {
  margin: 1rem 0 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-actions,
.toolbar,
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

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

.button-primary:hover {
  background: var(--primary-strong);
  color: #ffffff;
}

.button-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.card {
  padding: 1rem;
  min-width: 0;
}

.card p,
.panel p,
.notice p,
.doc-shell p {
  color: var(--muted);
}

.card p:last-child,
.panel p:last-child,
.notice p:last-child,
.doc-shell p:last-child {
  margin-bottom: 0;
}

.metric-value {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.65rem;
  line-height: 1.1;
  font-weight: 900;
  color: var(--text);
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.doc-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-card .button-row {
  margin-top: auto;
}

.notice {
  padding: 1rem;
  border-left: 5px solid var(--warn);
}

.notice.safe {
  border-left-color: var(--primary);
}

.learn-list,
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem;
}

.faq-item h3 {
  margin-bottom: 0.4rem;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-weight: 800;
}

.field small {
  display: block;
  color: var(--muted);
  margin-top: 0.35rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

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

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

th {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.json-editor {
  min-height: 28rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.invest-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.invest-footer-inner {
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none;
}

@media (max-width: 860px) {
  .invest-header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.8rem 0;
  }

  .invest-nav {
    justify-content: flex-start;
  }

  .hero,
  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .invest-header-inner,
  .page-shell,
  .invest-footer-inner {
    width: min(100% - 1rem, 1160px);
  }

  .hero-main,
  .panel,
  .doc-shell,
  .form-panel,
  .card {
    padding: 0.85rem;
  }

  .invest-nav a {
    padding: 0.5rem;
  }
}
