:root {
  background: var(--bg);
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #fff;
  --surface-mid: #edf0f2;
  --text: #222d35;
  --muted: #56636c;
  --line: #dbe0e4;
  --accent: #126d60;
  --accent-soft: #eaf4ef;
  --positive: #1d6b4c;
  --negative: #b32e40;
  --warning: #875b09;
  --fund-1: #258574;
  --fund-2: #547cb8;
  --fund-3: #b98328;
  --fund-4: #8b6bb0;
  --shadow: 0 1px 2px #182b3810;
  --radius-control: 6px;
  --radius-panel: 8px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  --control-line: #7d8992;
  --accent-solid: #126d60;
  --accent-hover: #0d5c51;
  --on-accent: #fff;
  --buy: #245fb3;
  --sell: #a34f1c;
  --disabled-bg: #e9edef;
  --disabled-text: #7b858d;
  --focus: #126d60;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #121619;
    --surface: #1b2024;
    --surface-mid: #262d32;
    --text: #eaf0f3;
    --muted: #a8b2ba;
    --line: #353f46;
    --accent: #79d7be;
    --accent-soft: #223b33;
    --positive: #7bd8af;
    --negative: #f49ba9;
    --warning: #e5bd73;
    --shadow: 0 1px 3px #0002;
    --control-line: #74828d;
    --accent-solid: #267e6d;
    --accent-hover: #2a8171;
    --on-accent: #fff;
    --buy: #94bff4;
    --sell: #edb184;
    --fund-1: #50b69f;
    --fund-2: #80a8dc;
    --fund-3: #dbb361;
    --fund-4: #b69bd7;
    --disabled-bg: #2c3338;
    --disabled-text: #84919a;
    --focus: #79d7be;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121619;
  --surface: #1b2024;
  --surface-mid: #262d32;
  --text: #eaf0f3;
  --muted: #a8b2ba;
  --line: #353f46;
  --accent: #79d7be;
  --accent-soft: #223b33;
  --positive: #7bd8af;
  --negative: #f49ba9;
  --warning: #e5bd73;
  --shadow: 0 1px 3px #0002;
  --control-line: #74828d;
  --accent-solid: #267e6d;
  --accent-hover: #2a8171;
  --on-accent: #fff;
  --buy: #94bff4;
  --sell: #edb184;
  --fund-1: #50b69f;
  --fund-2: #80a8dc;
  --fund-3: #dbb361;
  --fund-4: #b69bd7;
  --disabled-bg: #2c3338;
  --disabled-text: #84919a;
  --focus: #79d7be;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 1;
  color: var(--disabled-text);
  background: var(--disabled-bg);
  border-color: var(--line);
  box-shadow: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  outline: 2px solid var(--negative);
}
input,
textarea {
  border: 1px solid var(--control-line);
  background: var(--surface);
  border-radius: var(--radius-control);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input {
  min-width: 0;
}
textarea {
  resize: vertical;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 0.9375rem;
  font-weight: 650;
}
h3 {
  font-size: 0.875rem;
  font-weight: 650;
}
small {
  font-size: 0.875rem;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  padding: 10px 20px;
  background: var(--surface);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  clip-path: none;
  width: auto;
  height: auto;
}
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1312px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 20px;
}
.header-main {
  display: contents;
}
.ecosystem-link {
  font-size: 0.875rem;
  color: var(--muted);
  order: 3;
  margin-left: auto;
}
.header-actions {
  display: flex;
  gap: 2px;
  order: 4;
}
.icon-button {
  height: 36px;
  width: 36px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  font-size: 1.375rem;
  line-height: 1;
}
.icon-button:hover:not(:disabled) {
  background: var(--surface-mid);
}
.header-navigation {
  display: contents;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  order: 1;
  flex-shrink: 0;
}
.brand img {
  width: 30px;
  height: 30px;
}
.brand h1 {
  font-size: 1rem;
  letter-spacing: -0.025em;
}
.brand small {
  font-size: 0.75rem;
  line-height: 1;
  display: block;
}
.workspace-nav {
  display: flex;
  gap: 4px;
  order: 2;
  height: 100%;
  margin-left: 28px;
}
.workspace-nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 16px;
  background: transparent;
  font-size: 0.875rem;
  color: var(--muted);
}
.workspace-nav button:hover:not(:disabled) {
  color: var(--text);
}
.workspace-nav .is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 650;
}
.dashboard-main {
  max-width: 1368px;
  margin: auto;
  padding: 22px 28px 0;
}
.dashboard-main:focus {
  outline: none;
}
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 5px;
}
.workspace-heading h2 {
  font-size: 1.5625rem;
  letter-spacing: -0.03em;
  line-height: 1.5;
}
.local-badge {
  color: var(--muted);
  font-size: 0.75rem;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.snapshot-grid {
  margin-bottom: 22px;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.kpi-card {
  min-width: 0;
  padding: 0 22px;
  border-left: 1px solid var(--line);
}
.kpi-card:first-child {
  border-left: 0;
  padding-left: 0;
}
.kpi-label {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  margin-bottom: 7px;
}
.kpi-value {
  display: block;
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi-status {
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  line-height: 1.7;
}
.amount-unit {
  font-size: max(0.55em, 0.75rem);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.kpi-card small {
  display: block;
  margin-top: 7px;
  font-size: 0.75rem;
}
.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.13fr);
  gap: 28px;
  align-items: start;
}
.work-area > section {
  min-width: 0;
  scroll-margin-top: 84px;
}
.work-area > [data-view-panel="rules"] {
  grid-column: 1/-1;
}
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.span-7 {
  grid-column: span 7;
}
.span-5 {
  grid-column: span 5;
}
.span-8,
.span-4 {
  grid-column: 1/-1;
}
.input-grid {
  gap: 16px;
}
.table-card,
.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  min-width: 0;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
}
.card-header p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  max-width: 48em;
}
.step-number {
  display: inline-grid;
  place-items: center;
  height: 19px;
  width: 19px;
  background: var(--surface-mid);
  font-size: 0.75rem;
  border-radius: 4px;
  color: var(--muted);
  margin-right: 5px;
  vertical-align: 1px;
}
.theme-menu { position: relative; }
.theme-menu summary { display: grid; place-items: center; list-style: none; cursor: pointer; }
.theme-menu summary::-webkit-details-marker { display: none; }
.theme-menu[open] summary { background: var(--surface-mid); color: var(--accent); }
.theme-menu fieldset {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 8px);
  width: 168px;
  padding: 6px;
  margin: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--control-line);
  border-radius: var(--radius-panel);
  box-shadow: 0 8px 24px #0003;
}
.theme-menu label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.theme-menu label:hover { background: var(--surface-mid); }
.theme-menu label:has(:checked) { background: var(--accent-soft); color: var(--accent); }
.theme-menu input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.theme-menu summary:focus-visible, .theme-menu input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  min-height: 34px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s;
}
.button-primary:not(:disabled) {
  background: var(--accent-solid);
  color: var(--on-accent);
}
.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.button-secondary {
  border-color: var(--control-line);
  background: var(--surface);
}
.button-secondary:hover:not(:disabled) {
  background: var(--surface-mid);
}
.table-scroll {
  width: 100%;
  min-width: 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.875rem;
}
th {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  background: var(--surface);
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
.numeric {
  text-align: right;
}
.mono {
  font-variant-numeric: tabular-nums;
}
.fund-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 10px;
  border-left: 3px solid var(--fund-color, var(--line));
  line-height: 1.6;
}
.fund-name strong {
  font-size: 0.875rem;
  font-weight: 550;
}
.fund-name span {
  font-size: 0.75rem;
  letter-spacing: 0.015em;
  color: var(--muted);
}
.fund-target {
  font-size: 0.75rem;
  display: inline-block;
  margin-left: 8px;
}
.fund-name:hover strong {
  color: var(--accent);
}
.holdings-table .target-cell {
  display: none;
}
.input-hint {
  white-space: nowrap;
}
.table-input {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 5px;
  min-height: 40px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-control);
  padding: 0 9px;
  width: 116px;
  background: var(--surface);
  margin-left: auto;
}
.table-input:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.table-input input {
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  border: 0;
  background: transparent;
  border-radius: 0;
  width: 100%;
  height: 36px;
  text-align: right;
  outline: none;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.table-input span {
  font-size: 0.75rem;
  color: var(--muted);
}
.state-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 0.75rem;
  white-space: nowrap;
}
.is-pending {
  color: var(--muted);
}
.is-safe {
  color: var(--positive);
  background: var(--accent-soft);
}
.is-breach {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}
.holdings-table [data-weight] {
  font-size: 0.875rem;
}
.holdings-table th:first-child,
.holdings-table td:first-child {
  padding-left: 20px;
}
.holdings-table th:last-child,
.holdings-table td:last-child {
  padding-right: 16px;
}
.dashboard-card > .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px 20px 0;
}
.field > span {
  font-size: 0.75rem;
  color: var(--muted);
}
.input-shell {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  gap: 8px;
}
.input-shell input {
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: 1.6875rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  outline: none;
}
.input-shell:focus-within {
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 0 var(--focus);
}
.input-shell b {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}
.field small {
  font-size: 0.75rem;
}
.flow-modes {
  margin: 0 20px;
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-mid);
  border-radius: var(--radius-control);
}
.flow-modes button {
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  flex: 1;
  padding: 6px 8px;
  min-height: 30px;
  font-size: 0.875rem;
}
.flow-modes button[aria-pressed="true"] {
  background: var(--surface);
  box-shadow:
    0 1px 3px #13252b18,
    0 0 0 1px var(--line);
  color: var(--text);
  font-weight: 600;
}
.generate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
}
.generate-actions > span {
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 130px;
}
.generate-actions .button {
  min-width: 160px;
  min-height: 40px;
  font-size: 0.875rem;
}
.bulk-panel {
  padding: 16px 20px;
  background: var(--surface-mid);
  border-block: 1px solid var(--line);
}
.bulk-panel label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
  margin-bottom: 10px;
  gap: 12px;
}
.bulk-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bulk-controls textarea {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
}
.allocation-details,
.plan-audit {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 12px;
}
.allocation-details > summary,
.plan-audit > summary {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}
.allocation-details[open] > summary > span,
.plan-audit[open] > summary > span {
  transform: rotate(45deg);
}
summary::-webkit-details-marker {
  display: none;
}
.allocation-card {
  padding: 12px 0 0;
}
.allocation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.allocation-header h2 {
  font-size: 0.875rem;
}
.ring-key {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}
.ring-key i {
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 4px;
  vertical-align: middle;
  border-radius: 4px;
}
.ring-key .is-current {
  background: var(--accent);
}
.ring-key .is-target {
  background: var(--muted);
}
.allocation-layout {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}
.allocation-chart {
  height: 150px;
  width: 150px;
  position: relative;
}
.allocation-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ring-gradient);
}
.allocation-ring:after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--bg);
}
.allocation-ring-target {
  inset: 20px;
  opacity: 0.55;
}
.allocation-ring-target:after {
  inset: 5px;
}
.allocation-center {
  position: absolute;
  inset: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  text-align: center;
}
.allocation-center strong {
  font-size: 0.875rem;
  letter-spacing: -0.03em;
}
.allocation-center small {
  font-size: 0.75rem;
}
.allocation-legend {
  min-width: 0;
}
.allocation-item {
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.allocation-item:last-child {
  border-bottom: 0;
}
.allocation-item i,
.unchanged-item i {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: var(--fund-color);
  flex-shrink: 0;
}
.allocation-item > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.allocation-item strong {
  font-size: 0.75rem;
  font-weight: 500;
}
.allocation-item small {
  font-size: 0.75rem;
}
.allocation-values {
  margin-left: auto;
  text-align: right;
}
.allocation-values b {
  font-size: 0.875rem;
  font-weight: 550;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 35px;
  margin-bottom: 14px;
}
.section-heading h2 {
  margin-right: auto;
  font-size: 1rem;
}
.return-edit {
  display: none;
}
.empty-panel {
  min-height: 462px;
  border-radius: var(--radius-panel);
  padding: 65px 28px;
  background: color-mix(in srgb, var(--surface) 50%, var(--bg));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.empty-plan-diagram {
  width: 144px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 25px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-panel);
}
.empty-plan-diagram span {
  height: 7px;
  border-radius: 2px;
  background: var(--line);
}
.empty-plan-diagram span:nth-child(2) {
  width: 75%;
}
.empty-plan-diagram span:nth-child(3) {
  width: 45%;
  background: var(--accent);
  opacity: 0.3;
}
.empty-panel strong {
  font-size: 1rem;
  font-weight: 550;
}
.empty-panel p {
  max-width: 300px;
  margin: 9px auto 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.9;
}
.empty-panel ol {
  list-style: none;
  padding: 0;
  margin: 26px auto 0;
  text-align: left;
  width: fit-content;
  font-size: 0.875rem;
  color: var(--muted);
}
.empty-panel li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.empty-panel li span {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
}
.empty-panel .return-edit {
  margin-top: 20px;
}
.decision-card {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: start;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 16px 18px;
  border-radius: 0 var(--radius-panel) var(--radius-panel) 0;
  margin-bottom: 20px;
}
.decision-card h3 {
  font-size: 1rem;
  margin-bottom: 5px;
  letter-spacing: -0.02em;
}
.decision-card p {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.75;
}
.decision-card[data-state="warning"] {
  border-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 7%, var(--surface));
}
.decision-badge {
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--accent);
  padding-top: 3px;
}
.result-kpis {
  gap: 0;
  margin-bottom: 22px;
}
.result-kpis .kpi-card {
  padding: 0 15px;
}
.result-kpis .kpi-card:first-child {
  padding-left: 0;
}
.result-kpis .kpi-value {
  font-size: 1.375rem;
}
.result-kpis .kpi-status {
  font-size: 0.875rem;
  line-height: 1.9;
}
.positive {
  color: var(--positive);
}
.negative {
  color: var(--negative);
}
.warning {
  color: var(--warning);
}
.execution-card {
  overflow: hidden;
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.pill {
  background: var(--surface-mid);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--muted);
}
.execution-card table,
.execution-card tbody {
  display: block;
}
.execution-card thead {
  display: none;
}
.execution-card tr {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 5px 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.execution-card tr:last-child {
  border-bottom: 0;
}
.execution-card td {
  padding: 0;
  border: 0 !important;
  min-width: 0;
}
.execution-card td:first-child {
  grid-column: 1;
}
.execution-card td:nth-child(2) {
  grid-column: 2;
}
.trade-amount {
  grid-column: 3;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.4;
}
.trade-final {
  grid-column: 1;
  text-align: left;
  font-size: 0.75rem;
  color: var(--muted);
  padding-left: 10px !important;
}
.trade-weight {
  grid-column: 2/-1;
  font-size: 0.75rem;
  color: var(--muted);
}
.trade-final:before {
  content: attr(data-label) " ";
  font-size: 0.75rem;
}
.trade-weight:before {
  content: attr(data-label) " ";
  font-size: 0.75rem;
}
.reason-cell {
  grid-column: 1/-1;
  font-size: 0.75rem;
  color: var(--muted);
  padding-left: 10px !important;
  line-height: 1.8;
}
.result-fund {
  border-left: 0;
  padding-left: 10px;
}
.result-fund strong {
  font-size: 0.875rem;
}
.result-fund span {
  font-size: 0.75rem;
}
.action-pill {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.action-pill i {
  font-style: normal;
}
.risk-note {
  padding: 11px 18px;
  background: var(--surface-mid);
  font-size: 0.75rem;
  color: var(--muted);
}
.unchanged-trades {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  font-size: 0.75rem;
  color: var(--muted);
}
.unchanged-trades summary {
  cursor: pointer;
}
.unchanged-list {
  padding-top: 6px;
}
.unchanged-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.75rem;
  flex-wrap: wrap;
}
.unchanged-item > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.unchanged-item b {
  font-weight: 500;
}
.no-trades {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 124px;
  color: var(--positive);
  gap: 8px;
}
.no-trades span {
  font-size: 1.5rem;
}
.no-trades strong {
  font-size: 0.875rem;
  font-weight: 550;
}
.result-grid {
  display: block;
}
.result-grid .dashboard-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.result-grid .card-header {
  padding: 14px 0;
}
.comparison-row {
  margin-bottom: 16px;
}
.comparison-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 7px;
  gap: 12px;
}
.comparison-head strong {
  font-weight: 500;
}
.comparison-head span {
  color: var(--muted);
  font-size: 0.75rem;
}
.compare-line {
  display: grid;
  grid-template-columns: 36px 1fr 54px;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  margin: 5px 0;
  color: var(--muted);
}
.compare-line em {
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.compare-track {
  height: 6px;
  background: var(--line);
  position: relative;
}
.compare-track b {
  height: 100%;
  display: block;
}
.before-bar {
  background: var(--muted);
}
.after-bar {
  background: var(--accent);
}
.target-line {
  position: absolute;
  top: -3px;
  height: 12px;
  width: 1px;
  background: var(--text);
}
.calculation-list {
  margin: 0;
  font-size: 0.75rem;
}
.calculation-list > div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.calculation-list dt {
  color: var(--muted);
}
.calculation-list dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.status-banner {
  position: sticky;
  top: 80px;
  z-index: 19;
  scroll-margin-top: 90px;
  border-radius: var(--radius-control);
  padding: 11px 16px;
  background: var(--accent-soft);
  margin-bottom: 18px;
  font-size: 0.875rem;
  color: var(--positive);
}
.status-banner.is-error {
  color: var(--negative);
  background: color-mix(in srgb, var(--negative) 8%, var(--surface));
}
.manual-copy {
  width: 100%;
  min-height: 180px;
  padding: 15px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}
.band-row {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.band-name {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
}
.band-name span {
  color: var(--muted);
  font-size: 0.75rem;
}
.band-track {
  height: 12px;
  background: var(--surface-mid);
  position: relative;
  margin: 12px 0;
}
.band-safe {
  position: absolute;
  height: 100%;
  background: var(--accent-soft);
  border-inline: 1px solid var(--accent);
}
.band-track i {
  position: absolute;
  height: 18px;
  width: 2px;
  top: -3px;
  background: var(--accent);
}
.band-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.75rem;
}
.band-values span {
  font-size: 0.75rem;
  color: var(--muted);
}
.rule-copy ol {
  list-style: none;
  padding: 0 20px;
  margin: 0 0 20px;
}
.rule-copy li {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.rule-copy li > span {
  font-size: 0.875rem;
  color: var(--accent);
}
.rule-copy b {
  font-size: 0.875rem;
  font-weight: 550;
}
.rule-copy p,
.local-use > p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.9;
}
.local-use {
  grid-column: 1/-1;
  padding-bottom: 18px;
}
.local-use > p {
  padding: 0 20px 8px;
}
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 0.75rem;
  gap: 20px;
}
.footer a:hover {
  text-decoration: underline;
}
.footer > div {
  text-align: right;
}
#planHeading {
  scroll-margin-top: 92px;
}
#planHeading:focus {
  outline: none;
}
.action-pill.positive,
.trade-amount.positive,
#buyTotal {
  color: var(--buy);
}
.action-pill.negative,
.trade-amount.negative,
#sellTotal {
  color: var(--sell);
}
.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button-primary:active:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(1px);
}
::selection {
  background: var(--accent-soft);
}

