/* ══════════════════════════════════════════════════════════════
   拾词 Lexi — visual system
   Paper, ink, forest, and a little amber warmth.
   ══════════════════════════════════════════════════════════════ */

:root {
  --paper: #f6f0e6;
  --paper-deep: #eee5d5;
  --paper-dark: #e6dac6;
  --surface: #fffdf8;
  --surface-soft: #fbf7ef;
  --ink: #1b2722;
  --ink-2: #394b43;
  --ink-soft: #5f6b64;
  --muted: #8b918a;
  --forest: #173f36;
  --forest-2: #215a4a;
  --forest-3: #2d705c;
  --amber: #dfa45a;
  --amber-soft: #f0d3a6;
  --amber-wash: #f5e7d0;
  --clay: #b76549;
  --danger: #a54132;
  --line: #ded4c3;
  --line-soft: #eae2d5;
  --white: #fffdf8;
  --shadow-sm: 0 2px 8px rgba(38, 39, 31, 0.04);
  --shadow-md: 0 14px 38px rgba(38, 39, 31, 0.08);
  --shadow-lg: 0 28px 80px rgba(23, 35, 28, 0.16);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Songti SC", "STSong", "Noto Serif SC", serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --sidebar-w: 252px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --ease: cubic-bezier(0.22, 0.7, 0.25, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(225, 198, 154, 0.13), transparent 38rem),
    radial-gradient(circle at 90% 30%, rgba(27, 78, 63, 0.05), transparent 44rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-scroll-locked,
body.word-open {
  overflow: hidden;
}

::selection {
  color: var(--ink);
  background: var(--amber-soft);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--forest);
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ol,
ul {
  margin: 0;
  padding: 0;
}

svg {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
}

.icon {
  pointer-events: none;
}

:focus-visible {
  outline: 2px solid var(--forest-3);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: rgba(255, 252, 244, 0.56);
}

.dot-sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  vertical-align: middle;
}

/* ── Buttons ────────────────────────────────────────────────── */

.primary-btn,
.ghost-btn,
.danger-btn,
.hero-cta,
.text-btn,
.icon-btn,
.round-audio,
.small-action,
.save-word-btn {
  -webkit-tap-highlight-color: transparent;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--forest);
  border-radius: 999px;
  color: var(--white);
  background: var(--forest);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--forest-2);
  box-shadow: 0 8px 20px rgba(23, 63, 54, 0.18);
}

.primary-btn:active {
  transform: translateY(0);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color 180ms var(--ease), background 180ms var(--ease);
}

.ghost-btn:hover {
  border-color: #c6b9a3;
  background: rgba(255, 253, 248, 0.7);
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--danger);
  border-radius: 999px;
  color: var(--white);
  background: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.danger-btn:hover {
  background: #8f3326;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink-2);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 253, 248, 0.8);
  border-color: var(--line);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.text-btn:hover {
  color: var(--forest);
  border-color: var(--forest);
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.ghost-btn .btn-spinner {
  border-color: rgba(23, 63, 54, 0.2);
  border-top-color: var(--forest);
}

/* ── Boot ───────────────────────────────────────────────────── */

.boot-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  animation: fadeIn 500ms var(--ease);
}

.boot-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 18px;
  color: var(--paper);
  background: var(--forest);
  box-shadow: 0 16px 40px rgba(23, 63, 54, 0.22);
  font-family: var(--serif);
  font-size: 29px;
  animation: breathe 2.6s ease-in-out infinite;
}

.boot-title {
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: 0.08em;
}

.boot-title span {
  margin-left: 3px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.boot-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--paper);
  background: var(--forest);
  font-size: 17px;
}

/* ── Auth ───────────────────────────────────────────────────── */

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.88fr);
  min-height: 100svh;
  background: var(--surface-soft);
}

.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100svh;
  overflow: hidden;
  padding: 42px clamp(34px, 5vw, 76px);
  color: var(--paper);
  background:
    radial-gradient(circle at 72% 20%, rgba(223, 164, 90, 0.18), transparent 26rem),
    radial-gradient(circle at 12% 90%, rgba(93, 143, 120, 0.16), transparent 30rem),
    var(--forest);
}

.auth-art::before {
  content: "";
  position: absolute;
  right: -18vw;
  bottom: -28vw;
  width: 62vw;
  height: 62vw;
  border: 1px solid rgba(246, 240, 230, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 8vw rgba(246, 240, 230, 0.022),
    0 0 0 18vw rgba(246, 240, 230, 0.015);
  pointer-events: none;
}

.auth-art-texture {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: repeating-linear-gradient(112deg, transparent 0 52px, rgba(246, 240, 230, 0.08) 53px, transparent 54px 104px);
  pointer-events: none;
}

.auth-brand,
.mobile-auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 41px;
  height: 41px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--paper);
  background: var(--forest);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.auth-brand .brand-mark {
  color: var(--forest);
  background: var(--paper);
}

.brand-type {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.brand-type strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-type span {
  color: currentColor;
  opacity: 0.48;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.auth-copy {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  margin: 8vh 0;
}

.auth-copy h1 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.auth-copy h1 em {
  color: var(--amber);
  font-style: italic;
}

.auth-lead {
  max-width: 490px;
  color: rgba(246, 240, 230, 0.7);
  font-size: 15px;
  line-height: 1.9;
}

.auth-word-card {
  position: relative;
  width: min(430px, 100%);
  margin-top: 44px;
  padding: 22px 24px 20px;
  border: 1px solid rgba(246, 240, 230, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 24px 70px rgba(5, 20, 15, 0.2);
  backdrop-filter: blur(14px);
}

.auth-word-card::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 23px;
  width: 30px;
  height: 1px;
  background: var(--amber);
  opacity: 0.8;
}

.auth-word-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 32px;
}

.auth-word {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.02em;
}

.auth-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(246, 240, 230, 0.18);
  border-radius: 50%;
  color: var(--amber);
  background: transparent;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.auth-sound:hover {
  color: var(--forest);
  background: var(--amber);
}

.auth-ipa {
  margin-top: 4px;
  color: rgba(246, 240, 230, 0.55);
  font-family: var(--serif);
  font-size: 14px;
}

.auth-meaning {
  margin-top: 12px;
  color: rgba(246, 240, 230, 0.9);
  font-size: 14px;
  line-height: 1.7;
}

.auth-tags {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}

.auth-tags span {
  padding: 2px 9px;
  border: 1px solid rgba(246, 240, 230, 0.1);
  border-radius: 99px;
  color: rgba(246, 240, 230, 0.45);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.auth-art-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(246, 240, 230, 0.34);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-art-footer .auth-art-line {
  flex: 1;
  height: 1px;
  background: rgba(246, 240, 230, 0.12);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px clamp(30px, 5vw, 80px);
  background:
    radial-gradient(circle at 100% 0%, rgba(223, 164, 90, 0.09), transparent 24rem),
    var(--surface-soft);
}

.auth-panel-inner {
  width: min(390px, 100%);
}

.mobile-auth-brand {
  display: none;
}

.auth-intro {
  margin-bottom: 28px;
}

.auth-intro h2 {
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.auth-intro > p:last-child {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 23px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--paper);
}

.auth-tabs button {
  padding: 9px 12px;
  border: 0;
  border-radius: 99px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}

.auth-tabs button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: block;
}

.field-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.field-label small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
}

.field-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.field-input:focus-within {
  border-color: var(--forest-3);
  box-shadow: 0 0 0 3px rgba(45, 112, 92, 0.09);
}

.field-input.plain {
  padding: 0 14px;
}

