/* ============================================================
   RUANGCERITA.COM — Design System
   UI:   Plus Jakarta Sans 500 600 700 800
   Body: Lora 400 400i 600
   ============================================================ */

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

:root {
  --terra:       #B84C30;
  --terra-light: #F5EDE9;
  --terra-dark:  #8C3520;
  --ink:         #1A1714;
  --ink-2:       #4A453F;
  --ink-3:       #8A847C;
  --ink-4:       #B8B2AA;
  --paper:       #FAFAF8;
  --paper-2:     #F2EFE9;
  --paper-3:     #E8E3DB;
  --white:       #FFFFFF;
  --r-sm:        6px;
  --r-md:        10px;
  --r-lg:        16px;
  --r-xl:        24px;
  --nav-h:       60px;
  --content-w:   680px;
  --wide-w:      1100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--terra); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.rc-container {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   NAV
   ============================================================ */
.rc-nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 0;
  padding: 0 24px;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--paper-3);
}

.rc-logo {
  font-size: 17px; font-weight: 800;
  color: var(--ink); letter-spacing: -0.3px;
  white-space: nowrap; flex-shrink: 0;
  margin-right: 28px;
}
.rc-logo:hover { text-decoration: none; }
.rc-logo span { color: var(--terra); }

.nav-themes {
  display: flex; gap: 0;
  flex: 1; overflow: hidden;
}
.nav-theme-link {
  padding: 0 14px; font-size: 13px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap; height: var(--nav-h);
  display: flex; align-items: center;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-theme-link:hover { color: var(--terra); border-color: var(--terra); text-decoration: none; }

.nav-actions {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto; flex-shrink: 0; padding-left: 16px;
}

.btn-tulis {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; font-size: 13px; font-weight: 700;
  color: var(--ink-2); background: transparent;
  border: 1.5px solid var(--paper-3); border-radius: 20px;
  transition: border-color .15s, color .15s;
}
.btn-tulis:hover { color: var(--terra); border-color: var(--terra); text-decoration: none; }
.btn-tulis .ti { font-size: 14px; }

.nav-link-plain {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.nav-link-plain:hover { color: var(--terra); text-decoration: none; }

.btn-daftar {
  padding: 8px 18px; font-size: 13px; font-weight: 700;
  color: var(--white); background: var(--terra);
  border-radius: 20px; white-space: nowrap;
  transition: background .15s;
}
.btn-daftar:hover { background: var(--terra-dark); text-decoration: none; color: var(--white); }
.btn-daftar--large { padding: 12px 28px; font-size: 15px; border-radius: var(--r-md); }

.nav-avatar-wrap { position: relative; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--paper-3); background: var(--paper-2);
  cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--terra);
  transition: border-color .15s;
}
.nav-avatar:hover { border-color: var(--terra); }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

.nav-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 210px; background: var(--white);
  border: 1px solid var(--paper-3); border-radius: var(--r-md);
  box-shadow: 0 6px 24px rgba(0,0,0,.08); overflow: hidden;
}
.nav-dropdown.open { display: block; }
.dropdown-top { padding: 12px 16px; border-bottom: 1px solid var(--paper-3); }
.dropdown-top strong { display: block; font-size: 14px; font-weight: 700; }
.dropdown-top small { font-size: 12px; color: var(--ink-3); }
.nav-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--ink);
  transition: background .1s;
}
.nav-dropdown a:hover { background: var(--paper); text-decoration: none; }
.nav-dropdown .ti { font-size: 16px; color: var(--ink-3); }
.dropdown-sep { height: 1px; background: var(--paper-3); }
.dropdown-danger { color: #C0392B !important; }

/* ============================================================
   HOME HERO
   ============================================================ */
.home-hero {
  background: var(--white);
  border-bottom: 1px solid var(--paper-3);
  padding: 48px 24px;
}
.hero-inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-cover {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--paper-2);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 120px; font-weight: 800; opacity: 0.18;
}

.hero-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hero-theme { font-size: 13px; font-weight: 700; }
.hero-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.hero-sep { width: 1px; height: 12px; background: var(--paper-3); }

