/* Emergency access (break-glass): the banner, the toast and the dialog of L6 (app/components/break_glass_banner_component.rb, toast_component.rb, dialog_component.rb). design-direction.md
   section 6.4. The pages of S7 (app/views/break_glass, break_glass_approvals, break_glass_notices) are drawn by the shared components, PageSectionComponent, EntryListComponent and LinkCardsComponent,
   and have no rules of their own: they had a grid, a list, a card and a quote here, which are now the entry's.

   The banner is the warn tone with a thick edge at the start, the sentence first and the button after, wrapping under it on a narrow screen. The toast is a callout's
   shape with a title; it sits in the flow and never floats. The dialog is the finder's styling (radius, the lifted shadow, the soft scrim) on a native <dialog>.

   Tokens only and logical properties only (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on both shells, in light and in dark, and mirrors in
   a right-to-left language. Nothing pinned, no height in vh, and every box that holds words may shrink and wrap (WCAG 1.4.10). */

/* ── The banner ──────────────────────────────────────────────────────────── */
.break-glass-banner {
  display: grid;
  gap: 0.35rem;
  min-inline-size: 0;
  margin-block-end: var(--density-gap);
  padding: 0.8rem 1rem;
  border: 1px solid var(--tone-warn-line);
  border-inline-start-width: 4px;
  border-radius: var(--radius-md);
  background: var(--tone-warn-bg);
  color: var(--tone-warn-fg);
  overflow-wrap: anywhere;
}

/* Bold whether it is a heading or (above the page's h1) the paragraph that names the section. */
.break-glass-banner__title {
  margin-block: 0;
  font-size: var(--text-md);
  font-weight: bold;
}

.break-glass-banner__reading,
.break-glass-banner__basis {
  margin-block: 0;
  max-inline-size: 72ch;
}

.break-glass-banner__basis {
  font-size: var(--text-sm);
}

.break-glass-banner__remaining {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.break-glass-banner__close {
  margin-block-start: 0.25rem;
}

/* ── The toast ───────────────────────────────────────────────────────────── */
.toast {
  display: grid;
  gap: 0.2rem;
  max-inline-size: 66ch;
  min-inline-size: 0;
  margin-block-end: var(--density-gap);
  padding: 0.7rem 1rem;
  border: 1px solid var(--toast-line);
  border-inline-start-width: 4px;
  border-radius: var(--radius-md);
  background: var(--toast-bg);
  color: var(--toast-fg);
  overflow-wrap: anywhere;
}
.toast[data-tone="good"] { --toast-bg: var(--tone-good-bg); --toast-fg: var(--tone-good-fg); --toast-line: var(--tone-good-line); }
.toast[data-tone="info"] { --toast-bg: var(--tone-info-bg); --toast-fg: var(--tone-info-fg); --toast-line: var(--tone-info-line); }
.toast[data-tone="warn"] { --toast-bg: var(--tone-warn-bg); --toast-fg: var(--tone-warn-fg); --toast-line: var(--tone-warn-line); }
.toast[data-tone="bad"] { --toast-bg: var(--tone-bad-bg); --toast-fg: var(--tone-bad-fg); --toast-line: var(--tone-bad-line); }

.toast__title,
.toast__text,
.toast__action {
  margin-block: 0;
}

.toast__title {
  font-weight: 600;
}

.toast__action a {
  color: inherit;
  text-decoration: underline;
}

/* ── The dialog ──────────────────────────────────────────────────────────── */
.dialog-host {
  display: inline-block;
}

.dialog {
  inline-size: min(40rem, calc(100% - 2rem));
  max-inline-size: 100%;
  max-block-size: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--fg1);
  box-shadow: var(--shadow-lift);
  overflow: auto;
}
.dialog::backdrop {
  background: var(--scrim-soft);
}

.dialog__body {
  display: grid;
  gap: var(--density-gap);
  padding: 1.25rem;
  overflow-wrap: anywhere;
}

.dialog__title {
  margin-block: 0;
  font-size: var(--text-md);
}

.dialog__cancel {
  margin: 0;
}