.field-input input {
  width: 100%;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.field-input input::placeholder,
textarea::placeholder {
  color: #a8aaa3;
}

.form-error {
  display: none;
  padding: 9px 12px;
  border-radius: 9px;
  color: #8e3528;
  background: #f9e9e3;
  font-size: 12.5px;
  line-height: 1.55;
}

.form-error.is-visible {
  display: block;
}

.auth-submit {
  width: 100%;
  margin-top: 3px;
  min-height: 49px;
  justify-content: space-between;
  padding: 0 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 10px;
}

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

.auth-demo {
  width: 100%;
  min-height: 47px;
  color: var(--forest);
  border-color: #cfc5b4;
}

.auth-note {
  margin-top: 21px;
  padding: 12px 14px;
  border-left: 2px solid var(--amber);
  color: var(--ink-soft);
  background: rgba(240, 211, 166, 0.16);
  font-size: 11.5px;
  line-height: 1.7;
}

.auth-note strong {
  color: var(--forest);
  font-weight: 700;
  word-break: break-all;
}

.auth-legal {
  margin-top: 19px;
  color: #a0a49d;
  font-size: 10px;
  line-height: 1.7;
}

/* ── App shell ──────────────────────────────────────────────── */

.workspace {
  min-height: 100svh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--sidebar-w);
  padding: 28px 18px 20px;
  border-right: 1px solid rgba(113, 101, 80, 0.13);
  background:
    radial-gradient(circle at 20% 5%, rgba(255, 253, 248, 0.62), transparent 20rem),
    var(--paper-deep);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
}

.brand-button .brand-type strong {
  font-size: 20px;
}

.brand-button .brand-type span {
  color: var(--muted);
}

.sidebar-import {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  margin: 29px 0 24px;
  border: 1px solid var(--forest);
  border-radius: 12px;
  color: var(--paper);
  background: var(--forest);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(23, 63, 54, 0.14);
  transition: transform 170ms var(--ease), background 170ms var(--ease);
}

.sidebar-import:hover {
  transform: translateY(-1px);
  background: var(--forest-2);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: color 160ms var(--ease), background 160ms var(--ease);
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.5);
}

.nav-item.is-active {
  color: var(--forest);
  background: rgba(255, 253, 248, 0.82);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(47, 48, 39, 0.035);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: var(--amber);
}

.nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--muted);
  background: rgba(126, 126, 113, 0.08);
  font-size: 10px;
  text-align: center;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.device-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(113, 101, 80, 0.13);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.38);
  text-align: left;
}

.device-card:hover {
  background: rgba(255, 253, 248, 0.7);
}

.device-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--forest);
  background: rgba(23, 63, 54, 0.07);
}

.device-card > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.device-card strong {
  font-size: 10.5px;
  font-weight: 600;
}

.device-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card > svg {
  color: var(--muted);
}

.account-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.account-button:hover {
  background: rgba(255, 253, 248, 0.5);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--forest);
  background: var(--amber-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.avatar.large {
  width: 54px;
  height: 54px;
  font-size: 22px;
}

.avatar-btn {
  border: 0;
  padding: 0;
}

.account-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.account-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.sync-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b8b68;
  box-shadow: 0 0 0 2px rgba(75, 139, 104, 0.12);
}

.account-button > svg {
  color: var(--muted);
}

.mobile-topbar,
.mobile-nav {
  display: none;
}

.main-content {
  margin-left: var(--sidebar-w);
  padding: 42px 46px 92px;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  animation: pageIn 360ms var(--ease) both;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 3.2vw, 44px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

/* ── Library ────────────────────────────────────────────────── */

.library-header {
  margin-bottom: 28px;
}

.library-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0.72fr;
  min-height: 310px;
  overflow: hidden;
  padding: 44px clamp(30px, 4.5vw, 58px);
  border-radius: var(--radius-lg);
  color: var(--paper);
  background:
    radial-gradient(circle at 82% 28%, rgba(223, 164, 90, 0.16), transparent 19rem),
    linear-gradient(122deg, #173f36, #1c4a3e 62%, #245648);
  box-shadow: 0 24px 60px rgba(23, 53, 43, 0.13);
}

.library-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -150px;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(246, 240, 230, 0.08);
  border-radius: 50%;
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgba(246, 240, 230, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  top: -160px;
  right: -80px;
  width: 420px;
  height: 420px;
}

.orbit-two {
  top: -110px;
  right: -30px;
  width: 320px;
  height: 320px;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.hero-content h2 {
  font-family: var(--serif);
  font-size: clamp(33px, 3.9vw, 49px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.hero-content h2 em {
  color: var(--amber);
  font-style: italic;
}

.hero-content > p:not(.eyebrow) {
  max-width: 430px;
  margin-top: 18px;
  color: rgba(246, 240, 230, 0.58);
  font-size: 13px;
  line-height: 1.85;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  padding: 9px 16px;
  border: 1px solid rgba(246, 240, 230, 0.22);
  border-radius: 999px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
}

.hero-cta:hover {
  color: var(--forest);
  border-color: var(--amber);
  background: var(--amber);
}

.hero-word {
  position: relative;
  z-index: 1;
  display: flex;
  align-self: center;
  justify-self: end;
  width: min(285px, 100%);
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 28px;
  border: 1px solid rgba(246, 240, 230, 0.12);
  border-radius: 42% 58% 55% 45% / 48% 44% 56% 52%;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  transform: rotate(2deg);
}

.hero-word::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(246, 240, 230, 0.08);
  border-radius: inherit;
}

.hero-word-small {
  color: rgba(246, 240, 230, 0.35);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-word strong {
  margin: 5px 0 1px;
  color: var(--amber);
  font-family: var(--serif);
  font-size: 41px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.03em;
}

.hero-word-ipa {
  color: rgba(246, 240, 230, 0.42);
  font-family: var(--serif);
  font-size: 11.5px;
}

.hero-word-cn {
  margin-top: 11px;
  color: rgba(246, 240, 230, 0.72);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.hero-word-line {
  width: 34px;
  height: 1px;
  margin-top: 17px;
  background: rgba(223, 164, 90, 0.7);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 27px 0 46px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 20px;
  border-right: 1px solid var(--line-soft);
}

.stat-item:first-child {
  padding-left: 2px;
}

.stat-item:last-child {
  border-right: 0;
}

.stat-value {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--muted);
  font-size: 10.5px;
}

.library-section {
  margin-top: 8px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.5);
}

.filter-tab {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 150ms var(--ease), background 150ms var(--ease);
}

.filter-tab:hover {
  color: var(--ink-2);
}

.filter-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.doc-card {
  --card-accent: #7e9a88;
  --card-wash: #eef2ec;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: cardIn 380ms var(--ease) both;
  animation-delay: var(--delay, 0ms);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease);
}

.doc-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--card-accent);
  opacity: 0.8;
}

.doc-card:hover {
  transform: translateY(-3px);
  border-color: #d2c7b5;
  box-shadow: var(--shadow-md);
}

.doc-sage { --card-accent: #7a947f; --card-wash: #edf1eb; }
.doc-clay { --card-accent: #b87358; --card-wash: #f7ece6; }
.doc-ink { --card-accent: #697b7a; --card-wash: #edf0ef; }
.doc-ochre { --card-accent: #c69a53; --card-wash: #f7f0e1; }
.doc-plum { --card-accent: #8e737e; --card-wash: #f3edef; }

.doc-open {
  display: flex;
  width: 100%;
  min-height: 225px;
  flex-direction: column;
  align-items: flex-start;
  padding: 23px 24px 18px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 16px;
}

.doc-kind {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.progress-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(var(--card-accent) var(--progress, 0deg), var(--line-soft) 0);
  font-size: 0;
}

.progress-ring::before {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--surface);
}

.progress-ring span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.doc-card h3 {
  display: -webkit-box;
  overflow: hidden;
  max-width: calc(100% - 12px);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.doc-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted);
  font-size: 9.5px;
}

.doc-status {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 99px;
  color: var(--ink-soft);
  background: var(--card-wash);
  font-size: 9px;
  white-space: nowrap;
}

.doc-status.is-done {
  color: var(--forest);
}

.doc-progress-track {
  width: 100%;
  height: 2px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-soft);
}

.doc-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--card-accent);
}

