/* ============================================
   E-Book Reader - Interface
   ============================================ */

:root {
  --bg-primary: #f3f7f4;
  --bg-secondary: #e7eee9;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --page-bg: #fffdf8;
  --page-left: #f8f5ee;
  --ink: #17201d;
  --ink-soft: #51615d;
  --ink-muted: #7d8b86;
  --accent: #0f8f88;
  --accent-2: #d75d4b;
  --accent-3: #d9a441;
  --border: rgba(23, 32, 29, 0.12);
  --border-strong: rgba(23, 32, 29, 0.2);
  --shadow-sm: 0 1px 4px rgba(23, 32, 29, 0.08);
  --shadow-md: 0 10px 28px rgba(23, 32, 29, 0.13);
  --shadow-lg: 0 22px 70px rgba(23, 32, 29, 0.24);
  --radius: 8px;
  --transition: 180ms ease;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Merriweather, Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg-primary: #171916;
  --bg-secondary: #20251f;
  --surface: rgba(29, 34, 31, 0.9);
  --surface-strong: #222821;
  --page-bg: #f7f4ec;
  --page-left: #eee9df;
  --ink: #edf3ee;
  --ink-soft: #bac8c0;
  --ink-muted: #8f9e96;
  --accent: #28c2b8;
  --accent-2: #ee7b67;
  --accent-3: #edc35d;
  --border: rgba(237, 243, 238, 0.12);
  --border-strong: rgba(237, 243, 238, 0.22);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 26px 78px rgba(0, 0, 0, 0.52);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 143, 136, 0.08), transparent 36%),
    linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
  color: var(--ink);
  font-family: var(--font-ui);
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

body.reading {
  overflow: hidden;
}

body.reading .header {
  display: none;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.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;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  min-height: 64px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.app-title {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0;
}

.theme-toggle {
  position: relative;
  width: 50px;
  height: 28px;
}

.theme-toggle input {
  display: none;
}

.theme-toggle label {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-secondary);
  transition: background var(--transition), border-color var(--transition);
}

.theme-toggle label::after {
  content: "☼";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 0.72rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), color var(--transition);
}

.theme-toggle input:checked+label::after {
  content: "☾";
  transform: translateX(22px);
  color: var(--accent-3);
}

.upload-section {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 36px 20px;
}

.upload-card {
  width: min(540px, 100%);
  padding: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
  backdrop-filter: blur(18px);
}

.upload-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 1rem;
  font-weight: 850;
}

.upload-title {
  margin-bottom: 10px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.upload-subtitle {
  margin: 0 auto 28px;
  max-width: 440px;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.62;
}

.drop-zone {
  position: relative;
  padding: 30px 22px;
  cursor: pointer;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

[data-theme="dark"] .drop-zone {
  background: rgba(255, 255, 255, 0.04);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(15, 143, 136, 0.1);
  transform: translateY(-1px);
}

.drop-zone-symbol {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 1.35rem;
  line-height: 1;
}

.drop-zone-text {
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.45;
}

.drop-zone-text strong {
  color: var(--accent);
  font-weight: 760;
}

.drop-zone-formats {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

#file-input {
  display: none;
}

.pdf-url-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.pdf-url-form input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pdf-url-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 136, 0.14);
}

.pdf-url-form button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 760;
  transition: background var(--transition), transform var(--transition);
}

.pdf-url-form button:hover {
  background: #0b7771;
}

.pdf-url-form button:active {
  transform: scale(0.97);
}

.pdf-url-note {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.file-info {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.file-info.visible {
  display: flex;
}

.reader-section {
  display: none;
}

.reader-section.active {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(15, 143, 136, 0.08), transparent 38%),
    linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
  overflow: hidden;
}

.reader-rail {
  position: relative;
  z-index: 40;
  height: 100vh;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 28px rgba(23, 32, 29, 0.08);
  backdrop-filter: blur(18px);
}

.rail-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.18rem;
  font-weight: 740;
  line-height: 1;
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    opacity var(--transition);
}

.rail-btn:hover,
.rail-btn.active {
  color: var(--accent);
  background: rgba(15, 143, 136, 0.11);
  border-color: rgba(15, 143, 136, 0.22);
}

.rail-btn:active {
  transform: scale(0.95);
}

