/* Nexus Book 11.0. Shared product foundations. */
:root {
  --nx-bg: #f7f3ec;
  --nx-paper: #fffdf8;
  --nx-soft: #f0e9df;
  --nx-ink: #352a23;
  --nx-muted: #75675c;
  --nx-border: #e5dcd0;
  --nx-brand: #a24f31;
  --nx-brand-hover: #853c25;
  --nx-tint: #f5e6da;
  --nx-danger: #a33632;
  --nx-radius: 16px;
  --nx-shadow: 0 8px 32px #49332109;
  --nx-focus: #a24f31;
  --bg: var(--nx-bg);
  --surface: var(--nx-paper);
  --paper: var(--nx-paper);
  --ink: var(--nx-ink);
  --text: var(--nx-ink);
  --muted: var(--nx-muted);
  --line: var(--nx-border);
  --accent: var(--nx-brand);
}
html.premium-dark {
  color-scheme: dark;
  --nx-bg: #211d1a;
  --nx-paper: #2a2420;
  --nx-soft: #352c25;
  --nx-ink: #f4ebe0;
  --nx-muted: #bcac9d;
  --nx-border: #4a3d32;
  --nx-brand: #e0a17c;
  --nx-brand-hover: #efbb96;
  --nx-tint: #453024;
  --nx-focus: #efbb96;
}
html { scroll-padding-top: 100px; }
html, body { min-height: 100%; }
body, body.light, html.premium-dark body {
  background: var(--nx-bg) !important;
  color: var(--nx-ink) !important;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
button, input, select, textarea, html.premium-dark button, html.premium-dark input, html.premium-dark select {
  border: 1px solid var(--nx-border);
  background: var(--nx-paper);
  color: var(--nx-ink);
  border-radius: 10px;
  min-height: 44px;
}
button { padding: 10px 18px; font-weight: 550; }
input, select, textarea { padding: 11px 14px; min-width: 0; max-width: 100%; }
input::placeholder, textarea::placeholder { color: var(--nx-muted); opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--nx-brand); }
input[type="range"] { accent-color: var(--nx-brand); }
button:hover { border-color: var(--nx-brand); }
button:disabled { cursor: not-allowed; opacity: .5; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--nx-focus);
  outline-offset: 4px;
}
a { color: var(--nx-brand); text-underline-offset: 4px; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2 { text-wrap: balance; }
button, a { transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.nx-skip { position: fixed; left: 16px; top: -100px; z-index: 1000; padding: 12px 18px; background: var(--nx-paper); border-radius: 10px; }
.nx-skip:focus { top: 12px; }
body > header, html.premium-dark body > header {
  height: 82px;
  max-width: none;
  padding: 0 max(28px, calc((100vw - 1280px) / 2));
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: center;
  background: var(--nx-paper) !important;
  border-bottom: 1px solid var(--nx-border);
  box-shadow: none;
  z-index: 10;
}
body > header h1 { font: 600 29px/1.1 Georgia, serif; letter-spacing: -1.1px; color: var(--nx-ink); margin: 0 auto 0 0; white-space: nowrap; }
body > header h1 span { color: var(--nx-brand); }
body > header #nbProfileTop { width: 42px; height: 42px; min-height: 42px; border: 2px solid var(--nx-border); box-shadow: none; overflow: hidden; }
.nx-theme-toggle { display: inline-flex !important; align-items: center; justify-content: center; width: 42px; min-height: 42px; padding: 0; border: 0; background: transparent !important; color: var(--nx-muted) !important; }
.nx-theme-toggle svg { width: 20px; height: 20px; }
body > main { width: min(100%, 1336px); max-width: 1336px; padding: 36px 28px 112px !important; margin: 0 auto; }
nav.bottom, html.premium-dark nav.bottom {
  background: var(--nx-paper) !important;
  border-color: var(--nx-border);
  box-shadow: 0 -5px 30px #352a2306;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
}
nav.bottom button { color: var(--nx-muted); min-height: 54px; border-radius: 12px; font-weight: 500; font-size: 22px; padding: 7px 10px; }
nav.bottom button svg { width: 22px; height: 22px; }
nav.bottom button span { font-size: 11px; letter-spacing: .015em; }
nav.bottom button[aria-current="page"] { color: var(--nx-brand); background: var(--nx-tint); }
body #nbWelcome, html.premium-dark body #nbWelcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .52fr);
  align-items: center;
  gap: 28px;
  min-height: 290px;
  padding: 36px 42px;
  margin: 0 0 28px;
  background: #eee3d3 !important;
  border: 0;
  border-radius: 22px;
  color: #493325 !important;
  box-shadow: none;
}
html.premium-dark body #nbWelcome { background: #3a2a21 !important; color: #f4dfc8 !important; }
body #nbWelcome .eyebrow { display: block; font-size: 10px; letter-spacing: .17em; font-weight: 650; color: var(--nx-brand); }
body #nbWelcome h2 { font: 400 clamp(32px, 3.5vw, 48px)/1.13 Georgia, serif; letter-spacing: -1.4px; margin: 16px 0 14px; max-width: 15ch; }
body #nbWelcome p { font-size: 14px; line-height: 1.65; max-width: 38ch; color: inherit; opacity: .8; margin: 0 0 22px; }
body #nbWelcome .nx-hero-copy > button { min-height: 44px; padding: 11px 21px; border: 0; background: #a24f31; color: #fffaf5; border-radius: 10px; }
.nx-feature { display: flex; align-items: center; gap: 22px; min-width: 0; padding: 12px 0; }
.nx-feature-cover { width: 110px; height: 165px; border: 0; border-radius: 3px 7px 7px 3px; box-shadow: 6px 10px 22px #49302230; object-fit: cover; flex: none; }
.nx-feature-info { min-width: 0; }
.nx-feature-label { display: block; color: inherit; opacity: .7; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }
.nx-feature h3 { font: 400 21px/1.25 Georgia, serif; letter-spacing: -.3px; margin: 10px 0 6px; }
.nx-feature p { margin: 0 0 12px !important; font-size: 12px !important; }
.nx-feature button { background: transparent !important; color: inherit; border: 0; border-bottom: 1px solid currentColor; border-radius: 0; padding: 6px 0; min-height: 36px; font-size: 12px; }
#nbTools { display: flex; align-items: center; margin: 0 0 24px; gap: 8px; }
#nbTools button { min-height: 38px; padding: 8px 17px; font-size: 13px; border-radius: 30px; background: transparent; border-color: var(--nx-border); }
#nbTools button[aria-pressed="true"] { background: var(--nx-ink); color: var(--nx-paper); border-color: var(--nx-ink); }
#cloudpanel, html.premium-dark #cloudpanel { background: transparent !important; margin: 0; padding: 0; border: 0; border-radius: 0; }
#cloudpanel > h2 { font: 400 29px/1.2 Georgia, serif; color: var(--nx-ink); letter-spacing: -.6px; margin: 0 0 22px; }
body .premium-tools {
  position: static !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 !important;
  margin: 0 0 14px;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body .premium-tools > input { flex: 1 1 240px; min-width: 140px; padding-left: 40px; background: var(--nx-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23897768' stroke-width='1.6'%3E%3Ccircle cx='10' cy='10' r='6.5'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E") no-repeat 14px center; }
body .premium-tools > select { flex: 0 1 170px; width: 170px; }
body .premium-tools > button { flex: none; font-size: 13px; }
#premiumTheme { display: none; }
#premiumView { width: 44px; padding: 10px; font-size: 0; display: inline-grid; place-items: center; }
#premiumView svg { width: 19px; height: 19px; }
.nx-filter-toggle[aria-expanded="true"] { border-color: var(--nx-brand); background: var(--nx-tint); color: var(--nx-brand); }
.nx-filters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)) auto; gap: 12px; width: 100%; padding: 16px; background: var(--nx-soft); border-radius: 14px; }
.nx-filter-field { min-width: 0; display: grid; gap: 5px; }
.nx-filter-field > span { font-size: 11px; font-weight: 600; color: var(--nx-muted); }
.nx-filter-field select { width: 100%; font-size: 13px; }
.nx-filters > button { align-self: end; font-size: 12px; }
.refine-count { margin: 0 0 22px; color: var(--nx-muted); font-size: 12px; }
#stored:not(.premium-list), #books {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 30px 24px;
  align-items: start;
}
#stored:not(.premium-list) > article {
  display: flex !important;
  flex-direction: column;
  min-width: 0;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0;
  height: auto !important;
}
#stored:not(.premium-list) > article > .cover,
#stored:not(.premium-list) > article > img {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 0;
  border-radius: 3px 7px 7px 3px;
  box-shadow: 3px 5px 12px #38281d21;
  margin: 0 0 12px;
  cursor: pointer;
}
#stored:not(.premium-list) > article > .cover { display: grid; place-items: center; background: var(--nx-soft); color: var(--nx-muted); font: 18px/1.3 Georgia, serif; }
#stored:not(.premium-list) > article > h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 40px !important; min-height: 40px !important; margin: 0 0 5px !important; font: 600 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--nx-ink); letter-spacing: -.15px; }
#stored:not(.premium-list) > article > small { color: var(--nx-muted) !important; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin: 0 0 5px !important; height: 18px !important; min-height: 18px; font-size: 11px; line-height: 18px; }
#stored .nbGenreTag { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--nx-brand); background: transparent !important; border: 0; border-radius: 0; padding: 0 !important; margin: 0 0 5px !important; font-size: 10px; height: 17px !important; line-height: 17px; display: block; }
#stored > article > .book-actions { display: flex; gap: 6px; width: 100%; margin: 5px 0 0 !important; padding: 0 !important; align-items: center; }
#stored .book-actions button { min-height: 38px; margin: 0; border: 0; border-radius: 8px; background: var(--nx-soft); font-size: 12px; padding: 8px 12px; }
#stored .book-actions button:first-child { flex: 1; color: var(--nx-brand); }
#stored .book-actions button:last-child { width: 38px; flex: none; font-size: 20px; padding: 2px; background: transparent; color: var(--nx-muted); }
#stored .book-actions button[aria-pressed="true"] { color: var(--nx-brand); }
#stored > article > .nx-reading-track { height: 2px; width: 100%; margin: 2px 0 0; background: var(--nx-border); border-radius: 2px; overflow: hidden; }
.nx-reading-track > span { display: block; height: 100%; background: var(--nx-brand); width: var(--progress, 0%); }
#stored.premium-list { gap: 0; }
#stored.premium-list > article { display: grid; grid-template-columns: 72px minmax(0,1fr); grid-template-rows: repeat(4, auto) auto; padding: 18px 0; border: 0; border-bottom: 1px solid var(--nx-border); border-radius: 0; background: transparent; box-shadow: none; }
#stored.premium-list > article > :is(.cover, img) { width: 72px; height: 108px; grid-row: 1 / 8; object-fit: cover; border-radius: 4px; }
#stored.premium-list > article > :is(h3, small, .nbGenreTag, .nx-reading-track, .book-actions) { grid-column: 2; }
#stored.premium-list .book-actions { max-width: 210px; }
.nx-empty { padding: 54px 24px; border: 1px dashed var(--nx-border); border-radius: 16px; text-align: center; color: var(--nx-muted); }
.nx-empty h3 { font: 400 24px Georgia,serif; color: var(--nx-ink); margin: 0 0 10px; }
.nx-empty p { font-size: 14px; margin: 0 auto; max-width: 40ch; }
.nx-loading { color: var(--nx-muted); padding: 24px 0; font-size: 13px; }
.nx-loading::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 9px; border: 2px solid var(--nx-border); border-top-color: var(--nx-brand); border-radius: 50%; vertical-align: -2px; animation: nx-spin .9s linear infinite; }
@keyframes nx-spin { to { transform: rotate(360deg); } }

