/* One screen: the viewport is allocated, never covered by fixed controls. */
:root {
  color-scheme: dark;
  --white: #f3f5ed;
  --muted: #9da69f;
  --dim: #68746d;
  --line: #303a34;
  --accent: #d9fa83;
  --pink: var(--accent);
  --yellow: var(--accent);
  --cyan: #a7ded3;
  --orange: #efb88c;
  --black: #101413;
  --mono: ui-monospace, monospace;
  --jp:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--black);
  color: var(--white);
}
body {
  font-family: var(--jp);
  -webkit-tap-highlight-color: transparent;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
button:active {
  transform: scale(0.95);
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button,
select {
  min-height: 48px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.karaoke-app {
  height: 100dvh;
  height: var(--app-height, 100dvh);
  width: min(100%, 1120px);
  margin: auto;
  display: grid;
  grid-template-rows: 64px 52px minmax(0, 1fr) 182px;
  gap: 0;
  padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right))
    env(safe-area-inset-bottom) max(20px, env(safe-area-inset-left));
}
.screen-header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.brand-mark {
  font-size: 28px;
  color: var(--accent);
  width: 30px;
}
.brand-copy {
  min-width: 0;
}
.brand-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.icon-button {
  width: 48px;
  flex-shrink: 0;
  font-size: 24px;
  border-radius: 50%;
}
.icon-button:hover {
  background: #263029;
}
.mode-switch {
  display: flex;
  align-self: start;
  background: #202721;
  border: 1px solid #303a32;
  border-radius: 24px;
  padding: 3px;
  width: 224px;
  justify-self: center;
}
.mode-button {
  min-height: 38px;
  flex: 1;
  border-radius: 21px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.mode-button[aria-pressed="true"] {
  background: var(--accent);
  color: #202718;
}
.singing-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 164px;
  gap: 18px;
  min-height: 0;
  min-width: 0;
}
.art-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #29322d;
}
.cover-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 54%;
  opacity: 0.8;
}
.art-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.7), transparent 85%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 65%);
}
.stage-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}
.state-badge {
  display: flex;
  gap: 7px;
  align-items: center;
  background: #101413b8;
  border: 1px solid #ffffff24;
  border-radius: 20px;
  padding: 7px 10px;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}