@media (min-width: 1100px) {
  .workspace-heading {
    margin-bottom: 16px;
  }
  .workspace-heading .eyebrow {
    display: none;
  }
  .snapshot-grid {
    padding: 14px 0;
    margin-bottom: 20px;
  }
  .holdings-table td {
    padding-block: 10px;
  }
  .holdings-table th {
    padding-block: 7px;
  }
  .cash-flow-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .cash-flow-card > .card-header {
    grid-column: 1/-1;
    padding-block: 12px;
  }
  .cash-flow-card .flow-modes {
    grid-column: 1;
    grid-row: 2;
    margin: 0 0 0 20px;
    align-self: center;
  }
  .cash-flow-card > .field {
    grid-column: 2;
    grid-row: 2;
    margin: 0 20px 0 16px;
    gap: 2px;
  }
  .cash-flow-card .field small {
    display: none;
  }
  .cash-flow-card .input-shell input {
    font-size: 1.5rem;
    padding: 0;
  }
  .cash-flow-card .generate-actions {
    grid-column: 1/-1;
    padding-block: 12px;
  }
  .cash-flow-card .generate-actions > span {
    max-width: none;
  }
  .cash-flow-card .generate-actions .button {
    min-height: 36px;
  }
}
@media (max-width: 1270px) and (min-width: 1100px) {
  .holdings-table td {
    padding-inline: 8px;
  }
  .holdings-table th {
    padding-inline: 8px;
  }
  .table-input {
    width: 100px;
  }
  .fund-name strong {
    font-size: 0.875rem;
  }
  .work-area {
    gap: 20px;
  }
  .execution-card tr {
    gap: 7px 10px;
  }
  .trade-amount {
    font-size: 1.375rem;
  }
  .result-kpis .kpi-card {
    padding: 0 10px;
  }
  .result-kpis .kpi-value {
    font-size: 1.375rem;
  }
}
@media (max-width: 1099px) {
  .work-area {
    display: block;
  }
  .dashboard-main {
    max-width: 900px;
  }
  .return-edit {
    display: inline-flex;
  }
  .workspace-nav {
    margin-left: 12px;
  }
  .workspace-heading {
    margin-bottom: 20px;
  }
  .input-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }
  .span-8 {
    grid-column: 1;
  }
  .span-4 {
    grid-column: 2;
  }
  .holdings-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 13px 18px;
    border-top: 1px solid var(--line);
  }
  .holdings-table thead {
    display: none;
  }
  .holdings-table td {
    border: 0;
    padding: 0 !important;
  }
  .holdings-table td:first-child {
    grid-column: 1;
    grid-row: 1/3;
  }
  .holdings-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
  }
  .holdings-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.75rem;
    display: inline;
  }
  .holdings-table td:last-child {
    display: none;
  }
  .table-input {
    width: 130px;
  }
  .generate-actions {
    flex-direction: column;
  }
  .generate-actions > span {
    max-width: 100%;
  }
  .generate-actions .button {
    width: 100%;
    min-width: 0;
  }
  .allocation-details {
    max-width: 470px;
  }
  .snapshot-grid {
    padding: 18px 0;
  }
  .snapshot-grid .kpi-value {
    font-size: 1.4375rem;
  }
  .snapshot-grid .kpi-status {
    font-size: 1.0625rem;
  }
  .execution-card tr {
    grid-template-columns: 1fr auto auto;
  }
  .result-grid {
    display: grid;
  }
  .result-grid .span-7 {
    grid-column: 1/-1;
  }
  .result-grid .span-5 {
    grid-column: 1/-1;
  }
  .empty-panel {
    min-height: 420px;
  }
  .result-kpis .kpi-value {
    font-size: 1.375rem;
  }
  .result-kpis .kpi-status {
    font-size: 1.0625rem;
  }
  .empty-panel p {
    max-width: 340px;
  }
  .header-actions .icon-button {
    height: 40px;
    width: 40px;
  }
  .ecosystem-link {
    display: none;
  }
}
@media (max-width: 700px) {
  .status-banner {
    top: 124px;
    scroll-margin-top: 134px;
  }
  .app-header {
    height: 112px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 64px 48px;
    padding: 0 18px;
    gap: 0;
  }
  .header-navigation,
  .header-main {
    display: contents;
  }
  .brand {
    grid-column: 1;
    grid-row: 1;
  }
  .header-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 4px;
  }
  .header-actions .icon-button {
    height: 44px;
    width: 38px;
  }
  .workspace-nav {
    grid-column: 1/-1;
    grid-row: 2;
    order: 5;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 0;
  }
  .workspace-nav button {
    padding: 0 8px;
    min-height: 44px;
    font-size: 0.875rem;
  }
  .dashboard-main {
    padding: 22px 16px 0;
  }
  .workspace-heading {
    align-items: start;
    margin-bottom: 18px;
  }
  .workspace-heading h2 {
    font-size: 1.4375rem;
  }
  .local-badge {
    display: none;
  }
  .snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 18px;
    margin-bottom: 22px;
    padding: 16px 0;
  }
  .snapshot-grid .kpi-card {
    padding: 0 14px;
  }
  .snapshot-grid .kpi-card:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
  .snapshot-grid .kpi-value {
    font-size: 1.5625rem;
  }
  .snapshot-grid .kpi-status {
    font-size: 1.0625rem;
  }
  .snapshot-grid .kpi-card small {
    font-size: 0.75rem;
  }
  .input-grid {
    display: block;
  }
  .input-grid > .dashboard-card {
    margin-top: 16px;
  }
  .card-header {
    padding: 16px;
  }
  .card-header p {
    font-size: 0.75rem;
    max-width: 200px;
  }
  .card-header .button {
    font-size: 0.75rem;
    min-height: 34px;
  }
  .holdings-table tr {
    padding: 15px 16px;
    gap: 5px 12px;
  }
  .fund-name strong {
    font-size: 0.875rem;
  }
  .fund-name span {
    font-size: 0.75rem;
  }
  .fund-target {
    display: block;
    margin-left: 0;
    font-size: 0.75rem;
    line-height: 1.5;
  }
  .table-input {
    width: 126px;
    min-height: 44px;
  }
  .table-input input {
    height: 42px;
    font-size: 1.125rem;
  }
  .table-input span {
    font-size: 0.75rem;
  }
  .holdings-table td:nth-child(4) {
    font-size: 0.75rem;
  }
  .flow-modes {
    margin: 0 16px;
  }
  .flow-modes button {
    min-height: 36px;
  }
  .dashboard-card > .field {
    margin: 12px 16px 18px;
  }
  .input-shell input {
    font-size: 1.75rem;
    min-height: 44px;
  }
  .field small {
    font-size: 0.75rem;
  }
  .generate-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px #00000006;
    z-index: 15;
    flex-direction: row;
    gap: 16px;
  }
  .generate-actions > span {
    font-size: 0.75rem;
    max-width: 120px;
    flex: 1;
  }
  .generate-actions .button {
    min-height: 44px;
    flex: 1;
    width: auto;
    font-size: 0.8125rem;
  }
  .dashboard-content:has([data-view-panel="workspace"]:not([hidden])) {
    padding-bottom: 85px;
  }
  .allocation-details {
    margin-top: 20px;
  }
  .allocation-layout {
    grid-template-columns: 132px 1fr;
    gap: 12px;
  }
  .allocation-chart {
    width: 132px;
    height: 132px;
  }
  .allocation-center {
    inset: 36px 14px;
  }
  .allocation-center strong {
    font-size: 0.875rem;
  }
  .allocation-item small {
    font-size: 0.75rem;
  }
  .allocation-item strong {
    font-size: 0.75rem;
  }
  .allocation-values b {
    font-size: 0.75rem;
  }
  .allocation-header {
    margin-bottom: 10px;
  }
  .bulk-panel {
    padding: 14px 16px;
  }
  .bulk-panel label {
    font-size: 0.75rem;
    flex-wrap: wrap;
    gap: 4px;
  }
  .bulk-panel small {
    font-size: 0.75rem;
  }
  .section-heading {
    margin-bottom: 18px;
  }
  .section-heading h2 {
    font-size: 1.125rem;
  }
  .section-heading .button {
    min-height: 36px;
    font-size: 0.75rem;
    padding-inline: 10px;
  }
  .empty-panel {
    min-height: 390px;
    padding: 35px 20px;
  }
  .empty-panel p {
    font-size: 0.875rem;
  }
  .result-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 0;
    margin-bottom: 22px;
  }
  .result-kpis .kpi-card {
    padding: 0 14px;
  }
  .result-kpis .kpi-card:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
  .result-kpis .kpi-value {
    font-size: 1.375rem;
  }
  .result-kpis .kpi-status {
    font-size: 1.125rem;
    line-height: 1.5;
  }
  .decision-card {
    padding: 15px;
    gap: 8px;
    margin-bottom: 22px;
  }
  .decision-card h3 {
    font-size: 1rem;
  }
  .decision-card p {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.75;
  }
  .decision-badge {
    font-size: 0.75rem;
  }
  .execution-card tr {
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    padding: 16px 14px;
  }
  .execution-card td:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  .execution-card td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    padding-left: 10px !important;
  }
  .trade-amount {
    grid-column: 2;
    grid-row: 1/3;
    font-size: 1.375rem;
  }
  .trade-final {
    grid-column: 1;
    grid-row: 3;
    padding-left: 10px !important;
  }
  .trade-weight {
    grid-column: 2;
    grid-row: 3;
  }
  .reason-cell {
    font-size: 0.75rem;
  }
  .result-fund strong {
    font-size: 0.875rem;
  }
  .result-fund span {
    font-size: 0.75rem;
  }
  .risk-note {
    font-size: 0.75rem;
    padding: 11px 14px;
  }
  .plan-audit {
    margin-top: 20px;
  }
  .unchanged-trades {
    padding: 12px 14px;
  }
  .unchanged-item {
    font-size: 0.75rem;
  }
  .grid-12 {
    display: block;
  }
  .grid-12 > .dashboard-card {
    margin-bottom: 16px;
  }
  .band-row {
    padding: 14px 16px;
  }
  .band-values span {
    font-size: 0.75rem;
  }
  .rule-copy ol {
    padding: 0 16px;
  }
  .rule-copy p {
    font-size: 0.875rem;
  }
  .local-use > p {
    padding-inline: 16px;
  }
  .footer {
    margin-top: 24px;
    font-size: 0.75rem;
    padding-block: 16px;
  }
  .status-banner {
    position: sticky;
    top: 120px;
    z-index: 12;
    font-size: 0.875rem;
    box-shadow: var(--shadow);
  }
  input,
  textarea {
    scroll-margin-top: 140px;
    scroll-margin-bottom: 130px;
    border: 1px solid var(--control-line);
  }
  #planHeading {
    scroll-margin-top: 130px;
  }
  .result-grid .dashboard-card {
    margin-bottom: 0;
  }
}
@media (max-width: 360px) {
  .dashboard-main {
    padding-inline: 12px;
  }
  .card-header {
    padding: 14px 12px;
  }
  .holdings-table tr {
    padding: 14px 12px;
    gap: 4px 8px;
  }
  .fund-name {
    padding-left: 7px;
  }
  .fund-name strong {
    font-size: 0.875rem;
  }
  .table-input {
    width: 112px;
  }
  .card-header p {
    max-width: 170px;
    font-size: 0.75rem;
  }
  .card-header .button {
    padding: 7px 9px;
  }
  .allocation-layout {
    grid-template-columns: 115px 1fr;
    gap: 8px;
  }
  .allocation-chart {
    height: 115px;
    width: 115px;
  }
  .allocation-center strong {
    font-size: 0.75rem;
  }
  .allocation-item small {
    font-size: 0.75rem;
  }
  .trade-amount {
    font-size: 1.375rem;
  }
  .result-fund strong {
    font-size: 0.875rem;
  }
  .trade-weight,
  .trade-final {
    font-size: 0.75rem;
  }
  .trade-weight:before,
  .trade-final:before {
    font-size: 0.75rem;
  }
  .generate-actions {
    padding-inline: 12px;
  }
  .snapshot-grid .kpi-value {
    font-size: 1.4375rem;
  }
  .snapshot-grid .kpi-status {
    font-size: 1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
