@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-serif-4-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  --text-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Helvetica, Arial, sans-serif;
  --trans-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
                Helvetica, Arial, sans-serif;
  --text-scale: 1;
  --trans-scale: 1;

  --text-base: 1.35rem;
  --text-size: calc(var(--text-base) * var(--text-scale));
  --trans-size: calc(1.05rem * var(--trans-scale));

  --text-lead: 1.37;

  --trans-lines: 2;

  --ui-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
             Helvetica, Arial, sans-serif;
  --mono-font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --display-font: "Source Serif 4", Georgia, "Iowan Old Style",
                  "Times New Roman", serif;

  --ink-strong: #191622;
  --ink:        #2c2937;
  --ink-soft:   #56515f;
  --ink-mute:   #6b6577;
  --ink-faint:  #a8a2b2;

  --page:       #f6f4f0;
  --surface:    #ffffff;
  --surface-2:  #faf9f7;
  --surface-sunk: #f0edea;
  --line:       #e4e0da;
  --line-soft:  #eeebe6;

  --accent:       #5b4bd6;
  --accent-hover: #4a3ab8;
  --accent-text:  #4c3bb8;
  --accent-soft:  #e7e3fb;
  --accent-wash:  #f3f0fe;
  --accent-line:  #cbc3f2;
  --on-accent:    #ffffff;

  --scrim:           rgba(28, 24, 48, 0.42);

  --panel-loud:      #5b4bd6;
  --panel-loud-ink:  #ffffff;
  --panel-loud-mute: #e4e0fd;

  --warm:       #c2593a;
  --warm-text:  #a2452a;
  --warm-soft:  #fbe5dd;
  --warm-wash:  #fdf3ef;
  --warm-line:  #f2cbbd;

  --good:       #197a4b;
  --good-soft:  #ddf1e5;
  --good-line:  #b4ddc6;

  --danger:     #b32e28;
  --danger-soft:#fce8e6;
  --danger-line:#f2c9c5;

  --caution:    #92590f;
  --caution-soft:#fbeed8;
  --caution-line:#ecdcc2;

  --mark:       #ffe6a3;
  --speak:      #4634bd;
  --speak-dot:  #5b4bd6;
  --speak-wash: rgba(91, 75, 214, 0.06);

  --cover-bg-s: 46%;  --cover-bg-l: 88%;
  --cover-fg-s: 44%;  --cover-fg-l: 33%;

  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;
  --r-btn: 5px;

  --shadow-1: 0 1px 2px rgba(35, 28, 62, 0.05),
              0 1px 3px rgba(35, 28, 62, 0.05);
  --shadow-2: 0 2px 4px rgba(35, 28, 62, 0.05),
              0 8px 20px rgba(35, 28, 62, 0.08);
  --shadow-3: 0 8px 22px rgba(35, 28, 62, 0.10),
              0 26px 56px rgba(35, 28, 62, 0.14);

  --btn-face:       #ffffff;
  --btn-face-hover: #f7f4ef;
  --btn-edge:       #d5cec4;
  --btn-lip-neutral: #c0b6a4;
  --btn-lip:        #c0b6a4;
  --accent-lip:     #3d2fa6;
  --btn-ink:        #191622;
  --on-btn-ink:     #f6f4f0;

  --ring: #8f80ee;

  --kind-book:          color-mix(in srgb, var(--accent) 50%, var(--btn-edge));
  --kind-book-strong:   color-mix(in srgb, var(--accent) 80%, var(--btn-edge));
  --kind-article:       color-mix(in srgb, var(--good) 45%, var(--btn-edge));
  --kind-article-strong: color-mix(in srgb, var(--good) 75%, var(--btn-edge));
  --kind-own:           color-mix(in srgb, var(--warm) 50%, var(--btn-edge));
  --kind-own-strong:    color-mix(in srgb, var(--warm) 80%, var(--btn-edge));

  --glow-cool: rgba(91, 75, 214, 0.07);
  --glow-warm: rgba(194, 89, 58, 0.05);

  --flag-blue:  #2c4bab;
  --flag-white: #f7f6f3;
  --flag-red:   #d8443c;
  --flag-gold:  #edb734;
  --flag-black: #48465a;
  --flag-green: #2e9163;
  --flag-edge:  rgba(28, 24, 44, 0.24);

  --cover-0: #5140d0;
  --cover-1: #b83f22;
  --cover-2: #0c7a58;
  --cover-3: #f0b429;
  --cover-4: #1f58c7;
  --cover-5: #b8324a;
  --cover-6: #0d6e7c;
  --cover-7: #6b2f8f;
  --cover-ink:      #ffffff;
  --cover-ink-dark: #2b1d00;
  --cover-spine:    rgba(0, 0, 0, 0.16);

  --brand-tile:              #5b4bd6;
  --brand-ink:               #ffffff;
  --brand-underline:         #f4a882;
  --brand-underline-on-light: #c2593a;

  --google-blue:   #4285f4;
  --google-red:    #ea4335;
  --google-yellow: #fbbc05;
  --google-green:  #34a853;

  --bar-h: 54px;
  --col: 640px;
  --corner-w: 78px;
  --corner-gap: 8px;
  --corner-edge: 14px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --fs-xs:  0.75rem;
  --fs-sm:  0.86rem;
  --fs-md:  1rem;
  --fs-lg:  1.15rem;
  --fs-xl:  1.4rem;
  --fs-2xl: 1.75rem;

  --fs-display: clamp(2.1rem, 1.35rem + 3.2vw, 3rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {

  :root:not([data-theme="light"]) {
    --ink-strong: #f4f2f8;
    --ink:        #e4e1ea;
    --ink-soft:   #aaa5b6;
    --ink-mute:   #a29cae;
    --ink-faint:  #5b5668;

    --page:         #131218;
    --surface:      #1c1b24;
    --surface-2:    #24222d;
    --surface-sunk: #0f0e14;
    --line:         #34313f;
    --line-soft:    #27262f;

    --accent:       #a89bf5;
    --accent-hover: #bcb2f9;
    --accent-text:  #b3a7f7;
    --accent-soft:  #2b2647;
    --accent-wash:  #1f1c31;
    --accent-line:  #423b64;
    --on-accent:    #17132b;

    --scrim:           rgba(6, 5, 12, 0.66);

    --panel-loud:      #272045;
    --panel-loud-ink:  #f4f2f8;
    --panel-loud-mute: #b6aed0;

    --warm:       #ea9370;
    --warm-text:  #ea9370;
    --warm-soft:  #37231b;
    --warm-wash:  #261813;
    --warm-line:  #4e3125;

    --good:       #6cc48c;
    --good-soft:  #1a2f22;
    --good-line:  #2e4d3a;

    --danger:     #f0908a;
    --danger-soft:#33201e;
    --danger-line:#55322e;

    --caution:    #d9ab63;
    --caution-soft:#302614;
    --caution-line:#4c3d20;

    --mark:       #574722;
    --speak:      #b6a9ff;
    --speak-dot:  #9c8bfb;
    --speak-wash: rgba(255, 255, 255, 0.055);

    --cover-bg-s: 30%;  --cover-bg-l: 21%;
    --cover-fg-s: 46%;  --cover-fg-l: 72%;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.42),
                0 8px 22px rgba(0, 0, 0, 0.36);
    --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.5),
                0 24px 56px rgba(0, 0, 0, 0.45);

    --btn-face:       #2e2c3b;
    --btn-face-hover: #353348;
    --btn-edge:       #565272;
    --btn-lip-neutral: #1b1a26;
    --btn-lip:        #1b1a26;
    --accent-lip:     #6a5cbb;
    --btn-ink:        #f1eee8;
    --on-btn-ink:     #17151f;

    --ring: #a89bf5;

    --glow-cool: rgba(168, 155, 245, 0.085);
    --glow-warm: rgba(234, 147, 112, 0.045);
  }
}

:root[data-theme="dark"] {
    --ink-strong: #f4f2f8;
    --ink:        #e4e1ea;
    --ink-soft:   #aaa5b6;
    --ink-mute:   #a29cae;
    --ink-faint:  #5b5668;

    --page:         #131218;
    --surface:      #1c1b24;
    --surface-2:    #24222d;
    --surface-sunk: #0f0e14;
    --line:         #34313f;
    --line-soft:    #27262f;

    --accent:       #a89bf5;
    --accent-hover: #bcb2f9;
    --accent-text:  #b3a7f7;
    --accent-soft:  #2b2647;
    --accent-wash:  #1f1c31;
    --accent-line:  #423b64;
    --on-accent:    #17132b;

    --scrim:           rgba(6, 5, 12, 0.66);

    --panel-loud:      #272045;
    --panel-loud-ink:  #f4f2f8;
    --panel-loud-mute: #b6aed0;

    --warm:       #ea9370;
    --warm-text:  #ea9370;
    --warm-soft:  #37231b;
    --warm-wash:  #261813;
    --warm-line:  #4e3125;

    --good:       #6cc48c;
    --good-soft:  #1a2f22;
    --good-line:  #2e4d3a;

    --danger:     #f0908a;
    --danger-soft:#33201e;
    --danger-line:#55322e;

    --caution:    #d9ab63;
    --caution-soft:#302614;
    --caution-line:#4c3d20;

    --mark:       #574722;
    --speak:      #b6a9ff;
    --speak-dot:  #9c8bfb;
    --speak-wash: rgba(255, 255, 255, 0.055);

    --cover-bg-s: 30%;  --cover-bg-l: 21%;
    --cover-fg-s: 46%;  --cover-fg-l: 72%;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.42),
                0 8px 22px rgba(0, 0, 0, 0.36);
    --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.5),
                0 24px 56px rgba(0, 0, 0, 0.45);

    --btn-face:       #2e2c3b;
    --btn-face-hover: #353348;
    --btn-edge:       #565272;
    --btn-lip-neutral: #1b1a26;
    --btn-lip:        #1b1a26;
    --accent-lip:     #6a5cbb;
    --btn-ink:        #f1eee8;
    --on-btn-ink:     #17151f;

    --ring: #a89bf5;

    --glow-cool: rgba(168, 155, 245, 0.085);
    --glow-warm: rgba(234, 147, 112, 0.045);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--text-font);

  background-color: var(--page);
  background-image:
    radial-gradient(70rem 46rem at 8% -12%, var(--glow-cool), transparent 62%),
    radial-gradient(62rem 42rem at 104% -4%, var(--glow-warm), transparent 64%);
  background-attachment: fixed;
  background-repeat: no-repeat;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

