/* CONNECT_CLOUD_OFFICE_SOFT_ELEVATION_V8
 * Reference: "Refined Cloud Office Connect Dashboard.png" (Day) and
 * "Dark SaaS Business Dashboard.png" (Dark).
 * Remove HEAVY DECORATIVE card/layout lines; keep actual input outlines,
 * selected navigation, warning bars, keyboard focus, and semantic text.
 * Cloud Office only. The shared V7 Day/Dark shell gradient stays unchanged. */

html[data-theme="day"] {
  --co-day-base: #ECE7DF;
  --cx-canvas: #ECE7DF;
  --cx-shell: #ECE7DF;
  --co-card-fill: #FFFFFF;
  --cx-surface: #FFFFFF;
  --cx-surface-2: #F6F4F0;
  --cx-rail: #FFFFFF;
  --co-card-line: rgba(20,24,33,.065);
  --co-card-hover-line: rgba(20,24,33,.14);
  --co-card-shadow: 0 12px 30px rgba(30,34,49,.08), 0 3px 10px rgba(30,34,49,.04), 0 0 1px rgba(255,255,255,.9);
  --co-card-shadow-hover: 0 18px 40px rgba(30,34,49,.13), 0 5px 14px rgba(30,34,49,.06), 0 0 2px rgba(255,255,255,1);
  --co-layout-line: rgba(20,24,33,.08);
  --co-layout-line-hover: rgba(45,48,58,.45);
  --co-search-fill: #FFFFFF;
  --co-search-line: rgba(40,45,56,.18);
  --co-search-shadow: 0 4px 14px rgba(30,34,49,.06);
  --co-search-focus-line: rgba(20, 24, 33, 0.3);
  --co-search-focus-ring: rgba(20, 24, 33, 0.08);
  --co-nav-group-ink: rgba(20, 24, 33, 0.88);
}
html[data-theme="day"] .pa-shell.is-executive-rail {
  background: var(--cx-canvas);
  background-color: var(--cx-canvas);
}
html[data-theme="dark"] {
  --co-obsidian-base: #080808;
  --cx-canvas: #080808;
  --cx-shell: #080808;
  --co-card-fill: #262626;
  --cx-surface: #262626;
  --cx-surface-2: #303030;
  --cx-input: #2a2a2a;
  --cx-rail: #262626;
  --co-card-line: rgba(255,255,255,.08);
  --co-card-hover-line: rgba(255,255,255,.18);
  --co-card-shadow: 0 12px 32px rgba(0,0,0,.65), 0 2px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
  --co-card-shadow-hover: 0 18px 42px rgba(0,0,0,.80), 0 4px 14px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.16);
  --co-layout-line: rgba(255,255,255,.07);
  --co-layout-line-hover: rgba(185,185,185,.50);
  --co-search-fill: #2e2e2e;
  --co-search-line: rgba(255,255,255,.16);
  --co-search-shadow: 0 4px 16px rgba(0,0,0,.40), inset 0 1px 0 rgba(255,255,255,.08);
  --co-search-focus-line: rgba(255, 255, 255, 0.32);
  --co-search-focus-ring: rgba(255, 255, 255, 0.12);
  --co-nav-group-ink: rgba(255, 255, 255, 0.78);
}
html[data-theme="dark"] .pa-shell.is-executive-rail {
  background: var(--cx-canvas);
  background-color: var(--cx-canvas);
}

/* Quiet elevation separates information groups instead of dark border boxes.
 * Keep a 1px border BOX in layout, but reduce its visible paint to a hairline. */
html[data-theme] .pa-shell.is-executive-rail :is(
  .pa-panel, .pa-head.cr-do-head, .cr-do-dept, .cr-do-card,
  .cr-do-start, .pa-kpi, .pa-card, .pa-card-sm, .pa-hub-card
) {
  border-radius: 20px;
  border-color: var(--co-card-line);
  background: var(--co-card-fill);
  box-shadow: var(--co-card-shadow);
  transition: border-color 160ms ease-out, box-shadow 180ms ease-out;
}
html[data-theme] .pa-shell.is-executive-rail :is(
  .pa-panel, .pa-head.cr-do-head, .cr-do-dept, .cr-do-card,
  .cr-do-start, .pa-kpi, .pa-card, .pa-card-sm, .pa-hub-card
):hover {
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}