.hero-title {
  font-size: 32px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.5px; margin-bottom: 14px;
}
.hero-title a { color: var(--ink); }
.hero-title a:hover { color: var(--terra); text-decoration: none; }

.hero-synopsis {
  font-family: 'Lora', Georgia, serif;
  font-size: 16px; color: var(--ink-2); line-height: 1.7;
  margin-bottom: 20px;
}
.hero-meta {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 24px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
}
.hero-author {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-2); font-weight: 700;
}
.hero-author img, .author-initial {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
.author-initial {
  background: var(--terra-light);
  color: var(--terra);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.hero-author:hover { color: var(--terra); text-decoration: none; }
.hero-read-time { color: var(--ink-3); }
.hero-format-pill {
  background: var(--paper-2);
  color: var(--ink-2);
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.btn-baca {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 700;
  color: var(--white); background: var(--terra);
  border-radius: 20px; transition: background .15s;
}
.btn-baca:hover { background: var(--terra-dark); text-decoration: none; color: var(--white); }
.btn-baca .ti { font-size: 16px; }

/* ============================================================
   THEMES BAR
   ============================================================ */
.home-themes {
  padding: 20px 0;
  border-bottom: 1px solid var(--paper-3);
  background: var(--white);
}
.themes-label {
  font-size: 11px; font-weight: 700; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 12px;
}
.themes-row { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-pill {
  padding: 6px 16px;
  font-size: 13px; font-weight: 700;
  color: var(--tc, var(--terra));
  background: color-mix(in srgb, var(--tc, var(--terra)) 10%, transparent);
  border-radius: 20px;
  border: 1.5px solid color-mix(in srgb, var(--tc, var(--terra)) 25%, transparent);
  transition: all .15s;
}
.theme-pill:hover { text-decoration: none; opacity: .85; transform: translateY(-1px); }

/* ============================================================
   STORY GRID & CARDS
   ============================================================ */
.home-latest, .home-spotlight { padding: 40px 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px;
}
.section-head h2 { font-size: 18px; font-weight: 800; }
.section-more { font-size: 13px; font-weight: 700; color: var(--terra); }
.section-more:hover { text-decoration: underline; }

.story-grid { display: grid; gap: 24px; }
.story-grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.story-grid--2 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

/* Story Card */
.story-card { display: flex; flex-direction: column; }

.story-card__cover-link { display: block; }
.story-card__cover {
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
  background: var(--paper-2);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
}
.story-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.story-card__cover-initial {
  font-size: 56px; font-weight: 800; opacity: 0.2;
}
.story-card__format-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(26,23,20,.72); color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  display: flex; align-items: center; gap: 4px;
}
.story-card__format-badge .ti { font-size: 11px; }
.story-card__access-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
}
.story-card__access-badge--premium    { background: #FFF8E1; color: #8B6914; }
.story-card__access-badge--subscriber { background: var(--terra-light); color: var(--terra-dark); }

.story-card--large .story-card__cover { aspect-ratio: 3/2; }
.story-card--compact .story-card__cover { aspect-ratio: 3/2; }

.story-card__theme {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 6px;
}
.story-card__theme:hover { text-decoration: none; opacity: .8; }

.story-card__title {
  font-size: 16px; font-weight: 800; line-height: 1.35;
  margin-bottom: 8px;
}
.story-card__title a { color: var(--ink); }
.story-card__title a:hover { color: var(--terra); text-decoration: none; }

.story-card--compact .story-card__title { font-size: 14px; }

.story-card__synopsis {
  font-family: 'Lora', serif;
  font-size: 13px; color: var(--ink-2); line-height: 1.65;
  margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.story-card__meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  margin-top: auto; padding-top: 8px;
}
.story-card__author {
  display: flex; align-items: center; gap: 6px; color: var(--ink-2);
}
.story-card__author:hover { color: var(--terra); text-decoration: none; }
.story-card__avatar, .story-card__avatar--initial {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
}
.story-card__avatar--initial {
  background: var(--terra-light); color: var(--terra);
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.story-card__dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--ink-4); flex-shrink: 0;
}
.story-card__like { display: flex; align-items: center; gap: 3px; }
.story-card__like .ti { font-size: 12px; }

/* ============================================================
   SPOTLIGHT (Penulis)
   ============================================================ */
.spotlight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.writer-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border: 1px solid var(--paper-3); border-radius: var(--r-md);
  background: var(--white); transition: border-color .15s;
}
.writer-card:hover { border-color: var(--terra); text-decoration: none; }
.writer-card__avatar, .writer-card__initial {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.writer-card__initial {
  background: var(--terra-light); color: var(--terra);
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.writer-card__body { flex: 1; min-width: 0; }
.writer-card__body strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.writer-card__body p { font-size: 12px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.writer-card__stats { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-top: 4px; display: block; }
.writer-card__follow {
  flex-shrink: 0; padding: 6px 14px;
  font-size: 12px; font-weight: 700; color: var(--terra);
  border: 1.5px solid var(--terra); border-radius: 20px;
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.home-cta { padding: 60px 24px; }
.cta-card {
  max-width: 660px; margin: 0 auto; text-align: center;
  padding: 48px 40px; background: var(--white);
  border: 1px solid var(--paper-3); border-radius: var(--r-xl);
}
.cta-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; line-height: 1.3; }
.cta-card p { font-size: 15px; color: var(--ink-2); line-height: 1.65; margin-bottom: 24px; }

/* ============================================================
   READING PAGE
   ============================================================ */
.body--reading .rc-nav { border-bottom-color: transparent; }

.reading-progress-bar {
  position: fixed; top: 0; left: 0; z-index: 300;
  height: 3px; width: 0%; background: var(--terra);
  transition: width .1s linear;
}

.story-article { padding-bottom: 80px; }

.story-hero-img {
  width: 100%; max-height: 480px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-2);
}
.story-hero-img img { width: 100%; height: 480px; object-fit: cover; }

.story-content-wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 48px 24px 0;
}

.story-theme-link {
  display: inline-block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px;
}
.story-format-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--ink-3);
  margin-bottom: 10px; margin-left: 12px;
}

