:root {
  --canvas: oklch(0.975 0.006 85);
  --surface: #ffffff;
  --surface-subtle: oklch(0.985 0.004 85);
  --ink: oklch(0.22 0.01 85);
  --muted: oklch(0.45 0.012 85);
  --border: oklch(0.9 0.008 85);
  --border-strong: oklch(0.85 0.01 85);
  --primary: oklch(0.45 0.09 250);
  --primary-hover: oklch(0.39 0.1 250);
  --primary-soft: oklch(0.96 0.02 250);
  --primary-border: oklch(0.88 0.03 250);
  --information: oklch(0.45 0.09 250);
  --warning: oklch(0.45 0.1 60);
  --danger: oklch(0.52 0.14 25);
  --positive: oklch(0.43 0.1 150);
  --radius: 8px;
  --shadow: 0 1px 2px oklch(0.2 0.01 85 / 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid oklch(0.65 0.12 250 / 0.38);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 236px;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 0 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.brand strong {
  font-size: 15px;
  font-weight: 650;
}

.brand-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.primary-nav {
  display: grid;
  gap: 2px;
}

.nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border-left: 2px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.nav-link--active {
  border-left-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
}

.nav-link--disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 16px 16px 0;
}

.owner-email {
  display: block;
  overflow: hidden;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  min-height: 100vh;
  margin-left: 236px;
}

.app-content {
  padding: 24px clamp(20px, 2.4vw, 34px) 64px;
}

.account-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 10px clamp(20px, 2.4vw, 34px);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.account-context-bar > div {
  min-width: 0;
}

.account-context-bar__title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}

.account-context-bar__title span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-context-bar__title strong {
  flex: 0 0 auto;
  font-size: 17px;
}

.account-context-bar__facts {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 8px;
}

.mobile-security-link {
  display: none;
}

.sidebar-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sidebar-account {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin-top: 20px;
  padding: 0 12px;
}

.account-switcher {
  position: relative;
  width: 100%;
  min-width: 0;
}

.account-switcher__current,
.account-switcher__empty {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 74px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  background: var(--primary-soft);
  padding: 9px 12px;
  color: oklch(0.28 0.055 250);
  cursor: pointer;
  list-style: none;
  text-decoration: none;
}

.account-switcher__current::-webkit-details-marker {
  display: none;
}

.account-switcher__current::after {
  position: absolute;
  top: 12px;
  right: 12px;
  content: "⌄";
  color: oklch(0.4 0.05 250);
  font-size: 13px;
}

.account-switcher[open] .account-switcher__current::after {
  content: "⌃";
}

.account-switcher__provider,
.account-switcher__mode {
  color: oklch(0.4 0.04 250);
  font-size: 12px;
}

.account-switcher__provider {
  padding-right: 18px;
}

.account-switcher__name-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}

.account-switcher__name-row strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-switcher__index,
.account-switcher__option-index,
.nav-link__meta {
  margin-left: auto;
  color: oklch(0.38 0.06 250);
  font-family: var(--font-mono);
  font-size: 11px;
}

.account-switcher__menu {
  position: fixed;
  z-index: 30;
  width: 396px;
  max-height: min(560px, calc(100vh - 140px));
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 32px oklch(0.2 0.01 85 / 0.16);
  padding: 8px 0;
}

.account-switcher__group > p {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 8px 14px 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-switcher__option {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  text-decoration: none;
}

.account-switcher__option:hover,
.account-switcher__option--current {
  background: var(--primary-soft);
}

.account-switcher__option > span:first-child {
  display: grid;
  min-width: 0;
}

.account-switcher__option strong,
.account-switcher__option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-switcher__option strong {
  font-size: 14px;
}

.account-switcher__option small {
  color: var(--muted);
  font-size: 11px;
}

.account-switcher__all {
  display: block;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  padding: 12px 14px 5px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 620;
}

.account-switcher--unselected > p {
  margin: 0;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  background: var(--primary-soft);
  padding: 10px 12px;
  color: oklch(0.35 0.05 250);
  font-size: 12px;
}

.account-switcher__menu--static {
  position: static;
  width: auto;
  max-height: 260px;
  margin: 0;
  border-color: var(--border);
  box-shadow: none;
}

.account-switcher__empty {
  min-height: 62px;
}

.account-switcher__empty strong,
.account-switcher__empty span {
  display: block;
}

.account-switcher__empty span {
  color: oklch(0.4 0.04 250);
  font-size: 12px;
}

.primary-nav--account {
  margin: 8px 0 0 22px;
  border-left: 1px solid var(--border);
}

.primary-nav--account .nav-link {
  padding-left: 26px;
}

.primary-nav--global {
  margin-top: 22px;
}

.primary-nav--global .sidebar-label {
  padding: 0 16px 6px;
}

.context-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 3px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.context-pill--mode {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: oklch(0.35 0.06 250);
}

.context-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.index-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.index-selector .field {
  flex: 1 1 260px;
  min-width: 0;
}

.index-selector .button {
  margin-top: 24px;
}

.workflow-status:empty {
  display: none;
}

.workflow-status:not(:empty) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  width: min(100%, 1320px);
  margin: 0 auto 16px;
  border-left: 3px solid var(--primary);
  padding: 10px 16px;
  background: var(--surface);
}

.workflow-status p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-status[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .account-context-bar {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
  }

  .mobile-security-link {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
    font-size: 12px;
  }
}

.money-overview { padding: 22px; }
.money-overview__total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.money-overview__total span { color: var(--muted); }
.money-overview__total strong { font-size: 25px; }
.money-bar { display: flex; gap: 3px; height: 14px; margin: 20px 0 16px; overflow: hidden; border-radius: 999px; background: var(--border); }
.money-bar__segment--investable,
.money-state-dot--investable { background: var(--positive); }
.money-bar__segment--cooling,
.money-state-dot--cooling { background: oklch(0.68 0.13 75); }
.money-bar__segment--reserved,
.money-state-dot--reserved { background: var(--primary); }
.money-bar__segment--waiting,
.money-state-dot--waiting { background: var(--warning); }
.money-state-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.money-state-grid > div { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }
.money-state-grid small { color: var(--muted); }
.money-state-grid strong { grid-column: 2; font-size: 17px; }
.money-state-dot { width: 9px; height: 9px; border-radius: 50%; }
.reserve-editor__form { display: grid; grid-template-columns: minmax(220px, 0.7fr) 1fr; gap: 18px; align-items: end; padding: 20px; }
.reserve-editor__form > div:last-child { display: grid; gap: 5px; }
.cash-action-list { display: grid; }
.cash-action-list article { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--border); padding: 14px 20px; }
.cash-action-list article > div { display: grid; }
.cash-action-list small { color: var(--muted); }

@media (max-width: 760px) {
  .money-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reserve-editor__form { grid-template-columns: 1fr; }
  .cash-action-list article { align-items: flex-start; flex-direction: column; }
}

.page-shell {
  width: min(100%, 1320px);
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(25px, 2.4vw, 30px);
  font-weight: 730;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 690;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.page-subtitle,
.muted {
  margin-bottom: 0;
  color: var(--muted);
}

.page-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.button--primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button--quiet {
  width: auto;
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.button--secondary {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: oklch(0.33 0.075 250);
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--primary);
}

.button--full {
  width: 100%;
}

.button--fit {
  width: auto;
}

.button--danger {
  border-color: rgb(180 35 24 / 0.25);
  background: #fff;
  color: var(--danger);
}

.button--danger:hover:not(:disabled) {
  background: #fff4f2;
}

.flash {
  width: min(100%, 1320px);
  margin: 0 auto 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 15px;
}

.flash--alert {
  border-color: rgb(180 35 24 / 0.25);
  color: var(--danger);
}

.flash--notice {
  border-color: rgb(33 122 80 / 0.25);
  color: var(--positive);
}

.status-strip {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 15px 17px;
}

.status-strip strong {
  display: block;
  margin-bottom: 2px;
}

.status-strip p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.review-list {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgb(96 112 104 / 0.12);
}

.status-strip--healthy .status-dot {
  background: var(--positive);
  box-shadow: 0 0 0 4px rgb(33 122 80 / 0.12);
}

.status-strip--info .status-dot {
  background: var(--information);
  box-shadow: 0 0 0 4px rgb(54 89 179 / 0.12);
}

.status-strip--warning .status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgb(161 92 0 / 0.12);
}

.status-strip--danger {
  border-color: rgb(180 35 24 / 0.3);
  background: #fff7f6;
}

.status-strip--danger .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgb(180 35 24 / 0.12);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-width: 0;
  min-height: 110px;
  padding: 16px 18px;
}

.metric-card__label,
.metric-card__hint {
  display: block;
  color: var(--muted);
}

.metric-card__label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 620;
}

