:root {
  --px-per-minute: 2px;
  --row-height: 36px;
  --bar-height: 24px;
  --labour-bar-height: 16px;
  --labour-track-gap: 4px;
  --labour-stack-padding: 4px;
  --lane-row-gap: 4px;
  --lane-label-font-size: 14px;
  --lane-label-letter-spacing: 0.08em;
  --lane-label-padding-inline: 16px;
  --lane-divider-gradient: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0) 0%,
    var(--lane-divider-color) 18%,
    var(--lane-divider-color) 82%,
    rgba(var(--accent-rgb), 0) 100%
  );
  --radius-large: 26px;
  --radius-medium: 18px;
  --radius-small: 12px;
  --grid-color: rgba(148, 163, 184, 0.22);
  --grid-accent: rgba(148, 163, 184, 0.16);
  --bar-color: #6d8bff;
  --bar2-color: #9d87ff;
  --bar-conflict-color: #f87171;
  --text: #e6eaef;
  --text-strong: #ffffff;
  --muted: #a0a8b7;
  --surface: #18181b;
  --surface-strong: #111115;
  --surface-glass: #1f2126;
  --surface-border: rgba(82, 82, 91, 0.7);
  --panel-background: #18181b;
  --panel-border: rgba(82, 82, 91, 0.7);
  --accent: #7c8cff;
  --accent-strong: #8f9cff;
  --accent-soft: rgba(124, 140, 255, 0.18);
  --accent-rgb: 124, 140, 255;
  --lane-divider-color: rgba(var(--accent-rgb), 0.38);
  --positive: #3ed885;
  --warning: #f6a43d;
  --danger: #ef6868;
  --page-background: #101013;
  --page-overlay: none;
  --hero-background: linear-gradient(135deg, #202126, #131316);
  --hero-divider: rgba(99, 102, 117, 0.6);
  --hero-title: #f9fafb;
  --hero-subtitle: rgba(209, 213, 219, 0.9);
  --hero-eyebrow: rgba(156, 163, 175, 0.9);
  --hero-stat-background: rgba(24, 24, 27, 0.96);
  --hero-stat-border: rgba(82, 82, 91, 0.9);
  --hero-stat-shadow: inset 0 0 0 1px rgba(39, 39, 42, 0.85);
  --chip-bg: rgba(39, 39, 42, 0.9);
  --chip-border: rgba(82, 82, 91, 0.9);
  --chip-hover: rgba(63, 63, 70, 0.9);
  --chip-text: rgba(229, 231, 235, 0.96);
  --tab-bg: transparent;
  --tab-color: rgba(209, 213, 219, 0.8);
  --tab-active-bg: rgba(39, 39, 42, 0.96);
  --tab-active-color: #f9fafb;
  --tab-border: rgba(82, 82, 91, 0.9);
  --toggle-track: rgba(39, 39, 42, 0.95);
  --toggle-track-border: rgba(82, 82, 91, 0.9);
  --toggle-icon: var(--accent);
  --panel-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  --zoombar-background: rgba(39, 39, 42, 0.9);
  --zoombar-border: rgba(82, 82, 91, 0.7);
  --gantt-background: radial-gradient(circle at 16% 18%, rgba(63, 63, 70, 0.25), transparent 60%),
    #111115;
  --gantt-border: rgba(82, 82, 91, 0.85);
  --gantt-left-background: #15151a;
  --gantt-right-background: #111115;
  --gantt-label-background: #15151a;
  --gantt-label-border: rgba(63, 63, 70, 0.85);
  --split-left: 1fr;
  --split-right: 1fr;
  --chrome-collapse-speed: 0.22s;
  --gantt-header-background: #15151a;
  --gantt-header-border: rgba(63, 63, 70, 0.8);
  --gantt-row-border: rgba(55, 65, 81, 0.5);
  --gantt-scrollbar: rgba(148, 163, 184, 0.65);
  --ui-scrollbar-track: rgba(78, 87, 104, 0.28);
  --ui-scrollbar-thumb: rgba(122, 132, 151, 0.62);
  --ui-scrollbar-thumb-hover: rgba(148, 160, 182, 0.78);
  --ui-scrollbar-border: rgba(12, 14, 18, 0.5);
  --gantt-cutoff-border: rgba(148, 163, 184, 0.65);
  --tooltip-background: rgba(24, 24, 27, 0.96);
  --tooltip-border: rgba(82, 82, 91, 0.9);
  --tooltip-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  --chat-panel-width: 1400px;
  --chat-panel-min-width: 320px;
  --chat-panel-max-width: 9999px;
  --chat-panel-min-height: 360px;
  --chat-panel-default-height: 1200px;
  --chat-panel-max-height-offset: 160px;
  --inspector-stick-top: 32px;
  --main-min-width: 560px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --focus-ring: 0 0 0 2px rgba(124, 140, 255, 0.6);

  /* Semantic tokens */
  --color-text: var(--text);
  --color-text-strong: var(--text-strong);
  --color-text-muted: var(--muted);
  --color-bg-page: var(--page-background);
  --color-bg-surface: var(--surface);
  --color-bg-panel: var(--panel-background);
  --color-bg-glass: var(--surface-glass);
  --color-border-soft: var(--panel-border);
  --color-border-strong: var(--surface-border);
  --color-accent: var(--accent);
  --color-accent-strong: var(--accent-strong);
  --color-accent-soft: var(--accent-soft);
  --color-positive: var(--positive);
  --color-warning: var(--warning);
  --color-danger: var(--danger);
  --font-family-base: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-size-base: 14px;
  --font-size-label: 12px;
  --font-size-title: 20px;
  --spacing-gutter: 32px;
  --spacing-panel: 24px;
  --spacing-section: 16px;
  --spacing-stack: 20px;
  --spacing-tight: 8px;
  --spacing-header-y: 20px;
  --spacing-header-x: 32px;
  --radius-panel: var(--radius-medium);
  --radius-card: var(--radius-medium);
  --radius-chip: var(--radius-small);
}

body[data-density="compact"] {
  --row-height: 24px;
  --bar-height: 16px;
  --labour-bar-height: 10px;
  --labour-track-gap: 1px;
  --labour-stack-padding: 2px;
  --lane-row-gap: 1px;
  --lane-label-font-size: 11px;
  --lane-label-letter-spacing: 0.05em;
  --lane-label-padding-inline: 8px;
}
:root[data-theme="dark"] {
  --bg-0:#101013; --bg-1:#18181b; --bg-2:#1f2126;
  --txt-1:#e5e7eb; --txt-2:#9ca3af; --txt-3:#6b7280;
  --line:#27272f;
  --accent:#5DA0FF;
  --ok:#2BB673; --warn:#FFC857; --danger:#F26D6D; --info:#67D4FF;
  --op-normal:#394B63;
  --op-wait:#D9A52A;
  --op-blocked:#F26D6D;
  --op-qa:#67D4FF;
  --op-done:#2BB673;
  --radii:6px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --space-6:32px;
  --elev-1:0 1px 3px rgba(0,0,0,.28);
  --elev-2:0 8px 32px rgba(0,0,0,.45);
  --focus-ring: 0 0 0 3px rgba(93,160,255,.35);
  --tap: cubic-bezier(.2,.8,.2,1);
  --panel: cubic-bezier(.2,.8,.2,1);
  --color-text: var(--txt-1);
  --color-text-muted: var(--txt-2);
  --color-text-strong: var(--txt-1);
  --color-bg-page: var(--bg-0);
  --color-bg-surface: var(--bg-1);
  --color-bg-panel: var(--bg-1);
  --color-bg-glass: var(--bg-2);
  --color-border-soft: var(--line);
  --color-border-strong: var(--line);
  --color-accent: var(--accent);
  --color-accent-strong: var(--accent);
  --color-accent-soft: rgba(93,160,255,.18);
  --color-positive: var(--ok);
  --color-warning: var(--warn);
  --color-danger: var(--danger);
  --gantt-background: radial-gradient(circle at 16% 18%, rgba(63, 63, 70, 0.25), transparent 60%),
    var(--line);
  --gantt-right-background: var(--line);
}
:root[data-theme="light"] {
  --bg-0:#F6F8FB; --bg-1:#FFFFFF; --bg-2:#F3F5F9;
  --txt-1:#0F172A; --txt-2:#475569; --txt-3:#64748B;
  --line:#E5E7EB;
  --accent:#3B82F6;
  --ok:#10B981; --warn:#F59E0B; --danger:#EF4444; --info:#06B6D4;
  --op-normal:#6B7280; --op-wait:#D97706; --op-blocked:#EF4444; --op-qa:#06B6D4; --op-done:#10B981;
  --radii:6px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --space-6:32px;
  --elev-1:0 1px 3px rgba(0,0,0,.08);
  --elev-2:0 16px 48px rgba(0,0,0,.12);
  --focus-ring: 0 0 0 3px rgba(59,130,246,.25);
  --tap: cubic-bezier(.2,.8,.2,1);
  --panel: cubic-bezier(.2,.8,.2,1);
  --color-text: var(--txt-1);
  --color-text-muted: var(--txt-2);
  --color-text-strong: var(--txt-1);
  --color-bg-page: var(--bg-0);
  --color-bg-surface: var(--bg-1);
  --color-bg-panel: var(--bg-1);
  --color-bg-glass: var(--bg-2);
  --color-border-soft: var(--line);
  --color-border-strong: var(--line);
  --color-accent: var(--accent);
  --color-accent-strong: var(--accent);
  --color-accent-soft: rgba(59,130,246,.18);
  --color-positive: var(--ok);
  --color-warning: var(--warn);
  --color-danger: var(--danger);
  --ui-scrollbar-track: rgba(148, 163, 184, 0.28);
  --ui-scrollbar-thumb: rgba(100, 116, 139, 0.62);
  --ui-scrollbar-thumb-hover: rgba(71, 85, 105, 0.78);
  --ui-scrollbar-border: rgba(241, 245, 249, 0.8);
}
* { box-sizing: border-box; }
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: var(--ui-scrollbar-track);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: var(--ui-scrollbar-thumb);
  border-radius: 999px;
  border: 1px solid var(--ui-scrollbar-border);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--ui-scrollbar-thumb-hover);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
html,
body {
  height: 100%;
}
.ct-header,
.kpi-ribbon,
.timeline-shell,
.inspector {
  color: var(--txt-1);
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}
.hidden { display: none !important; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--font-size-base);
  color: var(--txt-1);
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
}

body::before {
  content: none;
}

#gantt-root {
  min-height: 100vh;
  width: 100%;
  display: block;
}
#gantt-root:fullscreen {
  background: var(--bg-0);
}
body.fullscreen-mode {
  height: 100vh;
  overflow: hidden;
  background: var(--bg-0);
}
body.fullscreen-mode #app {
  height: 100vh;
}
body.fullscreen-mode .ct-header,
body.fullscreen-mode .kpi-ribbon,
body.fullscreen-mode .hero,
body.fullscreen-mode .panel.summary,
body.fullscreen-mode footer {
  display: none !important;
}
body.fullscreen-mode .inspector-drawer footer {
  display: flex !important;
}
body.fullscreen-mode #content {
  flex: 1 1 auto;
  height: 100vh;
  overflow: hidden;
}
body.fullscreen-mode #paneSchedule {
  padding: 12px 16px;
  flex: 1 1 auto;
  height: 100%;
  overflow: auto;
}
body.fullscreen-mode .timeline-shell {
  height: calc(100vh - 24px);
  grid-template-columns: minmax(0, 1fr);
}
body.fullscreen-mode .timeline-shell.has-side-panels {
  grid-template-columns: minmax(0, 1fr) 400px;
}
body.fullscreen-mode .timeline-main,
body.fullscreen-mode #ganttSplitWrapper,
body.fullscreen-mode .gantt-pane {
  height: 100%;
  min-height: 0;
}
body.fullscreen-mode .timeline {
  width: 100%;
  height: 100%;
}

#app {
  display: flex;
  gap: 0;
  height: 100vh;
  min-height: 0;
  align-items: stretch;
  padding: 0;
  position: relative;
}

.rail {
  flex: 0 0 auto;
  width: 64px;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  transition: width 0.2s var(--panel);
}
.rail:not(.is-collapsed) {
  width: 240px;
  align-items: flex-start;
}
.rail-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.rail-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--color-text);
  padding: 6px 10px;
}
.rail-brand.is-hidden {
  visibility: hidden;
}
.rail-toggle {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--color-text);
  display: grid;
  place-items: center;
}
.rail-toggle-icon {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
  transition: transform 0.2s ease;
}
.rail:not(.is-collapsed) .rail-toggle-icon {
  transform: rotate(180deg);
}
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}
.rail-link {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--txt-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px;
  border-radius: 12px;
  transition: background 0.2s var(--panel), color 0.2s var(--panel);
}
.rail-link .rail-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rail-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.4;
}
.rail-link .rail-label {
  font-size: 13px;
  font-weight: 600;
}
.rail.is-collapsed .rail-label {
  opacity: 0;
  visibility: hidden;
  width: 0;
}
.rail-link.is-active {
  background: rgba(39, 39, 42, 0.95);
  color: var(--color-text);
}
.rail-link:hover {
  background: rgba(39, 39, 42, 0.75);
  color: var(--color-text);
}
.rail-footer {
  width: 100%;
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(63, 63, 70, 0.55);
}
.rail-user-wrap {
  position: relative;
  width: 100%;
}
.rail-user {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--txt-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s var(--panel), color 0.2s var(--panel);
}
.rail-user:hover {
  background: rgba(39, 39, 42, 0.75);
  color: var(--color-text);
}
.rail-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.2);
}
.rail-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}
.rail.is-collapsed .rail-user {
  justify-content: center;
}
.rail.is-collapsed .rail-user-meta {
  display: none;
}
.rail-user-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: 180px;
  width: 200px;
  max-width: 70vw;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 80;
}
.rail-user-menu.is-open {
  display: flex;
}
.rail-user-menu-item {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(24, 24, 27, 0.92);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.rail-user-menu-item:hover,
.rail-user-menu-item:focus {
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--text-strong);
}
.rail-user-menu-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rail-user-menu-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.4;
}
.rail-user-menu-label {
  font-weight: 600;
}

#content {
  flex: 1 1 auto;
  min-width: var(--main-min-width, 560px);
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-bg-surface);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.non-gantt .ct-header,
.non-gantt .kpi-ribbon {
  display: none;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
button,
.btn {
  cursor: pointer;
  border-radius: 6px;
  padding: 8px 12px;
  border: 1px solid transparent;
  transition:
    background 0.16s var(--tap),
    transform 0.16s var(--tap),
    border-color 0.16s var(--tap),
    color 0.16s var(--tap),
    box-shadow 0.16s var(--tap);
}
button:hover,
.btn:hover {
  transform: translateY(-1px);
}
button:active,
.btn:active {
  transform: translateY(0);
}

button.primary {
  background: linear-gradient(135deg, #27272f, #18181b);
  color: #f9fafb;
  border: 1px solid rgba(82, 82, 91, 0.95);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}
button.primary:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--txt-2);
}
button.ghost:hover {
  color: var(--txt-1);
  border-color: rgba(148, 163, 184, 0.8);
}
button.ghost:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
button.icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.icon-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button.icon-button svg .fill {
  fill: currentColor;
  stroke: none;
}

.tab-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--spacing-panel) var(--spacing-gutter) calc(var(--spacing-panel) + 8px);
  scrollbar-gutter: stable;
}

.app-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-panel);
  padding: var(--spacing-header-y) var(--spacing-header-x);
  background: linear-gradient(120deg, #202125, #151518);
  border-bottom: 1px solid rgba(63, 63, 70, 0.8);
}

.header-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--spacing-gutter);
}

.header-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--spacing-section);
  padding-top: var(--spacing-section);
  border-top: 1px solid rgba(132, 142, 160, 0.24);
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--spacing-tight);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(39, 39, 42, 0.95);
  border: 1px solid rgba(82, 82, 91, 0.9);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 14px;
  color: var(--hero-title);
  text-transform: uppercase;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: rgba(199, 206, 220, 0.78);
}

.brand-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--hero-title);
  line-height: 1.25;
}

.scenario-context {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.scenario-name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 16px;
  color: var(--color-text-strong);
}

.scenario-context-name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.scenario-context-id {
  font-size: 13px;
  color: var(--color-text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--color-accent-soft);
  border: 1px solid rgba(128, 140, 168, 0.45);
  color: var(--color-text-strong);
}

.status-pill.status-warning {
  background: rgba(246, 173, 85, 0.2);
  border-color: rgba(246, 173, 85, 0.4);
  color: var(--color-warning);
}

.status-pill.status-danger {
  background: rgba(239, 104, 104, 0.15);
  border-color: rgba(239, 104, 104, 0.4);
  color: var(--color-danger);
}

.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.scenario-meta-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.scenario-meta-item::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.scenario-meta-item:first-child::before {
  content: none;
}

.workspace-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 18px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: var(--color-bg-panel);
  color: var(--color-text);
  cursor: pointer;
  min-width: 180px;
}

.workspace-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.workspace-subtext {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-text-muted);
}

.workspace-pill:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}


.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.98);
  color: rgba(229, 231, 235, 0.9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.header-btn:hover {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.98);
}

.header-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.header-icon svg {
  width: 18px;
  height: 18px;
  stroke: rgba(214, 219, 230, 0.86);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.header-label {
  white-space: nowrap;
}

.theme-switcher {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-medium);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  color: var(--text);
  backdrop-filter: blur(12px) saturate(150%);
}

.theme-switcher label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.theme-switcher select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-small);
  color: var(--text-strong);
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(10, 12, 16, 0.32);
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 4px), calc(100% - 12px) calc(50% + 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.theme-switcher select:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.hero-illustration {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: rgba(226, 232, 240, 0.86);
}

.hero-radar {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(63, 63, 70, 0.8), rgba(24, 24, 27, 0.3));
  border: 1px solid var(--surface-border);
  display: grid;
  place-items: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-radar span {
  position: absolute;
}

.hero-radar span:nth-child(1) { top: 16px; left: 50%; transform: translateX(-50%); }
.hero-radar span:nth-child(2) { bottom: 20px; left: 50%; transform: translateX(-50%); }
.hero-radar span:nth-child(3) { left: 24px; top: 50%; transform: translateY(-50%) rotate(-90deg); }

.hero-hint {
  display: none;
}

body.chat-open {
  overflow: hidden;
}

.copilot-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #0b1220;
  border: none;
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--elev-2);
  z-index: 90;
}
.copilot-fab-logo {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.copilot-fab:hover {
  transform: translateY(-2px);
}
.copilot-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 15, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 80;
}
body.chat-open .copilot-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.ui-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 140;
}

.ui-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 15, 0.58);
  backdrop-filter: blur(6px);
}

.ui-modal__panel {
  position: relative;
  width: min(460px, 100%);
  background: var(--panel-background);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--panel-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ui-modal__header h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.25;
}

.ui-modal__message {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ui-modal__input {
  width: 100%;
}

.ui-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#chatPanel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: min(var(--chat-panel-width, 420px), calc(100% - 24px));
  min-height: var(--chat-panel-min-height, 360px);
  height: var(--chat-panel-height, auto);
  max-height: calc(100vh - var(--chat-panel-max-height-offset, 160px));
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--elev-2);
  padding: var(--space-4);
  gap: var(--space-3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s var(--panel), transform 0.2s var(--panel);
  z-index: 100;
}
body.chat-open #chatPanel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-resize-handle {
  position: absolute;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  z-index: 2;
}

.chat-resize-handle::after {
  content: '';
  display: block;
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  opacity: 0.8;
}

.chat-resize-handle:focus-visible::after,
.chat-resize-handle.active::after {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.35);
  opacity: 1;
}

.chat-resize-handle--horizontal {
  top: 72px;
  bottom: 40px;
  left: -14px;
  width: 24px;
  cursor: ew-resize;
}

.chat-resize-handle--horizontal::after {
  width: 4px;
  height: 48px;
}

.chat-resize-handle--vertical {
  top: -18px;
  left: 36px;
  right: 36px;
  height: 18px;
  cursor: ns-resize;
}

.chat-resize-handle--vertical::after {
  width: 48px;
  height: 4px;
}

.chat-resize-handle--corner {
  top: -18px;
  left: -18px;
  width: 28px;
  height: 28px;
  cursor: nwse-resize;
}