.story-title {
  font-size: 36px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.5px; color: var(--ink); margin-bottom: 16px;
}
.story-synopsis {
  font-family: 'Lora', serif;
  font-size: 18px; font-style: italic; color: var(--ink-2);
  line-height: 1.7; margin-bottom: 24px;
  border-left: 3px solid var(--terra); padding-left: 16px;
}

.story-byline {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 16px 0; margin-bottom: 32px;
  border-top: 1px solid var(--paper-3);
  border-bottom: 1px solid var(--paper-3);
}
.byline-author {
  display: flex; align-items: center; gap: 12px; color: var(--ink);
}
.byline-author:hover { color: var(--terra); text-decoration: none; }
.byline-avatar, .byline-avatar--initial {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.byline-avatar--initial {
  background: var(--terra-light); color: var(--terra);
  font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.byline-author strong { display: block; font-size: 14px; font-weight: 700; }
.byline-author small  { font-size: 12px; color: var(--ink-3); }
.byline-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); }

/* Story body text */
.story-body {
  font-family: 'Lora', Georgia, serif;
  font-size: 18px; line-height: 1.85; color: var(--ink);
  margin-bottom: 40px;
}
.story-body p { margin-bottom: 1.4em; }
.story-body h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800; margin: 2em 0 .6em; }
.story-body h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 18px; font-weight: 700; margin: 1.6em 0 .5em; }
.story-body blockquote {
  border-left: 3px solid var(--terra); padding-left: 20px;
  margin: 1.5em 0; font-style: italic; color: var(--ink-2);
}
.story-body strong { font-weight: 600; }
.story-body em { font-style: italic; }

