/* The home page (index.html) */

/* Zhanote home: the page is the notebook. A stack of tabbed folders (one per notebook, one for the prices) opens on
   the front folder, which holds the way in and the three notebooks; the rest of the page is more of the same
   stationery: a contents sheet, a row of pages, a price list, a reply card and the back cover. The rubber stamps
   (あ 字 한, and 合格 for a passed lesson) are the one ornament. Colours are the site's own, in light and dark. */
:root {
  --paper: #f3f7f8;
  --surface: #ffffff;
  --ink: #1b2442;
  --ink-2: #56607a;
  --rule: #d3dce0;
  --accent: #1e2b57;
  --on-accent: #ffffff;
  --mark: #ffe066;
  --mark-ink: #1b2442;
  --ok: #14734a;
  --on-st: #ffffff;
  --blend: multiply;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-ja: "Klee One", "Hiragino Maru Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
  --f-ko: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --f-zh: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Noto Serif CJK SC", "Songti SC", serif;
  /* the home page's own faces and its five sizes */
  --h-d: "Libre Franklin", "Bricolage Grotesque", "Segoe UI", sans-serif;
  --h-t: "Source Serif 4", Georgia, "Times New Roman", serif;
  --t-small: 0.875rem;
  --t-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --t-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --t-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --t-display: clamp(3.5rem, min(11vw, 15vh), 10rem);
  --m: clamp(16px, 3vw, 32px);
}
:root[data-theme="dark"] {
  --paper: #11161e;
  --surface: #18202b;
  --ink: #e7ecf3;
  --ink-2: #a2adbe;
  --rule: #2b3646;
  --accent: #afc4f2;
  --on-accent: #111a33;
  --mark: #efd15f;
  --mark-ink: #1b1d0e;
  --ok: #74d6a4;
  --on-st: #11161e;
  --blend: normal;
  color-scheme: dark;
}
:root[data-theme="light"] {
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--f-body);
}
h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.wrap {
  max-width: 78rem;
  margin-inline: auto;
  padding-inline: var(--m);
}
main,
.foot {
  font: 400 var(--t-body) / 1.55 var(--h-t);
}
main h2,
.foot h2 {
  font: 700 var(--t-head) / 0.98 var(--h-d);
  letter-spacing: -0.035em;
  text-wrap: balance;
}
main h3 {
  font: 700 var(--t-lead) / 1.15 var(--h-d);
  letter-spacing: -0.02em;
}
section {
  padding-block: clamp(64px, 8vw, 120px);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 0;
  font: 700 1rem/1 var(--h-d);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition:
    transform 0.15s,
    background-color 0.15s;
}
.btn:active {
  transform: translateY(2px);
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover {
  background: color-mix(in srgb, var(--accent) 84%, var(--ink-2));
}
.btn.quiet {
  color: var(--ink);
  background: var(--paper);
}
.btn.quiet:hover {
  background: color-mix(in srgb, var(--paper) 88%, var(--ink-2));
}
.fine {
  font-size: var(--t-small);
  color: var(--ink-2);
}

/* ---------- stamps ---------- */
.stamp {
  display: block;
  color: var(--c);
  mix-blend-mode: var(--blend);
}
.stamp svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.s-ja,
.ja {
  --c: var(--st-ja);
}
.s-zh,
.zh {
  --c: var(--st-zh);
}
.s-ko,
.ko {
  --c: var(--st-ko);
}
.s-ok {
  --c: var(--st-ok);
}
.ja .native {
  font-family: var(--f-ja);
}
.zh .native {
  font-family: var(--f-zh);
}
.ko .native {
  font-family: var(--f-ko);
}
:root {
  --st-ja: #2b8a6c;
  --st-zh: #c23b2e;
  --st-ko: #2f5da8;
  --st-ok: #c23b2e;
}
:root[data-theme="dark"] {
  --st-ja: #6ccba8;
  --st-zh: #f27e6c;
  --st-ko: #8fb2f2;
  --st-ok: #f27e6c;
}

/* ---------- the top: the headline and a stamped notebook page ---------- */
.hero {
  --paper-line: #dce6ea;
  --margin: #e8a3a0;
  --tape: rgba(255, 214, 79, 0.72);
  --f-hand: "Gaegu", "Comic Neue", "Segoe Print", cursive;
  padding-block: clamp(32px, 6vw, 76px) clamp(24px, 4vw, 48px);
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 28px 28px;
}
:root[data-theme="dark"] .hero {
  --paper-line: #18202b;
  --margin: #7a4b4e;
  --tape: rgba(239, 209, 95, 0.5);
}
.hero .wrap {
  max-width: 68rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero h1 {
  font: 800 clamp(2.4rem, 6.2vw, 4.4rem) / 1 var(--f-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 12ch;
}
.hero .sub,
.hero .fine {
  font-family: var(--f-body);
}
.hero .sub {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-2);
  max-width: 34rem;
  margin-top: 20px;
}
.hero .ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero .btn {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font: 600 1rem/1 var(--f-body);
}
.hero .btn.quiet {
  background: var(--surface);
  border: 1.5px solid var(--rule);
}
.hero .fine {
  font-size: 0.92rem;
  margin-top: 14px;
}
.page {
  position: relative;
  aspect-ratio: 10/9;
  width: 100%;
  max-width: 520px;
  justify-self: end;
  border: 1px solid var(--rule);
  border-radius: 4px 10px 10px 4px;
  background: var(--surface);
  transform: rotate(1.2deg);
  background-image:
    linear-gradient(
      90deg,
      transparent 15%,
      var(--margin) 15%,
      var(--margin) calc(15% + 1.5px),
      transparent calc(15% + 1.5px)
    ),
    repeating-linear-gradient(transparent 0 31px, var(--paper-line) 31px 32px);
}
.page::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 132px;
  height: 30px;
  margin-left: -66px;
  background: var(--tape);
  transform: rotate(-4deg);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 6px, transparent 6px 12px);
}
.page .stamp {
  position: absolute;
}
.page .h1 {
  left: 20%;
  top: 9%;
  width: 41%;
  --r: -9deg;
}
.page .h2 {
  left: 59%;
  top: 27%;
  width: 33%;
  --r: 7deg;
}
.page .h3 {
  left: 25%;
  top: 55%;
  width: 40%;
  --r: -3deg;
}
.page .stamp svg {
  transform: rotate(var(--r));
}
.hand {
  position: absolute;
  font: 700 1.45rem/1 var(--f-hand);
  color: var(--ink-2);
  white-space: nowrap;
}
.hand svg {
  position: absolute;
  width: 38px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.n1 {
  left: 17%;
  top: 53%;
}
.n1 svg {
  left: 10px;
  top: -20px;
  transform: scaleY(-1);
}
.hand path {
  vector-effect: non-scaling-stroke;
}
.n2 {
  left: 76%;
  top: 68%;
}
.n2 svg {
  left: -14px;
  top: -24px;
  transform: scaleX(-1) rotate(160deg);
}
.n3 {
  left: 68%;
  top: 82%;
}
.n3 svg {
  left: -40px;
  top: -6px;
  transform: rotate(180deg);
}
@keyframes press {
  0% {
    opacity: 0;
    transform: scale(1.4);
  }
  55% {
    opacity: 1;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes inkin {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.page .stamp {
  animation: press 0.5s cubic-bezier(0.3, 0.7, 0.3, 1) both;
}
.page .h1 {
  animation-delay: 0.25s;
}
.page .h2 {
  animation-delay: 0.6s;
}
.page .h3 {
  animation-delay: 0.95s;
}
.page .hand {
  animation: inkin 0.4s ease-out 1.45s both;
}
@media (max-width: 52rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .page {
    justify-self: center;
    max-width: 420px;
  }
}
.install {
  margin-top: 14px;
}
.install .btn {
  min-height: 44px;
  padding: 0 18px;
}
.install .btn::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: url(/app/icon.svg) center/contain no-repeat;
  border-radius: 4px;
}

/* the band under the top, with the name box */
.try {
  background: var(--surface);
  padding-block: clamp(32px, 4vw, 56px);
}
.try .wrap {
  max-width: 68rem;
}
/* the one live thing: your name in katakana */
.kname {
  background: var(--paper);
  padding: clamp(20px, 3vw, 32px);
  display: grid;
  gap: 12px;
  align-content: start;
}
.kname label {
  font: 700 var(--t-lead) / 1.15 var(--h-d);
  letter-spacing: -0.02em;
}
.kname input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 2px solid var(--ink-2);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--t-lead) / 1 var(--h-t);
}
.kname input:focus {
  border-color: var(--accent);
  outline: none;
}
.kname output {
  display: block;
  min-height: 1.2em;
  font: 600 var(--t-head) / 1.1 var(--f-ja);
  letter-spacing: 0.02em;
  color: var(--st-ja);
  overflow-wrap: anywhere;
}
.kname output.eg {
  color: var(--ink-2);
}
.kname output span {
  display: inline-block;
  animation: kpop 0.28s cubic-bezier(0.3, 0.7, 0.3, 1) both;
}
@keyframes kpop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
}
.kname {
  grid-template-areas: "lab" "sw" "inp" "out" "fine";
}
.kname label {
  grid-area: lab;
}
.kn-sw {
  grid-area: sw;
}
.kname input {
  grid-area: inp;
}
.kname > output {
  grid-area: out;
}
.kname .fine {
  grid-area: fine;
}
@media (min-width: 48rem) {
  .kname {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(24px, 4vw, 56px);
    align-items: center;
    grid-template-areas: "lab sw" "inp out" "fine out";
  }
  .kn-sw {
    justify-self: end;
  }
}
/* the switch, one button per notebook in its stamp colour */
.kn-sw {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kn-sw button {
  min-height: 40px;
  padding: 0 16px;
  border: 2px solid var(--c);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 700 0.9375rem/1 var(--h-d);
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.kn-sw button[aria-pressed="true"] {
  background: var(--c);
  color: var(--on-st);
}
.kname[data-w="ko"] > output {
  color: var(--st-ko);
  font-family: var(--f-ko);
}
.kname[data-w="zh"] > output {
  color: var(--st-zh);
  font-family: var(--f-zh);
}
.kname output ruby {
  ruby-position: over;
}
.kname output rt {
  font:
    500 0.3em/1.2 system-ui,
    "Segoe UI",
    Arial,
    sans-serif;
  letter-spacing: 0;
  color: var(--ink-2);
}

/* ---------- the three notebooks, inside the front folder ---------- */
#languages {
  background: var(--surface);
  padding-top: clamp(56px, 7vw, 96px);
}
.sec-head {
  display: grid;
  gap: 14px;
  max-width: 44rem;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.sec-head p {
  font-size: var(--t-lead);
  line-height: 1.4;
}
.books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
  align-items: end;
}
.book {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--paper);
  padding: 0 0 clamp(22px, 2.4vw, 30px);
  border-top: 12px solid var(--c);
}
.book:nth-child(1) {
  transform: rotate(-1deg);
}
.book:nth-child(2) {
  margin-bottom: 40px;
}
.book:nth-child(3) {
  transform: rotate(1.2deg);
  margin-bottom: 16px;
}
.book .band {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px clamp(18px, 2vw, 26px) 4px;
}
.book .band .stamp {
  width: 76px;
  flex: none;
}
.book .en {
  font: 700 1.125rem/1.1 var(--h-d);
}
.book .native {
  font-size: var(--t-lead);
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
}
.book ul,
.book .free,
.book .prog,
.book .btn {
  margin-inline: clamp(18px, 2vw, 26px);
}
.book ul {
  display: grid;
  gap: 6px;
}
.book li {
  padding-left: 20px;
  position: relative;
}
.book li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.58em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.book .free {
  font-size: var(--t-small);
  color: var(--ink-2);
}
.prog {
  font-size: var(--t-small);
  color: var(--ok);
  font-weight: 600;
}
.prog.none {
  color: var(--ink-2);
  font-weight: 400;
}
.book .btn {
  margin-top: auto;
}
@media (max-width: 60rem) {
  .books {
    grid-template-columns: minmax(0, 1fr);
  }
  .book:nth-child(n) {
    transform: none;
    margin-bottom: 0;
  }
  .book:nth-child(1) {
    transform: rotate(-0.6deg);
  }
  .book:nth-child(3) {
    transform: rotate(0.6deg);
  }
}