/* Book details, reader, account and dialogs. */
#detail, html.premium-dark #detail { background: var(--nx-bg) !important; color: var(--nx-ink) !important; padding: 28px; z-index: 30; }
#detail > button { display: block; margin: 0 auto; width: min(100%,960px); text-align: left; border: 0; padding-left: 0; font-size: 13px; color: var(--nx-muted); border-radius: 0; }
#detail .wrap { max-width: 960px; grid-template-columns: 240px minmax(0,1fr); gap: 68px; margin: 40px auto; }
#detail .detail-side .cover { border: 0; border-radius: 4px 9px 9px 4px; background: var(--nx-soft); box-shadow: 8px 15px 32px #35291d24; padding: 0; overflow: hidden; }
#detail #dc img { object-fit: cover; }
#detail .detail-info > small { color: var(--nx-brand) !important; font-size: 10px; letter-spacing: .15em; }
#detail #dt { font: 400 clamp(32px,4vw,48px)/1.13 Georgia,serif; letter-spacing: -1.1px; margin: 12px 0; }
#detail #da { font-size: 16px; color: var(--nx-muted); opacity: 1; margin: 0 0 16px; }
#detail #ds { font-size: 15px; color: var(--nx-ink); line-height: 1.85; }
#detail #nbDetailGenre { margin: 14px 0 20px; }
#detail #nbDetailGenre span { border-color: var(--nx-border); background: var(--nx-paper); color: var(--nx-muted); font-size: 11px; padding: 5px 11px; }
#detail #nbDetailId { font-size: 11px !important; color: var(--nx-muted) !important; }
#detail #nbDetailIdCopy { min-height: 28px; border: 0; color: var(--nx-brand); }
#detail .detail-actions { margin-top: 24px; gap: 8px; }
#detail .detail-actions button { border-radius: 10px; padding: 12px; min-height: 46px; font-size: 13px; border-color: var(--nx-border); }
#detail .primary { background: #a24f31; color: #fffaf5; border: 0; }
#detail #nbDownload { background: var(--nx-paper); color: var(--nx-ink); border-color: var(--nx-border); }
#detail #nbKindle { background: transparent; border-color: var(--nx-border); color: var(--nx-muted); }
#detail p, #detail .refine-related h3 { color: var(--nx-ink); }
#detail .refine-related { border-color: var(--nx-border); }
#detail .refine-related button { border: 0; padding: 10px 0; font-size: 13px; }
#detail .social63 { border-color: var(--nx-border); }
#detail .social63 button { border-radius: 8px; font-size: 13px; }
#reader:not(.nrReader) { z-index: 50; }
#reader:not(.nrReader) .rhead { height: 64px; padding: 10px max(18px,calc((100vw - 1040px)/2)); border-bottom: 1px solid #85705a22; box-shadow: none; }
#reader:not(.nrReader) .rhead button, #reader:not(.nrReader) .rfoot button { border-radius: 8px; min-height: 42px; min-width: 42px; padding: 8px; }
#reader:not(.nrReader) #rt { font: 15px/1.4 Georgia,serif; text-align: center; }
#reader:not(.nrReader) .rfoot { min-height: 60px; border-top: 1px solid #85705a22; box-shadow: none; padding: 8px max(16px,calc((100vw - 1000px)/2)); padding-bottom: max(8px,env(safe-area-inset-bottom)); }
#reader:not(.nrReader) #progress { font-size: 12px; }
#reader:not(.nrReader) #content { padding-top: 22px; }
#readingSettings, #nbPanel, #epubExtra { border: 1px solid #85705a33; border-radius: 16px !important; padding: 20px; box-shadow: 0 12px 48px #251a1620; max-width: calc(100vw - 32px); max-height: calc(100dvh - 150px); overflow: auto; }
#reader:not(.nrReader) .nx-reader-status { color: inherit; padding: 24px; }
#nbAccountShell { background: transparent !important; border: 0; width: min(100%, 1120px); padding: 28px; margin: 0 auto; }
#nbRequests { border: 0 !important; padding: 0 !important; }
#nbRequests > h2 { font: 400 32px Georgia,serif; margin-top: 12px; }
#nbSuggest { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; padding: 24px; border: 1px solid var(--nx-border); border-radius: 16px; background: var(--nx-paper); gap: 12px; margin: 22px 0; }
#nbSuggest button, .npSettings [data-save], .npAdmin button[type="submit"] { background: #a24f31; color: #fffaf5; border: 0; }
#nbVotes > p { padding: 18px 20px; border: 1px solid var(--nx-border); border-radius: 12px; background: var(--nx-paper); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
#nbVotes button { margin-left: auto; font-size: 12px; color: var(--nx-brand); }
.npDialog { background: var(--nx-paper); color: var(--nx-ink); border: 1px solid var(--nx-border); box-shadow: 0 24px 80px #251a1626; border-radius: 22px !important; padding: 24px; }
.npDialog::backdrop { background: #231a1466; backdrop-filter: blur(5px); }
.npPopup { padding: 0 0 22px; width: min(390px,calc(100vw - 32px)); }
.npBanner { height: 90px; background: linear-gradient(120deg,#eed9bd,#ad6442); }
.npPortrait { border-color: var(--nx-paper); width: 96px; height: 96px; margin-top: -48px; }
.npName { font: 400 26px Georgia,serif; }
.npQuota { font-size: 13px; color: var(--nx-muted); }
.npPopup > button { text-align: left; margin: 6px auto; width: calc(100% - 44px); border: 0; background: var(--nx-soft); border-radius: 10px; min-height: 44px; font-size: 13px; }
.npSettings[open] { background: var(--nx-bg); border-radius: 0 !important; padding: 28px; }
.npSettingsHeader h2 { font: 400 36px Georgia,serif; letter-spacing: -.7px; }
.npSection { background: var(--nx-paper) !important; color: var(--nx-ink) !important; border-color: var(--nx-border); padding: 24px; border-radius: 16px !important; box-shadow: none !important; }
.npSection .npHint { color: var(--nx-muted); font-size: 13px; }
.npSettings .npSection h3 { font: 600 16px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.npSettings .npChoices { grid-template-columns: repeat(4,minmax(0,1fr)); }
.npSettings .npChoices button { background: var(--nx-paper) !important; color: var(--nx-ink); border-color: var(--nx-border) !important; border-radius: 12px; }
.npSettings .npChoices button[aria-pressed="true"] { border-color: var(--nx-brand) !important; background: var(--nx-tint) !important; }
.npStatus:not(:empty) { background: var(--nx-paper); color: var(--nx-ink); border-radius: 12px; border-color: var(--nx-brand); }
#nbLibrarySettings a { display: inline-flex; min-height: 44px; align-items: center; }
.nx-toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 100; padding: 12px 20px; width: max-content; max-width: calc(100vw - 32px); background: var(--nx-ink); color: var(--nx-paper); border-radius: 12px; box-shadow: 0 8px 28px #20170f24; font-size: 13px; }

/* Sign in and registration. */
body #nbGate {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f1e9dd;
  padding: 40px 24px;
  overflow: auto;
  isolation: isolate;
}
body #nbGate .nbWordCloud { opacity: .18; color: #7f4e32; }
body #nbGate .nbWordCloud span { animation: none; }
body #nbGate .nbGateCard { display: grid; grid-template-columns: .95fr 1fr; width: min(930px,100%); max-width: 930px; min-height: 570px; border: 1px solid #e1d3c3; border-radius: 24px; background: #fffdf8; overflow: hidden; box-shadow: 0 20px 75px #653d1e12; z-index: 1; }
body #nbGate .nbGateArt { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; height: auto; background: #75432e; color: #f9e6ca; padding: 36px 32px 0; overflow: hidden; }
body #nbGate .nbGateArt > span { position: static; display: block; font-size: 11px; font-weight: 600; letter-spacing: .2em; }
body #nbGate .nbGateArt svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 46%; opacity: .9; }
body #nbGate .nx-gate-copy { position: relative; z-index: 1; margin: 52px 0 0; max-width: 270px; }
body #nbGate .nx-gate-copy h1 { margin: 0 0 16px; font: 400 43px/1.13 Georgia,serif; letter-spacing: -1px; color: #faead6; }
body #nbGate .nx-gate-copy p { margin: 0; color: #e4c6ad; font-size: 13px; max-width: 26ch; line-height: 1.7; }
body #nbGate .nbGateBody { padding: 42px 36px 30px; color: #352a23; min-width: 0; }
body #nbGate .nbGateBody > h2 { font: 400 33px/1.2 Georgia,serif; letter-spacing: -.5px; margin: 0 0 8px; }
body #nbGate .nx-gate-subtitle { margin: 0 0 27px; color: #75675c; font-size: 13px; }
body #nbGate #nbLogin { gap: 14px; margin: 0; display: flex; flex-direction: column; }
body #nbGate .nx-field { display: flex; flex-direction: column; gap: 6px; color: #58483d; font-size: 12px; font-weight: 600; }
body #nbGate input:not([type="checkbox"]) { width: 100%; min-height: 46px; font-size: 14px; color: #352a23; background: #fffdf8; border-color: #e1d7ca; border-radius: 9px; padding: 12px 13px; }
body #nbGate input:-webkit-autofill { -webkit-box-shadow: 0 0 0 50px #fff9ef inset; -webkit-text-fill-color: #352a23; }
body #nbGate .nbLoginOptions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; font-size: 12px; color: #75675c; }
body #nbGate .nbLoginOptions label { display: inline-flex; align-items: center; gap: 7px; }
body #nbGate .nbLoginOptions button { padding: 0; background: transparent; border: 0; color: #91472c; font-size: 12px; min-height: 38px; }
body #nbGate #nbSubmit { width: 100%; background: #a24f31; border: 0; color: #fffaf5; border-radius: 9px; min-height: 46px; font-size: 14px; }
body #nbGate #nbSubmit:hover { background: #853c25; }
body #nbGate #nbRegister { background: transparent; color: #91472c; border: 1px solid #dfc4ae; border-radius: 9px; min-height: 44px; font-size: 13px; }
body #nbGate #nbCaptcha { min-height: 65px; max-width: 100%; align-self: start; }
body #nbGateStatus { color: #a33632; font-size: 12px; line-height: 1.5; margin: 16px 0 0; }
body #nbGateStatus:empty { display: none; }

/* Administration. */
body.nx-admin { padding: 0; background: var(--nx-bg); }
.nx-admin .adminShell { width: 100%; max-width: 1600px; min-height: 100dvh; grid-template-columns: 232px minmax(0,1fr); border: 0; padding: 0; gap: 0; background: var(--nx-bg); border-radius: 0; }
.nx-admin .adminSide { top: 0; height: 100dvh; min-height: 620px; padding: 30px 18px 24px; border-right: 1px solid var(--nx-border); border-radius: 0; background: var(--nx-paper); gap: 14px; }
.nx-admin .adminBrand { font: 600 28px Georgia,serif; letter-spacing: -.8px; color: var(--nx-ink); padding: 0 10px; }
.nx-admin .adminSide > p { font-size: 9px; letter-spacing: .16em; color: var(--nx-muted); padding: 0 10px; margin-bottom: 20px; }
.nx-admin .adminSide .ncNav { gap: 4px; }
.nx-admin .adminSide .ncNav button { min-height: 44px; font-size: 12px; font-weight: 500; padding: 12px; gap: 12px; border-radius: 9px; color: var(--nx-muted); border: 0; }
.nx-admin .adminSide .ncNav button[aria-pressed="true"] { color: var(--nx-brand); background: var(--nx-tint); font-weight: 600; }
.nx-admin .adminSide > a { margin-top: auto; padding: 20px 10px 0; font-size: 12px; border-color: var(--nx-border); }
.nx-admin .adminIcon { width: 18px; height: 18px; color: var(--nx-brand); }
.nx-admin .adminMain { padding: 36px clamp(20px,4vw,56px); margin: 0; width: 100%; }
.nx-admin .adminTop { padding: 0; margin: 0 0 30px; min-height: 50px; }
.nx-admin .adminTop h1 { font: 400 36px/1.2 Georgia,serif; color: var(--nx-ink); letter-spacing: -.9px; }
.nx-admin .adminSubtitle { color: var(--nx-muted); font-size: 13px; margin-bottom: 22px; }
.nx-admin .ncStats { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.nx-admin .ncStats > div { height: 144px; min-height: 144px; padding: 20px; background: var(--nx-paper); border: 1px solid var(--nx-border); border-radius: 14px; gap: 12px; }
.nx-admin .ncStats strong { color: var(--nx-ink); font-size: 29px; font-weight: 500; letter-spacing: -.7px; }
.nx-admin .ncStats span:not(.adminIcon) { font-size: 11px; color: var(--nx-muted); }
.nx-admin .adminStorage { border-radius: 14px; border-color: var(--nx-border); background: var(--nx-paper); padding: 24px; }
.nx-admin .adminStorage h2 { font-size: 16px; font-weight: 600; }
.nx-admin .adminStorage p { font-size: 12px; color: var(--nx-muted); }
.nx-admin .adminRefresh { width: auto; min-width: 190px; padding: 12px 20px; background: #a24f31; border: 0; color: #fffaf5; border-radius: 10px; font-size: 13px; }
.nx-admin .adminMain section { background: var(--nx-paper); border: 1px solid var(--nx-border); box-shadow: none; border-radius: 16px; padding: 24px; margin: 0 0 20px; }
.nx-admin .adminMain section > h2 { font: 400 25px Georgia,serif; margin-bottom: 20px; }
.nx-admin .adminMain section > p { font-size: 13px; color: var(--nx-muted); }
.nx-admin .adminMain button, .nx-admin .adminMain input, .nx-admin .adminMain select, .nx-admin .adminMain textarea { font-size: 13px; max-width: 100%; }
.nx-admin .adminMain section > button { margin: 0 6px 10px 0; }
.nx-admin .adminMain section > input:not([type="checkbox"]) { margin: 0 6px 12px 0; }
.nx-admin input[type="file"] { padding: 22px; border: 1px dashed var(--nx-brand); width: 100%; background: var(--nx-bg); border-radius: 12px; }
.nx-admin input[type="file"]::file-selector-button { border: 0; border-radius: 7px; padding: 9px 12px; margin-right: 14px; background: var(--nx-tint); color: var(--nx-brand); font: inherit; cursor: pointer; }
.nx-admin .adminMain #go { background: #a24f31; color: #fffaf5; border: 0; }
.nx-admin #list > p { padding: 16px; border-color: var(--nx-border); border-radius: 12px; gap: 14px; }
.nx-admin .delete-book { color: var(--nx-danger); background: #fff2ed; border: 1px solid #ecd4c7; }
.nx-admin #managePanel details { border: 1px solid var(--nx-border); border-radius: 12px; padding: 14px; margin: 12px 0; }
.nx-admin #managePanel summary { font-size: 13px; cursor: pointer; line-height: 1.6; }
.nx-admin #managePanel label { font-size: 12px; }
.nx-admin #managePanel textarea { min-height: 100px; }
.nx-admin #managePanel input:not([type="checkbox"]), .nx-admin #managePanel textarea { display: block; width: 100%; margin: 7px 0 12px; }
.nx-admin #managePanel input[type="checkbox"] { width: 18px; height: 18px; }
.nx-admin .adminAuth { padding: 18px; border: 1px solid var(--nx-border); border-radius: 12px; background: var(--nx-paper); font-size: 12px; }
.nx-admin .adminAuth input { max-width: 420px; margin: 14px 0 10px; }
.nx-admin #users > p, .nx-admin #requests > p, .nx-admin #reviewQueue > article { padding: 18px 0; border-bottom: 1px solid var(--nx-border); font-size: 13px; }
.nx-admin progress { width: 100%; accent-color: var(--nx-brand); }
.nx-admin #batch { margin: 14px 0; }
.nx-admin .nx-danger-action { background: #fff2ed; color: var(--nx-danger); border-color: #ecd4c7; }

/* Responsive product layout. Four columns on every tablet orientation. */
@media (min-width: 1100px) {
  body:not(.nx-admin) nav.bottom { top: 14px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: 460px; height: 54px; padding: 3px; border: 0; box-shadow: none; border-radius: 13px; background: var(--nx-bg) !important; z-index: 11; }
  nav.bottom button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: 10px; }
  nav.bottom button span { font-size: 12px; margin: 0; }
  nav.bottom button svg { width: 18px; height: 18px; }
  nav.bottom button[aria-current="page"] { background: var(--nx-paper); box-shadow: 0 2px 8px #49332109; }
}
@media (min-width: 600px) and (max-width: 1366px) {
  body:not(.nx-admin) > main { padding: 28px 28px 112px !important; max-width: 1200px; }
  #stored:not(.premium-list), #books { grid-template-columns: repeat(4,minmax(0,1fr)) !important; gap: 28px 20px; }
}
@media (min-width: 600px) and (max-width: 900px) {
  body #nbWelcome { gap: 18px; padding: 30px; grid-template-columns: 1fr 230px; min-height: 268px; }
  body #nbWelcome h2 { font-size: 34px; }
  .nx-feature { gap: 14px; }
  .nx-feature-cover { width: 82px; height: 123px; }
  .nx-feature h3 { font-size: 18px; }
  .nx-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .nx-admin .adminShell { grid-template-columns: 190px minmax(0,1fr); }
  .nx-admin .adminBrand { font-size: 24px; }
  .nx-admin .adminSide { padding: 26px 12px; }
  .nx-admin .adminMain { padding: 28px 22px; }
  .nx-admin .ncStats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 759px) {
  body #nbGate { padding: 22px 16px; align-items: center; }
  body #nbGate .nbGateCard { display: block; width: min(440px,100%); min-height: 0; border-radius: 20px; }
  body #nbGate .nbGateArt { min-height: 148px; height: 148px; padding: 22px 26px; }
  body #nbGate .nbGateArt svg { height: 115px; width: 70%; left: auto; right: -15px; }
  body #nbGate .nx-gate-copy { margin: 16px 0 0; max-width: 170px; }
  body #nbGate .nx-gate-copy h1 { font-size: 23px; margin: 0; max-width: 9ch; }
  body #nbGate .nx-gate-copy p { display: none; }
  body #nbGate .nbGateBody { padding: 26px; }
  body #nbGate .nbGateBody > h2 { font-size: 29px; }
  body #nbGate .nx-gate-subtitle { margin-bottom: 20px; }
  body #nbGate .nbWordCloud { display: none; }
}
@media (max-width: 599px) {
  /* iOS Safari enlarges the whole page when a smaller form field receives focus. */
  body input:not([type="checkbox"]):not([type="radio"]), body select, body textarea,
  body #nbGate input:not([type="checkbox"]) { font-size: 16px !important; }
  html, body { overflow-x: clip; }
  body > header, html.premium-dark body > header { height: 68px; padding: 0 20px; gap: 10px; }
  body > header h1 { font-size: 26px; }
  body > main { padding: 24px 20px 110px !important; }
  body #nbWelcome { padding: 26px; gap: 20px; grid-template-columns: 1fr; border-radius: 18px; min-height: 0; margin-bottom: 22px; }
  body #nbWelcome h2 { font-size: 35px; margin-top: 12px; }
  body #nbWelcome p { font-size: 13px; margin-bottom: 20px; }
  .nx-feature { padding: 19px 0 0; border-top: 1px solid #8755372b; gap: 16px; }
  .nx-feature-cover { width: 58px; height: 87px; }
  .nx-feature h3 { font-size: 19px; margin: 5px 0; }
  .nx-feature p { display: none; }
  .nx-feature-label { font-size: 9px; }
  .nx-feature button { min-height: 30px; font-size: 11px; padding: 2px 0; }
  #nbTools { margin-bottom: 24px; }
  #cloudpanel > h2 { font-size: 27px; margin-bottom: 18px; }
  body .premium-tools { gap: 8px; }
  body .premium-tools > input { flex-basis: 100%; }
  body .premium-tools > select { flex: 1; width: auto; font-size: 12px; }
  body .premium-tools > button { font-size: 12px; padding-inline: 12px; }
  .nx-filters { grid-template-columns: 1fr; padding: 14px; }
  .nx-filters > button { width: 100%; }
  .refine-count { font-size: 11px; margin-bottom: 20px; }
  #stored:not(.premium-list), #books { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 26px 18px; }
  #stored .nbGenreTag { font-size: 10px; }
  #stored:not(.premium-list) > article > h3 { font-size: 13px; }
  #detail { padding: 18px 22px; }
  #detail .wrap { grid-template-columns: 1fr; gap: 32px; margin-top: 26px; }
  #detail .detail-side { width: 200px; margin: 0 auto; }
  #detail #dt { font-size: 33px; }
  #detail .detail-actions { margin-top: 20px; }
  #nbAccountShell { padding: 22px 20px 110px; }
  #nbSuggest { grid-template-columns: 1fr; padding: 18px; }
  .npSettings[open] { padding: 20px; }
  .npSection { padding: 20px; }
  .npSettingsHeader h2 { font-size: 30px; }
  .npSettings .npChoices { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .npSettings form { grid-template-columns: 1fr; }
  .nx-admin .adminShell { grid-template-columns: 1fr; }
  .nx-admin .adminSide { position: static; height: auto; min-height: 0; padding: 22px 20px; border-right: 0; border-bottom: 1px solid var(--nx-border); }
  .nx-admin .adminSide > p { margin-bottom: 4px; }
  .nx-admin .adminSide .ncNav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
  .nx-admin .adminSide .ncNav button { font-size: 11px; padding: 10px; }
  .nx-admin .adminSide > a { padding-top: 14px; margin: 4px 0 0; font-size: 12px; }
  .nx-admin .adminMain { padding: 24px 20px; }
  .nx-admin .adminTop h1 { font-size: 31px; }
  .nx-admin .ncStats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .nx-admin .ncStats > div { min-height: 130px; height: 130px; padding: 16px; }
  .nx-admin .ncStats strong { font-size: 26px; }
  .nx-admin .adminMain section { padding: 18px; }
  .nx-admin #list > p { grid-template-columns: 1fr; }
  .nx-admin .adminRefresh { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  #stored article > img:hover { transform: translateY(-3px); transition: transform .2s ease; }
  .npDialog[open], #detail:not([hidden]) .wrap { animation: nx-appear .22s ease-out both; }
  @keyframes nx-appear { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
body #nbGate .nbGateArt { justify-content: flex-start; }
body #nbGate #nbLogin { align-items: stretch; }
body #nbGate .nx-field { width: 100%; }
body #nbGate .nbLoginOptions { flex-wrap: nowrap; }
body #nbGate .nbLoginOptions button { font-weight: 400; }
body #nbWelcome .eyebrow { color: #91472c; }
.nx-feature-label { opacity: 1; color: #6c5848; }
html.premium-dark body #nbWelcome .eyebrow { color: #e0a17c; }
html.premium-dark .nx-feature-label { color: #d4b99e; }
#reader:not(.nrReader) :is(#nbPanel, #readingSettings, #epubExtra, #nb82Chapters) {
  position: fixed;
  top: 76px;
  right: 20px;
  left: auto;
  width: min(360px, calc(100vw - 40px));
  background: var(--paper, #f5efdf) !important;
  color: var(--ink, #302b24) !important;
  border: 1px solid #85705a33;
  border-radius: 16px !important;
  padding: 22px;
  z-index: 20;
}
#reader:not(.nrReader) :is(#nbPanel, #readingSettings, #epubExtra) h3 { font-size: 16px; margin: 0 0 16px; }
#reader:not(.nrReader) :is(#nbPanel, #readingSettings, #epubExtra) button {
  min-height: 42px;
  background: transparent !important;
  color: inherit !important;
  border: 1px solid #85705a33;
  border-radius: 9px;
  font-size: 13px;
  padding: 10px 13px;
}
#reader:not(.nrReader) :is(#nbPanel, #readingSettings, #epubExtra) input,
#reader:not(.nrReader) :is(#nbPanel, #readingSettings, #epubExtra) select {
  background: var(--paper, #f5efdf) !important;
  color: var(--ink, #302b24) !important;
  border: 1px solid #85705a44;
  font-size: 13px;
  min-height: 44px;
}
#reader:not(.nrReader) #nbPanel label { display: grid; gap: 7px; margin: 16px 0; font-size: 12px; }
#reader:not(.nrReader) #nbPanel select { width: 100%; }
#reader:not(.nrReader) #nbPanel > button { margin: 0 5px 8px 0; }
#reader:not(.nrReader) #nb82Nav { padding: 10px 20px; max-width: 1040px; margin: 0 auto; gap: 16px; }
#reader:not(.nrReader) #nb82Nav input { padding: 0; min-height: 28px; background: transparent; border: 0; }
#reader:not(.nrReader) #nb94Layout { font-size: 11px; padding: 0 20px 8px; text-align: right; }
#reader:not(.nrReader) #nb94Layout select { font-size: 11px; min-height: 32px; padding: 6px 10px; background: transparent; color: inherit; border-color: #85705a33; }
#reader:not(.nrReader) #nb94Controls { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); left: 18px; gap: 5px; }
#reader:not(.nrReader) #nb94Controls button { min-height: 34px; border: 1px solid #85705a33; background: var(--paper, #f5efdf); color: var(--ink, #302b24); border-radius: 8px; padding: 7px 11px; font-size: 11px; }
#reader:not(.nrReader) .rhead > button { font: 13px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
#reader:not(.nrReader) #epubTools { font-size: 11px; min-width: 50px; }
#reader:not(.nrReader) :is(#nbPanel, #readingSettings, #epubExtra, #nb82Chapters) {
  bottom: auto;
  transform: none;
  height: auto;
  max-height: calc(100dvh - 150px);
}

body #nbGate { align-items: safe center; }
@media (min-width: 600px) and (pointer: coarse) {
  body #stored:not(.premium-list), body #books {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

#cloudpanel .nx-library-more:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-width: min(220px, 100%);
  min-height: 46px;
  margin: clamp(24px, 4vw, 40px) auto 16px;
  padding: 10px 24px;
  border: 1px solid var(--nx-brand);
  border-radius: 999px;
  color: var(--nx-brand);
  background: var(--nx-paper);
  font-weight: 650;
}

#cloudpanel .nx-library-more:hover:not(:disabled) {
  background: var(--nx-soft);
}

#cloudpanel .nx-library-more:focus-visible {
  outline: 2px solid var(--nx-brand);
  outline-offset: 3px;
}