/* Focus within a panel must not resurrect V6/V7's heavy grey outline;
 * the actual focused link/button retains its own 2px focus-visible ring. */
html[data-theme] .pa-shell.is-executive-rail :is(
  .pa-panel, .pa-head.cr-do-head, .cr-do-dept, .cr-do-card,
  .cr-do-start, .pa-kpi, .pa-card, .pa-card-sm, .pa-hub-card
):focus-within {
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}

/* The dashboard greeting is :first-child, but V7's sticky-heading shadow
 * reset must not make it look like a flat, strongly outlined container. */
html[data-theme] .pa-shell.is-executive-rail .pa-view > .pa-head.cr-do-head:first-child {
  border-color: var(--co-card-line);
  background: var(--co-card-fill);
  box-shadow: var(--co-card-shadow);
}
html[data-theme] .pa-shell.is-executive-rail .pa-view > .pa-head.cr-do-head:first-child:hover {
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}

/* The inner "Not ready" message is NOT a second elevated card. Preserve the
 * original orange left status rule without an unnecessary enclosing outline. */
html[data-theme] .pa-shell.is-executive-rail .cr-do-next {
  background: transparent;
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-next.is-warn,
html[data-theme] .pa-shell.is-executive-rail .cr-do-next.is-warn:is(:hover, :focus-within) {
  box-shadow: inset 3px 0 0 var(--cx-accent);
}

/* Get Started has one shared panel, not four individual rectangular outlines.
 * Current step circles and their selected states remain untouched. */
html[data-theme] .pa-shell.is-executive-rail .cr-do-start-steps a {
  border-color: transparent;
  background: transparent;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-start-steps a:hover {
  border-color: var(--co-card-hover-line);
  background: var(--cx-hover);
}

/* Topbar: Always 100% transparent with no dividing borders */
html[data-theme] .pa-shell.is-executive-rail .pa-topbar {
  background: transparent;
  background-color: transparent;
  border: none;
  border-bottom: none;
  box-shadow: none;
}

/* Sidebar as a floating rounded card, matching reference layout at pixel level */
@media (min-width: 641px) {
  html[data-theme] .pa-shell.is-executive-rail {
    padding: 0.75rem 0.875rem 0.75rem 0.75rem;
    gap: 0.875rem;
    box-sizing: border-box;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  html[data-theme] .pa-shell.is-executive-rail .pa-side {
    height: calc(100dvh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    border-radius: 24px;
    background: var(--co-card-fill);
    background-color: var(--co-card-fill);
    border: 1px solid var(--co-card-line);
    border-right: 1px solid var(--co-card-line);
    box-shadow: var(--co-card-shadow);
    overflow: hidden;
    padding: 1.125rem 1rem;
    align-self: start;
  }
  html[data-theme] .pa-shell.is-executive-rail .pa-side::before {
    opacity: 0;
  }
  html[data-theme] .pa-shell.is-executive-rail .pa-frame {
    height: calc(100dvh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }
  html[data-theme] .pa-shell.is-executive-rail .pa-topbar {
    flex: 0 0 auto;
    position: relative;
    z-index: 20;
    background: transparent;
    background-color: transparent;
    border: none;
    border-bottom: none;
    box-shadow: none;
    padding: 0.125rem 0.25rem 0.625rem;
    min-height: 2.75rem;
  }
  html[data-theme] .pa-shell.is-executive-rail .pa-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0.25rem 1rem;
  }
}

/* Page Headings (including "Sales needs a plan" and standard screens):
 * Vertical stacked hierarchy (h1 above description), elevated card enclosure,
 * and no negative margins that cause underlying text to peek through. */
html[data-theme] .pa-shell.is-executive-rail .pa-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--pa-s3);
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  background: var(--co-card-fill);
  border: 1px solid var(--co-card-line);
  box-shadow: var(--co-card-shadow);
  margin-bottom: var(--pa-s3);
  position: static;
}
html[data-theme] .pa-shell.is-executive-rail .pa-head > div:first-child:not(.pa-head-id) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  flex: 1 1 auto;
  min-width: 0;
}
html[data-theme] .pa-shell.is-executive-rail .pa-head h1 {
  font-size: var(--cx-text-page);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  white-space: normal;
  color: var(--cx-text);
}
html[data-theme] .pa-shell.is-executive-rail .pa-head .pa-lead {
  font-size: var(--cx-text-small);
  color: var(--cx-text-2);
  line-height: 1.5;
  white-space: normal;
  max-width: 75ch;
  margin: 0;
}
html[data-theme] .pa-shell.is-executive-rail .pa-head .pa-eyebrow {
  display: block;
  font-size: var(--cx-text-meta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cx-text-3);
  margin-bottom: 2px;
}
@media (min-width: 641px) {
  html[data-theme] .pa-shell.is-executive-rail .pa-view > .pa-head:first-child {
    position: static;
    margin: 0 0 var(--pa-s3) 0;
    box-shadow: var(--co-card-shadow);
    border: 1px solid var(--co-card-line);
    background: var(--co-card-fill);
  }
}

/* Search is an INPUT: Elevated rounded pill matching reference layout */
html[data-theme] .pa-shell.is-executive-rail :is(
  .pa-searchbar, .pa-search, .chat-search .pa-input, .pa-search input
) {
  border-radius: var(--cx-radius-pill, 9999px);
}
html[data-theme] .pa-shell.is-executive-rail .pa-searchbar {
  min-height: 2.625rem;
  height: 2.625rem;
  max-width: 36rem;
  padding: 0 1rem 0 1.125rem;
  border-radius: 9999px;
  border: 1px solid var(--co-search-line);
  background: var(--co-search-fill);
  background-color: var(--co-search-fill);
  box-shadow: var(--co-search-shadow);
  color: var(--cx-text-2);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: border-color var(--pa-fast) var(--pa-ease), box-shadow var(--pa-fast) var(--pa-ease);
}
html[data-theme] .pa-shell.is-executive-rail .pa-searchbar:hover {
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}
html[data-theme] .pa-shell.is-executive-rail .pa-searchbar:focus-within {
  border-color: var(--co-search-focus-line);
  box-shadow: 0 0 0 2px var(--co-search-focus-ring), var(--co-search-shadow);
}
html[data-theme] .pa-shell.is-executive-rail .pa-nav-group {
  color: var(--co-nav-group-ink);
  font-weight: 600;
  letter-spacing: 0.02em;
}
html[data-theme] .pa-shell.is-executive-rail .pa-searchbar span {
  font-size: var(--cx-text-small);
  color: var(--cx-text-2);
}
html[data-theme] .pa-shell.is-executive-rail .pa-searchbar .pa-kbd {
  border-radius: 8px;
  background: var(--cx-surface-2);
  border: 1px solid var(--co-card-line);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cx-text-2);
}

