@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #090a0f;
  --bg-soft: #0e1017;
  --surface: rgba(25, 27, 35, 0.72);
  --surface-strong: rgba(32, 34, 43, 0.88);
  --surface-light: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f7;
  --text-muted: #a4a6b0;
  --text-dim: #6e717d;

  --blue: #70a7ff;
  --blue-soft: rgba(112, 167, 255, 0.16);
  --cyan: #72d8ff;
  --amber: #ffc96b;
  --amber-soft: rgba(255, 201, 107, 0.15);
  --red: #ff7d86;
  --red-soft: rgba(255, 125, 134, 0.14);
  --green: #7ee6aa;

  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;
  --shadow: 0 16px 45px rgba(0,0,0,.28);
  --blur: blur(28px) saturate(145%);

  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 15% -10%, rgba(80, 130, 255, .13), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(120, 90, 255, .09), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 150, 255, .055), transparent 35%),
    linear-gradient(120deg, transparent 0%, rgba(255,255,255,.012) 50%, transparent 100%);
}

button, input { font: inherit; }

button {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

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

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ===== STATUS DOTS ===== */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 12px currentColor;
}

.dot-blue { background: var(--blue); color: var(--blue); }
.dot-amber { background: var(--amber); color: var(--amber); }
.dot-red { background: var(--red); color: var(--red); }
.dot-green { background: var(--green); color: var(--green); }

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 12px;
  z-index: 100;
  width: min(1200px, calc(100% - 24px));
  height: 66px;
  margin: 12px auto 0;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(18, 20, 27, .70);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 12px 38px rgba(0,0,0,.25);
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 18px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: .2s ease;
}

.logo:hover { background: var(--surface-light); }
.logo-gui { color: var(--text); }
.logo-manga { color: var(--blue); }

.status-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  height: 42px;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

header input {
  flex: 1;
  min-width: 120px;
  height: 50px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 17px;
  outline: none;
  background: rgba(255,255,255,.045);
  color: var(--text);
  transition: .2s ease;
}

header input::placeholder { color: var(--text-dim); }
header input:focus {
  background: rgba(255,255,255,.075);
  border-color: var(--border-strong);
}

.header-actions {
  display: flex;
  gap: 6px;
}

header button {
  min-width: 50px;
  height: 50px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 17px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: .2s ease;
}

header button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

header button:active { transform: scale(.96); }
header button.primary { color: var(--blue); }
header button.primary:hover { background: var(--blue-soft); }

/* ===== PROGRESS ===== */
.progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 300;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 14px rgba(112,167,255,.55);
  transition: width .1s linear;
}

/* ===== MAIN ===== */
.container {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 32px 20px 70px;
}

/* ===== DEBUG ===== */
.debug-box {
  display: none;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: var(--blur);
  color: var(--cyan);
  font-size: 11px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.debug-box.visible { display: block; }
.debug-box .log-time { color: var(--text-dim); margin-right: 8px; }
.debug-box .log-label { color: var(--amber); margin-right: 4px; }
.debug-box .log-error { color: var(--red); }

/* ===== SECTION ===== */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 4px 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}

.section-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px rgba(112,167,255,.6);
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== GRID ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
  cursor: pointer;
  opacity: 0;
  animation: rise .45s ease forwards;
  transition: transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.card:hover {
  transform: translateY(-4px);
  background: var(--surface-strong);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.card:active { transform: scale(.985); }

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.07), transparent 30%);
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 2;
}

.card:hover::before { opacity: 1; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card .thumb {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
}

.card .thumb::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(10,11,16,.72));
  pointer-events: none;
}

.card img {
  width: 100%;
  height: 235px;
  display: block;
  object-fit: cover;
  transition: transform .45s ease, filter .3s ease;
}

.card:hover img {
  transform: scale(1.035);
  filter: brightness(1.05);
}