.app-checking .screen {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.noscript {
  max-width: 32rem;
  margin: 15vh auto 0;
  padding: 0 var(--sp-5);
  font-family: var(--ui-font);
  color: var(--ink-soft);
  line-height: 1.6;
  text-align: center;
}

.noscript h1 {
  font-size: var(--fs-xl);
  color: var(--accent-text);
}

.btn {
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.25;
  padding: 11px 20px;
  color: var(--ink-strong);
  background-color: var(--btn-face);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-btn);

  box-shadow: none;

  cursor: pointer;
  transition: background-color 0.16s var(--ease),
              border-color 0.16s var(--ease),
              color 0.16s var(--ease),
              box-shadow 0.16s var(--ease),
              transform 0.12s var(--ease);
}

.btn:hover {
  background-color: var(--btn-face-hover);
  border-color: var(--ink-strong);
  box-shadow: none;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary {
  color: var(--on-btn-ink);
  background-color: var(--btn-ink);
  border-color: var(--btn-ink);
  font-weight: 600;

  --btn-lip: var(--accent-lip);
}
.btn-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-small {
  padding: 7px 13px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  border-radius: var(--r-btn);
  box-shadow: none;
}
.btn-small:hover {
  color: var(--ink-strong);
  box-shadow: none;
}
.btn-small:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-wide { width: 100%; }

.btn-text {
  padding: 4px 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-color: var(--btn-edge);
  text-underline-offset: 4px;
  cursor: pointer;
}
.btn-text:hover {
  color: var(--ink-strong);
  text-decoration-color: currentColor;
}

.screen::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  z-index: 29;
  background-color: var(--page);
  border-bottom: 1px solid var(--line);
}

.corner-button {
  position: fixed;
  top: 0;
  z-index: 30;

  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--bar-h);
  padding: 0 2px;

  font-family: var(--ui-font);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1;

  color: var(--ink-soft);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.corner-button:hover {
  color: var(--ink-strong);
}
.corner-button:active {
  color: var(--ink-strong);
}

.corner-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.corner-label {
  white-space: nowrap;
}

.corner-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-icon {
  width: 1.05em;
  height: 1.05em;
  margin-right: 6px;
  vertical-align: -0.16em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.corner-panel {
  position: fixed;
  top: calc(var(--bar-h) + 6px);
  z-index: 30;

  width: 272px;
  max-height: calc(100vh - var(--bar-h) - 26px);
  overflow-y: auto;

  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  padding: var(--sp-5);

  display: none;
}
.corner-panel.open {
  display: block;
  animation: panel-in 0.16s var(--ease);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.picklist {
  position: relative;
  min-width: 0;
}

.picklist-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);

  min-width: 190px;
  padding: 10px 12px 10px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
}

.picklist-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.picklist-caret {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--ink-mute);
  transition: transform 0.16s var(--ease);
}

.picklist[data-open="true"] .picklist-caret { transform: rotate(180deg); }

.picklist[data-open="true"] .picklist-button {
  border-color: var(--accent-line);
  background-color: var(--btn-face-hover);
}

.picklist-panel {
  position: absolute;

  top: calc(100% + 10px);
  right: 0;
  z-index: 40;

  min-width: 100%;
  width: max-content;
  max-width: min(320px, calc(100vw - 2 * var(--sp-4)));

  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;

  padding: 6px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);

  display: none;
}
.picklist[data-open="true"] .picklist-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: panel-in 0.16s var(--ease);
}

.picklist[data-drop="up"] .picklist-panel {
  top: auto;
  bottom: calc(100% + 10px);
}
.picklist[data-drop="up"][data-open="true"] .picklist-panel {
  animation: panel-in-up 0.16s var(--ease);
}
@keyframes panel-in-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.picklist-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  flex: none;
  min-height: 44px;
  padding: 10px 14px;
  font-size: var(--fs-sm);
  text-align: left;
  border-radius: var(--r-sm);
  box-shadow: none;
}
.picklist-option:hover {
  transform: none;
  box-shadow: none;
}
.picklist-option:active {
  transform: translateY(1px);
  box-shadow: none;
}

.picklist-option[aria-selected="true"] {
  color: var(--on-accent);
  background-color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  --btn-lip: var(--accent-lip);
}
.picklist-option[aria-selected="true"]:hover {
  color: var(--on-accent);
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.picklist-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picklist-tick {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.picklist-option[aria-selected="true"] .picklist-tick { opacity: 1; }

.picklist-wide,
.picklist-wide .picklist-button { width: 100%; }
.picklist-wide .picklist-button { min-width: 0; }
.picklist-wide .picklist-panel {
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
}

.menu-section-title,
.account-heading,
.language-heading,
.options-title,
.chapter-number,
.card-context-label,
.card-sentence-label {
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
}

@media (max-width: 430px) {
  :root {
    --corner-w: 64px;
    --corner-gap: 6px;
    --corner-edge: 10px;
  }
}

.reader {
  max-width: 1088px;
  margin: 0 auto;
  padding: 84px 24px 40px;
}

#text {
  max-width: var(--col);
  margin: 0 auto;
}

#title {
  font-family: var(--display-font);
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.6rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink-strong);
  max-width: var(--col);
  margin: 0 auto 26px;
}

#title::after {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  margin: 16px auto -8px;
  border-radius: 2px;
  background-color: var(--accent);
  opacity: 0.55;
}

#title.title-long {
  font-family: var(--ui-font);
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--ink-soft);
}
#title.title-long::after {
  margin-top: 14px;
}

.translation-box {
  position: sticky;
  top: calc(var(--bar-h) + 10px);
  z-index: 5;

  max-width: calc(var(--col) + 96px);
  margin: 0 auto var(--sp-6);
  padding: 14px 16px;
  border: 1px solid transparent;

  font-family: var(--trans-font);
  font-size: var(--trans-size);
  font-style: italic;
  color: var(--ink-soft);

  box-sizing: content-box;
  line-height: 1.4;
  height: calc(var(--trans-lines) * 1.4em);
}

.translation-card {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  box-sizing: border-box;
  min-height: calc(100% + 2px);
  max-height: 60vh;
  padding: 14px 16px;
  overflow: hidden;

  display: flex;
  align-items: center;
  gap: var(--sp-3);

  background-color: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: 8px;
  box-shadow: var(--shadow-2);

  pointer-events: none;
  transition: height 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.translation-card.is-grown {
  box-shadow: var(--shadow-3);
}

.translation-text {
  flex: 1;
  min-width: 0;
}

.translation-percent {
  flex: none;
  font-family: var(--ui-font);
  font-size: var(--fs-xs);
  font-style: normal;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
}

.play-button {
  flex: none;
  min-width: 4.6em;
  padding: 0.5em 0.2em;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--ui-font);
  font-size: 1em;
  font-style: normal;
  line-height: 1;
  color: var(--ink-strong);
  background: none;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.16s var(--ease);
}
.play-button:hover {
  color: var(--accent-text);
}

.play-glyph {
  display: inline-block;
  width: 0.8em;
  text-align: center;
  font-size: 0.82em;
}
.play-label {
  font-size: 0.86em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.translation-box.has-text {
  color: var(--ink);
  font-style: normal;
}

.sentence.trans-shown {
  background-color: var(--accent-wash);
  border-radius: var(--r-xs);
}

.paragraph {
  font-size: var(--text-size);
  color: var(--ink);

  line-height: calc(var(--text-size) * (var(--text-lead) + 0.13)
                    + max(35px, var(--trans-size) * 1.6 + 8px));

  margin: 0 0 1.5em 0;
}

.word {
  cursor: pointer;
  border-radius: var(--r-xs);
  padding: 0 1px;
  transition: background-color 0.14s var(--ease),
              color 0.14s var(--ease);
  white-space: nowrap;
}

.word:hover {
  background-color: var(--mark);
}

.word.piece-lit,
.word-gap.piece-lit {
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: none;
}

.word.speaking {
  color: var(--speak);

  -webkit-text-stroke: 0.03em currentColor;
  position: relative;
}
.word.speaking::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.18em;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--speak-dot);
}

.sentence.speaking-sentence {
  background-color: var(--speak-wash);
  border-radius: var(--r-xs);
}

.tooltip {
  position: absolute;
  display: none;
  align-items: center;
  gap: 6px;

  font-family: var(--trans-font);
  font-size: var(--trans-size);
  white-space: nowrap;
  z-index: 10;

  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px 4px 4px 9px;
  box-shadow: var(--shadow-2);
}

.tooltip.visible {
  display: inline-flex;
}

.tooltip-word {
  font-weight: 600;
  color: var(--ink);
}

.tooltip-save {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 7px;
  font-family: var(--ui-font);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  color: var(--on-accent);
  background-color: var(--accent);
  border: none;
  border-radius: var(--r-xs);

  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.16s var(--ease),
              box-shadow 0.16s var(--ease),
              transform 0.12s var(--ease);
}
.tooltip-save:active {
  transform: translateY(1px);
  box-shadow: none;
}

.tooltip-save-plus {
  font-size: 0.95rem;
  line-height: 1;
}
.tooltip-save:hover  { background-color: var(--accent-hover); }
.tooltip-save:active { transform: scale(0.9); }

.menu,
.menu button,
.menu input {
  font-family: var(--ui-font);
}

.menu-button {
  right: 20px;
}

.menu-panel {
  right: var(--corner-edge);
}

