@layer modules {
  /* Versions: publishing gates, what changed, and the list of published versions. */
  .gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
  .gate { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 1rem; }
  .gate p { margin: 0; }
  .gate .hint { margin-top: .2rem; }
  .gate-title { font-weight: 600; }
  .gate-mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.25rem; font-weight: 700; color: var(--on-accent); }
  .gate.is-passed .gate-mark { background: var(--ok); }
  .gate.is-passed .gate-mark::before { content: "✓"; }
  .gate.is-warned .gate-mark { background: var(--warning); }
  .gate.is-warned .gate-mark::before { content: "!"; }
  .gate.is-blocked .gate-mark { background: var(--error); }
  .gate.is-blocked .gate-mark::before { content: "×"; }
  .gate.is-blocked .gate-title { color: var(--error); }
  .changes { display: grid; gap: .8rem; margin: 0; }
  .change { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
  .change dt { font-size: 1.3rem; font-weight: 600; }
  .change dd { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin: 0; }
  .change.is-added dt { color: var(--ok-ink); }
  .change.is-removed dt { color: var(--error); }
  .change.is-removed code { text-decoration: line-through; }
  .change-screen { display: inline-flex; align-items: baseline; gap: .4rem; }
  .change-screen .hint { margin: 0; font-size: 1.15rem; }
  .version-label.is-deployed { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
  /* A tag labels; it does not alarm. Each environment is named by a dot in its own colour, which leaves red to mean something is wrong. */
  .pill.is-env { display: inline-flex; align-items: center; gap: .5rem; border-color: var(--line); background: var(--surface-2); color: var(--ink); font-weight: 600; }
  .pill.is-env::before { content: ""; flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: var(--line-strong); }
  .pill.is-env.is-staging::before { background: var(--router); }
  .pill.is-env.is-live::before { background: var(--ok); }
  .version-dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--live); }
  .version-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
  .version-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 1.2rem; padding: 1rem 1.2rem 1rem 1.4rem; }
  .version-row + .version-row { border-top: 1px solid var(--line); }
  .version-label { justify-self: start; padding: .2rem .8rem; border-radius: var(--r-control); background: var(--surface-2); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 1.3rem; font-weight: 600; }
  .version-row.is-latest .version-label { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); }
  .version-note { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
  .version-meta { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; margin: .2rem 0 0; font-size: 1.25rem; color: var(--ink-3); }
  .version-actions { display: flex; gap: .5rem; }
  .version-actions .button_to { display: inline; }
  /* A runtime command or URL, shown as its own copyable line rather than crammed into a sentence. */
  .deploy-hint { display: grid; gap: .4rem; }
  .deploy-hint .hint { margin: 0; }
  .code-snippet { margin: 0; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface-2); font-family: var(--mono); font-size: 1.25rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; }
  .code-snippet code { padding: 0; border: 0; background: none; font-size: inherit; user-select: all; }
  .version-scenarios { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
  .version-scenarios li { padding: .1rem .8rem; border-radius: 999px; font-size: 1.2rem; }
  .version-scenarios .is-passed { background: var(--ok-soft); color: var(--ok-ink); }
  .version-scenarios .is-failed { background: var(--error-soft); color: var(--error); }
  .version-source .code.is-compact { height: 36rem; }
  .panel-head.is-settings .panel-title { font-family: var(--sans); letter-spacing: 0; }
  .panel-head.is-version { border-top-color: var(--ink); }
  .panel-head.is-version .panel-title, .panel-head.is-import .panel-title { font-family: var(--sans); letter-spacing: 0; }
  @media (max-width: 879px) { .version-row { grid-template-columns: auto minmax(0, 1fr); } .version-actions { grid-column: 1 / -1; } .change { grid-template-columns: minmax(0, 1fr); } }

  /* Deploy: one guided path. A rail of three stages, then the single next thing to do, then where each place stands. */
  .deploy { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 1.6rem 3.2rem; align-items: start; }
  .deploy-main { display: grid; gap: 1.6rem; min-width: 0; }
  @media (max-width: 760px) { .deploy { grid-template-columns: minmax(0, 1fr); } .deploy-rail { position: static; } }

  /* The rail: Publish, Test, Live, joined by a line that fills as far as the flow has travelled. */
  /* After Carbon's vertical progress indicator: a line down the left, blue through what is done and what is next. */
  .deploy-rail { position: sticky; top: 0; margin: 0; padding: 0; list-style: none; }
  .deploy-stage { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; min-height: 6.4rem; padding: 0 0 1.6rem 1.2rem; border-left: 2px solid var(--line-strong); }
  .deploy-stage:last-child { min-height: 0; padding-bottom: 0; }
  .deploy-stage.is-done, .deploy-stage.is-current { border-left-color: var(--focus); }
  .deploy-stage.is-blocked { border-left-color: var(--error); }
  .deploy-stage-mark { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; margin-top: .1rem; border: 1.5px solid var(--ink-3); border-radius: 50%; color: var(--focus); }
  .deploy-stage-mark .icon { width: 1.8rem; height: 1.8rem; }
  .deploy-stage.is-done .deploy-stage-mark, .deploy-stage.is-blocked .deploy-stage-mark { border: 0; }
  .deploy-stage.is-current .deploy-stage-mark { border-color: var(--focus); background: linear-gradient(90deg, var(--focus) 50%, transparent 50%); }
  .deploy-stage.is-blocked .deploy-stage-mark { background: none; color: var(--error); }
  .deploy-stage-text { display: grid; align-content: start; gap: .2rem; }
  .deploy-stage-name { font-size: 1.4rem; line-height: 2rem; color: var(--ink-2); }
  .deploy-stage.is-done .deploy-stage-name { color: var(--ink); }
  .deploy-stage.is-current .deploy-stage-name { color: var(--ink); font-weight: 600; }
  .deploy-stage-note { font-family: var(--mono); font-size: 1.2rem; color: var(--ink-3); overflow-wrap: anywhere; }
  /* Status is a colour and a mark together, never a colour alone: a reader who cannot tell them apart still sees which is which. */
  .deploy-stage-note.is-error, .deploy-stage-note.is-warning { display: flex; align-items: baseline; gap: .5rem; font-family: inherit; }
  .deploy-stage-note.is-error::before, .deploy-stage-note.is-warning::before { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: 1rem; font-weight: 700; line-height: 1.4rem; text-align: center; }
  .deploy-stage-note.is-error { color: var(--error); }
  .deploy-stage-note.is-error::before { content: "!"; background: var(--error); color: var(--on-danger); }
  .deploy-stage-note.is-warning { color: var(--warning); }
  .deploy-stage-note.is-warning::before { content: "!"; background: var(--warning); color: var(--warning-on, #161616); }
  .deploy-stage.is-attention { border-left-color: var(--warning); }
  .deploy-stage.is-attention .deploy-stage-mark { border: 0; color: var(--warning); }
  .deploy-stage.is-attention .deploy-stage-name { color: var(--ink); }

  /* The focus card: the one action, spelled out, with its button beside the words. */
  .deploy-focus { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.2rem 2.4rem; padding: 1.6rem 1.8rem; border: 1px solid var(--line); border-top: 3px solid var(--focus); border-radius: var(--r-card); background: var(--surface); }
  .deploy-focus-text { display: grid; gap: .6rem; }
  .deploy-focus-text .hint { margin: 0; }
  .deploy-focus.is-live { border-top-color: var(--ok); background: var(--ok-soft); }
  .deploy-focus-title { display: flex; align-items: center; gap: .7rem; margin: 0; font-size: 1.7rem; font-weight: 650; letter-spacing: -.01em; }
  .deploy-focus-title .icon { width: 2rem; height: 2rem; color: var(--focus); }
  .deploy-focus.is-live .deploy-focus-title .icon { color: var(--ok-ink); }
  .deploy-focus-body { margin: 0; color: var(--ink-2); font-size: 1.4rem; line-height: 1.5; }
  .deploy-focus > .deploy-action, .deploy-focus > .button_to { justify-self: start; }
  .deploy-action .button_to, .deploy .button_to { display: inline; }
  .deploy-check { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.35rem; color: var(--ink-2); }
  .deploy-check .icon { width: 1.7rem; height: 1.7rem; }
  .deploy-check.is-done { color: var(--ok-ink); }
  .deploy-check.is-todo .deploy-check-mark { color: var(--warning); }
  .deploy-second { margin: 0; }

  /* Where each place stands now: staging and live, side by side, with only the links each needs. */
  .deploy-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr)); gap: .8rem; }
  .deploy-place { position: relative; display: grid; align-content: start; gap: .8rem; padding: 1.2rem 1.4rem 1.3rem 1.8rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
  .deploy-place::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; border-radius: var(--r-card) 0 0 var(--r-card); background: var(--router); }
  /* Live is serving, not an error; red here is kept for what has gone wrong. */
  .deploy-place.is-live::before { background: var(--ok); }
  .deploy-place.is-empty { border-style: dashed; }
  .deploy-place.is-empty::before { opacity: .35; }
  /* What is left before this place answers a caller, which is not the same as a version having arrived. */
  .deploy-ready { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; font-size: 1.35rem; }
  .deploy-ready.is-ok { display: flex; align-items: center; gap: .5rem; color: var(--ok-ink); }
  .deploy-ready-item { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .6rem; color: var(--ink-2); }
  .deploy-ready-item .icon { width: 1.6rem; height: 1.6rem; flex: none; align-self: center; color: var(--warning); }
  .deploy-ready.is-ok .icon { width: 1.6rem; height: 1.6rem; }
  .deploy-ready-item.is-never_dialled .icon { color: var(--ink-3); }
  .deploy-place-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
  .deploy-place-name { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.45rem; font-weight: 650; }
  .deploy-place-name .icon { width: 1.7rem; height: 1.7rem; color: var(--ink-3); }
  .deploy-place-head .hint { margin: 0; }
  .deploy-place-url { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin: 0; font-size: 1.25rem; }
  .deploy-place-url code { overflow-wrap: anywhere; user-select: all; }
  .deploy-place-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
  /* Dial, connect and values are an icon and a word, the whole phrase on hover; rollback keeps its words because they name the version it goes back to. */
  .place-tool { display: inline-flex; align-items: center; gap: .5rem; height: 3.2rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface); color: var(--ink-2); font-size: 1.3rem; font-weight: 550; text-decoration: none; white-space: nowrap; cursor: pointer; transition: border-color .11s ease, color .11s ease; }
  .place-tool:hover { border-color: var(--line-strong); color: var(--ink); }
  /* The values page is where a placeholder variable is fixed, so it carries the warning instead of a link repeating it. */
  .place-tool.is-warning { border-color: var(--warning-line); background: var(--warning-surface); color: var(--warning); }
  /* Rolling a place back is the weightiest thing on the card, so it reads as a button rather than as a link. */
  .place-tool.is-back { margin-left: .8rem; }
  .place-tool.is-danger { border-color: var(--error-line); color: var(--error); }
  .place-tool.is-danger:hover { border-color: var(--error); background: var(--error-soft); }
  .deploy-place-links .button_to { display: inline-flex; }
  .version-menu > summary .icon { display: block; width: 1.6rem; height: 1.6rem; }
  .deploy-versions { margin-top: 1.6rem; }
  .place-tool.is-warning::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--warning); }
  .place-tool .icon { display: block; flex: none; width: 1.6rem; height: 1.6rem; }
  .deploy-place-links .button_to { display: inline; }

  /* Advanced: the full version history and runtime hints, folded away. */
  .deploy-advanced > summary { display: inline-flex; align-items: center; gap: .4rem; font-size: 1.35rem; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
  .deploy-advanced > summary::-webkit-details-marker { display: none; }
  .deploy-advanced > summary .icon { width: 1.5rem; height: 1.5rem; transition: transform .12s ease; }
  .deploy-advanced[open] > summary .icon { transform: rotate(90deg); }
  .deploy-advanced-body { margin-top: 1.2rem; display: grid; gap: 1.2rem; }
  .deploy-first-hint { margin: 0; }
  @media (max-width: 879px) { .deploy-focus { grid-template-columns: minmax(0, 1fr); } }
}