.doc-more {
  position: absolute;
  top: 52px;
  right: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  opacity: 0;
  transition: opacity 160ms var(--ease), background 160ms var(--ease);
}

.doc-card:hover .doc-more,
.doc-more:focus-visible {
  opacity: 1;
}

.doc-more:hover {
  background: var(--paper);
  border-color: var(--line-soft);
}

.doc-card.is-word-card .doc-open {
  min-height: 208px;
  background:
    radial-gradient(circle at 92% 0%, var(--card-wash), transparent 15rem);
}

.doc-card.is-word-card h3 {
  font-size: 34px;
  font-style: italic;
  color: var(--forest);
}

.doc-card.is-word-card .doc-excerpt {
  display: none;
}

.doc-card.is-word-card .doc-meta {
  padding-top: 25px;
}

.empty-library {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 330px;
  padding: 40px 20px;
  border: 1px dashed #d8cdbb;
  border-radius: 20px;
  text-align: center;
  background: rgba(255, 253, 248, 0.4);
}

.empty-illustration {
  position: relative;
  width: 96px;
  height: 88px;
  margin-bottom: 21px;
}

.empty-page {
  position: absolute;
  bottom: 0;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 61px;
  height: 74px;
  border: 1px solid #d2c6b2;
  border-radius: 5px 10px 6px 5px;
  background: var(--surface);
  box-shadow: 3px 5px 0 rgba(194, 178, 152, 0.12);
}

.empty-page.page-back {
  left: 11px;
  bottom: 5px;
  transform: rotate(-9deg);
  background: var(--paper-deep);
}

.empty-page.page-front span {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
}

.empty-spark {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--forest);
  background: var(--amber-soft);
}

.empty-library h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.empty-library p {
  max-width: 380px;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.empty-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 130px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
}

.library-footnote {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 17px;
  border-top: 1px solid var(--line-soft);
  color: #979b94;
  font-size: 9.5px;
  letter-spacing: 0.025em;
}

.library-footnote span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Modal & forms ──────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 33, 27, 0.38);
  backdrop-filter: blur(4px);
  animation: fadeIn 180ms var(--ease);
}

.modal {
  display: flex;
  width: min(520px, 100%);
  max-height: min(88svh, 860px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 248, 0.55);
  border-radius: 22px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-lg);
  animation: modalIn 260ms var(--ease);
}

.modal-wide {
  width: min(720px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 16px;
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.panel-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 26px 26px;
  overscroll-behavior: contain;
}

.modal-footer {
  flex: 0 0 auto;
  padding: 14px 26px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.modal-footer .modal-actions {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.import-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upload-zone {
  position: relative;
  padding: 16px 17px;
  border: 1px dashed #cbbda6;
  border-radius: 14px;
  background:
    radial-gradient(circle at 96% 10%, rgba(223, 164, 90, 0.1), transparent 13rem),
    rgba(255, 253, 248, 0.55);
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}

.upload-zone:hover,
.upload-zone:focus-visible {
  border-color: var(--forest-3);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(36, 55, 45, 0.04);
}

.upload-zone.is-dragging {
  border-color: var(--amber);
  background: var(--amber-wash);
  box-shadow: inset 0 0 0 2px rgba(223, 164, 90, 0.16);
}

.upload-zone.is-loading {
  cursor: wait;
  border-style: solid;
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.8);
}

.upload-zone-idle,
.upload-zone-loading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.upload-zone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--forest);
  background: var(--amber-soft);
}

.upload-zone-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.upload-zone-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone-action {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 9.5px;
  font-weight: 600;
}

.upload-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid rgba(23, 63, 54, 0.16);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.upload-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: -6px;
  padding-left: 2px;
}

.upload-formats span {
  padding: 2px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  color: #9a9c94;
  background: rgba(246, 240, 230, 0.58);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.extract-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid #cfe0d3;
  border-radius: 11px;
  background: #f0f6f0;
}

.extract-result.is-error {
  border-color: #eccdc4;
  background: #fbf0ec;
}

.extract-result.has-warnings {
  border-color: #e8d4ad;
  background: #fcf6e8;
}

.extract-result.has-warnings .extract-check {
  color: #916d36;
  background: #f2e2c3;
}

.extract-result.has-warnings .extract-copy > span {
  color: #8a744f;
}

.extract-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #4a8061;
  background: #deeddf;
}

.extract-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.extract-copy strong {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extract-copy > span {
  color: #678071;
  font-size: 9.5px;
}

.extract-warnings {
  margin-top: 4px;
  padding-left: 13px;
  color: #977548;
  font-size: 9px;
  line-height: 1.6;
}

.extract-again {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--forest);
  background: transparent;
  font-size: 9.5px;
  font-weight: 600;
}

.extract-again:hover {
  border-color: var(--forest);
}

.import-divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  color: var(--muted);
  font-size: 9px;
}

.import-divider::before,
.import-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.import-text-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.import-text-wrap:focus-within {
  border-color: var(--forest-3);
  box-shadow: 0 0 0 3px rgba(45, 112, 92, 0.08);
}

.import-text-wrap.is-dragging {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 2px rgba(223, 164, 90, 0.18);
}

.import-text-wrap textarea {
  display: block;
  width: 100%;
  min-height: 280px;
  max-height: 46svh;
  padding: 18px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
}

.import-text-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--line-soft);
  background: rgba(246, 240, 230, 0.4);
}

