.dictation-score {
  color: #192d43;
}

#exercise:has(.dictation-score) .score-panel {
  padding: clamp(12px, 2vw, 29px);
  background: #fff;
}

.dict-score-caption {
  margin: 0 0 12px;
  color: #425a71;
  font-size: clamp(.86rem, 1.4vw, 1rem);
  font-weight: 750;
}

.dict-measures {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(9px, 1.6vw, 20px);
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 3px;
}

.dict-system {
  display: grid;
  grid-template-columns: var(--dict-system-columns);
  width: max-content;
  min-width: 100%;
}

.dict-measure {
  min-width: 0;
}

.dict-measure.is-playing {
  background: #edfaf8;
}

.dict-measure-title {
  margin: 0;
  padding-inline-start: 7px;
  color: #4f657d;
  font-size: .79rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.25;
}

.dict-measure.is-playing .dict-measure-title {
  color: #17685f;
}

.dict-staves {
  min-width: 0;
}

.dict-staff-row {
  position: relative;
  min-width: 0;
}

.dict-staff-row.is-lower {
  margin-top: -2px;
}

.dict-staff-row.is-rhythm-correct {
  background: #eaf7ef;
  box-shadow: inset 0 0 0 1px #87b593;
}

.dict-notation, .dict-pulse-notation {
  display: block;
  width: 100%;
  height: auto;
}

.dict-notation {
  color: #111923;
  overflow: visible;
}

.dict-staff-line {
  stroke: currentColor;
  stroke-width: 1.1;
}

.dict-bar-line, .dict-stem {
  stroke: currentColor;
  stroke-width: 1.65;
}

.dict-beat-tick {
  stroke: #55728b;
  stroke-width: 1.65;
  stroke-linecap: round;
}

.dict-empty-note {
  fill: #fff;
  stroke: #46637d;
  stroke-width: 1.2;
  stroke-dasharray: 2 2;
}

.dict-note-head { fill: currentColor; }
.dict-note-head.is-open { fill: #fff; stroke: currentColor; stroke-width: 1.5; }
.dict-note-head.is-given { fill: #245f95; }
.dict-note-head.is-given.is-open { fill: #fff; stroke: #245f95; stroke-width: 2.1; }
.dict-beam { stroke: currentColor; stroke-width: 3.8; }
.dict-secondary-beam { stroke: currentColor; stroke-width: 2.7; }
.dict-flag { fill: none; stroke: currentColor; stroke-width: 1.9; }
.dict-tie { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.dict-accidental { fill: currentColor; font-size: 17px; }
.dict-meter { fill: currentColor; font: bold 22px Georgia, serif; }
.dict-triplet { fill: currentColor; font: bold 11px Georgia, serif; text-anchor: middle; }

.dict-order-staves { position: relative; }

.dict-staff-row :is(.dict-rhythm-slot, .dict-note-slot, .dict-figure-slot), .dict-order-slot {
  position: absolute;
  inset-block: 13% 5%;
  min-height: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #294f6b;
}

.dict-staff-row .dict-rhythm-slot, .dict-order-slot {
  left: 0;
  right: 1px;
}

.dict-staff-row :is(.dict-note-slot, .dict-figure-slot) {
  transform: translateX(-50%);
}

.dict-staff-row :is(.dict-rhythm-slot, .dict-note-slot, .dict-figure-slot):hover, .dict-order-slot:hover {
  border-color: #87b1c9;
  background: #93caff33;
}

.dict-staff-row :is(.dict-rhythm-slot, .dict-note-slot, .dict-figure-slot):focus-visible,
.dict-staff-row .is-selected,
.dict-order-slot:is(:focus-visible, .is-selected) {
  border-color: #235d80;
  outline: 2px solid #247598;
  outline-offset: -2px;
  background: #a6ddff44;
}

.dict-staff-row .is-correct, .dict-order-slot.is-correct {
  border-color: #6a996f;
  background: #a9dba63d;
}

.dict-staff-row .is-wrong, .dict-order-slot.is-wrong {
  border-color: #ac3948;
  background: #ef9e9e44;
}

.dictation-score .dict-review-target,
.dictation-score .dict-review-target:hover {
  --review-mark: #a23b18;
  border-color: var(--review-mark);
  background: #fbcbb631;
}

.dictation-score .dict-review-target::after {
  position: absolute;
  inset-inline: 1px;
  inset-block-end: 3px;
  border-bottom: 2px solid var(--review-mark);
  content: "";
  pointer-events: none;
}

.dictation-score .dict-review-target.is-review-current {
  --review-mark: #922c15;
  border-width: 2px;
  background: #fbcbb64d;
}

.dictation-score .dict-review-target.is-review-current::after {
  border-bottom-width: 3px;
}

.dictation-score .dict-review-target.is-review-missing {
  border-style: dashed;
}

.dictation-score .dict-review-target.is-review-missing::after {
  border-bottom-style: dashed;
}

.dictation-score .dict-review-target:focus-visible {
  z-index: 1;
  outline: 2px solid #19627d;
  outline-offset: 2px;
}

.dict-slot-marker {
  display: grid;
  min-width: 26px;
  min-height: 26px;
  place-items: center;
  border: 1px dashed #607c94;
  border-radius: 50%;
  background: #fff;
  line-height: 1;
  pointer-events: none;
}

.dict-rhythm-append .dict-slot-marker {
  min-width: 22px;
  min-height: 22px;
  color: #1d6179;
  border-color: #78a4b7;
  font-size: .88rem;
}

.dict-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.dict-pulse-dot {
  fill: #6c8498;
}

.dict-pulse-dot.is-playing {
  fill: #bd3345;
  stroke: #fff;
  stroke-width: 1.6px;
  transform: scale(1.45);
  transform-box: fill-box;
  transform-origin: center;
}

#exercise:has(.dictation-score) .studio-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

#exercise:has(.dictation-score) #palette {
  flex: 1 1 min(100%, 480px);
  min-width: 0;
  justify-content: stretch;
}

.dict-palette { width: 100%; }

.dict-palette-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 8px;
}

.dict-palette-header h3 {
  margin: 0;
  color: var(--muted);
  font-size: clamp(.87rem, 1.5vw, 1rem);
}

.dict-work-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.dict-mode-button {
  min-height: 44px;
  padding: 5px 12px;
  font-size: .9rem;
}

.dict-mode-button[aria-pressed="true"] {
  border-color: var(--lila);
  background: #402f6e;
}

.dict-mode-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.35;
}

.dict-rhythm-writing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  margin-bottom: 8px;
  padding: 5px 7px 5px 10px;
  border: 1px solid #304d69;
  border-radius: 9px;
  background: #102440;
}

