/* Schedule Demo Styles - Matching motherboard schedule view */

/* Custom Colors from theme */
:root {
  --sd-background: #ffffff;
  --sd-foreground: #0a0a0a;
  --sd-muted: #fafafa;
  --sd-less-muted: #8e8e8e;
  --sd-border: #ebebeb;
  --sd-soft-foreground: #555b62;
  --sd-highlight: #087ad1;
}

.schedule-demo {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 500px;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  background: var(--sd-background);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}

.schedule-demo * {
  font-family: inherit;
}

.schedule-demo button {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   App Toolbar
   ============================================ */

.schedule-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  background: var(--sd-background);
  border-bottom: 1px solid var(--sd-border);
  flex-shrink: 0;
  overflow: visible;
  min-width: 0;
  z-index: 20;
}

.toolbar-logo {
  display: flex;
  align-items: center;
  padding: 0 8px 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--sd-foreground);
  letter-spacing: -0.02em;
}

.toolbar-divider {
  color: var(--sd-border);
  margin: 0 2px;
  font-size: 14px;
  user-select: none;
}

.toolbar-dropdown {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sd-foreground);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.toolbar-dropdown:hover {
  background: var(--sd-muted);
}

.toolbar-dropdown svg {
  width: 16px;
  height: 16px;
  color: var(--sd-less-muted);
}

.toolbar-dropdown .active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4fe3c1;
  margin-left: 2px;
}

/* ============================================
   Plan Selector Dropdown
   ============================================ */

.plan-selector {
  position: relative;
}

.plan-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 280px;
  background: var(--sd-background);
  border: 1px solid var(--sd-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.plan-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.plan-dropdown-header {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sd-less-muted);
}

.plan-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.plan-dropdown-item:hover {
  background: var(--sd-muted);
}

.plan-item-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--sd-less-muted);
}

.plan-dropdown-item.selected .plan-item-title {
  font-weight: 600;
  color: var(--sd-foreground);
}

.plan-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4fe3c1;
  flex-shrink: 0;
}

.plan-dropdown-item:not([data-plan="master"]) .plan-item-dot {
  display: none;
}

.plan-item-time {
  font-size: 11px;
  color: var(--sd-less-muted);
}

.plan-item-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.plan-dropdown-item:hover .plan-item-actions,
.plan-dropdown-item.selected .plan-item-actions {
  opacity: 1;
}

.plan-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--sd-less-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.plan-action-btn:hover {
  background: var(--sd-border);
  color: var(--sd-foreground);
}

.plan-action-btn svg {
  width: 16px;
  height: 16px;
}

.toolbar-spacer {
  flex: 1;
  min-width: 0;
}

/* Toolbar optimize button - hidden on desktop, shown on mobile */
.toolbar-optimize-btn {
  display: none;
}

.toolbar-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sd-soft-foreground);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-tab:hover {
  color: var(--sd-foreground);
}

.toolbar-tab.active {
  color: var(--sd-foreground);
  border-bottom-color: var(--sd-foreground);
}

.toolbar-tab svg {
  width: 16px;
  height: 16px;
}

.avatar-stack {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 24px;
  width: 72px;
}

.avatar-stack-item {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: white;
  position: absolute;
}

.avatar-stack-more {
  background: linear-gradient(135deg, #6b7280, #1f2937);
  font-size: 8px;
}

/* ============================================
   Subheader (Tabs + Metrics + Optimize)
   ============================================ */

.schedule-subheader {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  background: var(--sd-background);
  border-bottom: 1px solid var(--sd-border);
  flex-shrink: 0;
  gap: 16px;
}

.subheader-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.subheader-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  padding-right: 20px;
  height: 100%;
  font-size: 13px;
  font-weight: 500;
  color: var(--sd-soft-foreground);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

.subheader-tab:hover {
  color: var(--sd-foreground);
}

.subheader-tab.active {
  color: var(--sd-foreground);
  border-bottom-color: var(--sd-foreground);
}

.subheader-tab svg {
  width: 16px;
  height: 16px;
}

.subheader-spacer {
  flex: 1;
}

/* ============================================
   Workflow Sections
   ============================================ */

.workflow-sections {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 12px;
  height: 100%;
}

.workflow-section {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-less-muted);
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
}

.workflow-section svg {
  width: 16px;
  height: 16px;
}

.workflow-section.active {
  color: var(--sd-foreground);
  border-bottom-color: var(--sd-foreground);
}

.subheader-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================
   Outcome Cards
   ============================================ */