.import-file-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.import-count {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.drop-hint {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  background: rgba(246, 240, 230, 0.9);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.import-text-wrap.is-dragging .drop-hint {
  display: flex;
}

.import-tip {
  display: flex;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.import-tip svg {
  margin-top: 2px;
}

.doc-menu-summary {
  padding: 17px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface);
}

.doc-menu-summary h3 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.doc-menu-summary p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.action-list {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  background: transparent;
  text-align: left;
}

.action-row:last-child {
  border-bottom: 0;
}

.action-row:hover {
  background: var(--paper);
}

.action-row > span {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.action-row strong {
  font-size: 12.5px;
  font-weight: 600;
}

.action-row small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}

.action-row > svg:last-child {
  color: var(--muted);
}

.action-row.danger {
  color: var(--danger);
}

.action-row.danger small {
  color: #b98074;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.confirm-content {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.confirm-content strong {
  color: var(--ink);
}

/* ── Reader ─────────────────────────────────────────────────── */

.reader-page {
  width: min(900px, 100%);
  padding-bottom: 120px;
}

.reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px 7px 2px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.back-btn:hover {
  color: var(--forest);
}

.reader-top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.font-controls {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.55);
}

.font-controls .icon-btn {
  width: 31px;
  height: 31px;
  font-size: 11px;
}

.font-controls > span {
  min-width: 22px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.reader-intro {
  max-width: 760px;
  margin: 0 auto 31px;
}

.reader-intro h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.8vw, 55px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.eyebrow-divider {
  margin: 0 5px;
  opacity: 0.5;
}

.reader-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10.5px;
}

.reader-sync {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 5px;
  color: #708b79;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto 22px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.reader-toolbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-add-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.48);
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}

.quick-add-toggle:hover {
  color: var(--forest);
  border-color: #cfc3b0;
}

.quick-add-toggle.is-active {
  color: var(--paper);
  border-color: var(--forest);
  background: var(--forest);
}

.translation-toggle {
  font-size: 9px;
  letter-spacing: 0.02em;
}

.translation-toggle.is-active {
  color: var(--forest);
  border-color: var(--amber);
  background: rgba(223, 164, 90, 0.18);
}

.paragraph-translation {
  max-width: 760px;
  margin: -1.05em auto 1.75em;
  padding: 9px 13px;
  border-left: 2px solid var(--amber);
  border-radius: 0 7px 7px 0;
  background: rgba(223, 164, 90, 0.08);
  color: #4d5d55;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

.paragraph-translation.is-loading {
  color: var(--muted);
  font-style: italic;
}

.paragraph-translation.is-error {
  border-left-color: #b76549;
  color: #8f4b37;
  background: rgba(183, 101, 73, 0.07);
}

.reading-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.page-indicator {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.reading-canvas {
  max-width: 760px;
  margin: 0 auto;
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--reader-font-size, 20px);
  line-height: 1.96;
  letter-spacing: 0.002em;
}

.reading-paragraph {
  margin: 0 0 1.55em;
}

.reading-paragraph:first-child::first-letter {
  float: left;
  margin: 0.08em 0.08em 0 0;
  color: var(--forest);
  font-family: var(--serif);
  font-size: 3.15em;
  line-height: 0.8;
  font-weight: 500;
}

.reading-canvas.is-single .reading-paragraph:first-child::first-letter {
  float: none;
  font-size: inherit;
  color: inherit;
}

.sentence {
  border-radius: 4px;
  transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.sentence.is-current-sentence {
  background: linear-gradient(90deg, rgba(240, 211, 166, 0.25), rgba(240, 211, 166, 0.08));
  box-shadow: -6px 0 0 rgba(223, 164, 90, 0.32);
}

.word {
  display: inline;
  margin: 0;
  padding: 0 1px;
  border: 0;
  border-radius: 3px;
  color: inherit;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  transition: color 120ms var(--ease), background-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

.word:hover {
  color: var(--forest);
  background: var(--amber-wash);
  box-shadow: 0 2px 0 rgba(183, 101, 73, 0.22);
}

.word.is-collected {
  background: rgba(240, 211, 166, 0.2);
  box-shadow: 0 1px 0 rgba(183, 101, 73, 0.15);
}

.word.is-collecting {
  opacity: 0.45;
  pointer-events: none;
}

.word.is-active {
  color: var(--white);
  background: var(--forest);
}

.word.is-speaking {
  color: var(--ink);
  background: var(--amber-soft);
  box-shadow: 0 1px 0 rgba(183, 101, 73, 0.2);
}

.reading-canvas.is-single {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 330px;
  text-align: center;
}

.single-word-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 40px 44px;
}

.single-word-kicker {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.single-word-button {
  margin: 17px 0 13px;
  color: var(--forest);
  font-family: var(--serif);
  font-size: clamp(48px, 9vw, 78px);
  font-style: italic;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.single-word-button:hover {
  color: var(--forest-2);
  background: transparent;
  box-shadow: 0 3px 0 var(--amber);
}

.single-word-button.is-active,
.single-word-button.is-speaking {
  color: var(--forest);
  background: transparent;
  box-shadow: 0 5px 0 var(--amber);
}

.single-word-caption {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10.5px;
}

.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 45px auto 0;
  padding-top: 17px;
  border-top: 1px solid var(--line-soft);
}

.page-nav > span {
  color: var(--muted);
  font-size: 9.5px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10.5px;
  font-weight: 500;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--line);
  background: var(--surface);
}

.reader-foot {
  display: flex;
  justify-content: space-between;
  max-width: 760px;
  margin: 55px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: #a0a39c;
  font-size: 9px;
}

.reader-loading {
  max-width: 760px;
  margin: 70px auto;
}

.skeleton {
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(90deg, #e7ddcd 25%, #f1e9dc 37%, #e7ddcd 63%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
}

.skeleton-kicker { width: 130px; height: 10px; margin-bottom: 25px; }
.skeleton-title { width: 82%; height: 42px; margin-bottom: 12px; }
.skeleton-title.short { width: 54%; margin-bottom: 34px; }
.skeleton-line { width: 100%; height: 14px; margin-bottom: 15px; }
.skeleton-line.mid { width: 72%; }
.skeleton-ipa { width: 150px; height: 12px; margin: 12px 0 25px; }

.reader-loading .skeleton-line:nth-child(4) { margin-top: 30px; }

.centered-message {
  display: flex;
  min-height: 60svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.message-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  border-radius: 50%;
  color: var(--forest);
  background: var(--amber-soft);
}

.centered-message h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
}

.centered-message p {
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ── Player ─────────────────────────────────────────────────── */

.speech-player {
  position: fixed;
  z-index: 60;
  right: 32px;
  bottom: 24px;
  left: calc(var(--sidebar-w) + 32px);
  max-width: 1040px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 19px;
  color: var(--paper);
  background:
    radial-gradient(circle at 35% 0%, rgba(223, 164, 90, 0.09), transparent 17rem),
    #16231f;
  box-shadow: 0 20px 55px rgba(12, 30, 23, 0.28);
  animation: playerIn 340ms var(--ease);
}

.player-progress {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: rgba(246, 240, 230, 0.1);
}

.player-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--amber);
  transition: width 250ms linear;
}

.player-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 14px 18px 13px;
}

.player-transport {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-skip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: rgba(246, 240, 230, 0.54);
  background: transparent;
}

.player-skip:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
}

.player-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  margin: 0 2px;
  border: 0;
  border-radius: 50%;
  color: var(--forest);
  background: var(--amber);
  box-shadow: 0 6px 18px rgba(223, 164, 90, 0.2);
  transition: transform 160ms var(--ease), background 160ms var(--ease);
}

.player-play:hover {
  transform: scale(1.04);
  background: #e9b46f;
}

.player-copy {
  min-width: 0;
}

.player-state {
  display: block;
  margin-bottom: 2px;
  color: rgba(246, 240, 230, 0.34);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.player-copy p {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(246, 240, 230, 0.88);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.player-speed {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 15px;
  border-left: 1px solid rgba(246, 240, 230, 0.1);
}

.speed-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
  color: rgba(246, 240, 230, 0.34);
  font-size: 8px;
  white-space: nowrap;
}

.speed-btn {
  min-width: 39px;
  height: 27px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(246, 240, 230, 0.54);
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  transition: color 150ms var(--ease), background 150ms var(--ease), border-color 150ms var(--ease);
}

.speed-btn:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.05);
}

.speed-btn.is-active {
  color: var(--ink);
  border-color: var(--amber);
  background: var(--amber);
}

/* ── Word panel ─────────────────────────────────────────────── */

.word-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 32, 26, 0.34);
  backdrop-filter: blur(3px);
  animation: fadeIn 200ms var(--ease);
}

.word-panel {
  position: fixed;
  z-index: 91;
  top: 0;
  bottom: 0;
  right: 0;
  display: flex;
  width: min(448px, 94vw);
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(255, 253, 248, 0.7);
  background: var(--surface-soft);
  box-shadow: -22px 0 70px rgba(21, 34, 27, 0.16);
  animation: slideIn 300ms var(--ease);
}

.word-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 24px 0;
}

.panel-close {
  width: 34px;
  height: 34px;
  border-color: var(--line-soft);
  background: rgba(255, 253, 248, 0.5);
}

.word-panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 25px 35px;
  overscroll-behavior: contain;
}

.word-panel-loading {
  padding-top: 7px;
}

.word-skeleton-title {
  font-family: var(--serif);
  font-size: 47px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.word-panel-loading p {
  margin-top: 25px;
  color: var(--muted);
  font-size: 10.5px;
}

.word-hero {
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line-soft);
}

.word-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.word-title-line h2 {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 55px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.round-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest);
  background: var(--surface);
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}

.round-audio:hover {
  color: var(--surface);
  border-color: var(--forest);
  background: var(--forest);
}

.ipa-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.ipa-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.55);
  font-family: var(--serif);
  font-size: 12px;
}

.ipa-chip span {
  padding: 1px 5px;
  border-radius: 99px;
  color: var(--muted);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ipa-chip strong {
  font-weight: 400;
}

.ipa-chip:hover {
  border-color: var(--line);
  background: var(--surface);
}

.word-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 12px;
  color: #8e7550;
  font-size: 10px;
  line-height: 1.6;
}

.word-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.save-word-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 37px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 600;
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}

