/* Styles for the test and tool pages (tools agent). Reads the design tokens from site/styles/tokens.css. */

.tool { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-l); padding: 20px; margin: 22px 0 8px; scroll-margin-top: 76px; }
.tool h2 { margin-top: 0; font-size: clamp(21px, 3vw, 26px); }
.tool h2:focus, .tool h3:focus { outline: none; }
.tool h3 { margin-top: 0; }
.tool [hidden] { display: none !important; }
.tool__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }
.tool__progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tool__progress .bar { flex: 1; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.tool__progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.steps { padding-left: 1.3em; margin: 0 0 16px; }
.steps li { margin: 6px 0; }
.status { font-weight: 700; min-height: 1.6em; }
.hint { min-height: 1.4em; color: var(--wrong); }
.friend { background: var(--brand-soft); border-radius: var(--radius-s); padding: 10px 14px; font-weight: 600; }
.caveat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; font-size: 15px; }
.sound-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.sound-note .btn { flex: none; }

/* Microphone panel */
.mic { border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.mic[data-mic-state="listening"] { border-style: solid; border-color: var(--right); padding: 8px 14px; }
.mic__facts { padding-left: 1.1em; margin: 0 0 12px; }
.mic__facts li { margin: 6px 0; }
.mic__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.mic__problem h3 { color: var(--wrong); }
.mic__wait { font-weight: 700; margin: 0; }
.mic__live { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-weight: 700; color: var(--right); }
.mic__live .btn { margin-left: auto; }
.mic__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--wrong); animation: pulse 1.2s ease-in-out infinite; }

/* Live note */
.live { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 10px 0 16px; }
.live__note { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 14vw, 88px); line-height: 1; min-width: 2.5ch; text-align: center; color: var(--muted); transition: color .15s; }
.live__note.is-held { color: var(--brand); }
.live__hz { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Answers */
.pc-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 14px 0; }
.pc-btn { border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 4px; font-family: var(--display); font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--line); }
.pc-btn.is-black { background: var(--key-black); color: var(--key-black-ink); border-color: var(--key-black); box-shadow: 0 3px 0 var(--key-edge); font-size: 13px; }
.pc-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.pc-btn:disabled { opacity: .5; cursor: default; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.choice-row .btn { padding-top: 18px; padding-bottom: 18px; font-size: 19px; }
.feedback { border-radius: var(--radius-s); padding: 10px 14px; font-weight: 700; margin: 10px 0; }
.feedback.is-right { background: var(--right-soft); color: var(--right); }
.feedback.is-wrong { background: var(--wrong-soft); color: var(--wrong); }
.grade { font-weight: 800; font-family: var(--display); font-size: 20px; min-height: 1.4em; text-align: center; }

/* Results */
.result__big { font-family: var(--display); font-weight: 900; font-size: clamp(40px, 9vw, 60px); line-height: 1.05; margin: 8px 0 12px; color: var(--brand); }
.result__details { margin: 12px 0; }
.result__details summary { cursor: pointer; font-weight: 700; }
.stat-row--2 { grid-template-columns: repeat(2, 1fr); margin: 10px 0 16px; }
.share { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.share [data-share-text] { word-break: break-word; user-select: all; }

/* Vocal range chart */
.range-chart { display: grid; gap: 6px; margin: 16px 0; }
.range-chart__row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; font-size: 14px; }
.range-chart__label { color: var(--muted); font-weight: 600; }
.range-chart__track { position: relative; height: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; }
.range-chart__bar { position: absolute; top: -1px; bottom: -1px; border-radius: 99px; background: var(--brand-soft); border: 1px solid var(--brand); }
.range-chart__row.is-you .range-chart__label { color: var(--ink); font-weight: 800; }
.range-chart__row.is-you .range-chart__bar { background: var(--accent); border-color: var(--accent-press); }
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.stepper > span { min-width: 110px; font-weight: 700; }
.stepper b { font-family: var(--display); font-size: 24px; min-width: 3ch; text-align: center; }

/* Radios and slider */
.radios { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.radios legend { font-weight: 700; margin-bottom: 6px; }
.radio { display: inline-flex; align-items: center; gap: 6px; }
.slider { display: flex; align-items: center; gap: 10px; margin: 18px 0; font-size: 14px; color: var(--muted); }
.slider input { flex: 1; accent-color: var(--brand); height: 32px; }

/* Tuning meter */
.meter { margin: 10px 0 6px; }
.meter__scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter__track { position: relative; height: 26px; border-radius: 99px; background: linear-gradient(90deg, var(--wrong-soft), var(--surface-2) 40%, var(--surface-2) 60%, var(--wrong-soft)); border: 1px solid var(--line); margin-top: 4px; }
.meter__zone { position: absolute; left: 40%; width: 20%; top: 0; bottom: 0; background: var(--right-soft); }
.meter__needle { position: absolute; top: -5px; bottom: -5px; width: 6px; margin-left: -3px; left: 50%; border-radius: 3px; background: var(--ink); transition: left .08s linear; }
.meter.is-good .meter__needle { background: var(--right); }
.meter.is-idle .meter__needle { opacity: .25; }
.meter__text { text-align: center; font-weight: 700; min-height: 1.5em; margin: 6px 0 0; font-variant-numeric: tabular-nums; }

/* Pitch detector */
.detector { text-align: center; }
.detector__note { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 6px; }
.detector__chip { font-size: clamp(56px, 16vw, 96px); padding: 6px 22px; border-radius: 22px; min-width: 2ch; transition: opacity .2s; }
.detector__chip.is-idle { opacity: .25; }
.detector__octave { color: var(--muted); font-weight: 700; min-width: 5ch; text-align: left; }
.detector__hz { font-variant-numeric: tabular-nums; color: var(--muted); margin: 8px 0 4px; }
.detector__history { display: block; width: 100%; height: 120px; margin: 14px 0 6px; background: var(--surface-2); border-radius: var(--radius-s); border: 1px solid var(--line); }
.detector__settings { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 20px; font-size: 15px; color: var(--muted); }
.detector__settings input[type="number"] { width: 4.5em; font: inherit; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

/* Hub quick check */
.quick-check { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.quick-check li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.quick-check details { color: var(--muted); }
.quick-check summary { cursor: pointer; font-weight: 700; }
.quick-check details p { margin: 6px 0 0; }

.method ul, .sources ul { padding-left: 1.2em; }
.method li, .sources li { margin: 6px 0; }
.sources { font-size: 15px; }

@media (max-width: 520px) {
  .tool { padding: 16px 14px; border-radius: var(--radius); }
  .pc-grid { grid-template-columns: repeat(4, 1fr); }
  .range-chart__row { grid-template-columns: 70px 1fr; font-size: 13px; }
  .mic__live .btn { margin-left: 0; }
}