.menu-heading {
  margin: 0 0 var(--sp-1) 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.menu-section {
  padding-top: var(--sp-4);
  margin-top: var(--sp-3);
  border-top: 1px solid var(--line-soft);
}
.menu-section-title {
  margin: 0 0 var(--sp-3) 0;
  font-size: var(--fs-sm);
}

.menu-group {
  margin-bottom: var(--sp-3);
}
.menu-group:last-child {
  margin-bottom: 0;
}

.menu-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 var(--sp-2) 0;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.menu-value {
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
}

.font-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.font-button,
.theme-button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  text-align: left;
  color: var(--ink-strong);
  background-color: var(--btn-face);
  border-color: var(--btn-edge);
  border-radius: var(--r-sm);
  box-shadow: none;
}
.font-button:hover,
.theme-button:hover {
  background-color: var(--btn-face-hover);
  border-color: var(--accent-line);
  box-shadow: none;
  transform: none;
}

.font-button:active,
.theme-button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.font-button.active,
.theme-button.active {
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  --btn-lip: var(--accent-lip);
  box-shadow: none;
}
.font-button.active:hover,
.theme-button.active:hover {
  background-color: var(--accent-hover);
  color: var(--on-accent);
}

.font-button-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.3;
}

.font-button-why {
  flex: none;
  font-family: var(--ui-font);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-mute);
}
.font-button.active .font-button-why {
  color: var(--on-accent);
  opacity: 0.8;
}

.font-button[data-font="clean"]   .font-button-name { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.font-button[data-font="book"]    .font-button-name { font-family: "Source Serif 4", Georgia, "Iowan Old Style", "Times New Roman", serif; }
.font-button[data-font="clear"]   .font-button-name { font-family: "Atkinson Hyperlegible", Verdana, Geneva, "DejaVu Sans", sans-serif; }
.font-button[data-font="classic"] .font-button-name { font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, serif; }
.font-button[data-font="mono"]    .font-button-name { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Courier New", monospace; }

.theme-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.theme-button {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 4px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.theme-button .btn-icon {
  width: 20px;
  height: 20px;
  margin-right: 0;
  vertical-align: 0;
}

.size-slider {
  width: 100%;
  height: 26px;
  cursor: pointer;
  accent-color: var(--accent);
}

.vocab,
.vocab button {
  font-family: var(--ui-font);
}

.vocab-button {
  transform-origin: center;
}

.vocab-button.pop { animation: vocab-pop 0.35s var(--ease); }
@keyframes vocab-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.vocab-panel {
  right: var(--corner-edge);
}

.vocab-heading {
  margin: 0 0 var(--sp-3) 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.vocab-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vocab-item {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
}
.vocab-item:last-child { border-bottom: none; }
.vocab-fr { font-weight: 700; color: var(--ink); }
.vocab-en { color: var(--ink-soft); font-style: italic; text-align: right; }

.vocab-empty {
  color: var(--ink-mute);
  font-size: var(--fs-sm);
  font-style: italic;
}

.picker {
  max-width: 640px;
  margin: 0 auto;
  padding: 96px 24px 72px;
  text-align: center;
}

.picker-title {
  font-family: var(--display-font);
  font-size: var(--fs-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink-strong);
  margin: 0 0 var(--sp-3) 0;
}

.picker-hint {
  color: var(--ink-soft);
  font-family: var(--ui-font);
  font-size: var(--fs-lg);
  font-weight: 400;
  line-height: 1.5;
  max-width: 30rem;
  margin: 0 auto;
  text-wrap: balance;

  overflow-wrap: anywhere;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: var(--sp-6) var(--sp-5);
  align-items: start;
}

.story-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 0;
}
.story-card:hover {
  background: none;
}
.story-card:active {
  transform: none;
}

.story-cover {
  --tone: var(--cover-0);
  --tone-ink: var(--cover-ink);
  display: grid;
  grid-template-rows: 50% 50%;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 2px 5px 5px 2px;
  background-color: var(--tone);
  color: var(--tone-ink);
  box-shadow: inset 5px 0 0 var(--cover-spine), var(--shadow-1);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.story-card:hover .story-cover {
  transform: translateY(-4px);
  box-shadow: inset 5px 0 0 var(--cover-spine), var(--shadow-2);
}
.kind-book .story-cover,
.kind-book:hover .story-cover {
  box-shadow: inset 5px 0 0 var(--cover-spine),
              4px 4px 0 -1px var(--page), 4px 4px 0 0 var(--btn-edge),
              8px 8px 0 -1px var(--page), 8px 8px 0 0 var(--btn-edge);
  overflow: visible;
}
.kind-book .story-cover-art {
  border-radius: 0 0 5px 2px;
}

.cover-tone-0 { --tone: var(--cover-0); }
.cover-tone-1 { --tone: var(--cover-1); }
.cover-tone-2 { --tone: var(--cover-2); }
.cover-tone-3 { --tone: var(--cover-3); --tone-ink: var(--cover-ink-dark); }
.cover-tone-4 { --tone: var(--cover-4); }
.cover-tone-5 { --tone: var(--cover-5); }
.cover-tone-6 { --tone: var(--cover-6); }
.cover-tone-7 { --tone: var(--cover-7); }

.story-cover-text {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 14px 12px 0 18px;
}
.story-cover-rule {
  flex: none;
  width: 28px;
  height: 1px;
  margin: 8px 0 7px;
  background-color: currentColor;
  opacity: 0.65;
}
.story-cover-en {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: var(--display-font);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.3;
  opacity: 0.92;
}
.story-cover-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 0;
  overflow: hidden;
}
.story-cover-picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-cover-initial {
  margin: 0 8px -10px 0;
  font-family: var(--display-font);
  font-size: 6.4rem;
  font-weight: 600;
  line-height: 0.8;
  opacity: 0.2;
  user-select: none;
}

.story-deck {
  display: grid;
  min-width: 0;
}
.story-deck > * {
  grid-area: 1 / 1;
  min-width: 0;
}
.story-deck-sheet {
  display: none;
}

.library {
  max-width: 1240px;
  text-align: left;
}

.library-header {
  margin-bottom: var(--sp-6);
}

.library .picker-hint {
  margin-left: 0;
  margin-right: 0;
}

.library-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
}

.library-shelf { min-width: 0; }
.library-rail  { min-width: 0; width: 100%; max-width: 384px; margin: 0 auto; }

.shelf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line-soft);
}

.shelf-filter,
.shelf-sort {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.shelf-sort { margin-left: auto; }

.shelf-toolbar-label {
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}

.shelf-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.level-chip {
  min-width: 42px;
  padding: 7px 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--r-btn);
  justify-content: center;
}

.level-chip.active {
  color: var(--on-accent);
  background-color: var(--accent);
  border-color: var(--accent);
  --btn-lip: var(--accent-lip);
}
.level-chip.active:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.shelf-count {
  margin: var(--sp-4) 0 var(--sp-4) 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 1000px) {

  .library-body {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--sp-6);
    align-items: start;
  }

  .library-rail {
    max-width: none;
    margin: 0;
    position: sticky;
    top: 96px;
  }

  .library-rail .picker-actions {
    flex-direction: column;
    margin-top: 0;
  }

  .library-rail .progress-card {
    max-width: none;
    margin: var(--sp-5) 0 0 0;
  }
}

.chapter-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.chapter-card {
  position: relative;
  display: block;
  padding: var(--sp-4) var(--sp-4) var(--sp-4) 22px;
  text-align: left;
  border-radius: 8px;
  box-shadow: none;
}
.chapter-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background-color: var(--accent);
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}
.chapter-card:hover {
  box-shadow: none;
}
.chapter-card:hover::before {
  opacity: 1;
}

.chapter-number {
  display: block;
  font-family: var(--ui-font);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-text);
  margin-bottom: 5px;
}

.chapter-title {
  display: block;
  font-family: var(--text-font);
  font-size: var(--fs-lg);
  line-height: 1.4;
  color: var(--ink);
}

.chapter-star {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  vertical-align: 2px;

  font-family: var(--ui-font);
  font-size: 0.72rem;
  font-weight: 600;

  color: var(--warm-text);
  background-color: var(--warm-soft);
  border-radius: var(--r-btn);
  cursor: help;
}

.chapter-legend {
  margin-top: var(--sp-5);
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}

.back-button {
  left: 20px;
}

.flashcards-button {
  margin-top: var(--sp-6);
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: var(--sp-3);
}
.flashcards-label {
  grid-column: 2;
}

.flashcards-due {
  grid-column: 3;
  justify-self: end;
  padding: 3px 10px;
  border-radius: var(--r-btn);
  background-color: var(--on-accent);
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.flashcards-page {
  max-width: 820px;
}

.clear-vocab-button {
  margin-top: var(--sp-5);
  color: var(--ink-soft);
}
.clear-vocab-button:hover {
  color: var(--danger);
  background-color: var(--danger-soft);
  border-color: var(--danger-line);
}

.flashcards-status {
  min-height: 1.2em;
  margin: var(--sp-4) 0 0 0;
  font-family: var(--ui-font);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-style: italic;
}

.flashcards-empty {
  color: var(--ink-mute);
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  font-style: italic;
  padding: var(--sp-6) 0;
}

.flashcards-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  text-align: left;
}

.card {
  display: grid;
  perspective: 1200px;
  cursor: pointer;
  border-radius: 10px;
}

.card:hover .card-face {
  border-color: var(--ink-mute);
}
.card-inner {
  display: grid;
  min-height: 244px;
  transition: transform 0.5s var(--ease);
  transform-style: preserve-3d;
}
.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  grid-area: 1 / 1;
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--btn-edge);
  border-radius: 10px;
  background-color: var(--surface);
  padding: var(--sp-4);
  max-height: 440px;
  transition: border-color 0.16s var(--ease);
  overflow: auto;
}

.card-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding-bottom: var(--sp-6);
  text-align: center;
}

.card-word {
  font-family: var(--text-font);
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
  overflow-wrap: anywhere;
}

.card-example {
  font-family: var(--text-font);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: var(--sp-1) 0 0 0;
  padding: 0 var(--sp-1);
}
.card-flip-hint {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--ui-font);
  font-size: 0.74rem;
  letter-spacing: 0;
  color: var(--ink-mute);
}

