:root {
  color-scheme: light;
  --ui-bg: #f6f7f9;
  --ui-sidebar: #f0f2f5;
  --ui-panel: #ffffff;
  --ui-panel-soft: #f8fafc;
  --ui-line: #d9dde5;
  --ui-line-soft: #e9edf2;
  --ui-text: #1d2433;
  --ui-muted: #687386;
  --ui-accent: #255e8f;
  --ui-accent-soft: #e8f1f8;
  --ui-success: #27613b;
  --ui-success-soft: #edf8f0;
  --ui-compute: #2563eb;
  --ui-production: #c2410c;
  --ui-warning: #8a5716;
  --ui-warning-soft: #fff5e8;
  --ui-danger: #a33b35;
  --ui-danger-soft: #f7e9e7;
  --ui-radius: 9px;
  --ui-shadow: 0 12px 34px rgba(16, 24, 40, .07);
  --ui-sidebar-width: 270px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html,
body { min-height: 100%; }

.pipelines-body {
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  overflow-x: hidden;
}

.pipelines-app {
  display: grid;
  grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
  min-height: 100svh;
  width: 100%;
}

.pipelines-sidebar {
  background: var(--ui-sidebar);
  border-right: 1px solid var(--ui-line);
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-width: 0;
  position: sticky;
  top: 0;
  z-index: 30;
}

.pipelines-sidebar-head {
  align-items: center;
  border-bottom: 1px solid var(--ui-line);
  display: flex;
  gap: 10px;
  min-height: 62px;
  padding: 12px 14px;
}

.pipelines-brand {
  align-items: center;
  color: var(--ui-text);
  display: flex;
  flex: 1;
  gap: 9px;
  min-width: 0;
  text-decoration: none;
}

.pipelines-brand:hover { color: var(--ui-text); }
.pipelines-brand img { flex: 0 0 auto; }
.pipelines-brand span { line-height: 1.12; min-width: 0; }
.pipelines-brand small,
.pipelines-brand strong { display: block; white-space: nowrap; }
.pipelines-brand small { color: var(--ui-muted); font-size: 11px; font-weight: 600; }
.pipelines-brand strong { font-size: 14px; font-weight: 750; }

.pipelines-nav {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.pipelines-nav a {
  border-radius: 7px;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 650;
  padding: 9px 11px;
  text-decoration: none;
}

.pipelines-nav a:hover {
  background: rgba(255, 255, 255, .62);
  color: var(--ui-text);
}

.pipelines-nav a.active {
  background: var(--ui-panel);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  color: var(--ui-text);
}

.pipelines-sidebar-account {
  border-top: 1px solid var(--ui-line);
  margin-top: auto;
  padding: 10px 12px;
}

.pipelines-user-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--ui-text);
  display: flex;
  gap: 9px;
  padding: 7px;
  text-align: left;
  width: 100%;
}

