/* Cititorul manuscrisului — ecran propriu peste aplicație. Coloană de lectură ~34em, bare care se ascund la citit. */
.rd {
  --rd-read: 'Literata', Georgia, 'Times New Roman', serif;
  --rd-ui: -apple-system, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
  --rd-fs: 19px; --rd-lh: 1.65;
  --p: #fbfbf8; --i: #1d1f22; --m: #6a6d72; --l: #e3e2dc; --s: #ffffff; --a: #2f4a6d; --ai: #ffffff; --soft: #eef1f5;
  --hy: rgba(250, 204, 21, .38); --hg: rgba(74, 222, 128, .32); --hp: rgba(244, 114, 182, .30);
  position: fixed; inset: 0; z-index: 9000; background: var(--p); color: var(--i); font-family: var(--rd-ui);
}
.rd.th-sepia { --p: #f3ead8; --i: #3b3024; --m: #7c6c58; --l: #ddd0b8; --s: #f8f1e3; --a: #7a4b22; --ai: #fff8ee; --soft: #eadfc8; }
.rd.th-dark { --p: #121315; --i: #d6d3cc; --m: #8b8e94; --l: #26282c; --s: #1b1c20; --a: #9bb8de; --ai: #10161e; --soft: #20242b;
  --hy: rgba(250, 204, 21, .26); --hg: rgba(74, 222, 128, .22); --hp: rgba(244, 114, 182, .24); color-scheme: dark; }
body.rd-lock { overflow: hidden; }
.rd[hidden] { display: none !important; }
.rd button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rd button:focus-visible, .rd textarea:focus-visible, .rd input:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.rd-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.rd-loading { padding: 90px 0; text-align: center; color: var(--m); font-family: var(--rd-read); font-size: 18px; display: grid; gap: 18px; justify-items: center; }

/* Bare */
.rd-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 2px; height: 52px; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 0 6px; background: var(--p); border-bottom: 1px solid var(--l); transition: transform .22s ease; }
.rd-top.hide { transform: translateY(-105%); }
.rd-top-t { flex: 1; min-width: 0; text-align: center; font-size: 13px; color: var(--m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.rd-ic { min-width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 500; }
.rd-ic:disabled { opacity: .3; }
.rd-ic:active { background: var(--soft); }
.rd-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.rd-prog i { display: block; height: 100%; width: 0; background: var(--a); }
.rd-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); background: var(--p); border-top: 1px solid var(--l); transition: transform .22s ease; }
.rd-bottom.hide { transform: translateY(105%); }
.rd-bottom[hidden] { display: none; }
.rd-bmid { flex: 1; text-align: center; font-size: 12.5px; color: var(--m); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bibliotecă */
.rd-lib { max-width: 760px; margin: 0 auto; padding: 28px 0 60px; display: grid; gap: 18px; }
.rd-lib-k { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--m); }
.rd-lib-h { font-family: var(--rd-read); font-weight: 400; font-size: clamp(28px, 7vw, 40px); line-height: 1.15; margin: -6px 0 0; color: var(--i); }
.rd-lib-p { margin: 0; color: var(--m); font-size: 15px; line-height: 1.5; }
.rd-resume { display: grid; gap: 6px; text-align: left; padding: 16px 18px; border-radius: 14px; background: var(--a); color: var(--ai) !important; }
.rd-resume-k { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.rd-resume-t { font-family: var(--rd-read); font-size: 18px; line-height: 1.3; }
.rd-resume .rd-bar { background: rgba(255, 255, 255, .25); } .rd-resume .rd-bar i { background: currentColor; }
.rd-shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rd-vol { display: grid; gap: 8px; text-align: left; padding: 18px 16px 16px 18px; border-radius: 4px 14px 14px 4px; background: var(--s); border: 1px solid var(--l); border-left: 8px solid var(--sp); }
.rd-vol.v1 { --sp: #c9a227; } .rd-vol.v2 { --sp: #4f7a5a; } .rd-vol.v3 { --sp: #b5525c; }
.rd-vol-l { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--m); }
.rd-vol-l em { font-style: normal; letter-spacing: .04em; text-transform: none; background: var(--soft); padding: 1px 7px; border-radius: 99px; margin-left: 4px; }
.rd-vol-n { font-family: var(--rd-read); font-size: 30px; letter-spacing: .06em; line-height: 1.1; }
.rd-vol-m { font-size: 12.5px; color: var(--m); }
.rd-bar { display: block; height: 4px; border-radius: 4px; background: var(--l); overflow: hidden; }
.rd-bar i { display: block; height: 100%; background: var(--a); border-radius: 4px; }
.rd-notes-link { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 15px 18px; border-radius: 14px; border: 1px solid var(--l); background: var(--s); text-align: left; font-weight: 500; }
.rd-notes-link span:last-child { color: var(--m); font-weight: 400; font-size: 14px; }
.rd-lib-foot { margin: 6px 0 0; font-size: 13px; color: var(--m); line-height: 1.5; }

/* Text */
.rd-art { max-width: 34em; margin: 0 auto; padding: 22px 0 10px; font-family: var(--rd-read); font-size: var(--rd-fs); line-height: var(--rd-lh); color: var(--i); hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; -webkit-user-select: text; user-select: text; }
.rd.ff-sans .rd-art { font-family: var(--rd-ui); }
.rd-sec { font-family: var(--rd-ui); font-size: 11.5px !important; letter-spacing: .14em; text-transform: uppercase; color: var(--m); margin: 18px 0 0 !important; text-align: left !important; }
.rd-art h1 { font-weight: 400; font-size: 1.5em; line-height: 1.25; margin: .8em 0 1em; text-wrap: balance; }
.rd-art h1 + h1 { margin-top: -.3em; }
.rd-art h2 { font-size: 1.1em; font-weight: 600; line-height: 1.35; margin: 1.9em 0 .55em; text-wrap: balance; }
.rd-art h3, .rd-art h4 { font-size: 1em; font-style: italic; font-weight: 400; margin: 1.5em 0 .4em; }
.rd-art p { margin: 0 0 .85em; text-align: justify; }
.rd-art ul, .rd-art ol { padding-left: 1.3em; margin: 0 0 .9em; }
.rd-art li { margin-bottom: .35em; }
.rd-art blockquote { margin: 1.1em 0; padding: .75em 1em; background: var(--soft); border-radius: 10px; font-size: .93em; }
.rd-art blockquote p { text-align: left; } .rd-art blockquote p:last-child { margin-bottom: 0; }
.rd-art hr { border: 0; text-align: center; margin: 2em 0; } .rd-art hr::after { content: "⁂"; color: var(--m); }
.rd-art a { color: var(--a); }
.rd-art strong { font-weight: 600; }
.rd-tbl { overflow-x: auto; margin: 1em 0; }
.rd-art table { border-collapse: collapse; font-family: var(--rd-ui); font-size: .78em; line-height: 1.45; min-width: 100%; }
.rd-art th, .rd-art td { border: 1px solid var(--l); padding: 6px 8px; text-align: left; vertical-align: top; }
.rd-art th { background: var(--soft); }
.rd-hl { color: inherit; border-radius: 3px; padding: 0 1px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rd-hl.c-y { background: var(--hy); } .rd-hl.c-g { background: var(--hg); } .rd-hl.c-p { background: var(--hp); }
.rd-hl.has-n { border-bottom: 2px dotted var(--a); }
.rd-fixed { box-shadow: -10px 0 0 -7px var(--a); }
.rd-fixbadge { display: inline-block; margin: -.4em 0 .9em; padding: 4px 10px; border-radius: 99px; background: var(--soft); color: var(--a) !important; font-family: var(--rd-ui) !important; font-size: 12.5px !important; font-weight: 500; }
.rd-flash { animation: rdFlash 1.8s ease; }
@keyframes rdFlash { 0%, 40% { background: var(--hy); } 100% { background: transparent; } }
.rd-end { max-width: 34em; margin: 2em auto 0; padding: 2em 0 140px; border-top: 1px solid var(--l); display: grid; gap: 14px; justify-items: center; text-align: center; font-size: 14px; color: var(--m); }

/* Butoane comune */
.rd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 99px; background: var(--a) !important; color: var(--ai) !important; font-weight: 600 !important; font-size: 15px; }
.rd-btn.ghost { background: transparent !important; color: var(--i) !important; border: 1px solid var(--l) !important; }
.rd-btn.danger { color: #c2410c !important; }
.rd-link { color: var(--a) !important; font-weight: 500; font-size: 14px; padding: 6px 0; }

/* Bara de selecție */
.rd-tool { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 8; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 16px; background: var(--s); border: 1px solid var(--l); box-shadow: 0 8px 30px rgba(0, 0, 0, .22); max-width: calc(100% - 20px); overflow-x: auto; }
.rd-tool[hidden] { display: none; }
.rd-dot { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; border: 2px solid transparent !important; }
.rd-dot.c-y { background: #facc15 !important; } .rd-dot.c-g { background: #4ade80 !important; } .rd-dot.c-p { background: #f472b6 !important; }
.rd-dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--s), 0 0 0 4px var(--i); }
.rd-tool-sep { width: 1px; height: 24px; background: var(--l); margin: 0 4px; flex: 0 0 auto; }
.rd-tool-b { padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.rd-tool-b:active { background: var(--soft); }

/* Foaie de jos */
.rd-scrim { position: absolute; inset: 0; z-index: 9; background: rgba(0, 0, 0, .38); }
.rd-scrim[hidden], .rd-sheet[hidden], .rd-toast[hidden] { display: none; }
.rd-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 86%; overflow-y: auto; background: var(--s); color: var(--i); border-radius: 20px 20px 0 0; padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); }
@media (min-width: 720px) { .rd-sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); } }
.rd-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--l); justify-self: center; margin-bottom: 4px; }
.rd-sh-h { font-family: var(--rd-read); font-size: 20px; }
.rd-row { display: grid; gap: 8px; }
.rd-lab { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--m); }
.rd-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.rd-seg button { min-height: 42px; border-radius: 10px; border: 1px solid var(--l) !important; font-size: 14px; }
.rd-seg button[aria-pressed="true"] { border-color: var(--a) !important; box-shadow: inset 0 0 0 1px var(--a); font-weight: 600; }
.rd-seg button:disabled { opacity: 1; font-variant-numeric: tabular-nums; }
.rd-dots { display: flex; gap: 12px; }
.rd-q { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-family: var(--rd-read); font-size: 15px; line-height: 1.5; max-height: 30vh; overflow-y: auto; white-space: pre-wrap; }
.rd-q.c-y { box-shadow: inset 4px 0 0 #facc15; } .rd-q.c-g { box-shadow: inset 4px 0 0 #4ade80; } .rd-q.c-p { box-shadow: inset 4px 0 0 #f472b6; }
.rd-ta, .rd-in { width: 100%; box-sizing: border-box; border: 1px solid var(--l); border-radius: 12px; background: var(--p); color: var(--i); padding: 10px 12px; font: 16px/1.5 var(--rd-read); resize: vertical; }
.rd-in { font-family: var(--rd-ui); }
.rd-acts { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rd-toc { display: grid; margin: 0 -18px; }
.rd-toc button { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 12px 18px; font-size: 14.5px; line-height: 1.35; }
.rd-toc button.cur { background: var(--soft); font-weight: 600; }
.rd-toc-sec { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--m); padding: 14px 18px 2px; }
.rd-toc-st { font-size: 12px; color: var(--m); font-variant-numeric: tabular-nums; }
.rd-toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 11; padding: 9px 16px; border-radius: 99px; background: var(--i); color: var(--p); font-size: 14px; font-weight: 500; }

