:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --bg-deep: #edf2ec;
  --surface: #ffffff;
  --surface-strong: #f2f7f3;
  --surface-soft: #e7f4ee;
  --text: #10271e;
  --text-soft: #344a41;
  --muted: #596b62;
  --line: #c8d8d0;
  --line-soft: rgba(64, 104, 86, 0.14);
  --emerald: #087f67;
  --emerald-strong: #0b9b7d;
  --gold: #b97913;
  --danger: #cf3f55;
  --warning: #c98010;
  --info: #386fb3;
  --rise: #b72f45;
  --chart-primary: var(--rise);
  --chart-benchmark: #53779f;
  --module-gap: 28px;
  --card-gap: 24px;
  --rise-soft: #fff0f2;
  --fall: #087f63;
  --fall-soft: #e9f7f0;
  --drawdown: #16725b;
  --volatility: #a66a14;
  --recovery: #7356b4;
  --shadow: 0 24px 70px rgba(34, 63, 50, 0.12);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --content: 1180px;
  --header-height: 76px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 9% -4%, rgba(44, 172, 133, 0.13), transparent 31rem),
    radial-gradient(circle at 93% 7%, rgba(236, 188, 84, 0.13), transparent 29rem),
    linear-gradient(180deg, #fbfbf7 0, var(--bg) 32rem, #f3f5f0 100%);
  color: var(--text);
  font-family: Inter, "IBM Plex Sans", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--emerald);
  color: #062017;
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid rgba(110, 231, 183, 0.85);
  outline-offset: 3px;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  width: min(calc(100% - 32px), var(--content));
  margin: 12px auto 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(139, 180, 163, 0.2);
  border-radius: 20px;
  background: rgba(6, 16, 13, 0.86);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px);
}

.brand {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand img {
  width: 36px;
  height: 36px;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.primary-nav a,
.nav-account-button {
  min-height: 44px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"],
.nav-account-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.primary-nav .nav-cta {
  margin-left: 5px;
  background: var(--emerald);
  color: #062017;
}

.primary-nav .nav-cta:hover {
  background: #8af0c9;
  color: #03110c;
}

.nav-divider {
  width: 1px;
  height: 24px;
  margin: 0 5px;
  background: var(--line);
}

.nav-toggle {
  display: none;
}

.icon-button {
  width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

main {
  flex: 1;
}

.page,
.page-narrow {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 84px 0 96px;
}

.page-narrow {
  max-width: 760px;
}

.page-loading {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
}

.loading-line {
  width: 96px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft);
}

.loading-line::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--emerald);
  animation: load 1.2s var(--ease) infinite alternate;
}

@keyframes load {
  from { transform: translateX(-20%); }
  to { transform: translateX(145%); }
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--emerald);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.18;
  text-wrap: balance;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(42px, 7vw, 78px);
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(20px, 2.4vw, 24px);
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 10px;
  font-size: 19px;
  letter-spacing: -0.015em;
}

.lead {
  max-width: 700px;
  color: var(--text-soft);
  font-size: clamp(17px, 2vw, 20px);
}

.muted,
.section-copy,
.fine-print {
  color: var(--muted);
}

.fine-print {
  font-size: 13px;
}

.hero {
  min-height: 620px;
  padding: 80px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: center;
  gap: 64px;
}

.hero h1 span {
  display: block;
  background: linear-gradient(95deg, var(--text) 12%, #a7f3d0 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(42px, 5.6vw, 68px);
}

.hero h1 span {
  white-space: nowrap;
}

.hero-actions,
.button-row {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 48px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--emerald);
  color: #04130d;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}

.button:hover {
  background: #8af0c9;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover {
  border-color: #4d7767;
  background: var(--surface-strong);
}

.button.danger {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
}

.button.small {
  min-height: 40px;
  padding: 8px 13px;
  font-size: 13px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.hero-panel {
  position: relative;
  min-height: 440px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(16, 35, 28, 0.94), rgba(6, 16, 13, 0.8));
  box-shadow: var(--shadow);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 22% -35% -42% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 231, 183, 0.13), transparent 64%);
}

.signal-header,
.card-header,
.section-heading,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.signal-header span,
.status-badge,
.pill {
  min-height: 28px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: 999px;
  background: rgba(110, 231, 183, 0.08);
  color: var(--emerald);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.signal-date {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.mini-allocation {
  position: relative;
  z-index: 1;
  margin-top: 38px;
  flex: 1;
  display: grid;
  gap: 14px;
}

.mini-asset {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
}

.mini-asset strong {
  font-size: 14px;
}

.mini-asset span {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--emerald-strong), var(--gold));
}

.progress-track .access-meter-0 {
  width: 70%;
}

.progress-track .access-meter-1 {
  width: 79%;
}

.progress-track .access-meter-2 {
  width: 88%;
}

.hero-panel-note {
  position: relative;
  z-index: 1;
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.trust-strip {
  padding: 22px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.trust-item {
  padding: 4px 24px;
  border-right: 1px solid var(--line-soft);
}

.trust-item:first-child {
  padding-left: 0;
}

.trust-item:last-child {
  border-right: 0;
}

.trust-item strong {
  display: block;
  font-size: 18px;
}

.trust-item span {
  color: var(--muted);
  font-size: 12px;
}

.section {
  padding: 104px 0 16px;
}

.section-heading {
  margin-bottom: 34px;
}

.section-copy {
  max-width: 550px;
}

.metrics-grid,
.feature-grid,
.allocation-grid,
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.feature-card,
.panel,
.allocation-card,
.auth-card,
.notice-card {
  border: 1px solid var(--line-soft);
  background: rgba(11, 24, 20, 0.82);
}

.metric-card,
.feature-card,
.allocation-card {
  padding: 22px;
  border-radius: var(--radius);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  margin-top: 12px;
  display: block;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.metric-foot {
  margin-top: 9px;
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric-value.positive,
.positive {
  color: var(--emerald);
}

.negative {
  color: var(--danger);
}

.feature-card {
  min-height: 190px;
}

.feature-index {
  margin-bottom: 34px;
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.page-hero {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--line-soft);
}

.page-hero h1 {
  max-width: 900px;
  font-size: clamp(40px, 6vw, 64px);
}

.panel {
  padding: 26px;
  border-radius: var(--radius);
}

.chart-panel {
  margin-top: 28px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.range-button {
  min-width: 52px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.range-button:hover,
.range-button.active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 340px;
  margin-top: 26px;
}

.chart-wrap svg {
  width: 100%;
  height: 340px;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(143, 164, 155, 0.15);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--chart-primary);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.chart-line.secondary-line {
  stroke: var(--chart-benchmark);
  stroke-width: 1.4;
  stroke-dasharray: 4 5;
}

.pill.warning {
  border-color: rgba(217, 119, 6, 0.35);
  background: #fff7df;
  color: #9a5a08;
}

.pill.danger {
  border-color: rgba(207, 63, 85, 0.36);
  background: #fff0f3;
  color: #b21e3b;
}

.chart-reveal-mask {
  transform-box: fill-box;
  transform-origin: left center;
  animation: chart-reveal-left 680ms cubic-bezier(0.22, 0.7, 0.25, 1) both;
}

@keyframes chart-reveal-left {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chart-layout-compact .chart-label,
.chart-layout-compact .chart-end-badge text {
  font-size: 13px;
}

.chart-legend {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-key::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--chart-primary);
}

.legend-key.secondary::before {
  background: var(--chart-benchmark);
}

.gate-card {
  margin-top: 28px;
  padding: 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(16, 35, 28, 0.95), rgba(11, 24, 20, 0.68)),
    var(--surface);
}

.gate-card p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.allocation-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.allocation-card .asset-code {
  color: var(--muted);
  font-size: 12px;
}

.allocation-weight {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--emerald);
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.status-line {
  margin: 24px 0;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 13px;
  background: rgba(125, 211, 252, 0.07);
  color: #d8f3ff;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 5px rgba(125, 211, 252, 0.1);
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: rgba(16, 35, 28, 0.7);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: rgba(110, 231, 183, 0.035);
}

.auth-layout {
  min-height: calc(100vh - 190px);
  padding: 72px 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.55fr);
  align-items: center;
  gap: 80px;
}

.auth-intro h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.auth-proof {
  margin-top: 34px;
  display: grid;
  gap: 14px;
}

.auth-proof div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  color: var(--text-soft);
  font-size: 14px;
}

.proof-mark {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: 8px;
  color: var(--emerald);
  font-size: 12px;
  font-weight: 800;
}

.auth-card {
  padding: 34px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #07120f;
  color: var(--text);
  outline: 0;
}

.field input:focus,
.field select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.11);
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
}

.form-error {
  display: none;
  padding: 11px 13px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 10px;
  background: rgba(251, 113, 133, 0.08);
  color: #fecdd3;
  font-size: 13px;
}

