﻿:root {
  --ink: #403744;
  --muted: #786d7b;
  --cream: #fff8ed;
  --paper: #fffefa;
  --peach: #ffd8c7;
  --pink: #ffcfe0;
  --mint: #bdebd9;
  --sky: #ccecff;
  --butter: #ffe79a;
  --lavender: #e2d8ff;
  --berry: #9b4f78;
  --leaf: #357b67;
  --staff: #4f4658;
  --shadow: 0 18px 45px rgba(96, 72, 64, 0.16);
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 231, 154, 0.58), transparent 23rem),
    radial-gradient(circle at 88% 16%, rgba(204, 236, 255, 0.7), transparent 22rem),
    radial-gradient(circle at 56% 96%, rgba(255, 207, 224, 0.5), transparent 20rem),
    linear-gradient(180deg, #fff6ea 0%, #f7fff8 100%);
}

button {
  color: inherit;
  font: inherit;
}

.app-shell {
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 0 12px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
}

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
}

.study-cat {
  width: clamp(116px, 16vw, 172px);
  height: auto;
  margin-bottom: -6px;
  filter: drop-shadow(0 12px 14px rgba(96, 72, 64, 0.14));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Fredoka", "Nunito", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 5px;
  font-size: clamp(2.35rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 0.94;
}

.intro {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.35;
}

.builder-card {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: clamp(12px, 2vw, 18px) clamp(14px, 2.5vw, 22px) clamp(14px, 2.5vw, 22px);
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.status-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 84px;
  padding: 0 4px;
}

.status-strip > div:first-child {
  position: relative;
  z-index: 2;
  justify-self: start;
  max-width: calc(50% - 142px);
}

.status-actions {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  transform: translateY(-50%);
}

.phone-relative-guide-slot {
  display: none;
}

.guide-toggle {
  display: inline-grid;
  align-items: center;
  justify-items: center;
  gap: 5px;
  color: var(--berry);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.guide-toggle-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.guide-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 82px;
  height: 34px;
  padding: 3px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 237, 0.9));
  box-shadow:
    inset 0 1px 1px rgba(96, 72, 64, 0.08),
    0 4px 9px rgba(96, 72, 64, 0.08);
  cursor: pointer;
}

.guide-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 0;
  width: 36px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffefa, #f3eadc);
  box-shadow: 0 3px 8px rgba(96, 72, 64, 0.14);
  transition: transform 0.18s ease, background 0.18s ease;
}

.guide-toggle-text {
  position: relative;
  z-index: 1;
  color: rgba(64, 55, 68, 0.58);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.guide-toggle-input:checked + .guide-toggle-track {
  background: linear-gradient(180deg, #fff6dc, #ffe9a8);
}

.guide-toggle-input:checked + .guide-toggle-track .guide-toggle-thumb {
  background: linear-gradient(180deg, #fff3c4, #ffd86f);
  transform: translateX(40px);
}

.guide-mode-start-on .guide-toggle-track {
  background: linear-gradient(180deg, #fff6dc, #ffe9a8);
}

.guide-mode-start-on .guide-toggle-thumb {
  background: linear-gradient(180deg, #fff3c4, #ffd86f);
  transform: translateX(40px);
}

.guide-mode-start-on .guide-toggle .guide-on {
  color: #725a21;
}

.guide-toggle-input:checked + .guide-toggle-track .guide-on,
.guide-toggle-input:not(:checked) + .guide-toggle-track .guide-off {
  color: #725a21;
}

.guide-toggle-input:focus-visible + .guide-toggle-track {
  outline: 4px solid rgba(240, 152, 136, 0.32);
  outline-offset: 3px;
}

.is-initializing .guide-toggle-thumb,
.is-initializing .guide-toggle-track,
.is-initializing .key-display,
.is-initializing .clef-mode-selector,
.is-initializing .staff-svg,
.is-initializing .relative-guide {
  transition: none !important;
}

.status-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--berry);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#stateLabel {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.key-display {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: grid;
  width: max-content;
  max-width: min(220px, 28vw);
  gap: 4px;
  justify-items: center;
  min-width: 0;
  transform: translate(-50%, -50%);
}

.conversion-strip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.parallel-control {
  position: relative;
  display: inline-flex;
}

.conversion-chip {
  min-height: 22px;
  padding: 3px 8px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  color: rgba(92, 75, 99, 0.86);
  cursor: pointer;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 9px rgba(96, 72, 64, 0.07);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.parallel-chip {
  background: linear-gradient(180deg, rgba(226, 216, 255, 0.78), rgba(255, 254, 250, 0.82));
}

.enharmonic-chip {
  background: linear-gradient(180deg, rgba(204, 236, 255, 0.76), rgba(255, 254, 250, 0.84));
}

.conversion-chip:hover:not(:disabled),
.conversion-chip:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  filter: saturate(1.05);
  outline: none;
}

.conversion-chip:focus-visible:not(:disabled) {
  box-shadow:
    0 4px 9px rgba(96, 72, 64, 0.07),
    0 0 0 4px rgba(240, 152, 136, 0.24);
}

.conversion-chip:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.parallel-popover {
  position: fixed;
  left: var(--parallel-popover-left, 50vw);
  top: var(--parallel-popover-top, 0);
  z-index: 10000;
  display: grid;
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 32px);
  gap: 6px;
  padding: 8px;
  border: 2px solid #ffffff;
  border-radius: 16px;
  background: #fffaf2;
  box-shadow: 0 14px 30px rgba(96, 72, 64, 0.18);
  opacity: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
}

.parallel-popover[hidden] {
  display: none;
}

.parallel-popover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #fffaf2;
  transform: translateX(-50%) rotate(45deg);
}

.parallel-option {
  position: relative;
  z-index: 1;
  display: block;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(226, 216, 255, 0.68), rgba(255, 248, 237, 0.86));
  color: #5c4b63;
  cursor: pointer;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(64, 55, 68, 0.04);
}

