:root {
  color-scheme: dark;
  --bg: #08110f;
  --panel: rgba(17, 29, 27, .86);
  --panel-solid: #111d1b;
  --panel-soft: rgba(27, 45, 40, .72);
  --line: rgba(188, 224, 205, .13);
  --line-strong: rgba(188, 224, 205, .25);
  --text: #f4f5ec;
  --muted: #a4b5ac;
  --muted-2: #73877c;
  --accent: #b7f06a;
  --accent-2: #f4d675;
  --mint: #8ce0be;
  --danger: #ff8d8d;
  --ok: #77dfb0;
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 84% -12%, rgba(111, 170, 116, .12), transparent 72%),
    radial-gradient(680px 460px at -15% 28%, rgba(183, 240, 106, .08), transparent 70%),
    var(--bg);
  font: 15px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .12;
  background-image: radial-gradient(rgba(240, 255, 245, .34) .55px, transparent .65px);
  background-size: 8px 8px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection { color: #0b130d; background: var(--accent); }
.brand-link { color: inherit; text-decoration: none; }
.brand-mark { margin-left: 5px; color: var(--accent); font-size: .72em; vertical-align: top; }
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 15, 13, .72);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}
.top h1 { flex: 0 0 auto; margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .12em; }
.top-nav, .navlinks { display: flex; align-items: center; gap: 8px; }
.top-nav { flex: 1; }
.top-nav a, .navlinks a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.top-nav a:hover, .top-nav a.active, .navlinks a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, .055);
}
.user-chip {
  max-width: 220px;
  overflow: hidden;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
main { width: min(1200px, 100%); margin: 0 auto; padding: clamp(22px, 4vw, 52px); }
main.wide { width: 100%; max-width: 1440px; padding: 22px clamp(14px, 3vw, 42px); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.16; letter-spacing: -.035em; }
h3 { line-height: 1.25; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.lead { max-width: 56ch; color: var(--muted); font-size: 17px; line-height: 1.7; }
.muted { color: var(--muted); }
.empty { padding: 24px 12px; color: var(--muted); text-align: center; }
.msg { min-height: 20px; margin: 8px 0; color: var(--muted); font-size: 13px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.card {
  margin: 0 0 22px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)), var(--panel);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .13);
  backdrop-filter: blur(16px);
}
.card h2 { margin: 0 0 16px; font-size: 21px; }
.btn, button.btn, a.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #11200e;
  font-weight: 760;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover, button.btn:hover, a.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(183,240,106,.18); }
