/* Series Story 2.0 — original editorial skin. Not a Blogbio/Dramaverse port. */
:root {
  --ss-bg: #f3eee4;
  --ss-paper: #fffdf8;
  --ss-ink: #1c1814;
  --ss-muted: #6d645b;
  --ss-line: #ddd2c2;
  --ss-accent: #b5441f;
  --ss-forest: #2a463c;
  /* Match dramaverse PC width: wide shell + ~780px prose so 728px ads fit. */
  --ss-max: 1260px;
  --ss-reader-max: 1080px;
  --ss-prose-max: 780px;
  --ss-serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ss-sans: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

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

html {
  font-size: 17px;
  width: 100%;
  max-width: 100%;
  /* Avoid overflow-x:hidden — on real iOS it clips position:fixed close buttons. */
  overflow-x: visible;
}

body.ss-body {
  margin: 0;
  background: var(--ss-bg);
  color: var(--ss-ink);
  font-family: var(--ss-sans);
  line-height: 1.55;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: visible;
  /* Real-device insets (notch / home indicator) — DevTools often reports 0. */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* max-width only — do not force display:block globally (breaks ad carousels). */
img { max-width: 100%; height: auto; }
.ss-brand img,
.ss-hero__cover img,
.ss-reader__hero img,
.ss-article__hero img,
.ss-article-card__img,
.ss-cover-card img,
.ss-row img,
.ss-book img,
.ss-result img,
.ss-reader__body p img,
.ss-article__body p img {
  display: block;
}
a { color: var(--ss-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--ss-serif); font-weight: 600; letter-spacing: -0.02em; }
button, input, textarea, select { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ss-skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.ss-skip:focus {
  left: 12px;
  z-index: 20;
  background: #fff;
  padding: 8px 12px;
}

.ss-shell { max-width: var(--ss-max); margin: 0 auto; padding: 0 20px; }

/* Header */
.ss-top {
  background: var(--ss-ink);
  color: #f6f0e6;
}
.ss-top a { color: inherit; text-decoration: none; }
.ss-top__bar {
  max-width: var(--ss-max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.ss-brand {
  font-family: var(--ss-serif);
  font-size: 1.45rem;
  font-weight: 600;
  white-space: nowrap;
}
.ss-brand img { height: 36px; width: auto; }
.ss-nav { flex: 1; }
.ss-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ss-nav__link { font-size: 0.95rem; color: #ece4d6; padding: 4px 0; }
.ss-nav__link.is-active { color: #fff; border-bottom: 2px solid var(--ss-accent); }

/* Genre strip under the top bar */
.ss-genrebar {
  background: #2a2420;
  border-top: 1px solid #3a332d;
}
.ss-genrebar__inner {
  max-width: var(--ss-max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ss-genrebar__inner::-webkit-scrollbar { display: none; }
.ss-genrebar__label {
  flex: 0 0 auto;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8f8474;
  margin-right: 10px;
}
.ss-genrebar__link {
  flex: 0 0 auto;
  font-size: 0.86rem;
  color: #d9cfbf;
  padding: 9px 10px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.ss-genrebar__link:hover { color: #fff; text-decoration: none; }
.ss-genrebar__link.is-active { color: #fff; border-bottom-color: var(--ss-accent); }
.ss-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 280px);
  background: #2a2420;
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
}
.ss-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.ss-search input[type="search"]::-webkit-search-decoration,
.ss-search input[type="search"]::-webkit-search-cancel-button,
.ss-search input[type="search"]::-webkit-search-results-button,
.ss-search input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.ss-search__btn {
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 0;
  background: var(--ss-accent);
  color: #fff;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
}
.ss-search__btn svg {
  display: block;
  width: 16px;
  height: 16px;
}
.ss-search--page {
  width: min(100%, 420px);
  max-width: 420px;
  margin: 0 0 28px;
  background: #fff;
  border: 1px solid var(--ss-line);
}
.ss-search--page input { color: var(--ss-ink); }
.ss-menu-btn {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid #5a524a;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
}

@media (max-width: 820px) {
  .ss-top__bar { flex-wrap: wrap; }
  .ss-menu-btn { display: inline-flex; }
  .ss-nav, .ss-search { display: none; width: 100%; }
  .ss-top.is-open .ss-nav,
  .ss-top.is-open .ss-search { display: flex; }
  .ss-search { width: 100%; margin-top: 4px; }
  .ss-search input { width: auto; }
}

/* Home */
.ss-hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  background: var(--ss-paper);
  border: 1px solid var(--ss-line);
  padding: 28px;
  margin: 28px 0 36px;
}
.ss-hero__cover img {
  width: 200px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #e6ddd0;
}
.ss-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--ss-accent);
  margin: 0 0 8px;
}
.ss-hero h1 { font-size: 2.1rem; margin: 0 0 10px; line-height: 1.15; }
.ss-hero h1 a { color: inherit; }
.ss-hero__meta { color: var(--ss-muted); font-size: 0.9rem; margin: 0 0 12px; }
.ss-hero__excerpt { margin: 0 0 18px; max-width: 52ch; color: #3a342e; }
.ss-btn {
  display: inline-block;
  background: var(--ss-ink);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 3px;
  text-decoration: none !important;
}
.ss-btn:hover { background: var(--ss-accent); }
.ss-btn--ghost {
  background: transparent;
  color: var(--ss-ink) !important;
  border: 1px solid var(--ss-ink);
  margin-left: 8px;
}

.ss-section { margin: 0 0 40px; }
.ss-section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--ss-ink);
  margin-bottom: 16px;
  padding-bottom: 6px;
}
.ss-section__head h2 { margin: 0; font-size: 1.25rem; }
.ss-section__more {
  font-size: 0.9rem;
  color: var(--ss-forest);
  text-decoration: none;
}
.ss-section__more:hover { color: var(--ss-accent); }
.ss-section__lead {
  margin: -8px 0 16px;
  color: var(--ss-muted);
  font-size: 0.95rem;
}
/* Standalone articles: blog cards with landscape image */
.ss-section--articles {
  border-top: 1px solid var(--ss-line);
  padding-top: 28px;
}
.ss-article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
}
.ss-article-card {
  display: flex;
  flex-direction: column;
  background: var(--ss-paper);
  border: 1px solid var(--ss-line);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ss-article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(28, 24, 20, 0.12);
}
.ss-article-card__media { display: block; background: #e6ddd0; }
.ss-article-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.ss-article-card__img--empty {
  background: linear-gradient(135deg, hsl(var(--ss-h, 20) 35% 78%), hsl(calc(var(--ss-h, 20) + 40) 30% 55%));
}
.ss-article-card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ss-article-card__cat {
  align-self: flex-start;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ss-accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 9px;
  text-decoration: none;
}
.ss-article-card__cat:hover { background: var(--ss-accent); color: #fff; text-decoration: none; }
.ss-article-card__title { margin: 4px 0 0; font-size: 1.12rem; line-height: 1.3; }
.ss-article-card__title a { color: inherit; }
.ss-article-card__excerpt {
  margin: 0;
  color: var(--ss-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ss-article-card__meta { margin: auto 0 0; padding-top: 8px; color: var(--ss-muted); font-size: 0.8rem; }
@media (max-width: 900px) {
  .ss-article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ss-article-grid { grid-template-columns: 1fr; }
}

.ss-page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 8px 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--ss-ink); }
.ss-page-head h1 { margin: 0; font-size: 2rem; }
.ss-page-head__count { margin: 0; color: var(--ss-muted); font-size: 0.9rem; }

/* Single article */
.ss-article {
  max-width: var(--ss-reader-max);
  width: 100%;
  margin: 0 auto 48px;
  overflow-x: visible;
  padding: 0 64px;
}
.ss-article__head { margin-bottom: 22px; max-width: var(--ss-prose-max); margin-left: auto; margin-right: auto; }
.ss-article__head h1 { font-size: 2.2rem; line-height: 1.15; margin: 12px 0 10px; }
.ss-article__meta { margin: 0; color: var(--ss-muted); font-size: 0.9rem; }
.ss-article__hero { margin: 0 auto 28px; max-width: var(--ss-prose-max); }
.ss-article__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.ss-article__body {
  font-size: 1.1rem;
  min-width: 0;
  max-width: var(--ss-prose-max);
  margin-left: auto;
  margin-right: auto;
  overflow-x: visible;
  overflow-y: visible;
}
.ss-article__body img { border-radius: 4px; }
.ss-article__body h2, .ss-article__body h3 { font-family: var(--ss-serif); margin: 1.6em 0 0.6em; }
@media (max-width: 600px) {
  .ss-article__head h1 { font-size: 1.7rem; }
}

.ss-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
}
.ss-cover-card a { color: inherit; text-decoration: none; }
.ss-cover-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #e6ddd0;
  margin-bottom: 8px;
}
.ss-cover-card h3 { font-size: 1rem; margin: 0 0 4px; line-height: 1.25; }
.ss-cover-card span { color: var(--ss-muted); font-size: 0.8rem; }

.ss-split {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 36px;
}
.ss-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ss-line);
}
.ss-row img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  background: #e6ddd0;
}
.ss-row h3 { margin: 0 0 4px; font-size: 1.05rem; }
.ss-row h3 a { color: inherit; }
.ss-row p { margin: 0; color: var(--ss-muted); font-size: 0.88rem; }

.ss-rank { counter-reset: ss; list-style: none; margin: 0; padding: 0; }
.ss-rank li {
  counter-increment: ss;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ss-line);
}
.ss-rank li::before {
  content: counter(ss);
  font-family: var(--ss-serif);
  font-size: 1.3rem;
  color: var(--ss-accent);
}
.ss-rank a { color: inherit; }
.ss-rank small { display: block; color: var(--ss-muted); }

.ss-more {
  display: inline-block;
  margin-top: 16px;
  background: transparent;
  border: 1px solid var(--ss-ink);
  padding: 8px 16px;
  cursor: pointer;
}

.ss-genres { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-chip {
  border: 1px solid var(--ss-line);
  background: var(--ss-paper);
  color: inherit;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none !important;
}
.ss-chip:hover { border-color: var(--ss-accent); color: var(--ss-accent); }

@media (max-width: 800px) {
  .ss-hero, .ss-split { grid-template-columns: 1fr; }
  .ss-hero__cover img { width: 140px; }
}

/* Category / search lists */
.ss-page-title { margin: 28px 0 8px; font-size: 2rem; }
.ss-lede { color: var(--ss-muted); margin: 0 0 24px; }
.ss-list { display: flex; flex-direction: column; }
.ss-empty { color: var(--ss-muted); padding: 24px 0; }

.ss-result {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ss-line);
}
.ss-result img {
  width: 88px;
  height: 118px;
  object-fit: cover;
}
.ss-result h3 { margin: 0 0 6px; }
.ss-result h3 a { color: inherit; }

.ss-pager {
  display: flex;
  gap: 16px;
  margin: 24px 0;
  align-items: center;
}

/* Series hub */
.ss-book {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  margin: 28px 0 36px;
}
.ss-book img {
  width: 220px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: 8px 10px 0 #1c1814;
}
.ss-book h1 { font-size: 2.2rem; margin: 0 0 10px; }
.ss-meta { color: var(--ss-muted); font-size: 0.92rem; margin: 0 0 14px; }
.ss-meta a { color: var(--ss-forest); }
.ss-desc { max-width: 60ch; }
.ss-desc p { margin: 0 0 12px; }
.ss-actions { margin-top: 18px; }

.ss-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  margin-bottom: 48px;
}
.ss-chapters { list-style: none; margin: 0; padding: 0; }
.ss-chapters li { border-top: 1px solid var(--ss-line); }
.ss-chapters a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  color: inherit;
}
.ss-chapters a:hover { color: var(--ss-accent); }
.ss-side h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--ss-ink);
  padding-bottom: 6px;
}
.ss-side ul { list-style: none; margin: 0 0 28px; padding: 0; }
.ss-side li { padding: 8px 0; border-bottom: 1px dashed var(--ss-line); }
.ss-side a { color: inherit; }

