/* ReadMeIfYouCan – web UI */
:root {
  --bg: #0a0b10;
  --bg-elev: #12141c;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.065);
  --surface-3: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eceef4;
  --text-2: #b4b9c7;
  --muted: #7d8395;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #22d3ee;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.75);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f4f8; --bg-elev: #ffffff;
    --surface: rgba(20, 20, 50, 0.035); --surface-2: rgba(20, 20, 50, 0.06); --surface-3: rgba(20, 20, 50, 0.1);
    --border: rgba(20, 20, 50, 0.09); --border-strong: rgba(20, 20, 50, 0.18);
    --text: #15161d; --text-2: #3d4150; --muted: #6b7083;
    --shadow: 0 10px 30px -12px rgba(30, 30, 80, 0.25), 0 2px 6px rgba(30, 30, 80, 0.08);
    --shadow-lg: 0 30px 60px -20px rgba(30, 30, 80, 0.35);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: -20% -10% auto auto; width: 70vw; height: 70vh; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.16), transparent 70%),
              radial-gradient(closest-side at 30% 70%, rgba(236, 72, 153, 0.10), transparent 70%);
  filter: blur(20px);
}
a { color: inherit; }
::selection { background: rgba(139, 92, 246, 0.35); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------ controls */
button, .btn {
  font: inherit; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
button:hover, .btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 24px -8px rgba(139, 92, 246, .7); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }
.btn-danger:hover { background: rgba(248, 113, 113, .16); border-color: rgba(248, 113, 113, .5); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-icon { padding: 8px; border-radius: 10px; }
.btn svg, button svg { width: 18px; height: 18px; flex: none; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: rgba(139, 92, 246, .6); box-shadow: 0 0 0 4px rgba(139, 92, 246, .15); background: var(--surface-2); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8395' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text-2); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; font-size: 14px; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); position: relative; padding: 0; border: none; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip.ok { color: var(--ok); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .25); }
.chip.warn { color: var(--warn); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .25); }
.chip.danger { color: var(--danger); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .25); }
.chip.accent { color: #c4b5fd; background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .3); }
@media (prefers-color-scheme: light) { .chip.accent { color: #6d28d9; } }

.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.segmented button { border: none; background: transparent; padding: 7px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.segmented button:hover { background: var(--surface-2); color: var(--text); }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); }

.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(16px); }
.card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.card h2 svg { width: 20px; height: 20px; color: var(--accent); }
.card > p.lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ shell */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 14px;
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg-elev) 70%, transparent); backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 20px -6px rgba(139, 92, 246, .8); }
.brand-logo svg { width: 19px; height: 19px; color: #fff; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--text-2); text-decoration: none;
  font-weight: 560; font-size: 14.5px; transition: background .15s, color .15s; position: relative;
}
.nav-item svg { width: 19px; height: 19px; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-item .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.nav-section { margin: 18px 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px 0; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--grad); flex: none; text-transform: uppercase; }
.sidebar-foot .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar-foot .who strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: 12px; color: var(--muted); }

main.view { padding: 34px 40px 80px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* mobile */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 8px; border-right: none; border-top: 1px solid var(--border); justify-content: space-around; }
  .brand, .nav-section, .sidebar-foot .who, .nav-item span.label, .nav-item .badge { display: none; }
  .nav-item { flex-direction: column; gap: 2px; padding: 8px 12px; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { margin: 0; border: none; padding: 0; }
  main.view { padding: 24px 18px 110px; }
  .page-head h1 { font-size: 27px; }
}

/* ------------------------------------------------------------------ library */
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; min-width: 110px; }
.stat strong { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 550; }

.searchbar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.searchbar:focus-within { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 5px rgba(139, 92, 246, .13), var(--shadow); }
.searchbar > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.searchbar input { border: none; background: transparent; padding: 10px 0; font-size: 16px; box-shadow: none; }
.searchbar input:focus { box-shadow: none; background: transparent; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0 24px; }
.toolbar select { width: auto; }

.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 22px; }
.book { cursor: pointer; display: flex; flex-direction: column; gap: 10px; outline: none; }
.cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2);
  box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); background: linear-gradient(100deg, rgba(255,255,255,.14) 0%, transparent 8%, transparent 92%, rgba(0,0,0,.15)); pointer-events: none; }