.btn.sec, button.btn.sec, a.btn.sec {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.035);
  color: var(--text);
  font-weight: 620;
}
.btn.sec:hover, button.btn.sec:hover, a.btn.sec:hover { border-color: rgba(183,240,106,.5); background: rgba(183,240,106,.08); }
.btn.danger, button.btn.danger { border-color: rgba(255,141,141,.35); background: rgba(255,141,141,.08); color: var(--danger); }
.btn.sm, button.btn.sm { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.btn:disabled, button.btn:disabled { opacity: .5; cursor: wait; transform: none; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
form.row { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
input, select, textarea {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(5, 12, 10, .52);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:hover, select:hover, textarea:hover { border-color: rgba(183,240,106,.35); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[type="file"] { max-width: 100%; padding: 8px; }
input[type="checkbox"] { width: 18px; min-width: 18px; height: 18px; accent-color: var(--accent); }
textarea { resize: vertical; }
.row-btns { display: flex; justify-content: center; gap: 10px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 9px; color: var(--text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-label, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.code-box { margin: 14px 0; padding: 16px 10px; border: 1px dashed rgba(183,240,106,.55); border-radius: 16px; background: rgba(183,240,106,.06); font: 700 21px/1.4 ui-monospace,monospace; letter-spacing: .1em; text-align: center; user-select: all; overflow-wrap: anywhere; }
.seg { display: flex; gap: 5px; margin: 8px 0 20px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,.16); }
.seg button { flex: 1; padding: 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel-soft); color: var(--text); }
.seg[hidden], .login form[hidden], .login div[hidden] { display: none; }
.linkbtn { padding: 3px; border: 0; background: none; color: var(--mint); font-size: 13px; text-decoration: underline; cursor: pointer; }
.login {
  width: min(460px, calc(100% - 32px));
  margin: clamp(42px, 10vh, 110px) auto;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  background: linear-gradient(150deg, rgba(255,255,255,.075), rgba(255,255,255,.018)), var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.login h1 { margin: 0 0 24px; text-align: center; font-size: 24px; letter-spacing: .14em; }
.login h2 { margin: 0 0 6px; font-size: 22px; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login form label, .note-form label { font-size: 12px; }
.login form input { width: 100%; min-height: 46px; }
.login form .btn { width: 100%; margin-top: 4px; }
.login p.muted { font-size: 13px; }
.ficha {
  display: grid;
  grid-template-columns: minmax(170px, .72fr) 1.28fr;
  align-items: center;
  gap: clamp(24px, 6vw, 64px);
  max-width: 900px;
  margin: 7vh auto;
  text-align: left;
}
.ficha-copy h2 { margin: 0 0 14px; font-size: clamp(30px, 5vw, 52px); }
.ficha-copy .lead { margin: 0 0 18px; }
.ficha-copy .cta { margin-top: 24px; }
.ficha-cover-wrap { width: min(100%, 280px); justify-self: center; }
.ficha-cover { aspect-ratio: 2/3; width: 100%; }
.ficha-cover img { width: 100%; height: 100%; object-fit: cover; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.book { display: block; color: inherit; text-decoration: none; }
.book-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.012)), rgba(17,29,27,.84);
  box-shadow: 0 16px 38px rgba(0,0,0,.14);
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}
.book-card:hover { transform: translateY(-6px); border-color: rgba(183,240,106,.42); box-shadow: 0 24px 52px rgba(0,0,0,.24); }
.book-cover {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 3/3.65;
  place-items: center;
  background:
    radial-gradient(circle at 72% 20%, rgba(221,241,173,.32), transparent 28%),
    linear-gradient(145deg, #293e31, #17241f 54%, #101817);
}
.book-cover::after { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.12); border-radius: inherit; pointer-events: none; content: ""; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.75,.25,1); }
.book-card:hover .book-cover img { transform: scale(1.045); }
.cover-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(233,245,222,.88);
  background: radial-gradient(circle at 50% 36%, rgba(183,240,106,.22), transparent 40%), linear-gradient(150deg,#243d30,#101a18 76%);
}
.cover-placeholder span { font-size: 54px; filter: drop-shadow(0 8px 15px rgba(0,0,0,.3)); }
.cover-placeholder small { color: rgba(225,240,221,.65); font-size: 9px; font-weight: 800; letter-spacing: .22em; }
.book-copy { padding: 17px 18px 19px; }
.book-copy h3 { margin: 10px 0 7px; font-size: 17px; letter-spacing: -.02em; }
.book-copy p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.book .tag { display: inline-flex; padding: 5px 9px; border: 1px solid rgba(183,240,106,.25); border-radius: 999px; background: rgba(183,240,106,.075); color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.book-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--mint); font-size: 12px; font-weight: 700; }
.book-access, .book-expiry { font-size: 12px !important; }
.coll { margin: 28px 0 0; }
.coll > h3, .collection-heading h3 { margin: 0 0 14px; font-size: 21px; }
.coll p.muted, .collection-heading p { margin: -8px 0 16px; }
.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.collection-heading h3 { margin: 0 0 4px; }
.collection-heading p { margin: 0; }
.collection-count { padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.page-heading, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-heading .lead { margin: 10px 0 0; }
.section-heading h2 { font-size: clamp(22px, 3vw, 30px); }
.section-note { color: var(--muted); font-size: 12px; }
.library-page { max-width: 1280px; }
.redeem-card { align-items: center !important; padding: 20px 24px; }
.redeem-card > div:first-child { flex: 1; }
.redeem-card > div:first-child strong { font-size: 16px; }
.redeem-card input { width: min(300px,100%); }
.redeem-card .msg { flex-basis: 100%; margin: 0; }
.library-section { margin: 42px 0; }
.notes-section { padding: clamp(18px, 3vw, 30px); scroll-margin-top: 90px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.note-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(4,12,10,.32);
  transition: transform .22s ease, border-color .22s ease;
}
.note-card:hover { transform: translateY(-3px); border-color: rgba(183,240,106,.35); }
.note-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 11px; }
.note-icon { font-size: 18px; }
.note-card h3 { margin: 15px 0 4px; font-size: 16px; }
.note-source { margin: 0 0 8px; color: var(--mint); font-size: 11px; }
.note-excerpt { display: -webkit-box; overflow: hidden; margin: 0 0 15px; color: var(--muted); font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.note-open { margin-top: auto; color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.notes-empty, .empty-panel { display: grid; min-height: 180px; place-content: center; justify-items: center; padding: 24px; color: var(--muted); text-align: center; }
.notes-empty > span:first-child, .empty-panel > span { font-size: 30px; }
.notes-empty p, .empty-panel p { margin: 8px 0 4px; color: var(--text); }
.empty-panel h3 { margin: 10px 0 0; }
nav.tabs {
  position: sticky;
  top: 71px;
  z-index: 20;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 -8px 24px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9,18,16,.84);
  backdrop-filter: blur(16px);
}
nav.tabs button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: .2s ease;
}
nav.tabs button:hover, nav.tabs button.on { border-color: var(--line); background: var(--panel-soft); color: var(--text); }
nav.tabs button.on { box-shadow: inset 0 -2px var(--accent); }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
table th { color: var(--muted-2); font-size: 10px; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
table td { color: var(--text); }
table tr:hover td { background: rgba(255,255,255,.018); }
td.act { display: flex; flex-wrap: wrap; gap: 7px; }
.badge { display: inline-flex; padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 10px; font-weight: 750; }
.badge.READY, .badge.activo { border-color: rgba(119,223,176,.35); background: rgba(119,223,176,.08); color: var(--ok); }
.badge.FAILED, .badge.revocado, .badge.disabled { border-color: rgba(255,141,141,.34); background: rgba(255,141,141,.07); color: var(--danger); }
.badge.PENDING, .badge.PROCESSING, .badge.pendiente { border-color: rgba(244,214,117,.35); background: rgba(244,214,117,.08); color: var(--accent-2); }
.cover-edit-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 18px 0 8px; }
.admin-cover-preview { width: 120px; aspect-ratio: 3/3.65; object-fit: cover; border: 1px solid var(--line); border-radius: 14px; }
.ficha { max-width: 960px; margin: 7vh auto; }
.reader-body { background: radial-gradient(800px 560px at 52% -20%, rgba(102,152,112,.12), transparent 70%), #090e0d; }
.reader-top { position: sticky; }
.reader-main { max-width: 1120px; padding-top: 32px; padding-bottom: 100px; }
.reader-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding: 0 8px; }
.reader-heading h1 { max-width: 760px; margin: 0; font-size: clamp(24px,4vw,39px); line-height: 1.15; letter-spacing: -.03em; }
.reader-page-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); color: var(--mint); font-size: 12px; white-space: nowrap; }
.pages-feed { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 12px 0 80px; }
.reader-page { width: min(860px,100%); scroll-margin-top: 105px; }
.page-caption { display: flex; justify-content: space-between; padding: 0 4px 8px; color: var(--muted-2); font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.page-stage {
  position: relative;
  display: grid;
  min-height: 65vh;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: #17201d;
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
}
.page-stage.page-loaded { min-height: 0; }
.page-stage img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.page-loading, .page-error { display: grid; min-height: 45vh; place-content: center; justify-items: center; gap: 10px; padding: 24px; color: var(--muted); text-align: center; }
.page-loading span { font-size: 28px; animation: gentlePulse 1.8s ease-in-out infinite; }
.annotation-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.annotation-layer.drawing-enabled { pointer-events: auto; cursor: crosshair; }
.reader-tools {
  position: fixed;
  top: 50%;
  left: max(12px, calc((100vw - 1400px) / 2));
  z-index: 40;
  display: flex;
  width: 60px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 7px;
  transform: translateY(-50%);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(13,24,21,.83);
  box-shadow: 0 16px 40px rgba(0,0,0,.3);
  backdrop-filter: blur(20px);
}
.tool-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: .2s ease;
}
.tool-button:hover, .tool-button.tool-active { border-color: rgba(183,240,106,.28); background: rgba(183,240,106,.1); color: var(--accent); transform: translateY(-1px); }
.tool-exit { color: var(--mint); font-size: 24px; }
.tool-divider { width: 26px; height: 1px; margin: 2px 0; background: var(--line-strong); }
.tool-colors { display: grid; grid-template-columns: repeat(2, 15px); gap: 7px; padding: 4px 0; }
.color-dot { width: 15px; height: 15px; padding: 0; border: 2px solid rgba(255,255,255,.2); border-radius: 50%; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.color-dot[data-color="amber"] { background: #f7c948; }
.color-dot[data-color="mint"] { background: #4edca3; }
.color-dot[data-color="rose"] { background: #ff7097; }
.color-dot[data-color="sky"] { background: #58b7ff; }
.color-dot:hover, .color-dot.active { transform: scale(1.17); box-shadow: 0 0 0 3px rgba(255,255,255,.16); }
.note-cloud {
  position: fixed;
  right: 25px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  width: min(380px, calc(100vw - 24px));
  max-height: min(600px, calc(100vh - 36px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(188,224,205,.24);
  border-radius: 24px;
  background: rgba(15,27,24,.92);
  box-shadow: 0 30px 80px rgba(0,0,0,.48);
  backdrop-filter: blur(24px) saturate(135%);
  animation: notePop .22s ease both;
}
.note-cloud[hidden] { display: none; }
.note-cloud.minimized { max-height: 58px; }
.note-cloud.minimized .note-cloud-content { display: none; }
.note-cloud-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 9px 14px 9px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.035); cursor: move; touch-action: none; user-select: none; }
.note-cloud-head > div, .note-head-actions { display: flex; align-items: center; gap: 10px; }
.note-cloud-head strong { font-size: 14px; }
.note-cloud-head > div > span { font-size: 18px; }
.note-head-actions button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.05); color: var(--muted); font-size: 18px; cursor: pointer; }
.note-cloud-content { display: flex; min-height: 0; flex-direction: column; overflow: auto; padding: 15px; }
.note-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; color: var(--mint); font-size: 11px; font-weight: 750; }
.note-items { display: flex; max-height: 260px; flex-direction: column; gap: 8px; overflow: auto; }
.reader-note-item { display: flex; align-items: start; gap: 6px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.reader-note-open { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: start; gap: 4px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.reader-note-page { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.reader-note-open strong { font-size: 12px; }
.reader-note-preview { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.note-delete { width: 28px; height: 28px; border: 0; border-radius: 9px; background: rgba(255,141,141,.08); color: var(--danger); font-size: 18px; cursor: pointer; }
.note-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.note-form[hidden] { display: none; }
.note-form input, .note-form textarea { width: 100%; }
.note-form textarea { min-height: 110px; }
.note-form-actions { display: flex; gap: 8px; }
.note-form .msg { margin: 0; }
.notes-empty { min-height: 100px; }
.notes-empty > span:first-child { font-size: 22px; }
.notes-empty p { color: var(--text); font-size: 12px; }
.notes-empty span:last-child { font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes gentlePulse { 50% { opacity: .45; transform: scale(.94); } }
@keyframes notePop { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 900px) {
  .user-chip { display: none; }
  .reader-tools { left: 9px; }
  .reader-main { padding-left: 82px; }
  .ficha { gap: 24px; }
}
@media (max-width: 620px) {
  .top { min-height: 62px; gap: 10px; padding: 9px 14px; }
  .top h1 { font-size: 15px; }
  .top-nav { gap: 0; }
  .top-nav a { padding: 7px 8px; font-size: 11px; }
  .logout-btn { min-height: 34px !important; padding: 6px 10px !important; font-size: 11px !important; }
  main { padding: 24px 17px; }
  .page-heading, .section-heading { align-items: start; flex-direction: column; }
  .section-note { margin-top: -8px; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .book-copy { padding: 12px; }
  .book-copy h3 { font-size: 14px; }
  .book-copy p { font-size: 11px; }
  .book-meta { font-size: 10px; }
  .cover-placeholder span { font-size: 40px; }
  .redeem-card { align-items: stretch !important; }
  .redeem-card > div:first-child { flex-basis: 100%; }
  .redeem-card input { flex: 1; width: 100%; }
  .collection-heading { align-items: start; }
  .ficha { grid-template-columns: 1fr; margin: 24px auto; text-align: center; }
  .ficha-cover-wrap { width: min(190px, 58vw); }
  .ficha-copy .lead { margin-right: auto; margin-left: auto; }
  .ficha-copy .cta { justify-content: center; }
  nav.tabs { top: 61px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .reader-heading { align-items: start; flex-direction: column; }
  .reader-main { padding: 22px 12px 120px; }
  .reader-tools {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    flex-direction: row;
    justify-content: space-around;
    transform: none;
    border-radius: 20px;
    padding: 6px 8px;
  }
  .tool-button { width: 40px; height: 40px; }
  .tool-divider { width: 1px; height: 25px; margin: 0; }
  .tool-colors { grid-template-columns: repeat(4, 13px); gap: 5px; }
  .color-dot { width: 13px; height: 13px; }
  .note-cloud { right: 12px; bottom: 76px; width: min(370px, calc(100vw - 24px)); max-height: min(64vh, 560px); }
  .page-stage { min-height: 42vh; border-radius: 9px; }
}
@media (max-width: 390px) {
  .top-nav a { font-size: 0; }
  .top-nav a::first-letter { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
