/* Urban Pipeline demo. Color carries meaning throughout:
   amber = Workday (source), blue = Drupal (destination),
   violet = queue items, green = approved/published, slate = ignored. */

:root {
  --page: #e8ecf0;
  --ink: #16202a;
  --muted: #56636f;
  --rule: #cdd5dd;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --amber: #a35a00;
  --amber-soft: #fbe9d0;
  --blue: #1b5c9c;
  --blue-soft: #dce8f5;
  --violet: #5843a4;
  --violet-soft: #e9e4f8;
  --green: #22704a;
  --green-soft: #d8efe1;
  --slate: #69747f;
  --slate-soft: #e4e8ec;
  --code-bg: #16202a;
  --code-ink: #dfe6ec;
  --code-key: #f3b46b;
  --shadow: 0 1px 0 rgba(22, 32, 42, 0.04), 0 24px 48px -28px rgba(22, 32, 42, 0.45);
  --sans: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d1319;
    --ink: #e3e9ee;
    --muted: #97a3ae;
    --rule: #28333e;
    --surface: #141c24;
    --surface-2: #1a232d;
    --amber: #f0a64c;
    --amber-soft: #36270f;
    --blue: #80b5ea;
    --blue-soft: #16283b;
    --violet: #b2a2f0;
    --violet-soft: #251f3f;
    --green: #72cd96;
    --green-soft: #132d1e;
    --slate: #8e99a4;
    --slate-soft: #222b34;
    --code-bg: #0a0f14;
    --code-ink: #d3dce4;
    --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
}

a {
  color: var(--blue);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
}

.muted {
  color: var(--muted);
}

.hide {
  opacity: 0;
  transform: translateY(6px);
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

/* Page frame */

.top {
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
  font-size: 15px;
}

.intro {
  padding: 28px 0 28px;
}

.intro h1 {
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 96;
  max-width: 17ch;
  margin: 0 0 18px;
}

.lede {
  max-width: 66ch;
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 44px 0 20px;
}

.notes h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 6px;
}

.notes p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.foot {
  padding: 28px 0 48px;
  font-size: 14px;
  color: var(--muted);
}

/* Player */

.stage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  container: stage / inline-size;
}

.scene-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 24px 0;
}

.scene-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.scene-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.scene {
  position: relative;
  height: 462px;
  padding: 16px 24px 20px;
  overflow: hidden;
  cursor: pointer;
}

.still .scene {
  cursor: default;
}

.scene.enter {
  animation: scene-in 420ms ease both;
}

@keyframes scene-in {
  from {
    opacity: 0;
  }
}

.scene * {
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    background-color 360ms ease,
    border-color 360ms ease,
    color 360ms ease;
  transition-delay: calc(var(--i, 0) * 90ms);
}

.caption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-height: 92px;
  padding: 16px 24px 18px;
  border-top: 1px solid var(--rule);
  background: var(--surface-2);
}

.caption p {
  min-width: 0;
  margin: 0;
  max-width: 64ch;
  font-size: 18px;
  line-height: 1.45;
}

