html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  min-height: 100%;
}

:root {
    --app-sidebar-width-expanded: 260px;
    --app-sidebar-width-collapsed: 68px;
    --app-sidebar-width: var(--app-sidebar-width-expanded);
    --app-sidebar-bg: #ffffff;
    --app-sidebar-fg: #1f2937;
    --app-sidebar-muted: #6b7280;
    --app-sidebar-border: #e5e7eb;
    --app-sidebar-hover-bg: #f3f4f6;
    --app-sidebar-active-bg: #e7f1ff;
    --app-sidebar-active-fg: #0b5ed7;
    --app-topstrip-height: 56px;
}

[data-sidebar-state="collapsed"] {
    --app-sidebar-width: var(--app-sidebar-width-collapsed);
}

body.app-shell {
    display: flex;
    flex-direction: row;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.app-shell__content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.app-shell__main {
    flex: 1 0 auto;
    width: 100%;
}

.app-shell__content > .footer {
    margin-top: auto;
}

/* ---------- App Sidebar (primary navigation) ---------- */
.app-sidebar {
    width: var(--app-sidebar-width);
    min-width: var(--app-sidebar-width);
    max-width: var(--app-sidebar-width);
    flex-direction: column;
    background-color: var(--app-sidebar-bg);
    color: var(--app-sidebar-fg);
    border-right: 1px solid var(--app-sidebar-border);
    height: 100vh;
    overflow: visible;
    transition: width 180ms ease, min-width 180ms ease, max-width 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar { transition: none; }
}

.app-sidebar__skip {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1080;
    padding: 0.5rem 0.75rem;
    background: var(--app-sidebar-active-bg);
    color: var(--app-sidebar-active-fg);
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid var(--app-sidebar-border);
    min-height: var(--app-topstrip-height);
}

.app-sidebar__brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    overflow: hidden;
    min-width: 0;
    flex: 1 1 auto;
}

.app-sidebar__brand-link .site-logo {
    height: 32px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 1;
}

.app-sidebar__brand-text {
    /* Logo image already contains the app name; keep for screen readers only. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.app-sidebar__collapse-toggle {
    background: transparent;
    border: 0;
    color: var(--app-sidebar-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-sidebar__collapse-toggle:hover,
.app-sidebar__collapse-toggle:focus-visible {
    background: var(--app-sidebar-hover-bg);
    color: var(--app-sidebar-fg);
}

.app-sidebar__body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

.app-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.app-sidebar__group {
    padding: 0.375rem 0;
}

.app-sidebar__group + .app-sidebar__group {
    border-top: 1px solid var(--app-sidebar-border);
    margin-top: 0.25rem;
    padding-top: 0.625rem;
}

.app-sidebar__group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-sidebar-muted);
    padding: 0 0.875rem 0.25rem;
    margin: 0;
}

.app-sidebar__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0 0.5rem;
    border-radius: 6px;
    color: var(--app-sidebar-fg);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    background: transparent;
    border: 0;
    width: calc(100% - 1rem);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}

.app-sidebar__item:hover,
.app-sidebar__item:focus-visible {
    background: var(--app-sidebar-hover-bg);
    color: var(--app-sidebar-fg);
    text-decoration: none;
}

.app-sidebar__item.is-active {
    background: var(--app-sidebar-active-bg);
    color: var(--app-sidebar-active-fg);
    font-weight: 600;
}

.app-sidebar__icon {
    width: 1.25rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.95rem;
}

.app-sidebar__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 120ms ease;
}

.app-sidebar__empty {
    display: block;
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
    color: var(--app-sidebar-muted);
    font-style: italic;
}

.app-sidebar__footer {
    border-top: 1px solid var(--app-sidebar-border);
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-sidebar__footer .app-sidebar__user {
    padding: 0;
}

/* Make embedded navbar-nav (login partial) look sidebar-native */
.app-sidebar__user .navbar-nav {
    flex-direction: column;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.app-sidebar__user .nav-item {
    width: 100%;
}

.app-sidebar__team-toggle {
    justify-content: flex-start;
}

.app-sidebar__team-toggle.no-team {
    color: #b45309;
}

/* Rotate dropdown chevron when the menu is open (HCI: visible state change) */
.app-sidebar .dropdown-toggle::after {
    transition: transform 180ms ease;
    transform-origin: center;
}

.app-sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar .dropdown-toggle::after { transition: none; }
}

/* ---------- Collapsed rail (desktop) ---------- */
[data-sidebar-state="collapsed"] .app-sidebar .app-sidebar__label,
[data-sidebar-state="collapsed"] .app-sidebar .app-sidebar__group-title {
    opacity: 0;
    flex: 0 0 0;
    width: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
    white-space: nowrap;
}

[data-sidebar-state="collapsed"] .app-sidebar .app-sidebar__brand-link {
    display: none;
}

[data-sidebar-state="collapsed"] .app-sidebar .app-sidebar__empty {
    display: none;
}

[data-sidebar-state="collapsed"] .app-sidebar .app-sidebar__brand {
    justify-content: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

[data-sidebar-state="collapsed"] .app-sidebar .app-sidebar__item {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    gap: 0;
}

[data-sidebar-state="collapsed"] .app-sidebar .dropdown-toggle::after {
    display: none;
}

[data-sidebar-state="collapsed"] .app-sidebar .app-sidebar__group + .app-sidebar__group {
    padding-top: 0.5rem;
}

[data-sidebar-state="collapsed"] #sidebarCollapseToggle i {
    transform: rotate(180deg);
}

/* Don't collapse the offcanvas version — it's always expanded when open */
.app-sidebar--offcanvas {
    width: var(--app-sidebar-width-expanded) !important;
    min-width: var(--app-sidebar-width-expanded) !important;
    max-width: var(--app-sidebar-width-expanded) !important;
    height: 100vh;
}

.app-sidebar--offcanvas .app-sidebar__label,
.app-sidebar--offcanvas .app-sidebar__group-title {
    opacity: 1 !important;
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

.app-sidebar--offcanvas .app-sidebar__brand-link {
    display: flex !important;
}

.app-sidebar--offcanvas .app-sidebar__item {
    justify-content: flex-start !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    gap: 0.75rem !important;
}

.app-sidebar--offcanvas .app-sidebar__empty {
    display: block !important;
}

.app-sidebar--offcanvas .dropdown-toggle::after {
    display: inline-block !important;
}

/* ---------- Narrow-screen top strip ---------- */
.app-topstrip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--app-topstrip-height);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
    background: var(--app-sidebar-bg);
    border-bottom: 1px solid var(--app-sidebar-border);
}