/* ---------- what's inside: a contents sheet, and the screen of the row you point at ---------- */
#inside .wrap {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.sheet {
  background: var(--surface);
  clip-path: polygon(
    0% 10px,
    4.167% 0px,
    8.333% 10px,
    12.5% 0px,
    16.667% 10px,
    20.833% 0px,
    25% 10px,
    29.167% 0px,
    33.333% 10px,
    37.5% 0px,
    41.667% 10px,
    45.833% 0px,
    50% 10px,
    54.167% 0px,
    58.333% 10px,
    62.5% 0px,
    66.667% 10px,
    70.833% 0px,
    75% 10px,
    79.167% 0px,
    83.333% 10px,
    87.5% 0px,
    91.667% 10px,
    95.833% 0px,
    100% 10px,
    100% calc(100% - 10px),
    95.833% calc(100% - 0px),
    91.667% calc(100% - 10px),
    87.5% calc(100% - 0px),
    83.333% calc(100% - 10px),
    79.167% calc(100% - 0px),
    75% calc(100% - 10px),
    70.833% calc(100% - 0px),
    66.667% calc(100% - 10px),
    62.5% calc(100% - 0px),
    58.333% calc(100% - 10px),
    54.167% calc(100% - 0px),
    50% calc(100% - 10px),
    45.833% calc(100% - 0px),
    41.667% calc(100% - 10px),
    37.5% calc(100% - 0px),
    33.333% calc(100% - 10px),
    29.167% calc(100% - 0px),
    25% calc(100% - 10px),
    20.833% calc(100% - 0px),
    16.667% calc(100% - 10px),
    12.5% calc(100% - 0px),
    8.333% calc(100% - 10px),
    4.167% calc(100% - 0px),
    0% calc(100% - 10px)
  );
  padding: clamp(48px, 5vw, 64px) clamp(22px, 3vw, 44px);
}
.sheet h2 {
  text-align: center;
  font-size: clamp(2rem, 1.3rem + 2vw, 3rem);
}
.sheet > p {
  text-align: center;
  margin: 16px auto 40px;
  max-width: 36ch;
}
.sheet h3 {
  font-size: 1.25rem;
  margin: 44px 0 14px;
}
.sheet h3:first-of-type {
  margin-top: 0;
}
.row {
  display: block;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.row .l {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.row .n {
  font-weight: 600;
}
.row .dots {
  flex: 1;
  border-bottom: 4px dotted var(--ink-2);
  opacity: 0.45;
  transform: translateY(-4px);
}
.row .v {
  font-size: var(--t-small);
  color: var(--ink-2);
  white-space: nowrap;
}
.row .d {
  display: block;
  font-size: var(--t-small);
  color: var(--ink-2);
  max-width: 40ch;
  margin-top: 2px;
}
.row.on .n {
  color: var(--accent);
}
.preview {
  position: sticky;
  top: 96px;
  display: grid;
}
.preview img {
  grid-area: 1/1;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  object-position: top;
  background: var(--surface);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.preview img.on {
  opacity: 1;
}
.preview .cap {
  margin-top: 12px;
  font-size: var(--t-small);
  color: var(--ink-2);
}
@media (max-width: 56rem) {
  #inside .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview {
    position: static;
    max-width: 520px;
  }
}

/* ---------- how it works: a row of pages you can drag ---------- */
#how {
  background: var(--surface);
  overflow: hidden;
}
.how-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.how-nav {
  display: flex;
  gap: 8px;
}
.how-nav button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--surface);
  font: 700 1.4rem/1 var(--h-d);
  cursor: pointer;
  transition: transform 0.15s;
}
.how-nav button:active {
  transform: translateY(2px);
}
.how-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}
.bar {
  height: 6px;
  background: var(--paper);
  margin: 22px 0 36px;
  position: relative;
}
.bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 20%;
  background: var(--ink);
  transition:
    left 0.2s,
    width 0.2s;
}
.pages {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-inline: max(var(--m), calc((100vw - 78rem) / 2 + var(--m)));
  scroll-padding-inline: max(var(--m), calc((100vw - 78rem) / 2 + var(--m)));
}
.pages::-webkit-scrollbar {
  display: none;
}
.pg {
  flex: 0 0 300px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.pg h3 {
  font-size: 1.25rem;
}
.pg p {
  font-size: var(--t-small);
  color: var(--ink-2);
  margin-top: 8px;
  min-height: 4.6em;
}
.pg .sp {
  height: var(--sp);
}
.pg figure {
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--paper);
}
.pg figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 6s ease-out;
}
.pg:hover figure img {
  transform: scale(1.06);
}
.pg figure.stamped {
  display: grid;
  place-items: center;
}
.pg figure.stamped .stamp {
  width: 62%;
  transform: rotate(-8deg);
}
/* tablets and phones: the pages lie two by two instead of running off the screen */
@media (max-width: 60rem) {
  .pages {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 20px;
    overflow: visible;
    padding-inline: var(--m);
  }
  .how-nav,
  .bar {
    display: none;
  }
  .how-top {
    margin-bottom: 32px;
  }
  .pg .sp {
    height: calc(var(--sp) / 4);
  }
  .pg p {
    min-height: 0;
  }
}

