.page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-surface, #fff);
}

.header {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 68px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
  font-size: 1.25rem;
}

.logo {
  height: 24px;
  width: auto;
}

.logoLockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subBrand {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}

.title {
  font-size: 1.25rem;
  font-weight: 600;
}

.headerDivider {
  width: 1px;
  height: 24px;
  background: var(--color-border, #e5e7eb);
  flex-shrink: 0;
}

.siteName {
  font-size: 1.125rem;
  font-weight: 600;
}

.siteHost {
  font-size: 0.875rem;
  color: var(--color-muted, #6b7280);
}

.headerSpacer {
  flex: 1;
}

.body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.rail {
  width: 18rem;
  border-right: 1px solid var(--color-border, #e5e7eb);
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.railHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}

.railTitle {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted, #6b7280);
}

.railGroupHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 4px;
  color: var(--color-muted, #6b7280);
}

.railGroupTitle {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.row,
.rowSelected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 8px;
  padding: 8px 12px 8px 32px;
  border-radius: 8px;
  cursor: pointer;
}

.rowSelected {
  background: var(--color-surface-secondary, #f3f4f6);
}

.rowSingle,
.rowSingleSelected {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 8px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.rowSingleSelected {
  background: var(--color-surface-secondary, #f3f4f6);
}

.rowSingleLabel {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.rowLabel {
  font-weight: 500;
}

.rowStatus {
  font-size: 0.875rem;
  color: var(--color-muted, #6b7280);
}

.rowConflict :global(.pds-status-indicator__icon) {
  width: 6px;
  height: 6px;
}

.rowConflict :global(.pds-status-indicator__label) {
  font-size: 0.8125rem;
  font-weight: 500;
}

.detail {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 28px;
  background: var(--color-canvas, #fbfbfc);
}

.pageHeaderBlock {
  padding: 2px 4px 8px;
  margin-bottom: 12px;
}

.pageHeader {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pageHeaderTitle {
  font-size: 1.3125rem;
  font-weight: 700;
  color: var(--color-fg-default, #171717);
  letter-spacing: -0.01em;
}

.pageHeaderKind {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-muted, #9a9a9a);
}

.resolvedBanner {
  margin-top: 14px;
}

.detailHeader {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.empty {
  color: var(--color-muted, #6b7280);
  padding: 24px 0;
}

.card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #ececec);
  border-radius: 14px;
  padding: 24px;
}

.cardHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.cardHeaderLeft {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.cardTitle {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--color-fg-default, #171717);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.showChangesToggle:global(.pds-switch) {
  flex-shrink: 0;
  width: auto;
  flex-direction: row-reverse;
  gap: 8px;
}

.panelHeaderRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.panelHeader {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panelSub {
  font-size: 0.75rem;
  color: var(--color-muted, #9a9a9a);
}

.singlePanel .merge-preview-renderer__panel:last-child {
  display: none;
}

.metaTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.metaTable th,
.metaTable td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  text-align: left;
  vertical-align: top;
}

.rowChanged {
  background: var(--color-row-changed, #fefce8);
}

.rowMuted {
  color: var(--color-muted, #6b7280);
}

.thumb {
  max-width: 80px;
  max-height: 60px;
  object-fit: contain;
  border-radius: 4px;
}

.metaCherry {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metaCherryBulk {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 20px;
  border: 1px solid #e6e6ef;
  border-radius: 12px;
  background: #fafafc;
}

.metaCherryBulkText {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metaCherryBulkTitle {
  font-size: 15px;
  font-weight: 700;
  color: #171717;
}

.metaCherryBulkHint {
  font-size: 13px;
  color: #8a8a8a;
}

.metaCherryList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metaCherryKey {
  display: block;
  font-size: 12px;
  color: #8a8a8a;
}

/* Shrinks to fit the switch, so the column sits at the table's right edge
   with its header lined up over the switch. */
.metaCherryKeep {
  width: 1%;
  white-space: nowrap;
}

.metaCherryActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.metaComposed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metaComposed .metaFields {
  margin: 0;
}

.metaComposedHeading {
  font-size: 13px;
  font-weight: 700;
  color: #9a9a9a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metaSourceLive,
.metaSourceWorkstream {
  flex: none;
  margin-inline-start: auto;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metaSourceLive {
  color: #2f6feb;
}

.metaSourceWorkstream {
  color: #a97b0a;
}

.metaFields {
  margin: 0 1rem 1rem;
  border: 1px solid #e6e6ef;
  border-radius: 9px;
  overflow: hidden;
}

.metaField,
.metaFieldChanged {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f3;
  border-left: 3px solid transparent;
}

.metaField:last-child,
.metaFieldChanged:last-child {
  border-bottom: none;
}

.metaFieldChanged {
  background: rgba(232, 185, 35, 0.14);
  border-left-color: #e8b923;
}

.metaFieldLabel {
  flex: none;
  width: 118px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 600;
  color: #8a8a8a;
}

.metaFieldValue {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 500;
  color: #171717;
  word-break: break-word;
}

.metaFieldChanged .metaFieldValue {
  font-weight: 700;
}

.metaImage {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metaImage img {
  display: block;
  width: 180px;
  max-width: 100%;
  aspect-ratio: 40 / 21;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid #e6e6ef;
}

.metaImageUrl {
  font-size: 12px;
  font-weight: 500;
  color: #9a9a9a;
  word-break: break-all;
}

/* ===== Cherry-pick page ===== */

.cpIntro {
  margin: 0;
  padding: 12px 20px;
  font-size: 0.9375rem;
  color: var(--color-muted, #6b6b76);
  background: var(--color-canvas, #f7f7f8);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}

.cpIntroInline {
  margin: -8px 0 20px;
  font-size: 0.9375rem;
  color: var(--color-muted, #6b6b76);
}

.cpBody {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.cpCanvas {
  flex: 1;
  min-width: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  /* Matches .detail's own asymmetric canvas gutter elsewhere on this page
     (top 24px, sides/bottom 28px) rather than a uniform value. */
  padding: 24px 28px 28px;
  background: var(--color-canvas, #f4f4f6);
}

.cpCanvasFrame {
  width: 100%;
  max-width: 1280px;
  background: var(--color-surface, #fff);
  border-radius: 14px;
  border: 1px solid var(--color-border, #e7e7ea);
  box-shadow: 0 1px 3px rgba(20, 20, 30, 0.08), 0 18px 50px rgba(20, 20, 30, 0.12);
  /* Breathing room only; the topmost badge's clipping is prevented by ScaledContent's topOverhang, not this padding, since this padding sits outside ScaledContent's own overflow:hidden box, which clips first. */
  padding: 16px;
  overflow: hidden;
  align-self: flex-start;
}

.cpRail {
  flex: none;
  width: 22.5rem;
  border-left: 1px solid var(--color-border, #ececef);
  overflow-y: auto;
  padding: 20px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cpRailHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cpRailHeading {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-fg-default, #171717);
}

.cpRailBulkCard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cpRailBulkTitle {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-fg-default, #171717);
}

.cpRailAllCard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--color-surface-secondary, #f6f6f7);
  border-radius: 10px;
}

/* PDS's SegmentedButton is content-width by default — force it (and its
   options) to fill the rail so "Live"/"Workstream" split the card evenly. */
.cpRail :global(.pds-segmented-button) {
  display: block;
  width: 100%;
}

.cpRail :global(.pds-segmented-button__track) {
  width: 100%;
}

.cpRail :global(.pds-segmented-button__option) {
  flex: 1;
}

/* The label carries the selected-option pill background but is
   content-width by default, so it floats as a small pill inside its half —
   stretch it to fill the option so the selected side reads as a solid half. */
.cpRail :global(.pds-segmented-button__option label) {
  width: 100%;
  justify-content: center;
}

.cpRailHint {
  font-size: 0.75rem;
  color: var(--color-muted, #9a9aa0);
  margin: 0;
}

.cpRailCard,
.cpRailCardDecided,
.cpRailCardSelected {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--color-border, #e0e0e4);
  border-radius: 10px;
  background: var(--color-surface, #fff);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(20, 20, 30, 0.06);
}

.cpRailCardDecided {
  background: var(--color-surface-secondary, #fafafa);
}

.cpRailCardSelected {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid var(--puck-css-primary, #3b82f6);
  box-shadow: 0 0 0 1px var(--puck-css-primary, #3b82f6);
}

.cpRailCardHeader {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cpRailCombinedBadge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-muted, #8a8a90);
}

.cpRailCardStatus,
.cpRailCardStatusDone {
  flex: none;
  color: #c99a2e;
}

.cpRailCardStatusDone {
  color: var(--color-status-success-foreground, #1f8a4c);
}

.cpRailCardLabel {
  font-weight: 600;
  font-size: 0.875rem;
}

.cpRailCardReason {
  font-size: 0.75rem;
  color: var(--color-muted, #9a9aa0);
  margin: 0;
}

.cpRailParts {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border, #efeff1);
}

.cpRailParts summary {
  color: var(--color-text, #1a1a1e);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.cpRailPartRow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.cpRailPartLabel {
  font-size: 0.8125rem;
  font-weight: 600;
}

.cpRailPartValues {
  font-size: 0.75rem;
  color: var(--color-muted, #8a8a90);
}

/* ===== Go-live summary page ===== */

.summaryBody {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px 40px;
  background: var(--color-canvas, #fbfbfc);
}

.summaryContainer {
  max-width: 900px;
  margin: 0 auto;
}

.summaryWorkstreamLabel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summaryBranchIcon {
  color: var(--color-accent-purple, #7c3aed);
}

.summaryHeading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-fg-default, #171717);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.summarySub {
  font-size: 0.9375rem;
  color: var(--color-muted, #6b7280);
  margin: 0 0 24px;
}

.summaryCard {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #ececec);
  border-radius: 14px;
  overflow: hidden;
}

.summaryRow {
  border-bottom: 1px solid var(--color-border, #ececec);
}

.summaryRow:last-child {
  border-bottom: none;
}

.summaryRowSummary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

.summaryRowSummary::-webkit-details-marker {
  display: none;
}

.summaryRowLeft {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.summaryRowTitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-fg-default, #171717);
}

.summaryRowPath {
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--color-muted, #9a9a9a);
}

.summaryRowRight {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.summaryRowMuted {
  font-size: 0.875rem;
  color: var(--color-muted, #6b7280);
}

.summaryStatusAdded {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-status-success-foreground, #1f8a4c);
}

.summaryStatusDeleted {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-status-critical-foreground, #d1373f);
}

.summaryRowChevron {
  transition: transform 0.15s ease;
}

.summaryRow[open] .summaryRowChevron {
  transform: rotate(180deg);
}

.summaryRowDetail {
  padding: 0 20px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summaryRowDetailLabel {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-muted, #9a9a9a);
}

.summaryRowDetailText {
  font-size: 0.875rem;
  color: var(--color-fg-default, #171717);
}

.summaryModalText {
  margin: 0 0 24px;
  color: var(--color-muted, #6b7280);
}

.summaryModalActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== Go-live deploy pages (progress / result) ===== */

.deployBody {
  flex: 1;
  overflow-y: auto;
  padding: 96px 40px 40px;
  background: var(--color-canvas, #f4f4f5);
}

.deployCard {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #ececec);
  border-radius: 16px;
  padding: 48px;
}

.deployHeading {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--color-fg-default, #171717);
}

.deploySub {
  font-size: 1rem;
  color: var(--color-muted, #6b7280);
  margin: 0 0 28px;
}

.deploySteps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.deployStep {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.125rem;
}

.deployStepIconDone {
  color: var(--color-fg-default, #171717);
}

.deployStepIconActive {
  color: var(--color-accent-blue, #2563eb);
  animation: deploy-spin 1s linear infinite;
}

.deployStepIconPending {
  color: var(--color-border, #d1d5db);
}

.deployStepLabel {
  color: var(--color-fg-default, #171717);
}

.deployStepLabelPending {
  color: var(--color-muted, #9a9a9a);
}

@keyframes deploy-spin {
  to { transform: rotate(360deg); }
}

/* Anchored near the top like .detail/.summaryBody/.deployBody, not centered
   like a modal — same pattern now applied to .deployBody above. */
.deployResultBody {
  flex: 1;
  overflow-y: auto;
  padding: 96px 40px 40px;
  background: var(--color-canvas, #f4f4f5);
}

.deployResult {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  max-width: 520px;
  margin: 0 auto;
}

.deployResultIconSuccess,
.deployResultIconFailure {
  /* Icon's own size="4xl" (2rem) reads small next to this screen's 2.5rem
     heading; scale it up via an existing spacing token, not a bespoke number. */
  width: var(--pds-spacing-4xl, 3rem);
  height: var(--pds-spacing-4xl, 3rem);
}

.deployResultIconSuccess {
  color: var(--color-status-success-foreground, #1f8a4c);
}

.deployResultIconFailure {
  color: var(--color-status-critical-foreground, #d1373f);
}

.deployResultHeading {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-fg-default, #171717);
}

.deployResultSub {
  font-size: 1.0625rem;
  color: var(--color-muted, #6b7280);
  margin: 0;
}

.deployResultFailedList {
  font-size: 0.9375rem;
  color: var(--color-muted, #6b7280);
  margin: 0;
}

.deployResultActions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
