/* © 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; color: var(--orange); }   /* one colour (Maestro, 2026-11-06: "take out the tricolor fonts") */
.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%; } }

/* the head: the title and the one add button beside it */
.dev-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.dev-top .dev-title { margin: 0; }

/* bench's own devices: one row each, remove asks inline */
.dev-own-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.dev-own .dev-chip { margin-left: auto; }
.dev-own .btn { padding: 5px 12px; font-size: 12.5px; }
.dev-ask { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--caution); }
.dev-list:empty { display: none; }

/* the add-device dialog and the one-time credential screen (teenyverse.net's mint modal, in bench's skin) */
.dev-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); padding: 20px;
  width: min(560px, calc(100vw - 32px)); box-sizing: border-box; }
.dev-dialog::backdrop { background: rgba(5, 8, 14, .72); }
.dev-dialog form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.dev-dialog-title { margin: 0; font-size: 19px; color: var(--orange); }
.dev-pick { border: 0; margin: 0; padding: 0; }
.dev-pick legend, .dev-field > span:first-child { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); padding: 0; margin-bottom: 8px; }
.dev-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.dev-kindcard { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); font: inherit; text-align: left; cursor: pointer; }
.dev-kindcard:hover { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.dev-kindcard.on { border-color: var(--orange); color: var(--ink); box-shadow: 0 0 0 1px var(--orange) inset; }
.dev-kindcard:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.dev-kindname { font-weight: 600; font-size: 14px; }
.dev-kindhow { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.dev-field { display: flex; flex-direction: column; gap: 6px; }
.dev-field input { font: inherit; font-family: var(--mono); font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 10px; }
.dev-field input:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.dev-preview { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); }
.dev-preview.bad { color: var(--caution); }
.dev-actions-end { justify-content: flex-end; }

.dev-reveal { display: none; }
.dev-reveal[open] { display: flex; flex-direction: column; gap: 12px; }
.dev-reveal-name { margin: 0; font-size: 24px; font-weight: 700; color: var(--orange); overflow-wrap: anywhere; }
.dev-warn { margin: 0; font-size: 13.5px; color: var(--caution); }
.dev-warn-soft { color: var(--ink-dim); }
.dev-cred { margin: 0; display: grid; gap: 6px; }
.dev-cred div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.dev-cred dt { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.dev-cred dd { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.dev-secret { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dev-secret .btn { padding: 4px 10px; font-size: 12px; }
.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; }