.card .title {
  padding: 13px 14px 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 14px;
  color: var(--text-muted);
  font-size: 11px;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 90px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading .spin {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid rgba(255,255,255,.09);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}

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

/* ===== INFO VIEW ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: .2s ease;
}

.back-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateX(-2px);
}

.back-btn::before { content: '‹'; color: var(--blue); font-size: 18px; line-height: 0; }

/* ===== MANGA INFO ===== */
.manga-info {
  position: relative;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

.manga-info::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.06), transparent 35%);
}

.manga-info img {
  width: 175px;
  max-height: 265px;
  border: 1px solid var(--border);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 14px 35px rgba(0,0,0,.3);
}

.manga-details {
  flex: 1;
  min-width: 240px;
}

.manga-details h2 {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 25px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.025em;
}

.manga-details .detail-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.055);
  font-size: 12px;
}

.manga-details .detail-row:last-child { border-bottom: none; }

.manga-details .detail-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 80px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.manga-details .detail-value { color: var(--text); flex: 1; }

.manga-details .desc {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.75;
}

.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.genre {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  transition: .18s ease;
}

.genre:hover {
  background: var(--blue-soft);
  border-color: rgba(112,167,255,.35);
  color: var(--blue);
}

/* ===== CHAPTERS ===== */
.chapters-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.025);
}

.chapter-btn {
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  transition: .18s ease;
}

.chapter-btn:hover {
  background: var(--blue-soft);
  border-color: rgba(112,167,255,.28);
  color: var(--blue);
  transform: translateY(-1px);
}

.chapter-btn:active { transform: scale(.97); }

/* ===== READER ===== */
.reader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0 50px;
}

.reader-page-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 8px 30px rgba(0,0,0,.24);
}

.reader-page {
  width: 100%;
  display: block;
  opacity: 0;
  transition: opacity .3s ease;
}

.reader-page.loaded { opacity: 1; }

.reader-page img {
  width: 100%;
  height: auto;
  display: block;
}

.page-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(12,13,18,.62);
  backdrop-filter: blur(18px);
  color: var(--text-muted);
  font-size: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}

.reader-page-wrap:hover .page-label { opacity: 1; }

/* ===== FLOATING CONTROLS ===== */
.page-counter {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(24,26,34,.78);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  color: var(--text-muted);
  font-size: 11px;
}

.page-counter span { color: var(--blue); font-weight: 700; }

.reader-controls {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: rgba(24,26,34,.78);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.reader-controls button {
  min-width: 44px;
  min-height: 40px;
  padding: 9px 13px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: .18s ease;
}

.reader-controls button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.reader-controls button:active { transform: scale(.94); }

/* ===== CHAPTER NAV ===== */
.chapter-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: min(100%, 650px);
  margin: 0 auto;
  padding: 18px 18px 100px;
}

.chapter-nav button {
  flex: 1;
  min-height: 50px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: .18s ease;
}

.chapter-nav button:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: rgba(112,167,255,.3);
  color: var(--blue);
}

.chapter-nav button:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.chapter-nav .divider {
  display: none;
}

/* ===== DOWNLOAD ===== */
.download-btn,
.bulk-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(255,201,107,.3);
  border-radius: 16px;
  background: rgba(255,201,107,.08);
  color: var(--amber);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: .18s ease;
}

.download-btn {
  position: fixed;
  top: 88px;
  right: max(20px, calc((100vw - 1200px) / 2 + 20px));
  z-index: 150;
}

.download-btn:hover,
.bulk-download-btn:hover {
  background: var(--amber-soft);
  border-color: rgba(255,201,107,.5);
  transform: translateY(-1px);
}

.download-btn:disabled,
.bulk-download-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4,5,9,.58);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  position: relative;
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  background: rgba(25,27,35,.88);
  backdrop-filter: blur(32px) saturate(150%);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  box-shadow: 0 30px 90px rgba(0,0,0,.48);
  transform: translateY(8px) scale(.98);
  transition: transform .22s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.07), transparent 32%);
}

.modal-header {
  position: relative;
  padding: 22px 22px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.modal-body { position: relative; padding: 18px 22px 22px; }

.modal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 11px;
}

.modal-status .status-text { color: var(--text); }

