/* PitStrike shell — main navigation and splash (tokens + layout) */

:root {
  --pitstrike-bg: #0b0f14;
  --pitstrike-surface: #121821;
  --pitstrike-accent: #ff6a00;
  --pitstrike-secondary: #00c2ff;
  --pitstrike-text: #e6edf3;
  --pitstrike-border-glow: rgba(0, 194, 255, 0.22);
  /* Enterprise topnav sizing system */
  --topnav-height: 58px;
  --topnav-control-h: 36px;
  --topnav-radius: 8px;
  --topnav-gap: 10px;
  --topnav-padding-x: 14px;
  --topnav-font-size: 12px;

  /* Button accent tokens */
  --btn-connect-from: rgba(210, 153, 34, 0.22);
  --btn-connect-to:   rgba(13, 17, 23, 0.88);
  --btn-connect-border: rgba(210, 153, 34, 0.5);
  --btn-ai-from:     rgba(138, 108, 220, 0.18);
  --btn-ai-to:       rgba(13, 17, 23, 0.72);
  --btn-ai-border:   rgba(138, 108, 220, 0.45);
  --btn-tools-from:  rgba(56, 130, 220, 0.12);
  --btn-tools-border: rgba(56, 130, 220, 0.35);

  /* Primary tab palette (controlled, premium tints) */
  --tab-ai: rgba(163, 113, 247, 0.75);       /* violet */
  --tab-calendar: rgba(88, 166, 255, 0.75);  /* blue */
  --tab-command: rgba(0, 194, 255, 0.75);    /* cyan */
  --tab-monitor: rgba(48, 209, 176, 0.75);   /* teal */
  --tab-news: rgba(210, 153, 34, 0.8);       /* amber */
  --tab-scrapbook: rgba(255, 95, 199, 0.75); /* magenta */
}

/* ── Keyframe animations ── */
@keyframes ps-nav-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes ps-connect-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(210, 153, 34, 0); }
  50%       { box-shadow: 0 0 0 4px rgba(210, 153, 34, 0.18), 0 0 18px rgba(210, 153, 34, 0.28); }
}

@keyframes ps-dot-ripple {
  0%   { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

@keyframes ps-badge-pop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1);   opacity: 1; }
}

/* Top bar: deep glass with animated shimmer line */
.app-top-bar {
  position: relative;
  z-index: var(--z-nav, 30000);
  background: linear-gradient(180deg, rgba(16, 21, 30, 0.97) 0%, rgba(10, 13, 20, 0.99) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 1px 0 rgba(0, 194, 255, 0.12), 0 6px 30px rgba(0, 0, 0, 0.55);
  overflow: visible;
}

/* Animated glow line at the bottom of the bar */
.app-top-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 194, 255, 0.45) 20%,
    rgba(138, 108, 220, 0.6) 50%,
    rgba(0, 194, 255, 0.45) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: ps-nav-shimmer 5s linear infinite;
  pointer-events: none;
}

.app-top-bar__tier--primary.main-nav-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  row-gap: 0;
  min-height: var(--topnav-height);
  padding: 6px 16px;
  box-sizing: border-box;
  width: 100%;
}

/* Four balanced zones: identity | telemetry (flex) | command | status */
.app-top-bar__zone--identity {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(280px, 28vw);
}

.app-top-bar__zone--identity .main-nav__brand-cluster {
  max-width: min(240px, 28vw);
  padding-right: 10px;
}

.app-top-bar__zone--telemetry {
  flex: 2 1 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

/* When KPI strip is collapsed to the toggle, shrink this zone so command/search gains width */
.app-top-bar__zone--telemetry.app-top-bar__zone--telemetry--kpi-collapsed {
  flex: 0 0 auto;
  min-width: 0;
}

.app-top-bar__zone--telemetry--kpi-collapsed .kpi-rail.kpi-rail--in-header {
  width: auto;
}

.app-top-bar__zone--command {
  flex: 1 1 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  min-width: 0;
}

/* Unified action cluster (Search → Connect → Ask → Tools → Actions) */
.pitstrike-command-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 255, 0.08);
  background: rgba(255, 255, 255, 0.022);
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

/* Zone 3 hierarchy: Search leads, Connect = primary CTA, Ask = premium secondary, Tools/Actions = utility */
.pitstrike-command-group .pitstrike-command-palette-trigger {
  order: 0;
}

.pitstrike-command-group .pitstrike-topnav-px-cluster {
  order: 1;
}

.pitstrike-command-group #nav-command {
  order: 2;
}

.pitstrike-command-group #command-side-panel-toggle {
  order: 3;
}

.pitstrike-command-group .pitstrike-shell-actions-panel {
  order: 4;
}

.pitstrike-command-group .pitstrike-topnav-connect,
.pitstrike-command-group .pitstrike-topnav-setup {
  border-color: var(--btn-connect-border);
  background: linear-gradient(180deg, var(--btn-connect-from), var(--btn-connect-to));
  color: #f0d080;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 0 12px rgba(210, 153, 34, 0.12), inset 0 1px 0 rgba(255, 220, 100, 0.08);
  animation: ps-connect-pulse 2.4s ease-in-out infinite;
  white-space: nowrap;
}

.pitstrike-command-group .pitstrike-topnav-connect:hover,
.pitstrike-command-group .pitstrike-topnav-setup:hover {
  border-color: rgba(226, 179, 80, 0.72);
  background: linear-gradient(180deg, rgba(226, 179, 80, 0.3), rgba(13, 17, 23, 0.9));
  color: #fff;
  animation: none;
  box-shadow: 0 0 20px rgba(210, 153, 34, 0.3), 0 4px 12px rgba(0,0,0,0.4);
}

.pitstrike-command-group #nav-command.ux-nav__action-btn--command {
  font-weight: 700;
  letter-spacing: 0.01em;
  border-color: var(--btn-ai-border);
  background: linear-gradient(180deg, var(--btn-ai-from), var(--btn-ai-to));
  color: #c5a8ff;
  box-shadow: 0 0 8px rgba(138, 108, 220, 0.12), inset 0 1px 0 rgba(180, 140, 255, 0.06);
  white-space: nowrap;
}

.pitstrike-command-group #nav-command.ux-nav__action-btn--command:hover {
  border-color: rgba(163, 113, 247, 0.65);
  background: linear-gradient(180deg, rgba(163, 113, 247, 0.26), rgba(13, 17, 23, 0.85));
  color: #ddc4ff;
  box-shadow: 0 0 16px rgba(138, 108, 220, 0.28), 0 4px 10px rgba(0,0,0,0.35);
}

.pitstrike-command-group #command-side-panel-toggle {
  font-weight: 600;
  border-color: var(--btn-tools-border);
  background: linear-gradient(180deg, var(--btn-tools-from), rgba(13, 17, 23, 0.72));
  color: rgba(130, 185, 255, 0.92);
  white-space: nowrap;
}

.pitstrike-command-group #command-side-panel-toggle:hover {
  border-color: rgba(88, 166, 255, 0.55);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.2), rgba(13, 17, 23, 0.8));
  color: #a8d0ff;
  box-shadow: 0 0 12px rgba(56, 130, 220, 0.2);
}

.pitstrike-command-group .pitstrike-shell-actions-panel__summary {
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(201, 209, 217, 0.82);
  white-space: nowrap;
}

.pitstrike-command-group .pitstrike-shell-actions-panel__summary:hover {
  border-color: rgba(255, 200, 60, 0.35);
  background: rgba(255, 200, 60, 0.06);
  color: #f0d080;
}

