:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #eef3f8;
  --ink: #122033;
  --muted: #66758a;
  --line: #dbe3ee;
  --brand: #07376c;
  --brand-2: #0b5f8f;
  --accent: #c98421;
  --good: #16835d;
  --attention: #b7791f;
  --risk: #b42318;
  --shadow: 0 16px 38px rgba(17, 32, 51, .08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.topnav,
.locale-switch,
.segmented,
.toggle-row {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.nav-tab,
.locale-switch button,
.segmented button,
.toggle-row button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-tab.is-active,
.locale-switch button.is-active,
.segmented button.is-selected,
.toggle-row button.is-selected {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(18, 32, 51, .12);
}

.app-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.intro-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.intro-band h1 {
  max-width: 780px;
  margin: 0;
  color: var(--brand);
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.intro-band p {
  max-width: 740px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.status-strip {
  min-width: 210px;
  padding: 14px 16px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  background: #f8fbff;
}

.status-strip span,
.metric span,
.score-card span,
.panel-note,
.field-help,
.confidence span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.status-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-size: 15px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2,
.panel-title h3,
.summary-panel h3,
.share-panel h3,
.mmat-panel h3,
.success-panel h3 {
  margin: 0;
  color: var(--brand);
  font-size: 24px;
  line-height: 1.2;
}

.section-head p,
.summary-panel p,
.share-panel p,
.mmat-panel p,
.success-panel p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.connect-layout,
.simulation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 20px;
}

.panel,
.summary-panel,
.share-panel,
.mmat-panel,
.success-panel,
.request-panel,
.profile-header,
.skeleton-panel,
.timeline-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel,
.summary-panel,
.share-panel,
.mmat-panel,
.success-panel,
.request-panel,
.timeline-panel {
  padding: 22px;
}

.connect-panel {
  display: grid;
  gap: 12px;
}

.field-label,
.request-panel label,
.simulation-layout label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.text-input,
.number-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

.text-input:focus,
.number-input:focus,
.range-input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(11, 95, 143, .16);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  border: 1px solid transparent;
}

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

.primary-button:hover {
  background: #0a477d;
}

.secondary-button {
  background: #fff;
  color: var(--brand);
  border-color: #cbd8e6;
}

.secondary-button:hover {
  border-color: var(--brand-2);
}

.demo-callout h3 {
  margin: 0;
  color: var(--brand);
}

.demo-callout p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.mini-steps {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.mini-steps span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #eef5fb;
  color: var(--brand);
  font-weight: 900;
}

.skeleton-panel {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.shimmer {
  height: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef3f8 0%, #f9fbfd 45%, #eef3f8 100%);
  background-size: 180% 100%;
  animation: shimmer 1s infinite linear;
}

.shimmer.short {
  width: 48%;
}

.shimmer.grid {
  height: 126px;
}

@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -180% 0; }
}

.category-grid,
.schemes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.category-card,
.scheme-card {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 26px rgba(17, 32, 51, .05);
}

.category-card.is-selected,
.scheme-card.is-selected {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(11, 95, 143, .14);
}

.category-card h3,
.scheme-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.category-card dl,
.scheme-card p {
  margin: 14px 0 0;
}

.category-card dl {
  display: grid;
  gap: 9px;
}

.category-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.category-card dd,
.category-card dt {
  margin: 0;
}

.category-card dd {
  color: var(--ink);
  font-weight: 800;
}

.request-panel {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 18px;
  align-items: end;
  margin-top: 18px;
}

.range-input {
  width: 100%;
  accent-color: var(--brand);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.profile-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
  padding: 24px;
}

.profile-header h2 {
  margin: 0;
  color: var(--brand);
  font-size: 30px;
  line-height: 1.1;
}

.profile-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  color: var(--brand);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.score-card {
  display: grid;
  min-width: 150px;
  gap: 2px;
  justify-items: center;
  padding: 16px;
  border-radius: 8px;
  background: #eef8f4;
  color: var(--good);
}

.score-card strong {
  font-size: 48px;
  line-height: 1;
}

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

.metric {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

.panel-title {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  min-height: 240px;
  align-items: end;
  padding-top: 12px;
}

.bar {
  display: grid;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.bar span {
  display: block;
  min-height: 26px;
  border-radius: 5px 5px 2px 2px;
  background: var(--brand-2);
}

.bar strong,
.bar small {
  display: block;
  text-align: center;
  white-space: nowrap;
  font-size: 11px;
}

.bar small {
  color: var(--muted);
}

.portfolio-table,
.turnover-grid,
.status-list,
.sim-metrics,
.comparison-table {
  display: grid;
  gap: 10px;
}

.portfolio-row,
.turnover-row,
.status-row,
.comparison-row {
  display: grid;
  grid-template-columns: 1.4fr .6fr .6fr .7fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
}

.portfolio-row.is-selected,
.turnover-row.is-selected {
  background: #eef8f4;
  color: var(--ink);
}

.portfolio-row strong,
.turnover-row strong,
.comparison-row strong {
  color: var(--ink);
}

.turnover-row {
  grid-template-columns: 1fr .7fr .7fr .7fr;
}

.status-row {
  grid-template-columns: 18px 1fr;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot.good { background: var(--good); }
.status-dot.attention { background: var(--attention); }
.status-dot.risk { background: var(--risk); }

.summary-panel,
.share-panel,
.mmat-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.share-panel {
  grid-template-columns: 1fr 116px;
  align-items: center;
}

.qr-demo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 112px;
  height: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-demo span {
  border-radius: 2px;
  background: var(--brand);
}

.qr-demo span:nth-child(3n) {
  background: transparent;
}

.mmat-panel {
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #f8fbff;
}

.mmat-result {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.timeline-step {
  position: relative;
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-step strong {
  display: block;
  color: var(--brand);
}

.timeline-step span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.confidence {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #eef8f4;
}

.confidence strong {
  display: block;
  margin-top: 4px;
  color: var(--good);
  font-size: 20px;
}

.scheme-card {
  min-height: 230px;
}

.scheme-card p {
  color: var(--muted);
  line-height: 1.55;
}

.scheme-card .fee {
  display: inline-flex;
  margin-top: 16px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.scheme-card.good { border-top: 4px solid var(--good); }
.scheme-card.attention { border-top: 4px solid var(--attention); }
.scheme-card.risk { border-top: 4px solid var(--risk); }

.comparison-table {
  margin-top: 14px;
}

.comparison-row {
  grid-template-columns: .8fr 1.1fr 1.1fr 1.1fr;
  background: #fff;
  border: 1px solid var(--line);
}

.success-panel {
  margin-top: 16px;
  background: #eef8f4;
}

@media (max-width: 1080px) {
  .topbar,
  .intro-band,
  .connect-layout,
  .simulation-layout,
  .profile-header,
  .mmat-panel,
  .share-panel {
    grid-template-columns: 1fr;
  }

  .topnav,
  .locale-switch {
    overflow-x: auto;
  }

  .category-grid,
  .schemes-grid,
  .metric-row,
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px;
  }

  .app-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 16px;
  }

  .intro-band {
    padding: 20px;
  }

  .intro-band h1 {
    font-size: 31px;
  }

  .category-grid,
  .schemes-grid,
  .metric-row,
  .dashboard-grid,
  .bar-chart,
  .timeline {
    grid-template-columns: 1fr;
  }

  .bar {
    grid-template-columns: 54px 1fr 78px;
    align-items: center;
  }

  .bar span {
    height: 16px !important;
    min-height: 16px;
    border-radius: 999px;
  }

  .bar strong {
    text-align: right;
  }

  .portfolio-row,
  .turnover-row,
  .comparison-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media print {
  .topbar,
  .dashboard-actions,
  .mmat-panel,
  .share-panel,
  .topnav,
  .locale-switch,
  .screen:not([data-step="dashboard"]) {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .intro-band,
  .panel,
  .summary-panel,
  .profile-header,
  .metric {
    box-shadow: none;
  }
}

/* ONEDD-approved staging style, ported to the live interactive demo shell. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f172a;
  --brand-2: #2563eb;
  --accent: #2563eb;
  --good: #059669;
  --attention: #d97706;
  --risk: #dc2626;
  --shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a,
button,
input,
small,
span,
strong,
p,
h1,
h2,
h3 {
  letter-spacing: 0;
}

.topbar {
  min-height: 64px;
  padding: 0 24px;
  grid-template-columns: minmax(220px, 1fr) minmax(0, auto) auto;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.brand {
  min-width: 0;
  gap: 9px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.brand strong {
  display: inline;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.brand small {
  display: inline-flex;
  margin: 0 0 0 8px;
  max-width: 180px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}

.topnav {
  height: 64px;
  padding: 0;
  gap: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar,
.locale-switch::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  position: relative;
  height: 64px;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav-tab:hover,
.nav-tab.is-active {
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.nav-tab.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--brand-2);
}

.locale-switch,
.segmented,
.toggle-row {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.locale-switch button,
.segmented button,
.toggle-row button {
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.locale-switch button.is-active,
.segmented button.is-selected,
.toggle-row button.is-selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.app-shell {
  width: min(1440px, calc(100% - 48px));
  padding: 24px 0 48px;
}

.intro-band {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intro-band h1 {
  max-width: 920px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.18;
}

.intro-band p {
  max-width: 920px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.status-strip {
  min-width: 230px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.status-strip strong {
  color: var(--brand-2);
}

.screen {
  min-width: 0;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2,
.panel-title h3,
.summary-panel h3,
.share-panel h3,
.mmat-panel h3,
.success-panel h3,
.demo-callout h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.section-head p,
.summary-panel p,
.share-panel p,
.mmat-panel p,
.success-panel p,
.demo-callout p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.panel,
.summary-panel,
.share-panel,
.mmat-panel,
.success-panel,
.request-panel,
.profile-header,
.skeleton-panel,
.timeline-panel,
.metric,
.category-card,
.scheme-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel,
.summary-panel,
.share-panel,
.mmat-panel,
.success-panel,
.request-panel,
.timeline-panel {
  padding: 20px;
}

.connect-layout,
.simulation-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.connect-panel {
  gap: 14px;
}

.field-label,
.request-panel label,
.simulation-layout label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.field-help,
.panel-note {
  color: var(--muted);
  font-size: 12px;
}

.text-input,
.number-input {
  min-height: 40px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
}

.text-input:focus,
.number-input:focus,
.range-input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

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

.primary-button:hover {
  background: #1e293b;
}

.secondary-button {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.secondary-button:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
}

.demo-callout {
  min-height: 100%;
  background: var(--surface-muted);
}

.mini-steps span {
  width: 38px;
  height: 38px;
  background: var(--surface);
  color: var(--brand-2);
  border: 1px solid var(--line);
  font-weight: 900;
}

.skeleton-panel {
  margin-top: 16px;
  background: var(--surface);
}

.shimmer {
  background: linear-gradient(90deg, #f1f5f9 0%, #ffffff 45%, #f1f5f9 100%);
}

.category-grid,
.schemes-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-card,
.scheme-card {
  min-height: 0;
  padding: 18px;
  box-shadow: var(--shadow);
}

.category-card:hover,
.scheme-card:hover {
  border-color: #bfdbfe;
}

.category-card.is-selected,
.scheme-card.is-selected {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 1px var(--brand-2);
}

.category-card h3,
.scheme-card h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.category-card div,
.scheme-card p {
  color: var(--muted);
}

.category-card dd {
  color: var(--ink);
}

.request-panel {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 180px;
  gap: 16px;
}

.range-input {
  accent-color: var(--brand-2);
}

.dashboard-actions {
  margin-bottom: 16px;
}

.profile-header {
  grid-template-columns: minmax(0, 1fr) 340px;
  margin-bottom: 16px;
  padding: 24px;
}

.profile-header h2 {
  color: var(--ink);
  font-size: 28px;
}

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

.profile-tags span {
  border-color: var(--line);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.profile-tags span:nth-child(2),
.profile-tags span:nth-child(3) {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: var(--good);
}

.score-card {
  min-width: 0;
  justify-items: start;
  padding: 18px;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--good);
}

.score-card span,
.score-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-card strong {
  font-size: 42px;
}

.metric-row {
  gap: 12px;
}

.metric {
  min-height: 96px;
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  color: var(--ink);
  font-size: 20px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr);
  gap: 16px;
}

.panel-title {
  margin-bottom: 14px;
}

.revenue-panel {
  min-width: 0;
}

.bar-chart {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  min-height: 268px;
  padding: 26px 8px 0;
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  min-width: 0;
  height: 242px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.bar span {
  width: 100%;
  height: var(--bar-h, 80px) !important;
  min-height: 30px;
  border-radius: 4px 4px 1px 1px;
  background: var(--brand);
}

.bar strong {
  display: none;
}

.bar small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.portfolio-row,
.turnover-row,
.status-row,
.comparison-row {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
}

.portfolio-row.is-selected,
.turnover-row.is-selected {
  background: #eff6ff;
  color: var(--ink);
}

.status-dot.good {
  background: var(--good);
}

.status-dot.attention {
  background: var(--attention);
}

.summary-panel,
.share-panel {
  background: var(--surface);
}

.mmat-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--surface);
}

.mmat-result {
  border-color: var(--line);
  border-radius: 6px;
  background: var(--brand);
  color: #67e8f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.qr-demo {
  border-color: var(--line);
  border-radius: 6px;
}

.qr-demo span {
  background: var(--brand);
}

.timeline-panel {
  min-width: 0;
}

.timeline {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 0 2px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 42px;
  right: 8%;
  left: 8%;
  height: 2px;
  background: var(--line);
}

.timeline-step {
  position: relative;
  min-height: 86px;
  padding: 44px 10px 8px;
  border: 0;
  background: transparent;
  text-align: center;
}

.timeline-step::before {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% - 10px);
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-2);
  border-radius: 50%;
  background: var(--surface);
}

.timeline-step strong {
  color: var(--ink);
  font-size: 13px;
}

.timeline-step span {
  color: var(--muted);
  font-size: 12px;
}

.confidence {
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #ecfdf5;
}

.confidence strong {
  color: var(--good);
}

.scheme-card {
  display: grid;
  gap: 12px;
  min-height: 250px;
  align-content: start;
  border-top: 1px solid var(--line);
}

.scheme-card.good,
.scheme-card.attention,
.scheme-card.risk {
  border-top: 1px solid var(--line);
}

.scheme-card.good .fee {
  color: var(--good);
}

.scheme-card.attention .fee {
  color: var(--attention);
}

.scheme-card.risk .fee {
  color: var(--risk);
}

.scheme-card .fee {
  margin-top: 2px;
  border-radius: 4px;
  background: var(--surface-muted);
}

.scheme-card .primary-button {
  align-self: end;
  margin-top: auto;
  width: 100%;
}

.comparison-row {
  background: var(--surface);
}

.success-panel {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px 20px;
  }

  .topnav {
    width: 100%;
    height: 44px;
    gap: 18px;
  }

  .nav-tab {
    height: 44px;
  }

  .locale-switch {
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
  }

  .connect-layout,
  .simulation-layout,
  .profile-header,
  .mmat-panel,
  .share-panel,
  .intro-band {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 28px, 1440px);
    padding-top: 16px;
  }

  .category-grid,
  .schemes-grid,
  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 8px 12px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand small {
    display: block;
    width: fit-content;
    margin: 4px 0 0;
    white-space: normal;
  }

  .app-shell {
    width: min(100% - 16px, 1440px);
  }

  .intro-band,
  .panel,
  .summary-panel,
  .share-panel,
  .mmat-panel,
  .success-panel,
  .request-panel,
  .profile-header,
  .skeleton-panel,
  .timeline-panel,
  .metric,
  .category-card,
  .scheme-card {
    padding: 16px;
  }

  .intro-band h1 {
    font-size: 21px;
  }

  .category-grid,
  .schemes-grid,
  .metric-row,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .toggle-row {
    max-width: 100%;
    overflow-x: auto;
  }

  .bar-chart {
    grid-template-columns: repeat(12, minmax(7px, 1fr));
    gap: 4px;
    min-height: 154px;
    padding: 12px 0 0;
  }

  .bar {
    height: 142px;
    gap: 5px;
  }

  .bar span {
    height: clamp(28px, calc(var(--bar-h, 80px) * .52), 118px) !important;
    min-height: 18px;
    border-radius: 3px 3px 1px 1px;
  }

  .bar small {
    font-size: 7px;
  }

  .portfolio-row,
  .turnover-row,
  .comparison-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .timeline::before {
    right: 10%;
    left: 10%;
  }

  .timeline-step {
    min-height: 98px;
    padding: 42px 2px 0;
  }

  .timeline-step strong,
  .timeline-step span {
    font-size: 10px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .dashboard-actions {
    justify-content: stretch;
  }

  .dashboard-actions .secondary-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media print {
  .topbar,
  .dashboard-actions,
  .mmat-panel,
  .share-panel,
  .topnav,
  .locale-switch,
  .screen:not([data-step="dashboard"]) {
    display: none !important;
  }
}
