:root { --header-h:76px; --radius-s:6px; --radius-m:12px; --radius-l:18px; }
:root[data-theme="light"] { color-scheme:light; }
:root[data-theme="dark"] { color-scheme:dark; --bg:#14171f; --surface:#1a1f2a; --surface-raised:#222836; --ink:#ece2c8; --ink-soft:#b6ae96; --ink-faint:#aba38f; --sepia:#d2b378; --sepia-bright:#e0b563; --sigil-red:#e4838b; --wash:#ece2c80f; --wash-strong:#ece2c81a; --line:#ece2c82e; --line-soft:#ece2c814; }
:root[data-reading-size="large"] { --article-size:1.25rem; }
:root[data-reading-size="larger"] { --article-size:1.5rem; }
[hidden] { display:none !important; }
:focus-visible { outline:2px solid var(--sepia); outline-offset:4px; }
button:disabled { cursor:not-allowed; opacity:.55; }
.atelier-header { height:var(--header-h); display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 28px; border-bottom:1px solid var(--line); background:var(--surface); }
.atelier-brand { display:flex; align-items:center; gap:12px; text-decoration:none; flex:none; }
.atelier-brand > svg { width:44px; height:44px; fill:none; stroke:var(--ink); stroke-width:1.3; stroke-linecap:round; stroke-linejoin:round; }
.atelier-brand > span { font:600 28px/1 var(--font-display); letter-spacing:.12em; }
.atelier-brand small { display:block; font:11px/1.6 var(--font-ui); letter-spacing:.025em; color:var(--ink-faint); }
.atelier-motto { font:italic 18px var(--font-display); color:var(--ink-soft); margin:0; }
#readingPrefsBtn { min-height:44px; font-size:12px; border-color:transparent; }
#readingPrefsBtn > span { margin-left:12px; font:20px Georgia,serif; }
.app,.dmz,.settings,.vault { height:calc(100dvh - var(--header-h)); }
.reader article > p:not(.byline) { font-size:var(--article-size,1.0625rem); line-height:1.85; }
.reader p + p { text-indent:0; }
.reading-dialog { color:var(--ink); background:var(--surface-raised); border:1px solid var(--line); border-radius:16px; padding:clamp(20px,4vw,36px); width:min(510px,calc(100% - 28px)); max-height:calc(100dvh - 36px); overflow:auto; box-shadow:0 20px 80px #14171f30; }
.reading-dialog::backdrop { background:#14171f66; backdrop-filter:blur(3px); }
.reading-dialog h2 { font-size:36px; margin:12px 0 26px; }
.reading-dialog h3 { margin:22px 0 8px; }
.dialog-close { float:right; min-height:36px; padding:6px 12px; font-size:11px; }
.preference-field { display:flex; flex-direction:column; gap:10px; margin-bottom:22px; font:13px var(--font-ui); }
.preference-field select { min-height:44px; width:100%; }
.preference-check { display:flex; gap:12px; align-items:center; font:13px var(--font-ui); min-height:44px; }
.preference-check input { width:18px; height:18px; accent-color:var(--sepia); }
.reading-dialog .preference-note,.atelier-about { font:12px/1.65 var(--font-ui); color:var(--ink-soft); }
.atelier-about { margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
.atelier-about summary { cursor:pointer; min-height:32px; }
:root[data-motion="reduce"] { --motion-fast:1ms linear; --motion-base:1ms linear; --motion-slow:1ms linear; }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
@media (prefers-reduced-motion:no-preference) { .reader article,.reading-dialog[open] { animation:page-unfold 300ms ease-out both; } }
@keyframes page-unfold { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; scroll-behavior:auto !important; } }
@media (max-width:768px) { :root { --header-h:70px; } .atelier-header { padding:10px 14px; gap:8px; } .atelier-brand { gap:8px; } .atelier-brand > svg { width:34px; height:34px; } .atelier-brand > span { font-size:23px; } .atelier-brand small { font-size:9px; } .atelier-motto { display:none; } #readingPrefsBtn { padding:7px; font-size:11px; } #readingPrefsBtn > span { margin-left:6px; } }
@media (max-width:359px) { .atelier-brand > svg { display:none; } }

:root { --rail-w:196px; }
.skip-link { position:fixed; z-index:1100; top:8px; left:8px; padding:12px; background:var(--surface); transform:translateY(-160%); }
.skip-link:focus { transform:none; }
.app { grid-template-columns:var(--rail-w) var(--list-w) minmax(0,1fr); }
.rail { align-items:stretch; padding:24px 14px 16px; gap:5px; overflow-y:auto; min-height:0; }
.rail__brand { display:flex; gap:12px; align-items:center; padding:0 10px 18px; margin:0 0 9px; border-bottom:1px solid var(--line); }
.rail__brand::after { content:"Your library"; font:10px var(--font-ui); text-transform:uppercase; letter-spacing:.1em; color:var(--ink-soft); }
.shelf { width:100%; min-height:44px; height:auto; flex:none; display:flex; justify-content:flex-start; gap:12px; padding:10px; }
.shelf .sigil { width:21px; height:21px; flex:none; stroke-width:1.35; }
.shelf__label { position:static; transform:none; opacity:1; padding:0; border:0; background:none; box-shadow:none; white-space:normal; text-align:left; font:12px/1.3 var(--font-ui); order:1; }
.shelf .count { position:static; order:2; margin-left:auto; font-size:10px; background:var(--surface); border-radius:4px; padding:4px; }
.shelf[aria-current="true"] { background:var(--ink); }
.shelf[aria-current="true"] .shelf__label { color:var(--surface); }
.shelf[aria-current="true"] .sigil { stroke:var(--surface); }
.shelf[aria-current="true"] .count { color:var(--ink); }
.shelf--help { display:flex; }
.rail__spacer { min-height:20px; }
.list { background:var(--surface); }
.list__header { padding:28px 26px 18px; align-items:center; }
.list__title { font-size:32px; }
.list__meta { font-size:10px; }
.desk-tools { display:flex; gap:6px; margin:0 24px 14px; }
.desk-tools button { display:flex; align-items:center; min-height:44px; font-size:12px; padding:10px; background:var(--bg); border-color:transparent; }
.desk-tools button:first-child { flex:1; text-align:left; }
.desk-tools kbd { margin-left:auto; font:11px var(--font-ui); color:var(--ink-faint); border:1px solid var(--line); border-radius:3px; padding:0 5px; }
.list__density { align-self:stretch; border:0; border-bottom:1px solid var(--line); border-radius:0; padding:0 0 8px; }
.list__density button { flex:1; min-height:36px; font-size:10px; text-transform:none; letter-spacing:0; }
.list__scroll { padding-inline:14px; scrollbar-width:thin; }
.article-row { padding:18px 12px; border-radius:8px; }
.article-row[aria-selected="true"] { background:var(--bg); box-shadow:inset 3px 0 var(--sepia); }
.article-row__title { font-size:22px; line-height:1.2; font-weight:600; margin-bottom:8px; }
.article-row__source,.article-row__age { font-size:10px; }
.article-row__excerpt { font:12px/1.65 var(--font-ui); }
.article-row + .article-row::before { height:1px; margin-bottom:18px; background-image:none !important; background:var(--line); }
.article-row__trash { min-width:28px; min-height:28px; justify-content:center; opacity:1; }
.article-list__empty { font:14px/1.7 var(--font-ui); padding:24px 12px; margin:0; }
.reader-wrap { background:var(--surface-raised); }
.reader__actions { flex-wrap:wrap; max-width:none; padding:24px 30px 0; gap:6px; justify-content:flex-start; }
.reader__actions button { min-height:36px; font-size:10px; text-transform:none; letter-spacing:.01em; border-color:transparent; }
#atelierBtn { margin-left:auto; border:1px solid var(--line); }
.reader { max-width:72ch; padding:36px clamp(24px,4vw,64px) 64px; }
.reader article > h1 { font-size:clamp(32px,3.7vw,55px); line-height:1.08; letter-spacing:-.025em; margin-bottom:20px; }
.reader .byline { font-size:11px; line-height:1.8; text-transform:none; letter-spacing:.02em; }
.reader__empty { padding:12px 0; height:auto; min-height:480px; }
.reader__empty > div { max-width:460px; }
.atelier-emblem { width:min(100%,270px); height:auto; color:var(--sepia); fill:none; stroke:currentColor; stroke-width:1; stroke-linecap:round; stroke-linejoin:round; }
.reader__empty h1 { font-size:clamp(34px,3.3vw,48px); line-height:1.1; margin:20px 0 16px; }
.reader__empty .empty-copy { font:14px/1.8 var(--font-ui); color:var(--ink-soft); margin:0 auto 22px; max-width:35ch; }
.empty-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.reader__empty button { min-height:44px; font-size:12px; }
.welcome-card { border-radius:18px 18px 6px 6px; border-top:4px solid var(--sepia); padding:36px; box-shadow:0 24px 100px #14171f30; }
.welcome-card__note { font:14px/1.75 var(--font-ui); }
.welcome-card__row button,.welcome-card__skip { min-height:44px; }
.welcome-card__row button[data-variant="primary"]:hover { color:var(--surface); background:var(--ink-soft); }
.cheat { max-height:calc(100dvh - 32px); overflow-y:auto; border-radius:16px; }
@media (prefers-reduced-motion:no-preference) { .reader__empty { animation:page-unfold 440ms ease-out both; } .emblem-orbit { transform-origin:150px 150px; animation:ink-settle 1800ms ease-out both; } }
@keyframes ink-settle { from { opacity:0; transform:rotate(-18deg) scale(.94); } to { opacity:1; transform:rotate(0) scale(1); } }
@media (min-width:769px) and (max-width:1190px) { :root { --rail-w:66px; --list-w:300px; } .rail { padding-inline:10px; align-items:center; } .rail__brand::after { display:none; } .rail__brand { padding:0 0 18px; } .shelf { justify-content:center; padding:10px 6px; } .shelf__label { position:fixed; left:64px; top:auto; max-width:170px; padding:6px 10px; background:var(--surface-raised); color:var(--ink); opacity:0; border:1px solid var(--line); } .shelf[aria-current="true"] .shelf__label { color:var(--ink); } .shelf .count { position:absolute; bottom:1px; right:0; padding:1px; } .atelier-motto { display:none; } .reader { padding:28px 24px; } }
@media (max-width:768px) { .app { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); } .rail { flex-direction:row; align-items:center; padding:8px 12px; gap:4px; overflow-y:hidden; overflow-x:auto; } .rail__brand,.rail__spacer { display:none; } .shelf { width:auto; min-width:50px; min-height:52px; padding:6px 10px; flex-direction:column; gap:4px; } .shelf .sigil { width:19px; height:19px; } .shelf__label { display:block; font-size:9px; white-space:nowrap; } .shelf .count { position:absolute; top:0; right:0; bottom:auto; font-size:8px; padding:2px; } .list__header { padding:18px 20px 12px; } .desk-tools { margin:0 18px 12px; } .list__density { margin:0 18px 8px; } .reader__actions { padding:12px; gap:4px; } .reader__actions button { min-height:40px; padding:6px 8px; } .reader { padding:28px 22px; } .reader article > h1 { font-size:38px; } .reader__empty { min-height:0; } .article-row__title { font-size:22px; } .welcome-card { padding:24px; } }

.feed-status { margin:0 24px 14px; font:11px/1.6 var(--font-ui); color:var(--ink-soft); overflow-wrap:anywhere; }
.feed-status[data-status="fail"] { color:var(--sigil-red); }