@media (min-width: 1280px) and (max-width: 1440px) {
  .app-top-bar__zone--identity {
    max-width: min(260px, 30vw);
  }

  .app-top-bar__zone--telemetry {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Search / jump: first read in Zone 3 */
.pitstrike-command-group .pitstrike-command-palette-trigger {
  flex: 2 1 auto;
  min-width: 140px;
  max-width: 360px;
  height: var(--topnav-control-h);
  font-weight: 600;
  font-size: 12px;
  border-color: rgba(120, 160, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(180, 195, 215, 0.75);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.pitstrike-command-group .pitstrike-command-palette-trigger:hover {
  border-color: rgba(88, 166, 255, 0.38);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(220, 232, 248, 0.92);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.08);
}

.app-top-bar__zone--status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.pitstrike-env-badge--in-identity {
  flex-shrink: 0;
}

.pitstrike-runtime-device-strip {
  flex-shrink: 1;
  min-width: 0;
  max-width: 42vw;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(200, 210, 230, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Premium Actions panel (grouped sections) */
.pitstrike-shell-actions-panel {
  position: relative;
}

.pitstrike-shell-actions-panel > .pitstrike-shell-actions-panel__summary {
  list-style: none;
}

.pitstrike-shell-actions-panel > .pitstrike-shell-actions-panel__summary::-webkit-details-marker {
  display: none;
}

.pitstrike-shell-actions-panel .desk-layout-nav__panel {
  right: 0;
  left: auto;
  min-width: min(300px, 92vw);
  max-width: min(380px, 94vw);
  max-height: min(72vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(120, 160, 255, 0.18);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.pitstrike-actions-panel__group {
  margin-bottom: 16px;
}

.pitstrike-actions-panel__group:last-child {
  margin-bottom: 0;
}

.pitstrike-actions-panel__group-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(139, 148, 158, 0.88);
  margin: 0 0 8px;
}

.pitstrike-actions-panel__row {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(88, 166, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: #e6edf3;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.pitstrike-actions-panel__row:hover {
  background: rgba(90, 130, 255, 0.08);
  border-color: rgba(120, 160, 255, 0.22);
  transform: translateY(-1px);
}

.pitstrike-actions-panel__row--link {
  color: #79c0ff;
}

.pitstrike-actions-panel__desk {
  margin-top: 4px;
}

.pitstrike-actions-panel__desk .pitstrike-actions-panel__subsummary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(88, 166, 255, 0.25);
  font-size: 11px;
  font-weight: 700;
  color: rgba(201, 209, 217, 0.95);
}

.pitstrike-actions-panel__desk .pitstrike-actions-panel__subsummary::-webkit-details-marker {
  display: none;
}

.pitstrike-actions-panel__desk-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(48, 54, 61, 0.55);
}

/* Full-width geometry edit strip below primary tier */
.app-top-bar__tier--geometry-edit.dashboard-geometry-edit-tier {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.75);
  background: rgba(18, 14, 8, 0.65);
  box-sizing: border-box;
}

.app-top-bar__tier--geometry-edit.dashboard-geometry-edit-tier[hidden] {
  display: none !important;
}

.app-top-bar__tier--geometry-edit .dashboard-geometry-edit-tier__label {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 167, 87, 0.95);
}

.app-top-bar__tier--geometry-edit .dashboard-geometry-edit-tier__btn {
  font-size: 10px;
  font-weight: 700;
  padding: 5px 11px;
}

/* ---------------- Enterprise topnav layout zones ---------------- */
.topnav {
  gap: var(--topnav-gap);
}

.topnav__brand {
  flex: 0 0 auto;
  max-width: min(280px, 26vw);
}

.topnav__center {
  flex: 1 1 auto;
  min-width: 0;
}

.topnav__mode {
  flex: 0 0 auto;
}

.topnav__utilities {
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .topnav__brand {
    flex-basis: 260px;
    max-width: 260px;
  }
}

/* Left: menu + square logo + title + version — one horizontal cluster */
.main-nav__brand-cluster {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(480px, 46vw);
  padding-right: 8px;
  border-right: 1px solid rgba(48, 54, 61, 0.65);
}

/* Logo + title + version + tagline — grouped beside the icon */
.main-nav__brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.app-top-bar__cluster--menu {
  flex-shrink: 0;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid rgba(48, 54, 61, 0.55);
}

.app-menubar.app-menubar--inline {
  gap: 0;
}

.main-nav__logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  overflow: hidden;
  text-decoration: none;
  background: rgba(13, 17, 23, 0.9);
  border: 1px solid rgba(0, 194, 255, 0.28);
  box-shadow: 0 0 10px rgba(0, 194, 255, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.4);
  line-height: 0;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.main-nav__logo-link:hover {
  border-color: rgba(0, 194, 255, 0.6);
  box-shadow: 0 0 20px rgba(0, 194, 255, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.main-nav__logo-img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
  image-rendering: auto;
}

.main-nav__logo-img--legacy-removed {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
  image-rendering: auto;
}

.main-nav__brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
}

.main-nav__brand-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.main-nav__brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e6edf3 30%, rgba(0, 194, 255, 0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.main-nav__brand-tagline {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0, 194, 255, 0.55);
  line-height: 1.25;
}

.main-nav__brand-cluster .header-version-link {
  margin: 0;
  height: var(--topnav-control-h);
  padding: 0 var(--topnav-padding-x);
  font-size: var(--topnav-font-size);
  font-weight: 650;
  letter-spacing: 0.04em;
  border-radius: var(--topnav-radius);
  border: 1px solid rgba(48, 54, 61, 0.55);
  background: rgba(22, 27, 34, 0.35);
  color: rgba(201, 209, 217, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.14s ease;
}

.main-nav__brand-cluster .header-version-link:hover {
  border-color: rgba(88, 166, 255, 0.25);
  background: rgba(22, 27, 34, 0.55);
  color: rgba(230, 237, 243, 0.9);
  transform: translateY(-1px);
}

.main-nav__brand-cluster .header-version-link:active {
  transform: translateY(0px) scale(0.99);
}

/* Center: tiered workspace nav (primary + secondary rows) */
.main-nav__workspace.workspace-tabs.main-nav__nav-stack {
  flex: 2 1 min(420px, 40vw);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  justify-content: center;
}

.main-nav__workspace.workspace-tabs:not(.main-nav__nav-stack) {
  flex: 2 1 min(420px, 40vw);
  min-width: 0;
  display: flex;
  align-items: center;
}

/* New center nav stack */
.topnav__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px;
  border-radius: calc(var(--topnav-radius) + 2px);
  border: 1px solid rgba(48, 54, 61, 0.7);
  background: rgba(13, 17, 23, 0.48);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.topnav__primary::-webkit-scrollbar { display: none; }

.topnav__tab {
  --tab-tint: rgba(88, 166, 255, 0.65);
  appearance: none;
  -webkit-appearance: none;
  height: var(--topnav-control-h);
  padding: 0 var(--topnav-padding-x);
  font-size: var(--topnav-font-size);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--topnav-radius);
  border: 1px solid transparent;
  background: transparent;
  color: rgba(201, 209, 217, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.14s ease;
}

.topnav__tab:hover {
  border-color: color-mix(in srgb, var(--tab-tint) 38%, transparent);
  background: color-mix(in srgb, var(--tab-tint) 8%, rgba(13, 17, 23, 0.55));
  box-shadow: 0 0 12px color-mix(in srgb, var(--tab-tint) 14%, transparent);
  color: rgba(230, 237, 243, 0.96);
  transform: translateY(-1px);
}

.topnav__tab:active {
  transform: translateY(0px) scale(0.99);
}

.topnav__tab.active,
.topnav__tab[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--tab-tint) 55%, rgba(48, 54, 61, 0.35));
  background: color-mix(in srgb, var(--tab-tint) 12%, rgba(13, 17, 23, 0.65));
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 6px 16px color-mix(in srgb, var(--tab-tint) 12%, transparent);
  color: #e6edf3;
}

.topnav__tab--ai { --tab-tint: var(--tab-ai); }
.topnav__tab--calendar { --tab-tint: var(--tab-calendar); }
.topnav__tab--command { --tab-tint: var(--tab-command); }
.topnav__tab--monitor { --tab-tint: var(--tab-monitor); }
.topnav__tab--news { --tab-tint: var(--tab-news); }
.topnav__tab--scrapbook { --tab-tint: var(--tab-scrapbook); }

.topnav__secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-left: 8px;
  opacity: 0.92;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.topnav__secondary::-webkit-scrollbar { display: none; }

.topnav__subtab {
  height: 28px;
  padding: 0 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9px;
  border: 1px solid rgba(48, 54, 61, 0.55);
  background: rgba(13, 17, 23, 0.22);
  color: rgba(201, 209, 217, 0.72);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.topnav__subtab:hover {
  border-color: rgba(88, 166, 255, 0.28);
  background: rgba(88, 166, 255, 0.06);
  color: rgba(230, 237, 243, 0.9);
}

.topnav__subtab.active {
  border-color: rgba(88, 166, 255, 0.4);
  background: rgba(88, 166, 255, 0.08);
  color: rgba(230, 237, 243, 0.94);
}

/* Hide legacy "More workspaces" disclosure in the new enterprise bar */
.main-nav__workspaces-more { display: none !important; }


/* Wide screens: keep the whole top bar on ONE line.
   Tabs become horizontally scrollable instead of wrapping / creating vertical void. */
@media (min-width: 1041px) {
  .app-top-bar__tier--primary.main-nav-row {
    flex-wrap: nowrap;
    row-gap: 0;
  }

  .main-nav__brand-cluster {
    max-width: min(360px, 28vw);
  }

  .main-nav__workspace.workspace-tabs.main-nav__nav-stack {
    flex: 1 1 auto;
    max-width: 52vw;
  }

  /* Legacy workspace tab row (kept for older pages; terminal uses .topnav__primary/.topnav__secondary). */
}

/* Legacy workspace-tab / "More workspaces" presentation removed from the enterprise topnav path.
   (Terminal now uses .topnav__primary/.topnav__secondary.) */

/* Trading actions immediately before health chip; nowrap keeps both on the top row (avoids health-only line + actions wrapping below). */
.main-nav__right {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

/* Center: Desk | Dashboard | Layout — segmented control, not rainbow pills */
.main-nav__center-cluster {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.workspace-mode-segmented {
  display: inline-flex;
  align-items: stretch;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.75);
  background: rgba(13, 17, 23, 0.72);
  overflow: visible;
}

.workspace-mode-segmented__desk {
  position: relative;
}

.workspace-mode-segmented__segment,
.workspace-mode-segmented__segment--summary {
  margin: 0;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(201, 209, 217, 0.88);
  padding: 6px 12px;
  border: none;
  border-right: 1px solid rgba(48, 54, 61, 0.65);
  background: transparent;
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
}

.workspace-mode-segmented > button.workspace-mode-segmented__segment:last-of-type {
  border-right: none;
}

.workspace-mode-segmented__desk .workspace-mode-segmented__segment--summary {
  list-style: none;
  display: flex;
  align-items: center;
}

.workspace-mode-segmented__desk .workspace-mode-segmented__segment--summary::-webkit-details-marker {
  display: none;
}

.workspace-mode-segmented__segment:hover,
.workspace-mode-segmented__desk .workspace-mode-segmented__segment--summary:hover {
  background: rgba(88, 166, 255, 0.07);
  color: var(--pitstrike-text);
}

.workspace-mode-segmented__desk[open] .workspace-mode-segmented__segment--summary {
  background: rgba(88, 166, 255, 0.1);
  color: var(--pitstrike-text);
}

.workspace-mode-segmented__desk .desk-layout-nav__panel {
  left: 0;
  right: auto;
  top: calc(100% + 6px);
}

/* Mode switch: context only (lower visual weight than workspace tabs). */
.workspace-mode-segmented--context {
  opacity: 0.88;
  border-color: rgba(48, 54, 61, 0.55);
  background: rgba(13, 17, 23, 0.55);
}

.workspace-mode-segmented--context .workspace-mode-segmented__segment,
.workspace-mode-segmented--context .workspace-mode-segmented__segment--summary {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  color: rgba(201, 209, 217, 0.72);
}

.workspace-mode-segmented--context .workspace-mode-segmented__segment:hover,
.workspace-mode-segmented--context .workspace-mode-segmented__desk .workspace-mode-segmented__segment--summary:hover {
  color: rgba(230, 237, 243, 0.88);
}

/* ⋯ flyout: desktop menus tucked out of the brand row */
.main-nav__overflow {
  position: relative;
}

.main-nav__overflow > .main-nav__overflow-panel {
  right: 0;
  left: auto;
  min-width: min(300px, 94vw);
  padding: 10px 12px;
}

.app-menubar.app-menubar--flyout {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  width: 100%;
}

.app-menubar--flyout .app-menubar__item {
  width: 100%;
}

.app-menubar--flyout .app-menu-trigger {
  display: block;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.app-menubar--flyout .app-menu-dropdown {
  position: static;
  margin-top: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.main-nav__chip--latency {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Collapsed system health + expanded detail chips */
.main-nav__system-health {
  position: relative;
  flex: 0 0 auto;
}

.main-nav__system-health-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--topnav-control-h);
  padding: 0 var(--topnav-padding-x);
  border-radius: var(--topnav-radius);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  font-size: var(--topnav-font-size);
  font-weight: 600;
  color: rgba(201, 209, 217, 0.78);
  user-select: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.main-nav__system-health-summary:hover {
  border-color: rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.06);
  color: #aff5b4;
}

.main-nav__system-health-summary::-webkit-details-marker {
  display: none;
}

.main-nav__health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.main-nav__health-dot--ok {
  background: #3fb950;
  box-shadow: 0 0 6px rgba(63, 185, 80, 0.55);
  animation: ps-dot-ripple 2.2s ease-out infinite;
}

/* Open panel: kill the pulse so the control is stable and clickable (no visual fight with expand). */
.main-nav__system-health[open] .main-nav__health-dot--ok {
  animation: none;
  box-shadow: 0 0 6px rgba(63, 185, 80, 0.55);
}

.main-nav__health-dot--warn {
  background: #d29922;
  box-shadow: 0 0 6px rgba(210, 153, 34, 0.35);
}

.main-nav__health-dot--info {
  background: rgba(88, 166, 255, 0.65);
  box-shadow: 0 0 5px rgba(88, 166, 255, 0.25);
}

.main-nav__health-dot--err {
  background: #f85149;
  box-shadow: 0 0 6px rgba(248, 81, 73, 0.35);
}

.main-nav__system-health-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: var(--z-overlay, 30010);
  min-width: min(340px, 94vw);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(18, 24, 33, 0.98);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.main-nav__chip--status {
  font-size: 10px;
  padding: 3px 8px;
  opacity: 0.95;
}

/* Right rail: unified control bar */
.nav-right-controls.ux-nav--command-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  border-radius: calc(var(--topnav-radius) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
  flex-shrink: 1;
}

.nav-right-controls.ux-nav--command-actions > * {
  flex: 0 0 auto;
}

/* Right actions: one visual language (no gold/purple/orange decoration) */
.ux-nav--command-actions {
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  flex-shrink: 1;
}

button.ux-nav__action-btn {
  margin: 0;
  font: inherit;
}

.ux-nav__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  font-size: var(--topnav-font-size);
  font-weight: 600;
  height: var(--topnav-control-h);
  padding: 0 var(--topnav-padding-x);
  border-radius: var(--topnav-radius);
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(22, 27, 34, 0.6);
  color: rgba(230, 237, 243, 0.82);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    transform 0.14s ease;
}

.ux-nav__action-btn:hover {
  transform: translateY(-1px);
}

.ux-nav__action-btn:active {
  transform: translateY(0px) scale(0.99);
}

.ux-nav__action-btn--primary {
  border-color: rgba(88, 166, 255, 0.5);
  background: rgba(88, 166, 255, 0.12);
  color: #e6edf3;
}

.ux-nav__action-btn--primary:hover {
  border-color: rgba(88, 166, 255, 0.75);
  background: rgba(88, 166, 255, 0.2);
}

.ux-nav__action-btn--secondary:hover {
  border-color: rgba(88, 166, 255, 0.38);
  background: rgba(88, 166, 255, 0.07);
}

.ux-nav__action-btn--quiet {
  border-color: rgba(139, 148, 158, 0.35);
  color: rgba(201, 209, 217, 0.78);
  font-weight: 500;
  background: transparent;
}

.ux-nav__action-btn--quiet:hover {
  border-color: rgba(248, 81, 73, 0.45);
  color: #ffa198;
  background: rgba(248, 81, 73, 0.06);
}

/* Command — same family as actions; blue emphasis = primary interactive (not orange) */
.ux-nav__link--home.ux-nav__action-btn {
  border-color: rgba(88, 166, 255, 0.48);
  background: rgba(88, 166, 255, 0.1);
  color: #e6edf3;
  font-weight: 700;
}

.ux-nav__link--home.ux-nav__action-btn:hover {
  border-color: rgba(88, 166, 255, 0.75);
  background: rgba(88, 166, 255, 0.18);
}

/* Primary copilot entry — reads as one intentional control, not another chrome button. */
.ux-nav__action-btn--command.ux-nav__link--home {
  height: var(--topnav-control-h);
  padding: 0 calc(var(--topnav-padding-x) + 2px);
  font-weight: 750;
  letter-spacing: -0.01em;
  border-color: rgba(88, 166, 255, 0.55);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.12), rgba(13, 17, 23, 0.55));
  box-shadow: none;
}

.ux-nav__action-btn--command.ux-nav__link--home:hover {
  border-color: rgba(88, 166, 255, 0.78);
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.24), rgba(13, 17, 23, 0.72));
}

