/* ── The single device drawer (docs/handoff.md 5.2, W2) ─────────────────────
   static/lib/assets/device-drawer.js on the frame of assets-drawer.css:
   source chips, the issues box, "What each source says" and the Records
   blocks, the history bar pinned at the bottom (opens in place, scrolls
   inside), and the one-line purchase and tickets rows. Status is a shape and
   a word, never colour alone (DESIGN.md §2, §6). Tokens only. */

.dd-serial { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; font-size: var(--fs-13); color: var(--text-2); }
.dd-not-armory { padding-right: 9px; color: var(--warn); background: var(--warn-dim); font-weight: 600; }
.ast-drawer-top .btn-ghost { gap: 4px; }

/* Source chips (replace the source-health card grid). */
.dd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dd-chip {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
    height: 26px; padding: 0 9px;
    border-radius: var(--radius-pill);
    box-shadow: inset 0 0 0 1px var(--border-sub);
    font-size: var(--fs-12); color: var(--text-2);
}
.dd-chip b { font-weight: 600; color: var(--text); }
.dd-chip-why { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chip.is-ok svg { color: var(--success); }
.dd-chip.is-warn { background: var(--warn-dim); color: var(--warn); }
.dd-chip.is-warn b, .dd-chip.is-warn svg { color: var(--warn); }
.dd-chip.is-unknown svg { color: var(--text-3); }

/* Issues: one line each, opening in place to why / suggested action. */
.dd-issues { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
/* A line wraps its actions (same-person buttons, who decided + Undo) under
   the text rather than squeezing the text to a column of letters. */
.dd-issues > li { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.dd-issue { flex: 1 1 14rem; min-width: 0; font-size: var(--fs-13); }
.dd-issue summary, .dd-issue.is-plain { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dd-issue.is-plain { cursor: default; }
.dd-issue-text { min-width: 0; overflow-wrap: anywhere; }
.dd-issue p { margin: 6px 0 0 4px; color: var(--text-2); }
.dd-issue-link { flex: none; font-size: var(--fs-12); color: var(--accent-text); }

/* Overview sources: the ones that are fine, named in one line. */
.dd-ok-line { margin: 6px 0 0; font-size: var(--fs-13); }

/* Device facts: who reports them (the MDM once, then Armory's own). */
.dd-facts-from { margin: 0 0 6px; font-size: var(--fs-12); color: var(--text-3); }
.ast-facts + .dd-facts-from { margin-top: 12px; }

/* Device facts beyond the first few. */
.dd-more-facts { margin-top: 10px; font-size: var(--fs-13); }
.dd-more-facts summary { cursor: pointer; color: var(--accent-text); }
.dd-more-facts .ast-facts { margin-top: 10px; }

/* Notes and flags (the asset's note and the serial's annotations), and the
   header's tag pills. */
.dd-annotations { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-13); }
.dd-annotations li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.dd-annotations .ast-link { margin-left: auto; font-size: var(--fs-12); }
.dd-tag { background: var(--sunken); color: var(--text-2); }

/* Purchase and tickets: one secondary line each. */
.dd-lines { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border-sub); }
.dd-line { margin: 0; font-size: var(--fs-13); color: var(--text-2); }
.dd-line-k { font-weight: 600; color: var(--text); }
.dd-line .ast-link { font-size: var(--fs-13); }

/* The Sources tab: the same rhythm as the panels (one wrapper, filled later). */
[data-sources] { display: flex; flex-direction: column; gap: 20px; }
.dd-summary { margin: 0; font-size: var(--fs-13); color: var(--text-2); }
.dd-says { display: grid; gap: 10px; margin: 0; }
.dd-say { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; }
.dd-say dt { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-12); color: var(--text-3); }
.dd-say dd { display: grid; gap: 4px; min-width: 0; margin: 0; }
.dd-disagree { font-size: var(--fs-12); font-weight: 600; color: var(--conflict); }
.dd-say.is-disagree dd { padding-left: 8px; box-shadow: inset 2px 0 0 var(--conflict); }
.dd-val { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; font-size: var(--fs-13); font-weight: 500; }
.dd-val > span:first-child, .dd-val > time { overflow-wrap: anywhere; }
.dd-val.is-shown { font-weight: 400; color: var(--text-2); }
.dd-who { font-size: var(--fs-12); font-weight: 400; color: var(--text-3); }
.dd-note { margin: 10px 0 0; font-size: var(--fs-12); }

.dd-record { border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--border-sub); }
.dd-record + .dd-record { margin-top: 8px; }
.dd-record summary { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: var(--fs-13); }
.dd-record[open] summary { border-bottom: 1px solid var(--border-sub); }
.dd-record-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; padding: 10px 12px; }
.dd-record-fields dt { font-size: var(--fs-12); color: var(--text-3); }
.dd-record-fields dd { margin: 2px 0 0; font-size: var(--fs-13); overflow-wrap: anywhere; }
.dd-record-fields code { font-size: var(--fs-12); }
.dd-record > .ast-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 12px 10px; font-size: var(--fs-13); color: var(--accent-text); }

/* History: a bar at the bottom of the drawer that opens in place (about
   half the drawer's height) and scrolls inside. */
.ast-drawer > [data-history] { flex: none; border-top: 1px solid var(--border-sub); background: var(--surface); }
.dd-history-bar {
    display: flex; align-items: center; gap: 8px; width: 100%;
    height: 44px; padding: 0 18px;
    border: 0; background: transparent; cursor: pointer;
    font: inherit; font-size: var(--fs-13); font-weight: 600; color: var(--text);
}
.dd-history-bar > span { flex: 1; text-align: left; }
.dd-history-bar:hover { background: var(--hover); }
.dd-history-panel { display: flex; flex-direction: column; height: 46vh; border-top: 1px solid var(--border-sub); }
.dd-history-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 18px; }
.dd-history-filters .btn[aria-pressed="true"] { background: var(--accent-dim); color: var(--accent-text); border-color: var(--accent-border); }
.dd-evidence { margin-left: auto; font-size: var(--fs-13); color: var(--accent-text); }
.dd-history-list { flex: 1; overflow-y: auto; padding: 4px 18px 16px; }
.dd-history-more { margin-top: 12px; }

@media (max-width: 720px) {
    .dd-say { grid-template-columns: minmax(0, 1fr); }
    .dd-record-fields { grid-template-columns: minmax(0, 1fr); }
    .dd-history-panel { height: 60vh; }
}
