:root {
  --accent: #e2b657;
  --gold: #ffc53d;
  --on-accent: #1c1408;
  --radius: 14px;
  --max: 1280px;
  --sans: Inter, "Segoe UI", sans-serif;
  --display: Outfit, Inter, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
html[data-theme="dark"], html:not([data-theme]) {
  color-scheme: dark;
  --bg: #08090a;
  --ink: #f5f4fa;
  --muted: #a7a6b2;
  --faint: #8b8a96;
  --surface: #121316;
  --record: #08090a;
  --record-ink: #f5f4fa;
  --record-muted: rgba(244, 240, 232, 0.74);
  --record-line: rgba(255, 197, 61, 0.28);
  --line: rgba(244, 240, 232, 0.12);
  --hover: rgba(244, 240, 232, 0.06);
  --note-bg: rgba(226, 182, 87, 0.12);
  --essay: #c9c9dc;
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --lift: 0 12px 30px rgba(0, 0, 0, 0.28);
  --field: #07080a;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f0e8;
  --ink: #16130f;
  --muted: #5e584f;
  --faint: #8a8378;
  --surface: #fff;
  --record: #100e0c;
  --record-ink: #fff;
  --record-muted: rgba(255, 255, 255, 0.78);
  --record-line: rgba(255, 255, 255, 0.12);
  --line: rgba(22, 19, 15, 0.1);
  --hover: rgba(22, 19, 15, 0.04);
  --note-bg: #fff7ea;
  --essay: #3c3832;
  --scrim: rgba(16, 14, 12, 0.28);
  --shadow: 0 10px 40px rgba(16, 14, 12, 0.08);
  --lift: 0 12px 30px rgba(16, 14, 12, 0.06);
  --field: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.skip { position: absolute; left: 16px; top: -40px; background: var(--record); color: var(--record-ink); padding: 8px 12px; z-index: 40; }
.skip:focus { top: 12px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.wrap { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }
main { position: relative; z-index: 1; padding: 18px 0 48px; }
.page { display: grid; gap: 14px; }

.nav-scrim {
  position: fixed; inset: 0; z-index: 20;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }
.top {
  position: sticky; z-index: 30; top: 0; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.nav-shell { position: relative; width: 100%; background: transparent; }
.bar-links { display: flex; align-items: center; gap: 2px; }
.bar-links a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: 13.5px;
  padding: 6px 8px; border-radius: 6px; white-space: nowrap;
}
.bar-links a:hover, .bar-links a[aria-current="page"] { color: var(--accent); background: var(--hover); }
.nav-bar {
  width: min(var(--max), calc(100% - 32px)); margin: 0 auto;
  display: flex; align-items: center; gap: 14px; min-height: 62px;
}
.netbar { border-top: 1px solid var(--line); background: var(--bg); }
.netbar-inner { display: flex; align-items: center; gap: 14px; min-height: 34px; color: var(--muted); font-size: 13px; }
.brand, .footer-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.04em;
}
.brand img, .footer-logo img { width: 34px; height: 34px; display: block; object-fit: contain; }
.footer-logo img { width: 48px; height: 48px; }
.nav-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.header-search { flex: 1 1 320px; min-width: 180px; }
.theme-toggle {
  width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.theme-toggle:hover { background: var(--hover); }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="dark"] .icon-moon, html:not([data-theme]) .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 0; padding: 8px; cursor: pointer; color: var(--ink);
}
.nav-bars { position: relative; width: 28px; height: 16px; }
.nav-bars i {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav-bars i:first-child { top: 3px; }
.nav-bars i:last-child { bottom: 3px; }
.is-open .nav-bars i:first-child { top: 7px; transform: rotate(45deg); }
.is-open .nav-bars i:last-child { bottom: 7px; transform: rotate(-45deg); }
.nav-words { display: inline-grid; font-family: var(--display); font-size: 16px; }
.nav-words span { grid-area: 1 / 1; transition: transform 0.35s ease, opacity 0.35s ease; }
.nav-words span:last-child { opacity: 0; transform: translateY(80%); }
.is-open .nav-words span:first-child { opacity: 0; transform: translateY(-80%); }
.is-open .nav-words span:last-child { opacity: 1; transform: none; }
.nav-panel {
  display: grid; grid-template-rows: 0fr;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.is-open .nav-panel { grid-template-rows: 1fr; }
.nav-panel-inner { overflow: hidden; }
.is-open .nav-panel-inner { overflow: auto; max-height: calc(100dvh - 96px); }
.nav-links {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  padding: 8px 22px 22px; border-top: 1px solid var(--line);
}
.nav-group p { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-group a {
  display: block; text-decoration: none; padding: 10px 12px; border-radius: 10px;
  transform: translateY(12px); opacity: 0;
  transition: background 0.2s ease, transform 0.45s ease, opacity 0.45s ease;
}
.is-open .nav-group a { transform: none; opacity: 1; }
.nav-group a:hover { background: var(--hover); transform: translateX(6px); }
.nav-group a[aria-current="page"] strong { color: var(--accent); }
.nav-group strong { display: block; font-family: var(--display); font-weight: 500; letter-spacing: -0.03em; font-size: 17px; }
.nav-group span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

.hero { position: relative; padding: 0; }
.hero-dither { display: none; }
.hero-inner { position: relative; z-index: 1; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr); gap: 14px; align-items: start; }
.apply-split { display: grid; grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr); gap: 18px; align-items: start; }
.apply-forms { display: grid; gap: 14px; align-content: start; }
.apply-guide.essay { max-width: none; }
.apply-guide h2:first-child { margin-top: 0; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sheet-head { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sheet .table-wrap, .sheet .kv, .detail .kv { border-radius: 0; background: transparent; box-shadow: none; }
.sheet .essay { padding: 4px 14px 8px; }
.sheet .essay h2 { margin: 16px 0 8px; font-size: 15px; }
.sheet .essay p { font-size: 14px; margin: 0 0 12px; }
.detail [data-extra]:not(:empty) {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pill, .badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.pill i, .badge i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(226, 182, 87, 0.6); animation: live 2.2s ease-out infinite;
}
h1, h2, h3 {
  margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2;
}
h1 { font-size: 1.35rem; max-width: none; }
.accent, .grad { color: var(--accent); }
.lede { color: var(--muted); font-size: 14px; max-width: 68em; margin: 6px 0 0; }
.lede a, .panel a, .essay a { color: var(--accent); }
.eyebrow, .crumbs {
  margin: 0 0 14px; color: var(--accent); letter-spacing: 0.14em; font-size: 12px; text-transform: uppercase; font-weight: 650;
}
.crumbs { color: var(--faint); }
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-hero { padding: 0 0 4px; }
.page-hero h1 { font-size: 1.35rem; }
.section { padding: 14px 0 0; }
.detail { padding-bottom: 48px; }
.detail h1 { font-size: 1.25rem; max-width: none; word-break: break-all; }

.search { display: flex; gap: 8px; margin: 0; width: 100%; }
.search input {
  flex: 1; min-width: 0;
  background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.note {
  margin: 14px 0; padding: 14px 16px; border-radius: 12px;
  background: var(--note-bg); box-shadow: inset 0 0 0 1px rgba(226, 182, 87, 0.28); color: var(--muted);
}
.note.bad { box-shadow: inset 0 0 0 1px rgba(255, 90, 70, 0.5); color: #ffb4a8; }
html[data-theme="light"] .note.bad { color: #8a2a16; }

.metrics.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden;
}
.metric { background: transparent; border-radius: 0; padding: 12px 14px; box-shadow: none; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric strong {
  display: block; font-family: var(--display); font-size: 18px;
  letter-spacing: -0.03em; font-weight: 600; line-height: 1.15; word-break: break-word;
}
.metric span { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

.table-wrap, .kv {
  overflow-x: auto; border-radius: 8px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-wrap th { white-space: nowrap; word-break: normal; }
.table-wrap td { overflow-wrap: anywhere; word-break: normal; vertical-align: top; }
.table-wrap td .btn { margin: 0 6px 6px 0; }
th {
  text-align: left; color: var(--faint); font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; font-size: 11px; padding: 10px 12px; border-top: 0; background: var(--hover);
}
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: var(--hover); }
td a, .mono, .kv a { color: var(--accent); text-decoration: none; }
td a:hover, .kv a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pager a { color: var(--accent); text-decoration: none; font-weight: 600; }

.kv { display: grid; grid-template-columns: 220px 1fr; }
.kv .k, .kv .v { padding: 11px 14px; border-top: 1px solid var(--line); }
.kv .k { color: var(--muted); font-size: 13px; }
.kv .k:nth-child(-n+2), .kv .v:nth-child(-n+2) { border-top: 0; }

.stack { display: grid; gap: 14px; }
.panel, .card {
  background: var(--surface); border-radius: 8px; padding: 16px;
  border: 1px solid var(--line); box-shadow: none;
}
.panel h2, .panel h3 {
  margin: 0 0 12px; font-size: 15px; max-width: none; font-weight: 600; letter-spacing: -0.01em;
}
.panel p, .essay p, .essay li { color: var(--essay); }
.essay { max-width: 72ch; }
.essay h2 { margin: 22px 0 8px; font-size: 1.05rem; max-width: none; }
.essay p { font-size: 14.5px; line-height: 1.65; margin: 0 0 12px; }
.essay a { color: var(--accent); }
.essay ol { margin: 0 0 14px; padding-left: 1.35rem; }
.essay ol li { margin: 0 0 10px; font-size: 14.5px; line-height: 1.65; }
.essay ol .mono { display: block; margin-top: 6px; }
.empty { color: var(--muted); margin: 0 0 12px; }

.form { display: grid; gap: 10px; }
.form label, .form .k { color: var(--faint); font-size: 13px; margin: 0; }
.form input, .form textarea, .form select, .search input {
  width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.header-search input { width: auto; flex: 1; min-width: 0; }
.form textarea { resize: vertical; min-height: 88px; }
[data-wallet-compile-status] { white-space: pre-wrap; }
[data-wallet-compile-status].bad { color: #ffb4a8; }
html[data-theme="light"] [data-wallet-compile-status].bad { color: #8a2a16; }
.form select { appearance: none; }
.actions, .tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; border-radius: 10px; padding: 12px 16px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink);
}
.btn.solid, .tabs .btn[aria-selected="true"], .post-tabs button[aria-selected="true"] {
  border: 0; background: var(--accent); color: var(--on-accent); font-weight: 650;
}
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.balance {
  margin: 0; font-family: var(--display); font-size: 32px;
  letter-spacing: -0.03em; font-weight: 600; color: var(--ink);
}
.seed {
  margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line); color: var(--accent);
  font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-all;
}
details.panel summary { cursor: pointer; font-family: var(--display); font-size: 1.4rem; letter-spacing: -0.03em; }
.tx-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tx-list a { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: 13px; }

.wallet-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.wallet-side { display: grid; gap: 4px; padding: 14px; position: sticky; top: 112px; }
.wallet-side .k { margin: 12px 0 4px; color: var(--faint); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.wallet-side .k:first-child { margin-top: 0; }
.wallet-side button, .wallet-side .side-link {
  display: block; width: 100%; text-align: left; background: transparent; color: var(--ink);
  border: 0; border-radius: 10px; padding: 10px 12px; font: inherit; cursor: pointer; text-decoration: none;
}
.wallet-side button[aria-selected="true"], .wallet-side .side-link[aria-current="page"] {
  background: var(--hover); color: var(--accent);
}
.wallet-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr); gap: 14px; align-items: start; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
}
input[data-wallet-file] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

.footer { position: relative; z-index: 1; background: var(--accent); color: #1c1408; padding: 28px 0 22px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 22px; }
.footer-brand p { max-width: 36ch; margin: 8px 0 0; font-size: 14px; }
.footer-grid strong, .footer p { margin: 0; }
.footer-grid div:not(.footer-brand) { display: grid; align-content: start; gap: 8px; }
.footer-grid div:not(.footer-brand) p { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }
.footer a { color: #1c1408; text-decoration: none; }
.footer-grid div:not(.footer-brand) a { display: inline-block; }
.footer-grid div:not(.footer-brand) a:hover { text-decoration: underline; }
.footer-logo span { font-size: 22px; }
.footer-logo img { width: 28px; height: 28px; }

@keyframes live { 70%, 100% { box-shadow: 0 0 0 8px rgba(226, 182, 87, 0); } }
@media (prefers-reduced-motion: reduce) {
  .pill i, .badge i, .nav-panel, .nav-shell { animation: none; transition: none; }
}
@media (max-width: 980px) {
  .nav-links, .footer-grid, .wallet-grid, .home-grid, .apply-split { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(odd) { border-left: 0; }
  .metric { border-top: 1px solid var(--line); }
  .metric:nth-child(-n+2) { border-top: 0; }
}
@media (max-width: 1100px) {
  .bar-links { display: none; }
}
@media (min-width: 1101px) {
  .nav-toggle { display: none; }
}
@media (max-width: 760px) {
  .metrics, .metrics.two, .kv, .wallet-shell, .wallet-grid, .footer-grid, .nav-links, .home-grid, .apply-split { grid-template-columns: 1fr; }
  .metric { border-left: 0; border-top: 1px solid var(--line); }
  .metric:first-child { border-top: 0; }
  .wallet-side { position: static; }
  .nav-bar { flex-wrap: wrap; padding: 8px 0; min-height: 0; }
  .nav-actions { margin-left: auto; }
  .header-search { order: 3; flex: 1 1 100%; }
  .search { flex-direction: row; }
  h1 { max-width: none; }
}
.closed-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px;
}
.closed-screen img { width: min(280px, 62vw); height: auto; }
.closed-screen h1 {
  margin: 28px 0 0; font-size: clamp(32px, 6vw, 56px); max-width: 16ch;
}
.closed-screen .lede { margin-top: 18px; }

@media (max-width: 760px) {
  .closed-screen { padding: 32px 20px; }
}

html[data-theme="light"] { --accent: #8d6414; }
html[data-theme="light"] .btn.solid,
html[data-theme="light"] .tabs .btn[aria-selected="true"],
html[data-theme="light"] .footer { background: #e2b657; color: #1c1408; }
html[data-theme="light"] .footer a { color: #1c1408; }
.art-band { height: 120px; overflow: hidden; border-bottom: 1px solid var(--line); background: #08090a; }
.art-band img { width: 100%; height: 120px; object-fit: cover; object-position: center 40%; display: block; }
.sheet + .essay, .metrics + .sheet, .home-grid { margin-top: 14px; }
