:root {
  --paper: #f3efe6;
  --paper-deep: #e8e0d2;
  --paper-light: #fbfaf6;
  --ink: #18231d;
  --ink-soft: #4d574f;
  --muted: #7b827a;
  --forest: #18543d;
  --forest-dark: #103d2d;
  --forest-soft: #dce9e0;
  --rust: #c45d39;
  --gold: #c99137;
  --red: #a94136;
  --line: rgba(24, 35, 29, .14);
  --line-strong: rgba(24, 35, 29, .24);
  --shadow-sm: 0 8px 24px rgba(34, 29, 21, .08);
  --shadow-lg: 0 30px 80px rgba(34, 29, 21, .15);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --body: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
  font-family: var(--body);
}

html[data-theme="dark"] {
  --paper: #141816;
  --paper-deep: #222824;
  --paper-light: #1b201d;
  --ink: #f0eee7;
  --ink-soft: #c3c8c3;
  --muted: #929b94;
  --forest: #3b9a70;
  --forest-dark: #267653;
  --forest-soft: rgba(67, 164, 119, .16);
  --rust: #df7957;
  --gold: #d8a553;
  --red: #de756a;
  --line: rgba(235, 241, 236, .12);
  --line-strong: rgba(235, 241, 236, .22);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .24);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .42);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; margin: 0; }
