/* Concept A — Hinoki study: a warm washi wall above a floor of natural tatami */
:root {
  --wall: #f0e9dc;     /* warm washi: warmer than the first draft's #f4efe5, less than the Kanji dark version's ivory */
  --paper: #fdf9f1;
  --paper-2: #f6f0e5;
  --ink: #221f1a;
  --ink-soft: #544c42;
  --ink-faint: #675e53;
  --honey: #946535;
  --honey-deep: #6a4422;
  --moss: #56693f;
  --link: #2f4366;
  --line: rgba(34, 31, 26, .12);
  --line-strong: rgba(34, 31, 26, .2);
  --shadow-card: 0 1px 2px rgba(60, 40, 20, .1), 0 14px 32px -14px rgba(60, 40, 20, .5); /* Ma dark's level and word cards */
  --shadow-on-mat: 0 1px 1px rgba(70, 58, 26, .1), 0 10px 24px -8px rgba(70, 58, 26, .3);
  --serif-ja: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --serif-ko: "Noto Serif KR", "Noto Serif JP", serif;
  --sans-ja: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --sans-ko: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", var(--sans-ja);
  --wrap: 1000px;
  --gutter: 32px;
  --rail: 12px;
  /* the box follows Ma dark's (6d9ce8f), a little smaller (owner, 28 Oct 2026): min(1080 px, window less a gutter); level
     cards keep the Ma grid where it fits (--ma-grid resolved where used) */
  --frame-max: 1080px;
  --frame-gutter: 24px;
  --mat-margin: 24px;
  --ma-grid: min(920px, 100% - 40px);
  /* the box's default height (home, study, Learned): the taller of the level rows and --study-h (the tallest card answer
     side in its width band, 28 Oct 2026), so a card never resizes the box; About grows it; Learned scrolls inside */
  --rows: 2;
  --row-h: 176px; /* level cards: 18 px taller than Ma's 158 */
  --vpad: 40px;
  --study-h: 776px; /* answers need up to 762 px from 861 px wide */
  --box-h: calc(max(var(--rows) * var(--row-h) + (var(--rows) - 1) * 16px + 2 * var(--vpad), var(--study-h)) + 2 * var(--rail));
  --wood: linear-gradient(rgba(246, 230, 200, .5), rgba(246, 230, 200, .5)), url("../assets/hinoki-planks-1024.webp") 0 0 / 640px 640px;
  --wood-post: linear-gradient(rgba(246, 230, 200, .5), rgba(246, 230, 200, .5)), url("../assets/hinoki-post.webp") 50% 0 / 42px 640px repeat-y;
  color-scheme: light;
}
body { background: var(--wall); color: var(--ink); font: 16px/1.65 var(--sans); }
html[lang="ko"] body { font-family: var(--sans-ko), var(--sans); }
a { color: var(--link); text-underline-offset: 3px; }
[lang="ja"] { font-family: var(--sans-ja); }
[lang="ko"] { font-family: var(--sans-ko); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
.skip { background: var(--paper); color: var(--ink); }


/* header */
.bar { background: var(--wall); }
.bar-inner { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 14px var(--gutter); }
.brand { gap: 12px; color: var(--ink); }
.brand-mark { font-family: var(--serif-ja); font-size: 32px; line-height: 1; color: var(--honey-deep); }
.brand-text { font-family: var(--serif-ja); font-weight: 600; font-size: 18px; letter-spacing: .03em; line-height: 1.2; }
.brand-text small { display: block; font-family: var(--sans-ko); font-weight: 400; font-size: 12px; letter-spacing: .02em; color: var(--ink-faint); margin-top: 2px; }
/* the wordmark (Mashiki, set by c/hinoki.js), a little smaller than the 間 logo; no tagline */
.brand-text { font-size: 32px; font-weight: 500; letter-spacing: .01em; line-height: 1; }
.brand-text small { display: none; }
.bar-right { gap: 14px; }
nav[aria-label] { gap: 2px; }
.bar nav a { text-decoration: none; color: var(--ink-soft); padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.bar nav a:hover { color: var(--ink); background: rgba(148, 101, 53, .08); }
.bar nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--honey); border-radius: 0; }
.pill { min-width: 1.6em; padding: 0 6px; border-radius: 99px; background: rgba(148, 101, 53, .12); font-size: 12px; color: var(--honey-deep); }
.lang-switch { border: 1px solid var(--line); border-radius: 99px; background: var(--paper-2); padding: 2px; }
.lang-switch button { background: transparent; color: var(--ink-soft); font: 500 13px var(--sans); padding: 5px 11px; border-radius: 99px; min-height: 30px; }
.lang-switch button[lang="ko"] { font-family: var(--sans-ko); }
.lang-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(60, 40, 20, .14); }

