/* © 2026 William C. Chesher. All Rights Reserved.
   devices.css - the device setup page. Reads only the tokens and bench.css; the card is automate's hardware
   drawer in bench's skin: a header per device, sections inside, switches, one save per card. */


.dev-main { padding-bottom: 40px; max-width: 760px; }
.dev-title { margin: 0 0 6px; font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.01em; background: var(--genesis); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dev-lead { margin: 0 0 18px; color: var(--ink-dim); font-size: 14px; }
.dev-state { margin: 0 0 14px; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.dev-state:empty { display: none; }
.dev-state a { color: var(--orange); }

.dev-list { display: flex; flex-direction: column; gap: 12px; }
.dev-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.dev-card[open] { border-color: color-mix(in srgb, var(--orange) 35%, var(--line)); }
.dev-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.dev-card > summary::-webkit-details-marker { display: none; }
.dev-card > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.dev-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dev-kind { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.dev-chip { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-faint); }
.dev-chip.live { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 50%, var(--line)); }
.dev-chip.recent { color: var(--caution); border-color: color-mix(in srgb, var(--caution) 50%, var(--line)); }

.dev-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.dev-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.dev-sec:first-child { border-top: 0; padding-top: 0; }
.dev-sec-title { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.dev-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.dev-row > .dev-what { flex: 0 0 150px; color: var(--ink-dim); }
.dev-row input[type="number"], .dev-row select { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; min-width: 0; }
.dev-row input[type="number"] { width: 96px; }
.dev-row select { flex: 0 1 220px; }
.dev-row input[type="range"] { flex: 0 1 180px; accent-color: var(--orange); }
.dev-row output { font-family: var(--mono); font-size: 12px; color: var(--ink); min-width: 2ch; }
.dev-row input:focus-visible, .dev-row select:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.dev-unit { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.dev-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-check { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); cursor: pointer; }
.dev-check input { accent-color: var(--orange); margin: 0; }
.dev-check:has(input:checked) { color: var(--ink); border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); }
.dev-check:has(input:disabled) { opacity: .55; cursor: default; }
.dev-check .dev-gone { color: var(--caution); }
.dev-note { margin: 0; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }
.dev-err { margin: 0; font-size: 13px; color: var(--bad); }
.dev-err:empty, .dev-ok:empty { display: none; }
.dev-ok { margin: 0; font-size: 13px; color: var(--mint); }
.dev-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn[disabled] { opacity: .5; cursor: progress; }

@media (max-width: 560px) { .dev-row > .dev-what { flex-basis: 100%; } }

/* add a device: the same card, open when the student has none or arrives from the studio's ship it step */
.dev-add > summary .dev-name { color: var(--orange-lt); }
.dev-add .dev-row input[type="text"], .dev-add .dev-row input:not([type]) { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; min-width: 0; flex: 0 1 220px; font-family: var(--mono); }
.dev-settings { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
