/* Tester page styles (index.html) */
.tester { padding-top: 20px; }
.tester-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .tester-grid { grid-template-columns: minmax(0, 1fr); } }
.workspace, .active, .pane { min-width: 0; }
.ws-head .row > div { min-width: 0; }
.ws-name { overflow-wrap: anywhere; }

.dev-panel { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 960px) { .dev-panel { position: static; } }
.dev-list { display: flex; flex-direction: column; gap: 8px; }
.dev-item { text-align: left; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--text); font: inherit; position: relative; overflow: hidden; }
.dev-item:hover { border-color: var(--line-strong); }
.dev-item[aria-selected="true"] { border-color: var(--gp); background: color-mix(in srgb, var(--gp) 8%, var(--bg)); }
.dev-item[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gp); }
.dev-item .n { font-weight: 700; font-size: 14px; display: block; }
.dev-item .m { font-size: 12px; color: var(--muted); }
.support { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.support span { display: flex; justify-content: space-between; color: var(--muted); }

.empty { text-align: center; padding: 48px 24px; }
.empty h1 { font-size: clamp(24px, 3.4vw, 34px); }
.empty p { max-width: 620px; margin: 0 auto 18px; }
.empty-icon { font-size: 72px; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }

.ws-head { padding-bottom: 0; margin-bottom: 16px; }
.ws-name { margin: 0 0 8px; font-size: 24px; }
.ws-head .tabs { margin: 8px -20px 0; padding: 0 12px; border-bottom: 0; border-top: 1px solid var(--line); }

.live-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 16px; }
@media (max-width: 1100px) { .live-grid { grid-template-columns: 1fr; } }
.pad-card { display: flex; align-items: center; justify-content: center; min-height: 320px; }
.pad-visual { width: 100%; max-width: 680px; }
.pad-svg { width: 100%; height: auto; display: block; }
.pad-body { fill: var(--panel-2); stroke: var(--line-strong); stroke-width: 3; }
.pad-well { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.pad-gate { fill: none; stroke: var(--line); stroke-dasharray: 3 4; }
.pad-btn { fill: var(--panel); stroke: var(--line-strong); stroke-width: 2; transition: fill .05s; }
.pad-btn.on { fill: var(--gp); stroke: var(--gp); filter: drop-shadow(0 0 6px var(--gp)); }
.pad-cap { fill: var(--panel-2); }
.pad-capdot { fill: var(--muted); }
.pad-fill { fill: var(--gp); opacity: .85; }
.pad-lbl { fill: var(--muted); font: 700 13px var(--font); pointer-events: none; }
.pad-face { font: 700 17px var(--font); pointer-events: none; }
.pad-touch { fill: var(--bg); }
.pad-touchdot { fill: var(--ok); }

.mini-sticks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.stick-canvas { width: 100%; max-width: 320px; aspect-ratio: 1; display: block; margin: 0 auto; background: var(--bg); border-radius: 50%; border: 1px solid var(--line); }
.stick-canvas.sm { max-width: 170px; }
.trig-row { display: grid; grid-template-columns: 18px 1fr 48px; gap: 10px; align-items: center; margin-bottom: 8px; font-weight: 700; }
.trig-row .progress > span { background: var(--gp); transition: none; }

.btn-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.bcell { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px; text-align: center; font-size: 12px; }
.bcell b { display: block; font-size: 13px; }
.bcell .v { font-family: var(--mono); color: var(--muted); }
.bcell.on { border-color: var(--gp); background: color-mix(in srgb, var(--gp) 14%, var(--bg)); }
.bcell.on .v { color: var(--gp); }
.axes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.axis { display: grid; grid-template-columns: 44px 1fr 64px; gap: 8px; align-items: center; font-size: 12px; }
.axis .bar { position: relative; height: 8px; background: var(--panel-2); border-radius: 4px; border: 1px solid var(--line); }
.axis .bar i { position: absolute; top: -1px; bottom: -1px; width: 3px; background: var(--gp); left: 50%; border-radius: 2px; }
.sm-select { width: auto; padding: 4px 8px; font-size: 13px; }

.slider { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 14px; }
.slider > span { display: flex; justify-content: space-between; color: var(--text-2); }
.slider output { font-family: var(--mono); color: var(--gp); }

.result { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.result .val { font-family: var(--mono); text-align: right; }
.big-num { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.check-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px; }
.check-row.ok { border-color: var(--ok); background: var(--ok-bg); }
.check-row.bad { border-color: var(--bad); background: var(--bad-bg); }
.manual-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 14px; }
.manual-item small { display: block; color: var(--muted); }
.manual-item:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }

.term { background: #020617; color: #a7f3d0; font: 12px/1.6 var(--mono); border-radius: 10px; padding: 12px; height: 180px; overflow: auto; border: 1px solid var(--line); }
.term .e { color: #fca5a5; } .term .w { color: #fcd34d; } .term .d { color: #94a3b8; }

.touch-canvas { width: 100%; aspect-ratio: 1920 / 1080; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; display: block; margin-bottom: 8px; }
.imu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.imu .axis { grid-template-columns: 54px 1fr 70px; }

.steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: s; flex-wrap: wrap; }
.steps li { flex: 1; min-width: 70px; font-size: 12px; text-align: center; padding: 6px 4px; border-radius: 8px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.steps li.cur { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); font-weight: 700; }
.steps li.done { color: var(--ok); }

.hist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hist-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.hist-card .t { font-weight: 700; }

.features .card h3 { font-size: 17px; }

/* Report (also used on /report) */
.rep { display: flex; flex-direction: column; gap: 16px; }
.rep-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.rep-verdict { font-size: 20px; font-weight: 800; padding: 8px 16px; border-radius: 10px; border: 2px solid; }
.rep-verdict.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.rep-verdict.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rep-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rep-item .k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.rep-item .v { font-weight: 700; }
.rep-notes { white-space: pre-wrap; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--text-2); }