.app-topstrip__toggle {
    font-size: 1.25rem;
    color: var(--app-sidebar-fg);
    padding: 0.375rem 0.625rem;
    text-decoration: none;
}

.app-topstrip__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--app-sidebar-fg);
    font-weight: 600;
}

.app-topstrip__brand .site-logo {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.app-topstrip__brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    body.app-shell {
        flex-direction: column;
    }

    .app-shell__content {
        padding-top: var(--app-topstrip-height);
    }
}
/* ---------- End App Sidebar ---------- */

.workitem-tagging-page {
  min-height: 60vh;
}

/* Sprint page work items scroll container */
.work-items-scroll-container {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
}

.work-items-scroll-container #workItemsTable {
  margin-bottom: 0;
}

.work-items-scroll-container #workItemsTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bs-body-bg, #fff);
  box-shadow: 0 1px 0 var(--bs-border-color, #dee2e6);
}

[data-bs-theme="dark"] .work-items-scroll-container {
  border-color: #495057;
}

[data-bs-theme="dark"] .work-items-scroll-container #workItemsTable thead th {
  background-color: #212529;
  box-shadow: 0 1px 0 #495057;
}

.type-filter-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.assigned-picker {
  display: flex;
  gap: 0.5rem;
}

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  background-color: #e9ecef;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
}

.chip-remove {
  border: none;
  background: transparent;
  margin-left: 0.35rem;
  cursor: pointer;
  line-height: 1;
}

.tag-pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill {
  background-color: #f1f3f5;
  border-radius: 0.5rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
}

.tag-button-group .tag-btn {
  min-width: 64px;
}

.tag-btn--dev {
  border-color: #0d6efd;
  color: #0d6efd;
}

.tag-btn--dev.active,
.tag-btn--dev:disabled {
  background-color: #0d6efd;
  color: #fff;
}

.tag-btn--devops {
  border-color: #6f42c1;
  color: #6f42c1;
}

.tag-btn--devops.active,
.tag-btn--devops:disabled {
  background-color: #6f42c1;
  color: #fff;
}

.tag-btn--ops {
  border-color: #198754;
  color: #198754;
}

.tag-btn--ops.active,
.tag-btn--ops:disabled {
  background-color: #198754;
  color: #fff;
}

.tag-row {
  border-left: 4px solid transparent;
  transition: border-color 0.2s ease;
}

.tag-row--dev {
  border-color: #0d6efd;
}

.tag-row--devops {
  border-color: #6f42c1;
}

.tag-row--ops {
  border-color: #198754;
}

.tag-indicator {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  background-color: #ced4da;
}

.tag-indicator[data-tag="Dev"] {
  background-color: #0d6efd;
}

.tag-indicator[data-tag="DevOps"] {
  background-color: #6f42c1;
}

.tag-indicator[data-tag="Ops"] {
  background-color: #198754;
}

.title-cell {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loading-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: #6c757d;
}

.scroll-sentinel {
  height: 2rem;
}

.toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1050;
}

.tag-toast {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #fff;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tag-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.tag-toast--success {
  background-color: #198754;
}

.tag-toast--danger {
  background-color: #dc3545;
}

.tag-toast--info {
  background-color: #0d6efd;
}

.site-logo {
    height: 32px;
    width: auto;
    display: block;
}

.visually-hidden {
    position: absolute;
    width:1px;height:1px;
    margin:-1px;padding:0;
    overflow:hidden;
    clip:rect(0 0 0 0);
    border:0;
}

.navbar .nav-link.active {
    color: #0d6efd !important;
}

.navbar.sticky-top {
    position: sticky !important;
    top: 0;
    z-index: 1030;
}

.service-card {
    border: 1px solid var(--bs-border-color-translucent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
}

.service-card__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.25rem;
}

.service-team-badge {
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
}

.service-empty-state {
    border-left: 4px solid #0dcaf0;
}

/* ── Delivery Review (MER) Timeline ── */
.mer-container {
    --mer-track-header-height: 28px;
    --mer-epic-row-height: 34px;
    --mer-feature-row-height: 26px;
    --mer-track-gap: 0.75rem;
    display: flex;
    min-height: 60vh;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
}

.mer-sidebar {
    width: 220px;
    overflow-y: auto;
    border-right: 1px solid var(--bs-border-color);
    padding: 2.75rem 0.5rem 0.5rem;
    flex-shrink: 0;
    background: var(--bs-body-bg);
    min-width: 220px;
    max-width: 460px;
}

.mer-sidebar-resize-handle {
    position: relative;
    width: 8px;
    cursor: col-resize;
    flex-shrink: 0;
    background: transparent;
    border-right: 1px solid var(--bs-border-color);
    transition: background-color 0.12s ease;
}