.caption > code {
  flex: none;
  max-width: 44%;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.still-caps {
  margin: 0;
  padding-left: 1.3em;
  display: grid;
  gap: 8px;
  font-size: 16px;
}

.still-caps code {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Cursor */

.cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  margin: -4px 0 0 -6px;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transform: translate(60%, 110%);
  transition:
    transform 800ms cubic-bezier(0.5, 0, 0.2, 1),
    opacity 300ms ease !important;
  transition-delay: 0ms !important;
}

.cursor.on {
  opacity: 1;
}

.cursor svg {
  width: 30px;
  height: 30px;
  fill: var(--ink);
  stroke: var(--surface);
  stroke-width: 1.6;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.cursor::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 0;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  opacity: 0;
}

.cursor.click::after {
  animation: ripple 520ms ease-out both;
}

@keyframes ripple {
  from {
    opacity: 0.9;
    transform: scale(0.3);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

.still .cursor {
  display: none;
}

/* Poster and outro */

.poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(3px);
  z-index: 10;
}

.poster[hidden] {
  display: none;
}

.poster-card {
  max-width: 34rem;
  text-align: center;
}

.poster-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.poster-title {
  margin: 0 0 26px;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.play-big {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font: 600 18px var(--sans);
  cursor: pointer;
}

.play-big svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.play-big .muted {
  color: inherit;
  opacity: 0.7;
  font-weight: 400;
}

.poster-alt {
  display: block;
  margin-top: 16px;
  font-size: 15px;
}

.outro-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 20px;
}

.btn {
  padding: 10px 20px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 16px var(--sans);
  cursor: pointer;
}

/* Controls */

.controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.ctl {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.ctl:hover {
  background: var(--surface);
}

.ctl:disabled {
  opacity: 0.35;
  cursor: default;
}

.ctl svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.ctl-play {
  width: 46px;
  height: 46px;
  background: var(--ink);
  color: var(--surface);
}

.ctl-play:hover {
  background: var(--ink);
}

.ctl-play .i-pause,
.ctl-play.is-playing .i-play {
  display: none;
}

.ctl-play.is-playing .i-pause {
  display: block;
}

.scrub {
  flex: 1;
  display: flex;
  gap: 3px;
  height: 26px;
  align-items: center;
  margin: 0 10px;
  cursor: pointer;
  touch-action: none;
}

.seg {
  flex-basis: 0;
  height: 6px;
  border-radius: 3px;
  background: var(--rule);
  overflow: hidden;
}

.seg i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

.time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 7.5em;
  text-align: right;
}

.still .ctl-play,
.still .scrub {
  display: none;
}

.still .controls {
  justify-content: flex-start;
}

.still .time {
  text-align: left;
  margin-left: 8px;
}

.chapters {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.chapters button {
  display: flex;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  height: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 400 14.5px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

.chapters button:hover {
  background: var(--surface);
}

.chapters button[aria-current] {
  background: var(--surface);
  border-color: var(--rule);
  color: var(--ink);
}

.ch-num {
  font-family: var(--mono);
  font-size: 12px;
}

/* Shared scene parts */

.sys {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.sys-src {
  background: var(--amber-soft);
  color: var(--amber);
}

.sys-dst {
  background: var(--blue-soft);
  color: var(--blue);
}

.side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.side-head code {
  color: var(--muted);
}

.code {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  font: 12.5px/1.55 var(--mono);
  white-space: pre;
  overflow: hidden;
}

/* Simplified Drupal admin window */

.win {
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  height: 100%;
}

.win-bar {
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
}

.url {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  font: 12.5px var(--mono);
  color: var(--muted);
}

.win-body {
  padding: 16px 20px;
  font-size: 14.5px;
}

.win-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
}

.dbtn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.dbtn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--surface);
}

.dbtn.quiet {
  font-size: 13px;
  padding: 4px 10px;
}

.gone {
  display: none !important;
}

/* 1: two rosters */

.twin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  height: 100%;
}

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 12px;
  padding: 6px 12px;
  line-height: 1.3;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--surface);
  position: relative;
}

.side-src .row {
  border-left: 3px solid var(--amber);
}

.side-dst .row {
  border-left: 3px solid var(--blue);
}

.row-name {
  font-weight: 600;
  justify-self: start;
}

.row-title {
  grid-column: 1;
  justify-self: start;
  color: var(--muted);
  font-size: 14px;
}

.row-div {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font: 12.5px var(--mono);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 4px;
}

.drift {
  background: var(--violet-soft);
  color: var(--violet) !important;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--violet-soft);
}

.row.lone {
  border-style: dashed;
}

.flag {
  position: absolute;
  right: 60px;
  top: 50%;
  translate: 0 -50%;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--violet);
  color: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
}

/* 3: load both sides */

.load {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
}

.wire {
  grid-column: 1 / -1;
  justify-self: center;
}

.load-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.load .code {
  font-size: 11.5px;
  line-height: 1.45;
  padding: 10px 14px;
}

.becomes {
  margin: 8px 0 4px;
  font-size: 13.5px;
  color: var(--muted);
}

.objs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.obj {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 13.5px;
}

.obj span {
  font: 12px var(--mono);
  opacity: 0.8;
}

.obj.src {
  background: var(--amber-soft);
  color: var(--amber);
}

.obj.dst {
  background: var(--blue-soft);
  color: var(--blue);
}

/* 4: matching */

