/* Atlas's own questions (js/dialogs.js): a yes or no, or a line of text, in place of the browser's confirm() and
   prompt(). A modal <dialog> over the whole page (the top layer), the page dimmed under it; a press on the dim,
   outside the panel, answers no. The panel is the dashboard's own modal (style.css, "Delete Modal": .delete-modal,
   its text, its text box and its Cancel and red buttons; .btn-primary for a yes that deletes nothing).
   Colours come from the tokens only (tokens.css). Every button is 40px tall at least and 44px under a finger, and on
   a narrow screen the two share the row. */

/* ---- the dialog: the whole page, dimmed */
.td-dialog {
  position: fixed; inset: 0; box-sizing: border-box;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: var(--overlay-heavy); color: var(--text);
  z-index: calc(var(--z-modal, 200) * 2);   /* (in the top layer it is over everything anyway; this is for a browser without it) */
}
.td-dialog[open] { display: flex; align-items: center; justify-content: center; }
.td-dialog::backdrop { background: transparent; }

/* ---- the dashboard's look */
/* On a phone the page's height follows the keyboard (app.js keeps --app-height): the question stays above it. */
.td-dash { height: var(--app-height, 100%); padding: var(--space-5); }
.td-dash .td-panel { max-width: 420px; max-height: 100%; overflow-y: auto; box-sizing: border-box; }
.td-dash .td-title { margin: 0 0 var(--space-3); line-height: var(--leading-tight, 1.3); overflow-wrap: anywhere; }
.td-dash .td-text { overflow-wrap: anywhere; }
.td-dash .td-field { margin-top: var(--space-3); }
.td-dash .td-label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.td-dash .td-input { margin: var(--space-2) 0 0; }
.td-dash .td-input:focus { border-color: var(--accent); }
.td-dash .td-actions { margin-top: var(--space-5); flex-wrap: wrap; }
.td-dash .td-actions .btn { justify-content: center; min-height: var(--space-10); padding: var(--space-2) var(--space-5); font-size: var(--text-sm); }
.td-dash .td-actions .btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
@media (pointer: coarse) {
  .td-dash .td-actions .btn { min-height: 44px; }
  .td-dash .td-input { font-size: var(--text-lg); }   /* (16px: a phone does not zoom in on it) */
}
@media (max-width: 480px) {
  .td-dash { padding: var(--space-4); }
  .td-dash .td-actions .btn { flex: 1 1 0; }
}
