/* ---------- popover and dialogs ---------- */
.popover {
  position: fixed;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  padding: 12px;
  width: 300px;
  box-shadow: 0 8px 24px rgba(10, 30, 35, 0.18);
  font-size: 13px;
}
.popover .mono {
  word-break: break-all;
  display: block;
  margin: 4px 0 10px;
  color: var(--link);
}
.popover input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface);
}
.popover .row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

dialog {
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  padding: 0;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  color: var(--ink);
}
dialog.wide {
  width: min(1180px, calc(100vw - 32px));
}
dialog::backdrop {
  background: rgba(8, 20, 24, 0.45);
}
.dlg-head {
  display: flex;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.dlg-head h2 {
  margin: 0;
  font-size: 17px;
}
.dlg-head .btn {
  margin-left: auto;
}
.dlg-body {
  padding: 10px 22px 24px;
}
.dlg-body > h3 {
  font-size: 14px;
  margin: 16px 0 2px;
}
.dlg-body p.help {
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 13px;
  max-width: 70ch;
}
.dlg-body textarea {
  width: 100%;
  min-height: 110px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface-2);
  font: 12px/1.5 var(--mono);
  resize: vertical;
}
.dlg-body textarea.masked {
  -webkit-text-security: disc;
}
.dlg-body .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}
.dlg-body .grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 4px;
}
.dlg-body .grid2 label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.dlg-body select {
  font-family: var(--ui);
}
.dlg-body input[type='text'],
.dlg-body input[type='url'],
.dlg-body select {
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}
.dlg-body input.slim {
  flex: 1;
  min-width: 200px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.dlg-body .grid2 small {
  color: var(--ink-3);
  font-size: 11.5px;
}
/* The optional payer project, under the Project ID and ISPB; the language of the page, first in Settings. */
.dlg-body .payer-field,
.dlg-body .lang-pick {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.dlg-body .lang-pick {
  margin: 0 0 14px;
  max-width: 420px;
}
.dlg-body .payer-field .opt {
  color: var(--ink-3);
  font-size: 11.5px;
}
.dlg-body .payer-field small,
.dlg-body .lang-pick small {
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.45;
}
.dlg-body .grid2 small.bad-text,
.dlg-body .payer-field small.bad-text {
  color: var(--err);
}
.varname {
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 4px;
}
.check {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 8px;
}
.key-status {
  font-size: 12.5px;
}
.key-status.bad {
  color: var(--err);
}

.step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.step:last-child {
  border-bottom: 0;
}
.step-n {
  width: 26px;
  height: 26px;
  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);
}
.step.done .step-n {
  background: var(--pix);
  border-color: var(--pix);
  color: #fff;
}
.step-body h3 {
  margin: 2px 0 4px;
  font-size: 14px;
}
.test-lines {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 13px;
}
.test-lines li {
  padding: 3px 0;
}
.test-lines li.ok {
  color: var(--pix-strong);
}
.test-lines li.bad {
  color: var(--err);
}
.test-lines .test-hint {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}