@media (max-width: 860px) {
  .ss-book, .ss-layout { grid-template-columns: 1fr; }
  .ss-book img { width: 160px; box-shadow: 6px 8px 0 #1c1814; }
}

/* Reader — PC width aligned with dramaverse (wide card + 64px side pad + 780px prose). */
.ss-crumb { font-size: 0.85rem; color: var(--ss-muted); margin: 20px 0; }
.ss-crumb a { color: var(--ss-forest); }
.ss-reader {
  max-width: var(--ss-reader-max);
  width: 100%;
  margin: 0 auto 48px;
  background: var(--ss-paper);
  border: 1px solid var(--ss-line);
  padding: 40px 64px 56px;
  /* Never clip in-content ads; wide units scroll inside the column instead. */
  overflow-x: visible;
}
.ss-reader__series {
  margin: 0 auto;
  max-width: var(--ss-prose-max);
  color: var(--ss-accent);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ss-reader__series a { color: inherit; }
/* --ss-reader-font / --ss-reader-size are set per series by the Story Series
   plugin (Đăng Series → "Áp dụng cho người đọc"); unset = theme defaults. */
.ss-reader h1 {
  font-family: var(--ss-reader-font, var(--ss-serif));
  font-size: calc(var(--ss-reader-size, 1.1875rem) * 1.6);
  margin: 6px auto 20px;
  max-width: var(--ss-prose-max);
}
.ss-reader__hero { margin: 0 auto 24px; max-width: var(--ss-prose-max); }
.ss-reader__hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #e6ddd0;
}
.ss-reader__body {
  font-family: var(--ss-reader-font, var(--ss-serif));
  font-size: var(--ss-reader-size, 1.15rem);
  line-height: 1.75;
  min-width: 0;
  max-width: var(--ss-prose-max);
  margin-left: auto;
  margin-right: auto;
  /* Keep overflow visible so sticky video (Ureka) is not trapped in a
     scroll/stacking context and covered by later in-article iframes. */
  overflow-x: visible;
  overflow-y: visible;
}
.ss-reader__body p { margin: 0 0 1.1em; }

/*
 * Ad containment — never clip creatives.
 * Wide units shrink when possible; otherwise scroll inside .ss-ad-fit (JS wraps late ads).
 */
.ss-reader,
.ss-article,
.ss-shell,
#content {
  overflow-x: visible;
}
.ss-ad-fit {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.1em;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  box-sizing: border-box;
}
.ss-ad-fit > * {
  vertical-align: top;
}