.rail-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.rail-btn:disabled:hover {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.rail-btn-small {
  font-size: 0.72rem;
  font-weight: 800;
}

.rail-separator {
  width: 28px;
  height: 1px;
  flex: 0 0 1px;
  margin: 2px 0;
  background: var(--border);
}

.page-indicator {
  width: 48px;
  min-height: 46px;
  display: grid;
  place-items: center;
  gap: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.05;
  text-align: center;
  user-select: none;
}

.page-indicator span:first-child {
  color: var(--accent);
  font-size: 0.92rem;
}

.page-total {
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.font-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.font-controls.hidden,
.reader-section.pdf-mode .font-controls,
.reader-section.txt-mode .pdf-control {
  display: none;
}

.reader-main {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.book-container {
  --page-width: 420px;
  --page-height: 620px;
  --page-half-height: 310px;
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 1900px;
  touch-action: none;
}

.book-container::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 12;
  width: 24px;
  height: var(--page-height);
  max-height: calc(100vh - 34px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg,
      transparent,
      rgba(0, 0, 0, 0.18) 42%,
      rgba(255, 255, 255, 0.28) 50%,
      rgba(0, 0, 0, 0.2) 58%,
      transparent);
  opacity: 0.5;
  filter: blur(0.2px);
  transition: opacity 90ms ease;
}

.book-container.is-flipping::before {
  opacity: 0;
}

.book-container::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: max(16px, calc((100vh - var(--page-height)) / 2 - 24px));
  z-index: 0;
  width: min(calc(var(--page-width) * 2.12), calc(100vw - 120px));
  height: 44px;
  pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.12) 46%, transparent 72%);
  filter: blur(12px);
}

.book-container.portrait-mode::before {
  display: none;
}

.book-container.portrait-mode::after {
  width: min(calc(var(--page-width) * 1.08), calc(100vw - 90px));
}

.company-panel {
  --company-panel-enter-x: 0px;
  position: absolute;
  top: calc(50% - var(--page-half-height));
  z-index: 3;
  width: var(--page-width);
  height: var(--page-height);
  pointer-events: auto;
  transform: translate(var(--company-panel-enter-x), 10px) scale(0.985);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 240ms ease,
    transform 300ms cubic-bezier(0.18, 0.86, 0.32, 1),
    visibility 0s linear 260ms;
}

.company-panel[hidden] {
  display: none !important;
}

.company-panel[data-side="left"] {
  --company-panel-enter-x: -22px;
  left: calc(50% - var(--page-width));
}

.company-panel[data-side="right"] {
  --company-panel-enter-x: 22px;
  left: 50%;
}

.company-panel.is-visible {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.company-panel.is-hiding {
  visibility: visible;
}

.book-container.is-flipping .company-panel {
  opacity: 0;
  visibility: hidden;
}

.book-container.portrait-mode .company-panel,
.reader-section.pdf-default-mode .company-panel {
  display: none !important;
}

.company-card {
  width: 100%;
  height: 100%;
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(15, 143, 136, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    #09100d;
  color: #eef7f3;
  text-rendering: optimizeLegibility;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 22px 45px rgba(0, 0, 0, 0.24);
  transform: translateY(8px) scale(0.992);
  transition: transform 320ms cubic-bezier(0.18, 0.86, 0.32, 1);
}

.company-panel.is-visible .company-card {
  transform: none;
}

.company-logo {
  min-width: 76px;
  height: 58px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: #fff;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: 0;
}

.company-logo img {
  max-width: 148px;
  max-height: 44px;
  object-fit: contain;
}

.company-name {
  max-width: 92%;
  margin-top: 8px;
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.company-subtitle {
  color: rgba(238, 247, 243, 0.92);
  font-size: 0.95rem;
  line-height: 1.45;
}

.company-tagline {
  max-width: 92%;
  margin: 6px 0 10px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: rgba(238, 247, 243, 0.96);
  font-size: 0.9rem;
  line-height: 1.55;
}

.company-contact-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  color: rgba(238, 247, 243, 0.93);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.company-address-list {
  display: grid;
  gap: 5px;
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.company-address-title {
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 780;
  text-transform: uppercase;
}

.reader-section.pdf-default-mode .book-container {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px clamp(12px, 4vw, 42px) 80px;
  perspective: none;
  touch-action: pan-y;
}

.reader-section.pdf-default-mode .book-container::before,
.reader-section.pdf-default-mode .book-container::after {
  display: none;
}

#book {
  --pdf-zoom: 1;
  --pdf-pan-x: 0px;
  --pdf-pan-y: 0px;
  position: relative;
  z-index: 2;
}

#book.pdf-default-view {
  width: min(100%, 920px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-bottom: 40px;
}

.stf__parent {
  overflow: visible !important;
  border-radius: 5px;
  box-shadow: 0 24px 34px rgba(19, 27, 25, 0.2);
  transform: none;
}

.stf__block {
  border-radius: 5px;
}

.page {
  position: relative;
  overflow: hidden;
  background: var(--page-bg);
  color: #21211f;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.055),
    inset 14px 0 20px rgba(0, 0, 0, 0.035),
    inset -10px 0 18px rgba(255, 255, 255, 0.32);
}

.page:nth-child(even):not(.page-cover-hard) {
  background: var(--page-left);
}

.page.page-pdf {
  --pdf-zoom: 1;
  --pdf-pan-x: 0px;
  --pdf-pan-y: 0px;
  display: grid;
  place-items: center;
  background: #ffffff;
}

.pdf-default-view .pdf-default-page {
  width: min(100%, 860px);
  height: auto;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow:
    0 18px 40px rgba(23, 32, 29, 0.18),
    0 0 0 1px rgba(23, 32, 29, 0.08);
}

.pdf-default-view .pdf-default-page::before,
.pdf-default-view .pdf-default-page::after {
  display: none !important;
}

.pdf-page-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
}

.pdf-page-shell img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  image-rendering: auto;
  transform: none;
  transform-origin: center center;
  transition: transform 120ms ease;
  backface-visibility: hidden;
}

.page-pdf.is-page-zoomed .pdf-page-shell img {
  will-change: transform;
}

.book-container.is-panning .page-pdf.is-active-zoom-page .pdf-page-shell img {
  transition: none;
}

.page-pdf.is-page-zoomed {
  cursor: grab;
}

.book-container.is-panning .page-pdf.is-active-zoom-page {
  cursor: grabbing;
}

.page-pdf:not(.page-cover-hard)::after {
  display: none;
}

.page-cover-hard {
  background: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.14),
    inset 0 0 26px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.25);
}

