:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #fff;
  --surface: #fff;
  --text: #242424;
  --muted: #666;
  --line: #e5e5e5;
  --accent: #235c99;
  --soft: #f6f6f6;
  --prose-size: 17px;
  font-family: var(--font);
  color: var(--text);
  background: var(--background);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --background: #191919;
  --surface: #222;
  --text: #e8e8e8;
  --muted: #aaa;
  --line: #383838;
  --accent: #91bbed;
  --soft: #252525;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 65px; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { background: none; }
button:focus-visible, a:focus-visible, input:focus-visible, img:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -70px; z-index: 20; padding: 12px; background: var(--surface); }
.skip-link:focus { top: 10px; }
.topbar { max-width: 880px; margin: auto; padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); font-size: 16px; font-weight: 600; text-decoration: none; }
.reading-settings { position: relative; font-size: 13px; color: var(--muted); }
.reading-settings summary { padding: 8px 0 8px 12px; }
.tools { position: absolute; right: 0; top: 100%; min-width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); z-index: 5; }
.tools button { display: block; width: 100%; padding: 10px; text-align: left; border: 0; font-size: 14px; color: var(--text); }
.tools button:hover { background: var(--soft); }
.search-box { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.search-box input { min-width: 0; width: 100%; border: 0; background: transparent; font-size: 14px; outline: none; }
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
kbd { font: 12px monospace; color: var(--muted); }
.empty-state { padding: 24px 0; color: var(--muted); }
.library-main, .paper-main { max-width: 880px; padding: 32px 28px 48px; margin: auto; overflow-wrap: anywhere; }
