:root {
  --tuner-cyan: #6ed8ff;
  --tuner-green: #78e29a;
  --tuner-amber: #f1bd62;
  --tuner-red: #ff6672;
  --tuner-slot: #0b0e12;
}

html,
body {
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.tuner-page {
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.tuner-console {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(31, 36, 44, 0.97), rgba(17, 20, 25, 0.99)),
    #15191f;
  box-shadow: var(--shadow), var(--inset);
  overflow: hidden;
}

.tuner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tuner-kicker {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tuner-toolbar h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.reference-button {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 42px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #11151a;
  box-shadow: var(--inset);
  cursor: pointer;
}

.reference-button span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.reference-button strong {
  color: #fff;
  font-size: 17px;
}

.reference-button:hover,
.reference-button:focus-visible {
  border-color: rgba(110, 216, 255, 0.72);
}

.instrument-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.instrument-button {
  min-height: 42px;
  padding: 7px 5px;
  color: #c3cad4;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #12161b;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.instrument-button:hover,
.instrument-button:focus-visible {
  border-color: #697483;
  color: #fff;
}

.instrument-button.is-active {
  color: #071008;
  border-color: #b7f1a5;
  background: #b0ed9c;
  box-shadow: 0 0 0 1px rgba(176, 237, 156, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.mode-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #11151a;
}

.mode-copy {
  min-width: 0;
}

.mode-copy strong,
.mode-copy span {
  display: block;
}

.mode-copy strong {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.mode-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.tuning-picker-button[hidden],
.string-panel[hidden],
.stop-button[hidden],
.error-panel[hidden] {
  display: none !important;
}

.tuning-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 138px;
  min-height: 36px;
  padding: 7px 10px;
  color: #e9eef4;
  border: 1px solid #48515e;
  border-radius: 10px;
  background: #1b2027;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.tuning-picker-button b {
  color: var(--green);
  font-size: 15px;
}

.tuning-popover {
  position: absolute;
  z-index: 30;
  top: 126px;
  right: 18px;
  width: min(360px, calc(100% - 36px));
  max-height: min(56vh, 460px);
  border: 1px solid #5a6471;
  border-radius: 14px;
  background: #151a20;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.tuning-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.tuning-popover-head strong {
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tuning-popover-head button,
.reference-head button {
  width: 34px;
  height: 34px;
  color: #cfd6df;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #0f1317;
  font-size: 20px;
  cursor: pointer;
}

.tuning-options {
  max-height: 390px;
  padding: 7px;
  overflow-y: auto;
}

.tuning-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  color: #e7ebf0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tuning-option:hover,
.tuning-option:focus-visible {
  background: #20262e;
  border-color: #46505c;
}

.tuning-option.is-selected {
  background: rgba(176, 237, 156, 0.1);
  border-color: rgba(176, 237, 156, 0.55);
}

.tuning-option strong,
.tuning-option small {
  display: block;
}

.tuning-option strong {
  font-size: 12px;
}

.tuning-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.tuning-option i {
  align-self: center;
  color: var(--green);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.display-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 305px;
  border: 1px solid #404957;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(110, 216, 255, 0.07), transparent 44%),
    linear-gradient(180deg, #11161c, #090c10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), inset 0 -30px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.start-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(14, 18, 23, 0.84), rgba(7, 9, 12, 0.94));
}

.start-layer[hidden] {
  display: none;
}

.start-button {
  min-width: 190px;
  min-height: 54px;
  padding: 12px 22px;
  color: #071008;
  border: 1px solid #d1ffc3;
  border-radius: 14px;
  background: #b0ed9c;
  box-shadow: 0 12px 35px rgba(66, 211, 107, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.start-button:hover,
.start-button:focus-visible {
  background: #c6f7b7;
}

.start-layer p,
.start-layer small {
  margin: 0;
  text-align: center;
}

.start-layer p {
  color: #eef2f6;
  font-size: 12px;
  font-weight: 850;
}

.start-layer small {
  color: var(--muted);
  font-size: 11px;
}

.pitch-display {
  width: min(630px, 100%);
  padding: 14px clamp(14px, 4vw, 32px) 16px;
  text-align: center;
}

.target-label {
  min-height: 24px;
  color: var(--tuner-cyan);
  font-size: clamp(14px, 2.8vw, 19px);
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.note-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 104px;
  margin-top: 2px;
}

.note-name {
  color: #f7f9fb;
  font-size: clamp(76px, 14vw, 116px);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: -0.085em;
  text-shadow: 0 0 30px rgba(110, 216, 255, 0.08);
}

.note-octave {
  margin: 10px 0 0 5px;
  color: #b9c3cf;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 900;
}

.detected-line {
  min-height: 20px;
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meter-wrap {
  margin-top: 10px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #848e9b;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.meter {
  position: relative;
  height: 62px;
  border-radius: 12px;
  background: #080b0e;
  border: 1px solid #343c47;
  overflow: hidden;
}

.meter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 102, 114, 0.025), transparent 40%, transparent 60%, rgba(241, 189, 98, 0.025));
  pointer-events: none;
}

.meter-segments {
  position: absolute;
  inset: 11px 12px;
  display: grid;
  grid-template-columns: repeat(25, 1fr);
  align-items: center;
  gap: clamp(2px, 0.7vw, 6px);
}

.meter-segment {
  width: 100%;
  height: 24px;
  border-radius: 2px;
  background: #2d3540;
  opacity: 0.72;
  transition: opacity 0.08s linear, height 0.08s linear, background 0.08s linear;
}

.meter-segment:nth-child(4n + 1) {
  height: 34px;
}

.meter-segment.is-center {
  height: 40px;
  background: #687482;
}

.meter-center {
  position: absolute;
  left: 50%;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.18);
}

.meter-indicator {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: var(--meter-cell-width, 14px);
  height: 45px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 5px;
  background: var(--tuner-cyan);
  box-shadow: 0 0 18px rgba(110, 216, 255, 0.5);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.08s linear, background 0.08s linear, box-shadow 0.08s linear, width 0.12s ease;
}

.tuner-console.has-pitch .meter-indicator {
  opacity: 1;
}

.tuner-console.is-in-tune .meter-indicator {
  width: var(--meter-cell-width, 14px);
  background: var(--tuner-green);
  box-shadow: 0 0 24px rgba(120, 226, 154, 0.65);
}

.tuner-console.is-in-tune .meter-center {
  width: 4px;
  background: #fff;
}

.tuner-console.is-in-tune .meter-segment:nth-child(13) {
  height: 42px;
  background: var(--tuner-green);
  opacity: 1;
}

.readout-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 34px;
  margin-top: 9px;
}

.readout-row > strong {
  min-width: 74px;
  color: #dce2e9;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 30px;
  padding: 5px 10px;
  color: #d2d9e2;
  border: 1px solid #424b57;
  border-radius: 999px;
  background: #151a20;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tuner-console.is-in-tune .status-badge {
  color: #08120a;
  border-color: #b7f1a5;
  background: var(--tuner-green);
}

.tuner-console.is-flat .status-badge {
  color: #061016;
  border-color: #9ae6ff;
  background: var(--tuner-cyan);
}

.tuner-console.is-sharp .status-badge {
  color: #1a1002;
  border-color: #ffe0a0;
  background: var(--tuner-amber);
}

.string-panel {
  margin-top: 9px;
}

.string-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.string-button {
  position: relative;
  min-height: 44px;
  padding: 6px 3px 5px;
  color: #aeb7c2;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #11151a;
  cursor: pointer;
}

.string-button strong,
.string-button small {
  display: block;
}

.string-button strong {
  color: inherit;
  font-size: 12px;
  line-height: 1.1;
}

.string-button small {
  margin-top: 2px;
  color: #78828e;
  font-size: 9px;
  font-weight: 850;
}

.string-button:hover,
.string-button:focus-visible {
  border-color: #66717e;
  color: #fff;
}

.string-button.is-auto {
  font-weight: 950;
}

.string-button.is-current {
  color: #071008;
  border-color: #c7ffb8;
  background: #b0ed9c;
}

.string-button.is-current small {
  color: #263d28;
}

.string-button.is-locked {
  box-shadow: inset 0 -3px 0 var(--tuner-amber);
}

.string-button.is-complete::after {
  content: "✓";
  position: absolute;
  top: 3px;
  right: 5px;
  color: var(--tuner-green);
  font-size: 10px;
  font-weight: 950;
}

.string-button.is-current.is-complete::after {
  color: #173b1b;
}

.tuner-footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  margin-top: 8px;
  padding: 5px 2px 0;
}

.mic-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a626d;
}

.tuner-console.is-running .mic-dot {
  background: var(--green);
  box-shadow: 0 0 10px rgba(66, 211, 107, 0.72);
}

.stop-button,
.error-panel button {
  min-height: 36px;
  padding: 7px 13px;
  color: #f4f6f8;
  border: 1px solid #5c6673;
  border-radius: 10px;
  background: #171c22;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.stop-button:hover,
.stop-button:focus-visible,
.error-panel button:hover,
.error-panel button:focus-visible {
  border-color: var(--tuner-red);
}

.error-panel {
  position: absolute;
  z-index: 40;
  inset: 50% auto auto 50%;
  width: min(420px, calc(100% - 30px));
  padding: 18px;
  border: 1px solid rgba(255, 102, 114, 0.66);
  border-radius: 15px;
  background: #181318;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
  transform: translate(-50%, -50%);
  text-align: center;
}

.error-panel strong {
  display: block;
  color: #fff;
  font-size: 16px;
  text-transform: uppercase;
}

.error-panel p {
  margin: 8px 0 14px;
  color: #c3c9d1;
  font-size: 12px;
  line-height: 1.5;
}

.reference-panel {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.reference-panel[hidden] {
  display: none;
}

.reference-card {
  width: min(390px, 100%);
  padding: 16px;
  border: 1px solid #596370;
  border-radius: 17px;
  background: #181d24;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.75);
}

.reference-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reference-head small {
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.reference-head h2 {
  margin: 3px 0 0;
  font-size: 26px;
}

.reference-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.reference-actions button {
  min-height: 46px;
  color: #f2f5f8;
  border: 1px solid #4a5460;
  border-radius: 11px;
  background: #11161b;
  font-weight: 900;
  cursor: pointer;
}

.reference-actions button:first-child,
.reference-actions button:last-child {
  font-size: 22px;
}

.reference-actions button:hover,
.reference-actions button:focus-visible {
  border-color: var(--green);
}

.reference-card > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.tuner-notes {
  width: min(760px, 100%);
  margin: 14px auto 0;
  padding: 18px 20px;
}

.tuner-notes h2 {
  margin: 0 0 7px;
  font-size: 18px;
}

.tuner-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .tuner-page {
    min-height: 100svh;
  }

  .site-nav {
    margin-bottom: 9px;
  }

  .tuner-console {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - 96px - env(safe-area-inset-bottom));
    padding: 10px;
    border-radius: 17px;
  }

  .tuner-toolbar {
    margin-bottom: 8px;
  }

  .tuner-kicker {
    font-size: 8.5px;
  }

  .tuner-toolbar h1 {
    font-size: 24px;
  }

  .reference-button {
    min-height: 37px;
    padding: 6px 10px;
  }

  .reference-button strong {
    font-size: 15px;
  }

  .instrument-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 7px;
  }

  .instrument-button {
    min-height: 37px;
    padding: 5px 3px;
    font-size: 10.5px;
  }

  .mode-strip {
    min-height: 43px;
    margin-bottom: 7px;
    padding: 6px 8px;
  }

  .mode-copy strong {
    font-size: 11px;
  }

  .mode-copy span {
    font-size: 10.5px;
  }

  .tuning-picker-button {
    min-width: 116px;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .tuning-popover {
    top: 154px;
    right: 10px;
    width: calc(100% - 20px);
    max-height: 48svh;
  }

  .display-stage {
    flex: 1 1 auto;
    min-height: 0;
  }

  .pitch-display {
    padding: 8px 10px 9px;
  }

  .target-label {
    min-height: 19px;
    font-size: 12px;
  }

  .note-row {
    min-height: 78px;
  }

  .note-name {
    font-size: clamp(66px, 20vw, 88px);
  }

  .note-octave {
    margin-top: 7px;
    font-size: 23px;
  }

  .detected-line {
    min-height: 16px;
    font-size: 10.5px;
  }

  .meter-wrap {
    margin-top: 5px;
  }

  .meter-labels {
    margin-bottom: 4px;
    font-size: 8px;
  }

  .meter {
    height: 54px;
  }

  .meter-segments {
    inset: 9px 8px;
    gap: 2px;
  }

  .meter-segment {
    height: 20px;
  }

  .meter-segment:nth-child(4n + 1) {
    height: 28px;
  }

  .meter-segment.is-center {
    height: 34px;
  }

  .meter-indicator {
    height: 39px;
  }

  .readout-row {
    min-height: 29px;
    margin-top: 6px;
  }

  .readout-row > strong {
    min-width: 67px;
    font-size: 12px;
  }

  .status-badge {
    min-width: 94px;
    min-height: 27px;
    padding: 4px 8px;
    font-size: 9.5px;
  }

  .string-panel {
    margin-top: 6px;
  }

  .string-buttons {
    gap: 4px;
  }

  .string-button {
    min-height: 39px;
    border-radius: 8px;
  }

  .string-button strong {
    font-size: 10.5px;
  }

  .string-button small {
    font-size: 8px;
  }

  .tuner-footer-controls {
    min-height: 34px;
    margin-top: 4px;
  }

  .tuner-notes,
  .site-footer {
    display: none;
  }
}

@media (max-width: 380px) {
  .tuner-console {
    min-height: calc(100svh - 92px - env(safe-area-inset-bottom));
    padding: 8px;
  }

  .instrument-button {
    min-height: 35px;
    font-size: 10px;
  }

  .mode-strip {
    min-height: 40px;
  }

  .note-row {
    min-height: 70px;
  }

  .note-name {
    font-size: 64px;
  }

  .meter {
    height: 50px;
  }

  .string-button {
    min-height: 37px;
  }
}

@media (max-height: 720px) and (max-width: 760px) {
  .site-nav {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .site-links {
    display: none;
  }

  .tuner-console {
    min-height: calc(100svh - 67px - env(safe-area-inset-bottom));
  }

  .tuner-toolbar {
    margin-bottom: 5px;
  }

  .tuner-kicker {
    display: none;
  }

  .instrument-grid {
    margin-bottom: 5px;
  }

  .instrument-button {
    min-height: 33px;
  }

  .mode-strip {
    min-height: 37px;
    margin-bottom: 5px;
  }

  .display-stage {
    min-height: 240px;
  }

  .target-label {
    min-height: 17px;
  }

  .note-row {
    min-height: 65px;
  }

  .note-name {
    font-size: 61px;
  }

  .meter {
    height: 46px;
  }

  .meter-segments {
    inset-top: 7px;
    inset-bottom: 7px;
  }

  .string-button {
    min-height: 34px;
  }

  .tuner-footer-controls {
    min-height: 30px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .site-wrap {
    padding-top: 7px;
  }

  .site-nav {
    display: none;
  }

  .tuner-console {
    width: min(980px, 100%);
    min-height: calc(100svh - 14px);
    padding: 8px 10px;
  }

  .tuner-toolbar {
    margin-bottom: 5px;
  }

  .tuner-toolbar h1 {
    font-size: 20px;
  }

  .tuner-kicker {
    display: none;
  }

  .instrument-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-bottom: 5px;
  }

  .instrument-button {
    min-height: 30px;
  }

  .mode-strip {
    min-height: 34px;
    margin-bottom: 5px;
  }

  .display-stage {
    min-height: 185px;
  }

  .pitch-display {
    display: grid;
    grid-template-columns: 0.7fr 1.4fr 1.2fr;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
  }

  .target-label,
  .note-row,
  .detected-line {
    grid-column: 1;
  }

  .target-label {
    align-self: end;
  }

  .note-row {
    min-height: 62px;
  }

  .note-name {
    font-size: 58px;
  }

  .note-octave {
    font-size: 20px;
  }

  .detected-line {
    align-self: start;
  }

  .meter-wrap {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 100%;
    margin: 0;
  }

  .readout-row {
    grid-column: 3;
    grid-row: 1 / span 3;
    flex-direction: column;
  }

  .string-panel {
    margin-top: 4px;
  }

  .string-button {
    min-height: 32px;
  }

  .tuner-footer-controls {
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .meter-indicator,
  .meter-center,
  .instrument-button.is-active,
  .string-button.is-current,
  .status-badge {
    forced-color-adjust: none;
    outline: 2px solid CanvasText;
  }
}

/* --------------------------------------------------------------------------
   Temporary tuner test panel
   Remove the HTML block between TUNER TEST PANEL START/END when testing ends.
   These styles can then be removed as one block as well.
   -------------------------------------------------------------------------- */
.detected-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.detected-line strong {
  color: #eef4f8;
  font-size: clamp(18px, 3.5vw, 25px);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.detected-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tuner-test-panel {
  width: min(760px, 100%);
  margin: 12px auto 0;
  padding: 0;
  overflow: hidden;
  border-color: rgba(110, 216, 255, 0.26);
  background: linear-gradient(180deg, rgba(13, 18, 24, 0.96), rgba(8, 12, 16, 0.96));
}

.tuner-test-details {
  display: block;
}

.tuner-test-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 12px 16px;
  color: #e7edf3;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.tuner-test-summary::-webkit-details-marker {
  display: none;
}

.tuner-test-summary::before {
  content: "▸";
  flex: 0 0 auto;
  color: var(--tuner-cyan);
  font-size: 12px;
  transition: transform 160ms ease;
}

.tuner-test-details[open] .tuner-test-summary::before {
  transform: rotate(90deg);
}

.tuner-test-summary > span:first-child {
  margin-right: auto;
}

.tuner-test-summary-meta {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: none;
}

.tuner-test-summary-meta strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.tuner-test-body {
  padding: 0 16px 14px;
  border-top: 1px solid rgba(78, 90, 104, 0.42);
}

.tuner-test-markers {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.tuner-test-markers button,
.tuner-test-actions button {
  min-height: 36px;
  padding: 6px 8px;
  color: #d9e0e7;
  border: 1px solid #46515e;
  border-radius: 9px;
  background: #151a20;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.tuner-test-markers button:hover,
.tuner-test-markers button:focus-visible,
.tuner-test-actions button:hover,
.tuner-test-actions button:focus-visible {
  border-color: var(--tuner-cyan);
}

.tuner-test-markers button.is-active {
  color: #051116;
  border-color: #a6edff;
  background: var(--tuner-cyan);
}

.tuner-test-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
}

.tuner-test-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

.tuner-test-actions > span strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.tuner-test-actions button.is-primary {
  color: #061108;
  border-color: #c5ffb6;
  background: var(--tuner-green);
}

@media (max-width: 760px) {
  .instrument-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .detected-line {
    gap: 6px;
  }

  .detected-line strong {
    font-size: clamp(18px, 6.4vw, 24px);
  }

  .detected-line span {
    font-size: 9.5px;
  }

  .tuner-test-panel {
    margin-top: 10px;
  }

  .tuner-test-summary {
    padding: 11px 12px;
  }

  .tuner-test-body {
    padding: 0 12px 12px;
  }

  .tuner-test-markers {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .tuner-test-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .tuner-test-summary-meta {
    flex-basis: 100%;
    padding-left: 20px;
  }

  .tuner-test-markers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tuner-test-actions {
    flex-wrap: wrap;
  }

  .tuner-test-actions > span {
    flex-basis: 100%;
  }

  .tuner-test-actions button {
    flex: 1 1 110px;
  }
}


/* Browser translation seed for dynamic microphone error text. */
.tuner-translation-seed {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  overflow: visible;
  z-index: -1;
  font-size: 1px;
  line-height: 1;
}

.tuner-translation-seed p {
  margin: 0;
  padding: 0;
  white-space: normal;
}