/* Header Action Buttons (Only 4 Kept: Assistant ✦, Activity ⚡, Bell 🔔, More ...) */
html[data-theme] .pa-shell.is-executive-rail .pa-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
html[data-theme] .pa-shell.is-executive-rail .pa-top-actions :is(
  .pa-search-icon,
  .pa-feedback-btn,
  .pa-office-quick-launch,
  [data-send-feedback],
  [data-products],
  [data-connect-theme-toggle],
  [data-office-quick-launch]
) {
  display: none;
}
html[data-theme] .pa-shell.is-executive-rail .pa-top-actions :is(
  .pa-assistant-btn,
  .pa-activity-btn,
  .pa-bell,
  .pa-v2-more
) {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--co-card-fill);
  border: 1px solid var(--co-card-line);
  box-shadow: var(--co-card-shadow);
  color: var(--cx-text-2);
  padding: 0;
  transition: transform var(--pa-fast) var(--pa-ease), box-shadow var(--pa-fast) var(--pa-ease), border-color var(--pa-fast) var(--pa-ease);
}
html[data-theme] .pa-shell.is-executive-rail .pa-top-actions :is(
  .pa-assistant-btn,
  .pa-activity-btn,
  .pa-bell,
  .pa-v2-more
):hover {
  transform: translateY(-1px);
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
  color: var(--cx-text);
}
html[data-theme] .pa-shell.is-executive-rail .pa-top-actions .pa-activity-dot {
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--cx-success);
  box-shadow: 0 0 4px var(--cx-success);
}
html[data-theme] .pa-shell.is-executive-rail .pa-top-actions .pa-badge {
  top: -0.125rem;
  right: -0.125rem;
  left: auto;
  min-width: 1.125rem;
  width: auto;
  height: 1.125rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
  border-radius: var(--cx-radius-pill, 9999px);
  background: var(--cx-warning);
  color: var(--cx-action-ink);
  font-size: max(12px, .75rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px var(--cx-shadow-1);
}

/* Live Activity Log & Sheets: Sleek Floating Card Drawer */
html[data-theme] .pa-dialog.is-sheet {
  background: var(--co-card-fill);
  background-color: var(--co-card-fill);
  color: var(--cx-text);
  border: 1px solid var(--co-card-line);
  box-shadow: var(--cx-shadow-3);
  overflow: hidden;
}
@media (min-width: 641px) {
  html[data-theme] .pa-dialog.is-sheet {
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    margin: 0 0 0 auto;
    height: calc(100dvh - 2rem);
    max-height: calc(100dvh - 2rem);
    width: min(25rem, calc(100vw - 2rem));
    border-radius: 24px;
  }
}
@media (max-width: 640px) {
  html[data-theme] .pa-dialog.is-sheet {
    margin: auto 0 0;
    height: auto;
    max-height: 92dvh;
    width: 100vw;
    border-radius: var(--cx-radius-lg) var(--cx-radius-lg) 0 0;
  }
}
html[data-theme] .pa-sheet {
  display: flex;
  flex-direction: column;
  height: 100%;
}
html[data-theme] .pa-sheet-head {
  border-bottom: 1px solid var(--co-card-line);
  padding: 1rem 1.25rem;
}
html[data-theme] .pa-sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
html[data-theme] .pa-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
html[data-theme] .pa-activity-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--co-card-line);
}
html[data-theme] .pa-activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
html[data-theme] .pa-activity-filter {
  border-radius: var(--cx-radius-pill, 9999px);
  font-size: max(12px, .75rem);
  text-transform: capitalize;
}
html[data-theme] .pa-activity-live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: max(12px, .75rem);
  color: var(--cx-text-3);
}
html[data-theme] .pa-activity-live-dot {
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--cx-success);
  margin-right: 0.25rem;
}
html[data-theme] .pa-activity-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
html[data-theme] .pa-activity-item {
  border: 1px solid var(--co-card-line);
  border-top: 1px solid var(--co-card-line);
  border-radius: 14px;
  background: var(--co-card-fill);
  box-shadow: var(--co-card-shadow);
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform var(--pa-fast) var(--pa-ease), box-shadow var(--pa-fast) var(--pa-ease);
}
html[data-theme] .pa-activity-item:hover {
  transform: translateY(-1px);
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}
html[data-theme] .pa-activity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
html[data-theme] .pa-activity-meta-left {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
html[data-theme] .pa-activity-kind {
  font-size: max(12px, .75rem);
  font-weight: 600;
  padding: 1px 0.375rem;
  border-radius: 6px;
  background: var(--cx-surface-2);
  color: var(--cx-text-2);
}
html[data-theme] .pa-activity-time {
  font-size: max(12px, .75rem);
  color: var(--cx-text-3);
  font-variant-numeric: tabular-nums;
}
html[data-theme] .pa-activity-level {
  font-size: max(12px, .75rem);
  font-weight: 600;
  padding: 1px 0.5rem;
  border-radius: var(--cx-radius-pill, 9999px);
}
html[data-theme] .pa-activity-level.is-success {
  background: var(--cx-success-soft);
  color: var(--cx-success-text);
}
html[data-theme] .pa-activity-level.is-warn {
  background: var(--cx-warning-soft);
  color: var(--cx-warning-text);
}
html[data-theme] .pa-activity-level.is-error {
  background: var(--cx-danger-soft);
  color: var(--cx-danger-text);
}
html[data-theme] .pa-activity-level.is-info {
  background: var(--cx-info-soft);
  color: var(--cx-info-text);
}
html[data-theme] .pa-activity-message {
  font-size: var(--cx-text-small);
  line-height: 1.4;
  color: var(--cx-text);
}

/* Connect Assistant Panel: Compact Floating Card Drawer with 100% Solid Opaque Background */
html[data-theme] .chat-panel {
  background: var(--co-card-fill);
  background-color: var(--co-card-fill);
  color: var(--cx-text);
  border: 1px solid var(--co-card-line);
  box-shadow: var(--cx-shadow-3);
  overflow: hidden;
  z-index: 60;
}
@media (min-width: 641px) {
  html[data-theme] .chat-panel {
    top: calc(var(--pa-top-h, 3rem) + var(--pa-safe-top, 0px) + 0.625rem);
    right: 1rem;
    bottom: 1rem;
    height: calc(100dvh - var(--pa-top-h, 3rem) - var(--pa-safe-top, 0px) - 1.625rem);
    max-height: calc(100dvh - var(--pa-top-h, 3rem) - var(--pa-safe-top, 0px) - 1.625rem);
    width: min(24.5rem, calc(100vw - 2rem));
    border-radius: 24px;
  }
}
@media (max-width: 640px) {
  html[data-theme] .chat-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
}
html[data-theme] .chat-panel-head {
  border-bottom: 1px solid var(--co-card-line);
  padding: 0.875rem 1.125rem;
  background: var(--co-card-fill);
  background-color: var(--co-card-fill);
}
html[data-theme] .chat-panel :is(.chat-convo, .chat-log, .chat-foot) {
  background: var(--co-card-fill);
  background-color: var(--co-card-fill);
}
html[data-theme] .chat-panel-mark {
  border-radius: 10px;
  width: 1.875rem;
  height: 1.875rem;
  background: var(--cx-surface-2);
  color: var(--cx-accent);
}
html[data-theme] .chat-panel-title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--cx-text);
}
html[data-theme] .chat-panel-head .pa-icon-btn {
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: var(--cx-text-2);
}
html[data-theme] .chat-panel-head .pa-icon-btn:hover {
  background: var(--cx-hover);
  color: var(--cx-text);
}