.chat-resize-handle--corner::after {
  width: 14px;
  height: 14px;
  border-radius: 6px;
}
.copilot-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.chat-context,
.chat-input,
.chat-hint { flex: 0 0 auto; }
.chat-messages { flex: 1 1 auto; min-height: 0; }
.chat-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
}

.chat-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.58);
  overflow: hidden;
}

.chat-history-pane {
  width: 280px;
  min-width: 280px;
  max-width: 320px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 14px;
  background: rgba(24, 24, 27, 0.95);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: width 0.2s ease, min-width 0.2s ease, opacity 0.2s ease;
}

.chat-history-pane.collapsed {
  width: 46px;
  min-width: 46px;
}

.chat-history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(63, 63, 70, 0.85);
}

.chat-history-pane.collapsed .chat-history-header {
  flex-direction: column;
  padding: 8px 4px;
}

.chat-history-pane.collapsed #chatNewSession {
  display: none;
}

.chat-session-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-history-pane.collapsed .chat-session-list {
  display: none;
}

.chat-session-item {
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 10px;
  background: rgba(9, 9, 11, 0.55);
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  cursor: pointer;
}

.chat-session-item:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
}

.chat-session-item.active {
  border-color: rgba(var(--accent-rgb), 0.75);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.3) inset;
}

.chat-session-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-item-meta {
  grid-column: 1 / span 2;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-delete {
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.85);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
}

.chat-session-delete:hover {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.55);
}

.chat-session-empty {
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed rgba(63, 63, 70, 0.9);
  border-radius: 10px;
  padding: 10px;
}

.chat-context {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.96), rgba(18, 18, 20, 0.92));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-context-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chat-context-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.8);
  margin: 0 0 6px;
}

.chat-context-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--hero-title);
}

.chat-context-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.chat-context-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(var(--accent-rgb), 0.2);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--hero-title);
}

.chat-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}

.ghost-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.ghost-link:hover {
  color: var(--accent-strong);
}

.ghost-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.chat-hint-link {
  margin-left: auto;
  color: rgba(191, 219, 254, 0.8);
  font-size: 12px;
}

.chat-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chat-controls {
  padding: 0 24px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.chat-alerts {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.chat-alerts.active { display: flex; }

.chat-alert {
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(248, 250, 252, 0.12);
  border: 1px solid rgba(241, 245, 249, 0.18);
  color: var(--text);
}

.chat-alert.warn { border-color: rgba(249, 115, 22, 0.45); background: rgba(249, 115, 22, 0.12); color: #ffedd5; }
.chat-alert.error { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.12); color: #fee2e2; }
.chat-alert.info { border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.12); color: #dbeafe; }

.chat-actions,
.chat-tools,
.chat-levers,
.chat-telemetry {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.chat-actions.active,
.chat-tools.active,
.chat-levers:not(.hidden) {
  display: flex;
}

.chat-action,
.chat-tool-section {
  background: rgba(24, 24, 27, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgba(39, 39, 42, 0.85);
}

.chat-action.pending { border-color: rgba(249, 115, 22, 0.45); }
.chat-action-title { font-weight: 600; font-size: 13px; color: var(--text-strong); }
.chat-action span,
.chat-action-detail,
.chat-action-hint,
.chat-tool-item,
.chat-tool-note { font-size: 12px; color: var(--muted); }

.chat-action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-action-btn {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.95);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-action-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.65); }
.chat-action-btn.confirm { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); border-color: rgba(var(--accent-rgb), 0.65); color: #fff; }
.chat-action-btn.confirm:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75); }
.chat-action-btn.dismiss { background: rgba(24, 24, 27, 0.85); color: var(--muted); }
.chat-action-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; transform: none; }

.chat-tools { background: rgba(24, 24, 27, 0.75); }
.chat-tool-section + .chat-tool-section { border-color: rgba(63, 63, 70, 0.9); }
.chat-tool-label { font-weight: 600; color: var(--text-strong); }
.chat-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.25);
  color: var(--hero-title);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-tool-warning { color: #facc15; font-size: 11px; }

.chat-telemetry { color: var(--muted); font-size: 12px; }
.chat-telemetry strong { color: var(--text-strong); font-size: 12px; }

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(24, 24, 27, 0.96);
}

.chat-input textarea {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.98);
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
  resize: none;
  min-height: 44px;
  max-height: 220px;
  overflow-y: hidden;
}

.chat-input-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}

.chat-input button:not(.ghost) {
  padding: 10px 18px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid rgba(82, 82, 91, 0.95);
  background: linear-gradient(135deg, #27272f, #18181b);
  color: #f9fafb;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.chat-input button:not(.ghost):hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7); }

.chat-hint {
  padding: 0 16px 14px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-tip { color: rgba(199, 210, 254, 0.75); }

.chat-hint-link {
  margin-left: auto;
  color: rgba(191, 219, 254, 0.82);
  font-size: 12px;
}

#zoombar {
  margin: 0;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--color-bg-panel);
  border: 1px solid rgba(63, 63, 70, 0.9);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: inset 0 0 0 1px rgba(39, 39, 42, 0.8);
  align-self: stretch;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
#zoombar .toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#zoombar .density-controls {
  gap: 10px;
}
#zoombar .view-switch-group {
  padding: 0 4px;
}
#zoombar .optimizer-progress {
  display: none;
  flex: 1 1 100%;
  gap: 6px;
  margin-top: 6px;
}
#zoombar .optimizer-progress.is-active {
  display: flex;
  flex-direction: column;
}
#zoombar .optimizer-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
#zoombar .optimizer-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
  position: relative;
}
#zoombar .optimizer-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.55), var(--accent));
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
  transition: width 0.2s ease;
}
#zoombar .optimizer-progress.is-indeterminate .optimizer-progress-bar {
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0.35),
    rgba(var(--accent-rgb), 0.8),
    rgba(var(--accent-rgb), 0.35)
  );
  background-size: 220% 100%;
  animation: optimizerSheen 1.4s ease infinite;
}
#zoombar .optimizer-progress.is-error .optimizer-progress-bar {
  background: linear-gradient(
    90deg,
    rgba(248, 113, 113, 0.75),
    rgba(239, 68, 68, 0.95)
  );
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}

@keyframes optimizerSheen {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gantt-corner-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 25;
  width: calc(var(--label-width, 180px) - 16px);
  min-width: 150px;
  max-width: 240px;
  pointer-events: auto;
}
.gantt-corner-controls .category-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gantt-corner-controls .category-filter label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(209, 213, 219, 0.7);
}
.gantt-corner-controls .category-filter select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(82, 82, 91, 0.9);
  background: var(--bg-2);
  color: var(--color-text-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 8px 22px rgba(0, 0, 0, 0.55);
}
.gantt-corner-controls .category-filter select:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}
.gantt-corner-controls .category-filter select option {
  background: var(--bg-2);
  color: var(--color-text-strong);
}
#zoombar .pane-toggle-group {
  border-left: 1px solid rgba(82, 82, 91, 0.7);
  padding-left: 12px;
  margin-left: 6px;
  gap: 10px;
}
#zoombar .toolbar-toggle svg {
  width: 22px;
  height: 22px;
}

#zoombar .worker-only {
  display: none;
}

body.worker-schedule-active #zoombar {
  justify-content: flex-start;
  gap: 8px;
}

body.worker-schedule-active #zoombar .machine-only {
  display: none;
}

body.worker-schedule-active #zoombar .worker-only {
  display: inline-flex;
}

#zoomInfo,
#zoomInfoHero {
  font-size: 12px;
  color: rgba(209, 213, 219, 0.85);
}

.sync-view-action {
  margin-left: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-state-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.view-state-toggles button {
  min-height: 34px;
}

.sync-view-button {
  min-width: 44px;
}
#zoomInfo[aria-hidden="true"],
#zoomInfoHero[aria-hidden="true"] {
  display: none;
}

#paneSchedule #ganttSplitWrapper {
  display: flex;
  flex-direction: row;
  gap: 24px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  align-items: flex-start;
}

#paneSchedule #ganttSplitWrapper.split-wrap {
  position: relative;
}

#paneSchedule.split-mode #ganttSplitWrapper.split-wrap {
  display: grid;
  grid-template-columns: var(--split-left, 1fr) 8px var(--split-right, 1fr);
  gap: 0;
  align-items: stretch;
}

.split-resizer {
  display: none;
}

#paneSchedule.split-mode .split-resizer {
  display: block;
  width: 8px;
  border-radius: 4px;
  background: var(--line);
  cursor: col-resize;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.split-wrap.dragging .split-resizer {
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.4);
}

.split-wrap.dragging iframe {
  pointer-events: none;
}

.gantt-pane {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.gantt-pane.secondary {
  display: none;
  --split-frame-height: 100%;
}

.gantt-pane.secondary.visible {
  display: flex;
}

#ganttSplitFrame {
  display: block;
  border: 1px solid var(--gantt-border);
  width: 100%;
  height: var(--split-frame-height, 100%);
  min-height: 420px;
  border-radius: var(--radius-large);
  background: var(--gantt-background);
  box-shadow: var(--panel-shadow);
}
#summaryTables {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 8px;
}

@media (min-width: 1200px) {
  #summaryTables {
    grid-template-columns: minmax(560px, 3fr) minmax(280px, 1.3fr);
  }
}

#paneSchedule {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px 32px 32px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

#paneSchedule .chrome-reveal-zone {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12px;
  z-index: 90;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}
body.chrome-collapsed #paneSchedule .chrome-reveal-zone {
  pointer-events: auto;
  opacity: 1;
}
#paneSchedule .chrome-reveal-zone:hover {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.2), transparent);
}
body.chrome-collapsed:not(.chrome-revealed) #paneSchedule {
  padding-top: 4px;
}

body.chrome-collapsed:not(.chrome-revealed) .ct-header,
body.chrome-collapsed:not(.chrome-revealed) .kpi-ribbon {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}
body.chrome-revealed .ct-header,
body.chrome-revealed .kpi-ribbon {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

#paneSchedule #jobsSummaryPanel,
#paneSchedule #zoombar {
  flex: none;
}

#paneSchedule #gantt {
  flex: 1 1 auto;
  min-height: 420px;
}

#paneSchedule.split-mode #ganttSplitWrapper {
  gap: 0;
  height: 100%;
}

#paneSchedule.split-mode .timeline-shell {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

#paneSchedule.split-mode .timeline-main {
  min-height: 0;
  height: 100%;
}

#paneSchedule.split-mode .gantt-pane {
  min-height: 0;
}

#paneSchedule.split-mode #ganttSplitFrame {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

#paneSchedule.split-mode .gantt-left,
#paneSchedule.split-mode .gantt-right,
body.embed-timeline .gantt-left,
body.embed-timeline .gantt-right {
  backdrop-filter: none !important;
}


.worker-empty {
  padding: 32px;
  font-size: 14px;
  color: rgba(209, 213, 219, 0.7);
  text-align: center;
}

#paneSchedule.summary-collapsed #jobsSummaryPanel {
  display: none;
}

#paneSchedule.scenarios-collapsed #scenarioPanel {
  display: none;
}
.schedule-kpi-panel {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-stack);
}
.schedule-kpi-panel .panel-header {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--spacing-section);
}
.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.panel-heading h2 { margin: 0; }
.panel-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(199, 206, 220, 0.7);
}
.schedule-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-section);
}
.schedule-kpi-grid.kpi-grid-empty .kpi-card {
  opacity: 0.6;
}
.kpi-card {
  border-radius: var(--radius-card);
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: linear-gradient(135deg, #18181b, #111115);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--panel-shadow);
  min-height: 150px;
}
.kpi-card.status-ok {
  border-color: rgba(62, 216, 133, 0.4);
  box-shadow: 0 0 0 1px rgba(62, 216, 133, 0.15);
}
.kpi-card.status-warning {
  border-color: rgba(246, 164, 61, 0.5);
  box-shadow: 0 0 0 1px rgba(246, 164, 61, 0.15);
}
.kpi-card.status-danger {
  border-color: rgba(239, 104, 104, 0.55);
  box-shadow: 0 0 0 1px rgba(239, 104, 104, 0.2);
}
.kpi-label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(226, 232, 240, 0.72);
}
.kpi-value {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text-strong);
}
.kpi-meta,
.kpi-footnote {
  margin: 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.78);
}
.kpi-footnote {
  font-size: 12px;
  color: rgba(231, 181, 82, 0.9);
}

body.embed-timeline {
  overflow: hidden;
  min-height: 0;
}
body.embed-timeline #appRail,
body.embed-timeline .ct-header,
body.embed-timeline .kpi-ribbon,
body.embed-timeline #scenarioPanel,
body.embed-timeline #jobsSummaryPanel,
body.embed-timeline .inspector-column,
body.embed-timeline .copilot-fab,
body.embed-timeline #chatPanel,
body.embed-timeline #chatBackdrop,
body.embed-timeline .app-header,
body.embed-timeline #paneDeveloper,
body.embed-timeline #paneSettings,
body.embed-timeline .hero,
body.embed-timeline .panel.summary,
body.embed-timeline .sync-view-action,
body.embed-timeline .developer-top-controls,
body.embed-timeline .summary-block,
body.embed-timeline #zoombar {
  display: none !important;
}

body.embed-timeline .gantt-corner-controls {
  display: none !important;
}

body.embed-timeline #content {
  padding: 0;
  border-left: 0;
  background: transparent;
  box-shadow: none;
  min-width: 0;
}

body.embed-timeline main {
  flex: 1 1 auto;
  min-height: 0;
}

body.embed-timeline #paneSchedule {
  padding: 0;
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  background: transparent;
}

body.embed-timeline #paneSchedule .timeline-shell {
  margin: 0;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-rows: minmax(0, 1fr);
}

body.embed-timeline #paneSchedule .timeline-main {
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
}

body.embed-timeline #paneSchedule #ganttSplitWrapper {
  height: 100%;
  gap: 0;
  align-items: stretch;
}

.summary-block {
  background: var(--color-bg-panel);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 20px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: inset 0 0 0 1px rgba(39, 39, 42, 0.8);
}

.summary-block h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-strong);
}

.msg {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.98), rgba(15, 15, 18, 0.95));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75);
  font-size: 13px;
  line-height: 1.55;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(226, 232, 240, 0.92);
}