.mer-sidebar-resize-handle::before {
    content: "⋮⋮";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    line-height: 1;
    color: color-mix(in srgb, var(--bs-body-color) 45%, transparent);
    pointer-events: none;
}

.mer-sidebar-resize-handle:hover,
.mer-sidebar-resize-handle:focus-visible {
    background: color-mix(in srgb, var(--bs-primary) 20%, transparent);
    outline: none;
}

.mer-sidebar-resize-handle:hover::before,
.mer-sidebar-resize-handle:focus-visible::before {
    color: color-mix(in srgb, var(--bs-primary) 65%, var(--bs-body-color));
}

body.mer-sidebar-resizing {
    user-select: none;
    cursor: col-resize;
}

.mer-timeline-area {
    flex: 1;
    overflow: auto;
    position: relative;
    min-width: 680px;
}

.mer-timeline-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    height: 40px;
    min-width: 960px;
    overflow: hidden;
}

.mer-timeline-tracks {
    position: relative;
    padding: 0.5rem;
    min-width: 960px;
}

.mer-month-band {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: var(--bs-secondary-color, #6c757d);
    background: color-mix(in srgb, var(--bs-body-bg) 92%, var(--bs-tertiary-bg, #f8f9fa) 8%);
}

.mer-month-band--end {
    border-right: 1px solid var(--bs-border-color);
}

.mer-month-band__label {
    display: inline-block;
    max-width: 100%;
    padding: 0 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 600;
}

.mer-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--bs-border-color);
    font-size: 0.7rem;
    padding-left: 0.25rem;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.15rem;
    background: transparent;
    pointer-events: none;
}

.mer-marker--tick-only {
    padding-left: 0;
    font-size: 0;
    pointer-events: none;
}

.mer-marker--start {
    left: 0 !important;
    z-index: 2;
}

.mer-marker--end {
    left: 100% !important;
    transform: translateX(-100%);
    padding-left: 0;
    padding-right: 0.25rem;
    text-align: right;
    z-index: 2;
}

.mer-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 2px dashed #dc3545;
    z-index: 4;
    pointer-events: none;
}

.mer-track {
    border-left: 4px solid var(--track-color);
    margin-bottom: var(--mer-track-gap);
    padding-left: 0.25rem;
}

/* sidebar tracks must use the same gap so sections stay in phase */
.mer-sidebar-track {
    margin-bottom: var(--mer-track-gap);
}

.mer-track:last-child,
.mer-sidebar-track:last-child {
    margin-bottom: 0;
}

/* ── Track section headers ── */
/* Both must be the same fixed height so no drift accumulates */
.mer-track-header {
    height: var(--mer-track-header-height);
    padding: 0 0.25rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}

.mer-track-title {
    height: var(--mer-track-header-height);
    margin-bottom: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.mer-track-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background-color: var(--track-color);
}

.mer-row {
    position: relative;
    height: var(--mer-epic-row-height);
}

.mer-row--feature {
    height: var(--mer-feature-row-height);
}

.priority-hidden {
    display: none !important;
}

.mer-bar {
    position: absolute;
    border-radius: 4px;
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
    cursor: pointer;
    background-color: var(--track-color);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.mer-bar:hover {
    filter: brightness(1.03);
}

.mer-bar--epic {
    height: 28px;
    line-height: 28px;
    font-weight: 600;
    color: var(--bs-body-color);
}

.mer-bar--feature {
    height: 20px;
    line-height: 20px;
    opacity: 0.86;
    margin-top: 2px;
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .mer-bar--epic {
    color: #fff;
}

[data-bs-theme="dark"] .mer-bar--feature {
    color: #fff;
}

/* ── State-based bar styles ── */
/* Background color intentionally omitted — bars use var(--track-color) to match the track dot. */
.mer-bar--state-removed {
    opacity: 0.7;
}

.mer-bar__state-icon {
    margin-right: 4px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.mer-bar__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mer-bar--epic .mer-bar__state-icon {
    font-size: 0.75rem;
}

/* ── Status badge ── */
.mer-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}
.mer-status-badge--new {
    color: #495057;
    background-color: #e9ecef;
    border-color: #ced4da;
}
.mer-status-badge--active {
    color: #084298;
    background-color: #cfe2ff;
    border-color: #9ec5fe;
}
.mer-status-badge--resolved {
    color: #432874;
    background-color: #e2d9f3;
    border-color: #c4b0e3;
}
.mer-status-badge--closed {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #a3cfbb;
}
.mer-status-badge--removed {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f1aeb5;
}
.mer-status-badge--unknown {
    color: #495057;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

[data-bs-theme="dark"] .mer-status-badge--new {
    color: #dee2e6;
    background-color: #495057;
    border-color: #6c757d;
}
[data-bs-theme="dark"] .mer-status-badge--active {
    color: #9ec5fe;
    background-color: #031633;
    border-color: #084298;
}
[data-bs-theme="dark"] .mer-status-badge--resolved {
    color: #c4b0e3;
    background-color: #1a0e30;
    border-color: #432874;
}
[data-bs-theme="dark"] .mer-status-badge--closed {
    color: #a3cfbb;
    background-color: #051b11;
    border-color: #0f5132;
}
[data-bs-theme="dark"] .mer-status-badge--removed {
    color: #f1aeb5;
    background-color: #2c0b0e;
    border-color: #842029;
}

/* ── Status legend ── */
.mer-status-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    background: var(--bs-body-bg);
}
.mer-status-legend__title {
    font-weight: 600;
    margin-right: 4px;
}

/* ── Hover/focus card ── */
.mer-hover-card {
    position: fixed;
    z-index: 1080;
    max-width: 360px;
    min-width: 220px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 12px;
    font-size: 0.85rem;
    pointer-events: none;
}
.mer-hover-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.mer-hover-card__type {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}
.mer-hover-card__title {
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}
.mer-hover-card__dates {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    margin-bottom: 4px;
}
.mer-hover-card__tags {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-bottom: 4px;
}
.mer-hover-card__summary {
    font-size: 0.78rem;
    color: var(--bs-body-color);
    border-top: 1px solid var(--bs-border-color);
    padding-top: 6px;
    margin-top: 4px;
    line-height: 1.4;
}

/* ── Sidebar item rows ── */
/* Must mirror .mer-row / .mer-row--feature heights exactly */
.mer-sidebar-items {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.9rem;
}

.mer-sidebar-item {
    height: var(--mer-epic-row-height);
    margin: 0;
    display: flex;
    align-items: center;
}

.mer-sidebar-item--feature {
    height: var(--mer-feature-row-height);
    padding-left: 1rem;
}

.mer-sidebar-item label {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
}

.mer-team-dropdown {
    min-width: 220px;
}

.mer-team-badge {
    display: inline-flex;
    align-items: center;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.mer-unscheduled {
    margin: 0.75rem 0.5rem 0.75rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-left: 4px solid var(--bs-info);
    border-radius: 0.5rem;
    background-color: rgba(13, 202, 240, 0.05);
    box-shadow: inset 0 0 0 1px rgba(13, 202, 240, 0.08);
}

.mer-unscheduled summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.6rem 0.75rem 0.6rem 1.1rem;
    border-bottom: 1px solid transparent;
    list-style-position: inside;
}

.mer-unscheduled[open] summary {
    border-bottom-color: var(--bs-border-color);
}

.mer-unscheduled #unscheduledContent {
    padding: 0.55rem 0.75rem 0.75rem 1.3rem;
}

.mer-unscheduled #unscheduledContent ul {
    padding-left: 1rem;
    margin-bottom: 0;
}

