:root,
[data-theme="light"] {
  --blue: #025bff;
  --blue-dark: #0046c6;
  --blue-soft: #e3edff;
  --red: #e31c3d;
  --green: #19b959;
  --green-soft: #eafff5;
  --yellow: #ffd200;
  --gray-100: #eef1f4;
  --gray-200: #ced2db;
  --gray-300: #adb5c3;
  --gray-400: #8d97ab;
  --gray-500: #6c7993;
  --gray-600: #545e72;
  --gray-700: #3c4352;
  --gray-800: #21252d;
  --gray-900: #14161c;
  --white: #ffffff;
  --page-bg: #f4f6fa;
  --page-text: #21252d;
  --surface: #ffffff;
  --surface-muted: #eef1f4;
  --surface-soft: #f7f9fc;
  --border: #d5dbe6;
  --card-shadow: 0 1px 3px rgba(20, 22, 28, 0.08);
  --hero-end: #1a1f2a;
  --disclaimer-bg: #fff8e8;
  --disclaimer-border: #ffe4a3;
  --disclaimer-text: #6a5200;
  --book-foot-bg: #fbfcfd;
  --float-bg: #ffffff;
  --float-border: #ced2db;
  --float-text: #21252d;
  --progress-track: rgba(2, 91, 255, 0.15);
  --chrome-bg: #14161c;
  --chrome-text: #ffffff;
  --chrome-muted: #ced2db;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 22, 28, 0.08);
  --font: "Vazirmatn", "Tahoma", sans-serif;
  --max: 1120px;
  --accent: #025bff;
}

[data-theme="dark"] {
  --blue: #4d8aff;
  --blue-dark: #7eb0ff;
  --blue-soft: rgba(77, 138, 255, 0.16);
  --green-soft: rgba(25, 185, 89, 0.18);
  --gray-100: #1c2230;
  --gray-200: #2a3344;
  --gray-300: #9aa6bc;
  --gray-400: #7f8ba3;
  --gray-500: #9aa6bc;
  --gray-600: #c0c8d8;
  --gray-700: #d5dbe8;
  --gray-800: #e8ecf5;
  --gray-900: #f3f5fa;
  --white: #151922;
  --page-bg: #0e1118;
  --page-text: #e8ecf5;
  --surface: #151922;
  --surface-muted: #1c2230;
  --surface-soft: #181e2a;
  --border: #2a3344;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --hero-end: #12161f;
  --disclaimer-bg: #2a2414;
  --disclaimer-border: #5a4a22;
  --disclaimer-text: #f0d78c;
  --book-foot-bg: #121722;
  --float-bg: #1a2030;
  --float-border: #33405a;
  --float-text: #e8ecf5;
  --progress-track: rgba(77, 138, 255, 0.25);
  --chrome-bg: #0a0c12;
  --chrome-text: #ffffff;
  --chrome-muted: #adb5c3;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --accent: #4d8aff;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--page-text);
  background: var(--page-bg);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--blue-dark);
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4.5vw, 1.75rem);
  box-sizing: border-box;
}

.container.prose {
  max-width: 820px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--chrome-bg);
  color: var(--chrome-text);
  border-bottom: 3px solid var(--blue);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--chrome-text);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  min-width: 0;
}

.brand:hover {
  color: var(--chrome-text);
}

.brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #4d8aff);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-abbr {
  margin-inline-start: 0.35rem;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7eb0ff;
  vertical-align: middle;
}

.logo-img {
  width: 96px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #0b1220;
}

.hero-grid,
.page-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.hero-visual img,
.topic-banner {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.page-hero {
  background: linear-gradient(180deg, var(--chrome-bg), var(--hero-end));
  color: #fff;
  padding: 2.5rem 0 2rem;
}

.page-hero p {
  color: var(--gray-300);
}

.review-logo-wrap {
  margin: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}

.big-rating {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.15rem;
}

.big-rating span {
  font-size: 1.6rem;
  font-weight: 800;
}

.big-rating small {
  color: var(--gray-300);
}

.inline-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.media-guides {
  background: var(--surface-soft);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.media-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-card h3,
.media-card p {
  margin: 0;
  padding: 0 1rem;
}

.media-card h3 {
  padding-top: 0.9rem;
  font-size: 1.05rem;
}

.media-card p {
  padding-bottom: 1rem;
  color: var(--gray-600);
  font-size: 0.92rem;
}

.article-section,
.review-prose {
  padding: 2.5rem 0 3rem;
}

.prose {
  max-width: 820px;
}

.prose h2,
.prose h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--gray-900);
  overflow-wrap: anywhere;
  padding-inline-end: 0.15rem;
}

