@layer modules {
  /* Deployments: what is serving, across every flow. */
  .deploys-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.6rem; }
  .deploys-bar .display, .deploys-bar .sub { margin: 0; }
  .deploys-bar .sub { margin-top: .6rem; }

  .deploy-flow { display: flex; align-items: center; gap: 1rem; font-size: 1.5rem; font-weight: 600; }
  .deploy-flow a { color: var(--ink); text-decoration: none; }
  .deploy-flow a:hover { text-decoration: underline; }
  .deploy-where { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; white-space: nowrap; }
  .deploy-where::before { content: ""; width: .8rem; height: .8rem; border-radius: 50%; }
  .deploy-where.is-live { color: var(--ok-ink); }
  .deploy-where.is-live::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
  .deploy-where.is-staging::before { background: var(--router); }
  .deploy-version { font-family: var(--mono); font-size: 1.3rem; }
  .deploy-version.is-pickable { display: inline-flex; align-items: center; gap: .6rem; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: var(--r-control); cursor: pointer; }
  .deploy-version.is-pickable:hover { border-color: var(--line-strong); }
  .deploy-version .icon { width: 1.3rem; height: 1.3rem; color: var(--ink-3); }
  .deploy-versions-menu .menu-items { left: 0; right: auto; min-width: 26rem; }
  .deploy-versions-menu .menu-item { white-space: nowrap; }
  /* The table scrolls sideways when it must, which would cut an open menu off. */
  .table-scroll:has(.deploy-versions-menu[open]) { overflow: visible; }
  .deploy-when { color: var(--ink-2); white-space: nowrap; }
  .deploy-when span { display: block; color: var(--ink-3); font-size: 1.25rem; }
  .deploy-speed { display: inline-flex; align-items: center; gap: 1rem; color: var(--ink-2); font-size: 1.3rem; }
  .deploy-speed.is-quiet { color: var(--ink-3); }
  .deploy-speed-now { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .spark { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 1px; width: 8.4rem; height: 2.2rem; color: var(--router); }
  .spark-bar { height: var(--height); min-height: 1px; background: currentColor; }
  .spark-bar.is-quiet { background: var(--line); }
  .deploy-state { display: inline-flex; align-items: center; gap: .6rem; font-weight: 550; white-space: nowrap; }
  .deploy-state .icon { width: 1.6rem; height: 1.6rem; }
  .deploy-state.is-ok { color: var(--ok-ink); }
  .deploy-state.is-warned { color: var(--warning); }
  .deploy-state.is-waiting { color: var(--ink-3); }
  .deploy-warning { color: var(--warning); font-weight: 550; }
  .deploy-tools .deploy-warning { border-color: transparent; }
  .deploy-tools .deploy-warning:hover { border-color: var(--warning); color: var(--warning); }
  .deploy-tools { display: flex; gap: .8rem; justify-content: flex-end; }
  .deploy-tools a { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: var(--r-control); color: var(--ink-2); font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
  .deploy-tools a:hover, .deploy-tools button:hover { border-color: var(--line-strong); color: var(--ink); }
  .deploy-tools button { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: var(--r-control); background: transparent; color: var(--ink-2); font: inherit; font-size: 1.25rem; white-space: nowrap; cursor: pointer; }
  .deploy-tools .is-danger button, .deploy-tools button.is-danger { color: var(--error); }
  .deploy-tools .icon { width: 1.4rem; height: 1.4rem; }
  .deploy-tools a[target] .icon { color: var(--whatsapp); }
  .deploy-tool-none { padding: .5rem .9rem; color: var(--ink-3); font-size: 1.25rem; white-space: nowrap; }
  .deploy-number { color: var(--ink); font-family: var(--mono); font-size: 1.3rem; }
  .deploys-none { padding: 4rem; border: 1px dashed var(--line-strong); border-radius: var(--r-section); color: var(--ink-2); text-align: center; }

  /* 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; }
  /* A place on several networks: one row per box, since each network is pointed at its own address. */
  .deploy-boxes { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
  .deploy-box { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: baseline; gap: .4rem .8rem; font-size: 1.25rem; }
  .deploy-box-name { display: inline-flex; align-items: center; gap: .4rem; font-weight: 550; white-space: nowrap; }
  .deploy-box-name .icon { width: 1.5rem; height: 1.5rem; flex: none; color: var(--ink-3); }
  .deploy-box-urls { display: grid; gap: .2rem; min-width: 0; }
  .deploy-box-url { overflow-wrap: anywhere; user-select: all; }
  .deploy-box-served { color: var(--ink-3); white-space: nowrap; }
  .deploy-box-served.is-warning { color: var(--warning); }
  @media (max-width: 40rem) { .deploy-box { grid-template-columns: minmax(0, 1fr); } }
  .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); } }
  /* A phone reads each place as a card: flow and where, version and when, then the tools as icons. */
  @media (max-width: 600px) {
    .deploys thead { display: none; }
    .deploys tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1.2rem; padding: 1.2rem 1.6rem; border-bottom: 1px solid var(--line); }
    .deploys.data-table td { display: block; height: auto; padding: 0; border: 0; }
    .deploys td:nth-child(2) { text-align: right; }
    .deploys td:nth-child(5) { display: none; }
    .deploys td:nth-child(6) { grid-column: 1 / -1; margin-top: .6rem; }
    .deploy-tools { justify-content: flex-start; }
    .deploy-tools a span, .deploy-tools button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .deploy-tools a, .deploy-tools button { padding: .6rem .9rem; }
  }
}
