:root {
  --rail: 64px;
  --titlebar: 34px;
  --settings-nav-width: clamp(248px, 17.8vw, 328px);
  --ink: #202124;
  --ink-2: #3f4145;
  --muted: #5f6268;
  --faint: #6f7278;
  --canvas: #f7f7f8;
  --page: #f1f2f3;
  --surface: #fff;
  --surface-2: #f6f6f4;
  --surface-3: #eceeed;
  --line: #e2e3e5;
  --line-strong: #cfd1d4;
  --action: #245ce5;
  --action-soft: #eaf1ff;
  --success: #117553;
  --success-soft: #e9f8f1;
  --update-border: #b9ddcf;
  --update-border-strong: #82bda7;
  --update-surface: #f2fbf7;
  --update-surface-hover: #dcf3e8;
  --update-surface-active: #ccebdc;
  --update-shadow: 0 18px 48px -22px rgb(27 82 61 / 42%);
  --warning: #8c4d08;
  --warning-soft: #fff4df;
  --risk: #a53646;
  --risk-soft: #f8e9eb;
  --brand: #e8353f;
  --brand-soft: rgb(232 53 63 / 10%);
  --shadow: 0 1px 3px rgb(27 34 42 / 5%);
  --shadow-lg: 0 34px 80px -48px rgb(27 34 42 / 38%);
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: var(--body);
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

orb-status {
  --orb-neutral: var(--ink-2);
  --orb-info: var(--action);
  --orb-success: var(--success);
  --orb-warning: var(--warning);
  --orb-danger: var(--risk);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; }
body { overflow: hidden; color: var(--ink); background: var(--canvas); font: 13px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgb(36 92 229 / 12%); }
button:focus-visible, input:focus-visible { outline: 3px solid rgb(36 92 229 / 24%); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 50; top: 8px; left: 8px; padding: 9px 12px; border-radius: 8px; color: #fff; background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.app-shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: var(--titlebar) minmax(0, 1fr); width: 100%; height: 100dvh; overflow: hidden; }
.command-rail { position: relative; z-index: 3; display: flex; min-height: 0; grid-row: 2; flex-direction: column; align-items: center; padding: 14px 8px 12px; background: #f2f2f3; box-shadow: inset -1px 0 #dedfe1; }
.brand { position: relative; display: grid; width: 44px; height: 44px; place-items: center; overflow: visible; margin-bottom: 18px; padding: 0; border: 0; border-radius: 14px; background: transparent; }
.brand img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand:hover { opacity: .88; }
.brand:active { opacity: .72; }
.rail-nav { display: grid; width: 100%; min-height: 0; gap: 6px; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-spacer { min-height: 8px; flex: 1; }
.rail-button { position: relative; display: grid; width: 44px; min-width: 44px; height: 44px; min-height: 44px; place-items: center; margin: 0 auto; padding: 0; border: 0; border-radius: 11px; color: var(--muted); background: transparent; }
.rail-button:hover, .account-entry:hover { color: var(--ink); }
.rail-button.active, .account-entry.active { color: var(--action); background: transparent; }
.rail-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rail-tooltip { position: fixed; z-index: 20; max-width: min(320px, calc(100vw - 92px)); padding: 7px 10px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 8px; color: var(--surface); background: var(--ink); box-shadow: 0 8px 24px rgb(27 34 42 / 24%); font-size: 12px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; pointer-events: none; white-space: normal; }
.rail-icon { display: grid; width: 26px; height: 26px; place-items: center; font: 600 24px/1 var(--display); }
.rail-icon svg { width: 26px; height: 26px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.rail-button.active .rail-glyph-body, .account-entry.active .rail-glyph-body { fill: currentcolor; }
.rail-button.active .rail-glyph-detail, .account-entry.active .rail-glyph-detail { stroke: var(--surface); }
.rail-button.active .rail-glyph-hole, .account-entry.active .rail-glyph-hole { fill: var(--surface); stroke: var(--surface); }
.update-entry { display: grid; width: 44px; min-height: 44px; place-items: center; margin-bottom: 8px; padding: 0; border: 1px solid var(--update-border); border-radius: 13px; color: var(--success); background: var(--success-soft); font-size: 10px; font-weight: 700; }
.update-entry:hover { border-color: var(--update-border-strong); background: var(--update-surface-hover); }
.update-entry:active { background: var(--update-surface-active); }
.update-entry .rail-icon { font-size: 18px; }
.account-entry { position: relative; display: grid; width: 44px; height: 44px; min-height: 44px; place-items: center; padding: 0; border: 0; border-radius: 11px; color: var(--muted); background: transparent; }
.rail-button:active .rail-icon, .account-entry:active .rail-icon { opacity: .65; }
.avatar { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: #fff; background: #5f6268; font-size: 10px; }

.workspace { display: grid; grid-column: 2; grid-row: 1 / span 2; grid-template-rows: var(--titlebar) minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
.topbar { position: relative; z-index: 6; display: flex; min-width: 0; align-items: center; gap: 10px; padding: 0 12px 0 14px; color: var(--muted); background: #f7f7f8; box-shadow: inset 0 -1px #dedfe1; font-size: 11px; -webkit-app-region: drag; }
.window-title { min-width: 0; overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.topbar-projection { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; clip-path: inset(50%); white-space: nowrap; pointer-events: none; }
.page-identity { min-width: 210px; }
.page-identity h1 { margin: 0; font: 700 20px/1.2 var(--display); letter-spacing: -.025em; }
.page-identity p { margin: 3px 0 0; color: var(--faint); font-size: 12px; }
.scope-summary { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.scope-summary > span:last-child { display: grid; min-width: 0; }
.scope-summary strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
.scope-summary small { color: var(--faint); font-size: 11px; }
.scope-mark { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #fff; background: var(--ink); font-weight: 760; }
.acceptance-badge { display: flex; min-width: 0; max-width: 320px; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #e5bd72; border-radius: 10px; color: #6f3c05; background: #fff4d6; }
.acceptance-badge span { flex: none; font-size: 10px; font-weight: 760; letter-spacing: .05em; }
.acceptance-badge strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.conversation-force-refresh { display: inline-flex; height: 28px; flex: none; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-2); background: #fff; font-size: 11px; font-weight: 680; white-space: nowrap; -webkit-app-region: no-drag; }
.conversation-force-refresh:hover { border-color: var(--action); color: var(--action); }
.conversation-force-refresh:disabled { cursor: wait; opacity: .68; }
.conversation-force-refresh[hidden] { display: none; }
.connection-control { display: inline-flex; width: 180px; height: 26px; flex: none; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 4px; border: 0; border-radius: 0; color: var(--muted); background: transparent; font-size: 11px; line-height: 1; -webkit-app-region: no-drag; }
.connection-control:hover { opacity: .8; }
.connection-control:active { opacity: .65; }
.connection-control:disabled { cursor: wait; opacity: .72; }
.connection-control[data-state="online"] { color: var(--success); }
.connection-control[data-state="unstable"] { color: var(--warning); }
.connection-control[data-state="offline"] { color: var(--risk); }
.connection-control orb-status { display: none; flex: none; }
.connection-control[data-state="checking"] orb-status { display: inline-flex; }
.connection-control[data-state="checking"] .network-icon { display: none; }
.connection-copy { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.connection-copy strong { font-size: 11px; font-weight: 680; white-space: nowrap; }
.connection-copy small { min-width: 45px; color: currentcolor; font: 600 10px/1 var(--mono); opacity: .72; text-align: right; white-space: nowrap; }
.network-icon, .network-icon svg { display: block; width: 17px; height: 17px; flex: none; }
.network-icon svg { overflow: visible; fill: currentcolor; }
.network-wave, .network-slash { fill: none; stroke: currentcolor; stroke-width: 1.8; stroke-linecap: round; }
.network-slash { display: none; stroke-width: 2.2; }
.connection-control[data-state="unstable"] .network-wave--outer { opacity: .18; }
.connection-control[data-state="unstable"] .network-wave--middle { opacity: .45; }
.connection-control[data-state="offline"] .network-wave, .connection-control[data-state="offline"] circle { opacity: .16; }
.connection-control[data-state="offline"] .network-slash { display: block; opacity: 1; }
.status-pill { display: inline-flex; min-height: 30px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 680; white-space: nowrap; }
button.status-pill { background: #fff; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentcolor; }
.status-pill.neutral { color: var(--muted); background: var(--surface-2); }
.status-pill.success { color: var(--success); border-color: #d8eee4; background: #f4fbf7; }
.status-pill.warning { color: var(--warning); border-color: #f0ddba; background: #fffaf0; }
.status-pill.error { color: var(--risk); border-color: #f0d8dc; background: #fff7f8; }
.navigation-status-slot { display: flex; width: 150px; height: 26px; flex: none; align-items: center; justify-content: flex-end; }
.status-pill.navigation-status { width: 100%; min-width: 0; min-height: 26px; justify-content: flex-end; overflow: hidden; padding: 0 4px; border: 0; background: transparent; }
.status-pill.navigation-status orb-status { flex: none; }
.status-pill.navigation-status > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.stage { position: relative; display: grid; grid-row: 2; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
.update-popover { position: absolute; z-index: 8; bottom: 18px; left: 18px; display: grid; width: min(360px, calc(100% - 36px)); grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 18px; border: 1px solid var(--update-border); border-radius: 16px; color: var(--ink-2); background: var(--update-surface); box-shadow: var(--update-shadow); transform-origin: left bottom; animation: update-popover-in 180ms cubic-bezier(.16, 1, .3, 1); }
.update-popover > orb-status { margin-top: 2px; }
.update-popover__copy { display: grid; min-width: 0; gap: 4px; padding-right: 24px; }
.update-popover__copy strong { color: var(--success); font-size: 14px; }
.update-popover__copy span { color: var(--muted); font-size: 12px; }
.update-popover__close { position: absolute; top: 6px; right: 6px; display: grid; width: 36px; min-height: 36px; place-items: center; padding: 0; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 20px; line-height: 1; }
.update-popover__close:hover { color: var(--ink); background: rgb(32 33 36 / 7%); }
.update-popover__restart { min-height: 40px; grid-column: 2; justify-self: start; padding: 0 16px; border: 1px solid var(--success); border-radius: 9px; color: var(--surface); background: var(--success); font-weight: 700; }
.update-popover__restart:hover { filter: brightness(.9); }
.update-popover__restart:disabled { cursor: wait; opacity: .68; }
@keyframes update-popover-in { from { opacity: 0; transform: translate3d(-10px, 12px, 0) scale(.98); } }
.local-view { min-width: 0; height: 100%; grid-row: 2; overflow: auto; }
.home-wordmark { display: flex; align-items: center; gap: 10px; font-weight: 740; }
.home-wordmark small { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.plain-button, .soft-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 680; }
.plain-button { border: 0; color: var(--muted); background: transparent; }
.plain-button:hover { color: var(--ink); background: rgb(32 33 36 / 7%); }
.soft-button { border: 1px solid transparent; background: var(--surface-3); }
.soft-button:hover { border-color: var(--line-strong); }
.home-setup__story .home-wordmark small, .home-setup__story p, .home-setup__assurance { color: #cfd1d4; }
.text-link { display: flex; min-height: 44px; align-items: center; padding: 0; border: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 750; }
.primary-button, .outline-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 680; }
.primary-button { border: 1px solid var(--ink); color: #fff; background: var(--ink); }
.outline-button { border: 1px solid #d4d5d8; background: #fff; }
.primary-button:not(:disabled):hover { background: #35373b; }
.primary-button:not(:disabled):active { background: #111214; }
.outline-button:not(:disabled):hover { border-color: #c3c5c9; background: var(--surface-2); }
.outline-button:not(:disabled):active { background: #e8e8ea; }
.state-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.state-tag.neutral { color: var(--muted); background: #f0f0f2; }
.state-tag.success { color: var(--success); background: var(--success-soft); }
.state-tag.warning { color: var(--warning); background: var(--warning-soft); }
.state-tag.danger { color: var(--risk); background: var(--risk-soft); }

.settings-view { overflow: hidden; }
.settings-shell {
  --settings-content-max: 924px;
  --settings-content-padding-x: 32px;
  --settings-page-title-size: 28px;
  --settings-page-copy-size: 14px;
  display: grid;
  grid-template-columns: var(--settings-nav-width) minmax(0, 1fr);
  height: 100%;
  font-family: var(--body);
}
.settings-nav { display: flex; min-height: 0; flex-direction: column; overflow: hidden; padding: 18px 10px 20px; border-right: 1px solid var(--line); background: var(--surface-2); }
.settings-nav__back { display: flex; width: 100%; min-height: 52px; align-items: center; gap: 9px; padding: 0 8px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font: 500 15px/20px var(--body); text-align: left; }
.settings-nav__back:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.settings-nav__back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.settings-nav__search { display: flex; min-height: 44px; align-items: center; gap: 9px; margin: 12px 0 8px; padding: 0 13px; border: 1px solid transparent; border-radius: 12px; color: var(--faint); background: color-mix(in srgb, var(--ink) 5%, var(--surface-2)); transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease; }
.settings-nav__search:focus-within { border-color: color-mix(in srgb, var(--ink) 26%, transparent); background: var(--canvas); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 7%, transparent); }
.settings-nav__search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; }
.settings-nav__search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: 400 14px/20px var(--body); }
.settings-nav__search input::placeholder { color: var(--faint); opacity: 1; }
.settings-nav__search input::-webkit-search-cancel-button { opacity: .55; }
.settings-nav__scroll { min-height: 0; flex: 1; overflow: auto; padding-right: 2px; scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent; scrollbar-width: thin; }
.settings-nav__group { display: block; }
.settings-nav__group + .settings-nav__group { margin-top: 10px; }
.settings-nav__group--diagnostics { padding-bottom: 12px; }
.settings-nav__group:not(:has(button:not([hidden]))) { display: none; }
.settings-nav__group h2 { margin: 10px 10px 6px; color: var(--faint); font: 400 15px/20px var(--body); letter-spacing: 0; }
.settings-nav__group button { position: relative; display: flex; width: 100%; min-height: 38px; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 10px; color: var(--ink-2); background: transparent; text-align: left; font: 400 15px/20px var(--body); }
.settings-nav__icon { width: 20px; height: 20px; flex: 0 0 auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-nav__group button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.settings-nav__group button.active { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); font-weight: 500; }
.settings-nav__empty { margin: 24px 10px; color: var(--faint); font: 400 14px/20px var(--body); text-align: center; }
.settings-content { min-width: 0; overflow: auto; padding: 34px var(--settings-content-padding-x) 96px; background: var(--surface); }
.settings-panel { width: 100%; max-width: var(--settings-content-max); margin: 0 auto; }
.settings-heading { margin-bottom: 44px; }
.settings-heading h1 { margin: 0; font: 500 var(--settings-page-title-size)/36px var(--body); letter-spacing: -.02em; text-wrap: balance; }
.settings-heading p { max-width: 760px; margin: 8px 0 0; color: var(--muted); font: 400 var(--settings-page-copy-size)/20px var(--body); }
body[data-settings="cloud-connectors"] .settings-content { overflow: hidden; padding: 0; }
.connector-entry-card__identity { display: flex; align-items: center; gap: 14px; }
.connector-entry-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.connector-entry-card__actions > button { margin-left: auto; }
.connector-entry-card__actions b { color: var(--muted); font: 500 13px/18px var(--body); }
.connector-install-row { align-items: start; }
.runtime-logo.cloud { font-size: 10px; letter-spacing: .04em; }
.connector-detail-host { width: 100%; max-width: none; min-height: 100%; }
.connector-detail-fallback { max-width: 520px; margin: 64px auto; padding: 0 24px; color: var(--muted); text-align: center; line-height: 1.7; }
.settings-section + .settings-section { margin-top: 44px; }
.settings-section__heading { margin-bottom: 16px; }
.settings-section__heading h2 { margin: 0; font: 500 16px/22px var(--body); }
.settings-section__heading p { max-width: 760px; margin: 5px 0 0; color: var(--muted); font: 400 14px/20px var(--body); }
.settings-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.settings-group:has(.settings-dropdown) { overflow: visible; }
.settings-row:has(.settings-dropdown[data-open]) { position: relative; z-index: 2; }
.settings-row { display: grid; min-height: 72px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 14px 18px; }
.settings-row + .settings-row, .settings-row + .artifact-update-boundary { border-top: 1px solid var(--line); }
.settings-row__copy { display: grid; min-width: 0; gap: 4px; }
.settings-row__copy .state-tag { justify-self: start; }
.settings-row__copy strong { color: var(--ink); font: 500 15px/20px var(--body); }
.settings-row__copy small { color: var(--muted); font: 400 14px/20px var(--body); }
.settings-row .primary-button, .settings-row .outline-button { flex: none; font: 500 14px/20px var(--body); }
.settings-code { color: var(--muted); font: 500 13px/20px var(--mono); white-space: nowrap; }
.settings-inline-back { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; margin: 0 0 24px; padding: 0 10px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; font: 500 14px/20px var(--body); }
.settings-inline-back:hover { background: var(--surface-2); }
.settings-inline-back:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.artifact-update-card { display: block; }
.artifact-update-header { display: grid; }
.artifact-update-heading { display: flex; min-width: 0; align-items: center; gap: 16px; }
.artifact-update-header > button { min-width: 132px; flex: none; }
.artifact-update-header > button:disabled { cursor: wait; opacity: .58; }
.artifact-update-item { min-height: 92px; }
.artifact-update-copy { min-width: 0; }
.artifact-update-copy progress { width: min(100%, 360px); height: 6px; margin-top: 10px; accent-color: var(--action); }
.artifact-update-actions { display: grid; min-width: 142px; justify-items: end; gap: 10px; }
.artifact-update-actions:has(> button[hidden]) { display: none; }
.artifact-update-boundary { margin: 0; padding: 14px 18px; color: var(--muted); font: 400 13px/20px var(--body); }
.runtime-log-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.runtime-log-summary > div { min-width: 0; }
.runtime-log-summary dt { color: var(--muted); font: 400 13px/18px var(--body); }
.runtime-log-summary dd { overflow: hidden; margin: 4px 0 0; color: var(--ink); font: 500 15px/20px var(--body); text-overflow: ellipsis; white-space: nowrap; }
.runtime-log-actions button:disabled { cursor: default; opacity: .48; }
.runtime-log-status:empty { display: none; }
.account-summary-identity { display: flex; min-width: 0; align-items: center; gap: 14px; }
.profile-mark { display: grid; width: 48px; height: 48px; flex: none; place-items: center; border-radius: 14px; color: #fff; background: var(--ink); font: 700 16px/1 var(--display); }
.login-error { margin: 2px 0 0; padding: 9px 11px; border-radius: 8px; color: var(--risk); background: #fff1f3; font-size: 12px; }
.account-logout-error { grid-column: 1 / -1; width: 100%; margin: 0; }
.empty-state { display: grid; max-width: 660px; justify-items: center; margin: 36px auto 0; padding: 44px 32px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; }
.empty-state > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 16px; color: var(--muted); background: #f0f0f2; font: 700 20px/1 var(--mono); }
.empty-state h2, .empty-state h3 { margin: 18px 0 0; font: 690 18px/1.25 var(--display); }
.empty-state p { max-width: 480px; margin: 9px 0 0; color: var(--muted); line-height: 1.7; }
.empty-state button { margin-top: 20px; }
.runtime-logo { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; color: #fff; background: var(--ink); font-weight: 760; }
.unavailable-view { display: grid; place-items: center; padding: 30px; }
.loading-view { padding: 28px; background: #f7f7f8; }
.loading-frame, .loading-panel { min-height: 100%; padding: clamp(24px, 4vw, 52px); border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.loading-frame p, .loading-panel p { margin: 24px 0 0; color: var(--muted); font-size: 13px; }
.loading-phase { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--muted); }
.loading-phase strong { font-size: 13px; }
.content-skeleton { display: grid; max-width: 960px; gap: 18px; }
.content-skeleton span { display: block; height: 22px; border-radius: 8px; background: linear-gradient(90deg, #edeef1 25%, #f7f7f8 50%, #edeef1 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s ease-in-out infinite; }
.content-skeleton span:first-child { width: 34%; height: 34px; }
.content-skeleton span:nth-child(2) { width: 72%; }
.content-skeleton span:nth-child(3) { height: 180px; }
.content-skeleton span:nth-child(4) { width: 58%; }
@keyframes skeleton-loading { to { background-position: -200% 0; } }
.mail-loading-view { display: grid; align-content: safe center; gap: 18px; padding: 28px; }
.mail-loading-view > p { margin: 0; color: var(--muted); text-align: center; }
.mail-loading-shell { display: grid; overflow: hidden; grid-template-columns: minmax(180px, 26%) minmax(0, 1fr); width: min(1080px, 100%); min-height: 520px; margin: 0 auto; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 22px 60px rgb(25 26 28 / 8%); }
.mail-loading-shell aside { display: grid; align-content: start; gap: 16px; padding: 26px 20px; border-right: 1px solid var(--line); background: #f6f7f8; }
.mail-loading-shell aside span, .mail-loading-shell header span, .mail-loading-shell main i { display: block; border-radius: 8px; background: linear-gradient(90deg, #e9eaed 25%, #f7f7f8 50%, #e9eaed 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s ease-in-out infinite; }
.mail-loading-shell aside span { width: 78%; height: 18px; }
.mail-loading-shell aside span:first-child { width: 100%; height: 42px; }
.mail-loading-shell > div { min-width: 0; }
.mail-loading-shell header { display: flex; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.mail-loading-shell header span { width: 110px; height: 34px; }
.mail-loading-shell header span:first-child { width: 44px; }
.mail-loading-shell main { display: grid; gap: 18px; padding: 28px 24px; }
.mail-loading-shell main i { width: 88%; height: 68px; }
.mail-loading-shell main i:nth-child(2) { width: 72%; }
.mail-loading-shell main i:nth-child(3) { width: 94%; }
.auth-shell-view { padding: 28px; background: #f1f2f3; }
.auth-shell-card { width: min(880px, 100%); min-height: 100%; margin: 0 auto; padding: clamp(28px, 5vw, 64px); border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.auth-shell-card h2 { margin: 18px 0 0; font: 690 clamp(28px, 4vw, 44px)/1.05 var(--display); letter-spacing: -.04em; }
.auth-shell-card > p { max-width: 620px; margin: 12px 0 32px; color: var(--muted); font-size: 14px; }

@media (max-width: 920px) {
  .status-pill { display: none; }
  .status-pill.navigation-status:not([hidden]) { display: inline-flex; }
  .settings-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .settings-row > button, .artifact-update-actions { justify-self: start; }
  .artifact-update-header > button { min-width: 0; }
  .artifact-update-actions { min-width: 0; justify-items: start; }
  .runtime-log-summary { grid-template-columns: 1fr; }
  .runtime-log-actions { align-items: stretch; flex-direction: column; }
  .runtime-log-actions button { align-self: flex-start; }
  .connector-entry-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: var(--titlebar) minmax(0, 1fr) 66px; }
  .workspace { grid-column: 1; grid-row: 1 / span 2; }
  .command-rail { grid-row: 3; flex-direction: row; padding: 6px 8px; overflow: hidden; box-shadow: inset 0 1px #dedfe1; }
  .window-title { display: none; }
  .connection-control { width: 190px; margin-left: auto; }
  .brand, .rail-spacer { display: none; }
  .rail-nav { display: flex; min-width: 0; flex: 1; gap: 2px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-button { min-width: 56px; min-height: 53px; flex: 0 0 56px; }
  .account-entry { width: 56px; min-width: 56px; min-height: 53px; flex: 0 0 56px; gap: 3px; padding: 5px 2px; border: 0; border-radius: 14px; color: var(--muted); background: transparent; font-size: 10px; }
  .account-entry i { display: none; }
  .account-entry .avatar { width: 24px; height: 24px; font-size: 9px; }
  .update-entry { width: 56px; min-width: 56px; min-height: 53px; flex: 0 0 56px; margin: 0; border: 0; border-radius: 14px; }
  .page-identity { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; clip-path: inset(50%); white-space: nowrap; }
  .scope-summary { max-width: 100%; }
  body[data-acceptance-label="true"] .scope-summary { display: none; }
  .acceptance-badge { max-width: calc(100vw - 116px); }
  .update-popover { right: 12px; bottom: 12px; left: 12px; width: auto; }
  .mail-loading-view { padding: 14px 12px 78px; }
  .mail-loading-shell { grid-template-columns: 92px minmax(0, 1fr); min-height: 430px; }
  .mail-loading-shell aside { padding-inline: 12px; }
  .settings-shell { grid-template-columns: 1fr; grid-template-rows: 64px minmax(0, 1fr); }
  .settings-nav { display: block; overflow: hidden; padding: 12px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav__back, .settings-nav__search { display: none; }
  .settings-nav__scroll { display: flex; gap: 5px; overflow-x: auto; padding: 0; scrollbar-color: #aeb0b5 transparent; scrollbar-width: thin; }
  .settings-nav__scroll::-webkit-scrollbar { height: 4px; }
  .settings-nav__scroll::-webkit-scrollbar-thumb { border-radius: 999px; background: #aeb0b5; }
  .settings-nav__group { display: flex; flex: 0 0 auto; }
  .settings-nav__group + .settings-nav__group { margin-top: 0; }
  .settings-nav__group--diagnostics { padding-bottom: 0; }
  .settings-nav__group h2 { display: none; }
  .settings-nav__group button { width: auto; flex: 0 0 auto; padding: 0 12px; }
  .settings-nav__group button.active::before { display: none; }
  .settings-nav__empty { display: none; }
  .settings-content { padding: 20px 13px 78px; }
  body[data-settings="cloud-connectors"] .settings-content { padding: 0; }
  .connector-entry-card__actions { align-items: stretch; flex-direction: column; }
  .connector-entry-card__actions > button { margin-left: 0; }
}

@media (max-height: 600px) {
  .mail-loading-view { gap: 10px; padding: 12px; }
  .mail-loading-shell { min-height: 240px; }
  .mail-loading-shell aside { gap: 10px; padding-block: 14px; }
  .mail-loading-shell header { padding-block: 12px; }
  .mail-loading-shell main { gap: 10px; padding-block: 12px; }
  .mail-loading-shell main i { height: clamp(24px, 6vh, 48px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Homepage: product introduction beside the trusted CRM authentication surface. */
.home-view { height: 100%; overflow-y: auto; background: #f6f9ff; }
.employee-welcome { display: grid; grid-template-columns: 52% 48%; min-height: 100%; }
.employee-story { display: flex; flex-direction: column; justify-content: space-between; gap: 36px; padding: 40px clamp(32px, 4.5vw, 80px); background: transparent; }
.employee-story__intro { padding: 24px 0; }
.employee-story h1 { margin: 0; font: 650 clamp(36px, 4vw, 56px)/1.25 var(--display); letter-spacing: -.035em; }
.employee-story__intro > p { max-width: 440px; margin: 24px 0 36px; color: var(--muted); font-size: 16px; line-height: 1.9; }
.employee-journey { display: grid; gap: 24px; list-style: none; padding: 0; margin: 0; }
.employee-journey li { display: flex; align-items: flex-start; gap: 16px; }
.employee-journey li > span { display: grid; flex: 0 0 32px; height: 32px; place-items: center; color: var(--action); border-radius: 50%; background: var(--action-soft); font-weight: 650; }
.employee-journey strong { font-size: 15px; }
.employee-journey p { margin: 5px 0 0; color: var(--muted); line-height: 1.65; }
.employee-story__foot { margin: 0; color: var(--muted); font-size: 12px; }
.employee-login-placeholder, .employee-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 40px; text-align: center; gap: 16px; }
.employee-login-placeholder h2, .employee-loading h1 { margin: 0; }
.employee-login-placeholder p, .employee-loading p { color: var(--muted); }
.employee-loading { min-height: 100%; }
.desktop-login-layout { width: min(100%, 442px); }
.desktop-login-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.desktop-login-brand img { display: block; width: 72px; height: 72px; border-radius: 20px; box-shadow: 0 14px 30px rgb(32 81 153 / 8%), 0 4px 16px rgb(229 63 76 / 7%); object-fit: cover; }
.desktop-login-brand h2 { margin: 18px 0 0; color: #16223a; font: 760 34px/1 var(--display); letter-spacing: -.045em; }
.desktop-login-brand h2 span { color: #165bd6; }
.desktop-login-brand p { margin: 12px 0 0; color: #8592a8; font-size: 14px; }
.desktop-login-form { display: grid; width: 100%; gap: 0; overflow: hidden; border: 1px solid rgb(160 183 214 / 31%); border-radius: 18px; background: rgb(255 255 255 / 88%); box-shadow: 0 24px 60px rgb(47 89 151 / 8%), 0 4px 18px rgb(46 88 150 / 4%); text-align: left; backdrop-filter: blur(16px); }
.desktop-login-form[data-auth-mode="iam"] { padding-top: 24px; }
.desktop-login-form[data-auth-mode="iam"] > [data-login-agreement] { justify-self: end; margin: 0 32px 12px; padding: 0; color: #426a9d; font: inherit; font-size: 13px; border: 0; background: transparent; cursor: pointer; }
.desktop-login-form[data-auth-mode="iam"] > [data-login-agreement]:focus-visible { outline: 2px solid #256be5; outline-offset: 4px; }

.login-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 22px 32px 0; padding: 4px; border: 1px solid rgb(153 177 210 / 22%); border-radius: 10px; background: #f1f5fa; }
.login-mode-tabs button { min-height: 38px; border: 0; border-radius: 7px; color: #77849a; background: transparent; font-size: 13px; font-weight: 620; }
.login-mode-tabs button:hover, .login-mode-tabs button:focus-visible { color: #165bd6; }
.login-mode-tabs button[aria-selected="true"] { color: #165bd6; background: #fff; box-shadow: 0 2px 8px rgb(47 89 151 / 9%); }
.login-panel { display: grid; min-height: 274px; gap: 22px; padding: 26px 32px 18px; }
#login-panel-sms { min-height: 0; padding-bottom: 24px; }
.desktop-login-field { display: grid; gap: 8px; color: #53627a; font-size: 12px; font-weight: 610; }
.account-picker > input, .mobile-code-row, .password-input, .login-input-shell { width: 100%; min-height: 57px; border: 1px solid rgb(153 177 210 / 37%); border-radius: 11px; color: #27364f; background: rgb(250 252 255 / 80%); outline: none; }
.account-picker > input, .mobile-code-row input, .password-input input, .login-input-shell input { font-size: 17px; line-height: 1.5; }
.desktop-login-field input::placeholder { color: #a5afbf; font-size: inherit; }
.account-picker > input:hover, .mobile-code-row:hover, .password-input:hover, .login-input-shell:hover { border-color: rgb(153 177 210 / 62%); }
.account-picker > input:focus, .mobile-code-row:focus-within, .password-input:focus-within, .login-input-shell:focus-within { border-color: rgb(44 109 221 / 60%); background: #fff; box-shadow: 0 0 0 3px rgb(35 103 221 / 8%); }
.desktop-login-field input:disabled { cursor: wait; color: var(--faint); background: #f1f2f4; }
.login-field-icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: #91a0b7; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.login-input-shell { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 12px; padding: 0 16px; }
.login-input-shell input { min-width: 0; height: 55px; padding: 0; border: 0; outline: 0; color: #27364f; background: transparent; }
.password-input { display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px; align-items: center; gap: 12px; padding: 0 10px 0 16px; }
.password-input:has(input:disabled) { background: #f1f2f4; }
.password-input input { min-width: 0; min-height: 55px; padding: 0; border: 0; outline: none; color: #27364f; background: transparent; }
.password-visibility { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.password-visibility:hover { color: var(--ink); background: var(--surface-2); }
.password-visibility:disabled { cursor: wait; opacity: .55; }
.password-visibility svg { width: 20px; height: 20px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.password-visibility__hide { display: none; }
.password-visibility[aria-pressed="true"] .password-visibility__show { display: none; }
.password-visibility[aria-pressed="true"] .password-visibility__hide { display: block; }
.mobile-code-row { display: grid; grid-template-columns: 20px auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 12px 0 16px; }
.mobile-prefix { padding-right: 11px; border-right: 1px solid rgb(153 177 210 / 32%); color: #5f6e84; font-size: 13px; font-weight: 620; }
.mobile-code-row input { min-width: 0; min-height: 55px; padding: 0; border: 0; outline: none; color: #27364f; background: transparent; }
.send-code-button { min-width: 82px; min-height: 34px; padding: 0 4px; border: 0; border-radius: 7px; color: #165bd6; background: transparent; font-size: 12px; font-weight: 650; }
.send-code-button:hover { background: rgb(28 96 213 / 7%); }
.send-code-button:disabled { cursor: wait; color: var(--faint); }
.dropdown-chevron { display: block; width: 22px; height: 22px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.account-picker { position: relative; display: block; }
.account-picker > input { padding: 0 46px 0 48px; }
.account-picker__icon { position: absolute; z-index: 1; top: 18px; left: 16px; }
.account-picker__toggle { position: absolute; top: 50%; right: 9px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; transform: translateY(-50%); }
.account-picker__toggle:hover { color: var(--ink); background: var(--surface-2); }
.account-history { position: absolute; z-index: 12; top: calc(100% + 7px); right: 0; left: 0; display: grid; max-height: 224px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 38px rgba(20, 31, 50, .16); }
.account-history__empty { padding: 16px 12px; color: var(--faint); text-align: center; font-size: 12px; font-weight: 500; }
.account-history__list { display: grid; }
.account-history__item { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; border-radius: 8px; }
.account-history__item:hover { background: var(--surface-2); }
.account-history__select, .account-history__delete { min-height: 38px; border: 0; color: var(--ink); background: transparent; }
.account-history__select { overflow: hidden; padding: 0 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.account-history__delete { display: grid; place-items: center; border-radius: 7px; color: var(--faint); font-size: 18px; }
.account-history__delete:hover { color: var(--risk); background: #fff0f2; }
.remember-login { display: flex; align-items: center; gap: 8px; color: #758198; font-size: 12px; cursor: pointer; }
.remember-login input, .login-agreement > input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.login-checkmark { position: relative; width: 16px; height: 16px; flex: 0 0 auto; border: 1px solid rgb(146 168 198 / 47%); border-radius: 5px; background: rgb(255 255 255 / 82%); }
.remember-login input:focus-visible + .login-checkmark, .login-agreement > input:focus-visible + .login-checkmark { box-shadow: 0 0 0 3px rgb(35 103 221 / 10%); }
.remember-login input:checked + .login-checkmark, .login-agreement > input:checked + .login-checkmark { border-color: #165bd6; background: #165bd6; }
.remember-login input:checked + .login-checkmark::after, .login-agreement > input:checked + .login-checkmark::after { position: absolute; top: 2px; left: 5px; width: 4px; height: 7px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); content: ""; }
.password-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.password-options > button { padding: 0; border: 0; color: #165bd6; background: transparent; font-size: 12px; font-weight: 600; }
.password-options > button:hover { color: #0d4dbf; text-decoration: underline; text-underline-offset: 3px; }
.login-agreement { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: start; gap: 8px; margin: 0 32px; padding: 0; border: 1px solid transparent; border-radius: 6px; color: #828b98; font-size: 12px; font-weight: 500; line-height: 1.8; cursor: pointer; }
.login-agreement > .login-checkmark { margin-top: 3px; border-radius: 50%; }
.login-agreement[data-invalid="true"] { padding: 6px 8px; border-color: #e05260; background: #fff7f8; }
.login-agreement button { padding: 0; border: 0; color: #4c596c; background: transparent; font: inherit; font-weight: 600; }
.login-agreement button:hover { color: #165bd6; text-decoration: underline; }
.desktop-login-submit { width: calc(100% - 64px); min-height: 56px; margin: 20px 32px 24px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(101deg, #256be5, #0d53cf); box-shadow: 0 12px 24px rgb(24 91 209 / 18%); font-size: 15px; font-weight: 670; }
.desktop-login-submit:hover { box-shadow: 0 15px 28px rgb(24 91 209 / 24%); filter: saturate(1.05); transform: translateY(-1px); }
.desktop-login-iam { display: grid; gap: 9px; margin: 0 32px 24px; padding-top: 16px; border-top: 1px solid rgb(153 177 210 / 24%); text-align: center; }
.desktop-login-iam button { min-height: 48px; border: 1px solid rgb(37 107 229 / 30%); border-radius: 10px; color: #165bd6; background: #f6f9ff; font-size: 14px; font-weight: 650; }
.desktop-login-iam button:hover, .desktop-login-iam button:focus-visible { border-color: #256be5; background: #edf4ff; }
.desktop-login-iam button:disabled { cursor: wait; opacity: .6; }
.desktop-login-iam p { margin: 0; color: #64748b; font-size: 12px; line-height: 1.5; }
.desktop-login-iam p[data-kind="error"] { color: #b83b4b; }
.desktop-login-submit:active { transform: translateY(0); }
.desktop-login-submit:disabled { cursor: wait; opacity: .68; }
.desktop-login-form > .login-error { margin: -10px 32px 24px; }
.captcha-dialog { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(14, 25, 42, .48); backdrop-filter: blur(3px); }
.captcha-card { display: grid; width: min(100%, 376px); gap: 16px; padding: 22px; border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(13, 28, 52, .25); text-align: left; }
.captcha-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.captcha-heading h3, .captcha-heading p { margin: 0; }
.captcha-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.captcha-heading button { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-2); font-size: 20px; }
.captcha-word-prompt { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.captcha-word-prompt img { display: block; width: 143px; max-width: 100%; height: auto; }
.captcha-stage { position: relative; width: 320px; max-width: 100%; overflow: hidden; border-radius: 10px; background: #edf2f8; }
.captcha-stage img:first-child { display: block; width: 100%; height: auto; user-select: none; }
.captcha-stage > #login-captcha-template { position: absolute; top: 0; left: 0; width: auto; height: auto; pointer-events: none; user-select: none; }
.captcha-stage[data-mode="word"] { cursor: crosshair; }
.captcha-stage:focus-visible { outline: 3px solid rgba(38, 97, 187, .28); outline-offset: 3px; }
.captcha-word-markers { position: absolute; inset: 0; pointer-events: none; }
.captcha-word-marker { position: absolute; display: grid; width: 28px; height: 28px; place-items: center; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; color: #fff; background: rgba(38, 97, 187, .92); box-shadow: 0 3px 10px rgba(13, 28, 52, .28); font-size: 12px; font-weight: 750; }
.captcha-slider { position: relative; display: grid; height: 42px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #f4f7fb; font-size: 12px; }
.captcha-slider > span:first-child { position: absolute; z-index: 2; top: 0; left: 0; display: grid; width: 42px; height: 40px; place-items: center; border-radius: 8px; color: #fff; background: var(--action); cursor: grab; font-size: 17px; touch-action: none; }
.captcha-slider > span:first-child:active { cursor: grabbing; }
.captcha-word-actions { display: flex; justify-content: space-between; gap: 12px; }
.captcha-word-actions button { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 650; }
.captcha-word-actions button:last-child { margin-left: auto; border-color: var(--action); color: #fff; background: var(--action); }
.captcha-word-actions button:disabled { cursor: default; opacity: .45; }
.captcha-status { min-height: 18px; margin: -6px 0 0; color: var(--muted); font-size: 12px; }
.captcha-status[data-error="true"] { color: var(--risk); }
.captcha-refresh { justify-self: end; padding: 0; border: 0; color: var(--action); background: transparent; font-size: 12px; }

body[data-module="home"]:has(#home-welcome:not([hidden])) .command-rail { background: #f6f9ff; }
.employee-story h1 { color: #1c2c49; }
.employee-story .home-wordmark { color: #2861bb; }
.employee-story .home-wordmark small { color: #62728b; }

/* Keep the existing login form legible at the desktop's minimum window width. */
@media (max-width: 1160px) {
  .employee-welcome { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .employee-story { display: none; }
  .employee-login-placeholder { justify-content: flex-start; }
}

.rail-button { position: relative; }
.notification-dot { position: absolute; z-index: 2; top: 4px; right: 4px; display: grid; min-width: 18px; height: 18px; place-items: center; padding: 0 5px; border: 2px solid #f2f2f3; border-radius: 999px; color: #fff; background: var(--brand); font: 750 10px/1 var(--body); font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgb(27 34 42 / 18%); }
.notification-dot[hidden] { display: none; }
.brand .notification-dot { top: -5px; right: -5px; }
.notification-badge-menu { position: fixed; z-index: 80; min-width: 136px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgb(25 30 38 / 18%); }
.notification-badge-menu[hidden] { display: none; }
.notification-badge-menu button { width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.notification-badge-menu button:hover, .notification-badge-menu button:focus-visible { outline: 0; background: var(--surface-2); }
/* Notification preferences use the same full-width settings groups as every other page. */
.notification-settings > .notification-hint { margin: -16px 0 28px; }
.settings-switch { position: relative; display: inline-grid; width: 38px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.settings-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.settings-switch > span { position: relative; border-radius: 999px; background: var(--line-strong); transition: background 140ms ease; }
.settings-switch > span::after { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(25 30 38 / 24%); content: ''; transition: transform 140ms ease; }
.settings-switch input:checked + span { background: var(--action); }
.settings-switch input:checked + span::after { transform: translateX(16px); }
.settings-switch input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 3px; }
.settings-switch:has(input:disabled) { cursor: default; opacity: .45; }
.settings-switch input:disabled { cursor: default; }
.general-setting-copy { display: grid; min-width: 0; gap: 5px; }
.general-setting-copy strong { color: var(--ink); font: 500 15px/20px var(--body); }
.general-setting-copy small { max-width: 760px; color: var(--muted); font: 400 14px/20px var(--body); }
.general-setting-control { width: auto; min-width: 148px; margin-top: 0; text-align: right; }
.settings-dropdown { position: relative; width: max-content; min-width: 208px; max-width: 100%; justify-self: end; }
.settings-dropdown-trigger { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: space-between; gap: 18px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font: 500 14px/20px var(--body); cursor: pointer; }
.settings-dropdown-trigger:hover, .settings-dropdown[data-open] .settings-dropdown-trigger { border-color: var(--line); background: var(--surface-2); }
.settings-dropdown-trigger:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.settings-dropdown-trigger svg { flex: 0 0 auto; transition: transform 140ms ease; }
.settings-dropdown[data-open] .settings-dropdown-trigger svg { transform: rotate(180deg); }
.settings-dropdown-menu { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; display: grid; box-sizing: border-box; width: 100%; min-width: 100%; max-height: min(360px, calc(100vh - 120px)); overflow-y: auto; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px rgb(25 30 38 / 18%); text-align: left; }
.settings-dropdown-menu[hidden] { display: none; }
.settings-dropdown-option { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 12px; border: 0; border-radius: 11px; color: var(--ink); background: transparent; font: 500 14px/20px var(--body); text-align: left; cursor: pointer; }
.settings-dropdown-option::after { content: '✓'; color: var(--action); font-weight: 750; opacity: 0; }
.settings-dropdown-option[aria-selected="true"]::after { opacity: 1; }
.settings-dropdown-option:hover { background: var(--surface-2); }
.settings-dropdown-option[aria-selected="true"] { background: var(--surface-3); }
.settings-dropdown-option:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
.general-setting-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-weight: 620; }
.general-setting-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.general-setting-button:not(:disabled):hover { border-color: var(--line-strong); background: var(--surface-2); }
.general-setting-button:disabled { cursor: wait; opacity: .58; }
.general-setting-value { min-width: 148px; color: var(--ink); font-size: 14px; text-align: right; }
.notification-dependent-row { padding-left: 34px; }
.notification-source-status:empty { display: none; }
.notification-hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.notification-setting-controls { display: flex; align-items: center; gap: 14px; }
.notification-sound-preview { display: flex; min-height: 38px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 500 14px/20px var(--body); cursor: pointer; }
.notification-sound-preview svg { color: var(--action); }
.notification-sound-preview:hover { background: var(--surface-2); }
.notification-sound-preview:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.notification-sound-preview:disabled { opacity: .5; cursor: default; }
.notification-pause-row button { flex-shrink: 0; }

html[data-color-scheme="dark"] {
  color-scheme: dark;
  --ink: #f1f3f5;
  --ink-2: #dfe3e8;
  --muted: #aeb4bd;
  --faint: #9299a3;
  --canvas: #181a1e;
  --page: #15171a;
  --surface: #23262b;
  --surface-2: #1e2125;
  --surface-3: #2d3137;
  --line: #373c44;
  --line-strong: #505761;
  --action: #7ca5ff;
  --action-soft: #202d49;
  --success: #66d2aa;
  --success-soft: #19362d;
  --warning: #f3bd6d;
  --warning-soft: #3a2d1b;
  --risk: #ff9aaa;
  --risk-soft: #43252b;
}
html[data-color-scheme="dark"] .command-rail,
html[data-color-scheme="dark"] .topbar,
html[data-color-scheme="dark"] .settings-nav { background: var(--page); box-shadow: inset -1px 0 var(--line); }
html[data-color-scheme="dark"] .topbar { box-shadow: inset 0 -1px var(--line); }
html[data-color-scheme="dark"] .scope-summary,
html[data-color-scheme="dark"] .outline-button,
html[data-color-scheme="dark"] .connector-entry-card,
html[data-color-scheme="dark"] .settings-group,
html[data-color-scheme="dark"] .captcha-word-actions button { background: var(--surface); }
html[data-color-scheme="dark"] .settings-nav button:hover,
html[data-color-scheme="dark"] .outline-button:not(:disabled):hover { background: var(--surface-3); }
html[data-color-scheme="dark"] .settings-nav button.active { background: #343941; }
html[data-color-scheme="dark"] .rail-button.active .rail-glyph-detail,
html[data-color-scheme="dark"] .account-entry.active .rail-glyph-detail,
html[data-color-scheme="dark"] .rail-button.active .rail-glyph-hole,
html[data-color-scheme="dark"] .account-entry.active .rail-glyph-hole { fill: var(--page); stroke: var(--page); }

@media (max-width: 760px) {
  .general-setting-row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px 0; }
  .general-setting-control, .general-setting-value { width: 100%; text-align: left; }
  .settings-dropdown { justify-self: stretch; }
  .settings-dropdown-trigger { width: 100%; justify-content: space-between; }
  .settings-dropdown-menu { right: auto; left: 0; width: 100%; }
  .general-setting-button { justify-self: start; }
}

/* Legal reading stays on the shared settings track; original terms wrap without horizontal scrolling. */
.legal-search { margin: 0 0 44px; }
.legal-search input { width: 100%; }
.legal-row { border: 0; width: 100%; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.legal-row:hover { background: var(--surface-2); }
.legal-row:focus-visible { outline: 2px solid var(--action); outline-offset: -3px; }
.legal-row .settings-row__copy { min-width: 0; overflow-wrap: anywhere; }
.legal-row__action { max-width: 350px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.legal-row .settings-code { white-space: normal; overflow-wrap: anywhere; text-align: right; }
.legal-text { margin: 0; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 14px/20px var(--mono); color: var(--ink); }