.modal-progress-wrap {
  width: 100%;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.modal-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--blue);
  box-shadow: 0 0 14px rgba(112,167,255,.5);
  transition: width .15s ease;
}

.modal-progress-text {
  margin-bottom: 18px;
  color: var(--text-dim);
  text-align: right;
  font-size: 10px;
}

.modal-log {
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(0,0,0,.18);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.65;
}

.modal-log .log-entry { display: flex; gap: 8px; }
.modal-log .log-time { color: var(--text-dim); flex-shrink: 0; }
.modal-log .log-msg.ok { color: var(--green); }
.modal-log .log-msg.err { color: var(--red); }
.modal-log .log-msg.warn { color: var(--amber); }

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: .18s ease;
}

.modal-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.modal-btn.danger {
  border-color: rgba(255,125,134,.3);
  background: var(--red-soft);
  color: var(--red);
}

.modal-btn.primary {
  border-color: rgba(112,167,255,.3);
  background: var(--blue-soft);
  color: var(--blue);
}

/* ===== BULK INPUTS ===== */
.modal-inputs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.modal-input-group label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.modal-input-group input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: rgba(0,0,0,.18);
  color: var(--text);
  transition: .18s ease;
}

.modal-input-group input:focus {
  border-color: rgba(112,167,255,.5);
  background: rgba(255,255,255,.04);
}

.modal-verify-result {
  display: flex;
  align-items: center;
  min-height: 20px;
  margin-bottom: 16px;
  font-size: 11px;
}

.hidden { display: none !important; }

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,.10);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.17); }

/* ===== CORNER ACCENTS ===== */
.corner-accent { display: none; }

/* ===== EMPTY ===== */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  body { font-size: 14px; }

  header {
    top: 8px;
    width: calc(100% - 16px);
    height: auto;
    min-height: 58px;
    margin-top: 8px;
    flex-wrap: wrap;
    padding: 6px;
    border-radius: 22px;
  }

  .logo {
    min-height: 46px;
    padding: 0 13px;
  }

  .status-bar { display: none; }

  header input {
    order: 3;
    flex-basis: 100%;
    height: 46px;
    min-width: 0;
  }

  .header-actions {
    margin-left: auto;
  }

  header button {
    min-width: 44px;
    height: 46px;
    padding: 0 12px;
  }

  .container { padding: 20px 12px 80px; }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
  }

  .card { border-radius: 19px; }
  .card img { height: 205px; }

  .manga-info {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    border-radius: 24px;
  }

  .manga-info img {
    width: min(220px, 100%);
    max-height: 320px;
    margin: 0 auto;
  }

  .manga-details { min-width: 0; }
  .manga-details h2 { font-size: 21px; }

  .chapters-list {
    max-height: 340px;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  }

  .chapter-btn {
    min-height: 46px;
    font-size: 11px;
  }

  .reader { padding: 6px 0 105px; }

  .reader-page-wrap {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .page-label { opacity: 1; }

  .page-counter {
    right: 12px;
    bottom: 12px;
    padding: 9px 13px;
  }

  .reader-controls {
    left: 12px;
    bottom: 12px;
  }

  .reader-controls button {
    min-width: 46px;
    min-height: 46px;
  }

  .chapter-nav {
    width: 100%;
    flex-direction: column;
    padding: 16px 8px 100px;
  }

  .chapter-nav button {
    width: 100%;
    min-height: 52px;
  }

  .download-btn {
    top: auto !important;
    right: 12px !important;
    bottom: 72px;
    padding: 9px 13px;
    border-radius: 15px;
  }

  .modal-overlay { padding: 12px; }
  .modal-box { border-radius: 25px; }
  .modal-inputs { flex-direction: column; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card img { height: 225px; }
  .card .title { font-size: 12px; padding: 11px 11px 4px; }
  .card .meta { padding: 0 11px 11px; }

  .manga-details .detail-row {
    flex-direction: column;
    gap: 3px;
    padding: 9px 0;
  }

  .manga-details .detail-label { min-width: auto; }
  .section-label { margin-top: 20px; }
}