.ux-nav__action-btn--overflow {
  min-width: 34px;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  color: rgba(201, 209, 217, 0.78);
  border-color: rgba(48, 54, 61, 0.55);
  background: rgba(13, 17, 23, 0.45);
}

.ux-nav__action-btn--overflow:hover {
  color: var(--pitstrike-text);
  border-color: rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.06);
}

.main-nav__hidden-desktop-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.main-nav__debug-anchor {
  /* Visible debug toggle in the top nav */
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.main-nav__debug-anchor:hover {
  opacity: 1;
}

.main-nav__debug-anchor[aria-pressed='true'],
.main-nav__debug-anchor.main-nav__debug-anchor--active {
  background: rgba(210, 56, 56, 0.15) !important;
  border-color: rgba(210, 56, 56, 0.45) !important;
  color: #f85149 !important;
  opacity: 1;
}

.pitstrike-account-menu__summary {
  list-style: none;
}

.pitstrike-account-menu__summary::-webkit-details-marker {
  display: none;
}

/* -------- Enterprise right-rail menus (Profile / Actions) -------- */
.topnav-menu__panel {
  padding: 10px;
  border-radius: calc(var(--topnav-radius) + 2px);
  border: 1px solid rgba(48, 54, 61, 0.7);
  background: rgba(18, 24, 33, 0.98);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}

.topnav-profile__trigger,
.topnav-actions__trigger {
  gap: 10px;
  font-weight: 650;
}

.topnav-profile__avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: radial-gradient(circle at 30% 20%, rgba(88, 166, 255, 0.22), rgba(22, 27, 34, 0.65));
  color: rgba(230, 237, 243, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topnav-profile__label,
.topnav-actions__label {
  display: inline-flex;
  align-items: center;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav-profile__chev,
.topnav-actions__chev {
  opacity: 0.65;
  font-size: 11px;
}

.topnav-menu__hdr {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 10px 8px;
  border-radius: calc(var(--topnav-radius) + 2px);
  border: 1px solid rgba(48, 54, 61, 0.55);
  background: rgba(13, 17, 23, 0.42);
}

.topnav-menu__avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.7);
  background: radial-gradient(circle at 30% 20%, rgba(163, 113, 247, 0.18), rgba(22, 27, 34, 0.72));
  color: rgba(230, 237, 243, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 850;
}

.topnav-menu__hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topnav-menu__name {
  font-size: 12px;
  font-weight: 800;
  color: rgba(230, 237, 243, 0.94);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.topnav-menu__role {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(201, 209, 217, 0.78);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.55);
  background: rgba(22, 27, 34, 0.42);
}

.topnav-menu__email {
  font-size: 11px;
  color: rgba(201, 209, 217, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav-menu__group {
  display: flex;
  flex-direction: column;
  padding: 6px 2px;
}

.topnav-menu__sep {
  height: 1px;
  background: rgba(48, 54, 61, 0.55);
  margin: 6px 2px;
}

.topnav-menu__row {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(230, 237, 243, 0.9);
  text-decoration: none;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--topnav-radius);
  cursor: pointer;
  text-align: left;
}

.topnav-menu__ico {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.topnav-menu__txt {
  font-size: 12px;
  font-weight: 650;
  color: rgba(230, 237, 243, 0.9);
}

.topnav-menu__row:hover {
  border-color: rgba(88, 166, 255, 0.2);
  background: rgba(88, 166, 255, 0.06);
}

.topnav-menu__row:active {
  transform: translateY(0px) scale(0.99);
}

.topnav-menu__row--danger {
  color: rgba(248, 81, 73, 0.95);
}

.topnav-menu__row--danger:hover {
  border-color: rgba(248, 81, 73, 0.32);
  background: rgba(248, 81, 73, 0.08);
}

/* Make the actions flyout content-driven, not oversized */
.topnav-actions__menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 260px;
}

.main-nav__overflow > .main-nav__overflow-panel {
  padding: 10px;
  min-width: auto;
}

/* Legacy alias if any script references main-nav__center */
.main-nav__center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

/* Workspace tabs: active underline (JS still toggles .active) */
.workspace-tab.active {
  color: var(--pitstrike-text);
  border-color: rgba(88, 166, 255, 0.45);
  background: rgba(88, 166, 255, 0.08);
  box-shadow: none;
}

.workspace-tab:hover {
  border-color: rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.05);
}

.ux-nav__pill--desktop {
  border: 1px solid rgba(0, 194, 255, 0.45);
  background: linear-gradient(135deg, rgba(0, 194, 255, 0.14), rgba(13, 17, 23, 0.92));
  color: var(--pitstrike-text);
}

.ux-nav__pill--desktop:hover {
  box-shadow: 0 0 16px rgba(0, 194, 255, 0.25);
}

.ux-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px 8px;
  min-width: 0;
  justify-content: flex-end;
  flex-shrink: 1;
}

@media (max-width: 1180px) {
  .main-nav__brand-cluster {
    max-width: min(400px, 52vw);
  }
}

/* Mid-width: stack workspace tabs, then Desk/Hub + trading actions + health on one row. */
@media (max-width: 1040px) {
  .app-top-bar__tier--primary.main-nav-row {
    align-items: flex-start;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .main-nav__brand-cluster {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  .main-nav__workspace.workspace-tabs {
    order: 2;
    flex: 1 1 100%;
    max-width: 100%;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid rgba(48, 54, 61, 0.45);
  }

  .main-nav__center-cluster {
    order: 3;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    padding-top: 4px;
  }

  .app-top-bar__cluster--actions.main-nav__right {
    order: 3;
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
    padding-top: 4px;
    flex-wrap: nowrap;
  }

  .workspace-mode-segmented {
    width: 100%;
    max-width: 420px;
  }
}

/* Inline layout-edit controls (no overlay tier). */
.dashboard-geometry-edit-tier-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  border-left: 1px solid rgba(48, 54, 61, 0.65);
  margin-left: 2px;
}

.dashboard-geometry-edit-tier-inline[hidden] {
  display: none !important;
}

.dashboard-geometry-edit-tier-inline .dashboard-geometry-edit-tier__label {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 167, 87, 0.95);
}

.dashboard-geometry-edit-tier-inline .dashboard-geometry-edit-tier__btn {
  font-size: 9px;
  font-weight: 700;
  padding: 4px 9px;
}

@media (max-width: 900px) {
  .main-nav__brand-cluster {
    max-width: none;
    border-right: none;
    padding-right: 0;
    flex-wrap: wrap;
  }

  .main-nav__brand-tagline {
    width: 100%;
  }
}

/* Very narrow: trading row full width; allow wrap inside the cluster */
@media (max-width: 720px) {
  .app-top-bar__cluster--actions.main-nav__right {
    flex-basis: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(48, 54, 61, 0.35);
  }

  .ux-nav {
    flex-wrap: wrap;
  }

  .main-nav__workspace.workspace-tabs {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(48, 54, 61, 0.35);
  }
}

/* Splash overlay */
.pitstrike-splash {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pitstrike-bg);
  transition: opacity 0.35s ease;
}