.book:hover .cover, .book:focus-visible .cover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-lg); }
.cover .ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 14px; color: #fff; }
.cover .ph strong { font-size: 16px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.cover .ph span { font-size: 12px; opacity: .85; font-weight: 600; }
.cover .badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; justify-content: space-between; z-index: 1; }
.cover .tag { font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 7px; background: rgba(10, 11, 16, .72); color: #fff; backdrop-filter: blur(8px); letter-spacing: .03em; }
.cover .tag.loan { background: rgba(251, 191, 36, .92); color: #241a00; }
.cover .tag.expired { background: rgba(248, 113, 113, .92); }
.cover .tag.ai { background: rgba(139, 92, 246, .9); }
.cover .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.35); z-index: 1; }
.cover .bar span { display: block; height: 100%; background: var(--grad); }
.book.expired .cover { filter: grayscale(.9) brightness(.6); }
.book .meta strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; font-weight: 650; line-height: 1.3; }
.book .meta span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.empty { text-align: center; padding: 70px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--accent); margin-bottom: 12px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 19px; }

.hits { display: flex; flex-direction: column; gap: 12px; }
.hit { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: background .15s, border-color .15s; }
.hit:hover { background: var(--surface-2); border-color: var(--border-strong); }
.hit .cover { border-radius: 8px; box-shadow: none; }
.hit .cover .ph strong { font-size: 9px; }
.hit .cover .ph span, .hit .cover .badges { display: none; }
.hit h4 { margin: 0; font-size: 15.5px; }
.hit p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
mark { background: rgba(236, 72, 153, .22); color: inherit; padding: 0 2px; border-radius: 4px; }

/* ------------------------------------------------------------------ drawer */
.scrim { position: fixed; inset: 0; background: rgba(5, 6, 10, .55); backdrop-filter: blur(3px); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 41; background: var(--bg-elev); border-left: 1px solid var(--border);
  transform: translateX(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); overflow-y: auto; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: none; }