.parallel-option:hover:not(:disabled),
.parallel-option:focus-visible:not(:disabled) {
  outline: none;
  filter: saturate(1.05);
}

.parallel-option-detail {
  display: block;
  color: #5c4b63;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
}

.parallel-option:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.relative-guide {
  position: relative;
  z-index: 3;
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 6px;
  max-height: 145px;
  overflow: visible;
  padding: 11px 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(64, 55, 68, 0.04),
    0 6px 12px rgba(96, 72, 64, 0.07);
  cursor: pointer;
  pointer-events: auto;
  transform: none;
  opacity: 1;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    max-height 220ms ease,
    padding 220ms ease,
    border-width 220ms ease,
    opacity 220ms ease,
    transform 220ms ease;
}

.relative-guide:hover,
.relative-guide:focus-visible {
  border-color: rgba(255, 216, 199, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(64, 55, 68, 0.04),
    0 8px 16px rgba(96, 72, 64, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.relative-guide[hidden],
.relative-guide.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  transform: translateY(8px);
}

.relative-guide-visual {
  position: relative;
  width: 60px;
  height: 48px;
  flex: 0 0 auto;
  overflow: visible;
}

.relative-guide-cat {
  position: absolute;
  right: -10px;
  top: -10px;
  width: 34px;
  height: auto;
  filter: drop-shadow(0 5px 6px rgba(96, 72, 64, 0.13));
  animation: relativeCatHop 2.8s ease-in-out infinite;
}

.relative-steps {
  position: absolute;
  right: 0;
  bottom: 3px;
  width: 42px;
  height: 30px;
}

.relative-step {
  position: absolute;
  display: grid;
  width: 16px;
  height: 11px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff6dc, #ffe9a8);
  color: #725a21;
  font-size: 0.5rem;
  font-weight: 900;
  box-shadow: 0 3px 6px rgba(96, 72, 64, 0.1);
}

.step-one {
  right: 0;
  top: 0;
}

.step-two {
  right: 11px;
  top: 8px;
}

.step-three {
  right: 22px;
  top: 16px;
}

.relative-guide-text {
  display: grid;
  gap: 1px;
  max-width: 96px;
  padding: 0;
  color: #5c4b63;
  font-size: 0.55rem;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
}

.relative-guide-title,
.relative-guide-steps {
  display: block;
}

.relative-guide-title {
  color: #6b5870;
}

.relative-guide-steps {
  color: #765f24;
  font-size: 0.58rem;
}

.relative-guide-text strong {
  color: var(--leaf);
  font-size: 0.5rem;
  line-height: 1.08;
}

.relative-guide-hint {
  display: block;
  margin-top: 2px;
  color: rgba(120, 109, 123, 0.52);
  font-size: 0.46rem;
  font-weight: 900;
  line-height: 1;
}

.relative-guide.motion-paused .relative-guide-cat {
  animation: none;
  transform: translate(-37px, 24px);
}

@keyframes relativeCatHop {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  18% {
    transform: translate(-12px, 6px) rotate(-2deg);
  }

  36% {
    transform: translate(-24px, 14px) rotate(2deg);
  }

  54% {
    transform: translate(-37px, 24px) rotate(-2deg);
  }

  70% {
    transform: translate(-37px, 24px) rotate(0deg);
  }
}

@keyframes relativeCatHopPhone {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  18% {
    transform: translate(-10px, 5px) rotate(-2deg);
  }

  36% {
    transform: translate(-20px, 12px) rotate(2deg);
  }

  54% {
    transform: translate(-31px, 20px) rotate(-2deg);
  }

  70% {
    transform: translate(-31px, 20px) rotate(0deg);
  }
}

.key-combo-button {
  position: relative;
  display: grid;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  gap: 2px;
  justify-items: center;
  padding: 9px 22px 9px 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 237, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(96, 72, 64, 0.1);
  cursor: pointer;
  font-family: "Fredoka", "Nunito", sans-serif;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.key-combo-button:hover,
.key-combo-button:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.04);
}

.key-combo-button:focus-visible {
  outline: 4px solid rgba(240, 152, 136, 0.32);
  outline-offset: 3px;
  border-radius: 22px;
}

.key-combo-button[aria-expanded="true"] {
  filter: saturate(1.08);
}

.key-caret {
  position: absolute;
  top: 16px;
  right: 9px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  opacity: 0.62;
  transform: translateY(1px);
}

.major-key-pill {
  display: block;
  color: #5c4b63;
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  font-weight: 700;
}

.minor-key-pill {
  display: block;
  color: var(--muted);
  font-size: clamp(0.76rem, 1.55vw, 0.88rem);
  font-weight: 700;
}

.key-slider-popover {
  --selected-bg: linear-gradient(180deg, #ffffff, #f7f1e8);
  --selected-text: #625564;
  --selected-thumb: #fffefa;
  --key-label-width: 44px;
  --key-lane-width: min(410px, calc(100vw - 128px));
  position: fixed;
  top: var(--popover-top, 0px);
  left: var(--popover-left, 50vw);
  z-index: 9999;
  display: grid;
  width: min(560px, calc(100vw - 36px));
  gap: 6px;
  padding: 10px 14px;
  border: 2px solid #ffffff;
  border-radius: 20px;
  background: #fffaf2 !important;
  box-shadow: 0 18px 36px rgba(96, 72, 64, 0.2);
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: translateX(-50%);
}

.key-slider-popover[hidden] {
  display: none;
}

.slider-track-row {
  display: grid;
  justify-items: center;
}

.slider-track-spacer {
  display: none;
}

.signature-slider {
  position: relative;
  width: var(--key-lane-width);
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.signature-slider-track {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: linear-gradient(90deg, #bfe4ff 0%, #fdf5e9 50%, #aee6d5 100%);
  box-shadow: inset 0 1px 2px rgba(96, 72, 64, 0.08);
  transform: translateY(-50%);
}

.signature-slider-thumb {
  position: absolute;
  top: 50%;
  left: calc(100% * var(--selected-percent));
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: var(--selected-thumb);
  box-shadow: 0 5px 12px rgba(96, 72, 64, 0.22);
  transform: translate(-50%, -50%);
}

.signature-slider:focus-visible {
  outline: 4px solid rgba(240, 152, 136, 0.32);
  outline-offset: 4px;
  border-radius: 999px;
}

.key-tick-grid {
  position: relative;
  width: var(--key-lane-width);
  min-height: 56px;
  justify-self: center;
}

.key-column-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--key-lane-width) * var(--selected-percent));
  z-index: 0;
  width: clamp(28px, 5.8%, 38px);
  border-radius: 16px;
  background: var(--selected-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 4px 9px rgba(128, 99, 46, 0.12);
  transform: translateX(-50%);
}

.key-tick-row-label {
  position: absolute;
  left: calc((var(--key-label-width) + 8px) * -1);
  z-index: 1;
  color: var(--berry);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.major-row-label {
  top: 8px;
}

.minor-row-label {
  top: 36px;
}

.key-tick-label {
  position: absolute;
  left: calc(var(--key-lane-width) * var(--tick-percent));
  z-index: 1;
  min-width: 0;
  min-height: 25px;
  padding: 4px 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(64, 55, 68, 0.64);
  cursor: pointer;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
}

.major-tick {
  top: 1px;
}

.minor-tick {
  top: 29px;
}

.key-tick-label[data-value^="-"] {
  color: #315f80;
}

.key-tick-label[data-value="0"] {
  color: #725a21;
}

.key-tick-label:not([data-value^="-"]):not([data-value="0"]) {
  color: #285f50;
}

.key-tick-label:hover,
.key-tick-label:focus-visible {
  background: rgba(255, 255, 255, 0.64);
  outline: 0;
}

.key-tick-label.selected {
  color: var(--selected-text);
  background: transparent;
  box-shadow: none;
}

.staff-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 322px;
  padding: clamp(10px, 1.7vw, 16px);
  border: 2px dashed rgba(128, 99, 46, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 240, 0.68)),
    var(--paper);
}

.staff-sidebar {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  align-self: center;
  min-height: 238px;
  align-content: center;
}

.clef-mode-selector {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  align-self: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 0 0 1px rgba(64, 55, 68, 0.05);
  transition: transform 220ms ease;
}

.staff-stage.guide-active .clef-mode-selector {
  transform: translateY(-3px);
}

.guide-mode-start-on .staff-stage .clef-mode-selector {
  transform: translateY(-3px);
}

.clef-mode-title {
  color: var(--berry);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.clef-mode-button {
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.78);
  color: var(--muted);
  cursor: pointer;
  font-family: "Nunito", "Trebuchet MS", sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.clef-mode-button:hover,
.clef-mode-button:focus-visible {
  transform: translateY(-1px);
  outline: 0;
}

.clef-mode-button.selected {
  background: linear-gradient(180deg, #fff6dc, #ffe9a8);
  color: #725a21;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 10px rgba(128, 99, 46, 0.12);
}

.staff-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.15s ease;
}

.staff-stage.guide-active .staff-svg {
  transform: translateY(-54px);
}

.guide-mode-start-on .staff-stage .staff-svg {
  transform: translateY(-54px);
}

@media (min-width: 721px) {
  .staff-stage .staff-svg {
    transform: translateY(10px);
  }

  .staff-stage.guide-active .staff-svg,
  .guide-mode-start-on .staff-stage .staff-svg {
    transform: translateY(-14px);
  }
}

.staff-line {
  stroke: var(--staff);
  stroke-width: 3;
  stroke-linecap: round;
}

@font-face {
  font-family: "StaffClefs";
  src:
    local("Segoe UI Symbol"),
    url("assets/fonts/staff-clefs.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: block;
  unicode-range: U+266D, U+266F, U+1D11E, U+1D121, U+1D122, U+1D12A, U+1D12B;
}

.clef-symbol {
  fill: var(--staff);
  font-family: "StaffClefs", "Segoe UI Symbol", "Times New Roman", Georgia, serif;
  font-weight: 400;
  text-anchor: middle;
}

.clef-treble {
  font-size: 114px;
}

.clef-bass {
  font-size: 85.5px;
  transform: scaleY(0.9);
  transform-box: fill-box;
  transform-origin: 50% 54%;
}

.clef-alto,
.clef-tenor {
  font-size: 92px;
}

.accidental-symbol {
  fill: var(--ink);
  font-family: "StaffClefs", "Segoe UI Symbol", Georgia, "Times New Roman", serif !important;
  font-size: 42px;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  dominant-baseline: middle;
  text-anchor: middle;
}

.guide-accidental-glow {
  fill: rgba(255, 231, 154, 0.52);
  stroke: rgba(240, 152, 136, 0.44);
  stroke-width: 2;
}

.guide-highlighted-accidental .accidental-symbol {
  fill: #2f2834;
}

.guide-helper {
  position: absolute;
  left: calc(112px + 14px);
  right: 16px;
  bottom: 4px;
  z-index: 3;
  height: 88px;
  pointer-events: none;
}

.guide-helper[hidden] {
  display: none;
}

.guide-cat {
  position: absolute;
  right: 0;
  bottom: 20px;
  width: clamp(68px, 9.1vw, 88px);
  height: auto;
  filter: drop-shadow(0 8px 10px rgba(96, 72, 64, 0.13));
}

.guide-bubble {
  position: absolute;
  right: calc(clamp(68px, 9.1vw, 88px) + 4px);
  bottom: 20px;
  width: fit-content;
  max-width: calc(100% - clamp(68px, 9.1vw, 88px) - 8px);
  min-height: 38px;
  max-height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: 0 8px 16px rgba(96, 72, 64, 0.1);
}

.guide-bubble::before {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 12px;
  width: 14px;
  height: 14px;
  border-right: 2px solid rgba(255, 255, 255, 0.88);
  border-bottom: 2px solid rgba(255, 255, 255, 0.88);
  background: rgba(255, 254, 250, 0.94);
  transform: rotate(45deg);
}

.guide-bubble p {
  position: relative;
  margin: 0;
  color: #5c4b63;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
}

.guide-bubble .guide-example {
  margin-top: 0;
  color: var(--leaf);
  font-size: 0.74rem;
  white-space: nowrap;
}

.guide-bubble .guide-example[hidden] {
  display: none;
}

.controls-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.accidental-control {
  display: grid;
  grid-template-columns: 52px minmax(54px, 1fr) 52px;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 8px;
  border-radius: 20px;
  box-shadow:
    0 8px 0 rgba(128, 99, 46, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.sharp-control {
  background: linear-gradient(180deg, #c7f0df, #aee6d5);
}

.flat-control {
  background: linear-gradient(180deg, #d8efff, #bfe4ff);
}

.step-button,
.reset-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.step-button {
  min-height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  color: #563a39;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  box-shadow:
    0 4px 0 rgba(128, 99, 46, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.control-label {
  display: inline-flex;
  gap: 0.35rem;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  color: #563a39;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.control-symbol {
  display: inline-block;
  font-size: 1.45rem;
  line-height: 0.9;
}

.music-symbol {
  font-family: "StaffClefs", "Segoe UI Symbol", Georgia, "Times New Roman", serif !important;
  font-size: 1.75rem;
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  transform: translateY(-0.02em);
}

.reset-button {
  min-height: 44px;
  padding: 9px 15px;
  border: 2px solid rgba(128, 99, 46, 0.14);
  border-radius: 999px;
  background: var(--paper);
  color: #65546b;
  font-size: 0.92rem;
  box-shadow: 0 5px 0 rgba(128, 99, 46, 0.1);
}

.step-button:hover:not(:disabled),
.reset-button:hover:not(:disabled),
.step-button:focus-visible:not(:disabled),
.reset-button:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  filter: saturate(1.04);
}

.step-button:focus-visible,
.reset-button:focus-visible {
  outline: 4px solid rgba(240, 152, 136, 0.32);
  outline-offset: 3px;
}

.step-button:active:not(:disabled),
.reset-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(128, 99, 46, 0.16);
}

.step-button:disabled,
.reset-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.18);
}

.learning-note {
  padding: 10px 12px;
  border: 1px dashed rgba(128, 99, 46, 0.24);
  border-radius: 20px;
  background: rgba(255, 248, 237, 0.72);
}

.learning-note p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.3;
}

.mnemonic-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.mnemonic-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 0 0 1px rgba(64, 55, 68, 0.06);
  opacity: 0.76;
}

.mnemonic-card.active {
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 0 0 1px rgba(53, 123, 103, 0.13),
    0 8px 18px rgba(96, 72, 64, 0.08);
  opacity: 1;
}

.mnemonic-card h3 {
  margin: 0;
  color: var(--berry);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.mnemonic-words {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}

.mnemonic-word {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  min-height: 21px;
  padding: 2px 6px;
  border-radius: 999px;
  background: transparent;
  color: rgba(64, 55, 68, 0.64);
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.mnemonic-word.collected {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 3px 7px rgba(128, 99, 46, 0.12);
}

.mnemonic-sharps .mnemonic-word.collected {
  background: linear-gradient(180deg, #d6f6e9, #aee6d5);
  color: #285f50;
}

.mnemonic-flats .mnemonic-word.collected {
  background: linear-gradient(180deg, #e1f4ff, #bfe4ff);
  color: #305f80;
}

.bead-helper {
  position: absolute;
  left: calc(10px + 70px + 10px + ((100% - 20px - 70px - 10px) * 4 / 7) - 29px);
  top: -12px;
  z-index: 4;
  width: 32px;
  height: 42px;
  pointer-events: none;
  transform: none;
}

.bead-confetti-piece {
  position: absolute;
  left: 15px;
  bottom: 16px;
  z-index: 6;
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--confetti-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  opacity: 0;
  animation: beadConfettiPop 980ms cubic-bezier(0.16, 0.8, 0.28, 1) var(--confetti-delay) forwards;
}

.bead-confetti-dash {
  width: 5px;
  height: 11px;
  border-radius: 4px;
}

@keyframes beadConfettiPop {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4) rotate(0deg);
  }

  18%,
  78% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--confetti-x), var(--confetti-y)) scale(1) rotate(var(--confetti-rotate));
  }
}

@media (prefers-reduced-motion: reduce) {
  .clef-mode-selector,
  .key-display,
  .relative-guide {
    transition: none;
  }

  .staff-stage.guide-active .clef-mode-selector,
  .relative-guide[hidden],
  .relative-guide.is-hidden {
    transform: none;
  }

  .bead-confetti-piece {
    animation: none;
    display: none;
  }
}

.bead-helper-cat {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: auto;
  filter: drop-shadow(0 5px 7px rgba(96, 72, 64, 0.13));
}

.bead-helper-bubble {
  position: absolute;
  right: calc(100% + 5px);
  bottom: 29px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 330px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: 0 8px 16px rgba(96, 72, 64, 0.11);
  color: #5c4b63;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
}

.bead-helper-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.bead-word {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #403744;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 700;
  line-height: 1;
}

.bead-word span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #403744;
  font-size: 0.62rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 1px 3px rgba(96, 72, 64, 0.12);
}

.bead-word span:nth-child(1) {
  background: #bfe4ff;
}

.bead-word span:nth-child(2) {
  background: #ffe57d;
}

.bead-word span:nth-child(3) {
  background: #ef4b76;
  color: #fffefa;
}

.bead-word span:nth-child(4) {
  background: #aee6d5;
}

.bead-period {
  margin-left: -1px;
}

.bead-helper-bubble::after {
  content: "";
  position: absolute;
  right: -16px;
  top: 68%;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 17px solid rgba(255, 254, 250, 0.96);
  transform: translateY(-50%);
}

.bead-helper-bubble::before {
  content: "";
  position: absolute;
  right: -20px;
  top: 68%;
  z-index: -1;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid rgba(255, 255, 255, 0.9);
  transform: translateY(-50%);
}

.bead-helper-beads {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.bead-helper-beads span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.bead-helper-beads span:nth-child(1) {
  background: #bfe4ff;
}

.bead-helper-beads span:nth-child(2) {
  background: #ffe57d;
}

.bead-helper-beads span:nth-child(3) {
  background: #ef4b76;
}

.bead-helper-beads span:nth-child(4) {
  background: #aee6d5;
}

footer {
  padding: 2px 0 0;
  color: #8b8582;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
}

@media (min-width: 721px) {
  .app-shell {
    zoom: 0.85;
  }
}

@media (min-width: 900px) and (max-height: 820px) {
  .app-shell {
    width: min(920px, calc(100% - 32px));
    gap: 9px;
    padding-top: 12px;
  }

  .study-cat {
    width: 128px;
  }

  .intro {
    font-size: 0.98rem;
  }

  .builder-card {
    gap: 9px;
    padding: 12px 16px 16px;
  }

  .accidental-control {
    min-height: 56px;
  }

  .step-button,
  .control-label {
    min-height: 40px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 22px, 640px);
    min-height: auto;
    grid-template-rows: auto;
    gap: 10px;
    padding-top: 10px;
  }

  .study-cat {
    width: clamp(92px, 26vw, 124px);
    margin-bottom: -2px;
  }

  h1 {
    font-size: clamp(1.9rem, 8vw, 2.75rem);
    white-space: nowrap;
  }

  .intro {
    font-size: 0.95rem;
  }

  .builder-card {
    border-radius: 24px;
    padding: 12px;
  }

  .status-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    min-height: 136px;
    padding-inline: 2px;
  }

  .status-strip > div:first-child {
    max-width: none;
  }

  .key-display {
    position: relative;
    left: auto;
    top: auto;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    justify-items: center;
    width: max-content;
    max-width: min(260px, 100%);
    gap: 4px;
    transform: none;
  }

  .key-slider-popover {
    width: min(520px, calc(100vw - 46px));
  }

  .major-key-pill {
    font-size: 0.95rem;
  }

  .minor-key-pill {
    font-size: 0.8rem;
  }

  .status-actions {
    position: relative;
    top: auto;
    right: auto;
    grid-column: 2;
    grid-row: 1;
    transform: none;
  }


  .staff-stage {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 9px;
    min-height: 310px;
    padding: 8px;
    border-radius: 20px;
  }

  .guide-helper {
    left: calc(96px + 9px);
    right: 12px;
    bottom: 10px;
    height: 88px;
  }

  .guide-bubble {
    min-height: 47px;
    max-height: 58px;
    padding: 7px 11px;
  }

  .guide-bubble p {
    font-size: 0.72rem;
    white-space: normal;
  }

  .guide-bubble .guide-example {
    font-size: 0.7rem;
  }

  .clef-mode-selector {
    gap: 5px;
    padding: 7px;
    border-radius: 16px;
  }

  .clef-mode-button {
    min-height: 30px;
    padding-inline: 6px;
    font-size: 0.72rem;
  }

  .accidental-control {
    grid-template-columns: 48px minmax(48px, 1fr) 48px;
    min-height: 56px;
    border-radius: 18px;
  }

  .step-button,
  .control-label {
    min-height: 42px;
  }
}

