:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --border: #d7deea;
  --text: #182230;
  --muted: #667085;
  --primary: #155eef;
  --warning: #b54708;
  --ok: #067647;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body {
  background: radial-gradient(900px 500px at 20% -15%, #e5f0ff 0%, var(--bg) 55%);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--text);
}

.form-control:disabled,
.form-select:disabled,
.form-check-input:disabled {
  background: #edf2f7;
  border-color: #cbd5e1;
  color: #98a2b3;
  opacity: 1;
}

.card {
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.release-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #fec84b;
  border-radius: 999px;
  background: #fffaeb;
}

.release-actions-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a2e0e;
}

.structure-mode-status {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  color: #475467;
  background: #f8fafc;
}

.structure-mode-status.on {
  border-color: #a6f4c5;
  color: #05603a;
  background: #ecfdf3;
}

.structure-inline-hint {
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

#sync-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #eef4ff;
  color: #194185;
  font-weight: 600;
}

#sync-status.state-live {
  background: #ecfdf3;
  border-color: #a6f4c5;
  color: #05603a;
}

#sync-status.state-draft {
  background: #fff6ed;
  border-color: #fedf89;
  color: #93370d;
}

.tree-wrap {
  max-height: 72vh;
  overflow: auto;
}

.tree-list-root,
.tree-children {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree-children {
  margin-left: 16px;
  border-left: 1px dashed #c9d7f5;
  padding-left: 8px;
}

.tree-node-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

.tree-node-row:hover {
  background: #eef4ff;
}

.tree-node-row.active {
  border-color: #98b6ff;
  background: #e8f0ff;
}

.tree-node-row.search-hit {
  border-color: #f7b267;
  background: #fff8ed;
}

.tree-node-row.is-unsaved {
  box-shadow: inset 3px 0 0 #fdb022;
}

.tree-expander {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475467;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tree-expander:hover {
  background: #dbe8ff;
}

.tree-expander .fa-chevron-right {
  transition: transform 0.12s ease;
}

.tree-expander[aria-expanded="true"] .fa-chevron-right {
  transform: rotate(90deg);
}

.tree-spacer {
  width: 18px;
  display: inline-block;
}

.tree-drag-handle {
  width: 16px;
  color: #667085;
  cursor: grab;
  display: inline-flex;
  justify-content: center;
}

.tree-drag-handle:active {
  cursor: grabbing;
}

.tree-drag-disabled .tree-drag-handle {
  opacity: 0.25;
  cursor: default;
}

.tree-children-empty {
  min-height: 0;
}

.tree:not(.tree-drag-disabled) .tree-children-empty {
  min-height: 18px;
  margin: 2px 0 0 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
}

.tree-node-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tree:not(.tree-drag-disabled) .tree-node-main {
  cursor: grab;
}

.tree:not(.tree-drag-disabled) .tree-node-main:active {
  cursor: grabbing;
}

.tree-node-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-node-meta {
  color: var(--muted);
  font-size: 11px;
}

.validation,
.diff-summary {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  max-height: 170px;
  overflow: auto;
  font-size: 12px;
}

.validation-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.json-editor {
  min-height: 280px;
}

.validation {
  font-family: var(--mono);
  white-space: normal;
}

.validation-section + .validation-section {
  margin-top: 10px;
}

.validation-heading {
  font-weight: 700;
  font-size: 11px;
  color: #344054;
  margin-bottom: 4px;
}

.validation-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  border: 0;
  background: transparent;
  color: #101828;
  padding: 2px 0;
}

.validation-item.blocking {
  color: #b42318;
}

.validation-item.warning {
  color: #92400e;
}

.validation-item.muted {
  color: #667085;
}

.validation-jump {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.validation-jump:hover,
.validation-jump:focus {
  color: #155eef;
  outline: none;
}

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

.checklist-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.checklist-list label,
.checklist-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  margin: 0;
  flex: 1;
}

.checklist-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #344054;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.publish-validation-jump {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  color: #b42318;
  font-size: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.publish-validation-jump:hover {
  color: #7a1210;
  text-decoration-style: solid;
}

.checklist-link {
  padding: 0;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.publish-review-board {
  display: grid;
  gap: 12px;
}

.publish-review-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fcfcfd;
  padding: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.publish-review-card.is-highlighted {
  border-color: #98b6ff;
  background: #eef4ff;
  box-shadow: 0 0 0 2px rgba(21, 94, 239, 0.08);
}

.publish-review-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.publish-review-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: #475467;
  margin: 8px 0 4px;
}

.publish-review-body {
  font-size: 12px;
}

.publish-review-list {
  margin: 0;
  padding-left: 18px;
}

.publish-review-list li + li {
  margin-top: 4px;
}

.publish-review-empty,
.publish-review-note {
  color: #667085;
}

.diff-summary .pill {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.diff-summary .pill.added { background: #ecfdf3; color: #05603a; border-color: #a6f4c5; }
.diff-summary .pill.removed { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.diff-summary .pill.changed { background: #fff6ed; color: #93370d; border-color: #fedf89; }

.json-editor {
  font-family: var(--mono);
  font-size: 12px;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
}

.preview-modal[aria-hidden="false"] {
  display: block;
}

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 18, 0.5);
}

.preview-modal-dialog {
  position: relative;
  width: min(900px, 92vw);
  max-height: 88vh;
  overflow: auto;
  margin: 5vh auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.preview-modal-dialog.wide {
  width: min(1200px, 95vw);
}

.preview-modal-header,
.preview-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.preview-modal-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.preview-modal-body {
  padding: 12px 14px;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.snapshot-pane {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fcfcfd;
}

.snapshot-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.preview-tree {
  list-style: none;
  padding-left: 12px;
  margin: 0;
}

.preview-tree li {
  margin: 2px 0;
}

.preview-tree.compact {
  max-height: 220px;
  overflow: auto;
}

.preview-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475467;
}

.toast-shell {
  position: fixed;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1200;
}

.toast-item {
  background: #101828;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.25);
}

.toast-item.success { background: #05603a; }
.toast-item.error { background: #b42318; }
.toast-item.warning { background: #93370d; }

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

  .checklist-item {
    flex-direction: column;
    align-items: stretch;
  }
}
