:root {
  --bg: #f3f7ff;
  --bg-soft: #eef3fb;
  --card: #ffffff;
  --line: #d9e3f1;
  --ink: #1d2b45;
  --muted: #5a6a86;
  --point: #2f80ed;
  --point-soft: #dcecff;
  --danger: #cc4b4b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, #ffffff 0%, transparent 42%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.learning-app {
  width: min(1250px, 94vw);
  margin: 24px auto 28px;
  display: grid;
  gap: 8px;
}

.card-ui {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 14px 32px rgba(29, 43, 69, 0.08);
  padding: 18px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 80%) minmax(240px, 20%);
  gap: 8px;
  align-items: start;
}

.main-column {
  display: grid;
  gap: 8px;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.8vw, 2rem);
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-wrap {
  position: relative;
}

.help-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f3f8ff;
  color: #2a5e9f;
  font-size: 0.84rem;
  padding: 3px 9px;
  font-weight: 400;
}

.help-overlay {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 78vw);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(29, 43, 69, 0.18);
  padding: 12px;
  z-index: 40;
}

.subtitle {
  margin: 4px 0 12px;
  color: var(--muted);
}

.guide-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

.guide-ko {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.compose-card {
  text-align: center;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.formula-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 230px 1fr;
  align-items: center;
  justify-items: center;
}

.formula {
  grid-column: 2;
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 400;
  color: var(--muted);
}

.arrow-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(82px, 1fr) minmax(0, 70%) minmax(82px, 1fr);
  align-items: center;
  justify-items: center;
}

.arrow {
  grid-column: 2;
  font-size: 1.6rem;
  color: var(--point);
}

.word-meaning-box {
  width: 70%;
  min-height: 36px;
  border: 0;
  border-radius: 2;
  background: #d7c9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 3px 10px;
  margin: 0 auto;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  word-break: keep-all;
}

.result-row {
  width: 100%;
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(82px, 1fr) auto minmax(82px, 1fr);
  align-items: center;
}

.result-row.sentence-unit {
  min-height: 112px;
  grid-template-columns: 0 minmax(0, 1fr) auto;
  column-gap: 8px;
}

.result-row.word-unit {
  grid-template-columns: minmax(62px, 1fr) minmax(0, 70%) minmax(62px, 1fr);
}

