/* Dialogs (S.dialog in dialogs.js): the shape shared by every theme. The
   frame, title, fields and buttons of each theme are in css/themes/. The
   body scrolls, so a dialog never grows past the screen. */
.dlg-ov {
  position: absolute;
  inset: 0;
  z-index: var(--z-dialog);
  display: grid;
  place-items: center;
  padding: 1em;
  overflow: hidden;
  background: rgba(10, 13, 14, 0.25);
}
.dlg {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: min(28em, 100%);
  max-width: min(44em, 100%);
  max-height: calc(100% - 1em);
  min-height: 0;
  background: var(--hall);
}
.dlg:focus {
  outline: none;
}
.dlg.wide {
  min-width: min(40em, 100%);
  max-width: min(52em, 100%);
}
.dlg-title,
.dlg-btns {
  flex: none;
}
.dlg-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.6em 1em;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}
.dlg-in {
  font: inherit;
  color: var(--haze);
  padding: 0.3em 0.5em;
  text-transform: uppercase;
}
.dlg-in:focus {
  outline: none;
}
/* A rejected password (markRejected in dialogs.js): the fields in the error
   color until one is edited. The themes draw a field with a border
   (desktop) or a line under it (tmux, title), and both turn red; :root
   outranks their focus rules, which load later */
:root .dlg-in.rejected,
:root .dlg-in.rejected:focus {
  color: var(--flag);
  border-color: var(--flag);
}
:root:not([data-theme="desktop"]) .dlg-in.rejected {
  box-shadow: inset 0 -2px 0 var(--flag);
}
/* The clues of a lock with a note (S.lockClues in common.js): a framed list,
   one row per clue, its label in a column of its own */
.lock-clues {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0;
  margin: 0.6em 0 0;
  border: 1px solid var(--rib);
  text-align: left;
}
.lock-clues dt,
.lock-clues dd {
  margin: 0;
  padding: 0.25em 0.6em;
  border-top: 1px solid var(--rib);
}
.lock-clues dt {
  color: var(--accent);
  border-right: 1px solid var(--rib);
}
.lock-clues dt:first-of-type,
.lock-clues dt:first-of-type + dd {
  border-top: 0;
}
/* I AM NOT AN EU CITIZEN under the clues, and the European facts it adds
   (S.lockPlain in common.js): a heading in the accent color over a second
   framed list */
.eu-btn {
  margin: 0.6em 0 0;
}
.lock-plain-head {
  margin: 0.2em 0 0;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-align: left;
}
/* The lines of a lock with a sort (sortDialog in dialogs.js, S.sortLines in
   common.js): a framed, numbered list, each line with its source and its choices */
.sort-lines {
  margin: 0.6em 0 0;
  padding: 0 0 0 2.4em;
  border: 1px solid var(--rib);
  text-align: left;
}
.sort-lines li {
  padding: 0.45em 0.6em 0.45em 0;
  border-top: 1px solid var(--rib);
}
.sort-lines li:first-child {
  border-top: 0;
}
.sort-lines li::marker {
  color: var(--accent);
}
.sort-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.35em;
}
.sort-choices .btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
/* After a rejected answer, the pressed choices in the error color until one
   changes (markRejected in dialogs.js) */
:root .sort-choices .btn.rejected[aria-pressed="true"] {
  border-color: var(--flag);
  color: var(--flag);
  box-shadow: inset 0 -2px 0 var(--flag);
}
/* The activation-key boxes of a lock with a key (keyDialog in dialogs.js):
   each box is as wide as its group, with a dash between boxes */
.key-boxes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35em 0.25em;
  margin-top: 0.6em;
}
.dlg-in.key-box {
  width: calc(var(--chars) * (1ch + 0.08em) + 1.3em);
  padding: 0.3em 0.6em;
  text-align: center;
  letter-spacing: 0.08em;
}
.key-dash {
  opacity: 0.6;
}
.dlg-btns {
  display: flex;
  justify-content: center;
  gap: 0.8em;
  padding: 0 1em 0.8em;
}
.dlg-rule {
  height: 1px;
  background: var(--rib);
  margin: 0.2em 0;
}
/* The error dialog (S.errorBox) sits above any other dialog */
.dlg-ov.err-ov {
  z-index: var(--z-error);
}
.dlg-err {
  min-width: min(24em, 100%);
}
/* Popup buttons in every theme: reverse video under the pointer or the
   focus, as a tmux menu shows its chosen item */
html[data-theme] :is(.dlg, .mail-toast, .tut) .btn:is(:hover, :focus-visible):not(:disabled) {
  background: var(--haze);
  border-color: var(--haze);
  color: var(--hall);
  text-shadow: none;
  outline: none;
}