.card-back {
  transform: rotateY(180deg);
  font-family: var(--trans-font);
}

.card-context {
  font-size: var(--fs-md);
  color: var(--ink-strong);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--sp-3);
}
.card-context-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-bottom: 3px;
}

.card-back-word {
  display: block;
  font-family: var(--text-font);
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--ink-strong);
  overflow-wrap: anywhere;
  margin-bottom: 2px;
}
.card-meaning {
  display: block;
}

.card-mark {
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: none;
}

.card-sentence {
  border-top: 1px solid var(--line-soft);
  padding-top: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.card-sentence-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-bottom: 3px;
}
.card-sentence-fr {
  font-family: var(--text-font);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.4;
  margin: 0;
}
.card-sentence-en {
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 3px 0 0 0;
}

.card-sentence-missing {
  font-style: italic;
  color: var(--ink-mute);
}

.flashcards-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.study-button,
.srs-settings-button {
  font-size: var(--fs-md);
  padding: 13px 26px;
}

.study-button.is-empty {
  color: var(--ink);
  background-color: var(--btn-face);
  border-color: var(--btn-edge);
  --btn-lip: var(--btn-lip-neutral);
}
.study-button.is-empty:hover {
  color: var(--ink-strong);
  background-color: var(--btn-face-hover);
  border-color: var(--accent-line);
}

.study-page {
  max-width: 540px;
  min-height: 100vh;
  box-sizing: border-box;
  padding-top: calc(var(--bar-h) + var(--sp-5));
  padding-bottom: var(--sp-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.study-top {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-5) 0;
}
.study-undo:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.study-counts {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);

  margin: 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.count-learning,
.count-review,
.count-new {
  display: inline-block;
  padding: 0 4px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.count-learning { color: var(--caution); }
.count-review   { color: var(--good); }
.count-new      { color: var(--accent-text); }

.study-area {
  text-align: left;
}
.study-area .card {
  cursor: default;
}
.study-area .card-inner {
  min-height: 300px;
}
.study-area .card-face {
  max-height: 60vh;
}
.study-area .card:hover .card-face {
  border-color: var(--btn-edge);
}
.study-area .card-face {
  padding: var(--sp-5);
}
.study-area .card-word {
  font-size: 2.4rem;
}
.study-area .card-example {
  font-size: var(--fs-md);
}
.study-area .card-flip-hint {
  display: none;
}
.study-area .card-back-word {
  font-size: 1.7rem;
}

.study-area {
  position: relative;
  isolation: isolate;
}

.study-area::before,
.study-area::after {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: 15px;
  opacity: 0;
  pointer-events: none;
}
.study-area::before {
  box-shadow: 0 0 22px 4px var(--flash-line);
}
.study-area::after {
  padding: 3px;
  background: linear-gradient(135deg, var(--flash-strong), var(--flash-line) 50%, var(--flash-strong));
  -webkit-mask: linear-gradient(var(--page) 0 0) content-box, linear-gradient(var(--page) 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(var(--page) 0 0) content-box exclude, linear-gradient(var(--page) 0 0);
}
.study-area:empty::before,
.study-area:empty::after {
  display: none;
}
.study-area.flash-1 { --flash-strong: var(--danger);  --flash-line: var(--danger-line); }
.study-area.flash-2 { --flash-strong: var(--caution); --flash-line: var(--caution-line); }
.study-area.flash-3 { --flash-strong: var(--good);    --flash-line: var(--good-line); }
.study-area.flash-4 { --flash-strong: var(--accent);  --flash-line: var(--accent-line); }
.study-area.is-flashing::before,
.study-area.is-flashing::after {
  animation: grade-flash 0.55s var(--ease) both;
}
@keyframes grade-flash {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .study-area.is-flashing::before,
  .study-area.is-flashing::after {
    animation: none;
    opacity: 1;
  }
}

.key-hint {
  display: inline-block;
  margin-left: 8px;
  padding: 0 5px;
  min-width: 1.35em;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-family: var(--ui-font);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  vertical-align: 0.1em;
}
@media (hover: none) and (pointer: coarse) {
  .key-hint { display: none; }
}

.study-show {
  margin-top: var(--sp-4);
  padding: 15px 0;
  font-size: var(--fs-md);
}

.study-grades {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.grade-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 13px 6px;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.grade-when {
  font-size: 0.76rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.grade-again { color: var(--danger);  border-color: var(--danger-line); }
.grade-again:hover, .grade-again.is-lit { background-color: var(--danger-soft); border-color: var(--danger); }
.grade-hard  { color: var(--caution); border-color: var(--caution-line); }
.grade-hard:hover, .grade-hard.is-lit   { background-color: var(--caution-soft); border-color: var(--caution); }
.grade-good  { color: var(--good);    border-color: var(--good-line); }
.grade-good:hover, .grade-good.is-lit   { background-color: var(--good-soft); border-color: var(--good); }
.grade-easy  { color: var(--accent-text); border-color: var(--accent-line); }
.grade-easy:hover, .grade-easy.is-lit   { background-color: var(--accent-soft); border-color: var(--accent); }

.grade-button.is-lit {
  transform: translateY(1px);
  box-shadow: none;
}

.grade-button .key-hint {
  position: absolute;
  top: 6px;
  left: 7px;
  margin-left: 0;
}

.study-done {
  margin: var(--sp-7) auto 0;
  max-width: 26rem;
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--ink-soft);
}

.options-page {
  max-width: 760px;
}

.options-section {
  margin-top: var(--sp-5);
  padding: var(--sp-5) 0 0;
  text-align: left;
  border-top: 1px solid var(--line);
}

@media (min-width: 700px) {
  .options-page:not(.create-page) .options-section:has(> .options-title) {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 9fr);
    column-gap: var(--sp-6);
    align-items: start;
  }
  .options-page:not(.create-page) .options-section:has(> .options-title) > * {
    grid-column: 2;
    min-width: 0;
  }
  .options-page:not(.create-page) .options-section > .options-title {
    grid-column: 1;
    grid-row: 1 / span 40;
    margin: 0;
  }
  .options-page:not(.create-page) .options-section > .options-title + * {
    margin-top: 0;
  }
  .options-page:not(.create-page) .options-section > .btn,
  .options-page:not(.create-page) .options-section > .btn-text {
    justify-self: start;
  }
}

.options-title {
  margin: 0 0 var(--sp-4) 0;
  font-family: var(--ui-font);
  font-size: var(--fs-lg);
  line-height: 1.3;
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--sp-3);
}
.options-row:last-child { margin-bottom: 0; }

.options-label {
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink);
}
.options-label-block {
  display: block;
  margin: var(--sp-4) 0 var(--sp-2) 0;
}

.options-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
}

.options-input {
  width: 104px;
  padding: 8px 2px 9px;
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-strong);
  background-color: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink-mute) 55%, transparent);
  border-radius: 0;
  text-align: right;
  transition: border-color 0.16s var(--ease),
              box-shadow 0.16s var(--ease);
}
.options-input:hover {
  border-bottom-color: var(--ink-mute);
}

.options-input-wide {
  width: 176px;
  text-align: left;
  font-weight: 400;
}

.options-row:has(.options-input-wide),
.options-row:has(.picklist-wide) {
  display: block;
  margin-bottom: var(--sp-4);
}
.options-row:has(.options-input-wide) .options-label,
.options-row:has(.picklist-wide) .options-label {
  display: block;
  margin-bottom: 7px;
}
.options-row:has(.options-input-wide) .options-input-wide {
  width: 100%;
}

.options-input:focus {
  outline: none;
  border-radius: 0;
  border-bottom-color: var(--ink-strong);
  box-shadow: 0 1px 0 var(--ink-strong);
}
.options-textarea:focus {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-color: var(--accent);
}

.options-row .size-slider {
  flex: 1 0 100%;
  margin-top: 2px;
}

.options-check {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 27px;
  margin: 0;
  background-color: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background-color 0.18s var(--ease),
              border-color 0.18s var(--ease);
}

.options-check::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background-color: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-1);
  transition: transform 0.18s var(--ease),
              background-color 0.18s var(--ease);
}
.options-check:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
.options-check:checked::after {
  background-color: var(--on-accent);
  border-color: transparent;
  transform: translateX(19px);
}
.options-check:hover {
  border-color: var(--accent-line);
}

.options-textarea {
  width: 100%;
  padding: var(--sp-4);
  font-family: var(--mono-font);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-btn);
  resize: vertical;
}

.options-help {
  margin: var(--sp-3) 0 0 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--ink-soft);
}
.options-help code {
  font-family: var(--mono-font);
  font-size: 0.78rem;
  color: var(--ink);
  background-color: var(--surface-sunk);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
  border-radius: var(--r-xs);
}

.options-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.options-section .options-actions {
  justify-content: flex-start;
}

.options-save {
  padding: 13px 28px;
}
.options-small-button:hover { color: var(--ink); }

.options-status {
  min-height: 1.3em;
  margin: var(--sp-4) 0 0 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--good);
}
.options-status.is-error {
  color: var(--danger);
}

.account,
.account button {
  font-family: var(--ui-font);
}

.account-button {
  padding: 0;
}

.account-panel {
  right: var(--corner-edge);
}

.account-heading {
  margin: 0 0 var(--sp-3) 0;
  font-size: var(--fs-sm);
}

.account-blurb {
  margin: 0 0 var(--sp-4) 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-soft);
}

.account-name {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-strong);
  overflow-wrap: anywhere;
}
.account-email {
  margin: 2px 0 var(--sp-4) 0;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  word-break: break-all;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.account-actions .btn {
  padding: 11px 16px;
  font-size: var(--fs-sm);
}

.account-page {
  max-width: 420px;
  text-align: left;
}
.account-page .picker-hint {
  margin: 0;
}
.account-page .options-section {
  padding: 0;
  border: 0;
}
.account-page .options-actions {
  flex-direction: column;
  align-items: stretch;
}
.account-page .options-actions .btn-text {
  align-self: flex-start;
}

.auth-google {
  margin-top: var(--sp-4);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
}

.google-mark {
  width: 18px;
  height: 18px;
  flex: none;
}
.google-mark-blue   { fill: var(--google-blue); }
.google-mark-red    { fill: var(--google-red); }
.google-mark-yellow { fill: var(--google-yellow); }
.google-mark-green  { fill: var(--google-green); }

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-2);
}