/* Fail-open exit: must not intercept clicks or block the shell */
#pitstrike-splash.is-exiting,
.pitstrike-splash.is-exiting {
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.pitstrike-splash--hide {
  opacity: 0;
  pointer-events: none;
}

.pitstrike-splash__img {
  width: min(100vw, 1920px);
  height: min(100vh, 1080px);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

/* Unified desk layout: top bar edit strip + Desk menu */
.app-top-bar__tier--geometry-edit {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: var(--z-overlay, 30010);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(88, 166, 255, 0.28);
  background: linear-gradient(165deg, rgba(22, 27, 34, 0.98), rgba(13, 17, 23, 0.99));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  min-width: min(420px, 92vw);
  max-width: 92vw;
}

.dashboard-geometry-edit-host {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dashboard-geometry-edit-toggle {
  white-space: nowrap;
}

.dashboard-geometry-edit-toggle[data-editing='1'] {
  border-color: rgba(255, 106, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 106, 0, 0.18), 0 6px 18px rgba(255, 106, 0, 0.12);
}

.dashboard-geometry-edit-tier__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #79c0ff;
}

.dashboard-geometry-edit-tier__hint {
  font-size: 10px;
  color: rgba(201, 209, 217, 0.75);
  flex: 1 1 220px;
  min-width: 0;
}

.dashboard-geometry-edit-tier__status {
  font-size: 11px;
  font-weight: 600;
  color: #7ee787;
  max-width: min(420px, 52vw);
  min-width: 0;
}

.dashboard-geometry-edit-tier__status[hidden] {
  display: none !important;
}

.dashboard-geometry-edit-tier__btn {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(88, 166, 255, 0.35);
  background: rgba(13, 17, 23, 0.85);
  color: #79c0ff;
  cursor: pointer;
}

.dashboard-geometry-edit-tier__btn:hover {
  border-color: rgba(88, 166, 255, 0.55);
}

.dashboard-geometry-edit-tier__btn--primary {
  background: linear-gradient(180deg, #58a6ff, #388bfd);
  color: #0d1117;
  border-color: #58a6ff;
}

.desk-layout-nav {
  position: relative;
  list-style: none;
}

.desk-layout-nav > summary {
  list-style: none;
  cursor: pointer;
}

.desk-layout-nav > summary::-webkit-details-marker {
  display: none;
}

.ux-nav__pill--desk-layouts {
  border: 1px solid rgba(163, 113, 247, 0.45);
  background: linear-gradient(135deg, rgba(163, 113, 247, 0.12), rgba(13, 17, 23, 0.92));
}

.desk-layout-nav__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: var(--z-overlay, 30010);
  min-width: min(320px, 92vw);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(88, 166, 255, 0.28);
  background: linear-gradient(165deg, rgba(22, 27, 34, 0.98), rgba(13, 17, 23, 0.99));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.desk-layout-nav__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.desk-layout-nav__action {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(88, 166, 255, 0.4);
  background: rgba(88, 166, 255, 0.1);
  color: #79c0ff;
  cursor: pointer;
}

.desk-layout-nav__action--muted {
  border-color: rgba(139, 148, 158, 0.45);
  background: rgba(48, 54, 61, 0.35);
  color: #c9d1d9;
}

.desk-layout-nav__caption {
  margin: 0 0 10px;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(139, 148, 158, 0.95);
}

.desk-layout-nav__slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.desk-layout-nav__slots:last-child {
  margin-bottom: 0;
}

.desk-layout-nav__slots-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(139, 148, 158, 0.9);
  min-width: 3.2rem;
}

.desk-layout-nav__slot {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(88, 166, 255, 0.35);
  background: rgba(13, 17, 23, 0.9);
  color: #e6edf3;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.desk-layout-nav__slot:hover {
  border-color: rgba(88, 166, 255, 0.6);
}

.desk-layout-nav__slot--save {
  border-color: rgba(63, 185, 80, 0.4);
  color: #56d364;
}

.desk-layout-nav__slot--save:hover {
  border-color: rgba(63, 185, 80, 0.65);
}

/* JWT account menu (terminal top bar) */
.ux-nav__pill--account {
  border: 1px solid rgba(63, 185, 80, 0.42);
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.12), rgba(13, 17, 23, 0.92));
  color: #aff5b4;
}

