/* =========================================================
   WORDLIST — a quiet vocabulary notebook
   ========================================================= */

:root {
  --canvas: #efe8da;
  --canvas-deep: #e7dfcf;
  --paper: #fcf9f2;
  --paper-warm: #f8f2e6;
  --paper-deep: #f0e8d9;
  --ink: #2c2923;
  --ink-soft: #514b40;
  --muted: #6f6656;
  --faint: #918673;
  --line: #d8cdb9;
  --line-strong: #bbae96;
  --accent: #a34f33;
  --accent-deep: #843c25;
  --accent-soft: #f0dfd4;
  --olive: #5f6a50;
  --olive-soft: #e5e7d9;
  --gold: #a8844c;
  --danger: #963f2e;
  --shadow-sm: 0 1px 2px rgba(54, 43, 27, .07);
  --shadow-md: 0 18px 45px -28px rgba(54, 43, 27, .5), 0 2px 5px rgba(54, 43, 27, .05);
  --shadow-lg: 0 35px 80px -40px rgba(54, 43, 27, .52), 0 3px 8px rgba(54, 43, 27, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia,
           "Songti SC", STSong, SimSun, "Times New Roman", serif;
  --sans: "Aptos", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Noto Sans CJK SC", sans-serif;
  --radius: 4px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(950px 620px at 8% -10%, rgba(255, 252, 243, .95), transparent 62%),
    radial-gradient(760px 540px at 102% 6%, rgba(234, 221, 198, .72), transparent 60%),
    linear-gradient(135deg, var(--canvas) 0%, #eee7d9 46%, #e9e1d1 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

::selection {
  color: var(--ink);
  background: #e8cfb9;
}

button,
input { font: inherit; }

button { color: inherit; }

a { color: inherit; }

button,
a,
.cell {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 3px;
  transform: translateY(-160%);
  transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

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

.noscript-card {
  max-width: 620px;
  margin: 80px auto;
  padding: 28px;
  font-family: var(--serif);
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line-strong);
}

/* ---------- shared shell ---------- */

.app-shell {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  align-items: center;
  min-height: 86px;
  border-bottom: 1px solid rgba(94, 82, 61, .17);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -.08em;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: transform .35s var(--ease), background .25s;
}
.brand:hover .brand-mark {
  background: var(--accent);
  transform: rotate(-7deg);
}

.brand-word {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .19em;
}
.brand-sub {
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: .34em;
  color: var(--muted);
}

.header-note {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
}
.header-note::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--olive);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(95, 106, 80, .12);
}

.main-nav {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-self: center;
  padding: 3px;
  background: rgba(252, 249, 242, .52);
  border: 1px solid rgba(187, 174, 150, .64);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.nav-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 15px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 2px;
  transition: color .18s, background .18s, box-shadow .18s;
}
.nav-link:hover {
  color: var(--ink);
  background: rgba(252, 249, 242, .82);
}
.nav-link.is-active {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 3px 9px -6px rgba(44, 41, 35, .8);
}
.nav-link.is-active:hover { color: var(--paper); background: var(--ink); }

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  font-family: var(--serif);
  line-height: 1;
  color: var(--paper);
  background: var(--olive);
  border-radius: 50%;
}
.avatar-content {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
}
.avatar-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-letter {
  line-height: 1;
  transform: translateY(-1px);
}
.avatar-nav {
  width: 19px;
  height: 19px;
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 0 0 1px rgba(44, 41, 35, .08);
}
.nav-link:not(.is-active) .avatar-nav {
  border-color: rgba(44, 41, 35, .12);
  box-shadow: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.is-image-busy [data-action="pick-cover"],
body.is-image-busy [data-action="pick-avatar"] {
  cursor: wait;
  opacity: .55;
}

/* ---------- common bits ---------- */

.eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 21px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .23em;
  color: var(--muted);
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 47px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .035em;
  color: var(--btn-fg);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: var(--btn-bg);
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: 0 7px 18px -12px rgba(44, 41, 35, .72);
  transition: background .22s, color .22s, transform .22s var(--ease), box-shadow .22s;
}
.btn:hover {
  --btn-bg: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 22px -14px rgba(94, 49, 31, .7);
}
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }

.btn-accent { --btn-bg: var(--accent); }
.btn-accent:hover { --btn-bg: var(--accent-deep); }

.btn-quiet {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  transition: color .2s, background .2s, border-color .2s;
}
.btn-quiet:hover {
  color: var(--ink);
  background: rgba(252, 249, 242, .65);
  border-color: var(--ink-soft);
}
.btn-quiet svg { width: 15px; height: 15px; }

.icon-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: color .18s, background .18s, border-color .18s, transform .18s;
}
.icon-btn:hover {
  color: var(--ink);
  background: rgba(252, 249, 242, .8);
  border-color: var(--line);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(150, 63, 46, .25); background: #f6e7e1; }

/* =========================================================
   HOME
   ========================================================= */

.home-main {
  padding-bottom: 76px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, .72fr);
  gap: 48px;
  align-items: center;
  min-height: 500px;
  padding: 44px 0 42px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  animation: fade-rise .75s var(--ease) both;
}

.hero-title {
  max-width: 670px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(46px, 4.9vw, 70px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -.045em;
}
.hero-title .line {
  display: block;
}
.hero-title em {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-style: normal;
}
.hero-title em::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: 3px;
  left: -2px;
  z-index: -1;
  height: 12px;
  background: var(--accent-soft);
  border-radius: 60% 30% 50% 30%;
  transform: rotate(-1.2deg);
}

.hero-lede {
  max-width: 480px;
  margin: 24px 0 0;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 29px;
}
.hero-tip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
}
.hero-tip svg { width: 14px; height: 14px; color: var(--olive); }

.hero-stats {
  display: flex;
  gap: 0;
  margin-top: 37px;
  padding-top: 19px;
  border-top: 1px solid rgba(94, 82, 61, .19);
}
.hero-stat {
  min-width: 108px;
  padding-right: 25px;
}
.hero-stat + .hero-stat {
  padding-left: 25px;
  border-left: 1px solid rgba(94, 82, 61, .16);
}
.hero-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.hero-stat span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--muted);
}

/* --- decorative notebook --- */

.hero-art {
  position: relative;
  width: 100%;
  max-width: 390px;
  height: 420px;
  margin-left: auto;
  animation: fade-in .9s .1s var(--ease) both;
}

.art-paper {
  position: absolute;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.art-paper.back {
  top: 38px;
  right: 9px;
  width: 315px;
  height: 362px;
  background: #f2eadb;
  transform: rotate(5.5deg);
  box-shadow: var(--shadow-sm);
}
.art-paper.back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 30px, rgba(125, 108, 80, .07) 30px 31px);
}
.art-paper.front {
  top: 17px;
  left: 8px;
  width: 330px;
  height: 390px;
  padding: 28px 27px 22px;
  transform: rotate(-2.5deg);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .55), transparent 44%),
    var(--paper);
  box-shadow: var(--shadow-lg);
}
.art-paper.front::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 44px;
  width: 1px;
  background: rgba(163, 79, 51, .14);
}
.art-paper.front::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #e5dac6 0 49%, var(--canvas) 50% 100%);
  border-top: 1px solid rgba(140, 123, 94, .25);
  border-left: 1px solid rgba(140, 123, 94, .25);
}

.art-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-left: 29px;
}
.art-head strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .24em;
}
.art-head span {
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--faint);
}