.mer-unscheduled #unscheduledContent li + li {
    margin-top: 0.2rem;
}

.mer-timeline-area, .mer-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(108, 117, 125, 0.35) transparent;
}

.mer-timeline-area::-webkit-scrollbar,
.mer-sidebar::-webkit-scrollbar {
    height: 0.5rem;
    width: 0.5rem;
}

.mer-timeline-area::-webkit-scrollbar-track,
.mer-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.mer-timeline-area::-webkit-scrollbar-thumb,
.mer-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(108, 117, 125, 0.28);
    border-radius: 999px;
}

.mer-timeline-area:hover::-webkit-scrollbar-thumb,
.mer-sidebar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(108, 117, 125, 0.4);
}

.service-page-tabs .nav-link {
    font-weight: 500;
}

.service-page-tabs .nav-link.active {
    color: #0d6efd;
}

.service-lookback-toggle .btn {
    min-width: 4rem;
}

/* Filter dropdowns */
.service-filter-dropdown {
    min-width: 14rem;
}

.service-filter-check {
    padding-block: 0.15rem;
}

.service-filter-toggle {
    font-size: 0.8125rem;
}

.service-filter-count {
    font-size: 0.65rem;
    vertical-align: middle;
}

.service-filter-apply {
    min-width: 4rem;
}

.service-facet-filter-dropdown {
    min-width: 24rem;
}

/* Rule builder rows */
.service-facet-rule-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.service-facet-rule-row .form-select {
    flex: 1;
    min-width: 0;
}

.service-facet-rule-sep {
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    flex-shrink: 0;
}

.service-facet-rule-sep--exclude {
    /* reserved for future exclude-specific styling */
}

.service-facet-rule-remove {
    flex-shrink: 0;
    line-height: 1;
}

.service-facet-rule-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
}

/* Chip-select: tag input component */
.service-chip-select {
    position: relative;
    flex: 1;
    min-width: 0;
}

.service-chip-select__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    min-height: 2rem;
    cursor: pointer;
    background: var(--bs-body-bg, #fff);
    align-items: center;
}

.service-chip-select__chips:empty::after {
    content: "Click to add…";
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.75rem;
}

.service-chip-select__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.3em 0.65em;
    border-radius: 999px;
    line-height: 1;
}

.service-chip-select__chip-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.85em;
    line-height: 1;
}

.service-chip-select__chip-remove:hover {
    opacity: 1;
}

.service-chip-select__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-top: 0;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
    padding: 0.25rem 0;
}

.service-chip-select.open .service-chip-select__dropdown {
    display: block;
}