/* Replaced media + common ad network hooks */
.ss-reader__body iframe,
.ss-reader__body embed,
.ss-reader__body object,
.ss-reader__body video,
.ss-reader__body img,
.ss-article__body iframe,
.ss-article__body embed,
.ss-article__body object,
.ss-article__body video,
.ss-article__body img {
  max-width: 100% !important;
}
.ss-reader__body img,
.ss-article__body img,
.ss-reader__body video,
.ss-article__body video {
  height: auto;
}
.ss-reader__body > div,
.ss-article__body > div,
.ss-reader__body > ins,
.ss-article__body > ins,
.ss-reader__body > section,
.ss-article__body > section,
.ss-reader__body > aside,
.ss-article__body > aside {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  box-sizing: border-box;
}
.ss-reader__body .adsbygoogle,
.ss-article__body .adsbygoogle,
.ss-reader__body ins.adsbygoogle,
.ss-article__body ins.adsbygoogle,
.ss-reader__body [id^="div-gpt-ad"],
.ss-article__body [id^="div-gpt-ad"],
.ss-reader__body [id*="google_ads"],
.ss-article__body [id*="google_ads"],
.ss-reader__body [class*="adsbygoogle"],
.ss-article__body [class*="adsbygoogle"],
.ss-reader__body [class*="pubadx"],
.ss-article__body [class*="pubadx"],
.ss-reader__body [class*="adx-"],
.ss-article__body [class*="adx-"],
.ss-reader__body [class*="ad-slot"],
.ss-article__body [class*="ad-slot"],
.ss-reader__body [class*="ad_slot"],
.ss-article__body [class*="ad_slot"],
.ss-reader__body [data-ad],
.ss-article__body [data-ad],
.ss-reader__body [data-ad-client],
.ss-article__body [data-ad-client],
.ss-reader__body [data-ad-slot],
.ss-article__body [data-ad-slot] {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/*
 * Sticky video (Ureka / UK player) — on real phones right:0 puts the X
 * flush with the screen edge; DevTools often looks fine. Pull inward + safe-area.
 * Also keep above in-article ads once reparented to body (see theme.js).
 */
[id^="uk-content-player-wrapper-"],
[id^="uk-content-player-"][style*="fixed"],
.ureka-player-wrapper,
[id^="ureka-div-player"] {
  right: max(28px, env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
  max-width: calc(100vw - 56px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
  box-sizing: border-box !important;
}
body > [id^="uk-content-player-wrapper-"] {
  z-index: 2147483000 !important;
}
.ucp-close-btn,
[class*="ucp-close"],
[id^="uk-content-player-wrapper-"] button[class*="close"] {
  right: 6px !important;
  left: auto !important;
  z-index: 5 !important;
}

@media (max-width: 900px) {
  .ss-reader { padding: 28px 28px 48px; }
  .ss-article { padding: 0 28px; }
}
@media (max-width: 640px) {
  .ss-shell { padding-left: 12px; padding-right: 12px; }
  .ss-reader {
    padding: 20px 14px 40px;
  }
  .ss-article { padding-left: 0; padding-right: 0; }
  .ss-reader__body,
  .ss-article__body,
  .ss-reader__series,
  .ss-reader h1,
  .ss-reader__hero,
  .ss-article__head,
  .ss-article__hero {
    max-width: 100%;
  }
}
.ss-readnav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 16px auto 24px;
  max-width: var(--ss-prose-max);
  align-items: center;
}
.ss-readnav a, .ss-readnav span, .ss-readnav button {
  border: 1px solid var(--ss-line);
  background: #fff;
  color: var(--ss-ink);
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
}
.ss-readnav .is-off { opacity: 0.4; pointer-events: none; }
.ss-readnav__spacer { flex: 1; }

/* Sticky chapter pill */
.ss-chap-pill {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--ss-ink);
  color: #f6f0e6;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(28, 24, 20, 0.28);
}
.ss-chap-pill:hover { background: var(--ss-accent); }
.ss-chap-pill__count {
  font-family: var(--ss-serif);
  font-weight: 700;
  font-size: 1.05rem;
}
.ss-similar {
  max-width: var(--ss-max);
  margin: 0 auto 48px;
  padding: 0 20px 72px;
}

.ss-toc {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(28, 24, 20, 0.5);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ss-toc.is-open { display: flex; }
.ss-toc__box {
  background: var(--ss-paper);
  width: min(520px, 100%);
  max-height: 80vh;
  overflow: auto;
  padding: 20px 24px;
}
.ss-toc__box h2 { margin: 0 0 12px; }
.ss-toc__box ul { list-style: none; margin: 0; padding: 0; }
.ss-toc__box li a {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ss-line);
  color: inherit;
}
.ss-toc__box li.is-current a { color: var(--ss-accent); font-weight: 700; }
.ss-toc__close { float: right; border: 0; background: none; font-size: 1.4rem; cursor: pointer; }

/* Legal / contact */
.ss-prose {
  max-width: 720px;
  margin: 28px auto 56px;
  background: var(--ss-paper);
  border: 1px solid var(--ss-line);
  padding: 32px;
}
.ss-prose h1 { margin-top: 0; }
.ss-prose h2 { margin: 1.6em 0 0.5em; font-size: 1.2rem; }
.ss-form label { display: block; margin: 12px 0 4px; font-weight: 700; }
.ss-form input, .ss-form textarea {
  width: 100%;
  border: 1px solid var(--ss-line);
  padding: 10px 12px;
  background: #fff;
}
.ss-form textarea { min-height: 140px; }
.ss-form button {
  margin-top: 16px;
  background: var(--ss-ink);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  cursor: pointer;
}
.ss-notice { padding: 10px 12px; background: #e8f0ea; }
.ss-notice--err { background: #f7e4dc; }

/* Footer */
.ss-foot {
  border-top: 1px solid var(--ss-ink);
  margin-top: 24px;
  padding: 28px 20px 40px;
  text-align: center;
  color: var(--ss-muted);
}
.ss-foot nav { margin-bottom: 8px; }
.ss-foot a { color: var(--ss-ink); margin: 0 10px; }

.ss-pagination { margin: 24px 0; }
.ss-pagination .nav-links,
.ss-pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.ss-pagination li { margin: 0; }
.ss-pagination a.page-numbers,
.ss-pagination span.page-numbers {
  display: inline-block;
  min-width: 2rem;
  text-align: center;
  padding: 6px 10px;
  border: 1px solid var(--ss-line);
  background: #fff;
  color: var(--ss-ink);
  text-decoration: none;
  border-radius: 3px;
}
.ss-pagination .page-numbers.current {
  background: var(--ss-ink);
  color: #f6f0e6;
  border-color: var(--ss-ink);
}
.ss-pagination .page-numbers.dots { border: 0; background: transparent; }

.admin-bar .ss-top { top: 32px; }
