/* One clear content plane and a lighter navigation plane, adapted for the web. */
html[data-page-role="customer"] {
  --md-sys-color-primary: #007aff;
  --md-sys-color-primary-container: #eaf3ff;
  --md-sys-color-on-primary-container: #14487c;
  --md-sys-color-secondary-container: #f0f0f3;
  --md-sys-color-on-secondary-container: #3a3a3c;
  --md-sys-color-surface: #f5f5f7;
  --md-sys-color-surface-container-low: #fff;
  --md-sys-color-surface-container: #f8f8fa;
  --md-sys-color-surface-container-high: #f0f0f3;
  --md-sys-color-on-surface: #1d1d1f;
  --md-sys-color-on-surface-variant: #6e6e73;
  --md-sys-color-outline: #a1a1a6;
  --md-sys-color-outline-variant: #e5e5e9;
  --role-accent: #007aff;
  --role-soft: #eaf3ff;
  --role-dark: #14487c;
  --primary: #007aff !important;
  --primary-dark: #0066d6 !important;
  --primary-soft: #eaf3ff !important;
  --canvas: #f5f5f7;
  --surface: #fff;
  --surface-soft: #f8f8fa;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5e9;
  --line-strong: #d2d2d7;
  --shadow-small: 0 2px 12px #1d1d1f08;
}
body[data-portal="customer"] {
  color: #1d1d1f;
  background: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body[data-portal="customer"] > .app-shell { grid-template-columns: 220px minmax(0, 1fr); background: #f5f5f7; }
body[data-portal="customer"] .sidebar {
  padding: 20px 12px 16px;
  border-right: 1px solid #e5e5e9;
  background: rgb(255 255 255 / 88%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.sidebar > .brand { padding: 6px 12px 17px; margin-bottom: 8px; }
.sidebar > .brand .page-wordmark { --page-wordmark-width: 96px; }
.sidebar .page-brand-role { color: #6e6e73 !important; font-size: 13px; }
.sidebar-label { margin: 14px 13px 8px; color: #86868b; font-size: 11px; letter-spacing: .06em; }
body[data-portal="customer"] .sidebar nav { gap: 3px; }
body[data-portal="customer"] .sidebar nav .nav-item { min-height: 44px; padding: 8px 12px; gap: 11px; border-radius: 10px; color: #515154; font-size: 14px; font-weight: 600; }
body[data-portal="customer"] .sidebar nav .nav-item:hover { color: #007aff; background: #f1f6fc; }
html[data-page-role="customer"] body[data-portal="customer"] .sidebar nav .nav-item.active { color: #0066d6; background: #eaf3ff; }
.sidebar .nav-item.active::before { display: none; }
body[data-portal="customer"] .sidebar .workspace-search-launch { min-height: 38px; margin-bottom: 14px; padding: 7px 9px; gap: 6px; border: 1px solid #e5e5e9; border-radius: 9px; background: #f8f8fa; color: #6e6e73; font-size: 12px; white-space: nowrap; }
.sidebar .workspace-search-launch kbd { padding: 1px 3px; font-size: 11px; }
body[data-portal="customer"] .sidebar .account-summary { border: 1px solid #e5e5e9; border-radius: 11px; background: #fff; }
.sidebar .avatar { color: #0066d6; background: #eaf3ff; }
body[data-portal="customer"] .main-content { max-width: 1420px; padding: 30px clamp(22px, 3.5vw, 48px) 64px; }
body[data-portal="customer"] .welcome-row { margin-bottom: 22px; }
.welcome-row .eyebrow { margin-bottom: 5px; color: #86868b !important; font-size: 12px; letter-spacing: .02em; }
.welcome-row h1 { color: #1d1d1f; font-size: clamp(27px, 2.5vw, 34px); font-weight: 700; line-height: 1.25; letter-spacing: -.04em; }
.welcome-row .page-subtitle { color: #6e6e73; font-size: 14px; line-height: 1.55; }
body[data-portal="customer"] :is(.panel, .task-workspace, .work-card, .metric-grid article, .error-panel) { border: 1px solid #e5e5e9; border-radius: 16px; background: #fff; box-shadow: 0 2px 12px #1d1d1f08; }
body[data-portal="customer"] .wizard-panel { max-width: 1040px; }
body[data-portal="customer"] .wizard-panel .panel-heading { padding: 20px 28px 16px; }
.panel-heading h2, .section-heading h2 { color: #1d1d1f; font-size: 20px; }
.save-state { border-radius: 7px; background: #f5f5f7; color: #6e6e73; font-size: 12px; }
.stepper { gap: 12px; padding: 0 28px 18px; }
.stepper li:not(:last-child)::after { background: #e5e5e9; }
.stepper li > span { color: #86868b; background: #f5f5f7; border-color: #d2d2d7; }
.stepper li > div { background: #fff; }
.stepper li strong { color: #6e6e73; }
html[data-page-role="customer"] .stepper li.active > span { background: #007aff; border-color: #007aff; box-shadow: 0 0 0 4px #eaf3ff; }
.stepper li.active strong, .stepper li.complete strong { color: #1d1d1f; }
.form-step { padding: 24px 28px; border-top: 1px solid #e5e5e9; }
body[data-portal="customer"] .field > span { color: #3a3a3c; font-size: 14px; font-weight: 600; }
body[data-portal="customer"] .field small { color: #86868b; font-size: 12px; }
body[data-portal="customer"] :is(.field input, .field select, .field textarea, .ui-search-field input) { min-height: 44px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: #1d1d1f; font-size: 15px; font-weight: 450; }
body[data-portal="customer"] :is(.field input, .field select, .field textarea, .ui-search-field input):focus-visible { border-color: #007aff; outline: 3px solid #007aff22; outline-offset: 1px; }
body[data-portal="customer"] :is(.primary-button, .button.primary) { min-height: 42px; padding: 9px 17px; border: 1px solid #007aff; border-radius: 10px; background: #007aff; color: #fff; box-shadow: none; font-size: 14px; }
body[data-portal="customer"] :is(.primary-button, .button.primary):hover:not(:disabled) { border-color: #0066d6; background: #0066d6; }
body[data-portal="customer"] :is(.secondary-button, .button:not(.primary):not(.danger)) { min-height: 42px; padding: 9px 17px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; color: #007aff; box-shadow: none; font-size: 14px; }
body[data-portal="customer"] :is(.secondary-button, .button:not(.primary):not(.danger)):hover:not(:disabled) { border-color: #b9b9bf; background: #f5f5f7; }
.explain-box { border-color: #e5e5e9; border-radius: 12px; background: #f8f8fa; color: #6e6e73; }
.explain-box > span[aria-hidden] { color: #007aff; }
.explain-box p { color: #6e6e73; }
.wizard-actions { border-top-color: #e5e5e9; border-radius: 0 0 16px 16px; background: rgb(255 255 255 / 90%); box-shadow: none; }
body[data-portal="customer"] :is(.tabs, .market-views) { gap: 3px; padding: 3px; border: 1px solid #e5e5e9; border-radius: 10px; background: #f0f0f3; }
body[data-portal="customer"] :is(.tabs button, .market-view) { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: #515154; }
body[data-portal="customer"] :is(.tabs button.active, .market-view[aria-pressed=true]) { border: 0; border-radius: 8px; background: #fff; color: #1d1d1f; box-shadow: 0 1px 4px #1d1d1f1a; }
body[data-portal="customer"] .metric-grid strong { color: #1d1d1f; }
body[data-portal="customer"] .metric-grid .metric-icon { color: #007aff !important; background: #eaf3ff !important; }
html[data-page-role="customer"] body[data-portal="customer"] .model-market { border: 1px solid #e5e5e9; border-radius: 16px; background: #fff; box-shadow: 0 2px 12px #1d1d1f08; }
body[data-portal="customer"] .model-market-intro { margin: 0; padding: 20px 24px; border-bottom: 1px solid #e5e5e9; border-radius: 0; background: #fff; }
.model-market-eyebrow { color: #86868b; font-size: 11px; }
.model-market-intro h2 { color: #1d1d1f; font-size: 20px; }
.model-market-intro p:last-child, .model-market-status { color: #6e6e73; font-size: 13px; }
.model-market-disclosure { margin: 16px 22px 0; border: 1px solid #e5e5e9; border-radius: 10px; background: #f8f8fa; color: #6e6e73; }
.model-market-disclosure-mark { color: #007aff; background: #eaf3ff; }
.model-market-controls { margin: 16px 22px 0; border-bottom: 0; }
.model-market-tabs { gap: 3px; padding: 3px; border: 1px solid #e5e5e9; border-radius: 10px; background: #f0f0f3; }
.model-market-tabs button { min-height: 36px; border: 0; border-radius: 8px; color: #515154; }
.model-market-tabs button[aria-selected="true"] { border: 0; border-radius: 8px; background: #fff; color: #1d1d1f; box-shadow: 0 1px 4px #1d1d1f1a; }
.model-market-filter select { min-height: 40px; border: 1px solid #d2d2d7; border-radius: 10px; background: #fff; }
body[data-portal="customer"] .model-market-card, body[data-portal="customer"] .model-market-collection { border: 1px solid #e5e5e9; border-radius: 12px; background: #fff; }
body[data-portal="customer"] .model-market-card.featured { border-color: #badbff; background: #f2f8ff; }
.model-market-card .model-price { color: #1d1d1f; }
.model-market-card .model-market-buy, .model-market-card.featured .model-market-link { border-radius: 10px; background: #007aff; border-color: #007aff; color: #fff; }
.model-market-link { border-radius: 10px; color: #007aff; background: #eaf3ff; }
body[data-portal="customer"] :is(.modal, .task-session-dialog, .task-auth-dialog, .drawer, .account-dialog, .workspace-command) { border: 1px solid #e5e5e9; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px #1d1d1f24; }
body[data-portal="customer"] :is(button, a, summary):focus-visible { outline-color: #007aff; outline-offset: 3px; }
@media (max-width: 820px) {
  body[data-portal="customer"] > .app-shell { display: block; }
  body[data-portal="customer"] .main-content { padding: 22px 16px 112px; }
  body[data-portal="customer"] .sidebar { border: 1px solid #e5e5e9; border-radius: 18px; background: rgb(255 255 255 / 90%); box-shadow: 0 5px 22px #1d1d1f16; }
  html[data-page-role="customer"] body[data-portal="customer"] .sidebar nav .nav-item.active { background: transparent; color: #007aff; }
  html[data-page-embedded] .mobile-brand { display: none; }
}
@media (max-width: 600px) {
  body[data-portal="customer"] .wizard-panel .panel-heading { padding: 18px; }
  .stepper { padding: 0 18px 16px; }
  .form-step { padding: 20px 18px; }
  .wizard-actions { border-radius: 14px; }
  .model-market-disclosure, .model-market-controls, .model-market-grid, .model-market-mine { margin-inline: 16px; }
}
@media (prefers-reduced-transparency: reduce) {
  body[data-portal="customer"] .sidebar, .wizard-actions { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Zero-data views should explain the next step without occupying a full card. */
body[data-portal="customer"] .primary-button:disabled {
  opacity: 1;
  border-color: #e5e5e9;
  background: #e5e5e9;
  color: #6e6e73;
  box-shadow: none;
  cursor: not-allowed;
}
body[data-portal="customer"] .workspace-state {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 3px 14px;
  min-height: 0;
  padding: 20px;
  border: 1px solid #e5e5e9;
  border-radius: 12px;
  background: #f8f8fa;
  text-align: left;
}
body[data-portal="customer"] .workspace-state .state-symbol {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 10px;
  color: #007aff;
  background: #eaf3ff;
  font-size: 20px;
}
body[data-portal="customer"] .workspace-state h3 { grid-column: 2; color: #1d1d1f; font-size: 16px; line-height: 1.4; }
body[data-portal="customer"] .workspace-state p { grid-column: 2; max-width: none; margin: 0; color: #6e6e73; font-size: 14px; line-height: 1.5; }
body[data-portal="customer"] .workspace-state :is(a, button) { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
body[data-portal="customer"] .task-workspace.is-empty { min-height: 0; }
body[data-portal="customer"] .task-workspace.is-empty .task-list { padding: 16px; }
body[data-portal="customer"] .workspace-empty {
  min-height: 0;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid #ededf0;
  border-radius: 10px;
  background: #f8f8fa;
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
body[data-portal="customer"] .finance-list:has(> .workspace-empty) { padding: 16px 22px 20px; }
body[data-portal="customer"] .finance-list:has(> .workspace-empty) > .workspace-empty { padding: 18px 20px; }
body[data-portal="customer"] #funds .workspace-note { margin: 0 22px 16px; color: #6e6e73; font-size: 14px; }
body[data-portal="customer"] #funds .workspace-feedback { margin: 0 22px 14px; color: #6e6e73; font-size: 13px; }
body[data-portal="customer"] #funds .workspace-actions:has(> [hidden]:only-child) { display: none; }
body[data-portal="customer"] .finance-entry h3 { color: #1d1d1f; }
body[data-portal="customer"] .finance-entry .finance-amount { color: #1d1d1f; }
body[data-portal="customer"] .model-market-grid > .workspace-empty { padding: 18px 20px; text-align: left; color: #6e6e73; }

@media (max-width: 650px) {
  body[data-portal="customer"] .workspace-state { grid-template-columns: 34px minmax(0, 1fr); padding: 16px; }
  body[data-portal="customer"] .workspace-state .state-symbol { width: 34px; height: 34px; }
  body[data-portal="customer"] .workspace-state :is(a, button) { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 8px; }
  body[data-portal="customer"] .task-workspace.is-empty .task-list { padding: 12px; }
  body[data-portal="customer"] .finance-list:has(> .workspace-empty) { padding: 12px 16px 16px; }
  body[data-portal="customer"] #funds .workspace-note,
  body[data-portal="customer"] #funds .workspace-feedback { margin-inline: 16px; }
}

/* Shared workspace rhythm: one title, one action location, one control language. */
html[data-page-role="customer"] {
  --canvas: #f6f8fb;
  --surface-soft: #f8fafc;
  --ink: #17212f;
  --muted: #66758a;
  --line: #e3e9f0;
  --line-strong: #cbd5e1;
  --primary: #1769d2 !important;
  --primary-dark: #1058b6 !important;
  --primary-soft: #eaf2ff !important;
}
body[data-portal="customer"] { background: var(--canvas); color: var(--ink); font-size: 17px; }
body[data-portal="customer"] > .app-shell { grid-template-columns: 232px minmax(0, 1fr); background: var(--canvas); }
body[data-portal="customer"] .sidebar { border-right-color: var(--line); background: #fff; }
body[data-portal="customer"] .main-content { max-width: 1440px; padding: 32px clamp(22px, 3vw, 44px) 72px; }
body[data-portal="customer"] .welcome-row { margin-bottom: 22px; align-items: center; }
body[data-portal="customer"] .welcome-row .eyebrow,
body[data-portal="customer"] .welcome-row .page-subtitle { display: none; }
body[data-portal="customer"] .welcome-row h1 { margin: 0; color: var(--ink); font-size: clamp(30px, 3vw, 38px); letter-spacing: -.035em; }
body[data-portal="customer"] :is(.panel, .task-workspace, .work-card, .metric-grid article, .model-market) { border-color: var(--line); border-radius: 15px; box-shadow: 0 2px 10px #15223808; }
body[data-portal="customer"] .sidebar nav .nav-item { font-size: 15px; }
html[data-page-role="customer"] body[data-portal="customer"] .sidebar nav .nav-item.active { color: #1058b6; background: #eaf2ff; }
body[data-portal="customer"] :is(.primary-button, .button.primary) { min-height: 42px; border-color: #1769d2; background: #1769d2; font-size: 15px; font-weight: 650; }
body[data-portal="customer"] :is(.primary-button, .button.primary):hover:not(:disabled) { border-color: #1058b6; background: #1058b6; }
body[data-portal="customer"] :is(.secondary-button, .button:not(.primary):not(.danger)) { min-height: 42px; border-color: var(--line-strong); color: #1769d2; font-size: 15px; font-weight: 650; }
body[data-portal="customer"] :is(.field input, .field select, .field textarea, .ui-search-field input) { border-color: var(--line-strong); font-size: 16px; }
body[data-portal="customer"] :is(.tabs, .market-views, .model-market-tabs) { gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f0f3f7; }
body[data-portal="customer"] :is(.tabs button, .market-view, .model-market-tabs button) { min-height: 38px; border: 0; border-radius: 8px; font-size: 15px; }
body[data-portal="customer"] :is(.tabs button.active, .market-view[aria-pressed="true"], .model-market-tabs button[aria-selected="true"]) { border: 0; background: #fff; color: var(--ink); box-shadow: 0 1px 4px #1522381a; }
body[data-portal="customer"] :is(#tasks .section-heading, #funds .panel-heading, #blocklist .panel-heading) { display: none; }
body[data-portal="customer"] #help .panel-heading h2 { display: none; }
body[data-portal="customer"] #help .panel-heading { justify-content: flex-end; }
body[data-portal="customer"] :is(#refresh-tasks, #refresh-finances, #models-refresh, #refresh-blocklist) { display: none; }
body[data-portal="customer"] #page-refresh[hidden] { display: none !important; }
body[data-portal="customer"] :is(#funds .workspace-note, #blocklist-intro, #block-worker-help) { display: none; }
body[data-portal="customer"] #blocklist .blocklist-guidance { margin-top: 20px; }
body[data-portal="customer"] .model-market-intro { display: none; }
body[data-portal="customer"] .model-market-disclosure { display: flex; align-items: center; margin: 20px 22px 0; padding: 10px 14px; border-color: var(--line); background: #f8fafc; font-size: 15px; }
body[data-portal="customer"] .model-market-disclosure p { margin: 0; font-size: 15px; }
body[data-portal="customer"] .model-market-disclosure-mark { color: #1769d2; background: #eaf2ff; }
body[data-portal="customer"] .model-market-card :is(.model-market-buy, .model-market-link) { border-color: #1769d2; border-radius: 10px; }
body[data-portal="customer"] .model-market-card .model-market-buy { background: #1769d2; color: #fff; }
body[data-portal="customer"] .model-market-link { color: #1769d2; background: #eaf2ff; }
body[data-portal="customer"] .model-market-controls { margin-top: 18px; }
body[data-portal="customer"] :is(.workspace-empty, .workspace-state) { background: #f8fafc; border-color: var(--line); color: var(--muted); font-size: 15px; }
body[data-portal="customer"] .task-filters { gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f0f3f7; }
body[data-portal="customer"] .task-filters button { min-height: 38px; padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: #536174; font-size: 15px; }
body[data-portal="customer"] .task-filters button[aria-pressed="true"] { border: 0; background: #fff; color: var(--ink); box-shadow: 0 1px 4px #1522381a; }
body[data-portal="customer"] .task-filters button span { background: #e6eaf0; color: #536174; }
body[data-portal="customer"] #help .help-content details { border-color: var(--line); border-radius: 10px; background: #f8fafc; }
body[data-portal="customer"] #help .help-content summary { color: var(--ink); font-size: 17px; }
body[data-portal="customer"] #help .help-content details[open] { background: #fff; }
body[data-portal="customer"] .primary-button:disabled { opacity: 1; border-color: #e3e9f0 !important; background: #e3e9f0 !important; color: #66758a !important; box-shadow: none; cursor: not-allowed; }
body[data-portal="customer"] .wizard-panel .panel-heading { justify-content: flex-end; padding-block: 12px 8px; border-bottom: 0; }
body[data-portal="customer"] .wizard-panel .panel-heading h2 { display: none; }
body[data-portal="customer"] .wizard-step-feedback { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-portal="customer"] .save-state { font-size: 15px; }
body[data-portal="customer"] #blocklist .blocklist-guidance { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; color: var(--muted); }
body[data-portal="customer"] #blocklist .blocklist-guidance strong { display: none; }
body[data-portal="customer"] #blocklist .blocklist-guidance p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 820px) {
  body[data-portal="customer"] > .app-shell { display: block; }
  body[data-portal="customer"] .main-content { padding: 22px 16px 112px; }
}