.art-mini-table {
  margin: 27px 0 0 29px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}
.art-mini-row {
  display: grid;
  grid-template-columns: 22px 1.25fr 1fr 36px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}
.art-mini-row > span {
  display: flex;
  align-items: center;
  padding: 0 7px;
  font-size: 8px;
  line-height: 1.3;
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.art-mini-row.head {
  min-height: 30px;
  background: #f1e9da;
}
.art-mini-row.head > span {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .07em;
  color: var(--ink-soft);
}
.art-mini-row .word {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-soft);
}
.art-mini-row .dot-grid {
  display: grid;
  grid-template-columns: repeat(4, 3px);
  gap: 3px;
  align-content: center;
  justify-content: center;
  padding: 0;
}
.dot-grid i {
  width: 3px;
  height: 3px;
  background: #b9a98e;
  border-radius: 50%;
}
.art-mini-row .hidden-bar {
  display: block;
  margin: auto;
  width: 20px;
  height: 5px;
  background: #d9cbb3;
  border-radius: 1px;
}

.art-caption {
  position: absolute;
  right: 53px;
  bottom: 67px;
  left: 75px;
  padding-top: 13px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--faint);
  border-top: 1px solid var(--line);
}

.sticky-note {
  position: absolute;
  right: -17px;
  bottom: 39px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 108px;
  min-height: 111px;
  padding: 19px 12px 13px;
  background: #e8ddad;
  box-shadow: 0 12px 25px -16px rgba(67, 54, 27, .55);
  transform: rotate(5deg);
}
.sticky-note::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 25px;
  width: 56px;
  height: 17px;
  background: rgba(246, 239, 219, .72);
  border-right: 1px solid rgba(184, 170, 140, .25);
  border-left: 1px solid rgba(184, 170, 140, .25);
  transform: rotate(-2deg);
}
.sticky-note span {
  font-size: 9.5px;
  letter-spacing: .12em;
  color: #635a3d;
}
.sticky-note strong {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  color: #3f3a28;
}
.sticky-note small {
  margin-top: 7px;
  font-size: 7.5px;
  letter-spacing: .22em;
  color: #7b704d;
}

.art-clip {
  position: absolute;
  top: -11px;
  left: 88px;
  z-index: 4;
  width: 22px;
  height: 70px;
  border: 2px solid #8d826f;
  border-radius: 12px;
  transform: rotate(4deg);
  opacity: .8;
}
.art-clip::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 4px;
  width: 10px;
  height: 50px;
  border: 1px solid #8d826f;
  border-radius: 7px;
}

/* --- saved wordlists --- */

.collections {
  padding: 15px 0 0;
  border-top: 1px solid rgba(94, 82, 61, .18);
}

.section-head {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 26px 0 22px;
}
.section-head .eyebrow { margin-bottom: 11px; }
.section-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.section-title .count {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--faint);
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 19px;
}

.list-card {
  --card-accent: var(--accent);
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, .54), transparent 50%),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow-sm);
  transition: transform .32s var(--ease), box-shadow .32s, border-color .25s;
  animation: fade-rise .55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.list-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--card-accent);
  opacity: .78;
}
.list-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .48;
  background: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(117, 99, 69, .045) 35px 36px);
}
.list-card:hover,
.list-card:focus-within {
  border-color: #c3b59c;
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.list-card:nth-child(3n + 2) { --card-accent: var(--olive); }
.list-card:nth-child(3n + 3) { --card-accent: var(--gold); }

.card-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 27px 25px 22px;
  color: inherit;
  text-decoration: none;
}
.card-link:focus-visible { outline-offset: -4px; }

.card-top {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.card-number {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--faint);
}
.card-count {
  padding: 3px 8px;
  font-size: 9.5px;
  letter-spacing: .07em;
  color: var(--muted);
  background: rgba(239, 232, 218, .75);
  border: 1px solid rgba(187, 174, 150, .42);
  border-radius: 99px;
}

.card-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 10px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--faint);
}
.card-meta::before {
  content: "";
  width: 13px;
  height: 1px;
  background: var(--line-strong);
}

.card-bottom {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 22px;
}
.card-open {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .11em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.card-open svg {
  width: 14px;
  height: 14px;
  transition: transform .25s var(--ease);
}
.list-card:hover .card-open svg { transform: translateX(3px); }
.card-word-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.card-word-dots i {
  display: block;
  width: 3px;
  height: 3px;
  background: var(--line-strong);
  border-radius: 50%;
}

.card-delete {
  position: absolute;
  top: 18px;
  right: 17px;
  z-index: 3;
  width: 29px;
  height: 29px;
  opacity: 0;
  transition: opacity .18s, background .18s, color .18s, transform .18s;
}
.card-delete svg { width: 14px; height: 14px; }
.list-card:hover .card-delete,
.list-card:focus-within .card-delete,
.card-delete:focus-visible { opacity: 1; }

.card-add {
  display: flex;
  width: 100%;
  grid-column: span var(--span, 1);
  flex-direction: column;
  gap: 15px;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 28px;
  color: var(--muted);
  cursor: pointer;
  background: rgba(250, 246, 237, .3);
  border: 1px dashed #b9aa90;
  border-radius: 3px;
  transition: color .2s, background .2s, border-color .2s, transform .3s var(--ease);
}
.card-add:hover {
  color: var(--ink);
  background: rgba(252, 249, 242, .65);
  border-color: var(--accent);
  transform: translateY(-3px);
}
.card-add .add-ring {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(163, 79, 51, .35);
  border-radius: 50%;
  transition: background .2s, color .2s, transform .3s var(--ease);
}
.card-add:hover .add-ring {
  color: var(--paper);
  background: var(--accent);
  transform: rotate(90deg);
}
.card-add .add-ring svg { width: 19px; height: 19px; }
.card-add strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .02em;
}
.card-add span:last-child {
  margin-top: -7px;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--faint);
}

.empty-collections {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 65px;
  text-align: center;
  background: rgba(252, 249, 242, .32);
  border: 1px dashed #bfb198;
  border-radius: 3px;
}
.empty-glyph {
  display: grid;
  width: 72px;
  height: 86px;
  margin-bottom: 22px;
  place-items: center;
  color: var(--accent);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: 6px 7px 0 rgba(198, 184, 160, .35);
  transform: rotate(-3deg);
}
.empty-glyph svg { width: 26px; height: 26px; }
.empty-collections h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}
.empty-collections p {
  max-width: 360px;
  margin: 9px 0 22px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

.page-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 23px 0 30px;
  margin-top: 48px;
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--faint);
  border-top: 1px solid rgba(94, 82, 61, .16);
}
.page-footer span:last-child {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: .03em;
}

[hidden] { display: none !important; }

/* =========================================================
   COVER PAGE
   ========================================================= */

.cover-main {
  padding: 18px 0 24px;
}

.cover-frame {
  position: relative;
  isolation: isolate;
  height: calc(100vh - 132px);
  height: calc(100svh - 132px);
  min-height: 560px;
  overflow: hidden;
  color: #f8f1e3;
  background: #211d17;
  border: 1px solid #a7977e;
  border-radius: 3px;
  box-shadow:
    0 40px 85px -50px rgba(45, 33, 19, .8),
    0 2px 5px rgba(45, 33, 19, .14);
  animation: fade-in .55s var(--ease) both;
}
.cover-frame::after {
  content: "";
  position: absolute;
  inset: 13px;
  z-index: 6;
  pointer-events: none;
  border: 1px solid rgba(255, 250, 239, .22);
}