html[data-theme] .chat-home-fact {
  border-radius: 14px;
  border: 1px solid var(--co-card-line);
  background: var(--co-card-fill);
  background-color: var(--co-card-fill);
  box-shadow: var(--co-card-shadow);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--cx-text);
  line-height: 1.4;
  transition: transform var(--pa-fast) var(--pa-ease), box-shadow var(--pa-fast) var(--pa-ease);
}
html[data-theme] .chat-home-fact:hover {
  transform: translateY(-1px);
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}
html[data-theme] .chat-home-note {
  border-radius: var(--cx-radius-pill, 9999px);
  border: 1px solid var(--co-card-line);
  background: var(--cx-surface-2);
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  color: var(--cx-text-2);
}
html[data-theme] .chat-home-dept {
  border-radius: 14px;
  border: 1px solid var(--co-card-line);
  background: var(--co-card-fill);
  background-color: var(--co-card-fill);
  box-shadow: var(--co-card-shadow);
  padding: 0.5rem 0.75rem;
  transition: transform var(--pa-fast) var(--pa-ease), box-shadow var(--pa-fast) var(--pa-ease);
}
html[data-theme] .chat-home-dept:hover {
  transform: translateY(-1px);
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}

/* Chat Composer: modern pill design & HIDE LANGUAGE SELECTOR */
html[data-theme] :is(.chat-lang, select.chat-lang) {
  display: none;
}
html[data-theme] .chat-composer {
  background: transparent;
  border-top: 1px solid var(--co-card-line);
  padding: 0.75rem 1rem 0.875rem;
}
html[data-theme] .chat-composer-box {
  border-radius: var(--cx-radius-pill, 9999px);
  border: 1px solid var(--co-search-line);
  background: var(--co-search-fill);
  background-color: var(--co-search-fill);
  box-shadow: var(--co-search-shadow);
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color var(--pa-fast) var(--pa-ease), box-shadow var(--pa-fast) var(--pa-ease);
}
html[data-theme] .chat-composer-box:focus-within {
  border-color: var(--cx-focus);
  box-shadow: 0 0 0 2px var(--cx-focus);
}
html[data-theme] .chat-send,
html[data-theme] .chat-stop,
html[data-theme] [data-voice-mic].chat-mic {
  border-radius: 50%;
  width: 2.125rem;
  height: 2.125rem;
  min-width: 2.125rem;
  min-height: 2.125rem;
  display: grid;
  place-items: center;
  transition: transform var(--pa-fast) var(--pa-ease);
}
html[data-theme] .chat-send:not(:disabled):hover,
html[data-theme] .chat-stop:hover,
html[data-theme] [data-voice-mic].chat-mic:hover {
  transform: scale(1.05);
}