.ux-nav__pill--account:hover {
  box-shadow: 0 0 14px rgba(63, 185, 80, 0.22);
}

button.ux-nav__pill.ux-nav__pill--logout {
  border: 1px solid rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.1);
  color: #ffa198;
  font-size: 10px;
  font-weight: 600;
}

button.ux-nav__pill.ux-nav__pill--logout:hover {
  border-color: rgba(248, 81, 73, 0.65);
  background: rgba(248, 81, 73, 0.16);
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.18);
}

.pitstrike-account-menu__panel {
  min-width: min(280px, 92vw);
}

.pitstrike-account-menu__email {
  margin: 0 0 10px;
  font-size: 10px;
  line-height: 1.35;
  color: rgba(139, 148, 158, 0.95);
  word-break: break-all;
}

.pitstrike-account-menu a.desk-layout-nav__action {
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.pitstrike-account-menu__logout {
  width: 100%;
  margin-top: 2px;
  border-color: rgba(248, 81, 73, 0.45) !important;
  background: rgba(248, 81, 73, 0.1) !important;
  color: #ffa198 !important;
}

.pitstrike-account-menu__logout:hover {
  border-color: rgba(248, 81, 73, 0.65) !important;
  background: rgba(248, 81, 73, 0.16) !important;
}

/* Intelligence calendar workspace tab */
.intelligence-cal {
  max-width: min(1480px, 100%);
  margin: 0 auto;
}

.intelligence-cal__shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(300px, 34%);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1080px) {
  .intelligence-cal__shell {
    grid-template-columns: 1fr;
  }
}

.intelligence-cal__main {
  min-width: 0;
}

.intelligence-cal__command {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(13, 17, 23, 0.55);
}

.intelligence-cal__search-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 12rem;
  min-width: 0;
}