.matching {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 28px;
  height: 100%;
}

.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
  display: grid;
  gap: 8px;
  align-content: start;
}

.rules li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--muted);
}

.rules li::before {
  content: counter(rule);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  font: 12px var(--mono);
}

.rules li.on {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface-2);
}

.rules li.on::before {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.rules li.used {
  opacity: 0.55;
}

.match {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-content: start;
}

.mcol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.mcard {
  position: relative;
  display: grid;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.35;
}

.mcard b {
  font-size: 14.5px;
  font-weight: 600;
}

.mcard span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcard i {
  font-style: normal;
  color: var(--violet);
}

.mcard.src {
  border-left: 3px solid var(--amber);
}

.mcard.dst {
  border-left: 3px solid var(--blue);
}

.mcard.matched {
  background: var(--surface-2);
}

.mcard.lone {
  border-style: dashed;
  border-color: var(--violet);
}

.mcard .via {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font: 500 11px/1.7 var(--mono);
}

.mcard.lone .via {
  background: var(--violet);
}

.threads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.thread {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 700ms ease forwards;
}

.thread.loose {
  stroke: var(--violet);
  stroke-width: 2.5;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* 5: differences */

.diffs {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  height: 100%;
}

.cmp {
  position: relative;
  align-self: start;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}

.cmp.dim .cmp-row {
  opacity: 0.35;
}

.cmp-row {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
}

.cmp-head {
  border-top: 0;
  background: var(--surface-2);
}

.cmp-head .sys {
  justify-self: start;
}

.cmp-who {
  font-weight: 600;
  grid-column: 1;
  white-space: nowrap;
}

.cmp-head {
  grid-template-columns: 150px 1fr 1fr;
}

.cmp-head .cmp-who {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmp-row .f {
  color: var(--muted);
  font-size: 13.5px;
}

.cmp-row .a,
.cmp-row .b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmp-row.diff {
  background: var(--violet-soft);
}

.cmp-row.diff .a,
.cmp-row.diff .b {
  color: var(--violet);
  font-weight: 600;
}

.stamp {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  justify-items: center;
  padding: 10px 18px;
  border: 2px solid var(--green);
  border-radius: 10px;
  background: var(--surface);
  color: var(--green);
  rotate: -4deg;
}

.stamp b {
  font-size: 34px;
  line-height: 1;
}

.stamp span {
  font: 11.5px var(--mono);
}

.rail-head {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  font-weight: 600;
}

.count {
  font-family: var(--mono);
  color: var(--violet);
}

.tickets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.ticket {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 14px;
}

.ticket span {
  color: var(--ink);
  opacity: 0.75;
  text-align: right;
}

.ticket.new {
  box-shadow: inset 0 0 0 2px var(--violet);
}

/* 6: tables */

.tables {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 24px;
  height: 100%;
}

.tbl-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.tbl-name {
  margin: 0 0 6px;
  font: 500 13px var(--mono);
}

.tbl table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tbl th {
  text-align: left;
  font: 500 11.5px var(--mono);
  color: var(--muted);
  padding: 4px 8px;
  border-bottom: 1px solid var(--ink);
}

.tbl td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.tbl td:first-child,
.tbl td:nth-child(2) {
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.tbl-side td:nth-child(2) {
  font-family: var(--sans);
  font-size: 12.5px;
}

.tbl-items td:nth-child(3) {
  white-space: nowrap;
  color: var(--violet);
  font-weight: 600;
}

.tbl td code,
.vbo code,
.rev-log code {
  font-size: 0.92em;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--surface-2);
}

.tbl tr.dupe td {
  color: var(--slate);
  text-decoration: line-through;
  text-decoration-color: var(--slate);
}

.tbl tr.dupe td.c-sum {
  text-decoration: none;
  font-style: italic;
}

.tbl tr.more td {
  color: var(--muted);
  font-family: var(--sans);
  font-style: italic;
}

/* 7 and 8: views bulk operations */

.win-vbo .win-body {
  padding: 12px 16px;
}

.filters,
.bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13.5px;
}

.filter {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}

.sel {
  display: inline-block;
  min-width: 9.5em;
  padding: 4px 26px 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a96a1'/%3E%3C/svg%3E")
    no-repeat right 9px center / 9px;
  color: var(--ink);
  font-size: 13.5px;
  white-space: nowrap;
}

.bulk {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.bulk .dbtn {
  padding: 4px 12px;
  font-size: 13.5px;
}

.vbo {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.vbo th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--ink);
}

.vbo td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.vbo th:first-child,
.vbo td:first-child {
  width: 28px;
}

.vbo .c-act {
  white-space: nowrap;
  color: var(--violet);
  font-weight: 600;
}

.vbo .c-sum {
  line-height: 1.4;
}

.done-by {
  color: var(--green);
  font-weight: 600;
}

.vbo tr.out {
  display: none;
}

.vbo tr.checked td {
  background: var(--blue-soft);
}

.cb {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 1.5px solid var(--slate);
  border-radius: 3px;
  vertical-align: middle;
}

tr.checked .cb {
  background: var(--blue)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.5l2.3 2.3L9.5 3.5' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  border-color: var(--blue);
}

.status,
.state {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status[data-s='active'] {
  background: var(--violet-soft);
  color: var(--violet);
}

.status[data-s='approved'],
.state[data-s='published'] {
  background: var(--green-soft);
  color: var(--green);
}

.status[data-s='executed'] {
  background: var(--green);
  color: var(--surface);
}

.status[data-s='ignore'],
.state[data-s='archived'] {
  background: var(--slate-soft);
  color: var(--slate);
}

.state[data-s='draft'] {
  background: var(--amber-soft);
  color: var(--amber);
}

/* 2: dashboard */

.win-dash .win-body {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 20px 26px;
}

.win-dash .win-title {
  margin: 0;
}

.dash-empty {
  margin: 0;
}

.dash-file {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-weight: 600;
}

.file-input {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  min-width: 320px;
}

.fbtn {
  padding: 4px 10px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  font-size: 13.5px;
}

.fname {
  color: var(--muted);
  font-size: 14px;
}

.fname.chosen {
  color: var(--amber);
  font-weight: 600;
}

.import.busy {
  opacity: 0.75;
}

.import.busy::after {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* 9: drafts */

.drafts {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 20px;
  height: 100%;
}

.drafts .win {
  height: auto;
  align-self: start;
}

.content {
  width: 100%;
  border-collapse: collapse;
}

.content th {
  text-align: left;
  font-size: 13px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--ink);
}

.content td {
  padding: 8px;
  border-bottom: 1px solid var(--rule);
}

.content td:first-child {
  font-weight: 600;
}

.pending {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12.5px;
  font-weight: 600;
}

.revs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rev {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
}

.rev-new {
  border-color: var(--amber);
}

.rev-meta {
  color: var(--muted);
  font-size: 13px;
}

.rev-log {
  grid-column: 1 / -1;
  font-size: 13.5px;
}

.rev .publish {
  grid-column: 1 / -1;
  justify-self: start;
}

/* 10: architecture */

.arch {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}

.iface {
  margin: 0 0 8px;
  font: 500 13px var(--mono);
  color: var(--muted);
}

.plugs {
  display: grid;
  gap: 8px;
}

.plug {
  display: grid;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
}

.plug b {
  font-weight: 600;
}

.plug span {
  font: 12px var(--mono);
  color: var(--muted);
}

.plugs:first-child .plug:not(.ghost) {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.plugs:last-child .plug:not(.ghost) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.plug.ghost {
  border-style: dashed;
  border-color: var(--slate);
  background: transparent;
}

.plug.q {
  margin-top: 12px;
  border-color: var(--violet);
  background: var(--violet-soft);
}

.core {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
}

.core-name {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

.steps {
  margin: 0;
  padding-left: 1.4em;
  font: 13px/1.9 var(--mono);
}

.drupal {
  list-style: none;
  margin: 26px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.drupal li {
  display: grid;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.35;
}

.drupal b {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

/* Paused playback freezes CSS animation too. */
.stage.paused .scene * {
  animation-play-state: paused;
}

/* Narrow stage: stack or trim each scene. */

@container stage (max-width: 760px) {
  .scene-head {
    padding: 14px 16px 0;
    flex-direction: column;
    gap: 0;
  }

  .scene-head h2 {
    font-size: 19px;
  }

  .scene {
    height: 540px;
    padding: 12px 16px 16px;
  }

  .caption {
    flex-direction: column;
    gap: 10px;
    min-height: 150px;
    padding: 14px 16px;
  }

  .caption p {
    font-size: 16px;
  }

  .caption > code {
    max-width: 100%;
  }

  .twin {
    gap: 12px;
  }

  .row {
    padding: 6px 8px;
    font-size: 13.5px;
  }

  .row-title {
    font-size: 12px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .row-div,
  .flag.hide {
    display: none;
  }

  .flag {
    position: static;
    translate: none;
    justify-self: start;
    margin-top: 3px;
    font-size: 11px;
  }

  .side-head .muted {
    display: none;
  }

  .load {
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
  }

  .wire {
    font-size: 10px;
    justify-self: stretch;
  }

  .load .xml,
  .load .query {
    display: none;
  }

  .objs {
    grid-template-columns: 1fr;
  }

  .matching {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 12px;
  }

  .rules {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .rules li {
    grid-template-columns: 20px 1fr;
    gap: 6px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .rules li::before {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .match {
    gap: 36px;
  }

  .mcol {
    gap: 6px;
  }

  .mcard {
    padding: 5px 8px;
    min-height: 50px;
    align-content: start;
  }

  .mcard b {
    font-size: 13px;
  }

  .mcard span:not(.via) {
    display: none;
  }

  .mcard .via {
    position: static;
    justify-self: start;
    margin-top: 2px;
    font-size: 10px;
  }

  .diffs {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 14px;
  }

  .cmp-row,
  .cmp-head {
    grid-template-columns: 64px 1fr 1fr;
    gap: 8px;
    padding: 5px 10px;
    font-size: 13px;
  }

  .cmp-head {
    grid-template-columns: 1fr auto auto;
  }

  .cmp-who {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stamp {
    right: 10px;
    bottom: 8px;
    padding: 4px 10px;
  }

  .stamp b {
    font-size: 22px;
  }

  .tickets {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .ticket {
    padding: 4px 8px;
    font-size: 12.5px;
  }

  .ticket span {
    display: none;
  }

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

  .c-sum {
    display: none;
  }

  .tbl-side {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .tbl-items th:nth-child(2),
  .tbl-items td:nth-child(2) {
    display: none;
  }

  .tbl-name {
    font-size: 11.5px;
    overflow-wrap: anywhere;
  }

  .tbl-side tr:nth-child(n + 4):not(.more) {
    display: none;
  }

  .tbl-side td:nth-child(2) {
    white-space: normal;
  }

  .filter.wide {
    display: none;
  }

  .sel {
    min-width: 0;
  }

  .vbo td,
  .vbo th {
    padding: 6px 6px;
  }

  .vbo .c-act {
    white-space: normal;
  }

  .drafts {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 12px;
  }

  .content thead,
  .rev:not(.rev-new) {
    display: none;
  }

  .content td {
    padding: 5px 4px;
    white-space: nowrap;
  }

  .pending {
    margin-left: 4px;
  }

  .win-body {
    padding: 12px 14px;
    font-size: 13.5px;
  }

  .win-title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .win-dash .win-body {
    padding: 14px 16px;
  }

  .file-input {
    min-width: 0;
  }

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

  .core {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 10px 14px;
  }

  .core-name {
    font-size: 18px;
    margin: 0 0 4px;
  }

  .steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: 11.5px;
    line-height: 1.7;
  }

  .plug {
    padding: 6px 10px;
  }

  .plug span {
    font-size: 11px;
  }

  .plug.q {
    margin-top: 8px;
  }

  .drupal {
    display: flex;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 10px;
    gap: 6px 16px;
  }

  .drupal li {
    font-size: 0;
  }

  .drupal b {
    font-size: 13.5px;
  }
}

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

  .notes {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .time {
    min-width: 0;
    font-size: 12px;
  }

  .scrub {
    margin: 0 6px;
  }
}

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

  .ctl {
    width: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene *,
  .scene.enter {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

/* Show PHP's -> as typed. Kept last because the font shorthand above resets it. */
code,
pre,
.code {
  font-variant-ligatures: none;
  font-feature-settings: 'calt' 0, 'liga' 0;
}
