:root {
  --navy: #0b1f33;
  --navy-2: #122a42;
  --navy-3: #1a3a57;
  --gold: #b08d57;
  --gold-bright: #d4b483;
  --gold-soft: #f4eee3;
  --bg: #e8edf2;
  --bg-deep: #dfe6ee;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #0f1720;
  --ink-soft: #3d4a59;
  --muted: #6a7685;
  --line: #d3dbe5;
  --line-strong: #b7c2d0;
  --up: #0d7a4f;
  --up-soft: #e7f5ef;
  --down: #b42318;
  --down-soft: #f8e8e6;
  --shadow: 0 18px 40px rgba(11, 31, 51, 0.1);
  --shadow-sm: 0 8px 22px rgba(11, 31, 51, 0.06);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --radius: 22px;
  --radius-sm: 16px;
  --radius-lg: 32px;
  --radius-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(176, 141, 87, 0.08), transparent 55%),
    linear-gradient(180deg, #edf1f6 0%, var(--bg) 40%, var(--bg-deep) 100%);
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

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

button {
  cursor: pointer;
}

::selection {
  background: var(--navy);
  color: var(--gold-bright);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  z-index: 10;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

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

.shell {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 18px;
  background:
    linear-gradient(180deg, rgba(176, 141, 87, 0.16), transparent 32%),
    linear-gradient(180deg, var(--navy) 0%, #071523 100%);
  color: #f3f6f9;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-dark {
  color: var(--navy);
}

.topbar .brand-text {
  font-size: 32px;
}

.mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(212, 180, 131, 0.35);
}

.brand-lockup {
  display: block;
  height: 52px;
  width: auto;
  object-fit: contain;
}

.brand-lockup-light {
  filter: brightness(0) invert(1);
  opacity: 0.96;
}

.hero-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.auth-side .hero-mark {
  width: 88px;
  height: 88px;
  margin-bottom: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-text small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 3px;
}

.rail nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail nav a {
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  color: rgba(243, 246, 249, 0.72);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

.rail nav a[aria-current="page"],
.rail nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 180, 131, 0.22);
}

.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rail-user {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.main {
  padding: 36px 40px 56px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.mobile-top {
  display: none;
}

.public-wrap {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: stretch;
  margin: 12px 0 48px;
  padding: 36px;
  background:
    radial-gradient(600px 280px at 0% 0%, rgba(176, 141, 87, 0.18), transparent 60%),
    linear-gradient(145deg, var(--navy) 0%, #0e2740 55%, #163650 100%);
  color: #f5f7fa;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(212, 180, 131, 0.2);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title,
.page-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.hero-title {
  font-size: clamp(42px, 6vw, 72px);
  max-width: 12ch;
  color: #fff;
}

.page-title {
  font-size: clamp(34px, 4.5vw, 48px);
  color: var(--navy);
}

.page-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold), transparent);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero .eyebrow {
  color: var(--gold-bright);
}

.lede {
  max-width: 40ch;
  margin: 18px 0 28px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
}

.hero .lede {
  color: rgba(245, 247, 250, 0.78);
}

.specimen {
  position: relative;
  z-index: 1;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid rgba(212, 180, 131, 0.35);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.specimen .eyebrow {
  color: var(--gold);
}

.specimen-label {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.specimen-value {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--navy);
}

.specimen-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 8px 0 40px;
}

.steps article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border-top: 2px solid var(--gold);
}

.steps span {
  display: block;
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
}

.steps h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.colophon {
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  padding: 18px;
}

.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  background:
    radial-gradient(500px 300px at 20% 10%, rgba(176, 141, 87, 0.2), transparent 55%),
    linear-gradient(180deg, var(--navy) 0%, #071523 100%);
  color: #f3f6f9;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-side .brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.auth-copy {
  max-width: 14ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 600;
  line-height: 1.02;
}

.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.auth-form .stack {
  max-width: 420px;
}

.btn-auth {
  width: 100%;
}

.btn,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  background: var(--navy);
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--navy-2);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(11, 31, 51, 0.18);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--navy);
}

.btn-ghost:hover {
  border-color: var(--navy);
  background: var(--surface-2);
}

