/* Fleet dashboard (tools/status-anchor/DASHBOARD.md).
   Every colour is one of the tokens index.html defines for both themes; this
   file names no colour of its own (test/fleet-dashboard.test.js checks that).
   Mobile first, in the app's 720-pixel column: nothing here widens the page,
   and everything that takes a tap is at least 44 by 44 pixels. */

.fd { margin-top: 18px; }
.fd-summary { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.fd-stale {
  background: var(--down-soft); color: var(--down); border: 1px solid var(--down-line);
  border-radius: 10px; padding: 10px 14px; font-weight: 600; margin-bottom: 12px;
}
/* A stale summary stays readable, greyed: every colour inside it becomes the
   muted grey, while text keeps its contrast. No opacity or filter, which
   would drop the muted text below 4.5:1 (test/fleet-dashboard.test.js checks
   the contrast in both themes). The red line above it carries the warning. */
.fd-is-stale .fd-content {
  --ok: var(--muted); --warn: var(--muted); --down: var(--muted); --accent: var(--muted);
  --accent-soft: var(--muted-soft); --warn-soft: var(--muted-soft); --accent-line: var(--border);
}
.fd-totals { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 600; margin-bottom: 10px; }
.fd-note { color: var(--muted); padding: 16px 0; }
.fd-note.fd-bad, .fd-bad { color: var(--down); }
.fd-pill { border-radius: 9px; padding: 1px 8px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }

/* A layer: a full-width press opens and closes it. */
.fd-layer { margin-top: 14px; border-top: 1px solid var(--rule); }
.fd-layer-head { margin: 0; font-size: 14px; }
button.fd-toggle {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: transparent; color: var(--fg); border: 0; border-radius: 0; padding: 8px 0;
  text-align: left; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
button.fd-toggle .fd-muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
button.fd-toggle::before { content: "▸"; color: var(--muted); }
button.fd-toggle[aria-expanded="true"]::before { content: "▾"; }
.fd-layer-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fd-count { color: var(--muted); font-weight: 400; font-size: 13px; text-transform: none; }
.fd-layer-body { display: grid; gap: 10px; padding-bottom: 6px; }
.fd-empty { padding: 6px 0; }

/* A host and a component share the host cards' look: a panel with a coloured
   left edge. */
.fd-host, details.fd-comp {
  background: var(--panel); border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px;
  padding: 10px 14px; min-width: 0;
}
.fd-host { border-left-color: var(--accent); }
details.fd-comp { border-left-color: var(--muted); padding-top: 0; padding-bottom: 0; }
.fd-host > *, .fd-body > * { min-width: 0; overflow-wrap: anywhere; }
.fd-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fd-name { font-weight: 600; overflow-wrap: anywhere; }
.fd-checkin { font-size: 13px; }
.fd-checkin.ok { color: var(--ok); }
.fd-checkin.warn { color: var(--warn); }
.fd-checkin.down { color: var(--down); }
.fd-checkin.unknown { color: var(--muted); }
.fd-muted { color: var(--muted); }
.fd-line { font-size: 13px; margin-top: 4px; }
.fd-label { color: var(--muted); margin-right: 4px; }
.fd-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

details.fd-comp > summary {
  min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  cursor: pointer; list-style: none; padding: 8px 0;
}
details.fd-comp > summary::-webkit-details-marker { display: none; }
details.fd-comp > summary::before { content: "▸"; color: var(--muted); }
details.fd-comp[open] > summary::before { content: "▾"; }
.fd-where { font-size: 13px; }
.fd-checks { margin-left: auto; letter-spacing: .15em; font-size: 13px; white-space: nowrap; }
.fd-check-passed { color: var(--ok); }
.fd-check-blocked { color: var(--down); }
.fd-check-open { color: var(--fg); }
.fd-check-stretch, .fd-check-na { color: var(--muted); }
.fd-body { padding: 0 0 10px; }
.fd-limit { border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 6px; }
.fd-headroom { color: var(--ok); }
.fd-headroom.fd-over { color: var(--down); font-weight: 600; }

/* Every link here is a tap target of at least 44 by 44 pixels. */
a.fd-chip {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  padding: 0 12px; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-soft);
  color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600; max-width: 100%;
  overflow-wrap: anywhere;
}

.fd-legend { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 10px; color: var(--muted); font-size: 12px; display: grid; gap: 4px; }

/* The effect of a change. */
.fd-change { display: grid; gap: 6px; }
.fd-change-title { font-size: 16px; margin: 6px 0; }
.fd-change .fd-muted { font-size: 13px; }
.fd-change input { min-height: 44px; max-width: 12em; }
table.fd-effect { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 6px; }
table.fd-effect th, table.fd-effect td { text-align: left; padding: 6px 8px 6px 0; border-top: 1px solid var(--rule); vertical-align: top; }
table.fd-effect th { color: var(--muted); font-weight: 400; width: 45%; }
.fd-warn {
  background: var(--warn-soft); color: var(--warn); border-radius: 9px; padding: 8px 12px; font-weight: 600; font-size: 13px;
}