.options-input[readonly] {
  color: var(--ink-soft);
  border-bottom-style: dashed;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 0 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  letter-spacing: 0;
  color: var(--ink-mute);
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--line);
}

.account-delete:hover {
  color: var(--danger);
  border-color: var(--danger-line);
  background-color: var(--danger-soft);
}

.options-section .font-buttons,
.options-section .theme-buttons {
  margin-bottom: var(--sp-1);
}
.options-section .size-slider {
  width: 100%;
}

.plan-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.plan-name {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--ink-strong);
}

.plan-detail {
  margin: 2px 0 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.plan-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: var(--r-btn);
  background-color: var(--warm-soft);
  border: 1px solid var(--warm-line);
  color: var(--warm-text);
  font-size: var(--fs-xs);
  font-weight: 600;
}

#screen-create .options-input-wide {
  width: 230px;
  max-width: 100%;
}

.create-file {
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  max-width: 100%;
}

.create-textarea {
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  line-height: 1.65;
  min-height: 240px;
}

.create-thumb-preview {
  display: block;
  width: 104px;
  height: 104px;
  margin-top: var(--sp-3);
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.create-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.create-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink);
}
.create-list li:last-child {
  border-bottom: none;
}

.create-item-name {
  flex: 1;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.create-item-meta {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  white-space: nowrap;
}

.create-item-delete:hover {
  color: var(--danger);
  border-color: var(--danger-line);
  background-color: var(--danger-soft);
}

.create-empty {
  margin: 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  font-style: italic;
}

.story-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-family: var(--display-font);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}

.story-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 2px;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-mute);
}

.story-card-level {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.level-pips {
  display: inline-flex;
  gap: 4px;
}

.level-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--btn-edge);
}

.level-pip.on {
  background-color: var(--ink-strong);
}

.level-name {
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--ink-mute);
}

.story-card-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 var(--sp-2);
}

.story-card-audio,
.story-card-own,
.story-card-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.story-card-audio { color: var(--ink-soft); }
.story-card-own   { color: var(--warm-text); }
.story-card-flag  { color: var(--warm-text); font-weight: 600; }

.story-card-own .btn-icon,
.story-card-audio .btn-icon,
.story-card-flag .btn-icon {
  width: 13px;
  height: 13px;
  margin: 0;
}

.language-button {
  font-weight: 600;
  color: var(--ink-strong);
}

#language-glyph {
  gap: 5px;
}
.language-code {
  line-height: 1;
}
#language-glyph .flag {
  width: 18px;
  height: 12px;
  border-radius: 3px;
}

.language-panel {
  right: var(--corner-edge);
}

.language-heading {
  margin: 0 0 var(--sp-3) 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
}

.language-list {
  display: grid;
  gap: 6px;
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: var(--fs-sm);
  text-align: left;
  box-shadow: none;
}
.language-option:hover {
  transform: none;
  box-shadow: none;
}
.language-option:active {
  transform: translateY(1px);
  box-shadow: none;
}

.language-option.active {
  color: var(--on-accent);
  background-color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  --btn-lip: var(--accent-lip);
}
.language-option.active:hover {
  color: var(--on-accent);
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.flag {
  display: block;
  width: 24px;
  height: 16px;
  flex: none;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--flag-edge), var(--shadow-1);
}
.flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.language-option-flag,
.language-flag {
  display: flex;
  flex: none;
}

.language-option-name {
  flex: 1;
}

.language-option-count {
  font-size: var(--fs-xs);
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.language-option.active .language-option-count {
  opacity: 0.85;
}

.shelf-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-6) 0;
  text-align: center;
}

.picker-empty {
  margin: 0;
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--ink-mute);
}

.analysis-button {
  order: 0;
}

.mark-read-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  max-width: 640px;
  margin: var(--sp-4) auto var(--sp-7);
}
.mark-read-button:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.mark-read-note {
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--good);
  font-weight: 500;
}

.progress-card {
  margin: var(--sp-7) auto 0 auto;
  max-width: 384px;
  padding: var(--sp-5);

  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.progress-figures {
  display: flex;
  justify-content: center;
  gap: var(--sp-7);
}
.progress-figure {
  margin: 0;
  text-align: center;
}
.progress-number {
  display: block;
  font-family: var(--ui-font);
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.progress-caption {
  display: block;
  margin-top: 5px;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.progress-known  { color: var(--accent-text); }

.streak {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  margin: var(--sp-4) auto 0 auto;
  padding: 4px 12px 4px 9px;
  border-radius: 999px;
  background-color: var(--surface-sunk);
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
.streak.is-lit {
  background-color: var(--warm-soft);
  color: var(--warm-text);
}
.streak-flame {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.progress-strong { color: var(--good); }

.progress-graph {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-soft);
}

.progress-hint {
  margin: var(--sp-2) 0 0 0;
  font-family: var(--ui-font);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--ink-mute);
  text-align: center;
}

.graph {
  display: block;
  width: 100%;
  height: auto;
}
.graph-grid {
  stroke: var(--line);
  stroke-width: 1;
}
.graph-axis {
  font-family: var(--ui-font);
  font-size: 9px;
  fill: var(--ink-mute);
}
.graph-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.graph-line-known  { stroke: var(--accent); }
.graph-line-strong { stroke: var(--good); }
.graph-dot-known   { fill: var(--accent); }
.graph-dot-strong  { fill: var(--good); }

.calendar {
  --cell: 26px;
  --cell-gap: 4px;
  --calendar-bg: var(--surface);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-soft);
}

.calendar-title {
  margin: 0 0 var(--sp-2) 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-soft);
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, var(--cell));
  gap: var(--cell-gap);
  justify-content: center;
}

.calendar-dow {
  font-family: var(--ui-font);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.6;
}

.calendar-day {
  display: flex;
  align-items: center;
  justify-content: center;

  height: var(--cell);
  border-radius: 7px;

  background-color: var(--surface-sunk);
  font-family: var(--ui-font);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
}

.calendar-blank { height: var(--cell); }

.calendar-day.is-future {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--ink-mute);
}

.calendar-day.is-active  { font-weight: 600; }
.calendar-day.is-level-1 { background-color: var(--accent-soft); color: var(--accent-text); }
.calendar-day.is-level-2 { background-color: var(--accent-line); color: var(--accent-text); }
.calendar-day.is-level-3 { background-color: var(--accent);      color: var(--on-accent); }

.calendar-day.is-today {
  box-shadow: 0 0 0 2px var(--calendar-bg), 0 0 0 3.5px var(--accent);
}

.calendar-day.is-future.is-today {
  box-shadow: 0 0 0 2px var(--calendar-bg), 0 0 0 3.5px var(--accent);
}

.calendar-note {
  margin: var(--sp-2) 0 0 0;
  font-family: var(--ui-font);
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  text-align: center;
}

.progress-calendar .calendar {
  --cell: 22px;
}
.analysis-calendar .calendar {
  --cell: 36px;
  --cell-gap: 7px;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.analysis-calendar .calendar-title { font-size: var(--fs-sm); }
.analysis-calendar .calendar-day   { font-size: var(--fs-sm); border-radius: 10px; }
.analysis-calendar .calendar-dow   { font-size: var(--fs-xs); }
.analysis-calendar .calendar-note  { font-size: var(--fs-sm); }

.analysis-page {
  max-width: 660px;
}

.analysis-unfinished {
  display: flex;
  gap: 10px;
  margin: 0 auto var(--sp-5) auto;
  max-width: 30rem;
  padding: 11px var(--sp-4);
  text-align: left;

  background-color: var(--warm-wash);
  border: 1px solid var(--warm-line);
  border-radius: var(--r-md);

  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink-soft);
}

.analysis-unfinished::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  background-color: var(--warm);
}

.analysis-figures {
  display: flex;
  justify-content: center;
  gap: var(--sp-7);
  margin-bottom: var(--sp-5);
}
.analysis-figure { margin: 0; text-align: center; }
.analysis-number {
  display: block;
  font-family: var(--ui-font);
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.analysis-caption {
  display: block;
  margin-top: var(--sp-1);
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.analysis-graph { margin-bottom: 6px; }

.analysis-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-3);
}
.analysis-list-title {
  margin: 0 0 6px 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-soft);
}