/* page: titles on the wall, cards on the tatami floor */
main { padding: 34px 0 0; }
.intro, .study-head, .progress-track, .tabs, .draft-note { max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
h1 { font-family: var(--serif-ja); font-weight: 600; font-size: 25px; line-height: 1.3; letter-spacing: .01em; margin: 0 0 6px; } /* one size for Levels, Learned and About (Levels' size) */
html[lang="ko"] h1 { font-family: var(--serif-ko); }
.intro p { color: var(--ink-soft); margin: 0; max-width: 60ch; font-size: 16.5px; }
.intro { margin-bottom: 28px; }
/* home: a quieter title and line above the levels */
#view-home .intro p { font-size: 15px; }
#view-home .intro { margin-bottom: 24px; }
/* one heading band (--head-h from c/hinoki.js) keeps the box's top edge put on Levels, Study, Learned and About */
#view-home > .intro, #view-learned > .intro, #view-about > .intro, #view-account > .intro, #view-study > .head-band { min-height: var(--head-h, 0px); margin-bottom: 24px; }
/* Study's band: the back link and progress sit at its foot, just above the box */
#view-study > .head-band { display: flex; flex-direction: column; justify-content: flex-end; }
#view-study > .head-band .progress-track { margin-bottom: 0; }
#view-study > .head-band > * { width: 100%; } /* a column flexbox doesn't stretch children with auto side margins */
#view-study > .head-band > .progress-track { max-width: min(var(--wrap) - 2 * var(--gutter), 100% - 2 * var(--gutter)); } /* lines up with the text above at every width */
#view-study::after { content: ""; display: block; height: var(--below-h, 0px); } /* as much room below the box as Levels (c/hinoki.js) */


.floor {
  --box-w: min(var(--frame-max), 100% - 2 * var(--frame-gutter));
  --grid: min(var(--ma-grid), var(--box-w) - 2 * var(--rail) - 2 * var(--mat-margin));
  position: relative;
  width: calc(var(--box-w) - 2 * var(--rail));
  margin: 0 auto;
  border-top: var(--rail) solid transparent;
  border-bottom: var(--rail) solid transparent;
  padding: 44px calc((var(--box-w) - 2 * var(--rail) - var(--grid)) / 2) 52px;
  background: linear-gradient(#ccc19e, #ccc19e) padding-box, var(--wood) border-box;
}
/* the posts at the sides; the rails above and below are the floor's own border */
.floor::before, .floor::after {
  content: ""; position: absolute; top: calc(-1 * var(--rail)); bottom: calc(-1 * var(--rail)); width: var(--rail);
  background: var(--wood-post); box-shadow: 0 0 0 1px rgba(80, 56, 30, .18);
}
.floor::before { left: calc(-1 * var(--rail)); }
.floor::after { right: calc(-1 * var(--rail)); }

.floor > * { width: 100%; max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.floor > :not(.hinoki-mats) { position: relative; } /* above the mats */
/* home, study and Learned share one box: the levels sit in the middle of it, a card or the list at its top (so flipping
   doesn't move the card) */
body[data-view="home"] .floor, body[data-view="study"] .floor, body[data-view="learned"] .floor, body[data-view="account"] .floor { min-height: var(--box-h); }
/* Sign in / Account: the same box as Levels (same top edge, height and room below), its content at the top */
#view-account::after { content: ""; display: block; height: var(--below-h, 0px); }
body[data-view="home"] .floor { display: flex; flex-direction: column; justify-content: center; padding-top: var(--vpad); padding-bottom: var(--vpad); }

/* the mats: Ma dark's tatami scene (c/hinoki.js adds the markup); eight mats (IMG_9111) fill the box, 3 x 5 upright or
   5 x 3; sticky, never taller than the window below the header; no drifting light */
.floor > .hinoki-mats { position: absolute; inset: 0; z-index: 0; width: auto; max-width: none; margin: 0; pointer-events: none; }
.hinoki-scene {
  --timber: #2c1e14;
  position: sticky; top: var(--bar-h, 0px); height: min(100%, 100vh - var(--bar-h, 0px));
  overflow: hidden; container-type: size; background: #e9dfcc;
}
/* the rail's soft shadow on the mats just below the top rail */
/* soft shading flush with the tatami's top and bottom edges (Ma dark 6d9ce8f) */
/* section lines: soft lines across the window at the box's top and bottom edges (owner, 28 Oct 2026) */
body { overflow-x: clip; }
/* no page (outer) scrollbar chrome, so views keep one width (owner, 1 Nov 2026); the page still scrolls; root only */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
.floor > .scene-lines { position: absolute; inset: calc(-1 * var(--rail)) 0; width: auto; max-width: none; margin: 0; pointer-events: none; }
.scene-lines::before, .scene-lines::after { content: ""; position: absolute; left: calc(50% - 50vw); width: 100vw; height: 40px; z-index: -1; }
/* each line is the edge of a clear 40 px strip outside the box (a 1 px element can't carry a -10 px spread shadow) */
.scene-lines::before { bottom: calc(100% - 1px); border-bottom: 1px solid rgba(30, 26, 22, .12); box-shadow: 0 6px 16px -10px rgba(60, 40, 20, .35); }
.scene-lines::after { top: calc(100% - 1px); border-top: 1px solid rgba(30, 26, 22, .12); box-shadow: 0 -6px 16px -10px rgba(60, 40, 20, .35); }
.hinoki-mats > .edge { position: absolute; top: calc(-1 * var(--rail)); bottom: calc(-1 * var(--rail)); left: 0; right: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 6px 16px -10px rgba(60, 40, 20, .35), inset 0 -6px 16px -10px rgba(60, 40, 20, .35); }
.hinoki-scene::after { content: ""; position: absolute; inset: 0 0 auto; height: 18px; z-index: 3; background: linear-gradient(rgba(70, 52, 24, .16), transparent); }
/* Tatami-style woven rush in the lattice openings: fine horizontal strands
   laid in narrow vertical columns, a muted straw beige leaning olive, with
   soft unevenness in the strands. Static; window light from the upper left
   and a little shade at the edges as before. */
.hinoki-mats .paper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 18% 12%, rgba(255, 248, 225, 0.42), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(84, 70, 38, 0.2) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='r'><feTurbulence type='fractalNoise' baseFrequency='0.012 0.45' numOctaves='2' seed='11' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.38 0 0 0 0 0.2 0 0 0 0.3 -0.06'/></filter><rect width='100%' height='100%' filter='url(%23r)'/></svg>"),
    repeating-linear-gradient(90deg, rgba(92, 80, 44, 0.05) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(180deg, rgba(96, 82, 46, 0.08) 0 1px, rgba(255, 246, 214, 0.05) 1px 2px, transparent 2px 3px),
    linear-gradient(180deg, #d3c8a6 0%, #ccc19e 60%, #c4b894 100%);
}

/* tatami wall: eight mats (seven full, one half) interlocking on a 3 x 5 grid of half-mat units */
.hinoki-mats .mats {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 3px;
  background: var(--timber);
  box-shadow: inset 0 0 22px rgba(70, 50, 30, 0.2);
  /* not dimmed: Soroban darkens the mats so its board stands out; here they keep their natural colour */
  /* portrait: 3 across, 5 down */
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, 1fr);
  grid-template-areas:
    "m1 m1 m2"
    "m3 m4 m2"
    "m3 m5 m6"
    "m7 m5 m6"
    "m7 m8 m8";
}

.hinoki-mats .m1 { grid-area: m1; } .hinoki-mats .m2 { grid-area: m2; } .hinoki-mats .m3 { grid-area: m3; } .hinoki-mats .m4 { grid-area: m4; }
.hinoki-mats .m5 { grid-area: m5; } .hinoki-mats .m6 { grid-area: m6; } .hinoki-mats .m7 { grid-area: m7; } .hinoki-mats .m8 { grid-area: m8; }

.hinoki-mats .mat {
  --hw: 10px;
  /* long-horizontal mats: strands run up and down (across the mat) */
  --heri: var(--heri-h);
  --strand: 90deg;
  --bind: 180deg;
  background:
    var(--heri) 0 0 / 100% 100% no-repeat,
    radial-gradient(ellipse 120% 90% at 50% 45%, transparent 60%, rgba(84, 70, 38, 0.16) 100%),
    repeating-linear-gradient(var(--bind), rgba(92, 80, 44, 0.05) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(var(--strand), rgba(96, 82, 46, 0.08) 0 1px, rgba(255, 246, 214, 0.05) 1px 2px, transparent 2px 3px),
    linear-gradient(180deg, #d3c8a6 0%, #ccc19e 60%, #c4b894 100%),
    linear-gradient(#263f22, #263f22);
  /* The weave is clipped inside a transparent border as wide as the edging,
     and a solid green layer lies under the patterned edging, so no pale
     weave can show at the mat's outer edge where Safari leaves the edging
     image a fraction of a pixel short. */
  box-sizing: border-box;
  border: var(--hw) solid transparent;
  background-origin: border-box, padding-box, padding-box, padding-box, padding-box, border-box;
  background-clip: border-box, padding-box, padding-box, padding-box, padding-box, border-box;
  /* a small shadow round each mat, so it sits a little proud of the seams */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85));
}

/* portrait layout: m2, m3, m5, m6, m7 stand upright; m4 is the half mat */
.hinoki-mats .m2, .hinoki-mats .m3, .hinoki-mats .m5, .hinoki-mats .m6, .hinoki-mats .m7 { --heri: var(--heri-v); --strand: 180deg; --bind: 90deg; }
.hinoki-mats .m4 { --heri: var(--heri-sq); }

/* wide walls: the same layout turned on its side */
@container (min-aspect-ratio: 1 / 1) {
  .hinoki-mats .mats {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    grid-template-areas:
      "m1 m3 m3 m7 m7"
      "m1 m4 m5 m5 m8"
      "m2 m2 m6 m6 m8";
  }
  .hinoki-mats .m1, .hinoki-mats .m8 { --heri: var(--heri-v); --strand: 180deg; --bind: 90deg; }
  .hinoki-mats .m2, .hinoki-mats .m3, .hinoki-mats .m5, .hinoki-mats .m6, .hinoki-mats .m7 { --heri: var(--heri-h); --strand: 90deg; --bind: 180deg; }
}

.hinoki-mats .mats .mat { --hw: 10px; }
@media (max-width: 860px) { .hinoki-mats .mats .mat { --hw: 6px; } }

.hinoki-mats {
  --fibre: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9 0.35' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0 0.3 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --heri-h: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><defs><pattern id='w' width='6' height='6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='6' height='6' fill='%23263f22'/><rect width='2.2' height='6' fill='%23305229' opacity='0.55'/></pattern></defs><rect width='100%' height='10' fill='url(%23w)'/><svg y='100%' overflow='visible'><rect y='-10' width='100%' height='10' fill='url(%23w)'/></svg><rect width='10' height='100%' fill='url(%23w)'/><svg x='100%' overflow='visible'><rect x='-10' width='10' height='100%' fill='url(%23w)'/></svg><svg x='10.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='10.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='30.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='30.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='50.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='50.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='70.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='70.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='90.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='90.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='25.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='25.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='75.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='75.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg></svg>");
  --heri-v: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><defs><pattern id='w' width='6' height='6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='6' height='6' fill='%23263f22'/><rect width='2.2' height='6' fill='%23305229' opacity='0.55'/></pattern></defs><rect width='100%' height='10' fill='url(%23w)'/><svg y='100%' overflow='visible'><rect y='-10' width='100%' height='10' fill='url(%23w)'/></svg><rect width='10' height='100%' fill='url(%23w)'/><svg x='100%' overflow='visible'><rect x='-10' width='10' height='100%' fill='url(%23w)'/></svg><svg x='25.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='25.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='75.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='75.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='10.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='10.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='30.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='30.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='50.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='50.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='70.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='70.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='90.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='90.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg></svg>");
  --heri-sq: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><defs><pattern id='w' width='6' height='6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='6' height='6' fill='%23263f22'/><rect width='2.2' height='6' fill='%23305229' opacity='0.55'/></pattern></defs><rect width='100%' height='10' fill='url(%23w)'/><svg y='100%' overflow='visible'><rect y='-10' width='100%' height='10' fill='url(%23w)'/></svg><rect width='10' height='100%' fill='url(%23w)'/><svg x='100%' overflow='visible'><rect x='-10' width='10' height='100%' fill='url(%23w)'/></svg><svg x='16.667%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='16.667%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='50.0%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='50.0%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='83.333%' y='5.0' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='83.333%' y='100%' overflow='visible'><g transform='translate(0 -5.0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='16.667%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='16.667%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='50.0%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='50.0%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='5.0' y='83.333%' overflow='visible'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='83.333%' overflow='visible'><g transform='translate(-5.0 0)'><path d='M0 -3.0L3.0 0L0 3.0L-3.0 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg></svg>");
}

@media (max-width: 860px) {
  .hinoki-mats {
    --heri-h: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><defs><pattern id='w' width='6' height='6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='6' height='6' fill='%23263f22'/><rect width='2.2' height='6' fill='%23305229' opacity='0.55'/></pattern></defs><rect width='100%' height='6' fill='url(%23w)'/><svg y='100%' overflow='visible'><rect y='-6' width='100%' height='6' fill='url(%23w)'/></svg><rect width='6' height='100%' fill='url(%23w)'/><svg x='100%' overflow='visible'><rect x='-6' width='6' height='100%' fill='url(%23w)'/></svg><svg x='10.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='10.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='30.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='30.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='50.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='50.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='70.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='70.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='90.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='90.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='25.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='25.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='75.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='75.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg></svg>");
    --heri-v: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><defs><pattern id='w' width='6' height='6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='6' height='6' fill='%23263f22'/><rect width='2.2' height='6' fill='%23305229' opacity='0.55'/></pattern></defs><rect width='100%' height='6' fill='url(%23w)'/><svg y='100%' overflow='visible'><rect y='-6' width='100%' height='6' fill='url(%23w)'/></svg><rect width='6' height='100%' fill='url(%23w)'/><svg x='100%' overflow='visible'><rect x='-6' width='6' height='100%' fill='url(%23w)'/></svg><svg x='25.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='25.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='75.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='75.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='10.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='10.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='30.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='30.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='50.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='50.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='70.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='70.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='90.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='90.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg></svg>");
    --heri-sq: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><defs><pattern id='w' width='6' height='6' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><rect width='6' height='6' fill='%23263f22'/><rect width='2.2' height='6' fill='%23305229' opacity='0.55'/></pattern></defs><rect width='100%' height='6' fill='url(%23w)'/><svg y='100%' overflow='visible'><rect y='-6' width='100%' height='6' fill='url(%23w)'/></svg><rect width='6' height='100%' fill='url(%23w)'/><svg x='100%' overflow='visible'><rect x='-6' width='6' height='100%' fill='url(%23w)'/></svg><svg x='16.667%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='16.667%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='50.0%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='50.0%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='83.333%' y='3.0' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='83.333%' y='100%' overflow='visible'><g transform='translate(0 -3.0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='16.667%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='16.667%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='50.0%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='50.0%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg><svg x='3.0' y='83.333%' overflow='visible'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></svg><svg x='100%' y='83.333%' overflow='visible'><g transform='translate(-3.0 0)'><path d='M0 -1.7999999999999998L1.7999999999999998 0L0 1.7999999999999998L-1.7999999999999998 0Z' fill='none' stroke='%237f9466' stroke-width='0.8' opacity='0.55'/></g></svg></svg>");
  }
}

/* Soft daylight, breathing very slowly */
.hinoki-mats .light {
  position: absolute;
  inset: -10%;
  /* one broad glow from a window at the upper left: no narrow bands, which
     read as pale streaks across the large mats */
  background: radial-gradient(ellipse 60% 70% at 15% 10%, rgba(255, 250, 236, 0.16), transparent 70%);
}

/* Paper fibre and grain over everything */
.hinoki-mats .grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: var(--fibre);
}


body[data-view="study"] .floor { padding-top: var(--study-pad, 24px); padding-bottom: 20px; } /* --study-pad: c/hinoki.js centres the card */

/* level picker: Ma's grid and card geometry (so N1 falls under N5 at four columns, beside N2 at three), rows at least
   --row-h tall so the box can be sized for them */
.levels { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); grid-auto-rows: minmax(var(--row-h), 1fr); gap: 16px; }
.level {
  border: 0; background: var(--paper); border-radius: 14px; padding: 22px 20px 18px; box-shadow: var(--shadow-card);
  line-height: 1.6; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
}
/* level accent: honey, 6 px (Ma dark's is 4) */
.level::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--honey); opacity: .55; }
.level:hover { transform: translateY(-2px); box-shadow: 0 1px 1px rgba(70, 58, 26, .1), 0 16px 30px -10px rgba(70, 58, 26, .38); }
.level[disabled] { opacity: .6; transform: none; }
.level, .level-card { display: flex; flex-direction: column; }
.level-card { flex: 1; }
.level-card > * { align-self: flex-start; width: auto; }
.level-card > .level-meter { align-self: stretch; }
.level-name { font-family: var(--serif-ja); font-weight: 500; font-size: 34px; line-height: 1.1; color: var(--ink); }
.level-sub { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.level-meter { height: 4px; background: rgba(148, 101, 53, .14); margin: auto 0 8px; border-radius: 4px; } /* the meter and count sit at the card's foot */
.level-sub { margin-bottom: 16px; }
.level-meter span { background: var(--honey); border-radius: 4px; }
.level-stats { font-size: 13px; color: var(--ink-faint); }
/* N1 (not available yet): mostly see-through paper, no outline or shadow, no lift; dark text so it stays readable over
   the mats' seams */
.level-soon { background: rgba(250, 246, 238, .56); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: none; opacity: 1; }
.level-soon::after { opacity: .22; }
.level-soon .level-name, .level-soon .level-sub, .level-soon .level-soon-tag { color: var(--ink); }
.level-soon .level-soon-tag { border-color: rgba(34, 31, 26, .35); }
.level-soon:hover { transform: none; box-shadow: none; }
.level-soon .level-name { color: var(--ink-soft); }
.level-soon .level-meter { background: rgba(84, 76, 66, .12); }
.level-soon-tag { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: 12px; letter-spacing: .04em; border: 1px solid var(--line-strong); color: var(--ink-soft); }
/* draft coverage: below the box, small, its text starting exactly at the box's outer left edge (the outer edge of the
   left post) at every width */
#view-home .draft-note {
  --box-left: calc((100% - min(var(--frame-max), 100% - 2 * var(--frame-gutter))) / 2);
  max-width: min(72em, calc(100% - 2 * var(--box-left))); padding: 0; margin: 48px 0 0 var(--box-left);
  color: var(--ink-faint); font-size: 12.5px; line-height: 1.6;
}
.draft-note strong { color: var(--ink-soft); font-weight: 600; }

/* study */
.back-link { text-decoration: none; color: var(--ink-soft); font-size: 15px; }
.back-link:hover { color: var(--ink); }
.progress { color: var(--ink-faint); font-size: 14px; }
.study-head { margin-bottom: 0; }
.progress-track { height: 3px; margin-top: 12px; margin-bottom: 26px; background: none; padding: 0; max-width: calc(var(--wrap) - 2 * var(--gutter)); }
.progress-track { background: rgba(148, 101, 53, .16); border-radius: 3px; }
.progress-track span { background: var(--honey); }
.card { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-card); max-width: 700px; margin: 0 auto; }
.card-inner { --pad-x: clamp(20px, 5vw, 58px); --pad-b: clamp(26px, 4vw, 42px); position: relative; padding: clamp(26px, 5vw, 50px) var(--pad-x) var(--pad-b); min-height: 380px; }
.face-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--honey); }
.note-flag { text-transform: none; letter-spacing: 0; color: var(--ink-faint); }
/* a long word (--n chars) shrinks to stay on one line */
.card { container-type: inline-size; }
.target-word { font-family: var(--serif-ja); font-weight: 500; font-size: min(clamp(56px, 13vw, 92px), max(30px, (100cqi - 2 * clamp(20px, 5vw, 58px)) / (var(--n, 1) * 1.04 + .1))); line-height: 1.15; margin: 6px 0 22px; letter-spacing: .04em; color: var(--ink); }
.target-word ruby rt { font-family: var(--sans-ja); font-size: .25em; letter-spacing: .04em; color: var(--honey-deep); }
.sentence { font-family: var(--sans-ja); font-size: clamp(20px, 4.4vw, 25px); line-height: 2.1; margin: 0 auto 8px; max-width: 30em; }
/* the word's underline sits on the same line as the dotted helper underlines (same offset under the text) */
.sentence .tgt { color: var(--honey-deep); text-decoration: underline solid rgba(148, 101, 53, .5); text-decoration-thickness: 2px; text-underline-offset: .32em; text-decoration-skip-ink: none; }
.helper { text-decoration: underline dotted rgba(34, 31, 26, .4); text-decoration-thickness: 1.5px; text-underline-offset: .32em; border-radius: 3px; }
.helper:hover, .helper[aria-expanded="true"] { background: rgba(148, 101, 53, .12); text-decoration-color: var(--honey); }
.helper-hint { color: var(--ink-faint); font-size: 13px; margin: 2px 0 0; }
/* front: word and example centred; the optional guess at the foot */
.front-body { flex: 1 0 auto; display: flex; flex-direction: column; padding-bottom: 6px; }
/* centred, at most 12vh down (a tall card's word stays in view) */
.front-body::before, .front-body::after { content: ""; flex: 1 1 0; }
.front-body::before { max-height: 12vh; }
.front-body .target-word { margin-top: 0; }
.recall { padding-top: 18px; }
.recall input { max-width: 420px; padding: 11px 14px; font: 17px var(--sans-ko); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper-2); color: var(--ink); }
.recall input::placeholder { color: #7a7064; }
.recall input:focus { outline: 2px solid var(--link); outline-offset: 1px; background: var(--paper); }
.meaning-ko { font-family: var(--serif-ko); font-size: clamp(25px, 5.4vw, 32px); font-weight: 600; margin: 4px 0 2px; }
/* one meaning, in the selected language only (app.js): Korean as before, English in the same place a little smaller */
.meaning-en { font-family: var(--serif-ko); font-size: clamp(20px, 4.4vw, 25px); font-weight: 600; line-height: 1.4; margin: 4px 0 2px; }
.meaning-en.is-long { font-size: clamp(16px, 3.4vw, 18px); font-weight: 500; line-height: 1.5; } /* the few long dictionary glosses */
.answer .meaning { overflow-wrap: break-word; }
.divider { border: 0; height: 6px; width: 56px; margin: 18px auto; background: linear-gradient(var(--moss), var(--moss)) 0 50% / 100% 2px no-repeat; }
/* the whole sentence in the selected language */
.sentence-tr { font-family: var(--sans); font-size: clamp(16.5px, 3.7vw, 19px); line-height: 1.5; color: var(--ink-soft); margin: 2px auto 0; max-width: 34em; overflow-wrap: break-word; }
.sentence-ko { font-family: var(--sans-ko); word-break: keep-all; overflow-wrap: anywhere; }
/* the typed guess: one line in the bottom padding (title holds it all), so it never adds height */
.guess { position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: 0; height: var(--pad-b); margin: 0; font-size: 12.5px; line-height: var(--pad-b); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-faint); }
.guess span { color: var(--ink-soft); }
.text-btn { color: var(--link); font-size: 14px; padding: 6px 8px; text-decoration: underline; text-underline-offset: 3px; }
.full-reading { font-family: var(--sans-ja); color: var(--ink-soft); font-size: 15px; margin: 2px 0 0; }
/* the opt-in kana sentence: a small quiet link */
.kana-toggle { font-size: 12.5px; color: var(--ink-faint); padding: 6px 8px; margin-top: 10px; text-decoration-color: rgba(103, 94, 83, .45); }
.kana-toggle:hover { color: var(--ink-soft); text-decoration-color: currentColor; }
.actions { max-width: 700px; margin: 20px auto 0; gap: 12px; }
.btn {
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 500 16px var(--sans);
  padding: 12px 22px; border-radius: 12px; min-height: 48px; box-shadow: 0 1px 2px rgba(70, 58, 26, .1);
}
html[lang="ko"] .btn { font-family: var(--sans-ko); }
.btn:hover { border-color: rgba(148, 101, 53, .55); }
.btn.primary { background: var(--honey-deep); border-color: var(--honey-deep); color: #fffaf1; }
.btn.primary:hover { background: #573616; }
.btn.quiet { background: var(--paper-2); }
#view-study .kbd-hint { display: none; } /* keys still work */
.kbd-hint { text-align: center; margin: 16px auto 0; width: fit-content; padding: 4px 12px; border-radius: 99px; background: rgba(253, 249, 241, .9); color: var(--ink-soft); font-size: 13px; }
kbd { font: 12px var(--sans); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--paper); }
.done { padding: 40px 10px; }
.done .big { font-family: var(--serif-ja); font-size: 48px; color: var(--honey-deep); }

/* popover */
.popover { background: var(--paper); border: 1px solid rgba(148, 101, 53, .3); border-radius: 12px; box-shadow: 0 12px 30px rgba(40, 28, 12, .18); padding: 12px 14px; }
.popover .p-word { font-family: var(--sans-ja); font-size: 22px; }
.popover .p-reading { font-family: var(--sans-ja); color: var(--honey-deep); font-size: 16px; }
.popover .p-lemma { font-size: 13px; color: var(--ink-faint); font-family: var(--sans-ja); }
.popover .p-ko { font-family: var(--sans-ko); font-size: 17px; margin-top: 6px; }
.popover .p-en { font-size: 13px; color: var(--ink-faint); }
.popover .p-level { display: inline-block; margin-top: 8px; font-size: 11px; letter-spacing: .06em; padding: 1px 8px; border-radius: 99px; background: rgba(148, 101, 53, .12); color: var(--honey-deep); }

/* learned: a file cabinet, one paper panel inside the box with the level filters and search at its top and a list
   that scrolls inside it (app.js draws only the rows in view). The box keeps the shared default height. */
/* About: the same box as Levels (top edge, height, room below); its sheet scrolls inside when sections are open, so
   opening one never changes the box. Scrolling chains to the page at either end (nothing traps the finger/wheel). */
body[data-view="about"] #view-about .floor { height: var(--box-h); display: flex; flex-direction: column; }
body[data-view="about"] #view-about .floor > .sheet { flex: 1 1 auto; min-height: 0; overflow-y: auto; width: 100%; box-sizing: border-box; }
/* its scrollbar as Learned's list (thin honey thumb, clear track, stable gutter), inset from the paper's edge by a clear
   border the paper shows through, so the thumb never reaches the rounded right corners; the padding gives that inset
   back, so the text and the box stay where they were */
body[data-view="about"] #view-about .floor > .sheet {
  scrollbar-width: thin; scrollbar-color: rgba(148, 101, 53, .45) transparent; scrollbar-gutter: stable;
  border: solid transparent; border-width: 10px 6px 10px 0;
  padding: calc(clamp(24px, 5vw, 48px) - 10px) calc(clamp(20px, 5vw, 56px) - 6px) calc(clamp(24px, 5vw, 48px) - 10px) clamp(20px, 5vw, 56px);
}
/* the cut line feathers out as in My words (.cabinet-feather; owner, 1 Nov 2026); at the end it hides nothing */
body[data-view="about"] #view-about .floor > .sheet { scroll-padding-bottom: 12px; }
body[data-view="about"] #view-about .floor > .sheet::after {
  content: ""; display: block; position: sticky; bottom: calc(10px - clamp(24px, 5vw, 48px)); height: 12px; pointer-events: none; /* = minus the bottom padding: the cut edge */
  background: linear-gradient(rgba(253, 249, 241, 0), var(--paper));
}
#view-about::after { content: ""; display: block; height: var(--below-h, 0px); }
.about-sec { border-top: 1px solid var(--line); }
.about-sec:last-of-type { border-bottom: 1px solid var(--line); }
.prose h2.about-h { margin: 0; font-size: inherit; }
.about-toggle { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 48px; padding: 12px 2px; cursor: pointer; font-family: var(--serif-ja); font-weight: 600; font-size: 19px; color: var(--ink); }
html[lang="ko"] .about-toggle { font-family: var(--serif-ko); }
.about-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
.about-chev { flex: 0 0 auto; width: 10px; height: 10px; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg); margin: -4px 6px 0 0; transition: transform .15s; }
.about-toggle[aria-expanded="true"] .about-chev { transform: rotate(225deg); margin-top: 4px; }
.about-panel { padding: 0 2px 14px; }
.about-panel > :first-child { margin-top: 0; }
pre.license { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .about-chev { transition: none; } }
body[data-view="learned"] #view-learned .floor { height: var(--box-h); display: flex; flex-direction: column; padding-top: 32px; padding-bottom: 28px; }
.cabinet { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; max-width: 760px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-card); padding: 18px 18px 6px; }
.tabs { gap: 6px; margin: 0 0 12px; padding: 0; max-width: none; }
.tab { border: 1px solid var(--line-strong); background: transparent; border-radius: 99px; padding: 6px 14px; font-size: 14px; color: var(--ink-soft); }
.tab:hover { border-color: rgba(148, 101, 53, .55); }
.tab[aria-selected="true"] { background: var(--honey-deep); color: #fffaf1; border-color: var(--honey-deep); }
.tab-soon, .tab-soon:hover { color: var(--ink-faint); border-color: var(--line); cursor: not-allowed; }
.cabinet-search input {
  width: 100%; padding: 10px 14px 10px 38px; font: 16px var(--sans-ko); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--paper-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7064' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 13px 50%;
}
.cabinet-search input::placeholder { color: #7a7064; }
.cabinet-search input:focus { outline: 2px solid var(--link); outline-offset: 1px; background-color: var(--paper); }
.cabinet-status { margin: 10px 4px 6px; min-height: 1.6em; font-size: 13px; color: var(--ink-faint); }
.cabinet-status .text-btn { font-size: 13px; padding: 2px 4px; }
.cabinet-scroll {
  --row: 48px; flex: 1 1 auto; min-height: 120px; overflow-y: auto; border-top: 1px solid var(--line); scrollbar-gutter: stable;
  scrollbar-width: thin; scrollbar-color: rgba(148, 101, 53, .45) transparent;
}
/* one continuous hairline between the word and translation columns, painted by the list's frame so it does not scroll
   or break between rows; and a narrow feather where the frame cuts a row, which sits below the last row at the very end */
.cabinet-scroll { --sep-x: calc(24px + 10em); }
.cabinet-scroll.has-rows { background: linear-gradient(var(--line-strong), var(--line-strong)) no-repeat var(--sep-x) 0 / 1px 100%; }
.cabinet-feather {
  position: sticky; bottom: 0; height: 12px; pointer-events: none; --fade: linear-gradient(rgba(253, 249, 241, 0), var(--paper)); background: var(--fade) no-repeat 0 0 / var(--sep-x) 100%, var(--fade) no-repeat calc(var(--sep-x) + 1px) 0 / calc(100% - var(--sep-x) - 1px) 100%; /* the divider shows through unfaded */
}
.cabinet-scroll:not(.has-rows) .cabinet-feather { display: none; }
.cabinet-scroll:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.learned-list { position: relative; display: block; max-width: none; margin: 0; }
.learned-item {
  position: absolute; left: 0; right: 0; top: 0; height: var(--row); display: grid; grid-template-columns: minmax(0, 10em) minmax(0, 1fr) auto;
  align-items: center; gap: 0 14px; padding: 0 8px 0 10px; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none;
}
.learned-item:hover, .learned-item:focus-within { background: rgba(148, 101, 53, .05); }
/* word and translation at one small size (13 px), a hairline between them; long text ends in … (full text in the title) */
.li-word { font-family: var(--serif-ja); font-size: 13px; line-height: 1.5; color: var(--ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-meta { min-width: 0; font-size: 13px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 14px; }
.li-ko { font-family: var(--sans-ko); font-size: 13px; color: var(--ink); }
.li-en { font-size: 13px; color: var(--ink); }
.li-actions { display: flex; gap: 2px; white-space: nowrap; grid-column: auto; } /* one line down to 521 px (base.css wraps from 640) */
.li-actions .text-btn { padding: 8px; min-height: 40px; }
.empty { margin: 14px 2px; color: var(--ink-soft); padding: 22px 24px; background: var(--paper-2); border-radius: 12px; text-align: center; }
.learned-tools { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 18px auto 0; max-width: 760px; }
.revise-all { min-width: 220px; }
.revise-all[disabled] { opacity: .55; cursor: not-allowed; }
.revise-note, .reset-link { margin: 0; font-size: 13px; color: var(--ink-soft); background: rgba(253, 249, 241, .94); padding: 4px 12px; border-radius: 99px; text-align: center; }
.reset-link { color: var(--link); }
/* phones: two lines a row (word and meaning, then the two actions) */
@media (max-width: 520px) {
  .cabinet { padding: 14px 12px 4px; }
  .cabinet-scroll { --row: 72px; --sep-x: calc(18px + 7em); }
  .learned-item { grid-template-columns: minmax(0, 7em) minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 12px; padding: 4px 4px 2px 6px; align-content: center; }
  .li-actions { grid-column: 1 / -1; justify-self: end; }
}
/* narrow phones: the list a little wider, the word column and the buttons a little narrower, so the actions ("Revisit",
   "Back to new") stay right of the divider */
@media (max-width: 374px) {
  .cabinet-scroll { margin-left: -6px; margin-right: -6px; --sep-x: calc(18px + 6em); }
  .learned-item { grid-template-columns: minmax(0, 6em) minmax(0, 1fr); }
  .li-actions .text-btn { padding-left: 4px; padding-right: 4px; font-size: 13px; }
}

/* about: a paper sheet on the mats */
.sheet { max-width: 760px; margin: 0 auto; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-on-mat); padding: clamp(24px, 5vw, 48px) clamp(20px, 5vw, 56px); }
.prose h2 { font-family: var(--serif-ja); font-weight: 600; font-size: 19px; margin: 30px 0 6px; }
html[lang="ko"] .prose h2 { font-family: var(--serif-ko); }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 1.2em; }
.stats-table { font-size: 14px; margin: 0 0 12px; }
/* optional account: the same paper sheet as About, its email field like the card's guess field */
.account > :first-child, .account > .acct-dev[hidden] + * { margin-top: 0; }
.account label { display: block; font-size: 14px; color: var(--ink-soft); margin: 0 0 6px; }
.acct-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.acct-row input { flex: 1 1 220px; min-width: 0; padding: 11px 14px; font: 17px var(--sans-ko); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper-2); color: var(--ink); }
.acct-row input:focus { outline: 2px solid var(--link); outline-offset: 1px; background: var(--paper); }
.acct-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.acct-small, .acct-msg { font-size: 14px; }
.acct-msg:empty { display: none; }
.acct-dev { font-size: 13px; color: var(--honey-deep); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; }
.text-btn.acct-danger { color: #8a2c1d; }
.btn.acct-danger { color: #8a2c1d; }
.acct-primary { margin-top: 18px; }
.acct-more { margin-top: 22px; font-size: 14px; color: var(--ink-soft); }
.acct-more > summary { cursor: pointer; width: fit-content; padding: 6px 0; min-height: 32px; }
.acct-more > .acct-actions { margin-top: 6px; }
/* More options keeps the box (owner, 1 Nov 2026; account.js fitMore): the sheet scrolls inside, About's inset bar */
#account-body {
  overflow-y: auto; box-sizing: border-box;
  scrollbar-width: thin; scrollbar-color: rgba(148, 101, 53, .45) transparent; scrollbar-gutter: stable;
  border: solid transparent; border-width: 10px 6px 10px 0;
  padding: calc(clamp(24px, 5vw, 48px) - 10px) calc(clamp(20px, 5vw, 56px) - 6px) calc(clamp(24px, 5vw, 48px) - 10px) clamp(20px, 5vw, 56px);
}
.acct-more.acct-measure > :not(summary) { display: none; }
.account p > .text-btn:first-child { margin-left: -8px; } /* the link's text lines up with the sheet's text */
.stats-table th { font-weight: 600; color: var(--ink-soft); font-size: 13px; }
.stats-table th, .stats-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }

/* footer: no "Ma · a draft for learning…" line in this concept, only room below the page */
main { padding-bottom: 56px; }
.foot { margin-top: 0; }
.foot-inner { display: none; }

/* welcome */
.welcome-backdrop { background: rgba(40, 32, 20, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.welcome-card { padding: 30px 34px 24px; background: var(--paper); border-radius: 20px; box-shadow: 0 30px 70px rgba(30, 20, 8, .3); }
/* the welcome never runs off the screen: at most the window less a margin, scrolling inside itself if longer */
.welcome-card { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; }
.welcome-close { background: transparent; color: var(--ink-faint); border-radius: 50%; }
.welcome-close:hover { background: var(--paper-2); color: var(--ink); }
.welcome-brand { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.welcome-mark { font-family: var(--serif-ja); font-size: 18px; letter-spacing: 0; color: var(--honey-deep); margin-right: 3px; }
.greeting { font-weight: 500; font-size: clamp(32px, 8.5vw, 42px); color: var(--ink); }
.greeting [lang="en"], .greeting [lang="ja"] { font-family: var(--serif-ja); }
.greeting [lang="ko"] { font-family: var(--serif-ko); }
.greeting-caret { background: var(--honey-deep); }
.greeting-dot { color: var(--ink-faint); }
.welcome-ask { color: var(--ink-soft); font-size: 15px; }
.welcome-langs .btn[aria-pressed="true"] { border-color: var(--honey); box-shadow: inset 0 0 0 1px var(--honey); }
@media (hover: hover) { .welcome-langs .btn:hover { background: var(--honey-deep); border-color: var(--honey-deep); color: #fffaf1; } }
.welcome-lede { margin: 0 0 20px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.65; }
.welcome-steps { gap: 14px; }
.welcome-steps li { gap: 14px; }
.welcome-steps strong { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.welcome-steps span:not(.welcome-num) { margin-top: 1px; font-size: 14px; line-height: 1.5; color: var(--ink-faint); }
.welcome-num { width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; border: 1px solid rgba(148, 101, 53, .4); color: var(--honey-deep); font-size: 13px; font-family: var(--serif-ja); }
.welcome-heri { height: 7px; margin: 22px 0; border-radius: 1px; background: repeating-linear-gradient(45deg, #4f6142 0 2px, #5f7350 2px 5px); }
.welcome-hide { font-size: 14px; color: var(--ink-soft); }
.welcome-hide input { accent-color: var(--honey-deep); }
.welcome-back { padding: 8px 4px; color: var(--ink-soft); font-size: 14px; }
/* the app for iPhone and iPad: one welcome step (once, after the language) and a block in About. Text only, no Apple
   artwork; heri diamonds as bullets; About's block has the level cards' honey edge. */
.welcome-note { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.app-title { font-family: var(--serif-ja); font-weight: 600; font-size: 20px; line-height: 1.35; margin: 0 0 6px; color: var(--ink); }
html[lang="ko"] .app-title, html[lang="ko"] .app-block h2 { font-family: var(--serif-ko); }
.welcome-step .app-lede { margin-bottom: 14px; }
.app-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.prose .app-points { padding-left: 0; }
.app-points li { position: relative; padding-left: 22px; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.app-points li::before { content: ""; position: absolute; left: 3px; top: .58em; width: 6px; height: 6px; border: 1.3px solid var(--honey); transform: rotate(45deg); }
.app-actions { display: grid; gap: 10px; }
.app-cta { display: flex; }
.app-cta > * { flex: 1 1 auto; }
.app-later { justify-self: center; min-height: 44px; padding: 8px 16px; color: var(--ink-soft); font-size: 15px; }
.app-later:hover { color: var(--ink); }
/* one or the other: underlined at rest; with keyboard focus the ring instead of the underline */
.app-later:focus-visible { text-decoration: none; }
/* the step opens with focus on its heading (tabindex=-1, not a control): no ring there */
.app-title:focus, .app-title:focus-visible { outline: none; }
.app-store { text-align: center; }
.app-store-search { margin: 0; padding: 4px 0 2px; color: var(--ink); font-weight: 500; font-size: 15.5px; line-height: 1.45; } /* no link yet: plain text, no box */
.welcome-step .app-store-search { text-align: center; }
.app-block { position: relative; overflow: hidden; margin: 0 0 30px; padding: 20px 22px 18px 30px; background: var(--paper-2); border-radius: 14px; }
.app-block::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--honey); opacity: .55; }
.prose .app-block h2 { margin: 0 0 4px; font-size: 20px; }
.app-block > p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.55; }
.app-block .app-cta { display: flex; margin-top: 18px; max-width: 340px; }
.prose .app-block .app-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-faint); }

/* tablet and phone */
@media (max-width: 860px) {
  :root { --gutter: 24px; --rail: 9px; --vpad: 32px; --frame-gutter: 16px; --mat-margin: 18px; --study-h: 794px; } /* up to 779 px */
  .floor { padding-top: 36px; padding-bottom: 40px; }
  h1 { font-size: 23px; }
  #view-home .draft-note { margin-top: 40px; }
}
@media (max-width: 640px) {
  :root { --gutter: 18px; --rail: 7px; --vpad: 24px; --frame-gutter: 6px; --mat-margin: 11px; --ma-grid: calc(100% - 28px); --study-h: 712px; } /* up to 698 px */
  h1 { font-size: 22px; }
  #view-home .intro p { font-size: 14.5px; }
  #view-home .draft-note { margin-top: 32px; }
  main { padding-bottom: 40px; }
  .bar-inner { padding: 10px var(--gutter); }
  .brand-text { display: none; }
  .bar-right { gap: 6px; }
  nav[aria-label] { gap: 0; }
  .bar nav a { padding: 8px 6px; font-size: 14px; } /* (was "nav a", which ".bar nav a" outranked) */
  .lang-switch button { padding: 4px 8px; font-size: 12px; min-height: 28px; }
  main { padding-top: 22px; }
  .intro { margin-bottom: 20px; }
  .intro p { font-size: 15.5px; }
  .floor { padding-top: 26px; padding-bottom: 30px; }
  .card-inner { min-height: 320px; }
  .progress-track { margin-left: var(--gutter); margin-right: var(--gutter); }
  #view-study > .head-band > .progress-track { width: auto; }
  #view-study .actions { background: rgba(240, 233, 220, .96); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
  #view-study .actions .btn { padding: 12px 8px; font-size: 15px; }
  #view-study .actions #flip-back { padding: 12px; }
  .welcome-backdrop { align-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .welcome-card { width: min(360px, 100%); padding: 22px 20px 16px; border-radius: 16px; }
  .greeting { font-size: clamp(28px, 8vw, 34px); margin-bottom: 12px; }
  .welcome-ask { font-size: 14.5px; margin-bottom: 12px; }
  .welcome-langs .btn { min-height: 48px; }
  .welcome-lede { font-size: 14.5px; line-height: 1.55; margin-bottom: 14px; }
  .welcome-steps { gap: 10px; }
  .welcome-steps li { gap: 12px; }
  .welcome-steps strong { font-size: 14.5px; }
  .welcome-steps span:not(.welcome-num) { font-size: 13px; line-height: 1.45; }
  .welcome-num { width: 24px; height: 24px; font-size: 12px; }
  .welcome-heri { margin: 16px 0; }
  .welcome-note { font-size: 12px; }
  .app-title { font-size: 18px; }
  .welcome-step .app-lede { margin-bottom: 10px; }
  .app-points { gap: 7px; }
  .app-points li { font-size: 13.5px; line-height: 1.45; padding-left: 20px; }
  .app-block { padding: 16px 16px 14px 22px; margin-bottom: 24px; }
  .prose .app-block h2 { font-size: 18px; }
  .app-block .app-cta { max-width: none; }
  .app-block > p { font-size: 14.5px; }
}
/* the level grid wraps to three rows below 718 px (two columns) and to five below 464 px (one column) */
@media (max-width: 717px) { :root { --rows: 3; } }
@media (max-width: 463px) { :root { --rows: 5; --study-h: 806px; --vpad: 16px; } } /* answers up to 792 px; the five level rows are taller still */
@media (prefers-reduced-motion: reduce) { .level { transition: none; } .level:hover { transform: none; } }
/* so the English header fits a 390 px phone */
/* four nav items (Sign in / Account) and the language switch on one row: short "한" for 한국어 (read out in full) */
.lang-short { display: none; }
@media (min-width: 641px) and (max-width: 820px) { .bar nav a { padding-left: 8px; padding-right: 8px; } }
@media (max-width: 420px) {
  .bar nav a { padding-left: 5px; padding-right: 5px; font-size: 13.5px; }
  .lang-switch .lang-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lang-switch .lang-short { display: inline; }
}
/* the narrowest phones: keep the header on one row in Korean too */
@media (max-width: 380px) {
  .bar-inner { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .bar-right { gap: 4px; }
  .bar nav a { padding: 8px 3px; font-size: 12px; }
  .pill { min-width: 1.4em; padding: 0 4px; font-size: 11px; }
  .lang-switch button { padding: 3px 6px; font-size: 11.5px; }
}
/* a little tighter on the answer side, so the answer buttons stay in view on a laptop screen */
.answer .target-word { margin-bottom: 12px; }
.answer .meaning { margin-bottom: 14px; }
.answer .divider { margin-top: 12px; margin-bottom: 12px; }
@media (min-width: 641px) { .card-inner { padding-top: clamp(24px, 3.6vw, 40px); --pad-b: clamp(22px, 3vw, 34px); } }
/* Korean pages set word-break: keep-all (base.css), which Japanese inherits and then cannot wrap at all: a long kana word
   such as それはいけませんね ran past the card. Japanese text breaks normally again. */
html[lang="ko"] [lang="ja"] { word-break: normal; }