.is-playing .live-dot {
  background: var(--accent);
  box-shadow: 0 0 8px #d9fa8380;
}
.key-badge {
  color: #e5e9df;
  font: 10px var(--mono);
}
.art-caption {
  position: absolute;
  left: 22px;
  bottom: 22px;
  display: grid;
  gap: 12px;
}
.art-eyebrow {
  font: 9px var(--mono);
  letter-spacing: 0.16em;
  color: #cbd1c5;
}
.art-title {
  font-size: clamp(25px, 4.5vw, 48px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0.07em;
}
.art-caption #section-name {
  font-size: 10px;
  color: #cad2c7;
}
.countdown {
  position: absolute;
  right: 20px;
  bottom: 20px;
  background: var(--accent);
  color: #202718;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font: 600 28px var(--mono);
}
.lyric-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr) 22px;
  gap: 6px;
}
.lyric-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.lyric-caption #lyric-kicker {
  color: var(--accent);
}
#lyric-count {
  font: 10px var(--mono);
}
.lyric-viewport,
.lyric-lines {
  min-height: 0;
  height: 100%;
  width: 100%;
}
.lyric-lines {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  gap: 4px;
}
.lyric-line {
  display: none;
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 3px 0;
  line-height: 1.45;
  text-align: left;
  font-size: var(--lyric-size, 24px);
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0;
}
.lyric-line.current,
.lyric-line.next-line,
.lyric-line.following-line {
  display: block;
}
.line-number {
  display: none;
}
.line-text {
  display: inline-block;
}
.lyric-lines.has-current .next-line,
.following-line {
  color: #98a399;
  font-size: calc(var(--lyric-size, 24px) * 0.82);
  font-weight: 500;
}
.lyric-char {
  --fill: 0%;
}
.current .lyric-char {
  background: linear-gradient(
    90deg,
    var(--accent) var(--fill),
    var(--white) var(--fill)
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.lyric-guide {
  margin: 0;
  align-self: center;
  color: #859187;
  font-size: 10px;
}
.player-bar {
  display: grid;
  grid-template-rows: 48px 80px 48px;
  align-content: end;
  gap: 0;
  min-width: 0;
  padding-bottom: 6px;
}
.timeline {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: 28px 16px;
  align-self: end;
}
.seek {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  width: 100%;
  margin: 0;
  height: 28px;
  cursor: pointer;
  touch-action: pan-x;
}
.seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--accent) var(--progress, 0%),
    #3c473f var(--progress, 0%)
  );
}
.seek::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -5px;
}
.seek::-moz-range-track {
  height: 3px;
  background: #3c473f;
}
.seek::-moz-range-progress {
  height: 3px;
  background: var(--accent);
}
.seek::-moz-range-thumb {
  width: 13px;
  height: 13px;
  background: var(--accent);
  border: 0;
  border-radius: 50%;
}
.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 10px var(--mono);
}
.transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.play-button {
  border-radius: 50%;
  width: 66px;
  height: 66px;
  min-width: 66px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #172013;
  box-shadow: 0 0 28px #d9fa830c;
}
.play-icon {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
  margin-left: 4px;
}
.playing .play-icon {
  width: 16px;
  height: 19px;
  border: 0;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
  margin: 0;
}
.phrase-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.phrase-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: currentColor;
  stroke-linejoin: round;
}
.compact-control {
  white-space: nowrap;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: 52px;
  height: 56px;
  font-size: 9px;
  color: var(--muted);
}
.control-symbol {
  font-size: 25px;
  line-height: 28px;
}
.repeat-button[aria-pressed="true"] {
  color: var(--accent);
}
.session-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #28322b;
  margin-top: 4px;
  gap: 14px;
}
.session-tools button {
  font-size: 11px;
  color: var(--muted);
  min-width: 104px;
}
.session-tools button[aria-pressed="true"],
.session-tools button[aria-expanded="true"] {
  color: var(--accent);
}
.tools-divider {
  height: 14px;
  width: 1px;
  background: var(--line);
}
.analysis-overlay {
  display: none;
  min-height: 0;
  background: #1a231d;
  border: 1px solid #344239;
  border-radius: 18px;
  padding: 16px;
  grid-template-rows: auto minmax(24px, 1fr) auto auto auto;
  gap: 8px;
}
.show-analysis .art-stage {
  display: none;
}
.show-analysis .analysis-overlay {
  display: grid;
}
.analysis-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.analysis-title small {
  font-size: 10px;
  color: var(--muted);
}
.pitch-card {
  min-height: 0;
  overflow: hidden;
}
#pitch-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.analysis-readout {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 10px var(--mono);
  color: var(--muted);
}
#mic-note {
  font-size: 20px;
  color: var(--accent);
}
.analysis-meter-label {
  margin-left: auto;
}
.analysis-meter {
  width: 36px;
  height: 4px;
  background: #35483e;
}
.analysis-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}
.mic-button {
  border-radius: 12px;
  border: 1px solid #687e60;
  color: var(--accent);
  font-size: 12px;
}
.mic-button.active {
  background: var(--accent);
  color: #172013;
}
#mic-status {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.player-mode #vocal-toggle,
.player-mode #analysis-toggle,
.player-mode .tools-divider,
.player-mode .karaoke-only {
  display: none;
}
.player-only {
  display: none;
}
.player-mode .player-only {
  display: block;
}
.player-mode .session-tools:after {
  content: "音楽を、ポケットに。";
  font-size: 11px;
  color: var(--muted);
}
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: #0009;
  backdrop-filter: blur(8px);
  z-index: 9;
}
.control-drawer {
  display: none;
  position: fixed;
  z-index: 10;
  bottom: env(safe-area-inset-bottom);
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 520px);
  max-height: calc(
    100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  padding: 24px 24px 28px;
  background: #1b231e;
  border: 1px solid #3a473d;
  border-radius: 24px 24px 0 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 20px;
}
.drawer-open .control-drawer {
  display: grid;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-head p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 11px;
}
.drawer-head h2 {
  margin: 6px 0;
  font-size: 19px;
}
.drawer-eyebrow {
  display: none;
}
.close-button {
  width: 48px;
  font-size: 28px;
  border-radius: 50%;
  background: #303c32;
}
.sheet-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.sheet-tabs button {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.sheet-tabs [aria-selected="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.drawer-section,
.drawer-foot {
  min-height: 0;
}
.drawer-label {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}
.control-grid {
  display: flex;
  gap: 14px;
}
.control-field {
  flex: 1;
  display: grid;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
}
.control-field select {
  width: 100%;
  background: #28352b;
  border: 1px solid #465444;
  border-radius: 10px;
  color: var(--white);
  padding: 0 10px;
  font-size: 13px;
}
.volume-field {
  display: grid;
  gap: 14px;
  margin: 24px 0 8px;
  font-size: 12px;
}
.volume-field input {
  height: 32px;
  width: 100%;
  accent-color: var(--accent);
}
.mode-note,
.drawer-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.drawer-label-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.section-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.section-button {
  padding: 10px 12px;
  border: 1px solid #3d4c40;
  border-radius: 10px;
  text-align: left;
  font-size: 12px;
}
.section-button small {
  display: block;
  font: 9px var(--mono);
  margin-bottom: 4px;
  color: var(--muted);
}
.section-button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #d9fa830b;
}
.drawer-status {
  font-size: 11px;
  color: var(--muted);
}
.app-version {
  font: 12px var(--mono);
  color: var(--accent);
}
.update-button,
.install-button {
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px;
  margin: 0 6px 12px 0;
  font-size: 12px;
}
.toast {
  position: fixed;
  z-index: 20;
  bottom: calc(190px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 10px);
  width: max-content;
  max-width: calc(100% - 32px);
  background: #e7eddf;
  color: #172013;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s,
    transform 0.18s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (min-width: 700px) and (min-height: 600px) {
  .karaoke-app {
    padding-left: 40px;
    padding-right: 40px;
    grid-template-rows: 76px 58px minmax(0, 1fr) 176px;
  }
  .singing-screen {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 40px;
  }
  .lyric-stage {
    align-self: center;
    height: 240px;
    grid-template-rows: 32px 1fr 26px;
  }
  .lyric-caption {
    font-size: 12px;
  }
  .lyric-guide {
    font-size: 12px;
  }
  .art-title {
    font-size: 48px;
  }
  .player-bar {
    width: min(600px, 100%);
    justify-self: center;
  }
  .brand-copy strong {
    font-size: 18px;
  }
}
@media (max-height: 660px) and (orientation: portrait) {
  .karaoke-app {
    grid-template-rows: 56px 46px minmax(0, 1fr) 160px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .singing-screen {
    grid-template-rows: minmax(0, 1fr) 138px;
    gap: 12px;
  }
  .player-bar {
    grid-template-rows: 40px 70px 44px;
  }
  .play-button {
    width: 58px;
    height: 58px;
    min-width: 58px;
  }
  .art-title {
    font-size: 24px;
  }
  .art-caption {
    bottom: 14px;
    left: 16px;
    gap: 6px;
  }
  .art-eyebrow {
    display: none;
  }
  .stage-top {
    top: 10px;
    left: 12px;
    right: 12px;
  }
  .analysis-overlay {
    padding: 10px;
    gap: 4px;
    grid-template-rows: auto minmax(16px, 1fr) auto auto;
  }
  .analysis-title small,
  #mic-status {
    display: none;
  }
  .mic-button {
    min-height: 40px;
  }
  .lyric-guide {
    font-size: 9px;
  }
  .control-drawer {
    padding: 16px;
    gap: 12px;
  }
}
@media (orientation: landscape) and (max-height: 599px) {
  .karaoke-app {
    grid-template-columns: minmax(0, 1fr) 216px;
    grid-template-rows: 52px minmax(0, 1fr);
    column-gap: 24px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .screen-header {
    grid-column: 1;
    grid-row: 1;
  }
  .mode-switch {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    align-self: center;
  }
  .singing-screen {
    grid-column: 1;
    grid-row: 2;
    grid-template-rows: minmax(0, 1fr) 124px;
    gap: 10px;
    padding-bottom: 12px;
  }
  .art-caption {
    bottom: 12px;
    left: 16px;
    gap: 4px;
  }
  .art-title,
  .art-eyebrow {
    display: none;
  }
  .stage-top {
    top: 10px;
    left: 12px;
    right: 12px;
  }
  .player-bar {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    grid-template-rows: 44px 78px 48px;
    width: 100%;
  }
  .transport {
    gap: 0;
  }
  .compact-control {
    min-width: 38px;
    font-size: 8px;
  }
  .phrase-button {
    width: 38px;
  }
  .play-button {
    width: 56px;
    height: 56px;
    min-width: 56px;
  }
  .session-tools {
    gap: 4px;
    flex-wrap: wrap;
  }
  .session-tools button {
    min-width: 90px;
    font-size: 10px;
  }
  .lyric-guide {
    font-size: 9px;
  }
  .analysis-overlay {
    padding: 8px;
    gap: 4px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .analysis-title {
    grid-column: 1;
  }
  .pitch-card {
    grid-column: 1;
  }
  .analysis-readout {
    grid-column: 1;
    font-size: 9px;
  }
  #mic-note {
    font-size: 13px;
  }
  .mic-button {
    grid-column: 2;
    grid-row: 1/4;
    padding: 6px;
    font-size: 10px;
  }
  .analysis-title small,
  #mic-status {
    display: none;
  }
  .control-drawer {
    width: min(640px, 100%);
    padding: 12px 20px;
    gap: 8px;
  }
  .drawer-head h2 {
    font-size: 15px;
  }
  .drawer-head p {
    display: none;
  }
  .sheet-tabs button {
    min-height: 40px;
  }
  .control-grid {
    float: left;
    width: 60%;
    margin-right: 18px;
  }
  .volume-field {
    margin: 0;
    gap: 8px;
  }
  .section-nav {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .section-button {
    padding: 6px;
    font-size: 10px;
  }
  .toast {
    bottom: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Practice scoring keeps the same allocated art slot and lyric area. */
.analysis-overlay {
  grid-template-rows: auto minmax(24px, 1fr) auto auto auto auto;
  gap: 6px;
}
.analysis-title .beta-badge {
  display: inline;
  color: var(--muted);
  font-size: 10px;
}
.live-score {
  color: var(--accent);
  font: 600 20px var(--mono);
}
.live-score small {
  font: 10px var(--mono);
  color: var(--muted);
}
.score-feedback {
  min-height: 14px;
  color: var(--accent);
  font-size: 10px;
  text-align: center;
}
.scoring-active .lyric-line {
  pointer-events: none;
}
.scoring-active .session-tools button:disabled {
  opacity: 0.35;
}
.latency-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 11px;
}
.latency-field > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.latency-field output {
  color: var(--muted);
  font: 11px var(--mono);
}
.latency-field input {
  width: 100%;
  height: 30px;
  accent-color: var(--accent);
}
.score-result {
  position: fixed;
  inset: 0;
  z-index: 12;
  width: min(100%, 600px);
  height: 100dvh;
  height: var(--app-height, 100dvh);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: 64px 48px minmax(0, 1fr) 88px;
  gap: 14px;
  background: var(--black);
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-header small {
  color: var(--muted);
  font-size: 10px;
}
.result-header h2 {
  margin: 6px 0 0;
  font-size: 24px;
}
.score-summary {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 18px;
}
.result-total {
  align-self: center;
  text-align: center;
}
.result-total > p:first-child {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 14px;
}
#score-value {
  font: 600 clamp(60px, 20vw, 88px)/1 var(--mono);
  color: var(--accent);
  letter-spacing: -0.06em;
}
.result-total > span {
  font: 12px var(--mono);
  color: var(--muted);
}
#score-best {
  height: 18px;
  font-size: 11px;
  color: var(--accent);
}
.result-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.result-metrics > div {
  display: grid;
  gap: 8px;
  text-align: center;
}
.result-metrics > div + div {
  border-left: 1px solid var(--line);
}
.result-metrics span {
  font-size: 11px;
  color: var(--muted);
}
.result-metrics strong {
  font: 600 25px var(--mono);
}
#score-comment {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.result-footer {
  display: grid;
  gap: 8px;
  align-content: end;
}
#score-retry {
  width: 100%;
  background: var(--accent);
  color: #172013;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
}
.result-footer p {
  margin: 0;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}
#score-phrases {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 48px;
}
#score-phrase-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  min-height: 0;
}
#score-phrase-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}
#score-phrase-list li span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#score-phrase-list strong {
  white-space: nowrap;
  color: var(--accent);
  font: 12px var(--mono);
}
.result-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-pagination button {
  width: 48px;
  font-size: 26px;
}
#score-page {
  color: var(--muted);
  font: 11px var(--mono);
}
@media (max-height: 660px) and (orientation: portrait) {
  .analysis-overlay {
    grid-template-rows: auto minmax(12px, 1fr) auto 40px 14px;
    gap: 3px;
  }
  .analysis-readout {
    font-size: 9px;
  }
  #mic-note {
    font-size: 15px;
  }
  .score-result {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    grid-template-rows: 54px 42px minmax(0, 1fr) 78px;
    gap: 8px;
  }
  .score-result .sheet-tabs button {
    min-height: 42px;
  }
  .score-summary {
    gap: 10px;
  }
  #score-value {
    font-size: 64px;
  }
  .result-total > p:first-child {
    margin-bottom: 6px;
  }
  .result-metrics {
    padding: 12px 0;
  }
  .volume-field {
    margin-top: 16px;
  }
}
@media (orientation: landscape) and (max-height: 599px) {
  .analysis-overlay {
    grid-template-columns: minmax(0, 1fr) 100px;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .score-feedback {
    grid-column: 2;
    grid-row: 3;
    font-size: 9px;
  }
  .mic-button {
    grid-row: 1/3;
  }
  .live-score {
    font-size: 15px;
  }
  .latency-field {
    width: calc(40% - 18px);
    margin-left: auto;
  }
  .score-result {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 190px;
    grid-template-rows: 48px minmax(0, 1fr);
    gap: 12px 24px;
    padding: 12px 24px;
  }
  .result-header {
    grid-column: 1;
    grid-row: 1;
  }
  .result-header h2 {
    font-size: 18px;
  }
  .score-result > .sheet-tabs {
    grid-column: 2;
    grid-row: 1;
  }
  #score-summary,
  #score-phrases {
    grid-column: 1;
    grid-row: 2;
  }
  .result-footer {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }
  .score-summary {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .result-total {
    grid-column: 1;
    grid-row: 1;
  }
  #score-value {
    font-size: 56px;
  }
  .result-metrics {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding: 10px 0;
  }
  #score-comment {
    grid-column: 1/3;
    grid-row: 2;
    font-size: 11px;
  }
  #score-phrase-list {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0 18px;
  }
  #score-phrase-list li {
    font-size: 10px;
  }
}

#score-scope {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 10px;
}
@media (orientation: landscape) and (max-height: 599px) {
  .score-summary > div:last-child {
    grid-column: 1/3;
    grid-row: 2;
  }
}

/* Native selection is keyboard and touch accessible without another overlay. */
.brand-copy { min-width: 0; }
#song-select { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; color: inherit; background: #101413; border: 0; border-bottom: 1px solid #566148; border-radius: 0; padding: 4px 20px 4px 0; font: inherit; font-weight: 700; text-overflow: ellipsis; }
#song-select:focus-visible { outline: 2px solid #dafa93; outline-offset: 2px; }