.service-chip-select__option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.service-chip-select__option:hover {
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.service-chip-select__option-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-facet-mode-select {
    font-size: 0.75rem;
    padding: 0.15rem 1.5rem 0.15rem 0.4rem;
    min-width: 3.5rem;
}

.service-section-card .card-header {
    background-color: transparent;
}

.service-run-summary__meta {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
}

.service-status-badge {
    --service-status-bg: #f7f8fa;
    --service-status-border: #e3e6eb;
    --service-status-color: #667085;
    background-color: var(--service-status-bg) !important;
    border: 1px solid var(--service-status-border);
    color: var(--service-status-color) !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.3em 0.65em;
    line-height: 1;
    border-radius: 999px;
}

.service-status-badge--success {
    --service-status-bg: #eaf7ef;
    --service-status-border: #cfe8d7;
    --service-status-color: #2f6b46;
}

.service-status-badge--danger {
    --service-status-bg: #fcedef;
    --service-status-border: #f4cdd3;
    --service-status-color: #8c3b4a;
}

.service-status-badge--warning {
    --service-status-bg: #fff6e8;
    --service-status-border: #f6e2bf;
    --service-status-color: #8a6733;
}

.service-status-badge--progress {
    --service-status-bg: #eaf3ff;
    --service-status-border: #cfdfff;
    --service-status-color: #315f9e;
}

.service-status-badge--pending {
    --service-status-bg: #eef1ff;
    --service-status-border: #d9def7;
    --service-status-color: #495b93;
}

.service-status-badge--neutral {
    --service-status-bg: #f7f8fa;
    --service-status-border: #e3e6eb;
    --service-status-color: #667085;
}

.service-status-badge--unavailable {
    --service-status-bg: #eef2f6;
    --service-status-border: #d7dee7;
    --service-status-color: #526071;
}

/* Pipeline accordion */
.service-pipeline-accordion {
    display: flex;
    flex-direction: column;
}

.service-pipeline-accordion__item {
    border-top: 1px solid var(--bs-border-color-translucent);
    padding-block: 0.65rem;
}

.service-pipeline-accordion__item:first-child {
    border-top: 0;
    padding-top: 0;
}

.service-pipeline-accordion__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    width: 100%;
    padding: 0.4rem 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 0.35rem;
    transition: background-color 0.15s ease;
}

.service-pipeline-accordion__header:hover:not([disabled]) {
    background-color: rgba(0, 0, 0, 0.03);
}

.service-pipeline-accordion__header[disabled] {
    cursor: default;
}

.service-pipeline-accordion__name {
    font-weight: 600;
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
}

.service-pipeline-accordion__icon {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.75rem;
    margin-left: auto;
    transition: transform 0.18s ease;
}

.service-pipeline-accordion__header:not(.collapsed) .service-pipeline-accordion__icon {
    transform: rotate(180deg);
}

.service-pipeline-accordion__body {
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
}

.service-deployments-table {
    table-layout: fixed;
}

.service-deployments-table__col--recent-runs {
    width: 40%;
}

.service-deployments-table__col--critical-stages {
    width: 20%;
}

.service-deployments-table__col--overall-result {
    width: 20%;
}

.service-deployments-table__col--critical-params {
    width: 20%;
}

/* Critical parameters inline display */
.service-critical-params {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.service-critical-params__item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.3em 0.65em;
    border-radius: 999px;
    background-color: var(--service-status-bg, #f7f8fa);
    border: 1px solid var(--service-status-border, #e3e6eb);
    color: var(--service-status-color, #667085);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.service-critical-params__name {
    white-space: nowrap;
}

.service-critical-params__name::after {
    content: ":";
}

.service-critical-params__value {
    overflow-wrap: anywhere;
}

.service-deployments-table td {
    padding-block: 0.9rem;
}

.service-run-summary {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.service-run-summary__title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.service-run-summary__link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
    align-self: flex-start;
}

.service-run-summary__link:hover,
.service-run-summary__link:focus {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
}

.service-critical-state {
    min-width: 0;
}

.service-critical-state__summary-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
}

.service-critical-state__meta {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.service-stage-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Facet summary (table cell) */
.service-facet-summary {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.service-facet-summary__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-facet-summary__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #6c757d);
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Facet groups (drawer) */
.service-facet-drawer-group {
    padding-block: 0.6rem;
}

.service-facet-drawer-group + .service-facet-drawer-group {
    border-top: 1px solid rgba(108, 117, 125, 0.12);
}

.service-facet-drawer-group__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.service-facet-drawer-group__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.service-stage-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-left: 0.15rem;
    padding-inline: 0;
    text-decoration: none;
    white-space: nowrap;
    opacity: 0.8;
}

.service-stage-trigger__icon {
    font-size: 0.7rem;
}

.service-stage-trigger:hover,
.service-stage-trigger:focus {
    text-decoration: underline;
    opacity: 1;
}

.service-status-legend-trigger {
    white-space: nowrap;
    font-weight: 600;
    text-decoration: none;
}

.service-status-legend-trigger:hover,
.service-status-legend-trigger:focus {
    text-decoration: underline;
}

.service-stage-offcanvas {
    --bs-offcanvas-width: min(36rem, 92vw);
    --service-stage-offcanvas-stack-gap: 1.0rem;
    --service-stage-offcanvas-summary-gap: 0.75rem;
    --service-stage-offcanvas-section-padding: 1rem;
    --service-stage-offcanvas-section-title-gap: 0.35rem;
    --service-stage-offcanvas-section-body-gap: 0.8rem;
    --service-stage-offcanvas-row-padding: 0.8rem;
    --service-stage-offcanvas-first-row-padding: 0.25rem;
    --service-stage-offcanvas-bottom-padding: 0.5rem;
}

.service-stage-offcanvas__content {
    display: flex;
    flex-direction: column;
    gap: var(--service-stage-offcanvas-stack-gap);
    padding-bottom: var(--service-stage-offcanvas-bottom-padding);
}

.service-stage-offcanvas__meta {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.9rem;
}

.service-stage-offcanvas__summary {
    display: flex;
    flex-direction: column;
    gap: var(--service-stage-offcanvas-summary-gap);
}

.service-stage-offcanvas__summary-meta,
.service-stage-offcanvas__summary-note,
.service-stage-offcanvas__content > .alert {
    margin-bottom: 0;
}

.service-stage-offcanvas__summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-stage-offcanvas__section {
    border-top: 1px solid var(--bs-border-color-translucent);
    padding-block: var(--service-stage-offcanvas-section-padding) 0;
}

.service-stage-offcanvas__section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem 1rem;
}

.service-stage-offcanvas__section-title {
    display: flex;
    flex-direction: column;
    gap: var(--service-stage-offcanvas-section-title-gap);
}

.service-stage-offcanvas__section-heading {
    color: var(--bs-body-color);
    font-size: 1rem;
    font-weight: 600;
}

.service-stage-offcanvas__caption {
    color: var(--bs-secondary-color, #6c757d);
    display: block;
    font-size: 0.875rem;
    max-width: 32rem;
}

.service-stage-offcanvas__section-toggle {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: inherit;
    text-align: left;
    transition: box-shadow 0.18s ease;
}

.service-stage-offcanvas__section-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.18);
}

.service-stage-offcanvas__section-toggle-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
}