body { color: var(--ink); background: var(--paper); }
body.modal-open { overflow: hidden; }
body.reader-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.sr-only { width: 1px; height: 1px; position: absolute; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

::selection { color: #fff; background: var(--forest); }
:focus-visible { outline: 3px solid rgba(196, 93, 57, .42); outline-offset: 3px; }

.site-header,
.studio-header {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 clamp(22px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 239, 230, .88);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 40;
}

.site-header { position: sticky; top: 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--forest);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand-mark i {
  width: 10px;
  height: 20px;
  display: block;
  border: 1.6px solid currentColor;
  transform: skewY(-8deg);
}
.brand-mark i + i { transform: skewY(8deg); }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-family: var(--display); font-size: 19px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.brand.compact .brand-mark { width: 36px; height: 36px; }
.brand.compact .brand-mark i { width: 8px; height: 17px; }

.site-nav,
.studio-nav { margin-left: auto; display: flex; align-items: center; gap: 28px; font-size: 13px; font-weight: 650; }
.language-picker { display: inline-flex; align-items: center; flex: none; }
.language-picker select { height: 34px; min-width: 92px; padding: 0 25px 0 11px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 10px; font-weight: 750; cursor: pointer; }
.language-picker select:hover,
.language-picker select:focus { color: var(--forest); border-color: rgba(24,84,61,.36); outline: 2px solid rgba(24,84,61,.12); outline-offset: 1px; }
.theme-toggle { min-width: 72px; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; padding: 0 11px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; background: transparent; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.theme-toggle:hover { color: var(--forest); border-color: rgba(24,84,61,.36); background: var(--forest-soft); }
.theme-toggle-icon { font-family: Georgia, serif; font-size: 15px; line-height: 1; }
.theme-toggle-label { font-size: 9px; font-weight: 800; letter-spacing: .03em; }
.site-nav > a:not(.nav-cta),
.studio-nav > a:not(.nav-cta) { color: var(--ink-soft); border-bottom: 1px solid transparent; }
.site-nav > a:hover:not(.nav-cta),
.studio-nav > a:hover:not(.nav-cta),
.site-nav > a.active { color: var(--ink); border-color: var(--ink); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  color: #fff;
  border-radius: 999px;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(24, 84, 61, .15);
  transition: transform .18s ease, background .18s ease;
}
.nav-cta:hover { background: var(--forest-dark); transform: translateY(-1px); }
.auth-trigger { min-height: 34px; max-width: 150px; overflow: hidden; padding: 0 13px; color: var(--forest); border: 1px solid rgba(24,84,61,.28); border-radius: 999px; background: transparent; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.auth-trigger:hover, .auth-trigger.signed-in { color: #fff; border-color: var(--forest); background: var(--forest); }

.step-label {
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Landing */
.landing-body {
  background:
    radial-gradient(circle at 82% 13%, rgba(201, 145, 55, .13), transparent 23%),
    linear-gradient(90deg, transparent 49.94%, rgba(24,35,29,.035) 50%, transparent 50.06%),
    var(--paper);
}
.landing-main { max-width: 1500px; margin: 0 auto; padding: 74px clamp(24px, 5vw, 82px) 130px; }
.landing-hero { min-height: 650px; display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(430px, .82fr); gap: clamp(54px, 7vw, 126px); align-items: center; }
.hero-copy-block { max-width: 720px; animation: rise-in .75s ease both; }
.eyebrow { display: flex; gap: 18px; align-items: center; color: var(--forest); font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.eyebrow span + span { display: flex; align-items: center; gap: 18px; color: var(--muted); }
.eyebrow span + span::before { width: 46px; height: 1px; content: ""; background: var(--line-strong); }
.hero-copy-block h1 {
  margin: 24px 0 26px;
  font-family: var(--display);
  font-size: clamp(58px, 6.3vw, 104px);
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.065em;
}
.hero-copy-block h1 em { color: var(--rust); font-weight: 400; }
.hero-copy { max-width: 620px; margin: 0; color: var(--ink-soft); font-size: clamp(17px, 1.4vw, 21px); line-height: 1.65; }
.promise-list { margin-top: 46px; border-top: 1px solid var(--line-strong); }
.promise-list > div { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.promise-list b { padding-top: 3px; color: var(--rust); font-family: var(--mono); font-size: 10px; }
.promise-list span { display: grid; grid-template-columns: 145px 1fr; gap: 14px; color: var(--muted); font-size: 13px; }
.promise-list strong { color: var(--ink); font-weight: 750; }

.upload-column { position: relative; animation: rise-in .75s .12s ease both; }
.upload-column::before {
  width: 132px;
  height: 132px;
  content: "";
  position: absolute;
  top: -28px;
  right: -30px;
  border: 1px solid rgba(196, 93, 57, .35);
  border-radius: 50%;
}
.upload-card {
  position: relative;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper-light);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.upload-card::before { width: 9px; content: ""; position: absolute; inset: 0 auto 0 0; background: var(--forest); }
.upload-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin: 0 0 28px 7px; }
.upload-card-head h2 { margin: 7px 0 0; font-family: var(--display); font-size: 31px; font-weight: 500; letter-spacing: -.03em; }
.format-badge { padding: 8px 10px; color: var(--forest); border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--mono); font-size: 9px; font-weight: 700; white-space: nowrap; }
.drop-zone {
  min-height: 365px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 28px;
  border: 1px dashed rgba(24, 84, 61, .44);
  border-radius: 3px;
  background:
    linear-gradient(rgba(24,84,61,.025), rgba(24,84,61,.025)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(24,35,29,.025) 30px 31px);
  text-align: center;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.drop-zone:hover,
.drop-zone.dragging { border-color: var(--rust); background-color: rgba(196,93,57,.035); transform: translateY(-2px); }
.upload-glyph { width: 74px; height: 74px; display: grid; place-items: center; margin-bottom: 20px; color: var(--forest); border-radius: 50%; background: var(--forest-soft); }
.upload-glyph svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.drop-zone h3 { margin: 0; font-family: var(--display); font-size: 27px; font-weight: 500; }
.drop-zone p { margin: 7px 0 23px; color: var(--muted); font-size: 13px; }
.drop-zone small { margin-top: 18px; color: var(--muted); font-size: 10px; }
.privacy-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 8px 0; color: var(--muted); font-size: 10px; }
.privacy-line span { color: var(--forest); font-size: 18px; }
.folio-note { display: flex; justify-content: space-between; gap: 22px; padding: 18px 5px 0 16px; color: var(--muted); font-size: 11px; }
.folio-note span { color: var(--rust); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; }
.folio-note strong { color: var(--ink-soft); font-weight: 650; }
.home-proof { display: grid; grid-template-columns: minmax(240px, .9fr) 1.6fr; gap: 40px; align-items: stretch; margin-top: 28px; padding: 22px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.home-proof-intro { display: grid; align-content: center; gap: 8px; padding-left: 2px; }
.home-proof-intro strong { max-width: 270px; font-family: var(--display); font-size: 21px; font-weight: 550; line-height: 1.16; letter-spacing: -.025em; }
.home-proof-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.home-proof-stats > div { display: grid; align-content: center; gap: 4px; padding: 3px 18px; border-left: 1px solid var(--line); }
.home-proof-stats strong { font-family: var(--display); font-size: 34px; font-weight: 500; letter-spacing: -.04em; }
.home-proof-stats span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 750;
  transition: transform .16s ease, color .16s ease, border-color .16s ease, background .16s ease;
}
.primary-button { color: #fff; background: var(--forest); box-shadow: 0 10px 22px rgba(24, 84, 61, .16); }
.primary-button:hover:not(:disabled) { background: var(--forest-dark); transform: translateY(-1px); }
.secondary-button { color: var(--ink); border-color: var(--line-strong); background: rgba(255,255,255,.48); }
.secondary-button:hover:not(:disabled) { border-color: var(--forest); color: var(--forest); background: #fff; }
.danger-button { color: #fff; background: var(--red); }
.danger-button:hover:not(:disabled) { background: #8e3029; }
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled { cursor: not-allowed; opacity: .52; }
.button-spinner { width: 14px; height: 14px; display: inline-block; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .75s linear infinite; }

.upload-state { min-height: 365px; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 30px; border: 1px solid var(--line); background: #f8f6f0; }
.upload-state > div:last-child { display: grid; gap: 7px; }
.upload-state strong { max-width: 330px; overflow: hidden; font-family: var(--display); font-size: 24px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.upload-state p { margin: 0; color: var(--muted); font-size: 12px; }
.book-loader { width: 50px; height: 42px; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.book-loader i { width: 11px; height: 33px; display: block; border: 1px solid var(--forest); background: var(--forest-soft); animation: book-pulse 1.2s ease-in-out infinite; }
.book-loader i:nth-child(2) { height: 42px; animation-delay: .12s; }
.book-loader i:nth-child(3) { height: 28px; animation-delay: .24s; }
.error-box { margin-top: 14px; padding: 12px 14px; color: #7b2924; border: 1px solid rgba(169,65,54,.25); border-radius: 3px; background: #f7e6e1; font-size: 11px; line-height: 1.55; }

.recent-section,
.how-section { padding-top: 120px; }
.section-heading { max-width: 660px; }
.section-heading.horizontal { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.section-heading h2 { margin: 8px 0 0; font-family: var(--display); font-size: clamp(38px, 4vw, 58px); font-weight: 500; letter-spacing: -.045em; }
.section-heading p { margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.text-link { padding-bottom: 5px; color: var(--forest); border-bottom: 1px solid var(--forest); font-size: 12px; font-weight: 750; }
.text-link span { margin-left: 8px; }
.recent-books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.recent-book-card { min-height: 260px; display: grid; grid-template-columns: 116px 1fr; gap: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: rgba(251,250,246,.72); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.recent-book-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.recent-cover,
.library-cover { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 2px 8px 8px 2px; background: linear-gradient(145deg, var(--forest), #748b62); box-shadow: 8px 10px 20px rgba(35,38,29,.18); }
.recent-cover::after,
.library-cover::after { width: 4px; content: ""; position: absolute; inset: 0 auto 0 7px; border-left: 1px solid rgba(255,255,255,.3); border-right: 1px solid rgba(0,0,0,.16); }
.recent-cover img,
.library-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-monogram { color: rgba(255,255,255,.9); font-family: var(--display); font-size: 52px; font-style: italic; }
.recent-book-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.recent-book-copy h3 { width: 100%; margin: 13px 0 5px; overflow: hidden; font-family: var(--display); font-size: 22px; font-weight: 550; line-height: 1.12; text-overflow: ellipsis; }
.recent-book-copy h3 a:hover { color: var(--forest); }
.recent-book-copy > p { margin: 0; color: var(--muted); font-size: 11px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 18px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.recent-reading { width: 100%; margin-top: auto; padding-top: 16px; }
.recent-read-button { width: 100%; min-height: 50px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 8px 13px; color: #fff; border-radius: 4px; background: var(--forest); box-shadow: 0 8px 20px rgba(24,84,61,.14); transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.recent-read-button:hover { color: #fff; background: var(--forest-dark); box-shadow: 0 11px 26px rgba(24,84,61,.22); transform: translateY(-1px); }
.recent-read-icon { width: 26px; height: 26px; display: grid; place-items: center; padding-left: 2px; border: 1px solid rgba(255,255,255,.34); border-radius: 50%; font-size: 8px; }
.recent-read-button > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.recent-read-button strong { font-size: 10px; font-weight: 850; }
.recent-read-button small { overflow: hidden; color: rgba(255,255,255,.7); font-size: 7px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recent-read-button > b { font-size: 15px; font-weight: 500; }
.recent-progress-track { width: calc(100% - 2px); height: 3px; margin: 7px 1px 0; overflow: hidden; border-radius: 999px; background: var(--line); }
.recent-progress-track i { height: 100%; display: block; border-radius: inherit; background: #54ae80; transition: width .35s ease; }
.recent-actions { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.recent-actions a { color: var(--forest); font-size: 11px; font-weight: 750; }
.recent-actions small { color: var(--muted); font-size: 9px; }
.record-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.record-status i { width: 7px; height: 7px; border-radius: 50%; background: #9aa099; }
.record-status.completed { color: var(--forest); }
.record-status.completed i { background: #45a877; box-shadow: 0 0 0 3px rgba(69,168,119,.13); }
.record-status.running,
.record-status.in-progress { color: #8a6020; }
.record-status.running i,
.record-status.in-progress i { background: var(--gold); box-shadow: 0 0 0 3px rgba(201,145,55,.14); animation: soft-pulse 1.4s ease-in-out infinite; }
.record-status.failed { color: var(--red); }
.record-status.failed i { background: var(--red); }
.record-status.ready { color: var(--forest); }
.record-status.ready i { background: var(--forest); }
.history-skeleton { min-height: 260px; border: 1px solid var(--line); background: linear-gradient(100deg, rgba(255,255,255,.3) 20%, rgba(255,255,255,.75) 40%, rgba(255,255,255,.3) 60%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.history-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px; color: var(--muted); border: 1px solid var(--line); background: rgba(251,250,246,.62); }
.history-empty a { color: var(--forest); font-weight: 750; }

.how-section { display: grid; grid-template-columns: minmax(270px, .62fr) 1fr; gap: clamp(50px, 8vw, 140px); align-items: start; }
.steps-grid { border-top: 1px solid var(--line-strong); }
.steps-grid article { display: grid; grid-template-columns: 68px 1fr; gap: 20px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.steps-grid article > span { padding-top: 4px; color: var(--rust); font-family: var(--mono); font-size: 10px; }
.steps-grid h3 { margin: 0 0 6px; font-family: var(--display); font-size: 25px; font-weight: 550; }
.steps-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.reading-benefits, .audience-section, .faq-section { padding-top: 120px; }
.reading-benefits { display: grid; grid-template-columns: minmax(270px, .7fr) 1fr; gap: clamp(50px, 8vw, 140px); align-items: start; }
.benefit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.benefit-grid article { min-height: 240px; display: flex; flex-direction: column; align-items: flex-start; padding: 20px; border: 1px solid var(--line); background: rgba(251,250,246,.65); }
.benefit-mark { min-width: 46px; height: 46px; display: inline-grid; place-items: center; margin-bottom: 36px; color: var(--forest); border: 1px solid var(--forest); border-radius: 50%; font-family: var(--mono); font-size: 10px; font-weight: 800; }
.benefit-grid article:nth-child(2) .benefit-mark { font-size: 24px; font-weight: 400; }
.benefit-grid article:nth-child(3) .benefit-mark { width: 46px; border-radius: 4px; font-size: 7px; }
.benefit-grid h3 { margin: 0 0 7px; font-family: var(--display); font-size: 20px; font-weight: 550; line-height: 1.15; }
.benefit-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.audience-note { padding-bottom: 6px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-strong); }
.audience-grid article { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 23px 20px 23px 0; border-bottom: 1px solid var(--line); }
.audience-grid article + article { padding-left: 20px; border-left: 1px solid var(--line); }
.audience-grid article > span { color: var(--rust); font-family: var(--mono); font-size: 10px; }
.audience-grid h3 { margin: 0 0 6px; font-family: var(--display); font-size: 21px; font-weight: 550; line-height: 1.18; }
.audience-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.faq-section { display: grid; grid-template-columns: minmax(240px, .72fr) 1fr; gap: clamp(50px, 8vw, 140px); align-items: start; }
.faq-list { border-top: 1px solid var(--line-strong); }
.faq-list details { padding: 17px 0; border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; list-style: none; padding-right: 28px; color: var(--ink); font-family: var(--display); font-size: 20px; font-weight: 550; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 2px; top: -2px; color: var(--forest); font-family: var(--body); font-size: 22px; font-weight: 400; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { max-width: 630px; margin: 10px 30px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.pricing-section { padding-top: 120px; }
.pricing-intro { max-width: 730px; margin: 22px 0 30px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pricing-currency-note { margin: -3px 0 18px; color: var(--muted); font-size: 10px; letter-spacing: .02em; }
.price-card { min-height: 430px; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); background: rgba(251,250,246,.65); }
.price-card.featured { border-color: var(--forest); box-shadow: 0 15px 36px rgba(24,84,61,.1); transform: translateY(-7px); }
.price-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price-label { color: var(--rust); font-family: var(--mono); font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.price-status { padding: 5px 8px; color: var(--forest); border: 1px solid rgba(24,84,61,.22); border-radius: 999px; font-size: 8px; font-weight: 750; }
.price-status.planned { color: var(--muted); border-color: var(--line); }
.price-card h3 { margin: 35px 0 7px; font-family: var(--display); font-size: 29px; font-weight: 550; }
.price-copy { min-height: 52px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.price strong { font-family: var(--display); font-size: 44px; font-weight: 500; letter-spacing: -.055em; }
.price span { color: var(--muted); font-family: var(--mono); font-size: 8px; }
.price-card ul { display: grid; gap: 10px; margin: 0 0 25px; padding: 0; list-style: none; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.price-card li { position: relative; padding-left: 17px; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--forest); font-weight: 800; }
.price-card .primary-button, .price-card .secondary-button { width: 100%; margin-top: auto; }
.pricing-footnote { display: flex; justify-content: space-between; gap: 24px; margin-top: 14px; padding: 15px 0; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; line-height: 1.5; }
.pricing-footnote strong { color: var(--forest); }
html[data-theme="dark"] .price-card { background: rgba(28,34,30,.62); }
html[data-theme="dark"] .price-card.featured { box-shadow: 0 15px 36px rgba(0,0,0,.22); }
html[data-theme="dark"] .home-proof,
html[data-theme="dark"] .benefit-grid article { background: rgba(28,34,30,.62); }
.site-footer { max-width: 1500px; display: flex; align-items: center; justify-content: space-between; gap: 30px; margin: 0 auto; padding: 28px clamp(24px, 5vw, 82px); color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
.site-footer nav a { color: var(--muted); border-bottom: 1px solid transparent; }
.site-footer nav a:hover, .site-footer nav a.active { color: var(--forest); border-color: currentColor; }
.upload-legal-note { max-width: 530px; margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.upload-legal-note a { color: var(--forest); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }

/* Studio workspace */
.workspace-body { overflow: hidden; background: #e9e4da; }
.studio-header { height: 70px; padding: 0 22px; background: rgba(248,246,240,.94); }
.studio-breadcrumb { min-width: 0; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.studio-breadcrumb a:hover { color: var(--forest); }
.studio-breadcrumb strong { max-width: 34vw; overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.studio-nav { gap: 18px; }
.studio-nav .nav-cta { min-height: 38px; }
.studio-shell { height: calc(100vh - 70px); display: grid; grid-template-columns: 286px minmax(520px, 1fr) 360px; }
.chapter-rail { overflow-y: auto; padding: 22px 15px 34px; border-right: 1px solid var(--line); background: #f7f4ec; }
.book-identity { display: grid; grid-template-columns: 67px 1fr; gap: 14px; align-items: center; padding: 0 7px 18px; border-bottom: 1px solid var(--line); }
.cover-shell { width: 67px; height: 91px; position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 2px 7px 7px 2px; background: linear-gradient(145deg, var(--forest), #758865); box-shadow: 7px 9px 17px rgba(35,38,29,.18); }
.cover-shell::after { width: 3px; content: ""; position: absolute; inset: 0 auto 0 6px; border-left: 1px solid rgba(255,255,255,.25); border-right: 1px solid rgba(0,0,0,.15); }
.cover-shell.no-cover::before { content: attr(data-letter); color: #fff; font-family: var(--display); font-size: 34px; font-style: italic; }
.cover-shell img { width: 100%; height: 100%; display: none; object-fit: cover; }
.book-identity-copy { min-width: 0; }
.book-identity h1 { display: -webkit-box; margin: 6px 0 4px; overflow: hidden; font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.book-identity p { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.book-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 15px 2px 22px; }
.stat-tile { min-width: 0; padding: 8px 3px; text-align: center; border-right: 1px solid var(--line); }
.stat-tile:last-child { border-right: 0; }
.stat-tile strong { display: block; overflow: hidden; font-family: var(--display); font-size: 14px; text-overflow: ellipsis; }
.stat-tile span { color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .06em; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 9px 9px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.text-button { padding: 0; color: var(--forest); border: 0; border-bottom: 1px solid transparent; background: transparent; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.text-button:hover { border-color: var(--forest); }
.chapter-list { display: flex; flex-direction: column; gap: 2px; }
.chapter-item { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) 30px; gap: 6px; align-items: center; padding: 10px 9px; color: var(--ink-soft); border: 0; border-radius: 3px; background: transparent; text-align: left; transition: background .16s ease, color .16s ease; }
.chapter-item:hover { color: var(--ink); background: rgba(24,84,61,.055); }
.chapter-item.active { color: var(--forest-dark); background: var(--forest-soft); box-shadow: inset 3px 0 0 var(--forest); }
.chapter-item.translated .chapter-name { color: var(--forest-dark); }
.chapter-item.translating .chapter-name { color: #76551f; }
.chapter-item.pending .chapter-name { color: var(--muted); }
.chapter-number { color: var(--muted); font-family: var(--mono); font-size: 8px; }
.chapter-name { min-width: 0; overflow: hidden; font-size: 10px; font-weight: 650; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.chapter-words { color: var(--muted); font-family: var(--mono); font-size: 7px; }
.chapter-state { min-width: 23px; justify-self: end; text-align: center; }
.chapter-state.is-complete { width: 19px; height: 19px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--forest); font-size: 10px; font-weight: 900; box-shadow: 0 0 0 3px rgba(24,84,61,.1); animation: check-in .24s ease both; }
.chapter-state.is-translating { color: #855d1e; font-family: var(--mono); font-size: 7px; font-weight: 850; }
.chapter-state.is-pending { color: #acaaa0; font-size: 18px; line-height: 1; }
.advanced-panel { margin: 14px 8px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.advanced-panel p { color: var(--muted); font-size: 9px; line-height: 1.5; }
.file-row { padding: 7px 0; overflow-wrap: anywhere; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 8px; }

.reading-stage { min-width: 0; display: flex; flex-direction: column; background: #dfd9ce; }
.reader-toolbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: rgba(244,240,232,.9); }
.reader-heading { min-width: 0; }
.reader-toolbar h2 { max-width: 500px; margin: 6px 0 0; overflow: hidden; font-family: var(--display); font-size: 21px; font-weight: 550; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.reader-tools { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.reader-tool-row { display: flex; align-items: center; gap: 8px; }
.reader-mode-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.45); }
.reader-mode { min-height: 26px; padding: 0 11px; color: var(--muted); border: 0; border-radius: 999px; background: transparent; font-size: 8px; font-weight: 800; letter-spacing: .03em; transition: color .16s ease, background .16s ease, box-shadow .16s ease; }
.reader-mode:hover:not(:disabled) { color: var(--forest); }
.reader-mode.active { color: #fff; background: var(--forest); box-shadow: 0 3px 10px rgba(24,84,61,.18); }
.reader-mode:disabled { cursor: not-allowed; opacity: .38; }
.reader-meta { display: flex; align-items: center; gap: 7px; }
.reader-meta > span { padding: 4px 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); font-size: 7px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.reader-live-status { display: inline-flex; align-items: center; gap: 5px; }
.reader-live-status i { width: 5px; height: 5px; display: block; border-radius: 50%; background: #9b9d96; }
.reader-live-status.live { color: #805b21; border-color: rgba(201,145,55,.3); background: rgba(201,145,55,.08); }
.reader-live-status.live i { background: var(--gold); animation: soft-pulse 1.1s ease-in-out infinite; }
.reader-live-status.complete { color: var(--forest); border-color: rgba(24,84,61,.22); background: var(--forest-soft); }
.reader-live-status.complete i { background: #48a979; }
.reader-live-status.pending i { background: #b5b2a8; }
.reader-action-group { display: flex; gap: 4px; }
.reader-action { min-width: 31px; height: 31px; display: grid; place-items: center; padding: 0 8px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.34); font-family: var(--display); font-size: 11px; font-weight: 700; transition: color .16s ease, border-color .16s ease, background .16s ease; }
.reader-action:hover,
.reader-action[aria-expanded="true"],
.reader-action[aria-pressed="true"] { color: var(--forest); border-color: rgba(24,84,61,.35); background: var(--forest-soft); }
.reader-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reader-appearance-panel { width: 248px; position: absolute; top: 39px; right: 0; padding: 15px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-light); box-shadow: var(--shadow-lg); z-index: 8; animation: modal-in .16s ease both; }
.appearance-row { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 750; }
.appearance-row.font-row { padding: 7px 0; }
.appearance-row select { width: 126px; height: 31px; padding: 0 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font-size: 9px; }
.size-stepper { display: flex; align-items: center; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.size-stepper button { min-width: 29px; height: 25px; padding: 0 8px; color: var(--muted); border: 0; border-radius: 999px; background: transparent; font-size: 9px; font-weight: 800; }
.size-stepper output { min-width: 27px; color: var(--ink); text-align: center; font-family: var(--mono); font-size: 8px; }
.reader-theme-switch { display: flex; align-items: center; flex: none; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.45); }
.reader-theme-switch button { min-width: 56px; height: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; color: var(--muted); border: 0; border-radius: 999px; background: transparent; font-size: 8px; font-weight: 800; letter-spacing: .02em; }
.reader-theme-switch button span { font-size: 11px; line-height: 1; }
.reader-theme-switch button:hover { color: var(--forest); }
.reader-theme-switch button.active { color: #fff; background: var(--forest); box-shadow: 0 3px 10px rgba(24,84,61,.18); }
.reader-appearance-panel > small { display: block; margin-top: 10px; color: var(--muted); font-size: 7px; line-height: 1.45; }
.reader-frame-wrap { flex: 1; position: relative; overflow: hidden; padding: 22px 26px 0; }
.paper-shadow { position: absolute; inset: 42px 46px -10px; background: rgba(53,45,34,.15); filter: blur(24px); }
#readerFrame { width: 100%; height: 100%; position: relative; border: 1px solid rgba(24,35,29,.09); border-bottom: 0; background: #fff; box-shadow: 0 18px 45px rgba(46,40,31,.12); }
.reader-page-navigation { display: none; }

.reading-stage.reader-expanded { height: 100dvh; position: fixed; inset: 0; background: var(--paper-deep); z-index: 90; animation: reader-open .24s ease both; }
.reader-expanded .reader-toolbar { min-height: 76px; padding: 10px clamp(18px, 4vw, 64px); background: color-mix(in srgb, var(--paper-light) 94%, transparent); box-shadow: 0 1px 0 var(--line); }
.reader-expanded .reader-toolbar h2 { max-width: min(43vw, 760px); }
.reader-expanded .reader-frame-wrap { padding: 18px clamp(18px, 7vw, 130px) 74px; }
.reader-expanded .paper-shadow { inset: 45px 10vw 54px; opacity: .65; }
.reader-expanded #readerFrame { border: 1px solid var(--line); border-radius: 3px; background: var(--paper-light); box-shadow: 0 24px 70px rgba(20,24,21,.22); }
.reader-expanded .reader-page-navigation { height: 48px; position: absolute; right: clamp(18px, 7vw, 130px); bottom: 14px; left: clamp(18px, 7vw, 130px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; color: var(--muted); z-index: 4; }
.reader-page-navigation button { min-width: 96px; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; background: var(--paper-light); font-size: 9px; font-weight: 800; }
.reader-page-navigation button:first-child { justify-self: start; }
.reader-page-navigation button:last-child { justify-self: end; }
.reader-page-navigation button:hover:not(:disabled) { color: #fff; border-color: var(--forest); background: var(--forest); }
.reader-page-navigation button:disabled { cursor: not-allowed; opacity: .32; }
.reader-page-navigation > span { font-family: var(--mono); font-size: 8px; letter-spacing: .03em; }

.translation-desk { overflow-y: auto; padding: 15px; border-left: 1px solid var(--line); background: #efeae0; }
.desk-card { margin-bottom: 11px; padding: 17px; border: 1px solid var(--line); border-radius: 4px; background: rgba(251,250,246,.9); box-shadow: 0 4px 14px rgba(35,31,24,.035); }
.desk-card-heading,
.status-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.desk-card h2 { margin: 6px 0 0; font-family: var(--display); font-size: 21px; font-weight: 550; }
.desk-card h3 { margin: 5px 0 0; font-family: var(--display); font-size: 17px; font-weight: 550; }
.ready-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--forest); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.ready-dot i { width: 6px; height: 6px; border-radius: 50%; background: #48a979; }
.field-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 9px; margin-top: 17px; }
.field-label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.field-label select { width: 100%; height: 39px; padding: 0 28px 0 10px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; font-size: 10px; font-weight: 650; text-transform: none; }
.field-label select.language-target-select { font-size: 10px; letter-spacing: .01em; text-overflow: ellipsis; }
.field-label select.language-target-select option { font-size: 12px; }
.edition-preview { margin-top: 15px; padding: 12px; border: 1px solid var(--line); background: #f4f1e9; }
.edition-preview > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.edition-preview > div { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; gap: 0 8px; padding: 6px 0; }
.edition-preview i { grid-row: 1 / 3; width: 25px; height: 30px; display: grid; place-items: center; color: var(--forest); border: 1px solid rgba(24,84,61,.3); background: var(--forest-soft); font-family: var(--mono); font-size: 7px; font-style: normal; font-weight: 800; }
.edition-preview b { font-size: 9px; }
.edition-preview small { color: var(--muted); font-size: 8px; }
.setup-actions { display: grid; grid-template-columns: .9fr 1.1fr; gap: 8px; margin-top: 14px; }
.setup-actions button { padding: 0 10px; font-size: 10px; }
.status-badge,
.muted-pill { padding: 5px 7px; border-radius: 999px; font-size: 7px; font-weight: 850; letter-spacing: .06em; }
.status-badge.ready { color: var(--forest); background: var(--forest-soft); }
.status-badge.running { color: #83581c; background: #f4e6c9; }
.status-badge.success { color: var(--forest); background: var(--forest-soft); }
.status-badge.failed { color: var(--red); background: #f4ded9; }
.muted-pill { color: var(--muted); border: 1px solid var(--line); }
.progress-track { height: 5px; margin: 18px 0 9px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest), #5d896b); transition: width .35s ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; }
.progress-meta strong { color: var(--forest); font-family: var(--mono); font-size: 8px; }
.job-counts { margin-top: 9px; color: var(--ink-soft); font-size: 9px; }
.checkpoint-status { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 10px; color: var(--forest); border-top: 1px solid var(--line); font-size: 8px; font-weight: 700; letter-spacing: .02em; }
.checkpoint-status i { width: 17px; height: 17px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--forest); font-style: normal; font-size: 9px; }
.checkpoint-status.paused { color: #78551e; }
.checkpoint-status.paused i { background: #c99137; }
.muted { margin: 10px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.download-card { border-color: rgba(24,84,61,.28); background: #f7f4ec; }
.download-intro { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.glossary-list { max-height: 215px; overflow-y: auto; }
.glossary-item { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 9px; }
.glossary-item i { color: var(--rust); font-style: normal; }
.empty-state { padding: 8px 0; color: var(--muted); font-size: 9px; }
.report-card { border-color: rgba(24,84,61,.28); }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 14px; }
.report-item { min-width: 0; padding: 8px 3px; text-align: center; border-right: 1px solid var(--line); }
.report-item:last-child { border-right: 0; }
.report-item strong { display: block; font-family: var(--display); font-size: 17px; }
.report-item span { display: block; color: var(--muted); font-size: 6px; line-height: 1.2; text-transform: uppercase; }
.quality-notice { margin-top: 12px; padding: 9px 10px; color: var(--forest); border: 1px solid rgba(24,84,61,.18); background: var(--forest-soft); font-size: 9px; line-height: 1.45; }
.quality-notice.warning { color: #78551e; border-color: rgba(201,145,55,.28); background: rgba(201,145,55,.1); }
.download-stack { display: grid; gap: 7px; margin-top: 13px; }
.download-link { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 3px; background: #fff; transition: border-color .16s ease, transform .16s ease; }
.download-link:hover { border-color: var(--forest); transform: translateX(2px); }
.download-icon { width: 30px; height: 34px; display: grid; place-items: center; color: var(--forest); border: 1px solid rgba(24,84,61,.26); background: var(--forest-soft); font-family: var(--mono); font-size: 7px; font-weight: 850; }
.download-link > span:nth-child(2) { display: grid; gap: 2px; }
.download-link strong { color: var(--ink); font-size: 10px; font-weight: 850; }
.download-link small { color: var(--muted); font-size: 7px; }
.download-cta { display: inline-flex !important; align-items: center; gap: 5px; color: var(--forest); font-size: 9px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.download-cta b { color: inherit; font-size: 17px; line-height: 1; }
.library-save-button { width: 100%; min-height: 40px; margin-top: 14px; color: #fff; border-color: var(--forest); background: var(--forest); font-size: 10px; font-weight: 850; }
.library-save-button:hover:not(:disabled) { color: #fff; border-color: var(--forest-dark); background: var(--forest-dark); }

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .studio-header,
html[data-theme="dark"] .library-header { background: rgba(20,24,22,.92); }
html[data-theme="dark"] .landing-body { background: radial-gradient(circle at 82% 13%, rgba(216,165,83,.09), transparent 23%), var(--paper); }
html[data-theme="dark"] .workspace-body { background: #101311; }
html[data-theme="dark"] .chapter-rail { background: #171c19; }
html[data-theme="dark"] .reading-stage { background: #101411; }
html[data-theme="dark"] .reader-toolbar { background: rgba(27,32,29,.94); }
html[data-theme="dark"] .reader-mode-switch,
html[data-theme="dark"] .reader-action,
html[data-theme="dark"] .reader-meta > span { background: rgba(255,255,255,.045); }
html[data-theme="dark"] .translation-desk { background: #121714; }
html[data-theme="dark"] .desk-card,
html[data-theme="dark"] .recent-book-card,
html[data-theme="dark"] .history-empty,
html[data-theme="dark"] .library-stats,
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .library-record,
html[data-theme="dark"] .library-empty { background: rgba(28,34,30,.88); }
html[data-theme="dark"] .upload-state,
html[data-theme="dark"] .edition-preview,
html[data-theme="dark"] .download-card { background: #1b211d; }
html[data-theme="dark"] .field-label select,
html[data-theme="dark"] .download-link,
html[data-theme="dark"] .file-pill { color: var(--ink); background: #202622; }
html[data-theme="dark"] .secondary-button { background: rgba(255,255,255,.045); }
html[data-theme="dark"] .secondary-button:hover:not(:disabled) { background: rgba(255,255,255,.09); }
html[data-theme="dark"] .error-box { color: #f1b0aa; background: rgba(169,65,54,.16); }
html[data-theme="dark"] #readerFrame { background: #191c1a; box-shadow: 0 18px 50px rgba(0,0,0,.34); }
html[data-theme="dark"] .paper-shadow { background: rgba(0,0,0,.42); }

/* Modal and messages */
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(17,28,22,.64); backdrop-filter: blur(8px); z-index: 100; }
.modal-card,
.confirm-card { width: min(920px, 96vw); max-height: 88vh; overflow-y: auto; padding: 30px; border: 1px solid rgba(255,255,255,.28); border-radius: 5px; background: var(--paper-light); box-shadow: 0 36px 100px rgba(16,28,21,.3); animation: modal-in .22s ease both; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.modal-header h2,
.confirm-card h2 { margin: 7px 0 0; font-family: var(--display); font-size: 32px; font-weight: 500; letter-spacing: -.03em; }
.modal-header p,
.confirm-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.icon-button { width: 38px; height: 38px; display: grid; flex: none; place-items: center; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 22px; font-weight: 300; }
.icon-button:hover { color: var(--red); border-color: rgba(169,65,54,.35); }
.preview-results { display: grid; gap: 0; margin-top: 12px; }
.preview-pair { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.preview-index { padding-top: 23px; color: var(--rust); font-family: var(--mono); font-size: 9px; }
.preview-cell { padding-right: 8px; }
.preview-cell.translation { padding-left: 18px; border-left: 1px solid var(--line); }
.preview-label { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.preview-cell p { margin: 8px 0 0; font-family: var(--display); font-size: 15px; line-height: 1.55; }
.preview-cell.translation p { color: var(--forest-dark); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.mode-note { margin-top: 14px; padding: 10px 12px; color: #72501d; border: 1px solid rgba(201,145,55,.3); background: #f6eacb; font-size: 10px; }
.confirm-card { width: min(470px, 94vw); }
.confirm-card .modal-actions { padding-top: 18px; border-top: 1px solid var(--line); }
.auth-card { width: min(430px, 94vw); position: relative; padding: 30px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-light); box-shadow: var(--shadow-lg); animation: modal-in .22s ease both; }
.auth-card > .auth-close { position: absolute; top: 20px; right: 20px; }
.auth-card h2 { margin: 12px 0 6px; font-family: var(--display); font-size: 31px; font-weight: 500; letter-spacing: -.035em; }
.auth-subtitle { margin: 0 38px 24px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.google-auth-button { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 3px; background: transparent; font-size: 11px; font-weight: 800; }
.google-auth-button:hover { border-color: var(--forest); background: var(--forest-soft); }
.google-mark { width: 22px; height: 22px; display: grid; place-items: center; color: #4285f4; border: 1px solid var(--line); border-radius: 50%; font-family: Arial, sans-serif; font-weight: 800; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.auth-form input { width: 100%; height: 43px; padding: 0 12px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 3px; outline: 0; background: transparent; font-size: 12px; }
.auth-form input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
.auth-submit { width: 100%; margin-top: 5px; }
.auth-mode-toggle { width: 100%; margin-top: 14px; padding: 4px; color: var(--forest); border: 0; background: transparent; font-size: 10px; font-weight: 800; }
.auth-mode-toggle:hover { text-decoration: underline; }
.auth-message { margin: 14px 0 0; padding: 10px 11px; color: var(--forest); border: 1px solid rgba(24,84,61,.22); background: var(--forest-soft); font-size: 10px; line-height: 1.45; }
.auth-session { display: grid; gap: 14px; }
.auth-session-email { margin: 0; color: var(--ink); font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.auth-signout { width: 100%; }
.toast { max-width: min(440px, calc(100vw - 30px)); position: fixed; right: 20px; bottom: 20px; padding: 13px 16px; color: #fff; border-radius: 4px; background: var(--forest-dark); box-shadow: var(--shadow-lg); font-size: 11px; line-height: 1.45; z-index: 120; animation: toast-in .25s ease both; }
.toast.error { background: var(--red); }
.fatal-state { min-height: 100vh; display: grid; place-content: center; gap: 12px; padding: 30px; text-align: center; }
.fatal-state span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.fatal-state strong { font-family: var(--display); font-size: 26px; }
.fatal-state a { color: var(--forest); text-decoration: underline; }

/* Library */
.library-body { background: var(--paper); }
.library-header { background: rgba(243,239,230,.94); }
.library-main { max-width: 1380px; margin: 0 auto; padding: 72px clamp(24px, 5vw, 72px) 120px; }
.library-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 50px; padding-bottom: 44px; border-bottom: 1px solid var(--line-strong); }
.library-hero h1 { margin: 10px 0 8px; font-family: var(--display); font-size: clamp(48px, 6vw, 78px); font-weight: 500; letter-spacing: -.055em; }
.library-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.library-stats { display: grid; grid-template-columns: repeat(3, 104px); border: 1px solid var(--line); background: rgba(251,250,246,.6); }
.library-stats > div { padding: 17px; text-align: center; border-right: 1px solid var(--line); }
.library-stats > div:last-child { border-right: 0; }
.library-stats strong { display: block; font-family: var(--display); font-size: 28px; font-weight: 500; }
.library-stats span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0; }
.search-field { width: min(420px, 50vw); height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 3px; background: rgba(251,250,246,.66); }
.search-field svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.search-field input { width: 100%; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 11px; }
.search-field input::placeholder { color: #999c96; }
.filter-group { display: flex; gap: 4px; }
.filter-button { min-height: 34px; padding: 0 12px; color: var(--muted); border: 1px solid transparent; border-radius: 999px; background: transparent; font-size: 9px; font-weight: 750; }
.filter-button:hover { color: var(--ink); }
.filter-button.active { color: var(--forest); border-color: rgba(24,84,61,.22); background: var(--forest-soft); }
.library-list { display: grid; gap: 10px; }
.library-loading { min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.library-record { display: grid; grid-template-columns: 94px minmax(220px, 1fr) minmax(280px, .9fr) auto; gap: 24px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: rgba(251,250,246,.76); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.library-record:hover { border-color: var(--line-strong); background: var(--paper-light); transform: translateY(-1px); }
.library-cover { width: 78px; height: 108px; margin: 0 auto; }
.library-book-info { min-width: 0; }
.library-book-info h2 { margin: 9px 0 3px; overflow: hidden; font-family: var(--display); font-size: 22px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.library-book-info h2 a:hover { color: var(--forest); }
.record-author { margin: 0; color: var(--muted); font-size: 10px; }
.record-details { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 13px; color: var(--ink-soft); font-size: 9px; }
.record-details span + span { position: relative; }
.record-details span + span::before { content: "·"; position: absolute; left: -9px; color: #a9aca6; }
.record-date { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; }
.record-files { display: grid; gap: 6px; }
.record-column-label { margin-bottom: 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.file-pill { display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.file-pill:hover { border-color: var(--forest); }
.file-pill i { width: 27px; height: 30px; display: grid; place-items: center; color: var(--forest); background: var(--forest-soft); font-family: var(--mono); font-size: 7px; font-style: normal; font-weight: 850; }
.file-pill > span { min-width: 0; display: grid; gap: 1px; }
.file-pill strong { font-size: 9px; }
.file-pill small { color: var(--muted); font-size: 7px; }
.file-pill b { color: var(--forest); font-size: 14px; }
.no-files { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; color: var(--muted); border: 1px dashed var(--line-strong); font-size: 9px; }
.no-files a { color: var(--forest); font-weight: 750; }
.record-actions { display: flex; gap: 7px; align-items: center; }
.record-actions .secondary-button { min-height: 38px; padding: 0 13px; font-size: 9px; white-space: nowrap; }
.record-actions .icon-button { width: 36px; height: 36px; font-size: 19px; }
.library-empty { min-height: 390px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px; text-align: center; border: 1px dashed var(--line-strong); background: rgba(251,250,246,.5); }
.library-empty h2 { margin: 20px 0 7px; font-family: var(--display); font-size: 30px; font-weight: 500; }
.library-empty p { max-width: 460px; margin: 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-book { width: 70px; height: 55px; display: flex; gap: 3px; align-items: end; justify-content: center; color: var(--forest); }
.empty-book i { width: 29px; height: 48px; display: block; border: 1px solid currentColor; transform: skewY(-7deg); }
.empty-book i + i { transform: skewY(7deg); }

/* Legal pages */
.legal-body { background: var(--paper); }
.legal-header { background: rgba(243,239,230,.94); }
.legal-main { max-width: 1120px; margin: 0 auto; padding: 82px clamp(24px, 6vw, 80px) 92px; }
.legal-intro { max-width: 740px; padding-bottom: 38px; border-bottom: 1px solid var(--line-strong); }
.legal-intro h1 { margin: 12px 0 10px; font-family: var(--display); font-size: clamp(48px, 7vw, 82px); font-weight: 500; letter-spacing: -.06em; }
.legal-intro p { max-width: 630px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.legal-updated { display: block; margin-top: 22px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; }
.legal-document { max-width: 900px; }
.legal-document section { display: grid; grid-template-columns: 58px 1fr; gap: 26px; padding: 31px 0; border-bottom: 1px solid var(--line); }
.legal-number { padding-top: 4px; color: var(--rust); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.legal-document h2 { margin: 0 0 9px; font-family: var(--display); font-size: 27px; font-weight: 550; letter-spacing: -.025em; }
.legal-document p { max-width: 760px; margin: 0 0 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.85; }
.legal-document p:last-child { margin-bottom: 0; }
.legal-callout { max-width: 900px; display: flex; gap: 18px; margin-top: 34px; padding: 18px 20px; color: var(--forest); border-left: 4px solid var(--forest); background: var(--forest-soft); font-size: 11px; line-height: 1.6; }
.legal-callout strong { flex: none; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.legal-callout span { color: var(--ink-soft); }
html[data-theme="dark"] .legal-header { background: rgba(20,24,22,.92); }
html[data-theme="dark"] .legal-document p { color: var(--ink-soft); }
html[data-theme="dark"] .legal-callout span { color: var(--ink-soft); }

@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes check-in { from { opacity: 0; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes book-pulse { 0%, 100% { opacity: .42; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes soft-pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1280px) {
  .studio-shell { grid-template-columns: 250px minmax(440px, 1fr) 330px; }
  .reader-mode { padding: 0 8px; font-size: 7px; }
  .recent-book-card { grid-template-columns: 96px 1fr; }
  .library-record { grid-template-columns: 84px minmax(190px, 1fr) minmax(240px, .9fr) auto; gap: 16px; }
}

@media (max-width: 1060px) {
  .landing-hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy-block { max-width: 820px; }
  .upload-column { max-width: 700px; }
  .recent-books { grid-template-columns: 1fr; }
  .recent-book-card { min-height: 220px; grid-template-columns: 120px 1fr; }
  .how-section { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-shell { height: calc(100vh - 70px); grid-template-columns: 240px minmax(440px, 1fr); grid-template-rows: 1fr; }
  .translation-desk { position: fixed; right: 0; bottom: 0; width: 350px; max-height: calc(100vh - 90px); border-top: 1px solid var(--line); box-shadow: -18px 0 45px rgba(40,35,27,.13); z-index: 25; }
  .reader-frame-wrap { padding-right: 370px; }
  .reading-stage:not(.reader-expanded) .reader-action.expand { width: 38px; height: 38px; position: fixed; top: 82px; right: 366px; border-color: var(--line-strong); background: var(--paper-light); box-shadow: var(--shadow-sm); z-index: 35; }
  .reading-stage:not(.reader-expanded) .reader-action.expand svg { width: 18px; height: 18px; }
  .library-record { grid-template-columns: 82px 1fr auto; }
  .record-files { grid-column: 2 / 3; }
  .record-actions { grid-column: 3; grid-row: 1 / 3; flex-direction: column; }
}

@media (max-width: 760px) {
  .site-header,
  .studio-header { height: 64px; padding: 0 16px; }
  .brand-copy small,
  .site-nav > a:not(.nav-cta),
  .studio-breadcrumb,
  .studio-nav > a:not(.nav-cta) { display: none; }
  .site-nav,
  .studio-nav { gap: 8px; }
  .language-picker select { min-width: 76px; padding-left: 9px; padding-right: 20px; font-size: 9px; }
  .nav-cta { min-height: 38px; padding: 0 14px; font-size: 11px; }
  .auth-trigger { max-width: 110px; min-height: 32px; padding: 0 9px; }
  .landing-main { padding: 48px 18px 90px; }
  .landing-hero { gap: 55px; }
  .home-proof { grid-template-columns: 1fr; gap: 18px; }
  .home-proof-intro strong { max-width: none; }
  .home-proof-stats > div { padding: 3px 10px; }
  .hero-copy-block h1 { font-size: clamp(48px, 15vw, 70px); }
  .promise-list span { grid-template-columns: 1fr; gap: 3px; }
  .upload-card { padding: 22px 18px 20px 25px; }
  .drop-zone { min-height: 315px; padding: 28px 14px; }
  .folio-note { display: grid; }
  .recent-section,
  .how-section { padding-top: 84px; }
  .section-heading.horizontal { align-items: flex-start; flex-direction: column; }
  .recent-book-card { grid-template-columns: 82px 1fr; min-height: 190px; padding: 15px; }
  .recent-cover { height: 135px; }
  .record-meta span:nth-child(2) { display: none; }
  .steps-grid article { grid-template-columns: 40px 1fr; }
  .reading-benefits, .faq-section { grid-template-columns: 1fr; gap: 36px; }
  .benefit-grid, .audience-grid { grid-template-columns: 1fr; }
  .benefit-grid article { min-height: 0; }
  .benefit-mark { margin-bottom: 22px; }
  .audience-grid article,
  .audience-grid article + article { padding: 20px 0; border-left: 0; }
  .audience-note { padding-bottom: 0; }
  .pricing-section { padding-top: 84px; }
  .pricing-grid { grid-template-columns: 1fr; gap: 12px; }
  .price-card, .price-card.featured { min-height: 0; transform: none; }
  .price-card .primary-button, .price-card .secondary-button { margin-top: 20px; }
  .pricing-footnote { flex-direction: column; gap: 5px; }
  .site-footer { padding: 24px 18px; }

  .workspace-body { overflow: auto; }
  .studio-shell { height: auto; display: flex; flex-direction: column; }
  .chapter-rail { max-height: 340px; border-right: 0; border-bottom: 1px solid var(--line); }
  .book-identity { grid-template-columns: 54px 1fr; }
  .cover-shell { width: 54px; height: 73px; }
  .chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reading-stage { min-height: 650px; }
  .reader-toolbar { padding: 14px 17px; }
  .reader-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .reader-tools { width: 100%; align-items: flex-start; }
  .reader-tool-row { width: 100%; }
  .reader-mode-switch { max-width: 100%; }
  .reader-mode { flex: 1; }
  .reader-action-group { margin-left: auto; }
  .reader-appearance-panel { right: auto; left: 0; }
  .reader-meta { display: none; }
  .reader-frame-wrap { min-height: 560px; padding: 14px 14px 0; }
  .reading-stage:not(.reader-expanded) .reader-action.expand { width: 31px; height: 31px; position: static; box-shadow: none; }
  .reader-expanded .reader-toolbar { padding: 10px 14px; }
  .reader-expanded .reader-heading { display: none; }
  .reader-expanded .reader-tools { align-items: stretch; }
  .reader-expanded .reader-frame-wrap { min-height: 0; padding: 8px 8px 66px; }
  .reader-expanded .reader-page-navigation { right: 10px; bottom: 9px; left: 10px; }
  .reader-page-navigation button { min-width: 78px; padding: 0 10px; }
  .reader-page-navigation > span { max-width: 42vw; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .translation-desk { width: auto; max-height: none; position: static; padding: 14px; border-left: 0; box-shadow: none; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .preview-pair { grid-template-columns: 24px 1fr; }
  .preview-cell.translation { grid-column: 2; padding: 13px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .modal-card { padding: 22px 18px; }

  .library-main { padding: 48px 16px 80px; }
  .library-hero { align-items: flex-start; flex-direction: column; }
  .library-stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .filter-group { overflow-x: auto; }
  .library-record { grid-template-columns: 68px 1fr; gap: 14px; padding: 15px; }
  .library-cover { width: 62px; height: 88px; }
  .record-files { grid-column: 1 / -1; }
  .record-actions { grid-column: 1 / -1; grid-row: auto; flex-direction: row; }
  .record-actions .secondary-button { flex: 1; }
}

@keyframes reader-open { from { opacity: 0; transform: scale(.992); } to { opacity: 1; transform: scale(1); } }

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