.cover-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 43%;
  filter: saturate(.82) contrast(.98);
  transform: scale(1.012);
  animation: cover-drift 2s var(--ease) both;
}
.cover-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(18, 15, 11, .84) 0%, rgba(18, 15, 11, .58) 36%, rgba(18, 15, 11, .12) 71%, rgba(18, 15, 11, .3) 100%),
    linear-gradient(180deg, rgba(18, 15, 11, .31) 0%, transparent 30%, rgba(18, 15, 11, .68) 100%);
}
.cover-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .06;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.cover-topline {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 7;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 29px 32px;
}
.cover-edition {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .18em;
  color: rgba(250, 245, 235, .66);
  text-transform: uppercase;
}
.cover-change {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 35px;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #f7f0e3;
  cursor: pointer;
  background: rgba(30, 26, 20, .23);
  border: 1px solid rgba(255, 250, 239, .32);
  border-radius: 2px;
  backdrop-filter: blur(10px);
  transition: background .2s, border-color .2s, transform .2s;
}
.cover-change svg { width: 13px; height: 13px; }
.cover-change:hover {
  background: rgba(163, 79, 51, .78);
  border-color: rgba(255, 243, 230, .52);
  transform: translateY(-1px);
}

.cover-content {
  position: absolute;
  bottom: clamp(112px, 14vh, 148px);
  left: clamp(34px, 5vw, 70px);
  z-index: 5;
  width: min(760px, calc(100% - 120px));
}
.cover-id {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 22px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .2em;
  color: rgba(250, 245, 235, .72);
}
.avatar-cover {
  width: 47px;
  height: 47px;
  font-size: 21px;
  background: var(--accent);
  border: 1px solid rgba(255, 250, 239, .56);
  box-shadow: 0 5px 16px -10px rgba(0, 0, 0, .7);
}
.cover-name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(56px, 7.15vw, 104px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.05em;
  color: #faf4e7;
  text-shadow: 0 4px 30px rgba(18, 14, 9, .38);
  overflow-wrap: anywhere;
}
.cover-tagline {
  max-width: 580px;
  margin: 23px 0 0;
  font-family: var(--serif);
  font-size: clamp(14px, 1.35vw, 17.5px);
  line-height: 1.8;
  letter-spacing: .01em;
  color: rgba(249, 243, 231, .8);
}
.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 23px;
  align-items: center;
  margin-top: 33px;
}
.cover-enter {
  --btn-bg: #f7f0e2;
  --btn-fg: var(--ink);
  min-height: 48px;
  padding: 11px 19px;
  font-size: 11.5px;
  box-shadow: 0 12px 30px -22px rgba(0, 0, 0, .9);
}
.cover-enter:hover {
  --btn-bg: var(--accent);
  --btn-fg: #fff8ee;
}
.cover-enter svg { width: 15px; height: 15px; }
.cover-edit {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  font-size: 10.5px;
  letter-spacing: .05em;
  color: rgba(249, 243, 231, .72);
  text-decoration: none;
  border-bottom: 1px solid rgba(249, 243, 231, .28);
  transition: color .2s, border-color .2s;
}
.cover-edit svg { width: 13px; height: 13px; }
.cover-edit:hover {
  color: #fff8ec;
  border-bottom-color: rgba(255, 248, 236, .7);
}

.cover-bottom {
  position: absolute;
  right: clamp(34px, 5vw, 70px);
  bottom: 26px;
  left: clamp(34px, 5vw, 70px);
  z-index: 5;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  font-size: 8.5px;
  letter-spacing: .1em;
  color: rgba(249, 243, 231, .55);
  border-top: 1px solid rgba(255, 250, 239, .2);
}
.cover-counts {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.cover-counts strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 249, 238, .9);
}
.cover-counts i {
  width: 3px;
  height: 3px;
  background: rgba(255, 249, 238, .38);
  border-radius: 50%;
}
.cover-page {
  font-family: var(--serif);
  letter-spacing: .16em;
  white-space: nowrap;
}
.cover-vertical {
  position: absolute;
  top: 46%;
  right: 9px;
  z-index: 5;
  font-size: 7.5px;
  letter-spacing: .28em;
  color: rgba(250, 245, 235, .34);
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

/* =========================================================
   PROFILE PAGE
   ========================================================= */

.profile-main {
  padding: 32px 0 64px;
}

.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  overflow: hidden;
  padding: 34px 38px;
  background:
    radial-gradient(80% 140% at 0% 0%, rgba(255, 255, 255, .62), transparent 48%),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.profile-hero::before {
  content: "W";
  position: absolute;
  top: -73px;
  right: 19%;
  z-index: 0;
  font-family: var(--serif);
  font-size: 290px;
  line-height: 1;
  color: rgba(163, 79, 51, .045);
  pointer-events: none;
}
.profile-hero > * { position: relative; z-index: 1; }

.profile-avatar-wrap {
  position: relative;
  width: 112px;
  height: 112px;
}
.avatar-profile {
  width: 112px;
  height: 112px;
  font-size: 42px;
  background: var(--olive);
  border: 4px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line-strong), 0 14px 28px -22px rgba(44, 34, 20, .7);
}
.avatar-camera {
  position: absolute;
  right: -1px;
  bottom: 3px;
  display: grid;
  width: 33px;
  height: 33px;
  padding: 0;
  place-items: center;
  color: var(--paper);
  cursor: pointer;
  background: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 3px 8px -4px rgba(44, 34, 20, .6);
  transition: background .2s, transform .2s;
}
.avatar-camera:hover { background: var(--accent); transform: scale(1.05); }
.avatar-camera svg { width: 14px; height: 14px; }

.profile-identity .eyebrow { margin-bottom: 9px; }
.profile-identity h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.profile-identity > p {
  max-width: 520px;
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}
.profile-local {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 15px;
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--faint);
}
.profile-local svg { width: 12px; height: 12px; color: var(--olive); }

.profile-stats {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--line);
}
.profile-stat {
  min-width: 78px;
  padding: 2px 13px;
  text-align: center;
}
.profile-stat + .profile-stat { border-left: 1px solid var(--line); }
.profile-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.15;
}
.profile-stat span {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  letter-spacing: .06em;
  color: var(--faint);
  white-space: nowrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 18px;
  margin-top: 18px;
}
.profile-card {
  padding: 29px 30px 24px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .5), transparent 48%),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.profile-card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.profile-card-no {
  padding-top: 4px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--accent);
}
.profile-card-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.profile-card-head p {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--faint);
}
.profile-field + .profile-field { margin-top: 20px; }
.profile-input {
  height: 45px;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .01em;
}
.profile-textarea {
  height: auto;
  min-height: 94px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
}
.profile-save-row {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 23px;
  padding-top: 15px;
  font-size: 9.5px;
  letter-spacing: .03em;
  color: var(--faint);
  border-top: 1px solid var(--line);
}
.profile-save-row svg { width: 13px; height: 13px; color: var(--olive); }