.result-text {
  grid-column: 2;
  border: 0;
  background: rgba(207, 228, 255, 0.48);
  font-size: 80px;
  line-height: 1;
  min-height: 112px;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  max-width: 100%;
  overflow-wrap: anywhere;
  display: grid;
  grid-auto-flow: row;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.result-text.character-unit {
  width: 130px;
}

.result-text.word-unit {
  width: 100%;
  min-height: 112px;
  height: 112px;
  padding: 10px;
}

.result-text.sentence-unit {
  width: 100%;
  min-height: 112px;
  height: 112px;
  padding: 10px;
}

.result-text.sentence-mode {
  font-size: var(--sentence-font-size, 90px);
  min-height: 112px;
  height: 112px;
  line-height: 1;
}

.sentence-check-row {
  width: 100%;
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: stretch;
}

.check-sentence-btn {
    grid-column: 2;
    width: 100%;
    min-height: 35px;
    border: 0;
    border-radius: 3px;
    background: #d7c9ff;
    color: #333;
    font-size: 1.04rem;
    line-height: 1.2;
    padding: 5px 12px;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.check-sentence-btn:not(:disabled):hover {
  background: #cfcfcf;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.check-sentence-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: none;
}

.check-sentence-btn:disabled {
  cursor: not-allowed;
}

.check-sentence-btn.is-loading {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.check-loading-dots {
  width: 54px;
  height: 18px;
  border-radius: 999px;
  background: #eeeeee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.check-loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9a9a9a;
  animation: check-dot-pulse 0.9s ease-in-out infinite;
}

.check-loading-dots span:nth-child(2) {
  animation-delay: 0.12s;
}

.check-loading-dots span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes check-dot-pulse {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.check-sentence-btn.is-correct {
  background: rgba(124, 184, 255, 0.68);
  color: #0d4f9b;
  font-size: 1.32rem;
  font-weight: 700;
}

.check-sentence-btn.is-fixed {
  background: #ffe0e0;
  color: #b32727;
  text-align: center;
}

.check-sentence-btn.is-speaking {
  outline: 3px solid #0d6efd;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.14);
  animation: checkSpeakingPulse 0.7s ease-in-out infinite alternate;
}

@keyframes checkSpeakingPulse {
  from {
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
  }
  to {
    box-shadow: 0 0 0 7px rgba(13, 110, 253, 0.24);
  }
}

.check-fixed-title {
  display: inline-block;
  margin-right: 8px;
  font-weight: 700;
}

.check-fixed-text {
  font-weight: 500;
}

.check-source-word {
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.check-sentence-listen {
  grid-column: 3;
  justify-self: end;
  width: 58px;
  min-height: 35px;
  border: 1px solid #b9d7ff;
  border-radius: 6px;
  background: #f2f8ff;
  color: #1f5c9f;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.check-sentence-listen:not(:disabled):hover {
  background: #e1f0ff;
  transform: translateY(-1px);
}

.check-sentence-listen:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.inline-delete-btn {
  grid-column: 3;
  justify-self: end;
  width: 58px;
  height: 78px;
  border: 1px solid #f0b7b7;
  border-radius: 8px;
  background: #fff4f4;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
}

.inline-delete-btn:hover {
  background: #ffe8e8;
  border-color: #e09191;
}

.auto-play-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f8ff;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 400;
  padding: 8px 10px;
}

.compose-card:not(:has(.result-row.character-unit)) .auto-play-check {
  display: none;
}

.auto-play-check input {
  width: 16px;
  height: 16px;
}
romanized-chip
.result-char,
.romanized-cell {
    width: 100%;
    display: inline-grid;
    place-items: center;
}

.result-sentence-char {
  display: inline-grid;
  place-items: center;
}

.result-space,
.romanized-space-cell {
  width: 100%;
}

.result-sentence-char.result-space {
  width: 24px;
}

.result-char.current-input,
.result-sentence-char.current-input {
  color: #1f78ff;
  font-weight: 700;
}

.result-char.input-pulse,
.result-sentence-char.input-pulse {
  animation: inputPulse 0.26s ease-out;
}

@keyframes inputPulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.result-char.speaking,
.result-sentence-char.speaking {
  color: #e32626;
  font-weight: 700;
  animation: speakingBounce 0.42s ease-in-out infinite alternate;
}

@keyframes speakingBounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-6px);
  }
}

.result-text.animated {
  transform: scale(1.06);
  opacity: 0.85;
}

.romanized-text {
  border: 0;
  background: transparent;
  color: #215ea8;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  border-radius: 0;
  padding: 0 10px;
  box-sizing: border-box;
  cursor: pointer;
  display: grid;
  grid-auto-flow: row;
  justify-content: center;
  gap: 0;
  max-width: 100%;
  height: 48px;
  min-height: 48px;
  align-items: center;
}

.romanized-text.character-unit {
  width: 130px;
}

.romanized-text.word-unit {
  width: min(70%, 100%);
  justify-self: center;
}

.romanized-text.sentence-unit {
  width: calc(100% - 86px);
  justify-self: start;
}

.romanized-chip {
  border: 0;
  min-width: 46px;
  min-height: 25px;
  padding: 0px 10px 2px 10px;
  border-radius: 999px;
  background: var(--point-soft);
  color: #215ea8;
  font: inherit;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.romanized-chip:hover,
.romanized-chip:focus-visible {
  background:#cfe4ff;
  transform: translateY(-1px);
}

.romanized-space {
  min-width: 0;
  background: transparent;
  cursor: default;
}

.listen-btn {
  border: 1px solid #90b8ef;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 400;
  background: #edf4ff;
  color: #2a5e9f;
}

#recordBtn {
  width: 104px;
}

.listen-row {
  width: 100%;
  position: relative;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding-top:5px;
}

.listen-row .auto-play-check {
  position: absolute;
  top: 10px;
  right: 18px;
  margin: 0;
}

.mobile-clear-btn,
.mobile-unit-select {
  display: none;
}

.listen-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.eq-canvas {
  width: 120px;
  height: 36px;
  border-radius: 0;  
  border-radius:40px;
}

#recordStatus {
  margin: 0;
  font-size: 0.9rem;
  white-space: nowrap;
}

