/* KSC R5 READABLE LAYOUT - fixes R4 oversize typography while keeping premium black/yellow */
html body.ksc-r5-readable {
  background-color: #050505 !important;
  color: #fff9e8 !important;
  overflow-x: hidden !important;
}

html body.ksc-r5-readable main,
html body.ksc-r5-readable .container,
html body.ksc-r5-readable .page-wrap,
html body.ksc-r5-readable .page-shell,
html body.ksc-r5-readable .content-wrap {
  width: min(100% - 64px, 1140px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Stop title explosion */
html body.ksc-r5-readable h1 {
  font-size: clamp(44px, 5.2vw, 72px) !important;
  line-height: 1.04 !important;
  letter-spacing: -0.035em !important;
  max-width: 780px !important;
}

html body.ksc-r5-readable h2 {
  font-size: clamp(34px, 4.2vw, 56px) !important;
  line-height: 1.04 !important;
  letter-spacing: -0.032em !important;
}

html body.ksc-r5-readable h3 {
  font-size: clamp(22px, 2.4vw, 32px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.02em !important;
}

/* More Mustafa-like but readable */
html body.ksc-r5-readable h1,
html body.ksc-r5-readable h2,
html body.ksc-r5-readable h3,
html body.ksc-r5-readable h4,
html body.ksc-r5-readable h5,
html body.ksc-r5-readable h6 {
  color: #fff9e8 !important;
  font-family: Inter, Arial, Helvetica, sans-serif !important;
  font-weight: 900 !important;
}

html body.ksc-r5-readable p,
html body.ksc-r5-readable li,
html body.ksc-r5-readable span,
html body.ksc-r5-readable small,
html body.ksc-r5-readable label {
  color: #d0c5aa !important;
}

html body.ksc-r5-readable a,
html body.ksc-r5-readable nav a,
html body.ksc-r5-readable header a {
  color: #ffd300 !important;
}

/* Hero and panels: darker, less olive */
html body.ksc-r5-readable .hero,
html body.ksc-r5-readable .intro,
html body.ksc-r5-readable .book-hero,
html body.ksc-r5-readable .auth-hero,
html body.ksc-r5-readable article,
html body.ksc-r5-readable .card,
html body.ksc-r5-readable .panel,
html body.ksc-r5-readable .box,
html body.ksc-r5-readable .surface,
html body.ksc-r5-readable [data-ksc-book-card],
html body.ksc-r5-readable .ksc-book-card,
html body.ksc-r5-readable .ksc-durak-card,
html body.ksc-r5-readable .ksc-public-auth-card,
html body.ksc-r5-readable .ksc-public-auth-shell {
  background-color: #10100b !important;
  border-color: rgba(255,211,0,.28) !important;
  color: #fff9e8 !important;
}

/* Homepage first grid/card balance */
html body.ksc-r5-readable .hero,
html body.ksc-r5-readable .intro,
html body.ksc-r5-readable .book-hero,
html body.ksc-r5-readable .auth-hero {
  padding: clamp(30px, 4vw, 48px) !important;
}

html body.ksc-r5-readable .ksc-public-auth-card,
html body.ksc-r5-readable .ksc-public-auth-shell {
  max-width: 380px !important;
}

/* Keep right auth title readable */
html body.ksc-r5-readable .ksc-public-auth-card h1,
html body.ksc-r5-readable .ksc-public-auth-card h2,
html body.ksc-r5-readable .ksc-public-auth-card h3,
html body.ksc-r5-readable .ksc-public-auth-shell h1,
html body.ksc-r5-readable .ksc-public-auth-shell h2,
html body.ksc-r5-readable .ksc-public-auth-shell h3 {
  font-size: clamp(28px, 3.2vw, 44px) !important;
  line-height: 1.08 !important;
  max-width: 100% !important;
}

/* Buttons: visible but not oversized */
html body.ksc-r5-readable button,
html body.ksc-r5-readable .btn,
html body.ksc-r5-readable a.btn,
html body.ksc-r5-readable .button,
html body.ksc-r5-readable .ksc-public-auth-button {
  min-height: 46px !important;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,211,0,.46) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase !important;
}

html body.ksc-r5-readable .btn-primary,
html body.ksc-r5-readable .primary,
html body.ksc-r5-readable .button-primary,
html body.ksc-r5-readable .ksc-public-auth-button.primary,
html body.ksc-r5-readable a.btn-primary,
html body.ksc-r5-readable button.primary {
  background: #ffd300 !important;
  color: #060606 !important;
  border-color: #ffd300 !important;
}

/* Card content sizes */
html body.ksc-r5-readable [data-ksc-book-card] h1,
html body.ksc-r5-readable [data-ksc-book-card] h2,
html body.ksc-r5-readable [data-ksc-book-card] h3,
html body.ksc-r5-readable .ksc-book-card h1,
html body.ksc-r5-readable .ksc-book-card h2,
html body.ksc-r5-readable .ksc-book-card h3,
html body.ksc-r5-readable .card h1,
html body.ksc-r5-readable .card h2,
html body.ksc-r5-readable .card h3 {
  font-size: clamp(22px, 2.4vw, 32px) !important;
  line-height: 1.12 !important;
  max-width: 100% !important;
}

/* Book gate should not become too massive */
html body.ksc-r5-readable .book-hero h1,
html body.ksc-r5-readable .book-hero h2,
html body.ksc-r5-readable .intro h1,
html body.ksc-r5-readable .intro h2 {
  font-size: clamp(42px, 5vw, 68px) !important;
  max-width: 900px !important;
}

/* Header close to Mustafa style */
html body.ksc-r5-readable header,
html body.ksc-r5-readable nav {
  background: #000 !important;
  border-bottom: 1px solid rgba(255,211,0,.20) !important;
}

html body.ksc-r5-readable nav a,
html body.ksc-r5-readable header a {
  color: rgba(255,249,232,.86) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .10em !important;
  text-transform: uppercase !important;
}

/* Mobile */
@media (max-width: 768px) {
  html body.ksc-r5-readable main,
  html body.ksc-r5-readable .container,
  html body.ksc-r5-readable .page-wrap,
  html body.ksc-r5-readable .page-shell,
  html body.ksc-r5-readable .content-wrap {
    width: min(100% - 24px, 1140px) !important;
  }

  html body.ksc-r5-readable h1 {
    font-size: clamp(36px, 10vw, 52px) !important;
    line-height: 1.06 !important;
  }

  html body.ksc-r5-readable h2 {
    font-size: clamp(30px, 8vw, 42px) !important;
  }

  html body.ksc-r5-readable .hero,
  html body.ksc-r5-readable .intro,
  html body.ksc-r5-readable .book-hero,
  html body.ksc-r5-readable .auth-hero {
    padding: 24px !important;
  }
}