:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171b22;
  background: #f4f6f8;
  font-synthesis: none;
  --canvas: #f4f6f8;
  --panel: #ffffff;
  --ink: #171b22;
  --muted: #4f5966;
  --green: #13795f;
  --lime: #c8ff4d;
  --line: #e8ebef;
  --danger: #c94a40;
  --warning: #9a6700;
  --info: #2f5f98;
  --success: #13795f;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --control-height: 44px;
  --rail-expanded-width: 248px;
  --rail-width: var(--rail-expanded-width);
  --shadow: 0 24px 70px rgb(34 43 56 / 8%);
}

/* Stage17: private messaging and customer-card communications. */
.s17-page{display:grid;gap:20px;max-width:1180px;margin:0 auto;padding:24px}.s17-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.s17-heading h1{margin:4px 0;font-size:clamp(1.75rem,3vw,2.5rem)}.s17-lead{max-width:68ch;color:var(--text-secondary,#53616d);margin:6px 0}.s17-chat-layout{display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);min-height:560px;border:1px solid #d8e1e8;border-radius:18px;overflow:hidden;background:#fff}.s17-dialog-list{display:flex;flex-direction:column;gap:8px;padding:14px;background:#f4f7f5;border-right:1px solid #d8e1e8}.s17-dialog-button{display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%;padding:13px;border:1px solid transparent;border-radius:12px;background:transparent;text-align:left;font:inherit;color:inherit}.s17-dialog-button:hover,.s17-dialog-button:focus-visible{background:#fff;border-color:#91a89b}.s17-unread{min-width:24px;padding:2px 7px;border-radius:999px;background:#1f6c45;color:#fff;text-align:center;font-size:.8rem}.s17-thread{display:flex;flex-direction:column;min-width:0}.s17-thread-heading{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #e3e9ed}.s17-thread-heading h2{margin:0}.s17-connection{color:#276749;font-size:.88rem}.s17-stream{display:flex;flex:1;flex-direction:column;gap:12px;overflow:auto;padding:20px;background:#fbfcfb}.s17-message{max-width:78%;padding:12px 14px;border-radius:14px 14px 14px 4px;background:#fff;border:1px solid #dce5e0}.s17-message.is-own{align-self:flex-end;border-radius:14px 14px 4px 14px;background:#e9f5ee;border-color:#b9dac7}.s17-message-meta{font-size:.78rem;color:#67766e}.s17-tombstone{font-style:italic;color:#68756f}.s17-inline-actions{display:flex;gap:8px;flex-wrap:wrap}.s17-compose{display:grid;grid-template-columns:1fr auto;gap:12px;padding:16px 20px;border-top:1px solid #e3e9ed}.s17-compose textarea,.s17-admin-form input,.s17-admin-form textarea{width:100%;padding:11px;border:1px solid #9fada6;border-radius:10px;font:inherit}.s17-state{margin:8px 0;color:#5b6761}.s17-admin-form{display:grid;grid-template-columns:1fr 1.5fr auto;align-items:end;gap:14px;padding:18px;border:1px solid #d8e1e8;border-radius:16px;background:#fff}.s17-admin-form label{display:grid;gap:6px;font-weight:600}.s17-admin-result{display:grid;gap:12px}.s17-audit{padding:10px 12px;border-left:4px solid #1f6c45;background:#edf7f1}.s17-view-switch{display:flex;gap:8px;flex-wrap:wrap}.s17-customer-cards,.s17-attention{display:grid;gap:18px}.s17-customer-card{padding:20px;border:1px solid #d8e1e8;border-radius:18px;background:#fff}.s17-customer-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.s17-customer-title h2{margin:4px 0}.s17-source{padding:5px 9px;border-radius:999px;background:#eef3f0;color:#526159;font-size:.82rem}.s17-customer-dialog{display:grid;gap:10px;margin-top:18px}.s17-customer-message{padding:14px;border-left:4px solid #70a586;background:#f7faf8;border-radius:4px 12px 12px 4px}.s17-customer-message.is-targeted{outline:3px solid #ca8a04;outline-offset:3px}.s17-message-flags{display:flex;gap:6px}.s17-badge{padding:3px 7px;border-radius:999px;background:#dcefe4;color:#165b38;font-size:.78rem}.s17-badge.is-warning{background:#fff0cf;color:#7b4d00}.s17-evidence{display:flex;gap:18px;flex-wrap:wrap}.s17-evidence div{display:grid;gap:2px}.s17-evidence dt{font-size:.74rem;color:#68756f}.s17-evidence dd{margin:0;font-weight:600}.s17-attention-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px;border:1px solid #d8e1e8;border-radius:14px;background:#fff}
@media(max-width:720px){.s17-page{padding:16px}.s17-heading,.s17-customer-title,.s17-attention-row{align-items:stretch;flex-direction:column}.s17-chat-layout{grid-template-columns:1fr;min-height:0}.s17-dialog-list{border-right:0;border-bottom:1px solid #d8e1e8}.s17-stream{max-height:52vh}.s17-message{max-width:92%}.s17-compose{grid-template-columns:1fr}.s17-admin-form{grid-template-columns:1fr}.s17-source{align-self:flex-start}}
@media(prefers-reduced-motion:reduce){.s17-page *{scroll-behavior:auto!important;transition:none!important}}

/* Stage15 role workbench: uses the existing shell and design-token lifecycle. */
.s15-workbench{max-width:1180px;margin:0 auto;padding:28px;display:grid;gap:20px;color:var(--ink,#17202a)}
.s15-header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:24px;align-items:flex-start}.s15-header>div:first-child{flex:999 1 28rem;min-width:min(100%,18rem)}.s15-header h1{margin:4px 0 8px;font-size:clamp(1.65rem,3vw,2.35rem);line-height:1.12}.eyebrow{margin:0;color:#526174;font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em}
.s15-truth{flex:1 1 14rem;min-width:min(100%,230px);max-width:100%;padding:14px 16px;border:1px solid #c9d3df;border-radius:14px;background:#fff;display:grid;gap:7px}.s15-truth.ready{border-left:5px solid #287a4b}.s15-truth.unsafe{border-left:5px solid #9b3a2d}
.s15-badge{display:inline-flex;align-items:center;width:max-content;min-height:28px;padding:3px 9px;border-radius:999px;background:#eef2f6;font-size:.78rem;font-weight:700}.s15-badge.high{background:#fff0d5;color:#6c3e00}.s15-badge.ready{background:#e6f5eb;color:#175b35}.s15-badge.unsafe{background:#fde8e5;color:#812b21}
.s15-queue,.s15-panel{background:#fff;border:1px solid #d7dee7;border-radius:18px;padding:20px;box-shadow:0 8px 28px rgba(32,47,61,.06)}.s15-section-title,.s15-attention-head{display:flex;justify-content:space-between;gap:12px;align-items:center}.s15-section-title h2{margin:0}.s15-attention{margin-top:16px;border:1px solid #d7dee7;border-radius:14px;padding:18px;background:#fbfcfd}.s15-attention h2{font-size:1.2rem;margin:14px 0 6px}.s15-reason{margin:0 0 14px;color:#465568}.s15-actions{display:flex;gap:10px;flex-wrap:wrap}.s15-warning{padding:11px 13px;border-radius:10px;background:#fff2ef;color:#74251c;border:1px solid #f0b7af}.s15-feedback{min-height:1.4em;color:#23603d;font-weight:600}.s15-dialog{max-width:520px;border:0;border-radius:16px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.28)}.s15-dialog::backdrop{background:rgba(14,24,34,.58)}.s15-evidence{display:grid;grid-template-columns:max-content 1fr;gap:9px 14px}.s15-evidence dt{font-weight:700}.s15-evidence dd{margin:0;color:#465568}.s15-metrics{list-style:none;padding:0;margin:12px 0 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}.s15-metrics li{padding:14px;border-radius:12px;background:#f3f6f8;display:grid;gap:5px}.s15-metrics span,.s15-metrics small{color:#526174}.s15-private{border-style:dashed}
.s15-workbench :focus-visible{outline:3px solid #146ec8;outline-offset:3px}@media(max-width:620px){.s15-workbench{padding:16px}.s15-header{display:grid}.s15-truth{min-width:0}.s15-section-title,.s15-attention-head{align-items:flex-start;flex-direction:column}.s15-evidence{grid-template-columns:1fr}.s15-actions .button{width:100%;min-height:44px}}
@media(forced-colors:active){.s15-queue,.s15-panel,.s15-attention,.s15-truth{border:1px solid CanvasText}.s15-badge{border:1px solid CanvasText}}
@media(prefers-reduced-motion:reduce){.s15-workbench *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
.s15-result{margin-top:12px;padding:12px;border-radius:10px;background:#f3f6f8;overflow-wrap:anywhere;min-height:44px}.s15-metric{padding:14px;border-radius:12px;background:#f3f6f8;display:grid;gap:8px}.s15-metric h3,.s15-metric p{margin:0}.s15-feedback{overflow-wrap:anywhere}@media(max-width:640px){.s15-workbench{padding:12px;gap:12px}.s15-truth{width:auto}.s15-queue,.s15-panel{padding:14px;border-radius:12px}.s15-dialog{max-width:calc(100vw - 24px);padding:18px}}@media(forced-colors:active){.s15-metric{border:1px solid CanvasText}.s15-warning{border:2px solid LinkText}}

* { box-sizing: border-box; }

html, body, #app { min-height: 100%; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

main, section, article, header, nav, p, h1, h2, h3, label, small { min-width: 0; overflow-wrap: anywhere; }

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid #13795f;
  outline-offset: 1px;
}

/* Route headings receive focus for screen-reader announcements, not interaction. */
[data-page-heading]:focus {
  outline: none;
}

.app-root, .app-shell { min-height: 100vh; }
.app-shell-bootstrap { pointer-events: none; }
.app-shell-bootstrap .rail { box-shadow: none; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 18% 15%, rgb(200 255 77 / 24%), transparent 32%),
    var(--canvas);
}

.login-panel {
  width: min(100%, 430px);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 24px 64px rgb(20 32 51 / 10%);
}

.login-form { display: grid; gap: 12px; }
.login-heading { margin-bottom: 20px; }
.login-heading h1, .page-header h1 { margin: 8px 0; letter-spacing: -0.035em; }
.login-heading h1 { font-size: 34px; }
.login-heading p, .page-header p { color: var(--muted); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -0.08em;
}
.brand-mark-outline {
  border: 2px solid var(--lime);
  background: var(--lime);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: -0.035em;
}

.eyebrow {
  margin: 0;
  color: var(--green) !important;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-label { margin-top: 4px; font-size: 14px; font-weight: 650; }
.field-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #cdd4df;
  border-radius: 11px;
  color: var(--ink);
  background: white;
}
.field-input:focus { border-color: var(--green); }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}
.button:disabled { cursor: wait; opacity: .62; }
.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: #2b3038; }
.button-secondary { border-color: var(--line); background: white; color: var(--ink); }
.button-danger { background: var(--danger); color: white; }
.button-quiet-danger { border-color: #f3c7c2; background: white; color: var(--danger); }
.login-submit { margin-top: 8px; }
.login-error { min-height: 20px; margin: 0; color: var(--danger); font-size: 14px; }
.logout-feedback { margin: 0; padding: 12px 14px; border: 1px solid #ffb4ac; border-radius: 12px; color: #ffe1dd; background: rgb(201 74 64 / 20%); font-size: 14px; font-weight: 700; line-height: 1.45; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); gap: 24px; padding: 20px; }
.rail {
  position: sticky;
  z-index: 10;
  top: 20px;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: calc(100vh - 40px);
  padding: 16px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: box-shadow 180ms ease;
}

/* Per-user full-width navigation mode. The same rail is either standard or overlay. */
.overlay-menu-controls,
.overlay-menu-backdrop { display: none; }
.app-shell.is-overlay-menu-route {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 16px;
}
.is-overlay-menu-route .workspace { width: 100%; min-width: 0; }
.is-overlay-menu-route .route-slot { padding-top: 68px; }
.is-overlay-menu-route .route-slot[data-module-key="planning"] { padding-top: 0; }
.is-overlay-menu-route .route-slot[data-module-key="planning"] .planning-topbar { padding-left: 76px; }
.is-overlay-menu-route .route-slot[data-module-key="sales_workbench"] {
  padding-top: 0;
}
.app-shell.is-overlay-menu-route[data-route-module="sales_workbench"] [data-module-root="sales_workbench"] .sales-shell-menu {
  position: static;
  z-index: auto;
}
.is-overlay-menu-route .overlay-menu-controls {
  position: fixed;
  z-index: 50;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mobile-menu-home { min-height:44px; display:none; align-items:center; gap:9px; border-radius:16px; color:var(--ink); text-decoration:none; }
.mobile-menu-home:focus-visible { outline:3px solid #8fd0e7; outline-offset:3px; }
.mobile-menu-brand { font-size:14px; font-weight:820; letter-spacing:-.015em; white-space:nowrap; }
.overlay-menu-trigger {
  position: relative;
  min-height: 44px;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--lime);
  font: inherit;
  cursor: pointer;
  box-shadow: none;
}
.overlay-menu-icon { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2.1; stroke-linecap:round; }
.app-shell .overlay-menu-controls button.overlay-menu-trigger { color:var(--lime); }
.overlay-menu-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display:grid;
  place-items:center;
  border-radius: 50%;
  background:var(--lime);
  color:var(--ink);
  font-size: 12px;
  font-weight:900;
  transition: background 160ms ease;
}
.overlay-menu-trigger:hover { background:var(--ink); filter:brightness(1.18); }
.overlay-menu-trigger:focus-visible { outline: 3px solid #8fd0e7; outline-offset: 3px; }
.is-overlay-menu-route .overlay-menu-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: block;
  border: 0;
  padding: 0;
  background: rgb(12 18 22 / 28%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.is-overlay-menu-route .rail {
  position: fixed;
  z-index: 40;
  top: 20px;
  bottom: 20px;
  left: 20px;
  width: min(var(--rail-expanded-width), calc(100vw - 40px));
  height: auto;
  padding: 16px 12px;
  transform: translateX(calc(-100% - 28px));
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.is-overlay-menu-route .rail > .logo-slot { display: flex; }
.mobile-drawer-close { position:absolute; z-index:2; top:17px; right:14px; width:42px; height:42px; display:none; place-items:center; padding:0; border:0; border-radius:12px; background:var(--canvas); color:var(--ink); cursor:pointer; }
.mobile-drawer-close svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; }
.is-overlay-menu-route .mobile-drawer-close { display:grid; }
.is-overlay-menu-route .rail-nav { display: grid; }
.is-overlay-menu-route .rail-label { display: inline-flex; }
.is-overlay-menu-route .rail-link,
.is-overlay-menu-route .rail-action { width: auto; justify-content: flex-start; padding: 0 17px; }
.is-overlay-menu-route .rail-desktop-overflow { display: contents; }
.is-overlay-menu-route .rail-more { display: none; }
.is-overlay-menu-route.is-overlay-menu-open .rail { transform: translateX(0); }
.is-overlay-menu-route.is-overlay-menu-open .overlay-menu-backdrop { opacity: 1; pointer-events: auto; }
.is-overlay-menu-route.is-overlay-menu-open .overlay-menu-controls { display: none; }
body.has-overlay-menu-open { overflow: hidden; }

.workspace-settings {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 12px;
  background: rgb(255 255 255 / 7%);
  color: white;
  text-decoration: none;
  font-weight: 750;
}
.workspace-settings svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.workspace-settings:hover,
.workspace-settings[aria-current="page"] { border-color: rgb(200 255 77 / 55%); background: rgb(200 255 77 / 12%); }
.workspace-settings:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }

.settings-page { width: min(880px, 100%); margin: 0 auto; }
.settings-header { max-width: 760px; }
.settings-header h1 { margin: 6px 0 12px; font-size: clamp(32px, 5vw, 54px); letter-spacing: -.04em; }
.settings-header > p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.settings-notice { margin: 24px 0 0; padding: 13px 16px; border: 1px solid #b9df62; border-radius: 13px; background: #f4ffd9; color: #31440a; font-weight: 750; }
.settings-form { display: grid; gap: 18px; margin-top: 26px; }
.settings-card { margin: 0; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 14px 38px rgb(23 27 34 / 7%); }
.settings-card legend { padding: 0 8px; font-size: 21px; font-weight: 820; letter-spacing: -.02em; }
.settings-hint { max-width: 700px; margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.settings-route-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-route-option { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; font-weight: 720; cursor: pointer; }
.settings-route-option:hover { border-color: #b8c8d1; background: white; }
.settings-route-option:has(input:checked) { border-color: #9fc83e; background: #f5ffdf; }
.settings-route-option input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: #789d1d; }
.settings-route-option input:focus-visible { outline: 3px solid #8fd0e7; outline-offset: 3px; }
.settings-actions { display: flex; justify-content: flex-end; }
.settings-actions .button { min-height: 46px; padding-inline: 22px; }

@media (max-width: 640px) {
  .app-shell.is-overlay-menu-route { display: block; padding: 8px; }
  .is-overlay-menu-route .route-slot { padding-top: 70px; }
  .is-overlay-menu-route .route-slot[data-module-key="planning"] { padding-top: 70px; }
  .is-overlay-menu-route .route-slot[data-module-key="planning"] .planning-topbar { padding-left: 0; }
  .is-overlay-menu-route .route-slot[data-module-key="sales_workbench"] {
    padding-top: 0;
  }
  .is-overlay-menu-route .overlay-menu-controls { top: 12px; left: 12px; }
  .is-overlay-menu-route .rail {
    top: 8px;
    bottom: 8px;
    left: 8px;
    width: min(var(--rail-expanded-width), calc(100vw - 16px));
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 16px 12px;
  }
  .is-overlay-menu-route .rail-nav { display: grid; justify-content: stretch; overflow-y: auto; }
  .is-overlay-menu-route .rail-link { width: auto; min-width: 0; min-height: 50px; justify-content: flex-start; padding: 0 15px; }
  .is-overlay-menu-route .rail-label { display: inline-flex; }
  .settings-route-grid { grid-template-columns: 1fr; }
  .settings-card { padding: 20px 16px; }
  .settings-actions .button { width: 100%; }
}

@media (forced-colors: active) {
  .overlay-menu-trigger,
  .workspace-settings,
  .settings-route-option { border: 1px solid CanvasText; }
  .overlay-menu-trigger { background: Canvas; color: CanvasText; }
  .is-overlay-menu-route .overlay-menu-backdrop { background: CanvasText; opacity: .35; }
}

.logo-slot, .rail-link, .rail-action {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.logo-slot { padding: 0 5px; color: var(--ink); text-decoration: none; }
.logo-slot:visited { color: var(--ink); }
.logo-slot .brand-mark { width: 48px; height: 48px; flex: 0 0 48px; }
.brand-name { font-weight: 800; }
.brand-identity { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgb(200 255 77 / 25%); }
.rail-nav {
  position: relative;
  isolation: isolate;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.rail-link, .rail-action {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 0;
  padding: 0 17px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: color 120ms ease;
}
.rail-link:hover, .rail-action:hover { background: #f0f3f7; color: var(--ink); }
.rail-link.is-active, .rail-more-toggle.is-active {
  background: var(--ink);
  color: white;
  box-shadow: 0 10px 24px rgb(23 27 34 / 16%);
}
.rail-nav.has-active-marker .rail-link.is-active,
.rail-nav.has-active-marker .rail-more-toggle.is-active {
  background: transparent;
  box-shadow: none;
}
.rail-nav.has-active-marker .rail-link.is-active:hover,
.rail-nav.has-active-marker .rail-more-toggle.is-active:hover { background: transparent; color: white; }
.rail-link.is-active .icon { color: var(--lime); }
.rail-more-toggle.is-active .icon { color: var(--lime); }
.rail-active-marker {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  display: block;
  border-radius: 14px;
  background: var(--ink);
  box-shadow: 0 10px 24px rgb(23 27 34 / 16%);
  pointer-events: none;
  transform-origin: top left;
  will-change: transform;
}
.rail-active-marker[hidden] { display: none; }
.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-label { opacity: 1; }
.rail-skeleton { min-height: 54px; display: flex; align-items: center; gap: 14px; padding: 0 17px; }
.rail-skeleton::before, .rail-skeleton::after { content: ""; display: block; border-radius: 999px; background: #edf0f3; }
.rail-skeleton::before { width: 22px; height: 22px; flex: 0 0 22px; }
.rail-skeleton::after { width: min(132px, 70%); height: 12px; }
.rail-desktop-overflow { display: contents; }
.rail-more { display: none; }
.rail-more-toggle { display: none; }
.rail-more-panel { display: contents; }
.rail-more-check { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

.workspace { min-width: 0; display: flex; flex-direction: column; }

@media (min-width: 1001px) {
  .app-shell[data-route-module="sales_workbench"] {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .app-shell[data-route-module="sales_workbench"] .workspace {
    height: 100%;
    min-height: 0;
  }
  .app-shell[data-route-module="sales_workbench"] .route-slot {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  .app-shell[data-route-module="sales_workbench"] .workspace-footer {
    display: none;
  }
  .app-shell.is-overlay-menu-route[data-route-module="sales_workbench"]:has([data-module-root="sales_workbench"].is-deal-mode) {
    padding: 0;
  }
}
.workspace-topbar { min-height: 58px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-bottom: 18px; }
.workspace-footer {
  position: relative;
  min-height: 248px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: stretch;
  gap: 32px;
  margin-top: 44px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 28px;
  background: var(--ink);
  color: white;
  box-shadow: 0 28px 72px rgb(23 27 34 / 16%);
}
.workspace-footer::after {
  position: absolute;
  right: -74px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgb(200 255 77 / 10%);
  content: "";
  pointer-events: none;
}
.workspace-footer-brand { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 22px; min-width: 0; }
.workspace-footer-mark {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--lime);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.06em;
}
.workspace-footer-copy { min-width: 0; }
.workspace-footer-kicker { margin: 4px 0 14px; color: var(--lime); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.workspace-footer-title { max-width: 620px; margin: 0; font-size: clamp(32px, 4vw, 52px); font-weight: 820; letter-spacing: -.045em; line-height: .98; }
.workspace-footer-note { max-width: 560px; margin: 22px 0 0; color: rgb(255 255 255 / 68%); font-size: 15px; line-height: 1.55; }
.workspace-account {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 22px;
  background: rgb(255 255 255 / 8%);
  backdrop-filter: blur(8px);
}
.workspace-account-kicker { margin: 0; color: rgb(255 255 255 / 62%); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-user { min-width: 0; display: flex; align-items: center; gap: 13px; }
.workspace-user-mark { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 15px; background: var(--lime); color: var(--ink); font-size: 18px; font-weight: 900; }
.workspace-user-copy { min-width: 0; display: grid; gap: 4px; }
.workspace-user-copy strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-user-copy > span { color: rgb(255 255 255 / 62%); font-size: 13px; }
.workspace-logout { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 16px; border: 1px solid white; border-radius: 14px; background: white; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.workspace-logout:hover { border-color: var(--lime); background: var(--lime); color: var(--ink); }
.workspace-logout:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.workspace-logout:disabled { cursor: wait; opacity: .62; }
.workspace-logout .icon { width: 20px; height: 20px; flex-basis: 20px; }
.route-slot { min-height: calc(100vh - 116px); padding: 0 0 32px; }
.route-slot:focus { outline: none; }
.platform-page { width: min(100%, 1260px); margin: 0 auto; }
.module-list { display: grid; gap: 12px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: clamp(32px, 3.5vw, 42px); }
.page-header p { max-width: 680px; line-height: 1.6; }
.c360-related-links { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0; }
.c360-related-links a { color: var(--accent); font-weight: 700; text-decoration: none; }
.c360-related-links a:hover { text-decoration: underline; }
.c360-related-links a:focus-visible { outline: 3px solid rgb(53 134 99 / 24%); outline-offset: 3px; }

.source-list { display: grid; gap: 12px; }
.source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.source-card h2 { margin: 0 0 6px; font-size: 18px; }
.source-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.source-key { margin-top: 7px !important; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-health { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 16px 0 0; }
.source-health div { min-width: 112px; }
.source-health dt { color: var(--muted); font-size: 12px; }
.source-health dd { margin: 3px 0 0; color: var(--ink); font-size: 14px; font-weight: 760; }
.status-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f0f3f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.status-verified { background: #e5f6ec; color: #17643b; }
.status-syncing { background: #edf3ff; color: #28569b; }
.status-attention { background: #fff3d6; color: #765000; }
.status-error { background: #ffe9e7; color: #9c3028; }
.stale-notice {
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff8e6;
  color: #7a5300;
}

.workspace-catalog-page { width: min(100%, 1260px); margin: 0 auto; }
.not-ready-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
  gap: 28px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.not-ready-copy h2 { margin: 14px 0 9px; font-size: clamp(22px, 2.5vw, 30px); letter-spacing: -.025em; }
.not-ready-copy p { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.6; }
.not-ready-badge {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f1f8dd;
  color: #4b6815;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.workspace-outcomes { display: grid; align-content: start; gap: 10px; margin: 0; padding: 0; list-style: none; }
.workspace-outcomes li { position: relative; padding: 11px 12px 11px 38px; border-radius: 13px; background: #f7f9fb; font-weight: 700; }
.workspace-outcomes li::before { position: absolute; left: 14px; content: "·"; color: var(--green); font-size: 25px; line-height: 17px; }
.workspace-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

.crm-page { width: min(100%, 1260px); margin: 0 auto; }
.crm-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.crm-header-actions, .crm-row-actions, .crm-form-actions, .crm-relation-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}

.c360-page, .c360-detail { width: min(100%, 1120px); margin: 0 auto; }
.c360-page .crm-input { width: min(100%, 620px); margin-top: 18px; }
.c360-results { display: grid; gap: 10px; }
.c360-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 18px 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.c360-card:hover, .c360-card:focus-visible { border-color: #7ca891; transform: translateY(-1px); }
.c360-card-main { display: grid; gap: 5px; }
.c360-card-main strong { font-size: 17px; }
.c360-card-main small, .c360-event small { color: var(--muted); }
.status-ready { background: #e5f6ec; color: #17643b; }
.status-partial, .status-stale { background: #fff3d6; color: #765000; }
.c360-back { width: fit-content; }
.c360-guard { display: grid; gap: 5px; padding: 17px 20px; border-radius: 17px; }
.c360-guard.is-safe { background: #e5f6ec; color: #17643b; }
.c360-guard.is-blocked { background: #fff3d6; color: #765000; }
.c360-panel { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.c360-panel h2 { margin: 0 0 15px; }
.c360-evidence, .c360-timeline { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.c360-evidence li { display: grid; gap: 4px; padding: 13px 15px; border-radius: 13px; background: #f7f9fb; }
.c360-evidence small, .c360-honesty { color: var(--muted); }
.c360-event { padding: 16px 0; border-top: 1px solid var(--line); }
.c360-event-head { display: flex; justify-content: space-between; gap: 16px; }
.c360-event p { margin: 8px 0; color: var(--muted); line-height: 1.5; }
.c360-detail-state { width: min(100%, 760px); margin: 0 auto; }
.c360-detail-state > .eyebrow { margin-bottom: 0; }
.c360-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 700px) { .c360-card, .c360-event-head { align-items: flex-start; flex-direction: column; } }
.crm-kpis { display: flex; min-height: 68px; margin-bottom: 16px; padding: 9px 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 8px 26px rgb(34 43 56 / 4%); }
.crm-kpi { min-width: 150px; display: grid; align-content: center; gap: 2px; padding: 0 14px; border-right: 1px solid var(--line); }
.crm-kpi:last-child { border-right: 0; }
.crm-kpi span, .crm-kpi small { color: var(--muted); font-size: 11px; font-weight: 750; }
.crm-kpi strong { font-size: 18px; font-weight: 920; }
.crm-tabs { display: inline-flex; gap: 6px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 10px 28px rgb(34 43 56 / 5%); }
.crm-tab { padding: 10px 15px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.crm-tab.is-active { background: var(--ink); color: white; }
.crm-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 200px auto; align-items: end; gap: 12px; margin-bottom: 20px; }
.crm-field { display: grid; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 650; }
.crm-entity-list, .crm-relation-list { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.crm-entity-row, .crm-relation-row, .crm-metadata, .crm-form, .crm-relations {
  border: 1px solid var(--line); border-radius: 22px; background: var(--panel);
}
.crm-entity-row, .crm-relation-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.crm-entity-row:last-child, .crm-relation-row:last-child { border-bottom: 0; }
.crm-entity-row:hover, .crm-relation-row:hover { background: #f8fbff; }
.crm-entity-row h2, .crm-relation-row strong { margin: 0; font-size: 18px; }
.crm-entity-row p, .crm-section-heading p { margin: 6px 0 0; color: var(--muted); }
.crm-pagination { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.crm-metadata { display: grid; grid-template-columns: minmax(130px, 180px) 1fr; margin: 0 0 20px; padding: 22px; }
.crm-metadata dt, .crm-metadata dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.crm-metadata dt { color: var(--muted); }
.crm-form { display: grid; gap: 16px; max-width: 720px; padding: 28px; box-shadow: var(--shadow); }
.crm-form-message:empty { display: none; }
.crm-notice { margin-bottom: 18px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.crm-notice p { margin: 5px 0 0; color: var(--muted); }
.crm-notice-error { border-color: #f3c7c2; background: #fff7f6; }
.crm-notice-conflict { border-color: #f0d18a; background: #fff9e9; }
.crm-notice .button { margin-top: 12px; }
.crm-relations { padding: 24px; box-shadow: var(--shadow); }
.crm-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.crm-section-heading h2 { margin: 0; }
.crm-relation-copy { display: grid; gap: 6px; min-width: 0; }
.crm-relation-copy code { overflow-wrap: anywhere; color: var(--muted); }
.crm-relation-controls .field-input { width: auto; min-height: 44px; }
.crm-check { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status-active { background: #e9f3ef; color: var(--green); }
.status-archived { background: #f0f3f7; color: var(--muted); }
.status-tombstone { background: #fff0ee; color: var(--danger); }

.state-view {
  min-height: 320px;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.state-view h2 { margin: 16px 0 8px; font-size: 22px; }
.state-view p { max-width: 540px; margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.state-partial { border-color: #f0d18a; background: #fffbef; }
.state-stale { border-color: #bfd3ea; background: #f4f8fd; }
.state-success { border-color: #add8c9; background: #f2fbf7; }
.state-conflict { border-color: #edc586; background: #fff8e7; }
.state-forbidden, .state-error { border-color: #efc0bc; background: #fff8f7; }
.state-loading { justify-items: stretch; gap: 18px; }
.route-module-loader {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 22px 24px;
  border: 1px solid rgb(218 224 229 / 80%);
  border-radius: 20px;
  background: rgb(238 241 244 / 62%);
  color: var(--ink);
}
.route-module-loader strong { display: block; font-size: 16px; }
.route-module-loader p { margin: 4px 0 0; color: var(--muted); }
.empty-mark { width: 44px; height: 7px; border-radius: 999px; background: var(--lime); }
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dfe6ec;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.error-code { font: 12px ui-monospace, monospace; }
.confirm-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(15 31 56 / 35%); }
.confirm-dialog { width: min(720px, 94vw); padding: 28px; border-radius: 22px; background: white; box-shadow: 0 22px 60px rgb(0 0 0 / 25%); }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 24px; }
.confirm-dialog p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

.catalogue { width: min(100%, 1180px); margin: 0 auto; }
.catalogue-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.catalogue-heading h2 { margin: 0 0 8px; font-size: 20px; }
.catalogue-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.catalogue-specimen { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.catalogue-specimen > .state-view { flex: 1 1 240px; min-height: 220px; padding: 24px; box-shadow: none; }
.field { display: grid; flex: 1 1 260px; gap: 7px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 10px 12px;
  border: 1px solid #cbd1d8;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
}
.field small { color: var(--muted); font-weight: 500; }
.button-danger { border-color: var(--danger); background: white; color: var(--danger); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes skeleton-sweep { to { transform: translateX(100%); } }

@media (max-width: 1199px) {
  :root { --rail-width: 82px; }
  .rail-label { display: none; }
  .rail-skeleton { justify-content: center; padding: 0; }
  .rail-skeleton::after { display: none; }
}

@media (max-width: 768px) {
  :root { --rail-width: 72px; }
  .app-shell { gap: 16px; padding: 16px; }
  .rail { top: 16px; height: calc(100vh - 32px); }
  .rail { padding-inline: 10px; }
  .rail-label { display: none; }
  .route-slot { padding: 0 0 24px; }
  .page-header { margin-bottom: 24px; }
  .c360-related-links { align-items: flex-start; flex-direction: column; }
  .crm-page-header, .crm-entity-row, .crm-relation-row, .crm-section-heading { align-items: stretch; flex-direction: column; }
  .crm-toolbar { grid-template-columns: 1fr; }
  .crm-header-actions, .crm-row-actions, .crm-relation-controls { width: 100%; }
  .crm-relation-controls .field-input { width: 100%; }
  .not-ready-card { grid-template-columns: 1fr; }
  .catalogue-card { grid-template-columns: 1fr; }
  .workspace-actions { grid-column: auto; }
  .workspace-footer { grid-template-columns: 1fr; gap: 26px; padding: 28px; }
}

@media (max-width: 480px) {
  :root { --mobile-rail-height: 64px; --mobile-rail-bottom: max(10px, env(safe-area-inset-bottom)); }
  .app-shell { display: flex; flex-direction: column; gap: 12px; padding: 10px; }
  .workspace { min-height: calc(100dvh - var(--mobile-rail-height) - 32px); }
  .rail { position: relative; inset: auto; width: 100%; height: var(--mobile-rail-height); flex: 0 0 auto; flex-direction: row; align-items: center; gap: 2px; padding: 7px 5px; overflow: visible; border-radius: 20px; }
  .logo-slot, .rail-action .rail-label { display: none; }
  .rail-nav { display: flex; flex: 1; justify-content: space-evenly; gap: 2px; overflow: visible; scrollbar-gutter: auto; }
  .rail-link, .rail-action { width: 46px; min-width: 44px; min-height: 48px; justify-content: center; padding: 0; }
  .rail-more { position: static; display: block; }
  .rail-desktop-overflow { display: none; }
  .rail-more-toggle { display: flex; }
  .rail-more-panel {
    position: absolute;
    z-index: 30;
    inset: calc(100% + 8px) 0 auto;
    display: none;
    gap: 6px;
    max-height: calc(100dvh - var(--mobile-rail-height) - var(--mobile-rail-bottom) - 34px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
    box-shadow: 0 18px 48px rgb(23 27 34 / 20%);
  }
  .rail-more.is-open .rail-more-panel { display: grid; }
  .rail-more-check:checked ~ .rail-more-panel { display: grid; }
  .rail-more-check:focus-visible + .rail-more-toggle { outline: 3px solid var(--lime); outline-offset: 3px; }
  .rail-more-panel .rail-link { width: 100%; justify-content: flex-start; padding: 0 17px; }
  .rail-more-panel .rail-label { display: inline; }
  .rail-nav.has-active-marker .rail-more-panel .rail-link.is-active,
  .rail-nav.has-active-marker .rail-more-panel .rail-link.is-active:hover {
    background: var(--ink);
    color: white;
    box-shadow: 0 10px 24px rgb(23 27 34 / 16%);
  }
  .rail-skeleton:nth-child(n + 5) { display: none; }
  .workspace-topbar { align-items: center; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .workspace-footer { gap: 24px; margin-top: 32px; padding: 24px 20px; border-radius: 22px; }
  .workspace-footer-brand { flex-direction: column; gap: 18px; }
  .workspace-footer-mark { width: 64px; height: 64px; flex-basis: 64px; border-radius: 18px; }
  .workspace-account { padding: 18px; }
  .route-slot { padding: 0 0 28px; scroll-padding-bottom: 0; }
  .page-header h1 { font-size: 32px; }
  .source-card { align-items: flex-start; flex-direction: column; gap: 14px; padding: 20px; }
  .state-view { min-height: 280px; padding: 24px; }
  .route-module-loader { min-height: 96px; padding: 18px; }
  .not-ready-card { gap: 20px; padding: 22px; }
  .workspace-actions .button { width: 100%; }
  .crm-header-actions .button, .crm-row-actions .button, .crm-form-actions .button, .crm-relation-controls .button { width: 100%; }
  .crm-metadata { grid-template-columns: 1fr; }
  .crm-metadata dt { padding-bottom: 2px; border-bottom: 0; }
  .crm-metadata dd { padding-top: 2px; }
  .crm-form, .crm-relations { padding: 18px; }
  .crm-kpis { scroll-snap-type: x mandatory; }
  .crm-kpi { min-width: 132px; scroll-snap-align: start; }
  .confirm-backdrop { padding: 14px; }
  .confirm-dialog { padding: 22px; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .button { width: 100%; }
  .login-page { padding: 16px; }
  .login-panel { padding: 28px 22px; border-radius: 20px; }
  .app-shell.has-mobile-drawer { display:block; padding:8px; }
  .has-mobile-drawer .workspace { min-height:calc(100dvh - 16px); }
  .has-mobile-drawer .route-slot { padding-top:68px; }
  .has-mobile-drawer .overlay-menu-controls { position:fixed; z-index:50; top:0; left:0; width:100vw; min-height:68px; display:flex; align-items:center; gap:8px; padding:12px; border-bottom:1px solid var(--line); background:var(--canvas); }
  .has-mobile-drawer .mobile-menu-home { display:inline-flex; }
  .has-mobile-drawer.is-overlay-menu-route .route-slot[data-module-key="sales_workbench"] { padding-top:68px; }
  .has-mobile-drawer [data-module-root="sales_workbench"] .sales-shell-menu { width:100vw; height:68px; align-self:auto; }
  .has-mobile-drawer [data-module-root="sales_workbench"] .sales-toolbar.has-shell-menu { grid-template-columns:0 minmax(0,1fr) 42px; }
  .has-mobile-drawer.is-overlay-menu-open .overlay-menu-controls { display:none; }
  .has-mobile-drawer .overlay-menu-backdrop { position:fixed; z-index:30; inset:0; display:block; border:0; padding:0; background:rgb(12 18 22 / 32%); opacity:0; pointer-events:none; transition:opacity 160ms ease; }
  .has-mobile-drawer.is-overlay-menu-open .overlay-menu-backdrop { opacity:1; pointer-events:auto; }
  .app-shell.has-mobile-drawer .rail { position:fixed; z-index:40; inset:8px auto 8px 8px; width:calc(100vw - 16px); height:auto; min-height:0; display:flex; flex-direction:column; align-items:stretch; gap:18px; padding:16px 12px; overflow:hidden; border-radius:22px; transform:translateX(calc(-100% - 20px)); transition:transform 180ms ease,box-shadow 180ms ease; }
  .app-shell.has-mobile-drawer.is-overlay-menu-open .rail { transform:translateX(0); }
  .has-mobile-drawer .rail>.logo-slot { display:flex; padding-right:50px; }
  .has-mobile-drawer .mobile-drawer-close { display:grid; }
  .has-mobile-drawer .rail-nav { display:grid; flex:1; justify-content:stretch; gap:4px; overflow-y:auto; overscroll-behavior:contain; }
  .has-mobile-drawer .rail-link,.has-mobile-drawer .rail-action { width:auto; min-width:0; min-height:50px; justify-content:flex-start; padding:0 15px; }
  .has-mobile-drawer .rail-label,.has-mobile-drawer .rail-action .rail-label { display:inline-flex; }
  .has-mobile-drawer .rail-desktop-overflow { display:contents; }
  .has-mobile-drawer .rail-more { display:none; }
}

@media (max-width: 240px) {
  .app-shell { display: flex; flex-direction: column; gap: 12px; padding: 8px; }
  .rail {
    position: relative;
    inset: auto;
    order: 0;
    width: 100%;
    height: auto;
    min-height: var(--mobile-rail-height);
    flex: 0 0 auto;
  }
  .workspace-footer { padding: 18px 14px; border-radius: 18px; }
  .workspace-footer-title { font-size: 30px; }
  .workspace { order: 1; min-height: auto; }
  .rail-more-panel {
    position: absolute;
    inset: calc(100% + 8px) 0 auto;
    max-height: min(70dvh, 560px);
  }
  .route-slot { padding-bottom: 28px; scroll-padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .rail-active-marker, .rail-link, .rail-action { transition: none !important; }
}

@media (forced-colors: active) {
  .route-module-loader { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
  .route-module-loader .spinner { border-color: CanvasText; border-top-color: Highlight; }
  .workspace-footer, .workspace-account, .workspace-logout { border: 1px solid CanvasText; }
  .workspace-footer { background: Canvas; color: CanvasText; }
  .workspace-footer::after { display: none; }
  .workspace-footer-mark, .workspace-logout { background: Canvas; color: CanvasText; }
  .workspace-footer-kicker, .workspace-footer-note, .workspace-account-kicker, .workspace-user-copy > span { color: CanvasText; }
  .rail-active-marker { border: 1px solid Highlight; background: Highlight; box-shadow: none; }
  .rail-nav.has-active-marker .rail-link.is-active,
  .rail-nav.has-active-marker .rail-more-toggle.is-active { color: HighlightText; forced-color-adjust: none; }
}

/* Home and cross-page source health */
.source-status-strip {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 38px;
  padding: 5px 0;
  overflow-x: auto;
  border: 0;
  background: transparent;
  scrollbar-width: thin;
}
.source-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.source-strip-item:hover, .source-strip-item:focus-visible {
  border-color: var(--line);
  background: #f7f9fb;
}
.source-strip-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border: 1px solid #7f8996;
  border-radius: 50%;
  background: transparent;
}
.source-strip-name { font-size: 12px; font-weight: 800; }
.source-strip-state { color: var(--muted); font-size: 12px; }
.source-strip-time { display: none; }
.source-state-healthy .source-strip-dot,
.source-state-active_ok .source-strip-dot { border-color: #15945f; background: #1eaf72; }
.source-state-running .source-strip-dot { border-color: #2d69b7; background: #4a8de4; }
.source-state-error .source-strip-dot { border-color: #bd4037; background: #df564b; }
.source-state-attention .source-strip-dot { border-color: #a66d04; background: #e7a82f; }
.source-strip-loading {
  display: inline-grid;
  gap: 7px;
  min-width: 220px;
}
@media (max-width: 1199px) {
  .source-status-strip { flex-wrap: wrap; overflow-x: visible; }
}
@media (max-width: 700px) {
  .source-strip-state { display: none; }
}
.release-queue-item { cursor: default; }
.release-queue-metric {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 35px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.release-queue-age { white-space: nowrap; }
.release-queue-installation {
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}
.release-queue-badge {
  position: absolute;
  z-index: 1;
  top: -12px;
  right: -14px;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #df3f36;
  box-shadow: 0 1px 3px rgb(125 28 22 / 28%);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}
.source-strip-loading, .source-strip-unavailable {
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.source-strip-unavailable { color: #9c3028; }

.home-page { width: min(100%, 1360px); margin: 0 auto; }
.home-page > h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.home-hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid #dde3e8;
  border-radius: 28px;
  background: #f8faf8 url("../../assets/crm2-home-hero.webp") center / cover no-repeat;
  box-shadow: 0 20px 50px rgb(31 42 55 / 9%);
}
.home-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgb(255 255 255 / 97%) 0%, rgb(255 255 255 / 89%) 37%, rgb(255 255 255 / 18%) 70%, transparent 100%);
}
.home-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-height: 390px;
  width: min(55%, 720px);
  padding: clamp(30px, 5vw, 64px);
}
.home-eyebrow {
  margin: 0 0 12px;
  color: #177b62;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.home-hero h2 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: -.055em;
}
.home-lead { max-width: 610px; margin: 22px 0; color: #536071; font-size: 18px; line-height: 1.55; }
.home-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.home-hero-tags span {
  padding: 8px 12px;
  border: 1px solid #d9e1e5;
  border-radius: 999px;
  background: rgb(255 255 255 / 78%);
  font-size: 13px;
  font-weight: 750;
}
.home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 42px 0 18px;
}
.home-section-heading h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; }
.home-section-heading > p { max-width: 560px; margin: 0; color: var(--muted); line-height: 1.5; }
.home-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-source-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  min-height: 240px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.home-source-heading { display: flex; align-items: center; gap: 10px; }
.home-source-heading .source-strip-dot { display: inline-block; flex: 0 0 auto; }
.home-source-heading h2 { margin: 0; font-size: 19px; }
.home-source-state { margin-top: 18px; font-size: 15px; }
.home-source-card > p { margin: 8px 0; color: var(--muted); line-height: 1.45; }
.home-source-time { font-size: 12px; }
.home-source-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #176a55;
  font-weight: 800;
  text-decoration: none;
}
.home-source-link:hover, .home-source-link:focus-visible { color: #0d493a; }
.home-status-error { grid-column: 1 / -1; padding: 24px; border: 1px solid #efc0bc; border-radius: 18px; background: #fff8f7; }
.home-status-error p { margin-bottom: 0; color: var(--muted); }

@media (max-width: 980px) {
  .home-source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero-copy { width: 70%; }
}
@media (max-width: 700px) {
  .workspace-topbar { flex-wrap: wrap; }
  .workspace-account { margin-left: auto; order: 1; }
  .source-status-strip { width: 100%; flex-basis: 100%; order: 2; padding-inline: 0; }
  .home-hero { min-height: 480px; background-position: 68% center; }
  .home-hero::after { background: linear-gradient(180deg, rgb(255 255 255 / 97%) 0%, rgb(255 255 255 / 86%) 60%, rgb(255 255 255 / 25%) 100%); }
  .home-hero-copy { align-content: start; width: 100%; min-height: 480px; padding: 30px 24px; }
  .home-hero h1 { font-size: clamp(36px, 12vw, 52px); }
  .home-section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .home-source-grid { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .source-strip-dot, .home-source-card, .home-hero { border: 1px solid CanvasText; }
  .source-state-healthy .source-strip-dot,
  .source-state-active_ok .source-strip-dot,
  .source-state-running .source-strip-dot,
  .source-state-error .source-strip-dot,
  .source-state-attention .source-strip-dot { background: CanvasText; }
  .source-state-active_ok .source-strip-dot {
    border-color: Highlight;
    background: Highlight;
    forced-color-adjust: none;
  }
  .release-queue-badge {
    border-color: Canvas;
    background: CanvasText;
    color: Canvas;
  }
}
.s16-page{max-width:1100px}.s16-toolbar,.s16-actions,.s16-card-top{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}.s16-toolbar{margin:1rem 0}.s16-toolbar input{flex:1;min-width:12rem}.s16-list{display:grid;gap:1rem}.s16-card,.s16-form{background:var(--surface,#fff);border:1px solid var(--border,#d9e0e5);border-radius:12px;padding:1rem}.s16-card h2{margin:.6rem 0}.s16-status,.s16-priority{border-radius:999px;padding:.2rem .6rem;background:#e7f4f1}.s16-priority{background:#fff0dc}.s16-meta,.s16-feedback{color:var(--text-muted,#5f6b76)}.s16-details[hidden]{display:none}.s16-details{margin-top:1rem;border-top:1px solid var(--border,#d9e0e5);padding-top:1rem}.s16-details h3,.s16-details h4{margin:1rem 0 .5rem}.s16-collaboration{display:grid;grid-template-columns:minmax(10rem,1fr) auto;gap:.5rem;margin:1rem 0}.s16-collaboration input,.s16-collaboration select{min-height:44px;border:1px solid var(--border,#bbc5cd);border-radius:8px;padding:.65rem;font:inherit}.s16-form{display:grid;gap:1rem;max-width:46rem}.s16-form label{display:grid;gap:.35rem;font-weight:600}.s16-form input,.s16-form select,.s16-form textarea{min-height:44px;border:1px solid var(--border,#bbc5cd);border-radius:8px;padding:.65rem;font:inherit}.s16-form textarea{min-height:6rem}.s16-dialog{width:min(46rem,calc(100vw - 2rem));max-height:calc(100vh - 2rem);border:0;border-radius:16px;padding:0;box-shadow:0 1.5rem 4rem #17212b33}.s16-dialog::backdrop{background:#17212b99}.s16-dialog .s16-form{border:0}.s16-page :focus-visible{outline:3px solid #087f5b;outline-offset:3px}@media(max-width:420px){.s16-toolbar>*{width:100%}.s16-actions button{flex:1;min-height:44px}.s16-card,.s16-form{padding:.8rem}.s16-collaboration{grid-template-columns:1fr}.s16-collaboration>*{width:100%}}@media(forced-colors:active){.s16-status,.s16-priority,.s16-card,.s16-details{border:1px solid ButtonText}.s16-page :focus-visible{outline:3px solid Highlight}}@media(prefers-reduced-motion:reduce){.s16-page *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}
.local-data { width: min(100%, 1260px); margin: 0 auto; }
.local-data__header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; padding: 32px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(135deg,#fff 0%,#f7f9f4 100%); box-shadow: var(--shadow-soft); }
.local-data__eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.local-data__header h1 { margin: 0; font-size: clamp(38px,5vw,64px); letter-spacing: -.05em; line-height: .98; }
.local-data__message { max-width: 720px; margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.local-data__count { flex: 0 0 auto; padding: 9px 13px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; }
.local-data__summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 12px; margin: 0 0 24px; }
.local-data__summary div { min-height: 118px; display: grid; align-content: space-between; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); }
.local-data__summary dt { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.local-data__summary dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 24px; font-weight: 850; letter-spacing: -.03em; }
.local-data__content { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow-soft); }
.local-data__section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.local-data__section-heading h2 { margin: 0; font-size: 22px; }
.local-data__section-heading p { max-width: 540px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.local-data__table { overflow: auto; }
.local-data table { width: 100%; border-collapse: collapse; min-width: 720px; }
.local-data th, .local-data td { padding: 15px 18px; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: top; }
.local-data tbody tr:hover { background: #f8faf5; }
.local-data th { position: sticky; top: 0; background: #f4f7ef; color: #425047; font-size: 12px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.local-data__state { padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: #fff; text-align: center; }
.local-data__state h2 { margin: 0 0 10px; }
.local-data__state p { margin: 0; color: var(--muted); }
.local-data__state--error { border-color: #efc4c0; background: #fff7f6; }
@media(max-width:700px){.local-data__header,.local-data__section-heading{align-items:flex-start;flex-direction:column}.local-data__header{padding:24px 20px}.local-data__section-heading p{text-align:left}.local-data__summary{grid-template-columns:repeat(2,minmax(0,1fr))}.local-data__summary div{min-height:100px;padding:16px}.local-data__summary dd{font-size:20px}}
@media(max-width:420px){.local-data__summary{grid-template-columns:1fr}.local-data__header h1{font-size:38px}}