/* Typing spinner */
.spinner { display:inline-block; width:14px; height:14px; border:2px solid rgba(148,163,184,0.4); border-top-color:#818cf8; border-radius:50%; animation: spin 0.9s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(14, 165, 233, 0.85)); border-color: rgba(59, 130, 246, 0.55); color: var(--text-strong); }
.msg.bot { align-self: flex-start; background: rgba(24, 24, 27, 0.94); border-color: rgba(63, 63, 70, 0.9); color: rgba(226, 232, 240, 0.92); }
.msg.system { align-self: center; background: rgba(24, 24, 27, 0.96); border-color: rgba(82, 82, 91, 0.9); color: #e5e7eb; }

/* Control tower refresh */
.ct-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  position: sticky;
  top: 0;
  z-index: 60;
  transition: transform var(--chrome-collapse-speed) ease, opacity var(--chrome-collapse-speed) ease,
    padding var(--chrome-collapse-speed) ease, margin var(--chrome-collapse-speed) ease,
    height var(--chrome-collapse-speed) ease;
}
.ct-header .brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 12, 16, 0.6);
  border: 1px solid rgba(82, 82, 91, 0.5);
}
.ct-header .brand-logo {
  display: block;
  height: 68px;
  width: auto;
  max-width: 480px;
  object-fit: contain;
}
.ct-header .brand-name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--txt-1);
}
.ct-header .brand-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--txt-2);
  font-size: 12px;
}
.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.brand-meta-item {
  color: var(--txt-3);
  font-size: 12px;
}
.header-actions {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}
.selector label {
  font-size: 12px;
  color: var(--txt-3);
}
.select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radii);
  padding: 10px 14px;
  background: var(--bg-2);
  color: var(--txt-1);
  font-size: 14px;
}
.scenario-select-id {
  font-size: 12px;
  color: var(--txt-3);
}
.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-bottom: 1px solid var(--line);
  transition: transform var(--chrome-collapse-speed) ease, opacity var(--chrome-collapse-speed) ease,
    padding var(--chrome-collapse-speed) ease, margin var(--chrome-collapse-speed) ease,
    height var(--chrome-collapse-speed) ease;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radii);
  padding: 12px 16px;
  text-align: left;
  background: rgba(39, 39, 42, 0.85);
  box-shadow: var(--elev-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 96px;
}
.kpi-head {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--txt-3);
}
.kpi-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.kpi .num {
  font: 600 2rem/1 "IBM Plex Mono", ui-monospace, monospace;
  color: var(--txt-1);
  font-variant-numeric: tabular-nums;
}
.kpi .delta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ok);
  margin-top: 2px;
  padding: 0;
  border: none;
}
.kpi .delta.down { color: var(--danger); }
.kpi-sub {
  font-size: 12px;
  color: var(--txt-2);
}
.spark {
  width: 100%;
  height: 28px;
}
.spark path {
  fill: none;
  stroke: var(--txt-3);
  stroke-width: 2;
  opacity: 0.8;
}
.seg {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.seg-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--txt-2);
}
.seg-btn.is-active {
  background: var(--bg-2);
  color: var(--txt-1);
}
.spacer {
  flex: 1;
}
.timeline-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin-top: 0;
}
.timeline-shell.has-side-panels {
  grid-template-columns: minmax(0, 1fr) 400px;
}
.timeline-shell:not(.has-side-panels) .inspector-column {
  display: none;
}
.inspector-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.inspector-column > .inspector,
.inspector-column > .kpi-lens {
  width: 100%;
}
.timeline-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.inspector {
  position: sticky;
  top: var(--inspector-stick-top, 32px);
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - var(--inspector-stick-top, 32px) - 24px);
  overflow-y: auto;
  padding: var(--space-5);
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  box-shadow: var(--elev-2);
  border-radius: var(--radii);
  align-self: flex-start;
  transition: opacity .24s var(--panel), transform .24s var(--panel);
}
.inspector.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  display: none;
}
.inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.inspector-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inspector-breadcrumb {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 13px;
}
.inspector-crumb {
  display: block;
  line-height: 1.3;
}
.inspector-crumb--primary {
  color: var(--txt-1);
  font-weight: 600;
}
.inspector-crumb--secondary {
  color: var(--txt-3);
  font-weight: 500;
}
.inspector-subtitle {
  font-size: 12px;
  color: var(--txt-3);
}
.inspector-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.inspector .scope-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.inspector .scope-toggle .seg-btn {
  border-radius: 999px;
  font-size: 12px;
  padding: 4px 10px;
}
.inspector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-3);
}
.inspector.is-editing .inspector-tags,
.inspector.is-editing .inspector-summary-card,
.inspector.is-editing #inspectorRoleSection,
.inspector.is-editing #inspectorCauseSection,
.inspector.is-editing #inspectorActionSection,
.inspector.is-editing #inspectorActionResult,
.inspector.is-editing #inspectorMultiState,
.inspector.is-editing #inspectorEmptyState {
  display: none;
}
.inspector-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--txt-2);
  font-size: 12px;
}
.inspector-tag[data-variant="status"] {
  border: 1px solid rgba(148, 163, 184, 0.4);
}
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radii);
  background: var(--bg-2);
}
.inspector-summary-card {
  flex-direction: column;
  gap: var(--space-3);
}
.stat-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}
.stat-meta-item .label {
  display: block;
  font-size: 11px;
  color: var(--txt-3);
}
.stat-meta-item .value {
  font-size: 13px;
}
.stat-label {
  color: var(--txt-2);
}
.stat-value .mono {
  font: 600 20px/1 "IBM Plex Mono", ui-monospace, monospace;
}
.inspector-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.inspector-summary-chips {
  margin-left: auto;
}
.inspector-summary-chips .kpi-lens__chip {
  font-size: 11px;
  padding: 4px 10px;
}
.inspector .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--space-4) 0;
}
.inspector .chip {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.inspector .role-fitter { border-color: rgba(43,182,115,.35); }
.inspector .role-helper { border-color: rgba(217,165,42,.35); }
.inspector .role-welder { border-color: rgba(242,109,109,.35); }
.inspector .role-qa { border-color: rgba(103,212,255,.35); }
.inspector-section {
  margin-top: var(--space-4);
}
.inspector-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.inspector-section h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--txt-2);
}
.inspector-nav {
  display: inline-flex;
  gap: 8px;
}
.causes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.cause {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.cause-bar {
  width: var(--w, 40%);
  max-width: 140px;
  min-width: 40px;
  height: 6px;
  border-radius: 3px;
  background: var(--warn);
}
.cause-value {
  font-variant-numeric: tabular-nums;
  color: var(--txt-2);
}
.cause .link {
  margin-left: auto;
}
.link {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.inspector-empty {
  margin-top: var(--space-4);
  padding: 12px;
  border-radius: var(--radii);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  color: var(--txt-3);
  font-size: 13px;
}
.inspector-multi {
  margin-top: var(--space-4);
  padding: 12px;
  border-radius: var(--radii);
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.85);
}
.inspector-multi.hidden,
.inspector-empty.hidden,
.inspector-section.hidden {
  display: none;
}
.inspector .chip.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
}
.inspector-drawer {
  margin-top: var(--space-4);
  border-radius: var(--radii);
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.96);
  padding: var(--space-4);
}
.inspector-drawer.hidden {
  display: none;
}
.inspector-drawer h4 {
  margin-top: 0;
}
.inspector-drawer form {
  display: grid;
  gap: 12px;
}
.inspector-drawer label {
  font-size: 12px;
  color: var(--txt-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inspector-drawer footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.inspector-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.inspector-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.inspector-edit-meta {
  font-size: 12px;
  color: var(--txt-2);
}
.inspector-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inspector-edit-row input {
  flex: 1;
  min-width: 0;
}
.inspector-edit-status {
  font-size: 12px;
  color: var(--txt-2);
  margin-top: 8px;
}
.inspector-edit-status.status-error {
  color: var(--color-danger);
}
.inspector-edit-status.status-success {
  color: var(--color-positive);
}
.inspector-edit-modes {
  margin-top: 4px;
}
.inspector-edit-panel.hidden {
  display: none;
}
.labour-mode-status {
  font-size: 12px;
  color: var(--txt-2);
  margin-bottom: 6px;
}
.labour-mode-status.status-error {
  color: var(--color-danger);
}
.labour-mode-status.status-success {
  color: var(--color-positive);
}
.labour-mode-body {
  display: grid;
  gap: 12px;
}
.labour-step {
  border: 1px solid var(--line);
  border-radius: var(--radii);
  background: var(--bg-1);
  padding: 10px;
}
.labour-step-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--txt-2);
  margin-bottom: 8px;
}
.labour-step-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.labour-step-row + .labour-step-row {
  margin-top: 6px;
}
.labour-step-role {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.labour-role-name {
  font-size: 13px;
  color: var(--txt-1);
}
.labour-role-meta {
  font-size: 11px;
  color: var(--txt-3);
}
.labour-role-current {
  font-size: 12px;
  color: var(--txt-2);
}
.labour-step-row select {
  width: 100%;
}
.labour-step-empty {
  font-size: 12px;
  color: var(--txt-3);
}
.inspector .seg-btn.is-active {
  background: var(--accent-soft);
  color: var(--txt-1);
}

.kpi-lens {
  display: none;
  position: sticky;
  top: var(--inspector-stick-top, 32px);
  width: 100%;
  max-width: 420px;
  padding: var(--space-5);
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  border-radius: var(--radii);
  box-shadow: var(--elev-2);
  align-self: flex-start;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition: opacity .24s var(--panel), transform .24s var(--panel);
}
.kpi-lens.is-open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.scenario-panel {
  display: none;
  position: sticky;
  top: var(--inspector-stick-top, 32px);
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - var(--inspector-stick-top, 32px) - 24px);
  padding: var(--space-5);
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  border-radius: var(--radii);
  box-shadow: var(--elev-2);
  align-self: flex-start;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition: opacity .24s var(--panel), transform .24s var(--panel);
  flex-direction: column;
  gap: var(--space-4);
  overflow: hidden;
}
.scenario-panel.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.scenario-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.scenario-panel__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scenario-panel__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--txt-3);
}
.scenario-panel__title h3 {
  margin: 0;
  font-size: 18px;
  color: var(--txt-1);
}
.scenario-panel__actions {
  display: flex;
  gap: 8px;
}
.scenario-panel__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-height: 0;
}
.scenario-list-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.scenario-panel button.icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
}
.scenario-panel button.icon-button svg {
  width: 18px;
  height: 18px;
}
.dashboards-root .kpi-lens {
  position: fixed;
  top: 120px;
  right: 32px;
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  z-index: 20;
}
.dashboards-root .kpi-lens .job-card__micro {
  height: auto;
  min-height: 18px;
  margin-top: 0.5rem;
  margin-bottom: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
}
.dashboards-root .kpi-lens .job-card__micro-empty {
  line-height: 1.2;
}
@media (max-width: 1100px) {
  .dashboards-root .kpi-lens {
    top: auto;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    max-height: min(70vh, 520px);
  }
}
.kpi-lens__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--space-5);
}
.kpi-lens__eyebrow-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--txt-3);
}
.kpi-lens__nav {
  display: inline-flex;
  gap: 6px;
}
.kpi-lens__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.kpi-lens__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.kpi-lens__title-row h3 {
  margin: 0;
  font-size: 20px;
  color: var(--txt-1);
}
.kpi-lens__metric {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.kpi-lens__value {
  font: 600 32px/1 'Inter', system-ui;
}
.kpi-lens__delta {
  font: 500 16px/1 'Inter', system-ui;
  color: var(--txt-2);
}
.kpi-lens__meta {
  margin: 0;
  font-size: 13px;
  color: var(--txt-3);
}
.kpi-lens__section {
  margin-bottom: var(--space-5);
}
.kpi-lens__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
  color: var(--txt-2);
}
.kpi-lens__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.kpi-lens__label {
  color: var(--txt-3);
}
.kpi-lens__row-value {
  color: var(--txt-1);
  text-align: right;
  word-break: break-word;
}
.kpi-lens__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.kpi-lens__section-head h4 {
  margin: 0;
  font-size: 14px;
  color: var(--txt-2);
}
.kpi-lens__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kpi-lens__chip {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.1);
  cursor: pointer;
  font-size: 12px;
}
.kpi-lens__chip.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
  color: var(--txt-1);
}
.kpi-lens__drivers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}
.kpi-lens__drivers::-webkit-scrollbar {
  width: 6px;
}
.kpi-lens__drivers::-webkit-scrollbar-track {
  background: var(--ui-scrollbar-track);
  border-radius: 999px;
}
.kpi-lens__drivers::-webkit-scrollbar-thumb {
  background: var(--ui-scrollbar-thumb);
  border-radius: 999px;
  border: 1px solid var(--ui-scrollbar-border);
}
.kpi-driver {
  border-radius: var(--radii);
  border: 1px solid rgba(63, 63, 70, 0.9);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(24, 24, 27, 0.85);
}
.kpi-driver__header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.kpi-driver__title {
  font-size: 14px;
  font-weight: 600;
}
.kpi-driver__meta {
  font-size: 12px;
  color: var(--txt-3);
}
.kpi-driver__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.kpi-driver__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kpi-driver__actions .link {
  font-size: 12px;
}
.kpi-driver.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 0 0 1px rgba(63, 63, 70, 0.9);
}
.kpi-lens__actions-toggle {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.12);
  color: var(--txt-1);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.kpi-lens__actions-toggle[aria-expanded="true"] {
  background: rgba(39, 39, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.9);
}

.kpi-lens__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--space-3);
}
.kpi-lens__actions.hidden {
  display: none;
}
.kpi-lens__action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi-lens__action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radii);
  border: 1px solid rgba(63, 63, 70, 0.9);
  padding: 12px;
  background: rgba(24, 24, 27, 0.9);
  cursor: pointer;
  text-align: left;
  gap: 12px;
}
.kpi-lens__action-btn:hover,
.kpi-lens__action-btn.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
}
.kpi-lens__action-label {
  font-size: 14px;
  font-weight: 600;
}
.kpi-lens__action-description {
  font-size: 12px;
  color: var(--txt-3);
}
.kpi-lens__recover-strategies {
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: var(--radii);
  background: rgba(18, 18, 22, 0.95);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi-lens__recover-note {
  font-size: 11px;
  color: var(--txt-3);
}
.kpi-lens__recover-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kpi-lens__strategy-btn {
  border: 1px solid rgba(82, 82, 91, 0.9);
  background: rgba(24, 24, 27, 0.96);
  color: var(--txt-1);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.kpi-lens__strategy-btn:hover {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
}
.kpi-lens__strategy-btn.is-active {
  border-color: rgba(93, 160, 255, 0.75);
  background: rgba(93, 160, 255, 0.16);
  color: #dbeafe;
}
.kpi-lens__freeze-controls {
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: var(--radii);
  background: rgba(18, 18, 22, 0.95);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi-lens__freeze-note {
  font-size: 11px;
  color: var(--txt-3);
}
.kpi-lens__freeze-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.kpi-lens__freeze-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-lens__freeze-label {
  font-size: 11px;
  color: var(--txt-3);
}
.kpi-lens__freeze-input {
  border: 1px solid rgba(82, 82, 91, 0.9);
  border-radius: 8px;
  background: rgba(24, 24, 27, 0.96);
  color: var(--txt-1);
  padding: 8px 10px;
  font-size: 12px;
}
.kpi-lens__freeze-input:focus {
  outline: none;
  border-color: rgba(93, 160, 255, 0.75);
  box-shadow: 0 0 0 2px rgba(93, 160, 255, 0.2);
}
.kpi-lens__freeze-summary {
  font-size: 11px;
  color: var(--txt-2);
}
.kpi-lens__freeze-summary.is-empty,
.kpi-lens__freeze-summary.is-invalid {
  color: #fbbf24;
}
.kpi-lens__action-preview {
  margin-top: var(--space-4);
  padding: 12px;
  border-radius: var(--radii);
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.9);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kpi-lens__action-preview.hidden {
  display: none;
}
.kpi-lens__deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kpi-lens__delta-chip {
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.kpi-lens__delta-chip.positive { color: var(--ok); border-color: rgba(59, 214, 143, 0.45); }
.kpi-lens__delta-chip.negative { color: var(--danger); border-color: rgba(239, 68, 68, 0.4); }
.kpi-lens__action-buttons {
  display: flex;
  gap: 8px;
}
.kpi-filter-dim {
  opacity: 0.25 !important;
}
.kpi-driver-pulse {
  animation: kpiPulse 2s ease-out 1;
}
@keyframes kpiPulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 140, 255, 0.8); }
  100% { box-shadow: 0 0 0 24px rgba(124, 140, 255, 0); }
}
button.small {
  padding: 6px 8px;
  font-size: 12px;
}
#inspectorPanel button.small.primary {
  border-radius: 6px;
}
#paneSchedule .label {
  background: linear-gradient(90deg, var(--bg-0) 60%, transparent);
  color: var(--txt-2);
  font-size: 12px;
  text-transform: none;
}
#paneSchedule .label::after {
  background: var(--line);
  opacity: 0.35;
}
#paneSchedule .lane-row {
  border-bottom: 1px solid var(--line);
  gap: 0;
}
#paneSchedule .lane {
  position: relative;
  height: 38px;
  min-height: 38px;
  content-visibility: auto;
  contain: layout style paint;
}

#gantt[data-hover-active="1"] .lane {
  content-visibility: visible;
  contain: none;
}
#paneSchedule .ops-lane {
  background: rgba(148, 163, 184, 0.025);
}
#paneSchedule .lane-row:nth-child(even) .ops-lane {
  background: rgba(148, 163, 184, 0.06);
}
#paneSchedule #zoombar {
  border-radius: var(--radii);
  border: 1px solid var(--line);
  background: var(--bg-1);
  box-shadow: var(--elev-1);
}

.timeline {
  position: relative;
}
.selection-menu {
  position: absolute;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radii);
  box-shadow: var(--elev-2);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
  z-index: 1100;
}
.selection-menu-btn {
  border: none;
  background: transparent;
  color: var(--txt-1);
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.selection-menu-btn:hover,
.selection-menu-btn:focus {
  background: var(--bg-2);
  color: var(--txt-1);
}
.timeline[data-color-mode="state"] .bar:not(.resource-bar):not(.labour-bar) {
  background: var(--bg-1);
  color: var(--txt-1);
}
.timeline[data-color-mode="product"] .bar:not(.resource-bar):not(.labour-bar) {
  background: var(--p, var(--bg-2));
  color: var(--p-text, var(--txt-1));
  border-color: transparent;
}
.timeline[data-color-mode="status"] .bar:not(.resource-bar):not(.labour-bar) {
  background: var(--status-color, var(--bg-2));
  color: var(--status-text, var(--txt-1));
  border-color: transparent;
}
.timeline[data-color-mode="labour-wait"] .bar:not(.resource-bar):not(.labour-bar),
.timeline[data-color-mode="contract-wait"] .bar:not(.resource-bar):not(.labour-bar) {
  background: var(--wait-color, var(--bg-2));
  color: var(--wait-text, var(--txt-1));
  border-color: transparent;
}
.timeline[data-color-mode="labour-wait"] .labour-bar,
.timeline[data-color-mode="labour-wait"] .resource-bar {
  border-color: transparent;
}
.timeline[data-color-mode="pinned"] .bar:not(.resource-bar):not(.labour-bar) {
  background: var(--pinned-fill, var(--bg-2));
  color: var(--pinned-text, var(--txt-1));
  border-color: transparent;
}
.timeline[data-color-mode="labour-wait"]:not(.labour-wait-focus-active)
  .bar:not(.resource-bar):not(.labour-bar)[data-labour-wait="0"] {
  opacity: 0.25;
}
.timeline[data-color-mode="labour-wait"]:not(.labour-wait-focus-active) .labour-bar[data-labour-wait="0"] {
  opacity: 0.4;
}
.timeline[data-color-mode="labour-wait"]:not(.labour-wait-focus-active) .resource-bar[data-labour-wait="0"] {
  opacity: 0.35;
}

.timeline[data-color-mode="contract-wait"]:not(.labour-wait-focus-active)
  .bar:not(.resource-bar):not(.labour-bar)[data-labour-contract-wait="0"] {
  opacity: 0.25;
}
.timeline[data-color-mode="contract-wait"]:not(.labour-wait-focus-active) .labour-bar[data-labour-contract-wait="0"] {
  opacity: 0.4;
}
.timeline[data-color-mode="contract-wait"]:not(.labour-wait-focus-active) .resource-bar[data-labour-contract-wait="0"] {
  opacity: 0.35;
}
/* Operations with any labour contract wait */
#gantt .bar.contract-wait::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px dashed rgba(99, 102, 241, 0.9);
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.16), rgba(129, 140, 248, 0.08));
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.28);
  z-index: 2;
  pointer-events: none;
}
#gantt .bar.contract-wait:hover::after {
  inset: -2px;
  border: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.25), transparent 65%);
  box-shadow: none;
  z-index: 1;
}
#gantt[data-color-mode="labour-wait"] .bar.contract-wait::after {
  display: none;
}
#gantt[data-color-mode="contract-wait"] .bar.contract-wait::after {
  border-style: solid;
  border-color: rgba(129, 140, 248, 0.7);
}
#gantt .bar:not(.resource-bar):not(.labour-bar) {
  --bar-state-color: var(--op-normal);
  position: absolute;
  height: 28px;
  top: 5px;
  transform: none;
  border-radius: var(--radii);
  border: 1px solid var(--line);
  background: var(--bg-1);
  box-shadow: var(--elev-1);
  color: var(--txt-1);
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  box-sizing: border-box;
}
#gantt .bar.is-selected {
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 5;
}
#gantt .bar.op-edit-pending:not(.resource-bar):not(.labour-bar),
#gantt .bar.op-edit-pinned:not(.resource-bar):not(.labour-bar) {
  border-color: var(--color-warning);
  box-shadow: 0 0 0 2px rgba(246, 164, 61, 0.6);
}
#gantt .bar:not(.resource-bar):not(.labour-bar):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}
#gantt .bar:not(.resource-bar):not(.labour-bar)::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--bar-state-color, var(--op-normal));
}
#gantt .bar .state-dot {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--bar-state-color, var(--op-normal));
  transform: translateY(-50%);
  pointer-events: none;
}
#gantt .bar:not(.resource-bar):not(.labour-bar) .bar-label {
  position: absolute;
  left: 20px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--txt-1);
}
#gantt .bar:not(.resource-bar):not(.labour-bar) .bar-label span {
  color: var(--txt-2);
  font-size: 12px;
}
#gantt .bar.op-wait { --bar-state-color: var(--op-wait); }
#gantt .bar.op-blocked { --bar-state-color: var(--op-blocked); }
#gantt .bar.op-qa { --bar-state-color: var(--op-qa); }
#gantt .bar.op-done {
  --bar-state-color: var(--op-done);
  opacity: 0.8;
}
#gantt .bar.machine-blocked-state {
  border-color: rgba(248, 113, 113, 0.78);
  background-color: rgba(127, 29, 29, 0.46);
  background-image: linear-gradient(
    135deg,
    rgba(248, 113, 113, 0.3) 25%,
    transparent 25%,
    transparent 50%,
    rgba(248, 113, 113, 0.3) 50%,
    rgba(248, 113, 113, 0.3) 75%,
    transparent 75%,
    transparent
  );
  background-size: 14px 14px;
}
#gantt .bar.machine-blocked-state .bar-label {
  color: var(--txt-1);
  font-weight: 600;
}
#gantt .bar.wip-in-progress {
  border-color: rgba(94, 234, 212, 0.7);
  background-color: var(--bg-1);
  background-image: linear-gradient(
    135deg,
    rgba(94, 234, 212, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(94, 234, 212, 0.25) 50%,
    rgba(94, 234, 212, 0.25) 75%,
    transparent 75%,
    transparent
  );
  background-size: 16px 16px;
}
#gantt .bar.wip-completed {
  opacity: 0.45;
  filter: saturate(40%);
}
#gantt .bar.wip-completed .bar-label {
  color: var(--txt-2);
}
#gantt .wip-area-label {
  text-transform: none;
  letter-spacing: 0.01em;
}
#gantt .wip-lane-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  width: 100%;
}
#gantt .wip-lane-label__title {
  color: var(--txt-1);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#gantt .wip-lane-label__meta {
  color: var(--txt-2);
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#gantt .bar.wip-area-bar {
  border-color: rgba(94, 234, 212, 0.28);
  box-shadow:
    0 12px 24px rgba(2, 8, 23, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
#gantt .bar.wip-area-bar:hover {
  box-shadow:
    0 18px 28px rgba(2, 8, 23, 0.56),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
#gantt .bar.wip-area-bar .bar-label {
  left: 18px;
}
#gantt .bar.wip-area-bar .state-dot {
  left: 7px;
}
#gantt .bar.wip-occupancy {
  border-color: rgba(94, 234, 212, 0.34);
}
#gantt .bar.wip-opening {
  border-color: rgba(250, 204, 21, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(250, 204, 21, 0.18),
    0 12px 24px rgba(2, 8, 23, 0.45);
}
#gantt .bar.wip-reservation {
  border-style: dashed;
  border-color: rgba(125, 211, 252, 0.5);
  opacity: 0.92;
}
#gantt .bar.wip-overflow {
  border-color: rgba(251, 191, 36, 0.5);
}
#gantt .bar.wip-overflow::before,
#gantt .bar.wip-overflow .state-dot {
  background: rgba(251, 191, 36, 0.92);
}
#gantt .bar.wip-dwell-risk {
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.5),
    0 14px 28px rgba(69, 10, 10, 0.34);
}
.current-time-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--danger);
  pointer-events: none;
  z-index: 30;
}
.current-time-line::after {
  content: "";
  position: absolute;
  top: -6px;
  left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--danger);
}
@media (max-width: 1400px) {
  .ct-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .timeline-shell,
  .timeline-shell.has-side-panels {
    grid-template-columns: minmax(0, 1fr);
  }
  .inspector {
    position: static;
    max-width: none;
    width: 100%;
  }
}
.bar.ghost-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.15) 0, rgba(255,255,255,0.15) 6px, transparent 6px, transparent 12px);
  pointer-events: none;
}
.bar.ghost-preview {
  opacity: 0.55;
}
.bar.highlight-pulse {
  animation: inspectorPulse 1.5s ease-out 0s 1;
}
@keyframes inspectorPulse {
  0% { box-shadow: 0 0 0 0 rgba(93, 160, 255, 0.7); }
  100% { box-shadow: 0 0 0 16px rgba(93, 160, 255, 0); }
}
.msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.85);
}
.msg-meta-label { min-width: 0; }
.msg-meta-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.msg.user .msg-meta { color: rgba(226, 232, 240, 0.82); }
.msg.bot .msg-meta { color: rgba(148, 163, 184, 0.75); }
.msg.system .msg-meta { color: #ede9fe; }
.msg-body { display: flex; flex-direction: column; gap: 6px; }
.msg-activity-host {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.msg.system .msg-body { color: #ede9fe; }
.msg-paragraph { margin: 0; }
.msg-heading { font-weight: 600; }
.msg-paragraph + .msg-paragraph { margin-top: 6px; }
.msg-list { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; list-style-position: outside; }
.msg-list li { margin: 0; line-height: 1.45; padding-left: 0; }
.msg-list li::marker { color: rgba(var(--accent-rgb), 0.7); }
.msg.system .msg-list li::marker { color: #ede9fe; }
.msg-body strong { font-weight: 600; color: var(--text-strong); }
.msg-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.28);
  color: rgba(226, 232, 240, 0.84);
  font: 600 12px/1 "Inter", system-ui;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.msg-action-btn:hover {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, 0.68);
  border-color: rgba(148, 163, 184, 0.36);
  color: rgba(248, 250, 252, 0.96);
}
.msg-action-btn:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.55);
  outline-offset: 2px;
}
.chat-stream-status {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: rgba(148, 163, 184, 0.76);
}
.chat-stream-status.visible { display: inline-flex; }
.chat-stream-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}
.chat-stream-status[data-state="running"] {
  color: #fbbf24;
}
.chat-stream-status[data-state="running"]::before {
  animation: chatActivityPulse 1.2s ease-in-out infinite;
}
.chat-stream-status[data-state="completed"] { color: #22c55e; }
.chat-stream-status[data-state="warn"] { color: #f59e0b; }
.chat-stream-status[data-state="error"] { color: #ef4444; }
.chat-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(45vh, 420px);
  overflow: auto;
  padding-right: 2px;
}
.chat-kpi-history {
  display: none;
  flex-direction: column;
  gap: 6px;
  max-height: min(32vh, 240px);
  overflow: auto;
  padding-right: 2px;
}
.chat-kpi-history.visible {
  display: flex;
}
.chat-kpi-entry {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(15, 23, 42, 0.45);
}
.chat-kpi-entry-title {
  font-size: 0.73rem;
  letter-spacing: 0.02em;
  color: rgba(148, 163, 184, 0.9);
}
.chat-activity-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.78rem;
  line-height: 1.35;
}
.chat-activity-item[data-state="running"] {
  border-color: rgba(251, 191, 36, 0.35);
}
.chat-activity-item[data-state="completed"] {
  border-color: rgba(34, 197, 94, 0.35);
}
.chat-activity-item[data-state="warn"] {
  border-color: rgba(245, 158, 11, 0.35);
}
.chat-activity-item[data-state="error"] {
  border-color: rgba(239, 68, 68, 0.4);
}
.chat-activity-item[data-count] .chat-activity-message {
  font-weight: 600;
}
.chat-activity-message {
  color: inherit;
}
.chat-activity-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chat-activity-kpi-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.65);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.72rem;
  line-height: 1.2;
}
@keyframes chatActivityPulse {
  0% { transform: scale(0.82); opacity: 0.55; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.82); opacity: 0.55; }
}
.msg.system .msg-body strong { color: #ede9fe; }
.msg.system.operation-context {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(8, 15, 32, 0.98), rgba(20, 33, 61, 0.96));
  border-color: rgba(96, 165, 250, 0.34);
  color: rgba(226, 232, 240, 0.96);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.28);
}
.msg.system.operation-context .msg-meta {
  color: rgba(147, 197, 253, 0.94);
}
.msg.system.operation-context .msg-body {
  color: rgba(226, 232, 240, 0.95);
}
.msg.system.operation-context .msg-action-btn {
  background: rgba(15, 23, 42, 0.48);
  border-color: rgba(147, 197, 253, 0.22);
  color: rgba(219, 234, 254, 0.92);
}
.msg.system.operation-context .msg-action-btn:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(147, 197, 253, 0.44);
  color: #f8fbff;
}
.operation-context-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.operation-context-card__primary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.operation-context-card__job {
  font-size: 14px;
  font-weight: 700;
  color: #f8fbff;
}
.operation-context-card__occurrence {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  border: 1px solid rgba(147, 197, 253, 0.26);
  color: rgba(191, 219, 254, 0.96);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.operation-context-card__op {
  font-size: 13px;
  font-weight: 700;
  color: rgba(191, 219, 254, 0.96);
  line-height: 1.4;
}
.operation-context-card__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.operation-context-card__detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(96, 165, 250, 0.12);
}
.operation-context-card__detail-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.9);
}
.operation-context-card__detail-value {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(226, 232, 240, 0.95);
}

