/* =========================================================
   Злой алхимик — reader theme
   Quiet paper & ink. One accent. Typography first.
   All colours, fonts and sizes come from CSS variables
   generated by Admin → Design.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .25s ease, color .25s ease;
}
html[lang="fa"] body { font-family: var(--f-fa); }
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .74rem; letter-spacing: .02em; font-feature-settings: "zero" 1; }
html[lang="fa"] .mono { font-family: var(--f-fa); font-size: .8rem; letter-spacing: 0; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: 20px; }
.wrap-text {
  width: 100%;
  max-width: calc(var(--measure) * var(--s-body) + 40px);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }

/* ---------- Header ---------- */
.site-head { padding-top: env(safe-area-inset-top); }
.head-row {
  display: flex; align-items: center; gap: 16px;
  min-height: 84px; gap: 22px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: auto; min-width: 0; }
.brand-mark { flex: none; width: 30px; height: 30px; color: var(--accent); transition: transform .5s cubic-bezier(.2,.7,.2,1); transform-origin: 50% 70%; }
.brand:hover .brand-mark { transform: rotate(-12deg); }
.sig { width: 1.15em; height: 1.15em; vertical-align: -.22em; color: var(--accent); }
.brand-name {
  font-family: var(--f-head); font-size: var(--s-site); font-weight: 500;
  letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[lang="fa"] .brand-name { font-family: var(--f-fa); }
.head-nav { display: flex; gap: 30px; font-family: var(--f-ui); font-size: 1.08rem; font-weight: 500; letter-spacing: .01em; }
.head-nav a { position: relative; text-decoration: none; color: color-mix(in srgb, var(--text) 62%, transparent); padding: 8px 0; transition: color .2s; }
.head-nav a::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .25s; }
.head-nav a:hover { color: var(--text); }
.head-nav a[aria-current="page"] { color: var(--text); }
.head-nav a[aria-current="page"]::after, .head-nav a:hover::after { transform: scaleX(1); }
.head-tools { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch a {
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .8rem; font-weight: 500; letter-spacing: .04em;
  text-decoration: none; color: var(--muted); padding: 6px 11px; border-radius: 999px; line-height: 1.2;
}
.lang-switch a[lang="fa"] { font-family: var(--f-fa); font-size: .88rem; }
.lang-switch a[aria-current] { background: var(--text); color: var(--bg); }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent;
  border-radius: 50%; cursor: pointer; color: var(--muted);
}
.theme-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.admin-link { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); text-decoration: none; font-family: var(--f-ui); font-size: .9rem; font-weight: 500; white-space: nowrap; transition: color .2s, border-color .2s; }
.admin-link:hover { color: var(--text); border-color: var(--muted); }
@media (max-width: 420px) { .admin-link span { display: none; } .admin-link { padding: 0; width: 38px; justify-content: center; } }

@media (max-width: 640px) {
  .head-row { flex-wrap: wrap; gap: 8px 12px; padding-block: 14px 10px; min-height: 0; }
  .brand { width: 100%; margin: 0; }
  .head-nav { gap: 20px; margin-inline-end: auto; font-size: 1.02rem; }
}