/* ---------- prices, set like a menu ---------- */
#pricing .wrap {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 64px);
}
#pricing .intro {
  display: grid;
  gap: 18px;
  align-content: start;
}
.menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 64px;
  align-items: start;
}
.menu h3 {
  font-size: 1.5rem;
  margin: 0 0 18px;
}
.menu .grp + .grp h3 {
  margin-top: 0;
}
.item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 22px;
  font-size: 1.1875rem;
}
.item .what {
  display: grid;
}
.item .what small {
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 36ch;
}
.item .amt {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.incl {
  display: grid;
  gap: 8px;
  margin: 6px 0 26px;
}
.incl li {
  padding-left: 22px;
  position: relative;
  font-size: 1rem;
}
.incl li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.42em;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}
.menu .btn {
  width: 100%;
}
.menu .btn.quiet {
  background: var(--surface);
}
.menu .btn.quiet:hover {
  background: color-mix(in srgb, var(--surface) 86%, var(--ink-2));
}
.pay-note {
  font-size: var(--t-small);
  color: var(--ink-2);
  margin-top: 12px;
}
@media (max-width: 56rem) {
  #pricing .wrap,
  .menu {
    grid-template-columns: minmax(0, 1fr);
  }
  .menu .grp + .grp {
    margin-top: 40px;
  }
}