/* Chat Page (#/chat) */
html[data-theme] .pa-shell.is-executive-rail .chat-side,
html[data-theme] .pa-shell.is-executive-rail .chat-main {
  border-radius: 20px;
  border-color: var(--co-card-line);
  background: var(--co-card-fill);
  box-shadow: var(--co-card-shadow);
}
html[data-theme] .pa-shell.is-executive-rail .chat-filter .pa-btn {
  border-radius: var(--cx-radius-pill, 9999px);
}
html[data-theme] .pa-shell.is-executive-rail .chat-main-head {
  border-bottom: 1px solid var(--co-card-line);
}

/* Inner Screens: soften crowded dividing lines across CRM reports, tables, dialogs */
html[data-theme] .pa-shell.is-executive-rail :is(
  .cr-rep-grid .pa-card, .cr-rep-card, .pa-dialog, .pa-menu,
  .pa-table-wrap, .pa-card-group, .pa-box, .pa-status-card
) {
  border-radius: 18px;
  border-color: var(--co-card-line);
  background: var(--co-card-fill);
  box-shadow: var(--co-card-shadow);
}
html[data-theme] .pa-shell.is-executive-rail .pa-row {
  border-top-color: var(--co-card-line);
}
html[data-theme] .pa-shell.is-executive-rail .pa-table th,
html[data-theme] .pa-shell.is-executive-rail .pa-table td {
  border-bottom-color: var(--co-card-line);
}