.status-link {
  color: #1f5c9f;
  text-decoration: underline;
}

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

.panel-wide {
  grid-column: 1 / -1;
}

.panel-grid h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.consonant-section-action,
.vowel-section-action {
  position: relative;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.section-action-icons {
  position: absolute;
  top:7px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.section-action-icons-left {
  right: 12px;
}

.section-action-icons-right {
  right: 14px;
}

.section-action-circle {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
  pointer-events: auto;
}

.section-play-circle {
  border: 0;
  background: rgba(237, 244, 255, 0.95);
}

.section-history-pill {
  width: 70px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 241, 241, 0.92);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  pointer-events: auto;
  transition: box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.section-history-half {
  display: grid;
  place-items: center;
  min-width: 0;
}

.section-history-next {
  border-left: 1px solid rgba(204, 75, 75, 0.26);
}

.section-action-text {
  min-width: 58px;
  height: 35px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 241, 241, 0.92);
  color: #cc4b4b;
  font-size: 0.9rem;
  font-weight: 500;
  transition: box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
  pointer-events: auto;
  text-align:center;
}

.consonant-section-action:hover:not(:has(.jamo-btn:hover)) .section-action-circle,

.consonant-section-action:hover:not(:has(.jamo-btn:hover)) .section-action-text {
  box-shadow: 0 0 0 4px rgba(225, 111, 111, 0.2), 0 0 16px rgba(225, 111, 111, 0.35);
}
z
.vowel-section-action:hover:not(:has(.jamo-btn:hover)) .section-action-circle {
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.2), 0 0 16px rgba(47, 128, 237, 0.35);
}

.history-prev-icon,
.history-next-icon,
.play-triangle-icon {
  width: 0;
  height: 0;
  display: inline-block;
}

.history-prev-icon {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid #cc4b4b;
}

.history-next-icon,
.play-triangle-icon {
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 9px solid currentColor;
}

.history-next-icon {
  color: #cc4b4b;
}

.play-triangle-icon {
  color: #2f80ed;
  margin-left: 2px;
}

.vowel-section-action.section-playing .section-play-circle {
  animation: sectionPlayPulse 0.38s ease-in-out infinite alternate;
}

@keyframes sectionPlayPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.12);
  }
}

.consonant-section-action:hover:not(:has(.jamo-btn:hover)) {
  border-color: #e16f6f;
  box-shadow: 0 0 0 3px rgba(225, 111, 111, 0.22), 0 14px 32px rgba(29, 43, 69, 0.08);
  cursor: pointer;
}

.vowel-section-action:hover:not(:has(.jamo-btn:hover)) {
  border-color: #76aef5;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.2), 0 14px 32px rgba(29, 43, 69, 0.08);
  cursor: pointer;
}

.right-column h2 {
  font-size: 0.88rem;
  white-space: nowrap;
  margin: 0 0 8px;
}

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

.example-card-head h2 {
  color: #000000;
  font-weight: 400;
  margin: 0;
}

.language-field select {
  width: 100%;
  max-width: 132px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  font-weight: 400;
  font-size: 0.82rem;
}

.jamo-grid {
  display: grid;
  gap: 4px;
}

.consonant-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.vowel-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.jamo-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.jamo-btn:hover {
  transform: translateY(-1px);
  border-color: #b7cff3;
}

.jamo-btn:disabled {
  background: #edf0f5;
  border-color: #d6dce6;
  color: #8a96a8;
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.jamo-btn:disabled .jamo-roman,
.jamo-btn:disabled .jamo-char {
  color: #8a96a8;
}

.jamo-btn.active {
  background: var(--point-soft);
  border-color: #91b9ef;
  box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.16);
}

.jamo-btn.ctrl-boost {
  border-color: #e66d6d;
  background: #fff0f0;
}

.jamo-btn.ctrl-boost .jamo-char {
  color: #c83c3c;
  font-size: 1.62rem;
}

.jamo-char {
  font-size: 1.45rem;
  font-weight: 400;
}

