/* Electrobooks — warm paper, clay and walnut. Lightweight custom design system, no external fonts. */
:root {
  color-scheme: light;
  --bg: #f7f1e8;
  --surface: #fffdf8;
  --surface-2: #f3eadc;
  --surface-3: #eadcc8;
  --ink: #2a211b;
  --ink-soft: #4b3c31;
  --muted: #7a6a5b;
  --line: #e6dbcb;
  --line-strong: #d8c7b2;
  --clay: #8c4a2f;
  --clay-2: #a85c3a;
  --sand: #e8c99a;
  --sand-soft: #f8ecd8;
  --coral: #c05a3e;
  --coral-soft: #faeadf;
  --amber: #b77a2b;
  --amber-soft: #fbf0d9;
  --gold: var(--amber);
  --paper: var(--surface);
  --walnut: #8b5e3c;
  --walnut-soft: #f2e6da;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 14px 38px rgba(74, 48, 32, .08);
  --shadow-soft: 0 4px 16px rgba(74, 48, 32, .06);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(232, 201, 154, .20), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(139, 94, 60, .08), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1;
}
::selection { background: var(--sand); color: var(--ink); }
a { color: var(--clay); text-decoration: none; }
a:hover { color: var(--clay-2); }
h1, h2, h3, h4 { margin: 0 0 .6em; color: var(--ink); line-height: 1.14; letter-spacing: -.025em; font-weight: 680; }
h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin: .35rem 0; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
code, pre, .json { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .35em; font-size: .88em; }
pre, .json { background: #2b211a; color: #f6e7cf; padding: 18px; border-radius: var(--radius-sm); overflow: auto; font-size: .84rem; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon use { pointer-events: none; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.section { padding: 72px 0; }
.section.tight { padding: 44px 0; }
.section.compact { padding: 28px 0; }
.narrow { max-width: 680px; }
.muted { color: var(--muted); }
.eyebrow, .section-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--clay); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.eyebrow::before, .section-kicker::before { content: ""; width: 18px; height: 2px; background: var(--sand); border-radius: 2px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head > div { max-width: 720px; }
.section-head p { color: var(--muted); margin: 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 241, 232, .84); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(216, 199, 178, .72); }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 26px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 760; letter-spacing: -.02em; font-size: 1.08rem; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--clay), #6d3524); box-shadow: inset 0 1px 0 rgba(255, 250, 242, .18), 0 6px 14px rgba(140, 74, 47, .18); }
.brand-mark .icon { width: 21px; height: 21px; stroke-width: 2; }
.nav { display: flex; align-items: center; gap: 3px; flex: 1; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: 10px; color: var(--ink-soft); font-size: .9rem; font-weight: 580; white-space: nowrap; transition: background .18s ease, color .18s ease; }
.nav a .icon { width: 17px; height: 17px; opacity: .78; }
.nav a:hover, .nav a.active { background: var(--surface); color: var(--clay); box-shadow: var(--shadow-soft); }
.nav a.active .icon { opacity: 1; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: 11px; color: var(--ink-soft); }
.icon-button:hover { background: var(--surface); border-color: var(--line); color: var(--clay); }
.user-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .86rem; font-weight: 620; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--sand-soft); color: var(--clay); font-weight: 760; }
.menu-toggle { display: none; }
.hidden-forms { display: inline; margin: 0; }
.toast-stack { padding-top: 14px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); font-size: .92rem; }
.toast.success { border-color: #e8cfa4; background: #f8efdc; }
.toast.error { border-color: #f0c1b7; background: #fbeee7; }
.toast > span { flex: 1; }
.toast button { border: 0; background: transparent; color: var(--muted); padding: 2px; display: grid; place-items: center; }
.success-list, .error-list { padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; }
.success-list { background: #f8efdc; border: 1px solid #e8cfa4; }
.error-list { background: #fbeee7; border: 1px solid #f0c1b7; }

/* Buttons and surfaces */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 11px 17px; font-weight: 650; font-size: .93rem; line-height: 1.15; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--clay); color: white; box-shadow: 0 8px 20px rgba(140, 74, 47, .18); }
.btn-primary:hover { background: #733d28; color: white; box-shadow: 0 10px 24px rgba(140, 74, 47, .24); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { color: var(--clay); border-color: var(--clay); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--clay); }
.btn-coral { background: var(--coral); color: white; }
.btn-coral:hover { background: #ab4d35; color: white; }
.btn-sm { padding: 8px 12px; font-size: .84rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.card, .panel, .glass-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.card { padding: 22px; }
.panel { padding: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title { font-weight: 700; }
.card-link { display: block; color: inherit; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.card-link:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); color: inherit; }
.notice { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 15px 17px; color: var(--ink-soft); }
.notice strong { color: var(--ink); }
.notice.warn { background: var(--amber-soft); border-color: #e8cf9e; }
.notice.danger { background: var(--coral-soft); border-color: #ecc3b6; }
.notice.demo { background: var(--walnut-soft); border-color: #e2d2c2; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 9px; font-size: .72rem; font-weight: 720; letter-spacing: .02em; background: var(--sand-soft); color: var(--clay); border: 1px solid #e4d0ad; }
.badge.gray { background: var(--surface-2); color: var(--ink-soft); border-color: var(--line); }
.badge.coral { background: var(--coral-soft); color: #8f3e2c; border-color: #ecc3b6; }
.badge.gold { background: var(--amber-soft); color: #8a5a1e; border-color: #e8cf9e; }
.badge.outline { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.status-pill { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--ink-soft); }
.status-pill.ai_proposed, .status-pill.awaiting_review { background: var(--walnut-soft); color: #7a523c; }
.status-pill.confirmed, .status-pill.verified { background: var(--sand-soft); color: var(--clay); }
.status-pill.rejected, .status-pill.conflict { background: var(--coral-soft); color: #8f3e2c; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); font-size: .78rem; font-weight: 600; }
.chip .icon { width: 14px; height: 14px; }

/* Layout helpers */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; align-items: center; }
.stack { display: grid; gap: 14px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex.between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.stat b { display: block; font-size: 1.8rem; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: .84rem; }
.empty { text-align: center; color: var(--muted); padding: 36px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 250, 242, .5); }
.empty .icon { width: 28px; height: 28px; color: var(--clay); margin-bottom: 8px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 84px 0 70px; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(247, 241, 232, .97) 0%, rgba(247, 241, 232, .88) 42%, rgba(247, 241, 232, .20) 100%), url('/static/art/hero.webp') center/cover no-repeat; z-index: -2; }
.hero::after { content: ""; position: absolute; width: 480px; height: 480px; right: -130px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(232, 201, 154, .35), transparent 70%); z-index: -1; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 46px; align-items: center; }
.hero h1 { max-width: 760px; margin-bottom: 20px; }
.hero-lead { font-size: 1.14rem; color: var(--ink-soft); max-width: 610px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 34px; }
.hero-stats div { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.hero-stats .icon { width: 18px; height: 18px; color: var(--clay); }
.glass-card { padding: 22px; background: rgba(255, 250, 242, .78); backdrop-filter: blur(14px); border-color: rgba(255, 250, 242, .9); box-shadow: 0 26px 60px rgba(74, 48, 32, .13); }
.mini-progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mini-progress-head strong { font-size: .92rem; }
.version-track { display: flex; align-items: center; gap: 6px; margin: 20px 0 4px; }
.version-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .72rem; font-weight: 700; }
.version-dot.active { background: var(--clay); color: white; border-color: var(--clay); }
.version-line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--sand), var(--line)); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.icon-tile { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--sand-soft); color: var(--clay); margin-bottom: 16px; }
.icon-tile .icon { width: 22px; height: 22px; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; width: var(--progress, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--clay), #d39a58); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.progress-label { display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; color: var(--muted); margin-bottom: 7px; }
.progress-label strong { color: var(--ink); }
.editor-progress { margin: 14px 0 20px; }

/* Catalog and book cards */
.catalog-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 26px; margin-bottom: 30px; }
.catalog-hero p { color: var(--muted); max-width: 560px; margin: 0; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.book-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.book-cover { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(140deg, #6d3524, #8c4a2f 55%, #a85c3a); overflow: hidden; }
.book-cover.variant-1 { background-image: linear-gradient(180deg, rgba(60, 38, 26, .06), rgba(60, 38, 26, .55)), url('/static/art/cover.webp'); background-size: cover; background-position: center; }
.book-cover.variant-2 { background: linear-gradient(145deg, #5a3a2a, #8b5e3c 60%, #d9ae7f); }
.book-cover.variant-3 { background: linear-gradient(145deg, #6d3524, #c05a3e 60%, #e7b49a); }
.book-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(50, 32, 22, .68)); }
.cover-lines { position: absolute; inset: 22px 26px; border-left: 1px solid rgba(255, 250, 242, .22); border-right: 1px solid rgba(255, 250, 242, .14); opacity: .55; }
.cover-title { position: absolute; left: 24px; right: 24px; bottom: 20px; z-index: 1; color: white; font-family: var(--serif); font-size: 1.5rem; line-height: 1.15; letter-spacing: -.02em; }
.cover-badge { position: absolute; top: 14px; left: 14px; z-index: 1; background: rgba(255, 250, 242, .88); color: var(--ink); border: 0; backdrop-filter: blur(8px); }
.book-body { padding: 20px; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.book-body h3 { font-family: var(--serif); font-size: 1.24rem; margin: 0; }
.book-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .82rem; }
.book-excerpt { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.book-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.price-tag { font-weight: 760; color: var(--ink); }
.price-tag small { color: var(--muted); font-weight: 500; }
.download-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.download-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 10px; background: var(--surface-2); color: var(--ink-soft); font-size: .8rem; font-weight: 650; border: 1px solid var(--line); }
.download-btn:hover { background: var(--sand-soft); color: var(--clay); }
.download-btn .icon { width: 15px; height: 15px; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.price-card { position: relative; padding: 26px; display: flex; flex-direction: column; }
.price-card.popular { border-color: var(--clay); box-shadow: 0 18px 44px rgba(140, 74, 47, .14); }
.price-card.popular::before { content: "Выбирают чаще"; position: absolute; top: -12px; left: 24px; background: var(--clay); color: white; border-radius: 999px; padding: 5px 11px; font-size: .72rem; font-weight: 720; }
.price-card h3 { font-size: 1.3rem; }
.price-value { font-size: 2.5rem; font-weight: 760; letter-spacing: -.05em; margin: 10px 0 2px; }
.price-value span { font-size: .9rem; color: var(--muted); font-weight: 550; letter-spacing: 0; }
.price-note { color: var(--muted); font-size: .85rem; min-height: 42px; }
.price-features { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; gap: 10px; flex: 1; }
.price-features li { display: flex; gap: 9px; align-items: flex-start; color: var(--ink-soft); font-size: .9rem; margin: 0; }
.price-features .icon { width: 17px; height: 17px; color: var(--clay); margin-top: 3px; }
.telegram-cta { display: flex; align-items: center; gap: 16px; padding: 24px; border-radius: var(--radius); background: linear-gradient(120deg, #6d3524, #8c4a2f); color: white; margin-top: 26px; }
.telegram-cta .icon { width: 30px; height: 30px; color: var(--sand); }
.telegram-cta h3 { color: white; margin: 0 0 4px; }
.telegram-cta p { color: rgba(255, 250, 242, .78); margin: 0; flex: 1; }
.telegram-cta .btn { background: white; color: var(--clay); }
.telegram-cta .btn:hover { color: var(--clay); background: #fff7e8; }

/* Publishing, platforms and monetization */
.platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.platform-card { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.platform-card .icon { width: 26px; height: 26px; color: var(--clay); margin-bottom: 14px; }
.platform-card .price { font-size: 1.6rem; font-weight: 760; letter-spacing: -.03em; margin: 12px 0 2px; }
.platform-card small { color: var(--muted); }
.monetization-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: start; }
.payout-card { padding: 26px; }
.payout-steps { display: grid; gap: 14px; margin-top: 20px; }
.payout-step { display: flex; gap: 13px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.payout-step b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--clay); color: white; font-size: .8rem; flex: 0 0 auto; }
.payout-step p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.step { position: relative; padding: 20px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.step-number { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--sand-soft); color: var(--clay); font-weight: 760; margin-bottom: 12px; }
.step h4 { font-size: .96rem; margin-bottom: 5px; }
.step p { color: var(--muted); font-size: .84rem; margin: 0; }
.faq-list { display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 15px 18px; }
.faq-item summary { cursor: pointer; font-weight: 680; }
.faq-item p { color: var(--muted); margin: 10px 0 0; font-size: .9rem; }

/* Forms and editor */
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { font-weight: 650; font-size: .88rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="email"], textarea, select { width: 100%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 11px 13px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, textarea:focus, select:focus { border-color: var(--clay-2); box-shadow: 0 0 0 3px rgba(232, 201, 154, .6); }
textarea { resize: vertical; min-height: 110px; }
.hint { color: var(--muted); font-size: .8rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); }
.check input { margin-top: 4px; accent-color: var(--clay); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.form-card { max-width: 860px; margin: 0 auto; }
.auth-card { max-width: 520px; margin: 0 auto; padding: 36px; }
.auth-card h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 10px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .auth-card { padding: 26px; } }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .84rem; }
.kv dd { margin: 0; word-break: break-word; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { background: var(--surface-2); color: var(--ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.chapter-rail { position: sticky; top: 92px; padding: 18px; }
.chapter-rail-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; color: var(--ink-soft); font-size: .88rem; }
.chapter-rail-item.active { background: var(--sand-soft); color: var(--clay); font-weight: 700; }
.chapter-rail-item .icon { width: 16px; height: 16px; }
.editor-main { min-width: 0; }
.editor-canvas { padding: 0; overflow: hidden; }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tool-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-soft); font-weight: 760; }
.tool-button:hover { background: var(--surface); border-color: var(--line); color: var(--clay); }
.toolbar-separator { width: 1px; height: 22px; background: var(--line-strong); margin: 0 5px; }
.draft-state { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .78rem; }
.draft-dot { width: 7px; height: 7px; border-radius: 50%; background: #c98a55; }
.editor-textarea { width: 100%; min-height: 58vh; border: 0; border-radius: 0; padding: 28px 32px; font-family: var(--serif); font-size: 1.12rem; line-height: 1.85; resize: vertical; box-shadow: none; }
.editor-textarea:focus { box-shadow: inset 0 0 0 2px rgba(232, 201, 154, .7); }
.word-meter { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; background: var(--surface); }
.editor-aside { position: sticky; top: 92px; display: grid; gap: 14px; }
.editor-aside .card { padding: 18px; }
.focus-mode .chapter-rail, .focus-mode .editor-aside { display: none; }
.focus-mode .workspace { grid-template-columns: 1fr; }
.editor { min-height: 420px; font-family: var(--serif); font-size: 1.05rem; line-height: 1.75; }
.chapter-body { font-family: var(--serif); font-size: 1.12rem; line-height: 1.85; }
.chapter-body p { margin: 0 0 1.2em; }
.fragment { position: relative; padding-left: 38px; }
.fragment-no { position: absolute; left: 0; top: 4px; color: var(--muted); font: 600 .72rem var(--sans); }
.prose { max-width: 760px; }
.prose h1, .prose h2, .prose h3 { font-family: var(--serif); }
.avatar-sm { width: 22px; height: 22px; font-size: .72rem; }
.forum-meta, .forum-post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .84rem; }
.forum-post-head { margin-bottom: 10px; }
.forum-actions { margin-top: 12px; }
.forum-quote { margin: 10px 0; padding: 6px 0 6px 16px; border-left: 2px solid var(--clay); color: var(--ink-soft); font-family: var(--serif); }
.forum-quote br { line-height: 1.6; }
.avatar-image { object-fit: cover; display: block; }
.avatar-lg { width: 76px; height: 76px; border-radius: 22px; font-size: 2rem; background: linear-gradient(135deg, var(--clay), var(--walnut)); color: #fff; }
.notification-link { position: relative; }
.badge-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--clay); color: #fff; font: 700 .68rem var(--sans); display: grid; place-items: center; }
.avatar-upload { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.report-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: 8px; }
.report-form input { width: 180px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .82rem; }
.thread-subscription { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; font-size: .86rem; }
.reaction-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0 2px; }
.reaction-form { display: inline-flex; margin: 0; }
.reaction-btn, .reaction-count { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink); padding: 5px 10px; font-size: .78rem; line-height: 1.2; }
.reaction-btn { cursor: pointer; }
.reaction-btn.active { background: var(--clay); color: #fffaf2; border-color: var(--clay); }
.reaction-btn span, .reaction-count span { font-weight: 700; }
.feed-item { padding: 18px 20px; }
.feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .82rem; margin-bottom: 8px; }
.feed-item h3 { margin: 0 0 8px; font-size: 1.12rem; }
.search-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.search-form input[type="search"] { flex: 1 1 240px; }
.book-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.project-cover { width: 140px; max-height: 210px; object-fit: cover; border-radius: 8px 16px 8px 8px; box-shadow: 0 10px 24px rgba(80, 48, 28, .16); margin: 14px 0; }
.print-cover { display: block; max-width: 260px; max-height: 390px; margin: 0 auto 26px; object-fit: contain; }
.cover-upload { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--clay); }

/* Secondary pages */
.simple-page { padding: 56px 0 76px; }
.simple-page .page-head { max-width: 780px; margin-bottom: 30px; }
.simple-page h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.simple-content { display: grid; gap: 20px; }
.content-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft); }
.content-card h1, .content-card h2, .content-card h3 { margin-top: 0; }
.error-page { min-height: 52vh; display: grid; place-items: center; padding: 60px 0; }
.error-card { text-align: center; max-width: 540px; padding: 36px; }
.error-code { font-size: 4rem; font-weight: 780; color: var(--clay); letter-spacing: -.06em; }

/* Footer */
.site-footer { margin-top: 40px; padding: 52px 0 24px; background: #2a1d17; color: rgba(255, 250, 242, .74); }
.site-footer .brand { color: white; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 34px; }
.footer-brand p { max-width: 340px; color: rgba(255, 250, 242, .6); font-size: .9rem; margin: 16px 0; }
.site-footer h4 { color: white; font-size: .88rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin: 8px 0; }
.site-footer a:not(.btn) { color: rgba(255, 250, 242, .72); font-size: .88rem; }
.site-footer a:not(.btn):hover { color: var(--sand); }
.telegram-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 11px; background: rgba(232, 201, 154, .10); border: 1px solid rgba(232, 201, 154, .22); color: var(--sand) !important; font-size: .86rem !important; font-weight: 650; }
.footer-bottom { display: flex; justify-content: space-between; gap: 14px; margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(255, 250, 242, .10); color: rgba(255, 250, 242, .48); font-size: .78rem; }

/* Responsive */
@media (max-width: 1080px) {
  .nav a span { display: none; }
  .nav a { padding: 9px; }
  .hero-grid, .monetization-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .editor-aside { grid-column: 1 / -1; position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid, .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-grid, .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .container { width: min(100% - 28px, 1180px); }
  .section { padding: 52px 0; }
  .site-header { position: relative; }
  .header-inner { flex-wrap: wrap; padding: 10px 0; }
  .menu-toggle { display: grid; }
  .nav { order: 3; flex-basis: 100%; display: none; padding: 8px 0 4px; border-top: 1px solid var(--line); }
  .nav.open { display: grid; grid-template-columns: repeat(2, 1fr); }
  .nav a span { display: inline; }
  .header-actions .btn-ghost, .header-actions .user-pill span:not(.avatar) { display: none; }
  .split, .split-even, .grid-2, .grid-3, .pricing-grid, .stat-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .chapter-rail, .editor-aside { position: static; }
  .editor-aside { grid-template-columns: 1fr; }
  .catalog-hero, .section-head, .telegram-cta { align-items: flex-start; flex-direction: column; }
  .hero { padding: 54px 0; }
  .hero::before { background: linear-gradient(180deg, rgba(247, 241, 232, .95), rgba(247, 241, 232, .82)), url('/static/art/hero.webp') center/cover; }
  .telegram-cta p { width: 100%; }
}
@media (max-width: 560px) {
  .container { width: min(100% - 20px, 1180px); }
  .header-actions { gap: 2px; }
  .header-actions .icon-button:nth-of-type(1) { display: none; }
  .book-grid, .feature-grid, .platform-grid, .timeline, .footer-grid, .nav.open { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .kv { grid-template-columns: 1fr; }
  .editor-textarea { padding: 20px; min-height: 52vh; }
  .btn { width: 100%; }
  .hero-actions .btn, .telegram-cta .btn { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Print view — browser "Save as PDF" is available, but no print-ready claim. */
.only-print { display: none; }
@media print {
  @page { margin: 18mm 16mm; }
  body { background: white; color: #2a211b; font-family: var(--serif); font-size: 11pt; line-height: 1.6; }
  .site-header, .site-footer, .toast-stack, .no-print, .btn, .icon-button, .download-bar, .progress { display: none !important; }
  .container { width: 100%; margin: 0; }
  .section { padding: 0; }
  .card, .panel, .glass-card { border: 0; box-shadow: none; padding: 0; background: white; }
  .only-print { display: block; }
  .print-title { text-align: center; font-size: 24pt; margin: 28mm 0 10mm; }
  .print-subtitle { text-align: center; color: #6b5a4b; margin-bottom: 28mm; }
  .print-meta { font-size: 9pt; color: #6b5a4b; border-top: 1px solid #d8c7b2; padding-top: 8pt; margin-top: 16pt; }
  .print-toc { page-break-after: always; }
  .print-chapter { page-break-before: always; }
  .print-chapter h2 { font-size: 18pt; margin-bottom: 12pt; }
  .print-chapter p { text-align: justify; orphans: 3; widows: 3; }
  a { color: #2a211b; text-decoration: none; }
}


/* Editorial, less template-like composition */
.editorial-shell { position: relative; overflow: hidden; }
.editorial-shell::before { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid var(--line-strong); border-radius: 50%; right: -120px; top: -140px; pointer-events: none; }
.manifesto-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(240px, .55fr); gap: 56px; align-items: start; }
.manifesto-quote { margin: 0; padding-left: 26px; border-left: 2px solid var(--clay); font-family: var(--serif); font-size: clamp(1.7rem, 3.2vw, 2.85rem); line-height: 1.24; letter-spacing: -.02em; color: var(--ink); }
.manifesto-quote cite { display: block; margin-top: 20px; font-family: var(--sans); font-size: .86rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.margin-note { border-top: 1px solid var(--line-strong); padding-top: 16px; color: var(--muted); font-size: .92rem; }
.margin-note strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; margin-bottom: 8px; }
.story-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.story-row:last-child { border-bottom: 1px solid var(--line); }
.story-index { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--clay); }
.story-row h3 { font-family: var(--serif); font-size: 1.55rem; margin-bottom: 8px; }
.story-row p { color: var(--muted); margin: 0; max-width: 720px; }
.warm-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.warm-panel .serif { font-family: var(--serif); }
.paper-note { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 4px 18px 4px 18px; padding: 26px; box-shadow: var(--shadow-soft); }
.paper-note::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 14px; height: 1px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 14px); }
.ink-rule { height: 1px; background: linear-gradient(90deg, var(--clay), var(--line-strong), transparent); margin: 34px 0; }
.editorial-lede { font-family: var(--serif); font-size: clamp(1.18rem, 2vw, 1.55rem); line-height: 1.5; color: var(--ink-soft); max-width: 760px; }
.editorial-small { font-size: .86rem; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); font-weight: 700; }
.book-quote { font-family: var(--serif); font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); }
.book-card { border-radius: 6px 20px 6px 20px; }
.book-cover { border-radius: 6px 16px 0 0; }
@media (max-width: 820px) {
  .manifesto-grid { grid-template-columns: 1fr; gap: 28px; }
  .story-row { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .story-index { font-size: 1.8rem; }
}


/* Journal / long-form editorial content */
.journal-clusters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.journal-cluster p { margin: 0; font-size: .9rem; line-height: 1.65; }
.journal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.journal-card { border-radius: 6px 20px 6px 20px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.journal-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.journal-date { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.journal-card h3 { font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; margin: 0; }
.journal-card h3 a { color: var(--ink); }
.journal-card h3 a:hover { color: var(--clay); }
.journal-card p { margin: 0; flex: 1; }
.journal-card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: .84rem; }
.journal-article-head { max-width: 840px; margin: 22px 0 36px; }
.journal-article-head h1 { font-family: var(--serif); font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.1; letter-spacing: -.02em; margin: 12px 0 18px; }
.journal-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .86rem; margin-top: 18px; }
.journal-back { display: inline-flex; align-items: center; gap: 8px; }
.journal-back .icon { transform: rotate(180deg); }
.journal-body { max-width: 760px; font-size: 1.08rem; line-height: 1.78; color: var(--ink-soft); }
.journal-body > * { margin: 0 0 22px; }
.journal-body .journal-lead { font-family: var(--serif); font-size: 1.42rem; line-height: 1.6; color: var(--ink); }
.journal-body h2 { font-family: var(--serif); font-size: 1.85rem; line-height: 1.3; color: var(--ink); margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.journal-body blockquote { margin: 34px 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--clay); font-family: var(--serif); font-size: 1.35rem; line-height: 1.5; color: var(--ink); }
.journal-body blockquote p { margin: 0; }
.journal-body blockquote cite { display: block; margin-top: 12px; font-family: var(--sans); font-size: .82rem; font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.journal-body ul { padding-left: 22px; }
.journal-body li { margin-bottom: 10px; }
.journal-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.journal-related { margin-top: 20px; }
.journal-related .journal-grid { margin-top: 20px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) {
  .journal-clusters, .journal-grid, .journal-related .journal-grid { grid-template-columns: 1fr; }
  .journal-body { font-size: 1rem; }
  .journal-body .journal-lead { font-size: 1.24rem; }
}

/* Electrobooks Studio: quiet editing surface, intentionally separate from the showcase. */
.studio-mode {background:#fafaf8;color:#242827}
.studio-header {height:58px;background:#fff;border-bottom:1px solid #e4e7e6;display:flex;align-items:center;gap:16px;padding:0 clamp(16px,3vw,48px);font-size:.88rem}
.studio-header a {color:#42514f;text-decoration:none}
.studio-brand {font-weight:750;color:#202c29!important;letter-spacing:-.02em}
.studio-head-sep,.studio-head-note {color:#87918e}
.studio-head-note {margin-left:auto}
.studio-mode .section.compact {padding:22px 0 55px}
.studio-mode .section.compact>.container {max-width:1600px}
.studio-mode .section-kicker {display:none}
.studio-mode h1 {font-size:1.4rem!important}
.studio-actions {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 12px;color:#697571;font-size:.82rem}
.studio-workspace {grid-template-columns:minmax(176px,220px) minmax(0,1fr);gap:16px;position:relative;align-items:start}
.studio-mode .chapter-rail {border:0;background:#f1f3f1;box-shadow:none;top:78px}
.studio-mode .editor-canvas {border:1px solid #e6e9e7;background:#fff;box-shadow:none;border-radius:12px;max-width:850px;margin:auto}
.studio-mode .editor-main {min-width:0}
.studio-mode .editor-textarea {font-family:Georgia,'Times New Roman',serif;font-size:1.15rem;line-height:1.85;min-height:58vh;max-width:100%;padding:26px clamp(18px,4vw,54px)}
.studio-mode .editor-toolbar {background:#fff;border-bottom:1px solid #eceeed}
.studio-mode .editor-aside {display:none;position:fixed;top:58px;right:0;bottom:0;width:min(390px,100vw);overflow:auto;z-index:60;background:#fff;box-shadow:-12px 0 45px #0002;padding:52px 18px 25px;grid-template-columns:1fr;align-content:start}
.studio-mode.studio-tools-open .editor-aside {display:grid}
.studio-close {position:absolute;right:17px;top:13px;border:0;background:transparent;font-size:1.7rem;cursor:pointer;color:#667}
.studio-local-warning {margin:14px 20px;padding:13px;border-radius:8px;background:#fff4df;color:#61471c;font-size:.83rem}
.studio-local-warning .btn {margin:8px 4px 0 0}
.studio-mode.focus-mode .studio-workspace {grid-template-columns:minmax(0,1fr)}
.studio-mode.focus-mode .chapter-rail,.studio-mode.focus-mode .editor-aside {display:none}
@media(max-width:850px){
 .studio-workspace {grid-template-columns:minmax(0,1fr)}
 .studio-mode .chapter-rail {position:static;max-height:175px;overflow:auto}
 .studio-actions {align-items:flex-start}
 .studio-mode .editor-textarea {min-height:54vh;font-size:1.03rem;line-height:1.7}
 .studio-head-note {display:none}
}

/* Electrobooks Studio: mobile navigation stays out of the writing surface. */
.studio-action-buttons {display:flex;gap:8px;align-items:center;justify-content:flex-end;min-width:0}
.studio-chapters-toggle {display:none}
@media (max-width:850px) {
 .studio-chapters-toggle {display:inline-flex}
 .studio-mode .chapter-rail {display:none;position:static;max-height:220px;overflow:auto}
 .studio-mode.studio-chapters-open .chapter-rail {display:block}
 .studio-mode.focus-mode .chapter-rail {display:none}
}
@media (max-width:560px) {
 .studio-actions {display:block;min-width:0}
 .studio-actions>span {display:block;margin-bottom:9px}
 .studio-action-buttons {width:100%;justify-content:stretch;gap:8px}
 .studio-action-buttons .btn {width:auto;max-width:100%;min-width:0;white-space:normal;flex:1;line-height:1.3;overflow-wrap:anywhere}
 .studio-header {padding:0 10px;gap:9px;font-size:.78rem}
 .studio-header a {overflow-wrap:anywhere}
 .studio-mode .form-actions {min-width:0}
 .studio-mode .editor-canvas {min-width:0}
}

/* V2.2: writing takes priority over navigation on small displays. */
@media (max-width: 600px) {
  .studio-mode .studio-intro, .studio-mode .studio-actions > span { display: none; }
  .studio-mode .section.compact { padding: 10px 0 32px; }
  .studio-mode .section.compact > .container { padding-left: 10px; padding-right: 10px; }
  .studio-mode .editor-toolbar { padding: 8px 10px; }
  .studio-mode .editor-textarea { padding: 18px 18px; }
}
.studio-mode.focus-mode .studio-intro,
.studio-mode.focus-mode .studio-actions { display: none; }