.intelligence-cal__search-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(139, 148, 158, 0.9);
}

.intelligence-cal__search {
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(48, 54, 61, 0.85);
  background: rgba(22, 27, 34, 0.95);
  color: var(--pitstrike-text);
  width: 100%;
  box-sizing: border-box;
}

.intelligence-cal__command-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.intelligence-cal__export-dd {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intelligence-cal__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
}

.intelligence-cal__filters-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(139, 148, 158, 0.85);
  margin-right: 4px;
}

.intelligence-cal__status {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(139, 148, 158, 0.95);
}

.intelligence-cal__filter-clear {
  margin: 0 0 0 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(248, 81, 73, 0.35);
  background: rgba(248, 81, 73, 0.08);
  color: rgba(255, 200, 190, 0.95);
  cursor: pointer;
}

.intelligence-cal__filter-clear:hover {
  border-color: rgba(248, 81, 73, 0.55);
  color: #fff;
}

.intelligence-cal__filter-chip {
  margin: 0;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.75);
  background: rgba(22, 27, 34, 0.75);
  color: rgba(201, 209, 217, 0.88);
  cursor: pointer;
}

.intelligence-cal__filter-chip:hover {
  border-color: rgba(88, 166, 255, 0.45);
}

.intelligence-cal__filter-chip--active {
  border-color: rgba(88, 166, 255, 0.65);
  background: rgba(88, 166, 255, 0.12);
  color: #e6edf3;
}

.intelligence-cal__kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .intelligence-cal__kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.intel-card {
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(13, 17, 23, 0.72);
  padding: 10px 12px;
}

.intel-card--kpi {
  padding: 10px 12px;
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-color: rgba(88, 166, 255, 0.18);
  background: linear-gradient(165deg, rgba(88, 166, 255, 0.06), rgba(13, 17, 23, 0.88));
}

.intel-card__k {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(139, 148, 158, 0.92);
}

.intel-card__v {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #e6edf3;
}

.intel-card__v--meta {
  font-size: 14px;
  font-weight: 700;
  color: rgba(121, 192, 255, 0.95);
}

.intel-card__sub {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 600;
  color: rgba(139, 148, 158, 0.92);
  font-variant-numeric: tabular-nums;
}

.intel-card__hd {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(121, 192, 255, 0.92);
}

.intel-card__hint {
  margin: 8px 0 0;
  font-size: 10px;
  color: rgba(139, 148, 158, 0.9);
}

.intel-card__empty {
  margin: 0;
  font-size: 12px;
  color: rgba(139, 148, 158, 0.92);
}

.intel-card--schedule .intelligence-cal__tl-list {
  margin-top: 4px;
}

.intel-card--muted {
  border-style: dashed;
  opacity: 0.92;
}

.intelligence-cal__rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 12px;
}

.intel-card--rail .intel-card__hd {
  margin-bottom: 6px;
}

.intel-card--rail {
  padding: 10px 12px;
}

.intelligence-cal__rail-val {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #e6edf3;
}

.intelligence-cal__rail-jump {
  margin: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  border: none;
  background: none;
  color: #79c0ff;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.intelligence-cal__rail-jump:hover {
  color: #a5d6ff;
}

.intelligence-cal__rail-watch {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
}

.intelligence-cal__alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}

.intelligence-cal__week-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.intelligence-cal__week-label {
  font-size: 12px;
  font-weight: 700;
  color: #79c0ff;
}

.intelligence-cal__week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.intelligence-cal__week-cell {
  margin: 0;
  font: inherit;
  min-height: 72px;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.75);
  background: rgba(22, 27, 34, 0.65);
  color: var(--pitstrike-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 6px;
  box-sizing: border-box;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

@media (prefers-reduced-motion: reduce) {
  .intelligence-cal__week-cell {
    transition: none;
  }
}

.intelligence-cal__week-cell:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 166, 255, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.intelligence-cal__week-cell--selected {
  outline: 2px solid rgba(88, 166, 255, 0.85);
  outline-offset: 1px;
}

.intelligence-cal__week-dow {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(139, 148, 158, 0.85);
}

.intelligence-cal__week-num {
  font-size: 16px;
  font-weight: 800;
  margin-top: 4px;
}

.intelligence-cal__week-dots {
  margin-top: auto;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.intelligence-cal__week-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(88, 166, 255, 0.75);
}

.intelligence-cal__week-dot--watch {
  background: transparent;
  box-shadow: inset 0 0 0 2px rgba(210, 153, 34, 0.75);
}

.intelligence-cal__heatmap-note {
  margin: 8px 0 4px;
  font-size: 11px;
  color: rgba(139, 148, 158, 0.9);
}

.intelligence-cal__cell--hm-0 {
  background: rgba(22, 27, 34, 0.65);
}

.intelligence-cal__cell--hm-1 {
  background: rgba(88, 166, 255, 0.12);
  border-color: rgba(88, 166, 255, 0.28);
}

.intelligence-cal__cell--hm-2 {
  background: rgba(88, 166, 255, 0.22);
  border-color: rgba(88, 166, 255, 0.42);
}

.intelligence-cal__cell--hm-3 {
  background: rgba(248, 81, 73, 0.18);
  border-color: rgba(248, 81, 73, 0.38);
}

.intelligence-cal__cell--hm-4 {
  background: rgba(248, 81, 73, 0.32);
  border-color: rgba(248, 81, 73, 0.55);
}

.intelligence-cal__cell--dim {
  opacity: 0.38;
  filter: grayscale(0.25);
}

.intelligence-cal__markers--brief {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(57, 197, 207, 0.85);
}

.intelligence-cal__lg--brief {
  border-radius: 50%;
  width: 8px;
  height: 8px;
  background: rgba(57, 197, 207, 0.75);
}

.intelligence-cal__tier-dot,
.intelligence-cal__opp-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}

.intelligence-cal__tier-dot--low {
  background: rgba(63, 185, 80, 0.65);
}
.intelligence-cal__tier-dot--med {
  background: rgba(210, 153, 34, 0.75);
}
.intelligence-cal__tier-dot--high {
  background: rgba(248, 81, 73, 0.65);
}
.intelligence-cal__tier-dot--crit {
  background: rgba(248, 81, 73, 0.95);
}

.intelligence-cal__opp-dot--low {
  background: rgba(48, 54, 61, 0.55);
}
.intelligence-cal__opp-dot--med {
  background: rgba(88, 166, 255, 0.55);
}
.intelligence-cal__opp-dot--high {
  background: rgba(63, 185, 80, 0.75);
}

.intelligence-cal__day {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .intelligence-cal__day {
    transition: none;
  }
  .intelligence-cal__workspace--enterprise {
    animation: none;
  }
}

.intelligence-cal__day:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  border-color: rgba(88, 166, 255, 0.45);
}

.intelligence-cal__cell--selected {
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.55), 0 0 24px rgba(88, 166, 255, 0.12);
  animation: intelligence-cal-shimmer 2.4s ease-in-out infinite;
}

@keyframes intelligence-cal-shimmer {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intelligence-cal__cell--selected {
    animation: none;
  }
}

.intelligence-cal__detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 960px) {
  .intelligence-cal__detail-grid {
    grid-template-columns: 1fr;
  }
}

.intelligence-cal__detail-list--inline {
  margin-top: 6px;
}

.intelligence-cal__workspace--enterprise {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(13, 17, 23, 0.72);
  animation: intelligence-cal-panel-in 0.28s ease-out;
}

@keyframes intelligence-cal-panel-in {
  from {
    opacity: 0.88;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intelligence-cal__hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(88, 166, 255, 0.22);
  background: linear-gradient(165deg, rgba(88, 166, 255, 0.08), rgba(13, 17, 23, 0.92));
}

.intelligence-cal__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pitstrike-text);
}

