/* ---------- the Setup screen ---------- */
/* The one dialog that takes the whole page: nothing else answers until the sandbox does. */
dialog.full {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
}
/* Its head, always in view: the step before, how far the setup is with a segment a step, the step after. */
.su-head {
  gap: 8px 20px;
}
.su-head .btn {
  margin-left: 0;
  white-space: nowrap;
}
.su-head #close-setup {
  margin-left: auto;
}
/* The bar keeps its width from step to step, so Next stays where the pointer left it. */
.su-stepper {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.su-bar {
  flex: 0 1 auto;
  width: 300px;
  min-width: 90px;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 14px;
}
.su-bar i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--rule-strong);
}
.su-bar .su-done {
  background: var(--pix);
}
.su-bar .su-failed {
  background: var(--err);
}
.su-bar .su-waiting {
  background: var(--idle);
}
/* The step shown stands taller. */
.su-bar .su-here {
  height: 14px;
  border-radius: 4px;
}
.su-count {
  white-space: nowrap;
}
#setup-body {
  max-width: 1320px;
  margin: 0 auto;
}
/* The other way in: what needs no sandbox. */
.su-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 100ch;
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
}
.su-lead {
  max-width: 100ch;
  margin: 8px 0 0;
  color: var(--ink-2);
}
.su-grid {
  display: grid;
  grid-template-columns: minmax(380px, 500px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.su-side {
  position: sticky;
  top: 72px;
}
.su-side-head {
  align-items: center;
  gap: 10px;
}
.su-join {
  margin-top: 14px !important;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 12.5px !important;
}

/* The map: three lanes, one row a step. */
.su-map {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.su-lanes,
.su-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 0 24px;
  align-items: center;
}
.su-lanes {
  padding: 0 0 4px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.su-row {
  position: relative;
  padding: 4px 0;
}
/* The line from one step to the next, behind the numbers. */
.su-row::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--rule);
}
.su-lanes + .su-row::before {
  top: 50%;
}
.su-row:last-child::before {
  bottom: 50%;
}
.su-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 8px 5px 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-weight: 600;
  color: var(--ink);
}
button.su-step {
  cursor: pointer;
}
button.su-step:hover {
  background: var(--surface-2);
}
button.su-step[aria-current='true'] {
  background: var(--pix-tint);
}
.su-n {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--rule-strong);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
}
.su-done .su-n {
  background: var(--pix);
  border-color: var(--pix);
  color: #fff;
}
.su-failed .su-n {
  background: var(--err-tint);
  border-color: var(--err);
  color: var(--err);
}
.su-waiting .su-n {
  background: var(--warn-tint);
  border-color: var(--idle);
  color: var(--warn);
}
.su-stark,
.su-check {
  position: relative;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-2);
}
.su-stark:not(:empty),
.su-check:not(.by):not(:empty) {
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid transparent;
}
.su-stark:not(:empty) {
  background: var(--warn-tint);
  color: var(--warn);
}
.su-check:not(.by):not(:empty) {
  background: var(--surface-2);
  border-color: var(--rule);
}
.su-done .su-check:not(.by) {
  background: var(--ok-tint);
  border-color: transparent;
  color: var(--ok);
}
.su-failed .su-check:not(.by) {
  background: var(--err-tint);
  border-color: transparent;
  color: var(--err);
}
.su-check.by {
  font-size: 12px;
  color: var(--ink-3);
}
/* An arrow into the lane of Stark and into the lane of the checks. */
.su-stark:not(:empty)::before,
.su-check:not(.by):not(:empty)::before {
  content: '→';
  position: absolute;
  left: -19px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
}

/* One step, beside the map. */
.su-panel {
  min-width: 0;
}
.su-panel-head .meta {
  margin: 0;
}
.su-panel h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 2px 0 6px;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.su-panel h4,
.su-group h4 {
  margin: 22px 0 6px;
  font-size: 13.5px;
}
.su-panel .help,
.su-issues-tab .help,
.su-stark-tab .help {
  max-width: 80ch;
}
.su-shared {
  margin-top: 8px !important;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 8px;
}
.su-file {
  margin-top: 8px !important;
}
.su-open {
  gap: 6px;
  margin-top: 10px;
}
.su-open:empty {
  display: none;
}
.su-panel .gd-message {
  margin-top: 18px;
  max-width: 86ch;
}
.su-message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 8px;
}
.su-message-actions a.btn {
  text-decoration: none;
}
.su-sent,
.su-tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.su-proof .row {
  align-items: center;
  gap: 10px;
}
.su-found li.wait {
  color: var(--warn);
}
.su-found li > b {
  display: inline-block;
  width: 1.1em;
}
/* What the first sandbox knows about the error a check just got. */
.su-hit {
  margin: 6px 0 4px;
  padding: 8px 12px;
  max-width: 80ch;
  border-left: 3px solid var(--idle);
  border-radius: 0 6px 6px 0;
  background: var(--warn-tint);
  color: var(--ink);
  font-size: 13px;
}
.su-hit p {
  margin: 0;
}
.su-issues {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.su-issue {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  max-width: 92ch;
}
.su-issue p {
  margin: 0;
}
.su-sign {
  font-weight: 600;
  color: var(--ink);
}
.su-cause {
  color: var(--ink-2);
}
.su-fix b {
  color: var(--pix-strong);
}
.su-issue code,
.su-hit code {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.su-source {
  font-size: 12px;
}

/* Issues found, and Write to Stark. */
#su-filter {
  flex: 1;
  max-width: 460px;
  padding: 6px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  background: var(--surface);
}
.su-issues-tab .row {
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
}
.su-group h4 .linkish {
  margin-left: 6px;
  font-weight: 400;
  font-size: 12.5px;
}
.su-stark-tab .gd-message {
  max-width: 92ch;
}

/* A path through the screens of Stark or Cloudflare. */
.ui-path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  vertical-align: baseline;
}
.ui-path b {
  padding: 0 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.ui-path i {
  font-style: normal;
  color: var(--ink-3);
}

/* The button of the top bar, until every step is done. */
#open-setup.todo {
  color: var(--pix-strong);
  font-weight: 600;
}
#open-setup .badge {
  background: var(--pix-strong);
  color: #fff;
}