.service-stage-offcanvas__count {
    align-self: flex-start;
}

.service-stage-offcanvas__section-icon {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.8rem;
    transition: transform 0.18s ease;
}

.service-stage-offcanvas__section-toggle.collapsed .service-stage-offcanvas__section-icon {
    transform: rotate(-90deg);
}

.service-stage-offcanvas__section-body {
    margin-top: var(--service-stage-offcanvas-section-body-gap);
}

.service-stage-offcanvas__section-toggle.collapsed .service-stage-offcanvas__caption {
    display: none;
}

.service-status-legend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-status-legend__section + .service-status-legend__section {
    border-top: 1px solid var(--bs-border-color-translucent);
    padding-top: 1rem;
}

.service-status-legend__section-heading {
    color: var(--bs-body-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
}

.service-status-legend__section-toggle {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: inherit;
    text-align: left;
    transition: box-shadow 0.18s ease;
}

.service-status-legend__section-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.18);
}

.service-status-legend__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.service-status-legend__section-icon {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.8rem;
    transition: transform 0.18s ease;
}

.service-status-legend__section-toggle.collapsed .service-status-legend__section-icon {
    transform: rotate(-90deg);
}

.service-status-legend__section-description {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
    max-width: 50rem;
}

.service-status-legend__list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.service-status-legend__item {
    display: grid;
    grid-template-columns: minmax(8.5rem, auto) minmax(0, 1fr);
    gap: 0.85rem 1rem;
    align-items: flex-start;
}

.service-status-legend__badge,
.service-status-legend__content {
    min-width: 0;
}

.service-status-legend__item-title {
    color: var(--bs-body-color);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.service-status-legend__item-note {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .service-status-legend__item {
        grid-template-columns: 1fr;
    }
}

.service-stage-list,
.service-parameter-list {
    border-top: 0;
    background-color: transparent;
}

.service-parameter-list__item,
.service-stage-list__item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    border: 0;
    background-color: transparent;
    border-top: 1px solid rgba(108, 117, 125, 0.12);
    padding-top: var(--service-stage-offcanvas-row-padding);
    padding-bottom: var(--service-stage-offcanvas-row-padding);
}

.service-parameter-list__item:first-child,
.service-stage-list__item:first-child {
    border-top: 0;
    padding-top: var(--service-stage-offcanvas-first-row-padding);
}

.service-parameter-list__item {
    align-items: flex-start;
}

.service-stage-list__item {
    align-items: center;
}

.service-parameter-list__name {
    color: var(--bs-body-color);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.service-parameter-list__value {
    color: var(--bs-secondary-color, #6c757d);
    font-family: var(--bs-font-monospace);
    max-width: min(18rem, 60%);
    text-align: right;
    overflow-wrap: anywhere;
}

.service-timeline-shell {
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(108, 117, 125, 0.35) transparent;
}

.service-timeline-shell::-webkit-scrollbar {
    height: 0.5rem;
}

.service-timeline-shell::-webkit-scrollbar-track {
    background: transparent;
}

.service-timeline-shell::-webkit-scrollbar-thumb {
    background-color: rgba(108, 117, 125, 0.28);
    border-radius: 999px;
}

.service-timeline-shell:hover::-webkit-scrollbar-thumb {
    background-color: rgba(108, 117, 125, 0.4);
}

.service-timeline-content {
    min-width: 720px;
    padding-inline-start: 0.75rem;
    padding-inline-end: 1.25rem;
}

.service-timeline {
    position: relative;
    height: 12px;
    border-top: 2px solid var(--bs-border-color-translucent);
    margin-bottom: 1rem;
}

.service-timeline__marker {
    position: absolute;
    top: -0.85rem;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
    color: var(--bs-secondary-color, #6c757d);
}

.service-timeline__marker--start {
    transform: translateX(0);
    text-align: left;
}

.service-timeline__marker--end {
    transform: translateX(-100%);
    text-align: right;
}

.service-timeline-group + .service-timeline-group {
    margin-top: 1.25rem;
}

.service-timeline-row {
    margin-bottom: 1rem;
}

.service-timeline-row__toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    width: 100%;
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 0.35rem;
    transition: background-color 0.15s ease;
}

.service-timeline-row__toggle:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.service-timeline-row__icon {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.65rem;
    margin-left: auto;
    transition: transform 0.18s ease;
}

.service-timeline-row__toggle:not(.collapsed) .service-timeline-row__icon {
    transform: rotate(180deg);
}

.service-timeline-row__title {
    min-width: 12rem;
}

.service-timeline-row__empty {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
}

.service-timeline-facet-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.service-timeline-facet-row__label {
    min-width: 5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #6c757d);
    padding-top: 0.25rem;
    white-space: nowrap;
}

.service-timeline-facet-row .service-timeline-bars {
    flex: 1;
    min-width: 0;
    border-top: 0;
}

.service-timeline-bars {
    position: relative;
    min-height: 2.15rem;
    border-top: 2px solid var(--bs-border-color-translucent);
    overflow: hidden;
}

.service-timeline-bar {
    position: absolute;
    top: 0.25rem;
    height: 1.35rem;
    border-radius: 999px;
    padding: 0 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    overflow: hidden;
    white-space: nowrap;
    background-color: var(--bar-light);
    box-shadow: inset 0 0 0 1px rgba(51, 65, 85, 0.12);
}

.service-timeline-bar span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dark mode overrides */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
}

[data-bs-theme="dark"] .navbar {
    background-color: #2b3035 !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .nav-link.text-dark {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .nav-link.text-dark.active {
    color: #6ea8fe !important;
}

/* ── PR Watch page ── */
.pr-watch-scroll-container {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
}

.pr-watch-scroll-container #prTable {
    margin-bottom: 0;
}