/* ---------- Reading progress ---------- */
.progress { position: fixed; inset-inline: 0; top: 0; height: 2px; z-index: 50; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
[dir="rtl"] .progress span { margin-inline-start: auto; }
body:not(.is-reading) .progress { display: none; }

/* ---------- Home ---------- */
.home-intro { padding-block: 56px 18px; }
.tagline {
  margin: 0; font-family: var(--f-head); font-style: italic; font-size: clamp(20px, 3.4vw, 28px);
  color: var(--muted); max-width: 28em;
}
html[lang="fa"] .tagline { font-family: var(--f-fa); font-style: normal; }
.empty { padding-block: 80px; color: var(--muted); }

.story-index { list-style: none; margin: 0 0 80px; padding: 0; }
.story-item { border-top: 1px solid var(--line); }
.story-item:last-child { border-bottom: 1px solid var(--line); }
.story-link {
  display: grid;
  grid-template-columns: 76px 1fr 220px;
  grid-template-areas: "no main thumb" "no meta thumb";
  gap: 6px 28px; padding-block: 30px; text-decoration: none; align-items: start;
}
.story-item:not(.has-cover) .story-link { grid-template-columns: 76px 1fr; grid-template-areas: "no main" "no meta"; }
.story-no { grid-area: no; color: var(--muted); padding-top: .55em; }
.story-main { grid-area: main; display: flex; flex-direction: column; gap: 6px; }
.story-title {
  font-family: var(--f-head); font-size: clamp(26px, 4.2vw, calc(var(--s-title) * .82));
  font-weight: var(--w-title); line-height: 1.12; text-transform: var(--t-case); letter-spacing: -.005em;
  transition: color .2s;
}
.story-sub { font-family: var(--f-head); font-style: italic; font-size: calc(var(--s-sub) * 1.02); color: var(--muted); }
.story-ex { font-family: var(--f-body); font-size: 1rem; line-height: 1.6; color: color-mix(in srgb, var(--text) 78%, var(--bg)); max-width: 36em; margin-top: 4px; }
[lang="fa"] .story-title, [lang="fa"] .story-sub, [lang="fa"] .story-ex { font-family: var(--f-fa); font-style: normal; }
.story-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); margin-top: 8px; }
.story-meta .tag { border: 1px solid var(--line); padding: 0 6px; border-radius: 3px; }
.story-thumb { grid-area: thumb; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.story-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.story-link:hover .story-title { color: var(--accent); }
.story-link:hover .story-thumb img { transform: scale(1.03); }

/* grid layout option */
.story-index.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 32px; padding-top: 24px; }
.layout-grid .story-item, .layout-grid .story-item:last-child { border: 0; }
.layout-grid .story-link, .layout-grid .story-item:not(.has-cover) .story-link {
  grid-template-columns: 1fr; grid-template-areas: "thumb" "no" "main" "meta"; padding: 0; gap: 8px;
}
.layout-grid .story-no { padding-top: 6px; }
.layout-grid .story-title { font-size: clamp(24px, 3vw, 32px); }

@media (max-width: 760px) {
  .home-intro { padding-block: 32px 8px; }
  .story-link, .story-item:not(.has-cover) .story-link {
    grid-template-columns: 1fr; grid-template-areas: "thumb" "no" "main" "meta"; gap: 8px; padding-block: 26px;
  }
  .story-no { padding: 0; }
  .story-thumb { aspect-ratio: 16 / 10; }
}

