/* Dormouse Device: shared styles for the free tests (keyboard, screen, sound & camera).
   Builds on controller-tester.css (ct-panel, ct-kicker, ct-note …) and the colours in styles.css. */

.tt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.tt-span { grid-column: 1 / -1; }
@media (max-width: 860px) { .tt-grid { grid-template-columns: 1fr; } }
.tt-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tt-status { margin: 0; }
.tt-gap { margin-top: 14px; }
.tt-error { color: #B23A2E; font-weight: 600; }
.tt-steps { padding-left: 1.3em; }
.tt-steps li { margin-bottom: 8px; }
.tt-select {
  font: 500 1rem var(--font-body); color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 8px 12px; width: 100%; max-width: 420px;
}
.tt-facts { margin: 0; display: grid; gap: 10px; }
.tt-facts div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tt-facts dt { color: var(--slate); }
.tt-facts dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- keyboard ---------- */
.kb-wrap { overflow-x: auto; padding-bottom: 4px; }
.kb {
  --u: clamp(26px, 5.4vw, 58px);
  min-width: 620px; display: grid; gap: 6px; padding: 14px; border-radius: var(--radius-md);
  background: var(--ink); user-select: none;
}
.kb-row { display: flex; gap: 6px; height: var(--u); }
.kb-frow { height: calc(var(--u) * 0.7); }
.kb-key, .kb-gap { flex: 1 1 0; min-width: 0; }
.kb-key {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: #2E3548; color: #fff; border-radius: 7px; border-bottom: 3px solid #161A25;
  font: 600 clamp(0.62rem, 1.2vw, 0.9rem)/1 var(--font-body); text-align: center;
  transition: background 60ms, transform 60ms;
}
.kb-key span { padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-key b { position: absolute; right: 4px; top: 2px; font-size: 0.62rem; font-weight: 700; opacity: 0.8; }
.kb-key.is-done { background: var(--moss); border-bottom-color: #34553A; }
.kb-key.is-double { background: #B23A2E; border-bottom-color: #7E271F; }
.kb-key.is-down { background: var(--hazel); color: var(--ink); border-bottom-color: var(--hazel-deep); transform: translateY(2px); }
.kb-gap.fn { display: flex; align-items: center; justify-content: center; color: #8A91A3; font-size: 0.8rem; border: 1px dashed #4A5163; border-radius: 7px; }
/* ISO Enter: the top part has no bottom edge, the tail sits under it */
.kb-key.enter-top { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: -6px; height: calc(100% + 6px); border-bottom: 0; z-index: 1; }
.kb-key.enter-tail { border-top-left-radius: 0; border-top-right-radius: 0; }
.kb-arrows { display: flex; gap: 6px; flex: 3 1 0; min-width: 0; }
.kb-arrows > .kb-key { align-self: flex-end; height: 50%; }
.kb-updown { flex: 1 1 0; display: grid; grid-template-rows: 1fr 1fr; gap: 3px; }
.kb-updown .kb-key { border-bottom-width: 2px; }
.kb-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 0.9rem; color: var(--slate); }
.kb-legend span { display: inline-flex; align-items: center; gap: 8px; }
.kb-sw { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.kb-sw-down { background: var(--hazel); }
.kb-sw-done { background: var(--moss); }
.kb-sw-double { background: #B23A2E; }
.kb-extra ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kb-extra li { background: #E4EDE4; border: 1px solid #BFD3BF; border-radius: var(--radius-sm); padding: 4px 10px; font-weight: 600; }
.kb-extra li span { color: var(--slate); font-weight: 400; margin-left: 4px; }
.kb-extra li.is-double { background: var(--hazel-tint); border-color: #B23A2E; }
.kb-extra li.is-down { background: var(--hazel); }

/* ---------- screen ---------- */
.sc-stage { position: fixed; inset: 0; z-index: 1000; background: #000; cursor: pointer; outline: none; }
.sc-stage[hidden] { display: none; }
html.sc-open, html.sc-open body { overflow: hidden; }
.sc-hint {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  max-width: min(90vw, 460px); text-align: center; padding: 14px 20px; border-radius: var(--radius-md);
  font: 500 1rem/1.5 var(--font-body); transition: opacity 600ms; pointer-events: none;
}
.sc-hint span { font-size: 0.85rem; opacity: 0.8; }
.sc-hint-dark { background: rgba(30, 36, 51, 0.85); color: #fff; }
.sc-hint-light { background: rgba(255, 255, 255, 0.9); color: var(--ink); }
.sc-hint.is-gone { opacity: 0; }

/* ---------- sound & camera ---------- */
.tt-meter { position: relative; height: 22px; background: var(--cream); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.tt-meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--moss), var(--hazel) 75%, #B23A2E); }
.tt-meter b { position: absolute; top: 0; bottom: 0; left: -2px; width: 2px; background: var(--ink); }
.tt-video { display: block; width: 100%; max-width: 720px; margin-top: 14px; border-radius: var(--radius-md); background: var(--ink); transform: scaleX(-1); aspect-ratio: 16 / 9; object-fit: contain; }

/* ---------- mouse and touchpad ---------- */
.ms-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
@media (max-width: 760px) { .ms-layout { grid-template-columns: 1fr; } }
.ms-pad {
  position: relative; min-height: 340px; border-radius: var(--radius-md); background: var(--ink); overflow: hidden;
  cursor: crosshair; user-select: none; -webkit-user-select: none; touch-action: none; outline: none;
}
.ms-pad:focus-visible { box-shadow: 0 0 0 3px var(--hazel); }
.ms-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ms-pad-hint { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: #fff; font-weight: 600; pointer-events: none; }
.ms-pad-hint span { color: var(--ink-soft); font-weight: 400; font-size: 0.92rem; max-width: 34ch; margin-top: 8px; }
.ms-side { display: grid; gap: 14px; justify-items: center; }
.ms-mouse { width: 150px; height: auto; }
.ms-body { fill: #2E3548; stroke: var(--ink); stroke-width: 4; }
.ms-key { fill: #3A4258; stroke: var(--ink); stroke-width: 3; transition: fill 60ms; }
.ms-key.is-done { fill: var(--moss); }
.ms-key.is-double { fill: #B23A2E; }
.ms-key.is-down { fill: var(--hazel); }
.ms-list { width: 100%; grid-template-columns: 1fr; }
.ms-scroll { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ms-scroll span { border: 1px solid var(--line); background: var(--cream); border-radius: var(--radius-sm); padding: 6px 12px; font-weight: 600; }
.ms-scroll span b { color: var(--slate); font-weight: 400; margin-left: 4px; }
.ms-scroll span.is-done { background: #E4EDE4; border-color: #BFD3BF; }
.ms-dbl {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 80px; border: 2px dashed var(--ink-soft);
  border-radius: var(--radius-md); font-weight: 700; user-select: none; -webkit-user-select: none; cursor: pointer; outline: none;
}
.ms-dbl b { font-weight: 400; color: var(--slate); }
.ms-dbl.is-done { border-style: solid; border-color: #BFD3BF; background: #E4EDE4; }
.ms-dbl.is-flash { animation: ms-flash 0.4s; }
@keyframes ms-flash { from { background: var(--hazel-tint); } }
.ms-drag-row { display: flex; gap: 16px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.ms-chip {
  font: 700 0.95rem var(--font-body); color: var(--ink); background: var(--hazel); border: 2px solid var(--ink);
  border-radius: 999px; padding: 10px 18px; cursor: grab; touch-action: none; position: relative; z-index: 2;
}
.ms-chip.is-dragging { cursor: grabbing; box-shadow: var(--shadow); }
.ms-drop {
  flex: 1 1 160px; min-height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px;
  border: 2px dashed var(--ink-soft); border-radius: var(--radius-md); color: var(--slate); font-weight: 600;
}
.ms-drop.is-over { border-color: var(--hazel); background: var(--hazel-tint); }
.ms-drop.is-done { border-style: solid; border-color: #BFD3BF; background: #E4EDE4; color: var(--ink); }

/* ---------- used laptop checkup ---------- */
.uc-progress { height: 8px; border-radius: 99px; background: var(--cream); overflow: hidden; }
.uc-progress i { display: block; height: 100%; width: 0; background: var(--moss); transition: width 0.2s; }
.uc-problems { color: #B23A2E; font-weight: 700; }
.uc-steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.uc-step { background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; }
.uc-step.is-ok { border-left-color: var(--moss); }
.uc-step.is-problem { border-left-color: #B23A2E; }
.uc-step.is-skip { border-left-color: var(--ink-soft); }
.uc-head { display: flex; gap: 12px; align-items: center; }
.uc-head h3 { margin: 0; font-size: 1.15rem; }
.uc-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.9rem; }
.uc-step.is-ok .uc-n { background: var(--moss); }
.uc-step.is-problem .uc-n { background: #B23A2E; }
.uc-how { margin: 10px 0 14px; color: var(--slate); }
.uc-how code { background: var(--cream); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.uc-marks { display: flex; flex-wrap: wrap; gap: 8px; }
.uc-mark { font: 600 0.95rem var(--font-body); color: var(--ink); background: var(--paper); border: 2px solid var(--ink-soft); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.uc-mark:hover { border-color: var(--ink); }
.uc-ok[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: #fff; }
.uc-problem[aria-pressed="true"] { background: #B23A2E; border-color: #B23A2E; color: #fff; }
.uc-skip[aria-pressed="true"] { background: var(--ink-soft); border-color: var(--ink-soft); }
.uc-note { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 0.9rem; color: var(--slate); }
.uc-note input, .uc-bat input { font: 1rem var(--font-body); color: var(--ink); background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.uc-bat { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; align-items: end; margin: 0 0 14px; }
.uc-bat label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--slate); }
.uc-or { grid-column: 1 / -1; font-size: 0.85rem; color: var(--slate); font-weight: 600; }
.uc-bat-out { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.uc-bat-out.is-good { color: var(--moss); }
.uc-bat-out.is-bad { color: #B23A2E; }
@media print {
  .site-header, .site-footer, .cta-band, .send-host, .uc-top .btn-row, .skip-link, .ct-privacy { display: none !important; }
  .uc-step { break-inside: avoid; }
}