.drawer-hero { position: relative; padding: 28px 28px 24px; display: flex; gap: 22px; overflow: hidden; }
.drawer-hero .backdrop { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) saturate(1.4); opacity: .45; }
.drawer-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--bg-elev)); }
.drawer-hero > * { position: relative; z-index: 1; }
.drawer-hero .cover { width: 150px; flex: none; }
.drawer-hero h2 { margin: 6px 0 4px; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.drawer-hero .authors { color: var(--text-2); font-weight: 550; }
.drawer-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.drawer-body { padding: 4px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.summary-card { border-radius: 14px; padding: 16px 18px; background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(236, 72, 153, .08)); border: 1px solid rgba(139, 92, 246, .25); }
.summary-card h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
.summary-card h3 svg { width: 16px; height: 16px; color: #c4b5fd; }
.summary-card p { margin: 0; color: var(--text-2); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 6px 0 -6px; }

/* ------------------------------------------------------------------ modal */
dialog.modal { border: 1px solid var(--border); border-radius: 20px; padding: 0; background: var(--bg-elev); color: var(--text); width: min(560px, 94vw); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(5, 6, 10, .6); backdrop-filter: blur(4px); }
.modal-head { padding: 22px 24px 4px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-body { padding: 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 16px; padding: 34px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: rgba(139, 92, 246, .07); }
.dropzone svg { width: 34px; height: 34px; color: var(--accent); }
.dropzone strong { display: block; margin-top: 8px; }
.drop-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 11, 16, .75); backdrop-filter: blur(6px); border: 3px dashed var(--accent); pointer-events: none; opacity: 0; transition: opacity .15s; }
.drop-overlay.show { opacity: 1; }
.drop-overlay div { font-size: 22px; font-weight: 800; }

/* ------------------------------------------------------------------ lists / tables */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .icon-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.list-item .icon-box svg { width: 19px; height: 19px; color: var(--text-2); }
.list-item .main { flex: 1; min-width: 0; }
.list-item .main strong { display: block; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .main span { font-size: 13px; color: var(--muted); }
.job-error { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .2); color: var(--danger); font-size: 12.5px; white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 520px) { .settings-grid { grid-template-columns: 1fr; } }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, .15); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(251, 191, 36, .15); }
.status-dot.danger { background: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, .15); }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 14px; max-width: 420px; animation: toast-in .3s cubic-bezier(.2, .8, .2, 1); }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: var(--ok); } .toast.error svg { color: var(--danger); } .toast.info svg { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (max-width: 860px) { .toasts { bottom: 90px; right: 12px; left: 12px; align-items: stretch; } }

/* ------------------------------------------------------------------ login */
.auth { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #0b0820; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff; }
.auth-art .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .75; animation: float 14s ease-in-out infinite; }
.auth-art .b1 { width: 420px; height: 420px; background: #6366f1; top: -80px; left: -60px; }
.auth-art .b2 { width: 380px; height: 380px; background: #ec4899; bottom: -100px; right: -40px; animation-delay: -5s; }
.auth-art .b3 { width: 260px; height: 260px; background: #22d3ee; top: 40%; left: 45%; opacity: .45; animation-delay: -9s; }
@keyframes float { 50% { transform: translate(30px, -24px) scale(1.06); } }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h1 { font-size: 46px; line-height: 1.05; letter-spacing: -.035em; margin: 0 0 16px; font-weight: 850; max-width: 520px; }
.auth-art p { font-size: 17px; opacity: .85; max-width: 460px; margin: 0; }
.auth-books { display: flex; gap: 14px; margin-top: 36px; }
.auth-books div { width: 74px; aspect-ratio: 2/3; border-radius: 8px; box-shadow: 0 20px 40px -12px rgba(0,0,0,.6); background: rgba(255,255,255,.12); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); }
.auth-books div:nth-child(2) { transform: translateY(-14px) rotate(3deg); background: rgba(236, 72, 153, .35); }
.auth-books div:nth-child(3) { transform: translateY(6px) rotate(-4deg); background: rgba(99, 102, 241, .4); }
.auth-books div:nth-child(4) { transform: translateY(-6px) rotate(2deg); background: rgba(34, 211, 238, .3); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 28px; letter-spacing: -.025em; margin: 0 0 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .btn-primary { padding: 12px; font-size: 15.5px; margin-top: 6px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); color: var(--danger); }
.alert.info { background: rgba(139, 92, 246, .1); border-color: rgba(139, 92, 246, .3); color: #c4b5fd; }
@media (prefers-color-scheme: light) { .alert.info { color: #6d28d9; } }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { min-height: 260px; padding: 32px; } .auth-art h1 { font-size: 32px; } .auth-books { display: none; } }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 860px) {
  .searchbar { flex-wrap: wrap; padding: 6px 10px 10px 14px; }
  .searchbar input { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .searchbar .segmented { width: 100%; }
  .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented button { flex: 1; }
  .page-head > .row { width: 100%; }
  .stats { width: 100%; }
  .stat { flex: 1; min-width: 0; padding: 8px 12px; }
  .covers { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 16px; }
  .hit { grid-template-columns: 52px 1fr; }
  .hit > :last-child { display: none; }
  .drawer-hero { flex-direction: column; }
  .drawer-hero .cover { width: 120px; }
  .kv { grid-template-columns: 110px 1fr; }
}

/* ------------------------------------------------------------------ annotations */
.ann { position: relative; padding: 16px 18px 16px 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.ann::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.ann:hover { border-color: var(--border-strong); }
.ann-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-book { font-weight: 650; text-decoration: none; }
.ann-book:hover { text-decoration: underline; }
.ann blockquote { margin: 0; padding: 2px 0 2px 14px; border-left: 3px solid color-mix(in srgb, var(--c) 70%, transparent); color: var(--text); font-size: 15.5px; line-height: 1.6; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 60%); border-radius: 0 8px 8px 0; }
.ann-note { margin: 0; color: var(--text-2); font-style: italic; }
.ann .summary-card { padding: 12px 14px; }
.md p, .md ul { margin: 0 0 8px; color: var(--text-2); }
.md h4 { margin: 8px 0 4px; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; padding: 0; background: var(--c); border: 2px solid transparent; opacity: .55; }
.color-dot.active { opacity: 1; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); }
.color-dot:hover { background: var(--c); opacity: .9; }
