/* The Korean notebook (korean.html and full/korean-full.html) */

body {
  margin: 0;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
.pq-gap {
  display: inline-block;
  min-width: 2.6em;
  height: 1em;
  border-bottom: 2px solid var(--accent);
  margin: 0 0.3em;
  vertical-align: -0.15em;
}

/* Layout: a practice notebook. Two steps on top (what to study, how to practise); one work sheet built around the
   ruled practice square; study set and progress in a side column that drops below the sheet on phones.
   Light theme is the paper notebook, dark theme is the classroom blackboard. */
:root {
  --paper: #f6f2ea;
  --paper-line: #eae3d6;
  --surface: #fffdf9;
  --ink: #1d2528;
  --ink-2: #5c6466;
  --rule: #e0d8c9;
  --grid: #a9c4c9;
  --accent: #1e5f74;
  --on-accent: #ffffff;
  --mark: #f2c14e;
  --mark-ink: #1d2528;
  --mark-depth: 0.62em;
  --ok: #14734a;
  --ok-bg: #dcf1e5;
  --bad: #b4301f;
  --bad-bg: #fae2dd;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --f-kana: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
:root[data-theme="dark"] {
  --paper: #121615;
  --paper-line: #191d1c;
  --surface: #1d2322;
  --ink: #edeae3;
  --ink-2: #a8aba4;
  --rule: #323937;
  --grid: #44606a;
  --accent: #7dc6d6;
  --on-accent: #06262f;
  --mark: #e3b548;
  --mark-ink: #1f1a06;
  --mark-depth: 3px;
  --ok: #74d6a4;
  --ok-bg: #1d3a2c;
  --bad: #f2958c;
  --bad-bg: #442521;
  color-scheme: dark;
}
:root[data-font="gothic"] {
  --f-kana: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
:root[data-font="myeongjo"] {
  --f-kana: "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
}

* {
  box-sizing: border-box;
}
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--f-body);
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 28px 28px;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[lang="ko"] {
  font-family: var(--f-kana);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 16px;
  padding-block: 20px 56px;
  display: grid;
  gap: 20px;
}
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
}
h1 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  line-height: 1.1;
}
h1 [lang="ko"] {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
h1 small {
  font: 600 0.8rem/1 var(--f-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 3px;
  gap: 2px;
  max-width: 100%;
}
.seg button {
  padding: 6px 12px;
  border-radius: 5px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.seg button[aria-pressed="true"] {
  background: var(--mark);
  color: var(--mark-ink);
}

.navrow {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
}
.navlab {
  font: 600 0.72rem/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.navmain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  min-width: 0;
}
.subj {
  display: grid;
  /* one column per study button, however many there are */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
  flex: 1 1 26rem;
  max-width: 44rem;
  min-width: 0;
}
.subj button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-2);
  min-height: 46px;
  min-width: 0;
}
.subj button [lang="ko"] {
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.subj button:hover {
  border-color: var(--ink-2);
}
.subj button[aria-pressed="true"] {
  background: var(--mark);
  border-color: var(--mark);
}
.subj button[aria-pressed="true"],
.subj button[aria-pressed="true"] [lang="ko"] {
  color: var(--mark-ink);
}
.lvl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.lvl {
  flex-wrap: wrap;
}
.lvl select {
  display: none !important;
}
.lvd {
  position: relative;
}
.lvd-b {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  max-width: 100%;
  padding: 0 12px 0 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
}
.lvd-b small {
  font-weight: 500;
  color: var(--ink-2);
  font-size: 0.82rem;
}
.lvd-b svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--ink-2);
  transition: transform 0.15s;
}
.lvd.open .lvd-b {
  border-color: var(--accent);
}
.lvd.open .lvd-b svg {
  transform: rotate(180deg);
}
.lvd-b:focus-visible,
.lvd-i:focus-visible,
.lvd-all:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.lvd-m {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(340px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 6px;
}
.lvd-m[hidden] {
  display: none;
}
.lvd-i {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.lvd-i:hover {
  background: var(--paper);
}
.lvd-i b {
  font-weight: 600;
}
.lvd-i small {
  margin-left: auto;
  padding-left: 16px;
  color: var(--ink-2);
  font-size: 0.8rem;
  white-space: nowrap;
}
.lvd-i:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.lvd-x {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink-2);
  border-radius: 4px;
  flex: none;
  display: grid;
  place-items: center;
}
.lvd-i[aria-checked="true"] .lvd-x {
  background: var(--accent);
  border-color: var(--accent);
}
.lvd-i[aria-checked="true"] .lvd-x::after {
  content: "";
  width: 8px;
  height: 4px;
  border: 2px solid var(--on-accent);
  border-top: 0;
  border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}
.lvd-sep {
  height: 1px;
  background: var(--rule);
  margin: 6px 4px;
}
.lvd-all {
  display: block;
  width: calc(100% - 8px);
  margin: 2px 4px 4px;
  padding: 9px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.lvd-all:disabled {
  opacity: 0.5;
  cursor: default;
}
.lvd-no {
  animation: lvdno 0.3s;
}
@keyframes lvdno {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .lvd-no {
    animation: none;
  }
  .lvd-b svg {
    transition: none;
  }
}
.lvl select {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0 10px;
  min-height: 46px;
  cursor: pointer;
}
/* the Practise row sits close under the Study row */
.navrow + .navrow {
  margin-top: -10px;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, var(--bw, 7rem)));
  gap: 5px;
}
.tabs button {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 4px;
  font: 600 0.98rem/1.2 var(--f-display);
  color: var(--ink-2);
  min-width: 0;
  white-space: nowrap;
  /* as tall as the Study buttons above, so the two rows line up */
  min-height: 46px;
}
.tabs button:hover {
  border-color: var(--ink-2);
}
.tabs button[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.stack {
  display: grid;
  gap: 22px;
}
.full {
  width: 100%;
}
.tp-prompt {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: 100%;
}
.kans {
  display: grid;
  gap: 6px;
  justify-items: center;
}
.kans p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  justify-content: center;
}
.kans .sub {
  margin: 0;
}
.sq .mt {
  font: 600 1.2rem/1.25 var(--f-display);
  font-size: 9.5cqi;
  padding: 8%;
  text-align: center;
  text-wrap: balance;
}
.kword b {
  font-weight: inherit;
  color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  gap: 28px;
  align-items: start;
}
/* a reference page (a chart, the word list) takes the whole width, without the side column */
.layout.wide {
  grid-template-columns: minmax(0, 1fr);
}
.layout.wide .side {
  display: none;
}
.layout.wide .head p {
  max-width: 56rem;
}
/* a chart of four or five columns would only stretch its cells on a wide page: it keeps about the size it had */
.layout.wide .rows[style*="--c:4"],
.layout.wide .rows[style*="--c:5"] {
  max-width: 42rem;
}
.sheet {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 22px;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: flex-end;
  justify-content: space-between;
}
.head h2 {
  font: 700 1.35rem/1.2 var(--f-display);
  text-wrap: balance;
}
.head p {
  color: var(--ink-2);
  font-size: 0.92rem;
  max-width: 34rem;
}
.head-r {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

/* practice square: the ruled box from a kana workbook */
.sq {
  position: relative;
  width: min(100%, 14.5rem);
  aspect-ratio: 1;
  container-type: inline-size;
  border: 1.5px solid var(--grid);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, var(--grid) 50%, transparent 0) center/10px 1px repeat-x,
    linear-gradient(0deg, var(--grid) 50%, transparent 0) center/1px 10px repeat-y,
    var(--surface);
}
.sq .g {
  font-size: 9rem;
  font-size: 64cqi;
  line-height: 1;
  font-weight: 400;
}
.sq .g.two {
  font-size: 5.6rem;
  font-size: 42cqi;
  letter-spacing: -0.04em;
}
.sq .rm {
  font: 500 3rem/1 var(--f-mono);
  font-size: 24cqi;
}
.sq.sm {
  width: 7.5rem;
  flex: none;
}
.sq .corner {
  position: absolute;
  top: 6px;
  left: 8px;
  font: 500 0.72rem/1 var(--f-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.sq .under {
  position: absolute;
  bottom: 7%;
  left: 0;
  right: 0;
  text-align: center;
  font: 500 1.4rem/1 var(--f-mono);
  font-size: 11cqi;
  color: var(--accent);
}
.card {
  cursor: pointer;
}
.card.flipped .g {
  transform: translateY(-6%);
}

.drill {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 18px;
  width: 100%;
  max-width: 27rem;
  margin-inline: auto;
  text-align: center;
}
.ask {
  font-weight: 500;
  font-size: 1.05rem;
}
.ask .rm,
.rm-s,
.rm-m {
  font-family: var(--f-mono);
}
.ask .rm {
  font-size: 1.3rem;
  font-weight: 500;
  padding-inline: 4px;
  box-shadow: inset 0 calc(-1 * var(--mark-depth)) 0 var(--mark);
}
.meta {
  color: var(--ink-2);
  font-size: 0.88rem;
}
.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 42px;
}
.btn:hover {
  border-color: var(--ink-2);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn.good {
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-bg);
}
.btn.miss {
  border-color: var(--bad);
  color: var(--bad);
  background: var(--bad-bg);
}
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}
kbd {
  font: 500 0.72rem/1 var(--f-mono);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 2px 5px;
  opacity: 0.6;
}
.lnk {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0 3px;
  font-size: 1.15em;
}

.opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.opt {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  min-height: 4.2rem;
  padding: 10px;
  font: 500 1.35rem/1.1 var(--f-mono);
}
.opt[lang="ko"] {
  font: 400 2.3rem/1.1 var(--f-kana);
}
.opt kbd {
  position: absolute;
  top: 6px;
  left: 7px;
}
.opt {
  padding-left: 28px;
  padding-right: 28px;
  overflow-wrap: anywhere;
}
@media (hover: none) and (pointer: coarse) {
  .opt kbd {
    display: none;
  }
  .opt {
    padding-left: 10px;
    padding-right: 10px;
  }
}
.opt:hover:not(:disabled) {
  border-color: var(--accent);
}
.opt:disabled {
  cursor: default;
}
.opt.right {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: var(--ok);
}
.opt.wrong {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: var(--bad);
}
.opt.dim {
  opacity: 0.45;
}

.fb {
  min-height: 2.9rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 500;
}
.fb.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.fb.no {
  background: var(--bad-bg);
  color: var(--bad);
}
.fb .m {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 700;
}
.fb [lang="ko"] {
  font-size: 1.25em;
}

.tform {
  display: flex;
  gap: 8px;
  width: 100%;
}
.tform input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 14px;
  font: 500 1.25rem/1.2 var(--f-mono);
  text-align: center;
}
.tform input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.tform input.ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.tform input.no {
  border-color: var(--bad);
  background: var(--bad-bg);
}

.word {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: 100%;
}
.word .u {
  flex: 0 1 4.6rem;
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: center;
}
.word .sq {
  width: 100%;
}
.word .ur {
  font: 500 0.95rem/1 var(--f-mono);
  color: var(--accent);
  min-height: 1em;
}
.mean {
  font: 600 1.1rem/1.3 var(--f-display);
}

.pad .g {
  position: absolute;
  color: var(--grid);
  user-select: none;
  pointer-events: none;
}
.pad.noguide .g {
  visibility: hidden;
}
.pad svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.pad path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sq.pad {
  width: min(100%, 19rem);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding-block: 36px;
  color: var(--ink-2);
}
.empty b {
  font: 700 1.15rem/1.3 var(--f-display);
  color: var(--ink);
}

/* chart */
.tag {
  font: 600 0.72rem/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.grp {
  display: grid;
  gap: 10px;
}
.grp h3 {
  font: 700 1rem/1.2 var(--f-display);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.grp h3 small {
  font: 400 0.85rem/1.2 var(--f-body);
  color: var(--ink-2);
}
.rows {
  display: grid;
  gap: 5px;
}
.krow {
  display: grid;
  grid-template-columns: 2.7rem repeat(5, minmax(0, 1fr));
  gap: 5px;
  align-items: stretch;
}
.krow.head span {
  text-align: center;
  font: 500 0.8rem/1 var(--f-mono);
  color: var(--ink-2);
}
/* the row's name at the start of each chart row */
.rowlab {
  display: grid;
  place-items: center;
  font: 500 0.85rem/1 var(--f-mono);
  border: 1px solid var(--mark);
  border-radius: 6px;
  background: var(--mark);
  color: var(--mark-ink);
}
.cell {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 2px 5px;
  display: grid;
  gap: 3px;
  justify-items: center;
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}
.cell.gap {
  border-style: dashed;
  opacity: 0.5;
}
.gs {
  display: flex;
  justify-content: center;
  gap: 1px;
  flex-wrap: wrap;
}
.gl {
  font-size: clamp(1.35rem, 5.2vw, 2rem);
  line-height: 1.15;
  padding: 0 4px 5px;
  border-radius: 5px;
  display: grid;
  justify-items: center;
  gap: 3px;
  white-space: nowrap;
}
@media (hover: hover) {
  .gl:hover {
    background: var(--surface);
  }
}
.gl.sel {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  background: var(--surface);
  color: var(--ink);
}
.pip {
  display: block;
  width: 1.1rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ok) calc(var(--n) * 33.4%), var(--rule) 0);
}
.rom {
  font: 400 0.74rem/1 var(--f-mono);
}

