/* T-010 calm alerts: the alert card (drawer), the line on each alert in the list, the level note, Alert health.
   Colours come from the shared tokens, so light and dark follow styles.css. */

/* List: "11× the usual · 26 people. Usually 1 to 4 a day." under the title */
.ab-line { display: block; margin-top: 4px; font-size: var(--t-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ab-line b { color: var(--ink); font-weight: 600; }
.ab-line .chip { height: 20px; font-size: 10.5px; }

/* Under the level choice */
.ab-level-note { margin: 12px 0 0; font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; text-wrap: pretty; }
.ab-level-note b { color: var(--ink); font-weight: 600; }

/* The card */
.ab-card { display: flex; flex-direction: column; gap: 14px; }
.ab-head { display: flex; gap: 12px; align-items: flex-start; }
.ab-head .a-icon { flex: none; }
.ab-what { margin: 0; font-size: var(--t-md); font-weight: 600; line-height: 1.35; color: var(--ink); text-wrap: balance; }
.ab-what b { font-weight: 700; }
.ab-what .hint { vertical-align: -0.2em; }
.ab-range { margin: 4px 0 0; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; font-variant-numeric: tabular-nums; text-wrap: pretty; }
.ab-range .chip { height: 22px; font-size: 11px; vertical-align: 1px; }
.text-btn.ab-num { display: inline; font: inherit; font-weight: 600; color: var(--accent); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; padding: 2px 0; margin: 0; min-height: 0; border-radius: 4px; }
.ab-table .text-btn.ab-num { display: inline-flex; padding: 4px 6px; margin: -4px -6px; }
.ab-num:hover { text-decoration-color: currentColor; }

.ab-chart { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.ab-chart-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ab-spark { display: flex; flex-direction: column; gap: 4px; border-radius: var(--r-xs); outline-offset: 3px; }
.ab-spark:focus-visible { outline: 2px solid var(--focus); }
.ab-spark svg { width: 100%; height: 64px; display: block; cursor: pointer; touch-action: pan-y; }
.ab-band { fill: var(--chart-band); stroke: var(--pos); stroke-opacity: 0.25; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.ab-bar { fill: var(--neu); transition: fill 0.12s var(--ease-std); }
.ab-bar.hol { fill: var(--neu); fill-opacity: 0.4; }
.ab-bar.now { fill: var(--neg); }
.ab-bar.on { fill: var(--ink-2); }
.ab-bar.now.on { fill: var(--neg-text); }
.ab-card[data-event^="t-price"] .ab-bar.now, .ab-card[data-event^="all-pos"] .ab-bar.now { fill: var(--pos); }
.ab-spark-axis { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-micro); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ab-spark-axis span { display: inline-flex; align-items: center; gap: 5px; }
.ab-key-band { width: 14px; height: 8px; border-radius: 2px; background: var(--chart-band); border: 1px dashed color-mix(in srgb, var(--pos) 40%, transparent); display: inline-block; }
.ab-readout { margin: 2px 0 0; min-height: 1.5em; font-size: var(--t-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ab-readout b { color: var(--ink); font-weight: 600; }

.ab-table-wrap { max-height: 260px; overflow: auto; border-radius: var(--r-xs); }
.ab-table { width: 100%; border-collapse: collapse; font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.ab-table th, .ab-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ab-table th { font-weight: 600; color: var(--ink-3); position: sticky; top: 0; background: var(--surface-2); }
.ab-table .r { text-align: right; }
.ab-table tr.now td { font-weight: 600; color: var(--ink); }

.ab-sum { margin: 0; display: flex; gap: 8px; align-items: baseline; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.chip.ab-ai { height: 20px; padding: 0 7px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; background: var(--violet-soft); color: color-mix(in srgb, var(--violet) 45%, var(--ink)); flex: none; }

.ab-posts { display: flex; flex-direction: column; gap: 6px; }
.ab-post { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; padding: 10px 12px; min-height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; transition: border-color 0.15s var(--ease-std), background 0.15s var(--ease-std); }
.ab-post:hover { border-color: var(--line-2); background: var(--surface-2); }
.ab-post:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ab-post-q { font-size: var(--t-sm); color: var(--ink); line-height: 1.45; }
.ab-post-src { font-size: var(--t-xs); color: var(--ink-3); }

.ab-prov { margin: 0; display: flex; flex-wrap: wrap; column-gap: 8px; row-gap: 2px; align-items: baseline; font-size: var(--t-sm); color: var(--ink-3); }
.ab-prov .ab-num { white-space: nowrap; }
.ab-also { margin: 0; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.5; }
.ab-also b { font-weight: 600; color: var(--ink); }
.ab-note { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; }
.ab-note .ico { margin-top: 2px; flex: none; }
.ab-missing { color: var(--warn-text); }

.ab-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ab-actions .btn { min-height: 44px; }
.ab-fb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-3); }
.ab-fb span { margin-right: auto; }
.ab-fb .btn { min-height: 40px; }

.ab-why summary { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-2); cursor: pointer; min-height: 36px; list-style: none; }
.ab-why summary::-webkit-details-marker { display: none; }
.ab-why[open] summary .ico { transform: rotate(180deg); }
.ab-why ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.5; }

/* Daily bundle */
.ab-bundle-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ab-bundle-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; min-height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.ab-bundle-row:hover { background: var(--surface-2); }
.ab-bundle-row b { font-size: var(--t-sm); font-weight: 500; color: var(--ink); }
.ab-bundle-row small { font-size: var(--t-xs); color: var(--ink-3); }

/* Alert health (Settings) */
.ab-health .card-head { align-items: flex-start; gap: 12px; }
.ab-health-wrap { overflow-x: auto; }
.ab-health-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.ab-health-table th, .ab-health-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.ab-health-table thead th { font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); }
.ab-health-table tbody th { font-weight: 500; color: var(--ink); }
.ab-health-table .r { text-align: right; }
.ab-health-table tr.flag td:last-child { color: var(--warn-text); font-weight: 600; }
.ab-health-table .chip { height: 20px; font-size: 10.5px; margin-left: 4px; }
.ab-health-note { margin: 10px 0 0; display: flex; gap: 6px; align-items: flex-start; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.5; }
.ab-health-note .ico { margin-top: 2px; flex: none; color: var(--warn); }
.ab-health .ab-why { margin-top: 8px; }

@media (max-width: 767px) {
  .ab-actions .btn { flex: 1 1 auto; }
  .ab-health-table thead th { font-size: 10.5px; }
  .ab-health-table th, .ab-health-table td { padding: 8px 4px; }
}
@media (prefers-reduced-motion: reduce) { .ab-bar { transition: none; } }

/* UX wave 1 (2026-10-11): the level panel as one line until opened; it opens in place and is remembered per viewer */
.screen.split-screen.alerts-compact { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "b" "a"; grid-template-rows: auto auto minmax(0, 1fr); }
.split-screen > .pb.ab-compact { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; min-height: 0; }
.ab-compact-l { margin: 0; flex: 1 1 auto; min-width: 0; font-size: var(--t-sm); color: var(--ink-2); }
.ab-compact-l b { color: var(--ink); font-weight: 600; }
.ab-compact .btn { flex: none; min-height: 40px; }
.ab-panel-close { flex: none; align-self: flex-start; }

/* Read daily summaries folded into one quiet row */
.alert-fold { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 12px 14px; min-height: 52px; text-align: left; border-radius: var(--r-md); border: 1px dashed var(--line-2); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.alert-fold:hover { background: var(--surface-2); }
.alert-fold:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.alert-fold-t { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.alert-fold-t b { font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.alert-fold-t small { font-size: var(--t-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-fold[aria-expanded="true"] .alert-fold-ico { transform: rotate(180deg); }
.alert-fold + .alert-item { margin-top: 10px; }

/* Card: the metric leads; the high-risk card leads with the quote */
.ab-head-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.ab-head-body .ab-range { margin: 0; }
.ab-what .chip { height: 22px; font-size: 11px; margin-right: 4px; vertical-align: 1px; }
.ab-quote { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r-sm); border: 0; border-left: 3px solid var(--neg); background: var(--neg-soft); color: inherit; font: inherit; cursor: pointer; }
.ab-quote:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ab-quote .ab-post-q { font-size: var(--t-base); }
.ab-fb .btn.ab-fb-btn { min-height: 36px; color: var(--ink-3); }
.ab-fb .btn.ab-fb-btn[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.ab-why li.ab-also b { font-weight: 600; }