.msg .chips { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--chip-text);
  transition: transform 0.15s ease, background 0.2s ease;
}
.chip:hover { background: var(--chip-hover); color: var(--chip-text); transform: translateY(-1px); }
#gantt {
  position: relative;
  display: grid;
  grid-template-columns: var(--label-width, 180px) 1fr;
  overscroll-behavior: contain;
  background: var(--gantt-background);
  border-radius: var(--radius-large);
  border: 1px solid var(--gantt-border);
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}

.gantt-left {
  overflow: hidden;
  height: 100%;
  z-index: 6;
  background: var(--gantt-left-background);
}

.gantt-left-labels {
  position: relative;
}

.gantt-right {
  overflow: auto;
  height: 100%;
  position: relative;
  background: var(--gantt-right-background);
  scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
  scrollbar-width: thin;
}


.gantt-right::-webkit-scrollbar { height: 10px; }
.gantt-right::-webkit-scrollbar-track {
  background: var(--ui-scrollbar-track);
  border-radius: 999px;
}
.gantt-right::-webkit-scrollbar-thumb {
  background: var(--ui-scrollbar-thumb);
  border-radius: 999px;
  border: 1px solid var(--ui-scrollbar-border);
}
.gantt-right::-webkit-scrollbar-thumb:hover {
  background: var(--ui-scrollbar-thumb-hover);
}

.gantt-tooltip {
  position: fixed;
  pointer-events: none;
  max-width: 520px;
  min-width: 360px;
  padding: 14px 16px;
  border-radius: var(--radius-small);
  background: var(--tooltip-background);
  border: 1px solid var(--tooltip-border);
  box-shadow: var(--tooltip-shadow);
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
  backdrop-filter: blur(12px) saturate(160%);
}

.gantt-tooltip.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.gantt-tooltip .tooltip-header {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.gantt-tooltip ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}

.gantt-tooltip li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.gantt-tooltip li.full {
  display: block;
}

.gantt-tooltip li.warning {
  color: var(--color-warning);
  font-weight: 600;
}

.gantt-tooltip li.warning .warning-icon {
  margin-right: 6px;
}

.gantt-tooltip .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.gantt-tooltip .value {
  font-weight: 600;
  color: var(--text-strong);
}

.zoom-grid-layer,
.zoom-content-layer {
  transform-origin: 0% 50%;
}

body.gantt-scrolling .gantt-left-labels,
body.zooming .gantt-left-labels,
body.zooming .zoom-grid-layer,
body.zooming .zoom-content-layer {
  will-change: transform;
}

#gantt [data-span-minutes] {
  --timeline-span-width: calc(
    (var(--timeline-span-minutes, 0) * var(--px-per-minute, 0px))
      + var(--timeline-span-extra-px, 0px)
  );
  min-width: var(--timeline-span-width);
}

#gantt [data-span-minutes][data-span-apply-width="1"] {
  width: var(--timeline-span-width);
}

#gantt [data-left-minutes] {
  left: calc(
    (var(--timeline-left-minutes, 0) * var(--px-per-minute, 0px))
      + var(--timeline-left-offset-px, 0px)
  );
}

#gantt [data-width-minutes] {
  --timeline-width: max(
    var(--timeline-min-width-px, 0px),
    calc(
      (var(--timeline-width-minutes, 0) * var(--px-per-minute, 0px))
        + var(--timeline-width-offset-px, 0px)
    )
  );
  width: var(--timeline-width);
}

#gantt [data-width-minutes][data-apply-min-width="1"] {
  min-width: var(--timeline-width);
}

#gantt [data-viewport-hidden="1"] {
  display: none !important;
}

.time-header-viewport {
  position: relative;
}

.lanes-viewport {
  position: relative;
}

.gantt-dim-overlay {
  position: absolute;
  left: 0;
  top: 0;
  background: rgba(8, 10, 14, 0.68);
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
  z-index: 2;
}

#gantt[data-hover-active="1"] .gantt-dim-overlay {
  opacity: 1;
}

.lanes-wrapper {
  position: relative;
  min-height: 100%;
  padding-bottom: 16px;
}

.label-header-spacer {
  position: sticky;
  top: 0;
  background: var(--gantt-header-background);
  z-index: 5;
  border-bottom: 1px solid var(--gantt-header-border);
}

.row {
  position: relative;
  height: var(--row-height);
  border-bottom: 1px solid var(--gantt-row-border);
  display: grid;
  grid-template-columns: var(--label-width, 180px) 1fr;
  align-items: stretch;
}

.label {
  position: sticky;
  left: 0;
  background: var(--gantt-label-background);
  border-right: 1px solid var(--gantt-label-border);
  padding: 0 var(--lane-label-padding-inline, 12px);
  font-size: var(--lane-label-font-size, 12px);
  letter-spacing: var(--lane-label-letter-spacing, 0.02em);
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: var(--row-height);
  overflow: hidden;
  z-index: 6;
}
.label:not(.wip-area-label) {
  white-space: nowrap;
  text-overflow: ellipsis;
}
.label.lane-clickable {
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.label.lane-clickable:hover,
.label.lane-clickable:focus-visible {
  background: rgba(39, 39, 42, 0.85);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(63, 63, 70, 0.9);
}

.lane-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--lane-row-gap, 4px);
  min-height: var(--row-height);
  height: auto;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.lane-row.lane-drawer-open {
  background: rgba(39, 39, 42, 0.35);
}

.lane-hover-card {
  position: absolute;
  min-width: 220px;
  max-width: 320px;
  z-index: 60;
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.lane-hover-card.hidden {
  opacity: 0;
  transform: translateY(-4px);
}
.lane-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #f8fafc;
}
.lane-card-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.lane-card-value {
  font-size: 20px;
  font-weight: 600;
}
.lane-card-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(248, 250, 252, 0.6);
}
.lane-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
}
.lane-spark-bar {
  width: 6px;
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px 999px 0 0;
}
.lane-card-next {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.lane-card-next.is-empty {
  opacity: 0.7;
}
.lane-card-risk {
  font-size: 12px;
  color: #f97316;
}
.lane-card-hint {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(248, 250, 252, 0.4);
}

.lane-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px;
  background: rgba(24, 24, 27, 0.98);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  z-index: 55;
}
.lane-drawer.is-loading::after {
  content: 'Loading insights…';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.7);
}
.lane-drawer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(248, 250, 252, 0.6);
  font-size: 18px;
  cursor: pointer;
}
.lane-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 16px;
}
.lane-drawer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  color: #e2e8f0;
  background: var(--gantt-label-background, #15151a);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 14px;
  padding: 16px;
}
.lane-section {
  padding: 12px 14px;
  margin: 0 0 10px;
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(63, 63, 70, 0.9);
}
.lane-section header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.8);
  margin-bottom: 4px;
}
.lane-section-meta {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(148, 163, 184, 0.6);
}
.lane-metric-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 4px 12px;
}
.lane-metric-list li {
  display: block;
  font-size: 12px;
}
.lane-metric-row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 6px;
}
.lane-metric-sub {
  display: block;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
  margin-top: 2px;
}
.lane-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.lane-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.2);
}
.lane-chip.is-empty {
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.4);
}
.lane-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lane-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}
.lane-list li.is-empty {
  opacity: 0.6;
  font-style: italic;
}
.lane-window {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(24, 24, 27, 0.9));
  border: 1px solid rgba(71, 85, 105, 0.6);
}
.lane-window-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.75);
  margin-bottom: 8px;
}
.lane-window-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lane-window-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}
.lane-window-btn.is-active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.8);
  color: #e0f2fe;
}
.lane-driver-list {
  display: grid;
  gap: 6px;
}
.lane-driver {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.lane-driver:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}
.lane-driver em {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.7);
}
.lane-driver-empty {
  font-size: 12px;
  font-style: italic;
  opacity: 0.65;
}
.role-coverage {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(12, 17, 29, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.role-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.role-block {
  background: rgba(24, 24, 27, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.role-block__title {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.8);
}
.role-risk-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.16), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(34, 197, 235, 0.4);
  box-shadow: 0 14px 40px rgba(6, 182, 212, 0.12);
}
.role-risk-card .role-risk__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5b4fc;
}
.role-risk-card .role-risk__value {
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0 2px;
}
.role-risk-card .role-risk__meta {
  font-size: 12px;
  color: #cbd5e1;
}
.role-risk-card.risk-high {
  background: linear-gradient(120deg, rgba(248, 113, 113, 0.16), rgba(248, 180, 180, 0.08));
  border-color: rgba(248, 113, 113, 0.5);
}
.role-risk-card.risk-medium {
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.12), rgba(14, 165, 233, 0.08));
  border-color: rgba(251, 191, 36, 0.45);
}
.role-wait-list {
  display: grid;
  gap: 8px;
}
.role-wait-card {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.16), rgba(59, 130, 246, 0.12));
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.role-wait-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.25);
}
.role-wait-card.status-active {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(120deg, rgba(34, 197, 94, 0.18), rgba(59, 130, 246, 0.12));
}
.role-wait-card.status-upcoming {
  border-color: rgba(234, 179, 8, 0.45);
  background: linear-gradient(120deg, rgba(234, 179, 8, 0.12), rgba(59, 130, 246, 0.08));
}
.role-wait__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.role-wait__machine {
  font-weight: 600;
  font-size: 13px;
}
.role-wait__badge {
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 12px;
}
.role-wait__meta {
  color: #cbd5e1;
  font-size: 12px;
  margin-top: 2px;
}
.role-wait__time {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.8);
}
.role-wait__hint {
  font-size: 11px;
  color: #a5b4fc;
}
.role-burndown-row {
  display: flex;
  gap: 4px;
  height: 12px;
}
.role-burndown-segment {
  display: flex;
  align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.role-burndown-segment.is-empty {
  background: rgba(148, 163, 184, 0.12);
}
.role-burndown-slice {
  display: block;
  height: 100%;
  min-width: 2px;
}
.role-burndown-slice.is-demand {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.75), rgba(251, 113, 133, 0.5));
}
.role-burndown-slice.is-free {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.55), rgba(14, 165, 233, 0.4));
}
.role-burndown-legend {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  color: #cbd5e1;
  font-size: 12px;
}
.legend-chip {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(148, 163, 184, 0.5);
}
.legend-chip.is-demand {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.8), rgba(251, 113, 133, 0.7));
}
.legend-chip.is-free {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.7), rgba(14, 165, 233, 0.6));
}
.role-peer-list {
  display: grid;
  gap: 8px;
}
.role-peer {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: linear-gradient(120deg, rgba(8, 47, 73, 0.8), rgba(6, 95, 70, 0.6));
  border-radius: 10px;
  padding: 10px 12px;
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.role-peer:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(6, 95, 70, 0.35);
}
.role-peer__name {
  font-weight: 600;
}
.role-peer__meta {
  font-size: 12px;
  color: #cbd5e1;
}
.role-peer__roles {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.8);
}
.role-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.role-impact-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: #e2e8f0;
}
.role-impact__label {
  font-size: 12px;
  color: #cbd5e1;
}
.role-impact__value {
  font-size: 16px;
  font-weight: 700;
}
.role-machine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.role-machine-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(30, 41, 59, 0.7);
  cursor: pointer;
}
.role-machine__name {
  font-weight: 600;
}
.role-machine__wait {
  font-size: 12px;
  color: #cbd5e1;
}
.role-empty {
  font-style: italic;
  opacity: 0.7;
  font-size: 12px;
}
.lane-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 6px;
}
.lane-util-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lane-util-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lane-util-stat {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.6);
  background: rgba(15, 23, 42, 0.7);
  font-size: 11px;
  color: rgba(226, 232, 240, 0.8);
}
.lane-util-stat strong {
  font-size: 12px;
  color: #e2e8f0;
}
.lane-util-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 140px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
}
.lane-util-bars.is-stacked {
  align-items: flex-end;
}
.lane-util-bar {
  flex: 1;
  min-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
}
.lane-util-bar-value {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}
.lane-util-bar-track {
  width: 100%;
  height: 100px;
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.9);
  border: 1px solid rgba(63, 63, 70, 0.9);
  position: relative;
  overflow: hidden;
}
.lane-util-bar-track.is-stacked {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.lane-util-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 1;
}
.lane-util-segment {
  width: 100%;
  min-height: 2px;
}
.lane-util-segment.kind-processing {
  background: rgba(34, 197, 94, 0.85);
}
.lane-util-segment.kind-setup {
  background: rgba(251, 191, 36, 0.8);
}
.lane-util-segment.kind-changeover {
  background: rgba(249, 115, 22, 0.8);
}
.lane-util-segment.kind-wait {
  background: rgba(248, 113, 113, 0.85);
}
.lane-util-segment.kind-idle {
  background: rgba(71, 85, 105, 0.7);
}
.lane-util-segment.kind-offshift {
  background: rgba(15, 23, 42, 0.9);
}
.lane-util-segment.kind-normal {
  background: rgba(20, 184, 166, 0.85);
}
.lane-util-segment.kind-overtime {
  background: rgba(56, 189, 248, 0.85);
}
.lane-util-segment.kind-occupied {
  background: rgba(56, 189, 248, 0.85);
}
.lane-util-segment.kind-reserved {
  background: rgba(251, 191, 36, 0.82);
}
.lane-util-segment.kind-free {
  background: rgba(51, 65, 85, 0.72);
}
.lane-util-wait-demand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  border-top: 1px solid rgba(248, 113, 113, 0.85);
  background: repeating-linear-gradient(
    -45deg,
    rgba(248, 113, 113, 0.28),
    rgba(248, 113, 113, 0.28) 4px,
    rgba(248, 113, 113, 0.12) 4px,
    rgba(248, 113, 113, 0.12) 8px
  );
}
.lane-util-wait-demand.is-overflow::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 2px solid rgba(248, 113, 113, 0.9);
}
.lane-util-target {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed rgba(226, 232, 240, 0.8);
  pointer-events: none;
  z-index: 3;
}
.lane-util-bar-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.9), rgba(20, 184, 166, 0.3));
  border-radius: 10px 10px 0 0;
  min-height: 4px;
}
.lane-util-bar.is-selected .lane-util-bar-track {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}
.lane-util-bar-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.05;
  min-height: 24px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.85);
}
.lane-util-bar-dow {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.7);
}
.lane-util-footnote {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
}
.lane-util-month-row {
  display: flex;
  width: 100%;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.8);
  gap: 0;
}
.lane-util-month-row span {
  text-align: center;
  padding-top: 4px;
  flex: 1 1 0;
}
.lane-util-empty {
  padding: 12px;
  border-radius: 8px;
  background: rgba(24, 24, 27, 0.85);
  border: 1px dashed rgba(63, 63, 70, 0.9);
  text-align: center;
  font-size: 12px;
}
.lane-util-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.75);
}
.lane-util-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lane-util-legend-chip {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}
.lane-util-legend-chip.kind-processing { background: rgba(34, 197, 94, 0.85); }
.lane-util-legend-chip.kind-setup { background: rgba(251, 191, 36, 0.8); }
.lane-util-legend-chip.kind-changeover { background: rgba(249, 115, 22, 0.8); }
.lane-util-legend-chip.kind-wait { background: rgba(248, 113, 113, 0.85); }
.lane-util-legend-chip.kind-wait_demand {
  background: repeating-linear-gradient(
    -45deg,
    rgba(248, 113, 113, 0.8),
    rgba(248, 113, 113, 0.8) 3px,
    rgba(248, 113, 113, 0.35) 3px,
    rgba(248, 113, 113, 0.35) 6px
  );
}
.lane-util-legend-chip.kind-idle { background: rgba(71, 85, 105, 0.7); }
.lane-util-legend-chip.kind-offshift { background: rgba(15, 23, 42, 0.9); }
.lane-util-legend-chip.kind-normal { background: rgba(20, 184, 166, 0.85); }
.lane-util-legend-chip.kind-overtime { background: rgba(56, 189, 248, 0.85); }
.lane-util-legend-chip.kind-occupied { background: rgba(56, 189, 248, 0.85); }
.lane-util-legend-chip.kind-reserved { background: rgba(251, 191, 36, 0.82); }
.lane-util-legend-chip.kind-free { background: rgba(51, 65, 85, 0.72); }
.lane-util-legend-chip.target {
  width: 16px;
  height: 0;
  border-top: 2px dashed rgba(226, 232, 240, 0.8);
  border-radius: 0;
}
/* Fatigue pills */
.lane-list-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}
.lane-pill {
  border-radius: 8px;
  padding: 10px 12px;
  background: #0f172a;
  color: #e9eef7;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.lane-pill .pill-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a5b4fc;
}
.lane-pill .pill-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}
.lane-pill .pill-detail {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 2px;
}
.lane-pill.tone-alert {
  background: #2f1a1f;
  border-color: rgba(248, 113, 113, 0.6);
  color: #ffe4e6;
}
.lane-pill.tone-ok {
  background: #15251c;
  border-color: rgba(74, 222, 128, 0.45);
  color: #d1fae5;
}
.lane-pill.tone-info {
  background: #122032;
  border-color: rgba(96, 165, 250, 0.45);
}
.lane-compliance {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(17, 24, 39, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.lane-compliance-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin-bottom: 8px;
}
.lane-compliance-card.risk-high {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(127, 29, 29, 0.35);
}
.lane-compliance-card.risk-medium {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(120, 53, 15, 0.3);
}
.lane-compliance-card.risk-low {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(20, 83, 45, 0.3);
}
.lane-compliance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.75);
}
.lane-compliance-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
}
.lane-compliance-meta {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.7);
}
.lane-compliance-rest {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.8);
}
.lane-drawer-error {
  font-size: 12px;
  color: #f87171;
}
.lane-focus-target {
  outline: 2px solid rgba(14, 165, 233, 0.9);
  outline-offset: 2px;
}
.lane-focus-match {
  box-shadow: 0 0 6px rgba(14, 165, 233, 0.9);
}

