/* DeployBot UI, pages layer: what belongs to one page (deploy page, site page, site setup
   wizard, error pages, dashboard), plus the fallbacks for no backdrop-filter, reduced
   transparency and forced colours, which override glass surfaces set in this layer. */

@layer pages {
  /* ---- deploy page header */

  .deploy-title {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
  }

  .deploy-title .id {
    font-family: var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    font-size: 20px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
  }

  .deploy-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    font-size: var(--text-5);
    color: var(--muted);
    margin-top: var(--space-2);
  }

  .deploy-meta code {
    font-size: var(--text-4);
    color: var(--text);
  }

  .deploy-meta strong {
    color: var(--text);
  }

  /* the run page's facts: a definition list, label over value, wrapping on a phone */
  dl.deploy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-8);
    margin: var(--space-5) 0 0;
  }

  dl.deploy-meta > div {
    display: grid;
    gap: 2px;
  }

  dl.deploy-meta dt {
    font-size: var(--text-3);
    font-weight: 600;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  dl.deploy-meta dd {
    margin: 0;
    color: var(--text);
  }

  .outcome {
    margin-bottom: var(--space-7);
  }

  .step-title .step-state {
    margin-left: auto;
    font-size: var(--text-3);
    color: var(--muted);
  }

  .step.fail .step-state,
  .step.warn .step-state {
    color: var(--tone);
    font-weight: 600;
  }

  .step-body .pre.excerpt {
    margin-top: var(--space-3);
  }

  .rollback-explainer {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
  }

  .rollback-explainer[open] > summary {
    margin-bottom: var(--space-4);
  }

  .log-note {
    padding: var(--space-3) var(--space-6);
  }

  /* ---- site page bits */

  .endpoint {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--raised);
    margin-bottom: var(--space-4);
  }

  .endpoint .name {
    font-size: var(--text-5);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }

  .endpoint .url {
    font-family: var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    font-size: var(--text-2);
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
  }

  .endpoint form {
    margin: 0;
  }

  .endpoint > div {
    min-width: 0;
  }

  .deploy-btn .ref-label {
    font-family: var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    font-weight: 600;
  }

  /* ---- auth shell */

  /* in pages, not layout with the rest of the auth shell: it overrides the margin of .flash, and
     components outrank layout */
  .auth-card .flash {
    margin-bottom: var(--space-7);
  }

  /* reCAPTCHA, after failed sign-ins. Its own inline styles are allowed on the sign-in page
     (SecurityInterceptor's Content-Security-Policy). */
  .auth-card .g-recaptcha {
    margin-bottom: var(--space-7);
  }

  /* ---- site setup wizard */

  .wizard {
    display: grid;
    grid-template-columns: minmax(200px, 220px) minmax(280px, 1fr);
    gap: var(--space-9);
    align-items: start;
  }

  @media (max-width: 720px) {
    .wizard {
      grid-template-columns: 1fr;
    }
  }

  .wizard-steps {
    position: sticky;
    top: var(--sticky-offset);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  .wizard-steps form {
    margin-top: var(--space-5);
  }

  .wizard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  .wizard-then {
    margin-top: var(--space-4);
    padding: 0 var(--space-4);
    font-size: var(--text-3);
    color: var(--muted);
  }

  .wizard-step {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-5);
    color: var(--muted);

    &.current {
      background: var(--surface);
      color: var(--text);
      font-weight: 600;
    }
  }

  .wizard-step a {
    color: inherit;
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }

  .wizard-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    display: inline-grid;
    place-items: center;
    font-size: var(--text-1);
    font-weight: 600;
    flex: none;
  }

  .wizard-step.current .wizard-num {
    border-color: var(--accent);
    color: var(--accent-text);
  }

  .wizard-step.done .wizard-num {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
  }

  /* a narrow screen: the steps are a row of numbers, and only the current one is named */
  @media (max-width: 720px) {
    .wizard-steps {
      position: static;
    }

    .wizard-list {
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
    }

    .wizard-step {
      padding: var(--space-2) var(--space-3);
    }

    .wizard-step:not(.current) .wizard-label {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }

    .wizard-then {
      padding: 0;
    }

    .wizard-steps form {
      margin-top: var(--space-3);
    }

    /* the stacked field grid: the IIS disclosure sits on the Environment field otherwise */
    .wizard-card .field-grid > details {
      margin-bottom: var(--space-5);
    }
  }

  .wizard-card {
    padding: 22px 24px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
  }

  .wizard-card .grow {
    flex: 1;
  }

  .wizard-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    margin-top: 18px;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
  }

  .wizard-foot .btn {
    height: 36px;
  }

  .wizard-card .lead {
    font-size: var(--text-5);
    color: var(--muted);
    margin-bottom: var(--space-6);
  }

  .branches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-3) 0;
  }

  .branches .tag {
    cursor: default;
  }

  .branches .tag:hover {
    border-color: var(--border);
    color: var(--text);
  }

  .branches .tag.configured {
    border-color: var(--ok);
    color: var(--ok);
  }

  /* ---- error pages */

  .error-page h1 {
    margin-bottom: var(--space-3);
  }

  .error-page p {
    font-size: var(--text-5);
    color: var(--muted);
  }

  .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-6);
  }

  .section-head h2 {
    font-size: 17px;
  }

  .row.wrap {
    flex-wrap: wrap;
  }

  .state-more {
    display: grid;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
  }

  #site-state {
    margin-bottom: var(--space-8);
  }

  .form-actions .note {
    font-size: var(--text-4);
    color: var(--muted);
    flex: 1 1 200px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* semantic data tables */
  /* position: relative so the visually hidden (absolute) <caption> is clipped here too */
  .table-scroll {
    overflow-x: auto;
    position: relative;

    &:focus-visible {
      outline: 2px solid var(--focus);
      outline-offset: -2px;
    }
  }

  table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-6);
  }

  table.data th {
    text-align: left;
    font-size: var(--text-2);
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: var(--space-5) var(--space-7);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
  }

  table.data td {
    padding: var(--space-4) var(--space-7);
    border-bottom: 1px solid color-mix(in oklch, var(--text) 5%, transparent);
    vertical-align: top;
    min-width: 0;
  }

  table.data tbody tr:last-child td {
    border-bottom: 0;
  }

  /* a translucent fill: --raised would read as an opaque block on glass */
  table.data tbody tr:hover {
    background: var(--hover-fill);
  }

  table.data .sub {
    display: block;
    font-size: var(--text-4);
    color: var(--muted);
    margin-top: 2px;
  }

  table.data .clamp {
    max-width: 46ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  table.data td.actions {
    text-align: right;
    white-space: nowrap;
  }

  table.data td.actions form {
    margin: 0;
    display: inline;
  }

  table.data code {
    font-size: var(--text-4);
  }

  .more-link {
    margin-top: var(--space-4);
    font-size: var(--text-5);
  }

  /* configuration as native disclosures */
  .disclosure {
    border-radius: 12px;
    margin-bottom: var(--space-4);
  }

  .disclosure > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-6);
    padding: 13px 18px;
    cursor: pointer;
    list-style: none;
  }

  .disclosure > summary::-webkit-details-marker {
    display: none;
  }

  .disclosure > summary::before {
    content: "\25B8";
    color: var(--muted);
    transition: transform .12s;
  }

  .disclosure[open] > summary::before {
    transform: rotate(90deg);
  }

  .disclosure > summary:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
    border-radius: 12px;
  }

  .sum-title {
    font-size: 14.5px;
    font-weight: 600;
  }

  .disclosure > .card {
    border: 0;
    border-top: 1px solid var(--glass-border);
    border-radius: 0 0 12px 12px;
    background: transparent;
    margin: 0;
  }

  .disclosure > .card.mb,
  .disclosure > .mb {
    margin-bottom: 0;
  }

  /* the <summary> already names the section */
  .disclosure .card-head .eyebrow {
    display: none;
  }

  /* ---- dashboard */

  /* sites head: the toolbar, search and status on the left, hide disabled and the count on the right */
  .sites-head {
    margin: 0 0 14px;
  }

  .filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
  }

  .status-field select {
    height: 34px;
    padding: 0 var(--space-5);
    font-size: var(--text-5);
  }

  /* a sortable header: the whole label is the link; the arrow shows the current order, and
     faintly on hover the order a click gives */
  .th-sort {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: inherit;

    &:hover {
      color: var(--text);
      text-decoration: none;
    }
  }

  .th-sort .sort-mark {
    font-size: .8em;
    opacity: 0;
  }

  .th-sort:is(:hover, :focus-visible) .sort-mark {
    opacity: .5;
  }

  th[aria-sort] .th-sort {
    color: var(--text);
  }

  th[aria-sort] .sort-mark,
  th[aria-sort] .th-sort:is(:hover, :focus-visible) .sort-mark {
    opacity: 1;
  }

  /* the site's address beside its name: opens it in a new tab */
  .ext-link {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 24px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: var(--text-5);

    &:hover {
      color: var(--text);
      background: var(--hover-fill);
      text-decoration: none;
    }
  }

  /* the branch line over the version line */
  .code-cell .branch {
    display: flex;
  }

  .code-cell .branch.version {
    margin-top: 2px;
    color: var(--muted);
  }

  .code-cell .mark {
    margin-left: var(--space-1);
    font: 600 var(--text-3) var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    cursor: help;
  }

  /* the .env cell: a glyph on the tone's tint, explained by its title and its hidden words */
  .env-chip {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: var(--text-3);
    font-weight: 700;
    color: var(--muted);
    cursor: help;
  }

  .env-chip:is(.ok, .warn) {
    color: var(--tone);
    background: color-mix(in oklch, var(--tone) 14%, transparent);
  }

  .last-deploy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text);

    &:hover {
      color: var(--text);
    }
  }

  .type-label {
    font-weight: 600;
  }

  .sites-head h2 {
    font-size: 18px;
  }

  .count-chip {
    font: 500 12px var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    color: var(--muted);
  }


  .sites-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3) var(--space-6);
  }

  .sites-toolbar :is(.toolbar-start, .toolbar-end) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-6);
  }

  .sites-toolbar .toolbar-end {
    margin-left: auto;
  }

  .search-field {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 34px;
    width: 280px;
    max-width: 100%;
    padding: 0 var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    background: color-mix(in oklch, var(--surface) 50%, transparent);
    color: var(--muted);
  }

  .search-field:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
  }

  .search-field :is(svg, .spinner) {
    flex: none;
  }

  /* while the table is being filtered (dashboard.js), the magnifier becomes a spinner */
  .search-field .spinner,
  .search-field[data-loading] svg {
    display: none;
  }

  .search-field[data-loading] .spinner {
    display: inline-block;
    margin: 0 1px;
  }

  .search-field input[type=search] {
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    outline: 0;
    flex: 1;
    min-width: 0;
    font-size: var(--text-5);
  }

  /* neutral links for repeated names in tables; amber stays for navigation and primary actions */
  .site-link {
    color: var(--text);
    font-weight: 600;
    font-size: var(--text-7);

    &:hover,
    &:focus-visible {
      color: var(--text);
      text-decoration: underline;
      text-underline-offset: 3px;
    }
  }

  table.data.sites {
    & tr.is-disabled {
      opacity: .6;
    }

    /* one summary line per site: every cell but the site name stays on one line */
    & th,
    & td {
      padding-left: var(--space-7);
      padding-right: var(--space-7);
    }

    & td {
      padding-top: var(--space-7);
      padding-bottom: var(--space-7);
      vertical-align: middle;
      white-space: nowrap;
    }

    & tr > :first-child {
      padding-left: var(--space-8);
    }

    & tr > :last-child {
      padding-right: var(--space-8);
    }

    & td.site-cell {
      white-space: normal;
      min-width: 14ch;
    }

    & th.c,
    & td.c {
      text-align: center;
    }

    & .badge {
      vertical-align: 1px;
    }

    & a.badge {
      cursor: pointer;
    }
  }

  .site-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
  }

  /* dependency updates available: a solid amber counter */
  .badge.badge-count {
    min-width: 22px;
    height: 22px;
    padding: 0 var(--space-2);
    justify-content: center;
    border-radius: 7px;
    font: 600 12px var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    background: var(--accent);
    color: var(--accent-ink);
  }

  .branch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
    vertical-align: middle;
  }

  .branch svg {
    flex: none;
    color: var(--muted);
  }

  .branch code {
    font-weight: 500;
  }

  /* long branch names truncate (full value in the title); scroll rather than clip if still too wide */
  table.data.sites td code {
    display: inline-block;
    max-width: 22ch;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }

  #sites-table,
  #recent .card {
    border-radius: var(--radius-2xl);
  }

  #sites-table {
    overflow-x: auto;
  }

  table.data.sites {
    & .dirty-mark {
      margin-left: 2px;
      font-weight: 700;
      cursor: help;
    }

    & td.actions {
      width: 1%;
      padding-left: 0;
      white-space: nowrap;
    }

    & td.actions form + form {
      margin-left: var(--space-1);
    }

    & td.actions small.error {
      white-space: normal;
      text-align: left;
    }
  }

  .btn-icon {
    width: 26px;
    padding: 0;
    vertical-align: middle;
  }

  .btn-icon svg {
    display: block;
  }

  .btn-icon[aria-busy="true"] svg {
    display: none;
  }

  .btn-icon[aria-busy="true"]::before {
    width: 10px;
    height: 10px;
  }

  table.data.sites {
    & .btn-icon.btn-xs {
      width: 30px;
      height: 30px;
      border-radius: var(--radius-md);
      border-color: var(--glass-border);
      background: color-mix(in oklch, var(--text) 3%, transparent);
      color: var(--muted);
    }

    & .btn-icon.btn-xs:hover {
      background: color-mix(in oklch, var(--text) 8%, transparent);
      color: var(--text);
    }
  }

  /* recent deployments: a lighter card, header row visually hidden, a round outcome mark first */
  #recent {
    margin-top: 44px;
  }

  #recent .section-head h2 {
    font-size: 18px;
  }

  /* the heading with its description under it */
  .section-head-stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  #recent .card {
    background: linear-gradient(180deg, color-mix(in oklch, var(--text) 3.5%, transparent), color-mix(in oklch, var(--text) 1.2%, transparent));
  }

  table.data.recent td {
    padding: var(--space-6) var(--space-7);
    vertical-align: middle;
  }

  table.data.recent td.glyph {
    width: 1%;
    padding-left: var(--space-8);
    padding-right: 0;
  }

  .outcome-mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: color-mix(in oklch, currentColor 14%, transparent);
  }

  .outcome-mark svg {
    display: block;
  }

  .outcome-mark:is(.ok, .fail, .warn, .info, .skip) {
    color: var(--tone);
  }

  /* partial, interrupted: the caution triangle (components.css), not a tinted disc */
  .outcome-mark:has(svg.caution) {
    border-radius: 0;
    background: none;
  }

  .status.bare .dot {
    display: none;
  }

  .sha-chip {
    font-weight: 500;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    background: color-mix(in oklch, var(--text) 5%, transparent);
    border: 1px solid var(--glass-border);
  }

  table.data.recent td.when {
    text-align: right;
    padding-right: var(--space-8);
    white-space: nowrap;
  }

  /* a table card's footer: how many rows it shows, and Show all when it holds some back */
  .tbl-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3) var(--space-6);
    min-height: 44px;
    padding: var(--space-3) 18px;
    border-top: 1px solid var(--glass-border);
    font-size: var(--text-5);
  }

  /* a dependency check running now (Updates cell); same ring as a busy button */
  .spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--info);
    border-top-color: transparent;
    vertical-align: middle;
    animation: db-spin .8s linear infinite;
  }

  table.data tr.empty td {
    color: var(--muted);
  }

  /* below ~760px the dashboard tables become labelled stacked rows (one DOM, no duplicates) */
  @media (max-width: 760px) {
    table.data.stacked thead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
    }

    table.data.stacked,
    table.data.stacked tbody,
    table.data.stacked tr,
    table.data.stacked td {
      display: block;
      width: auto;
    }

    table.data.stacked tr {
      padding: var(--space-4) var(--space-6);
      border-bottom: 1px solid var(--glass-border);
    }

    table.data.stacked tbody tr:last-child {
      border-bottom: 0;
    }

    table.data.stacked td {
      border: 0;
      padding: 4px 0 4px 118px;
      position: relative;
      min-height: 26px;
    }

    table.data.stacked td::before {
      content: attr(data-label);
      position: absolute;
      left: 0;
      top: 6px;
      width: 108px;
      font-size: var(--text-3);
      font-weight: 600;
      color: var(--muted);
    }

    table.data.stacked tr.empty td {
      padding-left: 0;
    }

    table.data.stacked tr.empty td::before {
      content: none;
    }

    table.data.stacked .clamp {
      max-width: none;
      white-space: normal;
    }

    /* recent: the outcome mark sits top-right of each stacked row */
    table.data.recent tr {
      position: relative;
    }

    table.data.recent td,
    table.data.recent td.when {
      padding: 4px 0 4px 118px;
      text-align: left;
    }

    table.data.recent td.glyph {
      position: absolute;
      top: 12px;
      right: 14px;
      width: auto;
      padding: 0;
      min-height: 0;
    }

    table.data.recent td.glyph::before {
      content: none;
    }
  }

  /* the sites table has eight columns, so it stacks earlier than the other dashboard tables */
  @media (max-width: 1080px) {
    table.data.sites {
      & thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
      }

      &,
      & tbody,
      & tr,
      & td {
        display: block;
        width: auto;
      }

      & tr {
        padding: var(--space-6) var(--space-7);
        border-bottom: 1px solid var(--glass-border);
        position: relative;
      }

      & td.actions {
        position: absolute;
        top: 16px;
        right: 16px;
        padding: 0;
        min-height: 0;
        width: auto;
      }

      & td.actions::before {
        content: none;
      }

      & tbody tr:last-child {
        border-bottom: 0;
      }

      & td,
      & td.c,
      & tr > :first-child,
      & tr > :last-child {
        border: 0;
        padding: 4px 0 4px 130px;
        position: relative;
        min-height: 26px;
        text-align: left;
        white-space: normal;
      }

      & td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 6px;
        width: 120px;
        font-size: var(--text-3);
        font-weight: 600;
        color: var(--muted);
      }

      /* the site block heads each stacked card, with room for the two row buttons */
      & td.site-cell {
        padding: 0 80px 8px 0;
      }

      & td.site-cell::before {
        content: none;
      }

      /* (after the padding rule above, which also matches the last cell) */
      & tr > td.actions {
        position: absolute;
        top: 16px;
        right: 16px;
        padding: 0;
        min-height: 0;
      }

      & tr.empty td {
        padding-left: 0;
      }

      & tr.empty td::before {
        content: none;
      }
    }
  }

  /* ---- fallbacks */

  /* fallbacks: no backdrop-filter, or the user asked for less transparency / forced colours */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .topbar-inner {
      background: color-mix(in oklch, var(--surface) 94%, transparent);
    }
  }

  @media (prefers-reduced-transparency: reduce) {
    .ambient {
      display: none;
    }

    .topbar-inner {
      background: var(--surface);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }

    dialog.modal::backdrop {
      background: rgba(18, 16, 24, .55);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }

  }

  @media (forced-colors: active) {
    .ambient {
      display: none;
    }

    /* the selected tab and the switch's state survive without colours */
    .seg label:has(input:checked) {
      outline: 2px solid Highlight;
      outline-offset: -2px;
    }

    .switch .track {
      border: 1px solid ButtonText;
      forced-color-adjust: none;
      background: Canvas;
    }

    .switch:has(input:checked) .track {
      background: Highlight;
    }
  }

  /* ---- site page: header and tabs */

  /* the address under the name: text and icon are one link; a long one ends in an ellipsis */
  .site-url {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
    min-width: 0;
    color: var(--muted);

    &:is(:hover, :focus-visible) {
      color: var(--text);
    }
  }

  .site-url-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ext-icon {
    flex: none;
  }

  /* a greyed-out button's reason: the wrapper takes the hover (.btn:disabled takes none) */
  .btn-blocked {
    display: inline-flex;
  }

  /* the tab bar: links without JavaScript, a tab list with it (site-tabs.js); it scrolls
     sideways on a narrow screen rather than wrapping */
  .site-tabs {
    /* the positioning context of the badges' hidden words, so they scroll with the bar */
    position: relative;
    display: flex;
    gap: var(--space-1);
    margin: var(--space-8) 0 var(--space-9);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-tabs a {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: var(--text-6);
    font-weight: 600;
    white-space: nowrap;

    &:hover {
      color: var(--text);
      text-decoration: none;
    }

    &[aria-selected="true"] {
      color: var(--text);
      border-bottom-color: var(--accent);
    }

    /* its panel holds a form with unsaved changes (site-tabs.js markDirtyTabs) */
    &.dirty::after {
      content: "";
      width: 6px;
      height: 6px;
      margin-left: var(--space-2);
      border-radius: 50%;
      background: var(--warn);
    }

    &:focus-visible {
      outline-offset: -2px;
    }
  }

  .tab-badge {
    margin-left: var(--space-2);
    padding: 0 6px;
    border-radius: var(--radius-pill);
    font: 600 var(--text-2) var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    line-height: 18px;
    color: var(--tone);
    background: color-mix(in oklch, var(--tone) 16%, transparent);
  }

  /* without JavaScript the panels stack, each under its own heading */
  .tab-panel + .tab-panel {
    margin-top: 48px;
  }

  html.has-tabs .tab-panel + .tab-panel {
    margin-top: 0;
  }

  .tab-panel:focus {
    outline: none;
  }

  .panel-title {
    margin-bottom: var(--space-6);
  }

  /* the Settings page's panels: forms read better at a measure than across a wide screen */
  .settings-panel {
    max-width: 880px;
  }

  /* two fields a row at most: paths and URLs stay readable */
  .settings-panel .field-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }

  /* ---- site page: the Overview */

  .overview {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    align-items: flex-start;
    margin-bottom: var(--space-8);
  }

  .overview-main {
    flex: 1 1 560px;
    min-width: 0;
    display: grid;
    gap: var(--space-7);
  }

  .overview-side {
    flex: 1 1 300px;
    max-width: 420px;
    display: grid;
    gap: var(--space-7);
  }

  /* no job: the region holds only whitespace, which :empty does not match, and as an empty grid
     item it would add a gap above the status sheet */
  #site-active:not(:has(> *)),
  #site-issues[hidden] {
    display: none;
  }

  /* the job running now */
  .run-card {
    padding: 14px 18px;
    border-radius: var(--radius-xl);
    border: 1px solid color-mix(in oklch, var(--info) 40%, var(--border));
    background: color-mix(in oklch, var(--info) 7%, var(--surface));
  }

  .run-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
  }

  .run-stages {
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--space-2);
    margin: var(--space-5) 0 var(--space-3);
    padding: 0;
    list-style: none;
  }

  /* an issue: glyph, title, where it was seen, an excerpt, what to do */
  .callout {
    display: flex;
    gap: var(--space-5);
    padding: 14px 18px;
    border-radius: var(--radius-xl);
    border: 1px solid color-mix(in oklch, var(--tone) 35%, var(--border));
    background: color-mix(in oklch, var(--tone) 7%, var(--surface));
  }

  .callout + .callout {
    margin-top: var(--space-4);
  }

  .callout > .glyph {
    flex: none;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: var(--text-3);
    font-weight: 700;
    color: var(--tone);
    background: color-mix(in oklch, var(--tone) 16%, transparent);
  }

  .callout-body {
    flex: 1;
    min-width: 0;
  }

  .callout-title {
    font-weight: 600;
  }

  .callout-detail {
    margin-top: 2px;
    font-size: var(--text-5);
    color: var(--muted);
    overflow-wrap: anywhere;
  }

  .pre.excerpt {
    margin-top: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    background: var(--well);
    font-size: var(--text-4);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .callout-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
  }

  .callout-actions:empty {
    display: none;
  }

  .callout-more,
  .callout-adopt {
    margin-top: var(--space-4);
  }

  /* the status sheet: one row per fact, label | value and sub-lines | action */
  .sheet {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface);
  }

  .sheet-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
  }

  .sheet-head h2 {
    font-size: var(--text-7);
    margin-right: auto;
  }

  .sheet-head .note {
    font-size: var(--text-3);
    color: var(--muted);
  }

  .sheet-rows {
    margin: 0;
  }

  .sheet-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) auto;
    gap: var(--space-2) var(--space-6);
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
  }

  .sheet-row:last-child {
    border-bottom: 0;
  }

  .sheet-row dt {
    font-size: var(--text-5);
    font-weight: 600;
    color: var(--muted);
  }

  .sheet-row dd {
    margin: 0;
    min-width: 0;
  }

  .sheet-value {
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  .sheet-sub {
    display: block;
    font-size: var(--text-5);
    color: var(--muted);
    overflow-wrap: anywhere;
  }

  .sheet-sub:is(.st-ok, .st-warn, .st-fail, .st-info, .st-skip) {
    color: color-mix(in oklch, currentColor 85%, var(--muted));
  }

  .sheet-action {
    font-size: var(--text-5);
    white-space: nowrap;
  }

  @media (max-width: 640px) {
    .sheet-row {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  /* the Incoming commits card: a commit graph, newest first, ending on the deployed commit */
  .commits-card {
    padding: 0;
    margin-bottom: var(--space-8);
  }

  .commits-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
  }

  .commits-head h2 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-7);
  }

  .commits-head .note {
    font-size: var(--text-3);
    color: var(--muted);
    margin-right: auto;
  }

  .git-icon {
    flex: none;
    vertical-align: -3px;
  }

  .commits-head h2 .git-icon {
    color: var(--accent-text);
  }

  .branch-chip {
    font-family: var(--font-mono);
    font-variant-ligatures: none;
    font-size: var(--text-3);
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    color: var(--accent-text);
    background: color-mix(in oklch, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
  }

  .commits-compare {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-3);
  }

  .commit-graph {
    list-style: none;
    margin: 0;
    padding: var(--space-3) 0;
  }

  .commit {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2) var(--space-5);
    padding: 8px 18px;
  }

  .commit:hover {
    background: var(--hover-fill);
  }

  /* the rail: a line through every node, from the newest commit down to the deployed one */
  .commit::before {
    content: "";
    position: absolute;
    left: 27px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: color-mix(in oklch, var(--accent) 45%, var(--border));
  }

  .commit:first-child::before {
    top: 50%;
  }

  .commit:last-child::before {
    bottom: 50%;
  }

  .commit:only-child::before {
    display: none;
  }

  .commit.more::before {
    background: none;
    border-left: 2px dashed var(--border);
  }

  .commit-node {
    position: relative;
    z-index: 1;
    justify-self: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--surface);
  }

  .commit.more .commit-node {
    width: 6px;
    height: 6px;
    background: var(--muted);
  }

  .commit.base .commit-node {
    background: var(--surface);
    border: 2px solid var(--ok);
  }

  .commit-body {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .commit-subject {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .commit-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--text-3);
    color: var(--muted);
  }

  .avatar {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--accent-ink);
    background: var(--accent);
  }

  .deployed-tag {
    font-size: var(--text-1);
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    color: var(--ok);
    border: 1px solid color-mix(in oklch, var(--ok) 45%, transparent);
  }

  .sha-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 2px 9px 2px 6px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    font-size: var(--text-3);
    color: var(--accent-text);
    text-decoration: none;
    white-space: nowrap;
  }

  .sha-chip .git-icon {
    width: 14px;
    height: 14px;
    color: var(--muted);
  }

  a.sha-chip:hover {
    background: var(--hover-fill);
    border-color: color-mix(in oklch, var(--accent) 40%, var(--border));
  }

  .commit.base .sha-chip {
    color: var(--muted);
  }

  @media (max-width: 640px) {
    .commit {
      grid-template-columns: 20px minmax(0, 1fr);
    }

    .commit .sha-chip {
      grid-column: 2;
      justify-self: start;
    }

    .commit-subject {
      white-space: normal;
      overflow-wrap: anywhere;
    }
  }

  /* the side column: recent activity and automatic deploys */
  .side-card .card-title {
    font-size: var(--text-7);
    margin-bottom: var(--space-4);
  }

  .side-list {
    list-style: none;
    margin: 0 0 var(--space-5);
    padding: 0;
    display: grid;
    gap: var(--space-5);
  }

  .side-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
  }

  .side-sub {
    display: block;
    margin: 2px 0 0 30px;
    font-size: var(--text-5);
    color: var(--muted);
  }

  .side-card p + p {
    margin-top: var(--space-3);
  }

  .side-card .small + .small {
    margin-top: var(--space-3);
  }

  .sheet-secondary {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-3);
  }

  /* ---- site page: the Variables tab */

  .env-tab {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    align-items: flex-start;
  }

  .env-main {
    flex: 1 1 520px;
    min-width: 0;
    display: grid;
    gap: var(--space-7);
  }

  .env-side {
    flex: 1 1 280px;
    max-width: 400px;
    display: grid;
    gap: var(--space-7);
  }

  .env-tab .card-title {
    font-size: var(--text-7);
    margin-bottom: var(--space-4);
  }

  .env-tab .card-head .card-title {
    margin-bottom: 0;
  }

  /* the picker doubles as the drop zone */
  .env-drop {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-6);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--well);
  }

  .env-drop label.btn:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }

  .env-drop.is-over {
    border-color: var(--accent);
    background: color-mix(in oklch, var(--accent) 10%, var(--well));
  }

  .env-drop :is([data-env-name], [data-review-env-name]) {
    flex: 1;
    min-width: 0;
  }

  .key-list {
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
    display: grid;
    gap: var(--space-2);
  }

  .key-list li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
  }

  /* a review shown in place (the .env replace, the dependency update) */
  .inline-review {
    margin-top: var(--space-6);
    padding: var(--space-6) var(--space-7);
    border: 1.5px solid color-mix(in oklch, var(--accent) 60%, var(--border));
    border-radius: var(--radius-lg);
    background: var(--surface);
  }

  .inline-review .review-file:focus {
    outline: none;
  }

  .diff-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-5);
  }

  .diff-col {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    background: color-mix(in oklch, var(--tone) 9%, transparent);
  }

  .diff-col ul {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
    overflow-wrap: anywhere;
  }

  .diff-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 600;
    font-size: var(--text-5);
  }

  .diff-count {
    font: 600 var(--text-3) var(--font-mono);
    font-variant-ligatures: none;
    font-feature-settings: "calt" 0;
    color: var(--tone);
  }

  .review-steps {
    margin: var(--space-2) 0 0;
    padding-left: 1.3em;
    display: grid;
    gap: var(--space-1);
  }

  /* ---- the site page's Settings tab: a local nav beside five sections; one column on narrow
     screens. The Settings page stacks the same sections in each of its tabs. */

  .settings-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: var(--space-9);
    align-items: start;
  }

  .settings-nav {
    position: sticky;
    top: var(--space-7);
  }

  .settings-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-1);
  }

  .settings-nav a {
    display: block;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--muted);
    text-decoration: none;
    font-size: var(--text-5);
  }

  .settings-nav a:hover {
    color: var(--text);
    background: var(--well);
  }

  .settings-section + .settings-section {
    margin-top: var(--space-9);
  }

  .settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    margin-bottom: var(--space-4);
  }

  .settings-head h3 {
    font-size: var(--text-7);
  }

  .settings-section > .consequence {
    margin: 0 0 var(--space-4);
  }

  /* Settings: a new install's Get started steps, above the tabs */
  .setup-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
  }

  .setup-steps li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
  }

  .setup-steps code {
    overflow-wrap: anywhere;
  }

  .setup-steps .check-mark {
    width: 20px;
    height: 20px;
    font-size: var(--text-2);
  }

  /* a step still to do shows its number */
  .setup-steps .check-mark:not(.ok) {
    background: var(--well);
    color: var(--muted);
  }

  /* Settings: the system checks, folded while they all pass; the rows carry their own padding */
  .tbl-checks > details > summary {
    padding: 12px 18px;
  }

  .tbl-checks > details[open] > summary {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
  }

  /* Settings: a tool's own system check, under its path */
  .tool-check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-3);
  }

  /* what automatic deploys do right now, before the controls that change it */
  .effect-box {
    margin-bottom: var(--space-5);
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--well);
  }

  .effect-box p + p {
    margin-top: var(--space-2);
  }

  .form-actions .consequence {
    font-size: var(--text-3);
  }

  @media (max-width: 900px) {
    .settings-layout {
      grid-template-columns: minmax(0, 1fr);
      gap: var(--space-6);
    }

    .settings-nav {
      position: static;
    }

    .settings-nav ul {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-2);
    }

    .settings-nav a {
      border: 1px solid var(--border);
      border-radius: var(--radius-pill);
      padding: var(--space-1) var(--space-4);
    }
  }

  /* ---- the Dependencies tab: the picker under the table, the review shown in place */

  .deps-pick {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-6);
    margin-top: var(--space-5);
  }

  .deps-pick .note {
    font-size: var(--text-3);
    color: var(--muted);
  }

  .deps-review.is-inline {
    max-width: none;
    margin-top: var(--space-6);
    padding: var(--space-6) var(--space-7) 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--well);
  }

  .deps-review.is-inline .review-head {
    margin-bottom: var(--space-5);
  }

  /* the page header above already names the site and its environment */
  .deps-review.is-inline .review-site {
    display: none;
  }

  /* focused by script so a screen reader starts there; not a control */
  .deps-review [tabindex="-1"]:focus {
    outline: none;
  }

  .deps-review.is-inline .review-foot {
    position: static;
    background: transparent;
  }

  .deps-trouble > summary {
    font-weight: 600;
  }

  .deps-trouble[open] > summary {
    margin-bottom: var(--space-3);
  }

  /* ---- the deploy review (a page; deploy-panel.js shows it in a modal) */

  .review {
    max-width: 1080px;
  }

  /* what is deployed, then how it runs: side by side where there is room, the run a card
     beside it */
  .review-cols {
    display: grid;
  }

  .review-col:first-child > .review-section:first-child {
    padding-top: 0;
    border-top: 0;
  }

  @media (min-width: 960px) {
    .review-cols {
      grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
      align-items: start;
      column-gap: var(--space-9);
      padding-bottom: var(--space-7);
    }

    .review-aside > .review-section {
      padding: var(--space-7);
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      background: var(--raised);
    }
  }

  .review-head {
    margin-bottom: var(--space-7);
  }

  .review-site {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
    font-size: var(--text-7);
  }

  .review .banner {
    margin-bottom: var(--space-6);
  }

  .review-section {
    padding: var(--space-7) 0;
    border-top: 1px solid var(--border);
  }

  .review-section h2 {
    font-size: var(--text-7);
    margin-bottom: var(--space-5);
  }

  .review-section > p + p,
  .review-section > p + .help {
    margin-top: var(--space-3);
  }

  .review-list {
    margin: 0;
    padding-left: 1.2em;
    display: grid;
    gap: var(--space-2);
  }

  .review-commits {
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
  }

  .review-commits .subject {
    overflow-wrap: anywhere;
  }

  .run-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--space-2);
    margin: 0 0 var(--space-6);
    padding: 0;
  }

  /* filled, so the steps stand out on the card they sit on */
  .run-chips .badge {
    background: var(--surface);
  }

  .run-chips .is-skipped {
    text-decoration: line-through;
    opacity: .6;
  }

  .run-chips .is-forced {
    color: var(--warn);
    border-color: color-mix(in oklch, var(--warn) 45%, transparent);
  }

  /* the checkout writes the .env sent with this deploy (review-env.js) */
  .run-chips :is(.env-mark, .deps-mark) {
    color: var(--warn);
  }

  /* Update outdated dependencies, under the steps */
  .deps-update {
    margin-bottom: var(--space-5);
  }

  /* the chosen file's comparison: one line that opens to the key names */
  .env-review-more > summary {
    font-size: var(--text-5);
  }

  .env-review-more[open] > summary {
    margin-bottom: var(--space-4);
  }

  .review-section [data-review-env-result] > :first-child {
    margin-top: var(--space-5);
  }

  .review-advanced > summary {
    font-weight: 600;
  }

  .review-advanced[open] > summary {
    margin-bottom: var(--space-5);
  }

  .review-advanced .check + .check,
  .review-advanced .skip-steps {
    margin-top: var(--space-5);
  }

  .skip-steps legend {
    font-weight: 600;
    font-size: var(--text-5);
    margin-bottom: var(--space-3);
  }

  /* in the modal the head and foot are its header and footer bars: they span its width and stay
     put while the body scrolls between them (the head leaves room for the close button) */
  .modal-body .review-head {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 calc(-1 * var(--space-9)) var(--space-7);
    padding: var(--space-7) 56px var(--space-6) var(--space-9);
    background: var(--raised);
    border-bottom: 1px solid var(--border);
  }

  .modal-body .review-head h1 {
    font-size: 20px;
  }

  .modal-body .review-head .review-site {
    margin-top: var(--space-2);
  }

  .modal-body .review-foot {
    margin: 0 calc(-1 * var(--space-9));
    padding: var(--space-6) var(--space-9);
    background: var(--raised);
  }

  .review-head .mono {
    overflow-wrap: anywhere;
  }

  .review-foot .deploy-btn {
    white-space: normal;
    text-align: left;
  }

  /* the button stays in reach at the bottom of a long review */
  .review-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    padding: var(--space-6) 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
  }

  /* while a field has focus (a phone's keyboard is up) the footer stays in the flow */
  .review-form:has(input[type=text]:focus, select:focus) .review-foot {
    position: static;
  }

  /* ---- configuration card on the site page */

  /* Configuration card on the site page */
  .config-kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--space-2) var(--space-6);
    margin: 0;
    font-size: var(--text-5);
  }

  .config-kv dt {
    color: var(--muted);
    font-weight: 600;
    font-size: var(--text-4);
  }

  .config-kv dd {
    margin: 0;
    min-width: 0;
  }

  .chips-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  /* the site's pipeline on the Settings tab (ol.flow) */
  .pipeline-steps {
    margin: 0;
    row-gap: var(--space-1);
  }

  /* Not deployed: the patterns, what they left out, the suggestion */
  .config-kv .excludes {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .config-kv .excludes form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
  }
}