/* Audio */
.story-audio {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: var(--paper-2);
  border-radius: var(--r-md); margin-bottom: 32px;
  border: 1px solid var(--paper-3);
}
.story-audio .ti { font-size: 24px; color: var(--terra); flex-shrink: 0; }
.story-audio strong { display: block; font-size: 14px; font-weight: 700; }
.story-audio small   { font-size: 12px; color: var(--ink-3); }
.audio-player { flex: 1; height: 36px; }

/* Paywall */
.story-paywall {
  margin: 32px 0;
  background: linear-gradient(to bottom, transparent, var(--paper) 40%);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0 40px;
}
.paywall-inner {
  text-align: center; padding: 36px 32px;
  background: var(--white); border: 1px solid var(--paper-3);
  border-radius: var(--r-xl); max-width: 440px;
}
.paywall-inner .ti { font-size: 32px; color: var(--terra); margin-bottom: 14px; display: block; }
.paywall-inner h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.paywall-inner p  { font-size: 14px; color: var(--ink-2); margin-bottom: 20px; line-height: 1.65; }
.btn-subscribe {
  display: inline-block; padding: 11px 24px;
  font-size: 14px; font-weight: 700;
  background: var(--terra); color: var(--white); border-radius: var(--r-md);
  margin-bottom: 12px; transition: background .15s;
}
.btn-subscribe:hover { background: var(--terra-dark); text-decoration: none; color: var(--white); }
.paywall-login { display: block; font-size: 13px; color: var(--ink-3); }

/* Episode list */
.episode-list { margin: 32px 0; }
.episode-list__title { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.episode-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--paper-3);
  border-radius: var(--r-md); margin-bottom: 8px;
  color: var(--ink); transition: border-color .15s, background .15s;
}
.episode-item:hover { border-color: var(--terra); background: var(--terra-light); text-decoration: none; }
.episode-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper-2); color: var(--ink-2);
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.episode-body { flex: 1; }
.episode-title { font-size: 14px; font-weight: 700; }
.episode-meta  { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.ep-access-badge { font-size: 10px; font-weight: 700; background: var(--terra-light); color: var(--terra-dark); padding: 2px 8px; border-radius: 20px; }
.episode-arrow { font-size: 16px; color: var(--ink-4); }
.btn-baca-episode {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; padding: 12px;
  background: var(--terra); color: var(--white);
  border-radius: var(--r-md); font-size: 14px; font-weight: 700;
  transition: background .15s;
}
.btn-baca-episode:hover { background: var(--terra-dark); text-decoration: none; color: var(--white); }

/* Story actions */
.story-actions {
  display: flex; gap: 12px; align-items: center;
  padding: 24px 0; border-top: 1px solid var(--paper-3);
  border-bottom: 1px solid var(--paper-3);
  margin-bottom: 32px;
}
.action-like, .action-share, .action-save {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  color: var(--ink-2); background: transparent;
  border: 1.5px solid var(--paper-3); border-radius: 20px;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.action-like:hover, .action-like.liked { color: #C0392B; border-color: #C0392B; background: #FEF2F2; }
.action-share:hover, .action-save:hover { color: var(--terra); border-color: var(--terra); }
.action-like .ti, .action-share .ti, .action-save .ti { font-size: 15px; }

/* Author card end-of-story */
.story-author-card {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 24px; background: var(--paper-2);
  border-radius: var(--r-lg); margin-bottom: 40px;
}
.author-card__img, .author-card__img--initial {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.author-card__img--initial {
  background: var(--terra-light); color: var(--terra);
  font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.author-card__body { flex: 1; }
.author-card__body a strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.author-card__body a:hover { text-decoration: none; }
.author-card__body p { font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.6; }
.author-card__stats { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 6px; display: block; }
.btn-follow-author {
  flex-shrink: 0; padding: 8px 18px;
  font-size: 13px; font-weight: 700;
  color: var(--terra); background: transparent;
  border: 1.5px solid var(--terra); border-radius: 20px;
  cursor: pointer; font-family: inherit; transition: all .15s;
  align-self: center;
}
.btn-follow-author:hover, .btn-follow-author.following {
  background: var(--terra); color: var(--white);
}

/* Related */
.story-related { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--paper-3); }
.story-related h2 { font-size: 16px; font-weight: 800; margin-bottom: 20px; }
.story-related em { font-style: italic; color: var(--terra); }

/* ============================================================
   FORMS & AUTH
   ============================================================ */
.auth-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px;
  background: var(--paper);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--ink-2); margin-bottom: 28px; }
.auth-foot  { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 16px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; height: 44px; padding: 0 14px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink); background: var(--white);
  border: 1.5px solid var(--paper-3); border-radius: var(--r-md);
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--terra); }
input.err, textarea.err { border-color: #C0392B; }
textarea { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; line-height: 1.65; }

.input-prefix { display: flex; border: 1.5px solid var(--paper-3); border-radius: var(--r-md); overflow: hidden; transition: border-color .15s; }
.input-prefix:focus-within { border-color: var(--terra); }
.input-prefix span { padding: 0 12px; font-size: 14px; font-weight: 700; color: var(--ink-3); background: var(--paper-2); border-right: 1.5px solid var(--paper-3); height: 44px; display: flex; align-items: center; flex-shrink: 0; }
.input-prefix input { border: none; border-radius: 0; height: 44px; }
.input-prefix input:focus { border: none; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--ink-3); font-size: 18px; padding: 0; }