html[data-theme="day"] .pa-shell.is-executive-rail .pa-nav > a[aria-current="page"] {
  background: linear-gradient(90deg, color-mix(in srgb, var(--exec-copper) 14%, transparent) 0%, transparent 100%);
  border-radius: 0.6875rem;
}

/* Sidebar Navigation: High Contrast Highlight for Menu Groups & Top Items */
html[data-theme="day"] .pa-shell.is-executive-rail .pa-nav :is(> a, .pa-v2-group > summary, .pa-v2-action, .pa-nav-group) {
  color: var(--cx-text);
  font-weight: 620;
}
html[data-theme="day"] .pa-shell.is-executive-rail .pa-nav .pa-v2-group > summary > .pa-ico:first-child,
html[data-theme="day"] .pa-shell.is-executive-rail .pa-nav > a > .pa-ico:first-child,
html[data-theme="day"] .pa-shell.is-executive-rail .pa-nav .pa-v2-action > .pa-ico:first-child {
  color: var(--cx-text-2);
  stroke-width: 1.8;
}
html[data-theme="dark"] .pa-shell.is-executive-rail .pa-nav :is(> a, .pa-v2-group > summary, .pa-v2-action, .pa-nav-group) {
  color: var(--cx-text);
  font-weight: 600;
}