.dict-rhythm-status {
  flex: 1 1 155px;
  min-width: 0;
  margin: 0;
  color: #e4effa;
  font-size: .85rem;
  font-weight: 650;
  line-height: 1.3;
}

.dict-rhythm-edits {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dict-rhythm-edits button {
  min-height: 44px;
  min-width: 44px;
  padding: 4px 9px;
  border-color: #4a6385;
  border-radius: 7px;
  background: #1c3453;
  font-size: .8rem;
  line-height: 1.15;
}

.dict-rhythm-edits button:hover:enabled,
.dict-rhythm-edits button[aria-pressed="true"] {
  border-color: var(--lila);
  background: #402f6e;
}

.dict-voice-controls, .dict-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dict-voice-controls button {
  min-height: 38px;
  padding: 4px 11px;
  font-size: .86rem;
}

.dict-voice-controls [aria-pressed="true"] {
  border-color: #967bd3;
  background: #402f6e;
}

#palette .dict-pitch-tile {
  min-width: 59px;
  padding: 6px 10px;
  font-size: .96rem;
}

#palette button[data-tile].dict-figure-tile {
  justify-content: flex-start;
  gap: 5px;
  min-width: 104px;
  max-width: 144px;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: .81rem;
  line-height: 1.15;
  text-align: start;
}

.dict-figure-icon {
  display: block;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  overflow: visible;
  color: inherit;
  pointer-events: none;
}

.dict-order-option {
  display: grid;
  align-content: start;
  gap: 4px;
  width: clamp(136px, 22vw, 220px);
}

#palette .dict-order-tile {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  width: 100%;
  padding: 7px 9px 5px;
}

#palette .dict-order-tile.is-placed {
  border-style: dashed;
  border-color: #705d99;
}

.dict-order-letter {
  font-size: .82rem;
}

.dict-order-preview {
  min-height: 38px;
  padding: 4px 8px;
  font-size: .8rem;
}

#exercise:has(.dictation-score) #check {
  min-height: 55px;
  padding-inline: clamp(17px, 3vw, 31px);
  border-radius: 11px;
  font-size: clamp(18px, 2.3vw, 27px);
}

#feedback .dict-review, #feedback.dict-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 14px;
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(9px, 1.5vw, 14px);
  border: 1px solid #304d69;
  border-inline-start: 3px solid #ffb48e;
  border-radius: 9px;
  background: #102440;
  text-align: start;
}

.dict-review-message {
  flex: 1 0 100%;
  margin: 0;
  color: #f5f8fc;
  font-size: clamp(.88rem, 1.65vw, 1rem);
  font-weight: 750;
  line-height: 1.35;
}

.dict-review-actions, .dict-review-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dict-review-nav {
  margin-inline-start: auto;
}

#feedback :is(.dict-review-actions, .dict-review-nav) button {
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: .82rem;
  line-height: 1.2;
}

#feedback .dict-review-actions button:first-child {
  color: #041825;
  border-color: transparent;
  background: var(--turquesa);
}

#feedback .dict-review-actions button:first-child:hover {
  background: #84fff4;
}

.dict-review-count {
  color: var(--muted);
  font-size: .83rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dict-guided-listening {
  width: 100%;
  min-width: 0;
}

.dict-listen-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.dict-listen-step {
  min-width: 0;
  min-height: 38px;
  padding: 4px 2px;
  border-radius: 7px;
  color: #d3dfee;
  font-size: clamp(.69rem, 1.45vw, .91rem);
  line-height: 1.2;
  text-align: center;
}

.dict-listen-step[aria-pressed="true"] {
  border-color: #967bd3;
  background: #402f6e;
  color: white;
}

.dict-listen-step:disabled {
  opacity: .76;
  background: transparent;
}

.studio-heading .dict-listen-status {
  min-height: 1.25em;
  margin: 9px 0 6px;
  color: var(--muted);
  font-size: clamp(.76rem, 1.32vw, .92rem);
  font-weight: 700;
  letter-spacing: normal;
}

.dict-listen-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

#audio .dict-listen-actions .listen, .dict-listen-stop {
  min-height: 44px;
  max-width: 100%;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: clamp(.8rem, 1.6vw, .99rem);
  line-height: 1.2;
  text-align: center;
}

#audio .dict-listen-actions .listen {
  flex: 1 1 112px;
}

#audio .dict-listen-actions .listen::before {
  width: .7em;
  height: .74em;
}

.dict-listen-check {
  font-size: .9em;
}

.dict-listen-stop {
  flex: 0 0 auto;
}

@media (max-width: 520px) {
  #exercise:has(.dictation-score) .studio-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #exercise:has(.dictation-score) #palette { flex-basis: auto; }
  #exercise:has(.dictation-score) #check { align-self: flex-end; }

  .dict-review-nav {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
}