/* ---------- Article head ---------- */
.article-head { padding-block: 64px 28px; }
.article-head.is-centered { text-align: center; }
.kicker { color: var(--muted); margin: 0 0 18px; }
.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.title {
  font-family: var(--f-head);
  font-size: clamp(32px, 7.4vw, var(--s-title));
  font-weight: var(--w-title); line-height: 1.06; letter-spacing: -.012em;
  text-transform: var(--t-case);
  margin: 0; text-wrap: balance;
}
.subtitle {
  font-family: var(--f-head); font-style: italic; font-size: clamp(17px, 3.6vw, var(--s-sub));
  color: var(--muted); margin: 14px 0 0; line-height: 1.4; text-wrap: balance;
}
[lang="fa"] .title, [lang="fa"] .subtitle { font-family: var(--f-fa); font-style: normal; line-height: 1.35; letter-spacing: 0; }
.byline { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); margin: 26px 0 0; }
.is-centered .byline { justify-content: center; }
@media (max-width: 640px) { .article-head { padding-block: 36px 20px; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.filters a {
  font-size: .85rem; text-decoration: none; color: var(--muted); padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px;
}
.filters a[aria-current] { color: var(--bg); background: var(--text); border-color: var(--text); }
.story-meta .stat { color: var(--muted); }
.type-poem .story-ex { font-style: italic; }

/* ---------- Covers ---------- */
.cover { margin: 0 auto 40px; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-hero { width: 100%; height: var(--cover-h, 60vh); min-height: 260px; max-height: 92vh; }
.cover-wide { max-width: 1100px; padding-inline: 20px; }
.cover-wide img { height: auto; max-height: var(--cover-h, 70vh); border-radius: var(--radius); }
.cover-inline { max-width: calc(var(--measure) * var(--s-body) + 40px); padding-inline: 20px; }
.cover-inline img { height: auto; max-height: var(--cover-h, 70vh); border-radius: var(--radius); }
.cover figcaption, .prose figcaption {
  font-family: var(--f-ui); font-size: .8rem; color: var(--muted); margin-top: 10px; line-height: 1.5;
}
@media (max-width: 640px) {
  .cover-wide, .cover-inline { padding-inline: 0; }
  .cover-wide img, .cover-inline img { border-radius: 0; }
  .cover figcaption { padding-inline: 20px; }
}

.notice {
  font-size: .85rem; color: var(--muted); margin-block: 0 28px;
  border-inline-start: 2px solid var(--accent); padding-block: 4px; padding-inline-start: 14px;
  max-width: calc(var(--measure) * var(--s-body) + 40px);
}
.notice a { margin-inline-start: 6px; }

/* ---------- Prose ---------- */
.prose {
  font-family: var(--f-body);
  font-size: calc(var(--s-body) * var(--reader-scale, 1) * var(--mobile-k, 1));
  line-height: var(--lh);
  hyphens: auto; -webkit-hyphens: auto;
  overflow-wrap: break-word;
  font-variant-numeric: oldstyle-nums proportional-nums;
}
@media (max-width: 600px) { :root { --mobile-k: .92; } }
.prose[lang="fa"], [lang="fa"] .prose, .prose [lang="fa"] { font-family: var(--f-fa-body); hyphens: manual; font-variant-numeric: normal; }
.prose > * { margin-block: 0 1.05em; }
.prose p { text-wrap: pretty; }
.prose > p + p { margin-top: -.15em; }
.prose h2, .prose h3 { font-family: var(--f-head); font-weight: 500; line-height: 1.2; margin-block: 2em .7em; }
.prose h2 { font-size: 1.45em; }
.prose h3 { font-size: 1.15em; font-style: italic; }
[lang="fa"] .prose h2, [lang="fa"] .prose h3 { font-family: var(--f-fa); font-style: normal; }
.prose blockquote {
  margin-inline: 0; padding-inline-start: 1.1em; border-inline-start: 2px solid var(--accent);
  font-style: italic; color: color-mix(in srgb, var(--text) 85%, var(--bg));
}
.prose hr {
  border: 0; height: auto; margin-block: 2.2em; text-align: center; overflow: visible;
}
.prose hr::after { content: "∗  ∗  ∗"; white-space: pre; color: var(--muted); letter-spacing: .4em; font-size: .9em; }
.prose a { color: var(--accent); }
.prose .ta-center { text-align: center; }
.prose .ta-right { text-align: end; }
.prose .ta-justify { text-align: justify; }
.prose .lead { font-size: 1.15em; line-height: 1.6; }
.prose .small { font-size: .85em; color: var(--muted); }
.prose .scene { margin-top: 2em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose .mark { background: color-mix(in srgb, var(--accent) 18%, transparent); padding-inline: .1em; }

/* Poems: keep the poet's line breaks, no hyphenation, slightly airier */
.prose.is-poem { hyphens: manual; -webkit-hyphens: manual; line-height: calc(var(--lh) * .95); }
.prose.is-poem p { margin-bottom: 1.4em; text-wrap: wrap; }
.prose.is-poem > p + p { margin-top: 0; }
.copy-notice { color: var(--muted); margin-top: 40px; }
.copy-notice .sig { margin-inline-end: 4px; }

.has-dropcap > p:first-of-type::first-letter {
  float: inline-start; font-family: var(--f-head); font-size: 3.6em; line-height: .82;
  padding-inline-end: .08em; margin-top: .08em; color: var(--accent);
}

/* Images inside text: set in the editor (size / alignment / float) */
.prose figure { margin-inline: auto; margin-block: 1.8em; width: 100%; }
.prose figure img { width: 100%; height: auto; border-radius: var(--radius); }
.prose figure.w-25 { width: 25%; } .prose figure.w-33 { width: 33.333%; }
.prose figure.w-50 { width: 50%; } .prose figure.w-75 { width: 75%; }
.prose figure.w-100 { width: 100%; }
.prose figure[style*="--fw"] { width: var(--fw); }
.prose figure.w-wide { width: min(1000px, 100vw - 40px); max-width: none; margin-inline: 50%; transform: translateX(-50%); }
[dir="rtl"] .prose figure.w-wide { transform: translateX(50%); }
.prose figure.w-full { width: 100vw; max-width: none; margin-inline: 50%; transform: translateX(-50%); }
[dir="rtl"] .prose figure.w-full { transform: translateX(50%); }
.prose figure.w-full img { border-radius: 0; }
.prose figure.w-full figcaption { padding-inline: 20px; max-width: 760px; margin-inline: auto; }
.prose figure.al-left { margin-inline: 0 auto; }
.prose figure.al-right { margin-inline: auto 0; }
.prose figure.fl-left { float: left; margin: .3em 1.4em .8em 0; }
.prose figure.fl-right { float: right; margin: .3em 0 .8em 1.4em; }
.prose figure.bordered img { border: 1px solid var(--line); padding: 6px; background: var(--surface); }
.prose figure.rounded img { border-radius: 14px; }
.prose figure.gray img { filter: grayscale(1); }
.prose::after { content: ""; display: block; clear: both; }
@media (max-width: 600px) {
  .prose figure.w-25, .prose figure.w-33 { width: 60%; }
  .prose figure.w-50, .prose figure.w-75 { width: 100%; }
  .prose figure[style*="--fw"] { width: max(var(--fw), 60%); }
  .prose figure.fl-left, .prose figure.fl-right { float: none; margin: 1.6em auto; width: 100%; }
  .prose figure.w-wide { width: 100vw; }
  .prose figure.w-wide img { border-radius: 0; }
}

/* ---------- After the text ---------- */
.after { padding-block: 24px 80px; }
.reactions { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 28px; border-top: 1px solid var(--line); margin-top: 48px; }
.rx {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .15s;
}
.rx:hover { border-color: var(--muted); }
.rx:active { transform: scale(.94); }
.rx.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rx-e { font-size: 1.05rem; line-height: 1; }
.rx-n:empty { display: none; }
.rx.share { margin-inline-start: auto; color: var(--muted); }
.rx.pop .rx-e { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }

.chapter-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; padding-block: 8px 36px; }
.cn {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--f-head); font-size: 1.15rem;
}
html[lang="fa"] .cn { font-family: var(--f-fa); font-size: 1rem; }
.cn .mono { color: var(--muted); }
.cn.next { text-align: end; }
.cn.toc-link { justify-content: center; }
.cn:hover { border-color: var(--accent); }
@media (max-width: 520px) {
  .chapter-nav { grid-template-columns: 1fr 1fr; }
  .cn.toc-link { grid-column: 1 / -1; order: 3; text-align: center; }
}

/* ---------- Comments ---------- */
.comments h2 { font-weight: 500; color: var(--muted); margin: 20px 0 16px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment { padding-block: 16px; border-bottom: 1px solid var(--line); }
.c-head { margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.c-head time { color: var(--muted); }
.c-body { margin: 0; font-family: var(--f-body); font-size: 1rem; line-height: 1.6; white-space: normal; }
html[lang="fa"] .c-body { font-family: var(--f-fa-body); }
.comment.is-author { padding-inline-start: 16px; border-inline-start: 2px solid var(--accent); }
.author-mark { color: var(--accent); }
.comment.is-new { animation: fadein .5s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.no-comments { margin: 0 0 8px; }

.comment-form { margin-top: 28px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .8rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.hp { position: absolute; inset-inline-start: -9999px; height: 0; overflow: hidden; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.form-msg { margin: 0; font-size: .9rem; color: var(--accent); min-height: 1.2em; }
.form-msg.err { color: #b4443a; }
.emoji-wrap { position: relative; }
.emoji-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.emoji-pop {
  position: absolute; bottom: 50px; inset-inline-start: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(6, 40px); gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.emoji-pop button { width: 40px; height: 40px; font-size: 1.25rem; border: 0; background: transparent; cursor: pointer; border-radius: 8px; }
.emoji-pop button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px;
  background: var(--text); color: var(--bg); border: 0; border-radius: 999px; text-decoration: none; cursor: pointer;
  font-size: .9rem; letter-spacing: .01em; transition: opacity .2s;
}
.btn:hover { opacity: .85; color: var(--bg); }
.btn[disabled] { opacity: .5; cursor: wait; }

/* ---------- Series table of contents ---------- */
.synopsis { margin-bottom: 36px; }
.toc { padding-bottom: 80px; }
.toc-title { font-weight: 500; color: var(--muted); margin: 8px 0 8px; }
.toc ol { list-style: none; margin: 0 0 32px; padding: 0; }
.toc li a {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: baseline;
  padding-block: 18px; border-bottom: 1px solid var(--line); text-decoration: none;
}
.toc li:first-child a { border-top: 1px solid var(--line); }
.toc-no, .toc-meta { color: var(--muted); }
.toc-name { font-family: var(--f-head); font-size: 1.35rem; line-height: 1.25; }
[lang="fa"] .toc-name, html[lang="fa"] .toc-name { font-family: var(--f-fa); font-size: 1.1rem; }
.toc li a:hover .toc-name { color: var(--accent); }
@media (max-width: 520px) { .toc li a { grid-template-columns: 32px 1fr; } .toc-meta { grid-column: 2; } }

/* ---------- About ---------- */
.about { padding-bottom: 80px; }
.about-photo { margin: 0 0 32px; width: 220px; }
.about-photo img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; filter: grayscale(.15); }
.social { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 32px; }
.notfound { padding-block: 100px; }
.notfound p { margin-top: 24px; }

/* ---------- Reader tools (Aa) ---------- */
.reader-tools { position: fixed; inset-inline-end: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; }
.rt-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--f-head); font-size: 1.15rem; box-shadow: 0 4px 18px rgba(0,0,0,.08);
  transition: opacity .3s, transform .3s;
}
.reader-tools.is-hidden .rt-btn { opacity: 0; transform: translateY(12px); pointer-events: none; }
.rt-panel {
  position: absolute; bottom: 60px; inset-inline-end: 0; width: 248px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.14);
}
.rt-label { color: var(--muted); margin: 0 0 8px; }
.rt-label + .rt-row { margin-bottom: 14px; }
.rt-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rt-row.themes { grid-template-columns: repeat(2, 1fr); margin-bottom: 0; }
.rt-row button {
  min-height: 38px; border: 1px solid var(--line); background: transparent; border-radius: 8px; cursor: pointer; font-size: .85rem;
}
.rt-row button.is-on { border-color: var(--text); background: var(--text); color: var(--bg); }

/* ---------- Footer, toast, preview ---------- */
.site-foot { padding-bottom: env(safe-area-inset-bottom); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-block: 28px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.foot-legal { flex-basis: 100%; font-size: .72rem; opacity: .85; }
.foot-legal a { color: inherit; }
.foot-links a { text-decoration: none; }
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .85rem; transition: .25s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.preview-bar {
  position: sticky; top: 0; z-index: 70; text-align: center; padding: 6px; font-size: .75rem; letter-spacing: .06em;
  background: var(--accent); color: var(--bg); font-family: 'JetBrains Mono', monospace; text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-head, .site-foot, .after, .reader-tools, .progress { display: none !important; }
  body { background: #fff; color: #000; }
}
