:root {
  --quiz-guide-gap: 12px;
  --rhythm-panel-height: 360px;
}
* { box-sizing: border-box; }

body{
  margin:0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:#f6f7fb;
  color:#0b0c10;
}

a{ color: inherit; text-decoration:none; }

.wrap{
  max-width: 860px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 26px 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.homeWrap{
  min-height: 100vh;
  min-height: 100svh;
}

/* ✅ 카드끼리 간격 */
.card + .card{ margin-top: 14px; }

.card{
  --quiz-card-padding: 18px;
  --quiz-heading-height: 44px;
  background:#ffffff;
  border:1px solid #e2e5ef;
  border-radius: 18px;
  padding: var(--quiz-card-padding);
  box-shadow: 0 14px 40px rgba(10, 12, 18, .10);
}

.topbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}

.quizQuestionHeader{ align-items: flex-start; }
.quizQuestionHeader > h1{ margin-inline-end: auto; }
.quizQuestionHeader .meta{ align-self: center; }

.selectionHeader > h1,
.quizQuestionHeader > h1{
  display: flex;
  align-items: center;
  min-block-size: var(--quiz-heading-height);
}

.topbar.quizNavHeader{
  flex-direction: row;
  align-items: center;
  margin-bottom: var(--quiz-card-padding);
}
.quizNavHeader .meta{ width: auto; }
.quizNavTitle{
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}

h1{
  font-size: 20px;
  margin:0;
  font-weight: 900;
  letter-spacing: .2px;
}

.meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  font-size: 13px;
}

.pill{
  padding: 6px 10px;
  border: 1px solid #e2e5ef;
  border-radius: 999px;
  background:#f3f5fb;
  color:#0b0c10;
  font-weight: 700;
}

.sectionTitle{
  margin: 10px 0 12px;
  font-size: 14px;
  font-weight: 900;
}

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

@media (max-width: 640px){
  .grid2{ grid-template-columns: 1fr; }
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid #d7dbea;
  background:#fff;
  color:#0b0c10;
  font-weight: 900;
  cursor:pointer;
  transition: transform .05s ease, border-color .15s ease, box-shadow .15s ease;
  user-select:none;
}

.btn:hover{
  border-color:#9aa3c7;
  box-shadow: 0 10px 24px rgba(15, 20, 40, .08);
}
.btn:active{ transform: translateY(1px); }
.btn[disabled]{ opacity:.55; cursor:not-allowed; box-shadow:none; }

.btnPrimary{
  border: none;
  background:#4a53a0;
  color:#fff;
}

.homeExamBtn{
  border: 1px solid #343b78;
}

.btnGhost{
  background:#fff;
  border:1px solid #d7dbea;
  color:#0b0c10;
}

/* --- Quiz layout --- */
.notationCard{
  margin-top: 8px;
  padding: 10px 10px 4px;
  border: 1px solid #e2e5ef;
  border-radius: 16px;
  background:#fff;
}

#scoreArea{
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 6px 0 4px;
}

#notation{
  width: 100%;
  overflow:hidden;
  background:#fff;
}

/* 악보는 검정 유지 */
#notation svg { background:#fff; }
#notation svg text { fill:#000; }
#notation svg path { fill:#000; stroke:#000; }
#notation svg line { stroke:#000; }

#notation.rhythmNotation{
  height: var(--rhythm-panel-height);
  border: 1px solid #cfcfcf;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rhythmNotation svg{
  width: auto;
  max-width: 100%;
  min-width: 0;
  height: auto;
  max-height: 100%;
}

.answerRow{
  display:flex;
  gap: 10px;
  margin-top: 14px;
  align-items:center;
}

#answerInput{
  flex:1;
  border: 1px solid #d7dbea;
  border-radius: 14px;
  padding: 12px 12px;
  font-size: 15px;
  outline: none;
  color:#0b0c10;
  background:#fff;
}

#answerInput:focus{
  border-color:#9aa3c7;
  box-shadow: 0 0 0 3px rgba(74,83,160,.14);
}

.helpText{
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color:#2b2f3a;
  opacity: .9;
}

.answerRow + .helpText,
.rhythmGuide{
  margin-top: var(--quiz-guide-gap);
}

.selectionHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selectionHeader + :is(.grid2, .meta){
  margin-top: var(--quiz-guide-gap);
}