/* Notițele mele */
.rd-notes { max-width: 760px; margin: 0 auto; padding: 18px 0 80px; display: grid; gap: 12px; }
.rd-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.rd-filters button { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--l) !important; font-size: 14px; }
.rd-filters button[aria-pressed="true"] { background: var(--a) !important; color: var(--ai) !important; border-color: var(--a) !important; }
.rd-filters b { font-weight: 600; opacity: .7; margin-left: 3px; }
.rd-export { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: 14px; background: var(--soft); font-size: 14px; line-height: 1.45; }
.rd-export span { flex: 1 1 240px; }
.rd-n-g { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--m); margin-top: 10px; }
.rd-n { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--s); border: 1px solid var(--l); }
.rd-n-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rd-tag { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--soft); }
.rd-tag.c-y { box-shadow: inset 3px 0 0 #facc15; } .rd-tag.c-g { box-shadow: inset 3px 0 0 #4ade80; } .rd-tag.c-p { box-shadow: inset 3px 0 0 #f472b6; }
.rd-tag.fix { color: var(--a); }
.rd-n-d { font-size: 12px; color: var(--m); }
.rd-n-note { font-size: 15px; line-height: 1.5; }
.rd-n-old { font-family: var(--rd-read); font-size: 14.5px; line-height: 1.5; color: var(--m); text-decoration: line-through; text-decoration-color: rgba(194, 65, 12, .5); }
.rd-n-new { font-family: var(--rd-read); font-size: 15px; line-height: 1.5; padding-left: 10px; box-shadow: inset 3px 0 0 var(--a); }
.rd-n-why { font-size: 13.5px; color: var(--m); font-style: italic; }
.rd-n-acts { display: flex; gap: 18px; }
.rd-empty { padding: 30px 6px; text-align: center; color: var(--m); font-size: 15px; line-height: 1.5; }

/* Intrarea din tab-ul Cărți */
.rd-entry { display: grid; gap: 6px; width: 100%; text-align: left; margin: 4px 0 18px; padding: 18px 18px 16px; border-radius: 16px; border: 1px solid var(--border, rgba(255, 255, 255, .12)); background: var(--card, rgba(255, 255, 255, .04)); color: var(--text); cursor: pointer; font: inherit; }
.rd-entry-k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .65; }
.rd-entry-t { font-family: 'Literata', Georgia, serif; font-size: 20px; line-height: 1.25; }
.rd-entry-s { font-size: 14px; opacity: .75; line-height: 1.45; }
.rd-entry-cta { font-size: 14px; font-weight: 600; color: var(--accent); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.rd-entry-cta em { font-style: normal; font-weight: 400; opacity: .7; color: var(--text); }
@media (prefers-reduced-motion: reduce) { .rd *, .rd-top, .rd-bottom { transition: none !important; animation: none !important; } }

/* ─── Mod pagini (ca o carte) ─── */
.rd.paged .rd-scroll { overflow: hidden; padding: 0; }
.rd.paged .rd-top { position: absolute; top: 0; left: 0; right: 0; margin: 0; height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 6px 0; }
.rd.paged .rd-top.hide, .rd.paged .rd-bottom.hide { visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
.rd-run, .rd-foot { position: absolute; left: 50%; transform: translateX(-50%); width: min(1120px, 100% - 48px); font-size: 11.5px; color: var(--m); }
.rd-run { top: calc(14px + env(safe-area-inset-top, 0px)); text-align: center; padding: 0 34px; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .04em; }
.rd-foot { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-pg { position: absolute; top: calc(50px + env(safe-area-inset-top, 0px)); bottom: calc(40px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); width: min(620px, 100% - 48px); overflow: hidden; perspective: 2200px; touch-action: none; -webkit-touch-callout: default; }
@media (min-width: 960px) { .rd-pg { width: min(1120px, 100% - 96px); } }
/* Cotorul dintre cele două pagini */
.rd-pg.two::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 64px; transform: translateX(-50%); pointer-events: none; z-index: 2; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .07) 48%, rgba(0, 0, 0, .1) 50%, rgba(0, 0, 0, .07) 52%, transparent); }
.rd.paged .rd-art { max-width: none; margin: 0; padding: 0; column-fill: auto; will-change: transform; orphans: 2; widows: 2; }
.rd.paged .rd-art > :first-child { margin-top: 0 !important; }
.rd.paged .rd-art p { margin: 0; }
.rd.paged .rd-art p + p { text-indent: 1.4em; }
.rd.paged .rd-art p.rd-sec + p { text-indent: 0; }
.rd.paged .rd-art > p + ul, .rd.paged .rd-art > p + ol { margin-top: .5em; }
.rd.paged .rd-art h1, .rd.paged .rd-art h2, .rd.paged .rd-art h3, .rd.paged .rd-art h4 { break-after: avoid; break-inside: avoid; }
.rd.paged .rd-tbl { overflow: visible; }
.rd.paged .rd-art table { table-layout: fixed; width: 100%; }
.rd-leaf { position: absolute; inset: 0; overflow: hidden; background: var(--p); pointer-events: none; z-index: 3; backface-visibility: hidden; box-shadow: 6px 0 24px rgba(0, 0, 0, .22); }
/* Panglica: semnul de carte */
.rd-ribbon { position: absolute; z-index: 4; top: env(safe-area-inset-top, 0px); right: 8px; width: 44px; height: 46px; display: flex; justify-content: center; align-items: flex-start; padding: 0; }
.rd:not(.paged) .rd-ribbon { position: fixed; top: calc(52px + env(safe-area-inset-top, 0px)); }
.rd-ribbon i { display: block; width: 16px; height: 24px; background: var(--m); opacity: .28; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); transition: height .2s ease, opacity .2s ease; }
.rd-ribbon.on i { background: #b3261e; opacity: 1; height: 40px; }
.rd-bmk { display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--l); }
.rd-bmk-go { flex: 1; min-width: 0; display: grid; gap: 4px; text-align: left; padding: 10px 0; font-size: 15px; line-height: 1.4; }
/* Telefoane: înguste, pe orizontală, cu decupaj */
.rd.paged .rd-scroll { overscroll-behavior: none; }
@media (max-width: 430px) {
  .rd.paged .rd-pg { width: calc(100% - 40px); }
  .rd.paged .rd-run, .rd.paged .rd-foot { width: calc(100% - 40px); }
  .rd.paged .rd-art p { text-align: start; } /* pe coloană îngustă alinierea dublă lasă goluri între cuvinte */
  .rd-top .rd-ic { min-width: 40px; }
}
@media (max-width: 350px) { #rdFootM { display: none; } }
@media (max-height: 480px) {
  .rd-pg { top: calc(36px + env(safe-area-inset-top, 0px)); bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  .rd-run { top: calc(9px + env(safe-area-inset-top, 0px)); }
  .rd-foot { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .rd-ribbon i { height: 18px; } .rd-ribbon.on i { height: 30px; }
}
@media (orientation: landscape) and (max-height: 480px) { .rd-pg, .rd-run, .rd-foot { max-width: calc(100% - 2 * max(20px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))); } }