.pr-watch-scroll-container #prTable thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bs-body-bg, #fff);
    box-shadow: 0 1px 0 var(--bs-border-color, #dee2e6);
}

[data-bs-theme="dark"] .pr-watch-scroll-container {
    border-color: #495057;
}

[data-bs-theme="dark"] .pr-watch-scroll-container #prTable thead th {
    background-color: #212529;
    box-shadow: 0 1px 0 #495057;
}

.pr-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.pr-sortable::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 0.4rem;
    font-size: 0.7em;
    opacity: 0.35;
}

.pr-sortable.pr-sort-asc::after {
    content: '\f0de';
    opacity: 1;
}

.pr-sortable.pr-sort-desc::after {
    content: '\f0dd';
    opacity: 1;
}

.pr-row--new {
    background-color: rgba(13, 202, 240, 0.08) !important;
}

[data-bs-theme="dark"] .pr-row--new {
    background-color: rgba(13, 202, 240, 0.15) !important;
}

.pr-badge--new {
    display: inline-block;
    background-color: #0dcaf0;
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    border-radius: 999px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pr-row--teammate {
    border-left: 4px solid #0d6efd;
}

[data-bs-theme="dark"] .pr-row--teammate {
    border-left-color: #6ea8fe;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #343a40;
    border-color: #495057;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #dee2e6;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #495057;
    color: #fff;
}

[data-bs-theme="dark"] .filter-chip {
    background-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .tag-pill {
    background-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .footer {
    background-color: #2b3035;
    border-color: #495057 !important;
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .footer a {
    color: #6ea8fe !important;
}

[data-bs-theme="dark"] .card {
    background-color: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .service-card__icon {
    background-color: rgba(110, 168, 254, 0.12);
    color: #6ea8fe;
}

[data-bs-theme="dark"] .service-pipeline-accordion__header:hover:not([disabled]) {
    background-color: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .service-timeline-row__toggle:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .service-pipeline-accordion__item {
    border-top-color: #495057;
}

[data-bs-theme="dark"] .service-team-badge {
    background-color: #343a40 !important;
    color: #dee2e6 !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .service-page-tabs .nav-link {
    color: #dee2e6;
}

[data-bs-theme="dark"] .service-page-tabs .nav-link.active {
    background-color: #2b3035;
    border-color: #495057 #495057 transparent;
    color: #6ea8fe;
}

[data-bs-theme="dark"] .service-run-summary__meta {
    color: #adb5bd;
}

[data-bs-theme="dark"] .service-run-summary__link:hover,
[data-bs-theme="dark"] .service-run-summary__link:focus {
    color: #6ea8fe;
    border-bottom-color: #6ea8fe;
}

[data-bs-theme="dark"] .service-critical-state__meta,
[data-bs-theme="dark"] .service-stage-offcanvas__meta,
[data-bs-theme="dark"] .service-stage-offcanvas__caption {
    color: #adb5bd;
}

[data-bs-theme="dark"] .service-status-badge--success {
    --service-status-bg: rgba(25, 135, 84, 0.18);
    --service-status-border: rgba(25, 135, 84, 0.32);
    --service-status-color: #98e2b4;
}

[data-bs-theme="dark"] .service-status-badge--danger {
    --service-status-bg: rgba(220, 53, 69, 0.18);
    --service-status-border: rgba(220, 53, 69, 0.32);
    --service-status-color: #ffb3bd;
}

[data-bs-theme="dark"] .service-status-badge--warning {
    --service-status-bg: rgba(255, 193, 7, 0.16);
    --service-status-border: rgba(255, 193, 7, 0.28);
    --service-status-color: #ffe08a;
}

[data-bs-theme="dark"] .service-status-badge--progress {
    --service-status-bg: rgba(13, 110, 253, 0.18);
    --service-status-border: rgba(13, 110, 253, 0.32);
    --service-status-color: #a9c8ff;
}

[data-bs-theme="dark"] .service-status-badge--pending {
    --service-status-bg: rgba(99, 102, 241, 0.18);
    --service-status-border: rgba(165, 180, 252, 0.28);
    --service-status-color: #c7d2fe;
}

[data-bs-theme="dark"] .service-status-badge--neutral {
    --service-status-bg: rgba(248, 249, 250, 0.06);
    --service-status-border: rgba(222, 226, 230, 0.18);
    --service-status-color: #dee2e6;
}

[data-bs-theme="dark"] .service-status-badge--unavailable {
    --service-status-bg: rgba(173, 181, 189, 0.12);
    --service-status-border: rgba(173, 181, 189, 0.22);
    --service-status-color: #ced4da;
}

[data-bs-theme="dark"] .service-critical-params__item {
    --service-status-bg: rgba(248, 249, 250, 0.06);
    --service-status-border: rgba(222, 226, 230, 0.18);
    --service-status-color: #dee2e6;
}

[data-bs-theme="dark"] .service-stage-trigger {
    color: #6ea8fe;
}

[data-bs-theme="dark"] .service-status-legend-trigger {
    color: #8ab4ff;
}

[data-bs-theme="dark"] .service-status-legend__section + .service-status-legend__section {
    border-top-color: #495057;
}

[data-bs-theme="dark"] .service-status-legend__section-description,
[data-bs-theme="dark"] .service-status-legend__item-note {
    color: #adb5bd;
}

[data-bs-theme="dark"] .service-timeline-shell {
    scrollbar-color: rgba(173, 181, 189, 0.35) transparent;
}

[data-bs-theme="dark"] .service-timeline-shell::-webkit-scrollbar-thumb {
    background-color: rgba(173, 181, 189, 0.25);
}

[data-bs-theme="dark"] .service-timeline-shell:hover::-webkit-scrollbar-thumb {
    background-color: rgba(173, 181, 189, 0.4);
}

[data-bs-theme="dark"] .service-timeline-bar {
    color: #e2e8f0;
    background-color: var(--bar-dark);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .service-stage-offcanvas__section,
[data-bs-theme="dark"] .service-parameter-list,
[data-bs-theme="dark"] .service-stage-list {
    border-color: #495057;
}

[data-bs-theme="dark"] .service-parameter-list__item,
[data-bs-theme="dark"] .service-stage-list__item {
    border-top-color: rgba(222, 226, 230, 0.12);
}

[data-bs-theme="dark"] .service-facet-summary__label {
    color: #adb5bd;
}

[data-bs-theme="dark"] .service-facet-drawer-group + .service-facet-drawer-group {
    border-top-color: rgba(222, 226, 230, 0.12);
}

[data-bs-theme="dark"] .service-facet-drawer-group__label {
    color: #dee2e6;
}

[data-bs-theme="dark"] .service-timeline-facet-row__label {
    color: #adb5bd;
}

[data-bs-theme="dark"] .mer-track {
    border-left-color: var(--track-color-dark);
}

[data-bs-theme="dark"] .mer-bar {
    background-color: var(--track-color-dark);
}

[data-bs-theme="dark"] .mer-unscheduled {
    background-color: rgba(13, 202, 240, 0.08);
    border-color: #495057;
    box-shadow: inset 0 0 0 1px rgba(13, 202, 240, 0.18);
}

[data-bs-theme="dark"] .mer-timeline-area,
[data-bs-theme="dark"] .mer-sidebar {
    scrollbar-color: rgba(173, 181, 189, 0.35) transparent;
}

[data-bs-theme="dark"] .mer-sidebar-resize-handle {
    border-right-color: #495057;
}

[data-bs-theme="dark"] .mer-sidebar-resize-handle::before {
    color: rgba(248, 249, 250, 0.45);
}

[data-bs-theme="dark"] .mer-timeline-area::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .mer-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(173, 181, 189, 0.25);
}

[data-bs-theme="dark"] .mer-timeline-area:hover::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .mer-sidebar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(173, 181, 189, 0.4);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #dee2e6;
    --bs-table-border-color: #495057;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #343a40;
    border-color: #495057;
    color: #dee2e6;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #343a40;
    border-color: #6ea8fe;
    color: #dee2e6;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #adb5bd;
    border-color: #6c757d;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

[data-bs-theme="dark"] .loading-row {
    color: #adb5bd;
}

body.mer-fullscreen-active .app-shell__header,
body.mer-fullscreen-active footer.footer {
    display: none !important;
}

#merContainer:fullscreen {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    padding: 1rem;
    min-height: 100vh;
}

#merContainer:fullscreen .mer-container {
    min-height: calc(100vh - 2rem);
}

[data-bs-theme="dark"] .tag-indicator {
    background-color: #6c757d;
}

[data-bs-theme="dark"] .border-bottom {
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .border-top {
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .box-shadow {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3) !important;
}

/* ── Admin: Team Configuration cards ── */
.admin-team-card {
    transition: box-shadow 0.15s ease;
}

.admin-team-card:hover {
    box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.1) !important;
}

.admin-team-card .card-header {
    background-color: var(--bs-body-tertiary-bg, #f8f9fa);
}

[data-bs-theme="dark"] .admin-team-card .card-header {
    background-color: rgba(255, 255, 255, 0.04);
}

.admin-team-card__meta dt,
.admin-team-card__meta dd {
    line-height: 1.6;
}

/* ── Admin: CodeMirror JSON editor ── */
.admin-json-editor .CodeMirror {
    height: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-json-editor .CodeMirror-scroll {
    min-height: 6rem;
}

[data-bs-theme="dark"] .admin-json-editor .CodeMirror {
    border-color: rgba(255, 255, 255, 0.15);
}

/* ---------- App Sidebar: dark theme ---------- */
[data-bs-theme="dark"] {
    --app-sidebar-bg: #1b1f24;
    --app-sidebar-fg: #e5e7eb;
    --app-sidebar-muted: #9ca3af;
    --app-sidebar-border: #2d333b;
    --app-sidebar-hover-bg: #262d36;
    --app-sidebar-active-bg: #1e3a5f;
    --app-sidebar-active-fg: #8ab4f8;
}

[data-bs-theme="dark"] .app-sidebar__team-toggle.no-team {
    color: #fbbf24;
}


/* Multi-line tooltips for the S360 action items tile (ETA + latest comment on Due date hover). */
.oc-multiline-tooltip .tooltip-inner {
    white-space: pre-line;
    text-align: left;
    max-width: 420px;
    font-size: 0.8125rem;
}