@media (max-width: 440px) {
  .app-shell {
    width: min(100% - 16px, 640px);
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  .intro {
    max-width: 310px;
  }

  .status-strip {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
      "signature actions"
      "key relative";
    align-items: start;
    gap: 10px;
    min-height: 158px;
  }

  .status-strip > div:first-child {
    grid-area: signature;
  }

  .status-actions {
    grid-area: actions;
    gap: 7px;
  }

  .status-kicker {
    font-size: 0.66rem;
  }

  .major-key-pill {
    font-size: 0.86rem;
  }

  .minor-key-pill {
    font-size: 0.72rem;
  }

  .key-display {
    grid-area: key;
    display: grid;
    grid-template-columns: minmax(0, max-content) max-content;
    grid-template-areas: "key conversions";
    align-items: center;
    justify-content: start;
    justify-items: center;
    column-gap: 10px;
    justify-self: start;
    align-self: center;
    width: max-content;
    max-width: min(310px, 100%);
    margin-left: 18px;
    transition: transform 240ms ease;
  }

  .phone-relative-guide-slot {
    grid-area: relative;
    display: grid;
    justify-self: end;
    align-self: start;
    width: fit-content;
    min-height: 96px;
  }

  .status-strip:has(.guide-toggle-input:not(:checked)) .key-display {
    transform: translateX(64px);
  }

  .guide-mode-start-on .status-strip .key-display {
    transform: none;
  }

  .status-strip:has(.guide-toggle-input:not(:checked)) .phone-relative-guide-slot {
    pointer-events: none;
  }

  .key-combo-button {
    grid-area: key;
    min-width: 166px;
    padding: 8px 30px 8px 14px;
  }

  .key-caret {
    top: 14px;
    right: 12px;
    border-left-width: 4px;
    border-right-width: 4px;
    border-top-width: 5px;
  }

  .conversion-strip {
    grid-area: conversions;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    transform: translateX(19px);
  }

  .conversion-chip {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 0.58rem;
  }

  .parallel-popover {
    max-width: calc(100vw - 1rem);
    gap: 4px;
    padding: 5px;
    border-radius: 15px;
    background: #fffaf2;
    box-shadow: 0 14px 30px rgba(96, 72, 64, 0.2);
  }

  .parallel-popover.phone-side-popover::after {
    left: -8px;
    top: var(--parallel-arrow-top, 50%);
    bottom: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 2px solid #ffffff;
    border-top: 2px solid #ffffff;
    transform: translateY(-50%) rotate(-45deg);
  }

  .parallel-option {
    padding: 4px 6px;
    border-radius: 11px;
  }

  .parallel-option-detail {
    font-size: 0.54rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .key-slider-popover {
    --key-label-width: 30px;
    --key-lane-width: min(280px, calc(100vw - 104px));
    width: calc(100vw - 24px);
    padding-inline: 6px;
  }

  .key-tick-row-label {
    font-size: 0.62rem;
  }

  .key-tick-labels {
    gap: 1px;
  }

  .key-tick-label {
    min-height: 23px;
    padding-inline: 1px;
    font-size: 0.52rem;
  }

  .controls-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .accidental-control {
    grid-template-columns: 34px minmax(50px, 1fr) 34px;
    min-height: 50px;
    padding: 6px;
    gap: 5px;
  }

  .control-label {
    gap: 3px;
    min-height: 36px;
    font-size: 0.82rem;
  }

  .control-symbol {
    font-size: 1.08rem;
  }

  .music-symbol {
    font-size: 1.28rem;
  }

  .flat-accidental .accidental-symbol {
    font-size: 39.9px;
  }

  .step-button {
    min-height: 36px;
    border-radius: 12px;
    font-size: 1.18rem;
  }

  .reset-button {
    min-height: 38px;
    padding-inline: 11px;
    font-size: 0.92rem;
  }

  .staff-stage {
    margin-top: -3px;
    grid-template-columns: 1fr;
    align-items: start;
    overflow: hidden;
    min-height: 252px;
    gap: 8px;
  }

  .staff-sidebar {
    position: static;
    display: block;
    align-self: start;
    justify-self: center;
    min-height: 0;
    width: auto;
  }

  .staff-svg {
    transform: translateY(-30px);
  }

  .staff-stage.guide-active .staff-svg,
  .guide-mode-start-on .staff-stage .staff-svg {
    transform: translateY(-30px);
  }

  .staff-stage.guide-active .clef-mode-selector,
  .guide-mode-start-on .staff-stage .clef-mode-selector {
    transform: none;
  }

  .guide-helper {
    left: 8px;
    right: 8px;
    top: 169px;
    bottom: auto;
    height: 86px;
  }

  .guide-cat {
    bottom: 20px;
    width: clamp(55px, 19.5vw, 70px);
  }

  .guide-bubble {
    right: calc(clamp(55px, 19.5vw, 70px) + 4px);
    bottom: 20px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    border-radius: 17px;
    min-height: 48px;
    max-height: 70px;
    padding: 5px 9px;
  }

  .guide-bubble p {
    font-size: 0.55rem;
    line-height: 1.05;
  }

  .guide-bubble .guide-example {
    margin-top: 0;
    font-size: 0.55rem;
    line-height: 1.05;
  }

  .guide-bubble::before {
    right: -7px;
    bottom: 13px;
    border-right: 2px solid rgba(255, 255, 255, 0.88);
    border-bottom: 2px solid rgba(255, 255, 255, 0.88);
  }

  .clef-mode-selector {
    grid-template-columns: repeat(4, max-content);
    align-items: center;
    justify-content: start;
    gap: 4px;
    padding: 5px 6px;
    align-self: start;
    width: fit-content;
  }

  .clef-mode-title {
    font-size: 0.68rem;
    text-align: center;
  }

  .clef-mode-button {
    min-height: 24px;
    padding: 4px 9px;
    font-size: 0.64rem;
  }

  .relative-guide {
    position: relative;
    top: 0;
    right: auto;
    z-index: 4;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    width: fit-content;
    max-width: 45vw;
    gap: 4px;
    padding: 6px 7px;
    border-radius: 15px;
  }

  .relative-guide-text {
    max-width: 94px;
    font-size: 0.48rem;
  }

  .relative-guide-text strong {
    font-size: 0.46rem;
  }

  .relative-guide-steps {
    font-size: 0.5rem;
  }

  .relative-guide-hint {
    font-size: 0.42rem;
  }

  .relative-guide-visual {
    width: 54px;
    height: 42px;
  }

  .relative-guide-cat {
    right: -7px;
    top: -8px;
    width: 30px;
  }

  .relative-steps {
    width: 38px;
    height: 27px;
  }

  .relative-step {
    width: 14px;
    height: 10px;
    font-size: 0.44rem;
    border-radius: 5px;
  }

  .relative-guide-cat {
    animation-name: relativeCatHopPhone;
  }

  .relative-guide.motion-paused .relative-guide-cat {
    transform: translate(-31px, 20px);
  }

  .learning-note {
    border-radius: 17px;
    padding: 8px 7px;
    font-size: 0.8rem;
  }

  .mnemonic-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 5px;
    padding: 5px 6px;
    border-radius: 17px;
  }

  .mnemonic-card h3 {
    font-size: 0.66rem;
  }

  .mnemonic-words {
    gap: 1px;
  }

  .mnemonic-word {
    min-height: 18px;
    padding: 2px 2px;
    font-size: 0.56rem;
  }

  .bead-helper {
    left: calc(6px + 42px + 5px + ((100% - 12px - 42px - 5px) * 4 / 7) - 9.5px);
    top: -10px;
    width: 28px;
    height: 38px;
  }

  .bead-helper-cat {
    width: 28px;
  }

  .bead-helper-bubble {
    right: calc(100% - 49px);
    bottom: 34px;
    width: 253px;
    max-width: 253px;
    padding: 7px 10px;
    font-size: 0.6rem;
    line-height: 1.05;
    white-space: nowrap;
  }

  .bead-helper-text {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .bead-helper-bubble::after {
    right: 34px;
    top: auto;
    bottom: -10px;
    border-top: 11px solid rgba(255, 254, 250, 0.96);
    border-right: 8px solid transparent;
    border-bottom: 0;
    border-left: 8px solid transparent;
    transform: none;
  }

  .bead-helper-bubble::before {
    right: 31px;
    top: auto;
    bottom: -14px;
    border-top: 14px solid rgba(255, 255, 255, 0.9);
    border-right: 11px solid transparent;
    border-bottom: 0;
    border-left: 11px solid transparent;
    transform: none;
  }
}

@media (max-width: 370px) {
  .guide-bubble p,
  .guide-bubble .guide-example {
    font-size: 0.52rem;
    line-height: 1.03;
  }

  .mnemonic-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 4px;
  }

  .mnemonic-card h3 {
    text-align: left;
    font-size: 0.6rem;
  }

  .mnemonic-word {
    font-size: 0.5rem;
    padding-inline: 1px;
  }

  .bead-helper {
    left: calc(6px + 38px + 4px + ((100% - 12px - 38px - 4px) * 4 / 7) - 16px);
    right: 4px;
    top: -10px;
  }

  .bead-helper-bubble {
    white-space: normal;
  }
}