.avatar-editor,
.cover-editor {
  display: flex;
  gap: 17px;
  align-items: center;
}
.avatar-preview .avatar {
  width: 76px;
  height: 76px;
  font-size: 28px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 7px 16px -14px rgba(44, 34, 20, .6);
}
.media-copy { min-width: 0; }
.media-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
}
.media-copy p {
  margin: 4px 0 12px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted);
}
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  align-items: center;
}
.inline-actions .btn-quiet {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 10.5px;
}
.inline-actions .btn-quiet svg { width: 13px; height: 13px; }
.text-button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 5px 0;
  font-size: 10.5px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.text-button:hover {
  color: var(--accent);
  border-bottom-color: rgba(163, 79, 51, .45);
}
.text-button svg { width: 12px; height: 12px; }
.media-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}
.cover-thumb {
  position: relative;
  flex: 0 0 154px;
  width: 154px;
  height: 92px;
  overflow: hidden;
  background: #28241d;
  border: 1px solid var(--line-strong);
  box-shadow: 0 7px 16px -14px rgba(44, 34, 20, .6);
}
.cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.82);
}
.cover-thumb span {
  position: absolute;
  bottom: 7px;
  left: 8px;
  font-size: 6.5px;
  letter-spacing: .18em;
  color: rgba(255, 249, 238, .72);
  text-shadow: 0 1px 5px rgba(0, 0, 0, .7);
}
.profile-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 23px 0 0;
  padding-top: 16px;
  font-size: 9.5px;
  line-height: 1.7;
  color: var(--faint);
  border-top: 1px solid var(--line);
}
.profile-note svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 2px;
  color: var(--accent);
}

@keyframes cover-drift {
  from { transform: scale(1.045); }
  to { transform: scale(1.012); }
}

/* =========================================================
   LIST PAGE
   ========================================================= */

.list-main {
  padding: 24px 0 72px;
}

.list-topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
}
.back-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.back-link:hover { color: var(--ink); }
.back-link svg { width: 15px; height: 15px; transition: transform .22s; }
.back-link:hover svg { transform: translateX(-3px); }
.topbar-note {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--faint);
}
.topbar-note svg { width: 13px; height: 13px; color: var(--olive); }

.list-heading {
  display: flex;
  gap: 36px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 36px 0 30px;
}
.list-heading .eyebrow { margin-bottom: 13px; }
.list-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.list-title {
  max-width: 790px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 60px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.title-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 1px;
  align-items: center;
}
.title-action {
  flex: 0 0 auto;
  opacity: .45;
}
.list-heading:hover .title-action,
.title-actions:focus-within .title-action { opacity: 1; }

.list-sub {
  max-width: 580px;
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}
.list-sub kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--sans);
  font-size: 10px;
  color: var(--ink-soft);
  background: rgba(252, 249, 242, .65);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.list-stats {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(250, 246, 237, .5);
}
.list-stat {
  min-width: 85px;
  padding: 11px 15px 9px;
  text-align: center;
}
.list-stat + .list-stat { border-left: 1px solid var(--line); }
.list-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
}
.list-stat span {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: .07em;
  color: var(--faint);
}

.workspace-toolbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin: 7px 0 13px;
  padding: 11px 13px 11px 16px;
  background: rgba(250, 246, 237, .48);
  border: 1px solid rgba(187, 174, 150, .55);
}
.toolbar-left {
  display: flex;
  gap: 17px;
  align-items: center;
  min-width: 0;
}
.toolbar-left .btn-quiet {
  min-height: 35px;
  padding: 6px 11px;
  font-size: 11px;
  background: rgba(252, 249, 242, .4);
}
.toolbar-hint {
  overflow: hidden;
  font-size: 10px;
  letter-spacing: .035em;
  color: var(--faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toolbar-right {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}
.btn-small {
  min-height: 35px;
  padding: 7px 13px;
  font-size: 11px;
}
.btn-small svg { width: 14px; height: 14px; }

/* --- paper sheet --- */

.sheet-stage {
  position: relative;
  padding-left: 26px;
}

.paper-sheet {
  position: relative;
  padding: 32px 27px 20px 53px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, .62), transparent 45%),
    var(--paper);
  border: 1px solid #cbbda5;
  border-radius: 3px;
  box-shadow:
    0 34px 68px -47px rgba(61, 48, 28, .68),
    0 2px 4px rgba(61, 48, 28, .08),
    inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.paper-sheet::before {
  content: "";
  position: absolute;
  top: 31px;
  bottom: 28px;
  left: 30px;
  width: 1px;
  background: rgba(163, 79, 51, .13);
}
.paper-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.binding {
  position: absolute;
  top: 38px;
  bottom: 35px;
  left: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 31px;
  pointer-events: none;
}
.binding i {
  position: relative;
  display: block;
  width: 29px;
  height: 14px;
  border: 1.5px solid #91846e;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(157, 144, 122, .16));
  box-shadow: 0 2px 2px rgba(71, 59, 40, .12), inset 0 1px 1px rgba(255, 255, 255, .65);
  transform: rotate(-5deg);
}
.binding i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 10px;
  width: 8px;
  height: 5px;
  background: #ded4c2;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(87, 73, 50, .3);
}

.sheet-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 24px;
  text-align: center;
}
.sheet-kicker {
  margin: 0 0 7px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .28em;
  color: var(--faint);
}
.sheet-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.7vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .31em;
  text-indent: .31em;
  color: var(--ink);
}
.sheet-rule {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 13px;
}
.sheet-rule::before,
.sheet-rule::after {
  content: "";
  width: 35px;
  height: 1px;
  background: var(--line);
}
.sheet-rule i {
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
}
.sheet-sub {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}
.table-scroll-hint {
  display: none;
  gap: 5px;
  align-items: center;
  margin: 10px 0 0;
  font-size: 9px;
  letter-spacing: .05em;
  color: var(--faint);
}
.table-scroll-hint svg { width: 12px; height: 12px; }
.sheet-number {
  position: absolute;
  top: 35px;
  right: 30px;
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--faint);
}
.sheet-number strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-soft);
}