.lane-divider {
  display: none;
}

.lane {
  position: relative;
  flex: 1 1 50%;
  min-height: calc(var(--row-height) / 2 - 6px);
  height: auto;
  overflow: visible;
}

.ops-lane {
  background: rgba(148, 163, 184, 0.025);
  flex: 1 1 60%;
}

.labour-lane,
.resource-lane {
  background: rgba(148, 163, 184, 0.06);
  border-radius: 6px;
  flex: 1 1 40%;
  padding: var(--labour-stack-padding) 0;
}

body:not(.worker-schedule-active):not(.wip-schedule-active) #paneSchedule .labour-lane {
  background: rgba(148, 163, 184, 0.025);
}

body:not(.worker-schedule-active):not(.wip-schedule-active) #paneSchedule .lane-row:nth-child(even) .labour-lane {
  background: rgba(148, 163, 184, 0.06);
}

body.workers-hidden #gantt .lane-row {
  gap: 0;
  background: transparent;
  box-shadow: none;
}

body.workers-hidden #gantt .ops-lane {
  border-radius: 6px;
}

body.workers-hidden #gantt .lane-row:nth-child(odd) .ops-lane {
  background: rgba(148, 163, 184, 0.025);
}

body.workers-hidden #gantt .lane-row:nth-child(even) .ops-lane {
  background: rgba(148, 163, 184, 0.06);
}

body.workers-hidden #gantt .lane-row.lane-drawer-open .ops-lane {
  background: rgba(39, 39, 42, 0.35);
}

body.workers-hidden #gantt .labour-lane,
body.workers-hidden #gantt .resource-lane {
  display: none;
}

body.workers-hidden #gantt .lane-divider {
  display: none;
}

.label-cutoff {
  position: sticky;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-right: 1px solid var(--gantt-cutoff-border);
  z-index: 2;
  pointer-events: none;
}

body.gantt-scrolling .gantt-left,
body.gantt-scrolling .gantt-right,
body.gantt-scrolling .time-header,
body.zooming .gantt-left,
body.zooming .gantt-right,
body.zooming .time-header {
  backdrop-filter: none !important;
}

body.gantt-scrolling .bar,
body.gantt-scrolling .labour-bar,
body.gantt-scrolling .resource-bar,
body.zooming .bar,
body.zooming .labour-bar,
body.zooming .resource-bar {
  box-shadow: none !important;
  filter: none !important;
  transition: none !important;
}

body.zooming .bar,
body.zooming .labour-bar,
body.zooming .resource-bar {
  pointer-events: none !important;
}

body.gantt-scrolling .bar::after,
body.gantt-scrolling .labour-bar::after,
body.gantt-scrolling .resource-bar::after,
body.gantt-scrolling #gantt .bar.contract-wait::after,
body.zooming .bar::after,
body.zooming .labour-bar::after,
body.zooming .resource-bar::after,
body.zooming #gantt .bar.contract-wait::after {
  display: none !important;
}

body.gantt-scrolling .bar-wait-segment,
body.gantt-scrolling .bar-downtime-overlay {
  display: none !important;
}

body.zooming .zoom-grid-layer,
body.zooming .zoom-content-layer {
  pointer-events: none !important;
}

.bar {
  position: absolute;
  box-sizing: border-box;
  height: var(--bar-height);
  top: 50%;
  transform: translateY(calc(-50% - 1px));
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-rgb), 0.92));
  border-radius: 8px;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 11px;
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 10px 20px rgba(12, 15, 20, 0.45);
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
  isolation: isolate;
  cursor: pointer;
}

#gantt .bar,
#gantt .bar *,
#gantt .bar::before,
#gantt .bar::after,
#gantt .labour-bar,
#gantt .labour-bar *,
#gantt .labour-bar::before,
#gantt .labour-bar::after,
#gantt .resource-bar,
#gantt .resource-bar *,
#gantt .resource-bar::before,
#gantt .resource-bar::after {
  cursor: pointer !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#gantt .bar-label {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body.resizing-chat #gantt .bar,
body.resizing-chat #gantt .bar *,
body.resizing-chat #gantt .bar::before,
body.resizing-chat #gantt .bar::after,
body.resizing-chat #gantt .labour-bar,
body.resizing-chat #gantt .labour-bar *,
body.resizing-chat #gantt .labour-bar::before,
body.resizing-chat #gantt .labour-bar::after,
body.resizing-chat #gantt .resource-bar,
body.resizing-chat #gantt .resource-bar *,
body.resizing-chat #gantt .resource-bar::before,
body.resizing-chat #gantt .resource-bar::after {
  cursor: pointer !important;
}

.bar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.25), transparent 65%);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1;
}

.bar-downtime-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.85;
  z-index: 1;
}

.bar-downtime-overlay-zero {
  background-image: repeating-linear-gradient(-45deg, rgba(255, 77, 79, 0.45) 0, rgba(255, 77, 79, 0.45) 6px, transparent 6px, transparent 12px);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 79, 0.35);
}

.bar-downtime-overlay-partial {
  background-image: repeating-linear-gradient(-45deg, rgba(255, 166, 33, 0.45) 0, rgba(255, 166, 33, 0.45) 6px, transparent 6px, transparent 12px);
  box-shadow: inset 0 0 0 1px rgba(255, 166, 33, 0.25);
}
.bar-downtime-overlay-labour {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(76, 196, 255, 0.82) 0,
    rgba(76, 196, 255, 0.82) 8px,
    rgba(12, 18, 28, 0.6) 8px,
    rgba(12, 18, 28, 0.6) 16px
  );
  box-shadow: inset 0 0 0 1px rgba(76, 196, 255, 0.7);
  mix-blend-mode: screen;
  opacity: 0.95;
}

.bar-has-downtime-zero {
  border-color: rgba(255, 77, 79, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.35), 0 12px 28px rgba(8, 10, 14, 0.55);
}

.bar-has-downtime-partial {
  border-color: rgba(255, 166, 33, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 166, 33, 0.3), 0 12px 24px rgba(8, 10, 14, 0.4);
}

.bar:hover {
  transform: translateY(calc(-50% - 1px)) scale(1.02);
  box-shadow: 0 18px 40px rgba(8, 10, 14, 0.55);
}

.bar:hover::after {
  opacity: 1;
  transform: scale(1.03);
}

.bar-label {
  position: relative;
  z-index: 2;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar.dim { filter: saturate(20%) brightness(0.6); opacity: 0.35; }
.bar.alt { background: inherit !important; }

.labour-bar,
.resource-bar {
  box-sizing: border-box;
  height: var(--labour-bar-height, calc(var(--bar-height) - 6px));
  top: var(--labour-bar-top, 50%);
  transform: translateY(var(--labour-bar-translate, -50%));
  border-radius: 6px;
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 16px rgba(8, 10, 14, 0.3);
}

.labour-bar .bar-label,
.resource-bar .bar-label {
  font-weight: 600;
}

.labour-bar.dim,
.resource-bar.dim {
  filter: saturate(30%) brightness(0.65);
  opacity: 0.35;
}

.unattended-bar {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.28);
  background-blend-mode: screen;
}

.unattended-bar .bar-label {
  font-style: italic;
}

.bar-offshift {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.12);
  /* Keep off-shift overlays visually consistent regardless of bar hue */
  mix-blend-mode: normal;
  opacity: 0.9;
  border-radius: inherit;
}

.bar-wait-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  background: rgba(239, 68, 68, 0.85);
  border-radius: inherit;
  z-index: 0;
  display: none;
}

.bar-conflict {
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.6);
  border: 2px solid var(--bar-conflict-color) !important;
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.95), rgba(239, 68, 68, 0.92)) !important;
  color: #000;
}

.bar-warning {
  box-shadow: 0 0 0 2px rgba(246, 164, 61, 0.5);
  border: 2px solid var(--color-warning) !important;
  background: linear-gradient(135deg, rgba(246, 164, 61, 0.92), rgba(251, 146, 60, 0.88)) !important;
  color: #000;
}

.time-header {
  position: sticky;
  top: 0;
  background: var(--gantt-header-background);
  border-bottom: 1px solid var(--gantt-header-border);
  color: var(--muted);
  z-index: 3;
  backdrop-filter: blur(12px) saturate(140%);
}

.time-row {
  display: flex;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.85);
}

.time-row .cell {
  text-align: center;
  padding: 6px 0;
  border-right: 1px solid var(--gantt-row-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  flex: 0 0 auto;
}

.time-row.collapsed .cell {
  color: transparent;
  text-shadow: none;
  user-select: none;
  pointer-events: none;
}

.time-row.months { font-weight: 700; background: rgba(39, 39, 42, 0.95); color: var(--hero-title); }
.time-row.weekdays { background: rgba(39, 39, 42, 0.9); font-weight: 600; color: rgba(226, 232, 240, 0.92); }
.time-row.days { background: rgba(39, 39, 42, 0.85); }
.time-row.hours { background: rgba(24, 24, 27, 0.9); }
.time-row.hours .cell.pattern-grid {
  position: relative;
}
.time-row.hours .cell.pattern-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0 calc(var(--timeline-pattern-step-px, 1px) - 1px),
    var(--gantt-row-border) calc(var(--timeline-pattern-step-px, 1px) - 1px),
    var(--gantt-row-border) var(--timeline-pattern-step-px, 1px)
  );
}
.time-row.minutes { background: rgba(18, 18, 20, 0.85); font-size: 10px; letter-spacing: 0.06em; color: rgba(226, 232, 240, 0.75); }
.time-row.minutes .cell.pattern-grid {
  position: relative;
}
.time-row.minutes .cell.pattern-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0 calc(var(--timeline-pattern-step-px, 1px) - 1px),
    var(--gantt-row-border) calc(var(--timeline-pattern-step-px, 1px) - 1px),
    var(--gantt-row-border) var(--timeline-pattern-step-px, 1px)
  );
}
.time-row.subhours { font-size: 10px; color: rgba(148, 163, 184, 0.55); }
.time-row.subhours .cell { border-right: 1px dashed rgba(82, 82, 91, 0.6); }
.time-row.subhours .cell.pattern-grid {
  position: relative;
  border-right: 1px dashed rgba(82, 82, 91, 0.6);
}
.time-row.subhours .cell.pattern-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0 calc(var(--timeline-pattern-step-px, 1px) - 1px),
    rgba(82, 82, 91, 0.6) calc(var(--timeline-pattern-step-px, 1px) - 1px),
    rgba(82, 82, 91, 0.6) var(--timeline-pattern-step-px, 1px)
  );
  -webkit-mask-image: repeating-linear-gradient(
    to bottom,
    #000 0 4px,
    transparent 4px 8px
  );
  mask-image: repeating-linear-gradient(
    to bottom,
    #000 0 4px,
    transparent 4px 8px
  );
}

.time-header.has-minute-row .time-row.hours {
  display: none;
}

.time-row .spacer { display: none; }

.weekend { background: rgba(var(--accent-rgb), 0.08); }
.band.weekend {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(var(--accent-rgb), 0.12);
}
button {
  padding: 9px 18px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.35), rgba(14, 165, 233, 0.28));
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.25);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.55), rgba(14, 165, 233, 0.45));
}

button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
  transform: none;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--txt-2);
}

button.ghost:hover {
  background: rgba(39, 39, 42, 0.75);
  color: var(--text-strong);
  border-color: rgba(148, 163, 184, 0.8);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
button.ghost.is-danger {
  color: var(--color-danger);
  border-color: rgba(239, 104, 104, 0.5);
}
button.ghost.is-danger:hover {
  background: rgba(239, 104, 104, 0.18);
  color: #fee2e2;
  border-color: rgba(239, 104, 104, 0.8);
  box-shadow: 0 8px 18px rgba(239, 104, 104, 0.22);
}
button.ghost.is-extend {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.55);
}
button.ghost.is-extend:hover {
  background: rgba(52, 211, 153, 0.16);
  color: #d1fae5;
  border-color: rgba(52, 211, 153, 0.85);
  box-shadow: 0 8px 18px rgba(52, 211, 153, 0.22);
}

button.ghost[aria-pressed="true"] {
  background: rgba(39, 39, 42, 0.95);
  color: var(--text-strong);
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

button.ghost[aria-pressed="true"]:hover {
  background: rgba(39, 39, 42, 0.98);
}

.panel-note {
  border: 1px dashed rgba(63, 63, 70, 0.9);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(24, 24, 27, 0.85);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

button.primary {
  background: linear-gradient(135deg, #27272f, #18181b);
  border-color: rgba(82, 82, 91, 0.95);
  color: #f9fafb;
}

button.primary:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7);
}

input,
select,
textarea {
  border-radius: 12px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.95);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.ai-wizard-callout {
  background: linear-gradient(125deg, #18181b, #111115);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 20px;
  padding: 20px;
  margin: 18px 0;
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.75);
}

.wizard-callout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.ai-wizard-shell {
  border-radius: 20px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.98);
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.75);
  margin-bottom: 24px;
}

.ai-wizard-shell.hidden { display: none; }

.wizard-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.wizard-step {
  flex: 1 1 140px;
  border-radius: 14px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.95);
  color: var(--muted);
  font-size: 12px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: border 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.wizard-step.active {
  border-color: rgba(148, 163, 184, 0.95);
  color: var(--hero-title);
  background: rgba(24, 24, 27, 0.98);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.75);
}

.wizard-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wizard-pane {
  border-radius: 18px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.9);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-pane[hidden] { display: none; }

.wizard-pane label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.wizard-pane input,
.wizard-pane textarea {
  width: 100%;
  background: rgba(24, 24, 27, 0.98);
  border-color: rgba(63, 63, 70, 0.9);
}

.wizard-pane textarea {
  resize: vertical;
  min-height: 90px;
}

.wizard-nav {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.wizard-summary {
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: rgba(24, 24, 27, 0.85);
  padding: 16px;
}

.wizard-summary-list {
  margin: 0 0 8px 18px;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  list-style: disc;
}

.wizard-summary-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}

label { color: var(--muted); font-size: 12px; }

.panel {
  padding: 22px 26px;
  border-top: none;
  background: var(--panel-background);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.developer-top-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 24px;
}

.developer-top-controls .theme-switcher {
  margin-top: 0;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-strong);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-header h2 { margin: 0; }
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-stack);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--spacing-section);
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-tight);
  padding: var(--spacing-section);
  border-radius: var(--radius-card);
  border: 1px solid rgba(132, 142, 160, 0.35);
  background: rgba(15, 20, 32, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.settings-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}
.settings-hint {
  font-size: 12px;
  color: rgba(198, 206, 222, 0.8);
}
#paneSettings input,
#paneSettings select {
  width: 100%;
  background: rgba(24, 24, 27, 0.9);
}
.settings-callouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-section);
}
.settings-callout {
  padding: var(--spacing-section);
  border-radius: var(--radius-card);
  border: 1px dashed rgba(63, 63, 70, 0.9);
  background: var(--color-bg-panel);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-tight);
  color: var(--color-text);
}
.settings-callout.secondary {
  border-style: solid;
  border-color: rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.92);
}
.settings-callout p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

#scenarioListPanel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1 1 auto;
  min-height: 0;
}
.scenario-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-3);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  box-shadow: var(--elev-1);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.scenario-card:hover {
  border-color: rgba(148, 163, 184, 0.7);
}
.scenario-card.selected {
  border-color: rgba(93, 160, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(93, 160, 255, 0.2), var(--elev-1);
}
.scenario-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.scenario-card__title {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--txt-1);
  text-align: left;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
  word-break: break-word;
}
.scenario-card__title:disabled {
  cursor: default;
  opacity: 0.6;
}
.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--txt-2);
}
.scenario-meta-item {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.12);
  color: var(--txt-2);
}
.scenario-meta-item.is-base {
  border-color: rgba(93, 160, 255, 0.45);
  background: rgba(93, 160, 255, 0.18);
  color: var(--txt-1);
}
.scenario-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scenario-log-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  font-size: 11px;
  color: var(--txt-2);
  align-items: baseline;
  background: rgba(15, 15, 18, 0.8);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.scenario-log-entry time {
  font-size: 10px;
  color: var(--txt-3);
}
.scenario-log-entry span { line-height: 1.35; }
.scenario-log-text {
  grid-column: 2 / span 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.45;
}
.scenario-log-text .msg-paragraph {
  margin: 0;
}
.scenario-log-text .msg-paragraph + .msg-paragraph {
  margin-top: 6px;
}
.scenario-log-text .msg-heading {
  font-weight: 600;
}
.scenario-log-text .msg-list {
  margin: 0;
  padding-left: 18px;
  gap: 4px;
}
.scenario-log-text .msg-list li {
  margin: 2px 0;
  line-height: 1.4;
}
.scenario-log-text strong {
  font-weight: 600;
}
.scenario-log-text code {
  font-family: var(--mono-font);
  font-size: 10px;
}
.scenario-log-hint {
  grid-column: 2 / span 1;
  font-size: 10px;
  color: rgba(251, 191, 36, 0.82);
  line-height: 1.25;
}
.scenario-log-remove {
  padding: 0;
}
.scenario-log-remove:hover { color: #f87171; }
.scenario-log-remove:disabled { opacity: 0.35; cursor: default; }
.scenario-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.scenario-actions .scenario-ot-toggle {
  border: 1px solid rgba(93, 160, 255, 0.45);
  color: var(--accent);
  background: rgba(93, 160, 255, 0.12);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.scenario-actions .scenario-ot-toggle:hover {
  background: rgba(93, 160, 255, 0.22);
  border-color: rgba(93, 160, 255, 0.65);
}
.scenario-actions .scenario-ot-toggle.active {
  background-color: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}
.scenario-actions .scenario-ot-toggle.active:hover {
  background-color: rgba(239, 68, 68, 0.3);
  border-color: rgba(252, 165, 165, 0.8);
}
.scenario-empty {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--txt-3);
  font-size: 12px;
  text-align: center;
}
.form-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px; align-items: center; margin: 6px 0; }
.form-row label { font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }
.hint.status-error { color: var(--color-danger); }
.hint.status-warn { color: var(--color-warning); }
.hint.status-success { color: var(--color-positive); }
.links a { font-size: 12px; margin-left: 8px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 32px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--tab-border);
}

.tab-btn {
  background: var(--tab-bg);
  border: 1px solid transparent;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--tab-color);
  border-radius: 999px;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tab-btn:hover {
  background: var(--accent-soft);
  color: var(--text-strong);
}