.selectionClose{
  display: grid;
  place-items: center;
  flex: none;
  inline-size: var(--quiz-heading-height);
  block-size: var(--quiz-heading-height);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--shell-ink);
  cursor: pointer;
}

.selectionClose::before{
  content: "";
  inline-size: 20px;
  block-size: 20px;
  background: currentColor;
  mask: url("./icon-x.svg") center / contain no-repeat;
}

.selectionClose:is(:hover, :focus-visible){
  background: var(--shell-hover);
  color: var(--shell-accent);
}

.quizExitDialog{
  inline-size: min(352px, calc(100% - 32px));
  max-block-size: calc(100% - 32px);
  padding: 24px 20px;
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: var(--shell-surface);
  color: var(--shell-ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  text-align: center;
  word-break: keep-all;
}

.quizExitDialog::backdrop{ background: rgba(0, 0, 0, .55); }

@media (prefers-reduced-motion: no-preference) {
  .quizExitDialog,
  .quizExitDialog::backdrop {
    opacity: 0;
    transition-property: opacity, display, overlay;
    transition-duration: var(--site-fade-duration, 220ms);
    transition-timing-function: var(--site-fade-timing, ease-in-out);
    transition-behavior: allow-discrete;
  }

  .quizExitDialog[open],
  .quizExitDialog[open]::backdrop { opacity: 1; }

  @starting-style {
    .quizExitDialog[open],
    .quizExitDialog[open]::backdrop { opacity: 0; }
  }
}

.quizExitDialog h2{ margin: 0; font-size: 18px; line-height: 1.35; }
.quizExitDialog p{ margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--shell-muted); }
.quizExitDialog .controls{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  inline-size: min(100%, 210px);
  margin: 18px auto 0;
}

.siteFooter{
  width: 100%;
  margin: auto auto 0;
  padding-top: 40px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color:#2b2f3a;
  opacity: .72;
}

.feedback{
  margin-top: var(--quiz-guide-gap);
  min-height: 22px;
  font-size: 14px;
  font-weight: 700;
}

#gameView:has(.answerRow + .helpText, .rhythmGuide) > .feedback:empty{
  min-height: 0;
}

.examIntroCard{ --exam-title-line-height: 24px; }
.examIntroCard .selectionHeader > h1{ line-height: var(--exam-title-line-height); }

.examIntro{
  display: grid;
  gap: var(--quiz-guide-gap);
  /* Match the gap to the title text rather than the full close-button row. */
  margin-top: calc(var(--quiz-guide-gap) + (var(--quiz-heading-height) - var(--exam-title-line-height)) / 2);
}

.examIntro > :is(.sectionTitle, .helpText){
  margin: 0;
}

.examTimer{
  font-variant-numeric: tabular-nums;
}

.examTimer.urgent{
  border-color: #ff4d5d;
  background: rgba(255,77,93,.12);
  color: #b91c1c;
}

.examQuestionText{
  margin: 8px 0 12px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 900;
}

.examStatus{
  color: #475569;
}

.examAnswerPanel{
  margin-top: 12px;
}

.rhythmGuide{
  display: grid;
  gap: 6px;
}