.table-viewport {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  scrollbar-color: #b8a98f #eee6d7;
  scrollbar-width: thin;
}
.table-viewport::-webkit-scrollbar { height: 9px; }
.table-viewport::-webkit-scrollbar-track { background: #eee6d7; }
.table-viewport::-webkit-scrollbar-thumb {
  background: #b8a98f;
  border: 2px solid #eee6d7;
  border-radius: 10px;
}

.word-table {
  width: 100%;
  min-width: 1018px;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: collapse;
}

.word-table col.col-index { width: 5.2%; }
.word-table col.col-word { width: 20.2%; }
.word-table col.col-meaning { width: 26.5%; }
.word-table col.col-record { width: 6.87%; }

.word-table th,
.word-table td {
  border: 1px solid #cec2ad;
}

.word-table thead th {
  position: relative;
  font-weight: 500;
  color: var(--ink-soft);
  background: #f2ebdd;
}

.th-main {
  height: 91px;
  padding: 12px 10px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .08em;
  text-align: center;
  vertical-align: middle;
  background: #f0e8d8 !important;
}
.th-main .th-en {
  display: block;
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: .13em;
  color: var(--faint);
}
.th-main.index-th {
  font-family: var(--serif);
  font-size: 12px;
}
.th-main.index-th .th-en { display: none; }

.th-group {
  height: 33px;
  padding: 5px 8px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .1em;
  text-align: center;
  color: var(--muted) !important;
  background: #e9dfcd !important;
}

.th-sub {
  height: 56px;
  padding: 6px 20px 16px 6px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .03em;
  text-align: center;
  vertical-align: middle;
  background: #f4ede1 !important;
}

.col-toggle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  color: #8c816f;
  cursor: pointer;
  background: rgba(252, 249, 242, .45);
  border: 1px solid rgba(166, 151, 125, .5);
  border-radius: 50%;
  opacity: .72;
  transition: opacity .18s, color .18s, background .18s, border-color .18s, transform .18s;
}
.th-main .col-toggle {
  right: 5px;
  bottom: 6px;
}
.th-sub .col-toggle {
  top: 5px;
  right: 4px;
  bottom: auto;
}
.col-toggle:hover {
  color: var(--accent);
  background: var(--paper);
  border-color: var(--accent);
  opacity: 1;
  transform: scale(1.06);
}
.col-toggle svg { width: 12px; height: 12px; }
.col-toggle[aria-pressed="true"] {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}
th.is-col-hidden {
  background: #e9ddc9 !important;
}
th.is-col-hidden .th-main-label,
th.is-col-hidden .th-sub-label {
  opacity: .48;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.word-table tbody td {
  height: 53px;
  padding: 0;
  vertical-align: middle;
  background: var(--paper);
  transition: background .14s;
}
.word-table tbody tr:nth-child(even) td { background: #faf5eb; }
.word-table tbody tr:hover td { background: #f5edde; }
.word-table tbody tr:last-child td { border-bottom-color: var(--line-strong); }

.index-cell {
  position: relative;
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .02em;
  color: #9b8f7c;
  text-align: center;
  user-select: none;
}
.index-cell .row-num {
  display: inline-block;
  transition: opacity .15s;
}
.row-delete {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 23px;
  height: 23px;
  padding: 0;
  place-items: center;
  color: #a08f76;
  cursor: pointer;
  background: #efe5d3;
  border: 1px solid #d5c5aa;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity .16s, transform .16s, color .16s, background .16s;
}
.row-delete svg { width: 11px; height: 11px; }
.index-cell:hover .row-num { opacity: 0; }
.index-cell:hover .row-delete,
.row-delete:focus-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.row-delete:hover {
  color: var(--danger);
  background: #f5e4dd;
  border-color: #dbb7aa;
}

.cell {
  position: relative;
  padding: 0 !important;
  cursor: pointer;
  outline-offset: -3px;
}
.cell-inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 53px;
  padding: 8px 12px;
}
.cell-value {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  transition: opacity .16s;
}
.cell-word .cell-value {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ink);
}
.cell-meaning .cell-value {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.cell-record .cell-inner {
  justify-content: center;
  padding: 8px 13px;
}
.cell-record .cell-value {
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.4;
  color: #5f594c;
  text-align: center;
  letter-spacing: .01em;
}
.cell.empty .cell-value {
  min-height: 1.4em;
}

.cell-edit {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  display: grid;
  width: 19px;
  height: 19px;
  padding: 0;
  place-items: center;
  color: #9b8e7a;
  cursor: pointer;
  background: rgba(250, 245, 235, .86);
  border: 1px solid transparent;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .16s, color .16s, background .16s, border-color .16s;
}
.cell-edit svg { width: 10px; height: 10px; }
.cell:hover .cell-edit { opacity: .8; }
.cell-edit:hover {
  color: var(--accent);
  background: var(--paper);
  border-color: #d6c7ae;
  opacity: 1 !important;
}
.cell.is-editing .cell-edit { display: none; }
.cell.is-editing {
  background: #fdfaf3 !important;
  box-shadow: inset 0 0 0 2px rgba(163, 79, 51, .56);
  cursor: text;
}
.cell.is-editing .cell-inner { align-items: flex-start; }
.cell.is-editing .cell-value {
  min-height: 37px;
  outline: none;
  cursor: text;
}
.cell.is-editing .cell-value:empty::before {
  content: "输入内容…";
  color: #b3a590;
}
.cell.is-editing .cell-word .cell-value,
.cell.is-editing .cell-value { font-size: inherit; }

.cell-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  letter-spacing: .1em;
  color: #786b55;
  pointer-events: none;
  opacity: 0;
  background-color: #e8decb;
  background-image:
    repeating-linear-gradient(135deg, transparent 0 7px, rgba(115, 97, 68, .09) 7px 8px);
  box-shadow: inset 0 0 17px rgba(105, 86, 58, .07);
  transition: opacity .16s;
}
.cell-mask svg { width: 13px; height: 13px; opacity: .72; }
.cell-mask .mask-text { display: none; }
.cell-word .cell-mask .mask-text,
.cell-meaning .cell-mask .mask-text { display: inline; }
.cell-record .cell-mask { gap: 0; }
.cell-record .cell-mask svg { width: 12px; height: 12px; }

.cell.is-hidden .cell-value,
.cell.is-col-hidden .cell-value {
  visibility: hidden;
  opacity: 0;
}
.cell.is-hidden .cell-mask,
.cell.is-col-hidden .cell-mask { opacity: 1; }
.cell.is-hidden .cell-edit,
.cell.is-col-hidden .cell-edit { display: none; }
.cell.is-hidden.is-editing .cell-mask,
.cell.is-col-hidden.is-editing .cell-mask { display: none; }
.cell.is-col-hidden { cursor: not-allowed; }
.cell.is-col-hidden .cell-inner { filter: none; }
.cell.is-col-hidden .cell-mask { background-color: #e4d9c4; }
.cell.is-col-hidden .cell-mask .mask-text { display: none; }

/* touch: keep the edit affordance visible */
@media (hover: none) {
  .cell-edit {
    top: 5px;
    right: 5px;
    width: 23px;
    height: 23px;
    opacity: .6;
  }
  .cell-edit svg { width: 11px; height: 11px; }
  .row-delete { opacity: .38; transform: translate(-50%, -50%) scale(.9); }
  .index-cell .row-num { opacity: .25; }
  .card-delete { opacity: .65; }
}

.sheet-foot {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding-top: 15px;
  font-size: 7.5px;
  letter-spacing: .16em;
  color: var(--faint);
  text-transform: uppercase;
}
.sheet-foot .foot-left {
  display: flex;
  gap: 9px;
  align-items: center;
}
.sheet-foot .foot-left::before {
  content: "";
  width: 15px;
  height: 1px;
  background: var(--line-strong);
}
.sheet-foot .foot-right {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sheet-foot .foot-right svg { width: 11px; height: 11px; color: var(--olive); }

.add-row-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding: 12px 13px 12px 16px;
  background: rgba(250, 246, 237, .37);
  border: 1px dashed #bdb096;
  border-radius: 3px;
}
.add-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-add-row {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-soft);
  cursor: pointer;
  background: rgba(252, 249, 242, .6);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  transition: color .2s, background .2s, border-color .2s;
}
.btn-add-row:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}
.btn-add-row svg { width: 13px; height: 13px; }
.btn-add-row.subtle {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
}
.btn-add-row.subtle:hover {
  color: var(--ink);
  background: rgba(252, 249, 242, .8);
  border-color: var(--line);
}
.add-row-note {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 9.5px;
  letter-spacing: .03em;
  color: var(--faint);
}
.add-row-note svg { width: 12px; height: 12px; color: var(--olive); }

/* =========================================================
   MODAL
   ========================================================= */

.modal {
  width: min(510px, calc(100vw - 34px));
  max-width: none;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  overflow: visible;
}
.modal::backdrop {
  background: rgba(44, 38, 29, .38);
  backdrop-filter: blur(3px);
}
.modal[open] { animation: modal-in .3s var(--ease) both; }
.modal[open]::backdrop { animation: backdrop-in .3s both; }