.tab-btn.active {
  color: var(--tab-active-color);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 10px 20px rgba(var(--accent-rgb), 0.25);
}

.tab-pane.hidden { display: none; }

#toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px 24px;
  background: rgba(10, 16, 28, 0.85);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.25);
}

/* Jobs Summary table */
#jobsSummaryPanel { overflow: hidden; }
#jobsSummary {
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
}
#jobsSummary .summary-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  border-radius: 16px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: var(--color-bg-panel);
}
.summary-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
  white-space: nowrap;
  border: 0;
  background: var(--color-bg-panel);
  color: rgba(226, 232, 240, 0.9);
}
.summary-table th, .summary-table td {
  border: 1px solid rgba(39, 39, 42, 0.9);
  padding: 8px 12px;
  text-align: center;
}
.summary-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(24, 24, 27, 0.98);
  font-weight: 600;
  color: var(--hero-title);
}
.summary-table tbody tr:hover { background: rgba(39, 39, 42, 0.95); }
.summary-table .clickable { color: #a5b4fc; cursor: pointer; text-decoration: underline; }
.summary-table .muted { color: var(--muted); }
.summary-table .status-on-time { background: rgba(34, 197, 94, 0.25); color: #bbf7d0; font-weight: 600; }
.summary-table .status-late { background: rgba(248, 113, 113, 0.28); color: #fecaca; font-weight: 600; }
.summary-table .status-preview { background: rgba(251, 191, 36, 0.24); color: #fde68a; font-weight: 600; }
.summary-table tbody tr.capacity-preview { outline: 2px solid rgba(251, 191, 36, 0.55); }

.chat-diagnostics {
  background: rgba(24, 24, 27, 0.9);
  border-top: 1px solid rgba(63, 63, 70, 0.9);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-diagnostics .diagnostics-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-diagnostics .diagnostics-header button {
  margin-left: auto;
}

.diagnostics-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.diagnostics-message {
  font-size: 12px;
  color: #cbd5f5;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.badge-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.45);
}

.badge-warn {
  background: rgba(249, 115, 22, 0.12);
  color: #fbbf24;
  border-color: rgba(249, 115, 22, 0.45);
}

.badge-issue {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
}

.diagnostics-status .summary-text {
  color: #94a3b8;
}
.developer-status {
  font-size: 13px;
  padding: 12px 16px;
  border: 1px dashed rgba(63, 63, 70, 0.9);
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.9);
  color: rgba(226, 232, 240, 0.78);
}

.developer-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}


.developer-card {
  flex: 1 1 220px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.98);
  padding: 16px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.developer-card h3 {
  margin: 0;
  font-size: 14px;
  color: rgba(226, 232, 240, 0.92);
}

.developer-card .metric {
  font-size: 26px;
  font-weight: 600;
  color: var(--hero-title);
}

.developer-card .delta {
  font-size: 12px;
  color: rgba(165, 180, 252, 0.85);
}

.developer-card.improved {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.3), 0 18px 35px rgba(15, 118, 110, 0.28);
}

.developer-card.regressed {
  border-color: rgba(248, 113, 113, 0.65);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.28), 0 18px 35px rgba(127, 29, 29, 0.28);
}

.developer-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: rgba(18, 18, 20, 0.98);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 16px;
  overflow: hidden;
  color: rgba(226, 232, 240, 0.9);
  box-shadow: inset 0 0 0 1px rgba(39, 39, 42, 0.9);
}

.developer-table th,
.developer-table td {
  border-bottom: 1px solid rgba(39, 39, 42, 0.9);
  border-right: 1px solid rgba(39, 39, 42, 0.8);
  padding: 8px 12px;
  text-align: left;
}

.developer-table th:last-child,
.developer-table td:last-child { border-right: none; }

.developer-table th {
  background: rgba(24, 24, 27, 0.98);
  font-weight: 600;
  color: var(--hero-title);
}

.developer-table tbody tr:nth-child(odd) { background: rgba(18, 18, 20, 0.98); }
.developer-table tbody tr:nth-child(even) { background: rgba(24, 24, 27, 0.94); }
.developer-table tbody tr:last-child td { border-bottom: none; }

.developer-table details {
  font-size: 11px;
  color: rgba(203, 213, 225, 0.9);
}

.developer-table details summary {
  cursor: pointer;
  color: rgba(229, 231, 235, 0.9);
}

.developer-table details pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: rgba(18, 18, 20, 0.98);
  border-radius: 10px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(63, 63, 70, 0.9);
  color: rgba(226, 232, 240, 0.86);
}

.planner-hint {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(125, 211, 252, 0.85);
}

.planner-fail {
  background: rgba(248, 113, 113, 0.22);
}

.planner-repeat {
  box-shadow: inset 3px 0 0 rgba(251, 191, 36, 0.55);
}

.planner-repeat-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.developer-table .status-regressed {
  color: #fca5a5;
  font-weight: 600;
}

.developer-table .status-improved {
  color: #6ee7b7;
  font-weight: 600;
}


.developer-chart {
  width: 100%;
  max-width: 540px;
  min-height: 180px;
  border-radius: 14px;
  background: rgba(18, 18, 20, 0.98);
  position: relative;
  padding: 16px 18px 20px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  box-shadow: inset 0 0 0 1px rgba(39, 39, 42, 0.9);
}

.developer-chart svg {
  width: 100%;
  height: 140px;
  display: block;
}

.developer-chart .chart-empty {
  color: rgba(226, 232, 240, 0.75);
  font-size: 12px;
  padding: 16px;
}

.developer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.developer-stat {
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 12px;
  padding: 10px 16px;
  min-width: 150px;
  color: rgba(226, 232, 240, 0.88);
  box-shadow: inset 0 0 0 1px rgba(39, 39, 42, 0.9);
}

.developer-stat span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.8);
}

.developer-stat strong {
  display: block;
  font-size: 18px;
  color: var(--hero-title);
}

.developer-stat.improved strong {
  color: #6ee7b7;
}

.developer-stat.regressed strong {
  color: #fca5a5;
}

.developer-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.developer-evals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.developer-eval-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.developer-eval-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.developer-eval-card h3 {
  margin: 0;
  font-size: 14px;
  color: #111827;
}

.developer-eval-card .summary {
  font-size: 12px;
  color: #475569;
}

.developer-eval-card button {
  border: 1px solid #d1d5db;
  background: var(--text-strong);
  color: #1f2937;
  font-size: 12px;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}

.developer-eval-card button:hover {
  background: #eef2ff;
}

.developer-eval-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}
.developer-status.warn {
  background: #fff7ed;
  border-color: #f97316;
  color: #b45309;
}

.developer-status.success {
  background: #ecfdf5;
  border-color: #34d399;
  color: #047857;
}

.developer-status.error {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}
#dev-scheduler-panel {
  margin-top: 12px;
  padding: 12px;
}
#dev-scheduler-panel .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
#dev-scheduler-panel .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
}
#dev-scheduler-panel .row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
#dev-calibration-panel {
  margin-top: 12px;
  padding: 12px;
}

#dev-calibration-panel .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
}

#dev-calibration-panel .grid-3.tight label {
  display: flex;
  flex-direction: column;
}

#cal-leaderboard {
  margin-top: 10px;
  overflow-x: auto;
}

#cal-leaderboard table {
  width: 100%;
  border-collapse: collapse;
}

#cal-leaderboard th,
#cal-leaderboard td {
  border: 1px solid #ddd;
  padding: 6px;
  font-size: 12px;
}

#cal-leaderboard th {
  background: transparent;
  text-align: left;
}

#calibrationLeaderboard th:first-child,
#calibrationLeaderboard td:first-child {
  width: 24px;
  text-align: center;
}

/* Developer progress bar */
#dev-progress {
  position: relative;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0 12px;
}
#dev-progress .bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.2s ease;
}
#dev-progress #dev-progress-text {
  position: absolute;
  top: -20px;
  right: 0;
  font-size: 12px;
  color: #333;
}

/* --- Theme variants ------------------------------------------------------ */
body.theme-graphite {
  --page-background: linear-gradient(160deg, #23272c 0%, #1b1e22 52%, #111417 100%);
  --page-overlay: radial-gradient(circle at 80% -10%, rgba(78, 205, 196, 0.3), transparent 55%),
    radial-gradient(circle at 10% 120%, rgba(67, 152, 139, 0.22), transparent 65%);
  --text: #e4e8ec;
  --text-strong: #ffffff;
  --muted: #94a5a9;
  --surface: rgba(31, 35, 39, 0.95);
  --surface-strong: rgba(24, 27, 31, 0.94);
  --surface-glass: rgba(26, 30, 33, 0.86);
  --surface-border: rgba(108, 122, 126, 0.45);
  --panel-background: rgba(24, 27, 31, 0.94);
  --panel-border: rgba(104, 118, 122, 0.38);
  --accent: #4ecdc4;
  --accent-strong: #35b7af;
  --accent-soft: rgba(78, 205, 196, 0.2);
  --accent-rgb: 78, 205, 196;
  --chip-bg: rgba(78, 205, 196, 0.14);
  --chip-border: rgba(108, 122, 126, 0.32);
  --chip-hover: rgba(78, 205, 196, 0.32);
  --chip-text: rgba(226, 244, 242, 0.9);
  --hero-background: linear-gradient(135deg, rgba(47, 60, 63, 0.88), rgba(18, 22, 24, 0.95));
  --hero-divider: rgba(94, 116, 120, 0.42);
  --hero-title: #f3f9f8;
  --hero-subtitle: rgba(209, 229, 227, 0.78);
  --hero-eyebrow: rgba(150, 178, 176, 0.76);
  --hero-stat-background: rgba(18, 22, 24, 0.84);
  --hero-stat-border: rgba(80, 100, 104, 0.42);
  --hero-stat-shadow: inset 0 0 0 1px rgba(78, 205, 196, 0.14);
  --tab-border: rgba(86, 100, 104, 0.42);
  --tab-color: rgba(197, 215, 214, 0.78);
  --tab-active-bg: rgba(78, 205, 196, 0.16);
  --tab-active-color: #f2fbf9;
  --toggle-track: rgba(31, 38, 40, 0.88);
  --toggle-track-border: rgba(92, 112, 116, 0.45);
  --panel-shadow: 0 24px 55px rgba(6, 10, 10, 0.55);
  --shadow-soft: 0 24px 55px rgba(6, 10, 10, 0.55);
  --zoombar-background: rgba(22, 26, 28, 0.95);
  --zoombar-border: rgba(90, 110, 114, 0.45);
  --gantt-background: linear-gradient(130deg, rgba(78, 205, 196, 0.08), transparent 60%), rgba(18, 21, 24, 0.95);
  --gantt-border: rgba(92, 110, 114, 0.48);
  --gantt-left-background: rgba(22, 26, 28, 0.95);
  --gantt-right-background: rgba(18, 21, 24, 0.95);
  --gantt-label-background: rgba(24, 27, 30, 0.94);
  --gantt-label-border: rgba(88, 106, 110, 0.34);
  --gantt-header-background: rgba(18, 22, 24, 0.94);
  --gantt-header-border: rgba(84, 102, 106, 0.34);
  --gantt-row-border: rgba(70, 84, 88, 0.3);
  --gantt-scrollbar: rgba(78, 205, 196, 0.48);
  --gantt-cutoff-border: rgba(78, 205, 196, 0.46);
  --tooltip-background: rgba(16, 20, 22, 0.96);
  --tooltip-border: rgba(88, 106, 110, 0.4);
  --tooltip-shadow: 0 22px 50px rgba(6, 10, 10, 0.58);
  --focus-ring: 0 0 0 2px rgba(78, 205, 196, 0.6);
  --radius-large: 26px;
  --radius-medium: 18px;
  --radius-small: 12px;
}

body.theme-mercury {
  --page-background: linear-gradient(150deg, #2f3239 0%, #26292f 55%, #1c1e23 100%);
  --page-overlay: radial-gradient(circle at 75% -20%, rgba(255, 186, 99, 0.24), transparent 55%),
    radial-gradient(circle at 10% 110%, rgba(255, 221, 164, 0.14), transparent 65%);
  --text: #f5f6fb;
  --text-strong: #ffffff;
  --muted: #b7bcc9;
  --surface: rgba(50, 54, 62, 0.94);
  --surface-strong: rgba(44, 48, 56, 0.95);
  --surface-glass: rgba(46, 50, 58, 0.86);
  --surface-border: rgba(158, 164, 178, 0.35);
  --panel-background: rgba(46, 50, 58, 0.94);
  --panel-border: rgba(158, 164, 178, 0.32);
  --accent: #f6ad55;
  --accent-strong: #fcd34d;
  --accent-soft: rgba(246, 173, 85, 0.2);
  --accent-rgb: 246, 173, 85;
  --chip-bg: rgba(246, 173, 85, 0.16);
  --chip-border: rgba(170, 152, 120, 0.35);
  --chip-hover: rgba(246, 173, 85, 0.32);
  --chip-text: rgba(255, 242, 224, 0.92);
  --hero-background: linear-gradient(135deg, rgba(71, 66, 56, 0.82), rgba(36, 36, 42, 0.94));
  --hero-divider: rgba(206, 174, 116, 0.38);
  --hero-title: #fff7ed;
  --hero-subtitle: rgba(255, 249, 235, 0.78);
  --hero-eyebrow: rgba(238, 200, 144, 0.82);
  --hero-stat-background: rgba(38, 36, 32, 0.86);
  --hero-stat-border: rgba(194, 166, 117, 0.4);
  --hero-stat-shadow: inset 0 0 0 1px rgba(246, 173, 85, 0.12);
  --tab-border: rgba(176, 160, 128, 0.32);
  --tab-color: rgba(240, 224, 196, 0.76);
  --tab-active-bg: rgba(246, 173, 85, 0.22);
  --tab-active-color: #fff8ec;
  --toggle-track: rgba(54, 48, 40, 0.88);
  --toggle-track-border: rgba(187, 160, 118, 0.4);
  --panel-shadow: 0 24px 55px rgba(14, 10, 6, 0.56);
  --shadow-soft: 0 24px 55px rgba(14, 10, 6, 0.56);
  --zoombar-background: rgba(48, 46, 40, 0.94);
  --zoombar-border: rgba(176, 152, 108, 0.38);
  --gantt-background: linear-gradient(140deg, rgba(246, 173, 85, 0.12), transparent 60%), rgba(38, 36, 40, 0.94);
  --gantt-border: rgba(176, 152, 108, 0.4);
  --gantt-left-background: rgba(44, 42, 38, 0.94);
  --gantt-right-background: rgba(36, 34, 30, 0.95);
  --gantt-label-background: rgba(44, 42, 38, 0.94);
  --gantt-label-border: rgba(176, 152, 108, 0.32);
  --gantt-header-background: rgba(40, 38, 34, 0.94);
  --gantt-header-border: rgba(170, 148, 110, 0.3);
  --gantt-row-border: rgba(158, 142, 110, 0.26);
  --gantt-scrollbar: rgba(246, 173, 85, 0.5);
  --gantt-cutoff-border: rgba(246, 173, 85, 0.46);
  --tooltip-background: rgba(38, 34, 30, 0.96);
  --tooltip-border: rgba(194, 166, 117, 0.38);
  --tooltip-shadow: 0 22px 52px rgba(18, 12, 6, 0.58);
  --focus-ring: 0 0 0 2px rgba(246, 173, 85, 0.55);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-small: 12px;
}

body.theme-onyx {
  --page-background: linear-gradient(160deg, #18161f 0%, #111019 55%, #09070f 100%);
  --page-overlay: radial-gradient(circle at 70% -10%, rgba(186, 104, 255, 0.28), transparent 55%),
    radial-gradient(circle at 10% 110%, rgba(93, 78, 168, 0.2), transparent 65%);
  --text: #e7e5ff;
  --text-strong: #ffffff;
  --muted: #a19ac7;
  --surface: rgba(26, 24, 36, 0.95);
  --surface-strong: rgba(20, 18, 28, 0.95);
  --surface-glass: rgba(24, 22, 34, 0.86);
  --surface-border: rgba(120, 106, 160, 0.42);
  --panel-background: rgba(22, 20, 32, 0.95);
  --panel-border: rgba(115, 102, 152, 0.4);
  --accent: #b388ff;
  --accent-strong: #a855f7;
  --accent-soft: rgba(179, 136, 255, 0.2);
  --accent-rgb: 179, 136, 255;
  --chip-bg: rgba(179, 136, 255, 0.18);
  --chip-border: rgba(120, 106, 160, 0.38);
  --chip-hover: rgba(179, 136, 255, 0.32);
  --chip-text: rgba(244, 238, 255, 0.92);
  --hero-background: linear-gradient(135deg, rgba(60, 46, 94, 0.85), rgba(24, 20, 40, 0.96));
  --hero-divider: rgba(133, 109, 182, 0.45);
  --hero-title: #f4f0ff;
  --hero-subtitle: rgba(226, 217, 255, 0.82);
  --hero-eyebrow: rgba(173, 158, 220, 0.78);
  --hero-stat-background: rgba(28, 24, 40, 0.86);
  --hero-stat-border: rgba(136, 110, 184, 0.44);
  --hero-stat-shadow: inset 0 0 0 1px rgba(179, 136, 255, 0.12);
  --tab-border: rgba(118, 102, 164, 0.38);
  --tab-color: rgba(210, 201, 245, 0.78);
  --tab-active-bg: rgba(179, 136, 255, 0.24);
  --tab-active-color: #f4f0ff;
  --toggle-track: rgba(32, 26, 44, 0.88);
  --toggle-track-border: rgba(129, 110, 176, 0.45);
  --panel-shadow: 0 26px 58px rgba(6, 3, 12, 0.6);
  --shadow-soft: 0 26px 58px rgba(6, 3, 12, 0.6);
  --zoombar-background: rgba(28, 24, 40, 0.96);
  --zoombar-border: rgba(120, 106, 160, 0.42);
  --gantt-background: linear-gradient(140deg, rgba(179, 136, 255, 0.12), transparent 60%), rgba(20, 16, 32, 0.95);
  --gantt-border: rgba(132, 112, 176, 0.48);
  --gantt-left-background: rgba(26, 22, 38, 0.95);
  --gantt-right-background: rgba(20, 16, 30, 0.95);
  --gantt-label-background: rgba(26, 22, 38, 0.94);
  --gantt-label-border: rgba(132, 112, 176, 0.4);
  --gantt-header-background: rgba(22, 18, 34, 0.94);
  --gantt-header-border: rgba(128, 110, 176, 0.36);
  --gantt-row-border: rgba(110, 92, 150, 0.28);
  --gantt-scrollbar: rgba(179, 136, 255, 0.5);
  --gantt-cutoff-border: rgba(179, 136, 255, 0.5);
  --tooltip-background: rgba(18, 14, 28, 0.96);
  --tooltip-border: rgba(132, 112, 176, 0.42);
  --tooltip-shadow: 0 24px 54px rgba(8, 4, 18, 0.62);
  --focus-ring: 0 0 0 2px rgba(179, 136, 255, 0.6);
  --radius-large: 22px;
  --radius-medium: 16px;
  --radius-small: 10px;
}
.kpi-lens__action-preview.collapsed {
  display: none;
}

.kpi-lens__slider {
  width: 100%;
  margin-top: 0.35rem;
}

.dashboards-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboards-panel.is-labour-rules {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-labour-schedule {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-work-area-schedule {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-material-replenishment {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-material-shortage-trend {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-material-inventory-position {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-bom-coverage {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-constraint-attribution {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-panel.is-replenishment-performance {
  height: calc(100vh - 96px);
  min-height: calc(100vh - 140px);
  max-height: calc(100vh - 90px);
  overflow: hidden;
}

.dashboards-root {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1 1 auto;
  min-height: 0;
}

.dashboards-root[data-mode="labour-rules"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="labour-schedule"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="work-area-schedule"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="material-replenishment"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="material-shortage-trend"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="material-inventory-position"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="bom-coverage"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="constraint-attribution"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboards-root[data-mode="replenishment-performance"] {
  height: calc(100vh - 140px);
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.dashboards-root[data-mode="labour-rules"] .dashboard-layout {
  gap: 1.1rem;
  overflow: hidden;
}

.dashboards-root[data-mode="labour-schedule"] .dashboard-layout {
  overflow: hidden;
}

.dashboards-root[data-mode="work-area-schedule"] .dashboard-layout {
  overflow: hidden;
}

.dashboards-root[data-mode="material-replenishment"] .dashboard-layout {
  overflow: hidden;
}

.dashboards-root[data-mode="material-shortage-trend"] .dashboard-layout {
  overflow: hidden;
}

.dashboards-root[data-mode="material-inventory-position"] .dashboard-layout {
  overflow: hidden;
}

.dashboards-root[data-mode="bom-coverage"] .dashboard-layout {
  overflow: hidden;
}

.dashboards-root[data-mode="constraint-attribution"] .dashboard-layout {
  overflow: hidden;
}

.dashboards-root[data-mode="replenishment-performance"] .dashboard-layout {
  overflow: hidden;
}

.dashboard-layout.is-refreshing::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(90deg, rgba(24, 24, 27, 0.4), rgba(24, 24, 27, 0));
  pointer-events: none;
}

.dashboard-refresh-indicator {
  align-self: flex-end;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5b4fc;
}

.dashboard-placeholder {
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  color: rgba(226, 232, 240, 0.8);
  font-size: 1rem;
}

.dashboard-placeholder.is-loading {
  border-style: solid;
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
}

.dashboard-placeholder.is-error {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.dashboard-hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-mode-switcher {
  display: inline-flex;
  background: rgba(24, 24, 27, 0.96);
  border-radius: 999px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  padding: 0.25rem;
  gap: 0.25rem;
  align-self: flex-start;
}

.dashboard-mode-btn {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  background: transparent;
  color: rgba(226, 232, 240, 0.75);
  cursor: pointer;
  font: inherit;
}

.dashboard-mode-btn.is-active {
  background: rgba(39, 39, 42, 0.95);
  color: var(--color-text);
}

.dashboard-kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.dashboard-kpi {
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.98);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--tap), box-shadow 0.2s var(--tap), border-color 0.2s var(--tap);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75);
}

.dashboard-kpi:hover,
.dashboard-kpi:focus-visible,
.dashboard-kpi.is-active {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.dashboard-kpi__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.65);
  margin: 0;
}

.dashboard-kpi__value {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 650;
  color: #f8fafc;
  line-height: 1.2;
}

.dashboard-kpi__hint {
  margin: 0;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.9rem;
}

.dashboard-kpi__sparkline {
  width: 100%;
  height: 48px;
  color: rgba(124, 140, 255, 0.8);
  margin-top: 0.35rem;
}

.dashboard-kpi__sparkline svg {
  width: 100%;
  height: 100%;
}

.dashboard-kpi__sparkline-empty {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.75);
}

.dashboard-kpi__delta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(39, 39, 42, 0.95);
  color: rgba(226, 232, 240, 0.9);
}

.dashboard-kpi__delta.is-up {
  color: var(--color-positive);
  background: rgba(16, 185, 129, 0.14);
}

.dashboard-kpi__delta.is-down {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.18);
}

.dashboard-kpi__delta-arrow {
  font-size: 0.75rem;
}

.dashboard-kpi__delta-value {
  font-weight: 600;
}

.dashboard-kpi__delta-window {
  color: rgba(226, 232, 240, 0.65);
}

.dashboard-kpi__insight {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
  line-height: 1.35;
}

.dashboard-kpi__preview {
  display: inline-flex;
  align-items: center;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px dashed rgba(226, 232, 240, 0.4);
}

.dashboard-kpi__preview.is-positive {
  color: var(--color-positive);
  border-color: rgba(34, 197, 94, 0.5);
}

.dashboard-kpi__preview.is-negative {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.45);
}

.dashboard-spotlight {
  border: 1px solid rgba(148, 163, 184, 0.9);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  background: rgba(39, 39, 42, 0.95);
  color: var(--color-text);
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  width: fit-content;
  cursor: pointer;
  font: inherit;
}

.dashboard-guidance {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-guidance__chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(226, 232, 240, 0.86);
  font-size: 0.78rem;
  padding: 0.25rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s var(--tap), border-color 0.2s var(--tap);
  font: inherit;
}

.dashboard-guidance__chip:hover {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
}

.dashboard-guidance__chip[data-intent="danger"] {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

.dashboard-guidance__chip[data-intent="warning"] {
  border-color: rgba(245, 158, 11, 0.7);
  color: #fde68a;
}

.dashboard-guidance__empty {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.85);
}

.dashboard-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.dashboard-filter-chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.35rem 0.8rem;
  background: transparent;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.78rem;
  cursor: pointer;
  font: inherit;
}

.dashboard-filter-chip.is-reset {
  border-style: dashed;
  color: rgba(248, 113, 113, 0.87);
}

.dashboard-filter-row__empty {
  color: rgba(148, 163, 184, 0.75);
  font-size: 0.82rem;
}

.dashboard-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.executive-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.executive-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(240px, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 22px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.85));
  box-shadow: var(--shadow-soft);
}

.executive-hero__status {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.executive-hero__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.9);
}

.executive-hero__headline {
  margin: 0;
  font-size: 2.2rem;
  color: #f8fafc;
}

.executive-hero__subtitle {
  margin: 0;
  color: rgba(226, 232, 240, 0.8);
}

.executive-hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}