.rhythmShortcuts{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.rhythmShortcut{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mobileHint{ display:none; }

.helpText kbd{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 24px;
  line-height: 1;
  padding: 2px 6px;
  border: 1px solid #bbb;
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(255,255,255,.7);
}

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

.examChoice{
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.examChoice.selected{
  border-color: #4a53a0;
  background: rgba(74,83,160,.14);
  box-shadow: 0 0 0 3px rgba(74,83,160,.10);
}

.examQnav .qbtn.answered{
  border-color: #4a53a0;
  background: rgba(74,83,160,.12);
}

.wrongReviewPanel{
  width: 100%;
  margin: 16px auto 0;
  text-align: left;
}

.wrongReviewTitle{
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 900;
}

.wrongReviewEmpty{
  padding: 14px;
  border: 1px solid #e2e5ef;
  border-radius: 10px;
  background: #f8fafc;
  color: #2b2f3a;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

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

.wrongReviewCard{
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e5ef;
  border-radius: 10px;
  background: #f8fafc;
}

.wrongReviewCard.fullWidth{
  grid-column: 1 / -1;
}

.wrongReviewCardTitle{
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 900;
}

.wrongReviewImage{
  width: 100%;
  height: 124px;
  margin-bottom: 8px;
  border: 1px solid #d7dbea;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.wrongReviewImage:where(.wide){
  height: 260px;
}

.wrongReviewImage.intervalReviewImage{
  height: var(--panel-h, 180px);
}

.wrongReviewImage.staffPanelReviewImage{
  height: var(--panel-h, 180px);
}

.wrongReviewImage.rhythmReviewImage{
  height: var(--rhythm-panel-height);
}

.wrongReviewImage img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
}

.wrongReviewMeta{
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wrongReviewPlayBtn{
  width: 100%;
  margin-top: 10px;
}

.theoryReview{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.theoryReviewQuestion{
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  color: #111827;
}

.theoryReviewKey{
  width: 100%;
  height: 130px;
  border: 1px solid #d7dbea;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.theoryReviewKey svg{
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}

.theoryReviewChoices{
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.theoryReviewChoice{
  min-width: 0;
  padding: 7px;
  border: 1px solid #d7dbea;
  border-radius: 8px;
  background: #fff;
}

.theoryReviewChoice.correctAnswer{
  border-color: #2bb673;
  background: rgba(43,182,115,.10);
}

.theoryReviewChoice.wrongSelected{
  border-color: #ff4d5d;
  background: rgba(255,77,93,.08);
}

.theoryReviewChoiceTop{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.theoryReviewChoiceNumber{
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #25308a;
  font-size: 12px;
  font-weight: 950;
}

.theoryReviewBadges{
  display: inline-flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theoryReviewBadge{
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.theoryReviewBadge.correct{
  background: rgba(43,182,115,.16);
  color: #047857;
}

.theoryReviewBadge.wrong{
  background: rgba(255,77,93,.14);
  color: #b91c1c;
}

.theoryReviewChoiceText{
  font-size: 14px;
  font-weight: 850;
  color: #111827;
}

.theoryReviewNotation{
  height: 104px;
  border: 1px solid #eef0f6;
}

.theoryPanel{
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #e2e5ef;
  border-radius: 14px;
  background:#fff;
}

.theoryQuestion{
  min-height: 64px;
  display:flex;
  align-items:center;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 900;
}

.theoryNotation{
  width: 100%;
  height: 130px;
  margin-bottom: 14px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  overflow: hidden;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
}

.theoryNotation svg{
  width: 100%;
  height: 100%;
  display:block;
  background:#fff;
}

.theoryNotation svg text{ fill:#000; }
.theoryNotation svg path{ fill:#000; stroke:#000; }
.theoryNotation svg line{ stroke:#000; }

.choiceGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.choiceBtn{
  min-height: 58px;
  justify-content:flex-start;
  text-align:left;
  line-height:1.35;
  white-space: normal;
}

.staffChoiceBtn{
  min-height: 118px;
  padding: 8px;
  justify-content:center;
}

.choiceNotation{
  width: 100%;
  height: 104px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.choiceNotation svg{
  width: 100%;
  height: 100%;
  display:block;
  background: #fff;
}

.choiceNotation svg text{ fill:#000; }
.choiceNotation svg path{ fill:#000; stroke:#000; }
.choiceNotation svg line{ stroke:#000; }

.srOnly{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.choiceBtn.correctChoice{
  border-color:#2bb673;
  background: rgba(43,182,115,.18);
}

.choiceBtn.wrongChoice{
  border-color:#ff4d5d;
  background: rgba(255,77,93,.16);
}

.homeworkPanel{
  width: min(420px, 100%);
  margin: 14px auto 0;
  padding: 14px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 8px;
  background: rgba(248,250,252,.9);
  text-align: left;
}
.homeworkField{
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}
.homeworkField input{
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid rgba(15,23,42,.18);
  border-radius: 8px;
  font-size: 15px;
}
.homeworkActions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}
.homeworkStatus{
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
}
.homeworkStatus[data-kind="ok"]{ color: #15803d; }
.homeworkStatus[data-kind="error"]{ color: #b91c1c; }
.homeworkStatus[data-kind="pending"]{ color: #475569; }

.controls{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  margin-top: var(--quiz-guide-gap);
  flex-wrap:wrap;
}

.rhythmControls > .btn:not(.rhythmTapBtn){
  inline-size: 84px;
  min-block-size: 46px;
  padding-inline: 8px;
  word-break: keep-all;
}

/* result */
.quizResultHeading{
  display: grid;
  grid-template-columns: var(--quiz-heading-height) minmax(0, 1fr) var(--quiz-heading-height);
  align-items: center;
  gap: 8px;
  min-block-size: var(--quiz-heading-height);
}

.quizResultHeading > .quizResultTitle{
  grid-column: 2;
  justify-self: center;
}

.quizResultHeading > .selectionClose{
  grid-column: 3;
  align-self: start;
}

.controls.quizResultActions{ justify-content: center; }
.quizResultActions .btn{
  min-inline-size: 100px;
  min-height: 44px;
  text-align: center;
}
.pill.quizResultTitle{
  margin: 0;
  font-size: inherit;
  letter-spacing: 0;
}
.center{ text-align:center; }
.big{ font-size: 36px; font-weight: 950; margin: 8px 0 4px; }
.sub{ margin:0 0 16px; opacity:.85; }
.hide{ display:none; }
.mobileOnly{ display:none !important; }

/* ✅ 문항 네비게이션 */
.qnav{
  display:grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}

.card :is(.grid2, .qnav) + .helpText{
  margin-block: var(--quiz-card-padding) 0;
  overflow-wrap: anywhere;
}

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

.qbtn{
  padding: 10px 0;
  border-radius: 12px;
  border: 1px solid #d7dbea;
  background: #ffffff;
  font-weight: 900;
  cursor: pointer;
  transition: transform .05s ease, border-color .15s ease, box-shadow .15s ease;
}

.qbtn:hover{
  border-color:#9aa3c7;
  box-shadow: 0 10px 20px rgba(15, 20, 40, .08);
}

.qbtn:active{ transform: translateY(1px); }

.qbtn.current{
  border-color:#4a53a0;
  box-shadow: 0 0 0 3px rgba(74,83,160,.14);
}

.qbtn.correct{
  border-color:#2bb673;
  background: rgba(43,182,115,.18);
}

.qbtn.wrong{
  border-color:#ff4d5d;
  background: rgba(255,77,93,.16);
}

.qbtn.fixed{
  border-color:#f0c419;
  background: rgba(240,196,25,.22);
}

/* === 링크(<a>) 버튼을 <button>과 같은 글씨 크기/정렬로 보이게 === */

/* 1) a.btn은 링크 기본 스타일(밑줄/인라인)을 버튼처럼 정리 */
a.btn{
  text-decoration: none;
  line-height: 1;
  display: inline-flex;        /* 혹시 상위에서 a를 inline으로 바꾸는 경우 대비 */
  align-items: center;
  justify-content: center;

  /* ✅ 여기 숫자만 조절하면 됨 (보통 13~14px) */
  font-size: 13px;
}

/* 2) button은 브라우저 기본 appearance 차이만 제거(크기 변경 없음) */
button.btn{
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}

/* ✅ 오선지(악보) 영역 모서리 라운드 + 내부 svg까지 같이 클리핑 */
#scoreArea{
  border-radius: 14px;
  overflow: hidden;      /* svg 배경이 밖으로 튀는 걸 잘라줌 */
  background: #fff;      /* 악보는 흰 배경 유지 */
}

/* svg 자체도 라운드(보조) */
#notation{
  border-radius: 14px;
  overflow: hidden;
}

#notation svg{
  display: block;        /* 아래쪽 여백/삐져나옴 방지 */
  border-radius: 14px;
}

/* Shared notation + piano split layout for chord/scale quizzes */
.splitRow{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.splitRow > *{ min-width: 0; }
@media (max-width: 900px){
  .splitRow{ grid-template-columns: 1fr; }
}

.splitRow #notation{
  width: 100%;
  height: var(--panel-h);
  border: 1px solid #cfcfcf;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.splitRow #notation svg{
  width: 100%;
  height: 100%;
  display: block;
}

.piano{
  width: 100%;
  max-width: 100%;
  height: var(--panel-h);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  cursor: grab;
  border: 1px solid #cfcfcf;
  border-radius: 14px;
  background: #f3f3f3;
  --white-w: 34px;
}
.piano.dragging{ cursor: grabbing; }
.piano-inner{
  position: relative;
  height: var(--panel-h);
  width: max-content;
  min-width: 0;
}
.piano-white-row{
  display: flex;
  height: var(--panel-h);
  width: max-content;
  align-items: stretch;
}
.piano-key{
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.piano-key.white{
  flex: 0 0 var(--white-w);
  width: var(--white-w);
  background: #fff;
  border-right: 1px solid #d6d6d6;
}
.piano-key.black{
  position: absolute;
  top: 0;
  height: 110px;
  width: calc(var(--white-w) * 0.65);
  transform: translateX(-50%);
  border-radius: 0 0 8px 8px;
  z-index: 3;
  background: #1f1f1f;
  border: 1px solid #111;
}
.piano-key.white.active{ background: #7fd3ff; }
.piano-key.black.active{
  background: #1aa7ff;
  border-color: #1aa7ff;
}

@media (max-width: 560px){
  :root{ --rhythm-panel-height: 220px; }

  .wrap{
    padding: 14px 10px 44px;
  }

  .homeWrap{
    min-height: 100vh;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .siteFooter{
    padding-bottom: max(86px, calc(env(safe-area-inset-bottom) + 72px));
    font-size: 11px;
  }

  .card{
    --quiz-card-padding: 14px;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(10, 12, 18, .08);
  }

  .card + .card{
    margin-top: 10px;
  }

  .topbar{
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .topbar.quizQuestionHeader{
    flex-direction: row;
    flex-wrap: wrap;
  }

  .quizQuestionHeader > .meta{ order: 1; }
  .examIntroCard{ --exam-title-line-height: 22px; }

  h1{
    font-size: 19px;
    line-height: 1.25;
  }

  .meta{
    width: 100%;
    gap: 6px;
  }

  .pill{
    padding: 5px 8px;
    font-size: 12px;
  }

  .grid2{
    gap: 10px;
  }

  .btn{
    min-height: 44px;
    padding: 12px 12px;
    border-radius: 10px;
  }

  .notationCard{
    padding: 8px;
    border-radius: 12px;
  }

  #scoreArea,
  #notation,
  #notation svg{
    border-radius: 10px;
  }

  #notation svg{
    max-width: 100%;
  }

  .answerRow{
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .examChoiceGrid{
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .examQuestionText{
    font-size: 16px;
  }

  .rhythmGuide{ gap: 4px; }
  .rhythmShortcuts{ display: none; }
  .mobileHint{ display: block; }

  .rhythmTapBtn{
    min-height: 56px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .rhythmTapBtn.isTapping{
    transform: translateY(1px) scale(.98);
    filter: brightness(1.12);
  }

  .theoryPanel{
    padding: 12px;
    border-radius: 12px;
  }

  .theoryQuestion{
    min-height: auto;
    font-size: 16px;
  }

  .theoryNotation{
    height: 104px;
    margin-bottom: 12px;
  }

  .theoryReviewKey{
    height: 104px;
  }

  .choiceGrid{
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .choiceBtn{
    min-height: 52px;
  }

  .staffChoiceBtn{
    min-height: 112px;
  }

  .wrongReviewGrid{
    grid-template-columns: 1fr;
  }

  .wrongReviewImage{
    height: 118px;
  }

  .wrongReviewImage:where(.wide){
    height: 210px;
  }

  .wrongReviewImage.intervalReviewImage{
    height: var(--panel-h, 180px);
  }

  .wrongReviewImage.staffPanelReviewImage{
    height: var(--panel-h, 180px);
  }

  #answerInput,
  .homeworkField input{
    font-size: 16px;
    border-radius: 10px;
  }

  .answerRow .btn,
  .homeworkActions .btn{
    width: 100%;
  }

  .controls{
    justify-content: stretch !important;
  }

  .controls > div{
    width: 100%;
    justify-content: stretch !important;
  }

  .controls .btn{
    flex: 1 1 calc(50% - 5px);
  }

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

  .rhythmControls > .btn:not(.rhythmTapBtn){
    inline-size: 100%;
  }

  .rhythmControls > .rhythmTapBtn{
    grid-column: 1 / -1;
  }

  .controls.quizResultActions .btn{
    flex: 1 1 0;
    min-inline-size: 0;
    padding-inline: 8px;
    word-break: keep-all;
  }

  .qnav{
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .qbtn{
    min-height: 42px;
    padding: 8px 0;
    border-radius: 10px;
  }

  .homeworkPanel{
    padding: 12px;
  }

  .big{
    font-size: 32px;
  }

  .mobileOnly{ display:inline-flex !important; }
}