.analysis-list {
  list-style: none;
  margin: 0;
  padding: 0 var(--sp-3);

  max-height: 340px;
  overflow-y: auto;

  background-color: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.analysis-item {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
}
.analysis-item:last-child { border-bottom: none; }

.analysis-list .vocab-empty {
  display: block;
  padding: var(--sp-4) 0;
  text-align: center;
}

.analysis-word  { flex: 1; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.analysis-times { color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.analysis-when  { color: var(--ink-mute); font-size: var(--fs-xs); min-width: 48px; text-align: right; }

.lp-body {

  --lp-max: 1120px;
  --lp-edge: var(--sp-5);

  --lp-display: clamp(2.4rem, 1.5rem + 4.2vw, 4rem);

  font-family: var(--ui-font);
  line-height: 1.55;
}

@media (max-width: 560px) {
  .lp-body { --lp-edge: var(--sp-4); }
}

.lp-body section[id] { scroll-margin-top: 72px; }

.lp-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lp-body a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.btn-compact {
  padding: 9px 18px;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  box-shadow: none;
}
.btn-compact:hover { box-shadow: none; }
.btn-compact:active { transform: translateY(1px); box-shadow: none; }

.lp-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--page);
  border-bottom: 1px solid var(--line-soft);
}

.lp-nav-inner {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: var(--sp-3) var(--lp-edge);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.lp-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  margin-right: auto;
}

.lp-mark {
  --mark-size: 30px;
  --mark-tile: var(--brand-tile);
  --mark-ink: var(--brand-ink);
  --mark-underline: var(--brand-underline);
  display: grid;
  place-items: center;
  flex: none;
  width: var(--mark-size); height: var(--mark-size);
  border-radius: calc(var(--mark-size) * 0.22);
  background-color: var(--mark-tile);
  box-shadow:
    inset 0 0 0 calc(var(--mark-size) * 0.045) var(--mark-tile),
    inset 0 0 0 calc(var(--mark-size) * 0.075)
      color-mix(in srgb, var(--mark-ink) 38%, var(--mark-tile));
  color: var(--mark-ink);
  font-family: var(--display-font);
  font-size: calc(var(--mark-size) * 0.6);
  font-weight: 600;
  line-height: 1;
}

.lp-mark-letter {
  position: relative;
  top: -0.06em;
}

.lp-mark-letter::after {
  content: "";
  position: absolute;
  left: -0.06em;
  right: -0.12em;
  bottom: -0.14em;
  height: max(1.5px, 0.09em);
  border-radius: 2px;
  background-color: var(--mark-underline);
}

.lp-brand-name {
  font-family: var(--display-font);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.lp-nav-links {
  display: flex;
  gap: var(--sp-5);
}

.lp-nav-links a,
.lp-nav-login {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color 0.16s var(--ease);
}
.lp-nav-links a:hover,
.lp-nav-login:hover { color: var(--accent-text); }

.lp-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

@media (max-width: 720px) {
  .lp-nav-links { display: none; }
  .lp-nav-inner { gap: var(--sp-3); }
}
@media (max-width: 400px) {
  .lp-nav-login { display: none; }
}

.lp-hero {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: clamp(var(--sp-7), 7vw, var(--sp-8)) var(--lp-edge) var(--sp-7);
}

.lp-hero-inner {
  max-width: 46rem;
  margin: 0 auto;

  text-align: center;
}

.lp-hero-title {
  margin: 0 0 var(--sp-4) 0;
  font-family: var(--display-font);
  font-size: var(--lp-display);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.025em;
  color: var(--ink-strong);
}

.lp-hero-title em {
  color: var(--accent-text);
  font-style: italic;
}

.lp-hero-sub {
  margin: 0 auto var(--sp-6);
  max-width: 36rem;
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--ink-soft);
}
.lp-hero-sub em {
  color: var(--ink);
  font-style: italic;
}

.lp-email {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 30rem;
  margin: 0 auto;
  background-color: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-2);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.lp-email:focus-within {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-3);
}

.lp-email-input {
  flex: 1;
  min-width: 0;
  padding: 15px 8px 15px 22px;
  border: 0;
  background: none;
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  color: var(--ink);
  border-radius: var(--r-pill);
}
.lp-email-input::placeholder { color: var(--ink-mute); }
.lp-email-input:focus { outline: none; }

.lp-email-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin: 4px 4px 4px 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: background-color 0.16s var(--ease), transform 0.12s var(--ease);
}
.lp-email-go:hover  { background-color: var(--accent-hover); }
.lp-email-go:active { transform: scale(0.94); }

.lp-email-go svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-hero-note,
.lp-final-note {
  margin: var(--sp-3) 0 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}

.lp-note-bad { color: var(--danger); font-weight: 600; }

.lp-final-note a { color: var(--panel-loud-ink); }

.lp-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-6);
  font-size: var(--fs-sm);
}

.lp-langs-label { color: var(--ink-mute); }

.lp-lang {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--ink);
  font-weight: 500;
}

.lp-langs-more { color: var(--ink-mute); font-style: italic; }

.lp-swap {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  white-space: nowrap;
  color: var(--swap-ink);
  transition: width 0.55s cubic-bezier(.25, 1, .35, 1);
}
.lp-swap[data-swap="first"]  { --swap-ink: var(--ink-strong);  --swap-pop: var(--accent-text); }
.lp-swap[data-swap="second"] { --swap-ink: var(--accent-text); --swap-pop: var(--warm); }

.lp-swap-word { display: none; }
.lp-swap-word.is-on { display: inline-block; }
.lp-swap-word.is-out {
  display: inline-block;
  position: absolute;
  left: 0;
  top: 0;
  animation: lp-swap-out 0.3s cubic-bezier(.2, .6, .4, 1) forwards;
}

.lp-swap-letter {
  display: inline-block;
  animation: lp-swap-letter-in 0.75s cubic-bezier(.2, 1.3, .4, 1) both;
}

@keyframes lp-swap-out {
  to {
    opacity: 0;
    transform: translateY(-0.45em) scale(0.92);
    filter: blur(6px);
  }
}

@keyframes lp-swap-letter-in {
  0% {
    opacity: 0;
    transform: translateY(0.75em) rotate(12deg) scale(0.4);
    filter: blur(5px);
    color: var(--swap-pop);
  }
  55% {
    opacity: 1;
    transform: translateY(-0.12em) rotate(-4deg) scale(1.12);
    filter: blur(0);
    color: var(--swap-pop);
  }
  100% {
    transform: none;
    color: var(--swap-ink);
  }
}

.lp-try {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: 0 var(--lp-edge) clamp(var(--sp-7), 6vw, var(--sp-8));
}

.lp-try-head { margin-bottom: var(--sp-6); }

.lp-body section.lp-try { scroll-margin-top: 104px; }

.lp-try-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 900px) {
  .lp-try-layout { grid-template-columns: minmax(0, 1fr); }
}

.lp-try-reader {
  position: relative;
  min-width: 0;
  padding: var(--sp-5);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
}

@media (max-width: 560px) {
  .lp-try-reader { padding: var(--sp-4); }
}

.lp-try-trans {
  display: flex;
  align-items: center;
  height: calc(2.8em + 28px);
  padding: 14px var(--sp-4);
  margin-bottom: var(--sp-5);
  background-color: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  font-family: var(--trans-font);
  font-size: var(--fs-md);
  line-height: 1.4;
}

.lp-try-trans-text {
  flex: 1;
  min-width: 0;
  max-height: 2.8em;
  overflow: hidden;
  color: var(--ink);
}
.lp-try-trans-text.is-hint {
  color: var(--accent-text);
  font-style: italic;
}

.lp-try-trans-text.is-new { animation: lp-try-rise 0.4s var(--ease) both; }

@keyframes lp-try-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.lp-try-text {
  margin: 0;
  font-family: var(--text-font);
  font-size: 1.3rem;
  line-height: calc(1.4em + 36px);
  color: var(--ink);
}

@media (max-width: 560px) {
  .lp-try-text { font-size: 1.15rem; }
}

.lp-try-word {
  border-radius: var(--r-xs);
  padding: 0 1px;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease);
}

.lp-try-word.is-lit {
  background-color: var(--mark);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: none;
}

.lp-try-pop {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 5px 10px;
  white-space: nowrap;
  font-family: var(--trans-font);
  font-size: var(--fs-md);
  line-height: 1.4;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  transform-origin: 50% 100%;
}
.lp-try-pop[hidden] { display: none; }
.lp-try-pop.is-popping { animation: lp-try-pop-in 0.42s cubic-bezier(.2, 1.4, .4, 1) both; }

@keyframes lp-try-pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.6); }
  to   { opacity: 1; transform: none; }
}

.lp-try-pop-word {
  font-weight: 600;
  color: var(--ink);
}

.lp-try-save {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 8px;
  font-family: var(--ui-font);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--on-accent);
  background-color: var(--accent);
  border-radius: var(--r-xs);
  box-shadow: 0 2px 0 var(--accent-lip);
}
.lp-try-save.is-pressed { animation: lp-try-press 0.28s var(--ease); }
.lp-try-save.is-saved {
  color: var(--good);
  background-color: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

@keyframes lp-try-press {
  40% { transform: translateY(2px) scale(0.92); box-shadow: 0 0 0 var(--accent-lip); }
}

.lp-try-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: 26px;
  height: 26px;
  margin: -3px 0 0 -5px;
  fill: var(--ink-strong);
  stroke: var(--surface);
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0;
  transition: transform 0.75s cubic-bezier(.45, .05, .25, 1), opacity 0.3s var(--ease);
}
.lp-try-cursor.is-shown  { opacity: 1; }
.lp-try-cursor.is-parked { transition: none; }

.lp-try-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.lp-try-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.lp-try-step {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-soft);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
              transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.lp-try-step strong { color: var(--ink-strong); font-weight: 600; }

.lp-try-step.is-active {
  background-color: var(--surface);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-2);
  transform: translateX(4px);
}

.lp-try-step-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--fs-xs);
  font-weight: 700;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.lp-try-step.is-active .lp-try-step-mark {
  background-color: var(--accent);
  color: var(--on-accent);
  transform: scale(1.1);
}

.lp-try-tray {
  padding: var(--sp-4);
  min-height: 180px;
  background-color: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}

.lp-try-tray-title {
  margin: 0 0 var(--sp-3) 0;
  font-weight: 600;
  color: var(--ink-strong);
}