.executive-stat {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.6rem 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.executive-stat__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}

.executive-stat__value {
  font-size: 1.1rem;
  color: #f8fafc;
  font-weight: 600;
}

.executive-insights {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.executive-insights__label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.85);
}

.executive-insights__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.9rem;
}

.executive-insights__item::before {
  content: '•';
  margin-right: 0.5rem;
  color: rgba(148, 163, 184, 0.8);
}

.executive-hero__kpis {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.executive-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.executive-kpi-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s var(--tap), transform 0.2s var(--tap);
}

.executive-kpi-card:hover {
  border-color: rgba(148, 163, 184, 0.75);
  transform: translateY(-1px);
}

.executive-kpi-card__label {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}

.executive-kpi-card__value {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #f8fafc;
}

.executive-kpi-card__hint {
  margin: 0;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.82rem;
}

.executive-kpi-card__spark {
  height: 36px;
  color: rgba(56, 189, 248, 0.8);
}

.executive-guidance .dashboard-guidance__chip {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.35);
}

.executive-guidance .dashboard-guidance__empty {
  color: rgba(148, 163, 184, 0.8);
}

.executive-filters {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.85);
}

.executive-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.risk-meter {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.15);
}

.risk-meter__segment {
  display: block;
}

.risk-meter__segment.is-on-time {
  background: rgba(34, 197, 94, 0.9);
}

.risk-meter__segment.is-risk {
  background: rgba(245, 158, 11, 0.9);
}

.risk-meter__segment.is-late {
  background: rgba(239, 68, 68, 0.9);
}

.risk-legend {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
}

.risk-legend__row {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
}

.risk-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.risk-legend__dot.is-on-time {
  background: rgba(34, 197, 94, 0.9);
}

.risk-legend__dot.is-risk {
  background: rgba(245, 158, 11, 0.9);
}

.risk-legend__dot.is-late {
  background: rgba(239, 68, 68, 0.9);
}

.risk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.risk-stat {
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.risk-stat__label {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.risk-stat__value {
  font-weight: 600;
  color: #f8fafc;
}

.constraint-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.constraint-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.constraint-card:hover {
  border-color: rgba(148, 163, 184, 0.75);
}

.constraint-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f8fafc;
}

.constraint-card__tag {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: rgba(226, 232, 240, 0.8);
}

.constraint-card__meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.85rem;
}

.executive-job-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.executive-job-card {
  min-height: 160px;
  background: rgba(17, 24, 39, 0.85);
}

.capacity-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.capacity-row {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.capacity-row.is-active {
  border-color: rgba(148, 163, 184, 0.75);
}

.capacity-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f8fafc;
}

.capacity-row__bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.capacity-row__fill.is-busy {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.capacity-row__meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}

.executive-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}

.executive-summary-card {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.65rem 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.executive-summary-card__label {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.executive-summary-card__value {
  font-weight: 600;
  color: #f8fafc;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
}

.planner-rail,
.planner-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.planner-rail__section {
  border-radius: 16px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.92);
  padding: 0.9rem;
  box-shadow: var(--shadow-soft);
}

.planner-rail__summary .dashboard-filter-row {
  gap: 0.35rem;
}

.planner-rail__summary .dashboard-filter-chip {
  font-size: 0.72rem;
}

.planner-rail__summary {
  position: sticky;
  top: 12px;
  z-index: 1;
}

.planner-rail__title {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.85);
}

.planner-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.planner-exception-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.planner-exception {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.65rem;
  background: rgba(15, 23, 42, 0.6);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.planner-exception.is-late {
  border-color: rgba(239, 68, 68, 0.5);
}

.planner-exception.is-at-risk {
  border-color: rgba(245, 158, 11, 0.55);
}

.planner-exception__header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: #f8fafc;
}

.planner-exception__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.75);
}

.planner-due-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.planner-due-table th,
.planner-due-table td {
  text-align: left;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  color: rgba(226, 232, 240, 0.8);
}

.planner-due-table th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.8);
}

.planner-hotspot-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.planner-hotspot {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.planner-hotspot.is-active {
  border-color: rgba(148, 163, 184, 0.75);
}

.planner-hotspot__header {
  display: flex;
  justify-content: space-between;
  color: #f8fafc;
}

.planner-hotspot__bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.planner-hotspot__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.planner-hotspot__meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.75);
}

.planner-inspector {
  border-radius: 18px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.92);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 16px;
  align-self: start;
}

.planner-inspector__header h3 {
  margin: 0;
  color: #f8fafc;
}

.planner-inspector__card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.planner-inspector__lens {
  gap: 0.75rem;
}
.planner-inspector__lens-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.planner-inspector__lens-header h4 {
  margin: 0;
  color: #f8fafc;
  font-size: 0.95rem;
}
.planner-inspector__lens-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.75);
}

.planner-inspector__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.8);
}

.planner-inspector__row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.planner-inspector__label {
  color: rgba(148, 163, 184, 0.9);
}

.planner-inspector__value {
  color: #f8fafc;
}

.planner-signal-grid .executive-summary-card {
  background: rgba(15, 23, 42, 0.4);
}

@media (max-width: 1100px) {
  .executive-hero {
    grid-template-columns: 1fr;
  }

  .planner-layout {
    grid-template-columns: 1fr;
  }

  .planner-inspector {
    position: static;
  }
}

.dashboard-panel {
  border-radius: 22px;
  padding: 1.5rem;
  background: var(--color-bg-panel);
  border: 1px solid rgba(63, 63, 70, 0.9);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-panel__header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
}

.dashboard-panel__subtitle {
  margin: 0;
  color: rgba(148, 163, 184, 0.8);
  font-size: 0.9rem;
}

.dashboard-panel__legend {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.85);
}

.dashboard-note-list {
  margin: 0;
  padding-left: 1.15rem;
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.9rem;
  line-height: 1.4;
}

.dashboard-note-list li {
  margin: 0.35rem 0;
}

.dashboard-panel__footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.9);
}

.dashboard-panel__footnote {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-chart {
  width: 100%;
  border-radius: 16px;
  padding: 0.75rem;
  background: rgba(24, 24, 27, 0.98);
  border: 1px solid rgba(39, 39, 42, 0.9);
}

.dashboard-chart__empty {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.6);
}

.dashboard-area {
  width: 100%;
  height: auto;
  display: block;
}

.dashboard-chart__plot {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.dashboard-chart__y-axis {
  position: relative;
  width: 48px;
  color: rgba(148, 163, 184, 0.8);
  font-size: 0.75rem;
}

.dashboard-chart__y-tick {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  white-space: nowrap;
}

.dashboard-chart__canvas {
  position: relative;
  flex: 1;
}

.dashboard-chart__x-axis {
  position: relative;
  margin-left: 48px;
  margin-top: 0.4rem;
  height: 1.1rem;
  color: rgba(148, 163, 184, 0.8);
  font-size: 0.75rem;
}

.dashboard-chart__x-tick {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.dashboard-chart__legend {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.35rem;
  margin-left: 48px;
  font-size: 0.8rem;
  color: rgba(203, 213, 225, 0.9);
}

.dashboard-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dashboard-chart__legend-swatch {
  width: 12px;
  height: 4px;
  border-radius: 999px;
  display: inline-block;
}

.dashboard-chart__legend-swatch.is-processing {
  background: #f97316;
}

.dashboard-chart__legend-swatch.is-normal {
  background: #22d3ee;
}

.dashboard-brush {
  position: relative;
  height: 32px;
  margin-top: 0.35rem;
}

.dashboard-brush__input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 32px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  accent-color: var(--color-accent);
  pointer-events: none;
}

.dashboard-brush__input.is-start {
  z-index: 2;
}

.dashboard-brush__input.is-end {
  z-index: 3;
}

.dashboard-brush__input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.dashboard-brush__input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.dashboard-brush__input::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--color-accent);
  border: 2px solid rgba(15, 23, 42, 0.7);
}

.dashboard-brush__input::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--color-accent);
  border: 2px solid rgba(15, 23, 42, 0.7);
}

.dashboard-brush__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
}

.dashboard-brush__range {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.6);
}

.dashboard-metrics {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-metric {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-metric__label {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.9);
}

.dashboard-metric__value {
  font-size: 1.2rem;
  color: #f8fafc;
  font-weight: 600;
}

.dashboard-grid--labour {
  grid-template-columns:
    minmax(560px, 2.4fr)
    minmax(320px, 1.1fr);
  align-items: start;
}

.dashboard-grid--labour .labour-panel--overview {
  grid-column: 1 / -1;
}

.dashboard-grid--labour .labour-panel--contract {
  grid-column: 1 / -1;
  min-width: 0;
}

.dashboard-grid--labour .labour-panel--worker {
  grid-column: 1;
  min-width: 0;
}

.dashboard-grid--labour .labour-panel--role {
  grid-column: 2;
  min-width: 0;
}

.dashboard-metrics--labour {
  align-items: stretch;
}

.dashboard-metric--labour {
  border-left: 3px solid rgba(34, 197, 94, 0.8);
  padding-left: 0.9rem;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
  border-radius: 12px;
}

.labour-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.labour-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.labour-table th,
.labour-table td {
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.9);
}

.labour-table th {
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.8);
}

.labour-table th.is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.labour-table td.is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.labour-table--worker {
  border-collapse: separate;
  border-spacing: 0;
}

.labour-table--worker th,
.labour-table--worker td {
  white-space: nowrap;
}

.labour-table--worker th:not(:last-child),
.labour-table--worker td:not(:last-child) {
  border-right: 1px solid rgba(148, 163, 184, 0.22);
}

.labour-table--contract th,
.labour-table--contract td {
  white-space: nowrap;
}

.labour-table--contract th:not(:last-child),
.labour-table--contract td:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.dashboard-panel--labour-schedule,
.dashboard-panel--work-area-schedule {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1 1 auto;
  min-height: 0;
}

.dashboard-panel--material-replenishment,
.dashboard-panel--material-shortage-trend {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1 1 auto;
  min-height: 0;
}

.dashboard-panel--material-inventory-position,
.dashboard-panel--bom-coverage,
.dashboard-panel--constraint-attribution,
.dashboard-panel--replenishment-performance {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1 1 auto;
  min-height: 0;
}

.dashboard-section-subtitle {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.82);
  margin-bottom: -0.25rem;
}

.dashboard-subview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.dashboard-subview-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}

.dashboard-subview-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dashboard-subview-chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  transition: background 0.2s var(--tap), border-color 0.2s var(--tap), color 0.2s var(--tap);
}

.dashboard-subview-chip:hover {
  background: rgba(39, 39, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.9);
}

.dashboard-subview-chip.is-active {
  background: rgba(39, 39, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.9);
  color: var(--color-text);
}

.labour-schedule-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.labour-schedule-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin: -0.25rem 0 0.4rem;
}

.labour-schedule-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 160px;
}

.labour-schedule-field--search {
  flex: 1 1 220px;
  min-width: 220px;
}

.labour-schedule-field__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}

.labour-schedule-field__input {
  min-height: 36px;
}

.labour-schedule-field__input[type="date"] {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.labour-schedule-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.labour-schedule-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
}

.labour-schedule-table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.labour-schedule-table {
  border-collapse: collapse;
  min-width: 860px;
}

.labour-schedule-table th,
.labour-schedule-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.labour-schedule-table th {
  background: rgba(15, 23, 42, 0.55);
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(6px);
}

.labour-util-bar {
  display: inline-block;
  vertical-align: middle;
  width: 60px;
  height: 4px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.labour-util-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(var(--fill, 0) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, #4ade80, #22c55e);
}

.labour-role-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.labour-role {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.85rem;
  background: rgba(21, 29, 45, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.labour-role__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e2e8f0;
}

.labour-role__hint {
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.85rem;
}

.labour-role__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.4rem;
}

.labour-role__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.78rem;
}

.labour-role__legend-swatch {
  display: inline-block;
  width: 16px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.labour-role__legend-swatch.is-duty {
  background: linear-gradient(90deg, #22d3ee, #0ea5e9);
}

.labour-role__legend-swatch.is-contract {
  background: rgba(249, 115, 22, 0.9);
}

.labour-role__track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  gap: 2px;
}

.labour-role__fill {
  display: block;
  height: 100%;
}

.labour-role__fill.is-duty {
  background: linear-gradient(90deg, #22d3ee, #0ea5e9);
}

.labour-role__fill.is-contract {
  background: rgba(249, 115, 22, 0.9);
}

.labour-role__figures {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  color: rgba(226, 232, 240, 0.9);
}

.labour-role__value {
  font-weight: 600;
}

.labour-help-trigger {
  cursor: help;
  text-decoration: underline dotted rgba(148, 163, 184, 0.6);
  text-underline-offset: 3px;
}

@media (max-width: 1400px) {
  .dashboard-grid--labour {
    grid-template-columns:
      minmax(420px, 2fr)
      minmax(280px, 1fr);
  }

  .dashboard-grid--labour .labour-panel--overview {
    grid-column: 1 / -1;
  }

  .dashboard-grid--labour .labour-panel--contract {
    grid-column: 1 / -1;
  }

  .dashboard-grid--labour .labour-panel--worker {
    grid-column: 1;
  }

  .dashboard-grid--labour .labour-panel--role {
    grid-column: 2;
  }
}

.has-labour-breach {
  background-color: rgba(248, 113, 113, 0.08);
}

.dashboard-resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-sort-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-sort-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.78rem;
  padding: 0.25rem 0.85rem;
  cursor: pointer;
  font: inherit;
}

.dashboard-sort-btn.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
  color: var(--color-text);
}

.resource-bar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.resource-bar__row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.resource-bar__label {
  display: flex;
  justify-content: space-between;
  color: #e2e8f0;
  font-size: 0.95rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.resource-bar__hint {
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.85rem;
}

.resource-bar__track {
  width: 100%;
  height: 8px;
  background: rgba(24, 24, 27, 0.9);
  border-radius: 999px;
  overflow: hidden;
}

.resource-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  border-radius: 999px;
}

.resource-bar__figures {
  min-width: 140px;
  text-align: right;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.resource-bar__metric {
  color: rgba(226, 232, 240, 0.9);
}

.resource-bar__metric--ot {
  color: #fcd34d;
}

.resource-bar__metric--load {
  color: #93c5fd;
}

.resource-bar__metric--lateness {
  color: #f472b6;
}

.resource-stacked-bar {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.85rem;
  background: rgba(22, 28, 38, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.resource-stacked-bar.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.resource-stacked-bar__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.resource-stacked-bar__track {
  display: flex;
  width: 100%;
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.resource-stacked-bar__fill {
  display: block;
  height: 100%;
}

.resource-stacked-bar__fill.is-normal {
  background: rgba(34, 197, 94, 0.9);
}

.resource-stacked-bar__fill.is-ot {
  background: rgba(249, 115, 22, 0.85);
}

.resource-stacked-bar__figures {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.resource-stacked-bar__spark {
  color: rgba(124, 140, 255, 0.75);
  margin-top: 0.25rem;
  height: 36px;
}

.dashboard-job-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-height: clamp(320px, 55vh, 640px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.job-card {
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(19, 24, 36, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 180px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.job-card.is-late {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.25);
}

.job-card.is-at-risk {
  border-color: rgba(245, 158, 11, 0.6);
}

.job-card.is-active {
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75);
}

.job-card__header {
  display: flex;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #f8fafc;
  align-items: center;
  justify-content: space-between;
}

.job-card__product {
  color: rgba(148, 163, 184, 0.85);
}

.job-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.8);
}

.job-card__slack-meter {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.08);
  overflow: hidden;
}

.job-card__slack-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.9), rgba(59, 130, 246, 0.8));
}