.prose p,
.prose li {
  color: var(--gray-700);
  margin-bottom: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.review-index {
  padding-right: 1.1rem;
}

.review-index li {
  margin-bottom: 0.45rem;
}

.topic-banner {
  margin: 0 0 1.5rem;
  border: 1px solid var(--gray-200);
  box-shadow: none;
}

.breadcrumbs {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 0.65rem 0;
  font-size: 0.86rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 auto;
  padding-inline: clamp(1.15rem, 4.5vw, 1.75rem);
  width: 100%;
  max-width: var(--max);
  box-sizing: border-box;
  color: var(--gray-600);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-right: 0.5rem;
  color: var(--gray-400);
}

.breadcrumbs a {
  font-weight: 600;
}

.toc,
.toc-inline {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--blue-soft);
  border-radius: 8px;
  font-size: 0.92rem;
}

.toc a,
.toc-inline a {
  font-weight: 700;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.pager a {
  font-weight: 700;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1.5rem;
}

.footer-heading {
  color: #fff !important;
  font-size: 1rem !important;
  margin: 0 0 0.75rem !important;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-list li {
  margin-bottom: 0.35rem;
}

.footer-list a {
  color: var(--gray-300);
  font-weight: 500;
}

.footer-list a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.nav a.is-active {
  color: #fff;
}

.hero-visual figcaption {
  margin-top: 0.45rem;
  color: var(--gray-400);
  font-size: 0.8rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav a {
  color: var(--chrome-muted);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--chrome-text);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--chrome-text);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  cursor: pointer;
}

/* Hero */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(2, 91, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(227, 28, 61, 0.12), transparent 50%),
    linear-gradient(180deg, var(--chrome-bg) 0%, var(--hero-end) 100%);
  color: #fff;
  padding: 3.25rem 0 2.75rem;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.03'%3E%3Cpath d='M0 30h60M30 0v60'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(2, 91, 255, 0.2);
  border: 1px solid rgba(2, 91, 255, 0.45);
  color: #9ec0ff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.7rem, 3.5vw, 2.65rem);
  line-height: 1.25;
  font-weight: 800;
  max-width: 18ch;
}

.hero p {
  margin: 0;
  color: var(--gray-300);
  max-width: 42rem;
  font-size: 1.05rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
  color: var(--gray-300);
  font-size: 0.9rem;
}

.hero-meta strong {
  color: var(--white);
}

/* Comparison table header strip */
.list-section {
  background: var(--surface-muted);
  padding: 2rem 0 3rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  color: var(--gray-900);
  border-right: 4px solid var(--red);
  padding-right: 0.75rem;
}

.section-head p {
  margin: 0.35rem 0 0;
  color: var(--gray-600);
  font-size: 0.95rem;
}

.updated {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--gray-600);
  font-weight: 600;
}

/* Sportsbook cards — SBR-like ranked rows */
.books {
  display: grid;
  gap: 0.85rem;
}

.book {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gray-800);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  animation: rise 0.55s ease both;
  min-width: 0;
}

.book.is-top {
  border-top-color: var(--blue);
}

.book-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.2rem;
}

.book-identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.rank-badge {
  flex-shrink: 0;
  min-width: 2.4rem;
  height: 2.4rem;
  border-radius: 6px;
  background: var(--chrome-bg);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.book.is-top .rank-badge {
  background: var(--blue);
  color: #fff;
}

.logo-tile {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.book-name {
  min-width: 0;
}

.book-name h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gray-900);
}

.book-tag {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.offer {
  min-width: 0;
}

.offer-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.offer-title {
  font-weight: 800;
  color: var(--gray-900);
  font-size: 0.98rem;
  line-height: 1.4;
}

.offer-sub {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--gray-600);
}

.rating {
  text-align: center;
}

.rating-score {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}

.rating-stars {
  color: #f5b400;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin: 0.25rem 0;
}

.rating-caption {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 600;
}

.pros {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pros li {
  position: relative;
  padding-right: 1.1rem;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
  color: var(--gray-700);
}

.pros li:last-child {
  margin-bottom: 0;
}

.pros li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0.45rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--green);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 150px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--gray-800);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-apk {
  background: var(--green-soft);
  color: #0f7a3d;
  border-color: #b8efd0;
}

.btn-apk:hover {
  background: #d5f8e5;
  color: #0b5e2f;
}

.book-foot {
  border-top: 1px solid var(--border);
  background: var(--book-foot-bg);
  padding: 0.75rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--gray-600);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Guide */
.guide {
  padding: 3rem 0;
  background: var(--surface);
}

.guide h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  border-right: 4px solid var(--red);
  padding-right: 0.75rem;
}