.outcome-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--sd-muted);
  border-radius: 6px;
  min-width: 120px;
}

.outcome-card .outcome-label {
  font-size: 11px;
  color: var(--sd-soft-foreground);
  font-weight: 500;
  line-height: 1.1;
}

.outcome-card .outcome-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--sd-foreground);
  line-height: 1;
  margin-left: auto;
  transition: color 0.3s ease;
}

.outcome-card .outcome-value.improved {
  color: #238551;
}

.outcome-card .outcome-value.worse {
  color: #cd4246;
}

.metric-unit {
  font-size: 11px;
  font-weight: 400;
  color: var(--sd-less-muted);
}

/* ============================================
   Main Content Area
   ============================================ */

.schedule-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ============================================
   Line Labels Gutter (Left Side)
   ============================================ */

.schedule-gutter {
  width: 60px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sd-border);
  background: var(--sd-background);
  z-index: 3;
}

.schedule-gutter-header {
  height: 40px;
  border-bottom: 1px solid var(--sd-border);
  background: var(--sd-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-line-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--sd-soft-foreground);
  border-bottom: 1px solid var(--sd-border);
  background: var(--sd-background);
}

.schedule-line-label:last-child {
  border-bottom: none;
}

/* ============================================
   Timeline Area (Right Side)
   ============================================ */

.schedule-timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  background: linear-gradient(
    to bottom,
    var(--sd-muted) 40px,
    var(--sd-background) 40px
  );
}

/* Scrollbar styling */
.schedule-timeline::-webkit-scrollbar {
  height: 8px;
}

.schedule-timeline::-webkit-scrollbar-track {
  background: var(--sd-muted);
}

.schedule-timeline::-webkit-scrollbar-thumb {
  background: var(--sd-border);
  border-radius: 4px;
}

.schedule-timeline::-webkit-scrollbar-thumb:hover {
  background: var(--sd-less-muted);
}

/* Time Axis */
.schedule-time-axis {
  height: 40px;
  position: relative;
  border-bottom: 1px solid var(--sd-border);
  background: var(--sd-muted);
  flex-shrink: 0;
  min-width: 100%;
}

.time-tick {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid var(--sd-border);
}

.time-tick.major {
  border-left-width: 2px;
}

.time-tick-label {
  position: absolute;
  top: 5px;
  left: 4px;
  font-size: 11px;
  color: var(--sd-less-muted);
  white-space: nowrap;
  font-weight: 500;
  text-transform: uppercase;
}

.time-tick.major .time-tick-label {
  font-weight: 600;
}

/* Lines Container */
.schedule-lines-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--sd-background);
  min-width: 100%;
}

/* Individual Line Track */
.schedule-line-track {
  flex: 1;
  position: relative;
  border-bottom: 1px solid var(--sd-border);
  min-height: 80px;
}

.schedule-line-track:last-child {
  border-bottom: none;
}

/* Vertical Grid Lines */
.schedule-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--sd-border);
  pointer-events: none;
  z-index: 0;
}

.schedule-grid-line.major {
  width: 2px;
}

/* ============================================
   Event Blocks
   ============================================ */

.schedule-event {
  position: absolute;
  top: 8px;
  bottom: 8px;
  border-radius: 0;
  border: 1px solid var(--sd-border);
  display: flex;
  flex-direction: column;
  overflow: visible;
  z-index: 1;
  box-sizing: border-box;
  font-family: "Univers Next Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.3;
}

.schedule-event * {
  font-family: inherit;
}

/* Event Header (Brand) */
.event-header {
  padding: 4px 8px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  height: 30px;
  display: flex;
  align-items: center;
}

/* Event Body */
.event-body {
  padding: 6px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  overflow: hidden;
}

.event-format {
  font-weight: 700;
  font-size: 12px;
}

.event-detail {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--sd-soft-foreground);
}

/* Condensed event (narrow) */
.schedule-event.condensed {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
}

.schedule-event.condensed .event-header,
.schedule-event.condensed .event-body {
  display: none;
}

.schedule-event.condensed .event-condensed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.event-condensed {
  display: none;
}

.event-condensed-brand,
.event-condensed-format {
  font-weight: 700;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   Event Errors
   ============================================ */

.event-error {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #cd4246;
  flex-shrink: 0;
  cursor: pointer;
  z-index: 10;
}

.event-error svg {
  width: 18px;
  height: 18px;
}

/* Tooltip */
.event-error-tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  padding: 6px 10px;
  background: #1f1f1f;
  color: white;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Arrow for tooltip */
.event-error-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 4px;
  border: 5px solid transparent;
  border-bottom-color: #1f1f1f;
}