.jamo-roman {
  font-size: 0.82rem;
  color: var(--muted);
}

.example-words {
  color: #000000;
  min-height: 110px;
  display: grid;
  align-content: start;
  gap: 7px;
  font-weight: 400;
  overflow: auto;
}

.example-title {
  color: var(--ink);
  font-weight: 400;
  padding: 4px 2px 2px;
}

.example-line {
  position: relative;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 7px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #000000;
  font: inherit;
  font-weight: 400;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.example-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(47, 128, 237, 0.16) 48%, transparent 78%);
  transform: translateX(-120%);
  pointer-events: none;
}

.example-line:hover,
.example-line:focus-visible {
  background: #f4f8ff;
  border-color: #c9dcf8;
  transform: translateY(-1px);
}

.example-line:hover::after,
.example-line:focus-visible::after {
  animation: exampleSweep 0.85s ease;
}

.example-line:active {
  transform: translateY(0);
}

.example-line span:last-child {
  text-align: right;
  color: #34445f;
}

@keyframes exampleSweep {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

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

.right-column .tts-panel {
  grid-template-columns: 1fr;
}

.right-column .tts-panel > .tts-field:not(.unit-field) {
  display: none;
}

.tts-field {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 400;
}

.tts-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.tts-field select,
.tts-field input[type="range"] {
  width: 100%;
}

.unit-field {
  font-size: 1.02rem;
}

.unit-field select {
  font-size: 1.02rem;
  font-weight: 400;
  min-height: 42px;
}

.controls {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.control-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f8ff;
  color: var(--ink);
  font-weight: 400;
  padding: 8px 12px;
}

.control-btn.active {
  border-color: #8db6ed;
  background: var(--point-soft);
  color: #1f5c9f;
}

.control-btn.danger {
  border-color: #f1caca;
  background: #fff1f1;
  color: var(--danger);
}

.keyboard-input-wrap {
  width: min(96%, 840px);
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.keyboard-text-input {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 1.5rem;
}

.hidden {
  display: none !important;
}

.mobile-korean-keyboard {
  display: none;
}

@media (max-width: 860px) {
  html,
  body {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .learning-app {
    width: 100%;
    height: 100dvh;
    margin: 0;
    padding: 8px 8px 12px;
    gap: 4px;
    align-content: start;
    overflow: hidden;
  }

  .hero-card {
    min-height: 38px;
    padding: 2px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero-top {
    min-height: 34px;
    justify-content: space-between;
  }

  .hero-card h1 {
    font-size: clamp(1.05rem, 5vw, 1.25rem);
    line-height: 1.1;
    white-space: nowrap;
  }

  .desktop-title-suffix {
    display: none;
  }

  .help-btn {
    min-height: 30px;
    padding: 2px 9px;
    font-size: 0.78rem;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    height: calc(100dvh - 62px);
    min-height: 0;
  }

  .main-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 4px;
    align-content: start;
  }

  .panel-grid,
  .right-column {
    display: none;
  }

  .consonant-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .vowel-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .result-row,
  .result-row.sentence-unit,
  .result-row.word-unit {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .sentence-check-row {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 6px;
  }

  .formula-row,
  .arrow-row,
  .eq-canvas,
  #recordStatus,
  .auto-play-check {
    display: none !important;
  }

  .formula,
  .arrow,
  .word-meaning-box {
    grid-column: 1;
  }

  .word-meaning-box {
    width: 100%;
  }

  .result-text,
  .inline-delete-btn {
    grid-column: 1;
  }

  .result-text.word-unit,
  .result-text.sentence-unit,
  .result-text.sentence-mode {
    width: 100%;
    min-height: 112px;
    height: 112px;
  }

  .check-sentence-btn {
    grid-column: 1;
  }

  .check-sentence-listen {
    grid-column: 2;
  }

  .inline-delete-btn {
    justify-self: center;
    width: 74px;
    height: 44px;
  }

  .result-row.word-unit .inline-delete-btn,
  .result-row.sentence-unit .inline-delete-btn {
    display: none;
  }

  .auto-play-check {
    grid-column: 1;
    justify-self: center;
  }

  .tts-panel {
    grid-template-columns: 1fr;
  }

  .keyboard-input-wrap {
    flex-direction: column;
  }

  .compose-card {
    flex: 0 1 auto;
    width: 100%;
    min-height: 0;
    padding: 4px 8px 6px;
    gap: 0;
    border-radius: 12px;
    background-size: auto 78%;
  }

  .result-row,
  .result-row.sentence-unit,
  .result-row.word-unit {
    min-height: clamp(96px, 24dvh, 150px);
  }

  .result-text,
  .result-text.word-unit,
  .result-text.sentence-unit,
  .result-text.sentence-mode {
    min-height: clamp(96px, 24dvh, 150px);
    height: clamp(96px, 24dvh, 150px);
    overflow: hidden;
    font-size: var(--mobile-result-font-size, 80px);
    white-space: nowrap;
  }

  .romanized-text {
    width: 100%;
    min-height: 36px;
    height: 36px;
    font-size: 1.18rem;
    overflow: hidden;
  }

  .romanized-cell {
    min-width: 0;
    margin-top: 6px;
  }

  .romanized-chip {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-inline: 1px;
    overflow: hidden;
    font-size: var(--mobile-roman-font-size, 1rem);
    white-space: nowrap;
  }

  .listen-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 3px;
    padding-top: 2px;
  }

  .listen-btn {
    min-height: 38px;
    padding: 6px 11px;
  }

  #listenBtn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  #recordBtn {
    width: 100px;
  }

  #recordBtn,
  #playRecordingBtn {
    display: none !important;
  }

  .mobile-clear-btn,
  .mobile-unit-select {
    display: block;
    min-height: 38px;
  }

  .mobile-clear-btn {
    padding: 6px 11px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .mobile-unit-select {
    width: min(32vw, 117px);
    margin-left: auto;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 6px 24px 6px 8px;
    background: #101827;
    color: #eef3f9;
    font: inherit;
  }

  .mobile-unit-select:focus {
    border-color: var(--point);
    outline: 2px solid rgba(34, 211, 238, 0.16);
  }

  .mobile-korean-keyboard {
    display: block;
    width: 100%;
    margin-top: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-keyboard-rows {
    display: grid;
    gap: 4px;
  }

  .mobile-keyboard-row {
    display: flex;
    justify-content: center;
    gap: 3px;
  }

  .mobile-keyboard-key {
    flex: 1 1 0;
    min-width: 0;
    height: clamp(38px, 6.5dvh, 48px);
    padding: 2px 1px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #202838;
    color: var(--ink);
    font: inherit;
    font-size: clamp(0.95rem, 4.2vw, 1.2rem);
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .mobile-key-char {
    line-height: 1;
  }

  .mobile-key-roman {
    color: var(--muted);
    font-size: clamp(0.48rem, 2.2vw, 0.62rem);
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-keyboard-key:active,
  .mobile-keyboard-key.active {
    border-color: var(--point);
    background: var(--point-soft);
    color: #ffffff;
  }

  .mobile-shift-key {
    flex: 1 1 0;
  }

  .mobile-shift-key img,
  .mobile-backspace-key img,
  .mobile-enter-key img {
    width: 19px;
    height: 19px;
    filter: invert(96%) sepia(6%) saturate(318%) hue-rotate(175deg) brightness(102%) contrast(96%);
    pointer-events: none;
  }

  .mobile-space-key {
    flex: 3.4 1 0;
    color: var(--muted);
    font-size: 0.7rem;
  }

  .mobile-enter-key {
    flex: 1.2 1 0;
  }

  .mobile-symbol-key {
    font-size: 1.15rem;
  }
}
.right-column {
  display: grid;
  gap: 7px;
  align-content: start;
}

.example-side-card {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
}

/* Immersive Pronunciation Lab visual theme.
   Layout, control order, sizing, and interaction structure remain unchanged. */
:root {
  --bg: #080d18;
  --bg-soft: #0b1220;
  --card: #111827;
  --card-raised: #1b2331;
  --line: rgba(151, 167, 191, 0.2);
  --line-strong: rgba(151, 167, 191, 0.34);
  --ink: #f4f7fb;
  --muted: #9ca9bc;
  --point: #22d3ee;
  --point-soft: rgba(34, 211, 238, 0.14);
  --danger: #ff7f87;
  --warning: #f6bd55;
}

html,
body {
  color: var(--ink);
  background: var(--bg);
  color-scheme: dark;
}

.card-ui {
  border-color: var(--line);
  background: var(--card);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.hero-card {
  background: #0d1423;
  border-color: rgba(34, 211, 238, 0.22);
}

.hero-card h1 {
  color: var(--ink);
  letter-spacing: -0.025em;
  font-weight: 750;
}

.help-btn,
.listen-btn,
.control-btn,
.auto-play-check {
  border-color: var(--line-strong);
  background: #202838;
  color: #e8eef7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.help-btn:hover,
.listen-btn:not(:disabled):hover,
.control-btn:not(:disabled):hover {
  border-color: rgba(34, 211, 238, 0.62);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.14);
}

.help-overlay {
  border-color: var(--line-strong);
  background: #1a2230;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

.compose-card {
  background: #111827;
  border-color: rgba(34, 211, 238, 0.16);
}

.formula {
  color: #b8c4d4;
  letter-spacing: 0.08em;
}

.arrow {
  color: var(--point);
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.48);
}

.result-text {
  border: 1px solid rgba(34, 211, 238, 0.24);
  background: #1b2635;
  color: #ffffff;
  text-shadow: 0 0 28px rgba(34, 211, 238, 0.2);
  box-shadow:
    inset 0 0 36px rgba(34, 211, 238, 0.055),
    0 0 28px rgba(34, 211, 238, 0.055);
}

.result-text:hover,
.result-text:focus-visible {
  border-color: rgba(34, 211, 238, 0.56);
  outline: none;
  box-shadow:
    inset 0 0 42px rgba(34, 211, 238, 0.09),
    0 0 24px rgba(34, 211, 238, 0.12);
}

.word-meaning-box,
.check-sentence-btn {
  background: rgba(34, 211, 238, 0.14);
  color: #dffbff;
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.check-sentence-btn:not(:disabled):hover {
  background: rgba(34, 211, 238, 0.2);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.12);
}

.check-sentence-btn.is-correct {
  background: rgba(34, 211, 238, 0.22);
  color: #c9f9ff;
}

.check-sentence-btn.is-fixed,
.control-btn.danger {
  border-color: rgba(255, 127, 135, 0.34);
  background: rgba(255, 127, 135, 0.1);
  color: #ff9ea4;
}

.check-sentence-listen {
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.1);
  color: #baf7ff;
}

.check-sentence-listen:not(:disabled):hover {
  background: rgba(34, 211, 238, 0.18);
}

.inline-delete-btn {
  border-color: rgba(151, 167, 191, 0.25);
  background: #202838;
  color: #d8e0eb;
}

.inline-delete-btn:hover {
  border-color: rgba(34, 211, 238, 0.46);
  background: #263142;
  color: #ffffff;
}

.romanized-text {
  color: #9deff8;
}

.romanized-chip {
  background: rgba(34, 211, 238, 0.12);
  color: #baf7ff;
}

.romanized-chip:hover,
.romanized-chip:focus-visible {
  background: rgba(34, 211, 238, 0.2);
}

.listen-btn:first-child {
  border-color: var(--point);
  background: var(--point);
  color: #07121a;
  font-weight: 700;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.24);
}

.listen-btn:first-child:hover {
  color: #07121a;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.38);
}

.listen-btn:disabled,
.control-btn:disabled,
.check-sentence-listen:disabled {
  opacity: 0.38;
}

.status-link {
  color: #8cecf7;
}

.panel-grid .card-ui,
.right-column .card-ui {
  background: var(--card-raised);
}

.panel-grid h2,
.right-column h2 {
  color: #f0f4fa;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.consonant-section-action:hover:not(:has(.jamo-btn:hover)),
.vowel-section-action:hover:not(:has(.jamo-btn:hover)) {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.1), 0 16px 36px rgba(0, 0, 0, 0.32);
}

.section-play-circle,
.section-history-pill,
.section-action-text {
  background: #263142;
}

.section-action-text,
.history-next-icon {
  color: #ff9ea4;
}

.history-prev-icon {
  border-right-color: #ff9ea4;
}

.section-history-next {
  border-left-color: rgba(255, 127, 135, 0.28);
}

.play-triangle-icon {
  color: var(--point);
}

.example-card-head h2,
.example-words,
.example-line {
  color: #edf2f8;
}

.example-title {
  color: #f4f7fb;
}

.example-line {
  border-bottom-color: rgba(151, 167, 191, 0.16);
  border-radius: 0;
}

.example-line::after {
  background: rgba(34, 211, 238, 0.06);
}

.example-line:hover,
.example-line:focus-visible {
  border-color: rgba(34, 211, 238, 0.24);
  background: rgba(34, 211, 238, 0.07);
}

.example-line span:last-child {
  color: #9ca9bc;
}

.language-field select,
.tts-field select,
.keyboard-text-input {
  border-color: var(--line-strong);
  background: #101827;
  color: #eef3f9;
}

.language-field select:focus,
.tts-field select:focus,
.keyboard-text-input:focus {
  border-color: var(--point);
  outline: 2px solid rgba(34, 211, 238, 0.16);
}

input[type="range"] {
  accent-color: var(--point);
}

input[type="checkbox"] {
  accent-color: var(--point);
}

.jamo-btn {
  border-color: rgba(151, 167, 191, 0.2);
  background: #202938;
  color: #edf3f9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.jamo-btn:hover {
  border-color: rgba(34, 211, 238, 0.55);
  background: #243243;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.1);
}

.jamo-btn.active {
  border-color: var(--point);
  background: rgba(34, 211, 238, 0.15);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.12), 0 0 20px rgba(34, 211, 238, 0.13);
}

.jamo-btn:disabled {
  border-color: rgba(151, 167, 191, 0.12);
  background: #151c27;
  color: #677386;
}

.jamo-btn:disabled .jamo-roman,
.jamo-btn:disabled .jamo-char {
  color: #677386;
}

.jamo-btn.ctrl-boost {
  border-color: rgba(246, 189, 85, 0.68);
  background: rgba(246, 189, 85, 0.12);
}

.jamo-btn.ctrl-boost .jamo-char {
  color: #ffd88a;
}

.jamo-roman,
.subtitle,
.guide-ko,
.tts-field,
#recordStatus {
  color: var(--muted);
}

.control-btn.active {
  border-color: rgba(34, 211, 238, 0.56);
  background: rgba(34, 211, 238, 0.14);
  color: #c5f9ff;
}

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: #ffffff;
}

/* Sound-focus artwork: a full-card backdrop without changing the existing layout. */
.compose-card {
  background-color: #111827;
  background-image: url("../images/sound-focus-rings.png");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% auto;
}

.result-text {
  border: 0;
  background: transparent;
  text-align: center;
  justify-items: center;
}

.arrow {
  visibility: hidden;
}

.result-text:hover,
.result-text:focus-visible {
  border: 0;
}

.result-text .result-char.current-input,
.result-text .result-sentence-char.current-input {
  color: #ffffff;
  text-shadow: 0 0 26px rgba(34, 211, 238, 0.28);
}

.word-meaning-box {
  border: 0;
  background: rgba(18, 55, 71, 0.74);
}

@media (max-width: 860px) {
  .compose-card {
    background-size: auto 72%;
    background-position: center top;
  }

  .result-row.character-unit .inline-delete-btn {
    display: none;
  }

  .result-text,
  .result-text.word-unit,
  .result-text.sentence-unit,
  .result-text.sentence-mode {
    padding: 18px 10px 2px;
  }

  .result-text.character-unit {
    width: 100%;
    justify-self: stretch;
  }

  #romanizedText {
    margin-bottom: 8px;
  }

  .word-meaning-box {
    width: 100%;
    min-height: 35px;
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 3px;
    background: rgba(34, 211, 238, 0.14);
    color: #dffbff;
    padding: 5px 12px;
    font-size: 1.04rem;
    font-weight: 400;
    line-height: 1.2;
  }

  .right-column {
    display: none;
  }
}

@media (min-width: 861px) {
  .result-text.sentence-unit,
  .check-sentence-btn {
    width: calc(100% - 80px);
    justify-self: center;
  }
}
