:root {
  color-scheme: light;
  --navy-950: #061830;
  --navy-900: #082448;
  --blue-600: #155eef;
  --blue-700: #0c4fd7;
  --ink: #10213b;
  --muted: #64748b;
  --line: #dbe4f0;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --soft-blue: #eef5ff;
  --success: #08775a;
  --danger: #b42318;
  --warning: #a15c07;
  --focus: #78a8ff;
  font-family: Inter, "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 1000; top: 10px; left: 84px; transform: translateY(-180%); padding: 9px 13px; border-radius: 7px; color: var(--ink); background: white; box-shadow: 0 8px 24px rgb(14 35 67 / 18%); white-space: nowrap; }
.skip-link:focus { transform: translateY(0); }
.loading-view { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.loading-mark { width: 28px; height: 28px; border: 3px solid #d8e4f5; border-top-color: var(--blue-600); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(460px, .92fr); }
.brand-panel { min-height: 100vh; padding: clamp(36px, 5vw, 76px); display: flex; flex-direction: column; color: white; background: var(--navy-950); position: relative; overflow: hidden; }
.brand-panel::after { content: ""; position: absolute; right: -18%; bottom: -30%; width: 72%; aspect-ratio: 1; border: 1px solid rgb(112 163 239 / 18%); border-radius: 50%; box-shadow: 0 0 0 70px rgb(31 91 183 / 5%), 0 0 0 140px rgb(31 91 183 / 4%); pointer-events: none; }
.brand-lockup { position: relative; z-index: 1; }
.brand-logo { display: block; width: 280px; max-width: 72%; height: auto; }
.brand-copy { max-width: 720px; margin: auto 0; position: relative; z-index: 1; }
.eyebrow, .kicker, .section-label { margin: 0 0 14px; color: #8db9ff; font-size: 13px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.brand-copy h1 { margin: 0; max-width: 720px; font-size: clamp(42px, 5vw, 70px); line-height: 1.12; letter-spacing: -.045em; }
.brand-copy > p:last-child { max-width: 580px; margin: 26px 0 0; color: #c9d8ec; font-size: 17px; line-height: 1.85; }
.trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; position: relative; z-index: 1; border: 1px solid rgb(150 185 236 / 18%); background: rgb(150 185 236 / 18%); }
.trust-grid div { padding: 18px; background: rgb(8 36 72 / 88%); }
.trust-grid dt { font-size: 14px; font-weight: 700; }
.trust-grid dd { margin: 6px 0 0; color: #9fb4cf; font-size: 12px; }

.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 42px; background: #f8fafc; }
.auth-card { width: min(100%, 440px); }
.internal-badge { width: max-content; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px; padding: 7px 10px; border: 1px solid #cddcf0; border-radius: 999px; color: #355474; background: white; font-size: 12px; font-weight: 700; }
.internal-badge span, .environment-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgb(8 119 90 / 10%); }
.form-heading { margin-bottom: 28px; }
.form-heading .kicker, .gate-card .kicker, .welcome-row .kicker { color: var(--blue-600); }
.form-heading h2 { margin: 0 0 10px; font-size: 32px; line-height: 1.2; letter-spacing: -.035em; }
.form-heading p:last-child { margin: 0; color: var(--muted); line-height: 1.65; }
.form { display: grid; gap: 10px; }
.form label { margin-top: 8px; color: #34445b; font-size: 13px; font-weight: 700; }
.form input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #c8d3e1; border-radius: 7px; outline: none; color: var(--ink); background: white; transition: border-color 150ms ease, box-shadow 150ms ease; }
.form input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgb(21 94 239 / 12%); }
.primary, .secondary, .header-button { border-radius: 7px; font-weight: 700; }
.primary { min-height: 48px; margin-top: 14px; border: 1px solid var(--blue-600); color: white; background: var(--blue-600); }
.primary:hover { background: var(--blue-700); }
.primary:disabled { opacity: .58; }
.secondary { min-height: 46px; border: 1px solid #cbd6e4; color: var(--ink); background: white; }
.secondary:hover { border-color: #9fb1c8; background: #f8fafc; }
.status { margin: 0 0 18px; padding: 11px 13px; border-left: 3px solid var(--success); color: #075e49; background: #ecfdf5; font-size: 13px; line-height: 1.55; }
.status.is-error { border-color: var(--danger); color: var(--danger); background: #fff2f0; }
.access-note { display: grid; grid-template-columns: 22px 1fr; gap: 11px; margin-top: 24px; padding: 16px; border: 1px solid var(--line); background: #f8fafc; }
.access-note svg { width: 20px; fill: none; stroke: #517095; stroke-width: 1.7; }
.access-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.access-note strong { color: var(--ink); }
.auth-footer { display: grid; gap: 9px; margin-top: 24px; color: #7a8799; font-size: 11px; line-height: 1.6; }
.auth-footer nav, .filing-links { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.auth-footer a { color: #4d6788; text-decoration: none; }
.auth-footer a:hover { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; }
.filing-links { padding-top: 9px; border-top: 1px solid var(--line); }

.gate-view { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; background: radial-gradient(circle at 50% 10%, #edf5ff 0, var(--canvas) 36%); }
.gate-card { width: min(100%, 500px); padding: 40px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 20px 60px rgb(35 55 85 / 8%); }
.gate-icon { display: grid; width: 48px; height: 48px; margin-bottom: 28px; place-items: center; border-radius: 10px; color: var(--blue-600); background: var(--soft-blue); }
.gate-icon.is-warning { color: var(--warning); background: #fff8eb; }
.gate-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gate-card h1 { margin: 0 0 14px; font-size: 28px; letter-spacing: -.025em; }
.gate-copy { margin: 0 0 24px; color: var(--muted); line-height: 1.75; }
.compact-form { gap: 9px; }
.field-hint { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.identity-summary { display: flex; justify-content: space-between; margin: 24px 0; padding: 14px 16px; background: #f6f8fb; color: var(--muted); }
.identity-summary strong { color: var(--ink); }
.full-width { width: 100%; }

.workspace { min-height: 100vh; min-height: 100dvh; }
.app-rail { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 72px; display: flex; flex-direction: column; overflow: hidden; background: var(--navy-950); color: white; }
.rail-brand { flex: none; display: grid; width: 50px; height: 50px; margin: 10px auto 8px; place-items: center; border: 1px solid rgb(130 175 239 / 24%); border-radius: 9px; background: var(--blue-600); }
.rail-brand img { width: 39px; height: 39px; object-fit: contain; }
.rail-nav { min-height: 0; display: grid; align-content: start; gap: 5px; padding: 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.rail-item { flex: none; display: grid; width: 56px; min-height: 52px; padding: 5px 0; place-items: center; align-content: center; gap: 2px; border: 1px solid transparent; border-radius: 7px; color: #b9cae0; background: transparent; font-size: 11px; transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease; }
.rail-item .rail-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail-item:hover { border-color: rgb(112 168 255 / 32%); color: white; background: rgb(255 255 255 / 6%); }
.rail-item:active { background: rgb(255 255 255 / 10%); }
.rail-item.is-active { border-color: #3b7fe7; color: white; background: #0d4fae; }
.rail-item:disabled { opacity: .48; }
.app-header { position: fixed; z-index: 15; top: 0; right: 0; left: 72px; height: 56px; display: flex; justify-content: space-between; align-items: stretch; color: white; background: var(--navy-900); }
.workspace-tab { min-width: 122px; display: grid; place-items: center; margin-top: 8px; border-radius: 7px 7px 0 0; color: var(--ink); background: white; font-size: 14px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 15px; padding-right: 18px; }
.environment-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid rgb(160 190 230 / 24%); border-radius: 6px; color: #d8e4f3; font-size: 12px; }
.header-identity { display: grid; justify-items: end; gap: 2px; font-size: 11px; }
.header-identity span { color: #a9bdd6; }
.header-identity strong { font-size: 12px; }
.header-button { min-height: 40px; padding: 0 12px; border: 1px solid #557397; color: white; background: transparent; }
.header-button:hover { background: rgb(255 255 255 / 8%); }
.workspace-main { min-height: 100vh; margin-left: 72px; padding: 88px clamp(24px, 3vw, 48px) 48px; }
.workspace-main:focus-visible { outline: 3px solid var(--focus); outline-offset: -4px; }
.welcome-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.welcome-row h1 { margin: 0 0 10px; font-size: 32px; letter-spacing: -.035em; }
.welcome-row p:last-child { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.7; }
.session-card { min-width: 250px; padding: 18px 20px; border: 1px solid var(--line); background: white; }
.session-card > span { display: block; color: var(--muted); font-size: 11px; }
.session-card strong { display: flex; align-items: center; gap: 8px; margin: 8px 0 5px; font-size: 18px; }
.session-card i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.session-card small { color: var(--muted); }
.foundation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 28px 0 14px; }
.foundation-card { min-height: 170px; display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 25px; border: 1px solid var(--line); background: white; }
.card-index { color: #9aabc0; font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.state-label { color: #7b8ba0; font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.foundation-card.is-ready .state-label { color: var(--success); }
.foundation-card h2 { margin: 9px 0 8px; font-size: 19px; }
.foundation-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.handoff-panel { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; margin-top: 14px; padding: 30px; border: 1px solid #cbd9eb; background: #edf4fc; }
.handoff-panel .section-label { color: #517095; }
.handoff-panel h2 { margin: 0 0 10px; font-size: 21px; }
.handoff-panel p { margin: 0; color: var(--muted); line-height: 1.7; }
.handoff-panel dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.handoff-panel dt { color: var(--muted); font-size: 11px; }
.handoff-panel dd { margin: 6px 0 0; font-size: 13px; font-weight: 700; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.compact-button { min-height: 44px; margin: 0; padding: 0 16px; white-space: nowrap; }
.quiet-button, .text-button { padding: 0; border: 0; color: var(--blue-600); background: transparent; font-weight: 700; }
.quiet-button:hover, .text-button:hover { color: var(--blue-700); text-decoration: underline; }
.text-button:disabled, .quiet-button:disabled { color: #a7b2c1; text-decoration: none; cursor: not-allowed; }

.business-shell, .account-center-page { min-width: 0; }
.business-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.business-heading > div { min-width: 0; }
.business-heading h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.03em; text-wrap: balance; }
.business-heading p:last-child { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.65; text-wrap: pretty; }
.page-state-badge { flex: none; min-height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid #b9cbe1; border-radius: 6px; color: #385675; background: #f3f7fc; font-size: 12px; font-weight: 750; }
.page-state-badge.is-not-connected { border-color: #d8c8ab; color: #7c4b0b; background: #fff8eb; }
.page-state-badge.is-live-account { border-color: #add9ca; color: #07644d; background: #edf9f4; }

.business-scope { display: grid; grid-template-columns: 1.2fr .9fr .9fr; margin: 22px 0; border: 1px solid var(--line); background: white; }
.business-scope div { min-width: 0; min-height: 78px; display: grid; align-content: center; gap: 6px; padding: 16px 20px; border-right: 1px solid var(--line); }
.business-scope div:last-child { border-right: 0; }
.business-scope dt { color: var(--muted); font-size: 11px; }
.business-scope dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 750; }

.business-shell-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 14px; }
.business-empty-panel { min-width: 0; min-height: 310px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(28px, 4vw, 48px); border: 1px solid #cbd9eb; border-radius: 10px; background: #f8fbff; }
.empty-illustration { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 24px; border: 1px solid #bed0e7; border-radius: 10px; color: #45698f; background: white; }
.empty-illustration svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-label { margin-bottom: 8px; color: #517095; font-size: 12px; font-weight: 750; }
.business-empty-panel h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.02em; text-wrap: balance; }
.business-empty-panel p { max-width: 60ch; margin: 0 0 20px; color: var(--muted); line-height: 1.7; text-wrap: pretty; }
.business-empty-panel .secondary:disabled { border-color: #d4dde8; color: #6c7d92; background: #eef2f7; opacity: 1; }

.business-contract-ledger { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: white; }
.business-contract-ledger > header { min-height: 88px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.business-contract-ledger h2 { margin: 0 0 5px; font-size: 18px; }
.business-contract-ledger header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.contract-read-state { flex: none; padding: 5px 7px; border-radius: 5px; color: #53657b; background: #edf1f6; font-size: 11px; font-weight: 750; }
.contract-rows { margin: 0; }
.contract-rows div { display: grid; grid-template-columns: minmax(92px, .65fr) minmax(0, 1.35fr); gap: 16px; padding: 17px 20px; border-bottom: 1px solid #e8eef5; }
.contract-rows div:last-child { border-bottom: 0; }
.contract-rows dt { color: var(--muted); font-size: 12px; }
.contract-rows dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; line-height: 1.55; }

.business-contract-section { margin-top: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.contract-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 20px; }
.contract-section-heading h2 { margin: 0; font-size: 19px; }
.contract-section-heading p { max-width: 560px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.profit-state-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); }
.profit-state-list > div { min-width: 0; padding: 18px; border-right: 1px solid var(--line); }
.profit-state-list > div:last-child { border-right: 0; }
.profit-state-list dt { margin-bottom: 12px; }
.profit-state-list dd { display: grid; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.profit-state-list code { width: max-content; padding: 3px 5px; border-radius: 4px; color: #33465f; background: #edf1f6; font-size: 11px; }
.profit-state { display: inline-flex; min-height: 27px; align-items: center; padding: 0 8px; border-radius: 5px; font-size: 11px; font-weight: 750; }
.profit-state.is-confirmed { color: #07644d; background: #eaf8f2; }
.profit-state.is-estimated { color: #7c4b0b; background: #fff5df; }
.profit-state.is-incomplete { color: #8a3940; background: #fff0f1; }
.processing-steps { counter-reset: process-stage; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 1px; list-style: none; background: var(--line); }
.processing-steps li { counter-increment: process-stage; min-width: 0; min-height: 72px; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-content: center; column-gap: 9px; padding: 13px 14px; background: #f8fafc; }
.processing-steps li::before { content: counter(process-stage); grid-row: span 2; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #bdcadd; border-radius: 5px; color: #53657b; background: white; font-size: 11px; font-weight: 750; }
.processing-steps span { font-size: 13px; font-weight: 750; }
.processing-steps small { color: var(--muted); font-size: 11px; }

.account-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.account-heading h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.03em; }
.account-heading p:last-child { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.65; }
.heading-actions { display: flex; gap: 9px; flex: none; }
.account-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0; border: 1px solid var(--line); background: white; }
.account-summary div { min-height: 86px; display: grid; align-content: center; gap: 6px; padding: 18px 22px; border-right: 1px solid var(--line); }
.account-summary div:last-child { border-right: 0; }
.account-summary span { color: var(--muted); font-size: 12px; }
.account-summary strong { font-size: 24px; letter-spacing: -.02em; }

.account-form-panel { margin-bottom: 18px; padding: 24px; border: 1px solid #b9cbe1; background: #eef4fb; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.panel-heading .section-label { margin-bottom: 7px; color: #517095; }
.panel-heading h2 { margin: 0; font-size: 20px; }
.panel-copy { margin: 9px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.account-form { display: grid; grid-template-columns: minmax(220px, 1.25fr) minmax(170px, .8fr) minmax(240px, 1.3fr) auto; align-items: end; gap: 13px; }
.password-change-panel { border-color: #c7d5e8; background: #f8fbff; }
.password-change-form { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)) auto; align-items: end; gap: 13px; }
.account-form > div, .password-change-form > div { display: grid; gap: 7px; }
.account-form label, .password-change-form label, .dialog-field label { color: #34445b; font-size: 12px; font-weight: 750; }
.account-form input, .account-form select, .password-change-form input, .directory-filters input, .directory-filters select, .role-editor select, .dialog-field input { min-height: 40px; padding: 0 11px; border: 1px solid #c5d1df; border-radius: 6px; outline: none; color: var(--ink); background: white; }
.account-form input:focus, .account-form select:focus, .password-change-form input:focus, .directory-filters input:focus, .directory-filters select:focus, .role-editor select:focus, .dialog-field input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgb(21 94 239 / 11%); }
.account-form small, .password-change-form small, .dialog-field small { color: var(--muted); font-size: 11px; }

.member-directory { border: 1px solid var(--line); background: white; }
.directory-toolbar { min-height: 82px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.directory-toolbar h2 { margin: 0 0 5px; font-size: 19px; }
.directory-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.directory-filters { display: flex; gap: 9px; }
.directory-filters input { width: 230px; }
.directory-filters select { min-width: 120px; }
.member-directory > .status { margin: 14px 20px 0; }
.table-wrap { overflow-x: auto; }
.member-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.member-table th { height: 45px; padding: 0 16px; color: #52627a; background: #f7f9fc; font-size: 11px; font-weight: 750; text-align: left; }
.member-table th:nth-child(1) { width: 21%; }
.member-table th:nth-child(2) { width: 19%; }
.member-table th:nth-child(3) { width: 12%; }
.member-table th:nth-child(4) { width: 20%; }
.member-table th:nth-child(5) { width: 28%; }
.member-table td { min-height: 74px; padding: 15px 16px; border-top: 1px solid #e7edf4; vertical-align: middle; font-size: 13px; }
.member-table tbody tr:hover { background: #fbfcfe; }
.member-identity, .member-activity { display: grid; gap: 5px; }
.member-identity strong { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.member-identity em { padding: 3px 6px; border-radius: 4px; color: #315f9b; background: #edf4ff; font-size: 10px; font-style: normal; font-weight: 700; }
.member-identity span, .member-activity span { color: var(--muted); font-size: 11px; }
.member-activity strong { font-size: 12px; }
.role-editor { display: flex; align-items: center; gap: 9px; }
.role-editor select { width: 112px; min-height: 34px; }
.state-chip { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.state-chip.is-active { color: #07644d; background: #eaf8f2; }
.state-chip.is-disabled { color: #8a3940; background: #fff0f1; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; }
.row-actions .text-button { font-size: 12px; }
.loading-cell { height: 160px; color: var(--muted); text-align: center; }
.empty-state { padding: 70px 20px; text-align: center; }
.empty-state strong { display: block; margin-bottom: 8px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.account-boundary { display: flex; gap: 14px; margin-top: 14px; padding: 15px 18px; border: 1px solid var(--line); color: var(--muted); background: #f8fafc; font-size: 12px; line-height: 1.6; }
.account-boundary strong { flex: none; color: var(--ink); }

.confirm-dialog { width: min(92vw, 480px); padding: 0; border: 1px solid #c9d5e3; border-radius: 10px; color: var(--ink); background: white; box-shadow: 0 24px 70px rgb(6 24 48 / 22%); }
.confirm-dialog::backdrop { background: rgb(6 24 48 / 48%); }
.confirm-dialog form { padding: 28px; }
.confirm-dialog .section-label { margin-bottom: 9px; color: #517095; }
.confirm-dialog h2 { margin: 0 0 10px; font-size: 22px; }
.confirm-dialog p { margin: 0 0 20px; color: var(--muted); line-height: 1.65; }
.dialog-field { display: grid; gap: 7px; margin: 18px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: auto; padding: 28px; }
  .brand-copy { margin: 64px 0 54px; }
  .brand-copy h1 { font-size: 42px; }
  .trust-grid { display: none; }
  .auth-panel { min-height: auto; padding: 44px 22px 60px; }
  .welcome-row { align-items: stretch; flex-direction: column; }
  .business-heading { align-items: stretch; flex-direction: column; }
  .page-state-badge { align-self: flex-start; }
  .business-shell-grid { grid-template-columns: 1fr; }
  .contract-section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .profit-state-list { grid-template-columns: 1fr; }
  .profit-state-list > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .profit-state-list > div:last-child { border-bottom: 0; }
  .account-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { align-self: flex-start; }
  .account-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-summary div:nth-child(2) { border-right: 0; }
  .account-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .account-form, .password-change-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-toolbar { align-items: stretch; flex-direction: column; }
  .directory-filters input { width: min(100%, 320px); }
  .session-card { width: 100%; }
  .foundation-grid, .handoff-panel { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-rail { width: 58px; }
  .rail-brand { width: 42px; height: 42px; }
  .rail-nav { padding: 7px; }
  .rail-item { width: 44px; min-height: 48px; font-size: 10px; }
  .app-header { left: 58px; }
  .workspace-main { margin-left: 58px; padding: 78px 16px 32px; }
  .environment-chip, .header-identity { display: none; }
  .header-actions { gap: 8px; padding-right: 9px; }
  .header-identity strong { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .foundation-card { grid-template-columns: 36px 1fr; padding: 20px 17px; }
  .business-scope { grid-template-columns: 1fr; }
  .business-scope div { min-height: 66px; border-right: 0; border-bottom: 1px solid var(--line); }
  .business-scope div:last-child { border-bottom: 0; }
  .business-empty-panel, .business-contract-section { padding: 22px 18px; }
  .business-contract-ledger > header { align-items: flex-start; flex-direction: column; }
  .contract-rows div { grid-template-columns: 1fr; gap: 5px; }
  .processing-steps { grid-template-columns: 1fr; }
  .handoff-panel { padding: 22px 18px; }
  .handoff-panel dl { grid-template-columns: 1fr; }
  .gate-card { padding: 28px 22px; }
  .workspace-tab { min-width: 106px; }
  .heading-actions { flex-wrap: wrap; }
  .account-summary { grid-template-columns: 1fr 1fr; }
  .account-summary div { padding: 15px; }
  .account-form, .password-change-form { grid-template-columns: 1fr; }
  .directory-filters { flex-direction: column; }
  .directory-filters input, .directory-filters select { width: 100%; }
  .table-wrap { overflow: visible; }
  .member-table, .member-table tbody, .member-table tr, .member-table td { display: block; width: 100%; }
  .member-table thead { display: none; }
  .member-table tr { padding: 13px 15px; border-top: 1px solid var(--line); }
  .member-table td { min-height: 0; display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: start; padding: 9px 0; border: 0; }
  .member-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; }
  .member-table .loading-cell { display: block; height: auto; padding: 50px 0; }
  .member-table .loading-cell::before { content: none; }
  .role-editor, .row-actions { align-items: flex-start; flex-wrap: wrap; gap: 7px; }
  .role-editor select { width: 96px; }
  .account-boundary { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