.lp-try-count {
  display: inline-block;
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.lp-try-count.is-bumped { animation: lp-try-bump 0.4s cubic-bezier(.2, 1.6, .4, 1); }

@keyframes lp-try-bump {
  40% { transform: scale(1.35); color: var(--accent-text); }
}

.lp-try-cards {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.lp-try-card {
  min-width: 0;
  display: flex;
  min-height: 106px;
  padding: var(--sp-2);
  color: var(--ink);
  background-color: var(--btn-face);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--btn-lip);
}
.lp-try-card.is-turning { animation: lp-try-turn 0.45s var(--ease); }

.lp-try-card.is-flipped {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 3px 0 var(--btn-lip), var(--shadow-3);
}

@keyframes lp-try-turn {
  0%   { transform: scaleX(0.05); }
  100% { transform: scaleX(1); }
}

.lp-try-card-face {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lp-try-card-face[hidden] { display: none; }

.lp-try-card-front {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.lp-try-card-word {
  font-family: var(--text-font);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-strong);
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .lp-try-card-word { font-size: var(--fs-sm); }
}

.lp-try-card-hint {
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}

.lp-try-card-gloss {
  font-family: var(--trans-font);
  font-weight: 600;
  color: var(--accent-text);
}

.lp-try-card-sentence {
  font-family: var(--text-font);
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--ink);
}

.lp-try-card-mark {
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.lp-try-card-english {
  font-family: var(--trans-font);
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--ink-soft);
}

.lp-proof {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background-color: var(--surface-2);
}

.lp-proof-inner {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: var(--sp-6) var(--lp-edge);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
}

.lp-proof-item { min-width: 0; text-align: center; }

.lp-proof-number {
  display: block;
  font-family: var(--display-font);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.lp-proof-caption {
  display: block;
  margin-top: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.4;
}

@media (max-width: 760px) {
  .lp-proof-inner { grid-template-columns: repeat(2, 1fr); }
}

.lp-section-head {
  max-width: 40rem;
  margin: 0 auto var(--sp-7);
  text-align: center;
}

.lp-section-title {
  margin: 0 0 var(--sp-3) 0;
  font-family: var(--display-font);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

.lp-section-sub {
  margin: 0;
  font-size: var(--fs-lg);
  color: var(--ink-soft);
  line-height: 1.55;
}

.lp-features,
.lp-steps,
.lp-faq {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: clamp(var(--sp-7), 6vw, var(--sp-8)) var(--lp-edge);
}

.lp-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
}

@media (max-width: 800px) {
  .lp-cards { grid-template-columns: 1fr; }
}

.lp-card {

  min-width: 0;

  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-2);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.lp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}

.lp-card-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-4);
  height: 168px;
  margin-bottom: var(--sp-5);
  padding: var(--sp-4);
  overflow: hidden;
  border-radius: var(--r-md);
  background-color: var(--surface-sunk);
  border: 1px solid var(--line-soft);
}

.lp-card-title {
  margin: 0 0 var(--sp-2) 0;
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.lp-card-body {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}
.lp-card-body em { color: var(--ink); font-style: italic; }

.lp-demo-text {
  font-family: var(--text-font);
  font-size: 1.15rem;
  line-height: 2.6;
  color: var(--ink);
  text-align: center;
}

.lp-demo-word {
  position: relative;
  background-color: var(--mark);
  border-radius: var(--r-xs);
  padding: 1px 3px;
}

.lp-demo-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background-color: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  font-family: var(--trans-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-text);
}

.lp-demo-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 10px;
  border-radius: var(--r-md);
  background-color: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.lp-demo-play {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.lp-demo-play svg {
  width: 12px; height: 12px;
  fill: currentColor;
}

.lp-demo-bar-text {
  font-family: var(--trans-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-demo-text-spoken { line-height: 1.8; }

.lp-demo-speaking {
  position: relative;
  color: var(--speak);
  font-weight: 600;
}
.lp-demo-speaking::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background-color: var(--speak-dot);
}

.lp-demo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background-color: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.lp-demo-card-word {
  font-family: var(--text-font);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-strong);
}

.lp-demo-card-gloss {
  font-family: var(--trans-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.lp-demo-grades {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.lp-demo-grade {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 2px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background-color: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-soft);
}
.lp-demo-grade em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.lp-demo-grade-1 { border-color: var(--danger-line);  color: var(--danger); }
.lp-demo-grade-2 { border-color: var(--caution-line); color: var(--caution); }
.lp-demo-grade-3 { border-color: var(--good-line);    color: var(--good); }
.lp-demo-grade-4 { border-color: var(--accent-line);  color: var(--accent-text); }

.lp-demo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.lp-demo-tile {
  min-width: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  font-family: var(--display-font);
  font-size: var(--fs-xl);
  font-weight: 600;
  background-image: linear-gradient(150deg,
      hsl(var(--cover-hue, 210) var(--cover-bg-s) calc(var(--cover-bg-l) + 5%)),
      hsl(calc(var(--cover-hue, 210) + 18) var(--cover-bg-s) calc(var(--cover-bg-l) - 6%)));
  color: hsl(var(--cover-hue, 210) var(--cover-fg-s) var(--cover-fg-l));
}

.lp-demo-tile-new {
  background-image: none;
  background-color: var(--surface);
  border: 2px dashed var(--accent-line);
  color: var(--accent-text);
}

.lp-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}

@media (max-width: 800px) {
  .lp-steps-list { grid-template-columns: 1fr; }
}

.lp-step {
  min-width: 0;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background-color: var(--surface-2);
  border: 1px solid var(--line-soft);
}

.lp-step-number {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: var(--sp-3);
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.lp-step-title {
  margin: 0 0 var(--sp-2) 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-strong);
}

.lp-step-body {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.lp-faq-list {
  max-width: 44rem;
  margin: 0 auto;
  display: grid;
  gap: var(--sp-3);
}

.lp-faq-item {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
}

.lp-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-strong);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.lp-faq-item summary::-webkit-details-marker { display: none; }

.lp-faq-item summary::after {
  content: "+";
  flex: none;
  font-size: var(--fs-xl);
  line-height: 1;
  color: var(--accent-text);
  transition: transform 0.16s var(--ease);
}
.lp-faq-item[open] summary::after {
  content: "−";
}

.lp-faq-item p {
  margin: var(--sp-3) 0 0 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.lp-final {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: 0 var(--lp-edge) clamp(var(--sp-7), 6vw, var(--sp-8));
}

.lp-final-panel {
  text-align: center;
  padding: clamp(var(--sp-6), 5vw, var(--sp-8)) var(--sp-5);
  border-radius: var(--r-xl);
  background-color: var(--panel-loud);
  color: var(--panel-loud-ink);
}

.lp-final-mark {
  --mark-size: 52px;
  --mark-tile: var(--brand-ink);
  --mark-ink: var(--brand-tile);
  --mark-underline: var(--brand-underline-on-light);
  display: inline-grid;
  margin-bottom: var(--sp-4);
}

.lp-final-title {
  margin: 0 0 var(--sp-2) 0;
  font-family: var(--display-font);
  font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--panel-loud-ink);
}

.lp-final-sub {
  margin: 0 0 var(--sp-5) 0;
  color: var(--panel-loud-mute);
}

.lp-final-note { color: var(--panel-loud-mute); }

.lp-email-onaccent {
  margin: 0 auto;
  border-color: transparent;
  box-shadow: var(--shadow-3);
}

.lp-footer {
  border-top: 1px solid var(--line-soft);
  background-color: var(--surface-2);
}

.lp-footer-inner {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: var(--sp-6) var(--lp-edge) calc(var(--sp-8) + var(--sp-6));
  text-align: center;
}

.lp-footer-brand {
  margin: 0 0 var(--sp-3) 0;
  font-family: var(--display-font);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-strong);
}

.lp-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3) var(--sp-5);
  margin-bottom: 0;
}

.lp-footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.lp-footer-links a:hover { color: var(--accent-text); }

.lp-sticky {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background-color: var(--panel-loud);
  border-top: 1px solid var(--panel-loud);
  box-shadow: var(--shadow-3);
}

.lp-sticky-inner {
  max-width: var(--lp-max);
  margin: 0 auto;
  padding: var(--sp-3) var(--lp-edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.lp-sticky-title {
  margin: 0;
  font-weight: 600;
  color: var(--panel-loud-ink);
}

.lp-sticky-sub {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--panel-loud-mute);
}

.lp-sticky .lp-email { max-width: 24rem; flex: 1; margin: 0; }

@media (max-width: 620px) {
  .lp-sticky-words { display: none; }
  .lp-sticky .lp-email { max-width: none; }
}

.picker-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.picker-actions .flashcards-button {
  margin-top: 0;
}

.create-button {
  padding: 13px 30px;
  font-weight: 600;
}

.create-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: var(--sp-4) 0 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.create-spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: create-spin 0.8s linear infinite;
}

@keyframes create-spin {
  to { transform: rotate(360deg); }
}

.create-steps {
  flex: 1 1 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
  text-align: start;
}

.create-step {
  display: grid;
  grid-template-columns: 18px 84px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}

.create-step-mark {
  display: flex;
  justify-content: center;
  font-weight: 700;
  color: var(--ink-mute);
}
.create-step[data-state="done"] .create-step-mark    { color: var(--good); }
.create-step[data-state="partial"] .create-step-mark { color: var(--caution); }
.create-step[data-state="failed"] .create-step-mark  { color: var(--danger); }

.create-step-name {
  font-weight: 600;
  color: var(--ink);
}

.create-step-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.create-step-time {
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  flex: 1 1 100%;
  display: block;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background-color: var(--accent);
  background-image: linear-gradient(135deg,
    var(--accent-hover) 25%, transparent 25%,
    transparent 50%, var(--accent-hover) 50%,
    var(--accent-hover) 75%, transparent 75%);
  background-size: 16px 16px;
  transition: width 0.4s var(--ease);
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  to { background-position: 16px 0; }
}

.create-progress.is-finished .progress-fill {
  animation: none;
}

.create-progress-hint {
  flex: 1 1 100%;
  min-width: 0;
  text-align: start;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
}

@media (prefers-reduced-motion: reduce) {
  .create-spinner { animation: none; }
  .progress-fill { animation: none; transition: none; }
}

.create-own-audio {
  margin: var(--sp-4) 0 0;
  text-align: start;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.create-own-audio summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-text);
}

.create-own-audio[open] summary {
  margin-bottom: var(--sp-2);
}

.admin-warning {
  margin: 0 0 var(--sp-5);
  padding: 12px 14px;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--warm-text);
  background-color: var(--warm-wash);
  border: 1px solid var(--warm-line);
  border-radius: var(--r-md);
}

.options-subtitle {
  margin: var(--sp-5) 0 var(--sp-3);
  font-family: var(--ui-font);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-strong);
}

#screen-admin .options-input-wide {
  width: 100%;
  max-width: 100%;
}

#admin-story-list li {
  flex-wrap: wrap;
}