.guide-lead {
  color: var(--gray-600);
  max-width: 48rem;
  margin-bottom: 1.75rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.guide-card {
  background: var(--surface-muted);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, transform 0.2s ease;
  min-width: 0;
}

.guide-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.guide-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.guide-card p {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.92rem;
}

.guide-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

/* Disclaimer / footer */
.disclaimer {
  background: var(--disclaimer-bg);
  border-block: 1px solid var(--disclaimer-border);
  padding: 1rem 0;
  font-size: 0.88rem;
  color: var(--disclaimer-text);
}

.site-footer {
  background: var(--chrome-bg);
  color: var(--chrome-muted);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: #fff;
  font-weight: 600;
}

.site-footer .footer-heading {
  color: #fff !important;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

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

@media (max-width: 980px) {
  .book-main {
    grid-template-columns: 1fr 1fr;
  }

  .actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .actions .btn {
    flex: 1 1 160px;
  }

  .guide-grid,
  .media-grid,
  .hero-grid,
  .page-hero-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--accent, #025bff);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

.eeat-box {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  background: var(--blue-soft);
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.toc,
.toc-inline {
  background: var(--blue-soft);
  border: 1px solid var(--border);
}

.breadcrumbs {
  background: var(--surface-muted);
  border-bottom-color: var(--border);
}

.prose {
  max-width: 820px;
}

.article-section,
.review-prose {
  background: transparent;
}

.main-content-pad,
#main-content.container,
main.container {
  padding-inline: clamp(1.15rem, 4.5vw, 1.75rem);
  box-sizing: border-box;
}

/* Keep long guide / article text away from screen edges on phones */
@media (max-width: 720px) {
  .container,
  .breadcrumbs ol,
  #main-content.container,
  main.container {
    padding-inline: 1.35rem;
  }

  .prose h2 {
    font-size: 1.25rem;
    line-height: 1.45;
  }

  .hero {
    padding-inline: 0;
  }

  .float-tools {
    /* leave room so text isn't hidden behind buttons */
    inset-inline-end: 0.75rem;
  }

  .book-main,
  .guide-card,
  .media-card,
  .eeat-box,
  .toc {
    margin-inline: 0;
  }
}

.eeat-box p {
  margin: 0.35rem 0;
}

.eeat-box a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 720px) {
  .menu-toggle {
    display: inline-flex;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .nav {
    display: none;
    position: absolute;
    inset-inline: 1rem;
    top: 64px;
    background: #1a1f2a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    z-index: 60;
  }

  .nav.open {
    display: flex;
  }

  .book-main {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .rating {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }

  .rating-stars,
  .rating-caption {
    margin: 0;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-meta span {
    flex: 1 1 100%;
  }

  .actions {
    min-width: 0;
    width: 100%;
  }

  .float-tools {
    inset-inline-end: 0.65rem;
    bottom: 0.65rem;
  }

  .float-toc {
    inset-inline-end: 0.65rem;
    bottom: 5.5rem;
    width: min(18.5rem, calc(100vw - 1.3rem));
  }
}

/* Reading progress + floating tools */
.read-progress {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 80;
  height: 3px;
  background: var(--progress-track);
  pointer-events: none;
}

.read-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), #19b959);
  transition: width 0.08s linear;
}

.float-tools {
  position: fixed;
  z-index: 70;
  inset-inline-end: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.float-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--float-border);
  background: var(--float-bg);
  color: var(--float-text);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.float-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--blue);
}

.float-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.float-ico {
  width: 18px;
  height: 18px;
  display: block;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.theme-ico {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
}

[data-theme="dark"] .theme-ico {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M21 14.5A8.5 8.5 0 0 1 9.5 3 7 7 0 1 0 21 14.5z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M21 14.5A8.5 8.5 0 0 1 9.5 3 7 7 0 1 0 21 14.5z'/%3E%3C/svg%3E");
}

.toc-ico {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E");
}

.up-ico {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M6 14l6-6 6 6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M6 14l6-6 6 6'/%3E%3C/svg%3E");
}

.down-ico {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M6 10l6 6 6-6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Cpath d='M6 10l6 6 6-6'/%3E%3C/svg%3E");
}

.float-toc {
  position: fixed;
  z-index: 69;
  inset-inline-end: 1rem;
  bottom: 6.2rem;
  width: min(20rem, calc(100vw - 2rem));
  max-height: min(60vh, 28rem);
  overflow: auto;
  background: var(--float-bg);
  color: var(--float-text);
  border: 1px solid var(--float-border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 0.75rem;
}

.float-toc[hidden] {
  display: none !important;
}

.float-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--float-border);
}

.float-toc-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.float-toc-nav {
  display: grid;
  gap: 0.2rem;
}

.float-toc-nav a {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  color: var(--float-text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.float-toc-nav a:hover {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

@media (max-width: 980px) {
  .pros {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .book {
    animation: none;
  }

  .read-progress-bar {
    transition: none;
  }
}