:root {
  --ink: #07111f;
  --text: #07111f;
  --surface: #f3f6fb;
  --surface-high: #e9eff8;
  --line: rgba(7, 17, 31, 0.1);
  --blue: #2540f5;
  --blue-deep: #121fb8;
  --cyan: #73d9ff;
  --orange: #f66230;
  --orange-deep: #d84a1c;
  --red: #ec3c49;
  --green: #1fa855;
  --muted: #56667d;
  --shadow: 0 22px 70px rgba(7, 17, 31, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --max-width: 1220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 8%, rgba(246, 98, 48, 0.08), transparent 26rem),
    radial-gradient(circle at 6% 30%, rgba(37, 64, 245, 0.07), transparent 24rem),
    #fff;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
body.lcb-no-scroll { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(var(--max-width), calc(100% - 2.5rem)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}
.nav-shell { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand img { width: 50px; height: 42px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(7,17,31,.18)); }
.brand-name { display: flex; flex-direction: column; font-family: "Archivo Black", sans-serif; font-size: 0.98rem; line-height: 0.95; letter-spacing: -0.03em; text-transform: uppercase; }
.brand-name span { color: var(--orange-deep); font-size: 0.7rem; letter-spacing: 0.16em; }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 42px; padding: 0.6rem 1rem;
  border: 1px solid transparent; border-radius: 12px;
  font: inherit; font-size: 0.82rem; font-weight: 800; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn i { font-size: 1.05rem; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 22px rgba(37,64,245,.2); }
.btn-primary:hover { background: var(--blue-deep); }
.btn-orange { background: var(--orange); color: #fff; box-shadow: 0 8px 22px rgba(246,98,48,.22); }
.btn-orange:hover { background: var(--orange-deep); }
.btn-ghost { background: var(--surface); color: #24344a; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-high); color: var(--blue); }
.btn-danger { background: rgba(236,60,73,.08); color: #c8202e; border-color: rgba(236,60,73,.25); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { min-height: 34px; padding: 0.4rem 0.7rem; font-size: 0.76rem; border-radius: 10px; }
.btn-block { width: 100%; }
.lcb-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 11px;
  background: rgba(255,255,255,.06); color: #fff; font-size: 1.2rem; cursor: pointer;
}
.lcb-icon-btn:hover { background: rgba(255,255,255,.16); }

.user-chip {
  display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.4rem 0.3rem 0.35rem;
  border: 1px solid rgba(37,64,245,.18); border-radius: 14px; background: rgba(37,64,245,.05);
}
.user-chip .avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 800; font-size: .85rem; }
.user-chip .who { display: flex; flex-direction: column; line-height: 1.15; max-width: 150px; }
.user-chip .who strong { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { font-size: 0.68rem; font-weight: 700; color: var(--blue); }
.user-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.15rem; padding: 0.3rem; border-radius: 8px; }
.user-chip button:hover { color: var(--red); background: rgba(236,60,73,.08); }

/* Hero */
.lib-hero { padding: 3.2rem 0 2.2rem; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, rgba(37,64,245,.06), rgba(255,255,255,0) 45%, rgba(246,98,48,.07)); }
.lib-hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 2.5rem; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .75rem; border-radius: 999px; background: rgba(246,98,48,.12); color: var(--orange-deep); font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.lib-hero h1 { margin: 1rem 0 .8rem; font-family: "Archivo Black", sans-serif; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.02; letter-spacing: -0.045em; }
.lib-hero h1 span { color: var(--blue); }
.lib-hero p { max-width: 640px; color: var(--muted); font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.hero-stack { position: relative; height: 230px; }
.hero-book {
  position: absolute; width: 150px; height: 210px; border-radius: 10px 16px 16px 10px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem;
  color: #fff; font-weight: 800; font-size: .85rem; line-height: 1.2;
}
.hero-book::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; border-radius: 10px 0 0 10px; background: rgba(0,0,0,.18); }
.hero-book i { position: absolute; top: 1rem; right: 1rem; font-size: 1.6rem; opacity: .85; }
.hero-book.b1 { left: 10%; top: 18px; transform: rotate(-9deg); background: linear-gradient(160deg, #2540f5, #121fb8); }
.hero-book.b2 { left: 34%; top: 0; transform: rotate(3deg); background: linear-gradient(160deg, #f66230, #d84a1c); z-index: 2; }
.hero-book.b3 { left: 58%; top: 24px; transform: rotate(11deg); background: linear-gradient(160deg, #0d1b2d, #24344a); }

/* Toolbar catálogo */
.lib-main { flex: 1; padding: 2.2rem 0 3.5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.search {
  position: relative; flex: 1 1 280px; max-width: 420px;
}
.search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; }
.search input { width: 100%; padding: .75rem 1rem .75rem 2.6rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font: inherit; font-size: .9rem; }
.search input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(37,64,245,.12); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.6rem; }
.chip { padding: .45rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #24344a; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.count-label { color: var(--muted); font-size: .85rem; font-weight: 700; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.3rem; }
.book-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: 0 10px 30px rgba(7,17,31,.05); transition: transform .2s, box-shadow .2s; }
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-high); }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: .4rem; padding: 1.1rem; color: #fff; }
.book-cover .placeholder i { position: absolute; top: 1rem; right: 1rem; font-size: 2rem; opacity: .85; }
.book-cover .placeholder strong { font-family: "Archivo Black", sans-serif; font-size: 1.05rem; line-height: 1.1; letter-spacing: -0.02em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-cover .tag { position: absolute; top: .8rem; left: .8rem; padding: .25rem .6rem; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink); font-size: .68rem; font-weight: 800; }
.book-body { display: flex; flex-direction: column; flex: 1; gap: .45rem; padding: 1rem 1.1rem 1.1rem; }
.book-body h3 { font-size: 1rem; line-height: 1.3; }
.book-body p { color: var(--muted); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-meta { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--muted); font-size: .74rem; font-weight: 700; }
.book-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.book-actions { display: flex; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.book-actions .btn { flex: 1; }

.empty { padding: 3.5rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-md); }
.empty i { font-size: 2.6rem; color: var(--blue); }
.empty h3 { margin: .5rem 0 .25rem; color: var(--ink); }

.info-band { padding: 2.6rem 0; background: var(--surface); border-top: 1px solid var(--line); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.info-card { padding: 1.3rem; border-radius: var(--radius-md); background: #fff; border: 1px solid var(--line); }
.info-card i { font-size: 1.6rem; color: var(--orange); }
.info-card h3 { margin: .5rem 0 .3rem; font-size: .95rem; }
.info-card p { color: var(--muted); font-size: .85rem; }

.site-footer { padding: 1.4rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; }

/* Modais */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; background: rgba(7,17,31,.55); backdrop-filter: blur(6px); }
.modal-card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.7rem; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(7,17,31,.35); }
.modal-card h2 { font-size: 1.15rem; margin-bottom: .2rem; }
.modal-card .sub { color: var(--muted); font-size: .85rem; margin-bottom: 1.2rem; }
.modal-close { position: absolute; top: .9rem; right: .9rem; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 1.1rem; color: var(--muted); }
.modal-close:hover { color: var(--ink); }
.modal-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: .9rem; border-radius: 14px; background: rgba(37,64,245,.1); color: var(--blue); font-size: 1.5rem; }

/* Formulários */
.form { display: grid; gap: .9rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.field { display: grid; gap: .3rem; }
.field label { font-size: .76rem; font-weight: 800; color: #24344a; }
.field input, .field select, .field textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid rgba(7,17,31,.16); border-radius: 12px;
  background: #fff; font: inherit; font-size: .88rem; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,64,245,.12); }
.field small { color: var(--muted); font-size: .72rem; }
.field input[type="file"] { padding: .55rem; background: var(--surface); }
.form-error { padding: .6rem .8rem; border-radius: 10px; background: rgba(236,60,73,.08); color: #b4182a; font-size: .82rem; font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .84rem; font-weight: 700; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* Toasts */
#lcb-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .5rem; max-width: min(360px, calc(100% - 2rem)); }
.lcb-toast { padding: .8rem 1rem; border-radius: 12px; background: var(--ink); color: #fff; font-size: .85rem; font-weight: 700; box-shadow: 0 14px 40px rgba(7,17,31,.3); animation: toast-in .25s ease; transition: opacity .4s, transform .4s; }
.lcb-toast-success { background: #0f7a3d; }
.lcb-toast-error { background: #b4182a; }
.lcb-toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.lcb-spinner { display: inline-block; width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
.lcb-spinner-sm { width: 15px; height: 15px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.btn-ghost .lcb-spinner-sm, .btn-danger .lcb-spinner-sm { border-color: rgba(7,17,31,.15); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Leitor */
.lcb-reader { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: #0d1b2d; color: #fff; --page-bg: #fff; --body-bg: #dfe4eb; }
.lcb-reader[data-theme="sepia"] { --page-bg: #f4ecd8; --body-bg: #d9ccae; }
.lcb-reader[data-theme="escuro"] { --page-bg: #1b1d22; --body-bg: #05080d; }
.lcb-reader-bar { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; background: #07111f; border-bottom: 1px solid rgba(255,255,255,.08); }
.lcb-reader-heading { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.lcb-reader-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.lcb-reader-heading > span { color: #94a3b8; font-size: .75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcb-reader-save { font-weight: 600; }
.lcb-reader-save[data-kind="ok"] { color: #6ee7a8; }
.lcb-reader-save[data-kind="warn"] { color: #fbbf24; }
.lcb-reader-tools { display: flex; align-items: center; gap: .4rem; }
.lcb-reader-zoom { min-width: 46px; text-align: center; color: #cbd5e1; font-size: .78rem; font-weight: 800; }
.lcb-reader-download { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .9rem; border: 0; border-radius: 11px; background: var(--orange); color: #fff; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.lcb-reader-download:hover { background: var(--orange-deep); }
.lcb-reader-download i { font-size: 1.1rem; }
.lcb-reader-progress { height: 3px; background: rgba(255,255,255,.06); }
.lcb-reader-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .2s; }
.lcb-reader-main { position: relative; flex: 1; display: flex; min-height: 0; }
.lcb-reader-body { position: relative; flex: 1; overflow: auto; padding: 1.2rem 1rem 2rem; background: var(--body-bg); transition: background .25s; }
.lcb-reader-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem; color: #475569; font-weight: 700; text-align: center; padding: 1rem; }
.lcb-reader[data-theme="escuro"] .lcb-reader-loading { color: #cbd5e1; }
.lcb-reader-loading .lcb-spinner { border-color: rgba(37,64,245,.18); border-top-color: var(--blue); }
.lcb-reader-pages { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.lcb-reader-page { position: relative; background: var(--page-bg); border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.25); overflow: hidden; max-width: none; }
.lcb-reader-page canvas { display: block; transition: filter .25s; }
.lcb-reader[data-theme="sepia"] .lcb-reader-page canvas { filter: sepia(.55) saturate(1.15) brightness(.96); }
.lcb-reader[data-theme="escuro"] .lcb-reader-page canvas { filter: invert(.9) hue-rotate(180deg) brightness(.95); }
.lcb-reader-page.is-bookmarked::after { content: ""; position: absolute; top: 0; right: 18px; width: 20px; height: 30px; background: var(--orange); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); pointer-events: none; z-index: 3; }
.lcb-reader-frame { width: min(1000px, 100%); height: calc(100vh - 120px); border: 0; border-radius: 6px; background: #fff; }

/* Marca-texto */
.lcb-hl-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.lcb-reader[data-tool="highlight"] .lcb-hl-layer { pointer-events: auto; cursor: crosshair; touch-action: none; }
.lcb-hl { position: absolute; border-radius: 2px; mix-blend-mode: multiply; opacity: .45; }
.lcb-reader[data-theme="escuro"] .lcb-hl { mix-blend-mode: screen; opacity: .35; }
.lcb-hl.is-preview { outline: 1px dashed rgba(0,0,0,.4); }
.lcb-reader[data-tool="erase"] .lcb-hl { pointer-events: auto; cursor: pointer; }
.lcb-reader[data-tool="erase"] .lcb-hl:hover { outline: 2px solid #ec3c49; opacity: .7; }
.lcb-hl-amarelo { background: #ffe14d; }
.lcb-hl-verde { background: #5be38a; }
.lcb-hl-azul { background: #5cc8ff; }
.lcb-hl-rosa { background: #ff7eb6; }

/* Rodapé: navegação e ferramentas */
.lcb-reader-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; padding: .55rem 1rem; background: #07111f; border-top: 1px solid rgba(255,255,255,.08); }
.lcb-reader.is-fallback .lcb-reader-foot, .lcb-reader.is-fallback .lcb-reader-tools .lcb-icon-btn, .lcb-reader.is-fallback .lcb-reader-zoom { display: none; }
.lcb-reader-nav { display: flex; align-items: center; gap: .5rem; }
.lcb-nav-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .9rem; border: 0; border-radius: 11px; background: var(--blue); color: #fff; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.lcb-nav-btn:hover:not(:disabled) { background: var(--blue-deep); }
.lcb-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.lcb-nav-btn i { font-size: 1.05rem; }
.lcb-page-box { display: inline-flex; align-items: center; gap: .4rem; color: #cbd5e1; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.lcb-page-box input { width: 4.2rem; min-height: 36px; padding: 0 .4rem; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-weight: 800; text-align: center; }
.lcb-reader-annot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.lcb-tool-btn { position: relative; display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .75rem; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.lcb-tool-btn:hover { background: rgba(255,255,255,.14); }
.lcb-tool-btn i { font-size: 1.15rem; }
.lcb-tool-btn[aria-pressed="true"] { background: rgba(115,217,255,.18); border-color: var(--cyan); color: var(--cyan); }
.lcb-tool-btn[data-act="bookmark"][aria-pressed="true"] { background: rgba(246,98,48,.16); border-color: var(--orange); color: #ffb08f; }
.lcb-color-chip { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); }
.lcb-badge { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--orange); color: #fff; font-size: .68rem; font-weight: 800; display: inline-grid; place-items: center; }
.lcb-pop-wrap { position: relative; }
.lcb-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 10; display: grid; gap: .3rem; min-width: 160px; padding: .45rem; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: #0f2036; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.lcb-pop-colors { grid-template-columns: repeat(4, 34px); min-width: 0; }
.lcb-pop-colors small { grid-column: 1 / -1; color: #94a3b8; font-size: .7rem; line-height: 1.3; }
.lcb-theme-opt { display: flex; align-items: center; gap: .55rem; padding: .55rem .6rem; border: 0; border-radius: 9px; background: transparent; color: #e2e8f0; font: inherit; font-size: .82rem; font-weight: 700; text-align: left; cursor: pointer; }
.lcb-theme-opt:hover { background: rgba(255,255,255,.08); }
.lcb-theme-opt[aria-pressed="true"] { background: rgba(115,217,255,.14); color: var(--cyan); }
.lcb-theme-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); }
.lcb-theme-claro { background: #fff; }
.lcb-theme-sepia { background: #f1e3c2; }
.lcb-theme-escuro { background: #1b1d22; }
.lcb-color-opt { width: 34px; height: 34px; border: 2px solid transparent; border-radius: 50%; cursor: pointer; }
.lcb-color-opt[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--blue); }

/* Painel de marcações */
.lcb-reader-panel { width: 300px; flex: none; display: flex; flex-direction: column; background: #0b1828; border-left: 1px solid rgba(255,255,255,.08); }
.lcb-panel-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .8rem .7rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .88rem; }
.lcb-panel-head strong { display: inline-flex; align-items: center; gap: .4rem; }
.lcb-icon-btn-sm { width: 34px; height: 34px; font-size: 1rem; }
.lcb-panel-body { flex: 1; overflow: auto; padding: .8rem 1rem 1rem; display: grid; align-content: start; gap: 1.1rem; }
.lcb-panel-body h4 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .5rem; color: #94a3b8; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.lcb-mark-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.lcb-mark-list li { display: flex; gap: .35rem; }
.lcb-mark-go { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem .7rem; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.04); color: #fff; font: inherit; font-size: .82rem; font-weight: 700; text-align: left; cursor: pointer; }
.lcb-mark-go:hover { border-color: var(--cyan); }
.lcb-mark-go small { color: #94a3b8; font-weight: 600; }
.lcb-mark-del { width: 38px; border: 1px solid rgba(236,60,73,.3); border-radius: 10px; background: rgba(236,60,73,.08); color: #ff8a93; cursor: pointer; font-size: 1rem; }
.lcb-mark-del:hover { background: #ec3c49; color: #fff; }
.lcb-mark-empty { margin: 0; color: #94a3b8; font-size: .8rem; line-height: 1.45; }
.lcb-panel-actions { display: grid; gap: .45rem; padding-top: .3rem; border-top: 1px solid rgba(255,255,255,.08); }
.lcb-panel-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 38px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.05); color: #e2e8f0; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.lcb-panel-btn.is-danger { border-color: rgba(236,60,73,.35); color: #ff8a93; }
.lcb-panel-btn:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.lcb-panel-btn:disabled { opacity: .4; cursor: not-allowed; }
body:has(.lcb-reader:not([hidden])) #lcb-toasts { bottom: 5.5rem; }

/* Painel */
.panel-main { flex: 1; padding: 2rem 0 3rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.panel-head h1 { font-family: "Archivo Black", sans-serif; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.04em; line-height: 1.05; }
.panel-head p { color: var(--muted); font-size: .9rem; }
.tabs { display: flex; gap: .3rem; padding: .3rem; margin-bottom: 1.4rem; border-radius: 14px; background: var(--surface); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; border: 0; border-radius: 11px; background: none; color: var(--muted); font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--blue); box-shadow: 0 4px 14px rgba(7,17,31,.08); }
.panel-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.card { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: 0 10px 30px rgba(7,17,31,.04); }
.card h2 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin-bottom: 1rem; }
.card h2 i { color: var(--orange); font-size: 1.25rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.card-head .search { max-width: 260px; flex: 1 1 200px; }
.card-head .search input { padding-top: .55rem; padding-bottom: .55rem; font-size: .84rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th { text-align: left; padding: .6rem .7rem; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .75rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .row-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.badge-on { background: rgba(31,168,85,.12); color: #0f7a3d; }
.badge-off { background: rgba(236,60,73,.1); color: #b4182a; }
.badge-draft { background: rgba(86,102,125,.12); color: #3c4a5e; }
.badge-admin { background: rgba(37,64,245,.1); color: var(--blue); }
.badge-editor { background: rgba(246,98,48,.12); color: var(--orange-deep); }
.mini-cover { width: 44px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-high); display: grid; place-items: center; color: var(--blue); font-size: 1.3rem; flex: 0 0 auto; }
.book-cell { display: flex; align-items: center; gap: .7rem; min-width: 220px; }
.book-cell strong { display: block; line-height: 1.25; }
.book-cell span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.upload-progress { height: 8px; border-radius: 999px; background: var(--surface-high); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--blue)); transition: width .2s; }
.muted { color: var(--muted); }

.gate { flex: 1; display: grid; place-items: center; padding: 3rem 1rem; }
.gate .modal-card { box-shadow: var(--shadow); border: 1px solid var(--line); }

@media (max-width: 900px) {
  .lib-hero-grid { grid-template-columns: 1fr; }
  .hero-stack { display: none; }
  .panel-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 1.6rem); }
  .brand-name { display: none; }
  .nav-actions .btn span.hide-sm { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .user-chip .who { max-width: 100px; }
  .lcb-reader-download span { display: none; }
  .lcb-reader-zoom { display: none; }
  .lcb-reader-body { padding: .6rem .3rem 1.5rem; }
  .lcb-reader-foot { padding: .45rem .5rem; justify-content: center; }
  .lcb-reader-nav { width: 100%; justify-content: space-between; }
  .lcb-reader-annot { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .lcb-tool-btn { flex: 1; justify-content: center; padding: 0 .4rem; }
  .lcb-tool-btn span:not(.lcb-badge):not(.lcb-color-chip) { display: none; }
  .lcb-pop-wrap { flex: 1; display: flex; }
  .lcb-pop-wrap > .lcb-tool-btn { width: 100%; }
  body:has(.lcb-reader:not([hidden])) #lcb-toasts { bottom: 8.5rem; }
}
@media (max-width: 760px) {
  .lcb-reader-panel { position: absolute; inset: 0 0 0 auto; width: min(320px, 88vw); z-index: 5; box-shadow: -14px 0 40px rgba(0,0,0,.45); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