/* ---------- questions ---------- */
#questions {
  background: var(--surface);
}
#questions .wrap {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 64px);
}
.faq {
  display: grid;
  gap: 8px;
}
.faq details {
  background: var(--paper);
  overflow: hidden;
}
.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  font: 600 1.125rem/1.35 var(--h-t);
  cursor: pointer;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s;
}
.faq details[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}
.faq details.shut summary::after {
  transform: rotate(45deg) translate(-2px, -2px);
}
.faq details p {
  padding: 0 20px 20px;
  max-width: 44rem;
}
@media (max-width: 56rem) {
  #questions .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- the reply card ---------- */
.reply {
  background: var(--accent);
  color: var(--on-accent);
  overflow: hidden;
  padding-bottom: 0;
}
.reply .wrap {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
}
.reply .side {
  font-size: var(--t-lead);
  line-height: 1.4;
  padding-bottom: 64px;
  max-width: 28ch;
}
.card {
  background: var(--surface);
  color: var(--ink);
  transform: rotate(2deg);
  transform-origin: left bottom;
  margin-bottom: -60px;
  padding: 48px 48px 108px;
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
}
.card h2 {
  font-size: 2rem;
  max-width: 18ch;
}
.picks {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(18px, 4vw, 44px);
  margin-top: 18px;
}
.pick {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 112px;
  color: var(--ink);
  text-decoration: none;
  font: 700 1rem/1 var(--h-d);
}
.pick .stamp {
  width: 100%;
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.pick:hover .stamp,
.pick:focus-visible .stamp {
  transform: rotate(-6deg) scale(1.05);
}
@media (max-width: 48rem) {
  .reply .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .reply .side {
    padding-bottom: 0;
  }
  .card {
    transform: rotate(1deg);
    padding: 32px 22px 96px;
  }
  .card h2 {
    font-size: 1.5rem;
  }
  .pick {
    width: 84px;
  }
}

/* ---------- the back cover ---------- */
.foot {
  padding: clamp(80px, 9vw, 128px) 0 clamp(40px, 5vw, 64px);
}
.back {
  position: relative;
  background: var(--surface);
  max-width: 66rem;
  margin-inline: auto;
  padding: clamp(40px, 5vw, 64px) clamp(22px, 4vw, 56px) 28px;
}
.back .edge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 24px;
  width: 100%;
  color: var(--surface);
  display: block;
}
.back .two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
}
.back .msg {
  display: grid;
  gap: 14px;
  align-content: start;
}
.back h2 {
  font-size: 2rem;
}
.back .addr {
  display: grid;
  gap: 12px;
  align-content: start;
  font-size: 1.125rem;
}
.back .addr a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.back .addr a:hover {
  color: var(--accent);
}
.back .insta {
  justify-self: start;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -9px;
  color: var(--ink);
  border-radius: 10px;
}
.back .insta svg {
  width: 26px;
  height: 26px;
}
.back .insta:hover {
  color: var(--accent);
}
.back .ok {
  position: absolute;
  top: clamp(20px, 3vw, 32px);
  right: clamp(20px, 3vw, 32px);
  width: 88px;
  transform: rotate(-10deg);
}
.back .imprint {
  margin-top: 44px;
  text-align: center;
  font-size: var(--t-small);
  color: var(--ink-2);
  max-width: 52rem;
  margin-inline: auto;
}
.by-link {
  color: var(--ink);
}
@media (max-width: 40rem) {
  .back .two {
    grid-template-columns: minmax(0, 1fr);
  }
  .back .ok {
    width: 64px;
  }
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- parts of each section rise in as it arrives (only with script; without it everything is simply there) ---------- */
.rv [data-r] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.rv [data-r].in {
  opacity: 1;
  transform: none;
}
.rv .book[data-r].in:nth-child(1) {
  transform: rotate(-1deg);
}
.rv .book[data-r].in:nth-child(3) {
  transform: rotate(1.2deg);
}
.rv .card[data-r].in {
  transform: rotate(2deg);
}
@media (max-width: 48rem) {
  .rv .card[data-r].in {
    transform: rotate(1deg);
  }
}
@media (max-width: 60rem) {
  .rv .book[data-r].in:nth-child(1) {
    transform: rotate(-0.6deg);
  }
  .rv .book[data-r].in:nth-child(3) {
    transform: rotate(0.6deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rv [data-r] {
    transform: none !important;
    transition: opacity 0.3s;
  }
  .page .stamp,
  .page .hand,
  .kname output span {
    animation: none;
  }
  .btn,
  .pick .stamp,
  .faq summary::after,
  .pg figure img,
  .preview img {
    transition: none;
  }
}

/* ---------- practice tabs on narrow phones: 5 or 6 tabs go in two rows of 3 ---------- */
@media (max-width: 420px) {
  .tabs[style*="--n: 5"],
  .tabs[style*="--n: 6"] {
    grid-template-columns: repeat(3, 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 .meta {
  margin: 0 0 6px;
  max-width: 30rem;
}
.locked .btn {
  width: auto;
}
/* ---------- 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) ---------- */
.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 ---------- */
@keyframes wcin {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* ---------- grammar quizzes: the box after a lesson, level checks, questions and the result ---------- */
/* the faint guide in the writing box has no stroke numbers, so you can try the order yourself first; Stroke order shows them */

/* ---------- 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);
}
.plan .terms {
  list-style: none;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}
.plan .terms li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0;
}
.plan .terms li::before {
  content: none !important;
}
.plan .terms b {
  min-width: 5.5em;
}
.plan .terms em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ok, #14734a);
}