.intelligence-cal__sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(139, 148, 158, 0.95);
  max-width: 52ch;
}

.intelligence-cal__sub strong {
  font-weight: 650;
  color: #d8dee4;
}

.intelligence-cal__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intelligence-cal__month-label {
  font-size: 13px;
  font-weight: 700;
  color: #79c0ff;
  min-width: 10rem;
  text-align: center;
}

.intelligence-cal__btn {
  margin: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(88, 166, 255, 0.4);
  background: rgba(13, 17, 23, 0.85);
  color: #c9d1d9;
  cursor: pointer;
}

.intelligence-cal__btn:hover {
  border-color: rgba(88, 166, 255, 0.65);
  color: var(--pitstrike-text);
}

.intelligence-cal__btn--muted {
  border-color: rgba(139, 148, 158, 0.45);
  color: rgba(201, 209, 217, 0.85);
}

.intelligence-cal__dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.intelligence-cal__dow-cell {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(139, 148, 158, 0.85);
}

.intelligence-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.intelligence-cal__macro-lede {
  margin: var(--ps-space-md, 12px) 0 0;
}

.intelligence-cal__watch-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(210, 153, 34, 0.28);
  background: rgba(210, 153, 34, 0.06);
}

.intelligence-cal__watch-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(210, 153, 34, 0.9);
}

.intelligence-cal__watch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intelligence-cal__watch-chip {
  margin: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(210, 153, 34, 0.45);
  background: rgba(13, 17, 23, 0.85);
  color: rgba(255, 211, 138, 0.95);
  cursor: pointer;
}

.intelligence-cal__watch-chip:hover {
  border-color: rgba(210, 153, 34, 0.75);
  color: #fff8e7;
}

.intelligence-cal__cell--pad {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
}

.intelligence-cal__day {
  position: relative;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.75);
  cursor: pointer;
  font: inherit;
  color: var(--pitstrike-text);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px 8px;
  box-sizing: border-box;
}

.intelligence-cal__day-num {
  font-size: 12px;
  font-weight: 800;
}

.intelligence-cal__cell--heat-0 {
  background: rgba(22, 27, 34, 0.65);
}

.intelligence-cal__cell--heat-1 {
  background: rgba(88, 166, 255, 0.12);
  border-color: rgba(88, 166, 255, 0.28);
}

.intelligence-cal__cell--heat-2 {
  background: rgba(88, 166, 255, 0.22);
  border-color: rgba(88, 166, 255, 0.42);
}

.intelligence-cal__cell--heat-3 {
  background: rgba(163, 113, 247, 0.22);
  border-color: rgba(163, 113, 247, 0.45);
}

.intelligence-cal__cell--watch {
  box-shadow: inset 0 0 0 2px rgba(210, 153, 34, 0.55);
}

.intelligence-cal__cell--selected {
  outline: 2px solid rgba(88, 166, 255, 0.85);
  outline-offset: 1px;
}

.intelligence-cal__detail {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(13, 17, 23, 0.72);
}

.intelligence-cal__pick-placeholder {
  margin-top: var(--ps-space-xl, 20px);
}

.intelligence-cal__detail-date {
  font-size: 14px;
  font-weight: 800;
  color: #79c0ff;
  margin-bottom: 8px;
}

.intelligence-cal__detail-list {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(201, 209, 217, 0.95);
}

.intelligence-cal__detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.intelligence-cal__watch-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: rgba(139, 148, 158, 0.95);
}

.intelligence-cal__cell--server-event {
  box-shadow: inset 0 -3px 0 0 rgba(88, 166, 255, 0.55);
}

.intelligence-cal__cell--server-event--high {
  box-shadow: inset 0 -3px 0 0 rgba(248, 81, 73, 0.65);
}

.intelligence-cal__server-day {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.06);
}

.intelligence-cal__server-day__label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(121, 192, 255, 0.95);
  margin-bottom: 8px;
}

.intelligence-cal__server-day__list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.intelligence-cal__server-ev {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid rgba(48, 54, 61, 0.55);
  font-size: 12px;
  line-height: 1.45;
  color: var(--pitstrike-text, #c9d1d9);
}

.intelligence-cal__server-day__list .intelligence-cal__server-ev:first-child {
  border-top: none;
  padding-top: 0;
}

.intelligence-cal__server-ev__meta {
  font-size: 10px;
  color: rgba(139, 148, 158, 0.95);
}

.intelligence-cal__server-ev__title {
  font-weight: 700;
  color: #e6edf3;
}

.intelligence-cal__server-ev__sum {
  font-size: 11px;
  color: rgba(201, 209, 217, 0.88);
}

.intelligence-cal__strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.55);
  background: rgba(13, 17, 23, 0.55);
}

.intelligence-cal__chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(48, 54, 61, 0.75);
  color: rgba(201, 209, 217, 0.92);
}

.intelligence-cal__chip--neutral {
  border-color: rgba(88, 166, 255, 0.35);
  color: #79c0ff;
}

.intelligence-cal__chip--risk {
  border-color: rgba(248, 81, 73, 0.4);
  color: rgba(255, 180, 174, 0.95);
}

.intelligence-cal__chip--opp {
  border-color: rgba(63, 185, 80, 0.4);
  color: rgba(170, 240, 190, 0.95);
}

.intelligence-cal__chip--meta {
  border-color: transparent;
  color: rgba(139, 148, 158, 0.85);
  font-weight: 600;
}

.intelligence-cal__chip--live {
  border-color: rgba(88, 166, 255, 0.45);
  color: rgba(121, 192, 255, 0.95);
  font-size: 10px;
}

.intelligence-cal__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.intelligence-cal__viewmode {
  display: inline-flex;
  gap: 4px;
  margin-right: 4px;
}

.intelligence-cal__btn--active {
  border-color: rgba(88, 166, 255, 0.75) !important;
  background: rgba(88, 166, 255, 0.12) !important;
  color: #e6edf3 !important;
}

.intelligence-cal__btn--small {
  padding: 5px 10px;
  font-size: 11px;
}

.intelligence-cal__btn--accent {
  border-color: rgba(57, 197, 207, 0.55);
  color: #a5f3fc;
  background: rgba(57, 197, 207, 0.08);
}

.intelligence-cal__strip-wrap {
  margin-bottom: 10px;
}

.intelligence-cal__month-narr {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(201, 209, 217, 0.88);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.55);
  background: rgba(22, 27, 34, 0.45);
}

.intelligence-cal__chip--avg-risk {
  border-color: rgba(248, 81, 73, 0.35);
  color: rgba(255, 200, 190, 0.95);
}

.intelligence-cal__agenda {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(13, 17, 23, 0.55);
}

.intelligence-cal__agenda--empty {
  font-size: 12px;
  color: rgba(139, 148, 158, 0.95);
}

.intelligence-cal__agenda-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.intelligence-cal__agenda-row {
  display: grid;
  grid-template-columns: 6.5rem 7rem 8rem 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid rgba(48, 54, 61, 0.45);
  font-size: 12px;
}

.intelligence-cal__agenda-list .intelligence-cal__agenda-row:first-child {
  border-top: none;
  padding-top: 0;
}

@media (max-width: 720px) {
  .intelligence-cal__agenda-row {
    grid-template-columns: 1fr;
  }
}

.intelligence-cal__agenda-day {
  font-weight: 800;
  color: #79c0ff;
  font-variant-numeric: tabular-nums;
}

.intelligence-cal__agenda-when {
  font-size: 10px;
  color: rgba(139, 148, 158, 0.95);
  font-variant-numeric: tabular-nums;
}

.intelligence-cal__agenda-type {
  font-size: 10px;
  color: rgba(139, 148, 158, 0.9);
}

