:root {
  --product-shell-width: 1320px;
  --product-shell-line: #e3e8ef;
  --product-shell-muted: #667085;
  --product-shell-ink: #16233a;
  --product-shell-brand: #c9161d;
  --product-shell-surface: #fff;
}

html:not(.shell-ready) .side .nav,
html:not(.shell-ready) .side .login-status,
html:not(.shell-ready) .workspace {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

html.shell-ready .side .nav,
html.shell-ready .side .login-status,
html.shell-ready .workspace {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.module-view.wide-admin {
  max-width: var(--product-shell-width);
}

.product-page-shell {
  box-sizing: border-box;
  width: min(100%, var(--product-shell-width));
  max-width: var(--product-shell-width);
  margin: 0 auto;
}

.product-page-header {
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  min-height: 104px;
  margin: 0;
  padding: 14px 0 18px;
  border: 0;
  border-bottom: 1px solid var(--product-shell-line);
  background: transparent;
}

.product-page-header-copy,
.product-page-header > div:first-child {
  min-width: 0;
}

.product-page-eyebrow,
.product-page-header .five-eyebrow,
.product-page-header > div:first-child > span:first-child {
  display: block;
  margin: 0 0 7px;
  color: var(--product-shell-brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.product-page-header h1 {
  margin: 0;
  color: var(--product-shell-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

.product-page-header p {
  max-width: 920px;
  margin: 7px 0 0;
  color: var(--product-shell-muted);
  font-size: 13px;
  line-height: 1.65;
}

.product-page-header-meta {
  display: grid;
  flex: 0 0 auto;
  min-width: 180px;
  padding: 10px 12px;
  border-left: 2px solid var(--product-shell-brand);
  background: #f8fafc;
}

.product-page-header-meta small {
  color: var(--product-shell-muted);
  font-size: 11px;
}

.product-page-header-meta b {
  margin-top: 3px;
  color: var(--product-shell-ink);
  font-size: 13px;
}

.product-primary-nav {
  box-sizing: border-box;
  width: 100%;
  margin: 12px 0 0;
  padding: 0 14px;
  border: 1px solid var(--product-shell-line);
  border-radius: 6px;
  background: var(--product-shell-surface);
  box-shadow: none;
}

.product-primary-nav .system-top-nav,
.product-primary-nav.business-system-tabs,
.product-primary-nav .five-stepper {
  display: flex;
  align-items: stretch;
  gap: 24px;
  min-height: 46px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  border: 0;
  background: transparent;
}

.product-primary-nav .system-nav-item,
.product-primary-nav.business-system-tabs > button,
.product-primary-nav .five-step {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.product-primary-nav .system-nav-item::after,
.product-primary-nav.business-system-tabs > button::after,
.product-primary-nav .five-step::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.product-primary-nav .system-nav-item:hover,
.product-primary-nav.business-system-tabs > button:hover,
.product-primary-nav .five-step:hover:not(:disabled) {
  color: var(--product-shell-ink);
}

.product-primary-nav .system-nav-item.active,
.product-primary-nav.business-system-tabs > button.active,
.product-primary-nav .five-step.active {
  background: transparent;
  color: var(--product-shell-brand);
  font-weight: 700;
}

.product-primary-nav .system-nav-item.active::after,
.product-primary-nav.business-system-tabs > button.active::after,
.product-primary-nav .five-step.active::after {
  background: var(--product-shell-brand);
}

.product-secondary-nav {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 42px;
  margin: 10px 0 0;
  padding: 5px;
  overflow-x: auto;
  border: 0;
  border-radius: 5px;
  background: #eef1f5;
}

.product-secondary-nav > button,
.product-secondary-nav .system-nav-item {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.product-secondary-nav > button.active,
.product-secondary-nav .system-nav-item.active {
  background: #fff;
  color: var(--product-shell-ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}

.product-context-bar {
  box-sizing: border-box;
  width: 100%;
  margin: 10px 0 0;
  border-color: var(--product-shell-line);
  border-radius: 6px;
  background: #f8fafc;
  box-shadow: none;
}

.product-page-shell--dste {
  display: flex;
  flex-direction: column;
}

.product-page-shell--dste .five-hero {
  order: 1;
}

.product-page-shell--dste .dste-product-tabs {
  order: 2;
}

.product-page-shell--dste .five-object-ribbon {
  order: 3;
}

.product-page-shell--dste .five-stage-head {
  order: 4;
  margin-top: 12px;
}

.product-page-shell--dste > :not(.five-hero):not(.dste-product-tabs):not(.five-object-ribbon):not(.five-stage-head) {
  order: 5;
}

.product-page-shell--dste .dste-product-tabs-head {
  display: none;
}

.product-page-shell--dste .five-stepper {
  grid-template-columns: none;
}

.product-page-shell--dste .five-step-index {
  display: none;
}

.product-page-shell--dste .five-step b {
  font-size: 13px;
}

.product-page-shell--dste .five-step small {
  display: none;
}

.product-page-shell--dste .five-step,
.product-page-shell--dste .five-step.complete,
.product-page-shell--dste .five-step.locked {
  min-height: 46px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.product-page-shell--dste .five-step.complete {
  color: #475467;
}

.product-page-shell--dste .five-step.locked {
  color: #98a2b3;
  opacity: 1;
}

.product-page-shell--dste .five-step.active,
.product-page-shell--dste .five-step.active.complete {
  color: var(--product-shell-brand);
  font-weight: 700;
}

.product-page-shell--foundation > [data-foundation-workbench-body],
.product-page-shell--system > [data-system-section-body],
.product-page-shell--system > .business-system-body {
  margin-top: 12px;
}

.product-page-shell--foundation .foundation-panel-head {
  min-height: 64px;
}

.product-page-shell--system [data-system-section-body] .user-org-head h1,
.product-page-shell--system [data-system-section-body] h1 {
  font-size: 18px;
}

.product-page-shell--system .business-system-head > div:last-child {
  min-width: 180px;
  padding: 10px 12px;
  border-left: 2px solid var(--product-shell-brand);
  border-radius: 0;
  background: #f8fafc;
}

.product-page-shell--portal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-page-shell--portal > * {
  margin-top: 0;
  margin-bottom: 0;
}

.product-page-shell--portal .module-head {
  min-height: 104px;
}

.product-page-shell--portal .portal-work-tabs.product-secondary-nav {
  margin-bottom: 12px;
}

.product-page-shell--portal .module-head {
  min-height: 84px;
}

.product-page-shell--portal .portal-function-grid .module-card {
  min-height: 136px;
  padding: 15px 16px;
}

.product-page-shell--portal .portal-function-grid .module-card h3 {
  margin-top: 8px;
}

.product-page-shell--portal .portal-function-grid .module-card p {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-page-shell--portal .portal-entry-action {
  justify-content: space-between;
  width: 100%;
  color: var(--product-shell-brand);
  font-weight: 700;
}

.product-page-shell--portal .module-card-button:hover .portal-entry-action {
  color: var(--product-shell-brand-hover);
}

.product-page-shell--portal .portal-metrics-band .stat {
  position: relative;
  min-height: 82px;
  padding: 13px 38px 13px 16px;
}

.product-page-shell--portal .portal-metrics-band .stat small {
  margin-bottom: 5px;
}

.product-page-shell--portal .portal-metrics-band .stat strong {
  line-height: 1.1;
}

.product-page-shell--portal .portal-stat-arrow {
  position: absolute;
  top: 50%;
  right: 15px;
  color: #98a2b3;
  font-size: 18px;
  transform: translateY(-50%);
}

.product-page-shell--portal .portal-stat:hover .portal-stat-arrow {
  color: var(--product-shell-brand);
}

@media (min-width: 901px) {
  body.show-role-switcher .workspace::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 248px;
    z-index: 44;
    height: 58px;
    pointer-events: none;
    background: #f6f8fc;
    border-bottom: 1px solid var(--product-shell-line);
  }

  body.collapsed.show-role-switcher .workspace::before {
    left: 76px;
  }

  body.show-role-switcher .side {
    z-index: 50;
  }

  body.show-role-switcher .canvas {
    padding-top: 0;
  }

  body.show-role-switcher .workspace-toolbar {
    position: fixed;
    top: 12px;
    z-index: 46;
  }

  .product-page-shell--portal .module-head.product-page-header {
    position: sticky;
    top: 0;
    z-index: 45;
    min-height: 58px;
    padding: 13px 310px 12px 0;
    border-bottom: 0;
    background: #f6f8fc;
    box-shadow: none;
    isolation: isolate;
  }
}

.portal-priority-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.portal-priority-head h2 {
  margin: 0;
}

.portal-priority-head p {
  margin: 4px 0 0;
  color: var(--product-shell-muted);
  font-size: 12px;
}

.portal-priority-head .btn {
  flex: 0 0 auto;
}

.toast {
  right: 24px;
  bottom: 24px;
  left: auto;
  max-width: min(420px, calc(100vw - 48px));
  border-radius: 6px;
  transform: translateY(12px);
}

.toast.show {
  transform: translateY(0);
}

body.show-role-switcher .toast {
  top: 72px;
  bottom: auto;
}

body.dste-agent-mode .canvas {
  padding-top: 28px;
  padding-right: 40px;
  padding-left: 40px;
}

.agent-workbench.product-page-shell--agent {
  display: block !important;
  max-width: var(--product-shell-width) !important;
  margin: 0 auto !important;
}

.product-page-shell--agent .agent-conversation-pane {
  width: 100%;
}

.product-page-shell--agent .chat-agent-head.product-page-header {
  position: sticky;
  top: 0;
  z-index: 18;
  align-items: flex-start;
  max-width: none;
  margin: 0;
  background: #f6f8fc;
}

.product-page-shell--agent .chat-agent-head.product-page-header h1 {
  font-size: 24px;
}

.product-page-shell--agent .chat-agent-head.product-page-header p {
  margin-top: 7px;
  font-size: 13px;
}

.product-page-shell--agent .chat-agent-picker.product-workbench-surface {
  box-sizing: border-box;
  max-width: none;
  margin: 12px 0 20px;
  padding: 14px;
  border: 1px solid var(--product-shell-line);
  border-radius: 6px;
  background: #fff;
}

.product-page-shell--agent .chat-agent-grid {
  gap: 10px;
}

.product-page-shell--agent .chat-agent-card {
  min-height: 104px;
  border-radius: 6px;
  box-shadow: none;
}

.product-page-shell--agent .chat-panel,
.product-page-shell--agent .empty-state {
  max-width: 960px;
  scroll-margin-top: 116px;
}

.product-primary-nav.business-system-tabs {
  display: flex;
  align-items: stretch;
  gap: 24px;
  min-height: 48px;
  margin: 12px 0 0;
  padding: 0 14px;
  overflow-x: auto;
  border: 1px solid var(--product-shell-line);
  border-radius: 6px;
  background: #fff;
}

.product-page-shell--dste .product-primary-nav .five-stepper {
  display: flex;
  align-items: stretch;
  gap: 24px;
  height: 46px;
  min-height: 46px;
  overflow-x: auto;
  overflow-y: hidden;
}

.product-page-shell--dste .product-primary-nav .five-step {
  display: inline-flex;
  flex: 1 0 auto;
  grid-template-columns: none;
  grid-template-rows: none;
  gap: 7px;
  width: auto;
  min-height: 46px;
  height: 46px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
}

.product-page-shell--dste .product-primary-nav .five-step.active {
  border: 0;
  background: transparent !important;
  color: var(--product-shell-brand);
}

.product-page-shell--dste .product-primary-nav .five-step-index {
  display: inline-grid;
  grid-column: auto;
  grid-row: auto;
  flex: 0 0 auto;
  align-self: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 50%;
}

.product-page-shell--dste .product-primary-nav .five-step b {
  grid-column: auto;
  grid-row: auto;
  align-self: center;
}

.product-page-shell--dste .product-primary-nav .five-step small {
  display: none;
}

.product-workbench-title {
  margin: 0;
}

@media (max-width: 1100px) {
  .product-page-header {
    gap: 18px;
  }

  .product-page-header-meta,
  .product-page-shell--system .business-system-head > div:last-child {
    min-width: 150px;
  }

  .product-primary-nav .system-top-nav,
  .product-primary-nav.business-system-tabs,
  .product-primary-nav .five-stepper {
    gap: 16px;
  }
}

/* Enterprise foundation agents */
.foundation-agent-workbench{grid-template-columns:minmax(0,1fr) minmax(360px,.56fr)}
.foundation-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:18px}
.foundation-agent-card{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:start;gap:11px;min-height:164px;padding:16px;border:1px solid #dde3ea;border-radius:7px;background:#fff;text-align:left;color:#26354a}
.foundation-agent-card:hover{border-color:#a8b7c7;background:#fafcfd;box-shadow:0 4px 14px rgba(31,48,70,.07)}
.foundation-agent-card:focus-visible{outline:3px solid rgba(201,22,29,.18);outline-offset:2px}
.foundation-agent-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:5px;background:#f1f3f6;color:#c9161d;font-size:12px;font-weight:800}
.foundation-agent-card small{display:block;color:#7b8796;font-size:11px;font-weight:700}
.foundation-agent-card h3{margin:4px 0 6px;font-size:15px;color:#17263d}
.foundation-agent-card p{margin:0;color:#59677a;font-size:12px;line-height:1.58}
.foundation-agent-card em{display:block;margin-top:10px;color:#667085;font-size:10px;font-style:normal;line-height:1.45}
.foundation-agent-card>b{align-self:center;color:#b9181f;font-size:12px}
.foundation-agent-boundary{display:flex;align-items:flex-start;gap:12px;margin:0 18px 18px;padding:11px 13px;border-left:3px solid #77889b;background:#f6f8fa;color:#526072;font-size:12px;line-height:1.55}
.foundation-agent-boundary b{flex:0 0 auto;color:#26354a}
.foundation-agent-boundary.compact{margin:14px 0 0}
.foundation-agent-contract{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:14px 0}
.foundation-agent-contract>div{padding:10px 11px;border:1px solid #e0e5eb;border-radius:5px;background:#f8fafc}
.foundation-agent-contract small{display:block;color:#7b8796;font-size:10px}
.foundation-agent-contract b{display:block;margin-top:4px;color:#26354a;font-size:12px;line-height:1.45}
.foundation-agent-response{display:grid;gap:6px;margin-top:14px;padding:13px 14px;border:1px solid #dce3ea;border-radius:6px;background:#f8fafc}
.foundation-agent-response>b{font-size:13px;color:#26354a}
.foundation-agent-response p,.foundation-agent-response small{margin:0;color:#59677a;font-size:12px;line-height:1.6}
.agent-workbench-entry{border-color:#cfd8e2!important;background:#f8fafc!important}
.agent-workbench-entry b{color:#b9181f}
@media(max-width:1180px){.foundation-agent-grid{grid-template-columns:1fr}.foundation-agent-workbench{grid-template-columns:1fr}.foundation-agent-contract{grid-template-columns:1fr}}
/* Visible Agent workbench route */
.agent-workbench-linkbar{position:sticky;top:0;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 14px;padding:9px 12px;border:1px solid #dce3ea;border-radius:6px;background:rgba(255,255,255,.97);box-shadow:0 3px 10px rgba(31,48,70,.05)}
.agent-workbench-linkbar small{display:block;color:#7b8796;font-size:10px}
.agent-workbench-linkbar b{display:block;margin-top:2px;color:#26354a;font-size:12px}
.agent-workbench-linkbar button{min-height:32px;padding:5px 11px;border:1px solid #d4dce5;border-radius:5px;background:#fff;color:#b9181f;font-size:12px;font-weight:700}
.agent-workbench-linkbar button:hover{border-color:#c9161d;background:#fff7f7}
