@media screen {
  html,body,.simple-shell,.simple-shell .main {background:var(--ui-background);color:var(--ui-ink)}
  .simple-shell .beta-topbar {max-width:760px;background:var(--ui-background);position:sticky;top:0;z-index:40;align-items:center}
  .simple-shell .beta-top-actions {display:flex;align-items:center;gap:12px}
  .simple-shell .beta-brand img,.demo-wizard-top img {mix-blend-mode:multiply}
  .simple-person {color:var(--ui-muted);font-size:12px;text-align:right}
  .simple-identity {min-width:0;flex:1;display:grid;gap:2px}
  .profile-role-picker {min-width:0;color:var(--ui-ink)}
  .profile-role-picker>summary {display:flex;flex-direction:column;justify-content:center;min-height:44px;padding:4px 8px;cursor:pointer;list-style:none;font-size:12px;line-height:1.4;text-align:left}
  .profile-role-picker>summary::-webkit-details-marker {display:none}
  .profile-role-name {font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .profile-role-options {position:absolute;top:calc(100% + 8px);right:16px;width:min(280px,calc(100vw - 32px));box-sizing:border-box;padding:8px;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:12px;box-shadow:0 12px 32px #071c3b20;z-index:60}
  .profile-option-row {display:flex;align-items:center;gap:8px;min-width:0;border-bottom:1px solid var(--ui-line)}
  .profile-option-row:last-child {border-bottom:0}
  .profile-option-row>button:first-child {flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:52px;padding:10px 4px;text-align:left;white-space:normal;background:transparent;border:0;color:var(--ui-ink);font:inherit;cursor:pointer}
  .profile-role-options [aria-pressed=true] {font-weight:700;color:var(--ui-primary)}
  .profile-info {flex:none;width:40px;min-height:44px;border:0;background:transparent;color:var(--ui-primary);font:700 17px Georgia,serif;cursor:pointer;border-radius:8px}
  .profile-info:hover {background:var(--ui-secondary)}
  .profile-actions {display:flex;flex-wrap:wrap;gap:10px}
  .profile-actions .client-button {margin:0}
  .profile-card-heading {display:flex;gap:18px;align-items:center;margin-bottom:20px}
  .profile-card-heading h2 {margin:0 0 6px;font-size:23px}
  .profile-card-heading p {margin:0}
  .profile-photo {flex:none;width:82px;height:100px;display:grid;place-items:center;border-radius:8px;background:var(--ui-secondary);font-size:32px;font-weight:700;overflow:hidden}
  .profile-photo .record-person-photo {width:100%;height:100%;object-fit:cover;border-radius:0;margin:0}
  .profile-facts {margin:0}
  .profile-facts>div {display:grid;grid-template-columns:110px minmax(0,1fr);gap:16px;border-bottom:1px solid var(--ui-line);padding:14px 0;align-items:start}
  .profile-facts dt {font-weight:600;color:var(--ui-ink)}
  .profile-facts dd {margin:0;overflow-wrap:anywhere;color:var(--ui-ink)}
  .profile-print-brand,.profile-print-note {display:none}
  .simple-shell #page:has([data-profile-preferences], [data-profile-agreements]) {max-width:600px}
  .demo-shell .simple-person {display:block;color:var(--ui-ink);font-weight:600;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .simple-demo-label {font-size:10px;line-height:1.3;color:var(--ui-muted)}
  .simple-register {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 6px;border:0;border-radius:6px;background:transparent;color:var(--ui-ink);font:inherit;font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:3px;white-space:nowrap;cursor:pointer}
  .simple-shell #page {max-width:600px;padding-bottom:120px}
  .simple-shell .client-home,.simple-shell .experience-home {display:grid;grid-template-columns:minmax(0,1fr);gap:18px}
  .simple-shell .experience-home>* {grid-column:auto;grid-row:auto}
  .simple-shell .client-card,.simple-shell .card,.simple-shell .beta-loan-summary,.simple-shell .loan-notebook {background:var(--ui-surface);border-color:var(--ui-line)}
  .simple-shell .beta-capital-hero,.simple-shell .beta-client-hero,.simple-shell .hero-card {background:var(--ui-secondary);color:var(--ui-ink);border-color:var(--ui-line)}
  .simple-shell .beta-capital-hero :is(button,strong,span),.simple-shell .beta-client-hero :is(button:not(.btn),strong,span) {color:var(--ui-ink)}
  .simple-shell :is(h1,h2,h3,.client-capital strong,.client-receipt-amount,.experience-facts dd) {color:var(--ui-ink)}
  .simple-shell :is(.client-heading p,.client-muted,.client-note,.experience-facts dt,.client-capital span,.client-card p) {color:var(--ui-muted)}
  .simple-shell .btn,.simple-shell .client-button,#modal .btn {background:var(--ui-secondary);color:var(--ui-ink);border-color:var(--ui-line);min-height:44px}
  .simple-shell .btn:is(.primary,.good),.simple-shell .client-button.primary,#modal .btn:is(.primary,.good) {background:var(--ui-primary);color:var(--ui-primary-ink);border-color:var(--ui-primary)}
  .simple-shell :is(.client-button.text,.client-text-button,.link-button),.simple-shell summary {color:var(--ui-ink)}
  .simple-shell .client-button.text {background:transparent}
  .simple-shell .beta-bottom-nav {grid-template-columns:repeat(3,minmax(0,1fr));background:var(--ui-surface);border-color:var(--ui-line);max-width:520px}
  .simple-shell .beta-bottom-nav button {width:100%;color:var(--ui-muted);font-size:12px}
  .simple-shell .beta-bottom-nav button.active,.simple-shell .beta-bottom-nav button.active .beta-avatar {background:var(--ui-secondary);color:var(--ui-ink)}
  .simple-shell .beta-bottom-nav .beta-avatar {background:var(--ui-secondary);color:var(--ui-ink)}
  .simple-shell .simple-more {padding:16px 18px;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:16px}
  .simple-shell .simple-more>summary {min-height:44px;font-weight:600}
  .simple-shell .simple-more .client-button {margin:8px 0}
  #modal {background:var(--ui-surface);color:var(--ui-ink)}
  #modal .notice {background:var(--ui-secondary);color:var(--ui-ink);border-color:var(--ui-line)}
  .demo-shell .beta-bottom-nav {grid-template-columns:repeat(4,minmax(0,1fr))}
  .demo-shell #page {padding-bottom:calc(120px + env(safe-area-inset-bottom))}
  html:has(.demo-shell) .toast-zone {bottom:100px}
  .demo-wizard {max-width:600px;margin:auto;padding:20px 20px 40px;color:var(--ui-ink)}
  .demo-wizard-top {position:sticky;top:0;z-index:40;background:var(--ui-background);display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;padding-block:8px}
  .demo-wizard-top .beta-top-actions {display:flex;align-items:center;gap:8px}
  .demo-wizard-top img {object-fit:contain}
  .demo-wizard-card {padding:24px;border:1px solid var(--ui-line);border-radius:22px;background:var(--ui-surface)}
  .demo-label {display:block;margin-bottom:24px;padding:8px 12px;border-radius:10px;background:var(--ui-secondary);font-size:13px;font-weight:700}
  .demo-wizard h1 {font-size:clamp(24px,5vw,32px);line-height:1.2;margin:10px 0 14px;color:var(--ui-ink)}
  .demo-wizard .eyebrow,.demo-wizard .muted {color:var(--ui-muted)}
  .demo-wizard .role-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:20px}
  .demo-wizard .role-card {min-width:0;border-color:var(--ui-line);color:var(--ui-ink);background:var(--ui-surface);padding:16px;cursor:pointer}
  .demo-wizard .role-card:hover,.demo-wizard .role-card:focus-visible {background:var(--ui-secondary);border-color:var(--ui-primary)}
  .demo-wizard .role-card small {display:block;color:var(--ui-muted);line-height:1.45}
  .demo-wizard .role-icon {background:var(--ui-secondary);color:var(--ui-ink)}
  .demo-guide {padding-left:22px;line-height:1.6}.demo-guide li {margin:12px 0;padding-left:4px}
  .demo-wizard-actions {display:flex;flex-wrap:wrap;gap:10px;margin-top:24px}
  .demo-wizard .btn {min-height:44px;background:var(--ui-secondary);color:var(--ui-ink);border-color:var(--ui-line)}
  .demo-wizard .btn.primary {background:var(--ui-primary);color:var(--ui-primary-ink);border-color:var(--ui-primary)}
  .demo-wizard-links {display:flex;flex-wrap:wrap;justify-content:center;gap:8px 20px;margin-top:20px}
  .demo-wizard-links a {display:inline-flex;align-items:center;min-height:44px;color:var(--ui-ink);font-size:13px}
  @media(max-width:420px) {.simple-person {display:none}.simple-shell .beta-top-actions {gap:4px}.simple-shell #page {padding-inline:16px}.demo-shell .beta-topbar {gap:8px;padding:8px 12px;min-height:68px}.demo-shell .beta-brand img {width:68px;height:48px}}
  @media(max-width:360px) {.demo-wizard {padding-inline:12px}.demo-wizard-card {padding:16px}.demo-wizard .role-grid {gap:8px}.demo-wizard .role-card {padding:12px}.demo-shell .beta-topbar {gap:6px}.demo-shell .beta-brand img {width:56px;height:42px}.demo-shell .simple-person {font-size:11px}.demo-shell .simple-register {padding-inline:4px;font-size:12px}}
}
@media print {.theme-picker,.simple-identity,.simple-register {display:none!important}}

.user-help-button{display:grid;place-items:center;flex-shrink:0;width:36px;height:36px;min-width:36px;padding:0;border:1px solid var(--ui-border);border-radius:50%;background:var(--ui-surface);color:var(--ui-primary);font-size:20px;font-weight:700;line-height:1;cursor:pointer}
.user-help-button:focus-visible{outline:3px solid var(--ui-primary);outline-offset:2px}
@media(max-width:360px){.simple-shell .beta-top-actions{gap:3px}.user-help-button{width:32px;height:32px;min-width:32px}}

/* Shared account header. Context never consumes the identity's first row. */
@media screen {
  .simple-shell .beta-topbar.app-header,.demo-wizard-top.app-header {display:flex;flex-direction:column;align-items:stretch;height:auto;gap:4px;padding:10px 16px}
  .app-header-row {display:flex;align-items:center;gap:12px;min-width:0;width:100%}
  .app-header-row>.beta-brand {flex:none}
  .app-header-row .beta-brand img {display:block;width:91px;height:65px;object-fit:contain}
  .app-header-row>.simple-identity {flex:1;min-width:0}
  .app-header-row :is(.wallet-identity strong,.profile-role-name,.demo-entry-identity strong) {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;white-space:normal;overflow-wrap:anywhere;font-size:15px;line-height:1.3}
  .app-header-row .profile-role-picker>summary {padding:0;min-width:0}
  .app-header-row :is(.wallet-identity>span,.profile-role-picker>summary>span:last-child,.demo-entry-identity>span) {font-size:13px;line-height:1.35;white-space:nowrap}
  .app-header-context {display:flex;align-items:center;gap:10px;min-width:0}
  .app-header-context:empty,.app-header-context:has(>.app-back[hidden]:only-child) {display:none}
  .app-header-context .simple-demo-label {display:inline-flex;align-items:center;white-space:nowrap;font-size:12px;line-height:1.4;padding:3px 9px;background:var(--ui-secondary);border-radius:7px}
  .app-header-context .app-back>span {display:inline}
  .header-actions {position:relative;flex:none;margin-left:auto}
  .header-menu-toggle {display:none}
  .header-actions-panel {display:flex;align-items:center;gap:12px}
  .header-actions-panel :is(a,button) {font:inherit;font-size:13px;min-height:44px}
  .header-actions-panel .user-help-button {display:flex;gap:6px;width:auto;height:auto;min-width:44px;padding:8px;border-radius:8px}
  .header-actions-panel .theme-trigger {display:flex;align-items:center;justify-content:center;gap:8px;width:auto;font-size:19px}
  .theme-trigger-label {font-size:13px}
  .app-header-row :focus-visible {outline:3px solid var(--ui-primary);outline-offset:3px}
  @media(max-width:760px) {
    .simple-shell .beta-topbar.app-header,.demo-wizard-top.app-header {padding:8px 12px;padding-top:max(8px,env(safe-area-inset-top));gap:6px}
    .demo-wizard-top.app-header {position:relative}
    .app-header-row {display:grid;grid-template-columns:64px minmax(0,1fr) 44px;gap:10px}
    .simple-shell .beta-topbar .app-header-row .beta-brand img,.demo-wizard-top .app-header-row .beta-brand img {width:64px;height:46px}
    .app-header-row .header-actions {position:static;margin:0;width:44px;gap:0}
    .header-menu-toggle {display:grid;place-items:center;min-width:44px;min-height:44px;padding:10px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-surface);color:var(--ui-ink);cursor:pointer}
    .header-menu-toggle svg {width:22px;height:22px}
    .header-actions-panel {display:none;position:absolute;right:12px;top:calc(100% + 4px);width:min(280px,calc(100vw - 24px));max-height:70dvh;overflow:auto;box-sizing:border-box;padding:8px;border:1px solid var(--ui-line);border-radius:14px;background:var(--ui-surface);box-shadow:0 12px 30px #071c3b26;z-index:80}
    .header-menu-toggle[aria-expanded="true"]+.header-actions-panel {display:grid;gap:4px}
    .header-actions-panel :is(.simple-register,.link-button,.user-help-button,.theme-trigger) {width:100%;min-width:44px;min-height:44px;justify-content:flex-start;text-align:left;padding:10px 12px;border:0;border-radius:8px;text-decoration:none;color:var(--ui-ink);background:transparent;font-size:15px}
    .header-actions-panel :is(.simple-register,.link-button,.user-help-button,.theme-trigger):hover {background:var(--ui-secondary)}
    .header-actions-panel .theme-menu {position:static;width:100%;max-width:100%;box-sizing:border-box;margin-top:4px;box-shadow:none}
  }
}
@media print {.header-actions,.app-header-context {display:none!important}}