/* side column */
.side {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.side section {
  display: grid;
  gap: 10px;
}
.side h2 {
  font: 700 1rem/1.2 var(--f-display);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.side h2 small {
  font: 500 0.82rem/1 var(--f-mono);
  color: var(--ink-2);
}
.side section + section {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}
.sub {
  font: 600 0.72rem/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 4px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chip {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  padding: 4px 8px;
  font: 500 0.8rem/1.3 var(--f-mono);
  color: var(--ink-2);
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
}
.chip [lang="ko"] {
  font-size: 1.05rem;
  color: var(--ink);
}
.chip[aria-pressed="true"] {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--mark-ink);
}
.chip[aria-pressed="true"] [lang="ko"] {
  color: var(--mark-ink);
}
.mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mini button {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--surface);
}
.mini button:hover {
  border-color: var(--ink-2);
}
.bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--rule);
}
.bar i {
  display: block;
}
.legend {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.legend b {
  display: block;
  font: 500 1.25rem/1.2 var(--f-mono);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  background: var(--rule);
}
.legend .l1::before {
  background: var(--mark);
}

/* stroke order diagrams */
.kvg {
  display: block;
}
.sq .kvg {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
}
.kvg path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kvg text {
  font: 500 6.5px var(--f-mono);
  fill: var(--accent);
}
.kvg.faint path {
  stroke: var(--grid);
}
.kvg.faint text {
  fill: var(--ink-2);
}
.kvg.guide path {
  stroke: var(--accent);
  opacity: 0.5;
}
@media (prefers-reduced-motion: no-preference) {
  /* each stroke at one steady speed: js/shared/strokes.js sets when it starts (--t) and how long it takes (--d) from
     its length; the even rhythm below is only for a drawing it has not timed */
  .kvg.play path {
    stroke-dasharray: 1 3;
    stroke-dashoffset: 1.05;
    animation: kdraw var(--d, 0.5s) ease-in-out forwards;
    animation-delay: var(--t, calc(var(--i) * 0.62s));
  }
  .kvg.play text {
    opacity: 0;
    animation: kshow 0.1s linear forwards;
    animation-delay: var(--t, calc(var(--i) * 0.62s));
  }
}
@keyframes kdraw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes kshow {
  to {
    opacity: 1;
  }
}
.kvg.pen {
  overflow: visible;
}
.kvg.pen path {
  stroke-width: 8;
}
.kvg.pen path.pg {
  stroke: var(--grid);
  opacity: 1;
}
.kvg.pen path.pi {
  stroke: var(--ink);
}
.kvg.pen.faint path.pi {
  stroke: var(--grid);
}
.kvg.pen.guide:not(.play) path.pi {
  stroke: var(--accent);
  opacity: 0.5;
}
.kvg.pen.play path.pg {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}
.kvg.pen.play path.pi {
  opacity: 1;
}
.kvg.pen text.n {
  text-anchor: middle;
  dominant-baseline: central;
  font-size: 7.6px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 1.5px;
  stroke-linejoin: round;
}
.pad .so {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pad.noguide .so {
  visibility: hidden;
}
.pad.hasso .g {
  visibility: hidden;
}

/* kanji */
.kgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 6px;
}
.kt {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 8px 3px 7px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  background: var(--paper);
  min-width: 0;
}
.kt [lang="ko"] {
  font-size: 2rem;
  line-height: 1.15;
}
.kt small {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--ink-2);
  text-align: center;
  overflow-wrap: anywhere;
}
@media (hover: hover) {
  .kt:hover {
    border-color: var(--accent);
  }
}
.kt.off {
  background: none;
}
.kd {
  display: grid;
  gap: 22px;
}
.kd-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}
.kd-nav .btn {
  min-height: 38px;
  padding: 6px 12px;
}
.kd-top {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.kd-fig {
  display: grid;
  gap: 10px;
  justify-items: center;
}
.kd-fig .sq {
  width: 100%;
}
.kd-info {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.kd-mean {
  font: 700 1.55rem/1.2 var(--f-display);
  text-wrap: balance;
}
.rd {
  display: grid;
  gap: 6px;
  margin: 0;
}
.rd dt {
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 6px;
}
.rd dt small {
  font-weight: 400;
  color: var(--ink-2);
  font-size: 0.84rem;
}
.rd dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: baseline;
}
.rm-s {
  font-size: 0.86rem;
  color: var(--ink-2);
}
.hint {
  background: var(--paper);
  border-radius: 8px;
  padding: 10px 14px;
  display: grid;
  gap: 4px;
}
.hint .sub {
  margin: 0;
}
.wl {
  border-top: 1px solid var(--rule);
}
.wr {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.wr .w {
  font-size: 1.55rem;
  line-height: 1.2;
  white-space: nowrap;
}
.wr .w b {
  font-weight: inherit;
  color: var(--accent);
}
.wd {
  min-width: 0;
  line-height: 1.35;
}
.btn.ic {
  padding: 8px;
  min-height: 38px;
  min-width: 38px;
  justify-content: center;
}
.kword {
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  line-height: 1.15;
}
.hl {
  padding-inline: 4px;
  font-weight: 600;
  box-shadow: inset 0 calc(-1 * var(--mark-depth)) 0 var(--mark);
}
.opt.txt {
  font: 500 1rem/1.25 var(--f-body);
}
.chip span.n {
  opacity: 0.7;
}
.by-credits {
  color: inherit;
}
@media (max-width: 640px) {
  .kd-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .kd-fig .sq {
    width: min(100%, 15rem);
  }
}

/* up to a tablet held sideways (1100px) the study set and progress go under the card, which takes the whole width,
   so the study and practise buttons above line up with it and keep room for their labels */
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .navrow {
    grid-template-columns: minmax(0, 1fr);
  }
  .subj {
    flex-basis: 100%;
    max-width: none;
  }
  .subj button {
    flex-direction: column;
    gap: 4px;
    /* the largest text sizes on a narrow phone: no bigger than fits the button (Grammar, Syllables) */
    font-size: min(0.78rem, 3.9vw);
    padding: 7px 2px 6px;
  }
  .tabs button {
    min-height: 0;
    /* the largest text sizes on a narrow phone: no bigger than fits the button (Radicals, Look-alikes) */
    font-size: min(0.84rem, 4.6vw);
    padding: 10px 1px;
  }
}
@media (max-width: 480px) {
  .seg button {
    padding: 6px 9px;
    font-size: 0.85rem;
  }
  .sheet {
    padding: 16px 12px;
  }
  h1 [lang="ko"] {
    font-size: 1.7rem;
  }
  .krow {
    gap: 3px;
  }
  .krow {
    grid-template-columns: 2.2rem repeat(5, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .opt,
  .chip,
  .gl {
    transition:
      border-color 0.12s,
      background-color 0.12s;
  }
}
.sheet {
  scroll-margin-top: 5.5rem;
}
.subj button,
.tabs button,
.pad {
  user-select: none;
  -webkit-user-select: none;
}
/* grammar */
.ex {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 54px 10px 14px;
  background: var(--paper);
  border-radius: 8px;
  text-align: left;
  min-width: 0;
}
.ex-j {
  font-size: 1.35rem;
  line-height: 1.5;
}
.ex.big .ex-j {
  font-size: 1.6rem;
}
.pt {
  color: var(--accent);
  font-weight: inherit;
}
.pt.fill {
  background: var(--mark);
  color: var(--mark-ink);
  border-radius: 3px;
  padding-inline: 3px;
}
.blank {
  display: inline-block;
  width: 1.7em;
  height: 1.1em;
  vertical-align: -0.15em;
  border-bottom: 2px solid var(--accent);
  margin-inline: 3px;
}
.ex-r {
  font-size: 0.9rem;
  color: var(--ink-2);
}
.ex-e {
  font-size: 0.96rem;
}
.ex .btn.ic {
  position: absolute;
  top: 8px;
  right: 8px;
}
.lesson {
  display: grid;
  gap: 14px;
  max-width: 46rem;
  min-width: 0;
}
.lesson h3 {
  font: 700 1.4rem/1.25 var(--f-display);
  text-wrap: balance;
}
.lesson h4 {
  font: 700 1.08rem/1.3 var(--f-display);
  margin: 10px 0 0;
}
.lesson p {
  max-width: 68ch;
}
.pat {
  border: 1.5px solid var(--grid);
  border-radius: 6px;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 1.05rem;
}
.pat [lang="ko"] {
  font-size: 1.2em;
  color: var(--accent);
}
.tw {
  overflow-x: auto;
}
.gt {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
.gt th,
.gt td {
  border: 1px solid var(--rule);
  padding: 7px 10px;
  text-align: left;
  vertical-align: middle;
}
.gt th {
  background: var(--paper);
  font-weight: 600;
  font-size: 0.86rem;
}
.jw [lang="ko"] {
  font-size: 1.12em;
}
.llist {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.lrow {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}
.lrow:hover {
  border-color: var(--accent);
}
.lrow .n {
  font: 500 0.92rem/1 var(--f-mono);
  color: var(--ink-2);
}
.lrow b {
  display: block;
  font: 700 1.02rem/1.3 var(--f-display);
}
.lrow small {
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.35;
  display: block;
}
.lrow .done {
  color: var(--ok);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
.pcard {
  position: relative;
  width: 100%;
  min-height: 10rem;
  border: 1.5px solid var(--grid);
  border-radius: 8px;
  background: var(--surface);
  padding: 30px 16px 22px;
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  cursor: pointer;
}
.pcard .corner {
  position: absolute;
  top: 8px;
  left: 10px;
  font: 500 0.72rem/1 var(--f-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.pcard .pj {
  font-size: 1.75rem;
  line-height: 1.4;
}
.tlnk {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: left;
}
.bar .b3 {
  background: var(--ok);
}
.legend {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.legend .l3::before {
  background: var(--ok);
}
.pip {
  background: linear-gradient(to right, var(--pc, var(--ok)) calc(var(--n) * 16.67%), var(--rule) 0);
}
.pip.due {
  --pc: var(--accent);
}
.fb small {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 2px;
}

.byline {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.byline b {
  font: 700 1.05rem/1 var(--f-display);
  color: var(--ink);
  letter-spacing: 0;
}
.vcat {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.vcat summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.vcat summary::-webkit-details-marker {
  display: none;
}
.vcat .vn {
  font: 600 1.02rem/1.2 var(--f-display);
}
.vcat .vc {
  font: 500 0.84rem/1 var(--f-mono);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.vcat .vc.done {
  color: var(--ok);
}
.vcat summary .bar {
  grid-column: 1/-1;
  height: 6px;
}
.vt {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: start;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px 10px 9px;
  min-width: 0;
}
.vt .k {
  font-size: 1.3rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  padding-right: 1.6rem;
}
.vt .m {
  font-size: 0.86rem;
  line-height: 1.3;
}
.vt .vx {
  position: absolute;
  top: 7px;
  right: 8px;
  font: 500 0.72rem/1 var(--f-mono);
  color: var(--bad);
}
.vt.lock {
  border-style: dashed;
  background: none;
  color: var(--ink-2);
  font-size: 0.86rem;
  place-content: center;
  text-align: center;
  min-height: 4.6rem;
}

.zoom {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 16, 14, 0.55);
  overscroll-behavior: contain;
}
.zcard {
  width: min(100%, 24rem);
  max-height: 100%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px 16px 18px;
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  outline: none;
}
.zoom.in {
  animation: zfade 0.2s ease-out;
}
.zoom.in .zcard {
  animation: zin 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes zfade {
  from {
    background: rgba(10, 16, 14, 0);
  }
}
@keyframes zin {
  from {
    transform: translate(var(--dx), var(--dy)) scale(0.16);
    opacity: 0.4;
  }
}
@media (prefers-reduced-motion: reduce) {
  .zoom.in,
  .zoom.in .zcard {
    animation: none;
  }
}
.zbar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.znav:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}
.zfig {
  display: grid;
  grid-template-columns: auto minmax(0, 13rem) auto;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.zfig .sq {
  width: 100%;
}
.znav {
  font-size: 1.9rem;
  line-height: 1;
  width: 2.6rem;
  height: 3.6rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-2);
}
.zr .rm {
  font: 500 2.3rem/1 var(--f-mono);
}
.zcard .meta {
  max-width: 20rem;
}
.zcard .acts {
  margin-top: 6px;
}

.rankbox {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--rc, var(--rule));
  border-radius: 8px;
  background: var(--surface);
}
.rankbox span {
  font: 600 0.72rem/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.rankbox b {
  font: 700 1.6rem/1.15 var(--f-display);
}
.rankbox small {
  font-size: 0.86rem;
  color: var(--ink-2);
}
.rankbox.r1,
.bar .r1,
.legend .r1 {
  --rc: var(--mark);
}
.rankbox.r2,
.bar .r2,
.legend .r2 {
  --rc: #e8964a;
}
.rankbox.r3,
.bar .r3,
.legend .r3 {
  --rc: var(--accent);
}
.rankbox.r4,
.bar .r4,
.legend .r4 {
  --rc: var(--ok);
}
.bar .r1,
.bar .r2,
.bar .r3,
.bar .r4 {
  background: var(--rc);
}
.legend.rk {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
}
.legend.rk span::before {
  background: var(--rc, var(--rule));
}

.cmp {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}
.cmp figure {
  margin: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.cmp .sq {
  width: 100%;
}
.cmp figcaption {
  font-size: 0.86rem;
  color: var(--ink-2);
}
.pad.mine {
  display: grid;
  place-items: center;
}
.pad.mine svg {
  pointer-events: none;
}
.pad .corner {
  z-index: 1;
}

.kt.back {
  outline: 3px solid var(--mark);
  outline-offset: 2px;
  transition: outline-color 1s;
}

.find {
  width: 100%;
  max-width: 24rem;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 12px;
  font: inherit;
  color: inherit;
}
.find:focus {
  outline: none;
  border-color: var(--accent);
}

.rl {
  --rc: currentColor;
  color: var(--rc);
  text-decoration: underline 2px var(--rc);
  text-underline-offset: 5px;
  text-decoration-skip-ink: none;
}
.r-s {
  --rc: #7b3fa8;
}
.r-o {
  --rc: #0e7378;
}
.r-t {
  --rc: #b05a07;
}
.r-p {
  --rc: #a12e64;
}
.r-w {
  --rc: #56701a;
}
.r-m {
  --rc: #6e5a34;
}
:root[data-theme="dark"] .r-s {
  --rc: #d3a6f0;
}
:root[data-theme="dark"] .r-o {
  --rc: #6fd3d8;
}
:root[data-theme="dark"] .r-t {
  --rc: #f2b26b;
}
:root[data-theme="dark"] .r-p {
  --rc: #f09ac6;
}
:root[data-theme="dark"] .r-w {
  --rc: #c2db82;
}
:root[data-theme="dark"] .r-m {
  --rc: #d9c49c;
}
.pq .ex-j {
  line-height: 2.3;
}
.pq ruby rt {
  font-size: 0.45em;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.pq .ex-e {
  font-size: 1.02rem;
}
.rlegend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 6px 0 0;
  font-size: 0.84rem;
}

.pq .tk,
.pq .pt {
  white-space: nowrap;
}
.pq .ex-j {
  line-height: 2.15;
}

.pq .rl,
.rlegend .rl {
  color: inherit;
  text-decoration: none;
  background: var(--rc);
  border-radius: 5px;
  padding: 1px 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.pq .ex-e .rl {
  padding: 0 3px;
}
.r-s {
  --rc: #e6d5f8;
}
.r-o {
  --rc: #cdefe3;
}
.r-v {
  --rc: #d3e5ff;
}
.r-a {
  --rc: #e6f4c4;
}
.r-t {
  --rc: #ffddbf;
}
.r-p {
  --rc: #fad1e3;
}
.r-w {
  --rc: #f1e2c6;
}
.r-m {
  --rc: #e2e2e2;
}
:root[data-theme="dark"] .r-s {
  --rc: #4a3566;
}
:root[data-theme="dark"] .r-o {
  --rc: #1f4a3d;
}
:root[data-theme="dark"] .r-v {
  --rc: #23395c;
}
:root[data-theme="dark"] .r-a {
  --rc: #3b4a1e;
}
:root[data-theme="dark"] .r-t {
  --rc: #5a3a1c;
}
:root[data-theme="dark"] .r-p {
  --rc: #5a2440;
}
:root[data-theme="dark"] .r-w {
  --rc: #4a3e2a;
}
:root[data-theme="dark"] .r-m {
  --rc: #3a3a3a;
}
.rlegend {
  gap: 6px 8px;
}
.rt {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 8px 4px 7px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--pc);
  color: var(--ink);
  font: inherit;
}
@media (hover: hover) {
  .rt:hover {
    border-color: var(--ink-2);
  }
}
.rt.back {
  outline: 3px solid var(--mark);
  outline-offset: 2px;
}
.rt small {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--ink-2);
  text-align: center;
  overflow-wrap: anywhere;
}
.rt .rc {
  position: absolute;
  top: 4px;
  right: 6px;
  font: 500 0.68rem/1 var(--f-mono);
  font-style: normal;
  color: var(--ink-2);
}
.rp {
  display: flex;
  align-items: center;
  gap: 7px;
}
.rp small {
  color: var(--ink-2);
}
svg.pos {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
}
svg.pos > * {
  fill: var(--pc);
  stroke: var(--ink-2);
  stroke-width: 0.8;
}

.sq.wide {
  aspect-ratio: var(--n) / 1;
  width: min(100%, calc(var(--n) * 9.5rem));
}
.cmp.wide {
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(var(--n) * 9.5rem);
}
.sq .gw {
  font-size: calc(60cqi / var(--n, 1));
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
}
.pad .gw {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.pad.hasso .gw {
  visibility: hidden;
}
.so.row {
  display: flex;
}
.so.row .so1 {
  position: relative;
  flex: 1;
}
.so.row .so1 .kvg {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
}

/* ---------- Korean ---------- */
.subj {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 36rem;
}
.krow {
  grid-template-columns: 2.7rem repeat(var(--c, 5), minmax(0, 1fr));
}
.rows[style*="--c:10"] .gl {
  font-size: clamp(1rem, 3.3vw, 1.45rem);
  padding: 0 1px 4px;
}
.rows[style*="--c:7"] .gl {
  font-size: clamp(1.1rem, 4.2vw, 1.7rem);
  padding: 0 2px 4px;
}
.rows[style*="--c:10"] .rom,
.rows[style*="--c:7"] .rom {
  font-size: 0.6rem;
}
.rows[style*="--c:10"] .cell {
  padding: 5px 0 4px;
}
.krow.head span[lang="ko"] {
  font: 400 1rem/1 var(--f-kana);
  color: var(--ink-2);
}
.rowlab[lang="ko"] {
  font: 400 1.15rem/1 var(--f-kana);
}
.wgrid {
  grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr));
}
.wgrid .kt {
  overflow: hidden;
  padding-inline: 5px;
}
.wgrid .kt span {
  font-size: 1.25rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.wgrid .kt small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  width: 100%;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.kword.big {
  font-size: 2.6rem;
  line-height: 1.2;
  text-align: center;
  margin: 0;
}
.kd-r {
  text-align: center;
  color: var(--ink-2);
  margin: 0;
}
.kd-fig {
  display: grid;
  gap: 10px;
  justify-items: center;
  align-content: start;
}
.opt.wko {
  font: 400 1.45rem/1.2 var(--f-kana);
}
.sq .g {
  font-size: 9rem;
  font-size: 62cqi;
}
@media (max-width: 480px) {
  .krow {
    grid-template-columns: 2.2rem repeat(var(--c, 5), minmax(0, 1fr));
  }
  .rows[style*="--c:10"] .krow {
    gap: 2px;
    grid-template-columns: 1.7rem repeat(10, minmax(0, 1fr));
  }
  .rows[style*="--c:10"] .rom {
    font-size: 0.5rem;
    letter-spacing: -0.03em;
  }
  .rows[style*="--c:10"] .rowlab {
    font-size: 0.95rem;
  }
}

/* ---------- practice tabs on narrow phones: 5 or 6 tabs go in two rows of 3, 7 tabs in rows of 4 and 3 ---------- */
@media (max-width: 420px) {
  .tabs[style*="--n: 5"],
  .tabs[style*="--n: 6"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tabs[style*="--n: 7"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 340px) {
  .tabs[style*="--n: 4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* radical tiles: a radical with 2 or 3 variant shapes fits its tile on a phone */
/* ---------- site bar: brand, study-language menu, and the menu for the language of the explanations ---------- */
.sitebar {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: relative;
  z-index: 30;
}
.sb-in {
  max-width: 70rem;
  margin-inline: auto;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font: 700 1.02rem/1.1 var(--f-display);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.sb-mark {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 1.05rem/1 var(--f-body);
}
.sb-nav {
  display: flex;
  gap: 6px;
  flex: none;
}
.sb-dd {
  position: relative;
}
.sb-dd summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  font: 600 0.9rem/1 var(--f-body);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.sb-dd summary::-webkit-details-marker {
  display: none;
}
.sb-dd summary:hover,
.sb-dd[open] summary {
  border-color: var(--ink-2);
}
.sb-c {
  font-size: 0.7rem;
  color: var(--ink-2);
  transition: transform 0.12s;
}
.sb-dd[open] .sb-c {
  transform: rotate(180deg);
}
.flag {
  flex: none;
  width: 24px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--rule);
}
.flag.globe {
  box-shadow: none;
  color: var(--ink-2);
}
.sb-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}
.sb-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 14.5rem;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(10, 16, 14, 0.18);
  display: grid;
  gap: 2px;
}
.sb-h {
  margin: 0;
  padding: 6px 8px 4px;
  font: 600 0.7rem/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.sb-i {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}
.sb-i small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ink-2);
  margin-top: 1px;
}
a.sb-i:hover {
  background: var(--paper);
}
.sb-i.cur {
  background: var(--paper);
}
button.sb-i {
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: 0;
  background: none;
  cursor: pointer;
}
button.sb-i:hover {
  background: var(--paper);
}
.sb-i:not(.cur) .sb-tick {
  visibility: hidden;
}
.sb-tick {
  color: var(--ok, #14734a);
  font-size: 0.9rem;
}
.sw {
  display: inline-flex;
  flex: none;
}
.sw i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--surface);
  margin-left: -4px;
}
.sw i:first-child {
  margin-left: 0;
  box-shadow: 0 0 0 1px var(--rule);
}
@media (max-width: 30rem) {
  .sb-brand > span:last-child {
    display: none;
  }
  .sb-nav {
    gap: 5px;
  }
}
.sb-sep {
  height: 1px;
  background: var(--rule);
  margin: 4px 2px;
}
@media (max-width: 30rem) {
  .sb-brand {
    font-size: 0.95rem;
  }
  .sb-dd summary {
    padding: 0 8px;
    gap: 6px;
  }
}
/* small screens: the menus open under the whole bar, inside the screen, instead of hanging off the button */
@media (max-width: 26rem) {
  .sb-name {
    display: none;
  }
  .sb-in {
    padding-inline: 12px;
    gap: 6px;
  }
}
@media (max-width: 40rem) {
  .sb-dd {
    position: static;
  }
  .sb-menu {
    left: 12px;
    right: 12px;
    top: calc(100% + 4px);
    min-width: 0;
  }
}
/* moving between the home page and a language fades one page out and the next one in */
html {
  background: var(--paper);
  scrollbar-gutter: stable;
}
body {
  animation: nbPageIn 0.38s ease-out both;
}
body.nb-leaving {
  opacity: 0;
  transition: opacity 0.22s ease-in;
}
@keyframes nbPageIn {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
  body.nb-leaving {
    transition: none;
  }
}
/* menus fade and slide in, and fade out again when the pointer leaves */
.sb-dd summary {
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.sb-dd summary:hover,
.sb-dd[open] summary {
  background: var(--surface);
}
.sb-dd[open] .sb-menu {
  animation: sbIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sbIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}
.sb-i {
  transition: background-color 0.12s;
}
.sb-c {
  transition: transform 0.18s;
}
@media (prefers-reduced-motion: reduce) {
  .sb-c,
  .sb-dd summary,
  .sb-i {
    transition: none;
  }
  .sb-dd[open] .sb-menu {
    animation: none;
  }
}
/* ---------- account button, log in and unlock dialogs, and locked parts ---------- */
.sb-acct summary {
  gap: 6px;
}
.acct-ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.acct-dlg {
  width: min(26rem, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 26px 24px 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(10, 16, 30, 0.28);
  font-family: var(--f-body);
}
.acct-dlg::backdrop {
  background: rgba(12, 18, 30, 0.45);
}
.acct-dlg h2 {
  margin: 0 0 10px;
  font: 700 1.35rem/1.2 var(--f-display);
  padding-right: 28px;
}
.acct-dlg p {
  margin: 0 0 12px;
}
.acct-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.acct-x:hover {
  background: var(--paper);
}
.acct-dlg .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font: 600 1rem/1 var(--f-body);
  cursor: pointer;
}
.acct-dlg .btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}
.acct-dlg .btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.acct-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  background: var(--surface);
}
.acct-google:hover {
  border-color: var(--ink-2);
}
.acct-google svg {
  width: 20px;
  height: 20px;
}
.acct-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 0.85rem;
  margin: 14px 0 !important;
}
.acct-or::before,
.acct-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}
.acct-form {
  display: grid;
  gap: 10px;
}
.acct-form label {
  display: grid;
  gap: 4px;
  font-weight: 600;
  font-size: 0.92rem;
}
.acct-form input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem var(--f-body);
}
.acct-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.acct-hint,
.acct-note {
  font-size: 0.88rem;
  color: var(--ink-2);
}
.acct-err {
  color: #b3261e;
  font-size: 0.92rem;
}
.acct-err:empty {
  display: none;
}
.acct-switch {
  margin: 16px 0 0 !important;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.acct-switch button {
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 0.92rem var(--f-body);
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}
.acct-list {
  margin: 0 0 16px;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}
.acct-test {
  font-size: 0.85rem;
  background: var(--mark, #ffe066);
  color: var(--mark-ink, #1b2442);
  padding: 6px 10px;
  border-radius: 8px;
}
:root[data-theme="dark"] .acct-err {
  color: #ff8a80;
}
/* locked parts of the free version */
.locked {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 28px 18px;
  border: 1.5px dashed var(--rule);
  border-radius: 12px;
  background: var(--paper);
  margin: 8px 0;
}
.locked .lk-t {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.locked .meta {
  margin: 0 0 6px;
  max-width: 30rem;
}
.locked .btn {
  width: auto;
}
.lk-svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lk .lk-svg {
  width: 18px;
  height: 18px;
}
.lockchip {
  opacity: 0.8;
}
.lockchip .lk-svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
}
.lockgrp h3 {
  margin-bottom: 8px;
}
/* ---------- the person button and its menu ---------- */
.sb-acct summary {
  padding: 0 6px 0 6px;
  min-width: 40px;
  justify-content: center;
}
.sb-acct summary .acct-face {
  width: 28px;
  height: 28px;
}
.acct-face {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--paper);
}
.acct-ini {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-family: var(--f-body);
}
.sb-acct .sb-menu {
  min-width: 16rem;
}
.sb-acct .sb-i {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.sb-acct .sb-i .acct-ic {
  color: var(--ink-2);
}
/* ---------- panels: back button, settings, account ---------- */
.acct-bk {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: 600 0.9rem/1 var(--f-body);
  padding: 8px 8px 8px 2px;
  border-radius: 8px;
  cursor: pointer;
}
.acct-bk:hover {
  color: var(--ink);
  background: var(--paper);
}
.acct-bk svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.acct-dlg:has(.acct-bk) {
  padding-top: 52px;
}
.acct-sec {
  margin: 14px 0 8px !important;
  font: 600 0.7rem/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.acct-grp {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.acct-lab {
  font-weight: 600;
  font-size: 0.92rem;
}
.acct-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
}
.acct-seg button {
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font: 500 0.9rem/1 var(--f-body);
  padding: 9px 0;
  cursor: pointer;
}
.acct-seg button[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  font-weight: 700;
}
.acct-pals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.acct-pals button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 500 0.85rem/1.25 var(--f-body);
  padding: 9px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.acct-pals button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.acct-pals .sw i {
  width: 12px;
  height: 12px;
}
.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
}
.acct-row b {
  font-size: 0.95rem;
}
.acct-row small {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-2);
  margin-top: 2px;
}
.acct-sw {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  border: 0;
  background: #c3c9d4;
  cursor: pointer;
  flex: none;
  transition: background 0.2s;
}
.acct-sw i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.acct-sw.on {
  background: var(--accent);
}
.acct-sw.on i {
  transform: translateX(18px);
}
/* furigana switched off in Profile → Learning: the kanji stay, the small kana above them go */
html[data-furi="off"] ruby rt {
  display: none;
}
.acct-sw:focus-visible,
.acct-seg button:focus-visible,
.acct-pals button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.acct-foot {
  margin-top: 12px !important;
}
.acct-pic {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.acct-pic > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.acct-lnk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 3px 0;
  color: var(--accent);
  font: 600 0.9rem/1.2 var(--f-body);
  cursor: pointer;
  text-decoration: none;
}
.acct-lnk.mute {
  color: var(--ink-2);
  font-weight: 500;
}
.acct-lnk .acct-ic {
  width: 16px;
  height: 16px;
}
.acct-fld {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.acct-fld > span {
  font-weight: 600;
}
.acct-fld input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem var(--f-body);
}
.acct-val {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--paper);
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.acct-val b {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.acct-g svg {
  width: 16px;
  height: 16px;
}
.acct-ok {
  color: var(--ok, #14734a);
  font-weight: 600;
}
.acct-rowbtn {
  width: 100%;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.acct-rowbtn:hover {
  border-color: var(--ink-2);
}
.acct-chev {
  font-size: 1.2rem;
  color: var(--ink-2);
}
.acct-cta {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px;
  background: var(--paper);
  display: grid;
  gap: 8px;
  margin-top: 2px;
}
.acct-cta > b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}
.acct-cta p {
  margin: 0 !important;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.acct-dlg .btn.sm {
  min-height: 38px;
  font-size: 0.9rem;
  margin-top: 0;
}
.acct-sub {
  border: 1px dashed var(--rule);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0;
}
.acct-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.acct-two .btn {
  padding: 0 14px;
}
.acct-rules {
  list-style: none;
  margin: -2px 0 6px;
  padding: 0;
  display: grid;
  gap: 3px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.acct-rules li::before {
  content: "○";
  display: inline-block;
  width: 18px;
}
.acct-rules li.on {
  color: var(--ok, #14734a);
}
.acct-rules li.on::before {
  content: "✓";
  font-weight: 700;
}
.acct-pwmsg {
  margin: 0 0 8px !important;
  font-size: 0.88rem;
  font-weight: 600;
}
.acct-pwmsg:empty {
  display: none;
}
.acct-pwmsg.good {
  color: var(--ok, #14734a);
}
.acct-pwmsg.good::before {
  content: "✓ ";
}
.acct-pwmsg.bad {
  color: #b3261e;
}
.acct-msg {
  margin: 0 0 8px !important;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}
.acct-msg:empty {
  display: none;
}
.acct-msg.ok {
  color: var(--ok, #14734a);
}
.acct-msg.bad {
  color: #b3261e;
}
.acct-done {
  margin: 8px 0 !important;
  font-weight: 600;
  color: var(--ok, #14734a);
}
.acct-ask {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}
.acct-ask .acct-face {
  width: 60px;
  height: 60px;
}
.acct-ask h2 {
  padding: 0 !important;
  margin: 0 !important;
}
.acct-ask hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 4px 0;
}
.acct-hi {
  margin: 0 !important;
  font-size: 1.05rem;
}
.acct-ask .btn {
  margin: 0;
}
:root[data-theme="dark"] .acct-pwmsg.bad,
:root[data-theme="dark"] .acct-msg.bad {
  color: #ff8a80;
}
@media (prefers-reduced-motion: reduce) {
  .acct-sw,
  .acct-sw i {
    transition: none;
  }
}
/* ---------- changing notebook (Stamp + Ripple) ---------- */
html.nbsw-in body,
html.nbsw-done body {
  animation: none !important;
}
html.nbsw-in::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: var(--nbsw-bg, #22304a);
}
/* the stamp the same size as on the page you left (switch.js: 42% of the shorter side of the visible window); dvh is
   the visible height, so a phone's address bar does not make it jump */
@supports (height: 1dvh) {
  html.nbsw-in::after {
    background-size:
      min(42vw, 42dvh) auto,
      auto;
  }
}
.nbsw {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  overflow: hidden;
}
.nbsw-r {
  position: absolute;
  border-radius: 50%;
}
.nbsw-d {
  position: absolute;
  color: #fff;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
}
.nbsw-mid {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.nbsw-stamp {
  position: relative;
}
.nbsw-ring {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}
.acct-right {
  align-self: flex-end;
  justify-self: end;
  margin: -4px 0 4px;
}
.acct-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}
.acct-icon .acct-ic {
  width: 24px;
  height: 24px;
}
.acct-icon.ok {
  background: var(--ok, #14734a);
  border-color: transparent;
  color: #fff;
}
.acct-ask .acct-hint {
  margin: 0 !important;
}

.acct-tourb {
  flex: none;
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}
.acct-tourb:hover {
  border-color: var(--ink-2);
}

/* ---------- writing check: after Check the writing box turns into the result, in the same place:
   the similarity, then yours and the model as two separate boxes, short notes and Write again ---------- */
.wcres {
  width: min(100%, 28.75rem);
  margin: 0 auto;
  display: grid;
  gap: 12px;
  animation: wcin 0.25s ease;
}
@keyframes wcin {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
#padbox[hidden],
#wacts[hidden],
.wcres[hidden] {
  display: none !important;
}
.wcpair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}
.wcpair figure {
  margin: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.wcpair figcaption {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}
.wcbox {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.wcbox::before,
.wcbox::after {
  content: "";
  position: absolute;
  border: 0 dashed var(--rule);
  pointer-events: none;
}
.wcbox::before {
  left: 50%;
  top: 0;
  bottom: 0;
  border-left-width: 1px;
}
.wcbox::after {
  top: 50%;
  left: 0;
  right: 0;
  border-top-width: 1px;
}
.wcbox svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.wcyours path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wcyours path.bad {
  stroke: var(--bad);
}
.wcyours text {
  font: 700 7px/1 var(--f-body, sans-serif);
  fill: var(--accent);
}
.wcmodel .kvg path {
  stroke-dashoffset: 0 !important;
  animation: none !important;
}
/* ---------- a lesson passed: the stamp in the list of lessons ---------- */
.gqstamp {
  display: inline-grid;
  place-items: center;
  align-content: center;
  width: 4.6rem;
  height: 4.6rem;
  border: 2.5px solid var(--bad);
  border-radius: 50%;
  color: var(--bad);
  transform: rotate(-9deg);
  font: 700 1.2rem/1 var(--f-body);
  flex: none;
}
.gqstamp small {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}
.gqstamp.sm {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 2px;
  font-size: 0.78rem;
}
/* the faint guide in the writing box has no stroke numbers, so you can try the order yourself first; Stroke order shows them */
.kvg.faint text {
  display: none;
}
.wcscore {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  text-align: center;
}
.wcscore b {
  font-size: 1.5rem;
  line-height: 1;
}
.wcscore span {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
.wcscore.ok b {
  color: var(--ok);
}
.wcscore.no b {
  color: var(--bad);
}
.wcnotes {
  margin: 0 auto;
  max-width: 30rem;
  padding-left: 1.2em;
  display: grid;
  gap: 4px;
  font-size: 0.92rem;
  text-align: left;
}
.wcres .meta {
  text-align: center;
  margin: 0;
}
.wcres .acts {
  margin-top: 2px;
}

/* ---------- the creator credit in the footer is a link ---------- */
.by-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: pointer;
  border-radius: 4px;
}
.by-link:hover b {
  color: var(--accent);
}

/* colour themes, picked in the site bar; the first is the notebook own one */
:root[data-pal="taegeuk-blue-red"] {
  --paper: #f1f4fa;
  --paper-line: #e3e8f2;
  --surface: #ffffff;
  --ink: #141e3a;
  --ink-2: #535e7a;
  --rule: #d4dbea;
  --grid: #a9b7e0;
  --accent: #0047a0;
  --on-accent: #ffffff;
  --mark: #ffc9cf;
  --mark-ink: #141e3a;
  --grid-2: #cdd6ed;
}
:root[data-pal="taegeuk-blue-red"][data-theme="dark"] {
  --paper: #0f1320;
  --paper-line: #151a2a;
  --surface: #192033;
  --ink: #e9edf7;
  --ink-2: #a2abc4;
  --rule: #2b3550;
  --grid: #3d4a78;
  --accent: #8fb2ff;
  --on-accent: #0b1d45;
  --mark: #f2a2ac;
  --mark-ink: #2a0a10;
  --grid-2: #262e4c;
}
:root[data-pal="lavender"] {
  --paper: #f5f3fa;
  --paper-line: #eae6f3;
  --surface: #ffffff;
  --ink: #221b36;
  --ink-2: #615978;
  --rule: #ded8ec;
  --grid: #c3b7e6;
  --accent: #5b3fb0;
  --on-accent: #ffffff;
  --mark: #ffe07a;
  --mark-ink: #221b36;
  --grid-2: #dcd5f0;
}
:root[data-pal="lavender"][data-theme="dark"] {
  --paper: #15121e;
  --paper-line: #1c1828;
  --surface: #211c2e;
  --ink: #eeeaf7;
  --ink-2: #aba3c2;
  --rule: #352e4b;
  --grid: #54477e;
  --accent: #c3b0ff;
  --on-accent: #22104d;
  --mark: #e8c95c;
  --mark-ink: #1b1a10;
  --grid-2: #342c4e;
}
:root[data-pal="celadon"] {
  --paper: #edf5f3;
  --paper-line: #deebe7;
  --surface: #ffffff;
  --ink: #14302a;
  --ink-2: #4d6a63;
  --rule: #cfe1dc;
  --grid: #a3cec3;
  --accent: #2e7d6e;
  --on-accent: #ffffff;
  --mark: #f5cf7a;
  --mark-ink: #14302a;
  --grid-2: #c8e2db;
}
:root[data-pal="celadon"][data-theme="dark"] {
  --paper: #0f1917;
  --paper-line: #15221f;
  --surface: #182824;
  --ink: #e3f1ed;
  --ink-2: #99b8b0;
  --rule: #283f39;
  --grid: #3b6a5e;
  --accent: #82d9c6;
  --on-accent: #062a23;
  --mark: #e5c26a;
  --mark-ink: #1b1a08;
  --grid-2: #25423a;
}

[data-act="listen"]:not(.vok),
.btn[data-act="syl"]:not(.vok) {
  opacity: 0.45;
}
#nbv-soon {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translate(-50%, 20px);
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
#nbv-soon.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.kvg.acj path.ao {
  fill: var(--ink);
  stroke: none;
}
.kvg.acj path.am {
  display: none;
  fill: none;
  stroke: var(--ink);
  stroke-width: 150;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kvg.acj.glyph path.am {
  stroke-width: 17;
}
.kvg.acj text.fin {
  display: none;
}
.kvg.acj.play text.fin {
  display: inline;
  fill: var(--ink);
}
.kvg.acj text {
  font-size: 72px;
}
.kvg.acj.glyph text.n {
  font-size: 7.6px;
}
.kvg.acj .ag {
  font-size: 100px;
  font-weight: 400;
  fill: var(--ink);
}
.kvg.acj text.ag,
.kvg.acj.faint text.ag,
.kvg.acj.play text.ag {
  display: inline;
  opacity: 1;
  animation: none;
}
.kvg.acj text.n {
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 14px;
  stroke-linejoin: round;
  font-weight: 600;
}
.kvg.acj.glyph text.n {
  stroke-width: 1.5px;
}
.kvg.acj.faint path.ao,
.kvg.acj.faint .ag {
  fill: var(--grid);
}
.kvg.acj.guide path.ao,
.kvg.acj.guide .ag {
  fill: var(--accent);
  opacity: 0.5;
}
.kvg.acj.play path.ao,
.kvg.acj.play .ag {
  fill: var(--grid);
}
.kvg.acj.play .ag {
  opacity: 1;
  animation: none;
}
.kvg.acj.play path.am {
  display: inline;
}
.sq.wide {
  width: min(100%, calc(var(--n) * 19rem));
}
.cmp.wide {
  max-width: calc(var(--n) * 19rem);
}
.drill:has(.sq.wide) {
  max-width: 100%;
}
.pacebar {
  width: 100%;
  max-width: 20rem;
  margin: 2px auto 0;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.pacebar i {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  overflow: hidden;
  position: relative;
}
.pacebar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ok, #2e8b57);
  transform-origin: left;
  animation: nbpace linear forwards;
  animation-duration: inherit;
}
@keyframes nbpace {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
.pacebar span,
.wctap {
  font-size: 0.82rem;
  color: var(--ink-2);
}
.wctap {
  margin: 4px 0 0;
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .pacebar i::after {
    animation: none;
    transform: none;
  }
}

#sheet kbd {
  display: none !important;
}
#sheet .acts > [data-act="next"] {
  order: 99;
}
#sheet [data-act="grade"][data-ok="0"] {
  display: none !important;
}
#sheet .opt[aria-disabled] {
  cursor: pointer;
}
.tform {
  flex-direction: column;
  align-items: center;
}
.tform input {
  width: 100%;
}