.job-card__micro {
  display: flex;
  gap: 2px;
  height: 8px;
  margin-top: 0.25rem;
}

.job-card__micro-segment {
  flex: 1;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.4);
}

.job-card__micro-segment.is-critical {
  background: rgba(239, 68, 68, 0.8);
}

.job-card__micro-empty {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.job-card__footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.9);
  margin-top: 0.25rem;
}

.job-card__tardiness {
  color: #f87171;
}

.job-card__tardiness--ok {
  color: #34d399;
}

.job-card__slack {
  color: #34d399;
}

.job-card__slack--missing {
  color: rgba(248, 250, 252, 0.7);
}

.job-card__status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.job-card__status.is-late {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.5);
}

.job-card__status.is-on-time {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.5);
}

.job-card__status.is-at-risk {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
}

.triage-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.triage-header {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(135deg, rgba(24, 24, 27, 0.96), rgba(15, 23, 42, 0.92));
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
}

.triage-header__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.triage-header__titles {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.triage-header__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.7);
}

.triage-header__headline {
  margin: 0;
  font-size: 1.6rem;
  color: #f8fafc;
}

.triage-header__subtitle {
  margin: 0;
  color: rgba(226, 232, 240, 0.8);
  max-width: 520px;
}

.triage-header__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.8);
}

.triage-window {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.triage-window__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.8);
}

.triage-window__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.triage-window__empty {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.7);
}

.triage-window__hint {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}

.triage-chip {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: rgba(30, 41, 59, 0.65);
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.triage-chip.is-active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.7);
  color: #f8fafc;
}

.triage-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.triage-kpi-card {
  border-radius: 18px;
  border: 1px solid rgba(71, 85, 105, 0.6);
  background: rgba(15, 23, 42, 0.78);
  padding: 1rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: rgba(226, 232, 240, 0.9);
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.triage-kpi-card.is-static {
  cursor: default;
}

.triage-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.4);
}

.triage-kpi-card__label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.8);
}

.triage-kpi-card__value {
  margin: 0;
  font-size: 1.5rem;
  color: #f8fafc;
}

.triage-kpi-card__detail {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(203, 213, 225, 0.8);
}

.triage-kpi-card.tone-danger {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(127, 29, 29, 0.18);
}

.triage-kpi-card.tone-warning {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(217, 119, 6, 0.18);
}

.triage-kpi-card.tone-neutral {
  border-color: rgba(71, 85, 105, 0.6);
}

.triage-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.triage-highlights__empty {
  color: rgba(148, 163, 184, 0.8);
  font-size: 0.85rem;
}

.triage-highlight {
  border-radius: 16px;
  padding: 0.85rem;
  border: 1px solid rgba(71, 85, 105, 0.6);
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.triage-highlight__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.75);
}

.triage-highlight__value {
  font-size: 1.1rem;
  color: #f8fafc;
}

.triage-highlight__detail {
  font-size: 0.85rem;
  color: rgba(203, 213, 225, 0.8);
}

.triage-filter-summary .dashboard-filter-row {
  justify-content: flex-start;
}

.triage-alert {
  border-radius: 14px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(30, 64, 175, 0.15);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.85rem;
}

.triage-alert.is-error {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(127, 29, 29, 0.2);
}

.triage-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.triage-main,
.triage-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.triage-queue {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.triage-queue-card {
  border-radius: 16px;
  border: 1px solid rgba(71, 85, 105, 0.6);
  background: rgba(15, 23, 42, 0.72);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.triage-queue-card.severity-critical {
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 16px 28px rgba(127, 29, 29, 0.35);
}

.triage-queue-card.severity-high {
  border-color: rgba(251, 191, 36, 0.65);
}

.triage-queue-card__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.triage-queue-card__rank {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.8);
}

.triage-queue-card__severity,
.triage-queue-card__status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: rgba(226, 232, 240, 0.8);
}

.triage-queue-card__product {
  margin: 0;
  color: rgba(203, 213, 225, 0.9);
  font-size: 0.9rem;
}

.triage-queue-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.85);
}

.triage-queue-card__signals {
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.9);
}

.triage-queue-card__actions {
  display: flex;
  gap: 0.5rem;
}

.triage-queue-card__btn {
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.2);
  color: #e2e8f0;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.triage-queue-card__btn.ghost {
  border-color: rgba(71, 85, 105, 0.7);
  background: transparent;
}

.triage-driver-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.triage-driver {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.75rem;
  align-items: center;
}

.triage-driver__label {
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.9);
}

.triage-driver__value {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.85);
}

.triage-driver__bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.6);
  overflow: hidden;
}

.triage-driver__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.9), rgba(129, 140, 248, 0.9));
}

.triage-hotspot-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.triage-hotspot {
  border-radius: 14px;
  border: 1px solid rgba(71, 85, 105, 0.6);
  background: rgba(15, 23, 42, 0.7);
  padding: 0.75rem;
  text-align: left;
  color: rgba(226, 232, 240, 0.9);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.triage-hotspot__header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.triage-hotspot__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.6);
  overflow: hidden;
}

.triage-hotspot__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.9), rgba(245, 158, 11, 0.9));
}

.triage-hotspot__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.85);
}

.triage-watchlist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.triage-watchlist__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.9);
}

.triage-watchlist__btn {
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: transparent;
  color: rgba(226, 232, 240, 0.85);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .triage-grid {
    grid-template-columns: 1fr;
  }

  .triage-header__meta {
    align-items: flex-start;
  }

  .triage-watchlist__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.dashboard-empty {
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.8);
}

.dashboard-command-palette {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.dashboard-command-palette__panel {
  width: min(520px, 90vw);
  background: rgba(18, 18, 20, 0.98);
  border-radius: 18px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  padding: 1rem;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-command-palette__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background: rgba(24, 24, 27, 0.96);
  color: var(--color-text);
}

.dashboard-command-palette__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dashboard-command__btn {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  padding: 0.45rem 0.75rem;
  background: rgba(24, 24, 27, 0.95);
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  font: inherit;
}

.dashboard-command__btn:hover {
  border-color: rgba(148, 163, 184, 0.9);
}

.dashboard-command__empty {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.85);
  padding: 0.5rem 0.25rem;
}

.cost-toggle {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.cost-toggle__btn {
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.75);
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  font: inherit;
}

.cost-toggle__btn.is-active {
  background: rgba(39, 39, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.9);
  color: var(--color-text);
}

.cost-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.cost-summary__metric {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem;
  font-size: 0.9rem;
}

.planner-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.planner-controls {
  border-radius: 18px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  padding: 1rem;
  background: rgba(24, 24, 27, 0.95);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.planner-controls h4 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.7);
}

.planner-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.planner-filter-group__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.7);
}

.planner-filter-group__chips {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.planner-chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.2rem 0.75rem;
  font-size: 0.78rem;
  background: transparent;
  color: rgba(226, 232, 240, 0.85);
  cursor: pointer;
  font: inherit;
}

.planner-chip.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
  color: var(--color-text);
}

.labour-rule-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.dashboard-panel--labour-rules .labour-rule-layout {
  flex: 1 1 auto;
}

.labour-rule-layout__filters {
  position: sticky;
  top: 10px;
  align-self: start;
}

.dashboard-panel--labour-rules {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dashboards-root[data-mode="labour-rules"] .dashboard-panel--labour-rules .dashboard-panel__header {
  margin-bottom: 4px;
}

.labour-rule-filters {
  background: linear-gradient(180deg, rgba(30, 36, 50, 0.92), rgba(18, 22, 30, 0.95));
  border: 1px solid var(--color-border-soft);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.labour-rule-filters > h4 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
  color: var(--color-text-strong);
}

.labour-rule-filter-group {
  display: grid;
  gap: 8px;
}

.labour-rule-filter-label {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.7);
}

.labour-rule-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.labour-rule-filter-row--dates {
  align-items: stretch;
}

.labour-rule-chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  transition: background 0.2s var(--tap), border-color 0.2s var(--tap), color 0.2s var(--tap);
}

.labour-rule-chip:hover {
  background: rgba(39, 39, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.9);
}

.labour-rule-chip.is-active {
  background: rgba(39, 39, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.9);
  color: var(--color-text);
}

.labour-rule-chip--ghost {
  background: rgba(15, 23, 42, 0.35);
}

.labour-rule-search {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-border-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
}

.labour-rule-date-input {
  min-height: 34px;
  min-width: 130px;
  border-radius: 10px;
  border: 1px solid rgba(99, 115, 158, 0.45);
  background: rgba(15, 23, 42, 0.72);
  color: var(--color-text);
  padding: 0 10px;
  font: inherit;
  font-size: 0.82rem;
}

.labour-rule-date-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.72);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.labour-rule-filter-hint {
  margin: 0;
  font-size: 0.76rem;
  color: rgba(148, 163, 184, 0.82);
}

.labour-rule-chart-area {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.labour-rule-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.labour-rule-chart-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-strong);
}

.labour-rule-chart-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.labour-rule-overlay {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(236px, 260px);
  gap: 10px;
  align-items: stretch;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(63, 63, 70, 0.9);
  background:
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.18), transparent 52%),
    linear-gradient(140deg, #18181b, #101015);
  padding: 12px 14px;
}

.labour-rule-overlay__chart {
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
}

.labour-rule-overlay svg {
  width: auto;
  min-width: 0;
  max-width: none;
  height: auto;
  display: block;
  mix-blend-mode: screen;
}

.labour-rule-overlay__summary {
  position: static;
  background: rgba(24, 24, 27, 0.95);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 12px;
  padding: 10px 11px;
  min-width: 0;
  max-width: none;
  min-height: 0;
  display: grid;
  gap: 4px;
  align-content: start;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.labour-rule-overlay__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(241, 245, 249, 0.7);
  margin-bottom: 4px;
}

.labour-rule-overlay__headline {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 4px;
}

.labour-rule-overlay__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.labour-rule-overlay__period {
  grid-column: 1 / -1;
  color: rgba(124, 140, 255, 0.9);
}

.labour-rule-visuals {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 320px;
  gap: 16px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.labour-rule-chart-shell {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 18, 20, 0.98), rgba(24, 24, 27, 0.9));
  border: 1px solid var(--color-border-soft);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 420px;
}

.labour-rule-chart-shell svg {
  width: auto;
  min-width: 0;
  max-width: none;
  height: auto;
  display: block;
}

.labour-rule-chart-shell text {
  fill: rgba(248, 250, 252, 0.9);
  font-size: 0.78rem;
}

.labour-rule-overlay text {
  fill: rgba(248, 250, 252, 0.92);
}

.dashboards-root[data-mode="labour-rules"] .labour-rule-chart-shell,
.dashboards-root[data-mode="labour-rules"] .labour-rule-legend {
  height: 100%;
  min-height: 0;
}

.labour-rule-axis-label {
  fill: var(--color-text-muted);
  font-size: 0.78rem;
}

.labour-rule-x-tick {
  font-size: 0.74rem;
  fill: rgba(226, 232, 240, 0.82);
}

.labour-rule-focus-line {
  stroke: var(--color-accent);
  stroke-dasharray: 4 3;
  stroke-width: 1.5;
}

.labour-rule-line {
  transition: opacity 0.2s var(--tap), stroke-width 0.2s var(--tap);
}

.labour-rule-line.is-muted,
.labour-rule-legend__item.is-muted {
  opacity: 0.25;
}

.labour-rule-line.is-active {
  stroke-width: 3.2;
}

.labour-rule-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 15, 18, 0.98);
  border: 1px solid rgba(82, 82, 91, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: none;
  transition: opacity 0.15s ease;
  min-width: 200px;
  z-index: 5;
}

.labour-rule-tooltip__title {
  margin: 0 0 4px;
  color: #e2e8f0;
  font-weight: 700;
}

.labour-rule-tooltip__metric {
  margin: 0;
  color: var(--color-text);
  font-size: 0.95rem;
}

.labour-rule-tooltip__hint {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.labour-rule-legend {
  background: rgba(18, 18, 20, 0.98);
  border: 1px solid rgba(63, 63, 70, 0.9);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  max-height: calc(100vh - 140px);
  position: sticky;
  top: 12px;
  align-self: start;
  overflow: hidden;
}

.labour-rule-legend__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.labour-rule-legend__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.8rem;
}

.labour-rule-legend__hint {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.labour-rule-legend__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 190px);
  padding-right: 6px;
  min-height: 0;
  flex: 1 1 auto;
}

@media (max-width: 1360px) {
  .labour-rule-layout {
    grid-template-columns: 1fr;
  }

  .labour-rule-layout__filters {
    position: static;
  }

  .labour-rule-visuals {
    grid-template-columns: 1fr;
  }

  .labour-rule-legend {
    position: static;
    max-height: 380px;
  }

  .labour-rule-overlay__summary {
    margin-top: 0;
  }

  .labour-rule-overlay {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .labour-rule-overlay svg {
    height: 146px;
  }

  .labour-rule-overlay__meta {
    grid-template-columns: 1fr;
  }
}

.labour-rule-legend__item {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s var(--tap), transform 0.2s var(--tap), background 0.2s var(--tap), opacity 0.2s var(--tap);
}

.labour-rule-legend__item:hover,
.labour-rule-legend__item.is-active {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(39, 39, 42, 0.95);
  transform: translateY(-1px);
}

.labour-rule-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.labour-rule-legend__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}

.labour-rule-legend__name {
  font-weight: 700;
  color: #f8fafc;
}

.labour-rule-legend__role {
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.labour-rule-legend__stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.labour-rule-legend__cap {
  color: rgba(124, 140, 255, 0.9);
}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid--labour .labour-panel--overview,
  .dashboard-grid--labour .labour-panel--worker,
  .dashboard-grid--labour .labour-panel--role,
  .dashboard-grid--labour .labour-panel--contract {
    grid-column: auto;
  }
}

/* Chat interface redesign */
#chatPanel {
  right: 20px;
  bottom: 84px;
  background: color-mix(in srgb, var(--bg-1) 88%, #030712 12%);
  border: 1px solid color-mix(in srgb, var(--line) 70%, #94a3b8 30%);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.6);
  padding: 14px;
  gap: 12px;
  backdrop-filter: blur(14px);
}

.copilot-drawer__header {
  align-items: flex-start;
  padding: 8px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-2) 75%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.chat-shell {
  gap: 10px;
}

.chat-context.state {
  margin: 0;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg-2) 70%, #020617 30%);
  padding: 12px;
}

.chat-main,
.chat-history-pane {
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--bg-1) 86%, #020617 14%);
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08);
}

.chat-history-pane {
  width: 250px;
  min-width: 250px;
  border-radius: 14px;
}

.chat-history-pane.collapsed {
  width: 52px;
  min-width: 52px;
}

.chat-history-header {
  padding: 8px;
  gap: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.chat-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.chat-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-icon-btn:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--bg-2) 80%);
  border-color: rgba(var(--accent-rgb), 0.6);
  transform: translateY(-1px);
}

.chat-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.3);
}

.chat-history-pane.collapsed #chatNewSession {
  display: none;
}

.chat-session-item {
  grid-template-columns: 1fr 28px;
  align-items: start;
  background: color-mix(in srgb, var(--bg-2) 68%, transparent);
  border-color: color-mix(in srgb, var(--line) 80%, transparent);
}

.chat-session-item-meta {
  grid-column: 1 / -1;
}

.chat-session-delete {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.chat-session-delete svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-session-delete:hover {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.chat-messages {
  padding: 14px;
  gap: 10px;
  background: color-mix(in srgb, var(--bg-1) 95%, #020617 5%);
}

.msg {
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--bg-2) 80%, #020617 20%);
  box-shadow: none;
}

.msg.user {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.42), rgba(30, 64, 175, 0.45));
  border-color: rgba(var(--accent-rgb), 0.55);
}

.msg.bot,
.msg.system {
  background: color-mix(in srgb, var(--bg-2) 85%, #020617 15%);
}

.chat-input {
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  background: color-mix(in srgb, var(--bg-1) 88%, #020617 12%);
  padding: 10px;
  gap: 10px;
}

.chat-input textarea {
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-2) 85%, #020617 15%);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}

.chat-input-actions {
  align-items: flex-end;
}

.chat-send-btn {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.92), rgba(37, 99, 235, 0.85));
  color: #eff6ff;
  border-color: rgba(var(--accent-rgb), 0.8);
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 1), rgba(37, 99, 235, 0.95));
}

.chat-hint {
  padding: 0 10px 6px;
}

@media (max-width: 980px) {
  .chat-history-pane {
    width: 220px;
    min-width: 220px;
  }
}

#chatHistoryToggle[aria-expanded="true"] .icon-history { transform: scaleX(-1); }

.dashboard-panel--wip {
  background:
    linear-gradient(180deg, rgba(14, 18, 28, 0.96), rgba(11, 14, 24, 0.92)),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 42%);
}

.dashboard-metrics--wip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.dashboard-metric--wip {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(15, 23, 42, 0.62));
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 92px;
}

.wip-dashboard-layout {
  display: grid;
  gap: 16px;
}

.wip-area-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.wip-area-card {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.68)),
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 45%);
  border: 1px solid rgba(94, 234, 212, 0.14);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 20px 40px rgba(3, 7, 18, 0.28);
}

.wip-area-card.is-overflow {
  border-color: rgba(251, 191, 36, 0.22);
  background:
    linear-gradient(180deg, rgba(33, 26, 9, 0.9), rgba(18, 14, 8, 0.72)),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.12), transparent 44%);
}

.wip-area-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wip-area-card__title-wrap {
  display: grid;
  gap: 2px;
}

.wip-area-card__title {
  margin: 0;
  font-size: 15px;
  color: #f8fafc;
}

.wip-area-card__subtitle {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.82);
}

.wip-area-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.18);
  color: #cffafe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wip-area-card__badge.is-overflow {
  background: rgba(217, 119, 6, 0.2);
  color: #fde68a;
}

.wip-area-card__meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  overflow: hidden;
}

.wip-area-card__meter.is-overcommitted {
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.28);
}

.wip-area-card__meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.92), rgba(59, 130, 246, 0.92));
}

.wip-area-card__meter-fill--occupancy {
  background: linear-gradient(90deg, rgba(160, 196, 116, 0.96), rgba(214, 230, 156, 0.92));
}

.wip-area-card__meter-fill--reserved {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.86), rgba(251, 191, 36, 0.82));
}

.wip-area-card__meter-overcommit {
  position: absolute;
  inset: 0 0 0 auto;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.98), rgba(251, 191, 36, 0.98));
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.38);
}

.wip-area-card__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wip-area-card__stat {
  display: grid;
  gap: 2px;
}

.wip-area-card__stat-label {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.84);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.wip-area-card__stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.wip-area-card__spark {
  display: grid;
  grid-auto-flow: column;
  align-items: end;
  gap: 4px;
  min-height: 56px;
}

.wip-area-card__spark-bar {
  position: relative;
  min-height: 56px;
  border-radius: 999px 999px 0 0;
  background: rgba(15, 23, 42, 0.36);
  overflow: hidden;
}

.wip-area-card__spark-bar.is-overcommitted {
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.24);
}

.wip-area-card__spark-segment {
  position: absolute;
  inset: auto 0 0 0;
  border-radius: inherit;
}

.wip-area-card__spark-segment--occupancy {
  background: linear-gradient(180deg, rgba(160, 196, 116, 0.96), rgba(202, 224, 138, 0.68));
}

.wip-area-card__spark-segment--reserved {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.88), rgba(251, 191, 36, 0.62));
}

.wip-area-card__spark-overcommit {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.98), rgba(251, 191, 36, 0.96));
}

.wip-area-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: rgba(226, 232, 240, 0.86);
  font-size: 12px;
}

.wip-area-card__footer-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wip-area-card__notes {
  margin: 0;
  font-size: 12px;
  color: rgba(203, 213, 225, 0.78);
}

.wip-event-list {
  display: grid;
  gap: 10px;
}

.wip-event-item {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  gap: 8px;
}

.wip-event-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.wip-event-item__type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 0.96);
}

.wip-event-item__time {
  font-size: 12px;
  color: rgba(203, 213, 225, 0.78);
}

.wip-event-item__body {
  display: grid;
  gap: 4px;
}

.wip-event-item__primary {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
}

.wip-event-item__meta,
.wip-event-item__notes {
  font-size: 12px;
  color: rgba(203, 213, 225, 0.78);
}