.create-limit.is-full {
  color: var(--danger);
  font-weight: 600;
}

.welcome-page {
  max-width: 640px;
}

.welcome-languages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.welcome-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4) var(--sp-5);
}

.welcome-card-flag {
  display: flex;
  margin-bottom: var(--sp-2);
}
.welcome-card-flag .flag {
  width: 54px;
  height: 36px;
  border-radius: 7px;
}

.welcome-card-name {
  font-size: var(--fs-lg);
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.welcome-card-count {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-mute);
}

.welcome-card-tick {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--btn-edge);
}
.welcome-card-tick svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}

.welcome-card.is-picked {
  color: var(--on-accent);
  background-color: var(--accent);
  border-color: var(--accent);
  --btn-lip: var(--accent-lip);
}
.welcome-card.is-picked:hover {
  color: var(--on-accent);
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}
.welcome-card.is-picked .welcome-card-count {
  color: var(--on-accent);
}
.welcome-card.is-picked .welcome-card-tick {
  background-color: var(--on-accent);
  border-color: var(--on-accent);
}
.welcome-card.is-picked .welcome-card-tick svg {
  visibility: visible;
}

.welcome-actions {
  margin-top: var(--sp-6);
}

@media (max-width: 430px) {
  .welcome-languages {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    margin-top: var(--sp-5);
  }
  .welcome-card {
    flex-direction: row;
    gap: var(--sp-3);
    padding: 14px 52px 14px 16px;
    text-align: left;
  }
  .welcome-card-flag {
    margin-bottom: 0;
  }
  .welcome-card-flag .flag {
    width: 36px;
    height: 24px;
    border-radius: 5px;
  }
  .welcome-card-name {
    flex: 1;
    font-size: var(--fs-md);
  }
  .welcome-card-tick {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
  }
}

.welcome-actions .btn-primary:disabled {
  color: var(--ink-soft);
  background-color: var(--btn-face);
  border-color: var(--btn-edge);
  box-shadow: none;
  transform: none;
  cursor: default;
}

.welcome-help {
  text-align: center;
}

.language-subheading {
  margin: var(--sp-3) 0 2px 0;
  font-family: var(--ui-font);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-mute);
}

.lp-legal {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--sp-7) var(--lp-edge) var(--sp-8);
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.65;
}

.lp-legal-title {
  margin: 0 0 var(--sp-2) 0;
  font-family: var(--display-font);
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

.lp-legal-date {
  margin: 0 0 var(--sp-6) 0;
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}

.lp-legal h2 {
  margin: var(--sp-7) 0 var(--sp-3) 0;
  font-family: var(--display-font);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-strong);
}

.lp-legal h3 {
  margin: var(--sp-5) 0 var(--sp-2) 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-strong);
}

.lp-legal p,
.lp-legal ul {
  margin: 0 0 var(--sp-4) 0;
}

.lp-legal ul { padding-left: 1.25rem; }
.lp-legal li { margin-bottom: var(--sp-2); }

.lp-legal a {
  color: var(--accent-text);

  overflow-wrap: anywhere;
}

.lp-legal strong { color: var(--ink-strong); }

.lp-legal-summary {
  margin: 0 0 var(--sp-6) 0;
  padding: var(--sp-4) var(--sp-5);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.lp-legal-summary h2 { margin-top: 0; }
.lp-legal-summary ul { margin-bottom: 0; }

.lp-legal-table-wrap {
  margin: 0 0 var(--sp-4) 0;
  overflow-x: auto;
}

.lp-legal-table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.lp-legal-table th,
.lp-legal-table td {
  padding: var(--sp-3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.lp-legal-table th {
  font-weight: 600;
  color: var(--ink-strong);
  background-color: var(--surface-2);
}

.privacy-note {
  margin-top: var(--sp-5);
  text-align: center;
}
.privacy-note a { color: var(--accent-text); }

.upgrade-button {
  order: 1;
  height: auto;
  padding: 7px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-strong);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-btn);
}
.upgrade-button:hover {
  border-color: var(--ink-strong);
}

@media (max-width: 374px) {
  :root {
    --corner-w: 57px;
    --corner-gap: 4px;
    --corner-edge: 6px;
  }
}

.upgrade-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-3);
  font-family: var(--ui-font);
}
.upgrade-dialog::backdrop {
  background-color: var(--scrim);
}

.upgrade-inner {
  position: relative;
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
}

.upgrade-close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  min-width: 40px;
  padding-left: 0;
  padding-right: 0;
}
.upgrade-close .btn-icon { margin-right: 0; }

.upgrade-title {
  margin: 0 var(--sp-7) var(--sp-3) 0;
  font-family: var(--display-font);
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--ink-strong);
}

.upgrade-reason {
  margin: 0 0 var(--sp-4) 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background-color: var(--warm-wash);
  border: 1px solid var(--warm-line);
  color: var(--ink-strong);
  line-height: 1.5;
}

.upgrade-current {
  margin: 0 0 var(--sp-4) 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.upgrade-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--sp-4);
  align-items: stretch;
}

.upgrade-plan {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  border-radius: 8px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
}

.upgrade-plan-featured {
  border-color: var(--accent);
  background-color: var(--accent-wash);
}

.upgrade-plan-badge {
  position: absolute;
  top: -11px;
  left: var(--sp-4);
  padding: 3px 12px;
  border-radius: var(--r-btn);
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.upgrade-plan-name {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-strong);
}

.upgrade-plan-price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.upgrade-plan-amount {
  font-family: var(--display-font);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.upgrade-plan-interval {
  font-size: var(--fs-md);
  color: var(--ink-mute);
}

.upgrade-plan-tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.upgrade-plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}
.upgrade-plan-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--ink);
  line-height: 1.45;
}

.upgrade-tick {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  fill: none;
  stroke: var(--good);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upgrade-plan-go {
  margin-top: auto;
}
.upgrade-plan-note {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  text-align: center;
}

.upgrade-manage-row {
  margin-top: var(--sp-3);
  text-align: center;
}

.upgrade-note {
  margin: var(--sp-4) 0 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.5;
}

#screen-create .create-fields .options-input-wide {
  width: 100%;
}

.create-writing .create-limit {
  margin: 0 0 var(--sp-4);
}

.create-text-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px var(--sp-4);
  margin: var(--sp-2) 0 0;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  text-align: start;
  min-width: 0;
}
.create-text-meta span { min-width: 0; }
.create-text-meta span:empty { display: none; }

.create-option + .create-option,
.create-go {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line-soft);
}

.create-option > .options-row:first-child {
  margin-bottom: 0;
}

.create-option .create-voice-row {
  margin: var(--sp-4) 0 0;
}

.create-go .options-status {
  margin-top: var(--sp-3);
}
.create-go .options-status:empty {
  display: none;
}

.create-yours .create-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--sp-3);
}
.create-yours .create-list li,
.create-yours .create-list li:last-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name delete"
                       "meta delete";
  align-items: center;
  gap: 4px var(--sp-3);
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  background-color: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.create-yours .create-item-name   { grid-area: name; }
.create-yours .create-item-meta   { grid-area: meta; white-space: normal; }
.create-yours .create-item-delete { grid-area: delete; }

.create-yours .create-list li.create-empty {
  display: block;
  grid-column: 1 / -1;
  padding: 0;
  background: none;
  border: none;
}

@media (min-width: 1000px) {

  .create-page {
    max-width: 1160px;
    text-align: left;
  }
  .create-page .picker-hint {
    margin-left: 0;
    margin-right: 0;
  }

  .create-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: var(--sp-5);
    align-items: start;
  }

  .create-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: var(--sp-4);
  }

  .create-textarea {
    min-height: 440px;
  }
}

@media (min-width: 1000px) and (min-height: 820px) {
  .create-rail {
    position: sticky;
    top: 96px;
  }
}

.title-story {
  max-width: var(--col);
  margin: 0 auto var(--sp-2);
  text-align: center;
  font-family: var(--ui-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-mute);
}

.reader-rail {
  display: contents;
}
.reader-place,
.rail-voice {
  display: none;
}

.next-chapter-button .btn-icon {
  margin-right: 0;
  margin-left: 6px;
}

@media (min-width: 1200px) {
  :root {
    --text-base: clamp(1.35rem, 0.5rem + 1.2vw, 1.75rem);
    --col: min(900px, 62vw);
  }
  .reader {
    max-width: none;
  }
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 20px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--display-font);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}
.topbar-brand .lp-mark {
  --mark-size: 26px;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}
.topbar .corner-button {
  position: static;
}
.topbar .account {
  order: 2;
}
.topbar .vocab-button .corner-glyph,
.topbar .analysis-button .corner-glyph,
.topbar .upgrade-button .corner-glyph,
.topbar .language-button .corner-label,
.topbar .account-button .corner-label {
  display: none;
}
.topbar .language-button .corner-glyph {
  gap: 7px;
}
.topbar .account-button .corner-glyph {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--surface-sunk);
  border: 1px solid var(--line);
  color: var(--ink-strong);
  font-size: 0.82rem;
  font-weight: 600;
}
.topbar .account-button:hover .corner-glyph {
  border-color: var(--ink-mute);
}
.topbar .account-button .corner-icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 480px) {
  .topbar {
    padding: 0 12px;
    gap: var(--sp-2);
  }
  .topbar-nav {
    gap: 12px;
  }
  .topbar-brand-name {
    display: none;
  }
  .corner-button {
    font-size: 0.85rem;
  }
  .upgrade-button {
    padding: 6px 8px;
  }
  .back-button {
    left: 12px;
  }
  .menu-button {
    right: 12px;
  }
}

@media (max-width: 374px) {
  .topbar-nav {
    gap: 10px;
  }
  .topbar .upgrade-button {
    padding: 0;
    border: 0;
  }
  .topbar .language-flag {
    display: none;
  }
}

@media (max-width: 480px) {
  .translation-percent {
    display: none;
  }
  .translation-card {
    padding: 12px;
    gap: var(--sp-2);
  }
}