.btn-danger {
  background: var(--down);
  color: #fff;
}

.btn-text {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  font-weight: 500;
}

.btn-text.light {
  color: rgba(243, 246, 249, 0.85);
}

.btn-text.danger {
  color: var(--down);
}

.flashes {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.flash {
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 14px;
}

.flash-ok {
  border-color: rgba(13, 122, 79, 0.28);
  background: var(--up-soft);
  color: #0a5a3a;
}

.flash-erro {
  border-color: rgba(180, 35, 24, 0.28);
  background: var(--down-soft);
  color: #8a1b14;
}

.banner {
  margin: 0 0 24px;
  padding: 12px 18px;
  border: 1px solid rgba(176, 141, 87, 0.35);
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 500;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.portfolio-hero {
  margin-bottom: 22px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(176, 141, 87, 0.16), transparent 55%),
    linear-gradient(135deg, var(--navy) 0%, #12304a 100%);
  color: #f5f7fa;
  box-shadow: var(--shadow);
}

.portfolio-hero .eyebrow,
.portfolio-hero .stat-label {
  color: rgba(212, 180, 131, 0.9);
}

.portfolio-hero .stat-value,
.portfolio-hero .page-title {
  color: #fff;
}

.portfolio-hero .page-title::after {
  background: linear-gradient(90deg, var(--gold-bright), transparent);
}

.portfolio-hero .stats {
  margin-bottom: 0;
}

.portfolio-hero .stat {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.portfolio-hero .muted {
  color: rgba(245, 247, 250, 0.7);
}

.portfolio-hero .btn-ghost {
  border-color: rgba(212, 180, 131, 0.45);
  color: #fff;
}

.portfolio-hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--gold-bright);
  color: #fff;
}

.portfolio-hero .up {
  color: #7dcea0;
}

.portfolio-hero .down {
  color: #f0a39a;
}

.stats {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
}

.stat.compact {
  min-width: 200px;
  text-align: right;
  background:
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-color: transparent;
}

.stat.compact .stat-label {
  color: var(--gold-bright);
}

.stat.compact .stat-value {
  color: #fff;
}

.stat-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--navy);
}

.stat-hero .stat-value {
  font-size: clamp(40px, 4.8vw, 58px);
}

.num {
  font-variant-numeric: lining-nums tabular-nums;
  font-family: var(--serif);
  font-weight: 600;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.yield-card {
  margin: 0 0 22px;
  padding: 22px 24px;
  border: 1px solid rgba(176, 141, 87, 0.4);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(176, 141, 87, 0.1), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.yield-card .eyebrow {
  color: var(--gold);
}

.yield-when {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--navy);
}

.yield-pct {
  display: inline-flex;
  margin: 10px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--up-soft);
  color: var(--up);
  font-size: 13px;
  font-weight: 600;
}

