/* INTRASE learning website: the Hangul (Korean) alphabet trainer (hangul.js). Korean only: every rule is scoped to .hg-page or .hg-entry, nothing here
   touches the Japanese kana styles of app.css. It uses the generic classes of the page (.card, .btn, .eyebrow, .muted, .notice, .form-error, .field-hint,
   .text-btn, .sr-only, .feature-links, .grid.two, .space-top) and the same colours as the Japanese trainer: navy type, teal interaction, warm paper. */
.page:has(.hg-page) { background: #f8f7f3; }
.hg-page, .hg-entry { --ink: #17354b; --muted: #54656d; --green: #137c73; --soft: #edf6f2; --line: #dce5e1; color: var(--ink); }
/* Text marked lang="ko" uses a Korean system font (no web font is requested). */
:is(.hg-page, .hg-entry) :is([lang="ko"], [lang="ko"] *) { font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', sans-serif; }
/* A Korean word is not split between syllables at the end of a line (a word longer than the line still breaks). */
:is(.hg-page, .hg-entry) :is([lang="ko"], [lang="ko"] *) { word-break: keep-all; overflow-wrap: break-word; }
.hg-page button:disabled { cursor: not-allowed; opacity: .48; }
.hg-page .btn { border-radius: 12px; min-height: 46px; }
.hg-page .btn:not(.secondary):hover { background: #0d665f; }
.hg-page .text-btn { min-height: 44px; }
.hg-page .card { border-radius: 22px; box-shadow: 0 4px 18px #17354b03; }
.hg-page .form-error:empty, .hg-page .field-error:empty { display: none; }
.hg-page .field-error { margin: 8px 0 0; color: #a2352c; font-size: 13px; font-weight: 650; text-align: center; }
.hg-page .eyebrow { letter-spacing: 1.7px; font-size: 10px; }
.hg-page h1, .hg-page h2, .hg-page h3 { color: var(--ink); }
.hg-page h2 { font-size: 23px; line-height: 1.3; }
.hg-page h3 { font-size: 16px; }
/* A two-tone navy ring (12:1 on light surfaces) instead of the amber one of the page; choice cards show it around the whole card. */
.hg-page :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #17354b; outline-offset: 2px; box-shadow: 0 0 0 6px #fff; }
.hg-option:has(input:focus-visible), .hg-stage:has(input:focus-visible), .hg-focus-option:has(input:focus-visible), .hg-segmented label:has(input:focus-visible) { outline: 3px solid #17354b; outline-offset: 2px; }
.hg-option input:focus-visible, .hg-stage input:focus-visible, .hg-focus-option input:focus-visible, .hg-segmented input:focus-visible { outline: 0; box-shadow: none; }
html:has(.hg-quiz-bottom) { scroll-padding-bottom: 104px; }
.hg-breadcrumb { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 20px; font-size: 13px; }
.hg-breadcrumb a { font-weight: 700; color: var(--ink); }
.hg-breadcrumb > span { color: var(--muted); }
.hg-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px 30px; background: #17354b; border-radius: 24px; overflow: hidden; }
.hg-hero h1 { color: #fff; font-size: clamp(28px, 3vw, 36px); margin-bottom: 9px; letter-spacing: -.8px; }
.hg-hero .eyebrow { color: #c5d7c9; }
.hg-hero p { color: #c7d5dc; margin: 0; font-size: 14px; }
.hg-stats { display: flex; flex-shrink: 0; margin: 0; padding: 0; }
.hg-stats > div { display: flex; flex-direction: column-reverse; gap: 3px; padding: 0 22px; border-left: 1px solid #ffffff26; }
.hg-stats > div:last-child { padding-right: 0; }
.hg-stats dt { color: #c7d5dc; font-size: 11px; white-space: nowrap; }
.hg-stats dd { color: #fff; font-size: 28px; line-height: 1.25; margin: 0; font-weight: 750; letter-spacing: -.5px; }
.hg-stats dd small { color: #aebfc8; font-size: 15px; font-weight: 400; }
.hg-observer { margin-top: 16px; }
.hg-tabs { display: flex; gap: 8px; padding: 5px; margin: 22px 0; background: #eaece7; border-radius: 15px; }
.hg-tabs > button { flex: 1; border: 0; border-radius: 11px; min-height: 46px; padding: 10px 16px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; }
.hg-tabs > button[aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 2px 5px #17354b0c; }
.hg-tabs > button:hover { color: var(--ink); background: #ffffff80; }
.hg-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.hg-section-heading h2, .hg-section-heading h3 { margin-bottom: 5px; }
.hg-section-heading p { font-size: 13px; margin: 0; }
.hg-section-heading > .text-btn, .hg-section-heading > .btn { flex-shrink: 0; font-size: 12px; }
.hg-chart-card { margin-top: 18px; }
/* Eleven categories: one row that scrolls sideways, with a soft edge on the side that has more. */
.hg-categories { display: flex; max-width: 100%; gap: 5px; padding: 4px; border-radius: 12px; background: #f3f4f0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.hg-categories .btn { flex: 0 0 auto; border: none; min-height: 44px; font-size: 12px; padding: 7px 14px; border-radius: 9px; background: transparent; color: var(--muted); white-space: nowrap; }
.hg-categories .btn[aria-pressed="true"] { background: #fff; color: #137c73; box-shadow: 0 1px 4px #17354b0c; }
.hg-categories.scroll {
  background:
    linear-gradient(to right, #f3f4f0 24px, #f3f4f000) left center / 32px 100% no-repeat local,
    linear-gradient(to left, #f3f4f0 24px, #f3f4f000) right center / 32px 100% no-repeat local,
    linear-gradient(to right, #17354b24, #17354b00) left center / 10px 100% no-repeat scroll,
    linear-gradient(to left, #17354b24, #17354b00) right center / 10px 100% no-repeat scroll,
    #f3f4f0;
}
.hg-groups { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; padding: 16px 8px 20px; margin-inline: -8px; scroll-padding-inline: 8px; scrollbar-width: thin; }
.hg-groups .btn { flex-shrink: 0; min-height: 44px; padding: 7px 14px; font-size: 12px; border-radius: 10px; }
.hg-groups .btn[aria-pressed="true"] { background: #17354b; border-color: #17354b; color: #fff; }
.hg-groups .btn.secondary { background: #fff; color: #54656d; border-color: #e1e7e2; }
.hg-tip { padding: 12px 15px; color: #5e7268; font-size: 13px; background: #f4f6ed; border-radius: 12px; }
.hg-tip [lang] { white-space: nowrap; }
.hg-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.hg-chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.hg-chart-heading h3 { margin: 0; }
.hg-chart-heading h3 .hg-chart-count { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 6px; white-space: nowrap; }
.hg-chart-heading .text-btn { font-size: 11px; flex-shrink: 0; white-space: nowrap; }
.hg-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px; padding: 0; list-style: none; color: var(--muted); font-size: 11px; }
.hg-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #c9d3d0; }
.hg-legend .hg-lv-learning i { background: #d7a24a; }
.hg-legend .hg-lv-stable i { background: #5aa38f; }
.hg-legend .hg-lv-mastered i { background: #137c73; }
.hg-row-label { margin: 18px 0 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.hg-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hg-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 116px; padding: 12px 4px; border: 1px solid #e0e6e1; background: #fdfdfb; border-radius: 14px; color: var(--ink); }
.hg-tile strong { font-size: clamp(28px, 3vw, 39px); font-weight: 500; line-height: 1.4; white-space: nowrap; }
.hg-tile span { font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.hg-tile small { font-size: max(10px, .65rem); color: #5b6b66; margin-top: 5px; }
.hg-tile.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.hg-tile.mastered small { color: #137c73; }
.hg-tile:hover { border-color: #137c73; background: #f1f7f3; }
/* A tile that holds a word (the names of the pronunciation rules) may wrap, and the rule tiles are wider. */
.hg-tile strong[data-len]:not([data-len="1"]) { font-size: 24px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; text-align: center; }
.hg-chart-card:has([data-hg-category="rule"][aria-pressed="true"]) .hg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hg-chart-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 0 0; margin-top: 20px; border-top: 1px solid var(--line); }
.hg-chart-action strong { font-size: 13px; }
.hg-chart-action p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.hg-chart-action .btn { font-size: 12px; }
.hg-detail { padding: 24px; background: #f5f5ee; border: 1px solid #e7e7dd; border-radius: 18px; text-align: center; scroll-margin-top: 20px; }
.hg-detail h2 { font-size: 25px; }
.hg-detail h2 span { font-size: 19px; color: var(--muted); font-weight: 400; }
.hg-detail h2 span[lang] { font-size: inherit; color: inherit; font-weight: 500; }
.hg-detail p { font-size: 13px; color: #54656d; }
.hg-detail .hg-detail-line { margin: 0 0 8px; }
.hg-detail .hg-detail-note { margin-top: 17px; margin-bottom: 6px; }
.hg-detail .field-hint { font-size: 11px; }
.hg-detail > .btn, .hg-group-actions .btn { font-size: 12px; width: 100%; }
.hg-memo, .hg-examples, .hg-confused, .hg-results { text-align: left; margin-top: 16px; }
.hg-memo h3, .hg-examples h3, .hg-confused h3, .hg-results h3 { font-size: 13px; margin-bottom: 4px; }
.hg-memo p { margin: 0 0 8px; }
.hg-examples ul, .hg-results ul { margin: 0; padding-left: 18px; font-size: 13px; color: #54656d; }
.hg-examples li { margin-bottom: 6px; }
.hg-examples li small { display: block; color: var(--muted); font-size: 11px; }
.hg-results p { font-size: 12px; }
.hg-confused ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hg-chip { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 4px 12px; border: 1px solid #d9e3de; border-radius: 12px; background: #fff; color: var(--ink); font-size: 24px; }
.hg-chip.static { background: #f7f8f4; color: #54656d; }
.hg-why { margin-top: 8px; font-size: 12px; color: var(--muted); }
.hg-why summary { cursor: pointer; }
.hg-why p { margin: 6px 0 0; font-size: 12px; }
.hg-group-actions { display: grid; gap: 8px; margin-top: 16px; }
.hg-group-note { text-align: left; }
.hg-neighbours { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 17px; font-size: 11px; color: var(--muted); }
.hg-neighbours .btn { font-size: 11px; padding: 7px 10px; min-height: 44px; width: auto; }
.hg-empty-glyph { display: grid; place-items: center; width: 110px; height: 110px; margin: 10px auto 24px; border-radius: 22px; border: 1px solid #e2e3d8; color: #b0bbae; font-size: 70px; font-weight: 300; transform: rotate(-5deg); background: #fafaf4; }
.hg-detail:has(.hg-empty-glyph) h2 { font-size: 18px; }
.hg-detail-hint { color: #5b6b66; display: block; font-size: 10px; letter-spacing: 1px; margin-top: 24px; }
/* practice */
.hg-practice .hg-section-heading { margin-bottom: 18px; }
.hg-practice-scope { display: flex; gap: 18px; margin-bottom: 14px; align-items: stretch; }
.hg-practice-group { flex: 1; min-width: 150px; }
.hg-practice-group label { margin: 0 0 5px; font-size: 10px; text-transform: uppercase; font-weight: 750; letter-spacing: .8px; color: var(--muted); }
.hg-practice-group select { margin: 0; padding: 9px 12px; min-height: 44px; border-color: var(--line); border-radius: 10px; color: var(--ink); font-size: 13px; background: #fff; }
.hg-stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.hg-stage-heading h3 { margin: 0; font-size: 14px; }
.hg-stage-heading h3 span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 8px; }
.hg-stage-heading .text-btn { font-size: 12px; }
.hg-stage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hg-stage { position: relative; display: flex; align-items: center; gap: 12px; padding: 17px 15px; margin: 0; border: 1px solid #e1e6e2; border-radius: 14px; cursor: pointer; background: #fff; }
.hg-stage.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.hg-stage.disabled { cursor: default; background: #f7f8f6; color: var(--muted); }
.hg-stage input { width: 17px; height: 17px; margin: 0; accent-color: #137c73; flex-shrink: 0; order: 4; margin-left: auto; }
.hg-stage-number { display: grid; place-items: center; flex-shrink: 0; width: 31px; height: 34px; border-radius: 9px; color: #566761; background: #f2f4f1; font-size: 12px; font-weight: 750; }
.hg-stage.selected .hg-stage-number { color: #fff; background: #137c73; }
.hg-stage-copy { display: flex; flex-direction: column; gap: 4px; }
.hg-stage-copy strong { font-size: 13px; font-weight: 750; line-height: 1.35; }
.hg-stage-copy small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.35; }
.hg-stage-example { margin-left: auto; padding-left: 4px; color: #5b6b66; font-size: 14px; font-weight: 500; white-space: nowrap; }
.hg-stage-soon { margin-left: auto; padding: 2px 8px; border: 1px solid #dfe3dc; border-radius: 20px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.hg-stage.disabled input { display: none; }
.hg-options { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; background: #fbfcfa; }
.hg-options summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 13px; font-weight: 700; }
.hg-options-body { display: grid; gap: 14px; padding: 4px 0 16px; }
.hg-option-group { border: 0; padding: 0; margin: 0; }
.hg-option-group legend { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; padding: 0; }
.hg-segmented { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.hg-segmented label { display: grid; place-items: center; min-width: 52px; min-height: 44px; margin: 0; padding: 0 14px; border: 1px solid #dce5e1; border-radius: 10px; background: #fff; cursor: pointer; }
.hg-segmented label.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; color: #137c73; }
.hg-segmented input { position: absolute; opacity: 0; width: 1px; min-height: 1px; pointer-events: none; }
.hg-switch { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font-weight: 600; cursor: pointer; }
.hg-focus { margin: 22px 0 0; padding: 0; border: 0; }
.hg-focus legend { font-size: 14px; font-weight: 750; margin-bottom: 8px; padding: 0; }
.hg-focus-list { display: grid; gap: 8px; }
.hg-focus-option { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 15px; border: 1px solid #e1e6e2; border-radius: 13px; cursor: pointer; background: #fff; }
.hg-focus-option.selected { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.hg-focus-option.disabled { opacity: .6; cursor: default; }
.hg-focus-option input { margin-top: 2px; }
.hg-focus-copy { display: flex; flex-direction: column; gap: 2px; }
.hg-focus-copy strong { font-size: 13px; }
.hg-focus-copy small { color: var(--muted); font-size: 11px; font-weight: 400; }
.hg-focus-count { color: var(--muted); font-weight: 600; }
.hg-focus-set { padding: 0 0 0 32px; }
.hg-focus-set select { min-height: 44px; font-size: 13px; }
.hg-start-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line); }
.hg-start-row strong { font-size: 13px; }
.hg-start-row p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.hg-start-row .btn { min-width: 200px; }
.hg-custom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: #f4f6ed; font-size: 13px; }
.hg-custom p { margin: 0; }
.hg-today, .hg-resume { margin-bottom: 18px; }
.hg-reco-list { display: grid; gap: 10px; }
.hg-reco { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid #e1e6e2; border-radius: 14px; background: #fbfcfa; }
.hg-reco strong { font-size: 14px; }
.hg-reco p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.hg-resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.hg-resume-actions, .hg-dead-actions, .hg-confirm-actions, .hg-result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hg-upcoming { border-top: 1px solid #dfe3dc; padding: 19px 4px 0; margin-top: 18px; }
.hg-upcoming > div { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.hg-upcoming h3 { font-size: 13px; margin: 0; color: var(--muted); }
.hg-upcoming > div > span { padding: 2px 8px; border: 1px solid #dfe3dc; border-radius: 20px; font-size: 10px; color: var(--muted); }
.hg-upcoming ol { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 0; list-style: none; }
.hg-upcoming li { display: flex; align-items: center; gap: 7px; color: #5b6b66; font-size: 11px; }
.hg-upcoming li span { color: #5b6b66; border: 1px solid #dde2d9; border-radius: 50%; display: grid; place-items: center; height: 22px; width: 22px; font-size: 10px; }
/* progress and history */
.hg-review-actions { margin-top: 24px; }
.hg-review-actions h3 { font-size: 14px; }
.hg-review-actions .feature-links { margin: 10px 0 0; }
.hg-progress-explainer { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.hg-progress-explainer summary { cursor: pointer; color: var(--ink); }
.hg-progress-explainer p { margin: 10px 0 0; }
.hg-count { border-radius: 20px; padding: 3px 9px; background: #f3f5ef; color: var(--muted); font-size: 11px; white-space: nowrap; }
.hg-level-line { color: var(--muted); font-size: 12px; margin: 0 0 6px; }
.hg-progress-skill { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.hg-progress-skill strong { font-size: 13px; }
.hg-progress-skill p { color: var(--muted); margin: 7px 0; font-size: 11px; }
.hg-progress-skill .btn { margin-top: 8px; font-size: 11px; }
.hg-progress-bar { display: block; appearance: none; height: 5px; width: 100%; border: 0; background: #e8eeea; color: #137c73; border-radius: 5px; overflow: hidden; margin: 12px 0; }
.hg-progress-bar::-webkit-progress-bar { background: #e8eeea; }
.hg-progress-bar::-webkit-progress-value { background: #137c73; border-radius: 5px; }
.hg-progress-bar::-moz-progress-bar { background: #137c73; border-radius: 5px; }
.hg-empty-state { text-align: center; padding: 38px 25px; grid-column: 1 / -1; }
.hg-empty-state > span { font-size: 36px; color: #93aaa0; display: block; margin-bottom: 12px; }
.hg-empty-state p { color: var(--muted); font-size: 13px; margin: 0; }
.hg-untouched { margin-top: 14px; font-size: 13px; color: var(--muted); }
.hg-untouched summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.hg-untouched ul { margin: 0; padding-left: 20px; }
.hg-weak-list { padding: 24px 4px 0; font-size: 13px; }
.hg-loading { padding: 30px 4px; color: var(--muted); }
.hg-history-list { display: grid; gap: 12px; }
.hg-history-item { display: flex; align-items: center; gap: 20px; }
.hg-history-score { flex-shrink: 0; display: flex; align-items: baseline; justify-content: center; min-width: 68px; padding: 14px 8px; border-radius: 14px; background: #edf6f2; color: #137c73; font-size: 26px; font-weight: 750; }
.hg-history-score small { font-size: 12px; color: inherit; }
.hg-history-item h3 { font-size: 14px; }
.hg-history-item p { font-size: 12px; color: var(--muted); margin: 0; }
.hg-history-item .btn { margin-left: auto; flex-shrink: 0; font-size: 12px; }
.hg-pagination { display: flex; justify-content: center; align-items: center; gap: 22px; padding-top: 22px; font-size: 12px; color: var(--muted); }
.hg-pagination .btn { font-size: 12px; }
/* the session */
.hg-quiz { max-width: 790px; margin: 0 auto; padding: 27px 34px; scroll-margin-top: 20px; }
.hg-quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.hg-quiz-top .eyebrow { margin: 0; }
.hg-quiz-top .text-btn { font-size: 12px; color: var(--muted); }
.hg-session-stages { display: flex; gap: 7px; margin: 0 0 24px; padding: 0; list-style: none; }
.hg-session-stages > li { display: flex; flex: 1; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; background: #f3f5f1; font-size: 12px; font-weight: 750; color: #5b6b66; }
.hg-session-stages small { font-size: 11px; color: inherit; font-weight: 400; }
.hg-session-stages > .active { color: #fff; background: #17354b; }
.hg-session-stages > .done { color: #137c73; background: #edf6f2; }
.hg-quiz-progress { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; letter-spacing: .5px; }
.hg-quiz .hg-progress-bar { margin: 9px 0 25px; }
.hg-plan { text-align: center; color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.hg-skipped { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: #f4f6ed; color: #5e7268; font-size: 12px; }
.hg-skipped p { margin: 0 0 4px; }
.hg-quiz > h2 { margin-bottom: 7px; text-align: center; }
.hg-quiz > p.muted { text-align: center; font-size: 13px; }
.hg-question { display: grid; place-items: center; font-size: 84px; line-height: 1.3; min-height: 166px; text-align: center; margin: 20px 0; padding: 17px; border: 1px solid #e8e9df; border-radius: 18px; background: #f7f7f0; font-weight: 500; overflow-wrap: anywhere; }
/* A prompt: one glyph is the default size; longer texts shrink so that a word of five glyphs still fits a phone (277px inside the card at 375px). */
.hg-question[lang="ko"][data-len="2"] { font-size: 72px; }
.hg-question[lang="ko"][data-len="3"] { font-size: 60px; }
.hg-question[lang="ko"][data-len="4"] { font-size: 52px; }
.hg-question[lang="ko"]:is([data-len="5"], [data-len="6"], [data-len="7"], [data-len="8"]) { font-size: 44px; }
/* A prompt in Latin letters (the reading of a letter or a block): wider per character than one glyph. */
.hg-question:not([lang])[data-len="4"], .hg-question:not([lang])[data-len="5"] { font-size: 68px; }
.hg-question:not([lang]):is([data-len="6"], [data-len="7"], [data-len="8"], [data-len="9"]) { font-size: 48px; }
p.hg-meaning { text-align: center; color: var(--muted); margin: -8px 0 14px; font-size: 14px; }
.hg-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hg-option { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 13px 18px; border: 1px solid #dce5e1; border-radius: 13px; cursor: pointer; font-size: 24px; margin: 0; font-weight: 500; }
.hg-option:has(input:checked) { background: #edf6f2; border-color: #137c73; box-shadow: inset 0 0 0 1px #137c73; }
.hg-option input { width: 19px; height: 19px; accent-color: #137c73; margin: 0; }
.hg-option > span { white-space: nowrap; }
.hg-option > span[lang="ko"] { font-size: 32px; line-height: 1.2; }
.hg-option > small { margin-left: auto; font-size: 10px; border: 1px solid #e0e5e1; border-radius: 5px; padding: 1px 5px; font-weight: 400; }
/* Respellings in brackets ([감사함니다]) get a column of their own. */
.hg-choices-long { grid-template-columns: minmax(0, 1fr); }
.hg-choices-long .hg-option > span, .hg-choices-long .hg-option > span[lang="ko"] { white-space: normal; overflow-wrap: anywhere; font-size: 24px; }
.hg-typing { max-width: 420px; margin: 0 auto; font-size: 12px; color: var(--muted); }
.hg-typing input { min-height: 64px; text-align: center; font-size: 26px; color: var(--ink); border-color: var(--line); border-radius: 13px; margin-top: 7px; }
.hg-typing-help { text-align: center; }
.hg-listen { display: flex; flex-direction: column; align-items: center; background: #f7f7f0; padding: 25px; margin: 20px 0; border-radius: 18px; }
.hg-listen > span { color: #137c73; font-size: 34px; margin-bottom: 15px; }
.hg-play { display: grid; place-items: center; width: 64px; height: 64px; border: 0; border-radius: 50%; background: #137c73; color: #fff; font-size: 24px; }
.hg-play.playing { background: #17354b; }
.hg-skip { display: flex; justify-content: center; margin-top: 14px; }
.hg-skip-status { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-size: 13px; }
.hg-skip-status[hidden], .hg-skip .text-btn[hidden] { display: none; }
.hg-quiz-bottom { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.hg-quiz-bottom > span { color: var(--muted); font-size: 11px; }
.hg-quiz-bottom .btn { min-width: 175px; }
.hg-match-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0 10px; text-align: center; color: var(--muted); letter-spacing: 1px; font-size: 10px; font-weight: 700; }
.hg-match-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.hg-match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.hg-match-column { display: grid; gap: 10px; align-content: start; }
.hg-match-tile { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; }
.hg-match-tile strong { font-size: 24px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.hg-match-glyph strong { font-size: 30px; font-weight: 500; }
.hg-match-tile > small { margin-left: auto; font-size: 11px; color: var(--muted); text-align: right; }
.hg-pair-number { display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: #f1f4ef; color: #566761; font-size: 11px; font-weight: 700; }
.hg-match-tile.paired { background: #edf6f2; border-color: #c3dcd0; }
.hg-match-tile.paired .hg-pair-number { background: #d7eade; color: #137c73; }
.hg-match-tile.active { box-shadow: inset 0 0 0 1px #137c73; border-color: #137c73; background: #f1f8f5; }
.hg-page .hg-match-tile:disabled { opacity: .85; cursor: default; }
.hg-match-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.hg-match-footer p { margin: 0; color: var(--muted); font-size: 11px; }
.hg-match-footer .text-btn { font-size: 11px; }
.hg-intro-card { display: grid; justify-items: center; gap: 8px; margin: 18px 0; padding: 22px 16px; border: 1px solid #e8e9df; border-radius: 18px; background: #f7f7f0; text-align: center; }
.hg-intro-count { color: var(--muted); font-size: 12px; }
.hg-intro-glyph { font-size: 84px; line-height: 1.25; font-weight: 500; overflow-wrap: anywhere; }
.hg-intro-glyph[data-len="2"] { font-size: 72px; }
.hg-intro-glyph[data-len="3"] { font-size: 60px; }
.hg-intro-glyph:is([data-len="4"], [data-len="5"], [data-len="6"], [data-len="7"], [data-len="8"]) { font-size: 48px; }
.hg-intro-reading { font-size: 28px; font-weight: 700; color: #137c73; }
.hg-intro-name { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.hg-intro-name strong { color: var(--ink); }
.hg-intro-memo { max-width: 520px; text-align: left; }
.hg-intro-tip-label { font-size: 12px; margin: 8px 0 4px; }
.hg-intro-tip { margin: 0; font-size: 14px; }
.hg-intro-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hg-intro-skip { display: flex; justify-content: center; margin-top: 6px; }
.hg-dead .form-error { margin-top: 14px; }
/* the result */
.hg-result { max-width: 790px; margin: 0 auto; text-align: center; padding: 36px; }
.hg-result-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 17px; border-radius: 50%; color: #137c73; background: #e7f3eb; font-size: 26px; }
.hg-result h1 { font-size: 28px; }
.hg-score { color: #137c73; font-size: 70px; font-weight: 750; letter-spacing: -3px; line-height: 1.25; margin-bottom: 10px; }
.hg-score > span { color: var(--muted); font-size: 23px; font-weight: 400; letter-spacing: -.5px; }
.hg-result > p { color: var(--muted); font-size: 14px; }
.hg-result-actions { justify-content: center; }
.hg-result-stages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 20px 0; font-size: 12px; }
.hg-result-stages p { margin: 0; }
.hg-review { text-align: left; margin-top: 18px; }
.hg-review h2 { font-size: 18px; }
.hg-review-empty { color: var(--muted); }
.hg-feedback-group h3 { font-size: 14px; margin: 16px 0 8px; }
.hg-feedback { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 8px; padding: 0; list-style: none; text-align: left; }
.hg-feedback-item { display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 17px; min-width: 0; overflow-wrap: anywhere; }
.hg-feedback-item > span { color: #137c73; font-size: 12px; }
.hg-feedback-item.review > span { color: #7a5517; }
.hg-feedback-item.skipped > span { color: var(--muted); }
.hg-feedback-item strong { font-size: 20px; }
.hg-feedback-item small { font-size: 12px; }
.hg-feedback-item p { margin: 0; font-size: 13px; color: #54656d; }
.hg-feedback-item .hg-explain.ok { color: #137c73; }
.hg-replay summary { cursor: pointer; font-size: 12px; min-height: 44px; display: flex; align-items: center; }
.hg-replay audio { width: 100%; }
.hg-footer { margin-top: 35px; padding-top: 20px; border-top: 1px solid #e2e5dc; color: #5f6f68; font-size: 12px; }
.hg-footer > p { margin-bottom: 7px; }
.hg-credits summary { cursor: pointer; width: fit-content; min-height: 44px; display: flex; align-items: center; }
.hg-credits p { margin: 9px 0; max-width: 850px; }
/* the dialogs of the trainer live outside .hg-page */
dialog .hg-confirm-actions { margin-top: 14px; }
/* the link of the learning page, drawn under its heading */
.hg-link { margin: 0 8px 12px 0; }
/* the hero of the Korean program page */
.hg-entry { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 30px; padding: 32px 36px; margin-bottom: 22px; border-radius: 25px; background: #17354b; color: #fff; }
.hg-entry .eyebrow { color: #c5d7c9; font-size: 10px; }
.hg-entry h2 { color: #fff; font-size: clamp(25px, 2.5vw, 32px); max-width: 530px; line-height: 1.3; letter-spacing: -.6px; }
.hg-entry p { color: #c7d5dc; font-size: 14px; max-width: 530px; }
.hg-entry .btn { background: #e5eedf; color: #17354b; border-color: #e5eedf; margin-top: 8px; }
.hg-entry .btn:hover { background: #f3f6ef; }
.hg-entry-glyphs { position: relative; height: 166px; }
.hg-entry-glyphs span { position: absolute; display: grid; place-items: center; width: 120px; height: 134px; border-radius: 20px; font-size: 70px; line-height: 1; background: #f5f2e5; color: #17354b; transform: rotate(-9deg); left: 5px; top: 8px; box-shadow: 0 8px 15px #061b2226; }
.hg-entry-glyphs span + span { left: 100px; top: 29px; background: #d8e9db; transform: rotate(9deg); }
.hg-entry-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: #afc4cb; font-size: 11px; margin-top: 20px; }
@media (max-width: 1150px) {
  .hg-hero { gap: 22px; padding: 25px; }
  .hg-stats > div { padding: 0 13px; }
  .hg-stats dd { font-size: 24px; }
  .hg-hero h1 { font-size: 28px; }
  .hg-stage-example { display: none; }
  .hg-layout { grid-template-columns: minmax(0, 1.2fr) minmax(235px, 1fr); gap: 18px; }
  .hg-grid { gap: 5px; }
  .hg-tile { min-height: 102px; }
  .hg-tile strong { font-size: 29px; }
  .hg-detail { padding: 19px; }
}
@media (max-width: 900px) {
  .hg-hero { flex-direction: column; align-items: stretch; gap: 22px; }
  .hg-stats > div { flex: 1; padding: 0 18px; }
  .hg-stats > div:first-child { padding-left: 0; border: 0; }
  .hg-layout { grid-template-columns: 1fr; }
  .hg-chart-card:has([data-hg-category="rule"][aria-pressed="true"]) .hg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hg-entry { grid-template-columns: 1fr; padding: 26px 24px; }
  .hg-entry-glyphs { display: none; }
}
@media (max-width: 700px) {
  .hg-page .card { padding: 18px 16px; }
  .hg-quiz { padding: 20px 16px; }
  .hg-result { padding: 24px 16px; }
  .hg-hero { padding: 22px 18px; }
  .hg-stats > div { padding: 0 10px; }
  .hg-stats dd { font-size: 22px; }
  .hg-tabs > button { padding: 10px 6px; font-size: 13px; }
  .hg-section-heading { flex-direction: column; gap: 8px; }
  .hg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hg-stage-grid { grid-template-columns: 1fr; }
  .hg-practice-scope { flex-direction: column; gap: 8px; }
  .hg-start-row { flex-direction: column; align-items: stretch; }
  .hg-start-row .btn { min-width: 0; width: 100%; }
  .hg-choices { gap: 8px; }
  .hg-option { padding: 10px 12px; gap: 8px; }
  .hg-option > small { display: none; }
  .hg-match-board, .hg-match-heading { gap: 10px; }
  .hg-match-tile { padding: 8px 10px; gap: 8px; min-height: 64px; }
  .hg-match-tile { position: relative; }
  .hg-match-tile > small { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }   /* still read by a screen reader */
  .hg-feedback { grid-template-columns: minmax(0, 1fr); }
  .hg-history-item { flex-wrap: wrap; gap: 12px; }
  .hg-history-item .btn { margin-left: 0; width: 100%; }
  .hg-reco { flex-direction: column; align-items: stretch; }
  .hg-quiz-bottom { flex-direction: column; align-items: stretch; gap: 8px; }
  .hg-quiz-bottom > span { text-align: center; }
  .hg-quiz-bottom .btn { width: 100%; }
  .hg-score { font-size: 56px; }
  .hg-question { font-size: 72px; min-height: 140px; }
  .hg-intro-glyph { font-size: 72px; }
}
@media (max-width: 600px) {
  .hg-question[lang="ko"][data-len="2"] { font-size: 64px; }
  .hg-question[lang="ko"][data-len="3"] { font-size: 54px; }
  .hg-question[lang="ko"][data-len="4"] { font-size: 46px; }
  .hg-question[lang="ko"]:is([data-len="5"], [data-len="6"], [data-len="7"], [data-len="8"]) { font-size: 40px; }
  .hg-question:not([lang])[data-len="4"], .hg-question:not([lang])[data-len="5"] { font-size: 58px; }
  .hg-question:not([lang]):is([data-len="6"], [data-len="7"], [data-len="8"], [data-len="9"]) { font-size: 42px; }
  .hg-intro-glyph[data-len="2"] { font-size: 64px; }
  .hg-intro-glyph[data-len="3"] { font-size: 52px; }
  .hg-intro-glyph:is([data-len="4"], [data-len="5"], [data-len="6"], [data-len="7"], [data-len="8"]) { font-size: 42px; }
}
@media (max-width: 390px) {
  .hg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hg-tile { min-height: 96px; }
  .hg-session-stages small { display: none; }
  .hg-option > span[lang="ko"] { font-size: 28px; }
  .hg-entry-meta { font-size: 10px; }
}
/* Short screens: keep the question and the primary action in view. */
@media (max-height: 760px) {
  .hg-question[lang="ko"][data-len="2"] { font-size: 52px; }
  .hg-question[lang="ko"][data-len="3"] { font-size: 46px; }
  .hg-question[lang="ko"][data-len="4"] { font-size: 40px; }
  .hg-question[lang="ko"]:is([data-len="5"], [data-len="6"], [data-len="7"], [data-len="8"]) { font-size: 36px; }
  .hg-question:not([lang])[data-len="4"], .hg-question:not([lang])[data-len="5"] { font-size: 48px; }
  .hg-question:not([lang]):is([data-len="6"], [data-len="7"], [data-len="8"], [data-len="9"]) { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .hg-page *, .hg-entry * { transition: none !important; scroll-behavior: auto !important; }
}
/* Korean program follows the compact Japanese course-first entry layout. */
.japanese-program:has(.hg-entry) .program-utilities{border:1px solid #dce5e1;background:#fff;border-radius:18px;margin:20px 0;padding:16px 20px}
.japanese-program:has(.hg-entry) .program-utilities summary{cursor:pointer;font-weight:750;color:#17354b;line-height:1.6}.japanese-program:has(.hg-entry) .program-utilities summary span{display:block;font-size:12px;font-weight:400;color:#637780;margin-left:16px}.japanese-program:has(.hg-entry) .program-utilities .feature-links{margin:16px 0 0}
/* Stage 5/6: keep whole Korean words together, with room to type a sentence. */
.hg-text-prompt { background: linear-gradient(145deg, #eff8f5, #f4f7fc); border: 1px solid #d7e8e2; border-radius: 20px; margin: 20px 0; padding: 24px; text-align: center; }
.hg-text-label { display: block; color: #326d68; font-size: 11px; font-weight: 750; letter-spacing: .12em; margin-bottom: 14px; }
.hg-text-written { color: #17354b; font-size: clamp(30px, 5vw, 46px); font-weight: 700; line-height: 1.65; overflow-wrap: anywhere; }
.hg-text-prompt-word .hg-text-written { font-size: clamp(36px, 6vw, 60px); }
.hg-sentence-token { display: inline-block; max-width: 100%; word-break: keep-all; overflow-wrap: anywhere; }
.hg-text-prompt .hg-meaning { margin: 16px 0 0; font-size: 16px; line-height: 1.65; color: #49666f; }
.hg-quiz:has(.hg-text-prompt) .hg-typing { max-width: 640px; width: 100%; }
.hg-quiz:has(.hg-text-prompt-text) .hg-typing textarea { min-height: 112px; font-size: 20px; line-height: 1.65; text-align: left; padding: 14px 16px; border-radius: 13px; margin-top: 7px; resize: vertical; }
.hg-feedback-item .hg-answer-reading { line-height: 1.75; }
.hg-answer-rr { color: #176e67; }
.hg-feedback-item .hg-sino { background: #eef5fc; padding: 10px 12px; border-radius: 10px; margin-top: 4px; color: #274966; }
.hg-sino small { display: block; margin-top: 5px; line-height: 1.6; }
.hg-text-progress { border-top: 3px solid #4b9e93; }
@media (max-width: 600px) {
  .hg-text-prompt { margin: 16px 0; padding: 18px 14px; }
  .hg-text-written { font-size: 28px; }
  .hg-text-prompt-word .hg-text-written { font-size: 38px; }
}

/* Korean stroke order and finger drawing. */
.hg-strokes,
.hg-drawing { display: grid; gap: 12px; justify-items: center; margin-top: 4px; }
.hg-stroke-preview { display: block; width: min(100%, 300px); aspect-ratio: 1 / 1; height: auto; border: 1px solid #e0e3d9; border-radius: 16px; background: #fff; }
.hg-draw-status { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.hg-stroke-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hg-stroke-tile { position: relative; width: 76px; height: 76px; min-width: 64px; min-height: 64px; padding: 4px; border: 1px solid #dce5e1; border-radius: 12px; background: #fff; }
.hg-stroke-tile:hover:not(:disabled) { border-color: #137c73; background: #f1f7f3; }
.hg-stroke-tile svg { display: block; width: 100%; height: 100%; }
.hg-page .hg-stroke-tile:disabled { opacity: 1; cursor: not-allowed; }
.hg-stroke-tile.chosen { border-color: #137c73; background: #edf6f2; }
.hg-stroke-tile.chosen svg { opacity: .35; }
.hg-stroke-order { position: absolute; top: -7px; right: -7px; display: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #137c73; color: #fff; font-size: 12px; font-weight: 700; }
.hg-stroke-tile.chosen .hg-stroke-order { display: grid; }
.hg-stroke-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hg-stroke-actions .btn { min-width: 150px; }
.hg-draw-surface { display: block; width: min(100%, 420px, calc(100vh - 330px)); width: min(100%, 420px, calc(100dvh - 330px)); min-width: min(100%, 220px); aspect-ratio: 1 / 1; height: auto; border: 2px solid #cfdcd5; border-radius: 16px; background: #fff; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hg-writing-model { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:12px; background:#edf7f4; border-radius:16px; padding:12px; margin-block:12px; }
.hg-writing-model span { font-size:11px; font-weight:800; letter-spacing:.06em; color:#397c6e; }
.hg-writing-model strong { font-size:44px; line-height:1.2; }
.hg-writing-model p { width:100%; text-align:center; margin:0; font-size:13px; color:var(--muted); }
.hg-feedback-glyph { width:140px; max-width:100%; aspect-ratio:1; background:#fff; border:1px solid #dce5e1; border-radius:14px; margin-top:8px; }
@media(max-width:480px) { .hg-stroke-tile { width:68px; height:68px; } .hg-stroke-actions .btn { flex:1; min-width:120px; } .hg-stroke-preview { width:min(100%,220px); } }

.hg-writing-guide { display:grid; gap:10px; justify-items:center; margin-block:16px; padding:14px; border-radius:16px; background:#edf7f4; }
.hg-writing-guide h3 { margin:0; color:#17354b; }
.hg-writing-guide p { font-size:12px; color:var(--muted); line-height:1.5; margin:0; }