/* The test run waits for the setup. */
.tr-setup-gate {
  margin: 12px 0;
}
.tr-setup-gate ul {
  margin: 4px 0 8px;
  padding-left: 18px;
}

/* In the Guide the map is a picture. */
.gd-fig .su-map {
  max-width: 640px;
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  /* White on light teal is under 2.3:1 in dark mode, as for the other ticks. */
  .su-done .su-n,
  #open-setup .badge {
    color: #062a26;
  }
}
@media (max-width: 980px) {
  .su-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .su-side {
    position: static;
  }
}
@media (max-width: 820px) {
  /* Two rows: the title and Close, then the steps from edge to edge. */
  .su-stepper {
    order: 2;
    flex-basis: 100%;
  }
  .su-bar {
    flex: 1 1 auto;
    width: auto;
  }
}
@media (max-width: 480px) {
  /* On a phone the lanes of Stark and of the checks fold under their step. */
  .su-lanes {
    display: none;
  }
  .su-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  .su-stark:empty,
  .su-check:empty {
    display: none;
  }
  .su-stark,
  .su-check {
    margin-left: 43px;
    justify-self: start;
  }
  .su-stark:not(:empty)::before,
  .su-check:not(.by):not(:empty)::before {
    content: none;
  }
  .su-count {
    display: none;
  }
  #open-setup .badge {
    display: none;
  }
  .su-next-name {
    display: none;
  }
}

/* The same steps in the Guide's chapter. */
.gd-step .gd-step-open {
  gap: 6px;
  margin-top: 10px;
}
.gd-step .gd-step-open:empty {
  display: none;
}
.gd-step .gd-step-open .btn {
  margin-top: 0;
}
.gd-step .gd-wrong {
  margin: 16px 0 0;
}
.gd-step .su-issue {
  padding: 8px 0;
  font-size: 13px;
}

/* The first step: the app in both stores as codes a phone reads, an approval moment by moment, a team's rules. */
.su-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
}
.su-store {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.su-store:hover {
  border-color: var(--pix);
}
.link-qr {
  width: 104px;
  height: 104px;
  border-radius: 4px;
}
.su-store span {
  display: grid;
  gap: 1px;
}
.su-store b {
  font-size: 14px;
}
.su-store small {
  color: var(--ink-3);
  font-size: 12.5px;
}
.su-approval-title {
  margin: 18px 0 6px !important;
}
.su-approval {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  counter-reset: moment;
  max-width: 86ch;
}
.su-approval li {
  counter-increment: moment;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.4;
}
.su-approval li b {
  display: block;
  margin-bottom: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.su-approval li b::before {
  content: counter(moment) '. ';
}
.su-approval li.on-phone {
  background: var(--pix-tint);
  border-color: transparent;
}
.su-approval li.on-phone b {
  color: var(--pix-strong);
}
.su-team {
  margin: 18px 0 0;
  padding: 12px 16px;
  max-width: 86ch;
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.su-team h4 {
  margin: 0 0 6px !important;
}
.su-team ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
}
.su-team li {
  padding: 2px 0;
}
.su-team .meta {
  margin: 8px 0 0;
  font-size: 12px;
}
@media (max-width: 640px) {
  .su-approval {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Start here: the two ways into the setup, side by side. */
.su-start-tab h3 {
  margin: 6px 0;
  font-size: 20px;
}
.su-start-lead {
  max-width: 86ch;
  margin: 0 0 16px;
  color: var(--ink-2);
}
.su-ways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}
.su-way {
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
}
.su-way.is-chosen {
  border-color: var(--pix-strong);
  box-shadow: 0 0 0 1px var(--pix-strong);
}
.su-way h4 {
  margin: 0 0 6px !important;
  font-size: 16px;
}
.su-way h5 {
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--ink-2);
}
.su-way p {
  margin: 0;
  font-size: 13.5px;
}
.su-way ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13.5px;
}
.su-way li {
  padding: 2px 0;
}
.su-way .meta {
  margin-top: 10px;
  font-size: 12.5px;
}
.su-way-actions {
  margin-top: 14px;
  gap: 8px;
  flex-wrap: wrap;
}
