@layer modules {
  /* Connecting an aggregator: the callback URL, a test dial, and each provider's steps. */
  .callback { display: flex; align-items: center; gap: .6rem; }
  .callback-url { flex: 1; min-width: 0; padding: .7rem .9rem; overflow-wrap: anywhere; font-size: 1.3rem; user-select: all; }
  .check-result { margin-top: 1rem; padding: 1rem 1.2rem; border-radius: var(--r-control); border: 1px solid var(--ok-line); background: var(--ok-soft); }
  .check-result.is-failed { border-color: var(--error-line); background: var(--error-surface); }
  .check-title { margin: 0 0 .6rem; font-weight: 600; }
  .check-result.is-ok .check-title { color: var(--ok-ink); }
  .check-result.is-failed .check-title { color: var(--error); }
  /* The lede says what an aggregator is before any step asks for one. */
  .connect-lede { margin: 0; color: var(--ink-2); font-size: 1.4rem; line-height: 1.5; }
  .connect .group > legend { display: flex; align-items: center; }
  .connect .group > .hint { margin-bottom: 0; }
  /* Slow calls: the problem said once, then one row per call with how long it may hang. */
  .connect .slow-calls { display: grid; gap: .8rem; margin-top: 1.8rem; padding: 1.4rem 1.6rem; border: 1px solid var(--warning-line); border-left: 3px solid var(--warning); border-radius: var(--r-control); background: var(--warning-soft); }
  .slow-calls p { margin: 0; }
  .slow-calls-title { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.4rem; font-weight: 650; }
  .slow-calls-title .icon { width: 1.8rem; height: 1.8rem; color: var(--warning); flex: none; }
  .slow-calls-body { color: var(--ink-2); line-height: 1.5; }
  .slow-calls-list { list-style: none; margin: .2rem 0; padding: 0; border: 1px solid var(--warning-line); border-radius: var(--r-control); background: var(--surface); }
  .slow-call { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .4rem 1.2rem; padding: .8rem 1rem; }
  .slow-call + .slow-call { border-top: 1px solid var(--line); }
  .slow-call-screen { font-weight: 600; }
  .slow-call-url { overflow: hidden; font-family: var(--mono); font-size: 1.2rem; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
  .slow-call-wait { padding: .1rem .8rem; border-radius: 999px; background: var(--warning-soft); border: 1px solid var(--warning-line); font-size: 1.2rem; font-weight: 600; white-space: nowrap; }
  .slow-call-fix { font-size: 1.3rem; white-space: nowrap; }
  @media (max-width: 879px) { .slow-call { grid-template-columns: minmax(0, 1fr) auto; } }
  /* One provider's steps at a time, picked without a round trip. */
  .provider-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
  .connect .providers > .provider-picker { margin-top: 1.6rem; }
  /* Logos keep their own colours, so a tile stays white in the dark theme too. */
  .provider-option { --tile-accent: #0f62fe; position: relative; display: grid; place-items: center; height: 7.2rem; padding: 1.2rem 1.6rem; border: 1px solid var(--line-strong); border-radius: var(--r-card); background: #fff; cursor: pointer; transition: border-color .11s ease, box-shadow .11s ease; }
  .provider-option:hover { border-color: var(--tile-accent); }
  .provider-option input { position: absolute; opacity: 0; pointer-events: none; }
  .provider-option:has(input:checked) { border-color: var(--tile-accent); box-shadow: inset 0 0 0 1px var(--tile-accent); }
  .provider-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
  .provider-logo { display: block; width: auto; max-width: 100%; height: 3.2rem; }
  .provider-check { position: absolute; top: .6rem; right: .6rem; display: none; color: var(--tile-accent); }
  .provider-check .icon { display: block; width: 1.8rem; height: 1.8rem; }
  .provider-option:has(input:checked) .provider-check { display: block; }
  .provider { display: none; }
  .providers:has(input[value="at"]:checked) .provider.is-at, .providers:has(input[value="mtn"]:checked) .provider.is-mtn { display: block; }
  .connect .providers > .provider { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
  .connect .guide-steps { gap: 1.8rem; }
  /* The raw exchange, for whoever wires the aggregator's side. */
  .connect-details { margin-top: 2.2rem; }
  .connect-details > summary { display: inline-flex; align-items: center; gap: .4rem; font-size: 1.3rem; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
  .connect-details > summary::-webkit-details-marker { display: none; }
  .connect-details > summary .icon { width: 1.5rem; height: 1.5rem; transition: transform .12s ease; }
  .connect-details[open] > summary .icon { transform: rotate(90deg); }
  .exchange { display: grid; grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr)); gap: 1rem; margin-top: 1.4rem; }
  .exchange .label { margin-bottom: .4rem; }
  .exchange .call-json { white-space: pre-wrap; overflow-wrap: anywhere; }

  /* A call placed from the editor: one screen at a time, as a phone shows it. */
  /* A real call: the phone, centred, under what it is really calling. */
  .dial-call { display: grid; justify-items: center; }
  .dial-call .phone-banner { width: min(46rem, 100%); }

  /* What the phone is really calling, worn above it. */
  .phone-banner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; margin: 0 0 1.2rem; padding: 1rem 1.2rem; border: 1px solid var(--error); border-radius: var(--r-card); background: var(--error-soft, var(--surface)); font-size: 1.35rem; line-height: 1.45; color: var(--ink); }
  .phone-banner .icon { margin-top: .2rem; color: var(--error); }
}
