/* ==========================================================================
   FlipDesk — stylesheet
   Paper-and-ink palette, vermilion accent, Fraunces display + DM Sans text.
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #16161d;
  --ink-2: #3a3a44;
  --muted: #6d6c75;
  --line: #e7e3da;
  --line-2: #d9d4c8;
  --accent: #e5462a;
  --accent-hover: #cc3a20;
  --accent-ink: #ffffff;
  --accent-soft: #fdece6;
  --ok: #1f8a5b;
  --ok-soft: #e3f4ec;
  --warn: #b7791f;
  --warn-soft: #fbf1df;
  --danger: #c9302c;
  --danger-soft: #fbe7e6;
  --info-soft: #e8eefc;
  --info: #3355c4;
  --chart-1: #e5462a;
  --chart-2: #2f6fd6;
  --stage: #26262c;
  --stage-2: #1c1c21;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(22, 22, 29, .06), 0 4px 16px rgba(22, 22, 29, .06);
  --shadow-lg: 0 12px 40px rgba(22, 22, 29, .16);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121216;
    --surface: #1a1a20;
    --surface-2: #1f1f26;
    --ink: #eeede9;
    --ink-2: #c9c8c3;
    --muted: #9c9ba4;
    --line: #2a2a33;
    --line-2: #383842;
    --accent: #ff6847;
    --accent-hover: #ff8166;
    --accent-ink: #1a0b07;
    --accent-soft: #3a1d16;
    --ok: #45c08a;
    --ok-soft: #12301f;
    --warn: #e0a54a;
    --warn-soft: #33270f;
    --danger: #ff6b66;
    --danger-soft: #3a1716;
    --info-soft: #1b2440;
    --info: #8aa6ff;
    --chart-1: #ff6847;
    --chart-2: #6ea0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-family: var(--display); font-weight: 650; font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.i { width: 1.15em; height: 1.15em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .container { padding: 0 28px; } }
.section { padding-top: 36px; padding-bottom: 12px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.grow { flex: 1; min-width: 0; }
.pad { padding: 16px; }
[hidden] { display: none !important; }

/* ── Brand ───────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--display); font-size: 1.3rem; letter-spacing: -.02em; }
.brand--sm .brand-name { font-size: 1.1rem; }
.brand-mark { position: relative; width: 26px; height: 22px; flex: none; }
.brand-mark i { position: absolute; top: 0; width: 13px; height: 22px; border-radius: 2px 6px 6px 2px; background: var(--accent); }
.brand-mark i:first-child { left: 0; transform: skewY(8deg); background: var(--ink); border-radius: 6px 2px 2px 6px; }
.brand-mark i:last-child { right: 0; transform: skewY(-8deg); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--ink-2); color: var(--bg); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .875rem; }
.btn-xs { padding: 4px 10px; font-size: .8rem; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-file { position: relative; overflow: hidden; }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.copied { background: var(--ok); color: #fff; border-color: var(--ok); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Header ──────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.main-nav a.active, .main-nav a:hover { background: var(--surface); color: var(--ink); }
.header-search { flex: 1; max-width: 460px; position: relative; display: flex; align-items: center; }
.header-search .i { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.header-search input[type=search] { width: 100%; padding: 10px 14px 10px 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.header-search input:focus { outline: none; border-color: var(--ink); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (max-width: 860px) {
  .main-nav { display: none; }
  .header-search { display: none; }
  .header-actions .btn-primary span { display: none; }
}

/* ── Menus ───────────────────────────────────────────── */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar-btn { border-radius: 50%; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-panel--wide { min-width: 280px; }
.menu-panel a, .menu-panel button:not(.btn) {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 0; background: none; text-decoration: none; text-align: left; cursor: pointer; color: var(--ink);
}
.menu-panel a:hover, .menu-panel button:not(.btn):hover { background: var(--surface-2); color: var(--ink); }
.menu-panel form { margin: 0; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head span { color: var(--muted); font-size: .875rem; }

/* ── Avatars ─────────────────────────────────────────── */
.avatar { width: var(--s, 36px); height: var(--s, 36px); border-radius: 50%; object-fit: cover; flex: none; }
.avatar--initials {
  display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--s, 36px) * .38);
  background: hsl(var(--h, 20) 70% 88%); color: hsl(var(--h, 20) 55% 28%);
}
@media (prefers-color-scheme: dark) { .avatar--initials { background: hsl(var(--h, 20) 35% 26%); color: hsl(var(--h, 20) 70% 82%); } }

