/* UnGungseo source and GPLv2 notice: /assets/hanja-tree/reading/ungungseo/SOURCE.txt */
@font-face {
  font-family: "ClassAimate Hanja Gungseo";
  src: url("/assets/hanja-tree/reading/ungungseo/ungungseo-hanja-v1.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF;
}

@font-face {
  font-family: "ClassAimate Hanja Reading";
  src: url("/assets/hanja-tree/reading/classaimate-hanja-reading-v1.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF;
}

:root {
  color-scheme: light;
  --paper: #f9f4e9;
  --card: #fff9ec;
  --green: #184f39;
  --on-green: #fffdf4;
  --dark: #20271f;
  --muted: #4c5146;
  --edge: #ddd1b9;
  --soft: #e9edc9;
  --hanja-reading: "ClassAimate Hanja Gungseo", "ClassAimate Hanja Reading";
  --serif: var(--hanja-reading), "HCR Batang", "AppleMyungjo", "Batang", serif;
  font-family: var(--hanja-reading), "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--dark); background: var(--paper) url("/assets/hanja-tree/landscape.jpg") center bottom / 100% auto no-repeat; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
a { color: var(--green); text-underline-offset: .18em; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible { outline: 3px solid #986018; outline-offset: 4px; }
h1, h2, p { margin: 0; }
p { line-height: 1.58; }
img { max-width: 100%; display: block; }
.ht-header { min-height: 94px; padding: .8rem clamp(1rem, 3vw, 3rem); display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 2rem; border-bottom: 1px solid var(--edge); background: #faf5e9; }
.ht-brand { font-weight: 850; font-size: clamp(1.22rem, 2.2vw, 1.85rem); text-decoration: none; white-space: nowrap; }
.ht-brand strong { margin-left: .35rem; font-size: 1.25em; }
.ht-header nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: .25rem; }
.ht-header nav button { border: 0; padding: .55rem .95rem; min-height: 44px; font-weight: 800; border-radius: 99px; color: var(--muted); background: transparent; }
.ht-header nav button[aria-current], .ht-rail strong, .ht-title { background: var(--green); color: #fffdf4; }
.ht-tagline { color: var(--muted); }
.ht-badge { border: 1px solid #78947d; border-radius: 99px; padding: .35rem .8rem; color: var(--green); font-weight: 850; white-space: nowrap; }
#ht-main { min-height: calc(100vh - 94px); padding: clamp(1rem, 2.7vw, 2.4rem) clamp(.8rem, 2vw, 2rem) 5rem; }
#ht-main:focus { outline: none; }
.ht-status { position: fixed; z-index: 2; inset: auto 1rem 1rem; max-width: max-content; padding: .6rem 1rem; background: #fffaf0; color: #642612; box-shadow: 0 3px 18px #47321e35; border: 1px solid #b68153; border-radius: .7rem; }
.ht-shell { display: grid; grid-template-columns: clamp(9.5rem, 15vw, 13rem) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.2rem); }
.ht-rail { display: grid; align-content: start; gap: .8rem; padding-right: .85rem; border-right: 1px solid var(--edge); }
.ht-rail strong, .ht-rail .ht-button, .ht-rail a { display: block; text-align: left; border-radius: .75rem; padding: .7rem 1rem; }
.ht-rail .ht-button { background: transparent; color: var(--dark); border-color: transparent; }
.ht-title, .ht-label { display: inline-block; padding: .45rem .9rem; border-radius: .75rem; font-size: clamp(1.4rem, 3.5vw, 2.45rem); line-height: 1.26; font-weight: 850; }
.ht-label { background: var(--soft); color: var(--green); }
.ht-map-heading, .ht-unit-head, .ht-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; }
.ht-unit-head, .ht-review-head { justify-content: space-between; }
.ht-map-heading { margin-bottom: 1.85rem; }
.ht-map-heading > span, .ht-eyebrow { color: var(--muted); font-weight: 700; }
.ht-unit-head h2 { font-size: clamp(1.45rem, 3.3vw, 2.65rem); }
.ht-unit-head h2 span { background: var(--soft); color: var(--green); padding: .2rem .55rem; border-radius: .4rem; font-size: .67em; }
.ht-path { display: flex; justify-content: center; gap: clamp(.35rem, 2.3vw, 2.5rem); flex-wrap: wrap; margin: 1.5rem auto; }
.ht-waypoint { position: relative; border: 1px solid var(--edge); border-radius: 50%; background: var(--card); color: var(--dark); width: clamp(3rem, 7vw, 5.5rem); aspect-ratio: 1; font: bold clamp(1.1rem, 3.8vw, 2.7rem) var(--serif); box-shadow: 0 .15rem .3rem #75552c2d; }
.ht-waypoint:last-child { font-family: inherit; font-size: clamp(.75rem, 1.6vw, 1rem); }
.ht-waypoint.is-current { background: #e6ebbd; color: var(--green); border: .22rem solid #779849; opacity: 1; }
.ht-waypoint small { position: absolute; top: 0; right: 0; font: 800 .8rem system-ui; color: var(--green); }
.ht-paper { border: 1px solid #e8d9be; border-radius: 1.5rem; background: #fff8eb; box-shadow: 0 .24rem .65rem #73553517; }
.ht-map-next { display: grid; grid-template-columns: .85fr 1.1fr .85fr; align-items: center; padding: clamp(1rem, 3vw, 2.6rem); gap: 1rem; min-height: 340px; }
.ht-map-next h2 { font-size: clamp(1.7rem, 4vw, 3.1rem); }
.ht-map-next img { max-height: 15rem; margin: auto; border-radius: 1rem; mix-blend-mode: multiply; }
.ht-map-next .ht-button { margin-top: .7rem; }
.ht-glyph { font: 800 clamp(4.7rem, 14vw, 11.8rem)/1.1 var(--serif); color: var(--green); text-align: center; }
.ht-button { display: inline-block; min-height: 44px; border: 1px solid var(--green); border-radius: 2rem; background: var(--green); color: #fffdf3; padding: .55rem 1.15rem; font-weight: 800; }
.ht-guide, .ht-all-units { margin-top: 1rem; background: #faf5ea; padding: .75rem 1rem; border: 1px solid var(--edge); border-radius: .75rem; }
summary { cursor: pointer; color: var(--green); font-weight: 800; }
.ht-origin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.8fr); gap: clamp(.8rem, 2vw, 1.5rem); align-items: stretch; }
.ht-glyph-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; min-height: 35rem; padding: 1rem; }
.ht-glyph-card strong { background: var(--green); color: #fffaf0; padding: .65rem 1.25rem; border-radius: 2rem; font-size: clamp(1.5rem, 3.8vw, 2.85rem); }
.ht-origin-story { display: grid; grid-template-columns: 1fr 1.07fr; align-items: center; gap: 1rem; padding: clamp(1rem, 2.6vw, 2.2rem); }
.ht-origin-story img { border-radius: 1rem; width: 100%; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; }
.ht-story-copy { font-size: clamp(1.12rem, 2.05vw, 1.7rem); margin: 1.2rem 0; }
.ht-sources { margin-top: 1.4rem; padding-top: .7rem; border-top: 1px solid var(--edge); }
.ht-sources p, .ht-sources a { font-size: .87rem; }
.ht-next { display: flex; justify-content: flex-end; margin-top: 1rem; }
.ht-next .ht-button { font-size: clamp(1.2rem, 2.5vw, 1.95rem); padding-inline: 1.8rem; }
.ht-center, .ht-question, .ht-review-card { padding: clamp(1.1rem, 3.6vw, 3.2rem); }
.ht-center, .ht-review-card { text-align: center; }
.ht-center { min-height: 26rem; display: grid; align-content: center; justify-items: center; gap: 1rem; }
.ht-question { min-height: clamp(28rem, 70vh, 42rem); }
.ht-question-body { display: grid; grid-template-columns: minmax(0, 2.7fr) minmax(0, 1fr); align-items: center; gap: 1rem; margin-top: clamp(1rem, 4vw, 3rem); }
.ht-question-body:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.ht-question-body img { mix-blend-mode: multiply; }
.ht-prompt { border: 1px solid var(--edge); padding: 1rem; font-weight: 800; font-size: clamp(1.25rem, 3.55vw, 2.8rem); border-radius: 1.1rem; background: #fcf2de; }
.ht-choices, .ht-grades, .ht-staff-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.ht-choices button { flex: 1 1 8rem; min-height: 70px; border: 2px solid var(--edge); border-radius: 1.1rem; background: #fffbf1; color: var(--dark); padding: .75rem; font-size: clamp(1.1rem, 3vw, 2.1rem); font-weight: 850; }
.ht-choices .is-correct { border-color: var(--green); background: var(--soft); color: var(--green); }
.ht-choices .is-wrong { border-color: #a24f42; background: #f6e0d5; }
.ht-feedback { color: var(--green); font-weight: 800; padding: .65rem .95rem; border-radius: .85rem; margin-top: 1rem; background: var(--soft); }
.ht-word-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .8rem; text-align: left; width: 100%; }
.ht-word-list article { background: #f5eedb; padding: 1rem; border-radius: .85rem; }
.ht-tree { display: grid; grid-template-columns: 1.42fr 1fr; gap: 1rem; }
.ht-tree h1 { font-size: clamp(1.7rem, 3.6vw, 2.8rem); color: var(--green); }
.ht-tree-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.ht-branches { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 1rem; padding: 1.25rem; min-height: 28rem; margin-top: .7rem; background: #fff8eb url("/assets/hanja-tree/wood.jpg") left center / 60% auto no-repeat; }
.ht-branches .ht-glyph { background: #fbf5dc; border-radius: 50%; }
.ht-branches .ht-button { display: block; margin: 1.15rem 0; background: #f9f1da; color: var(--dark); }
.ht-branches .ht-button[aria-pressed=true] { background: #e7edbf; border-width: 3px; }
.ht-word-detail { padding: 1.2rem; }
.ht-word-detail h2 { color: #fff9ed; background: var(--green); border-radius: .8rem; padding: .65rem; font-size: clamp(1.3rem, 3.1vw, 2.6rem); }
.ht-word-detail dt { color: var(--green); font-weight: 800; margin-top: .7rem; }
.ht-word-detail dd { margin: .2rem 0; }
.ht-word-detail img { max-height: 12rem; margin: auto; mix-blend-mode: multiply; }
.ht-review-head { margin-bottom: 1rem; }
.ht-review-card { min-height: 34rem; }
.ht-review-word { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem; }
.ht-review-word h2 { font-size: clamp(2rem, 6vw, 5rem); color: var(--green); }
.ht-review-word img { max-width: min(34%, 12rem); mix-blend-mode: multiply; }
.ht-review-card .ht-feedback { max-width: 48rem; margin: 1.2rem auto .7rem; font-size: clamp(1.1rem, 3vw, 2.2rem); }
.ht-review-card p { margin-bottom: .7rem; }
.ht-grades { justify-content: center; }
.ht-grades .ht-button { flex: 1 1 7rem; background: #fffbf0; color: var(--green); }
.ht-grades .ht-button[data-grade=good] { color: #fffdf3; background: var(--green); }
.ht-staff-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 1rem; }
.ht-staff-actions { margin-bottom: 1.4rem; }
.ht-staff-actions .ht-button { flex: 1; background: #f8efd9; color: var(--dark); }
.ht-staff-panel { padding: clamp(.7rem, 2vw, 1.55rem); }
.ht-staff-panel .ht-label { font-size: 1.25rem; }
.ht-table-wrap { max-width: 100%; overflow: auto; }
.ht-table-wrap table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.ht-table-wrap th, .ht-table-wrap td { padding: .6rem; border-bottom: 1px solid var(--edge); }
.ht-table-wrap thead { background: var(--soft); color: var(--green); }
#ht-settings { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
#ht-settings h2 { width: 100%; font-size: 1.15rem; }
#ht-settings select { max-width: 100%; background: #fffaf0; padding: .45rem; border: 1px solid #928a77; border-radius: .5rem; }
@media (max-width: 900px) {
  .ht-header nav { margin-left: 0; }
  .ht-shell { display: block; }
  .ht-rail { display: none; }
  .ht-origin { grid-template-columns: minmax(0,.7fr) minmax(0,2fr); }
  .ht-glyph-card { min-height: 22rem; }
}
@media (max-width: 610px) {
  :root { font-size: 16px; }
  .ht-header { gap: .15rem .4rem; }
  .ht-header nav button { padding-inline: .65rem; }
  #ht-main { padding: .8rem .7rem 3rem; }
  .ht-origin, .ht-origin-story, .ht-map-next, .ht-question-body, .ht-tree, .ht-word-list, .ht-staff-grid { grid-template-columns: minmax(0,1fr); }
  .ht-map-next { text-align: center; min-height: 0; }
  .ht-map-next img, .ht-origin-story img, .ht-question-body img { width: min(100%,14rem); margin-inline: auto; }
  .ht-glyph-card { flex-direction: row; min-height: auto; gap: .8rem; }
  .ht-glyph-card .ht-glyph { font-size: 4rem; }
  .ht-glyph-card strong { font-size: 1.25rem; }
  .ht-branches { min-height: 16rem; padding: .7rem; gap: .4rem; }
  .ht-branches .ht-button { padding-inline: .65rem; }
}

.ht-lesson-navigation { display: flex; justify-content: space-between; gap: .75rem; }
.ht-lesson-navigation [data-action="advance"] { margin-inline-start: auto; }
.ht-write-panel { padding: clamp(.8rem, 2vw, 1.75rem); }
.ht-write-panel > p { margin: .5rem 0 .8rem; }
.ht-write-layout { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: start; }
.ht-write-layout > div { width: min(100%, 21rem); }
.ht-write-board, .ht-write-example { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--edge); border-radius: .65rem; background: #fffaf0; }
.ht-write-board { touch-action: none; user-select: none; cursor: crosshair; }
.ht-write-board polyline, .ht-write-example polyline { fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ht-write-board polyline[data-write-error],
.ht-write-correction polyline[data-write-error] { stroke: #a23823; }
.ht-write-correction { display: flex; gap: .75rem; margin: .75rem 0; }
.ht-write-correction figure { width: min(calc((100% - .75rem) / 2), 9rem); margin: 0; }
.ht-write-correction figcaption { margin-bottom: .25rem; font-weight: 750; }
.ht-write-correction polyline[data-current] { stroke: #a23823; stroke-width: 5; }
.ht-write-correction text[data-current] { opacity: 1; fill: #a23823; }
.ht-write-board .ht-write-guide { opacity: .28; }
.ht-write-grid { stroke: #cebea6; stroke-width: .45; stroke-dasharray: 2 2; }
.ht-write-board text, .ht-write-example text { fill: #805017; font-size: 7px; font-weight: 750; paint-order: stroke; stroke: #fffaf0; stroke-width: 1.2; }
.ht-write-dense text { opacity: 0; }
.ht-write-dense.is-replaying text { animation: ht-write-number .5s both; animation-delay: calc(var(--stroke) * .5s); }
@keyframes ht-write-number { 0%, 100% { opacity: 0; } 2%, 92% { opacity: 1; } }
.ht-write-guide.ht-write-dense { opacity: 1; }
.ht-write-guide.ht-write-dense polyline { opacity: .24; }
.ht-write-guide.ht-write-dense polyline[data-current] { opacity: .7; }
.ht-write-guide.ht-write-dense text[data-current] { opacity: 1; }
.ht-write-example.is-replaying polyline { animation: ht-write-reveal .42s both; animation-delay: calc(var(--stroke) * .5s); }
@keyframes ht-write-reveal { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
.ht-write-brush { fill: var(--dark); }
.ht-write-sequence { visibility: hidden; }
.ht-write-brush-example.is-replaying .ht-write-sequence { animation: ht-write-show-sequence var(--sequence-time) steps(1, end); }
.ht-write-brush-example.is-replaying .ht-write-brush { animation: ht-write-hide-brush var(--sequence-time) steps(1, end); }
@keyframes ht-write-show-sequence { from { visibility: visible; } to { visibility: hidden; } }
@keyframes ht-write-hide-brush { from { visibility: hidden; } to { visibility: visible; } }
@media (prefers-reduced-motion: reduce) { .ht-write-example.is-replaying polyline { animation: none; } }
.ht-write-example + button, .ht-write-buttons { margin-top: .5rem; }
.ht-write-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.ht-write-buttons .ht-button, .ht-write-panel button { min-height: 44px; }
.ht-write-buttons [data-action="write-undo"], .ht-write-buttons [data-action="write-clear"] { background: transparent; color: var(--green); }
.ht-write-finished { max-width: 11rem; }
.ht-stars { color: #74501f; letter-spacing: .08em; white-space: nowrap; }
.ht-short-due { font-weight: 700; color: var(--green); }
.ht-review-usage { font-size: .85rem; color: var(--muted); }
#ht-review-settings input { min-height: 44px; padding: .35rem; max-width: 8rem; }
@media (max-width: 650px) {
  .ht-write-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
  .ht-write-example:not(.ht-write-finished) { max-width: 8rem; }
  .ht-write-example.ht-write-brush-example { max-width: 9rem; }
}

/* The large-screen view follows the reviewed 1536 × 1024 layout. */
.ht-brand-leaf { display: inline-block; width: .62em; height: .9em; margin-left: .33em; transform: rotate(27deg); border-radius: 90% 0 90% 0; background: linear-gradient(35deg,#63914b,#244e35); }
.ht-waypoint:last-child { font: bold clamp(1.1rem, 3.8vw, 2.7rem) var(--serif); }
.ht-waypoint.is-review { font: 800 clamp(.75rem, 1.6vw, 1rem) system-ui; }
.ht-waypoint:disabled { color: #353930; opacity: .75; }
.ht-paper { background: linear-gradient(132deg,#fdf7e9,#fbf2e1 53%,#fff8ec); }
.ht-label, .ht-title { border-radius: .65rem .83rem .64rem .84rem; }
.ht-origin-story .ht-button { background: transparent; color: var(--green); }
.ht-glyph-card .ht-glyph { color: #24231e; }
.ht-branch-words .ht-button { position: relative; text-align: left; width: 100%; }
.ht-branch-words .ht-button::before { content: ""; position: absolute; width: 1rem; height: 2px; background: #8b744a; top: 50%; right: 100%; }
.ht-branches .ht-glyph { justify-self: center; width: min(100%,10rem); font-size: clamp(4rem,9vw,8rem); aspect-ratio: 1; display: grid; align-content: center; }
.ht-question-body img, .ht-review-word img, .ht-word-detail img { border-radius: 2rem; }
.ht-table-wrap:focus-visible { outline: 3px solid #986018; outline-offset: 2px; }

@media (min-width: 1100px) {
  .ht-header nav { margin-right: auto; margin-left: auto; gap: .7rem; }
  .ht-header nav button { font-size: 1.23rem; padding: .6rem 1.15rem; }
  .ht-header .ht-badge { font-size: 1.15rem; }
  .ht-map-heading { margin-bottom: 2rem; }
  .ht-unit-head, .ht-map > p { padding-inline: 5.5%; }
  .ht-unit-head .ht-button { color: var(--green); border: 0; background: #f2e7cd; font-size: 1.4rem; padding: .55rem 1.45rem; }
  .ht-unit-head .ht-button strong { font-size: 1.55em; }
  .ht-map-next { max-width: 920px; margin-inline: auto; min-height: 390px; }
  .ht-map-next .ht-button { font-size: 1.52rem; padding: .65rem 1.55rem; }
  .ht-origin { min-height: min(72vh,735px); }
  .ht-origin-story { align-items: start; padding-top: 2.5rem; }
  .ht-origin-story img { align-self: center; }
  .ht-glyph-card .ht-glyph { font-size: clamp(8rem,18vw,16rem); }
  .ht-story-copy { font-size: clamp(1.55rem,2.3vw,1.87rem); }
  .ht-origin-story .ht-button { font-size: 1.28rem; padding-inline: 1.3rem; }
  .ht-question { min-height: min(75vh,768px); }
  .ht-question .ht-label { margin-left: 12%; }
  .ht-prompt { padding-block: 1.3rem; }
  .ht-choices { margin-top: 2.3rem; }
  .ht-choices button { min-height: 7.2rem; }
  .ht-question .ht-feedback { margin-top: 1.55rem; font-size: 1.46rem; padding: .95rem 1.2rem; }
  .ht-tree-shell { grid-template-columns: clamp(9.5rem,13.5vw,11.5rem) minmax(0,1fr); gap: 1rem; }
  .ht-tree { grid-template-columns: 1.37fr 1fr; }
  .ht-branches { min-height: 34rem; }
  .ht-branch-words .ht-button { font-size: 1.4rem; min-height: 4.7rem; }
  .ht-word-detail dt { font-size: 1.2rem; }
  .ht-word-detail dd { font-size: 1.18rem; }
  .ht-review-head { padding-inline: 6%; }
  .ht-review-card { min-height: 37rem; }
  .ht-review-word h2 { background: var(--soft); border-radius: .85rem; padding: .3rem 1rem; }
  .ht-review-card > p:not(.ht-feedback) { font-size: 1.22rem; }
  .ht-grades { margin-top: 1.7rem; }
  .ht-grades .ht-button { min-height: 4.3rem; font-size: 1.45rem; }
  .ht-staff-actions { margin-block: 2rem; }
  .ht-staff-actions .ht-button { min-height: 5rem; font-size: 1.5rem; border-color: #dfceb0; box-shadow: 0 .2rem .45rem #7355351c; }
  .ht-staff-panel { padding: 1.8rem; }
  .ht-table-wrap th, .ht-table-wrap td { padding: .8rem; font-size: 1.18rem; }
  .ht-staff-grid > aside h2 { background: var(--green); color: #fffaf0; }
}
.ht-mobile-units { display: none; }
@media (max-width: 900px) {
  .ht-mobile-units { display: block; margin-top: 1rem; }
}

.ht-dex-wrap { max-width: 64rem; margin-inline: auto; }
.ht-dex-wrap > p { margin-block: .7rem 1rem; }
.ht-dex-review-link { margin: .8rem 0; }
.ht-dex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr)); gap: .45rem; }
.ht-dex-tile { display: grid; justify-items: center; gap: .25rem; padding: .65rem .28rem; color: var(--dark); background: var(--card); border: 1px solid var(--edge); border-radius: .7rem; }
.ht-dex-tile[aria-pressed="true"] { background: #eaf0dc; border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.ht-dex-tile > strong { color: var(--green); font: 800 2rem/1.15 var(--serif); }
.ht-dex-tile small { color: var(--green); font-size: .77rem; font-weight: 800; }
.ht-dex-wrap progress { width: 100%; accent-color: var(--green); }
.ht-dex-tile progress { height: .4rem; }
.ht-dex-panel { display: grid; gap: .7rem; padding: clamp(.8rem, 2.5vw, 1.5rem); }
.ht-dex-panel > .ht-button { justify-self: start; }
.ht-dex-panel > .ht-guide { margin-top: 0; }
.ht-dex-meter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; color: var(--green); }
.ht-dex-milestones { list-style: none; margin: 0; padding: 0; }
.ht-dex-milestones li { padding: .3rem .45rem; border-bottom: 1px solid var(--edge); }
.ht-dex-milestones [aria-current] { background: #eaf0dc; font-weight: 800; }
.ht-dex-milestones strong { color: var(--green); font-size: .86em; }
.ht-dex-panel fieldset { min-inline-size: 0; border: 0; margin: 0; padding: .4rem 0 .7rem; border-bottom: 1px solid var(--edge); }
.ht-dex-panel legend { padding: 0; font-weight: 800; }
.ht-dex-input { font: inherit; min-height: 44px; max-width: 100%; padding: .45rem .65rem; border: 1px solid #87917c; border-radius: .55rem; color: var(--dark); background: #fffdf6; }
.ht-dex-input:focus-visible { outline: 3px solid #986018; outline-offset: 2px; }
.ht-dex-choices { display: grid; gap: .35rem; }
.ht-dex-choices label { display: flex; align-items: center; gap: .45rem; min-height: 44px; padding: .3rem .5rem; border: 1px solid var(--edge); border-radius: .45rem; cursor: pointer; }
.ht-dex-choices input { margin: 0; accent-color: var(--green); }
.ht-dex-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ht-dex-secondary { color: var(--green); background: transparent; }
.ht-exam-list { margin: 0; padding-left: 1.35rem; }
.ht-exam-list li { padding: .5rem 0; border-bottom: 1px solid var(--edge); }
.ht-exam-list button { margin-top: .4rem; }
@media (max-width: 720px) {
}

.ht-origin-picker { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .8rem; font-weight: 800; }
.ht-origin-picker select { min-height: 44px; max-width: 100%; color: var(--green); background: var(--card); border: 1px solid var(--edge); border-radius: .6rem; padding: .35rem; }
.ht-origin-tiles { margin-bottom: 1rem; }
.ht-origin-tiles .ht-button { color: var(--green); background: var(--card); border-color: var(--edge); padding-inline: .5rem; }
.ht-origin-tiles .ht-button[aria-pressed="true"] { color: white; background: var(--green); }
.ht-origin-library-card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: start; gap: clamp(.8rem, 3vw, 2rem); padding: clamp(.8rem, 3vw, 2rem); }
.ht-origin-library-card h2 { margin-block: .2rem .35rem; }
.ht-origin-library-card h3 { margin: .75rem 0 .2rem; }
.ht-origin-library-card .ht-feedback { margin-top: .8rem; }
.ht-origin-player img { width: 100%; height: auto; border-radius: .8rem; margin-bottom: .65rem; }
.ht-origin-timing { margin-top: .4rem; color: var(--muted); }
@media (max-width: 720px) {
  .ht-origin-library-card { grid-template-columns: minmax(0, 1fr); }
}

/* Student home based on the 1536 × 1024 daily learning reference. */
body[data-hanja-screen="home"] { background-color: #faf6ed; }
body[data-hanja-screen="home"] #ht-main { padding: 0 1.5rem 2rem .6rem; }
.ht-home-student { margin-left: auto; font-weight: 750; text-decoration: none; }
.ht-home-shell { display: grid; grid-template-columns: minmax(9rem,12.8rem) minmax(0,1fr); gap: 1rem; max-width: 90rem; margin: auto; }
.ht-home-rail { border-right: 1px solid var(--edge); padding: 2.8rem .7rem 1rem 0; display: grid; gap: .5rem; align-content: start; }
.ht-home-rail .ht-button { min-height: 3.65rem; display: flex; gap: .65rem; align-items: center; justify-content: flex-start; text-align: left; border: 0; border-radius: .9rem; padding: .6rem 1rem; background: transparent; color: var(--dark); }
.ht-home-rail button[aria-current] { background: var(--green); color: #fffdf4; }
.ht-home-rail svg { width: 1.8rem; height: 1.8rem; flex: none; }
.ht-home { min-width: 0; padding-top: .95rem; }
.ht-home-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; margin: 0 0 .75rem; }
.ht-home-heading h1 { color: #153c2a; font-size: clamp(1.7rem,3.45vw,3rem); line-height: 1.2; letter-spacing: -.04em; }
.ht-home-heading .ht-brand-leaf { vertical-align: -.04em; margin: 0 .35em 0 .22em; }
.ht-home-heading > span, .ht-home-soon { background: #f3e8d4; padding: .24rem .7rem; border-radius: 1rem; color: var(--muted); font-weight: 700; }
.ht-home-row, .ht-home-shortcuts { display: grid; gap: .75rem; margin-bottom: .75rem; }
.ht-home-top { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); }
.ht-home-middle { grid-template-columns: minmax(0,1fr) minmax(0,.96fr); }
.ht-home-card { border: 1px solid #d9c6a9; border-radius: 1.18rem; padding: 1rem; min-width: 0; background: linear-gradient(115deg,#fcf7ed,#faf4e9); }
.ht-home-card h2 { color: #173e2b; font-size: clamp(1.18rem,2.25vw,2rem); line-height: 1.23; word-break: keep-all; }
.ht-home-row h2 { display: inline-block; background: #e5ebc3; padding: .2rem .7rem; border-radius: 1rem .84rem 1rem .8rem; }
.ht-today { position: relative; min-height: 21rem; overflow: hidden; display: grid; align-content: center; text-align: center; }
.ht-today-art { position: absolute; width: 37%; max-width: 14rem; inset: auto auto 0 0; mix-blend-mode: multiply; }
.ht-today-content { position: relative; padding-left: 22%; }
.ht-today h2 { font-size: clamp(1.5rem,3vw,2.5rem); }
.ht-today h2 strong { font-size: 1.18em; }
.ht-today-content > p { margin: .45rem 0; }
.ht-today-tiles { display: flex; justify-content: center; gap: clamp(.35rem,1.2vw,.95rem); padding: 0; list-style: none; margin: .65rem 0 .95rem; }
.ht-today-tiles li { display: grid; place-items: center; width: min(30%,7.8rem); aspect-ratio: 1.12; border: 1px solid #e0d2bb; border-radius: .9rem; color: #183b2a; background: linear-gradient(145deg,#fff9ec,#f2e6d2); box-shadow: 0 .13rem .28rem #8f755832; font: bold clamp(2.2rem,6vw,3.4rem)/1 var(--serif); }
.ht-today-tiles .ht-today-word { font-size: clamp(1.1rem,3.2vw,2.65rem); }
.ht-today .ht-button { display: inline-block; min-height: 2.8rem; min-width: min(100%,14rem); font-size: clamp(1rem,2vw,1.5rem); padding-inline: 1rem; }
.ht-today .ht-today-reward { font-size: .85rem; color: #554631; margin-bottom: 0; }
.ht-growth { display: grid; gap: .7rem; align-content: center; }
.ht-growth-top { display: grid; align-items: center; gap: .6rem; grid-template-columns: minmax(0,1.2fr) minmax(0,.95fr); }
.ht-growth-top strong { display: block; margin-top: .35rem; color: var(--green); font-size: clamp(1.5rem,3vw,2.5rem); }
.ht-growth progress { width: 100%; height: .8rem; border: 0; border-radius: 99px; accent-color: #568039; }
.ht-growth progress::-webkit-progress-bar { border-radius: 99px; background: #e5dac3; }
.ht-growth progress::-webkit-progress-value { border-radius: 99px; background: #729c4b; }
.ht-growth-top img { width: 100%; max-height: 10rem; object-fit: contain; mix-blend-mode: multiply; }
.ht-growth dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.ht-growth dl div + div { border-left: 1px solid var(--edge); padding-left: .8rem; }
.ht-growth dt { font-size: .94rem; word-break: keep-all; }
.ht-growth dd { margin: 0; color: var(--green); font-weight: 850; font-size: clamp(1.8rem,3.45vw,2.8rem); }
.ht-growth dd small { font-size: .57em; margin-left: .1em; }
.ht-growth-week { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; border-top: 1px solid var(--edge); padding-top: .65rem; }
.ht-growth-week strong { color: var(--green); }
.ht-growth-week ul { list-style: none; display: flex; gap: .4rem; margin: 0; padding: .12rem 0; }
.ht-growth-week li { width: .95rem; height: 1.25rem; border: 1px solid #917c57; border-radius: 100% 0; transform: rotate(17deg); }
.ht-growth-week .is-earned { background: #69994a; border-color: #4f7639; }
.ht-home-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .65rem; }
.ht-home-card-head span { color: var(--muted); }
.ht-home-reading, .ht-home-writing { min-height: 12.4rem; }
.ht-home-sentence { background: #f4ead6; border-radius: .75rem; margin: .6rem 0; padding: .6rem .7rem; color: var(--dark); font-size: clamp(1.12rem,2.3vw,1.8rem); overflow-wrap: anywhere; }
.ht-home-sentence mark { background: #e6ebbe; border-radius: .3em; padding: .03em .22em; color: #154732; font-weight: 850; white-space: nowrap; }
.ht-home-reading .ht-button { display: block; margin: .2rem auto 0; background: transparent; border-color: var(--green); color: var(--green); min-height: 44px; }
.ht-home-writing { display: grid; grid-template-columns: minmax(0,1fr) minmax(3.25rem,33%); align-items: center; gap: .6rem; }
.ht-home-writing p { margin: .6rem 0; }
.ht-home-soon { font-size: .83rem; }
.ht-writing-grid { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid #cdbb9d; border-radius: .75rem; color: #9e9381; background: linear-gradient(transparent calc(50% - .5px),#ddd0ba 50%,transparent calc(50% + 1px)),linear-gradient(90deg,transparent calc(50% - .5px),#ddd0ba 50%,transparent calc(50% + 1px)); font: bold clamp(2.5rem,8vw,7rem)/1 var(--serif); }
.ht-home-shortcuts { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ht-home-shortcuts article { min-height: 7.5rem; display: flex; align-items: center; gap: .65rem; }
.ht-home-shortcuts svg, .ht-drop-glyph { width: 2.6rem; height: 2.6rem; flex: none; color: var(--green); }
.ht-drop-glyph { font: bold 2rem/2.6rem var(--serif); text-align: center; background: #eee2ca; border-radius: .4rem; }
.ht-home-shortcuts .ht-button { color: var(--green); background: transparent; border: 0; padding: .25rem 0; min-height: 44px; font-size: clamp(1.15rem,2.2vw,1.9rem); }
.ht-home-shortcuts h2 { font-size: clamp(1.15rem,2.2vw,1.9rem); }
.ht-home-shortcuts p { color: var(--muted); font-size: .9rem; }
#ht-sentence-answer { display: grid; gap: .55rem; justify-items: start; }
.ht-sentence-input { display: grid; grid-template-columns: minmax(2.9rem,max-content) minmax(0,1fr); gap: .65rem; align-items: center; max-width: 100%; font-weight: 800; }
.ht-sentence-input [aria-invalid="true"] { border: 2px solid #9e4425; }
@media (min-width: 901px) {
  body[data-hanja-screen="home"] .ht-header nav, body[data-hanja-screen="dex"]:has(.ht-dex-screen) .ht-header nav { display: none; }
  body[data-hanja-screen="dex"]:has(.ht-dex-screen) #ht-main { padding: 0 1.5rem 2rem .6rem; }
  .ht-dex-screen { padding-top: .95rem; min-width: 0; width: 100%; }
}
@media (max-width: 900px) {
  body[data-hanja-screen="home"] #ht-main { padding: .5rem .9rem 2rem; }
  .ht-home-shell { display: block; }
  .ht-home-rail { display: none; }
  .ht-today { min-height: 17rem; }
}
@media (max-width: 610px) {
  body[data-hanja-screen="home"] .ht-header { padding: .55rem .7rem; }
  body[data-hanja-screen="home"] .ht-header nav button { font-size: .84rem; padding-inline: .5rem; }
  .ht-home-row, .ht-home-shortcuts { grid-template-columns: minmax(0,1fr); }
  .ht-today { min-height: 0; }
  .ht-today-art { width: 31%; }
  .ht-today-content { padding-left: 17%; }
  .ht-home-card { padding: .75rem; }
  .ht-growth-top img { max-height: 6rem; }
  .ht-home-reading, .ht-home-writing, .ht-home-shortcuts article { min-height: 0; }
}

.ht-drop { max-width: 760px; margin: 0 auto; padding: clamp(14px, 4vw, 32px); }
.ht-drop [hidden] { display: none; }
.ht-drop-heading, .ht-drop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.ht-drop-heading h1 { margin: .1em 0; color: #184b36; font-size: clamp(1.65rem, 5vw, 2.4rem); }
.ht-drop-heading p { margin: 0; }
.ht-drop-option { display: flex; align-items: center; gap: .5rem; width: fit-content; min-height: 44px; margin: .5rem 0; cursor: pointer; }
.ht-drop-option input { accent-color: #184b36; width: 1.2rem; height: 1.2rem; }
.ht-drop-toolbar { margin-top: 1rem; }
.ht-drop .ht-button { min-height: 44px; }
.ht-drop-field {
  --ht-drop-tile-height: 4.75rem;
  position: relative;
  height: clamp(9rem, 27svh, 16rem);
  margin: .55rem 0 .8rem;
  border: 1px solid #c4cfaa;
  border-bottom: 4px solid #98ab73;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #fcf8e9, #e6ebcb);
}
.ht-drop-tile {
  position: absolute;
  inset-inline-start: 50%;
  top: calc(var(--ht-drop-progress, 0) * (100% - var(--ht-drop-tile-height)));
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  height: var(--ht-drop-tile-height);
  min-width: 5rem;
  padding-inline: .7rem;
  border: 1px solid #aabb8e;
  border-radius: 14px;
  background: #fffdf3;
  color: #174b36;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 11vw, 3.4rem);
  line-height: 1;
  box-shadow: 0 5px 12px #2d483222;
  white-space: nowrap;
}
.ht-drop-tile.is-hit { background: #d9edcb; border-color: #638746; }
.ht-drop-tile.is-missed { background: #f9e9d0; border-color: #b9794f; }
.ht-drop-paused { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.is-untimed .ht-drop-tile { top: 50%; transform: translate(-50%, -50%); }
.ht-drop-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.ht-drop-form label { display: grid; gap: .25rem; flex: 1 1 9rem; min-width: 0; }
.ht-drop-form input { box-sizing: border-box; width: 100%; min-height: 44px; font-size: 1.1rem; }
.ht-drop-form [data-drop-skip] { color: #184b36; background: #e7edd8; }
.ht-drop-feedback { min-height: 2lh; margin: .55rem 0 0; }
.ht-drop-missed { padding-inline-start: 1.25rem; }
.ht-drop-missed li { margin-block: .35rem; }
@media (prefers-reduced-motion: reduce) {
  .ht-drop-tile { top: 50%; transform: translate(-50%, -50%); }
}

.ht-weekly-summary { padding: 1rem; margin-block: .75rem; }
.ht-weekly-summary h2 { margin-block: 0 .5rem; color: var(--green); }
.ht-weekly-glyphs, .ht-weekly-results { padding: 0; list-style: none; }
.ht-weekly-glyphs { display: flex; flex-wrap: wrap; gap: .5rem; }
.ht-weekly-glyphs li, .ht-weekly-results li { padding: .4rem .6rem; border-radius: .5rem; background: #ede8d5; }
.ht-weekly-results li + li { margin-top: .4rem; }
.ht-weekly form { margin-block: 1rem; }
.ht-weekly fieldset { min-inline-size: 0; padding: 0; border: 0; }
.ht-weekly legend { font-weight: 700; overflow-wrap: anywhere; }
.ht-weekly .ht-button { min-height: 44px; }

.ht-classroom { padding: clamp(.85rem, 2vw, 1.5rem); margin-block: .75rem; }
.ht-classroom h2 { margin-block: 0 .55rem; }
.ht-classroom .ht-button { margin-block: .2rem; }
.ht-semester { max-width: 76rem; margin-inline: auto; }
.ht-semester label { display: grid; gap: .25rem; min-width: 0; }
.ht-semester input:not([type=checkbox]), .ht-semester select { width: 100%; min-height: 2.75rem; max-width: 100%; font: inherit; }
.ht-semester-fields, .ht-semester-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); align-items: end; gap: .55rem; }
.ht-semester-days { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-block: .65rem; }
.ht-semester-days label { display: flex; align-items: center; min-height: 2.25rem; }
.ht-semester fieldset { min-width: 0; margin-block: .8rem; border: 1px solid var(--edge); }
.ht-semester-rows { padding: 0; list-style: none; }
.ht-semester-row { padding: .65rem 0; border-block-end: 1px solid var(--edge); }
.ht-semester-row small { overflow-wrap: anywhere; }
.ht-class-material-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.ht-class-material img, .ht-class-material .ht-write-example { max-width: min(100%, 22rem); display: block; }
.ht-class-material p, .ht-class-material li { font-size: clamp(1rem, 2vw, 1.35rem); }

/* Desktop home keeps the original card grid and fits the reading action in the first view. */
.ht-student-classroom { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; padding: .45rem .9rem; margin: 0 0 .75rem; }
.ht-student-classroom h2 { font-size: 1rem; margin: 0; border-radius: .65rem; padding: .15rem .45rem; background: var(--soft); }
.ht-student-classroom p { margin: 0; }
.ht-student-classroom .ht-button { margin-block: 0; }
.ht-student-classroom [data-action="open"] { margin-inline-start: auto; }
@media (min-width: 901px) {
  .ht-home-top .ht-home-card, .ht-home-middle .ht-home-card { padding: .6rem .9rem; }
  .ht-today { min-height: 0; }
  .ht-today h2 { font-size: clamp(1.55rem, 2.8vw, 2.15rem); }
  .ht-today-content > p { margin: .22rem 0; }
  .ht-today-tiles { margin: .3rem 0 .42rem; }
  .ht-today-tiles li { max-height: 4rem; }
  .ht-today .ht-button { min-height: 44px; padding-block: .3rem; font-size: 1.17rem; line-height: 1.25; }
  .ht-home-reading .ht-home-sentence { padding-block: .42rem; margin-block: .45rem; }
  .ht-growth { gap: .4rem; }
  .ht-growth-top img { max-height: 7.5rem; }
  .ht-home-reading, .ht-home-writing { min-height: 0; }
  .ht-home-reading .ht-button { width: 100%; background: var(--green); color: var(--on-green); }
}
@media (max-width: 610px) {
  .ht-home-top, .ht-home-middle { display: contents; }
  .ht-home { display: flex; flex-direction: column; gap: .65rem; }
  .ht-home-heading, .ht-home .ht-student-classroom { margin-bottom: 0; }
  .ht-today-content > p { margin-block: .25rem; }
  .ht-today-tiles { margin-block: .35rem .55rem; }
  .ht-today-tiles li { max-height: 3.15rem; }
  .ht-home-reading { order: 1; }
  .ht-growth { order: 2; }
  .ht-home-writing, .ht-home-shortcuts, .ht-home > .ht-guide { order: 3; }
}

.ht-classroom-notice { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .5rem 1rem; margin-bottom: .75rem; border-radius: .75rem; background: var(--soft); color: var(--green); }
.ht-student-classroom [hidden] { display: none; }
.ht-staff-context { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-inline-start: auto; }
.ht-staff-context strong { padding: .3rem .65rem; border: 1px solid var(--edge); border-radius: .55rem; }
.ht-staff-nav { display: flex; flex-wrap: wrap; gap: .2rem .75rem; max-width: 76rem; margin: 0 auto 1rem; border-bottom: 1px solid var(--edge); }
.ht-staff-nav .ht-button { border: 0; border-bottom: .2rem solid transparent; border-radius: 0; background: transparent; color: var(--dark); min-height: 44px; }
.ht-staff-nav .ht-button[aria-current="page"] { border-bottom-color: var(--green); color: var(--green); }
.ht-staff-subnav { margin-bottom: 1.25rem; }
.ht-staff-today h1, #ht-semester-title { font-size: clamp(1.75rem, 3vw, 2.6rem); }
.ht-staff-range { margin-top: .5rem; }
.ht-staff-queue, .ht-staff-roster { list-style: none; padding: 0; margin: .6rem 0; }
.ht-staff-queue li, .ht-staff-roster li { display: flex; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; }
.ht-staff-queue li + li, .ht-staff-roster li + li { border-top: 1px solid var(--edge); }
.ht-staff-queue li span, .ht-staff-roster li span:last-child { text-align: end; }
.ht-staff-next { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.ht-staff-today-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
.ht-staff-today-grid .ht-classroom { margin-bottom: 0; }
.ht-staff-material-preview { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.ht-staff-material-preview img { width: clamp(6rem, 17vw, 11rem); aspect-ratio: 4 / 3; object-fit: cover; border-radius: .65rem; }
.ht-staff-queue strong { display: flex; flex-wrap: wrap; align-items: baseline; gap: .28rem .7rem; }
.ht-staff-queue b { font: 700 clamp(1.2rem, 2.8vw, 2.1rem)/1.15 var(--serif); }
.ht-staff-queue [data-current] { color: var(--green); font-weight: 800; }
.ht-staff-today-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.ht-staff-today-links .ht-button { background: transparent; color: var(--green); }
@media (min-width: 901px) {
  .ht-staff-today, body[data-hanja-screen="staff"] .ht-staff-nav { width: min(100%, 64rem); margin-inline: auto; }
  .ht-staff-next [data-action="semester-next"] { min-width: 13rem; }
}
.ht-staff-roster { max-height: 14rem; overflow: auto; }
.ht-semester-heading, .ht-semester-context { display: flex; flex-wrap: wrap; gap: .45rem .8rem; align-items: center; margin-bottom: .65rem; }
.ht-semester-heading { justify-content: space-between; }
.ht-semester-context select { width: auto; margin: 0; }
.ht-semester-context p { margin: 0; }
.ht-semester-row-locked { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.ht-coin-total { padding: .55rem .75rem; border-radius: .65rem; background: var(--soft); }
.ht-coin-total strong { font-size: 1.3em; }
.ht-semester-save { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .45rem; padding: .5rem; border-top: 1px solid var(--edge); background: var(--paper); }
.ht-semester-save:has(p:not([hidden])) { position: sticky; bottom: 0; z-index: 1; }
.ht-semester-save p { margin-inline-end: auto; }
.ht-dex-shelf .ht-dex-screen { max-width: none; }
.ht-dex-collection {
  --ht-dex-card-height: clamp(8.25rem, 22.9dvh, 13rem);
  --ht-dex-gap: clamp(.42rem, .85vw, .72rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ht-dex-gap);
  margin: .9rem 0;
  padding: 0;
  list-style: none;
}
.ht-dex-collection:focus-visible { outline: 3px solid #986018; outline-offset: .25rem; }
.ht-dex-card {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .15rem;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: var(--ht-dex-card-height);
  padding: 1.9rem .3rem .55rem;
  border: 1px solid var(--edge);
  border-radius: .95rem;
  background: #fcf8ed;
  color: var(--dark);
}
button.ht-dex-card:hover { border-color: #849877; }
.ht-dex-number, .ht-dex-today { position: absolute; inset-block-start: .45rem; font-weight: 750; }
.ht-dex-number { inset-inline-start: .6rem; color: var(--green); font-variant-numeric: tabular-nums; }
.ht-dex-today {
  inset-inline-end: .45rem;
  padding: .08rem .38rem;
  border-radius: 1rem;
  background: #ffda91;
  color: #523b1b;
  font-size: .72rem;
}
.ht-dex-stamp {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  inline-size: clamp(3.25rem, 12.8dvh, 7.45rem);
  max-inline-size: 85%;
  aspect-ratio: 1.13;
  color: var(--green);
  font: 400 clamp(2.35rem, 7.8dvh, 4.55rem)/1 var(--serif);
}
.ht-dex-stamp[data-stars]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: .9rem;
  background: var(--ht-dex-pigment);
  mask: url("/assets/hanja-tree/dex-pigment.webp") center / 100% 100% luminance no-repeat;
}
.ht-dex-stamp[data-pigment="0"] { --ht-dex-pigment: #f2e6cc; }
.ht-dex-stamp[data-pigment="1"] { --ht-dex-pigment: #e4edca; }
.ht-dex-stamp[data-pigment="2"] { --ht-dex-pigment: #d8e9b5; }
.ht-dex-stamp[data-pigment="3"] { --ht-dex-pigment: #cde7a1; }
.ht-dex-stamp[data-pigment="4"] { --ht-dex-pigment: #beda82; }
.ht-dex-stamp[data-pigment="5"] { --ht-dex-pigment: #a9d257; }
.ht-dex-reading { font-size: clamp(.88rem, 1.5vw, 1.24rem); font-weight: 700; }
.ht-dex-card .ht-stars { color: #396428; font-size: clamp(.79rem, 1.4vw, 1.2rem); letter-spacing: .08em; }
.ht-dex-undiscovered { align-content: center; gap: .6rem; }
.ht-dex-undiscovered .ht-dex-stamp {
  inline-size: clamp(3.05rem, 11.3dvh, 6.4rem);
  aspect-ratio: 1.08;
  border: 1px dashed #849168;
  border-radius: .9rem;
  color: #68764f;
}
.ht-dex-stamp svg { inline-size: 48%; }
@media (min-width: 520px) { .ht-dex-collection { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .ht-dex-collection { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 901px) {
  .ht-dex-shelf { grid-template-columns: minmax(9rem, 17.5vw) minmax(0, 1fr); gap: clamp(.75rem, 1.7vw, 1.45rem); }
  .ht-dex-shelf .ht-dex-screen { padding-block-start: clamp(.8rem, 2.4dvh, 1.45rem); }
  .ht-dex-collection {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-block-size: calc(3 * var(--ht-dex-card-height) + 2 * var(--ht-dex-gap));
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #a4ad91 transparent;
  }
  .ht-dex-collection button:focus-visible { outline-offset: -4px; }
}
@media (min-width: 1200px) and (min-height: 800px) {
  body:has(.ht-dex-shelf) .ht-student-top { padding-block: .7rem; }
  .ht-dex-shelf .ht-home-rail { gap: .9rem; padding-block-start: 2.1rem; }
  .ht-dex-shelf .ht-home-rail .ht-button { min-block-size: 4.45rem; font-size: 1.17rem; }
  .ht-dex-shelf .ht-dex-screen > p { font-size: 1.25rem; }
}
.ht-dex-dialog {
  inline-size: min(42rem, calc(100% - 1.5rem));
  max-block-size: calc(100dvh - 1.5rem);
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 1.15rem;
  color: var(--dark);
  background: var(--paper);
}
.ht-dex-dialog::backdrop { background: #1b2b2060; }
.ht-dex-dialog .ht-paper { border: 0; }
.ht-dex-close { justify-self: end; margin: 0; }
.ht-dex-error { color: #642612; }
.ht-dex-feature { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; }
.ht-dex-feature img, .ht-dex-feature .ht-writing-grid { width: clamp(4rem, 12vw, 8rem); }
.ht-dex-measures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .65rem; }
.ht-dex-measures > div { padding: .55rem .7rem; border: 1px solid var(--edge); border-radius: .6rem; }
.ht-dex-measures dt { font-weight: 800; }
.ht-dex-measures dd { margin: .2rem 0 0; }
.ht-weekly-staff > .ht-button { margin: .35rem 0 .75rem; }
@media (max-width: 610px) {
  .ht-staff-today-grid { grid-template-columns: minmax(0, 1fr); }
  .ht-semester-row-locked { grid-template-columns: minmax(0, 1fr); }
  .ht-dex-feature { grid-template-columns: auto 1fr; }
  .ht-dex-feature img { display: none; }
  .ht-weekly-staff .ht-table-wrap table { display: block; min-width: 0; }
  .ht-weekly-staff .ht-table-wrap thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .ht-weekly-staff .ht-table-wrap tbody, .ht-weekly-staff .ht-table-wrap tr { display: block; }
  .ht-weekly-staff .ht-table-wrap th, .ht-weekly-staff .ht-table-wrap td { display: flex; justify-content: space-between; gap: .5rem; }
  .ht-weekly-staff .ht-table-wrap td::before { content: attr(data-label); font-weight: 700; }
}

.ht-exam-stroke { display: block; width: clamp(4rem, 16vh, 8rem); aspect-ratio: 1; margin: .35rem 0; }
.ht-exam-form { display: grid; gap: 1rem; }
.ht-exam-form fieldset { min-inline-size: 0; }

.ht-unit-review-status {
  width: min(100%, 32rem);
  padding: .7rem .85rem;
  border: 1px solid var(--edge);
  border-radius: .9rem;
  background: #fcf7ea;
  text-align: left;
}
.ht-unit-review-status.is-blocked { border-color: #a0aa6f; }
.ht-unit-review-condition {
  padding: .45rem .65rem;
  border-radius: .55rem;
  color: var(--green);
  background: var(--soft);
  font-size: clamp(1.15rem, 3.4vw, 1.8rem);
  font-weight: 850;
  line-height: 1.38;
  word-break: keep-all;
}
.ht-unit-review-status dl { display: grid; gap: .25rem; margin: .55rem 0; }
.ht-unit-review-status dl div { display: flex; justify-content: space-between; gap: .55rem; }
.ht-unit-review-status dd { margin: 0; color: var(--green); font-weight: 850; text-align: right; }
.ht-unit-review-status [data-action="unit-review-start"] { margin-top: .4rem; }
#ht-main [data-unit-secondary] { color: var(--green); background: transparent; }
.ht-home-learn { display: grid; justify-items: start; gap: .6rem; }
.ht-map-review { padding: clamp(.8rem, 2vw, 1.4rem); display: grid; gap: .5rem; }
.ht-lesson-more summary { min-height: 44px; align-content: center; }
.ht-lesson-more .ht-dex-actions { justify-content: center; }
.ht-today.is-empty .ht-today-art { display: none; }
.ht-today.is-empty .ht-today-content { padding-inline: 0; }
.ht-today.is-empty { min-height: auto; }