.save-word-btn:hover {
  border-color: var(--forest);
}

.save-word-btn.is-saved {
  color: var(--paper);
  border-color: var(--forest);
  background: var(--forest);
}

.small-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 37px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 10.5px;
}

.small-action:hover {
  color: var(--forest);
  background: rgba(255, 253, 248, 0.6);
}

.word-section {
  padding: 23px 0;
  border-bottom: 1px solid var(--line-soft);
}

.word-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.word-section-head h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.word-section-head span {
  color: #a4a69e;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.definition-group {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  margin-bottom: 14px;
}

.definition-group:last-child {
  margin-bottom: 0;
}

.pos-badge {
  align-self: start;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--forest);
  background: var(--card-wash, #edf1eb);
  font-family: var(--serif);
  font-size: 9.5px;
  font-style: italic;
  white-space: nowrap;
}

.definition-group ol {
  padding-left: 0;
  color: var(--ink-2);
  list-style: none;
  font-size: 13.5px;
  line-height: 1.8;
}

.definition-group li + li {
  margin-top: 7px;
}

.panel-empty {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 14px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(246, 240, 230, 0.65);
  font-size: 12px;
  line-height: 1.7;
}

.example-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.example-card {
  position: relative;
  padding: 13px 40px 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}

.example-card blockquote {
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
}

.example-card figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.example-audio {
  position: absolute;
  top: 9px;
  right: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper);
}

.example-audio:hover {
  color: var(--forest);
  background: var(--amber-wash);
}

.phrase-list {
  display: flex;
  flex-direction: column;
}

.phrase-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.phrase-item:last-child {
  border-bottom: 0;
}

.phrase-item strong {
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.phrase-item span {
  color: var(--muted);
  font-size: 10.5px;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.form-grid > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.5);
}

.form-grid span {
  color: var(--muted);
  font-size: 8.5px;
}

.form-grid strong {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.synonym-group {
  margin-bottom: 12px;
}

.synonym-group:last-child {
  margin-bottom: 0;
}

.synonym-meaning {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-chip {
  padding: 4px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface);
  font-family: var(--serif);
  font-size: 11.5px;
}

.word-chip:hover {
  color: var(--forest);
  border-color: var(--amber);
  background: var(--amber-wash);
}

.english-definitions {
  padding: 17px 0 3px;
  color: var(--ink-soft);
}

.english-definitions summary {
  cursor: pointer;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 14px;
}

.english-definitions summary span {
  margin-left: 5px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
}

.english-definitions p {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.7;
}

.english-definitions em {
  color: var(--forest);
  font-family: var(--serif);
}

.word-source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 17px;
  color: #a2a49c;
  font-size: 8.5px;
}

.word-error {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 8px;
  text-align: center;
}

.word-error h2 {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
}

.word-error > p {
  max-width: 290px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.error-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.word-error-tip {
  margin-top: 24px !important;
  font-size: 10px !important;
}

/* ── Wordbook ───────────────────────────────────────────────── */

.wordbook-page .page-header {
  margin-bottom: 26px;
}

.wordbook-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 230px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.55);
}

.search-field:focus-within {
  border-color: var(--forest-3);
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11.5px;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.saved-word-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 190ms var(--ease), border-color 190ms var(--ease);
}

.saved-word-card:hover {
  transform: translateY(-2px);
  border-color: #d3c6b2;
}

.saved-word-card.is-mastered {
  background: rgba(251, 247, 239, 0.72);
}

.saved-word-main {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 48px 16px 18px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.saved-word-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.saved-word-ipa {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 10.5px;
}

.saved-status {
  margin-right: 0;
  padding: 2px 6px;
  border-radius: 99px;
  color: #748879;
  background: #edf2ec;
  font-size: 8px;
  white-space: nowrap;
}

.saved-word-card.is-mastered .saved-status {
  color: var(--muted);
  background: var(--paper-deep);
}

.saved-word-main h3 {
  overflow-wrap: anywhere;
  margin: 5px 0 4px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.saved-word-main p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-word-date {
  margin-top: 10px;
  color: #a3a69f;
  font-size: 8.5px;
}

.saved-word-actions {
  position: absolute;
  right: 11px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.saved-word-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.saved-word-actions button:hover {
  color: var(--forest);
  background: var(--paper);
}

.saved-word-actions button:last-child:hover {
  color: var(--danger);
}

.wordbook-empty {
  min-height: 390px;
}

.bookmark-illustration .empty-page {
  transform: rotate(4deg);
}

/* ── Account ────────────────────────────────────────────────── */

.account-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: var(--surface);
}

.account-hero > div {
  min-width: 0;
  flex: 1;
}

.account-hero h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.account-hero p {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 99px;
  color: #5d7d69;
  background: #edf2ec;
  font-size: 8px;
  white-space: nowrap;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.55);
}

.account-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-right: 1px solid var(--line-soft);
}

.account-stats > div:last-child {
  border-right: 0;
}

.account-stats strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.account-stats span {
  color: var(--muted);
  font-size: 8.5px;
}

.account-section {
  margin-top: 20px;
}

.account-section h4 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.account-section > p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.url-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  color: var(--forest);
  background: var(--surface);
  font-family: var(--sans);
  font-size: 11.5px;
  text-align: left;
}

.url-row:hover {
  border-color: var(--forest-3);
}

.url-row svg {
  color: var(--muted);
}

.url-empty {
  margin-top: 10px;
  padding: 11px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
}

.account-hint {
  margin-top: 7px !important;
  color: #9b9f97 !important;
  font-size: 9px !important;
}