.intelligence-cal__agenda-title {
  font-weight: 650;
  color: #e6edf3;
  min-width: 0;
  word-break: break-word;
}

.intelligence-cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 10px 0 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(139, 148, 158, 0.9);
}

.intelligence-cal__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.intelligence-cal__lg {
  width: 14px;
  height: 6px;
  border-radius: 2px;
  display: inline-block;
}

.intelligence-cal__lg--journal {
  background: linear-gradient(90deg, rgba(163, 113, 247, 0.35), rgba(163, 113, 247, 0.65));
}

.intelligence-cal__lg--desk {
  background: rgba(88, 166, 255, 0.65);
}

.intelligence-cal__lg--watch {
  box-shadow: inset 0 0 0 2px rgba(210, 153, 34, 0.65);
  background: transparent;
}

.intelligence-cal__lg--risk {
  background: rgba(248, 81, 73, 0.55);
}

.intelligence-cal__markers {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: flex;
  gap: 3px;
  pointer-events: none;
}

.intelligence-cal__markers--desk {
  width: 10px;
  height: 3px;
  border-radius: 1px;
  background: rgba(88, 166, 255, 0.75);
}

.intelligence-cal__markers--watch {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid rgba(210, 153, 34, 0.85);
}

.intelligence-cal__workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(13, 17, 23, 0.72);
}

@media (max-width: 820px) {
  .intelligence-cal__workspace {
    grid-template-columns: 1fr;
  }
}

.intelligence-cal__today-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(57, 197, 207, 0.45);
  color: #a5f3fc;
  vertical-align: middle;
}

.intelligence-cal__brief {
  margin-bottom: 12px;
}

.intelligence-cal__brief--loading,
.intelligence-cal__brief--idle,
.intelligence-cal__brief--err {
  font-size: 12px;
  color: rgba(201, 209, 217, 0.9);
}

.intelligence-cal__brief--err {
  color: rgba(255, 180, 174, 0.95);
}

.intelligence-cal__scores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.intelligence-cal__score {
  min-width: 5rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.65);
  background: rgba(22, 27, 34, 0.55);
}

.intelligence-cal__score-k {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(139, 148, 158, 0.9);
  margin-bottom: 4px;
}

.intelligence-cal__score-v {
  font-size: 20px;
  font-weight: 800;
  color: #e6edf3;
}

.intelligence-cal__brief-sum {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(201, 209, 217, 0.95);
  margin: 0 0 10px;
}

.intelligence-cal__scenario {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(201, 209, 217, 0.9);
  margin: 0 0 10px;
}

.intelligence-cal__action-plan {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(201, 209, 217, 0.95);
  margin-bottom: 10px;
}

.intelligence-cal__action-notes {
  margin: 8px 0 0;
  font-size: 11px;
  color: rgba(139, 148, 158, 0.95);
}

.intelligence-cal__related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.intelligence-cal__related-lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(139, 148, 158, 0.9);
  margin-right: 4px;
}

.intelligence-cal__rel-chip {
  margin: 0;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(57, 197, 207, 0.35);
  background: rgba(13, 17, 23, 0.85);
  color: #a5f3fc;
  cursor: pointer;
}

.intelligence-cal__rel-chip:hover {
  border-color: rgba(57, 197, 207, 0.6);
}

.intelligence-cal__meta-hint {
  font-size: 10px;
  color: rgba(139, 148, 158, 0.75);
  margin: 0;
}

.intelligence-cal__timeline {
  margin-bottom: 12px;
}

.intelligence-cal__timeline-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(121, 192, 255, 0.95);
  margin-bottom: 8px;
}

.intelligence-cal__tl-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.intelligence-cal__tl-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(48, 54, 61, 0.55);
  font-size: 12px;
  align-items: flex-start;
}

.intelligence-cal__tl-list .intelligence-cal__tl-item:first-child {
  border-top: none;
  padding-top: 0;
}

.intelligence-cal__tl-time {
  flex: 0 0 5.5rem;
  font-size: 10px;
  font-weight: 700;
  color: rgba(139, 148, 158, 0.95);
  font-variant-numeric: tabular-nums;
}

.intelligence-cal__tl-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intelligence-cal__tl-meta {
  font-size: 10px;
  color: rgba(139, 148, 158, 0.85);
}

.intelligence-cal__tl-title {
  font-weight: 700;
  color: #e6edf3;
}

/* Phase A2: command side panel */
.command-side-panel__backdrop[hidden],
.command-side-panel[hidden] {
  display: none !important;
}

.command-side-panel__backdrop {
  position: fixed;
  inset: 0;
  z-index: 12040;
  background: rgba(1, 4, 9, 0.55);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.command-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 92vw);
  max-width: 420px;
  min-width: 280px;
  z-index: 12050;
  display: flex;
  flex-direction: column;
  background: rgba(13, 17, 23, 0.98);
  border-left: 1px solid var(--ps-border-subtle, rgba(48, 54, 61, 0.85));
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.42);
}

.command-side-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.75);
}

.command-side-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #e6edf3;
}

.command-side-panel__close {
  border: 1px solid rgba(48, 54, 61, 0.85);
  background: rgba(22, 27, 34, 0.9);
  color: #c9d1d9;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.command-side-panel__close:hover {
  border-color: rgba(88, 166, 255, 0.45);
  color: #fff;
}

.command-side-panel__body {
  padding: 12px 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.command-side-panel__section {
  margin-bottom: 18px;
}

.command-side-panel__section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(139, 148, 158, 0.95);
}

.command-side-panel__btn {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.75);
  background: rgba(22, 27, 34, 0.85);
  color: #c9d1d9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.command-side-panel__btn:hover {
  border-color: rgba(88, 166, 255, 0.4);
  color: #fff;
}

.command-side-panel__hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(139, 148, 158, 0.9);
}

.command-side-panel-toggle {
  border: 1px solid rgba(48, 54, 61, 0.75);
  background: rgba(22, 27, 34, 0.75);
  color: #c9d1d9;
  border-radius: var(--topnav-radius);
  height: var(--topnav-control-h);
  padding: 0 var(--topnav-padding-x);
  font-size: var(--topnav-font-size);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* AI meter in the right control bar */
.ai-meter {
  height: var(--topnav-control-h);
  padding: 0 var(--topnav-padding-x);
  border-radius: var(--topnav-radius);
  border: 1px solid rgba(138, 108, 220, 0.3);
  background: linear-gradient(180deg, rgba(138, 108, 220, 0.1), rgba(13, 17, 23, 0.55));
  color: rgba(197, 168, 255, 0.88);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: var(--topnav-font-size);
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.14s ease, box-shadow 0.15s ease;
}

.ai-meter:hover {
  border-color: rgba(163, 113, 247, 0.55);
  background: linear-gradient(180deg, rgba(138, 108, 220, 0.2), rgba(13, 17, 23, 0.72));
  color: #ddc4ff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(138, 108, 220, 0.2);
}

.ai-meter:active {
  transform: translateY(0px) scale(0.99);
}

.ai-meter[disabled],
.ai-meter[aria-disabled="true"] {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.command-side-panel-toggle:hover {
  border-color: rgba(88, 166, 255, 0.4);
  color: #fff;
}

.intelligence-cal__date-input {
  font: inherit;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(48, 54, 61, 0.85);
  background: rgba(22, 27, 34, 0.95);
  color: var(--pitstrike-text);
}

/* Narrow shell: keep mode control usable */
@media (max-width: 900px) {
  .main-nav__health-label {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-mode-segmented--context .workspace-mode-segmented__segment,
  .workspace-mode-segmented--context .workspace-mode-segmented__segment--summary {
    padding: 4px 7px;
    font-size: 8px;
  }
}