.yield-note {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.yield-chip {
  display: inline-flex;
  margin: 10px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #7a5d2e;
  font-size: 12px;
  font-weight: 600;
}

.mix {
  display: flex;
  height: 8px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
  margin-bottom: 8px;
}

.mix-capital {
  background: var(--navy);
}

.mix-yield {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.mix.is-loss .mix-capital {
  background: var(--down);
}

.mix-legend {
  display: flex;
  justify-content: space-between;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sheet,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.sheet.narrow {
  max-width: 560px;
  margin-top: 40px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sheet h2,
.panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}

.sheet-head h2 {
  margin: 0;
}

.ledger-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.ledger.compact {
  min-width: 0;
}

.ledger th {
  text-align: left;
  padding: 12px 12px 12px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
}

.ledger td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

.ledger tbody tr:hover td {
  background: rgba(11, 31, 51, 0.015);
}

.ledger th.num,
.ledger td.num {
  text-align: right;
  padding-right: 12px;
}

.ledger td.num {
  font-size: 16px;
}

.footnote,
.help {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.search input {
  min-width: min(360px, 100%);
  border-radius: var(--radius-pill);
}

.account-list {
  display: grid;
  gap: 12px;
}

.account-row {
  display: grid;
  grid-template-columns: 1.15fr 2fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.account-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.account-name:hover {
  color: var(--navy-3);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.mini-stats dt {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.mini-stats dd {
  margin: 4px 0 0;
  font-size: 17px;
  color: var(--navy);
}

.account-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.inline-yield {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-yield input {
  width: 92px;
  border-radius: var(--radius-pill);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.stack {
  display: grid;
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.15);
  outline: none;
}

.fieldset {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.danger-zone {
  margin-top: 16px;
  border-color: rgba(180, 35, 24, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fcf6f5 100%);
}

.danger-zone h2 {
  color: var(--down);
}

@media (max-width: 960px) {
  html,
  body {
    overflow-x: hidden;
  }

  .shell {
    display: block;
    padding: 0;
    min-height: 100dvh;
  }

  .mobile-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
  }

  .mobile-top .brand-text {
    font-size: 22px;
    color: var(--navy);
  }

  .rail .brand {
    display: none;
  }

  .rail {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    top: auto;
    z-index: 30;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 0;
    border-radius: 22px;
  }

  .rail nav {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    gap: 4px;
  }

  .rail nav a {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
  }

  .rail-foot {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .rail-user {
    display: none;
  }

  .main {
    margin: 10px 10px 88px;
    padding: 16px 14px 28px;
    border-radius: 22px;
  }

  .public-wrap {
    width: 100%;
    padding: 0 14px 36px;
  }

  .topbar {
    padding: 14px 0;
    gap: 12px;
  }

  .topbar .brand-text {
    font-size: 24px;
  }

  .hero,
  .steps,
  .account-row,
  .split,
  .grid-2 {
    display: block;
  }

  .hero {
    padding: 20px 16px;
    margin: 0 0 16px;
    border-radius: 22px;
    gap: 18px;
  }

  .hero-title {
    font-size: 32px;
    max-width: none;
  }

  .lede {
    font-size: 15px;
    margin: 12px 0 18px;
  }

  .page-title {
    font-size: 30px;
  }

  .auth {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .auth-side {
    min-height: 0;
    padding: 16px 16px 14px;
    gap: 8px;
    justify-content: flex-start;
  }

  .auth-side .brand {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .auth-side .hero-mark,
  .auth-side .brand .hero-mark {
    width: 56px;
    height: 56px;
    margin: 0;
  }

  .auth-side .brand-text {
    font-size: 24px;
  }

  .auth-copy {
    max-width: none;
    font-size: 20px;
    line-height: 1.2;
  }

  .auth-form {
    flex: 1 1 auto;
    padding: 20px 16px 22px;
    justify-content: flex-start;
  }

  .auth-form .page-title {
    font-size: 32px;
  }

  .auth-form .stack {
    max-width: none;
  }

  .auth-form input {
    font-size: 16px;
    min-height: 48px;
  }

  .auth-form .btn {
    min-height: 50px;
    width: 100%;
  }

  .page-head,
  .account-actions,
  .search,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .search input,
  .search label {
    min-width: 0;
    width: 100%;
  }

  .stat.compact {
    text-align: left;
    min-width: 0;
    width: 100%;
  }

  .specimen-meta {
    text-align: left;
    flex-direction: column;
    gap: 4px;
  }

  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }

  .stats .stat + .stat {
    margin-top: 0;
  }

  .stat-hero {
    grid-column: 1 / -1;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-hero .stat-value {
    font-size: 34px;
  }

  .portfolio-hero {
    padding: 16px;
    border-radius: 22px;
  }

  .portfolio-hero .stats .stat {
    padding: 12px;
  }

  .yield-when {
    font-size: 24px;
  }

  .account-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .mini-stats {
    grid-template-columns: 1fr 1fr;
    margin: 0;
  }

  .account-actions,
  .inline-yield {
    width: 100%;
  }

  .inline-yield input {
    flex: 1;
  }

  .account-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .split > * + *,
  .grid-2 > * + *,
  .account-list > * + *,
  .steps article + article {
    margin-top: 10px;
  }

  .sheet,
  .panel {
    padding: 16px;
  }

  .ledger {
    min-width: 0;
  }

  .ledger.compact {
    min-width: 0;
  }

  .ledger thead {
    display: none;
  }

  .ledger,
  .ledger tbody,
  .ledger tr,
  .ledger td {
    display: block;
    width: 100%;
  }

  .ledger tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .ledger td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }

  .ledger td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
  }

  .ledger td.num {
    text-align: right;
    padding-right: 0;
  }

  .btn,
  .btn-small {
    width: auto;
  }

  .flash {
    border-radius: 16px;
  }
}

@media (max-width: 960px) and (hover: none) {
  .stat:hover,
  .account-row:hover,
  .panel:hover,
  .yield-card:hover,
  .specimen:hover,
  .steps article:hover,
  .btn:hover {
    transform: none;
    box-shadow: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes grow-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes glow-ring {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.08); }
}

@keyframes mark-glow {
  0%, 100% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); }
  50% { box-shadow: 0 12px 32px rgba(212, 180, 131, 0.45); }
}

.rail {
  animation: slide-in 0.7s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.main,
.hero,
.auth-side,
.auth-form,
.topbar {
  animation: fade-up 0.75s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.auth-form {
  animation-delay: 0.12s;
}

.hero {
  animation-delay: 0.06s;
}

.hero-title,
.page-title,
.lede,
.auth-copy {
  animation: fade-up 0.8s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.hero-title { animation-delay: 0.14s; }
.lede { animation-delay: 0.22s; }
.auth-copy { animation-delay: 0.18s; }

.hero-mark,
.mark {
  animation: mark-glow 3.6s ease-in-out infinite;
}

.hero-mark {
  animation: fade-up 0.7s cubic-bezier(0.22, 0.8, 0.32, 1) both, mark-glow 3.6s ease-in-out 0.7s infinite;
}

.hero::after {
  animation: glow-ring 7s ease-in-out infinite;
}

.specimen {
  animation: fade-up 0.85s cubic-bezier(0.22, 0.8, 0.32, 1) 0.18s both;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.specimen:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px rgba(11, 31, 51, 0.16);
}

.steps article {
  animation: fade-up 0.7s cubic-bezier(0.22, 0.8, 0.32, 1) both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.steps article:nth-child(1) { animation-delay: 0.08s; }
.steps article:nth-child(2) { animation-delay: 0.16s; }
.steps article:nth-child(3) { animation-delay: 0.24s; }

.steps article:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.stat,
.yield-card,
.sheet,
.panel,
.account-row,
.flash {
  animation: fade-up 0.65s cubic-bezier(0.22, 0.8, 0.32, 1) both;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stats .stat:nth-child(1) { animation-delay: 0.05s; }
.stats .stat:nth-child(2) { animation-delay: 0.12s; }
.stats .stat:nth-child(3) { animation-delay: 0.19s; }
.stats .stat:nth-child(4) { animation-delay: 0.26s; }

.account-list .account-row:nth-child(1) { animation-delay: 0.06s; }
.account-list .account-row:nth-child(2) { animation-delay: 0.12s; }
.account-list .account-row:nth-child(3) { animation-delay: 0.18s; }
.account-list .account-row:nth-child(4) { animation-delay: 0.24s; }
.account-list .account-row:nth-child(5) { animation-delay: 0.3s; }
.account-list .account-row:nth-child(n + 6) { animation-delay: 0.34s; }

.split > *:nth-child(1) { animation-delay: 0.08s; }
.split > *:nth-child(2) { animation-delay: 0.16s; }

.stat:hover,
.account-row:hover,
.panel:hover,
.yield-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.sheet:hover {
  box-shadow: var(--shadow);
}

.mix-capital,
.mix-yield {
  transform-origin: left center;
  animation: grow-x 0.9s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.mix-yield {
  animation-delay: 0.18s;
}

.ledger tbody tr {
  animation: fade-up 0.45s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.ledger tbody tr:nth-child(1) { animation-delay: 0.04s; }
.ledger tbody tr:nth-child(2) { animation-delay: 0.08s; }
.ledger tbody tr:nth-child(3) { animation-delay: 0.12s; }
.ledger tbody tr:nth-child(4) { animation-delay: 0.16s; }
.ledger tbody tr:nth-child(5) { animation-delay: 0.2s; }
.ledger tbody tr:nth-child(6) { animation-delay: 0.24s; }
.ledger tbody tr:nth-child(n + 7) { animation-delay: 0.28s; }

.ledger tbody tr {
  transition: background 0.25s ease, transform 0.25s ease;
}

.rail nav a {
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.rail nav a:hover {
  transform: translateX(4px);
}

.account-name {
  transition: color 0.25s ease, letter-spacing 0.25s ease;
}

.btn-ghost:hover,
.btn-danger:hover {
  transform: translateY(-2px);
}

.page-title::after {
  animation: grow-x 0.8s cubic-bezier(0.22, 0.8, 0.32, 1) 0.3s both;
  transform-origin: left center;
}

.colophon {
  animation: fade-in 1s ease 0.4s both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

html.splash-pending,
html.splash-pending body {
  overflow: hidden;
}

.splash {
  display: none;
}

html.splash-pending .splash {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 4000;
  overflow: hidden;
  background: #071523;
}

.splash-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(176, 141, 87, 0.22), transparent 34%),
    radial-gradient(circle at 50% 50%, #0b1f33 0%, #071523 62%, #040b12 100%);
}

.splash-orbit {
  position: absolute;
  left: 50%;
  top: 46%;
  border: 1px solid rgba(212, 180, 131, 0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
}

.splash-orbit-a {
  width: 220px;
  height: 220px;
}

.splash-orbit-b {
  width: 340px;
  height: 340px;
}

.splash-orbit-c {
  width: 500px;
  height: 500px;
}

.splash-stage {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  text-align: center;
}

.splash-mark {
  position: relative;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
}

.splash-mark img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: scale(0.55) rotate(-8deg);
  box-shadow: 0 0 0 0 rgba(212, 180, 131, 0);
}

.splash-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 180, 131, 0.0);
  transform: scale(0.7);
  opacity: 0;
}

.splash-word {
  margin: 28px 0 0;
  font-family: var(--serif);
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #f5f1e8;
  opacity: 0;
  transform: translateY(16px);
}

.splash-sub {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-bright);
  opacity: 0;
  transform: translateY(10px);
}

.splash-sub span {
  display: block;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  transform: scaleX(0);
}

html.splash-playing .splash-orbit-a {
  animation: splash-orbit 2.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html.splash-playing .splash-orbit-b {
  animation: splash-orbit 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

html.splash-playing .splash-orbit-c {
  animation: splash-orbit 2.6s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}

html.splash-playing .splash-ring-1 {
  animation: splash-ring 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

html.splash-playing .splash-ring-2 {
  animation: splash-ring 1.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

html.splash-playing .splash-ring-3 {
  animation: splash-ring 2s cubic-bezier(0.16, 1, 0.3, 1) 0.32s both;
}

html.splash-playing .splash-mark img {
  animation: splash-logo 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

html.splash-playing .splash-word {
  animation: splash-type 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.85s both;
}

html.splash-playing .splash-sub {
  animation: splash-type 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.12s both;
}

html.splash-playing .splash-sub span {
  animation: splash-line 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.28s both;
}

.splash.is-out {
  animation: splash-leave 0.75s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes splash-logo {
  0% {
    opacity: 0;
    transform: scale(0.55) rotate(-8deg);
    box-shadow: 0 0 0 0 rgba(212, 180, 131, 0);
  }
  55% {
    opacity: 1;
    transform: scale(1.08) rotate(0deg);
    box-shadow: 0 0 40px 8px rgba(212, 180, 131, 0.28);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 28px rgba(212, 180, 131, 0.35);
  }
}

@keyframes splash-ring {
  0% {
    opacity: 0;
    transform: scale(0.72);
    border-color: rgba(212, 180, 131, 0);
  }
  40% {
    opacity: 1;
    border-color: rgba(212, 180, 131, 0.7);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
    border-color: rgba(212, 180, 131, 0);
  }
}

@keyframes splash-orbit {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.42) rotate(0deg);
  }
  35% { opacity: 0.9; }
  100% {
    opacity: 0.18;
    transform: translate(-50%, -50%) scale(1) rotate(18deg);
  }
}

@keyframes splash-type {
  from {
    opacity: 0;
    transform: translateY(16px);
    letter-spacing: 0.5em;
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-line {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes splash-leave {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(8px);
    visibility: hidden;
  }
}