/* Department Cards: Full 3D Artwork & Centered Department Name Only */
html[data-theme] .pa-shell.is-executive-rail .cr-do-grid {
  gap: 1rem;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding: 1rem 1rem 1.25rem;
  border-radius: 20px;
  background: var(--co-card-fill);
  border: 1px solid var(--co-card-line);
  box-shadow: var(--co-card-shadow);
  overflow: hidden;
  text-align: center;
  transition: transform var(--pa-fast) var(--pa-ease), box-shadow var(--pa-fast) var(--pa-ease), border-color var(--pa-fast) var(--pa-ease);
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept:hover {
  transform: translateY(-2px);
  border-color: var(--co-card-hover-line);
  box-shadow: var(--co-card-shadow-hover);
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept .cr-do-dept-figure {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border-radius: var(--cx-radius-pill, 9999px);
  background: var(--cx-surface-2);
  border: 1px solid var(--co-card-line);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cx-text-2);
  z-index: 2;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept .cr-do-dept-art {
  width: 100%;
  height: 10.5rem;
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  background-color: transparent;
  border: none;
  border-bottom: none;
  padding: 0.5rem 0.5rem 0;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept .cr-do-dept-art .cr-do-art {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 9.75rem;
  object-fit: contain;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept .cr-do-dept-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.5rem 0;
  gap: 0;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cx-text);
  text-align: center;
}
html[data-theme] .pa-shell.is-executive-rail .cr-do-dept :is(.cr-do-dept-lead, .cr-do-benefits) {
  display: none;
}

/* Mobile Navigation Drawer, Search & Tabs */
@media (max-width: 640px) {
  html[data-theme] .pa-shell.is-executive-rail .pa-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 20rem);
    height: 100dvh;
    max-height: 100dvh;
    z-index: 50;
    border-radius: 0;
    background: var(--co-card-fill);
    background-color: var(--co-card-fill);
    box-shadow: var(--cx-shadow-3);
  }
  html[data-theme] .pa-shell.is-executive-rail .pa-searchbar {
    display: none;
  }
  html[data-theme] .pa-shell.is-executive-rail .pa-tabbar {
    background: var(--co-card-fill);
    background-color: var(--co-card-fill);
  }
}

/* Body-mounted dialog boundaries are functional and remain visible.
 * Avoid changing token contrast verified in V7 (including status badges). */

/* Universal Charcoal Grey Popups, Menus & Overlays for Executive Cloud Office */
html[data-theme="dark"] body:has(.pa-shell.is-executive-rail) :is(
  .ac-menu, .ac-menu.is-executive, .pa-menu, .pa-dialog, .pa-palette, .pa-sheet
) {
  --co-menu-bg: #262626;
  --co-menu-line: rgba(255, 255, 255, 0.12);
  --co-menu-hover: #323232;
  --co-menu-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  --cx-surface: var(--co-menu-bg);
  --cx-surface-2: #303030;
  --cx-hover: var(--co-menu-hover);
  --cx-border: var(--co-menu-line);
  --cx-border-soft: rgba(255, 255, 255, 0.08);
  --co-account-menu-bg: var(--co-menu-bg);
  --co-account-menu-line: var(--co-menu-line);
  --co-deepblack-menu: var(--co-menu-bg);
  background: var(--co-menu-bg);
  background-color: var(--co-menu-bg);
  border-color: var(--co-menu-line);
  border-radius: 16px;
  box-shadow: var(--co-menu-shadow);
}
html[data-theme="day"] body:has(.pa-shell.is-executive-rail) :is(
  .ac-menu, .ac-menu.is-executive, .pa-menu, .pa-dialog, .pa-palette, .pa-sheet
) {
  --co-menu-day-bg: #FFFFFF;
  --co-menu-day-line: rgba(20, 24, 33, 0.1);
  --co-menu-day-hover: #F5F3EF;
  --co-menu-day-shadow: 0 16px 36px rgba(30, 34, 49, 0.12), 0 3px 10px rgba(30, 34, 49, 0.06);
  --cx-surface: var(--co-menu-day-bg);
  --cx-surface-2: #F6F4F0;
  --cx-hover: var(--co-menu-day-hover);
  --cx-border: var(--co-menu-day-line);
  --cx-border-soft: rgba(20, 24, 33, 0.06);
  --co-account-menu-bg: var(--co-menu-day-bg);
  --co-account-menu-line: var(--co-menu-day-line);
  background: var(--co-menu-day-bg);
  background-color: var(--co-menu-day-bg);
  border-color: var(--co-menu-day-line);
  border-radius: 16px;
  box-shadow: var(--co-menu-day-shadow);
}
html[data-theme="dark"] body:has(.pa-shell.is-executive-rail) :is(.ac-menu, .pa-menu) :is(.ac-row:hover, button.ac-business:hover, a.ac-head:hover, .pa-menu-item:hover, .pa-menu-item:focus-visible) {
  background: var(--co-menu-hover);
  color: var(--cx-text);
}
html[data-theme="dark"] body:has(.pa-shell.is-executive-rail) .ac-menu .ac-business {
  background: var(--cx-surface-2);
  border-top-color: var(--co-menu-line);
}
html[data-theme="day"] body:has(.pa-shell.is-executive-rail) :is(.ac-menu, .pa-menu) :is(.ac-row:hover, button.ac-business:hover, a.ac-head:hover, .pa-menu-item:hover, .pa-menu-item:focus-visible) {
  background: var(--co-menu-day-hover);
  color: var(--cx-text);
}
html[data-theme="day"] body:has(.pa-shell.is-executive-rail) .ac-menu .ac-business {
  background: var(--cx-surface-2);
  border-top-color: var(--co-menu-day-line);
}