.field-err { display: block; font-size: 12px; font-weight: 600; color: #C0392B; margin-top: 4px; }
.alert { padding: 12px 16px; border-radius: var(--r-md); font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.alert--err { background: #FDEDED; color: #C0392B; border: 1px solid #FACACА; }
.alert--ok  { background: #EDFDF4; color: #1A6B3C; border: 1px solid #C6EDD9; }

.btn-submit {
  width: 100%; padding: 13px; font-size: 15px; font-weight: 700;
  color: var(--white); background: var(--terra);
  border: none; border-radius: var(--r-md); cursor: pointer;
  font-family: inherit; margin-top: 8px; transition: background .15s;
}
.btn-submit:hover { background: var(--terra-dark); }

/* ============================================================
   FOOTER
   ============================================================ */
.rc-footer {
  background: var(--white); border-top: 1px solid var(--paper-3);
  padding: 36px 24px 28px; margin-top: 32px;
}
.footer-inner { max-width: var(--wide-w); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.footer-logo { font-size: 17px; font-weight: 800; color: var(--ink); }
.footer-logo span { color: var(--terra); }
.footer-tagline { font-size: 13px; color: var(--ink-3); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.footer-links a:hover { color: var(--terra); text-decoration: none; }
.footer-copy { font-size: 12px; color: var(--ink-4); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-head { display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:28px;flex-wrap:wrap; }
.dash-title { font-size:22px;font-weight:800;margin-bottom:4px; }
.dash-sub   { font-size:14px;color:var(--ink-2); }

.dash-stats { display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;margin-bottom:36px; }
.dstat-card {
  background:var(--white);border:1px solid var(--paper-3);border-radius:var(--r-md);
  padding:20px 16px;display:flex;flex-direction:column;align-items:flex-start;gap:6px;
}
.dstat-card .ti { font-size:22px;color:var(--ink-3); }
.dstat-card strong { font-size:26px;font-weight:800;line-height:1; }
.dstat-card span  { font-size:12px;font-weight:600;color:var(--ink-3); }
.dstat-card small { font-size:11px;color:var(--terra);font-weight:700; }
.dstat-card--accent { border-color:var(--terra-light);background:var(--terra-light); }
.dstat-card--accent .ti { color:var(--terra); }
.dash-section { margin-bottom:32px; }

.story-table { background:var(--white);border:1px solid var(--paper-3);border-radius:var(--r-md);overflow:hidden; }
.story-table-head {
  display:flex;align-items:center;padding:10px 16px;
  background:var(--paper-2);border-bottom:1px solid var(--paper-3);
  font-size:11px;font-weight:800;color:var(--ink-3);text-transform:uppercase;letter-spacing:.06em;
}
.story-table-row {
  display:flex;align-items:center;padding:13px 16px;
  border-bottom:1px solid var(--paper-2);transition:background .1s;
  gap:12px;
}
.story-table-row:last-child { border-bottom:none; }
.story-table-row:hover { background:var(--paper); }
.str-title-col { flex:1;min-width:0; }
.str-theme { font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;display:block;margin-bottom:2px; }
.str-title { font-size:14px;font-weight:700;color:var(--ink);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.str-title:hover { color:var(--terra);text-decoration:none; }
.str-ep-count { font-size:11px;color:var(--ink-3);font-weight:600; }
.str-format-badge { font-size:10px;font-weight:700;padding:3px 8px;border-radius:20px;background:var(--paper-2);color:var(--ink-3); }
.str-status { font-size:10px;font-weight:700;padding:3px 10px;border-radius:20px; }
.str-status--published { background:#EDFDF4;color:#1A6B3C; }
.str-status--draft     { background:var(--paper-2);color:var(--ink-3); }
.str-status--archived  { background:#FEF2F2;color:#C0392B; }
.str-action-btn { display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:6px;color:var(--ink-3);transition:background .1s; }
.str-action-btn:hover { background:var(--paper-2);color:var(--terra);text-decoration:none; }
.str-action-btn .ti { font-size:16px; }
.btn-edit-profile, .btn-write-new {
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 16px;font-size:13px;font-weight:700;
  border-radius:20px;transition:all .15s;
}
.btn-edit-profile { color:var(--ink-2);border:1.5px solid var(--paper-3); }
.btn-edit-profile:hover { border-color:var(--terra);color:var(--terra);text-decoration:none; }
.btn-write-new { color:var(--white);background:var(--terra);border:none; }
.btn-write-new:hover { background:var(--terra-dark);text-decoration:none;color:var(--white); }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-wrap { padding-bottom: 60px; }
.profile-cover {
  height: 200px; background: var(--paper-2);
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.profile-header {
  display: flex; align-items: flex-start; gap: 24px;
  padding-top: 0; padding-bottom: 28px;
  border-bottom: 1px solid var(--paper-3);
  margin-bottom: 28px; flex-wrap: wrap;
  position: relative;
}
.profile-avatar-wrap { margin-top: -40px; flex-shrink: 0; }
.profile-avatar, .profile-avatar--initial {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--white);
}
.profile-avatar--initial {
  background: var(--terra-light); color: var(--terra);
  font-size: 32px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.profile-info { flex: 1; padding-top: 16px; min-width: 0; }
.profile-name    { font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.profile-username{ font-size: 14px; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.profile-tagline { font-family: 'Lora', serif; font-size: 15px; color: var(--ink-2); margin-bottom: 12px; font-style: italic; }
.profile-stats   { display: flex; gap: 20px; margin-bottom: 12px; }
.pstat strong { display: block; font-size: 18px; font-weight: 800; }
.pstat span   { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.profile-bio { font-family: 'Lora', serif; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.profile-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; flex-shrink: 0; }
.btn-follow-profile, .btn-subscribe-profile {
  padding: 9px 20px; font-size: 13px; font-weight: 700;
  border-radius: 20px; cursor: pointer; font-family: inherit;
  white-space: nowrap; text-align: center;
}
.btn-follow-profile { color: var(--terra); background: transparent; border: 1.5px solid var(--terra); }
.btn-follow-profile.following { background: var(--terra); color: var(--white); border-color: var(--terra); }
.btn-follow-profile:hover { background: var(--terra); color: var(--white); }
.btn-subscribe-profile { color: var(--white); background: var(--terra); border: none; text-decoration: none; display: block; }
.btn-subscribe-profile:hover { background: var(--terra-dark); text-decoration: none; color: var(--white); }
.badge-subscribed { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #1A6B3C; }
.badge-subscribed .ti { font-size: 14px; }
.profile-content { padding-top: 4px; }

/* ============================================================
   EXPLORE PAGE
   ============================================================ */
.explore-bar { display:flex;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap; }
.explore-search {
  display:flex;align-items:center;gap:8px;flex:1;max-width:400px;
  background:var(--white);border:1.5px solid var(--paper-3);border-radius:24px;
  padding:0 16px;height:40px;transition:border-color .15s;
}
.explore-search:focus-within { border-color:var(--terra); }
.explore-search .ti { font-size:15px;color:var(--ink-3); }
.explore-search input { border:none;outline:none;background:transparent;font-family:inherit;font-size:14px;font-weight:500;color:var(--ink);flex:1; }
.explore-search input::placeholder { color:var(--ink-4); }
.explore-filters { display:flex;gap:8px; }
.filter-select { padding:0 12px;height:40px;font-family:inherit;font-size:13px;font-weight:600;color:var(--ink-2);background:var(--white);border:1.5px solid var(--paper-3);border-radius:20px;cursor:pointer;outline:none; }
.filter-select:focus { border-color:var(--terra); }
.explore-themes { display:flex;gap:6px;flex-wrap:wrap;margin-bottom:20px; }
.theme-pill.active { opacity:1; }

.pagination { display:flex;gap:6px;margin-top:32px;justify-content:center; }
.page-btn { width:36px;height:36px;display:flex;align-items:center;justify-content:center;border-radius:8px;font-size:13px;font-weight:700;color:var(--ink-2);border:1px solid var(--paper-3);background:var(--white);transition:all .15s; }
.page-btn:hover { border-color:var(--terra);color:var(--terra);text-decoration:none; }
.page-btn.active { background:var(--terra);color:var(--white);border-color:var(--terra); }

/* ============================================================
   TEMA PAGE
   ============================================================ */
.tema-hero { padding:0; }
.tema-tag { display:inline-block;padding:5px 14px;border-radius:20px;font-size:12px;font-weight:700;margin-bottom:12px; }
.tema-title { font-size:36px;font-weight:800;margin-bottom:10px;line-height:1.2; }
.tema-desc  { font-family:'Lora',serif;font-size:16px;color:var(--ink-2);margin-bottom:10px; }
.tema-count { font-size:13px;font-weight:600;color:var(--ink-3); }

/* ============================================================
   EPISODE NAVIGATION
   ============================================================ */
.episode-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin: 32px 0;
  padding: 24px 0; border-top: 1px solid var(--paper-3);
}
.epnav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; background: var(--white);
  border: 1px solid var(--paper-3); border-radius: var(--r-md);
  color: var(--ink); transition: border-color .15s;
}
.epnav-btn:hover { border-color: var(--terra); text-decoration: none; }
.epnav-btn .ti { font-size: 20px; color: var(--ink-3); flex-shrink: 0; }
.epnav-btn div small { display:block;font-size:11px;font-weight:600;color:var(--ink-3); }
.epnav-btn div strong { display:block;font-size:14px;font-weight:700;color:var(--ink); }
.epnav-btn--next { flex-direction: row-reverse; text-align: right; }
.epnav-end {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  padding: 16px; background: #EDFDF4; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; color: #1A6B3C;
}
.epnav-end .ti { font-size: 20px; }
.epnav-end a { color: #1A6B3C; font-weight: 700; margin-left: auto; }

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-wrap {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 32px; padding-top: 36px; padding-bottom: 60px;
  align-items: start;
}
.settings-sidebar { position: sticky; top: calc(var(--nav-h) + 16px); }
.settings-profile-preview {
  background: var(--white); border: 1px solid var(--paper-3);
  border-radius: var(--r-md); padding: 20px 16px;
  text-align: center; margin-bottom: 12px;
}
.spp-avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin: 0 auto 10px; background: var(--terra-light); }
.spp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.spp-initial { width: 64px; height: 64px; border-radius: 50%; background: var(--terra-light); color: var(--terra); font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.settings-profile-preview strong { display: block; font-size: 14px; font-weight: 800; }
.settings-profile-preview span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.spp-link { display: block; font-size: 12px; font-weight: 700; color: var(--terra); margin-top: 10px; }
.settings-nav { background: var(--white); border: 1px solid var(--paper-3); border-radius: var(--r-md); overflow: hidden; }
.snav-link { display: block; padding: 11px 16px; font-size: 13px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--paper-3); transition: background .1s; }
.snav-link:last-child { border-bottom: none; }
.snav-link:hover { background: var(--paper); color: var(--terra); text-decoration: none; }

.settings-main { min-width: 0; }
.settings-section {
  background: var(--white); border: 1px solid var(--paper-3);
  border-radius: var(--r-lg); padding: 28px 32px;
  margin-bottom: 20px;
}
.settings-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.settings-desc  { font-size: 13px; color: var(--ink-2); margin-bottom: 24px; line-height: 1.6; }

.settings-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.settings-avatar-preview { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--terra-light); }
.settings-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.settings-avatar-initial { width: 72px; height: 72px; border-radius: 50%; background: var(--terra-light); color: var(--terra); font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.btn-upload-avatar { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--terra); border: 1.5px solid var(--terra); border-radius: 20px; cursor: pointer; transition: background .15s; }
.btn-upload-avatar:hover { background: var(--terra-light); }
.btn-upload-avatar .ti { font-size: 14px; }
.cover-upload-row { display: flex; align-items: flex-start; gap: 14px; }
.cover-thumb { width: 160px; height: 60px; border-radius: 8px; overflow: hidden; background: var(--paper-2); border: 1px dashed var(--paper-3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { text-align: center; color: var(--ink-4); font-size: 12px; }
.cover-placeholder .ti { font-size: 20px; display: block; }

.monetisasi-info { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.minfo-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--paper); border-radius: var(--r-md); border: 1px solid var(--paper-3); }
.minfo-item .ti { font-size: 20px; color: var(--terra); }
.minfo-item strong { display: block; font-size: 13px; font-weight: 700; }
.minfo-item span   { font-size: 12px; color: var(--ink-3); }

.toggle-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-label input[type=checkbox] { display: none; }
.toggle-track { width: 40px; height: 22px; border-radius: 11px; background: var(--paper-3); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); transition: left .2s; }
.toggle-label input:checked + .toggle-track { background: var(--terra); }
.toggle-label input:checked + .toggle-track::after { left: 21px; }
.toggle-text { font-size: 14px; font-weight: 700; }

/* ============================================================
   KOLEKSI PAGE
   ============================================================ */
.koleksi-hero { background: var(--white); border-bottom: 1px solid var(--paper-3); }
.koleksi-cover { width: 100%; max-height: 300px; overflow: hidden; }
.koleksi-cover img { width: 100%; height: 300px; object-fit: cover; }
.koleksi-meta { padding: 32px 0 28px; }
.koleksi-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--terra); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.koleksi-badge .ti { font-size: 14px; }
.koleksi-title { font-size: 28px; font-weight: 800; margin-bottom: 10px; line-height: 1.3; }
.koleksi-desc  { font-family: 'Lora', serif; font-size: 15px; color: var(--ink-2); margin-bottom: 10px; line-height: 1.7; }
.koleksi-count { font-size: 13px; color: var(--ink-3); font-weight: 600; }

/* ============================================================
   UTILITIES
   ============================================================ */
.rc-main { min-height: calc(100vh - var(--nav-h)); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-cover { max-height: 300px; aspect-ratio: 16/9; }
  .hero-cover-placeholder { font-size: 80px; }
  .hero-title { font-size: 26px; }
  .nav-themes { display: none; }
}

@media (max-width: 640px) {
  .rc-nav { padding: 0 16px; }
  .home-hero { padding: 28px 16px; }
  .home-themes .rc-container, .home-latest, .home-spotlight { padding-left: 16px; padding-right: 16px; }
  .story-grid--3 { grid-template-columns: 1fr; }
  .story-title { font-size: 26px; }
  .story-body  { font-size: 16px; }
  .story-content-wrap { padding: 28px 16px 0; }
  .form-row { grid-template-columns: 1fr; }
  .story-author-card { flex-direction: column; }
  .spotlight-grid { grid-template-columns: 1fr; }
}