.modal-card {
  position: relative;
  padding: 33px 34px 28px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .55), transparent 45%),
    var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -30px rgba(34, 27, 17, .58);
}
.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
}
.modal-kicker {
  margin: 0 0 14px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .24em;
  color: var(--accent);
}
.modal-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.modal-desc {
  margin: 9px 0 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--muted);
}
.modal-field { margin-top: 23px; }
.modal-label {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.text-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 10px 13px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  background: rgba(248, 242, 230, .55);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.text-input::placeholder {
  font-family: var(--sans);
  font-size: 12px;
  color: #afa28d;
}
.text-input:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 79, 51, .1);
}
.text-input[aria-invalid="true"] { border-color: var(--danger); }
.field-hint {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--faint);
}
.field-error {
  margin: 7px 0 0;
  font-size: 10.5px;
  color: var(--danger);
}
.modal-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 27px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}
.modal-actions .btn,
.modal-actions .btn-quiet { min-height: 41px; font-size: 11.5px; }
.btn-danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff9f2;
}
.btn-danger:hover { --btn-bg: #7b2f21; }

.delete-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding: 13px 14px;
  background: #f5eae2;
  border: 1px solid #e0c9bd;
}
.delete-summary .delete-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--danger);
  border: 1px solid rgba(150, 63, 46, .26);
  border-radius: 50%;
}
.delete-summary .delete-icon svg { width: 15px; height: 15px; }
.delete-summary strong {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}
.delete-summary span {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--muted);
}

/* =========================================================
   TOAST
   ========================================================= */

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-end;
  width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  gap: 13px;
  align-items: center;
  justify-content: space-between;
  min-width: 235px;
  padding: 12px 14px 12px 16px;
  color: var(--paper);
  pointer-events: auto;
  background: rgba(44, 41, 35, .96);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 3px;
  box-shadow: 0 15px 35px -18px rgba(30, 24, 16, .7);
  animation: toast-in .35s var(--ease) both;
}
.toast.is-leaving { animation: toast-out .25s ease both; }
.toast-message {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  line-height: 1.5;
}
.toast-message svg { flex: 0 0 auto; width: 14px; height: 14px; color: #c8bd9e; }
.toast-action {
  flex: 0 0 auto;
  padding: 3px 0;
  font-size: 10.5px;
  font-weight: 600;
  color: #e7c8ad;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: 0;
}
.toast-action:hover { color: #fff0dc; }

/* =========================================================
   MOTION
   ========================================================= */

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(7px); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1080px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
  }
  .hero-art { height: 405px; transform: scale(.9); transform-origin: center right; }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-add { grid-column: span 2; }
  .list-heading { align-items: flex-start; }
  .list-stats { margin-top: 4px; }
}

@media (max-width: 860px) {
  .app-shell { width: min(100% - 40px, 740px); }
  .site-header {
    grid-template-columns: auto 1fr;
    gap: 14px;
  }
  .main-nav { justify-self: end; }
  .header-note { display: none; }
  .cover-topline { padding: 23px 25px; }
  .cover-content { left: 34px; width: min(660px, calc(100% - 68px)); }
  .cover-name { font-size: clamp(50px, 8vw, 80px); }
  .cover-vertical { display: none; }
  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    padding: 29px 30px;
  }
  .profile-stats {
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-top: 2px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .profile-stat {
    flex: 1;
    min-width: 0;
    padding: 0;
  }
  .profile-grid { grid-template-columns: 1fr; }
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 30px;
    padding: 42px 0 32px;
  }
  .hero-copy { max-width: 650px; }
  .hero-art {
    width: min(390px, 88%);
    margin: 8px auto 0;
    transform: scale(.95);
    transform-origin: center top;
  }
  .hero-stats { margin-top: 34px; }
  .list-heading { display: block; padding: 26px 0 25px; }
  .list-stats { display: inline-flex; margin-top: 22px; }
  .paper-sheet { padding: 26px 16px 18px 34px; }
  .paper-sheet::before { left: 18px; }
  .sheet-head { padding-bottom: 19px; }
  .sheet-number { top: 27px; right: 20px; }
  .binding { left: 14px; }
  .table-scroll-hint { display: inline-flex; }
  .workspace-toolbar { align-items: flex-start; }
  .toolbar-hint { display: none; }
  .page-footer { margin-top: 34px; }
}