.pipelines-user-button:hover { background: rgba(255, 255, 255, .65); }
.pipelines-avatar {
  align-items: center;
  background: var(--ui-accent-soft);
  border-radius: 50%;
  color: var(--ui-accent);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.pipelines-user-copy { flex: 1; line-height: 1.2; min-width: 0; }
.pipelines-user-copy strong,
.pipelines-user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipelines-user-copy strong { font-size: 12px; }
.pipelines-user-copy small { color: var(--ui-muted); font-size: 10px; margin-top: 2px; }

.pipelines-main { min-width: 0; }
.pipelines-topbar {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(246, 247, 249, .9);
  border-bottom: 1px solid var(--ui-line);
  display: flex;
  gap: 10px;
  min-height: 54px;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.pipelines-topbar-title { color: var(--ui-muted); font-size: 12px; font-weight: 650; }
.pipelines-topbar-brand { align-items: center; display: none; flex: 0 0 auto; justify-content: center; }
.pipelines-topbar-brand img { display: block; }
.pipelines-sidebar-open { visibility: hidden; }
.pipelines-content { min-width: 0; }
.pipelines-scrim { display: none; }

.ui-icon-button,
.ui-button,
.pipelines-main .btn {
  align-items: center;
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  box-shadow: none;
  color: var(--ui-text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  justify-content: center;
  min-height: 36px;
  padding: 8px 11px;
  text-decoration: none;
}
.ui-icon-button { flex: 0 0 auto; height: 36px; padding: 0; width: 36px; }
.ui-icon-button:hover,
.ui-button:hover,
.pipelines-main .btn:hover { background: #fbfcfe; border-color: #b8c1ce; color: var(--ui-text); }
.pipelines-main .btn-primary,
.ui-button.primary { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.pipelines-main .btn-danger { background: var(--ui-danger-soft); border-color: #e7c5c0; color: var(--ui-danger); }
.pipelines-main .btn:disabled,
.ui-button:disabled { background: #e4e9ef; border-color: #d4dce5; color: #718096; cursor: not-allowed; opacity: 1; }

.pipelines-page,
.ops-console {
  margin: 0 auto;
  max-width: 1500px;
  min-width: 0;
  padding: 28px 24px 60px;
}

.pipelines-page-header,
.ops-page-header {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.pipelines-eyebrow,
.ops-eyebrow {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .09em;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.pipelines-page-header h1,
.ops-page-header h1 {
  color: var(--ui-text);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -.035em;
  margin: 0;
}

.pipelines-page-subtitle,
.ops-subtitle {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 7px 0 0;
  max-width: 760px;
}

.pipelines-page-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.pipelines-section { margin-top: 18px; }
.pipelines-section-heading,
.ops-section-heading { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 13px; padding-right: 38px; position: relative; }
.pipelines-section-heading h2,
.ops-section-heading h2 { font-size: 15px; font-weight: 700; margin: 0; }
.pipelines-section-heading p { color: var(--ui-muted); font-size: 12px; margin: 4px 0 0; }

.ui-surface,
.pipelines-main .card,
.ops-section,
.ops-metric {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: none;
}
.pipelines-main .card-header {
  align-items: center;
  background: var(--ui-panel-soft);
  border-bottom: 1px solid var(--ui-line);
  border-radius: var(--ui-radius) var(--ui-radius) 0 0;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 700;
  min-height: 46px;
  padding: 9px 13px;
}
.pipelines-main .card-body { padding: 14px; }

.pipelines-main input:not([type="checkbox"]):not([type="radio"]),
.pipelines-main select,
.pipelines-main textarea,
.ops-search {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  color: var(--ui-text);
  font: inherit;
  font-size: 13px;
  min-height: 36px;
  padding: 8px 10px;
}
.pipelines-main input:focus,
.pipelines-main select:focus,
.pipelines-main textarea:focus,
.ops-search:focus { border-color: #8fb5d4; box-shadow: 0 0 0 3px rgba(37, 94, 143, .12); outline: 0; }
.pipelines-main .form-label { color: var(--ui-muted); font-size: 12px; font-weight: 700; }

.table-surface,
.ops-table-shell {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: none;
  max-width: 100%;
  overflow: auto;
}
.table-surface .table-responsive { margin: 0; }
.table-surface .dataTables_wrapper { padding: 12px; }
.table-surface-compact .dataTables_wrapper { padding: 8px; }
.table-surface table.dataTable,
.table-surface table.table,
.ops-table {
  border-collapse: collapse !important;
  border-spacing: 0;
  font-size: 12px;
  margin: 0 !important;
  width: 100% !important;
}
.table-surface table.dataTable thead th,
.table-surface table.table thead th,
.ops-table th {
  background: var(--ui-panel-soft);
  border-bottom: 1px solid var(--ui-line) !important;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
  padding: 11px 12px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table-surface table.dataTable tbody td,
.table-surface table.table tbody td,
.ops-table td {
  border-top: 1px solid var(--ui-line-soft) !important;
  color: var(--ui-text);
  padding: 11px 12px;
  vertical-align: middle;
}
.table-surface table.dataTable tbody tr,
.table-surface table.table tbody tr { background: var(--ui-panel); }
.table-surface table.dataTable tbody tr:hover,
.table-surface table.table tbody tr:hover,
.ops-table tr:hover td { background: #fbfcfe; }
.table-surface table.dataTable tbody tr.selected { background: var(--ui-accent-soft) !important; }
.table-surface .dataTables_filter,
.table-surface .dataTables_info,
.table-surface .dataTables_length { color: var(--ui-muted); font-size: 12px; margin-bottom: 8px; }
.table-surface .dataTables_filter input,
.table-surface .dataTables_length select { margin-left: 5px; }
.table-surface .dataTables_paginate .paginate_button { border-radius: 7px !important; }
.table-surface .dtr-control { color: var(--ui-accent); font-weight: 700; }
.table-surface .badge,
.ops-badge { border-radius: 999px; font-size: 11px; font-weight: 700; padding: 5px 8px; }
td.wrap { overflow-wrap: anywhere; white-space: normal !important; word-break: normal; }

.pipeline-table-actions .btn,
.process-table-actions .btn,
.vm-table-actions .btn-link,
.show-dates {
  height: 32px;
  min-height: 32px;
  min-width: 32px;
  padding: 0 8px;
}

.ai-card { height: auto; }
.ai-summary-strip { display: flex; flex-wrap: wrap; gap: 6px; text-align: left; }
.ai-summary-chip {
  align-items: center;
  background: var(--ui-panel-soft);
  border-radius: 999px;
  color: var(--ui-muted);
  display: inline-flex;
  font-size: 11px;
  gap: 5px;
  line-height: 1.2;
  padding: 5px 8px;
}
.ai-summary-chip strong { color: var(--ui-text); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.ai-feed { max-height: min(78vh, 1100px); overflow-y: auto; text-align: left; }
.ai-feed-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; text-align: left; }
.ai-filter-chip {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  color: var(--ui-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  padding: 6px 9px;
}
.ai-filter-chip:hover { border-color: #b8c1ce; color: var(--ui-text); }
.ai-filter-chip.active { background: var(--ui-text); border-color: var(--ui-text); color: #fff; }
.ai-filter-chip-clear { background: var(--ui-panel-soft); }
.ai-feed-item { border-bottom: 1px solid var(--ui-line-soft); padding: 11px 0; }
.ai-feed-item:first-child { padding-top: 0; }
.ai-feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ai-feed-row { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.ai-feed-main { flex: 1 1 auto; min-width: 0; }
.ai-feed-title { color: var(--ui-text); font-size: 13px; font-weight: 650; }
.ai-feed-meta,
.ai-feed-side-meta { color: var(--ui-muted); font-size: 11px; }
.ai-feed-side-meta { flex: 0 0 auto; min-width: 11.5rem; text-align: right; white-space: nowrap; }
.ai-feed-detail { color: var(--ui-muted); font-size: 12px; margin-top: 4px; }
.ai-empty { color: var(--ui-muted); font-size: 12px; padding: 8px 0; text-align: left; }
.ai-inline-badges .badge { margin: 4px 5px 0 0; }
.ai-summary-chip-new { background: var(--ui-warning-soft); color: var(--ui-warning); }
.ai-feed-item-new { background: var(--ui-warning-soft); border-radius: 7px; margin: 3px -7px; padding: 11px 8px; }
.ai-new-badge { background: var(--ui-warning-soft); color: var(--ui-warning); font-size: 10px; margin-left: 6px; }
.ai-overall-summary {
  background: var(--ui-panel-soft);
  border-radius: 7px;
  color: var(--ui-text);
  padding: 12px;
  text-align: left;
}
.ai-brain-summary { background: var(--ui-accent-soft); }
.ai-overall-summary-new { background: var(--ui-warning-soft); }
.ai-overall-title { color: var(--ui-text); font-size: 12px; font-weight: 700; }
.ai-overall-headline { color: var(--ui-text); font-size: 13px; font-weight: 650; margin-top: 5px; }
.ai-brain-narrative,
.ai-overall-details,
.ai-overall-highlight-reason { color: var(--ui-muted); font-size: 12px; }
.ai-brain-narrative { margin-top: 6px; }
.ai-overall-details { margin: 7px 0 0; padding-left: 16px; }
.ai-overall-details li + li { margin-top: 4px; }
.ai-overall-highlights { display: grid; gap: 7px; margin-top: 10px; }
.ai-overall-highlight { background: rgba(255, 255, 255, .72); border-radius: 7px; padding: 8px 10px; }
.ai-overall-highlight-title { color: var(--ui-text); font-size: 12px; font-weight: 650; }
.ai-overall-highlight-reason { margin-top: 3px; }
.ai-brain-findings { margin-top: 12px; }
.ai-brain-findings-title { color: var(--ui-muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.ai-brain-findings-details > summary { cursor: pointer; list-style: none; margin-bottom: 7px; }
.ai-brain-findings-details > summary::-webkit-details-marker { display: none; }
.ai-brain-findings-details > summary::before { content: '▾'; display: inline-block; margin-right: 6px; transition: transform .15s ease; }
.ai-brain-findings-details:not([open]) > summary::before { transform: rotate(-90deg); }
.ai-brain-findings-list { display: grid; gap: 7px; max-height: min(65vh, 900px); overflow-y: auto; padding-right: 5px; }

.pipelines-main .modal-content,
.ops-dialog {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(16, 24, 40, .28);
}
.pipelines-main .modal-header,
.pipelines-main .modal-footer { border-color: var(--ui-line); }
.pipelines-main .modal-title { color: var(--ui-text); font-size: 15px; font-weight: 750; }
.modal-dialog { overflow-y: initial !important; }
.modal-body { max-height: 80vh; overflow-y: auto; }

.ui-tooltip {
  background: #101828;
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .26);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  max-width: min(320px, calc(100vw - 24px));
  padding: 7px 9px;
  pointer-events: none;
  position: fixed;
  z-index: 100;
}

.dropdown-menu { border-color: var(--ui-line); border-radius: 8px; font-size: 13px; }
.dropdown-item { color: var(--ui-text); padding: 7px 11px; }
.dropdown-item:active { background: var(--ui-accent); }
.pipeline-log-container { max-height: 300px; overflow-y: auto; }
.pipeline-log-loading { display: none; }
.pipeline-debug-payload { overflow-wrap: anywhere; white-space: pre-wrap; }

.vm-form .btn-submit { min-width: 140px; }
.scheduler-card { overflow: hidden; }
.scheduler-summary {
  background: var(--ui-accent-soft);
  border-radius: var(--ui-radius);
  color: var(--ui-text);
  padding: 14px 16px;
  text-align: left;
}
.scheduler-summary h5 { font-size: 14px; font-weight: 700; }
.scheduler-summary p { color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
.scheduler-summary p:last-child { margin-bottom: 0; }
.scheduler-table td,
.scheduler-table th { vertical-align: middle; }
.scheduler-time-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  min-width: 220px;
}
.scheduler-time-grid label {
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  margin-bottom: 2px;
  text-transform: uppercase;
}
.scheduler-time-cell { min-width: 260px; }
.scheduler-updated-meta { color: var(--ui-muted); font-size: 11px; line-height: 1.4; min-width: 180px; text-align: left; }
.scheduler-empty { color: var(--ui-muted); font-size: 12px; padding: 20px 0; text-align: center; }
.scheduler-save-btn { min-width: 110px; }
.scheduler-row-saving td { background: var(--ui-warning-soft) !important; }
.scheduler-row-updated td { background: var(--ui-success-soft) !important; }

/* Shared Control hub / Bridge-style application primitives. */
.pipelines-live-state {
  align-items: center;
  color: var(--ui-muted);
  display: flex;
  flex: 0 0 auto;
  font-size: 12px;
  gap: 8px;
  margin-top: 8px;
}
.pipelines-live-dot {
  background: var(--ui-success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--ui-success-soft);
  height: 8px;
  width: 8px;
}
.pipelines-live-dot.error { background: var(--ui-danger); box-shadow: 0 0 0 4px var(--ui-danger-soft); }

.pipelines-metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}
.pipelines-metric {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  min-width: 0;
  padding: 15px 16px;
}
.pipelines-metric-label { color: var(--ui-muted); font-size: 11px; }
.pipelines-metric-value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.pipelines-metric-detail { color: var(--ui-muted); font-size: 11px; margin-top: 2px; }

.pipelines-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pipelines-toolbar-filters { align-items: center; display: flex; flex: 1; flex-wrap: wrap; gap: 8px; }
.pipelines-search { flex: 1 1 230px; max-width: 420px; }
.pipelines-select { min-width: 150px; }
.pipelines-search,
.pipelines-select,
.pipelines-field input,
.pipelines-field select,
.pipelines-time-grid input {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  color: var(--ui-text);
  font: inherit;
  font-size: 12px;
  min-height: 36px;
  padding: 7px 9px;
}
.pipelines-search:focus,
.pipelines-select:focus,
.pipelines-field input:focus,
.pipelines-field select:focus,
.pipelines-time-grid input:focus { border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-accent-soft); outline: 0; }

.pipelines-section {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  margin-bottom: 18px;
  min-width: 0;
  padding: 16px;
}
.pipelines-section.flat { background: transparent; border: 0; padding: 0; }
.pipelines-section-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.pipelines-section-header { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; margin-bottom: 13px; }
.pipelines-section-header h2 { font-size: 15px; font-weight: 700; margin: 0; }
.pipelines-section-header p { color: var(--ui-muted); font-size: 12px; margin: 4px 0 0; }
.pipelines-section-copy { color: var(--ui-muted); font-size: 12px; line-height: 1.45; margin: 4px 0 0; max-width: 720px; }
.pipelines-section-label { color: var(--ui-text); font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.pipelines-spaced { margin-top: 16px; }

.pipelines-table-shell {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  max-width: 100%;
  overflow: auto;
}
.pipelines-table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 900px;
  width: 100%;
}
.pipelines-table th {
  background: var(--ui-panel-soft);
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
  padding: 0;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.pipelines-table th > button {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  min-height: 40px;
  padding: 10px 12px;
  text-align: left;
  text-transform: inherit;
  width: 100%;
}
.pipelines-table.static-head th { padding: 10px 12px; }
.pipelines-table td {
  border-top: 1px solid var(--ui-line-soft);
  color: var(--ui-text);
  padding: 11px 12px;
  vertical-align: top;
}
.pipelines-table tbody tr:hover td { background: #fbfcfe; }
.pipelines-table .pipelines-empty-row td { color: var(--ui-muted); padding: 26px 12px; text-align: center; }
.pipelines-primary { color: var(--ui-text); font-weight: 650; }
.pipelines-secondary { color: var(--ui-muted); font-size: 11px; line-height: 1.4; margin-top: 3px; }
.pipelines-wrap { overflow-wrap: anywhere; word-break: normal; }
.pipelines-identity-line { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pipelines-machine-role { align-items: center; color: var(--ui-muted); display: inline-flex; flex: 0 0 auto; font-size: 9px; font-weight: 750; gap: 4px; letter-spacing: .04em; line-height: 1; text-transform: uppercase; }
.pipelines-machine-role > span { background: currentColor; border-radius: 50%; height: 6px; width: 6px; }
.pipelines-machine-role.compute { color: var(--ui-compute); }
.pipelines-machine-role.production { color: var(--ui-production); }
.pipelines-machine-role.production > span { border-radius: 1px; transform: rotate(45deg); }

.pipelines-badge {
  background: var(--ui-panel-soft);
  border-radius: 999px;
  color: var(--ui-muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}
.pipelines-badge.success { background: var(--ui-success-soft); color: var(--ui-success); }
.pipelines-badge.warning { background: var(--ui-warning-soft); color: var(--ui-warning); }
.pipelines-badge.danger { background: var(--ui-danger-soft); color: var(--ui-danger); }
.pipelines-badge.accent { background: var(--ui-accent-soft); color: var(--ui-accent); }
.pipelines-pressure { font-weight: 700; white-space: nowrap; }
.pipelines-pressure.success { color: var(--ui-success); }
.pipelines-pressure.warning { color: var(--ui-warning); }
.pipelines-pressure.danger { color: var(--ui-danger); }
.pipelines-resource-list { display: grid; gap: 3px; }

.pipelines-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; }
.pipelines-icon-action {
  align-items: center;
  background: transparent;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  color: var(--ui-muted);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}
.pipelines-icon-action:hover { border-color: #b8c1ce; color: var(--ui-text); }
.pipelines-icon-action.danger:hover { background: var(--ui-danger-soft); border-color: #e7c5c0; color: var(--ui-danger); }
.pipelines-icon-action:disabled { cursor: wait; opacity: .55; }

.pipelines-insights-summary {
  background: var(--ui-panel-soft);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px 13px;
}
.pipelines-insights-summary h3 { font-size: 13px; font-weight: 700; margin: 0; }
.pipelines-insights-summary p { color: var(--ui-muted); font-size: 12px; margin: 5px 0 0; }
.pipelines-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pipelines-chip { background: var(--ui-panel); border-radius: 999px; color: var(--ui-muted); font-size: 11px; padding: 5px 8px; }
.pipelines-chip strong { color: var(--ui-text); }
.pipelines-feed { display: grid; }
.pipelines-feed-item { border-bottom: 1px solid var(--ui-line-soft); padding: 10px 0; }
.pipelines-feed-item:last-child { border-bottom: 0; }
.pipelines-feed-head { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.pipelines-feed-title { font-size: 12px; font-weight: 650; }
.pipelines-feed-copy { color: var(--ui-muted); font-size: 11px; line-height: 1.45; margin-top: 4px; }
.pipelines-empty { color: var(--ui-muted); font-size: 12px; padding: 20px 8px; text-align: center; }

.pipelines-disclosure > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  list-style: none;
}
.pipelines-disclosure > summary::-webkit-details-marker { display: none; }
.pipelines-disclosure > summary::before { content: '›'; transition: transform .15s ease; }
.pipelines-disclosure[open] > summary::before { transform: rotate(90deg); }
.pipelines-disclosure-body { margin-top: 13px; }

.pipelines-notices {
  bottom: 18px;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  position: fixed;
  right: 18px;
  z-index: 110;
}
.pipelines-notice {
  align-items: flex-start;
  background: var(--ui-success-soft);
  border-radius: 9px;
  box-shadow: var(--ui-shadow);
  color: var(--ui-success);
  display: flex;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 12px;
}
.pipelines-notice.danger { background: var(--ui-danger-soft); color: var(--ui-danger); }
.pipelines-notice.warning { background: var(--ui-warning-soft); color: var(--ui-warning); }
.pipelines-notice button { background: transparent; border: 0; color: inherit; font-size: 18px; line-height: 1; padding: 0; }

.pipelines-dialog {
  background: var(--ui-panel);
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(16,24,40,.25);
  color: var(--ui-text);
  max-height: min(86vh, 900px);
  max-width: min(760px, calc(100vw - 28px));
  overflow: auto;
  padding: 20px;
  width: 100%;
}
.pipelines-dialog.wide { max-width: min(1100px, calc(100vw - 28px)); }
.pipelines-dialog::backdrop { background: rgba(16,24,40,.42); }
.pipelines-dialog-head { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 16px; }
.pipelines-dialog-head h2 { font-size: 18px; margin: 0; }
.pipelines-dialog-head p { color: var(--ui-muted); font-size: 12px; margin: 5px 0 0; }
.pipelines-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.pipelines-dialog .danger { background: var(--ui-danger); border-color: var(--ui-danger); color: #fff; }
.pipelines-form-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pipelines-field label { color: var(--ui-muted); display: block; font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.pipelines-field input, .pipelines-field select { width: 100%; }
.pipelines-log { background: #111827; border-radius: 8px; color: #d8e1ec; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 320px; overflow: auto; padding: 12px; white-space: pre-wrap; }
.pipelines-row-dirty td { background: var(--ui-warning-soft) !important; }
.pipelines-dialog-actions.full { grid-column: 1 / -1; }
.pipelines-time-grid { align-items: center; display: grid; gap: 8px; grid-template-columns: repeat(2, max-content); justify-content: start; min-width: 0; }
.pipelines-time-field { align-items: center; color: var(--ui-muted); display: grid; font-size: 10px; font-weight: 700; gap: 6px; grid-template-columns: auto max-content; margin: 0; min-width: 0; }
.pipelines-time-field input { field-sizing: content; inline-size: auto; margin: 0; max-inline-size: 100%; min-inline-size: 0; padding-inline: 7px 2px; }
.pipelines-time-field input::-webkit-calendar-picker-indicator { margin: 0 0 0 4px; padding: 0; }
.pipelines-schedule-actions,
.pipelines-project-actions { align-items: center; display: flex; flex-wrap: nowrap; gap: 5px; width: max-content; }
.pipelines-schedule-actions { margin-left: auto; }
.pipelines-section-toggle { height: 30px; position: absolute; right: 0; top: 0; width: 30px; }
.pipelines-section-toggle i { transition: transform 150ms ease; }
.pipelines-section.is-collapsed > .pipelines-section-heading { margin-bottom: 0; }
.pipelines-section.is-collapsed > :not(.pipelines-section-heading) { display: none; }
.pipelines-section.is-collapsed > .pipelines-section-heading .pipelines-section-toggle i { transform: rotate(-90deg); }

@media (min-width: 801px) {
  .pipelines-body.pipelines-sidebar-collapsed .pipelines-app { grid-template-columns: 0 minmax(0, 1fr); }
  .pipelines-body.pipelines-sidebar-collapsed .pipelines-sidebar { pointer-events: none; visibility: hidden; }
  .pipelines-body.pipelines-sidebar-collapsed .pipelines-topbar-brand { display: inline-flex; }
  .pipelines-body.pipelines-sidebar-collapsed .pipelines-sidebar-open { visibility: visible; }
}

@media (max-width: 1500px) {
  .pipelines-table-shell--scheduler { background: transparent; border: 0; overflow: visible; }
  .pipelines-table--scheduler,
  .pipelines-table--scheduler tbody { display: block; min-width: 0; width: 100%; }
  .pipelines-table--scheduler thead { display: none; }
  .pipelines-table--scheduler tr:not(.pipelines-empty-row) {
    background: var(--ui-panel);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-bottom: 10px;
  }
  .pipelines-table--scheduler tr:not(.pipelines-empty-row) td {
    border: 0;
    border-top: 1px solid var(--ui-line-soft);
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 10px 12px;
    text-align: left;
  }
  .pipelines-table--scheduler tr:not(.pipelines-empty-row) td::before {
    color: var(--ui-muted);
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    margin-bottom: 5px;
    text-transform: uppercase;
  }
  .pipelines-table--scheduler .pipelines-cell-identity { grid-column: span 4; }
  .pipelines-table--scheduler .pipelines-cell-health { grid-column: span 2; }
  .pipelines-table--scheduler .pipelines-cell-mode,
  .pipelines-table--scheduler .pipelines-cell-state { grid-column: span 3; }
  .pipelines-table--scheduler .pipelines-cell-schedule { grid-column: span 6; }
  .pipelines-table--scheduler .pipelines-cell-reconciliation { grid-column: span 8; }
  .pipelines-table--scheduler .pipelines-cell-actions { grid-column: span 4; }
  .pipelines-table--scheduler tr:not(.pipelines-empty-row) td.pipelines-actions {
    align-content: flex-start;
    display: flex;
    flex-flow: row wrap;
    gap: 8px;
    justify-content: flex-end;
  }
  .pipelines-table--scheduler td.pipelines-actions::before { flex: 0 0 100%; }
}

@media (max-width: 1240px) {
  .pipelines-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipelines-table-shell { background: transparent; border: 0; overflow: visible; }
  .pipelines-table, .pipelines-table tbody { display: block; min-width: 0; width: 100%; }
  .pipelines-table thead { display: none; }
  .pipelines-table tr:not(.pipelines-empty-row) {
    background: var(--ui-panel);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
  }
  .pipelines-table tr:not(.pipelines-empty-row) td {
    border: 0;
    border-top: 1px solid var(--ui-line-soft);
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 9px 10px;
    text-align: left;
  }
  .pipelines-table tr:not(.pipelines-empty-row) td::before {
    color: var(--ui-muted);
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    margin-bottom: 4px;
    text-transform: uppercase;
  }
  .pipelines-table tr:not(.pipelines-empty-row) td:last-child,
  .pipelines-table .pipelines-cell-identity,
  .pipelines-table .pipelines-cell-actions { grid-column: 1 / -1; }
  .pipelines-table--scheduler .pipelines-cell-mode,
  .pipelines-table--scheduler .pipelines-cell-schedule,
  .pipelines-table--scheduler .pipelines-cell-reconciliation { grid-column: 1 / -1; }
  .pipelines-table tr:not(.pipelines-empty-row) td.pipelines-actions {
    align-content: flex-start;
    display: flex;
    flex-flow: row wrap;
    gap: 7px;
    justify-content: flex-start;
  }
  .pipelines-table td.pipelines-actions::before { flex: 0 0 100%; }
  .pipelines-schedule-actions { margin-left: 0; }
}

@media (max-width: 800px) {
  .pipelines-app { grid-template-columns: minmax(0, 1fr); }
  .pipelines-sidebar {
    box-shadow: 18px 0 50px rgba(16, 24, 40, .24);
    left: 0;
    max-width: 86vw;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform 160ms ease;
    width: 320px;
  }
  .pipelines-body.pipelines-sidebar-visible .pipelines-sidebar { transform: translateX(0); }
  .pipelines-scrim {
    background: rgba(16, 24, 40, .34);
    border: 0;
    inset: 0;
    padding: 0;
    position: fixed;
    z-index: 29;
  }
  .pipelines-body.pipelines-sidebar-visible .pipelines-scrim { display: block; }
  .pipelines-sidebar-open { visibility: visible; }
  .pipelines-topbar { padding: 8px 10px; }
  .pipelines-page,
  .ops-console { padding: 20px 12px 44px; }
  .pipelines-page-header,
  .ops-page-header { display: block; margin-bottom: 18px; }
  .pipelines-page-actions,
  .ops-live-state { margin-top: 12px; }
  .pipelines-page-actions .btn { flex: 1 1 auto; }
  .pipelines-section-heading,
  .ops-section-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .ops-section-grid,
  .ops-section-grid > *,
  .ops-section,
  .ops-section-heading,
  .ops-section-heading > * { max-width: 100%; min-width: 0; }
  .ops-section { overflow: hidden; }
  .ops-primary,
  .ops-secondary { overflow-wrap: anywhere; }
  .pipelines-section-grid { grid-template-columns: 1fr; }
  .pipelines-toolbar, .pipelines-toolbar-filters { align-items: stretch; flex-direction: column; }
  .pipelines-search, .pipelines-select, .pipelines-toolbar .btn { max-width: none; width: 100%; }
  .pipelines-form-grid { grid-template-columns: 1fr; }
  .pipelines-dialog { padding: 16px; }
}

@media (max-width: 640px) {
  .pipelines-section { padding: 12px; }
  .pipelines-table tr:not(.pipelines-empty-row) { grid-template-columns: minmax(0, 1fr); }
  .pipelines-table tr:not(.pipelines-empty-row) td,
  .pipelines-table--scheduler .pipelines-cell-health,
  .pipelines-table--scheduler .pipelines-cell-state { grid-column: 1 / -1; }
  .pipelines-table tr:not(.pipelines-empty-row) td.pipelines-actions {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .pipelines-icon-action { height: 40px; width: 40px; }
  .pipelines-dialog-actions .btn { flex: 1 1 120px; }
}

@media (max-width: 420px) {
  .pipelines-metric-grid,
  .pipelines-time-grid { grid-template-columns: minmax(0, 1fr); }
  .pipelines-page,
  .ops-console { padding-left: 10px; padding-right: 10px; }
  .pipelines-time-field { grid-template-columns: 24px max-content; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