/* Print only the open report */
@media print {
  body.print-report > *:not(#m-report) { display: none !important; }
  body.print-report #m-report { position: static; display: block; padding: 0; background: none; backdrop-filter: none; }
  body.print-report #m-report .modal-box { max-height: none; box-shadow: none; border: 0; max-width: none; }
}

/* =========================================================
   Lite / Technician modes
   ========================================================= */
.mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.tester-title { font-size: clamp(22px, 3vw, 30px); margin: 0; }
.mode-bar p { margin: 2px 0 0; }
body.mode-lite .tech-only { display: none !important; }
.ws-head { padding-bottom: 14px; }
body.mode-tech .ws-head { padding-bottom: 0; }

.status-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; font-family: inherit; }
.status-chip:hover { border-color: var(--line-strong); }
.status-chip .s { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-chip.ok .s { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-chip.warn .s { background: var(--warn); }
.status-chip.bad .s { background: var(--bad); }
.status-chip.prog .s { background: var(--accent); }
.restore-note { margin-top: 10px; font-size: 13px; color: var(--text-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.lite-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lite-pad { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.lite-pad .pad-visual { max-width: 620px; margin: 0 auto; }
.lite-card h3 { font-size: 17px; }
.lite-card .section-title > div { flex: 1; min-width: 0; }
.lite-cta { grid-column: span 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent-2) 18%, transparent)), var(--panel); }
.lite-grid:has(#lite-ps.hidden) .lite-cta { grid-column: 1 / -1; }
@media (max-width: 1100px) { .lite-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lite-pad { grid-row: auto; } .lite-grid .lite-cta { grid-column: 1 / -1; } }
@media (max-width: 680px) { .lite-grid { grid-template-columns: minmax(0, 1fr); } .lite-pad { grid-column: auto; } .lite-grid .lite-cta { grid-column: auto; } }
.ring { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.ring.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.verdict { display: inline-block; margin-top: 4px; }
.yesno { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.yesno > span { flex: 1; min-width: 140px; }
.yesno.answered-pass { border-color: color-mix(in srgb, var(--ok) 60%, transparent); background: var(--ok-bg); }
.yesno.answered-fail { border-color: color-mix(in srgb, var(--bad) 60%, transparent); background: var(--bad-bg); }
.pane-help { color: var(--text-2); font-size: 14px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.calib-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: c; }
.calib-steps li { counter-increment: c; padding: 12px 14px 12px 46px; position: relative; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.calib-steps li::before { content: counter(c); position: absolute; left: 12px; top: 11px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
@media (max-width: 760px) { .calib-steps { grid-template-columns: 1fr; } }
.support-box summary { cursor: pointer; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card:not([open]) > summary { margin-bottom: 0; }

/* =========================================================
   Checklist tiles
   ========================================================= */
.cl-head { margin-bottom: 16px; }
.cl-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .cl-layout { grid-template-columns: minmax(0, 1fr); } .cl-current { order: -1; } }
.cl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cl-tile { position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: inherit; min-height: 96px; overflow: hidden; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform .15s, border-color .15s; }
.cl-tile:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.cl-tile .ic { font-size: 22px; }
.cl-tile .t { font-weight: 700; font-size: 14px; line-height: 1.25; }
.cl-tile .st { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.cl-tile .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .2s; }
.cl-tile.current { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.cl-tile.pass { border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: linear-gradient(180deg, var(--ok-bg), transparent), var(--panel); }
.cl-tile.pass .st { background: var(--ok); color: #fff; border-color: transparent; }
.cl-tile.fail { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: linear-gradient(180deg, var(--bad-bg), transparent), var(--panel); }
.cl-tile.fail .st { background: var(--bad); color: #fff; border-color: transparent; }
.cl-tile.skip, .cl-tile.blocked { opacity: .65; }
.cl-current { position: sticky; top: calc(var(--header-h) + 16px); min-height: 280px; display: flex; flex-direction: column; gap: 12px; }
.cl-current .big-ic { font-size: 44px; line-height: 1; }
.cl-current h3 { font-size: 22px; margin: 0; }
.cl-current .help { color: var(--text-2); font-size: 15px; margin: 0; }
.cl-current .live { font-family: var(--mono); font-size: 13px; color: var(--text-2); padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); white-space: pre-wrap; }
.cl-current .nav { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cl-summary .big-num { font-size: 40px; }


/* =========================================================
   Neon: controller drawing, plots, hero
   ========================================================= */
.pad-body { stroke: color-mix(in srgb, var(--gp) 55%, var(--line-strong)); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--gp) 38%, transparent)); transition: stroke .4s, filter .4s; }
.pad-btn.on { filter: drop-shadow(0 0 4px var(--gp)) drop-shadow(0 0 14px var(--gp)); }
.pad-cap { stroke: color-mix(in srgb, var(--gp) 45%, var(--line-strong)); }
.pad-visual { filter: drop-shadow(0 22px 34px color-mix(in srgb, var(--gp) 24%, transparent)); }
.pad-touchdot { filter: drop-shadow(0 0 8px var(--ok)); }
.stick-canvas { box-shadow: 0 0 0 1px var(--line), 0 0 30px -8px color-mix(in srgb, var(--gp) 55%, transparent), inset 0 0 26px -10px color-mix(in srgb, var(--gp) 50%, transparent); }
.dev-item[aria-selected="true"] { box-shadow: 0 0 22px -8px var(--gp), inset 0 0 18px -12px var(--gp); }
.dev-item[aria-selected="true"]::before { box-shadow: 0 0 12px var(--gp); }
.bcell.on { box-shadow: 0 0 14px -2px var(--gp); }
.status-chip.ok { border-color: color-mix(in srgb, var(--ok) 55%, transparent); box-shadow: 0 0 14px -6px var(--ok); }
.status-chip.ok .s { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent, 0 0 12px var(--ok); } }
.ring.ok { box-shadow: 0 0 16px -4px var(--ok); }
.lite-cta { border-color: color-mix(in srgb, var(--neon-violet) 40%, var(--line)); }
.cl-tile.pass { box-shadow: 0 0 22px -10px var(--ok); }
.cl-tile.fail { box-shadow: 0 0 22px -10px var(--bad); }
.cl-tile.current { box-shadow: 0 0 0 2px color-mix(in srgb, var(--neon-cyan) 55%, transparent), 0 0 26px -6px var(--neon-cyan); animation: tilepulse 2.4s ease-in-out infinite; }
@keyframes tilepulse { 50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--neon-pink) 55%, transparent), 0 0 30px -4px var(--neon-pink); } }
.cl-current .big-ic { filter: drop-shadow(0 0 14px var(--neon-cyan)); animation: floaty 3.4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-5px); } }
.mode-bar { padding: 4px 2px 6px; }

/* hero (no controller yet) */
.empty { position: relative; overflow: hidden; }
.hero-pad { width: min(440px, 80%); height: auto; margin: 0 auto 6px; display: block; overflow: visible; }
.hero-pad .hp-body { fill: color-mix(in srgb, var(--neon-violet) 8%, transparent); stroke: url(#hg); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s .2s ease-out forwards, hue 8s linear infinite; filter: drop-shadow(0 0 10px var(--neon-cyan)) drop-shadow(0 0 28px var(--neon-violet)); }
.hero-pad .hp-stick, .hero-pad .hp-touch, .hero-pad .hp-dpad { fill: none; stroke: color-mix(in srgb, var(--neon-cyan) 70%, transparent); stroke-width: 2.5; opacity: 0; animation: fadein .8s 1.6s forwards; }
.hero-pad .hp-dot { fill: none; stroke-width: 3; opacity: 0; animation: fadein .6s forwards, blink 3.2s 2.4s infinite; }
.hero-pad .d1 { stroke: #34d399; animation-delay: 1.5s, 2.4s; } .hero-pad .d2 { stroke: #f87171; animation-delay: 1.6s, 2.9s; } .hero-pad .d3 { stroke: #60a5fa; animation-delay: 1.7s, 3.4s; } .hero-pad .d4 { stroke: #f472b6; animation-delay: 1.8s, 3.9s; }
.hero-pad .hp-ring { fill: none; stroke: var(--neon-cyan); stroke-width: 2; opacity: 0; transform-origin: 320px 230px; animation: ripple 3.6s 2s ease-out infinite; }
.hero-pad .r2 { animation-delay: 3.2s; stroke: var(--neon-violet); } .hero-pad .r3 { animation-delay: 4.4s; stroke: var(--neon-pink); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes blink { 0%, 100% { filter: none; } 8% { filter: drop-shadow(0 0 8px currentColor) brightness(1.8); fill: color-mix(in srgb, currentColor 35%, transparent); } 20% { filter: none; } }
@keyframes ripple { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes hue { 50% { filter: drop-shadow(0 0 12px var(--neon-pink)) drop-shadow(0 0 30px var(--neon-cyan)); } }
.hero-pad .d1, .hero-pad .d2, .hero-pad .d3, .hero-pad .d4 { color: #fff; }
.empty h2 { background: linear-gradient(95deg, var(--text), var(--neon-cyan) 60%, var(--neon-pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