.metric-card__value {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.metric-card__value--compact {
  overflow: hidden;
  font-family: inherit;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card__hint {
  font-size: 11px;
  line-height: 1.35;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  overflow: hidden;
  margin-bottom: 16px;
}

.content-grid .panel {
  margin-bottom: 0;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 15px 18px;
}

.panel__header .eyebrow {
  margin-bottom: 3px;
}

.panel__body {
  padding: 18px;
}

.panel__body > :last-child {
  margin-bottom: 0;
}

.panel__body > .secure-form {
  padding: 0;
}

.panel__body > p {
  margin-bottom: 0;
}

.panel__body > :not(:first-child) {
  margin-top: 18px;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.badge--neutral {
  background: oklch(0.95 0.006 85);
  color: var(--muted);
}

.badge--warning {
  background: oklch(0.95 0.05 60);
  color: var(--warning);
}

.badge--positive {
  background: oklch(0.95 0.035 150);
  color: var(--positive);
}

.badge--info {
  background: var(--primary-soft);
  color: var(--information);
}

.badge--danger {
  background: oklch(0.95 0.035 30);
  color: var(--danger);
}

.weight-gap--positive {
  color: var(--information);
}

.weight-gap--negative {
  color: var(--warning);
}

.evidence-note {
  margin: 0;
  border-top: 1px solid var(--border);
  padding: 16px 20px 20px;
  color: var(--muted);
  font-size: 12px;
}

.portfolio-table td:first-child {
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 13px 20px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 2px;
  color: var(--muted);
}

.numeric {
  text-align: right;
}

.tabular,
code,
time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

code {
  color: #31473c;
  font-family: var(--font-mono);
  font-size: 12px;
}

.empty-state {
  padding: 50px 22px;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state p {
  max-width: 430px;
  margin: 0 auto;
  color: var(--muted);
}

.evidence-panel {
  align-self: start;
}

.evidence-list {
  margin: 0;
  padding: 6px 20px 10px;
}

.evidence-list > div {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
}

.evidence-list > div:last-child {
  border-bottom: 0;
}

.evidence-list dt {
  color: var(--muted);
}

.evidence-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.text-link {
  display: inline-block;
  margin: 4px 20px 20px;
  color: var(--information);
  font-weight: 620;
  text-underline-offset: 3px;
}

.timeline {
  padding: 4px 20px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-item__marker {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.timeline-item__marker--succeeded,
.timeline-item__marker--no_change {
  background: var(--positive);
}

.timeline-item__marker--failed {
  background: var(--danger);
}

.timeline-item__marker--queued,
.timeline-item__marker--running,
.timeline-item__marker--refreshing_index,
.timeline-item__marker--refreshing_portfolio {
  background: var(--information);
}

.timeline-item__title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.timeline-item time,
.timeline-item p {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item p {
  margin: 3px 0 0;
}

.panel > .muted {
  padding: 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.settings-grid > .panel {
  margin-bottom: 0;
}

.strategy-summary-card {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(0, 1.85fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 78%);
  box-shadow: var(--shadow);
  padding: 24px;
}

.strategy-summary-card__intro h2 {
  margin-bottom: 7px;
  font-size: 26px;
}

.strategy-summary-card__intro > p:not(.eyebrow) {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
}

.strategy-summary-card__notice {
  display: inline-flex;
  margin-top: 14px;
  border-radius: 999px;
  background: #fff4e5;
  padding: 5px 10px;
  color: var(--warning);
  font-size: 11px;
  font-weight: 680;
}

.index-strategy-card {
  margin-top: 16px;
}

.strategy-summary-card__controls {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.strategy-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.strategy-facts > div {
  min-width: 0;
  border: 1px solid var(--primary-border);
  border-radius: 6px;
  background: rgb(255 255 255 / 0.82);
  padding: 11px 12px;
}

.strategy-facts--editable {
  grid-template-columns: minmax(210px, 1.25fr) minmax(190px, 1fr) minmax(170px, 0.9fr);
}

.strategy-control.field label,
.strategy-control__label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strategy-control.field select {
  min-height: 38px;
  border-color: transparent;
  background-color: transparent;
  padding: 6px 28px 6px 0;
  font-size: 14px;
  font-weight: 700;
}

.strategy-control.field select:hover,
.strategy-control.field select:focus {
  border-color: var(--primary-border);
  background-color: #fff;
  padding-left: 8px;
}

.strategy-control--readonly strong {
  display: block;
  padding-top: 8px;
  font-size: 14px;
}

.strategy-summary-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.strategy-summary-card__actions p,
.strategy-summary-card__controls > [data-passkey-target="status"] {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.strategy-summary-card__controls > [data-passkey-target="status"]:empty {
  display: none;
}

.strategy-facts dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-editor__toolbar,
.plan-editor__commit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}

.plan-editor__toolbar {
  border-bottom: 1px solid var(--border);
}

.plan-editor__toolbar p {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-field--compact {
  min-height: auto;
  border: 0;
  padding: 0;
}

.selection-column {
  width: 42px;
  text-align: center;
}

.selection-column input {
  width: 17px;
  height: 17px;
}

.lot-stepper {
  display: inline-grid;
  grid-template-columns: 44px 58px 44px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.lot-stepper button,
.lot-stepper input {
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
}

.lot-stepper button {
  cursor: pointer;
  font-size: 19px;
}

.lot-stepper button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.lot-stepper input {
  width: 58px;
  border-right: 1px solid var(--border);
  border-left: 1px solid var(--border);
  appearance: textfield;
}

.lot-stepper input::-webkit-inner-spin-button,
.lot-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.inline-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.plan-editor__row--removed {
  opacity: 0.46;
}

.plan-editor__commit {
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.plan-editor__commit > div {
  display: grid;
  gap: 2px;
}

.plan-editor__commit span,
.plan-editor__commit small {
  color: var(--muted);
  font-size: 12px;
}

.plan-editor__commit strong {
  font-size: 20px;
}

.plan-authorization {
  border-color: var(--primary-border);
  box-shadow: 0 6px 20px oklch(0.3 0.04 250 / 0.08);
}

.plan-authorization .secure-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.plan-authorization .secure-form > [data-passkey-target="status"] {
  grid-column: 1 / -1;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.strategy-facts dd {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-editor__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.strategy-editor__summary::-webkit-details-marker {
  display: none;
}

.strategy-editor[open] .strategy-editor__summary {
  border-bottom: 1px solid var(--border);
}

.strategy-editor__toggle {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.strategy-editor__toggle-close,
.strategy-editor[open] .strategy-editor__toggle-open {
  display: none;
}

.strategy-editor[open] .strategy-editor__toggle-close {
  display: inline;
}

.strategy-form__commit {
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.strategy-form__commit[hidden] {
  display: none;
}

.secure-form {
  display: grid;
  gap: 18px;
  padding: 22px 20px;
}

.secure-form--compact {
  max-width: 520px;
  padding: 0;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.checkbox-field {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle);
  padding: 13px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.boundary-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 20px 36px 22px;
  color: var(--muted);
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 20px;
}

.action-panel .muted {
  margin-top: 8px;
}

.danger-zone {
  border-color: rgb(180 35 24 / 0.18);
}

.danger-zone summary {
  cursor: pointer;
  padding: 17px 20px;
  color: var(--danger);
  font-weight: 650;
}

.danger-zone__body {
  border-top: 1px solid var(--border);
  padding: 20px;
}

.danger-zone__body > p {
  max-width: 720px;
  color: var(--muted);
}

.timeline-item__marker--succeeded {
  background: var(--positive);
}

.timeline-item__marker--rejected,
.timeline-item__marker--failed {
  background: var(--danger);
}

.timeline-item__marker--superseded {
  background: var(--muted);
}

.cash-event-list {
  display: grid;
}

.cash-event {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px minmax(300px, 1.5fr);
  gap: 20px;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding: 17px 20px;
}

.cash-event:last-child {
  border-bottom: 0;
}

.cash-event__main strong,
.cash-event__main span {
  display: block;
}

.cash-event__main span,
.inline-secure-form span {
  color: var(--muted);
  font-size: 12px;
}

.cash-event__amount {
  font-weight: 690;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cash-event__amount.positive {
  color: var(--positive);
}

.cash-event__amount.negative {
  color: var(--danger);
}

.cash-event__state {
  display: grid;
  justify-items: start;
  gap: 9px;
}

.inline-secure-form {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(100px, 0.7fr) minmax(110px, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.inline-secure-form--restore {
  grid-template-columns: 1fr minmax(110px, 0.8fr) auto;
}

.inline-secure-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd8d1;
  border-radius: 9px;
  padding: 7px 9px;
}

.inline-link {
  color: var(--information);
  font-weight: 620;
  text-underline-offset: 3px;
}

.plan-omissions summary {
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 650;
}

.auth-body {
  background: var(--canvas);
}

.auth-shell {
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: clamp(24px, 10vh, 112px) 24px 24px;
}

.auth-column { width: min(100%, 420px); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand .brand-mark { width: 32px; height: 32px; margin: 0; }
.auth-brand strong { font-size: 17px; font-weight: 700; }

.auth-card {
  display: grid;
  gap: 18px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 28px;
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.auth-intro,
.auth-help {
  color: var(--muted);
}

.auth-intro {
  margin: -8px 0 0;
  font-size: 14px;
}

.auth-help {
  margin: 0;
  font-size: 14px;
}
.auth-help a { color: var(--primary); font-weight: 600; }

.auth-form-error {
  margin: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--danger);
  padding: 12px 14px;
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 18px;
}
.auth-form .field label { font-size: 13px; font-weight: 600; }
.auth-form .field input { min-height: 48px; border-radius: 8px; }
.auth-form .button { min-height: 48px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

.field input:focus,
.field select:focus {
  border-color: var(--information);
  outline: 3px solid oklch(0.65 0.12 250 / 0.18);
}

@media (max-width: 1060px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .strategy-summary-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .page-header {
    display: grid;
    gap: 17px;
  }

  .page-header .button,
  .page-header form {
    width: 100%;
  }

  .action-panel {
    display: grid;
  }

  .action-panel form,
  .action-panel .button {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    min-height: 120px;
    padding: 15px;
  }

  .metric-card__value {
    font-size: 21px;
  }

  .panel__header {
    padding: 16px;
  }

  .strategy-summary-card {
    gap: 20px;
    padding: 18px 16px;
  }

  .strategy-facts {
    grid-template-columns: 1fr 1fr;
  }

  .strategy-facts--editable {
    grid-template-columns: 1fr;
  }

  .strategy-summary-card__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .strategy-summary-card__actions .button {
    width: 100%;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    border-bottom: 1px solid var(--border);
    padding: 15px 16px;
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  td {
    border: 0;
    padding: 0;
  }

  td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 680;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  td.numeric {
    text-align: left;
  }

  .timeline-item__title {
    display: grid;
    gap: 2px;
  }

  .cash-event {
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
    padding: 15px 16px;
  }

  .cash-event__state {
    grid-column: 1 / -1;
  }

  .inline-secure-form,
  .inline-secure-form--restore {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 26px 22px;
  }
}

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

  tbody tr {
    grid-template-columns: 1fr;
  }
}

.security-page .panel {
  padding: clamp(18px, 3vw, 28px);
}

.security-page form {
  display: grid;
  gap: 16px;
  max-width: 640px;
}

.security-page h2 {
  margin-top: 0;
}

.security-page li {
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.security-page .page-heading {
  margin-bottom: 28px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.broker-provider-panel + .broker-provider-panel {
  margin-top: 20px;
}

.account-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 14px;
  margin: 18px;
}

.account-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
}

.account-card__heading,
.account-card__facts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.account-card__heading h3,
.broker-connect-form h3 {
  margin: 0;
}

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

.account-card__facts div {
  display: grid;
  gap: 3px;
}

.account-card__facts dt {
  color: var(--muted);
  font-size: 12px;
}

.account-card__facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 620;
}

.broker-connect-form {
  margin-top: 24px;
}

.broker-connect-form > form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.broker-provider-panel > p {
  margin: 18px 20px;
}

.recovery-mode-banner {
  margin: 18px 0 0;
}

@media (max-width: 560px) {
  .account-card__facts {
    grid-template-columns: 1fr;
  }
}

.connect-account-disclosure {
  border-top: 1px solid var(--border);
}

.connect-account-disclosure > summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  list-style: none;
  padding: 0 18px;
  color: var(--primary);
  font-weight: 650;
}

.connect-account-disclosure > summary::-webkit-details-marker {
  display: none;
}

.connect-account-disclosure > summary::before {
  margin-right: 7px;
  content: "+";
  font-size: 18px;
}

.connect-account-disclosure[open] > summary::before {
  content: "−";
}

.connect-account-disclosure[open] > summary {
  border-bottom: 1px solid var(--border);
}

.broker-connect-form {
  margin: 0;
  background: var(--surface-subtle);
}

.broker-connect-form > div:first-child h3 {
  margin: 0 0 4px;
}

.empty-state--compact {
  padding-block: 32px;
}


.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgb(20 27 24 / 0.34);
}

.side-sheet {
  position: fixed;
  z-index: 31;
  inset: 0 0 0 auto;
  width: min(620px, calc(100vw - 80px));
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -18px 0 50px rgb(20 27 24 / 0.14);
}

.side-sheet__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  padding: 24px 28px 20px;
  backdrop-filter: blur(10px);
}

.side-sheet__header h2 { margin: 2px 0 0; font-size: 26px; }
.side-sheet__close { color: var(--primary); font-weight: 650; text-decoration: none; }
.side-sheet__body { display: grid; gap: 0; padding-bottom: 48px; }
.sheet-section { display: grid; gap: 16px; border-bottom: 1px solid var(--border); padding: 24px 28px; }
.sheet-section h3 { margin: 0; }
.sheet-lead { margin: 0; padding: 22px 28px 0; color: var(--muted); }
.sheet-section .sheet-lead { padding: 0; }
.sheet-section__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sheet-section__heading span { color: var(--muted); font-size: 13px; }

.stack-form { display: grid; gap: 16px; }
.field-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack-form textarea { resize: vertical; }

.mode-list { display: grid; gap: 10px; padding: 20px 28px; }
.mode-option { display: block; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.mode-option--selected { border-color: var(--primary); background: var(--primary-soft); }
.mode-option button,
.mode-option--radio { display: flex; width: 100%; align-items: flex-start; gap: 12px; border: 0; background: transparent; padding: 16px; color: inherit; cursor: pointer; text-align: left; }
.mode-option button:disabled { cursor: not-allowed; opacity: 0.5; }
.mode-option button > span:last-child,
.mode-option--radio > span { display: grid; gap: 3px; }
.mode-option small { color: var(--muted); }
.mode-option__radio { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 3px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); }
.mode-option--selected .mode-option__radio { border: 5px solid var(--primary); }
.mode-option--radio input { margin-top: 5px; }
.mode-option > p { margin: 0; padding: 0 16px 12px 45px; color: var(--danger); font-size: 12px; }
.status-note { margin: 0 28px; border-radius: var(--radius); background: var(--surface-subtle); padding: 14px 16px; color: var(--muted); }

.compact-list { display: grid; }
.compact-list > div { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--border); padding: 10px 0; }
.compact-list > div:last-child { border-bottom: 0; }
.compact-list span { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.compact-list b { font-variant-numeric: tabular-nums; }
.compact-details > summary { padding-inline: 0; }

.plan-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 22px 28px 0; border: 1px solid var(--border); border-radius: var(--radius); }
.plan-summary > div { display: grid; gap: 4px; padding: 14px; }
.plan-summary > div + div { border-left: 1px solid var(--border); }
.plan-summary span { color: var(--muted); font-size: 12px; }
.selection-list { display: grid; gap: 8px; padding: 20px 28px; }
.selection-list label { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.selection-list label span { display: grid; gap: 2px; }
.selection-list small { color: var(--muted); }
.plan-adjustments > summary { cursor: pointer; color: var(--primary); font-weight: 650; }
.plan-adjustments[open] > summary { margin-bottom: 16px; }
.plan-adjustment-list { display: grid; }
.plan-adjustment-list > div { display: grid; grid-template-columns: auto 62px 128px 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); padding: 10px 0; }
.plan-adjustment-list > div > span { text-align: right; font-variant-numeric: tabular-nums; }
.plan-adjustments__total { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.plan-adjustments__total small { grid-column: 1 / -1; color: var(--muted); }

@media (max-width: 900px) {
  .portfolio-plan-card { align-items: flex-start; flex-direction: column; }
  .portfolio-plan-card__actions { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .decision-card { grid-template-columns: 1fr; gap: 10px; }
  .side-sheet__header,
  .sheet-section { padding-inline: 18px; }
  .sheet-lead { padding-inline: 18px; }
  .mode-list,
  .selection-list { padding-inline: 18px; }
  .status-note,
  .plan-summary { margin-inline: 18px; }
  .field-grid--three,
  .plan-summary { grid-template-columns: 1fr; }
  .plan-adjustment-list > div { grid-template-columns: auto 1fr auto; }
  .plan-adjustment-list .lot-stepper { grid-column: 2; }
  .plan-adjustment-list > div > span { grid-column: 3; grid-row: 2; }
  .plan-adjustment-list .inline-danger { grid-column: 2 / -1; justify-self: start; }
  .plan-summary > div + div { border-top: 1px solid var(--border); border-left: 0; }
}

/* Shared workspace component foundations. */
.policy-toolbar {
  position: relative;
  z-index: 9;
  display: flex;
  min-height: 69px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 24px;
}

.policy-toolbar__controls,
.policy-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-toolbar__actions {
  margin-left: auto;
}

.policy-menu {
  position: relative;
}

.policy-menu > summary {
  list-style: none;
}

.policy-menu > summary::-webkit-details-marker {
  display: none;
}

.policy-chip {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 6px 12px;
  color: var(--ink);
  cursor: pointer;
}

.policy-chip > span:first-of-type:not(.policy-chip__dot) {
  color: var(--muted);
  font-size: 11px;
}

.policy-chip strong {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.policy-chip > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.policy-chip__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  align-self: center;
  border-radius: 50%;
  background: var(--information);
}

.policy-chip--automatic,
.policy-chip--confirm { border-color: oklch(0.88 0.04 150); background: oklch(0.97 0.02 150); }
.policy-chip--automatic .policy-chip__dot,
.policy-chip--confirm .policy-chip__dot { background: var(--positive); }
.policy-chip--observe .policy-chip__dot { background: var(--muted); }
.policy-chip--off { border-color: oklch(0.86 0.06 25); background: oklch(0.96 0.03 25); }
.policy-chip--off .policy-chip__dot { background: var(--danger); }

.policy-menu[open] > .policy-chip {
  border-color: var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--primary-soft);
}

.policy-popover {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 40;
  width: 400px;
  max-width: calc(100vw - 292px);
  border: 1px solid var(--primary);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 30px oklch(0.2 0.01 85 / 0.12);
  padding: 12px;
}

.policy-popover--index,
.policy-popover--mode { width: 360px; }

.policy-options {
  display: grid;
  gap: 4px;
}

.policy-option button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 7px 10px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.policy-option button:hover,
.policy-option--selected button {
  background: var(--primary-soft);
}

.policy-option button:disabled {
  cursor: default;
  opacity: 1;
}

.policy-option button > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.policy-option strong {
  font-size: 14px;
}

.policy-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-option__radio {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
}

.policy-option--selected .policy-option__radio {
  border: 4px solid var(--primary);
}

.policy-popover__links,
.policy-popover__note {
  margin: 8px 0 0;
  border-top: 1px solid var(--border);
  padding: 9px 10px 1px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.policy-popover__links a {
  color: var(--primary);
  font-weight: 650;
  text-decoration: none;
}

.policy-popover__intro {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.policy-option > p:empty { display: none; }

.policy-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: oklch(0.96 0.03 25);
  padding: 0 12px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.policy-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.portfolio-notice {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 14px;
}

.portfolio-notice > div { display: grid; gap: 2px; min-width: 0; }
.portfolio-notice small { color: var(--muted); font-size: 12px; }
.portfolio-notice .button { margin-left: auto; }
.portfolio-notice__dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.portfolio-notice--info .portfolio-notice__dot,
.portfolio-notice--plan .portfolio-notice__dot { background: var(--information); }
.portfolio-notice--warning .portfolio-notice__dot { background: var(--warning); }
.portfolio-notice--off .portfolio-notice__dot { background: var(--danger); }
.portfolio-notice--global-stop {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.portfolio-notice--global-stop .portfolio-notice__dot { background: var(--danger); }

.portfolio-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 18px;
}

.portfolio-summary__metric {
  display: grid;
  gap: 1px;
}

.portfolio-summary__metric span,
.portfolio-summary__updated,
.index-summary-button span {
  color: var(--muted);
  font-size: 12px;
}

.portfolio-summary__metric strong {
  font-family: var(--font-mono);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.portfolio-summary__metric--small strong { font-size: 20px; }
.portfolio-summary__updated { margin-left: auto; }

.index-summary-button {
  display: flex;
  min-height: 44px;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
}

.index-summary-button strong { color: oklch(0.24 0.05 250); font-size: 13px; }
.portfolio-table--compact th,
.portfolio-table--compact td { padding: 12px 18px; }
.portfolio-table--compact th { font-family: inherit; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }

.money-overview {
  padding: 18px;
}

.money-overview__total {
  justify-content: flex-start;
  gap: 12px;
}

.money-overview__tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.money-overview__tools small {
  color: var(--muted);
  font-size: 12px;
}

.money-overview__total strong {
  font-family: var(--font-mono);
  font-size: 26px;
}

.money-state-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.money-state-grid > div {
  grid-template-columns: auto 1fr;
  min-width: 150px;
}

.money-state-grid strong {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: 16px;
}

.money-state-grid small {
  grid-column: 2;
  grid-row: 2;
  white-space: nowrap;
}

.money-state-dot { margin-top: 5px; border-radius: 2px; }
.money-decisions__header { border-bottom: 1px solid var(--border); padding: 14px 18px; font-size: 15px; font-weight: 650; }
.money-decision-row { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); padding: 14px 18px; }
.money-decision-row:last-child { border-bottom: 0; }
.money-decision-row > div { display: grid; gap: 2px; min-width: 0; }
.money-decision-row small { color: var(--muted); font-size: 12px; }
.money-decision-row > b { margin-left: auto; font-family: var(--font-mono); font-size: 15px; }

.compact-page-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.compact-page-heading > strong { font-size: 17px; }
.compact-page-heading > small { margin-left: auto; color: var(--muted); }
.compact-page-heading > .button { margin-left: auto; }


.custom-index-actions {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.custom-index-editor {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.custom-index-editor__body {
  flex: 1 1 auto;
  overflow-y: auto;
}

.custom-index-name {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}

.custom-index-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 44px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 9px 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.custom-index-columns span:nth-child(2) {
  text-align: right;
}

.custom-index-row {
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
}

.custom-index-row__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 44px;
  gap: 10px;
  align-items: center;
}

.custom-index-row input {
  min-width: 0;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-weight: 650;
}

.custom-index-row input[data-field="ticker"] {
  text-transform: uppercase;
}

.custom-index-row input[data-field="weight"] {
  text-align: right;
}

.custom-index-row input.is-invalid {
  border-color: var(--danger);
}

.custom-index-row button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.custom-index-row > p {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.custom-index-editor__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
}

.custom-index-paste {
  display: grid;
  gap: 8px;
  padding: 0 20px 14px;
}

.custom-index-paste textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-mono);
  resize: vertical;
}

.custom-index-editor__footer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 20px 16px;
}

.custom-index-total {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.custom-index-total strong {
  font-family: var(--font-mono);
  font-size: 16px;
}

.custom-index-total .button {
  margin-left: auto;
}

.custom-index-sum--valid {
  color: var(--positive);
}

.custom-index-sum--invalid {
  color: var(--danger);
}

.custom-index-editor__actions {
  display: flex;
  gap: 8px;
}

.custom-index-editor__actions .button--primary {
  flex: 1 1 auto;
}

.order-settings-form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.order-settings-form__body {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
}

.order-settings-form__body h3,
.order-settings-form__body p {
  margin: 0;
}

.order-settings-form__body > p {
  color: var(--muted);
  font-size: 13px;
}

.price-tolerance-option {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.price-tolerance-option--selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 650;
}

.price-tolerance-option__radio {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
}

.price-tolerance-option--selected .price-tolerance-option__radio {
  border: 5px solid var(--primary);
}

.price-tolerance-custom {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 0 12px;
}

.price-tolerance-custom input {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-weight: 650;
  text-align: right;
}

.order-settings-form__footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}

.order-settings-form__footer .button--primary {
  flex: 1 1 auto;
}

.order-settings-form__footer > p {
  width: 100%;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

/* Canonical desktop design. Keep current component rules here rather than
   stacking one-off overrides over the older screens above. */
:root {
  --line: oklch(0.9 0.008 85);
  --ink-2: oklch(0.3 0.01 85);
  --line-soft: oklch(0.95 0.008 85);
  --line-strong: oklch(0.62 0.012 85);
  --accent-line: oklch(0.6 0.07 250);
  --accent-ink: oklch(0.26 0.06 250);
  --pos-graphic: oklch(0.55 0.11 150);
  --sky: oklch(0.74 0.07 235);
  --neutral-graphic: oklch(0.72 0.012 85);
  --over: oklch(0.62 0.05 255);
  --warn-graphic: oklch(0.7 0.12 70);
  --disabled-bg: oklch(0.95 0.004 85);
  --disabled-ink: oklch(0.44 0.012 85);
  --disabled-line: oklch(0.8 0.008 85);
}

/* The authenticated application is one design system. These foundations are
   intentionally scoped and stronger than the retained pre-v9 rules above so
   an old component variant cannot silently change current controls. */
.design-v9 {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}
.design-v9 :focus-visible {
  outline: 3px solid oklch(0.45 0.12 250);
  outline-offset: 2px;
}
.design-v9 h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: normal;
  line-height: normal;
}
.design-v9 h2 {
  font-weight: 700;
  letter-spacing: normal;
}
.design-v9 .button {
  width: auto;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  transition: none;
}
.design-v9 .button:hover:not(:disabled) { transform: none; }
.design-v9 .button:disabled {
  border-color: var(--disabled-line);
  background: var(--disabled-bg);
  color: var(--disabled-ink);
  opacity: 1;
}
.design-v9 .button--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.design-v9 .button--primary:hover:not(:disabled) { background: var(--primary-hover); }
.design-v9 .button--quiet {
  width: auto;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.design-v9 .button--secondary {
  border-color: var(--accent-line);
  background: var(--primary-soft);
  color: var(--accent-ink);
}
.design-v9 .button--full { width: 100%; }
.design-v9 .button--fit { width: auto; }
.design-v9 .panel {
  margin-bottom: 0;
  border-radius: 10px;
  box-shadow: none;
}
.design-v9 .brand strong { font-weight: 700; }
.design-v9 .brand-mark { border-radius: 7px; font-weight: 700; }

.sidebar {
  width: 232px;
  gap: 18px;
  padding: 18px 0;
}

.app-main { margin-left: 232px; }
.primary-nav { gap: 0; margin: 0; }
.nav-link {
  min-height: 44px;
  border-left-width: 3px;
  padding: 0 14px 0 12px;
  color: oklch(0.3 0.01 85);
  font-size: 15px;
}
.nav-link--active { color: var(--accent-ink); font-weight: 600; }
.nav-label--compact { display: none; }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: oklch(0.95 0.04 85); color: oklch(0.32 0.06 60); font-size: 12px; font-weight: 700; text-align: center; }
.sidebar-stop { margin-top: auto; padding: 0 14px; }
.sidebar-stop form { margin: 0; }
.sidebar-stop > form > .button,
.sidebar-stop > div > .button,
.sidebar-stop > .button {
  width: 100%;
  min-height: 44px;
  gap: 8px;
  justify-content: flex-start;
  border: 1px solid oklch(0.6 0.12 25);
  border-radius: 8px;
  background: #fff;
  color: oklch(0.4 0.12 25);
  font-size: 14px;
  font-weight: 600;
}
.sidebar-stop > form > .button::before,
.sidebar-stop > div > .button::before,
.sidebar-stop > .button::before { width: 8px; height: 8px; flex: none; border-radius: 50%; background: oklch(0.52 0.14 25); content: ""; }
.sidebar-stop > .button--resume-all { background: oklch(0.96 0.03 25); cursor: default; }
.sidebar-session { padding: 0 14px; }
.sidebar-session form { margin: 0; }
.sidebar-session__button { width: 100%; min-height: 40px; border: 0; background: transparent; padding: 0 12px; color: var(--muted); cursor: pointer; text-align: left; }
.sidebar-session__button:hover { color: var(--ink); }

.confirm-dialog {
  width: min(500px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px oklch(0.2 0.01 85 / 0.2);
  padding: 22px;
  color: var(--ink);
}
.confirm-dialog::backdrop { background: oklch(0.2 0.01 85 / 0.32); }
.confirm-dialog--danger { border-color: oklch(0.6 0.12 25); }
.confirm-dialog h2 { margin: 0; font-size: 18px; }
.confirm-dialog p { margin: 8px 0 20px; color: var(--muted); font-size: 14px; }
.confirm-dialog > div { display: flex; gap: 8px; }
.confirm-dialog form { min-width: 0; flex: 1 1 auto; margin: 0; }
.confirm-dialog form .button { width: 100%; }
.confirm-dialog .button { min-height: 48px; }
.global-resume-dialog ul { margin: 14px 0 20px; padding: 0; list-style: none; }
.global-resume-dialog li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; border-bottom: 1px solid var(--line-soft); padding: 10px 0; font-size: 14px; }
.global-resume-dialog li b { font-weight: 600; }
.button--danger { border-color: oklch(0.52 0.14 25); background: oklch(0.52 0.14 25); color: #fff; }
.content-column,
.design-v9 .app-content {
  width: 100%;
  max-width: 1264px;
  margin-right: auto;
  margin-left: auto;
  padding-right: clamp(16px, 3vw, 32px);
  padding-left: clamp(16px, 3vw, 32px);
}
.global-stop-banner { border-bottom: 1px solid oklch(0.6 0.12 25); background: oklch(0.96 0.03 25); }
.global-stop-banner__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.global-stop-banner__inner > div { display: flex; min-width: 0; flex: 1 1 280px; flex-direction: column; gap: 3px; }
.global-stop-banner strong { color: oklch(0.4 0.12 25); font-size: 15px; font-weight: 600; }
.global-stop-banner span { color: oklch(0.4 0.12 25); font-size: 13px; }
.global-stop-banner form { margin: 0; }

.policy-toolbar {
  z-index: 25;
  display: block;
  min-height: 73px;
  border-left: 0;
  padding: 0;
  background: #fff;
}
.policy-toolbar__inner { display: flex; min-height: 73px; align-items: center; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.disclosure-chevron { display: block; width: 12px; height: 12px; flex: 0 0 12px; transition: transform 120ms ease; }
.policy-toolbar__inner > .sidebar-account {
  display: block;
  width: auto;
  flex: 0 0 auto;
  gap: 0;
  margin: 0;
  padding: 0;
}
.policy-toolbar__inner > .sidebar-account .account-switcher__current,
.policy-toolbar__inner > .sidebar-account .account-switcher__empty {
  min-width: 188px;
  min-height: 48px;
  padding: 6px 36px 6px 14px;
  border-color: var(--accent-line);
}
.account-switcher[open] .account-switcher__current { border-color: var(--primary); border-radius: 8px; }
.account-switcher__current::after { display: none; content: none; }
.account-switcher__current > .disclosure-chevron,
.account-switcher__empty > .disclosure-chevron { position: absolute; top: 18px; right: 14px; color: var(--muted); }
.account-switcher[open] .account-switcher__current > .disclosure-chevron { transform: rotate(180deg); }
.account-switcher__provider { padding: 0; font-size: 12px; }
.account-switcher__name-row strong { color: var(--accent-ink); font-size: 15px; font-weight: 700; }
.policy-toolbar__inner > .sidebar-account .account-switcher__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 360px;
  max-height: min(60vh, 440px);
  margin-top: 0;
  border: 1px solid oklch(0.88 0.008 85);
  border-radius: 10px;
  box-shadow: 0 18px 40px oklch(0.2 0.01 85 / 0.16);
  padding: 4px 8px 8px;
}
.account-switcher__search { display: block; padding: 6px 2px 2px; }
.account-switcher__search input { width: 100%; height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; }
.account-switcher__group > p { justify-content: flex-start; gap: 8px; padding: 8px 10px 4px; font-family: var(--font-sans); letter-spacing: 0; text-transform: none; }
.account-switcher__option { min-height: 48px; border-radius: 6px; padding: 4px 10px; }
.account-switcher__option > span { display: grid; min-width: 0; flex: 1 1 auto; }
.account-switcher__attention { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--neutral-graphic); }
.account-switcher__attention--danger { background: var(--danger); }
.account-switcher__attention--attention { background: var(--warn-graphic); }
.account-switcher__attention--off { background: var(--danger); }
.account-switcher__meta--danger { color: oklch(0.42 0.12 25) !important; }
.account-switcher__meta--attention { color: oklch(0.38 0.07 60) !important; }
.account-switcher__all { min-height: 44px; margin: 4px -8px -8px; padding: 11px 18px; border-top-color: var(--line-soft); }
.policy-toolbar__controls { min-width: 0; flex-wrap: nowrap; gap: 10px; }
.policy-chip {
  position: relative;
  width: 100%;
  min-height: 48px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  border-color: var(--line-strong);
  background: #fff;
  padding: 5px 12px;
}
.policy-menu { flex: 0 1 auto; }
.policy-chip__label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; line-height: 16px; }
.policy-chip__value { display: flex; min-width: 0; align-items: center; gap: 6px; line-height: 18px; }
.policy-chip strong { font-size: 14px; font-weight: 600; }
.policy-chip__value .disclosure-chevron { color: var(--muted); }
.policy-menu[open] > .policy-chip .disclosure-chevron { transform: rotate(180deg); }
.policy-chip--automatic,
.policy-chip--confirm { border-color: oklch(0.55 0.09 145); background: oklch(0.95 0.04 145); color: oklch(0.32 0.08 145); }
.policy-chip--automatic .policy-chip__dot,
.policy-chip--confirm .policy-chip__dot { width: 7px; height: 7px; background: oklch(0.5 0.1 145); }
.policy-chip--observe { border-color: var(--line-strong); background: oklch(0.97 0.008 85); color: var(--ink); }
.policy-chip--observe .policy-chip__dot { background: var(--neutral-graphic); }
.policy-chip--off { border-color: oklch(0.7 0.08 25); background: oklch(0.96 0.03 25); color: oklch(0.4 0.12 25); }
.policy-chip--off .policy-chip__dot { background: var(--danger); }
.policy-menu[open] > .policy-chip { border-color: var(--primary); border-radius: 8px; }
.policy-popover {
  top: calc(100% + 6px);
  width: 320px;
  max-width: calc(100vw - 32px);
  border: 1px solid oklch(0.88 0.008 85);
  border-radius: 10px;
  box-shadow: 0 18px 40px oklch(0.2 0.01 85 / 0.16);
  padding: 8px;
}
.policy-popover--outside,
.policy-popover--limit { right: 0; left: auto; }
.policy-option button { min-height: 48px; }
.policy-option__radio { width: 18px; height: 18px; }
.policy-option--selected .policy-option__radio { border-width: 5px; }
.policy-limit-options { display: grid; gap: 4px; }
.policy-limit-custom-option { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 10px; border: 0; border-radius: 6px; background: transparent; padding: 7px 10px; color: var(--ink); cursor: pointer; text-align: left; }
.policy-limit-custom-option:hover,
.policy-limit-custom-option.policy-option--selected { background: var(--primary-soft); }
.policy-limit-custom-option > span:last-child { display: grid; min-width: 0; gap: 1px; }
.policy-limit-custom-option strong { font-size: 14px; }
.policy-limit-custom-option small { color: var(--muted); font-size: 12px; }
.policy-limit-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line-soft); padding: 12px 10px 2px; }
.policy-limit-editor__input { display: flex; min-width: 0; height: 44px; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 0 12px; }
.policy-limit-editor__input input { min-width: 0; flex: 1 1 auto; border: 0; outline: 0; background: transparent; font-family: var(--font-mono); font-size: 15px; text-align: right; }
.policy-limit-editor__input > span:last-child { color: var(--muted); }
.policy-limit-editor > p { grid-column: 1 / -1; margin: 0; color: var(--danger); font-size: 12px; }
.policy-toolbar__actions .button { min-height: 44px; border-color: var(--accent-line); background: var(--primary-soft); color: var(--accent-ink); }

.design-v9 .app-content { padding-top: 24px; padding-bottom: 40px; }
.design-v9 .app-content > .flash { width: 100%; max-width: none; margin-right: 0; margin-left: 0; }
.design-v9 .app-content > .page-shell { margin-right: 0; margin-left: 0; }
.account-home { width: 100%; max-width: none; margin: 0; }
.portfolio-notice {
  min-height: 0;
  gap: 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--neutral-graphic);
  border-radius: 10px;
  padding: 16px 20px;
}
.portfolio-notice__dot { display: none; }
.portfolio-notice strong { font-size: 17px; font-weight: 600; }
.portfolio-notice small { font-size: 14px; }
.portfolio-notice--info { border-left-color: var(--primary); }
.portfolio-notice--plan { border-left-color: var(--pos-graphic); }
.portfolio-notice--warning { border-left-color: var(--warn-graphic); }
.portfolio-notice--off,
.portfolio-notice--global-stop { border-left-color: var(--danger); }

.account-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.account-dashboard-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  border-radius: 10px;
  padding: 20px;
}
.account-dashboard-card > h2 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.account-dashboard-card__amount { white-space: nowrap; font-family: var(--font-mono); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.account-share-list { display: flex; flex-direction: column; gap: 14px; }
.portfolio-share-row { display: flex; flex-direction: column; gap: 6px; }
.portfolio-share-row__line { display: flex; align-items: baseline; gap: 12px; }
.portfolio-share-row__line > span { min-width: 0; color: oklch(0.3 0.01 85); font-size: 14px; }
.portfolio-share-row__line > strong { margin-left: auto; white-space: nowrap; font-family: var(--font-mono); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.portfolio-share-row__line > em { width: 40px; flex: none; color: var(--muted); font-family: var(--font-mono); font-size: 13px; font-style: normal; text-align: right; }
.portfolio-share-row__track { display: block; width: 100%; height: 8px; overflow: hidden; appearance: none; border: 0; border-radius: 4px; background: oklch(0.95 0.006 85); color: var(--neutral-graphic); }
.portfolio-share-row__track::-webkit-progress-bar { border-radius: 4px; background: oklch(0.95 0.006 85); }
.portfolio-share-row__track::-webkit-progress-value { border-radius: 4px; background: currentColor; }
.portfolio-share-row__track::-moz-progress-bar { border-radius: 4px; background: currentColor; }
.portfolio-share-row--under .portfolio-share-row__track { color: var(--pos-graphic); }
.portfolio-share-row--matched .portfolio-share-row__track { color: var(--neutral-graphic); }
.portfolio-share-row--over .portfolio-share-row__track { color: var(--over); }
.money-share-row { display: flex; align-items: center; gap: 12px; }
.money-share-row__content { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.money-share-row__action { display: flex; width: 104px; flex: 0 0 104px; justify-content: flex-end; }
.money-share-row__action > .button { width: auto; min-height: 44px; padding: 0 14px; border-color: var(--line-strong); font-weight: 600; white-space: nowrap; }
.money-share-row__empty-value { color: var(--muted); font-family: var(--font-sans) !important; font-size: 14px !important; font-weight: 400 !important; }
.money-share-row--investable .portfolio-share-row__track { color: var(--pos-graphic); }
.money-share-row--cooling .portfolio-share-row__track { color: var(--sky); }
.money-share-row--waiting .portfolio-share-row__track { color: var(--warn-graphic); }
.money-share-row--reserved .portfolio-share-row__track { color: var(--neutral-graphic); }
.account-dashboard-card__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.account-dashboard-card__footer > span { min-width: 0; flex: 1 1 200px; color: var(--muted); font-size: 14px; }
.account-dashboard-card__footer .button { min-height: 44px; border-color: var(--line-strong); font-weight: 600; }
.account-dashboard-card__empty { color: var(--muted); font-size: 14px; }
.account-card-warning { margin: -4px -20px 0; border: 0; border-block: 1px solid var(--line-soft); padding: 10px 20px; }

.decisions-page { width: 100%; max-width: 760px; margin: 0; }
.decisions-page > .compact-page-heading { margin: 0 0 16px; }
.decisions-page > .compact-page-heading h1 { margin: 0; }
.decision-groups { display: flex; flex-direction: column; gap: 18px; }
.decision-group { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.decision-group > header { display: flex; align-items: baseline; gap: 10px; margin: 0 20px; border-bottom: 1px solid var(--line-soft); padding: 16px 0 10px; }
.decision-group > header h2 { margin: 0; font-size: 16px; font-weight: 700; }
.decision-group > header span { color: var(--muted); font-size: 13px; }
.decision-row { display: grid; min-height: 72px; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; margin: 0 20px; border-bottom: 1px solid var(--line-soft); padding: 10px 0; }
.decision-row:last-child { border-bottom: 0; }
.decision-row__marker { width: 10px; height: 10px; border-radius: 1px; background: var(--warn-graphic); }
.decision-row--plan-confirmation .decision-row__marker { background: var(--pos-graphic); }
.decision-row--cooling-cash .decision-row__marker { background: var(--sky); }
.decision-row--read-key .decision-row__marker,
.decision-row--cash-reconciliation .decision-row__marker,
.decision-row--trading-key .decision-row__marker { background: var(--danger); }
.decision-row__content { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.decision-row__content strong { font-size: 15px; font-weight: 600; }
.decision-row__content small { color: var(--muted); font-size: 12px; }
.decision-row > b { white-space: nowrap; font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.decision-row > .button { min-width: 86px; }
.decision-empty { padding: 22px 20px; color: var(--muted); font-size: 14px; }

.sheet-backdrop { z-index: 40; background: oklch(0.2 0.01 85 / 0.28); }
.side-sheet {
  z-index: 41;
  display: flex;
  width: min(560px, 100vw);
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 14px 0 0 14px;
  box-shadow: -18px 0 40px oklch(0.2 0.01 85 / 0.16);
}
.side-sheet:focus { outline: none; }
.side-sheet__close { display: grid; place-items: center; text-decoration: none; }
.side-sheet__header {
  position: static;
  flex: 0 0 auto;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  backdrop-filter: none;
}
.side-sheet__header > div { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; }
.side-sheet__header h2 { margin: 0; font-size: 18px; font-weight: 700; }
.side-sheet__header p { margin: 0; color: var(--muted); font-size: 13px; }
.side-sheet__close { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; color: oklch(0.4 0.012 85); font-size: 16px; font-weight: 400; }
.side-sheet__body { display: block; min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 0; }
.side-sheet__body--plan,
.side-sheet__body--confirmation,
.side-sheet__body--execution { overflow: hidden; }
.side-sheet__body--confirmation,
.side-sheet__body--execution { display: flex; flex-direction: column; }
.confirmation-sheet__scroll { min-height: 0; flex: 1 1 auto; }
.sheet-empty { padding: 24px 20px; color: var(--muted); }
.sheet-empty strong { color: var(--ink); }
.sheet-empty p { margin: 4px 0 0; }

.plan-sheet-layout { display: flex; height: 100%; min-height: 0; flex-direction: column; }
.plan-sheet__scroll { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.plan-inline-warning { border-bottom: 1px solid var(--line-soft); background: oklch(0.97 0.03 85); padding: 12px 20px; color: oklch(0.32 0.04 60); font-size: 13px; }
.plan-sheet-row {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 20px;
}
.plan-sheet-row__identity { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 1px; }
.plan-sheet-row__identity strong { font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.plan-sheet-row__identity span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.plan-sheet-row__stepper { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.plan-sheet-row__stepper button,
.plan-sheet-row__stepper input { width: 44px; height: 44px; flex: 0 0 44px; }
.plan-sheet-row__stepper button { border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font-size: 18px; cursor: pointer; }
.plan-sheet-row__stepper button:disabled { border-color: var(--disabled-line); background: var(--disabled-bg); color: var(--disabled-ink); cursor: not-allowed; }
.plan-sheet-row__stepper input { appearance: textfield; border: 0; background: transparent; font-family: var(--font-mono); font-size: 15px; font-weight: 600; text-align: center; }
.plan-sheet-row__stepper input::-webkit-inner-spin-button,
.plan-sheet-row__stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.plan-sheet-row__sum { width: 118px; flex: 0 0 118px; white-space: nowrap; font-family: var(--font-mono); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.plan-sheet-row__lots { flex: 0 0 auto; color: var(--muted); font-family: var(--font-mono); font-size: 14px; }
.plan-sheet-row--removed { background: var(--surface-subtle); color: var(--muted); }
.plan-skipped h3 { margin: 0; padding: 14px 20px 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.plan-skipped > div { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); padding: 10px 20px; }
.plan-skipped strong { width: 72px; flex: 0 0 72px; color: var(--muted); font-family: var(--font-mono); font-size: 14px; }
.plan-skipped span { color: oklch(0.4 0.012 85); font-size: 13px; }
.plan-sheet__footer { display: flex; flex: 0 0 auto; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding: 16px 20px; }
.plan-sheet__footer > div:not(.plan-sheet__actions) { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.plan-sheet__footer span { color: var(--muted); }
.plan-sheet__footer strong { font-family: var(--font-mono); font-size: 17px; font-weight: 700; }
.plan-sheet__footer b { font-family: var(--font-mono); font-weight: 400; }
.plan-sheet__actions { display: flex; gap: 8px; padding-top: 4px; }
.plan-sheet__actions .button { min-height: 48px; }
.plan-sheet__actions .button--primary { flex: 1 1 auto; }

.confirmation-sheet__scroll { overflow-y: auto; }
.confirmation-sheet__total { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 10px; }
.confirmation-sheet__total strong { white-space: nowrap; font-family: var(--font-mono); font-size: 30px; font-weight: 600; }
.confirmation-sheet__total span { color: var(--muted); font-size: 14px; }
.confirmation-sheet__lines { border-top: 1px solid var(--border); }
.confirmation-sheet__lines > div { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 12px 20px; }
.confirmation-sheet__lines strong { min-width: 0; flex: 1 1 auto; font-family: var(--font-mono); font-size: 14px; }
.confirmation-sheet__lines span { flex: 0 0 auto; color: oklch(0.4 0.012 85); font-size: 14px; }
.confirmation-sheet__lines b { width: 118px; flex: 0 0 118px; font-family: var(--font-mono); font-size: 14px; text-align: right; }
.confirmation-sheet__price { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; font-size: 14px; }
.confirmation-sheet__price > span { color: var(--muted); }
.confirmation-sheet__price a { color: var(--primary); text-decoration: underline; }
.confirmation-sheet__footer { display: flex; gap: 8px; border-top: 1px solid var(--border); padding: 16px 20px; }
.confirmation-sheet__footer form,
.confirmation-sheet__footer > .button--primary { min-width: 0; flex: 1 1 auto; }
.confirmation-sheet__footer > .button--quiet { flex: 0 0 auto; }
.confirmation-sheet__footer form .button { width: 100%; min-height: 48px; }
.confirmation-sheet__footer > .button { min-height: 48px; }
.confirmation-sheet__footer p { margin: 4px 0 0; color: var(--danger); font-size: 12px; }

.execution-sheet__summary { border-bottom: 1px solid var(--border); padding: 14px 20px; font-size: 15px; font-weight: 600; }
.execution-sheet__lines { min-height: 0; overflow-y: auto; }
.execution-sheet__lines > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-bottom: 1px solid var(--line-soft); padding: 12px 20px; }
.execution-sheet__lines strong { min-width: 0; flex: 1 1 90px; font-family: var(--font-mono); font-size: 14px; }
.execution-sheet__lines b { width: 118px; flex: 0 0 118px; font-family: var(--font-mono); font-size: 14px; text-align: right; }
.execution-status { display: flex; min-height: 28px; align-items: center; gap: 7px; border-radius: 14px; background: var(--primary-soft); padding: 0 10px; color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.execution-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.execution-status--filled { background: oklch(0.95 0.04 145); color: oklch(0.32 0.08 145); }
.execution-status--filled i { background: oklch(0.5 0.1 145); }
.execution-status--partially-filled { background: oklch(0.96 0.04 80); color: oklch(0.36 0.07 60); }
.execution-status--partially-filled i { background: var(--warn-graphic); }
.execution-status--rejected,
.execution-status--review-required,
.execution-status--blocked { background: oklch(0.96 0.03 25); color: oklch(0.4 0.12 25); }
.execution-status--rejected i,
.execution-status--review-required i,
.execution-status--blocked i { background: var(--danger); }
.execution-sheet__footer { margin-top: auto; border-top: 1px solid var(--border); padding: 16px 20px; }

.side-sheet__body--money,
.side-sheet__body--reserve { overflow: hidden; }
.money-sheet-layout,
.reserve-sheet-layout { display: flex; height: 100%; min-height: 0; flex-direction: column; }
.money-sheet__scroll,
.reserve-sheet__scroll { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.money-sheet__total { display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--border); padding: 18px 20px; white-space: nowrap; font-family: var(--font-mono); font-size: 26px; font-weight: 600; }
.money-sheet__total small { color: var(--muted); font-family: var(--font-sans); font-size: 13px; font-weight: 400; }
.money-sheet__section { display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); padding: 18px 20px; }
.money-sheet__section > strong,
.reserve-sheet__editor > strong { font-size: 15px; font-weight: 700; }
.money-decision-input { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
.money-decision-input button,
.money-decision-input input,
.reserve-sheet__stepper button,
.reserve-sheet__stepper input { height: 44px; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); }
.money-decision-input button,
.reserve-sheet__stepper button { width: 44px; padding: 0; font-size: 18px; cursor: pointer; }
.money-decision-input input,
.reserve-sheet__stepper input { appearance: textfield; background: var(--surface-subtle); padding: 0 12px; font-family: var(--font-mono); font-size: 16px; font-weight: 600; text-align: right; }
.money-decision-input input::-webkit-inner-spin-button,
.money-decision-input input::-webkit-outer-spin-button,
.reserve-sheet__stepper input::-webkit-inner-spin-button,
.reserve-sheet__stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.money-decision-quick { display: flex; grid-template-columns: none; flex-wrap: wrap; gap: 8px; }
.money-decision-quick .button { min-height: 44px; border-radius: 22px; padding: 0 16px; }
.money-sheet__remainder > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.money-sheet__remainder b { white-space: nowrap; font-family: var(--font-mono); font-size: 16px; }
.money-sheet__choice { display: flex; min-height: 48px; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; cursor: pointer; }
.money-sheet__choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.money-sheet__choice input { width: 18px; height: 18px; accent-color: var(--primary); }
.money-sheet__footer,
.reserve-sheet__footer { display: flex; flex: 0 0 auto; gap: 8px; border-top: 1px solid var(--border); padding: 16px 20px; }
.money-sheet__footer .button--primary,
.reserve-sheet__footer .button--primary { min-width: 0; flex: 1 1 auto; }
.money-sheet__footer .button--quiet,
.reserve-sheet__footer .button--quiet { flex: 0 0 auto; }
.money-sheet__footer .button,
.reserve-sheet__footer .button { min-height: 48px; }
.money-sheet__footer p:empty,
.reserve-sheet__footer p:empty { display: none; }
.money-sheet__footer p:not(:empty),
.reserve-sheet__footer p:not(:empty) { width: 100%; margin: 4px 0 0; color: var(--danger); font-size: 12px; }
.money-sheet__footer:has(p:not(:empty)),
.reserve-sheet__footer:has(p:not(:empty)) { flex-wrap: wrap; }
.reserve-sheet__editor { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.reserve-sheet__stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; }
.reserve-sheet__fact { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.reserve-sheet__fact span { color: var(--muted); }
.reserve-sheet__fact b { white-space: nowrap; font-family: var(--font-mono); font-weight: 600; }
.reserve-sheet__warning { border: 1px solid oklch(0.7 0.09 75); border-radius: 8px; background: oklch(0.97 0.03 85); padding: 12px 14px; color: oklch(0.32 0.04 60); font-size: 13px; line-height: 1.5; }

.composition-sheet { display: flex; flex-direction: column; }
.composition-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.composition-filter { display: inline-flex; min-height: 44px; align-items: center; border: 1px solid var(--line-strong); border-radius: 22px; padding: 0 14px; color: var(--ink); font-size: 14px; text-decoration: none; }
.composition-filter--active { border-color: var(--primary); background: var(--primary-soft); color: var(--accent-ink); }
.composition-table__head,
.composition-table__row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px 72px; gap: 10px; align-items: center; }
.composition-table__head { padding: 8px 20px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.composition-table__head span:not(:first-child) { text-align: right; }
.composition-table__row { min-height: 52px; border-top: 1px solid var(--line-soft); padding: 8px 20px; }
.composition-table__row > div { display: flex; min-width: 0; flex-direction: column; }
.composition-table__row strong { font-family: var(--font-mono); font-size: 14px; }
.composition-table__row span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.composition-table__row > b { font-family: var(--font-mono); font-size: 13px; font-weight: 400; text-align: right; }
.composition-table__row--underweight > b:last-child { color: oklch(0.4 0.1 150); }
.composition-table__row--overweight > b:last-child,
.composition-table__row--out > b:last-child { color: oklch(0.42 0.07 255); }

.index-catalog-sheet__row { display: flex; min-height: 68px; align-items: center; gap: 16px; border-bottom: 1px solid var(--line-soft); padding: 10px 20px; }
.index-catalog-sheet__row > div { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 2px; }
.index-catalog-sheet__row strong { font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.index-catalog-sheet__row span { color: var(--muted); font-size: 13px; }
.index-catalog-sheet__row form { flex: 0 0 auto; margin: 0; }
.index-catalog-sheet__row .button { border-color: var(--line-strong); }
.index-catalog-sheet__selected { white-space: nowrap; }
.api-keys-sheet__summary { display: flex; align-items: center; gap: 9px; margin: 0 20px 12px; border-radius: 8px; background: var(--surface-subtle); padding: 12px 14px; color: var(--ink-2); font-size: 14px; }
.api-keys-sheet__summary--ready { background: oklch(0.96 0.025 150); color: var(--positive); }
.api-keys-sheet__summary--ready .status-dot { background: var(--positive); }
.api-key-attestation { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.api-key-attestation input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; }

.broker-directory { width: 100%; max-width: none; gap: 20px; }
.broker-directory > .compact-page-heading { margin: 0; }
.compact-page-heading > strong { font-size: 24px; font-weight: 700; }
.broker-provider-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.broker-provider-panel .panel__header { padding: 0 0 10px; border: 0; }
.broker-provider-panel .panel__header > div { gap: 10px; }
.broker-provider-panel__header h2 { font-size: 16px; }
.broker-account-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.broker-account-list .account-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 16px;
}
.broker-account-list .account-card:last-child { border-bottom: 1px solid var(--border); }
.account-card__identity { display: flex; flex-direction: row; align-items: baseline; gap: 8px; }
.account-card__identity strong { font-size: 16px; }
.account-card__identity small { margin-left: auto; font-size: 13px; }
.account-card__state { display: flex; min-height: 22px; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.account-card__state .status-dot { width: 8px; height: 8px; margin: 0; border-radius: 50%; box-shadow: none; background: var(--neutral-graphic); }
.account-card__state--automatic .status-dot,
.account-card__state--confirm .status-dot { background: var(--pos-graphic); }
.account-card__state--off { color: oklch(0.4 0.12 25); }
.account-card__state--off .status-dot { background: var(--danger); }
.account-card__details { display: flex; flex-direction: column; gap: 0; border-block: 1px solid var(--line-soft); }
.account-card__details > div { display: flex; min-height: 42px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.account-card__details > div:last-child { border-bottom: 0; }
.account-card__details span { min-width: 0; flex: 1 1 auto; color: var(--muted); }
.account-card__details a { flex: 0 0 auto; color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.account-card__actions { margin-top: auto; justify-content: stretch; }
.account-card__actions .button { width: 100%; min-width: 0; flex: 1 1 auto; border-color: var(--accent-line); background: var(--primary-soft); color: var(--accent-ink); }
.account-card__actions .button { min-height: 44px; padding-inline: 14px; }
.account-card--selected { background: #fff !important; }

.connect-wizard__body { padding: 20px; }
.connect-wizard__body h3 { margin: 18px 0 6px; font-size: 18px; }
.connect-wizard__body p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.connect-wizard__form { display: grid; gap: 16px; }
.connect-wizard__provider { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 16px; text-decoration: none; }
.connect-wizard__provider strong { font-size: 15px; }
.connect-wizard__provider span { color: var(--accent-ink); font-size: 14px; }

.api-keys-sheet__list { display: flex; flex-direction: column; }
.api-keys-sheet__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; border-bottom: 1px solid var(--line-soft); padding: 16px 20px; }
.api-keys-sheet__row--active { background: oklch(0.985 0.012 145); }
.api-keys-sheet__row > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.api-keys-sheet__row > div:first-child strong { font-size: 15px; font-weight: 600; }
.api-keys-sheet__row > div:first-child span { color: var(--muted); font-size: 12px; }
.api-key-state { display: flex; min-height: 28px; align-items: center; gap: 7px; align-self: center; border-radius: 14px; background: var(--surface-subtle); padding: 0 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.api-key-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral-graphic); }
.api-key-state--ready { background: oklch(0.95 0.04 145); color: oklch(0.32 0.08 145); }
.api-key-state--ready i { background: oklch(0.5 0.1 145); }
.api-keys-sheet__actions { display: flex; grid-column: 1 / -1; gap: 8px; justify-content: flex-end; }
.api-keys-sheet__actions form { margin: 0; }
.api-key-sheet-form { border-bottom: 1px solid var(--border); padding: 18px 20px; }
.api-key-sheet-form h3 { margin: 0 0 14px; font-size: 15px; }
.api-key-sheet-form__actions { display: flex; gap: 8px; }
.api-key-sheet-form__actions .button--primary { flex: 1 1 auto; }

.security-page-v9 { display: flex; width: 100%; max-width: 760px; flex-direction: column; gap: 18px; }
.security-page-v9 > h1 { margin: 0; font-size: 24px; font-weight: 700; }
.security-card { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 18px 20px 0; }
.security-card > h2,
.security-card > div > h2 { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.security-key-list > div { display: flex; min-height: 60px; align-items: center; gap: 16px; border-top: 1px solid var(--line-soft); padding: 8px 0; }
.security-key-list strong { min-width: 0; flex: 1 1 auto; font-size: 15px; font-weight: 600; }
.security-key-list form { margin: 0; }
.security-key-list__protected { display: flex; align-items: center; gap: 10px; }
.security-key-list__protected small { max-width: 150px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.security-key-list p,
.security-card footer p,
.security-card--row form p { margin: 4px 0 0; color: var(--danger); font-size: 12px; }
.security-card > footer { border-top: 1px solid var(--line-soft); padding: 12px 0 16px; }
.security-card__empty { border-top: 1px solid var(--line-soft); padding: 14px 0; color: var(--muted); }
.security-card--row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px 20px; }
.security-card--row > div { min-width: 0; flex: 1 1 240px; }
.security-card--row > div h2 { margin-bottom: 2px; color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.security-card--row > div span { color: var(--muted); font-size: 13px; }
.security-flow-card { width: min(100%, 420px); margin-inline: auto; }
.security-flow-card .page-heading { margin-bottom: 16px; }
.security-flow-card .page-heading .brand-mark { margin-bottom: 18px; }
.security-flow-card .page-heading h1 { margin: 0; font-size: 24px; }
.security-flow-card .page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.security-flow-card .panel { border-radius: 10px; padding: 20px; }
.security-flow-card form { max-width: none; }
.security-flow-card .inline-link { display: inline-block; margin-top: 14px; }
.recovery-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.recovery-code-grid li { margin: 0; min-width: 0; border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 6px; text-align: center; }
.recovery-code-grid code { white-space: nowrap; font-family: var(--font-mono); font-size: 13px; }
.recovery-code-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.recovery-code-feedback { min-height: 18px; color: var(--muted); font-size: 12px; }
.custom-index-sum--empty { color: var(--muted); }
.order-settings-form__footer { align-items: flex-start; }
.order-settings-form__footer .button--primary { min-width: 0; flex: 1 1 auto; }
.order-settings-form__footer .button--quiet { flex: 0 0 auto; }
.mobile-sign-out,
.mobile-popover-title,
.mobile-stop-state,
.mobile-disclosure-backdrop { display: none; }

@media (max-width: 1111px) and (min-width: 1000px) {
  .policy-toolbar__inner { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .policy-toolbar__inner > .sidebar-account { min-width: 220px; flex: 1 1 auto; }
  .policy-toolbar__controls { width: 100%; flex: 1 1 100%; order: 3; overflow: visible; }
  .policy-toolbar__actions { width: auto; order: 2; margin-left: auto; }
  .account-dashboard { grid-template-columns: 1fr; }
}

@media (max-width: 999px) {
  .app-shell { display: flex; min-height: 100vh; flex-direction: column; }
  .sidebar {
    display: flex;
    position: sticky;
    inset: 0 0 auto;
    z-index: 30;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
  }
  .brand { padding: 0; }
  .primary-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-link { min-height: 44px; border: 0; border-radius: 8px; padding: 0 12px; font-size: 14px; }
  .nav-label--wide { display: none; }
  .nav-label--compact { display: inline; }
  .sidebar-stop { margin: 0 0 0 auto; padding: 0; }
  .sidebar-stop > form > .button,
  .sidebar-stop > div > .button,
  .sidebar-stop > .button { width: auto; padding: 0 12px; }
  .sidebar-session { padding: 0; }
  .sidebar-session__button { width: auto; min-height: 44px; padding: 0 10px; }
  .mobile-security-link { display: none; }
  .app-main { margin-left: 0; }
  .policy-toolbar__inner { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .policy-toolbar__inner > .sidebar-account { flex: 1 1 220px; }
  .policy-toolbar__controls { flex: 1 1 100%; flex-wrap: wrap; order: 3; }
  .policy-toolbar__controls .policy-menu { flex: 1 1 150px; }
  .policy-toolbar__actions { width: auto; order: 2; margin-left: auto; }
}

@media (max-width: 879px) {
  .account-dashboard,
  .broker-account-list { grid-template-columns: 1fr; }
}

@media (min-width: 768px) and (max-width: 820px) {
  .design-v9 .app-content { padding-top: 18px; }
  .policy-toolbar__inner > .sidebar-account { flex: 1 1 100%; }
  .policy-toolbar__controls { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); order: 2; }
  .policy-toolbar__controls .policy-menu { min-width: 0; }
  .policy-toolbar__actions { width: 100%; order: 3; margin: 0; }
  .policy-toolbar__actions form,
  .policy-toolbar__actions .button { width: 100%; }
  .policy-popover { width: min(320px, calc(100vw - 32px)); max-width: none; }
  .policy-popover--limit { right: 0; left: auto; }
}

/* Mobile 4.2: the same account state, with bottom navigation and bottom sheets. */
@media (max-width: 767px) {
  html { scroll-padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body { font-size: 14px; }
  .app-shell { display: flex; min-height: 100dvh; flex-direction: column; }
  .sidebar {
    display: flex;
    position: relative;
    inset: auto;
    z-index: 10;
    width: 100%;
    min-height: 56px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  }
  .brand { min-width: 0; gap: 10px; padding: 0; }
  .brand strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
  .primary-nav {
    display: grid;
    position: fixed;
    inset: auto 0 0;
    z-index: 22;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--border-strong);
    background: #fff;
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .nav-link,
  .nav-link--active {
    display: flex;
    min-width: 0;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-top: 3px solid transparent;
    border-radius: 0;
    background: #fff;
    padding: 0 2px;
    color: oklch(0.4 0.012 85);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
  }
  .nav-link[aria-current="page"] { border-top-color: var(--primary); color: oklch(0.26 0.06 250); font-weight: 600; }
  .nav-label--wide { display: none; }
  .nav-label--compact { display: inline; }
  .nav-count { width: 20px; min-width: 20px; height: 20px; margin: 0; padding: 0; font-size: 11px; line-height: 20px; }
  .sidebar-stop { flex: 0 0 auto; margin: 0; padding: 0; }
  .sidebar-stop > div > .button { width: auto; min-height: 44px; padding: 0 12px; white-space: nowrap; }
  .mobile-stop-state { display: flex; min-height: 44px; align-items: center; border: 1px solid oklch(0.6 0.12 25); border-radius: 8px; background: oklch(0.96 0.03 25); padding: 0 10px; color: oklch(0.4 0.12 25); font-size: 12px; font-weight: 600; }
  .sidebar-session { display: none; }
  .mobile-sign-out { display: flex; justify-content: flex-end; }
  .mobile-sign-out form { margin: 0; }
  .app-main { min-width: 0; margin-left: 0; }
  .design-v9 .app-content { width: 100%; padding: 20px 16px calc(80px + env(safe-area-inset-bottom)); }
  .design-v9 .app-content > .page-shell { width: 100%; max-width: none; }
  .content-column { padding-right: 16px; padding-left: 16px; }
  .global-stop-banner__inner { gap: 10px; padding-top: 12px; padding-bottom: 12px; }
  .global-stop-banner__inner > div { flex-basis: 100%; }
  .global-stop-banner .button { width: 100%; }
  .global-stop-banner form { width: 100%; }

  .policy-toolbar { position: relative; z-index: 1; overflow: visible; }
  .policy-toolbar:has(details[open]) { z-index: 45; }
  .policy-toolbar__inner {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px;
  }
  .policy-toolbar__inner > .sidebar-account { grid-column: 1 / -1; order: 1; width: 100%; min-width: 0; }
  .policy-toolbar__inner > .sidebar-account .account-switcher__current,
  .policy-toolbar__inner > .sidebar-account .account-switcher__empty { width: 100%; min-width: 0; min-height: 48px; }
  .account-switcher__name-row { min-width: 0; }
  .account-switcher__name-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .policy-toolbar__controls { display: contents; }
  .policy-toolbar__controls .policy-menu { width: 100%; min-width: 0; }
  .policy-toolbar__controls .policy-menu:nth-child(1) { grid-column: 1; order: 3; }
  .policy-toolbar__controls .policy-menu:nth-child(2) { grid-column: 1 / -1; order: 2; }
  .policy-toolbar__controls .policy-menu:nth-child(3) { grid-column: 2; order: 4; }
  .policy-chip { width: 100%; min-width: 0; min-height: 48px; }
  .policy-chip__value { width: 100%; }
  .policy-chip__value strong { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .policy-chip__value .disclosure-chevron { margin-left: auto; }
  .policy-toolbar__actions { grid-column: 1 / -1; order: 5; width: 100%; margin: 0; }
  .policy-toolbar__actions form,
  .policy-toolbar__actions .button { width: 100%; }
  .policy-toolbar__actions .button { min-height: 44px; }
  .mobile-disclosure-backdrop { display: none; }
  details[open] > .mobile-disclosure-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    width: 100%;
    height: 100%;
    border: 0;
    background: oklch(0.2 0.01 85 / 0.28);
    cursor: default;
  }
  .policy-popover,
  .policy-popover--index,
  .policy-popover--mode,
  .policy-popover--limit,
  .policy-toolbar__inner > .sidebar-account .account-switcher__menu {
    position: fixed;
    inset: auto 0 0;
    z-index: 41;
    width: 100%;
    max-width: none;
    max-height: 80dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 32px oklch(0.2 0.01 85 / 0.18);
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  }
  .mobile-popover-title { display: block; padding: 8px 10px 6px; font-size: 16px; font-weight: 700; }
  .account-switcher__menu .mobile-popover-title { padding: 10px 10px 6px; }
  .account-switcher__menu .account-switcher__group { max-height: none; }
  .account-switcher__search { padding: 6px 2px; }

  .portfolio-notice { flex-wrap: wrap; gap: 10px; padding: 16px; }
  .portfolio-notice strong { font-size: 17px; }
  .portfolio-notice .button,
  .portfolio-notice form { width: 100%; margin-left: 0; }
  .portfolio-notice .button { justify-content: center; }
  .account-dashboard,
  .broker-account-list { grid-template-columns: 1fr; gap: 16px; }
  .account-dashboard-card { padding: 16px; }
  .account-dashboard-card__amount { font-size: clamp(23px, 7vw, 30px); }
  .money-share-row { flex-wrap: wrap; gap: 8px 12px; }
  .money-share-row__content { flex: 1 1 100%; }
  .money-share-row__action { width: auto; flex: 0 0 auto; margin-left: auto; }
  .money-share-row__action:empty { display: none; }
  .account-dashboard-card__footer { gap: 10px; }

  .side-sheet {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 32px oklch(0.2 0.01 85 / 0.18);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .side-sheet::before { display: block; width: 40px; height: 4px; flex: 0 0 4px; align-self: center; margin-top: 8px; border-radius: 2px; background: var(--border-strong); content: ""; }
  .side-sheet__header { padding: 10px 12px 12px 16px; }
  .side-sheet__header > div { flex: 1 1 auto; }
  .side-sheet__header h2 { font-size: 18px; }
  .side-sheet__body { min-width: 0; }
  .sheet-section { padding-inline: 16px; }
  .sheet-lead { padding-inline: 16px; }
  .plan-sheet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 16px; }
  .plan-sheet-row__identity { grid-column: 1 / -1; }
  .plan-sheet-row__stepper { grid-column: 1; }
  .plan-sheet-row__sum { grid-column: 2; width: auto; min-width: 0; flex: none; margin: 0; }
  .plan-sheet-row__lots { grid-column: 1; }
  .plan-sheet__footer,
  .money-sheet__footer,
  .reserve-sheet__footer,
  .confirmation-sheet__footer { padding: 12px 16px; }
  .confirmation-sheet__lines > div { flex-wrap: wrap; padding-inline: 16px; }
  .confirmation-sheet__lines strong { flex: 1 1 110px; }
  .confirmation-sheet__lines b { width: auto; flex: 0 0 auto; margin-left: auto; }
  .composition-table__head,
  .composition-table__row { grid-template-columns: minmax(0, 1fr) 50px 50px 58px; gap: 5px; padding-right: 16px; padding-left: 16px; }
  .composition-table__head { font-size: 11px; }
  .composition-filters { padding-inline: 16px; }
  .money-sheet__total,
  .money-sheet__section,
  .reserve-sheet__editor { padding-right: 16px; padding-left: 16px; }
  .money-sheet__total { font-size: clamp(21px, 6vw, 26px); }
  .reserve-sheet__fact { flex-wrap: wrap; }
  .decision-row { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; }
  .decision-row > b { grid-column: 2; }
  .decision-row > .button { grid-column: 3; grid-row: 1 / span 2; }
  .broker-directory > .compact-page-heading { flex-wrap: wrap; }
  .broker-directory > .compact-page-heading > .button { width: 100%; margin-left: 0; }
  .broker-provider-panel__header { flex-wrap: wrap; }
  .broker-account-list .account-card { padding: 16px; }
  .security-page-v9 { max-width: none; }
  .security-page-v9 > h1 { font-size: 22px; }
  .security-key-list > div { align-items: flex-start; flex-wrap: wrap; }
  .security-key-list > div > form,
  .security-key-list__protected { margin-left: auto; }
  .security-flow-card { width: 100%; }
  .auth-shell { align-items: flex-start; padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
  .auth-column { width: 100%; }
  .auth-card { padding: 20px 16px; }
  .confirm-dialog {
    position: fixed;
    inset: auto 12px max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    margin: 0;
    padding: 20px;
  }
  .confirm-dialog > div { flex-wrap: wrap; }
}