.account-actions {
  display: flex;
  gap: 9px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.account-actions .ghost-btn {
  flex: 1;
}

.danger-text {
  color: var(--danger);
}

/* ── Toast ──────────────────────────────────────────────────── */

.toast-region {
  position: fixed;
  z-index: 300;
  top: 20px;
  right: 20px;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  color: var(--paper);
  background: #1c2a24;
  box-shadow: 0 12px 35px rgba(20, 32, 26, 0.2);
  font-size: 11.5px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  margin-top: 1px;
  color: var(--amber);
}

.toast-error {
  background: #552b24;
}

.toast-error svg {
  color: #f1bda9;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1240px) {
  :root { --sidebar-w: 232px; }
  .main-content { padding-right: 34px; padding-left: 34px; }
  .library-hero { padding: 38px 38px; }
  .hero-word { width: 245px; }
}

@media (max-width: 1040px) {
  .auth-page { grid-template-columns: minmax(0, 1fr) minmax(400px, 0.9fr); }
  .auth-art { padding: 36px; }
  .auth-copy h1 { font-size: 52px; }
  .library-hero { grid-template-columns: minmax(0, 1fr) 230px; }
  .hero-word strong { font-size: 35px; }
  .doc-open { padding: 21px 20px 17px; }
  .doc-card h3 { font-size: 22px; }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .mobile-topbar {
    position: fixed;
    z-index: 40;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: calc(66px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 20px 0;
    border-bottom: 1px solid rgba(113, 101, 80, 0.12);
    background: rgba(246, 240, 230, 0.9);
    backdrop-filter: blur(16px);
  }
  .mobile-topbar .brand-mark { width: 33px; height: 33px; font-size: 17px; border-radius: 9px; }
  .mobile-topbar .brand-type strong { font-size: 18px; }
  .mobile-topbar-actions { display: flex; align-items: center; gap: 7px; }
  .mobile-topbar .icon-btn { background: rgba(255, 253, 248, 0.6); border-color: var(--line-soft); }
  .mobile-topbar .avatar { width: 33px; height: 33px; font-size: 14px; }
  .mobile-nav {
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(63px + env(safe-area-inset-bottom));
    padding: 0 44px env(safe-area-inset-bottom);
    border-top: 1px solid rgba(113, 101, 80, 0.14);
    background: rgba(250, 246, 238, 0.95);
    backdrop-filter: blur(18px);
  }
  .mobile-nav-item {
    display: flex;
    min-width: 64px;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 12px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    font-size: 8.5px;
    font-weight: 600;
  }
  .mobile-nav-item.is-active { color: var(--forest); background: rgba(23, 63, 54, 0.055); }
  .mobile-nav-import {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: -19px;
    border: 4px solid var(--paper);
    border-radius: 50%;
    color: var(--paper);
    background: var(--forest);
    box-shadow: 0 8px 22px rgba(23, 63, 54, 0.2);
  }
  .main-content {
    margin-left: 0;
    padding: calc(84px + env(safe-area-inset-top)) 24px calc(150px + env(safe-area-inset-bottom));
  }
  .header-import { display: none; }
  .wordbook-page .page-header .ghost-btn { display: none; }
  .speech-player {
    right: 14px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 14px;
    border-radius: 16px;
  }
  .player-inner { padding: 12px 14px; }
  .reader-page { padding-bottom: 86px; }
  body.is-reading .mobile-topbar { display: none; }
  body.is-reading .main-content {
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  body.is-reading .reader-topbar {
    position: sticky;
    z-index: 8;
    top: calc(env(safe-area-inset-top) + 4px);
    margin-bottom: 27px;
    padding: 7px 8px;
    border-bottom: 0;
    border-radius: 12px;
    background: rgba(246, 240, 230, 0.9);
    box-shadow: 0 5px 18px rgba(53, 48, 38, 0.035);
    backdrop-filter: blur(14px);
  }
  .toast-region { top: calc(12px + env(safe-area-inset-top)); }
}

@media (max-width: 760px) {
  .auth-page { display: block; min-height: 100svh; }
  .auth-art { display: none; }
  .auth-panel {
    min-height: 100svh;
    align-items: flex-start;
    padding: calc(28px + env(safe-area-inset-top)) 24px calc(38px + env(safe-area-inset-bottom));
  }
  .auth-panel-inner { width: min(420px, 100%); margin: 0 auto; }
  .mobile-auth-brand { display: flex; margin-bottom: 40px; }
  .mobile-auth-brand .brand-mark { width: 37px; height: 37px; font-size: 19px; }
  .auth-intro h2 { font-size: 31px; }
  .auth-intro { margin-bottom: 23px; }
  .auth-copy { margin: 0; }
  .library-hero { grid-template-columns: 1fr; min-height: 295px; padding: 35px 28px; }
  .hero-word { display: none; }
  .hero-content h2 { font-size: 38px; }
  .hero-content > p:not(.eyebrow) { max-width: 360px; }
  .page-header { align-items: flex-start; }
  .page-header h1 { font-size: 33px; }
  .header-import { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); margin: 22px 0 36px; }
  .stat-item:nth-child(2) { border-right: 0; }
  .stat-item:nth-child(1), .stat-item:nth-child(2) { border-bottom: 1px solid var(--line-soft); }
  .stat-item:nth-child(3) { padding-left: 2px; }
  .stat-item:nth-child(3) { border-bottom: 0; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 13px; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-open { min-height: 205px; }
  .doc-more { opacity: 1; }
  .library-footnote { flex-direction: column; gap: 6px; }
  .reader-topbar { margin-bottom: 28px; }
  .reader-intro h1 { font-size: 36px; }
  .reader-toolbar { align-items: flex-start; gap: 10px; }
  .reading-hint { max-width: 52%; line-height: 1.5; }
  .reader-toolbar-end { min-width: 0; gap: 7px; }
  .reading-canvas { font-size: calc(var(--reader-font-size, 20px) - 1px); line-height: 1.9; }
  .page-nav { margin-top: 35px; }
  .reader-foot { flex-direction: column; gap: 4px; }
  .wordbook-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .wordbook-page .page-header .ghost-btn { display: none; }
  .search-field { width: 100%; }
  .word-grid { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-height: 92svh;
    border-radius: 22px 22px 0 0;
    animation: modalUp 280ms var(--ease);
  }
  .modal-head { padding: 22px 20px 14px; }
  .modal-body { padding: 0 20px 20px; }
  .modal-footer {
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: rgba(251, 247, 239, 0.97);
    backdrop-filter: blur(12px);
  }
  .modal-head h2 { font-size: 25px; }
  .import-text-wrap textarea { min-height: 33svh; }
  .import-text-foot { align-items: flex-start; flex-direction: column; gap: 6px; }
  .import-file-actions { gap: 13px; }
  .word-panel {
    top: auto;
    width: 100%;
    height: min(88svh, 800px);
    border-top: 1px solid var(--line-soft);
    border-left: 0;
    border-radius: 23px 23px 0 0;
    box-shadow: 0 -20px 60px rgba(21, 34, 27, 0.18);
    animation: sheetUp 300ms var(--ease);
  }
  .word-panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: #d9cfbf;
    transform: translateX(-50%);
  }
  .word-panel-head { padding: 22px 20px 0; }
  .word-panel-scroll { padding: 9px 21px calc(30px + env(safe-area-inset-bottom)); }
  .word-title-line h2 { font-size: 43px; }
  .toast-region { right: 12px; left: 12px; width: auto; align-items: stretch; }
  .toast { max-width: none; }
}

@media (max-width: 560px) {
  .main-content { padding-right: 17px; padding-left: 17px; }
  .mobile-topbar { padding-right: 15px; padding-left: 15px; }
  .library-header { align-items: flex-start; }
  .library-header h1 { font-size: 30px; }
  .header-import { width: 42px; min-width: 42px; padding: 0; font-size: 0; gap: 0; }
  .header-import svg { width: 20px; height: 20px; }
  .page-header .ghost-btn { padding: 0 13px; font-size: 0; gap: 0; min-height: 40px; width: 40px; }
  .page-header .ghost-btn svg { width: 19px; height: 19px; }
  .library-hero { min-height: 275px; padding: 31px 23px; border-radius: 21px; }
  .hero-content h2 { font-size: 34px; }
  .hero-content > p:not(.eyebrow) { font-size: 12px; }
  .hero-cta { margin-top: 20px; }
  .stat-item { padding: 13px 14px; }
  .stat-item:first-child { padding-left: 0; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 9.5px; }
  .filter-tabs { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .filter-tab { flex: 1; text-align: center; }
  .section-heading h2 { font-size: 25px; }
  .doc-open { min-height: 195px; padding: 20px 18px 16px; }
  .doc-card h3 { font-size: 22px; }
  .doc-card.is-word-card h3 { font-size: 31px; }
  .doc-excerpt { font-size: 11.5px; }
  .doc-meta { gap: 6px; }
  .page-header { margin-bottom: 24px; }
  .reader-topbar { margin-bottom: 24px; }
  .reader-intro { margin-bottom: 24px; }
  .reader-intro h1 { font-size: 31px; }
  .reader-meta { gap: 6px; font-size: 9.5px; }
  .reader-sync { width: 100%; margin-left: 0; }
  .font-controls { display: none; }
  .reader-toolbar { padding: 8px 0; }
  .reading-hint { max-width: 46%; font-size: 8.5px; }
  .quick-add-toggle { padding: 4px 7px; font-size: 8px; }
  .translation-toggle { padding: 4px 6px; font-size: 8px; }
  .paragraph-translation { margin-top: -0.85em; margin-bottom: 1.45em; padding: 8px 10px; font-size: 12px; }
  .page-indicator { font-size: 8px; }
  .upload-zone { padding: 13px 12px; }
  .upload-zone-icon { width: 39px; height: 39px; }
  .upload-zone-action { display: none; }
  .upload-zone-copy strong { white-space: normal; line-height: 1.4; }
  .upload-zone-copy small { white-space: normal; line-height: 1.45; }
  .extract-result { flex-wrap: wrap; }
  .extract-again { margin-left: 38px; }
  .upload-formats { margin-top: -8px; }
  .reading-canvas { line-height: 1.86; }
  .reading-paragraph { margin-bottom: 1.35em; }
  .reading-paragraph:first-child::first-letter { font-size: 3em; }
  .single-word-stage { padding-right: 8px; padding-left: 8px; }
  .single-word-button { font-size: 54px; }
  .page-btn { font-size: 9.5px; }
  .page-nav > span { font-size: 8.5px; }
  .speech-player { right: 8px; bottom: calc(69px + env(safe-area-inset-bottom)); left: 8px; }
  .player-inner {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "transport copy" "speed speed";
    gap: 8px 11px;
    padding: 11px 12px 9px;
  }
  .player-transport { grid-area: transport; }
  .player-copy { grid-area: copy; }
  .player-speed {
    grid-area: speed;
    justify-content: space-between;
    padding: 7px 0 0;
    border-top: 1px solid rgba(246, 240, 230, 0.08);
    border-left: 0;
  }
  .player-play { width: 39px; height: 39px; }
  .player-skip { width: 26px; height: 26px; }
  .player-copy p { font-size: 11.5px; }
  .player-state { font-size: 6.5px; }
  .speed-label { font-size: 7.5px; }
  .speed-btn { flex: 1; max-width: 62px; height: 29px; font-size: 9.5px; }
  .wordbook-page .page-header h1 { font-size: 34px; }
  .saved-word-main { padding: 16px 42px 14px 16px; }
  .saved-word-main h3 { font-size: 25px; }
  .account-stats strong { font-size: 18px; }
  .auth-panel { padding-right: 21px; padding-left: 21px; }
  .auth-intro h2 { font-size: 29px; }
}

@media (max-width: 380px) {
  .auth-panel { padding-right: 16px; padding-left: 16px; }
  .library-hero { padding: 27px 19px; }
  .hero-content h2 { font-size: 30px; }
  .stat-item { padding-right: 10px; padding-left: 10px; }
  .player-state { display: none; }
  .speed-label span { display: none; }
  .main-content { padding-right: 13px; padding-left: 13px; }
}

/* ── Motion preferences ─────────────────────────────────────── */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0.4; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(35px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes playerIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

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

@keyframes breathe {
  0%, 100% { transform: translateY(0); box-shadow: 0 16px 40px rgba(23, 63, 54, 0.18); }
  50% { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(23, 63, 54, 0.26); }
}

/* ── Word practice ─────────────────────────────────────────── */
.header-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.practice-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin: 24px 0 30px; padding: 22px 26px; border-radius: var(--radius-lg);
  color: var(--paper);
  background: radial-gradient(ellipse at 90% 10%, rgba(223,164,90,.2), transparent 52%), var(--forest);
  box-shadow: var(--shadow-md);
}
.practice-strip-kicker { color: rgba(246,240,230,.45); font-size: 8px; font-weight: 700; letter-spacing: .2em; }
.practice-strip h2 { margin: 5px 0 4px; color: var(--paper); font-family: var(--serif); font-size: 24px; font-weight: 500; }
.practice-strip p { margin: 0; color: rgba(246,240,230,.62); font-size: 11px; }
.wordbook-stats { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.wordbook-stats strong { margin-right: 3px; color: var(--forest); font-family: var(--serif); font-size: 16px; font-weight: 500; }
.practice-strip-btn {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 11px 17px; border-radius: 999px; color: var(--forest);
  background: var(--amber); font-size: 11px; font-weight: 700;
}

.practice-page { max-width: 980px; margin: 0 auto; }
.practice-header { margin-bottom: 26px; }
.practice-setup, .practice-result {
  padding: 25px; border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.practice-setup-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.practice-source-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--paper-deep); }
.practice-tab { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 600; }
.practice-tab.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px rgba(27,39,34,.08); }
.practice-due { color: var(--muted); font-size: 10px; }
.practice-flow-tabs { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.practice-flow-tab { position: relative; padding: 0 2px 9px; color: var(--muted); font-size: 10px; font-weight: 600; }
.practice-flow-tab.is-active { color: var(--forest); }
.practice-flow-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--amber); }
.practice-sound-toggle { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding-bottom: 8px; color: var(--muted); font-size: 9px; }
.practice-sound-toggle.is-active { color: var(--forest-3); }
.practice-loop-panel {
  display: flex; align-items: center; gap: 18px; padding: 22px;
  border: 1px solid var(--amber-soft); border-radius: var(--radius-md);
  background: var(--amber-wash);
}
.practice-loop-number { color: var(--amber); font-family: var(--serif); font-size: 58px; line-height: .9; }
.practice-loop-panel strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 500; }
.practice-loop-panel p { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.65; }