/* ── Hero ────────────────────────────────────────────── */
.hero { padding: 56px 0 32px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.2vw, 3.8rem); line-height: 1.03; letter-spacing: -.025em; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.lead-sm { color: var(--ink-2); max-width: 46em; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 26px 0 0; color: var(--ink-2); font-weight: 500; }
.hero-points li { display: flex; align-items: center; gap: 6px; }
.hero-points .i { color: var(--accent); }
.hero-art { position: relative; height: 420px; }
.hero-book { position: absolute; inset: 0; }
.hero-book img, .hero-book-placeholder {
  position: absolute; width: 58%; aspect-ratio: 1 / 1.414; object-fit: cover; border-radius: 4px 10px 10px 4px;
  box-shadow: var(--shadow-lg); background: var(--surface);
}
.hero-book-0 { left: 34%; top: 2%; transform: rotate(5deg); z-index: 3; }
.hero-book-1 { left: 10%; top: 10%; transform: rotate(-7deg); z-index: 2; }
.hero-book-2 { left: 48%; top: 22%; transform: rotate(12deg); z-index: 1; opacity: .9; }
.hero-book-placeholder { left: 22%; top: 4%; transform: rotate(-4deg); background: linear-gradient(135deg, var(--accent), #f6a96b); display: grid; place-content: center; gap: 10px; padding: 30px; }
.hero-book-placeholder span { display: block; width: 140px; height: 12px; border-radius: 6px; background: rgba(255,255,255,.7); }
.hero-book-placeholder span + span { width: 90px; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { height: 300px; max-width: 360px; margin: 0 auto; width: 100%; }
}

/* ── Section heads, chips, grids ─────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-family: var(--display); font-size: 1.5rem; font-weight: 650; margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin-bottom: .15em; }
.page-head p { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .875rem; color: var(--muted); text-decoration: none; margin-bottom: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 24px; scrollbar-width: thin; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); text-decoration: none; font-size: .9rem; font-weight: 500; white-space: nowrap;
}
.chip em { font-style: normal; color: var(--muted); font-size: .8rem; }
.chip:hover, .chip.active { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); }
.chip--sm { padding: 4px 11px; font-size: .82rem; }

.grid { display: grid; gap: 28px 22px; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid--tight { gap: 20px 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 200px); gap: 22px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.scroller > * { scroll-snap-align: start; }

/* ── Cards ───────────────────────────────────────────── */
.card { min-width: 0; }
.card-cover {
  position: relative; display: block; aspect-ratio: 1 / var(--ratio, 1.414); max-height: 330px;
  border-radius: 4px 8px 8px 4px; overflow: hidden; background: var(--surface);
  box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 8px 22px rgba(22, 22, 29, .12);
  transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s;
}
.card-cover::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(90deg, rgba(0,0,0,.14), transparent); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-cover, .manage-card:hover .card-cover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 2px 2px rgba(0,0,0,.06), 0 18px 34px rgba(22,22,29,.2); }
.card-badge { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.7); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.card-badge .i { width: 15px; height: 15px; }
.card-pages { position: absolute; left: 10px; bottom: 8px; font-size: .72rem; font-weight: 700; background: rgba(0,0,0,.66); color: #fff; padding: 2px 8px; border-radius: 999px; opacity: 0; transition: opacity .2s; }
.card:hover .card-pages { opacity: 1; }
.card-body { padding-top: 12px; }
.card-title { font-size: .98rem; font-weight: 650; margin: 0 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { text-decoration: none; }
.card-author { font-size: .85rem; color: var(--muted); text-decoration: none; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); font-size: .8rem; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .i { width: 14px; height: 14px; }

/* ── Publishers / features ───────────────────────────── */
.publishers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.publisher { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.publisher:hover { border-color: var(--ink); color: var(--ink); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; padding: 28px 0 40px; }
.features > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.features p { margin: 0; font-size: .93rem; }
.feature-ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: 12px; }

/* ── Empty states & errors ───────────────────────────── */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state--page { padding: 90px 16px; }
.empty-state .actions-row { justify-content: center; }
.error-code { font-family: var(--display); font-size: 5rem; line-height: 1; color: var(--accent); margin: 0 0 10px; }

/* ── Footer ──────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 34px 0; }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr auto; gap: 24px; align-items: start; }
.footer-inner p { margin: 8px 0 0; max-width: 32em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { text-decoration: none; color: var(--ink-2); }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }

/* ── Forms ───────────────────────────────────────────── */
.form .field, .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > span { font-weight: 600; font-size: .9rem; }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23888' stroke-width='1.8'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
textarea.code { font: .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.is-invalid input, .is-invalid textarea, .is-invalid select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .85rem; margin: 2px 0 0; font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.input-prefix em { font-style: normal; padding: 10px 0 10px 12px; color: var(--muted); white-space: nowrap; }
.input-prefix input { border: 0; padding-left: 2px; box-shadow: none !important; }
.input-prefix:focus-within { border-color: var(--ink); }
.input-icon { position: relative; flex: 1; min-width: 180px; }
.input-icon .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 38px; }
.check { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; font-size: .95rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.radio-cards label { position: relative; display: flex; flex-direction: column; padding: 12px 14px 12px 40px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.radio-cards input { position: absolute; left: 14px; top: 15px; accent-color: var(--accent); width: 16px; height: 16px; }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-cards small { color: var(--muted); font-size: .8rem; }
.radio-cards--sm { margin-bottom: 16px; }
.form-section + .form-section { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section h2 { font-size: 1rem; margin-bottom: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.inline-field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.inline-field label { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.inline-field input[type=number] { width: 72px; padding: 6px 8px; }
.inline-upload { margin-top: 10px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: .9rem; }

/* ── Auth ────────────────────────────────────────────── */
.auth { display: grid; place-items: center; padding: 56px 16px; min-height: calc(100vh - 220px); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.9rem; }
.auth-alt { text-align: center; margin: 18px 0 0; color: var(--muted); }
.auth-card--locked { text-align: center; }
.lock-cover { position: relative; width: 120px; margin: 0 auto 18px; }
.lock-cover img { width: 100%; border-radius: 4px 8px 8px 4px; filter: blur(3px) saturate(.6); box-shadow: var(--shadow); }
.lock-cover span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.lock-cover .i { width: 34px; height: 34px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.auth-card--locked .form { text-align: left; }

/* ── Toasts, badges, notices ─────────────────────────── */
.toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .25s ease-out; }
.toast--error { background: var(--danger); color: #fff; }
.toast--info { background: var(--info); color: #fff; }
.toast-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; display: grid; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge .i { width: 12px; height: 12px; }
.badge--live { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge--draft { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge--private, .badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge--unlisted { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge--featured { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.notice { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); margin-bottom: 20px; font-weight: 500; }

/* ── Pagination, tabs, segmented ─────────────────────── */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 36px 0 10px; }
.pagination a, .pagination span { min-width: 40px; padding: 8px 12px; text-align: center; border-radius: 10px; border: 1px solid var(--line-2); text-decoration: none; background: var(--surface); }
.pagination .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tabs a { padding: 10px 0; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-color: var(--accent); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg a { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .875rem; color: var(--muted); display: inline-flex; align-items: center; }
.seg a.active { background: var(--ink); color: var(--bg); }
.seg--icons a { padding: 6px 10px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { width: auto; border-radius: 999px; padding-top: 8px; padding-bottom: 8px; }

/* ── Reader page ─────────────────────────────────────── */
.reader-stage { background: var(--stage); padding: 0; }
.reader {
  --tb: 52px;
  position: relative; display: flex; flex-direction: column;
  height: min(calc(100vh - 64px), 920px); min-height: 460px;
  background: radial-gradient(ellipse at 50% 35%, #3a3a42 0%, var(--stage) 55%, var(--stage-2) 100%);
  color: #e9e8e4; user-select: none; -webkit-user-select: none;
}
.reader--embed { height: 100vh; min-height: 0; }
.reader.is-fullscreen, .reader.pseudo-fs { height: 100vh; }
.reader.pseudo-fs { position: fixed; inset: 0; z-index: 300; }
.reader-toolbar {
  height: var(--tb); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 10px; background: rgba(0,0,0,.28); border-bottom: 1px solid rgba(255,255,255,.06); z-index: 5;
}
.tb-group { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tb-nav { position: absolute; left: 50%; transform: translateX(-50%); }
.tb-btn, .tb-zoom {
  display: inline-grid; place-items: center; height: 36px; min-width: 36px; padding: 0 6px; border-radius: 9px;
  border: 0; background: transparent; color: #e9e8e4; cursor: pointer; text-decoration: none;
}
.tb-btn:hover, .tb-zoom:hover { background: rgba(255,255,255,.1); color: #fff; }
.tb-btn .i { width: 20px; height: 20px; }
.tb-zoom { font-size: .8rem; font-weight: 600; min-width: 52px; font-variant-numeric: tabular-nums; }
.tb-page { display: flex; align-items: center; gap: 6px; font-size: .88rem; margin: 0 4px; font-variant-numeric: tabular-nums; }
.reader .tb-page-input { width: 64px; text-align: center; padding: 5px 4px !important; border-radius: 8px !important; border: 1px solid rgba(255,255,255,.16) !important; background: rgba(255,255,255,.08) !important; color: #fff !important; }
.tb-page span { color: rgba(255,255,255,.6); white-space: nowrap; }
.tb-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-decoration: none; padding: 0 8px; color: #fff; }
.when-fs { display: none; }
.is-fullscreen .when-fs, .pseudo-fs .when-fs { display: block; }
.is-fullscreen .when-normal, .pseudo-fs .when-normal { display: none; }
.reader-body { flex: 1; display: flex; min-height: 0; position: relative; }
.reader-viewport { position: relative; flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.is-zoomed .reader-viewport { overflow: auto; align-items: flex-start; justify-content: flex-start; cursor: grab; }
.is-zoomed.is-panning .reader-viewport { cursor: grabbing; }
.book-zoom { position: relative; margin: auto; flex: none; }
.book-wrap { transform-origin: 0 0; margin: 0 auto; transition: opacity .3s; opacity: 0; }
.is-ready .book-wrap { opacity: 1; }
.is-zoomed .book { pointer-events: none; }
.book .page { background: #fff; overflow: hidden; }
.page-inner { position: relative; width: 100%; height: 100%; background: #fff; }
.page-inner canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.page-spinner { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; border: 3px solid #e3e1db; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.is-rendered .page-spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.stf__parent { margin: 0 auto; }
.stf__block { filter: drop-shadow(0 18px 30px rgba(0,0,0,.45)); }

.nav-arrow {
  position: absolute; top: 50%; z-index: 4; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.1); color: #fff; cursor: pointer; transition: background .15s, opacity .2s;
}
.nav-arrow:hover { background: rgba(255,255,255,.22); }
.nav-arrow--prev { left: 14px; }
.nav-arrow--next { right: 14px; }
.nav-arrow .i { width: 22px; height: 22px; }
.at-start .nav-arrow--prev, .at-end .nav-arrow--next { opacity: 0; pointer-events: none; }
.is-zoomed .nav-arrow { position: fixed; }
.reader-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: rgba(255,255,255,.75); }
.reader-error { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px; color: #fff; }
.loader-book { display: flex; gap: 3px; perspective: 400px; }
.loader-book span { width: 26px; height: 36px; background: #fff; border-radius: 2px; transform-origin: left center; animation: leaf 1.4s ease-in-out infinite; opacity: .85; }
.loader-book span:nth-child(2) { animation-delay: .15s; }
.loader-book span:nth-child(3) { animation-delay: .3s; background: var(--accent); }
@keyframes leaf { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(-70deg); } }
.reader-progress { height: 3px; background: rgba(255,255,255,.08); flex: none; }
.reader-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }

.reader-panel {
  width: 250px; flex: none; display: flex; flex-direction: column; background: rgba(12,12,16,.55);
  border-right: 1px solid rgba(255,255,255,.07); z-index: 6; backdrop-filter: blur(8px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.thumbs { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; padding: 14px; align-content: start; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; color: rgba(255,255,255,.7); font-size: .75rem; }
.thumb-img { width: 100%; aspect-ratio: 1 / var(--ratio, 1.414); background: rgba(255,255,255,.9); border-radius: 2px; overflow: hidden; outline: 2px solid transparent; outline-offset: 2px; }
.thumb-img canvas { width: 100%; height: 100%; }
.thumb.active .thumb-img { outline-color: var(--accent); }
.thumb.active { color: #fff; font-weight: 700; }
.search-form { padding: 12px 12px 4px; }
.search-form input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.search-status { padding: 0 14px; margin: 6px 0; color: rgba(255,255,255,.6); }
.search-results { list-style: none; margin: 0; padding: 0 6px 12px; overflow-y: auto; flex: 1; }
.search-results button { display: block; width: 100%; text-align: left; background: none; border: 0; color: rgba(255,255,255,.82); padding: 9px 8px; border-radius: 8px; cursor: pointer; font-size: .85rem; line-height: 1.4; }
.search-results button:hover { background: rgba(255,255,255,.08); }
.search-results b { display: block; color: #fff; font-size: .75rem; margin-bottom: 2px; }
.search-results mark { background: var(--accent); color: #fff; border-radius: 3px; padding: 0 2px; }
@media (max-width: 800px) {
  .reader-panel { position: absolute; inset: 0 auto 0 0; width: min(280px, 85vw); background: rgba(16,16,20,.96); }
  .nav-arrow { display: none; }
  .hide-sm { display: none !important; }
  .tb-nav { position: static; transform: none; }
  .reader { height: calc(100svh - 64px); }
  .reader--embed { height: 100svh; }
}

.modal { border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); user-select: text; }
.modal::backdrop { background: rgba(10,10,14,.55); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 22px; margin: 0; }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 1.4rem; }
.modal-head .tb-btn { color: var(--muted); }
.modal-head .tb-btn:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 16px 22px 22px; }
.social-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.social { padding: 7px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; font-size: .85rem; font-weight: 600; }
.social:hover { border-color: var(--ink); color: var(--ink); }

.embed-brand { position: fixed; right: 12px; bottom: 14px; z-index: 10; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; font-weight: 700; text-decoration: none; transform: scale(.9); transform-origin: right bottom; }
.embed-brand .brand-mark { transform: scale(.7); }
.embed-brand:hover { color: #fff; background: rgba(0,0,0,.75); }
.embed-unavailable { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; background: var(--stage); color: #eee; }
body.bare { background: var(--stage); }

.pub-details { display: grid; grid-template-columns: 1fr 340px; gap: 40px; padding-top: 34px; }
.pub-badges { display: flex; gap: 8px; align-items: center; }
.pub-title { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); margin: 10px 0 18px; }
.pub-author-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.pub-author { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.pub-author > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }
.pub-author small { color: var(--muted); }
.pub-author-row form { margin: 0; }
.pub-description { color: var(--ink-2); max-width: 46em; margin-bottom: 16px; }
.pub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-actions form { margin: 0; }
.like-btn .on { display: none; color: var(--accent); }
.like-btn.is-liked .on { display: block; }
.like-btn.is-liked .off { display: none; }
.like-btn.is-liked { border-color: var(--accent); }
.save-list { max-height: 220px; overflow-y: auto; padding: 4px 10px; }
.save-new { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.save-new input { padding: 7px 10px; }
.save-menu .menu-panel { left: 0; right: auto; }
.owner-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 10px; border-radius: var(--radius); background: var(--accent-soft); }
.pub-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 18px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pub-facts div { background: var(--surface); padding: 12px 14px; }
.pub-facts dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.pub-facts dd { margin: 2px 0 0; font-weight: 650; font-size: 1.05rem; }
@media (max-width: 900px) { .pub-details { grid-template-columns: 1fr; gap: 20px; } }

/* ── Profile ─────────────────────────────────────────── */
.profile-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 40px 0 30px; }
.profile-inner { display: flex; align-items: flex-start; gap: 26px; flex-wrap: wrap; }
.profile-info { flex: 1; min-width: 240px; }
.profile-info h1 { margin-bottom: 0; }
.profile-info > p.muted { margin-bottom: 10px; }
.profile-bio { max-width: 44em; color: var(--ink-2); }
.profile-site { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--accent); }
.profile-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 22px; padding: 0; margin: 14px 0 0; color: var(--muted); }
.profile-stats b { color: var(--ink); font-size: 1.1rem; }

/* ── Collections ─────────────────────────────────────── */
.grid--collections { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 20px; }
.collection-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.collection-stack { position: relative; aspect-ratio: 4 / 3.4; margin-bottom: 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.collection-stack img { position: absolute; width: 46%; aspect-ratio: 1 / 1.414; object-fit: cover; top: 12%; left: 27%; border-radius: 2px 5px 5px 2px; box-shadow: 0 6px 16px rgba(0,0,0,.18); transition: transform .3s; }
.collection-stack img:nth-last-child(2) { transform: translateX(-34%) rotate(-8deg); }
.collection-stack img:nth-last-child(3) { transform: translateX(34%) rotate(8deg); }
.collection-card:hover .collection-stack img:last-child { transform: translateY(-6px); }
.collection-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.collection-empty .i { width: 40px; height: 40px; }
.sortable { list-style: none; margin: 0; padding: 0; }
.sortable li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sortable li.dragging { opacity: .5; }
.sortable img { width: 38px; aspect-ratio: 1 / 1.414; object-fit: cover; border-radius: 2px; flex: none; }
.sortable a { font-weight: 600; text-decoration: none; display: block; }
.sortable form { margin: 0; }
.drag-handle { cursor: grab; color: var(--muted); letter-spacing: -3px; padding: 0 4px; }
.pick-list { max-height: 280px; overflow-y: auto; margin-bottom: 12px; }

/* ── Dashboard shell ─────────────────────────────────── */
body.dash { background: var(--bg); }
.dash-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.dash-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.dash-side .brand { padding: 0 6px; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.dash-nav a:hover { background: var(--surface-2); color: var(--ink); }
.dash-nav a.active { background: var(--accent-soft); color: var(--accent); }
.dash-side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.dash-user { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px; border-radius: 10px; }
.dash-user > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.dash-user strong, .dash-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-user small { color: var(--muted); }
.dash-side-links { display: flex; flex-direction: column; margin-top: 6px; }
.dash-side-links a, .dash-side-links button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; text-decoration: none; color: var(--muted); font-size: .9rem; cursor: pointer; border-radius: 8px; }
.dash-side-links a:hover, .dash-side-links button:hover { color: var(--ink); background: var(--surface-2); }
.dash-side-links form { margin: 0; }
.dash-main { min-width: 0; display: flex; flex-direction: column; }
.dash-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.dash-topbar .header-search { display: flex; }
.dash-toggle { display: none; }
.dash-content { padding: 28px; width: 100%; max-width: 1280px; }
.side-scrim { display: none; }
@media (max-width: 960px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-side { position: fixed; z-index: 60; left: 0; width: 270px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .side-open .dash-side { transform: none; }
  .side-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.35); }
  .dash-toggle { display: inline-grid; }
  .dash-topbar { padding: 0 14px; }
  .dash-content { padding: 20px 14px; }
}

/* ── Panels, stats, charts ───────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel--danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title h2, .panel-h { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.panel-h { margin-bottom: 14px; }
.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat strong { font-family: var(--display); font-size: 2rem; font-weight: 650; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cols > .panel { margin-bottom: 0; }
.cols + .panel, .cols + .cols, .cols + p { margin-top: 20px; }
.cols--3 { grid-template-columns: repeat(3, 1fr); }
.cols--side { grid-template-columns: 1fr 340px; }
@media (max-width: 1000px) { .cols, .cols--3, .cols--side { grid-template-columns: 1fr; } }

.chart { width: 100%; height: 230px; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-area { fill: color-mix(in srgb, var(--chart-1) 14%, transparent); }
.chart-line { fill: none; stroke: var(--chart-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-line--2 { stroke: var(--chart-2); stroke-width: 2; stroke-dasharray: 5 4; }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: color-mix(in srgb, var(--chart-1) 25%, transparent); }
.legend { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); }
.lg::before { content: ''; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--chart-1); }
.lg--2::before { background: var(--chart-2); }
.page-bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; overflow-x: auto; padding-bottom: 20px; }
.page-bar { position: relative; flex: 1 0 14px; height: 100%; display: flex; align-items: flex-end; }
.page-bar span { display: block; width: 100%; background: var(--chart-1); border-radius: 3px 3px 0 0; opacity: .85; }
.page-bar:hover span { opacity: 1; }
.page-bar em { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(80px, 1fr) 1.4fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--chart-1); border-radius: 4px; }
.hbar-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar-val small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.kv div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv span { color: var(--muted); }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border: 0; }
.rank img { width: 34px; aspect-ratio: 1 / 1.414; object-fit: cover; border-radius: 2px; }
.rank a { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num small { color: var(--muted); font-weight: 400; }

/* ── Tables & toolbar ────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar select { width: auto; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.w-check { width: 40px; }
.w-actions { width: 160px; }
.row-pub { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.row-pub img { width: 40px; aspect-ratio: 1 / 1.414; object-fit: cover; border-radius: 2px 4px 4px 2px; box-shadow: 0 2px 6px rgba(0,0,0,.15); flex: none; }
.row-pub > div { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 650; text-decoration: none; }
.row-user { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.row-user > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.bulk-bar { position: sticky; top: 72px; z-index: 10; display: none; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); }
.bulk-bar.show { display: flex; }
.bulk-bar select { width: auto; background-color: var(--surface); color: var(--ink); padding-top: 6px; padding-bottom: 6px; }
.bulk-bar .btn-dark { background: var(--accent); color: var(--accent-ink); }
.manage-card { position: relative; }
.manage-check { position: absolute; z-index: 2; top: 8px; left: 12px; background: var(--surface); border-radius: 6px; padding: 4px; display: grid; box-shadow: var(--shadow); }
.manage-check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.select-all { margin-bottom: 14px; }
@media (max-width: 1100px) { .hide-md { display: none; } }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* ── Upload ──────────────────────────────────────────── */
.upload-grid { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; }
.upload-grid > div:last-child { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
@media (max-width: 960px) { .upload-grid { grid-template-columns: 1fr; } }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 260px; padding: 28px; border: 2px dashed var(--line-2); border-radius: 18px; background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.dz-icon .i { width: 26px; height: 26px; }
.dropzone--sm { min-height: 110px; padding: 16px; border-radius: var(--radius); }
.dropzone--sm .dz-icon { width: 40px; height: 40px; }
.has-file .dropzone { min-height: 120px; }
.file-row { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.file-row .file-info { display: flex; flex-direction: column; min-width: 0; }
.file-row .file-info strong { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-preview img { width: 74px; aspect-ratio: 1 / 1.414; object-fit: cover; border-radius: 2px 6px 6px 2px; box-shadow: var(--shadow); }
.cover-preview--lg img { width: 150px; }
.upload-progress { position: relative; height: 34px; border-radius: 10px; background: var(--surface-2); overflow: hidden; margin: 14px 0 0; border: 1px solid var(--line); }
.upload-progress span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-soft); transition: width .2s; }
.upload-progress b { position: relative; display: grid; place-items: center; height: 100%; font-size: .85rem; }
.edit-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.edit-grid > form { margin-bottom: 0; }
@media (max-width: 1000px) { .edit-grid { grid-template-columns: 1fr; } }
.embed-preview { position: relative; padding-top: max(56%, 340px); border-radius: var(--radius-sm); overflow: hidden; background: var(--stage); }
.embed-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Settings / people ───────────────────────────────── */
.settings { max-width: 760px; }
.avatar-row { display: flex; align-items: center; gap: 18px; }
.avatar-row form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.people { list-style: none; padding: 0; margin: 0; }
.people li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people a { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.people a > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