.page-cover-hard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.1));
  opacity: 0.2;
}

.page-cover-hard::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 4;
  width: 9px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.22));
}

.pdf-back-cover.page-cover-hard::after {
  right: auto;
  left: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent);
}

.page-content {
  position: relative;
  height: 100%;
  padding: 42px 38px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-text {
  flex: 1;
  overflow: hidden;
  color: #282722;
  font-family: var(--font-body);
  line-height: 1.82;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  text-align: justify;
  text-rendering: optimizeLegibility;
}

.page-number {
  flex: 0 0 auto;
  margin-top: 18px;
  padding-top: 12px;
  color: #797469;
  border-top: 1px solid rgba(0, 0, 0, 0.09);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  text-align: center;
}

.page-text-mode::after {
  display: none;
}

.page-cover {
  display: grid;
  place-items: center;
  color: white;
  background:
    linear-gradient(135deg, rgba(15, 143, 136, 0.94), rgba(215, 93, 75, 0.94)),
    var(--accent);
}

.cover-content {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.cover-mark {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  font-size: 0.74rem;
  font-weight: 850;
}

.cover-title {
  max-width: 92%;
  color: white;
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 4vw, 1.75rem);
  line-height: 1.28;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.26);
}

.cover-divider {
  width: 58px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.cover-subtitle,
.back-cover-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 11, 0.46);
  backdrop-filter: blur(10px);
}

.loading-overlay.active {
  display: flex;
}

.loading-card {
  width: min(320px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.42;
}

.progress-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transition: width 260ms ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 2000;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface-strong);
  box-shadow: var(--shadow-md);
  font-size: 0.84rem;
  font-weight: 650;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, 90px);
  transition: transform 240ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .reader-section.active {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .reader-rail {
    padding-inline: 7px;
  }

  .rail-btn {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .page-content {
    padding: 30px 24px;
  }
}

@media (max-width: 640px) {
  .header {
    min-height: 58px;
    padding: 10px 14px;
  }

  .logo {
    width: 32px;
    height: 32px;
  }

  .app-title {
    font-size: 0.95rem;
  }

  .upload-section {
    min-height: calc(100vh - 58px);
    padding: 22px 14px;
  }

  .upload-card {
    padding: 28px 18px;
  }

  .upload-icon {
    width: 58px;
    height: 58px;
  }

  .drop-zone {
    padding: 24px 14px;
  }

  .pdf-url-form {
    grid-template-columns: 1fr;
  }

  .reader-section.active {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .reader-rail {
    gap: 6px;
    padding: 8px 6px;
  }

  .rail-btn {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
    font-size: 1.02rem;
  }

  .rail-btn-small {
    font-size: 0.66rem;
  }

  .page-indicator {
    width: 42px;
    min-height: 40px;
    font-size: 0.66rem;
  }

  .page-indicator span:first-child {
    font-size: 0.82rem;
  }

  .rail-separator {
    width: 24px;
  }

  .book-container::after {
    bottom: 10px;
  }
}

@media (max-height: 680px) {
  .reader-rail {
    gap: 5px;
  }

  .rail-btn {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .page-indicator {
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}