/* Hardware-Tester.com - Headphone Tester
   Loaded AFTER /css/styles.css and /css/keyboard-tester.css (shared breadcrumb,
   .kt panel, .kt-stat, .kt-controls, .kt-section, FAQ and link-grid styles). */

.ht {
  --ht-left: #60a5fa;
  --ht-right: #34d399;
  --ht-warn: #fbbf24;
  --ht-bad: #f87171;
}

.ht-warning {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-left: 3px solid var(--ht-warn);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.08);
  color: var(--text);
  font-size: 0.95rem;
}

.ht-warning strong {
  color: var(--ht-warn);
}

.ht-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem 1.4rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

.ht-illustration {
  width: 8.5rem;
  height: auto;
  padding: 0.6rem 0.8rem;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: 1.25rem;
}

.ht-illustration .band {
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
}

.ht-illustration .cup {
  fill: var(--bg-card);
  stroke: currentColor;
  stroke-width: 3;
  transition: fill 0.12s ease, stroke 0.12s ease;
}

.ht-illustration text {
  fill: currentColor;
  font: 700 15px var(--font);
  text-anchor: middle;
}

.ht-illustration .is-on .cup {
  stroke-width: 4;
}

.ht-illustration .ht-cup-left.is-on { color: var(--ht-left); }
.ht-illustration .ht-cup-right.is-on { color: var(--ht-right); }
.ht-illustration .ht-cup-left.is-on .cup { fill: rgba(96, 165, 250, 0.28); }
.ht-illustration .ht-cup-right.is-on .cup { fill: rgba(52, 211, 153, 0.28); }

.ht-hero-copy h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.ht-hero-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.ht-error {
  margin: 0 0 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-left: 3px solid var(--ht-bad);
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.08);
  color: var(--text);
}

.ht-error[hidden] {
  display: none;
}

.ht-error h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.ht-error p {
  margin: 0;
  color: var(--text-muted);
}

/* Control groups ------------------------------------------------------ */
.ht-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 0.85rem;
  margin: 0 0 0.9rem;
}

.ht-group {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ht-group h3 {
  margin: 0 0 0.25rem;
  font-size: 1.02rem;
}

.ht-group > p {
  margin: 0 0 0.7rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.ht-group .kt-controls {
  margin-top: 0;
}

.ht .btn {
  min-height: 2.75rem;
}

.ht .btn.is-active {
  color: #06251f;
  background: var(--accent);
  border-color: var(--accent);
}

.ht .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ht-freqs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.ht-freq { white-space: nowrap; padding-inline: 0.5rem; }

.ht-freq[aria-pressed="true"] {
  color: #06251f;
  background: var(--accent);
  border-color: var(--accent);
}

.ht-radios {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
}

.ht-radios legend {
  padding: 0;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ht-radios label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  margin-right: 0.9rem;
  cursor: pointer;
}

.ht-radios input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}

.ht-volume {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ht-volume label {
  font-weight: 600;
}

.ht-volume input[type="range"] {
  width: 100%;
  height: 2.25rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.ht-volume output {
  min-width: 3.2rem;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ht-volume .ht-note {
  grid-column: 1 / -1;
  margin: 0;
}

.ht input:focus-visible,
.ht button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Channel indicator ---------------------------------------------------- */
.ht-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.ht-pad {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "ch name" "ch state";
  align-items: center;
  column-gap: 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.ht-pad-ch {
  grid-area: ch;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  font-size: 1.5rem;
  font-weight: 800;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--text-muted);
}

.ht-pad-name {
  grid-area: name;
  font-weight: 700;
}

.ht-pad-state {
  grid-area: state;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ht-pad.is-on {
  border-style: solid;
}

.ht-pad.is-on .ht-pad-state {
  color: var(--text);
  font-weight: 700;
}

#ht-pad-left.is-on { border-color: var(--ht-left); background: rgba(96, 165, 250, 0.14); }
#ht-pad-left.is-on .ht-pad-ch { color: var(--ht-left); background: rgba(96, 165, 250, 0.2); }
#ht-pad-right.is-on { border-color: var(--ht-right); background: rgba(52, 211, 153, 0.14); }
#ht-pad-right.is-on .ht-pad-ch { color: var(--ht-right); background: rgba(52, 211, 153, 0.2); }

.ht-pan {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ht-pan h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.ht-pan-track {
  position: relative;
  height: 0.5rem;
  margin: 0.9rem 0.8rem 0.5rem;
  background: var(--border-strong);
  border-radius: 999px;
}

.ht-pan-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.35rem;
  bottom: -0.35rem;
  width: 2px;
  background: var(--border-strong);
}

.ht-pan-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.4rem;
  height: 1.4rem;
  margin: -0.7rem 0 0 -0.7rem;
  background: var(--text-muted);
  border: 2px solid var(--bg);
  border-radius: 50%;
}

.ht-pan.is-live .ht-pan-dot {
  background: var(--accent);
}

.ht-pan-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ht-pan-labels span:nth-child(2) {
  font-weight: 600;
}

.ht-note {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.ht .kt-stat-value {
  font-size: 1.25rem;
}

/* Checklist ------------------------------------------------------------ */
.ht-check {
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.ht-check h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.ht-check fieldset {
  margin: 0.6rem 0 0;
  padding: 0;
  border: 0;
}

.ht-check legend {
  padding: 0;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ht-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ht-check-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  cursor: pointer;
}

.ht-check-list input {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

.ht-check-summary {
  margin: 0.75rem 0 0;
  font-weight: 700;
}

.ht-check-summary[data-state="issues"] { color: var(--ht-warn); }
.ht-check-summary[data-state="clear"] { color: var(--ht-right); }

@media (max-width: 640px) {
  .ht-hero {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .ht-illustration {
    width: 7rem;
  }

  .ht-channels {
    grid-template-columns: 1fr;
  }

  .ht-volume {
    grid-template-columns: 1fr auto;
  }

  .ht-volume input[type="range"] {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .ht .ht-group .kt-controls .btn {
    flex: 1 1 calc(50% - 0.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ht-pad,
  .ht-illustration .cup {
    transition: none;
  }
}