.practice-mode-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.practice-mode-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  min-height: 142px; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-md);
  text-align: left; background: var(--surface-soft);
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}
.practice-mode-card:hover { border-color: var(--paper-dark); transform: translateY(-2px); }
.practice-mode-card.is-active { border-color: var(--amber); background: var(--amber-wash); box-shadow: inset 0 0 0 1px rgba(223,164,90,.18); }
.practice-mode-index { color: var(--muted); font-family: var(--serif); font-size: 11px; }
.practice-mode-card strong { color: var(--ink); font-family: var(--serif); font-size: 21px; font-weight: 500; }
.practice-mode-card span:last-child { color: var(--muted); font-size: 10px; line-height: 1.55; }

.practice-start-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft);
}
.practice-start-row > div { display: flex; flex-direction: column; gap: 3px; }
.practice-start-row strong { color: var(--ink); font-size: 12px; }
.practice-start-row span { color: var(--muted); font-size: 10px; }
.practice-start-btn { flex-shrink: 0; }

.practice-session-page { max-width: 720px; }
.practice-session-top { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.practice-session-top .back-btn { flex-shrink: 0; }
.practice-progress { display: flex; align-items: center; gap: 9px; flex: 1; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.practice-progress-track { flex: 1; height: 3px; overflow: hidden; border-radius: 3px; background: var(--line-soft); }
.practice-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--amber); transition: width 260ms var(--ease); }
.practice-session-mode { color: var(--forest); font-size: 9px; font-weight: 700; letter-spacing: .08em; }