/* Fix mid-word breaking in Needs You items */
html[data-theme] .chat-home-label {
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
  hyphens: none;
}
html[data-theme] .chat-home-grid {
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
}

/* Full-page Connect Chat Assistant Enhancement */
html[data-theme] .chat-convo:not(.is-compact) .chat-empty {
  max-width: min(62rem, 100%);
  padding: 2.25rem 1rem 1.5rem;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-empty.is-home {
  max-width: min(62rem, 100%);
}
html[data-theme] .chat-convo:not(.is-compact) .chat-empty.is-home > h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-home-intro {
  max-width: 46rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-home-dept-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.125rem;
  width: 100%;
  margin-top: 1rem;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-home-dept {
  padding: 1.25rem 1.375rem;
  min-height: 8.5rem;
  border-radius: 18px;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-home-dept-ask h3 {
  font-size: 1.1875rem;
  font-weight: 700;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-home-dept-ask p {
  font-size: 0.9375rem;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-home-starters {
  gap: 0.5rem;
  margin-top: 0.75rem;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-home-starter {
  min-height: 2.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 9999px;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-composer {
  max-width: min(62rem, 100%);
  margin: 0 auto;
  width: 100%;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-composer-box {
  min-height: 3.5rem;
  padding: 0.5rem 0.875rem 0.5rem 1.25rem;
  border-radius: 18px;
}
html[data-theme] .chat-convo:not(.is-compact) .chat-composer-box textarea {
  font-size: 1.0625rem;
}

/* Collapsed rail toggle alignment */
.pa-shell.is-executive-rail.is-rail .pa-side-head {
  padding: 0.5rem 0.25rem;
  position: relative;
}
.pa-shell.is-executive-rail.is-rail .pa-brand {
  padding: 0;
  display: flex;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] .pa-shell.is-executive-rail :is(
    .pa-panel, .pa-head.cr-do-head, .cr-do-dept, .cr-do-card,
    .cr-do-start, .pa-kpi, .pa-card, .pa-card-sm, .pa-hub-card
  ) { transition: none; }
}
@media (forced-colors: active) {
  html[data-theme] .pa-shell.is-executive-rail :is(
    .pa-panel, .pa-head.cr-do-head, .cr-do-dept, .cr-do-card,
    .cr-do-start, .pa-kpi, .pa-card, .pa-card-sm, .pa-hub-card
  ) {
    border-color: CanvasText;
    background: Canvas;
    box-shadow: none;
  }
  html[data-theme] .pa-shell.is-executive-rail :is(.pa-side, .pa-topbar) {
    border-color: CanvasText;
  }
}