.form-error.visible {
  display: block;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.text-link {
  color: var(--emerald);
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: var(--card-gap);
}

.admin-sidebar {
  position: sticky;
  top: 104px;
  height: fit-content;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(11, 24, 20, 0.78);
}

.admin-sidebar button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.admin-sidebar button:hover,
.admin-sidebar button.active {
  background: var(--surface-soft);
  color: var(--text);
}

.admin-section {
  display: none;
}

.admin-section.active { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--module-gap); }
.admin-section.active > :is(.section-heading, .admin-freshness-grid, .preview-grid, .rebalance-schedule-notice, .refresh-status) { margin-block: 0; }
.admin-heading-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.admin-heading-row > h1 { margin: 0; }
.admin-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; overflow-wrap: anywhere; margin: 0; }
.admin-page > .page-hero .eyebrow { margin-bottom: 8px; }
.admin-page > .page-hero .lead { font-size: 16px; margin: 12px 0 0; }
.settings-scope { margin: 0 0 16px; font-size: 14px; color: var(--text-soft); }
.admin-advanced-details > summary { min-height: 44px; padding-block: 8px; cursor: pointer; font-weight: 750; }
.admin-advanced-details > .notice-card { margin-top: 16px; }
.accounts-table td:first-child { min-width: 160px; max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
.account-self-note { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.accounts-table td:last-child { white-space: normal; min-width: 210px; }
.accounts-table td:last-child .button { margin: 4px 4px 4px 0; }
.accounts-table tbody td :is(.button, select) { min-height: 44px; }
.accounts-table [data-user-status] { display: block; overflow-wrap: anywhere; margin-top: 6px; }
.password-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.password-dialog::backdrop { background: rgba(11, 24, 20, 0.45); }
.password-dialog h2 { margin-top: 0; }
.password-target { font-weight: 750; overflow-wrap: anywhere; }
.password-dialog input { min-width: 0; width: 100%; }
.password-dialog [aria-invalid="true"] { border-color: var(--danger); }


.admin-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.preview-card {
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(11, 24, 20, 0.82);
}

.preview-card.intraday {
  border-color: rgba(217, 184, 108, 0.3);
}

.preview-card .pill {
  border-color: rgba(217, 184, 108, 0.25);
  background: rgba(217, 184, 108, 0.08);
  color: var(--gold);
}

.target-list {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.target-row {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.target-row small {
  display: block;
  color: var(--muted);
}

.target-row strong:last-child {
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
}

.setting-row {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #07120f;
  cursor: pointer;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}

.switch input:checked + span {
  border-color: var(--emerald-strong);
  background: rgba(52, 211, 153, 0.15);
}

.switch input:checked + span::after {
  transform: translateX(22px);
  background: var(--emerald);
}

.switch input:focus-visible + span {
  outline: 3px solid rgba(110, 231, 183, 0.85);
  outline-offset: 3px;
}

.notice-card {
  padding: 22px;
  border-radius: var(--radius);
}

.notice-card.warning {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.06);
}

.notice-card.danger {
  border-color: rgba(251, 113, 133, 0.25);
  background: rgba(251, 113, 133, 0.06);
}

.empty-state,
.error-state {
  padding: 64px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.error-state h2 {
  color: var(--text);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 40px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10231c;
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 13px;
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.4);
}

.site-footer {
  width: min(calc(100% - 40px), var(--content));
  margin: auto auto 16px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(35, 67, 52, 0.05);
}

.footer-intro {
  min-width: 0;
}

.footer-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-brand span {
  display: grid;
  line-height: 1.1;
}

.footer-brand strong {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.footer-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.site-footer p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-meta {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-links a {
  min-height: 44px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-weight: 700;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  background: var(--surface-strong);
  color: var(--text);
}

.footer-meta .footer-disclaimer {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.footer-copyright {
  font-size: 11px;
}

.home-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.home-performance-card,
.home-signal-card,
.rebalance-receipt,
.details-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(27, 64, 50, 0.94), rgba(13, 34, 27, 0.96));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.home-performance-card,
.home-signal-card,
.rebalance-receipt {
  padding: 24px;
}

.home-return-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-return-tile {
  min-height: 94px;
  padding: 15px;
  display: grid;
  align-content: space-between;
  border: 1px solid rgba(151, 211, 187, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.home-return-tile.is-highlighted {
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(217, 184, 108, 0.08));
}

.home-return-tile span {
  color: var(--muted);
  font-size: 12px;
}

.home-return-tile strong {
  font-size: clamp(19px, 2vw, 27px);
  font-variant-numeric: tabular-nums;
}

.mini-chart-title {
  margin-top: 20px;
  display: block;
  font-size: 13px;
}

.mini-performance-chart {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(251, 191, 36, 0.07), transparent 58%),
    rgba(5, 20, 15, 0.72);
}

.mini-performance-chart svg {
  width: 100%;
  height: 210px;
}

.mini-chart-tooltip {
  min-height: 34px;
  margin-top: 8px;
  padding-inline: 4px;
  font-size: 11px;
}

.home-signal-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 100% 0, rgba(251, 191, 36, 0.24), transparent 48%),
    linear-gradient(160deg, rgba(33, 75, 58, 0.98), rgba(13, 34, 27, 0.96));
}

.signal-status-row {
  margin: 20px 0 16px;
  display: grid;
  justify-items: start;
  gap: 6px;
}

.signal-status-row > strong {
  max-width: 100%;
  font-size: clamp(24px, 2.4vw, 28px);
  word-break: keep-all;
}

.signal-status-row > strong,
.signal-stage {
  color: var(--emerald);
  font-size: clamp(24px, 2.4vw, 28px);
}

.signal-status-row span,
.signal-scope {
  color: var(--muted);
  font-size: 12px;
}

.signal-scope {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.home-detail-links {
  margin-top: 22px;
  padding-top: 18px;
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line-soft);
}

.home-detail-links a {
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 750;
}

.home-detail-links a.is-highlighted {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.15);
}

.snapshot-metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portfolio-page {
  padding-top: 42px;
}

.portfolio-page .page-hero {
  padding-top: 18px;
  padding-bottom: 42px;
}

.portfolio-page .section {
  padding-top: 72px;
}

.snapshot-metrics-grid .metric-card {
  position: relative;
  overflow: hidden;
}

.snapshot-metrics-grid .metric-return {
  border-color: rgba(244, 114, 182, 0.36);
  background: linear-gradient(145deg, rgba(190, 24, 93, 0.16), rgba(41, 24, 35, 0.58));
}

.snapshot-metrics-grid .metric-risk {
  border-color: rgba(251, 146, 60, 0.34);
  background: linear-gradient(145deg, rgba(154, 52, 18, 0.18), rgba(44, 29, 23, 0.62));
}

.snapshot-metrics-grid .metric-quality {
  border-color: rgba(96, 165, 250, 0.38);
  background: linear-gradient(145deg, rgba(30, 64, 175, 0.2), rgba(20, 35, 57, 0.64));
}

.snapshot-metrics-grid .metric-neutral {
  border-color: rgba(125, 211, 252, 0.34);
  background: linear-gradient(145deg, rgba(14, 116, 144, 0.16), rgba(18, 40, 48, 0.62));
}

.snapshot-metrics-grid .metric-return::before { background: #f43f5e; }
.snapshot-metrics-grid .metric-risk::before { background: #f97316; }
.snapshot-metrics-grid .metric-quality::before { background: #3b82f6; }

.metric-tag {
  margin-right: 8px;
  padding: 3px 8px;
  display: inline-flex;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  line-height: 1.3;
}

.metric-return .metric-label,
.metric-return .metric-value { color: #fb7185; }
.metric-risk .metric-label,
.metric-risk .metric-value { color: #fb923c; }
.metric-quality .metric-label,
.metric-quality .metric-value { color: #60a5fa; }

.metric-inline {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.metric-inline .metric-value {
  margin-top: 0;
}

.metric-inline > span {
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.curve-section-heading {
  align-items: flex-end;
}

.snapshot-metric-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.snapshot-metric-group { min-width: 0; }
.snapshot-metric-group h3 { margin: 0 0 12px; font-size: 16px; }
.snapshot-metric-group.is-returns { grid-column: 1 / -1; }
.snapshot-metric-group.is-risk { grid-column: span 3; }
.snapshot-metric-group.is-risk .snapshot-metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.snapshot-metric-group.is-recovery .snapshot-metrics-grid { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .snapshot-metric-groups > .snapshot-metric-group { grid-column: 1 / -1; } }
@media (max-width: 520px) { .snapshot-metric-group.is-risk .snapshot-metrics-grid { grid-template-columns: 1fr; } }
.performance-chart-panel > .chart-controls { justify-content: flex-start; margin-bottom: 16px; }
.interval-comparison-table :is(th, td):not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.chart-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.benchmark-select {
  min-height: 40px;
  padding: 0 10px 0 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.benchmark-select select {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 750;
  outline: 0;
}

.benchmark-select option {
  background: var(--surface-strong);
}

.performance-chart-panel {
  margin-top: 0;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(251, 191, 36, 0.08), transparent 52%),
    rgba(13, 34, 27, 0.94);
}

.chart-reading-note {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-soft);
  font-size: 12px;
}

.chart-end-badge rect {
  fill: rgba(8, 24, 18, 0.94);
  stroke: var(--chart-primary);
}

.chart-end-badge text {
  fill: var(--chart-primary);
  font-size: 11px;
  font-weight: 800;
}

.chart-end-badge.is-secondary rect { stroke: var(--chart-benchmark); }
.chart-end-badge.is-secondary text { fill: var(--chart-benchmark); }

.performance-chart-panel .chart-line:not(.secondary-line) {
  stroke: var(--chart-primary);
  stroke-width: 2.8;
}

.performance-chart-panel .secondary-line {
  stroke: var(--chart-benchmark);
  stroke-width: 1.8;
  stroke-dasharray: 7 7;
}

.performance-chart-panel .chart-grid {
  stroke-dasharray: 3 6;
  stroke: rgba(198, 209, 204, 0.18);
}

.signal-detail-panel {
  padding: 36px;
}

.snapshot-metrics-grid .metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--emerald-strong);
}

.snapshot-metrics-grid .metric-risk::before {
  background: var(--danger);
}

.snapshot-metrics-grid .metric-quality::before {
  background: var(--gold);
}

.snapshot-metrics-grid .metric-neutral::before {
  background: var(--info);
}

.range-custom-row {
  max-width: 544px;
  margin: 0 0 24px;
  padding: 16px;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 240px));
  justify-content: start;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--muted);
  font-size: 13px;
}

.release-center { min-width: 0; }
.dashboard-context { padding: 12px 16px; border-left: 3px solid var(--line); font-size: 14px; }
.dashboard-context p { margin: 6px 0 0; }

.publication-date-strip { display: flex; flex-wrap: wrap; gap: 16px 28px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.publication-date-strip > div { display: grid; gap: 4px; }
.publication-date-strip dt { color: var(--muted); font-size: 13px; }
.publication-date-strip dd { margin: 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.notification-feed, .notification-feed [data-notices] { display: grid; gap: 20px; min-width: 0; }
.notification-feed > .panel-heading { margin: 0; }
.notification-feed > button { justify-self: start; }
.notification-preferences-panel form { display: grid; gap: 16px; margin-top: 16px; }
.notification-preferences-panel form > p { margin: 0; }
.notification-preferences-panel form > button { justify-self: start; }
.notification-center [role="status"]:empty { display: none; }

.paper-follow-center,
.notification-center {
  display: grid;
  gap: var(--module-gap);
}

.page-narrow > .section {
  display: grid;
  gap: var(--module-gap);
}

.methodology-panel :is(h2, h3):focus-visible,
#strategy-intro:focus-visible { outline: 2px solid var(--emerald); outline-offset: 6px; }
.methodology-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block: 20px 24px;
}

.methodology-toc .button {
  min-height: 44px;
}

.methodology-toc > span {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 13px;
}

.methodology-panel [id],
#strategy-intro {
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.methodology-panel [id]:focus-visible,
#strategy-intro:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 6px;
}


.paper-follow-center > .panel-heading,
.paper-follow-center > .admin-summary-grid,
.notification-center > .panel-heading {
  margin-block: 0;
}
.release-center h2 { font-size: 24px; margin: 0; }
.release-center h3 { font-size: 18px; margin-block: 8px; }
.release-center .panel { box-shadow: none; }
.release-current { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; padding: 20px; margin-block: 16px; }
.release-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.release-body > .fine-print, .release-body > .notice-card { grid-column: 1 / -1; }
.release-body > h3 { grid-column: 2; grid-row: 2; }
.release-body > .release-targets:first-of-type { grid-column: 1; grid-row: 2 / 4; }
.release-body > .release-targets:nth-of-type(2), .release-body > .muted { grid-column: 2; grid-row: 3; }
.release-filter { max-width: 320px; margin-block: 24px; }
.release-card { margin-block: 12px; overflow: hidden; border-radius: 14px; padding: 0; }
.release-card[hidden], #release-more[hidden] { display: none; }
.release-card > summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; }
.release-card > summary small, .release-targets small { display: block; color: var(--muted); font-size: 13px; margin-top: 8px; }
.release-body { padding: 0 24px 24px; border-top: 1px solid var(--line); }
.release-body .fine-print { overflow-wrap: anywhere; }
.release-targets { list-style: none; padding: 0; margin-block: 16px; }
.release-targets li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.release-targets strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.release-card summary:hover { background: var(--surface-strong); }
.release-card summary:focus-visible { outline: 2px solid var(--emerald); outline-offset: -4px; }
@media (max-width: 640px) {
  .release-card > summary { align-items: flex-start; flex-direction: column; padding: 16px; }
  .release-current, .release-body { padding: 16px; }
  .release-targets li { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 1100px) {
  .release-current, .release-body { display: block; }
}

.range-custom-row.is-visible {
  display: grid;
}

.range-custom-row input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  color-scheme: light;
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.range-date-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.range-date-field label {
  color: var(--text);
  font-weight: 700;
}

.range-custom-row input[aria-invalid="true"] {
  border-color: var(--danger);
}

.range-validation:empty {
  display: none;
}

.range-validation {
  min-height: 18px;
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.chart-tooltip {
  min-height: 22px;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chart-point {
  opacity: 0;
  cursor: crosshair;
  outline: none;
  transition: opacity 120ms ease, r 120ms ease;
}

.chart-point:hover,
.chart-point:focus {
  opacity: 1;
  r: 5;
}

.chart-point-primary {
  fill: var(--chart-primary);
}

.chart-point-secondary {
  fill: var(--chart-benchmark);
}

.allocation-stack {
  height: 22px;
  width: 100%;
  margin: 20px 0 14px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.allocation-segment {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
  min-width: 2px;
}

.allocation-segment[data-allocation-weight="5"] { flex-grow: 5; }
.allocation-segment[data-allocation-weight="10"] { flex-grow: 10; }
.allocation-segment[data-allocation-weight="15"] { flex-grow: 15; }
.allocation-segment[data-allocation-weight="20"] { flex-grow: 20; }
.allocation-segment[data-allocation-weight="25"] { flex-grow: 25; }
.allocation-segment[data-allocation-weight="30"] { flex-grow: 30; }
.allocation-segment[data-allocation-weight="35"] { flex-grow: 35; }
.allocation-segment[data-allocation-weight="40"] { flex-grow: 40; }
.allocation-segment[data-allocation-weight="45"] { flex-grow: 45; }
.allocation-segment[data-allocation-weight="50"] { flex-grow: 50; }
.allocation-segment[data-allocation-weight="55"] { flex-grow: 55; }
.allocation-segment[data-allocation-weight="60"] { flex-grow: 60; }
.allocation-segment[data-allocation-weight="65"] { flex-grow: 65; }
.allocation-segment[data-allocation-weight="70"] { flex-grow: 70; }
.allocation-segment[data-allocation-weight="75"] { flex-grow: 75; }
.allocation-segment[data-allocation-weight="80"] { flex-grow: 80; }
.allocation-segment[data-allocation-weight="85"] { flex-grow: 85; }
.allocation-segment[data-allocation-weight="90"] { flex-grow: 90; }
.allocation-segment[data-allocation-weight="95"] { flex-grow: 95; }
.allocation-segment[data-allocation-weight="100"] { flex-grow: 100; }

.allocation-tone-0 { background: #6ee7b7; fill: #6ee7b7; }
.allocation-tone-1 { background: #60a5fa; fill: #60a5fa; }
.allocation-tone-2 { background: #d9b86c; fill: #d9b86c; }
.allocation-tone-3 { background: #f472b6; fill: #f472b6; }
.allocation-tone-4 { background: #a78bfa; fill: #a78bfa; }
.allocation-tone-5 { background: #94a3b8; fill: #94a3b8; }

.allocation-card {
  position: relative;
  overflow: hidden;
}

.allocation-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--emerald);
}

.allocation-card-1::before { background: #60a5fa; }
.allocation-card-2::before { background: #d9b86c; }
.allocation-card-3::before { background: #f472b6; }
.allocation-card-4::before { background: #a78bfa; }
.allocation-card-5::before { background: #94a3b8; }

.asset-category {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rebalance-receipt {
  margin-top: 18px;
}

.receipt-heading,
.receipt-columns,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.receipt-heading > strong {
  color: var(--gold);
  font-size: 18px;
}

.receipt-columns {
  margin-top: 20px;
}

.receipt-columns > div {
  width: 50%;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.receipt-columns ul {
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.receipt-columns li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.details-panel {
  overflow: hidden;
}

.details-panel summary {
  padding: 16px 18px;
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 750;
}

.details-panel[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.details-panel .data-table-wrap {
  border: 0;
  border-radius: 0;
}

.calendar-view {
  margin-top: 14px;
}

.return-calendar-shell {
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(13, 34, 27, 0.86);
}

.calendar-month-nav {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.calendar-month-nav button {
  width: 42px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
}

.calendar-month-nav button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.return-calendar-weekdays,
.return-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.return-calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.return-calendar-cell {
  min-height: 72px;
  padding: 9px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-variant-numeric: tabular-nums;
}

.return-calendar-cell span {
  color: var(--muted);
  font-size: 11px;
}

.return-calendar-cell strong {
  font-size: 12px;
}

.return-calendar-cell.is-positive {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.11);
}

.return-calendar-cell.is-negative {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.1);
}

.return-calendar-cell.is-empty {
  visibility: hidden;
}

.return-calendar-cell.is-muted strong {
  color: var(--muted);
}

.annual-calendar-table td {
  min-width: 72px;
  text-align: right;
}

@media (max-width: 980px) {
  .home-summary-grid {
    grid-template-columns: 1fr;
  }

  .snapshot-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 34px;
  }

  .hero-panel {
    min-height: 390px;
  }

  .metrics-grid,
  .feature-grid,
  .allocation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .admin-sidebar button {
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    width: calc(100% - 24px);
    min-height: 64px;
    margin-top: 8px;
    padding: 0 12px;
    border-radius: 16px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 10px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #07120f;
    box-shadow: var(--shadow);
  }

  .primary-nav.open {
    display: flex;
  }

  .primary-nav a,
  .nav-account-button {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-divider {
    width: 100%;
    height: 1px;
    margin: 5px 0;
  }

  .page,
  .page-narrow {
    width: min(calc(100% - 28px), var(--content));
    padding: 52px 0 72px;
  }

  .hero {
    min-height: auto;
    padding-top: 44px;
  }

  .hero-panel {
    min-height: 380px;
    padding: 22px;
  }

  .trust-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
  }

  .trust-item:nth-child(2) {
    border-right: 0;
  }

  .trust-item:nth-child(3),
  .trust-item:nth-child(4) {
    border-bottom: 0;
  }

  .trust-item:nth-child(3) {
    padding-left: 0;
  }

  .section {
    padding-top: 76px;
  }

  .section-heading,
  .panel-heading {
    flex-direction: column;
  }

  .home-return-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-controls,
  .curve-section-heading {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .receipt-columns {
    flex-direction: column;
  }

  .receipt-columns > div {
    width: 100%;
  }

  .range-custom-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .gate-card,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrap,
  .chart-wrap svg {
    min-height: 280px;
    height: 280px;
  }

  .admin-summary-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    width: calc(100% - 28px);
    margin-bottom: 12px;
    padding: 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    border-radius: 16px;
  }

  .footer-meta {
    width: 100%;
    padding-top: 14px;
    justify-items: stretch;
    gap: 8px;
    border-top: 1px solid var(--line-soft);
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .footer-links a {
    justify-content: center;
    border: 1px solid var(--line-soft);
    background: #fafcfb;
  }

  .footer-meta .footer-disclaimer {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .brand-copy small {
    display: none;
  }

  .metrics-grid,
  .feature-grid,
  .allocation-grid {
    grid-template-columns: 1fr;
  }

  .home-return-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-performance-card,
  .home-signal-card,
  .rebalance-receipt {
    padding: 18px;
  }

  .chart-controls,
  .chart-toolbar {
    width: 100%;
  }

  .benchmark-select {
    width: 100%;
    justify-content: space-between;
  }

  .return-calendar-shell {
    padding: 12px;
  }

  .return-calendar-weekdays,
  .return-calendar-grid {
    gap: 4px;
  }

  .return-calendar-cell {
    min-height: 54px;
    padding: 5px;
  }

  .return-calendar-cell strong {
    font-size: 9px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero h1 span {
    white-space: normal;
  }

  .auth-card,
  .panel,
  .gate-card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Homepage hero: one clear message, with the secondary walkthrough removed. */
.home-page {
  width: 100%;
  max-width: none;
  padding-top: 22px;
  padding-bottom: 64px;
}

.home-page > .section {
  width: min(calc(100% - 64px), 1240px);
  margin-inline: auto;
}

.hero-home {
  width: 100%;
  min-height: clamp(520px, 66vh, 660px);
  padding: clamp(72px, 10vh, 112px) max(32px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.42), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(8, 127, 103, 0.10), transparent 32%),
    linear-gradient(135deg, #ffe16b 0%, #ffd54f 48%, #f8ce45 100%);
  border-block: 1px solid rgba(166, 106, 20, 0.12);
}

.hero-home .hero-copy {
  width: min(960px, 100%);
  margin-inline: auto;
}

.hero-home .hero-copy::before {
  display: none;
}

.hero-home .eyebrow {
  color: #17372c;
  letter-spacing: 0.26em;
}

.hero-home h1 {
  max-width: none;
  margin: 20px auto 26px;
  font-size: clamp(48px, 6vw, 82px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero-home h1 span {
  margin-top: 12px;
  white-space: normal;
  background: linear-gradient(92deg, #086f5a 0%, #119479 56%, #8d5e0d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-home .lead {
  max-width: 760px;
  margin-inline: auto;
  color: #243c33;
  font-size: clamp(17px, 1.65vw, 21px);
}

.hero-home .hero-actions,
.hero-home .hero-fine-print {
  justify-content: center;
}

.hero-home .hero-fine-print {
  color: #344d43;
}

/* Keep the floating navigation paint inside its rounded box. This also avoids
   the Chromium sticky-layer seam that could stretch across the viewport. */
.site-header {
  border: 0;
  overflow: clip;
  isolation: isolate;
  contain: layout paint;
  background-clip: padding-box;
  clip-path: inset(0 round 20px);
  box-shadow:
    inset 0 0 0 1px rgba(80, 112, 98, 0.16),
    0 12px 34px rgba(38, 67, 54, 0.10);
}

@media (max-width: 760px) {
  .home-page {
    padding-top: 14px;
  }

  .home-page > .section {
    width: min(calc(100% - 28px), 1240px);
  }

  .hero-home {
    min-height: 540px;
    padding: 64px 22px;
  }

  .hero-home h1 {
    font-size: clamp(42px, 12vw, 58px);
  }
}

@media (max-width: 520px) {
  .site-header {
    clip-path: inset(0 round 14px);
  }

  .hero-home {
    min-height: 520px;
  }
}

/* 2026 light editorial refresh -------------------------------------------------
   The legacy selectors above remain the compatibility layer. These overrides
   turn every route into one coherent, warm-light research experience. */

html {
  background: var(--bg);
}

body {
  letter-spacing: -0.005em;
}

::selection {
  background: rgba(11, 155, 125, 0.2);
  color: var(--text);
}

:focus-visible {
  outline-color: rgba(8, 127, 103, 0.72);
}

.site-header {
  border-color: rgba(80, 112, 98, 0.16);
  background: rgba(255, 255, 252, 0.97);
  box-shadow: 0 12px 34px rgba(38, 67, 54, 0.1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.brand-copy strong {
  color: #0b4334;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"],
.nav-account-button:hover {
  background: #eaf5ef;
  color: #075f4d;
}

.primary-nav .nav-cta,
.button {
  background: linear-gradient(135deg, #0b9275, #08745e);
  box-shadow: 0 8px 20px rgba(8, 127, 103, 0.18);
  color: #fff;
}

.primary-nav .nav-cta:hover,
.button:hover {
  background: linear-gradient(135deg, #0ca384, #08745e);
  color: #fff;
  transform: translateY(-1px);
}

.button,
.home-detail-links a,
.metric-card,
.feature-card,
.allocation-card,
.range-button {
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    color 180ms var(--ease);
}

.button.secondary,
.icon-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: none;
  color: var(--text);
}

.button.secondary:hover,
.icon-button:hover {
  border-color: #8fb8a7;
  background: #f3faf6;
  color: #075f4d;
}

.button.danger {
  border-color: rgba(207, 63, 85, 0.28);
  background: #fff1f3;
  box-shadow: none;
  color: #a51f37;
}

.eyebrow {
  color: #087f67;
}

h1,
h2,
h3 {
  color: #10271e;
  font-weight: 800;
}

.lead {
  color: #3f554c;
  line-height: 1.75;
}

.page,
.page-narrow {
  padding-top: 32px;
}

.hero {
  min-height: 600px;
  gap: clamp(40px, 6vw, 84px);
}

.hero-copy {
  position: relative;
}

.hero-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  top: -45px;
  left: -82px;
  border-radius: 50%;
  background: rgba(255, 218, 127, 0.21);
  filter: blur(2px);
}

.hero h1 {
  max-width: 780px;
  margin-bottom: 28px;
  font-size: clamp(46px, 5.55vw, 72px);
  line-height: 1.06;
}

.hero h1 span {
  margin-top: 10px;
  background: linear-gradient(92deg, #08745e 10%, #199d81 60%, #a46b13 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-fine-print {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.hero-fine-print .status-dot {
  margin-top: 0;
}

.hero-panel {
  min-height: 460px;
  padding: 30px;
  border-color: rgba(64, 104, 86, 0.16);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 216, 126, 0.32), transparent 42%),
    linear-gradient(145deg, #ffffff, #eef8f2 68%, #f8f3e7);
  box-shadow: 0 30px 80px rgba(35, 75, 57, 0.14);
}

.hero-panel::before {
  background: radial-gradient(circle, rgba(22, 160, 133, 0.12), transparent 64%);
}

.hero-panel-index {
  color: #9e6a18;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.mini-allocation {
  margin-top: 28px;
  gap: 11px;
}

.mini-asset {
  padding: 16px;
  border: 1px solid rgba(64, 104, 86, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.7);
}

.mini-asset strong em {
  margin-right: 7px;
  color: #0b9275;
  font-size: 11px;
  font-style: normal;
}

.progress-track {
  background: #e3ebe7;
}

.progress-track i {
  background: linear-gradient(90deg, #0b9b7d, #f0b64e);
}

.trust-strip {
  margin-top: 8px;
  border-color: rgba(64, 104, 86, 0.12);
}

.section {
  padding-top: var(--module-gap);
}

.home-page > .section {
  padding-top: 48px;
}

.home-page .section-heading h2 {
  font-size: clamp(24px, 2.8vw, 32px);
}

.section-heading {
  margin-bottom: var(--card-gap);
}

.section-copy {
  color: #64776e;
  line-height: 1.75;
}

.metric-card,
.feature-card,
.panel,
.allocation-card,
.auth-card,
.notice-card,
.preview-card {
  border-color: rgba(64, 104, 86, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(35, 67, 52, 0.055);
}

.metric-card:hover,
.feature-card:hover,
.allocation-card:hover {
  border-color: rgba(8, 127, 103, 0.28);
  box-shadow: 0 16px 40px rgba(35, 67, 52, 0.09);
  transform: translateY(-2px);
}

.metric-value.positive,
.positive {
  color: #078358;
}

.negative {
  color: #c93e52;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(64, 104, 86, 0.12);
}

.page-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 240px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 178, 143, 0.13), transparent 70%);
  pointer-events: none;
}

.home-performance-card,
.home-signal-card,
.rebalance-receipt,
.details-panel {
  border-color: rgba(64, 104, 86, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(35, 67, 52, 0.08);
}

.home-performance-card,
.home-signal-card {
  padding: 28px;
}

.home-return-tile {
  border-color: rgba(64, 104, 86, 0.12);
  background: #f5f8f5;
}

.home-return-tile.is-highlighted {
  border-color: rgba(213, 155, 47, 0.38);
  background: linear-gradient(145deg, #fff8df, #fffdf6);
}

.mini-performance-chart,
.performance-chart-panel {
  border-color: rgba(64, 104, 86, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 230, 164, 0.23), transparent 55%),
    #fbfcfa;
}

.home-signal-card {
  background:
    radial-gradient(circle at 100% 0, rgba(111, 177, 232, 0.2), transparent 44%),
    linear-gradient(150deg, #f0faf5, #ffffff 68%);
}

.signal-status-row > strong,
.signal-stage {
  color: #08745e;
}

.signal-scope {
  border-color: #cbdcd4;
  background: rgba(255, 255, 255, 0.65);
}

.home-detail-links a {
  border-color: rgba(64, 104, 86, 0.13);
  background: rgba(255, 255, 255, 0.76);
}

.home-detail-links a:hover {
  border-color: rgba(8, 127, 103, 0.34);
  background: #f3fbf7;
  transform: translateX(3px);
}

.home-detail-links a.is-highlighted {
  border-color: rgba(213, 155, 47, 0.3);
  background: #fff8e6;
}

.snapshot-metrics-grid .metric-return {
  border-color: #f2c5cc;
  background: linear-gradient(145deg, #fff3f5, #fffafb);
}

.snapshot-metrics-grid .metric-risk {
  border-color: #ebcbbb;
  background: linear-gradient(145deg, #fff5ef, #fffaf7);
}

.snapshot-metrics-grid .metric-quality {
  border-color: #c6d8f3;
  background: linear-gradient(145deg, #eff5ff, #fafcff);
}

.snapshot-metrics-grid .metric-neutral {
  border-color: #cbdad3;
  background: linear-gradient(145deg, #f2f6f4, #ffffff);
}

.metric-return .metric-label,
.metric-return .metric-value {
  color: #c92d49;
}

.metric-risk .metric-label,
.metric-risk .metric-value {
  color: #a7471e;
}

.metric-quality .metric-label,
.metric-quality .metric-value {
  color: #2768bd;
}

.chart-grid,
.performance-chart-panel .chart-grid {
  stroke: rgba(75, 102, 90, 0.16);
}

.chart-label {
  fill: #6d7e76;
}

.performance-chart-panel .chart-line:not(.secondary-line),
.chart-line {
  stroke: var(--chart-primary);
}

.performance-chart-panel .secondary-line,
.chart-line.secondary-line {
  stroke: var(--chart-benchmark);
}

.chart-end-badge rect {
  fill: #ffffff;
  stroke: var(--chart-primary);
}

.chart-end-badge text {
  fill: var(--chart-primary);
}

.chart-end-badge.is-secondary rect {
  stroke: var(--chart-benchmark);
}

.chart-end-badge.is-secondary text {
  fill: var(--chart-benchmark);
}

.range-button {
  border-color: #d4dfda;
  background: rgba(255, 255, 255, 0.72);
  color: #65766e;
}

.range-button:hover,
.range-button.active {
  border-color: #e3b652;
  background: #fff7dd;
  box-shadow: 0 5px 14px rgba(174, 123, 22, 0.1);
  color: #80510d;
}

.benchmark-select {
  border-color: #d4dfda;
  background: rgba(255, 255, 255, 0.76);
}

.benchmark-select option {
  background: #fff;
}

.range-custom-row input,
.field input,
.field select {
  border-color: #c8d8d0;
  background: #ffffff;
  color: var(--text);
  color-scheme: light;
}

.field input:focus,
.field select:focus,
.range-custom-row input:focus {
  border-color: #0b9275;
  box-shadow: 0 0 0 4px rgba(11, 146, 117, 0.11);
}

.chart-reading-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  color: #4f6259;
  line-height: 1.72;
}

.chart-reading-note strong {
  color: #08745e;
}

.chart-reading-note small {
  grid-column: 2;
  color: #7a8982;
}

.gate-card {
  border-color: rgba(8, 127, 103, 0.22);
  background:
    radial-gradient(circle at 92% 0, rgba(255, 220, 135, 0.25), transparent 38%),
    linear-gradient(115deg, #f0faf5, #ffffff);
  box-shadow: 0 16px 44px rgba(35, 67, 52, 0.07);
}

.status-line {
  border-color: rgba(56, 111, 179, 0.2);
  background: #eef6ff;
  color: #294e76;
}

.status-dot {
  background: #3f80c4;
  box-shadow: 0 0 0 5px rgba(63, 128, 196, 0.1);
}

.allocation-stack {
  background: #edf2ef;
}

.receipt-columns > div,
.target-row {
  border-color: rgba(64, 104, 86, 0.12);
  background: #f7f9f7;
}

.data-table-wrap {
  border-color: rgba(64, 104, 86, 0.14);
  background: #fff;
}

.data-table th {
  background: #f0f5f2;
  color: #60736a;
}

.data-table tbody tr:hover {
  background: #f4faf6;
}

.annual-calendar-table td.is-empty-value {
  color: #a7b2ad;
}

.return-calendar-shell {
  border-color: rgba(64, 104, 86, 0.14);
  background: #fff;
  box-shadow: 0 14px 42px rgba(35, 67, 52, 0.06);
}

.calendar-month-nav button {
  border-color: #cfddd6;
  background: #f1f7f4;
  color: #174c3c;
}

.return-calendar-cell {
  border-color: rgba(64, 104, 86, 0.11);
  background: #f7f9f7;
}

.return-calendar-cell.is-positive {
  border-color: rgba(8, 131, 88, 0.21);
  background: #eaf8f0;
}

.return-calendar-cell.is-negative {
  border-color: rgba(201, 62, 82, 0.2);
  background: #fff0f2;
}

.auth-layout {
  min-height: calc(100vh - 166px);
}

.auth-intro {
  padding: clamp(10px, 4vw, 44px);
}

.auth-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #0b9b7d, #6cbdd7, #e3b652);
}

.proof-mark {
  border-color: rgba(8, 127, 103, 0.24);
  background: #eaf7f1;
  color: #08745e;
}

.form-error {
  background: #fff0f2;
  color: #a6253a;
}

.admin-sidebar {
  border-color: rgba(64, 104, 86, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(35, 67, 52, 0.06);
}

.admin-sidebar button:hover,
.admin-sidebar button.active {
  background: #eaf5ef;
  color: #075f4d;
}

.preview-card.intraday,
.notice-card.warning {
  border-color: rgba(185, 121, 19, 0.25);
  background: #fff9e9;
}

.notice-card.danger {
  border-color: rgba(207, 63, 85, 0.22);
  background: #fff2f4;
}

.switch span {
  background: #e7eeea;
}

.switch input:checked + span {
  background: rgba(11, 155, 125, 0.18);
}

.toast {
  border-color: rgba(64, 104, 86, 0.18);
  background: #fff;
  color: var(--text-soft);
}

.prose-panel h3:not(:first-child) {
  margin-top: 32px;
}

/* Chinese market color semantics: gains are red, losses are green. */
.metric-value.positive,
.positive {
  color: var(--rise);
}

.negative {
  color: var(--fall);
}

.metric-return .metric-label,
.metric-return .metric-value {
  color: var(--rise);
}

.snapshot-metrics-grid .metric-return {
  border-color: rgba(207, 63, 85, 0.24);
  background: linear-gradient(145deg, var(--rise-soft), #fffafb);
}

.snapshot-metrics-grid .metric-return::before {
  background: var(--rise);
}

.snapshot-metrics-grid .metric-drawdown {
  border-color: rgba(8, 127, 99, 0.24);
  background: linear-gradient(145deg, var(--fall-soft), #f8fdfb);
}

.metric-drawdown .metric-label,
.metric-drawdown .metric-value {
  color: var(--drawdown);
}

.snapshot-metrics-grid .metric-drawdown::before {
  background: var(--drawdown);
}

.snapshot-metrics-grid .metric-volatility {
  border-color: rgba(166, 106, 20, 0.24);
  background: linear-gradient(145deg, #fff7e8, #fffdf8);
}

.metric-volatility .metric-label,
.metric-volatility .metric-value {
  color: var(--volatility);
}

.snapshot-metrics-grid .metric-volatility::before {
  background: var(--volatility);
}

.snapshot-metrics-grid .metric-recovery {
  border-color: rgba(115, 86, 180, 0.24);
  background: linear-gradient(145deg, #f4f0ff, #fbfaff);
}

.metric-recovery .metric-label,
.metric-recovery .metric-value {
  color: var(--recovery);
}

.snapshot-metrics-grid .metric-recovery::before {
  background: var(--recovery);
}

.performance-chart-panel .chart-line:not(.secondary-line),
.chart-line {
  stroke: var(--chart-primary);
}

.chart-point-primary {
  fill: var(--chart-primary);
}

.chart-end-badge rect {
  stroke: var(--chart-primary);
}

.chart-end-badge text {
  fill: var(--chart-primary);
}

.drawdown-analysis-panel {
  border-color: rgba(115, 86, 180, 0.18);
  background:
    linear-gradient(180deg, rgba(115, 86, 180, 0.07), transparent 58%),
    #fff;
}

.drawdown-analysis-panel .chart-line:not(.secondary-line) {
  stroke: var(--chart-primary);
}

.drawdown-analysis-panel .chart-point-primary {
  fill: var(--chart-primary);
}

.drawdown-analysis-panel .chart-end-badge:not(.is-secondary) rect {
  stroke: var(--chart-primary);
}

.drawdown-analysis-panel .chart-end-badge:not(.is-secondary) text {
  fill: var(--chart-primary);
}

.calendar-toolbar {
  width: fit-content;
  padding: 4px;
  gap: 4px;
  border: 1px solid rgba(64, 104, 86, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 24px rgba(35, 67, 52, 0.06);
}

.calendar-toolbar .range-button {
  min-height: 38px;
  border-color: transparent;
  border-radius: 10px;
}

.calendar-toolbar .range-button.active {
  border-color: rgba(185, 121, 19, 0.35);
  background: #fff7df;
  box-shadow: 0 4px 12px rgba(166, 106, 20, 0.1);
}

.return-calendar-shell {
  padding: clamp(16px, 2.2vw, 26px);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(35, 67, 52, 0.08);
}

.calendar-month-nav {
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(64, 104, 86, 0.1);
}

.calendar-month-nav strong {
  color: #173b30;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.calendar-month-nav button {
  border-radius: 12px;
  transition: transform 160ms var(--ease), background 160ms var(--ease);
}

.calendar-month-nav button:not(:disabled):hover {
  background: #e8f5ef;
  transform: translateY(-1px);
}

.return-calendar-weekdays {
  margin-bottom: 10px;
  color: #687b72;
  font-weight: 700;
}

.return-calendar-grid {
  gap: clamp(5px, 0.7vw, 9px);
}

.return-calendar-cell {
  min-height: 68px;
  padding: 9px 10px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}

.return-calendar-cell:not(.is-empty):hover {
  z-index: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(35, 67, 52, 0.1);
}

.return-calendar-cell.is-positive {
  border-color: rgba(207, 63, 85, 0.24);
  background: var(--rise-soft);
}

.return-calendar-cell.is-positive strong {
  color: var(--rise);
}

.return-calendar-cell.is-negative {
  border-color: rgba(8, 127, 99, 0.24);
  background: var(--fall-soft);
}

.return-calendar-cell.is-negative strong {
  color: var(--fall);
}

.return-calendar-cell.is-flat {
  border-color: rgba(56, 111, 179, 0.16);
  background: #f2f6fb;
}

.return-calendar-cell.is-flat strong {
  color: #56718e;
}

.return-calendar-cell.is-weekend.is-muted {
  background: #f3f5f3;
}

.return-calendar-cell.is-latest {
  box-shadow: 0 0 0 2px rgba(185, 121, 19, 0.44);
}

.annual-calendar-table th,
.annual-calendar-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.annual-calendar-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f0f5f2;
}

.annual-calendar-table td.positive {
  background: rgba(207, 63, 85, 0.055);
  color: var(--rise);
}

.annual-calendar-table td.negative {
  background: rgba(8, 127, 99, 0.055);
  color: var(--fall);
}

.annual-calendar-table td.is-flat-value {
  background: #f6f8f7;
  color: #6f8178;
}

.chart-hit-area {
  fill: transparent;
  cursor: crosshair;
  pointer-events: all;
}

.chart-point {
  pointer-events: none;
}

.chart-hover-layer line {
  stroke: rgba(39, 66, 55, 0.64);
  stroke-width: 1.25;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.chart-hover-layer {
  pointer-events: none;
}

.chart-hover-layer [data-chart-primary-hover] {
  fill: #fff;
  stroke: var(--rise);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.chart-hover-layer [data-chart-secondary-hover] {
  fill: #fff;
  stroke: var(--chart-benchmark);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.chart-floating-tooltip rect {
  fill: rgba(255, 255, 255, 0.98);
  stroke: rgba(44, 67, 57, 0.16);
  stroke-width: 1;
  filter: drop-shadow(0 8px 14px rgba(29, 46, 38, 0.16));
}

.chart-floating-tooltip text {
  fill: #263c34;
  font-size: 11px;
  font-weight: 650;
  pointer-events: none;
}

.chart-floating-tooltip .chart-floating-date {
  fill: #172c24;
  font-size: 13px;
  font-weight: 850;
}

.chart-floating-tooltip .chart-floating-value {
  fill: #192b24;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.chart-floating-tooltip .chart-floating-extra {
  fill: var(--rise);
  font-weight: 850;
}

.chart-floating-tooltip [data-tooltip-extra-row] line {
  stroke: rgba(44, 67, 57, 0.12);
  stroke-dasharray: none;
}

.chart-floating-dot.is-primary {
  fill: var(--chart-primary);
}

.chart-floating-dot.is-secondary {
  fill: var(--chart-benchmark);
}

.chart-tone-drawdown .chart-floating-dot.is-primary {
  fill: var(--chart-primary);
}

.drawdown-chart-legend .legend-key::before {
  background: var(--chart-primary);
}

.chart-tooltip {
  width: 1px;
  height: 1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.chart-tooltip strong {
  color: var(--rise);
}

.chart-detail-date {
  min-width: 92px;
  color: #35594b;
  font-weight: 800;
}

.drawdown-range-summary {
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 20px;
  border: 1px solid rgba(115, 86, 180, 0.16);
  border-radius: 12px;
  background: rgba(115, 86, 180, 0.055);
  color: #5f6f68;
  font-size: 12px;
}

.drawdown-range-summary strong {
  color: var(--recovery);
  font-size: 15px;
}

.drawdown-chart-wrap {
  margin-top: 12px;
}

.drawdown-stages {
  margin-top: 22px;
}

.drawdown-stages-heading {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #61746b;
  font-size: 12px;
}

.drawdown-stages-heading strong {
  color: #173b30;
  font-size: 15px;
}

.drawdown-stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.drawdown-stage-card {
  min-width: 0;
  padding: 14px;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(115, 86, 180, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.76);
}

.drawdown-stage-card > div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #718079;
  font-size: 10px;
}

.drawdown-stage-card > div strong {
  color: #263c34;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.drawdown-stage-card > div strong.negative {
  color: var(--fall);
}

.drawdown-stage-index {
  color: var(--recovery);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.drawdown-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.85fr);
  align-items: stretch;
  gap: 18px;
}

.drawdown-chart-card,
.drawdown-stage-table-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(115, 86, 180, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.drawdown-chart-card .drawdown-chart-wrap {
  margin: 0;
}

.drawdown-stage-table-panel .drawdown-range-summary {
  margin-bottom: 14px;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.drawdown-stages {
  margin-top: 0;
}

.drawdown-stage-table th,
.drawdown-stage-table td {
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

.drawdown-stage-table th {
  background: #fff7de;
  color: #5c4a26;
  font-size: 10px;
}

.drawdown-stage-table td {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.drawdown-stage-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e5ebe8;
  color: #687970;
  font-size: 10px;
  line-height: 1.7;
}

.calendar-period-control {
  position: relative;
  min-width: 220px;
}

.calendar-month-nav .calendar-period-button {
  width: 100%;
  height: auto;
  min-height: 58px;
  padding: 8px 18px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(185, 121, 19, 0.22);
  border-radius: 13px;
  background: #fffaf0;
  color: #173b30;
  cursor: pointer;
}

.calendar-period-button:hover,
.calendar-period-button:focus-visible {
  border-color: rgba(185, 121, 19, 0.5);
  box-shadow: 0 7px 18px rgba(166, 106, 20, 0.11);
}

.calendar-period-button span,
.calendar-year-control > span {
  color: #77877f;
  font-size: 10px;
  font-weight: 700;
}

.calendar-period-button strong {
  white-space: nowrap;
}

.calendar-native-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  inset: 50% auto auto 50%;
  opacity: 0;
  pointer-events: none;
}

.calendar-year-control {
  min-width: 220px;
  min-height: 58px;
  padding: 7px 16px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(185, 121, 19, 0.22);
  border-radius: 13px;
  background: #fffaf0;
}

.calendar-year-control select {
  min-width: 120px;
  padding: 3px 24px 3px 8px;
  border: 0;
  background: transparent;
  color: #173b30;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.return-calendar-year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.return-calendar-year-cell {
  min-height: 92px;
  padding: 15px;
  display: grid;
  align-content: space-between;
  border: 1px solid #dce6e1;
  border-radius: 14px;
  background: #f5f8f6;
  font-variant-numeric: tabular-nums;
}

.return-calendar-year-cell span {
  color: #6f8178;
  font-size: 12px;
  font-weight: 700;
}

.return-calendar-year-cell strong {
  font-size: 20px;
}

.return-calendar-year-cell.is-positive {
  border-color: rgba(207, 63, 85, 0.24);
  background: var(--rise-soft);
}

.return-calendar-year-cell.is-positive strong {
  color: var(--rise);
}

.return-calendar-year-cell.is-negative {
  border-color: rgba(8, 127, 99, 0.24);
  background: var(--fall-soft);
}

.return-calendar-year-cell.is-negative strong {
  color: var(--fall);
}

.return-calendar-year-cell.is-flat strong,
.return-calendar-year-cell.is-muted strong {
  color: #667b70;
}

.allocation-grid.is-balanced {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.allocation-value {
  grid-column: 2;
  align-self: center;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.allocation-value .allocation-weight {
  grid-column: auto;
  grid-row: auto;
  margin: 0;
}

.allocation-target {
  color: #72827a;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.allocation-target em {
  font-style: normal;
}

.refresh-action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.refresh-status {
  margin: 14px 0 0;
  color: #5f7168;
  font-size: 12px;
}

.rank-index {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #eef5f1;
  color: #315b4b;
  font-weight: 800;
}

.intraday-ranking-panel {
  border-color: rgba(56, 111, 179, 0.2);
  background:
    linear-gradient(180deg, rgba(56, 111, 179, 0.055), transparent 48%),
    #fff;
}

.intraday-ranking-panel.is-decision-zone {
  margin-top: 20px;
  margin-bottom: 32px;
  border: 1px solid rgba(56, 111, 179, 0.34);
  background:
    linear-gradient(135deg, rgba(56, 111, 179, 0.1), rgba(255, 255, 255, 0.96) 38%),
    #fff;
  box-shadow: 0 20px 48px rgba(45, 83, 119, 0.12);
}

.admin-section[data-admin-section="preview"] .preview-grid {
  align-items: start;
  margin-bottom: 0;
}

.decision-zone-label {
  display: inline-block;
  margin-bottom: 5px;
  color: #3168a8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.intraday-ranking-panel.is-decision-zone h3 {
  font-size: 21px;
}

.intraday-data-status {
  margin: 14px 0 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(8, 127, 103, 0.22);
  border-radius: 10px;
  background: #f0f8f4;
  color: #52685e;
  font-size: 11px;
}

.intraday-data-status strong {
  flex: 0 0 auto;
  color: #08745e;
  font-size: 11px;
}

.intraday-data-status.is-legacy {
  border-color: rgba(217, 119, 6, 0.3);
  background: #fff8e7;
  color: #685b42;
}

.intraday-data-status.is-legacy strong {
  color: #9a5a08;
}

.intraday-ranking-panel .data-table th,
.intraday-ranking-panel .data-table td {
  padding-inline: 10px;
}

.calendar-section-heading {
  align-items: flex-end;
}

.calendar-section-heading .calendar-toolbar {
  margin-left: auto;
}

.return-calendar-shell:not(.annual-calendar-shell) {
  padding: 16px 26px 26px;
  background: #fff;
}

.return-calendar-shell:not(.annual-calendar-shell) .calendar-month-nav {
  width: fit-content;
  margin: 0 auto 18px;
  padding: 0;
  grid-template-columns: 38px auto 38px;
  gap: 10px;
  border: 0;
}

.calendar-month-nav > button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
}

.calendar-period-control {
  min-width: 168px;
}

.calendar-month-nav .calendar-period-button {
  min-height: 38px;
  padding: 5px 15px;
  display: flex;
  justify-content: center;
  gap: 8px;
  border-color: #dce4df;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
}

.return-calendar-cell.is-empty {
  visibility: visible;
  background: #fff;
}

.calendar-month-nav .calendar-period-button span {
  display: inline;
  color: #667a70;
  font-size: 12px;
}

.calendar-picker-popover {
  width: 250px;
  padding: 10px;
  position: absolute;
  z-index: 15;
  inset: calc(100% + 8px) auto auto 50%;
  transform: translateX(-50%);
  border: 1px solid #dce4df;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(31, 52, 43, 0.16);
}

.calendar-picker-popover[hidden] {
  display: none;
}

.calendar-picker-year {
  margin-bottom: 7px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 6px;
}

.calendar-month-nav .calendar-picker-year button,
.calendar-month-nav .calendar-picker-months button {
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #304b40;
  font-size: 12px;
}

.calendar-picker-year strong {
  color: #173b30;
  font-size: 14px;
}

.calendar-picker-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.calendar-month-nav .calendar-picker-months button:hover,
.calendar-month-nav .calendar-picker-months button.active {
  background: #fff4d8;
  color: #9a650e;
}

.calendar-month-nav .calendar-picker-months button:disabled {
  color: var(--muted);
  opacity: 1;
  background: var(--bg);
  cursor: not-allowed;
}

.return-calendar-weekdays,
.return-calendar-grid {
  gap: 0;
}

.return-calendar-weekdays {
  margin: 0;
  padding: 0 0 8px;
  color: #101e19;
  font-size: 13px;
  font-weight: 800;
}

.return-calendar-grid {
  border-top: 1px solid #e1e7e4;
  border-left: 1px solid #e1e7e4;
}

.return-calendar-cell {
  min-height: 82px;
  padding: 13px 8px;
  place-content: center;
  gap: 7px;
  border: 0;
  border-right: 1px solid #e1e7e4;
  border-bottom: 1px solid #e1e7e4;
  border-radius: 0;
  background: #fff;
  text-align: center;
  box-shadow: none;
}

.return-calendar-cell:not(.is-empty):hover {
  z-index: auto;
  transform: none;
  background: #fafcfb;
  box-shadow: none;
}

.return-calendar-cell span {
  color: #101e19;
  font-size: 14px;
  font-weight: 800;
}

.return-calendar-cell strong {
  font-size: 13px;
}

.return-calendar-cell.is-positive,
.return-calendar-cell.is-negative,
.return-calendar-cell.is-flat,
.return-calendar-cell.is-weekend.is-muted {
  background: #fff;
}

.return-calendar-cell.is-latest {
  box-shadow: inset 0 0 0 2px rgba(185, 121, 19, 0.48);
}

.annual-calendar-shell .calendar-month-nav {
  width: fit-content;
  margin: 0 auto 12px;
  padding: 0;
  grid-template-columns: 38px auto 38px;
  border: 0;
}

.calendar-year-control {
  min-width: 140px;
  min-height: 38px;
  padding: 0 12px;
  border-color: #dce4df;
  border-radius: 999px;
  background: #fff;
}

.calendar-year-control > span {
  display: none;
}

.calendar-year-control select {
  min-width: 88px;
  padding: 3px 18px 3px 4px;
  font-size: 15px;
}

.return-calendar-year-cell,
.return-calendar-year-cell.is-positive,
.return-calendar-year-cell.is-negative {
  min-height: 96px;
  place-content: center;
  gap: 9px;
  border-color: #e1e7e4;
  background: #fff;
  text-align: center;
}

.return-calendar-year-cell span {
  color: #101e19;
  font-size: 17px;
  font-weight: 850;
}

.return-calendar-year-cell strong {
  font-size: 17px;
}

.allocation-rebalance-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
  gap: var(--card-gap);
}

.allocation-structure-panel,
.rebalance-receipt {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid #dfe7e3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(35, 67, 52, 0.07);
}

.allocation-structure-panel .allocation-stack {
  margin: 14px 0 18px;
}

.allocation-structure-list {
  display: grid;
}

.allocation-structure-row {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #edf1ef;
}

.allocation-structure-row:first-child {
  border-top: 0;
}

.allocation-structure-row > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 8px;
}

.allocation-structure-row > div .asset-category {
  margin: 0;
  grid-row: 1;
}

.allocation-structure-row > div strong {
  grid-row: 1;
  color: #172c24;
  font-size: 14px;
}

.allocation-structure-row > div small {
  grid-column: 1 / -1;
  color: #7a8982;
  font-size: 10px;
}

.allocation-structure-row > strong {
  color: #172c24;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.allocation-structure-row > strong small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.allocation-structure-row.is-zero {
  opacity: 0.5;
}

.allocation-structure-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.rebalance-receipt .receipt-heading {
  margin-bottom: 12px;
}

.receipt-heading > div {
  display: grid;
  gap: 2px;
}

.receipt-columns {
  margin-bottom: 14px;
}

.receipt-columns > div {
  min-height: 118px;
  background: #fbfdfc;
}

.rebalance-comparison-table th,
.rebalance-comparison-table td {
  padding: 10px 8px;
  text-align: right;
  white-space: nowrap;
}

.rebalance-comparison-table th:first-child,
.rebalance-comparison-table td:first-child {
  text-align: left;
}

.rebalance-comparison-table td:first-child strong {
  display: block;
  color: #172c24;
}

.rebalance-comparison-table .asset-category {
  margin: 0 6px 0 0;
  font-size: 8px;
}

.change-pill {
  padding: 3px 7px;
  display: inline-flex;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.history-rebalance-panel {
  padding: 18px;
}

.history-rebalance-list {
  border: 1px solid #dfe7e3;
  border-radius: 14px;
  overflow: hidden;
}

.history-rebalance-item {
  border-top: 1px solid #e6ece9;
  background: #fff;
}

.history-rebalance-item:first-child {
  border-top: 0;
}

.history-rebalance-item summary {
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.history-rebalance-item summary::-webkit-details-marker {
  display: none;
}

.history-rebalance-item summary span {
  color: #36564a;
  font-weight: 800;
}

.history-rebalance-item summary strong {
  min-width: 0;
  overflow: hidden;
  color: #172c24;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-rebalance-item summary em {
  color: #9a650e;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.history-rebalance-item[open] summary {
  background: #f4f8f6;
}

.history-rebalance-body {
  padding: 0 15px 15px;
}

.history-rebalance-item summary .history-risk-badge {
  margin-left: 9px;
  padding: 3px 7px;
  display: inline-flex;
  border: 1px solid rgba(207, 63, 85, 0.34);
  border-radius: 999px;
  background: #fff0f3;
  color: #b21e3b;
  font-size: 9px;
  line-height: 1;
  vertical-align: middle;
}

.history-risk-details {
  margin: 10px 0 12px;
  display: grid;
  gap: 8px;
}

.history-risk-note {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid rgba(213, 155, 47, 0.34);
  border-radius: 10px;
  background: #fff9e9;
}

.history-risk-note strong {
  color: #8f5509;
  font-size: 10px;
  white-space: nowrap;
}

.history-risk-note p {
  margin: 0;
  color: #685b42;
  font-size: 11px;
  line-height: 1.55;
}

.history-risk-note.is-triggered {
  border-color: rgba(207, 63, 85, 0.35);
  background: #fff0f3;
}

.history-risk-note.is-triggered strong {
  color: #b21e3b;
}

.history-risk-note.is-triggered p {
  color: #70444d;
}

.rebalance-performance-table th,
.rebalance-performance-table td {
  padding: 11px 10px;
  text-align: right;
  white-space: nowrap;
}

.rebalance-performance-table th:first-child,
.rebalance-performance-table td:first-child {
  text-align: left;
}

.rebalance-performance-table td:first-child strong {
  display: block;
  color: #172c24;
}

.rebalance-performance-table .asset-category {
  margin: 0 6px 0 0;
  font-size: 8px;
}

.rebalance-period-total {
  margin-top: 10px;
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  border: 1px solid #e0e8e4;
  border-radius: 11px;
  background: #f8fbf9;
  color: #50665c;
  font-size: 12px;
}

.rebalance-period-total strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.member-execution-note {
  margin-top: 12px;
}

.preview-card.previous-period {
  border-color: rgba(64, 104, 86, 0.18);
  background: #fff;
}

.previous-period-total {
  margin: 14px 0 10px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  background: #f2f7f4;
  color: #5f7168;
  font-size: 12px;
}

.previous-period-total strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.previous-period-assets {
  display: grid;
  gap: 8px;
}

.previous-period-assets > div {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5ebe8;
  border-radius: 11px;
  background: #fbfdfc;
}

.previous-period-assets > div > div {
  display: grid;
}

.previous-period-assets small {
  color: #718079;
  font-size: 10px;
}

.previous-period-assets > div > span {
  color: #718079;
  font-size: 10px;
  line-height: 1.7;
  text-align: right;
}

.previous-period-assets b {
  font-size: 11px;
}

.home-signal-card .panel-heading .button {
  min-width: 104px;
  flex: 0 0 auto;
  justify-content: center;
  white-space: nowrap;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.benchmark-picker {
  position: relative;
}

.benchmark-picker-button {
  min-height: 40px;
  padding: 7px 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d6dfda;
  border-radius: 999px;
  background: #fff;
  color: #61736a;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.benchmark-picker-button strong {
  color: #173b30;
}

.benchmark-picker-menu {
  width: min(320px, calc(100vw - 48px));
  max-height: min(420px, 70vh);
  padding: 8px;
  position: absolute;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  z-index: 18;
  inset: calc(100% + 8px) 0 auto auto;
  border: 1px solid #dce4df;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(35, 55, 46, 0.16);
}

.benchmark-picker-menu[hidden] {
  display: none;
}

.benchmark-picker-menu button {
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  text-align: left;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #66776f;
  cursor: pointer;
  font-size: 13px;
}

.benchmark-picker-menu button + button {
  margin-top: 4px;
}

.benchmark-picker-menu button strong {
  color: #172c24;
  font-size: 14px;
  line-height: 1.5;
}

.benchmark-picker-menu button[aria-selected="true"] {
  border-color: #e7bd61;
  background: #fff8e7;
}

.benchmark-picker-menu button:hover:not([aria-selected="true"]):not(:disabled) {
  background: #f0f6f3;
}

.benchmark-picker-menu button:focus-visible {
  outline: 2px solid var(--brand, #16725b);
  outline-offset: -2px;
}

.entry-price { display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.entry-price small { color: var(--muted); font-size: 12px; }
.history-cash-note { padding: 12px 16px; background: #f1f7f4; border: 1px solid #dce4df; border-radius: 12px; line-height: 1.7; }
.protection-exit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 12px 0; }
.history-risk-note:has(.protection-exit-grid) { display: block; }
.history-risk-note .protection-exit-grid strong { color: var(--text); }
.protection-exit-grid > span { display: grid; gap: 6px; font-size: 13px; }
.protection-exit-grid strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.history-risk-note .protection-exit-grid strong.negative { color: var(--fall); }
.history-risk-note .protection-exit-grid strong.positive { color: var(--rise); }
@media (max-width: 700px) { .protection-exit-grid { grid-template-columns: 1fr; gap: 12px; } }
.receipt-entry-prices { margin-top: 16px; border-top: 1px solid #dce4df; padding-top: 12px; }
.receipt-cost-body > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.receipt-entry-prices .entry-price { text-align: right; }
.receipt-entry-prices > summary { min-height: 44px; padding-block: 8px; cursor: pointer; font-weight: 750; }
.receipt-cost-body { padding-top: 8px; }
.rebalance-performance-table { min-width: 640px; }

.rebalance-schedule-notice {
  margin: 0 0 18px;
  padding: 17px 19px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(207, 63, 85, 0.36);
  border-radius: 17px;
  background:
    linear-gradient(110deg, rgba(255, 236, 240, 0.98), rgba(255, 251, 246, 0.96)),
    #fff;
  box-shadow: 0 16px 38px rgba(174, 50, 69, 0.12);
}

.rebalance-schedule-notice.is-admin {
  margin-top: 0;
}

.rebalance-schedule-notice.is-today {
  border-color: rgba(207, 63, 85, 0.38);
  background: linear-gradient(110deg, #fff0f2, #fffaf3);
}

.rebalance-schedule-label {
  display: block;
  margin-bottom: 4px;
  color: var(--rise);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.rebalance-schedule-notice.is-today .rebalance-schedule-label {
  color: var(--rise);
}

.rebalance-schedule-notice > div:first-child > strong {
  color: #172c24;
  font-size: 20px;
}

.rebalance-schedule-notice p {
  margin: 5px 0 0;
  color: #687b72;
  font-size: 11px;
}

.rebalance-schedule-countdown {
  min-width: 128px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 8px;
  border-left: 1px solid rgba(163, 109, 21, 0.18);
}

.rebalance-schedule-countdown > strong {
  grid-row: 1 / span 2;
  color: var(--rise);
  font-size: 34px;
  line-height: 1;
}

.rebalance-schedule-notice.is-today .rebalance-schedule-countdown > strong {
  color: var(--rise);
}

.rebalance-schedule-countdown > span {
  color: #344e43;
  font-size: 11px;
  font-weight: 800;
}

.rebalance-schedule-countdown small {
  color: #7b8a83;
  font-size: 9px;
}

.rebalance-overheat-alert {
  grid-column: 1 / -1;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  border: 1px solid rgba(217, 119, 6, 0.38);
  border-radius: 12px;
  background: rgba(255, 247, 224, 0.96);
}

.rebalance-overheat-alert > span {
  color: #a45d08;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.rebalance-overheat-alert > strong {
  color: #7b4307;
  font-size: 14px;
}

.rebalance-overheat-alert > p {
  margin: 0;
  color: #6d5536;
  font-size: 11px;
}

.rebalance-schedule-notice.is-triggered,
.rebalance-schedule-notice.is-touched {
  border-color: rgba(220, 38, 69, 0.58);
  background: linear-gradient(110deg, #ffe8ed, #fff7f2);
  box-shadow: 0 16px 38px rgba(190, 35, 65, 0.17);
}

.rebalance-schedule-notice.is-triggered .rebalance-overheat-alert,
.rebalance-schedule-notice.is-touched .rebalance-overheat-alert {
  border-color: rgba(220, 38, 69, 0.46);
  background: rgba(255, 235, 239, 0.98);
}

.rebalance-schedule-notice.is-triggered .rebalance-overheat-alert > span,
.rebalance-schedule-notice.is-triggered .rebalance-overheat-alert > strong,
.rebalance-schedule-notice.is-touched .rebalance-overheat-alert > span,
.rebalance-schedule-notice.is-touched .rebalance-overheat-alert > strong {
  color: #b91c3b;
}

.rebalance-schedule-notice.is-triggered .rebalance-overheat-alert > p,
.rebalance-schedule-notice.is-touched .rebalance-overheat-alert > p {
  color: #71404a;
}

.setting-row select,
.data-table select {
  min-height: 40px;
  padding: 8px 36px 8px 12px;
  appearance: none;
  border: 1px solid #cedbd5;
  border-radius: 10px;
  background:
    linear-gradient(45deg, transparent 50%, #567066 50%) calc(100% - 17px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, #567066 50%, transparent 50%) calc(100% - 12px) 50% / 5px 5px no-repeat,
    #fff;
  color: #183128;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.setting-row select {
  min-width: 190px;
}

.data-table select {
  min-width: 112px;
}

.setting-row select:focus-visible,
.data-table select:focus-visible {
  border-color: var(--emerald);
  outline: 3px solid rgba(10, 137, 107, 0.14);
  outline-offset: 1px;
}

@media (max-width: 1100px) {
  .drawdown-stage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .allocation-rebalance-layout {
    grid-template-columns: 1fr;
  }

  .drawdown-analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .calendar-section-heading {
    align-items: flex-start;
  }

  .calendar-section-heading .calendar-toolbar {
    margin-left: 0;
  }

  .return-calendar-shell:not(.annual-calendar-shell) {
    padding: 12px;
  }

  .return-calendar-cell {
    padding: 8px 2px;
  }

  .return-calendar-cell span,
  .return-calendar-cell strong {
    font-size: 10px;
  }

  .drawdown-stage-grid {
    grid-template-columns: 1fr;
  }

  .drawdown-stages-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-rebalance-item summary {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 6px 10px;
  }

  .history-rebalance-item summary em {
    grid-column: 2;
  }

  .history-risk-note {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .rebalance-schedule-notice {
    grid-template-columns: 1fr;
  }

  .rebalance-schedule-countdown {
    padding: 10px 0 0;
    border-top: 1px solid rgba(163, 109, 21, 0.18);
    border-left: 0;
  }

  .rebalance-overheat-alert {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .benchmark-picker-menu {
    right: auto;
    left: 0;
  }
}

.site-footer {
  border-color: rgba(64, 104, 86, 0.13);
}

@media (min-width: 1280px) {
  .site-header,
  .page,
  .site-footer {
    width: min(calc(100% - 64px), 1240px);
  }

  .home-summary-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.55fr);
  }
}

@media (max-width: 760px) {
  .primary-nav {
    border-color: rgba(64, 104, 86, 0.16);
    background: rgba(255, 255, 252, 0.98);
  }

  .page,
  .page-narrow {
    padding-top: 24px;
  }

  .hero {
    padding-top: 38px;
  }

  .hero h1 {
    font-size: clamp(40px, 11vw, 56px);
  }

  .section {
    padding-top: var(--module-gap);
  }

  .home-performance-card,
  .home-signal-card,
  .performance-chart-panel {
    padding: 20px;
  }

  .chart-reading-note {
    grid-template-columns: 1fr;
  }

  .chart-reading-note small {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .site-header {
    border-radius: 14px;
  }

  .hero-panel {
    min-height: 0;
    padding: 20px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .home-return-grid {
    gap: 8px;
  }

  .home-return-tile {
    min-height: 86px;
    padding: 13px;
  }

  .snapshot-metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    padding: 19px;
  }

  .chart-wrap,
  .chart-wrap svg {
    min-height: 230px;
    height: 230px;
  }

  .return-calendar-cell {
    min-height: 50px;
  }

  .calendar-period-control,
  .calendar-year-control {
    min-width: 140px;
  }

  .calendar-period-button,
  .calendar-year-control {
    min-height: 50px;
  }

  .calendar-period-button span {
    display: none;
  }

  .return-calendar-year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .return-calendar-year-cell {
    min-height: 78px;
    padding: 12px;
  }

  .allocation-grid.is-balanced {
    grid-template-columns: 1fr;
  }

  .allocation-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chart-tooltip {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .refresh-action-group {
    width: 100%;
    justify-content: stretch;
  }

  .refresh-action-group .button {
    flex: 1 1 145px;
  }
}

/* Final homepage layout overrides live after the responsive compatibility
   rules so the hero remains edge-to-edge on every viewport. */
.home-page {
  width: 100%;
  max-width: none;
  padding-top: 24px;
}

.home-page > .hero-home {
  width: 100%;
  margin-inline: 0;
}

.home-page > .section {
  width: min(calc(100% - 64px), 1240px);
  margin-inline: auto;
}

/* The router moves focus to <main> after navigation for screen readers. Its
   default focus ring looked like a full-width green divider, so the landmark
   stays focusable without drawing a viewport-wide outline. */
#main-content:focus,
#main-content:focus-visible {
  outline: none;
}

.site-header {
  position: sticky;
  top: 0;
  overflow: visible;
  isolation: auto;
  contain: none;
  clip-path: none;
  border: 1px solid rgba(80, 112, 98, 0.16);
  background: #fffffc;
  box-shadow: 0 12px 30px rgba(38, 67, 54, 0.09);
}

/* Compact interface copy stays on one line whenever the available width is
   sufficient. Explanatory prose continues to wrap naturally. */
.primary-nav a,
.nav-account-button,
.button,
.range-button,
.benchmark-picker-button,
.calendar-period-button,
.calendar-year-control,
.metric-label,
.status-badge,
.chart-legend span,
.admin-sidebar button,
.setting-row label,
.data-table th {
  white-space: nowrap;
}

.panel-heading h3,
.card-header h3,
.receipt-heading h3,
.drawdown-stages-heading strong {
  text-wrap: nowrap;
}

@media (min-width: 900px) {
  .section-heading > div:first-child {
    flex: 0 0 auto;
  }

  .section-heading .section-copy {
    max-width: 720px;
    flex: 1 1 auto;
    text-align: right;
  }
}

/* Drawdown chart: match the return-chart interaction language with a crisp
   white hover card, red strategy line and restrained dashed benchmark. */
.drawdown-analysis-panel {
  border-color: rgba(64, 104, 86, 0.14);
  background: #fff;
}

.drawdown-chart-card,
.drawdown-stage-table-panel {
  border-color: rgba(64, 104, 86, 0.14);
  background: #fff;
}

.drawdown-analysis-panel .chart-line:not(.secondary-line) {
  stroke: var(--chart-primary);
  stroke-width: 2.5;
}

.drawdown-analysis-panel .chart-line.secondary-line {
  stroke: var(--chart-benchmark);
  stroke-width: 1.55;
  stroke-dasharray: 7 6;
}

.drawdown-analysis-panel .chart-point-primary,
.chart-tone-drawdown .chart-floating-dot.is-primary {
  fill: var(--chart-primary);
}

.drawdown-analysis-panel .chart-end-badge:not(.is-secondary) rect {
  stroke: var(--chart-primary);
}

.drawdown-analysis-panel .chart-end-badge:not(.is-secondary) text {
  fill: var(--chart-primary);
}

.drawdown-chart-legend .legend-key::before {
  background: var(--chart-primary);
}

.drawdown-chart-legend .legend-key.secondary::before {
  background: var(--chart-benchmark);
}

.drawdown-range-summary {
  border-color: rgba(185, 121, 19, 0.2);
  background: #fffaf0;
}

.drawdown-range-summary strong {
  color: var(--rise);
}

.chart-hover-layer line[data-chart-crosshair] {
  stroke: rgba(46, 63, 56, 0.42);
  stroke-width: 1;
  stroke-dasharray: none;
}

.chart-floating-tooltip rect {
  fill: rgba(255, 255, 255, 0.985);
  stroke: rgba(39, 62, 52, 0.18);
  stroke-width: 1;
  filter: drop-shadow(0 10px 18px rgba(24, 42, 34, 0.18));
}

.chart-floating-tooltip text {
  fill: #263c34;
  font-size: 13px;
  font-weight: 700;
}

.chart-floating-tooltip .chart-floating-date {
  fill: #10271e;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.chart-floating-tooltip .chart-floating-value,
.chart-floating-tooltip .chart-floating-extra {
  font-size: 13px;
  font-weight: 850;
}

.chart-floating-tooltip .chart-floating-divider {
  stroke: rgba(44, 67, 57, 0.12);
  stroke-width: 1;
  stroke-dasharray: none;
}

.chart-hover-layer [data-chart-primary-hover] {
  stroke: var(--rise);
}

@media (max-width: 760px) {
  .panel-heading h3,
  .card-header h3,
  .receipt-heading h3,
  .drawdown-stages-heading strong {
    text-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .home-page {
    padding-top: 14px;
  }

  .home-page > .section {
    width: min(calc(100% - 28px), 1240px);
  }

  .home-page > .hero-home {
    min-height: 540px;
    padding: 64px 22px;
  }
}

/* Institutional editorial finish -------------------------------------------
   Keep every route on the same baseline: neutral surfaces, measured type,
   disciplined spacing and colour reserved for meaning rather than decoration. */
.page:not(.home-page) > .page-hero h1,
.page-narrow > .page-hero h1 {
  max-width: 1040px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.25;
}

.page:not(.home-page) > .page-hero .lead,
.page-narrow > .page-hero .lead {
  max-width: 980px;
}

.panel,
.metric-card,
.feature-card,
.preview-card,
.gate-card,
.notice-card,
.auth-card,
.admin-sidebar {
  border-color: rgba(55, 86, 72, 0.15);
  box-shadow: 0 14px 36px rgba(35, 67, 52, 0.07);
}

.panel,
.metric-card,
.feature-card,
.preview-card,
.gate-card,
.notice-card {
  background-color: #fff;
}

.section-heading,
.panel-heading,
.card-header,
.receipt-heading {
  column-gap: 24px;
}

.section-heading h2,
.panel-heading h3,
.card-header h3 {
  color: #0d2d22;
}

.section-copy,
.lead,
.muted {
  color: #5d7067;
}

.data-table {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.data-table th {
  font-size: 13px;
  padding-block: 12px;
  background: #f1f5f3;
  color: #4e655b;
  letter-spacing: 0.035em;
}

.data-table td {
  padding-block: 13px;
  color: #17342a;
}

.data-table tbody tr:hover {
  background: #f7faf8;
}

.admin-layout {
  align-items: start;
}

.admin-content,
.admin-section {
  min-width: 0;
}

.admin-section.active > :first-child {
  margin-top: 0;
}

.admin-summary-grid {
  gap: 16px;
}

.admin-summary-grid .metric-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.admin-summary-grid .metric-value {
  margin-top: 10px;
  line-height: 1.18;
}

.admin-summary-grid .metric-foot {
  margin-top: 12px;
}

.admin-freshness-grid {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(29, 59, 46, 0.05);
}

.admin-freshness-item {
  min-width: 0;
  padding: 17px 20px 16px;
  display: grid;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
}

.admin-freshness-item:last-child {
  border-right: 0;
}

.admin-freshness-label,
.admin-freshness-foot {
  color: #61766c;
  font-size: 12px;
}

.admin-freshness-label {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.admin-freshness-value {
  color: #0d2d22;
  font-size: clamp(18px, 1.7vw, 24px);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rebalance-schedule-notice {
  box-shadow: 0 12px 30px rgba(174, 50, 69, 0.08);
}

.intraday-ranking-panel.is-decision-zone {
  box-shadow: 0 14px 36px rgba(45, 83, 119, 0.09);
}

.strategy-settings-panel {
  margin-top: 0;
}

.strategy-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.strategy-settings-grid label,
.strategy-threshold-row label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #314e42;
  font-size: 14px;
  font-weight: 800;
}

.strategy-settings-grid input,
.strategy-settings-grid select,
.strategy-threshold-row input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cedbd5;
  border-radius: 10px;
  background: #fff;
  color: #17342a;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.strategy-settings-grid input:focus-visible,
.strategy-settings-grid select:focus-visible,
.strategy-threshold-row input:focus-visible {
  border-color: var(--emerald);
  outline: 3px solid rgba(10, 137, 107, 0.14);
  outline-offset: 1px;
}

.strategy-risk-row {
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.strategy-threshold-row {
  padding: 16px 0;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  align-items: end;
  gap: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.strategy-threshold-row label {
  position: relative;
}

.strategy-threshold-row label em {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: #61766c;
  font-style: normal;
}

.strategy-threshold-row input {
  padding-right: 30px;
}

.strategy-threshold-row p {
  margin: 0 0 10px;
  color: #667a70;
  font-size: 13px;
}

.strategy-settings-panel .button-row {
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.strategy-settings-panel .refresh-status {
  margin: 0;
}

.auth-card::before {
  height: 4px;
}

@media (max-width: 760px) {
  .page:not(.home-page) > .page-hero h1,
  .page-narrow > .page-hero h1 {
    font-size: clamp(28px, 7.8vw, 32px);
  }

  .admin-summary-grid .metric-card {
    min-height: 0;
  }

  .admin-freshness-grid {
    grid-template-columns: 1fr;
  }

  .admin-freshness-item {
    grid-template-columns: minmax(88px, 0.55fr) minmax(0, 1fr);
    align-items: baseline;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .admin-freshness-item:last-child {
    border-bottom: 0;
  }

  .admin-freshness-foot {
    grid-column: 2;
  }

  .strategy-settings-grid,
  .strategy-threshold-row {
    grid-template-columns: 1fr;
  }

  .strategy-settings-panel .button-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .intraday-data-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.skip-focus-target:focus {
  outline: 3px solid rgba(8, 127, 103, 0.72);
  outline-offset: 5px;
}

/* Portfolio long-page navigation and progressive disclosure ----------------
   Desktop preserves the complete research report. Compact screens keep the
   decision-critical summary visible and progressively disclose dense tables. */
.portfolio-section-nav {
  position: sticky;
  top: calc(var(--header-height, 72px) + 12px);
  z-index: 18;
  width: 100%;
  max-width: 100%;
  margin: 18px 0 0;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid rgba(55, 86, 72, 0.16);
  border-radius: 15px;
  background: rgba(255, 255, 252, 0.94);
  box-shadow: 0 10px 30px rgba(35, 67, 52, 0.08);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.portfolio-section-nav::-webkit-scrollbar {
  display: none;
}

.portfolio-section-nav button {
  min-height: 38px;
  padding: 8px 15px;
  flex: 1 0 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #52685e;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.portfolio-section-nav button:hover,
.portfolio-section-nav button:focus-visible {
  border-color: rgba(8, 127, 103, 0.2);
  background: #f2f7f4;
  color: #075f4d;
}

.portfolio-section-nav button[aria-current="true"],
.portfolio-section-nav button.active {
  border-color: rgba(8, 127, 103, 0.18);
  background: #e8f5ef;
  color: #075f4d;
  box-shadow: inset 0 -2px 0 #0b9678;
}

.portfolio-section-target {
  scroll-margin-top: calc(var(--header-height, 72px) + 86px);
}

.portfolio-section-target:focus {
  outline: none;
}

.portfolio-section-target:focus-visible {
  outline: 2px solid rgba(8, 127, 103, 0.48);
  outline-offset: 8px;
}

.portfolio-progressive-details {
  min-width: 0;
}

.portfolio-progressive-details > summary {
  min-height: 44px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #dce6e1;
  border-radius: 11px;
  background: #f7faf8;
  color: #18382d;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.portfolio-progressive-details > summary::-webkit-details-marker {
  display: none;
}

.portfolio-progressive-details > summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e8f1ec;
  color: #1f5c48;
  font-size: 15px;
}

.portfolio-progressive-details[open] > summary::after {
  content: "−";
}

.portfolio-progressive-details > summary small {
  margin-left: auto;
  color: #718279;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.drawdown-details > summary {
  margin-bottom: 12px;
}

.drawdown-details:not([open]) > summary {
  margin-bottom: 0;
}

.period-highlight-grid {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.period-highlight-card {
  min-width: 0;
  min-height: 112px;
  padding: 15px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  border: 1px solid #dce6e1;
  border-radius: 13px;
  background: #f8faf9;
}

.period-highlight-card > span,
.period-highlight-card small {
  color: #64786e;
  font-size: 11px;
}

.period-highlight-card strong {
  font-size: clamp(22px, 3vw, 30px);
  font-variant-numeric: tabular-nums;
}

.period-history-details > summary {
  margin-bottom: 12px;
}

.period-history-details:not([open]) > summary {
  margin-bottom: 0;
}

.history-rebalance-groups {
  display: grid;
  gap: 12px;
}

.history-more-details > summary {
  border-color: rgba(8, 127, 103, 0.18);
  background: #f3f8f5;
}

.history-more-details > .history-rebalance-list {
  margin-top: 10px;
}

.history-archive-content {
  max-height: min(72vh, 760px);
  margin-top: 10px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.history-load-status {
  margin: 0 2px 10px;
  color: #596b62;
  font-size: 11px;
  font-weight: 700;
}

.history-load-status:empty {
  display: none;
}

.history-more-details[data-state="loading"] > summary::after {
  content: "…";
}

.history-more-details[data-state="error"] > summary {
  border-color: rgba(185, 46, 68, 0.35);
  background: #fff7f8;
}

.history-more-details[data-state="error"] .history-load-status {
  color: #9f263c;
}

.history-year-groups {
  display: grid;
  gap: 8px;
}

.history-year-group {
  border: 1px solid #dfe7e3;
  border-radius: 12px;
  background: #fff;
}

.history-year-group > summary {
  min-height: 44px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #18382d;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.history-year-group > summary::-webkit-details-marker {
  display: none;
}

.history-year-group > summary small {
  margin-left: auto;
  color: #596b62;
  font-size: 10px;
  font-weight: 700;
}

.history-year-group > summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f1ec;
  color: #1f5c48;
}

.history-year-group[open] > summary::after {
  content: "−";
}

.history-year-group[open] > summary {
  background: #f4f8f6;
}

.history-year-records {
  padding: 0 10px 10px;
}

.table-scroll-hint {
  margin: 5px 2px 7px;
  color: #718279;
  font-size: 13px;
  font-weight: 750;
  text-align: right;
}

.table-scroll-hint::after {
  content: "  ↔";
  color: #0b8d70;
}

.data-table-wrap.is-scrollable:focus-visible {
  outline: 2px solid rgba(8, 127, 103, 0.42);
  outline-offset: 2px;
}

.runs-table {
  min-width: 720px;
  table-layout: fixed;
}

.runs-table th:nth-child(1) { width: 170px; }
.runs-table th:nth-child(2) { width: 140px; }
.runs-table th:nth-child(3) { width: 140px; }
.runs-table td:nth-child(2) small { display: block; margin-top: 4px; color: var(--muted); }

.runs-table td {
  vertical-align: top;
}

.runs-table .run-status-cell,
.runs-table .run-detail-cell {
  white-space: normal;
  overflow-wrap: anywhere;
}

.runs-toolbar {
  align-items: center;
  margin-block: 16px 12px;
  gap: 10px 16px;
}

.runs-toolbar label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.runs-toolbar select {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.runs-toolbar .button {
  min-height: 44px;
}

.runs-toolbar [data-run-page-status] {
  flex: 1 1 260px;
  min-width: 0;
  line-height: 1.5;
}

.run-status-cell small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.run-detail-cell {
  min-width: 0;
}

.run-detail-text {
  display: block;
  overflow-wrap: anywhere;
}

.run-detail-cell > small {
  display: block;
  margin-block: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.run-detail-cell > .run-error-details {
  margin-top: 6px;
}

.run-error-details {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.run-error-details > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #223f34;
  list-style: none;
  cursor: pointer;
}

.run-error-details > summary::-webkit-details-marker {
  display: none;
}

.run-error-details > summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-error-details > summary small {
  flex: 0 0 auto;
  color: #9a5a08;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.run-error-details > pre {
  max-width: 100%;
  max-height: 240px;
  margin: 10px 0 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid #ead9b9;
  border-radius: 9px;
  background: #fffaf0;
  color: #5f4a27;
  font: 10px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .portfolio-section-nav {
    top: calc(var(--header-height, 64px) + 8px);
    margin-top: 12px;
    padding: 5px;
    border-radius: 13px;
    scroll-snap-type: x proximity;
  }

  .portfolio-section-nav button {
    min-height: 44px;
    padding: 7px 13px;
    scroll-snap-align: center;
  }

  .portfolio-page .range-button,
  .portfolio-page .benchmark-picker-button,
  .calendar-month-nav button,
  .calendar-month-nav .calendar-period-button,
  .calendar-year-control,
  .admin-sidebar button,
  .admin-section .button,
  .admin-section select,
  .admin-section input:not([type="checkbox"]):not([type="radio"]),
  .admin-section textarea {
    min-height: 44px;
  }

  .calendar-month-nav button {
    min-width: 44px;
  }

  .portfolio-section-target {
    scroll-margin-top: calc(var(--header-height, 64px) + 72px);
  }

  .portfolio-page .section {
    padding-top: 50px;
  }

  .portfolio-page .snapshot-section {
    padding-top: 38px;
  }

  .portfolio-page .section-heading {
    margin-bottom: 24px;
  }

  .snapshot-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .snapshot-metrics-grid .metric-card {
    min-height: 116px;
    padding: 13px 12px;
  }

  .snapshot-metrics-grid .metric-label {
    min-height: 30px;
    font-size: 10px;
    line-height: 1.45;
  }

  .snapshot-metrics-grid .metric-tag {
    margin: 0 4px 2px 0;
    padding: 2px 5px;
    font-size: 8px;
  }

  .snapshot-metrics-grid .metric-value {
    margin-top: 8px;
    font-size: clamp(21px, 7vw, 29px);
  }

  .snapshot-metrics-grid .metric-inline {
    margin-top: 7px;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .snapshot-metrics-grid .metric-inline > span {
    font-size: 12px;
  }

  .snapshot-metrics-grid .metric-foot {
    margin-top: 7px;
    font-size: 9px;
    line-height: 1.4;
  }

  .portfolio-progressive-details > summary {
    min-height: 46px;
  }

  .period-table-panel {
    padding: 16px;
  }

  .period-highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .period-highlight-card {
    min-height: 104px;
    padding: 11px 12px;
    align-content: space-between;
  }

  .period-highlight-card strong {
    font-size: 20px;
  }

  .period-highlight-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    min-height: 80px;
  }

  .allocation-structure-panel,
  .portfolio-page .rebalance-receipt {
    padding: 14px;
  }

  .allocation-structure-panel .allocation-stack {
    margin: 9px 0 11px;
  }

  .allocation-structure-row {
    padding: 7px 0;
    gap: 7px;
  }

  .allocation-structure-row > div strong,
  .allocation-structure-row > strong {
    font-size: 12px;
  }

  .portfolio-page .receipt-heading {
    margin-bottom: 8px;
    gap: 8px;
  }

  .portfolio-page .receipt-heading > strong {
    font-size: 15px;
    white-space: nowrap;
  }

  .portfolio-page .receipt-columns {
    margin: 10px 0;
    flex-direction: row;
    gap: 8px;
  }

  .portfolio-page .receipt-columns > div {
    width: 50%;
    min-height: 0;
    padding: 10px;
  }

  .portfolio-page .receipt-columns ul {
    margin-top: 8px;
    gap: 6px;
  }

  .portfolio-page .receipt-columns li {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
  }

  .portfolio-page .rebalance-comparison-table th,
  .portfolio-page .rebalance-comparison-table td,
  .portfolio-page .rebalance-performance-table th,
  .portfolio-page .rebalance-performance-table td {
    padding: 7px 6px;
  }

  .portfolio-page .history-rebalance-panel {
    padding: 14px;
  }

  .portfolio-page .history-rebalance-panel > .panel-heading {
    margin-bottom: 16px;
  }

  .portfolio-page .history-rebalance-item summary {
    min-height: 62px;
    padding: 10px 11px;
  }

  .history-rebalance-item summary strong {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .drawdown-stage-table-panel {
    padding: 13px;
  }
}

@media (max-width: 340px) {
  .snapshot-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* Trusted operations release -------------------------------------------------
   Report-like public surfaces and compact operational admin tools. */
body {
  background: #f4f6f3;
}

.site-header {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(35, 67, 52, 0.06);
}

.site-footer {
  background: #fff;
}

.primary-nav .nav-cta,
.button {
  background: #087f67;
  box-shadow: none;
}

.primary-nav .nav-cta:hover,
.button:hover {
  background: #066b57;
}

.home-page {
  padding-top: 32px;
}

.home-page > .hero-home {
  width: min(calc(100% - 64px), 1240px);
  min-height: 0;
  margin-inline: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  text-align: left;
}

.hero-report {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(55, 86, 72, 0.16);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(35, 67, 52, 0.07);
}

.hero-report-meta {
  min-height: 48px;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(55, 86, 72, 0.12);
  color: #5b6f66;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.hero-home .hero-copy {
  width: min(900px, 100%);
  margin: 0;
  padding: clamp(54px, 7vw, 86px) clamp(28px, 6vw, 76px);
}

.hero-home .eyebrow {
  color: var(--emerald);
  letter-spacing: 0.18em;
}

.hero-home h1 {
  max-width: 820px;
  margin: 16px 0 24px;
  color: #10271e;
  font-size: clamp(40px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.hero-home h1 span {
  display: block;
  margin-top: 8px;
  background: none;
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

.hero-home .lead {
  max-width: 700px;
  margin-inline: 0;
  color: #52675e;
  font-size: clamp(16px, 1.5vw, 19px);
}

.hero-home .hero-actions,
.hero-home .hero-fine-print {
  justify-content: flex-start;
}

.hero-home .hero-fine-print {
  color: #60736a;
}

.hero-report-footer {
  min-height: 66px;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(55, 86, 72, 0.12);
  background: #fafcfb;
}

.hero-report-footer span {
  min-height: 38px;
  padding: 4px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid rgba(55, 86, 72, 0.12);
  color: #41594e;
  font-size: 13px;
  font-weight: 720;
}

.hero-report-footer span:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-report-footer strong {
  color: var(--emerald);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.operation-status {
  min-height: 28px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d3ded9;
  border-radius: 999px;
  background: #f7f9f8;
  color: #435b50;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.operation-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #83948c;
}

.operation-status.healthy,
.operation-status.recovered {
  border-color: #b8d9cc;
  background: #edf8f3;
  color: #12644f;
}

.operation-status.healthy > span,
.operation-status.recovered > span {
  background: #188065;
}

.operation-status.recovered > span {
  box-shadow: 0 0 0 3px rgba(24, 128, 101, 0.13);
}

.operation-status.warning {
  border-color: #ead4a8;
  background: #fff9ec;
  color: #895b0d;
}

.operation-status.warning > span {
  background: #c98010;
}

.operation-status.danger {
  border-color: #ecc2c9;
  background: #fff3f5;
  color: #a52e41;
}

.operation-status.danger > span {
  background: #cf3f55;
}

.source-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-summary-grid .metric-value { font-size: 24px; overflow-wrap: anywhere; }

.source-monitor-panel {
  margin-top: 20px;
}

.source-table {
  min-width: 1060px;
}

.source-table td strong,
.source-table td small {
  display: block;
}

.probe-schedule-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.probe-schedule-table td {
  overflow-wrap: anywhere;
  white-space: normal;
}

.probe-schedule-table td strong,
.probe-schedule-table td small {
  display: block;
}

.probe-schedule-table td small {
  margin-top: 5px;
  color: var(--muted);
}

.probe-schedule-table summary {
  padding-block: 8px;
  cursor: pointer;
}

@media (max-width: 700px) {
  .probe-schedule-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .probe-schedule-table tbody,
  .probe-schedule-table tr,
  .probe-schedule-table td {
    display: block;
    width: 100%;
  }

  .probe-schedule-table tr {
    border-bottom: 1px solid var(--line-soft);
    padding-block: 10px;
  }

  .probe-schedule-table td {
    border: 0;
    padding: 8px 12px;
  }

  .probe-schedule-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--muted);
  }
}

.source-table td small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.section-copy,
.lead,
.muted {
  color: #52645b;
}

.portfolio-progressive-details > summary small,
.table-scroll-hint {
  color: #596b62;
}

.period-highlight-card > span,
.period-highlight-card small {
  color: #596b62;
}

.status-badge {
  border-color: #b8d9cc;
  background: #edf8f3;
  color: #075f4d;
}

.allocation-structure-row.is-zero {
  opacity: 1;
  background: #fbfcfb;
}

.allocation-structure-row > div small,
.allocation-structure-row.is-zero > div strong,
.allocation-structure-row.is-zero > strong,
.allocation-structure-row.is-zero .asset-category {
  color: #596b62;
}

.asset-category,
.receipt-heading > strong {
  color: #7a5008;
}

.preview-card .pill {
  border-color: #b8d9cc;
  background: #edf8f3;
  color: #075f4d;
}

.home-performance-card,
.home-signal-card {
  background: #fff;
  box-shadow: 0 12px 32px rgba(35, 67, 52, 0.06);
}

.previous-period-assets small,
.previous-period-assets > div > span {
  color: #596b62;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .home-page {
    padding-top: 14px;
    padding-bottom: 44px;
  }

  .home-page > .hero-home {
    width: min(calc(100% - 28px), 1240px);
    min-height: 0;
    padding: 0;
  }

  .hero-report {
    border-radius: 16px;
  }

  .hero-report-meta {
    padding: 11px 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .hero-home .hero-copy {
    padding: 28px 20px;
  }

  .hero-home h1 {
    font-size: clamp(34px, 10.5vw, 42px);
  }

  .hero-report-footer {
    padding: 8px 16px;
    grid-template-columns: 1fr;
  }

  .hero-report-footer span,
  .hero-report-footer span:first-child {
    min-height: 44px;
    padding: 8px 0;
    border-top: 1px solid rgba(55, 86, 72, 0.1);
    border-left: 0;
  }

  .hero-report-footer span:first-child {
    border-top: 0;
  }

  .source-summary-grid {
    grid-template-columns: 1fr;
  }

  .source-monitor-panel {
    padding: 16px;
  }
}

/* Production audit fixes ----------------------------------------------------
   Make clipped horizontal content discoverable without adding permanent
   controls, and keep the highest-value mobile actions readable first. */
.horizontal-scroll-surface.has-horizontal-overflow {
  overscroll-behavior-inline: contain;
}

.status-badge,
.pill {
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
}

.preview-card .card-header > div {
  min-width: 0;
}

.static-page-title .headline-line {
  width: max-content;
  max-width: 100%;
  display: block;
  text-align: left;
  text-align-last: left;
  white-space: nowrap;
  word-spacing: 0;
}

.horizontal-scroll-surface.can-scroll-right:not(.can-scroll-left) {
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 30px), transparent 100%);
}

.horizontal-scroll-surface.can-scroll-left:not(.can-scroll-right) {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 100%);
}

.horizontal-scroll-surface.can-scroll-left.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
}

@media (max-width: 760px) {
  .auth-layout {
    padding: 36px 0 48px;
    gap: 44px;
  }

  .auth-card {
    order: -1;
  }

  .auth-intro {
    padding: 0 14px;
  }

  .auth-intro h1 {
    font-size: clamp(34px, 9.5vw, 40px);
    line-height: 1.12;
    text-wrap: balance;
  }

  .portfolio-section-nav,
  .admin-sidebar {
    scroll-padding-inline: 24px;
  }

  .portfolio-section-nav button {
    padding-inline: 10px;
  }

  .receipt-heading {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .receipt-heading > div {
    min-width: 0;
  }

  .receipt-heading > strong {
    align-self: start;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }

  .table-scroll-hint {
    min-height: 28px;
    margin: 8px 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #49675b;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .snapshot-metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 340px) {
  .receipt-heading {
    grid-template-columns: 1fr;
  }

  .receipt-heading > strong {
    justify-self: start;
  }
}

/* Desktop clarity and semantic return cards -------------------------------
   Keep report surfaces neutral; reserve market colours for actual values. */
.snapshot-metrics-grid .metric-return {
  border-color: rgba(55, 86, 72, 0.15);
  background: #fff;
}

.metric-return .metric-label {
  color: var(--text-soft);
}

.metric-return .metric-value,
.metric-return .metric-tag {
  color: var(--muted);
}

.snapshot-metrics-grid .metric-return::before {
  background: #83948c;
}

.metric-return.is-positive .metric-value,
.metric-return.is-positive .metric-tag {
  color: var(--rise);
}

.metric-return.is-positive::before {
  background: var(--rise);
}

.metric-return.is-negative .metric-value,
.metric-return.is-negative .metric-tag {
  color: var(--fall);
}

.metric-return.is-negative::before {
  background: var(--fall);
}

@media (min-width: 761px) {
  .home-page {
    padding-top: 22px;
  }

  .hero-home .hero-copy {
    padding: 32px clamp(32px, 4vw, 48px) 32px;
  }

  .hero-home h1 {
    max-width: 780px;
    margin-block: 12px 18px;
    font-size: clamp(40px, 4.2vw, 52px);
  }

  .hero-report-footer {
    min-height: 56px;
    padding-block: 10px;
  }

  .portfolio-page > .page-hero,
  .admin-page > .page-hero {
    padding-top: 20px;
    padding-bottom: 24px;
  }

  .portfolio-page > .page-hero h1,
  .admin-page > .page-hero h1 {
    font-size: clamp(28px, 3vw, 36px);
  }

  .portfolio-page > .page-hero .lead,
  .admin-page > .page-hero .lead {
    max-width: 880px;
    margin-top: 14px;
  }

  .admin-page > .admin-layout {
    padding-top: var(--module-gap);
  }
}

.paper-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.paper-follow-center .release-card { margin-bottom: 12px; }
.paper-follow-center .fine-print { overflow-wrap: anywhere; }
.paper-curve-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.paper-curve-controls button[aria-pressed="true"] { color: #fff; background: var(--accent, #087f6c); }
.paper-curve-drawing { width: 100%; overflow: hidden; }
.paper-curve-svg { display: block; width: 100%; min-height: 170px; touch-action: pan-y; }
.paper-curve-svg:focus-visible { outline: 2px solid #087f6c; outline-offset: 2px; }
.paper-curve-svg text { fill: #53647a; font-size: 16px; }
.paper-curve-grid { stroke: #e3eae7; stroke-width: 1; }
.paper-curve-baseline { stroke: #8b9b94; stroke-dasharray: 5 5; }
.paper-curve-gap { fill: #8b9b94; opacity: .16; }
.paper-curve-focus { stroke: #8b9b94; stroke-dasharray: 4 4; }
.paper-curve-readout { min-height: 1.6em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 600px) { .paper-curve-svg text { font-size: 36px; } }
@media (max-width: 760px) { .paper-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .paper-summary-grid { grid-template-columns: 1fr; } .paper-record > summary { align-items: flex-start; flex-wrap: wrap; } }

.paper-recovery > summary { cursor: pointer; min-height: 44px; font-weight: 600; }
.paper-recovery [data-recovery-host] { margin-top: 1rem; }
.paper-recovery textarea { width: 100%; max-width: 100%; min-height: 180px; resize: vertical; font-family: monospace; }
.paper-recovery .recovery-ack { display: flex; align-items: center; gap: .6rem; min-height: 44px; margin: 1rem 0; }
.paper-recovery .recovery-ack input { width: 20px; height: 20px; flex-shrink: 0; }
.paper-recovery .release-body { overflow-wrap: anywhere; }
.paper-recovery .fine-print { overflow-wrap: anywhere; }
.paper-recovery summary:focus-visible { outline: 2px solid var(--accent, #087f6c); outline-offset: 4px; }
/* Research is a bounded report; overflow remains inside the keyboard region. */
.ranking-table-wrap { max-height: 560px; overflow: auto; scroll-padding: 56px 0 0 196px; }
.ranking-table-wrap thead th { position: sticky; top: 0; z-index: 3; background: #f4f7f5; }
.ranking-table-wrap :is(th, td):nth-child(-n+2) { position: sticky; z-index: 2; background: #fff; }
.ranking-table-wrap :is(th, td):first-child { left: 0; min-width: 56px; width: 56px; }
.ranking-table-wrap :is(th, td):nth-child(2) { left: 56px; min-width: 140px; box-shadow: 2px 0 0 var(--line); }
.ranking-table-wrap thead th:nth-child(-n+2) { z-index: 4; background: #f4f7f5; }
.context-table-wrap { max-height: 560px; overflow: auto; scroll-padding: 56px 0 0 180px; }
.context-table-wrap thead th { position: sticky; top: 0; z-index: 3; }
.context-table-wrap :is(th, td):first-child { position: sticky; left: 0; z-index: 2; min-width: 160px; background: var(--surface); box-shadow: 2px 0 0 var(--line-soft); }
.context-table-wrap thead th:first-child { z-index: 4; background: #f1f5f3; }
.source-evidence > summary { min-height: 44px; padding-block: 8px; cursor: pointer; font-weight: 700; white-space: nowrap; }
.source-evidence { min-width: 220px; }
.robustness-report { display: grid; gap: var(--module-gap); min-width: 0; }
.robustness-report > .panel { min-width: 0; }
.research-fee-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.research-fee-card { padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.research-fee-card h3 { margin: 0; }
.research-fee-card dl { display: grid; gap: 12px; margin-bottom: 0; }
.research-fee-card dl > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.research-fee-card dt { color: var(--muted); font-size: 13px; }
.research-fee-card dd { margin: 0; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.research-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-block: 20px; }
.research-filters label { display: grid; gap: 6px; font-size: 14px; }
.research-filters select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.research-filters p { flex-basis: 100%; margin: 0; }
.robustness-table :is(th, td):nth-child(n+3) { text-align: right; }
@media (max-width: 760px) { .research-fee-grid { grid-template-columns: 1fr; } }
.robustness-table { min-width: 1080px; }
.robustness-report .fine-print { overflow-wrap: anywhere; }
.robustness-report summary { padding: 12px 0; cursor: pointer; min-height: 44px; }
.robustness-parameters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.robustness-parameters dt { color: var(--muted); overflow-wrap: anywhere; }
.robustness-parameters dd { margin: 4px 0 0; }

.notification-option { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.notification-option input { width: 20px; height: 20px; flex: 0 0 20px; }
.notification-card { margin-bottom: 16px; }
.notification-card summary { cursor: pointer; min-height: 44px; padding: 12px 0; }

@media (max-width: 760px) {
  [data-admin-section] input:not([type="checkbox"]):not([type="radio"]),
  [data-admin-section] select {
    min-height: 44px;
  }
}
.notification-card .fine-print { overflow-wrap: anywhere; }

/* Home and portfolio report refinements -----------------------------------
   Keep the public surfaces bright and legible while letting market colours
   communicate meaning. These rules intentionally stay within these routes. */
.home-page,
.portfolio-page {
  font-size: 16px;
}

.home-page .button,
.home-page .home-detail-links a {
  min-height: 44px;
}

.portfolio-page .chart-reading-note small,
.portfolio-page .portfolio-progressive-details > summary small,
.portfolio-page .history-year-group > summary small,
.portfolio-page .drawdown-stage-note,
.portfolio-page .period-highlight-card small {
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.portfolio-page .period-highlight-card > span {
  font-size: 14px;
}

.portfolio-page .snapshot-metric-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.portfolio-page .snapshot-primary-metrics,
.portfolio-page .snapshot-secondary-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-page .snapshot-metrics-grid .metric-card {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border-color: rgba(55, 86, 72, 0.15);
  background: #fff;
  box-shadow: 0 8px 22px rgba(35, 67, 52, 0.045);
}

.portfolio-page .snapshot-metrics-grid .metric-card:not(.metric-return)::before {
  background: #9aa9a2;
}

.portfolio-page .snapshot-metrics-grid .metric-risk .metric-label,
.portfolio-page .snapshot-metrics-grid .metric-risk .metric-value,
.portfolio-page .snapshot-metrics-grid .metric-quality .metric-label,
.portfolio-page .snapshot-metrics-grid .metric-quality .metric-value,
.portfolio-page .snapshot-metrics-grid .metric-neutral .metric-label,
.portfolio-page .snapshot-metrics-grid .metric-neutral .metric-value {
  color: var(--text-soft);
}

.portfolio-page .snapshot-metrics-grid .metric-label {
  min-height: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.portfolio-page .snapshot-metrics-grid .metric-value {
  max-width: 100%;
  margin-top: 8px;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.portfolio-page .snapshot-metrics-grid .metric-inline {
  flex-wrap: wrap;
  gap: 4px 10px;
}

.portfolio-page .snapshot-metrics-grid .metric-inline > span {
  font-size: 14px;
}

.portfolio-page .snapshot-metrics-grid .metric-foot {
  display: block;
  margin-top: 8px;
  color: #596b62;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.portfolio-page .snapshot-current-drawdown {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 12px 14px;
  border: 1px solid rgba(55, 86, 72, 0.14);
  border-radius: 12px;
  background: #f7faf8;
}

.portfolio-page .snapshot-current-drawdown > div {
  display: grid;
  gap: 4px;
}

.portfolio-page .snapshot-current-drawdown .metric-label {
  color: #596b62;
  font-size: 14px;
}

.portfolio-page .snapshot-current-drawdown strong {
  color: #18382d;
  font-size: 16px;
}

.portfolio-page .snapshot-current-drawdown p {
  margin: 0;
  color: #596b62;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.portfolio-page .snapshot-more-metrics > summary {
  font-size: 14px;
}

.portfolio-page .snapshot-more-metrics[open] > summary {
  margin-bottom: 12px;
}

.portfolio-page .snapshot-calculation-notes {
  margin-top: 12px;
  color: #596b62;
  font-size: 12px;
  line-height: 1.6;
}

.portfolio-page .snapshot-calculation-notes p {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.portfolio-page .snapshot-calculation-notes p:last-child {
  margin-bottom: 0;
}

@media (min-width: 761px) {
  /* Keep desktop home content in the normal scroll flow. Other routes and
     the mobile navigation retain their existing sticky behavior. */
  .site-header.is-home-route {
    position: relative;
    top: auto;
  }

  .home-page {
    padding-top: 18px;
  }

  .home-page .hero-report-meta {
    min-height: 44px;
    padding-block: 9px;
  }

  .home-page .hero-home .hero-copy {
    padding: 16px clamp(28px, 4vw, 48px);
  }

  .home-page .hero-home h1 {
    max-width: 760px;
    margin: 8px 0 12px;
    font-size: clamp(40px, 3.2vw, 46px);
    line-height: 1.1;
  }

  .home-page .hero-home h1 span {
    display: inline;
    margin-top: 0;
  }

  .home-page .hero-home .lead {
    max-width: 760px;
    margin: 0;
    font-size: 17px;
    line-height: 1.55;
  }

  .home-page .hero-home .hero-actions {
    margin-top: 18px;
    gap: 10px;
  }

  .home-page .hero-home .hero-actions .button {
    min-height: 44px;
  }

  .home-page .hero-home .hero-fine-print {
    margin: 10px 0 0;
    font-size: 12px;
  }

  .home-page .hero-report-footer {
    min-height: 48px;
    padding-block: 6px;
  }

  .home-page > .section {
    padding-top: 18px;
  }

  .home-page .section-heading {
    align-items: center;
    margin-bottom: 12px;
  }

  .home-page .section-heading h2 {
    margin: 0;
    font-size: 24px;
  }

  .home-page .section-heading .section-copy {
    max-width: 680px;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
  }

  .home-page .home-summary-grid {
    gap: 14px;
  }

  .home-page .home-performance-card,
  .home-page .home-signal-card {
    padding: 16px;
  }

  .home-page .home-return-grid {
    margin-top: 12px;
    gap: 8px;
  }

  .home-page .home-return-tile {
    min-height: 66px;
    padding: 10px;
  }

  .home-page .home-return-tile strong {
    font-size: clamp(18px, 1.65vw, 23px);
  }

  .home-page .mini-chart-title {
    margin-top: 12px;
  }

  .home-page .home-performance-card > .fine-print {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.45;
  }

  .home-page .mini-performance-chart {
    margin-top: 8px;
    padding: 10px;
  }

  .home-page .mini-performance-chart svg {
    /* The 132px four-row hover card also needs 12px clearance on both sides. */
    height: 160px;
  }

  .home-page .mini-chart-tooltip {
    min-height: 28px;
    margin-top: 4px;
    font-size: 12px;
  }

  .home-page .home-detail-links {
    margin-top: 14px;
    padding-top: 12px;
  }

  .home-page .home-detail-links a {
    padding: 8px 10px;
  }
}

@media (max-width: 760px) {
  .home-page {
    padding-top: 12px;
  }

  .home-page .hero-home .hero-copy {
    padding: 24px 18px;
  }

  .home-page .hero-home h1 {
    margin: 10px 0 14px;
    font-size: clamp(32px, 8.8vw, 40px);
    line-height: 1.14;
  }

  .home-page .hero-home .lead {
    font-size: 16px;
    line-height: 1.6;
  }

  .home-page .hero-home .hero-actions {
    margin-top: 18px;
  }

  .home-page .hero-home .hero-fine-print {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
  }

  .home-page .hero-report-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 10px;
  }

  .home-page .hero-report-footer span,
  .home-page .hero-report-footer span:first-child {
    min-width: 0;
    min-height: 38px;
    padding: 7px 0;
    border-top: 1px solid rgba(55, 86, 72, 0.1);
    border-left: 0;
    font-size: 12px;
    line-height: 1.4;
  }

  .home-page .hero-report-footer span:first-child {
    border-top: 0;
  }

  .home-page .hero-report-footer span:nth-child(2) {
    border-top: 0;
  }

  .home-page .hero-report-footer span:nth-child(3) {
    grid-column: 1 / -1;
  }

  .home-page > .section {
    padding-top: 28px;
  }

  .home-page .section-heading {
    display: block;
    margin-bottom: 14px;
  }

  .home-page .section-heading h2 {
    margin-bottom: 8px;
    font-size: 23px;
    line-height: 1.3;
  }

  .home-page .section-heading .section-copy {
    font-size: 16px;
    line-height: 1.55;
  }

  .home-page .home-performance-card,
  .home-page .home-signal-card {
    padding: 16px;
  }

  .home-page .home-return-tile {
    min-height: 72px;
    padding: 11px;
  }

  .home-page .mini-performance-chart svg {
    height: 170px;
  }

  .portfolio-page {
    padding-top: 22px;
  }

  .portfolio-page .page-hero {
    padding-top: 10px;
    padding-bottom: 22px;
  }

  .portfolio-page .page-hero .lead {
    font-size: 16px;
    line-height: 1.6;
  }

  .portfolio-page .portfolio-section-nav {
    margin-bottom: 4px;
  }

  .portfolio-page .section {
    padding-top: 28px;
  }

  .portfolio-page .snapshot-section {
    padding-top: 18px;
  }

  .portfolio-page .snapshot-heading {
    display: flex;
    align-items: baseline;
    gap: 8px 14px;
    margin-bottom: 14px;
  }

  .portfolio-page .snapshot-heading h2 {
    margin: 0;
    font-size: 22px;
  }

  .portfolio-page .snapshot-heading .section-copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
  }

  .portfolio-page .snapshot-metric-groups {
    gap: 10px;
  }

  .portfolio-page .snapshot-primary-metrics,
  .portfolio-page .snapshot-secondary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .portfolio-page .snapshot-metrics-grid .metric-card {
    padding: 12px 11px;
  }

  .portfolio-page .snapshot-metrics-grid .metric-label {
    font-size: 14px;
  }

  .portfolio-page .snapshot-metrics-grid .metric-value {
    margin-top: 7px;
    font-size: clamp(19px, 5.8vw, 24px);
  }

  .portfolio-page .snapshot-metrics-grid .metric-foot {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
  }

  .portfolio-page .snapshot-current-drawdown {
    padding: 10px 12px;
  }

  .portfolio-page .snapshot-more-metrics > summary {
    min-height: 44px;
    padding: 9px 11px;
    font-size: 14px;
  }

  .portfolio-page .snapshot-more-metrics[open] > summary {
    margin-bottom: 8px;
  }

  .portfolio-page .snapshot-calculation-notes {
    margin-top: 8px;
  }
}

@media (max-width: 359px) {
  .home-page .hero-report-footer {
    grid-template-columns: 1fr;
  }

  .home-page .hero-report-footer span:nth-child(2) {
    border-top: 1px solid rgba(55, 86, 72, 0.1);
  }

  .portfolio-page .snapshot-primary-metrics,
  .portfolio-page .snapshot-secondary-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .portfolio-page .snapshot-heading {
    display: block;
  }

  .portfolio-page .snapshot-heading .section-copy {
    margin-top: 6px;
  }
}