.practice-card {
  display: flex; flex-direction: column; align-items: center; min-height: 470px;
  padding: 34px 38px 30px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 28px;
  background: radial-gradient(circle at 50% 0%, rgba(223,164,90,.1), transparent 36%), var(--surface);
  box-shadow: var(--shadow-md); text-align: center;
}
.practice-kicker { margin: 0; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.practice-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; width: 100%; padding: 26px 0 22px; }
.practice-prompt-word { color: var(--forest); font-family: var(--serif); font-size: clamp(42px,7vw,66px); line-height: 1.1; letter-spacing: -.02em; }
.practice-prompt-ipa { margin-top: 10px; color: var(--muted); font-family: var(--serif); font-size: 15px; }
.practice-prompt-meaning { max-width: 520px; margin-top: 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.practice-prompt-meaning.is-large { margin-top: 0; color: var(--ink); font-family: var(--serif); font-size: clamp(26px,4vw,38px); line-height: 1.45; }
.practice-prompt-instruction { color: var(--muted); font-size: 11px; }
.practice-audio-big {
  display: flex; align-items: center; justify-content: center; width: 92px; height: 92px;
  margin-bottom: 18px; border-radius: 50%; color: var(--forest); background: var(--amber-soft);
  box-shadow: 0 12px 28px rgba(223,164,90,.22); transition: transform 160ms var(--ease);
}
.practice-audio-big:hover { transform: scale(1.04); }
.practice-spell-hint { margin-bottom: 14px; color: var(--forest); font-family: var(--serif); font-size: clamp(30px,5vw,48px); letter-spacing: .1em; }

.practice-choice-options {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px;
  width: 100%; max-width: 620px; margin-top: 24px;
}
.practice-choice-options button {
  min-height: 58px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 13px; color: var(--ink-soft); background: var(--surface-soft);
  font-family: var(--serif); font-size: 14px; line-height: 1.45; text-align: left;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}
.practice-choice-options button:hover {
  border-color: var(--amber); background: var(--amber-wash); transform: translateY(-1px);
}

.practice-form { display: flex; width: 100%; max-width: 510px; gap: 8px; }
.practice-form input {
  flex: 1; min-width: 0; height: 52px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px;
  outline: none; color: var(--ink); background: var(--paper); font-family: var(--serif);
  font-size: 20px; letter-spacing: .03em; text-align: center;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.practice-form input:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(33,90,74,.09); }
.practice-form .primary-btn { flex-shrink: 0; }
.practice-form-foot { display: flex; gap: 18px; margin-top: 14px; }
.practice-form-foot .text-btn { color: var(--muted); font-size: 10px; }

.practice-feedback { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 510px; padding: 13px 16px; border-radius: 14px; text-align: left; }
.practice-feedback.is-correct { color: var(--forest); background: rgba(45,112,92,.09); }
.practice-feedback.is-wrong { color: var(--clay); background: rgba(183,101,73,.08); }
.practice-feedback-mark {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; color: var(--surface); background: currentColor; font-size: 15px; font-weight: 700;
}
.practice-feedback.is-correct .practice-feedback-mark { background: var(--forest); }
.practice-feedback.is-wrong .practice-feedback-mark { background: var(--clay); }
.practice-feedback strong { display: block; color: var(--ink); font-size: 12px; }
.practice-feedback p { margin: 3px 0 0; color: var(--ink-soft); font-size: 10px; }
.practice-answer-line { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; color: var(--forest); font-family: var(--serif); font-size: 30px; }
.practice-answer-line small { color: var(--muted); font-size: 13px; }
.practice-answer-meaning { margin: 6px 0 18px; color: var(--ink-soft); font-size: 12px; }
.practice-next-btn { min-width: 160px; }

.practice-result { display: flex; flex-direction: column; align-items: center; padding: 46px 30px; text-align: center; }
.practice-score { color: var(--forest); font-family: var(--serif); font-size: 84px; line-height: 1; letter-spacing: -.04em; }
.practice-score span { color: var(--amber); font-size: 30px; }
.practice-result-stats { display: flex; gap: 30px; margin: 26px 0; color: var(--muted); font-size: 10px; }
.practice-result-stats strong { display: block; margin-bottom: 3px; color: var(--ink); font-family: var(--serif); font-size: 24px; font-weight: 500; }
.practice-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }

@media (max-width: 760px) {
  .practice-strip { flex-direction: column; align-items: flex-start; padding: 19px 20px; }
  .practice-strip h2 { font-size: 21px; }
  .practice-mode-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .practice-setup-top, .practice-start-row { flex-direction: column; align-items: flex-start; }
  .practice-start-btn { width: 100%; }
  .practice-card { min-height: 410px; padding: 24px 18px; border-radius: 22px; }
  .practice-form { flex-direction: column; }
  .practice-form .primary-btn { width: 100%; }
  .practice-session-top { gap: 10px; }
  .practice-session-mode { display: none; }
  .practice-header .header-actions { width: 100%; }
}

/* ── Article dictation ─────────────────────────────────────── */
.dictation-page { max-width: 860px; margin: 0 auto; }
.dictation-setup {
  padding: 25px; border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.dictation-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.dictation-mode-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius-md);
  text-align: left; background: var(--surface-soft);
}
.dictation-mode-card.is-active { border-color: var(--amber); background: var(--amber-wash); }
.dictation-mode-card span { color: var(--muted); font-family: var(--serif); font-size: 11px; }
.dictation-mode-card strong { color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 500; }
.dictation-mode-card p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.dictation-start-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.dictation-start-row > div { display: flex; flex-direction: column; gap: 3px; }
.dictation-start-row strong { color: var(--ink); font-size: 12px; }
.dictation-start-row span { color: var(--muted); font-size: 10px; }

.dictation-top { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.dictation-card {
  display: flex; flex-direction: column; align-items: center; min-height: 420px;
  padding: 28px 36px; border: 1px solid var(--line-soft); border-radius: 26px;
  background: radial-gradient(circle at 50% 0%, rgba(223,164,90,.08), transparent 38%), var(--surface);
  box-shadow: var(--shadow-md); text-align: center;
}
.dictation-prompt {
  display: flex; align-items: center; justify-content: center; flex: 1;
  width: 100%; min-height: 120px; padding: 16px 0;
}
.dictation-english {
  color: var(--ink); font-family: var(--serif); font-size: clamp(20px, 3vw, 28px);
  line-height: 1.55; text-align: left; max-width: 720px;
}
.dictation-translation {
  color: var(--ink); font-family: var(--serif); font-size: clamp(18px, 3vw, 26px);
  line-height: 1.75; text-align: left; max-width: 700px;
}
.dictation-answer {
  width: 100%; min-height: 96px; padding: 15px 16px; resize: vertical;
  border: 1px solid var(--line); border-radius: 14px; outline: none;
  color: var(--ink); background: var(--paper); font-family: var(--serif);
  font-size: 17px; line-height: 1.6;
}
.dictation-answer:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(33,90,74,.09); }
.dictation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; margin-top: 12px; }
.dictation-actions .text-btn { color: var(--muted); font-size: 10px; }
.dictation-retry { margin-top: 10px; color: var(--clay); font-size: 10px; }
.dictation-answer-sentence {
  max-width: 720px; margin: 16px 0; color: var(--ink);
  font-family: var(--serif); font-size: 20px; line-height: 1.6; text-align: left;
}

@media (max-width: 760px) {
  .dictation-mode-grid { grid-template-columns: 1fr; }
  .dictation-start-row { flex-direction: column; align-items: flex-start; }
  .dictation-start-row .primary-btn { width: 100%; }
  .dictation-card { padding: 22px 16px; border-radius: 20px; }
  .dictation-actions { justify-content: center; }
}

/* ── Business vocabulary ───────────────────────────────────── */
.vocab-page { max-width: 1020px; margin: 0 auto; }
.vocab-intro {
  display: flex; align-items: center; gap: 26px; margin-bottom: 22px; padding: 18px 22px;
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--surface);
}
.vocab-intro > div { display: flex; flex-direction: column; }
.vocab-intro strong { color: var(--forest); font-family: var(--serif); font-size: 24px; font-weight: 500; }
.vocab-intro span { color: var(--muted); font-size: 9px; }
.vocab-intro .primary-btn { margin-left: auto; }
.vocab-category-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 10px; }
.vocab-category-heading h2 { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 500; }
.vocab-category-heading span { color: var(--muted); font-size: 9px; }
.vocab-filter-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.vocab-filter-tabs .filter-tab { padding: 7px 13px; font-size: 10px; }
.vocab-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.vocab-card {
  display: flex; flex-direction: column; align-items: flex-start; min-height: 150px;
  padding: 15px; border: 1px solid var(--line-soft); border-radius: var(--radius-md);
  background: var(--surface);
}
.vocab-card.is-saved { background: var(--surface-soft); opacity: .72; }
.vocab-card-top { display: flex; width: 100%; justify-content: space-between; color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.vocab-card h3 { margin: 10px 0 3px; color: var(--forest); font-family: var(--serif); font-size: 22px; font-weight: 500; }
.vocab-card p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.vocab-card .text-btn { margin-top: auto; padding-top: 10px; color: var(--forest-3); font-size: 10px; }
.vocab-card .text-btn:disabled { color: var(--muted); }
.vocab-foot { margin-top: 18px; color: var(--muted); font-size: 10px; }
.practice-vocab-link { margin-top: 10px; text-align: right; }
.practice-vocab-link .text-btn { color: var(--muted); font-size: 10px; }

@media (max-width: 760px) {
  .vocab-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .vocab-intro { flex-wrap: wrap; gap: 14px; }
  .vocab-intro .primary-btn { width: 100%; margin-left: 0; }
}