/* Show tooltip on hover or click on error icon */
.event-error:hover .event-error-tooltip,
.event-error.show-tooltip .event-error-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Raise z-index when tooltip is visible */
.event-error:hover,
.event-error.show-tooltip {
  z-index: 100;
}

/* Condensed event error positioning */
.schedule-event.condensed .event-error {
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
}

.schedule-event.condensed .event-error svg {
  width: 16px;
  height: 16px;
}

.schedule-event.has-error {
  border-color: #cd4246;
  box-shadow: inset 0 0 0 1px #cd4246;
}

/* ============================================
   Tab Badges
   ============================================ */

.tab-badge {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 4px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #cd4246;
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  line-height: 1;
}

.tab-badge.visible {
  display: inline-flex;
}

.tab-check {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #238551;
}

.tab-check.visible {
  display: inline-flex;
}

.tab-check svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Drag and Drop States
   ============================================ */

.schedule-event {
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.schedule-event:hover {
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.schedule-event:active {
  cursor: grabbing;
}

.schedule-event.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  cursor: grabbing;
}

/* Touch drag clone (mobile) */
.schedule-event.touch-drag-clone {
  cursor: grabbing;
  touch-action: none;
}

/* Prevent default touch actions on events for better drag behavior */
@media (pointer: coarse) {
  .schedule-event {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.schedule-line-track {
  transition: background-color 0.15s ease;
}

.schedule-line-track.drag-over {
  background-color: rgba(8, 122, 209, 0.04);
}

/* Drop Indicator */
.drop-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--sd-highlight);
  border-radius: 2px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.15s ease, left 0.1s ease;
  z-index: 100;
  pointer-events: none;
}

.drop-indicator::before,
.drop-indicator::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.drop-indicator::before {
  top: -2px;
  border-bottom: 6px solid var(--sd-highlight);
}

.drop-indicator::after {
  bottom: -2px;
  border-top: 6px solid var(--sd-highlight);
}

.drop-indicator.visible {
  opacity: 1;
}

/* ============================================
   Changeover/Downtime Blocks
   ============================================ */

.schedule-changeover {
  position: absolute;
  top: 8px;
  bottom: 8px;
  background: #f0f0f0;
  border-radius: 0;
  border: 1px solid var(--sd-border);
  z-index: 0;
}

/* ============================================
   Filler Blocks (extends to infinity)
   ============================================ */

.schedule-filler {
  position: absolute;
  top: 8px;
  bottom: 8px;
  background-color: #f7f7f7;
  background-image: linear-gradient(
    -45deg,
    transparent 49.5%,
    #d4d4d4 49.5%,
    #d4d4d4 50.5%,
    transparent 50.5%
  );
  background-size: 12px 12px;
  border: 1px solid var(--sd-border);
  border-right: none;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   Controls (in subheader)
   ============================================ */

.optimize-btn {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-background);
  background: var(--sd-foreground);
  border: 1px solid var(--sd-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.optimize-btn:hover {
  background: #2a2a2a;
}

.optimize-btn:disabled {
  background: var(--sd-less-muted);
  cursor: not-allowed;
}

.optimize-btn.reset {
  background: var(--sd-background);
  color: var(--sd-soft-foreground);
  border: 1px solid var(--sd-border);
}

.optimize-btn.reset:hover {
  background: var(--sd-foreground);
  color: var(--sd-background);
}

/* ============================================
   Interaction Hints
   ============================================ */

/* Emanating glow animation for schedule events */
@keyframes hint-emanate {
  0%,
  100% {
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 0 8px 0 rgba(0, 0, 0, 0.1),
      0 0 16px 0 rgba(0, 0, 0, 0.05);
  }
  50% {
    border-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25), 0 0 12px 2px rgba(0, 0, 0, 0.18),
      0 0 24px 4px rgba(0, 0, 0, 0.1);
  }
}

/* Emanating glow animation for buttons */
@keyframes hint-button-emanate {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 0 8px 0 rgba(0, 0, 0, 0.12),
      0 0 16px 0 rgba(0, 0, 0, 0.06);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 12px 2px rgba(0, 0, 0, 0.2),
      0 0 24px 4px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
  }
}

/* Apply hint to specific event when demo is hovered and not yet interacted */
.schedule-demo.show-hints .schedule-event.hint-target {
  animation: hint-emanate 1.8s ease-in-out infinite;
  z-index: 5;
}

/* Apply hint to optimize button */
.schedule-demo.show-hints .optimize-btn.hint-target {
  animation: hint-button-emanate 1.8s ease-in-out infinite;
}

/* Apply hint to demo toggle button (outside schedule-demo container) */
.demo-toggle-btn.hint-target {
  animation: hint-button-emanate 1.8s ease-in-out infinite;
}

/* Ensure the hint animation doesn't interfere with drag states */
.schedule-demo .schedule-event.dragging {
  animation: none !important;
  border-color: var(--sd-border) !important;
}

.schedule-demo .schedule-event.dragging::after {
  display: none !important;
}

/* ============================================
   Responsive
   ============================================ */

/* ============================================
   Operator Side Panel
   ============================================ */

.operator-panel {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--sd-border);
  background: var(--sd-background);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.operator-panel:hover {
  background: var(--sd-muted);
}

.operator-panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

.operator-icon {
  width: 20px;
  height: 20px;
  color: var(--sd-foreground);
}

.operator-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 600;
  color: var(--sd-soft-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.operator-expand-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  color: var(--sd-less-muted);
  transition: color 0.15s ease;
}

.operator-panel:hover .operator-expand-hint {
  color: var(--sd-soft-foreground);
}

.operator-expand-hint svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Mobile / Simplified Layout (< 900px)
   ============================================ */

@media (max-width: 900px) {
  /* Hide workflow sections (Graph, Inputs, Plan, Outcomes) */
  .workflow-sections {
    display: none;
  }

  /* Hide avatar stack on mobile */
  .avatar-stack {
    display: none;
  }

  /* Compact toolbar */
  .schedule-toolbar {
    height: 40px;
    padding: 0 8px;
  }

  .toolbar-dropdown {
    font-size: 12px;
    padding: 4px 6px;
  }

  /* Show optimize button in toolbar on mobile */
  .toolbar-optimize-btn {
    display: inline-flex;
  }

  /* Hide optimize button in subheader on mobile */
  .schedule-subheader > .optimize-btn {
    display: none;
  }

  /* Subheader: fixed height, tabs only */
  .schedule-subheader {
    height: 40px;
    padding: 0 12px;
    gap: 8px;
    flex-shrink: 0;
  }

  .subheader-tabs {
    flex: 1;
    height: 100%;
  }

  .subheader-tab {
    padding: 0 8px;
    padding-right: 20px;
    font-size: 12px;
  }

  .tab-check,
  .tab-badge {
    right: 2px;
  }

  .tab-check svg {
    width: 14px;
    height: 14px;
  }

  .subheader-spacer {
    display: none;
  }

  /* Hide metrics from subheader on mobile (they move to bottom bar) */
  .schedule-subheader .subheader-metrics {
    display: none;
  }

  /* Main content fills space between subheader and bottom bar */
  .schedule-content {
    flex: 1;
    min-height: 0;
  }

  /* Gutter adjustments */
  .schedule-gutter {
    width: 40px;
  }

  .schedule-line-label {
    font-size: 10px;
  }

  .schedule-gutter-header {
    height: 32px;
  }

  /* Time axis */
  .schedule-time-axis {
    height: 32px;
  }

  .time-tick-label {
    font-size: 9px;
  }

  /* Event blocks */
  .event-header {
    font-size: 11px;
    padding: 3px 6px;
    height: 22px;
  }

  .event-body {
    padding: 3px 6px;
    font-size: 10px;
  }

  /* Operator panel */
  .operator-panel {
    width: 32px;
  }

  .operator-icon {
    width: 14px;
    height: 14px;
  }

  .operator-label {
    font-size: 9px;
  }
}

/* ============================================
   Mobile Bottom Bar
   ============================================ */

.mobile-bottom-bar {
  display: none;
}

@media (max-width: 900px) {
  .mobile-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    padding: 0 10px;
    background: var(--sd-background);
    border-top: 1px solid var(--sd-border);
    flex-shrink: 0;
    gap: 8px;
  }

  .mobile-bottom-bar .subheader-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .mobile-bottom-bar .outcome-card {
    padding: 4px 8px;
    min-width: 0;
    gap: 6px;
  }

  .mobile-bottom-bar .outcome-label {
    font-size: 9px;
    white-space: nowrap;
  }

  .mobile-bottom-bar .outcome-value {
    font-size: 12px;
  }

  .mobile-bottom-bar .metric-unit {
    font-size: 9px;
  }

  /* Hide optimize button from bottom bar (stays in subheader) */
  .mobile-bottom-bar .optimize-btn {
    display: none;
  }
}