@media (max-width: 640px) {
  .app-shell { width: calc(100% - 28px); }
  .site-header { min-height: 72px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 13.5px; letter-spacing: .14em; }
  .brand-sub { display: none; }
  .brand-mark { width: 31px; height: 31px; font-size: 19px; }
  .main-nav { gap: 1px; padding: 2px; }
  .nav-link {
    gap: 5px;
    min-height: 30px;
    padding: 7px 9px;
    font-size: 9.5px;
    letter-spacing: .03em;
  }
  .avatar-nav { width: 18px; height: 18px; font-size: 9px; }
  .header-note { font-size: 9px; letter-spacing: .04em; }

  .cover-main { padding: 10px 0 18px; }
  .cover-frame {
    height: calc(100vh - 100px);
    height: calc(100svh - 100px);
    min-height: 560px;
  }
  .cover-frame::after { inset: 8px; }
  .cover-topline { padding: 17px 18px; gap: 12px; }
  .cover-edition {
    max-width: 55%;
    font-size: 7px;
    line-height: 1.5;
    letter-spacing: .12em;
  }
  .cover-change {
    min-height: 31px;
    padding: 7px 9px;
    font-size: 9px;
  }
  .cover-change svg { width: 12px; height: 12px; }
  .cover-content {
    right: 22px;
    bottom: 107px;
    left: 22px;
    width: auto;
  }
  .cover-id { margin-bottom: 15px; font-size: 7.5px; letter-spacing: .16em; }
  .avatar-cover { width: 38px; height: 38px; font-size: 17px; }
  .cover-name {
    font-size: clamp(44px, 13.5vw, 70px);
    line-height: 1;
  }
  .cover-tagline {
    max-width: 94%;
    margin-top: 14px;
    font-size: 12.5px;
    line-height: 1.68;
  }
  .cover-actions { gap: 15px; margin-top: 21px; }
  .cover-enter {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 10.5px;
  }
  .cover-edit { font-size: 9.5px; }
  .cover-bottom {
    right: 22px;
    bottom: 17px;
    left: 22px;
    gap: 8px;
    padding-top: 10px;
    font-size: 8px;
  }
  .cover-counts { gap: 8px; }
  .cover-counts strong { font-size: 13px; }
  .cover-page { display: none; }

  .profile-main { padding: 22px 0 42px; }
  .profile-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 17px;
    padding: 22px;
  }
  .profile-avatar-wrap { width: 90px; height: 90px; }
  .avatar-profile { width: 90px; height: 90px; font-size: 34px; }
  .avatar-camera { width: 30px; height: 30px; }
  .profile-identity .eyebrow { margin-bottom: 7px; }
  .profile-identity h1 { font-size: 34px; }
  .profile-identity > p { font-size: 12.5px; }
  .profile-local { margin-top: 12px; }
  .profile-stats {
    width: 100%;
    margin-top: 3px;
    padding-top: 15px;
  }
  .profile-stat strong { font-size: 20px; }
  .profile-grid { gap: 13px; margin-top: 13px; }
  .profile-card { padding: 22px 18px 20px; }
  .profile-card-head { padding-bottom: 15px; margin-bottom: 18px; }
  .profile-card-head h2 { font-size: 21px; }
  .profile-card-head p { font-size: 9.5px; }
  .profile-field + .profile-field { margin-top: 17px; }
  .avatar-editor { gap: 14px; }
  .avatar-preview .avatar { width: 68px; height: 68px; font-size: 25px; }
  .cover-editor { flex-wrap: wrap; align-items: flex-start; }
  .cover-thumb { flex: 0 0 100%; width: 100%; height: 132px; }
  .cover-editor .media-copy { width: 100%; }
  .media-divider { margin: 19px 0; }

  .home-hero { gap: 0; padding: 32px 0 27px; }
  .hero-title { font-size: clamp(39px, 12.2vw, 58px); line-height: 1.19; }
  .hero-lede { margin-top: 20px; font-size: 13px; line-height: 1.85; }
  .hero-actions { margin-top: 26px; gap: 12px; }
  .hero-actions .btn { min-height: 44px; padding: 10px 16px; font-size: 12px; }
  .hero-tip { font-size: 9.5px; }
  .hero-stats { margin-top: 27px; padding-top: 17px; }
  .hero-stat { min-width: 0; flex: 1; padding-right: 12px; }
  .hero-stat + .hero-stat { padding-left: 14px; }
  .hero-stat strong { font-size: 23px; }
  .hero-stat span { font-size: 9px; }
  .hero-art { display: none; }
  .section-head { align-items: center; padding: 24px 0 19px; }
  .section-title { font-size: 27px; }
  .section-head .btn { min-height: 40px; padding: 9px 13px; font-size: 11px; }
  .list-grid { grid-template-columns: 1fr; gap: 13px; }
  .card-add { grid-column: span 1; }
  .list-card,
  .card-link { min-height: 187px; }
  .card-link { padding: 22px 20px 18px; }
  .card-title { margin-top: 18px; font-size: 23px; }
  .card-delete { opacity: .55; }
  .card-add { min-height: 150px; }
  .page-footer { font-size: 8.5px; }
  .page-footer span:last-child { display: none; }

  .list-topbar { min-height: 30px; }
  .topbar-note { display: none; }
  .list-heading { padding-top: 25px; }
  .list-title { font-size: clamp(32px, 10vw, 46px); }
  .list-sub { font-size: 11px; }
  .list-stats { width: 100%; }
  .list-stat { flex: 1; min-width: 0; padding: 9px 10px 8px; }
  .list-stat strong { font-size: 20px; }
  .workspace-toolbar { display: block; padding: 10px; }
  .toolbar-left { justify-content: space-between; }
  .toolbar-right { margin-top: 9px; }
  .toolbar-right .btn { width: 100%; }
  .sheet-stage { padding-left: 0; }
  .paper-sheet {
    padding: 22px 11px 15px 23px;
    box-shadow: 0 22px 45px -38px rgba(61, 48, 28, .7);
  }
  .paper-sheet::before { left: 12px; top: 18px; }
  .binding { display: none; }
  .sheet-kicker { font-size: 7px; }
  .sheet-title { font-size: 21px; }
  .sheet-sub { font-size: 9.5px; }
  .sheet-number { display: none; }
  .sheet-head { padding-top: 4px; }
  .entry-hint { display: none; }
  .add-row-bar { align-items: flex-start; padding: 10px; }
  .add-row-note { width: 100%; font-size: 9px; }
  .add-row-actions { width: 100%; }
  .btn-add-row { flex: 1; justify-content: center; }
  .modal-card { padding: 28px 22px 22px; }
  .modal-title { font-size: 25px; }
  .toast-region { right: 16px; bottom: 16px; }
}

@media (max-width: 390px) {
  .header-note { display: none; }
}

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

