/* Alert pages and the header badge (Wave 3D). Design V2 tokens from style.css only; no new colours.
   Levels: High = error tokens, Medium = no-yield (orange) tokens, Low = ready (blue) tokens, Info = hold (grey).
   Breakpoints as style.css: TV >= 1440, laptop 1024-1439, tablet 600-1023, phone < 600 (44 px targets). */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.al-page { max-width: 1700px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.al-page .panel { margin: 0; min-width: 0; }
.al-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.al-head h1 { margin: 0; font-size: 28px; }
.al-sub { margin: 4px 0 10px; font-size: 15px; color: var(--text-muted); line-height: 1.4; }
.al-empty { margin: 8px 0; color: var(--text-muted); font-size: 18px; }
.al-n { display: inline-block; margin-left: 6px; padding: 0 10px; border-radius: 12px; background: var(--track);
  font-size: 16px; font-weight: 600; vertical-align: middle; }

/* buttons and links that act like buttons */
.al-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius); font-size: 16px; font-weight: 700; text-decoration: none; white-space: nowrap;
  width: auto; margin: 0; }
.al-btn-ack { background: var(--ready-fill); border: 2px solid var(--ready-line); color: var(--ready-text); }
.al-btn-shelve, .al-btn-quiet { background: var(--surface); border: 1px solid var(--input-line); color: var(--text); }
.al-btn:hover { border-color: var(--link); }
.al-btn:focus-visible, .al-badge:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* level pill, state tag */
.al-level, .al-count, .al-badge-n { display: inline-block; padding: 2px 10px; border-radius: 8px; border: 1px solid;
  font-weight: 700; font-size: 15px; white-space: nowrap; }
.al-lv-high { background: var(--error-fill); border: var(--error-line-width) solid var(--error-line); color: var(--error-text); }
.al-lv-medium { background: var(--noyield-fill); border-color: var(--noyield-line); color: var(--noyield-text); }
.al-lv-low { background: var(--ready-fill); border-color: var(--ready-line); color: var(--ready-text); }
.al-lv-info { background: var(--hold-fill); border-color: var(--hold-line); color: var(--hold-text); }
.al-state { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-muted); white-space: nowrap; }
.al-st-active { color: var(--text); border-color: var(--input-line); }
.al-st-acknowledged { background: var(--ok-fill); border-color: var(--ok-line); color: var(--ok-text); }
.al-st-shelved { background: var(--offline-fill); border-color: var(--offline-line); color: var(--offline-text); }
.al-until { font-size: 14px; color: var(--text-muted); }
.al-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; font-size: 15px; }

/* the list / history table */
.al-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.al-table th, .al-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--track);
  vertical-align: middle; }
.al-table thead th { font-size: 14px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.al-table tbody th { font-weight: 600; color: var(--text); font-size: inherit; }
.al-table .al-msg, .al-table .al-rule { white-space: normal; }
.al-table .al-msg { min-width: 12em; }
.al-msg a { color: var(--link); overflow-wrap: anywhere; }
.al-msg a:hover { color: var(--link-hover); }
.al-rule { color: var(--text-muted); font-size: 14px; overflow-wrap: anywhere; }
.al-row-high { background: var(--error-fill); }
.al-row-high td, .al-row-high th { border-bottom-color: var(--error-line); }
.al-actions { white-space: nowrap; text-align: right; }
.al-act { display: inline-block; margin: 0; }
.al-actions .al-btn { margin: 2px 0 2px 6px; }

/* detail */
.al-detail-top { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.al-detail-msg { font-size: 24px; overflow-wrap: anywhere; }
.al-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 24px; margin: 12px 0 0; }
.al-facts div { min-width: 0; }
.al-facts dt { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.al-facts dd { margin: 2px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.al-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.al-form label { margin-top: 8px; }
.al-form .al-btn { margin-top: 16px; min-width: 200px; min-height: 48px; }

/* history filters */
.al-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.al-filter label { margin: 0; font-size: 15px; color: var(--text-muted); }
.al-filter input, .al-filter select { width: auto; min-width: 150px; color: var(--text); }
.al-filter button { width: auto; margin: 0; padding: 0 28px; }

/* header badge (base.html slot, integration) */
.al-badge-slot { display: flex; align-items: center; }
.al-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
  font-weight: 600; font-size: 16px; white-space: nowrap; }
.al-badge-high { border: var(--error-line-width) solid var(--error-line); }
.al-badge-n { padding: 0 8px; font-size: 15px; }
.al-badge-zero { background: var(--track); border-color: var(--line); color: var(--text-muted); }

@media (min-width: 1440px) {
  .al-head h1 { font-size: 34px; }
  .al-table { font-size: 18px; }
  .al-level { font-size: 17px; }
}

@media (max-width: 1439px) {
  .al-actions { white-space: normal; }
  .al-actions .al-btn { display: flex; width: 100%; margin: 4px 0; }
  .al-act { display: block; }
}

@media (max-width: 1023px) {
  .al-head h1 { font-size: 24px; }
  .al-table th, .al-table td { padding: 8px 6px; font-size: 15px; }
  .al-forms { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 599px) {
  .al-head h1 { font-size: 22px; }
  .al-table, .al-table tbody { display: block; }
  .al-table thead { display: none; }
  .al-table tr { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px;
    padding: 4px 14px 8px; margin-bottom: 10px; }
  .al-row-high { border: var(--error-line-width) solid var(--error-line); }
  .al-table tbody th, .al-table td { display: flex; justify-content: space-between; align-items: center; gap: 8px;
    min-height: 44px; padding: 6px 0; border-top: 1px solid var(--track); border-bottom: 0; text-align: right;
    white-space: normal; font-size: 16px; }
  .al-table tbody th { order: -1; border-top: 0; justify-content: flex-start; text-align: left; font-size: 18px; }
  .al-table td::before, .al-table tbody th.al-msg::before { content: attr(data-label); color: var(--text-muted);
    font-size: 13px; font-weight: 600; text-align: left; flex: 0 0 auto; }
  .al-table tbody th.al-msg::before { content: none; }
  .al-msg a { display: inline-flex; align-items: center; min-height: 44px; }
  .al-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; text-align: left; }
  .al-table td.al-actions::before { content: none; }
  .al-actions .al-btn, .al-act, .al-act .al-btn { width: 100%; margin: 0; }
  .al-facts { grid-template-columns: minmax(0, 1fr); }
  .al-form .al-btn { width: 100%; min-width: 0; }
  .al-filter label { flex: 1 1 40%; }
  .al-filter input, .al-filter select { width: 100%; min-width: 0; }
  .al-filter button { flex: 1 1 40%; }
  .al-badge-label { display: none; }
  .al-badge-slot { grid-column: 1 / -1; justify-self: start; }   /* topbar is a grid on phones */
}