/* ---------- record marks ---------- */
.mark-cell { cursor: pointer; text-align: center; user-select: none; }
.mark-cell .cell-inner { display: flex; align-items: center; justify-content: center; }
.mark-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  font-weight: 650;
  line-height: 1;
}
.mark-cell.is-check .mark-symbol { color: #3f8d65; }
.mark-cell.is-cross .mark-symbol { color: #bd5a56; }
.mark-cell.empty .mark-symbol::after { content: "·"; color: var(--faint); opacity: .28; font-weight: 400; }
.mark-cell:hover { background: rgba(151, 135, 238, .08); }

/* ---------- unmastered overview ---------- */
.unmastered-home { margin-top: 48px; }
.unmastered-home .section-head { align-items: flex-end; }
.unmastered-home-note { font-size: 9px; color: var(--faint); }
.unmastered-board {
  overflow: hidden;
  margin-top: 16px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px -34px rgba(40, 36, 70, .35);
}
.unmastered-board-head,
.unmastered-item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.7fr) minmax(0, .9fr) auto;
  gap: 16px;
  align-items: center;
  padding: 11px 16px;
}
.unmastered-board-head {
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--faint);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.unmastered-item {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 205, 185, .45);
  transition: background .18s ease;
}
.unmastered-item:last-child { border-bottom: 0; }
.unmastered-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.unmastered-word { overflow: hidden; font-size: 13px; font-weight: 600; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.unmastered-meaning { overflow: hidden; font-size: 10px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.unmastered-list { overflow: hidden; font-size: 9px; color: var(--faint); text-overflow: ellipsis; white-space: nowrap; }
.unmastered-stage { padding: 3px 7px; font-size: 8px; color: #a5524e; white-space: nowrap; background: rgba(189, 90, 86, .08); border-radius: 6px; }
.unmastered-more { margin: 10px 2px 0; font-size: 9px; color: var(--faint); }
.unmastered-empty {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  margin-top: 16px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.unmastered-empty-mark { display: grid; width: 30px; height: 30px; place-items: center; font-size: 18px; color: #3f8d65; background: rgba(63, 141, 101, .09); border-radius: 50%; }
.unmastered-empty p { margin: 0; font-size: 10px; color: var(--faint); }

/* ---------- unmastered list controls ---------- */
.unmastered-button { gap: 6px; }
.unmastered-button svg { width: 14px; height: 14px; }
.unmastered-button b { min-width: 16px; padding: 1px 5px; font-size: 8px; font-weight: 500; color: #a5524e; text-align: center; background: rgba(189, 90, 86, .1); border-radius: 10px; }
.unmastered-modal-list { max-height: 46vh; overflow: auto; margin: 14px -4px 0; padding: 0 4px; }
.unmastered-modal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.unmastered-modal-row:last-child { border-bottom: 0; }
.unmastered-modal-word { font-size: 12px; font-weight: 600; color: var(--ink); }
.unmastered-modal-meaning { font-size: 9.5px; color: var(--muted); }
.unmastered-modal-row small { font-size: 8px; color: #a5524e; white-space: nowrap; }
.unmastered-modal-empty { margin: 18px 0; font-size: 10px; color: var(--faint); text-align: center; }

@media (max-width: 760px) {
  .unmastered-home { margin-top: 34px; }
  .unmastered-home .section-head { align-items: flex-start; gap: 8px; }
  .unmastered-home-note { display: none; }
  .unmastered-board-head { display: none; }
  .unmastered-item { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 13px; }
  .unmastered-meaning { grid-column: 1; grid-row: 2; }
  .unmastered-list { grid-column: 1; grid-row: 3; }
  .unmastered-stage { grid-column: 2; grid-row: 1 / span 3; }
  .unmastered-modal-row { grid-template-columns: minmax(0, 1fr) auto; }
  .unmastered-modal-meaning { grid-column: 1; grid-row: 2; }
  .unmastered-modal-row small { grid-column: 2; grid-row: 1 / span 2; }
}
.list-title-row { flex-wrap: wrap; }
.title-actions { gap: 6px; }
/* ---------- learning calendar ---------- */
.calendar-main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 70px; }
.calendar-heading {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 26px 0 4px;
}
.calendar-title {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5.2vw, 64px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.045em;
  color: var(--ink);
}
.calendar-sub { max-width: 520px; margin: 12px 0 0; font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.calendar-summary { display: grid; grid-template-columns: repeat(4, minmax(62px, 1fr)); gap: 8px; flex: 0 0 auto; }
.calendar-stat {
  min-width: 68px;
  padding: 11px 12px;
  text-align: center;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.calendar-stat strong { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1; color: var(--ink); }
.calendar-stat span { display: block; margin-top: 5px; font-size: 7.5px; color: var(--faint); white-space: nowrap; }
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .9fr);
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}
.calendar-panel,
.todo-panel {
  padding: 22px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: 21px;
  box-shadow: 0 20px 50px -42px rgba(30, 28, 60, .5);
}
.calendar-panel-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.calendar-month { margin: 4px 0 0; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.2; color: var(--ink); }
.calendar-month .todo-count { margin-left: 7px; font-family: var(--sans); font-size: 8px; font-weight: 400; color: var(--faint); }
.calendar-nav { display: flex; gap: 5px; align-items: center; }
.calendar-nav-btn,
.calendar-today-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 9px;
  color: var(--muted);
  cursor: pointer;
  background: color-mix(in srgb, var(--paper) 68%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.calendar-nav-btn { width: 30px; padding: 0; }
.calendar-nav-btn svg { width: 13px; height: 13px; }
.calendar-nav-btn:hover,
.calendar-today-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.calendar-today-btn { padding: 0 10px; }
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 20px;
  padding: 0 1px;
}
.calendar-weekdays span { font-size: 8px; color: var(--faint); text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 6px; }
.calendar-day {
  position: relative;
  min-width: 0;
  min-height: 67px;
  padding: 7px;
  overflow: hidden;
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: color-mix(in srgb, var(--paper) 58%, transparent);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background .16s, border-color .16s, transform .16s;
}
.calendar-day:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); transform: translateY(-1px); }
.calendar-day.is-outside { opacity: .32; }
.calendar-day.is-today { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.calendar-day.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.calendar-day-num { display: block; font-family: var(--serif); font-size: 15px; line-height: 1.1; color: var(--ink-soft); }
.calendar-day.is-selected .calendar-day-num { color: var(--accent-deep); }
.calendar-day-marks { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 9px; }
.calendar-day-marks i { padding: 2px 3px; font-size: 7px; font-style: normal; line-height: 1; border-radius: 4px; }
.calendar-day-marks .is-check { color: #3f8d65; background: rgba(63, 141, 101, .1); }
.calendar-day-marks .is-cross { color: #bd5a56; background: rgba(189, 90, 86, .1); }
.calendar-detail {
  padding: 13px 14px;
  margin-top: 14px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.calendar-detail-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.calendar-detail-head strong { font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.calendar-today-tag { padding: 2px 6px; font-size: 7px; color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 10px; }
.calendar-detail-body { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; margin-top: 8px; }
.calendar-detail-mark { font-size: 8.5px; }
.calendar-detail-mark.is-check { color: #3f8d65; }
.calendar-detail-mark.is-cross { color: #bd5a56; }
.calendar-detail-total,
.calendar-detail-empty,
.calendar-detail-todos { font-size: 8.5px; color: var(--faint); }
.calendar-detail-todos { padding-left: 8px; border-left: 1px solid var(--line); }
.todo-panel { display: flex; flex-direction: column; }
.todo-form { display: grid; grid-template-columns: minmax(0, 1fr) 112px auto; gap: 6px; margin-top: 18px; }
.todo-form .text-input { min-width: 0; height: 34px; padding: 7px 9px; font-size: 9px; }
.todo-form .btn-small { min-height: 34px; padding: 0 10px; font-size: 8px; white-space: nowrap; }
.todo-table { margin-top: 16px; border-top: 1px solid var(--line); }
.todo-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 55px 60px 24px;
  gap: 7px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.todo-head { padding-top: 9px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.todo-head span { font-size: 7px; letter-spacing: .06em; color: var(--faint); }
.todo-check {
  display: grid;
  width: 19px;
  height: 19px;
  padding: 0;
  place-items: center;
  color: #fff;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 6px;
}
.todo-check svg { width: 12px; height: 12px; }
.todo-row.is-done .todo-check { background: #5a9d78; border-color: #5a9d78; }
.todo-row.is-done .todo-text { color: var(--faint); text-decoration: line-through; }
.todo-text { min-width: 0; overflow-wrap: anywhere; font-size: 10px; line-height: 1.5; color: var(--ink-soft); }
.todo-due { font-size: 8px; color: var(--faint); white-space: nowrap; }
.todo-status { font-size: 7.5px; white-space: nowrap; }
.todo-status-pending { color: var(--faint); }
.todo-status-today { color: var(--accent-deep); }
.todo-status-overdue { color: #bd5a56; }
.todo-status-done { color: #5a9d78; }
.todo-delete {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  color: var(--faint);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
}
.todo-delete svg { width: 12px; height: 12px; }
.todo-delete:hover { color: #bd5a56; background: rgba(189, 90, 86, .08); }
.todo-empty {
  padding: 22px 4px;
  font-size: 9px;
  line-height: 1.7;
  color: var(--faint);
  text-align: center;
}

@media (max-width: 980px) {
  .calendar-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .calendar-summary { width: 100%; }
  .calendar-layout { grid-template-columns: 1fr; }
  .todo-panel { order: 2; }
}

@media (max-width: 620px) {
  .calendar-main { width: min(100% - 30px, 1180px); padding-bottom: 44px; }
  .calendar-heading { padding-top: 16px; }
  .calendar-title { font-size: clamp(38px, 12vw, 52px); }
  .calendar-summary { grid-template-columns: repeat(2, 1fr); }
  .calendar-panel,
  .todo-panel { padding: 14px; border-radius: 16px; }
  .calendar-panel-head { align-items: flex-start; }
  .calendar-month { font-size: 18px; }
  .calendar-weekdays,
  .calendar-grid { gap: 3px; }
  .calendar-day { min-height: 53px; padding: 5px; border-radius: 8px; }
  .calendar-day-num { font-size: 13px; }
  .calendar-day-marks { gap: 2px; margin-top: 6px; }
  .calendar-day-marks i { font-size: 6px; padding: 1px 2px; }
  .calendar-detail-body { gap: 6px 9px; }
  .todo-form { grid-template-columns: minmax(0, 1fr) auto; }
  .todo-text-input { grid-column: 1 / -1; }
  .todo-date-input { min-width: 0; }
  .todo-row { grid-template-columns: 23px minmax(0, 1fr) 50px 23px; gap: 5px; }
  .todo-head span:nth-child(4),
  .todo-status { display: none; }
  .todo-head span:nth-child(5) { display: block; }
}