
:root {
  --nav: #1f3155;
  --gold: #e9b548;
  --gold-deep: #c58d27;
  --ink: #1b2536;
  --muted: #5f697a;
  --paper: #f5eee2;
  --card: #fffdf9;
  --site-container: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #efe4d1, var(--paper));
}

body.modal-open {
  overflow: hidden;
}

.container {
  width: min(var(--site-container), calc(100% - 32px));
  margin: 0 auto;
}

.container-fluid {
  width: min(1680px, 97%);
  margin: 0 auto;
}

.container-wide {
  width: min(var(--site-container), calc(100% - 32px));
  margin: 0 auto;
}

.page-gap { padding: 22px 0 30px; }

body:not(.layout-fluid) > main.container.page-gap {
  padding-top: 30px;
}

.topbar {
  background: linear-gradient(110deg, #2e4b7d, var(--nav));
  color: #fff;
}

.home-header {
  background: radial-gradient(circle at 10% 20%, #35598f, #1a2e51 60%, #152742);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.home-top {
  min-height: 78px;
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  align-items: center;
  gap: 16px;
}

.home-brand-wrap {
  display: inline-grid;
  text-decoration: none;
}

.home-brand {
  color: #f5c96c;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
}

.home-brand-wrap small {
  color: #d5def0;
  margin-top: 2px;
  font-size: 0.85rem;
}

.home-menu {
  display: flex;
  justify-content: center;
  gap: 22px;
}

.home-menu a {
  color: #dce6f8;
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.home-menu a.active {
  border-color: #dce6f8;
}

.home-search {
  display: grid;
  grid-template-columns: 1fr auto;
  background: #f6f3eb;
  border-radius: 999px;
  padding: 4px;
}

.home-search input {
  border: 0;
  background: transparent;
  padding: 8px 12px;
}

.home-search button {
  border: 0;
  background: #ebe4d7;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.home-hero {
  margin-top: 6px;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 20px;
  padding: 28px 0 30px;
}

.hero-visual {
  position: relative;
  height: 170px;
}

.hero-books {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 150px;
  height: 116px;
  border-radius: 12px;
  background: linear-gradient(180deg, #c08f4f, #57361e);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.hero-tablet {
  position: absolute;
  left: 90px;
  bottom: 6px;
  width: 122px;
  height: 154px;
  border-radius: 14px;
  background: linear-gradient(145deg, #181818, #383838 40%, #0f0f0f);
  border: 3px solid #111;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
}

.hero-copy h1 span {
  color: #f2c45e;
}

.hero-copy p {
  margin: 8px 0 0;
  font-size: 1.25rem;
}

.home-shelf {
  height: 16px;
  background: linear-gradient(180deg, #a96d3d, #6e4528);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a, .text-link { color: #e5ebf5; text-decoration: none; }
.text-link.dark { color: #234576; }

.profile-menu {
  position: relative;
}

.notification-menu {
  position: relative;
  margin-left: auto;
}

.notification-trigger {
  list-style: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #ded7ca;
  background: #f5f1e8;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.notification-trigger::-webkit-details-marker { display: none; }
.notification-trigger::marker { content: ""; }

.notification-bell {
  font-size: 1.1rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid #fff;
}

.notification-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 92vw);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e6e0d6;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  z-index: 1000;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.notification-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-head a {
  font-size: 0.82rem;
  text-decoration: none;
  color: #234576;
  font-weight: 700;
}

.notification-mini-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.notification-mini-item {
  text-decoration: none;
  color: #334155;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 3px;
}

.notification-mini-item.unread {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.notification-mini-item strong {
  font-size: 0.86rem;
}

.notification-mini-item small {
  font-size: 0.76rem;
  color: #64748b;
}

.notification-card form {
  margin: 0;
}

.notification-card form button {
  width: 100%;
  border: 1px solid #ddd4c2;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.profile-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #f5f1e8;
  color: #2f3b4f;
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 180px;
  cursor: pointer;
  border: 1px solid #ded7ca;
}

.profile-trigger::-webkit-details-marker { display: none; }
.profile-trigger::marker { content: ""; }

.profile-role {
  font-weight: 700;
  text-transform: capitalize;
}

.profile-avatar {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid #0f1115;
  position: relative;
}

.profile-avatar::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border: 2px solid #0f1115;
  border-radius: 999px;
  background: transparent;
}

.profile-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 18px;
  height: 9px;
  border: 2px solid #0f1115;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.profile-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 92vw);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e6e0d6;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  z-index: 1000;
}

.profile-hero {
  padding: 16px;
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(120deg, #4f3ae7, #8047cf);
  position: relative;
}

.profile-card-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  z-index: 1;
}

.profile-card-x:hover {
  background: rgba(255, 255, 255, 0.35);
}

.profile-hero strong {
  display: block;
  font-size: 1.35rem;
}

.profile-hero p {
  margin: 2px 0 0;
  color: #e8ddff;
  overflow-wrap: anywhere;
}

.profile-hero-avatar {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  position: relative;
}

.profile-hero-avatar::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 999px;
}

.profile-hero-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 28px;
  height: 14px;
  border: 2px solid #fff;
  border-top: 0;
  border-radius: 0 0 16px 16px;
}

.profile-card > a {
  display: block;
  padding: 12px 16px;
  color: #5a6171;
  text-decoration: none;
  border-top: 1px solid #f2ede4;
}

.profile-card > a:hover {
  background: #f8f5ef;
}

.profile-card > .profile-card-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: #5a6171;
  text-decoration: none;
  border: none;
  border-top: 1px solid #f2ede4;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-card > .profile-card-btn:hover {
  background: #f8f5ef;
}

.profile-card form {
  padding: 12px 16px 16px;
  border-top: 1px solid #f2ede4;
}

.profile-card form button {
  border: 1px solid #ddd4c2;
  background: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.notification-item.unread {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.notification-item p {
  margin: 5px 0;
}

.notification-item small {
  color: #64748b;
}

.brand {
  color: #f3c256;
  font-size: 1.9rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  background: linear-gradient(120deg, #233f69, #162946);
  color: #fff;
  border-radius: 16px;
  padding: 46px 34px;
}

.hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); }
.hero p { color: #d6deec; max-width: 700px; }
.hero-actions { display: flex; gap: 12px; margin-top: 20px; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2c2414;
}

.btn-danger {
  background: linear-gradient(180deg, #d4625a, #b9453e);
  color: #fff;
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  background: transparent;
}

.dark-outline {
  border: 1px solid #cdd4df;
  color: #24344f;
}

.btn-outline.light {
  border-color: rgba(255, 255, 255, 0.55);
}

.full { width: 100%; text-align: center; }

/* Guest flash gate */
.flash-gate-body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #ed1c24;
}

.flash-gate {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 42px);
  background: #ed1c24;
}

.flash-image {
  position: relative;
  z-index: 2;
  display: block;
  width: min(100%, 1120px);
  max-height: calc(100vh - 28px);
  object-fit: contain;
  border: 0;
  box-shadow: none;
}

.flash-home-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

.flash-login-hit,
.flash-signup-hit {
  position: absolute;
  z-index: 3;
  display: block;
  border-radius: 999px;
}

.flash-login-hit {
  left: calc(50% + min(100vw, 1120px) * 0.25);
  top: calc(50% - min(100vh, 720px) * 0.185);
  width: min(150px, 16vw);
  height: 38px;
}

.flash-signup-hit {
  left: calc(50% + min(100vw, 1120px) * 0.27);
  top: calc(50% - min(100vh, 720px) * 0.12);
  width: min(118px, 14vw);
  height: 32px;
}

@media (max-width: 760px) {
  .flash-gate {
    padding: 0;
    background: #ed1c24;
  }

  .flash-image {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border: 0;
    object-fit: cover;
    box-shadow: none;
  }

  .flash-login-hit {
    left: 63vw;
    top: 37vh;
    width: 25vw;
    height: 40px;
  }

  .flash-signup-hit {
    left: 66vw;
    top: 43vh;
    width: 20vw;
    height: 36px;
  }
}

.section-card {
  background: var(--card);
  border-radius: 14px;
  margin-top: 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 { margin: 0; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.book-card {
  border: 1px solid #ece6da;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.book-card h3 { margin: 10px 0 2px; font-size: 1rem; }
.book-card p { margin: 0; color: #1a2942; font-weight: 700; }

.book-cover {
  height: 150px;
  border-radius: 8px;
  background: linear-gradient(160deg, #7d5b3a, #332318 60%, #c18848);
}

.book-cover.alt { background: linear-gradient(160deg, #82483d, #2c2e45 60%, #f1ab5e); }
.book-cover.large { height: 280px; width: 220px; }
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.library-spotlight-card .section-head {
  align-items: end;
}

.library-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 190px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.library-cover-card {
  display: grid;
  gap: 6px;
}

.library-cover-link {
  display: block;
  border-radius: 10px;
}

.library-cover {
  height: 250px;
  transition: transform .16s ease, box-shadow .16s ease;
}

.library-cover-link:hover .library-cover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

.library-cover-card h3 {
  margin: 0;
  font-size: .96rem;
  line-height: 1.25;
}

.library-progress-note {
  margin: 0;
  color: #64748b;
  font-size: .82rem;
}

.library-empty-card,
.library-grid-card,
.library-hero-card,
.library-filter-card {
  overflow: hidden;
}

.library-empty-actions {
  margin-top: 14px;
}

.library-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.library-search-shell {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: .86rem;
  font-weight: 700;
}

.library-search-shell input {
  width: 100%;
  border: 1px solid #d6dee8;
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  font: inherit;
}

.library-search-shell select {
  width: 100%;
  border: 1px solid #d6dee8;
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  font: inherit;
}

.library-sort-shell {
  max-width: 240px;
}

.library-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-tab-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-category-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.library-filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #fff;
  color: #243b53;
  font-size: .88rem;
  font-weight: 700;
  padding: 9px 14px;
  text-decoration: none;
}

.library-filter-pill:hover {
  border-color: #9acfb9;
  color: #0f6d4d;
}

.library-filter-pill.active {
  border-color: #0f6d4d;
  background: #edf7f1;
  color: #0f6d4d;
}

.library-loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.52);
  backdrop-filter: blur(2px);
}

.library-loading[hidden] {
  display: none !important;
}

.library-loading-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
}

.library-loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  animation: library-spin .7s linear infinite;
}

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

.library-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: #ffffff;
}

.library-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #0f6d4d;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 9px;
}

.library-hero-copy h2 {
  margin: 8px 0 4px;
  max-width: 620px;
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  line-height: 1.18;
}

.library-hero-meta,
.library-hero-summary {
  margin: 0;
}

.library-hero-meta {
  color: #355a53;
  font-weight: 600;
}

.library-hero-summary {
  display: none;
}

.library-hero-actions,
.library-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.library-hero-actions {
  margin-top: 10px;
}

.library-stat-row {
  margin-top: 10px;
}

.library-stat-row span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 109, 77, 0.12);
  color: #27434a;
  font-size: .76rem;
  padding: 5px 9px;
}

.library-hero-cover-link {
  display: block;
  justify-self: end;
}

.library-hero-cover {
  width: 86px;
  height: 124px;
  border-radius: 10px;
  box-shadow: none;
}

.library-hero-card .library-hero-actions .btn {
  padding: 7px 10px;
  font-size: 0.78rem;
  line-height: 1.1;
}

.library-continue-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 380px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.library-continue-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e5edf0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.library-continue-cover-link {
  display: block;
}

.library-continue-cover {
  height: 132px;
  border-radius: 12px;
  overflow: hidden;
}

.library-continue-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.library-continue-kicker {
  margin: 0;
  color: #0f6d4d;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.library-continue-item h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.library-continue-item h3 a {
  color: #10213d;
  text-decoration: none;
}

.library-continue-item h3 a:hover {
  color: #0f6d4d;
}

.library-continue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 118px));
  justify-content: start;
  gap: 34px 36px;
}

.library-book-card {
  display: block;
}

.library-book-cover-link {
  display: block;
  border-radius: 18px;
}

.library-book-cover {
  height: auto;
  border-radius: 13px;
  box-shadow: none;
  transition: transform .18s ease;
}

.library-book-cover:hover {
  transform: translateY(-2px);
}

.library-book-body {
  display: block;
  min-width: 0;
}

.library-book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.library-book-chip,
.library-book-stat {
  border-radius: 999px;
  font-size: .74rem;
  padding: 6px 10px;
}

.library-book-chip {
  background: #edf7f1;
  border: 1px solid #cfe6db;
  color: #0f6d4d;
  font-weight: 700;
}

.library-book-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.library-book-card h3 {
  margin: 10px 0 4px;
  min-height: 1.2em;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 800;
}

.library-book-card h3 a {
  display: -webkit-box;
  overflow: hidden;
  color: #151515;
  text-decoration: none;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.library-book-card h3 a:hover {
  color: #0f6d4d;
}

.library-book-author {
  margin: 0 0 4px;
  color: #777b80;
  font-size: 0.76rem;
  line-height: 1.15;
}

.library-book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.library-book-actions .btn.small {
  padding: 5px 8px;
  font-size: 0.72rem;
  line-height: 1.1;
}

.library-book-card .library-progress-note {
  margin: 0;
  color: #ff0000;
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 800;
}

.genre-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.genre-pill {
  background: #f7efe2;
  border: 1px solid #ead9c0;
  border-radius: 999px;
  padding: 8px 14px;
}

.how-it-works {
  border-top: 2px solid #ece2d0;
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(11, auto);
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step-card {
  min-width: 145px;
  background: #fff;
  border: 1px solid #ede3d3;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.step-card strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f0b84c;
  color: #2d2414;
}

.step-card p {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

.step-arrow {
  color: #c9b79b;
  font-size: 1.6rem;
}

.testimonial {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  align-items: center;
  background: linear-gradient(120deg, #f8efdf, #f4e7d3);
}

.quote-mark {
  margin: 0;
  color: #d6b072;
  font-size: 2rem;
  line-height: 1;
}

.testimonial p {
  margin: 4px 0 10px;
}

.testimonial-photo {
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(130deg, #eed9bd, #d5ad83);
}

.community-cta {
  margin-top: 14px;
  background: linear-gradient(120deg, #233c66, #162946);
  color: #f5f7ff;
  padding: 24px 0 12px;
}

.community-cta h3 {
  text-align: center;
  margin: 0 0 10px;
}

.community-cta .hero-actions {
  justify-content: center;
}

.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #dce5f8;
  text-decoration: none;
  font-size: 0.9rem;
}

.auth-wrap {
  padding: 36px 0;
  display: flex;
  justify-content: center;
}

.auth-ecom-body {
  min-height: 100vh;
  background: #ffffff;
}

.auth-ecom-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
  align-items: stretch;
}

.auth-ecom-brand {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: block;
  padding: clamp(42px, 6vw, 82px);
  color: #ffffff;
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #ff0000 0%, #ff1f1f 45%, #fff1f1 100%);
}

.auth-ecom-logo {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  text-decoration: none;
}

.auth-ecom-logo img {
  display: block;
  width: 112px;
  height: auto;
  filter: brightness(0) invert(1);
}

.auth-ecom-brand h1 {
  margin: 18px 0 0;
  max-width: 10.5ch;
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  line-height: 1.16;
  color: #ffffff;
  letter-spacing: 0;
}

.auth-ecom-brand p {
  margin: 16px 0 0;
  max-width: 520px;
  color: #374151;
  font-size: 1rem;
  line-height: 1.55;
}

.auth-ecom-brand-copy {
  position: relative;
  z-index: 3;
  margin-top: clamp(54px, 9vw, 0px);
}

.auth-ecom-visual {
  position: absolute;
  right: -4%;
  bottom: -1px;
  z-index: 2;
  width: min(660px, 76%);
  max-height: 82vh;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}

.auth-ecom-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-card {
  width: min(500px, 100%);
  background: #ffffff;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.auth-ecom-card {
  width: min(440px, 100%);
  border: 0;
  border-radius: 0;
  padding: 0;
}

.auth-title {
  margin: 0 0 8px;
  color: #111827;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  line-height: 1.18;
}

.auth-subtitle {
  margin: 0 0 30px;
  color: #4b5563;
  font-size: 0.98rem;
}

.form-stack { display: grid; gap: 13px; }

.field-label {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-input-wrap {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid #d7d8dd;
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.auth-input-wrap:focus-within {
  border-color: #ff0000;
  box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.12);
}

.auth-input-wrap span {
  color: #4b5563;
  font-size: 0.95rem;
}

.auth-input-wrap input {
  border: 0 !important;
  border-radius: 0 !important;
  padding: 12px 0 !important;
  outline: 0;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  border: 1px solid #d7d8dd;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}

.auth-submit-btn {
  margin-top: 6px;
  border-radius: 999px;
  background: #ff0000;
  border-color: #ff0000;
}

.auth-submit-btn[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
}

input[type="number"],
textarea,
select {
  width: 100%;
  border: 1px solid #d7d8dd;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  font-family: inherit;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 0.86rem;
}

.field-error {
  margin: 0;
  color: #c43a2f;
  font-size: 0.92rem;
}

.auth-helper-text {
  margin: -2px 0 0;
  color: #6b7280;
  font-size: 0.86rem;
}

.auth-inline-note strong {
  font-weight: 800;
}

.flash-ok {
  border: 1px solid #99d3a9;
  color: #1f7044;
  background: #ebfff1;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.flash-error {
  border: 1px solid #e5a4a4;
  color: #812e2e;
  background: #fff1f1;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.flash-danger {
  border: 1px solid #e5a4a4;
  color: #812e2e;
  background: #fff1f1;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.auth-links {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #111827;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.auth-links a {
  color: #ff0000;
  text-decoration: none;
}

.auth-back-home {
  margin-top: 18px;
  display: inline-block;
  width: 100%;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.84rem;
  text-align: center;
}

.auth-back-home-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.auth-divider {
  display: none;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 32px 0 24px;
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: #e5e7eb;
}

.auth-social-row {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-social-row a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid #d7d8dd;
  border-radius: 999px;
  color: #111827;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 900;
  background: #ffffff;
}

.auth-verify-actions {
  display: grid;
  gap: 14px;
}

.auth-link-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #ff0000;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.page-header {
  background: #fff;
  border-bottom: 1px solid #e8e4db;
  padding: 14px 0;
  display: none;
}

.reader-page-title {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.6rem);
  line-height: 1.2;
  font-weight: 700;
}

.dashboard-note { color: var(--muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.seller-kpi-grid {
  margin-top: 0;
  margin-bottom: 12px;
}

.seller-analytics-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.seller-chart {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.seller-chart-row {
  display: grid;
  grid-template-columns: 56px 1fr 96px;
  gap: 8px;
  align-items: center;
}

.seller-chart-label {
  font-size: 0.78rem;
  color: #64748b;
}

.seller-chart-track {
  height: 10px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
}

.seller-chart-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
}

.seller-chart-value {
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
}

.seller-topbooks {
  display: grid;
  gap: 8px;
}

.seller-period-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 10px;
}

.seller-period-pill {
  text-decoration: none;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #fff;
}

.seller-period-pill:hover {
  background: #f8fafc;
}

.seller-period-pill.active {
  color: #0f172a;
  border-color: #93c5fd;
  background: #e0f2fe;
}

.seller-topbook-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #e7ecf3;
  border-radius: 10px;
  padding: 10px 11px;
  background: #fbfdff;
}

.seller-topbook-item small {
  display: block;
  color: #64748b;
  margin-top: 3px;
}

.writer-chapter {
  display: grid;
  gap: 10px;
}

.writer-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 12px;
  align-items: start;
}

.writer-nav {
  position: sticky;
  top: 82px;
}

.writer-tree-search {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  margin-bottom: 10px;
}

.writer-tree {
  max-height: calc(100vh - 220px);
  overflow: auto;
  display: grid;
  gap: 8px;
}

.writer-tree-chapter {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.writer-tree-chapter-link {
  text-decoration: none;
  color: #1f2937;
  font-weight: 700;
}

.writer-tree-pages {
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.writer-tree-page-link {
  text-decoration: none;
  color: #475569;
  font-size: 0.85rem;
  border-left: 2px solid #e2e8f0;
  padding-left: 8px;
}

.writer-tree-page-link:hover {
  color: #1d4ed8;
  border-left-color: #93c5fd;
}

.writer-tree-empty {
  font-size: 0.8rem;
  color: #94a3b8;
}

.writer-inline-form {
  padding: 10px;
  border: 1px solid #e7ecf3;
  border-radius: 10px;
  background: #fbfdff;
}

.writer-pages-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.writer-page-card {
  border: 1px solid #e7ecf3;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.writer-page-card textarea,
.writer-inline-form textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}

.writer-quill-wrap {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
}

.writer-quill-wrap .ql-toolbar.ql-snow {
  border: 0;
  border-bottom: 1px solid #e5e7eb;
}

.writer-quill-wrap .ql-container.ql-snow {
  border: 0;
  min-height: 200px;
  font-family: inherit;
}

.writer-quill-editor .ql-editor {
  min-height: 200px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.writer-page-actions {
  display: flex;
  gap: 8px;
}

.writer-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.writer-media-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.writer-media-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.writer-media-item strong {
  font-size: 0.84rem;
  display: block;
  overflow-wrap: anywhere;
}

.writer-media-item small {
  color: #64748b;
}

.admin-panel-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-body {
  background: #f4f6fb;
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 14px;
  padding: 14px 0 20px;
}

.admin-sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  background: #fff;
  border: 1px solid #e7ecf3;
  border-radius: 14px;
  padding: 14px;
}

.admin-sidebar-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-sidebar-head small {
  color: #64748b;
}

.admin-sidebar-nav {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.admin-sidebar-nav a {
  text-decoration: none;
  color: #334155;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
}

.admin-sidebar-nav a:hover {
  background: #f8fbff;
  border-color: #dde7f5;
}

.admin-sidebar-nav a.active {
  background: #eaf2ff;
  border-color: #cfe0fb;
  color: #1f4b93;
}

.admin-content {
  display: grid;
  gap: 12px;
}

.admin-page-head {
  background: #fff;
  border: 1px solid #e7ecf3;
  border-radius: 12px;
  padding: 12px 14px;
}

.seller-body {
  background: #f4f6fb;
}

.seller-body .nav-links {
  display: none;
}

.seller-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 14px;
  padding: 14px 0 20px;
}

.seller-sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  background: #fff;
  border: 1px solid #e7ecf3;
  border-radius: 14px;
  padding: 14px;
}

.seller-sidebar-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.seller-sidebar-head small {
  color: #64748b;
}

.seller-sidebar-nav {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.seller-sidebar-nav a {
  text-decoration: none;
  color: #334155;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
}

.seller-sidebar-nav a:hover {
  background: #f8fbff;
  border-color: #dde7f5;
}

.seller-sidebar-nav a.active {
  background: #eaf2ff;
  border-color: #cfe0fb;
  color: #1f4b93;
}

.seller-content {
  display: grid;
  gap: 12px;
}

.seller-page-head {
  background: #fff;
  border: 1px solid #e7ecf3;
  border-radius: 12px;
  padding: 12px 14px;
}

.seller-quick-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.seller-tab-pill {
  text-decoration: none;
  color: #334155;
  border: 1px solid #dbe5f1;
  background: #fff;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.86rem;
  font-weight: 700;
}

.seller-tab-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  margin-left: 6px;
  background: #eef2f7;
  color: #1f2937;
  font-size: 0.72rem;
}

.seller-tab-pill:hover {
  border-color: #c7d6ea;
  background: #f8fafc;
}

.seller-tab-pill.active {
  color: #0f3f7a;
  border-color: #bcd4f7;
  background: #eaf2ff;
}

.seller-tab-pill.active span {
  background: #d8e8ff;
  color: #0f3f7a;
}

.seller-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 12px;
  align-items: start;
}

.seller-side-panel {
  display: grid;
  gap: 12px;
}

.seller-side-card {
  background: #fff;
  border: 1px solid #e5edf6;
  border-radius: 12px;
  padding: 12px;
}

.seller-side-card h3 {
  margin: 0 0 10px;
}

.seller-alert-list {
  display: grid;
  gap: 8px;
}

.seller-alert-item {
  text-decoration: none;
  color: #334155;
  border: 1px solid #e5edf6;
  background: #f8fbff;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 2px;
}

.seller-alert-item strong {
  font-size: 0.9rem;
}

.seller-alert-item small {
  color: #64748b;
  font-size: 0.76rem;
}

.seller-tip-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  display: grid;
  gap: 8px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ece6da;
  padding: 14px;
}

.stat-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--muted); }
.stat-card p { margin: 0; font-size: 1.5rem; font-weight: 700; }

.stat-card-link {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #fffdf9, #f7efe2);
  border-color: #e3c896;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.stat-card-link:hover {
  transform: translateY(-2px);
  border-color: #cf9c44;
  box-shadow: 0 10px 20px rgba(201, 141, 39, 0.2);
  background: linear-gradient(180deg, #fff6e8, #f4e4c9);
}

.stat-card-link h3 {
  color: #6a4a16;
}

.stat-card-link p {
  color: #1f3155;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.badge-count {
  background: #ebf0f9;
  color: #1f3f74;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.88rem;
}

.text-success { color: #16a34a; }
.text-danger { color: #dc2626; }
.text-warning { color: #f59e0b; }

.pager-wrap {
  margin-top: 16px;
  margin-bottom: 20px;
}
.pager-wrap nav[role="navigation"] svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.pager-wrap nav[role="navigation"] span.inline-flex,
.pager-wrap nav[role="navigation"] a.inline-flex {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Pagination custom (myj) — gantikan view default Laravel */
.myj-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 0;
}

.myj-pagination-info {
  color: #576479;
  font-size: 0.85rem;
}

.myj-pagination-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.myj-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #fff;
  color: #21354a;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.myj-page-btn:hover {
  background: #f3f6fb;
  border-color: #b9c6da;
  color: #0b2a4a;
}

.myj-page-btn.is-active {
  background: #ED1C24;
  border-color: #ED1C24;
  color: #fff;
}

.myj-page-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.myj-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 36px;
  color: #8a97a8;
  font-size: 0.875rem;
}

@media (max-width: 560px) {
  .myj-pagination {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .myj-pagination-nav {
    justify-content: center;
  }
}

.book-detail {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.book-detail h1 { margin-top: 0; margin-bottom: 8px; }

.price-tag {
  font-size: 1.4rem;
  color: #173565;
  font-weight: 700;
  margin: 8px 0;
}

.detail-meta {
  display: grid;
  gap: 4px;
  color: #576479;
  margin-bottom: 14px;
}

.cart-list {
  display: grid;
  gap: 10px;
}

.cart-item {
  border: 1px solid #ece6da;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.cart-item h3 { margin: 0 0 4px; }
.cart-item p { margin: 0; color: #30415f; font-weight: 700; }

.checkout-row {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.reader-box {
  position: relative;
  min-height: 260px;
  overflow: hidden;
}

.reader-watermark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  z-index: 1;
}

.reader-watermark-layer span {
  color: rgba(22, 38, 67, 0.18);
  font-size: 0.78rem;
  transform: rotate(-14deg);
}

.reader-content {
  position: relative;
  z-index: 2;
  font-size: 1.22rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 6px 8px;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  display: grid;
  place-items: center;
}

.reader-text {
  white-space: pre-wrap;
  line-height: 1.7;
}

.reader-rich-text {
  width: 100%;
  max-width: 100%;
  color: #111827;
  line-height: 1.45;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.reader-rich-text h1,
.reader-rich-text h2,
.reader-rich-text h3,
.reader-rich-text h4 {
  margin: 0 0 8px;
}

.reader-rich-text p {
  margin: 0 0 6px;
}

.reader-rich-text .writer-a5-page {
  font-size: 11pt;
  line-height: 1.4;
}

.reader-rich-text .writer-a5-page h3 {
  margin: 0 0 10px;
  font-size: 1.58rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.reader-rich-text .writer-a5-page h4 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.reader-rich-text .writer-a5-page .writer-a5-body {
  line-height: 1.4;
}

.reader-rich-text ul,
.reader-rich-text ol {
  margin: 0 0 10px 18px;
}

.reader-rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.reader-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  margin: auto;
}

.reader-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  margin: auto;
}

.reader-shell {
  position: relative;
  background: radial-gradient(circle at center, #f9f5ec, #eee3d0);
  -webkit-user-select: none;
  user-select: none;
}

.reader-shell.is-epub-reader {
  background: #ffffff;
}

.reader-shell-full {
  min-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
}

body.immersive-mode {
  background: #0b1020;
}

body.immersive-mode .immersive-main {
  padding-top: 0;
  padding-bottom: 0;
}

.reader-shell.is-immersive {
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 100vh;
}

.section-card.reader-shell.is-immersive.is-epub-reader {
  margin-top: 0;
  padding-top: 0;
}

.reader-shell.is-browser-fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: #f4f6f8;
  padding: 10px;
}

.reader-shell.is-browser-fullscreen .reader-main-grid {
  min-height: calc(100vh - 96px);
}

.reader-shell.is-browser-fullscreen .flipbook-wrap,
.reader-shell.is-browser-fullscreen .reader-flow-wrap {
  min-height: calc(100vh - 112px);
}

.reader-shell.is-browser-fullscreen .flipbook-stage {
  min-height: calc(100vh - 112px);
}

.reader-shell.is-browser-fullscreen .reader-flow-toc {
  height: calc(100vh - 112px);
  max-height: calc(100vh - 112px);
}

.reader-shell.is-browser-fullscreen #reader-flow-toc-list {
  height: calc(100vh - 170px);
  max-height: calc(100vh - 170px);
}

.reader-shell.is-immersive .reader-top {
  position: sticky;
  top: 0;
  z-index: 18;
  margin-bottom: 12px;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 16px 26px rgba(15, 23, 42, 0.12);
}

.reader-shell.is-immersive .reader-meta-line strong {
  font-size: 1rem;
}

.reader-shell.is-immersive .reader-watermark-note {
  display: none;
}

.reader-shell.is-immersive .reader-top,
.reader-shell.is-immersive .reader-footer,
.reader-shell.is-immersive .reader-progress-bar-top {
  transition: opacity .18s ease, transform .18s ease, margin .18s ease, padding .18s ease, max-height .18s ease;
}

.reader-shell.is-immersive.reader-ui-hidden .reader-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  max-height: 0;
  overflow: hidden;
  box-shadow: none;
}

.reader-shell.is-immersive.reader-ui-hidden.reader-ui-overlay-open .reader-top {
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  z-index: 100;
  opacity: 1;
  pointer-events: auto;
}

.reader-shell.is-immersive.reader-ui-hidden .reader-footer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  max-height: 0;
  overflow: hidden;
}

.reader-show-ui-btn {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 25;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 0;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.28);
}

.reader-show-ui-btn[hidden] {
  display: none !important;
}

.reader-shell.is-epub-reader .reader-show-ui-btn {
  display: none;
}

.flipbook-wrap {
  display: block;
  min-height: calc(100vh - 330px);
}

.flipbook-wrap[hidden],
.reader-flow-wrap[hidden] {
  display: none !important;
}

.reader-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.reader-main-grid.has-toc {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.reader-shell.is-epub-reader .reader-main-grid {
  gap: 0;
}

.reader-shell.is-epub-reader .reader-main-grid.has-toc {
  grid-template-columns: 300px minmax(0, 1fr);
}

.reader-main-content {
  min-width: 0;
}

.reader-epub-tools {
  position: relative;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reader-epub-tools[hidden] {
  display: none !important;
}

.reader-epub-settings {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  width: 260px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  padding: 12px;
}

.reader-epub-settings[hidden] {
  display: none !important;
}

.reader-epub-plus-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: #ff5a1f;
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.reader-epub-highlights-btn {
  background: #0f172a;
}

.reader-epub-menu-link {
  display: block;
  margin-top: 10px;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  color: #334155;
  font-weight: 800;
  text-decoration: none;
}

.reader-epub-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 38px;
  margin-left: auto;
  margin-top: 0;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 0;
  background: #ffffff;
}

.reader-epub-back-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-epub-font-row,
.reader-theme-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reader-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.reader-theme-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.reader-font-btn,
.reader-theme-btn,
.reader-mode-btn {
  min-height: 38px;
  border: 1px solid #d9e1ec;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.reader-font-btn.large {
  font-size: 1.25rem;
}

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

.reader-theme-btn {
  font-size: 0.84rem;
  font-weight: 700;
}

.reader-mode-btn {
  font-size: 0.82rem;
  font-weight: 800;
}

.reader-mode-btn.is-active {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #eff6ff;
}

.reader-theme-btn.is-active {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #eff6ff;
}

.reader-setting-field {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
}

.reader-setting-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d9e1ec;
  border-radius: 7px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 8px;
}

.reader-progress-line {
  margin-top: 10px;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 800;
}

.reader-highlight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reader-highlight-head strong {
  color: #0f172a;
  font-size: 0.84rem;
}

.reader-highlight-note {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.reader-highlight-clear-btn {
  border: 0;
  background: transparent;
  color: #dc2626;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.reader-highlights-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 8px 14px 14px;
  max-height: none;
  overflow: auto;
}

.reader-highlights-empty {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}

.reader-highlight-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
  margin: 0;
}

.reader-highlight-jump,
.reader-highlight-remove {
  border: 1px solid #d9e1ec;
  border-radius: 7px;
  background: #fffdf2;
  color: #172033;
  font: inherit;
}

.reader-highlight-jump {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.45;
  cursor: pointer;
}

.reader-highlight-remove {
  width: 30px;
  min-height: 30px;
  padding: 0;
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.reader-highlights-panel .reader-flow-toc-head {
  border-bottom: 1px solid #e6ebf2;
}

.reader-highlight-panel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}

.reader-highlights-panel-list {
  height: calc(100vh - 236px);
  max-height: calc(100vh - 236px);
}

.reader-flow-wrap {
  position: relative;
  min-height: calc(100vh - 330px);
  border: 1px solid #dac6a3;
  border-radius: 14px;
  background: #f6efe1;
  padding: 18px;
  overflow: auto;
}

.reader-flow-page-nav {
  z-index: 35;
}

.reader-flow-wrap .reader-flow-page-nav.left {
  left: 16px;
}

.reader-flow-wrap .reader-flow-page-nav.right {
  right: 16px;
}

.reader-flow-toc {
  position: sticky;
  top: 12px;
  z-index: 15;
  width: 100%;
  height: calc(100vh - 132px);
  max-height: calc(100vh - 132px);
  margin: 0;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

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

.reader-flow-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e6ebf2;
  color: #0f172a;
}

.reader-flow-toc-close {
  width: 30px;
  height: 30px;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

#reader-flow-toc-list {
  height: calc(100vh - 190px);
  max-height: calc(100vh - 190px);
  overflow-y: auto;
}

.reader-flow-toc-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  padding: 10px 20px 10px calc(14px + (var(--toc-depth, 0) * 16px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.reader-flow-toc-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.reader-flow-toc-item.is-active {
  background: #eaf1ff;
  color: #1d4ed8;
  box-shadow: inset 4px 0 0 #1d4ed8;
}

.reader-flow-toc-item.is-locked,
.reader-flow-toc-item:disabled {
  cursor: not-allowed;
  color: #9aa6b8;
}

.reader-flow-toc-item.is-locked:hover,
.reader-flow-toc-item:disabled:hover {
  background: transparent;
  color: #9aa6b8;
}

.reader-flow-toc-head small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 500;
}

.reader-shell.is-epub-reader .reader-flow-toc {
  width: 300px;
  top: 64px;
  height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}

.reader-shell.is-epub-reader #reader-flow-toc-list {
  height: calc(100dvh - 132px);
  max-height: calc(100dvh - 132px);
}

.reader-shell.is-epub-reader .reader-flow-toc-head {
  position: relative;
  justify-content: center;
  min-height: 66px;
  text-align: center;
}

.reader-shell.is-epub-reader .reader-flow-toc-close {
  position: absolute;
  right: 12px;
  top: 12px;
}

.reader-shell.is-epub-reader .reader-flow-toc-item {
  min-height: auto;
  padding: 10px 20px 10px calc(14px + (var(--toc-depth, 0) * 16px));
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-shell.is-epub-reader .reader-flow-toc-item:hover {
  background: #fff7ed;
  color: #ff5a1f;
}

.reader-shell.is-epub-reader .reader-flow-toc-item.is-active {
  background: #fff7ed;
  color: #ff5a1f;
  box-shadow: inset 4px 0 0 #ff5a1f;
}

.reader-flow-toc-empty {
  margin: 0;
  padding: 14px 16px;
  color: #64748b;
}

.reader-flow-page {
  position: relative;
  width: min(1120px, 100%);
  min-height: 78vh;
  margin: 0 auto;
  border: 1px solid #e5d8bf;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 16px 36px rgba(54, 45, 31, 0.16);
  overflow: hidden;
}

.reader-shell.is-epub-reader .reader-flow-wrap {
  min-height: calc(100dvh - 64px);
  border: 0;
  border-radius: 0;
  background: #f6f8fb;
  padding: 18px;
  overflow-x: hidden;
}

.reader-shell.is-epub-reader .reader-flow-page {
  width: min(1120px, 100%);
  min-height: calc(100dvh - 100px);
  border: 1px solid #e5d8bf;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(54, 45, 31, 0.12);
  background: #ffffff;
}

.reader-shell.is-epub-reader .reader-epubjs-area {
  height: calc(100dvh - 102px);
  min-height: calc(100dvh - 102px);
  border-radius: 10px;
  overflow: hidden;
}

.reader-flow-content {
  position: relative;
  z-index: 2;
  padding: clamp(24px, 5vw, 58px);
  color: #172033;
  font-family: var(--reader-flow-font-family, Georgia, "Times New Roman", serif);
  font-size: calc(1.08rem * var(--reader-flow-font-scale, 1));
  line-height: var(--reader-flow-line-height, 1.82);
  text-align: var(--reader-flow-align, left);
  -webkit-user-select: none;
  user-select: none;
}

.reader-flow-content.is-native-epub-content {
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

.reader-epubjs-area {
  position: relative;
  width: 100%;
  height: min(78vh, calc(100vh - 190px));
  min-height: 620px;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
}

.reader-shell.is-browser-fullscreen .reader-epubjs-area {
  height: calc(100vh - 170px);
}

.reader-shell[data-reader-theme="white"] .reader-flow-wrap {
  background: #f4f6f8;
}

.reader-shell[data-reader-theme="white"] .reader-flow-page {
  background: #ffffff;
  border-color: #dfe5ee;
}

.reader-shell[data-reader-theme="sepia"] .reader-flow-wrap {
  background: #efe5c8;
}

.reader-shell[data-reader-theme="sepia"] .reader-flow-page {
  background: #fbf2d4;
  border-color: #dfcf9f;
}

.reader-shell[data-reader-theme="sepia"] .reader-flow-content {
  color: #332715;
}

.reader-shell[data-reader-theme="night"] .reader-flow-wrap {
  background: #0f172a;
  border-color: #25324a;
}

.reader-shell[data-reader-theme="night"] .reader-flow-page {
  background: #111827;
  border-color: #334155;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.reader-shell[data-reader-theme="night"] .reader-flow-content,
.reader-shell[data-reader-theme="night"] .reader-flow-section h1,
.reader-shell[data-reader-theme="night"] .reader-flow-section h2 {
  color: #e5e7eb;
}

.reader-shell[data-reader-theme="night"] .reader-flow-section h2 {
  border-top-color: #334155;
}

.reader-shell[data-reader-theme="night"] .reader-flow-watermark span {
  color: rgba(226, 232, 240, 0.12);
}

.reader-flow-section {
  margin-bottom: 34px;
}

.reader-flow-section h1,
.reader-flow-section h2 {
  margin: 0 0 18px;
  color: #0f172a;
  line-height: 1.16;
}

.reader-flow-section h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.reader-flow-section h2 {
  font-size: 1.45rem;
  padding-top: 10px;
  border-top: 1px solid #eee4d3;
}

.reader-flow-section h3,
.reader-flow-section h4 {
  margin: 20px 0 10px;
}

.reader-flow-section p {
  margin: 0 0 1.1em;
}

.reader-flow-section ul,
.reader-flow-section ol {
  margin: 0 0 1.1em 1.4em;
}

.reader-flow-chapter-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid #e5edf6;
}

.reader-flow-watermark {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px 24px;
  padding: 50px;
  overflow: hidden;
}

.reader-flow-watermark span {
  align-self: center;
  justify-self: center;
  color: rgba(22, 38, 67, 0.12);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: pre-line;
  transform: rotate(-20deg);
}

.reader-shell[data-watermark-level="strong"] .reader-flow-watermark span {
  color: rgba(22, 38, 67, 0.2);
}

.flipbook-stage {
  position: relative;
  min-height: 668px;
  border: 1px solid #dac6a3;
  border-radius: 14px;
  background: linear-gradient(180deg, #4c4c4c, #2f2f2f);
  overflow: hidden;
  padding: 12px;
  display: grid;
  justify-items: center;
  align-items: start;
  --reader-zoom: 1;
}

.flipbook-stage.zoom-active {
  overflow: auto;
}

.flipbook-stage.is-fullscreen {
  padding: 16px;
}

.flipbook-stage.is-native-epub-stage {
  align-items: center;
  background: #eef2f7;
  overflow: hidden;
}

.flipbook-host {
  width: min(100%, 867px);
  height: 668px;
  margin: 0 auto;
  align-self: start;
  --reader-zoom: 1;
  transform: scale(var(--reader-zoom));
  transform-origin: top center;
}

.reader-epub-page-host {
  position: relative;
  width: min(100%, 980px);
  height: min(74vh, 760px);
  min-height: 560px;
  margin: 0 auto;
  align-self: start;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.reader-epub-page-host[hidden] {
  display: none !important;
}

.reader-epub-page-host.is-rendering,
.reader-epubjs-area.is-rendering {
  opacity: 0;
}

.flipbook-host.is-native-epub {
  position: relative;
  width: min(100%, 980px);
  height: min(74vh, 760px);
  min-height: 560px;
  transform: none !important;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.flipbook-host.is-native-epub iframe {
  background: #fff;
}

.reader-epub-page-host.is-native-epub iframe {
  background: #fff;
}

.flipbook-host.is-native-epub > .reader-watermark-layer,
.reader-epub-page-host.is-native-epub > .reader-watermark-layer,
.reader-epubjs-area.is-native-epub > .reader-watermark-layer {
  z-index: 5;
  display: block;
  padding: 0;
}

.flipbook-host.is-native-epub > .reader-watermark-layer span,
.reader-epub-page-host.is-native-epub > .reader-watermark-layer span,
.reader-epubjs-area.is-native-epub > .reader-watermark-layer span {
  position: absolute;
  left: var(--wm-x, 50%);
  top: var(--wm-y, 50%);
  transform: translate(-50%, -50%) rotate(-20deg);
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(22, 38, 67, 0.14);
  white-space: pre-line;
  text-align: center;
  line-height: 1.25;
}

.flipbook-host.is-native-epub.slide-next iframe,
.reader-epub-page-host.is-native-epub.slide-next iframe,
.reader-epubjs-area.slide-next iframe {
  animation: epubSlideNext 180ms ease-out;
}

.flipbook-host.is-native-epub.slide-prev iframe,
.reader-epub-page-host.is-native-epub.slide-prev iframe,
.reader-epubjs-area.slide-prev iframe {
  animation: epubSlidePrev 180ms ease-out;
}

@keyframes epubSlideNext {
  from {
    opacity: 0.35;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes epubSlidePrev {
  from {
    opacity: 0.35;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reader-epub-error {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 24px;
  color: #8a1f2d;
  font-weight: 800;
  text-align: center;
}

.flipbook-host .stf__parent {
  margin: 0 auto;
  box-shadow: 0 8px 18px rgba(72, 63, 48, 0.12);
  border-radius: 8px;
}

.flipbook-host .stf__block {
  margin: 0 auto;
}

.flip-page {
  background: #fffefb;
}

.flip-page-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fffefb;
  border: 1px solid #ece4d4;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.flip-page-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 14px;
}

.flip-page-content.mode-html,
.flip-page-content.mode-text {
  position: absolute;
  left: var(--reader-page-box-left, 14px);
  top: var(--reader-page-box-top, 14px);
  width: var(--reader-page-box-width, calc(100% - 28px));
  height: var(--reader-page-box-height, calc(100% - 28px));
  display: block;
  padding: 0;
}

.flip-page-content.mode-html .reader-rich-text,
.flip-page-content.mode-text .reader-text {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px 0 0;
  scrollbar-width: thin;
  scrollbar-color: #c7d2e3 transparent;
  background: transparent;
  box-sizing: border-box;
}

.flip-page-content.mode-html .reader-rich-text::-webkit-scrollbar,
.flip-page-content.mode-text .reader-text::-webkit-scrollbar {
  width: 6px;
}

.flip-page-content.mode-html .reader-rich-text::-webkit-scrollbar-track,
.flip-page-content.mode-text .reader-text::-webkit-scrollbar-track {
  background: transparent;
}

.flip-page-content.mode-html .reader-rich-text::-webkit-scrollbar-thumb,
.flip-page-content.mode-text .reader-text::-webkit-scrollbar-thumb {
  background: #c7d2e3;
  border-radius: 999px;
}

.flip-page-content.mode-html .reader-rich-text::-webkit-scrollbar-thumb:hover,
.flip-page-content.mode-text .reader-text::-webkit-scrollbar-thumb:hover {
  background: #aebcd2;
}

.flip-page-content.mode-image {
  display: grid;
  place-items: center;
}

.flip-page-no {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  color: #77819a;
  font-size: 0.78rem;
}

.flip-page .reader-watermark-layer {
  z-index: 4;
  display: block;
  padding: 0;
  mix-blend-mode: multiply;
  overflow: hidden;
}

.flip-page .reader-watermark-layer span {
  position: absolute;
  left: var(--wm-x, 50%);
  top: var(--wm-y, 50%);
  transform: translate(-50%, -50%) rotate(-20deg);
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(22, 38, 67, 0.14);
  text-shadow: none;
  white-space: pre-line;
  text-align: center;
  line-height: 1.25;
  animation: none;
}

.reader-shell[data-watermark-level="strong"] .flip-page .reader-watermark-layer span {
  color: rgba(22, 38, 67, 0.22);
}

/* Watermark perlu cerah bila theme night (surface gelap) */
.reader-shell[data-reader-theme="night"] .reader-flow-watermark span,
.reader-shell[data-reader-theme="night"] .flipbook-host.is-native-epub > .reader-watermark-layer span,
.reader-shell[data-reader-theme="night"] .reader-epub-page-host.is-native-epub > .reader-watermark-layer span,
.reader-shell[data-reader-theme="night"] .reader-epubjs-area.is-native-epub > .reader-watermark-layer span {
  color: rgba(226, 232, 240, 0.16);
}

.reader-shell[data-reader-theme="night"][data-watermark-level="strong"] .reader-flow-watermark span,
.reader-shell[data-reader-theme="night"][data-watermark-level="strong"] .flipbook-host.is-native-epub > .reader-watermark-layer span,
.reader-shell[data-reader-theme="night"][data-watermark-level="strong"] .reader-epub-page-host.is-native-epub > .reader-watermark-layer span,
.reader-shell[data-reader-theme="night"][data-watermark-level="strong"] .reader-epubjs-area.is-native-epub > .reader-watermark-layer span {
  color: rgba(226, 232, 240, 0.26);
}

.print-block-note {
  display: none;
}

.reader-top {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  overflow: visible;
}

.reader-shell.is-epub-reader .reader-top {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: 64px;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.12);
  overflow: visible;
}

.reader-epub-book-toggle {
  max-width: min(460px, 42vw);
  height: 64px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-right: 1px solid #e5e7eb;
  background: #ffffff;
  color: #0f172a;
  padding: 6px 51px 5px 0;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 #14b8a6;
}

.reader-epub-cover {
  width: 34px;
  height: 48px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
}

.reader-epub-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reader-epub-book-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reader-epub-book-copy strong {
  overflow: hidden;
  color: #111827;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-epub-book-copy small {
  overflow: hidden;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-epub-chevron {
  color: #64748b;
  font-size: 1.45rem;
  line-height: 1;
  justify-self: center;
}

.reader-actions-epub {
  flex: 1 1 auto;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
  padding: 0 10px;
}

.reader-shell.is-epub-reader .reader-toolbar-group-right,
.reader-shell.is-epub-reader .reader-epub-tools {
  width: auto;
  height: 40px;
  flex: 0 0 auto;
  align-self: center;
  justify-content: flex-end;
  overflow: visible;
}

.reader-shell.is-epub-reader .reader-epub-settings,
.reader-epub-settings.is-floating {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  z-index: 3000;
}

.reader-epub-settings.is-floating {
  position: fixed;
}

.reader-top-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.reader-top-cta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.reader-ui-close-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.reader-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex: 1 0 auto;
  flex-wrap: nowrap;
}

.reader-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.reader-toolbar-group-right {
  justify-content: flex-end;
}

.reader-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reader-view-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reader-watermark-wrap {
  display: none;
  align-items: center;
  gap: 6px;
}

.reader-watermark-note {
  font-size: 0.8rem;
  color: #5a6780;
  display: none;
}

.reader-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reader-page-jump label {
  font-size: 0.88rem;
  color: #4a5871;
}

.reader-page-jump input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid #cdd4df;
  border-radius: 8px;
  background: #fff;
}

.reader-zoom-select {
  border: 1px solid #cdd4df;
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

.reader-fit-select {
  border: 1px solid #cdd4df;
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  max-width: 260px;
}

.reader-watermark-select {
  border: 1px solid #cdd4df;
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

.zoom-btn {
  min-width: 34px;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.reader-zoom-state {
  min-width: 44px;
  text-align: center;
  color: #42526f;
  font-size: 0.86rem;
  font-weight: 700;
}

.reader-top .dashboard-note {
  margin: 0;
  font-size: 0.96rem;
}

.reader-meta-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  color: #3f4f68;
  font-size: 0.96rem;
}

.reader-meta-line strong {
  color: #1f2f4b;
  font-size: 1rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-reader {
  position: relative;
  background: linear-gradient(90deg, #d7c4a3 0%, #f8f1e4 10%, #fffdf8 50%, #f8f1e4 90%, #d7c4a3 100%);
  border: 1px solid #dac6a3;
  border-radius: 16px;
  min-height: 520px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  overflow: hidden;
  perspective: 2200px;
}

.reader-shell-full .book-reader {
  min-height: calc(100vh - 330px);
  flex: 1;
}

.book-page {
  position: relative;
  background: #fffefb;
  border-left: 1px solid #eadfca;
  border-right: 1px solid #eadfca;
  min-height: 480px;
  margin: 14px 0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
}

.book-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  transform-style: preserve-3d;
}

.reader-sheet {
  position: relative;
  min-height: 100%;
  border: 1px solid #ece2d0;
  border-radius: 10px;
  padding: 10px 10px 34px;
  background: #fffefb;
  overflow: hidden;
  display: flex;
  backface-visibility: hidden;
}

.book-spread.flip-next #right-sheet {
  animation: flipNext 0.42s ease;
}

.book-spread.flip-next #left-sheet {
  animation: flipDepthNext 0.42s ease;
}

.book-spread.flip-prev #left-sheet {
  animation: flipPrev 0.42s ease;
}

.book-spread.flip-prev #right-sheet {
  animation: flipDepthPrev 0.42s ease;
}

@keyframes flipNext {
  0% { transform: rotateY(0deg) translateZ(0); transform-origin: left center; }
  50% { transform: rotateY(-14deg) translateZ(20px); transform-origin: left center; }
  100% { transform: rotateY(0deg) translateZ(0); transform-origin: left center; }
}

@keyframes flipPrev {
  0% { transform: rotateY(0deg) translateZ(0); transform-origin: right center; }
  50% { transform: rotateY(14deg) translateZ(20px); transform-origin: right center; }
  100% { transform: rotateY(0deg) translateZ(0); transform-origin: right center; }
}

@keyframes flipDepthNext {
  0% { filter: brightness(1); }
  50% { filter: brightness(0.92); }
  100% { filter: brightness(1); }
}

@keyframes flipDepthPrev {
  0% { filter: brightness(1); }
  50% { filter: brightness(0.92); }
  100% { filter: brightness(1); }
}

.reader-sheet.is-empty {
  background: linear-gradient(180deg, #f7f1e5, #f2e8d5);
}

.reader-sheet.is-empty .reader-watermark-layer,
.reader-sheet.is-empty .reader-content,
.reader-sheet.is-empty .reader-page-no {
  opacity: 0;
}

.reader-sheet .reader-watermark-layer {
  padding: 12px;
  grid-template-columns: 1fr;
}

.reader-page-no {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: #4a5975;
  font-size: 0.95rem;
}

.reader-shell-full .book-page {
  margin: 8px 0;
  min-height: calc(100vh - 360px);
}

.page-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 36px;
  height: 56px;
  border: 1px solid #d6e0ec;
  background: rgba(255, 255, 255, 0.92);
  color: #3d4b63;
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.page-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.page-nav.is-locked {
  cursor: not-allowed;
}

.page-nav.is-locked:hover {
  background: rgba(255, 255, 255, 0.92);
}

.page-nav.left {
  left: 10px;
}

.page-nav.right {
  right: 10px;
}

.reader-footer {
  margin-top: 10px;
  text-align: center;
  color: #41516f;
  font-weight: 700;
}

.reader-progress-bar {
  width: min(520px, 92vw);
  margin: 8px auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.reader-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}

.reader-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #991b1b, #dc2626);
  transition: width 0.22s ease;
}

.reader-progress-percent {
  min-width: 42px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.order-list {
  display: grid;
  gap: 12px;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  align-items: start;
}

.cart-item.ecommerce.cart-item-v2 {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 10px;
}

.book-cover.mini {
  width: 72px;
  height: 98px;
  border-radius: 8px;
}

.cart-item.ecommerce.cart-item-v2 .book-cover.mini {
  width: 92px;
  height: 128px;
  border-radius: 8px;
}

.cart-item-copy h3 {
  margin: 0 0 4px;
}

.cart-item-copy p {
  margin: 0;
  color: #0f172a;
  font-weight: 700;
}

.cart-item-copy small {
  color: #64748b;
}

.cart-summary h3 {
  margin-top: 0;
}

.checkout-row.total {
  font-size: 1.08rem;
}

.order-list.ecommerce {
  gap: 10px;
}

.order-card.ecommerce {
  border: 1px solid #e8edf3;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.order-items.ecommerce {
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.order-items.ecommerce li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px dashed #e7edf5;
  padding: 8px 0;
}

.order-total-line {
  margin: 8px 0 0;
}

.order-card {
  border: 1px solid #ebe4d8;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.order-items {
  margin: 8px 0;
  padding-left: 18px;
}

.order-items li {
  margin-bottom: 4px;
}

.seller-table-wrap {
  overflow-x: auto;
}

.seller-table {
  width: 100%;
  border-collapse: collapse;
}

.seller-table th,
.seller-table td {
  border-bottom: 1px solid #ece6da;
  padding: 10px 8px;
  text-align: left;
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d6dce7;
  background: #f3f5f9;
  color: #364562;
  font-size: 0.78rem;
  font-weight: 700;
}

.chip-success {
  background: #e9f9ef;
  border-color: #bde6cb;
  color: #236740;
}

.chip-warn {
  background: #fff8e7;
  border-color: #f1d58f;
  color: #7a5604;
}

.chip-danger {
  background: #ffecef;
  border-color: #f0b6bf;
  color: #8a1f2d;
}

.chip-info {
  background: #e0f4ff;
  border-color: #a6d9f5;
  color: #0c5a8a;
}

/* Status "Menunggu pembayaran" — chip biru lembut (class sendiri utk mudah ubah) */
.chip-awaiting-payment {
  background: #eaf3ff;
  border-color: #bcd8f7;
  color: #21609b;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.88rem;
}

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

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e6dece;
  border-radius: 10px;
  background: #fff;
}

.inline-edit {
  display: grid;
  gap: 6px;
}

.seller-upload-card {
  position: relative;
}

.upload-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(248, 242, 231, 0.92);
  border-radius: 14px;
  display: grid;
  place-items: center;
  padding: 20px;
}

.upload-loading[hidden] {
  display: none !important;
}

.upload-loading-box {
  width: min(520px, 92%);
  border: 1px solid #dfd1b8;
  border-radius: 14px;
  background: #fffdf8;
  padding: 18px;
  text-align: center;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.upload-loading-box h3 {
  margin: 8px 0 6px;
}

.upload-loading-box p {
  margin: 0;
  color: #5b6880;
}

.upload-elapsed {
  margin-top: 8px !important;
  color: #24344f !important;
}

.upload-elapsed strong {
  font-variant-numeric: tabular-nums;
}

.upload-cancel-btn {
  margin-top: 12px;
}

.upload-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 999px;
  border: 4px solid #e7d7b6;
  border-top-color: #d39b2f;
  animation: spin 0.9s linear infinite;
}

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

.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.profile-summary {
  background: linear-gradient(170deg, #2a4674, #1a2f4f);
  border-radius: 12px;
  color: #f6f8ff;
  padding: 16px;
  height: fit-content;
}

.profile-summary-top {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
}

.profile-summary-avatar {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  position: relative;
}

.profile-summary-avatar::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
}

.profile-summary-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 24px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top: 0;
  border-radius: 0 0 14px 14px;
}

.profile-summary h3 {
  margin: 0 0 4px;
}

.profile-summary p {
  margin: 0;
  color: #dbe5f8;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.profile-role-list {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-role-list span {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.profile-forms {
  display: grid;
  gap: 14px;
}

.profile-block {
  background: #fff;
  border: 1px solid #ece6da;
  border-radius: 12px;
  padding: 14px;
}

.profile-block h3 {
  margin: 0 0 6px;
}

.profile-block > p {
  margin: 0 0 12px;
  color: #58637a;
}

.danger-block {
  background: #fff9f8;
  border-color: #f0d8d5;
}

@media (max-width: 900px) {
  .home-top { grid-template-columns: 1fr; gap: 10px; padding: 10px 0; }
  .home-menu { justify-content: flex-start; flex-wrap: wrap; gap: 10px 16px; }
  .home-search { width: 100%; }
  .home-hero { grid-template-columns: 1fr; padding-top: 10px; }
  .hero-visual { height: 120px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: 1fr; }
  .seller-analytics-grid { grid-template-columns: 1fr; }
  .seller-workspace-grid { grid-template-columns: 1fr; }
  .seller-chart-row { grid-template-columns: 52px 1fr 78px; }
  .writer-layout { grid-template-columns: 1fr; }
  .writer-nav {
    position: static;
  }
  .writer-tree {
    max-height: 260px;
  }
  .writer-pages-grid { grid-template-columns: 1fr; }
  .writer-media-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .profile-trigger {
    min-width: 140px;
    padding: 6px 10px;
  }
  .profile-role {
    font-size: 0.88rem;
  }
  .profile-avatar {
    width: 30px;
    height: 30px;
  }
  .book-detail { grid-template-columns: 1fr; }
  .book-cover.large { width: 100%; }
  .checkout-row { flex-direction: column; align-items: flex-start; }
  .reader-top {
    align-items: flex-start;
    flex-direction: column;
    overflow-x: visible;
  }
  .reader-shell.is-epub-reader .reader-top {
    min-height: 58px;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }
  .reader-epub-book-toggle {
    width: calc(100% - 96px);
    flex: 0 0 calc(100% - 96px);
    min-width: 0;
    max-width: calc(100% - 96px);
    height: 58px;
    grid-template-columns: 36px minmax(0, 1fr) 20px;
    padding: 5px 8px 5px 0;
    gap: 6px;
  }
  .reader-epub-cover {
    width: 30px;
    height: 42px;
  }
  .reader-epub-book-copy strong {
    font-size: 0.92rem;
  }
  .reader-epub-book-copy small {
    font-size: 0.76rem;
  }
  .reader-epub-book-copy {
    display: grid;
  }
  .reader-epub-chevron {
    font-size: 1.25rem;
  }
  .reader-actions-epub {
    flex: 0 0 auto;
    width: 96px;
    min-width: 96px;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0 6px 0 0;
  }
  .reader-shell.is-epub-reader .reader-toolbar-group-right,
  .reader-shell.is-epub-reader .reader-epub-tools {
    height: 40px;
  }
  .reader-epub-plus-btn {
    width: 40px;
    height: 40px;
  }
  .reader-epub-back-link {
    width: 40px;
    min-height: 40px;
    margin-left: auto;
    padding: 0;
  }
  .reader-top-head {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .reader-top-cta {
    width: 100%;
    margin-left: 0;
  }
  .reader-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .reader-toolbar-group,
  .reader-view-group {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .reader-epub-tools {
    width: 100%;
  }
  .reader-shell.is-epub-reader .reader-actions-epub {
    width: 96px;
    min-width: 96px;
    flex: 0 0 96px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }
  .reader-shell.is-epub-reader .reader-toolbar-group-right,
  .reader-shell.is-epub-reader .reader-epub-tools {
    width: 40px;
    min-width: 40px;
    flex: 0 0 40px;
    flex-wrap: nowrap;
    justify-content: center;
  }
  .reader-epub-settings {
    left: auto;
    right: 0;
    width: min(260px, 92vw);
  }
  .reader-shell.is-epub-reader .reader-epub-settings {
    top: calc(100% + 8px);
    left: 0;
    right: auto;
  }
  .reader-main-grid,
  .reader-main-grid.has-toc {
    grid-template-columns: 1fr;
  }
  .reader-page-jump input {
    width: 72px;
  }
  .reader-meta-line {
    flex-wrap: wrap;
    gap: 4px 10px;
  }
  .book-reader { grid-template-columns: 34px 1fr 34px; min-height: 420px; }
  .book-page { min-height: 380px; }
  .book-spread { grid-template-columns: 1fr; }
  .reader-sheet#right-sheet {
    display: none;
  }
  .flipbook-wrap {
    min-height: 420px;
  }
  .flipbook-stage {
    min-height: 400px;
  }
  .reader-flow-wrap {
    height: calc(100dvh - 150px);
    min-height: min(620px, calc(100dvh - 150px));
    max-height: calc(100dvh - 150px);
    padding: 10px;
  }
  .reader-shell.is-immersive.reader-ui-hidden .reader-flow-wrap {
    height: calc(100dvh - 20px);
    min-height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
  }
  .reader-flow-page,
  .reader-flow-content.is-native-epub-content,
  .reader-epubjs-area {
    height: 100%;
    min-height: 480px;
  }
  .reader-flow-wrap .reader-flow-page-nav {
    top: auto;
    bottom: 18px;
    width: 42px;
    height: 42px;
    transform: none;
    background: rgba(255, 255, 255, 0.54);
    border-color: rgba(148, 163, 184, 0.42);
    color: rgba(30, 41, 59, 0.78);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(2px);
  }
  .reader-flow-wrap .reader-flow-page-nav.left {
    left: 12px;
  }
  .reader-flow-wrap .reader-flow-page-nav.right {
    right: 12px;
  }
  .section-card.reader-shell.is-immersive.reader-ui-hidden {
    margin-top: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .reader-flow-toc {
    position: fixed;
    inset: 12px;
    top: max(12px, env(safe-area-inset-top));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 90;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0;
  }
  .reader-shell.is-epub-reader .reader-flow-toc {
    inset: auto;
    top: 58px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100dvw;
    max-width: 100dvw;
    height: calc(100dvh - 58px);
    max-height: calc(100dvh - 58px);
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .reader-shell.is-epub-reader .reader-flow-wrap {
    height: calc(100dvh - 58px);
    min-height: calc(100dvh - 58px);
    max-height: calc(100dvh - 58px);
    width: 100%;
    max-width: 100dvw;
    padding: 8px;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .reader-shell.is-epub-reader .reader-flow-page,
  .reader-shell.is-epub-reader .reader-epubjs-area {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    margin-left: auto;
    margin-right: auto;
  }
  .reader-shell.is-epub-reader .reader-main-content,
  .reader-shell.is-epub-reader .reader-main-grid {
    width: 100%;
    max-width: 100dvw;
    min-width: 0;
    overflow-x: hidden;
  }
  #reader-flow-toc-list {
    height: calc(100dvh - 92px);
    max-height: none;
  }
  .reader-shell.is-epub-reader #reader-flow-toc-list {
    height: calc(100dvh - 126px);
    max-height: calc(100dvh - 126px);
  }
  .reader-show-ui-btn {
    top: auto;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 70;
  }
  .reader-shell.is-immersive.reader-ui-hidden .reader-show-ui-btn {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    bottom: auto;
    z-index: 95;
  }
  .reader-shell.is-epub-reader.reader-ui-hidden .reader-show-ui-btn {
    display: grid;
  }
  .reader-flow-content {
    padding: 24px 18px;
  }
  .flipbook-host {
    width: 100%;
    height: 400px;
  }
  .container-fluid { width: min(1120px, 96%); }
  .reader-shell-full { min-height: auto; }
  .reader-shell-full .book-reader { min-height: 420px; }
  .reader-shell-full .book-page { min-height: 360px; }
  .testimonial { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .book-spread.flip-next #left-sheet,
  .book-spread.flip-next #right-sheet,
  .book-spread.flip-prev #left-sheet,
  .book-spread.flip-prev #right-sheet {
    animation: none;
  }
}

@media (max-width: 980px) {
  .auth-ecom-shell {
    grid-template-columns: 1fr;
  }

  .seller-shell {
    grid-template-columns: 1fr;
  }

  .seller-sidebar {
    position: static;
  }

  .auth-ecom-brand {
    min-height: 360px;
    padding: 24px;
  }

  .auth-ecom-card {
    width: 100%;
  }

  .auth-ecom-panel {
    min-height: auto;
    padding: 28px 20px 36px;
  }

  .auth-ecom-brand h1 {
    max-width: 11ch;
    font-size: 2rem;
  }

  .auth-ecom-visual {
    display: block;
    width: min(360px, 78%);
    right: -18px;
  }
}

/* Modern Clean Refresh (Kindle/Apple-inspired) */
:root {
  --nav: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --paper: #f8fafc;
  --card: #ffffff;
  --gold: #2563eb;
  --gold-deep: #1d4ed8;
}

body {
  background: #f8fafc;
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4 {
  font-family: Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  color: #0f172a;
}

.nav-links a, .text-link {
  color: #334155;
}

.nav-links a:hover {
  color: #111827;
}

.profile-trigger {
  background: #ffffff;
  border-color: #e2e8f0;
}

.section-card {
  background: #ffffff;
  border: 1px solid #e8edf3;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.03);
}

.home-header {
  background: #ffffff;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
}

.home-top {
  min-height: 86px;
  grid-template-columns: 260px 1fr 320px;
}

.home-brand {
  color: #0f172a;
}

.home-brand-wrap small {
  color: #64748b;
}

.home-menu a {
  color: #475569;
  border-bottom: 2px solid transparent;
}

.home-menu a.active {
  color: #111827;
  border-color: #111827;
}

.home-search {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.home-search button {
  background: #111827;
  color: #ffffff;
}

.home-hero {
  grid-template-columns: 220px 1fr;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border: 1px solid #e7edf5;
  border-radius: 22px;
  margin: 18px 0 22px;
  padding: 34px;
}

.hero-visual {
  height: 190px;
}

.hero-books {
  width: 160px;
  height: 124px;
  background: linear-gradient(180deg, #1d4ed8, #0f172a);
}

.hero-tablet {
  left: 102px;
  width: 126px;
  height: 160px;
  background: linear-gradient(145deg, #0b1220, #1f2937);
}

.hero-copy h1 {
  color: #0f172a;
}

.hero-copy h1 span {
  color: #2563eb;
}

.hero-copy p {
  color: #475569;
}

.home-shelf {
  display: none;
}

.book-grid {
  gap: 18px;
}

.book-card {
  border-radius: 14px;
  border: 1px solid #e7edf5;
  background: #ffffff;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  border-color: #d8e0ea;
}

.book-cover {
  background: linear-gradient(135deg, #1d4ed8, #0f172a 60%, #0b1220);
}

.book-cover.alt {
  background: linear-gradient(135deg, #0ea5e9, #2563eb 60%, #1e293b);
}

.book-card p {
  color: #111827;
  font-weight: 700;
}

.genre-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.community-cta {
  background: #ffffff;
  color: #0f172a;
  border-top: 1px solid #e2e8f0;
}

.footer-links a {
  color: #475569;
}

.btn.btn-primary {
  background: #0071e3;
  border-color: #0071e3;
  color: #ffffff;
}

.btn.btn-primary:hover {
  background: #0062c3;
}

.btn.btn-outline.dark-outline {
  border-color: #cbd5e1;
  color: #334155;
}

.reader-shell {
  background: #ffffff;
}

.reader-top {
  background: #ffffff;
  border: 1px solid #e7edf5;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

.reader-meta-line strong {
  color: #0f172a;
}

.flipbook-stage {
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  box-shadow: inset 0 1px 0 #ffffff;
}

.page-nav {
  color: #334155;
  background: #ffffff;
  border: 1px solid #d6e0ec;
  border-radius: 999px;
}

.page-nav:hover {
  background: #f1f5f9;
}

.reader-footer {
  color: #475569;
}

/* Ecommerce layout */
.ecom-page {
  background: #f5f5f7;
}

.ecom-header {
  background: #fbfbfd;
  color: #1d1d1f;
  border-bottom: 1px solid #e5e5ea;
  padding: 10px 0 14px;
}

.ecom-topbar {
  display: grid;
  grid-template-columns: 180px 1fr 320px;
  align-items: center;
  gap: 14px;
}

.ecom-logo {
  color: #1d1d1f;
  text-decoration: none;
  font-size: 1.9rem;
  font-weight: 800;
}

.ecom-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.ecom-search input {
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}

.ecom-search button {
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 700;
  background: #0071e3;
  color: #fff;
}

.ecom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.ecom-actions a {
  color: #424245;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.ecom-promo-strip {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ecom-promo-strip span {
  background: #f2f2f7;
  border: 1px solid #e5e5ea;
  color: #515154;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.ecom-hero {
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 18px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.ecom-tag {
  display: inline-block;
  margin: 0 0 6px;
  background: #e8f2ff;
  color: #0066cc;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.ecom-hero h1 {
  margin: 0;
  font-size: 2rem;
}

.ecom-hero p {
  color: #6e6e73;
}

.ecom-banner-card {
  background: linear-gradient(145deg, #f7f7fa, #eef3fb);
  border: 1px solid #dce7f6;
  border-radius: 12px;
  color: #1d1d1f;
  padding: 16px;
}

.ecom-banner-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.ecom-cat-row {
  margin: 16px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.ecom-cat-row a, .ecom-chip-row a {
  flex: 0 0 auto;
  text-decoration: none;
  color: #424245;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
}

.ecom-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.ecom-listing-head {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.market-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 12px;
  align-items: start;
}

.market-sidebar {
  position: sticky;
  top: 82px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.market-filter-form {
  display: grid;
  gap: 18px;
}

.market-sidebar-block {
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.market-sidebar-block:last-of-type {
  border-bottom: 0;
}

.market-sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #151515;
  font-size: 1rem;
  line-height: 1;
  font-weight: 900;
}

.market-sidebar-title span {
  width: 15px;
  color: #374151;
  font-size: 0.96rem;
  line-height: 1;
}

.market-recent-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.market-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-recent-clear {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
}

.market-recent-clear:hover {
  background: #f3f4f6;
}

.review-form {
  display: grid;
  gap: 10px;
  margin: 8px 0 16px;
}

.review-form-row {
  display: grid;
  gap: 6px;
}

.review-form-row label {
  font-size: 0.82rem;
  color: #374151;
  font-weight: 700;
}

.review-form-row select,
.review-form-row textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  padding: 8px 10px;
  font: inherit;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.review-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.review-item p {
  margin: 0 0 6px;
}

.review-item small {
  color: #6b7280;
}

.cart-coupon-form {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.cart-coupon-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.cart-coupon-row input {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

.cart-coupon-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 10px;
  border: 1px dashed #9ca3af;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f9fafb;
}

.market-recent-searches a {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #1f2937;
  text-decoration: none;
  border: 1px solid #d1d5db;
  background: #f8fafc;
}

.market-recent-searches a:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #1e3a8a;
}

.market-category-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.market-filter-actions {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.market-filter-actions .btn.btn-primary {
  background: #ff0000;
  border-color: #ff0000;
}

.market-filter-actions .btn.btn-primary:hover,
.market-filter-actions .btn.btn-primary:focus-visible {
  background: #d10000;
  border-color: #d10000;
}

.market-content {
  display: grid;
  gap: 12px;
  background: #ffffff;
  padding: 16px 18px 20px;
}

.ecom-card-meta {
  margin: 0 0 6px;
  color: #6b7280;
  font-size: 0.82rem;
}

.product-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.product-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.product-badge.new {
  background: #ff0000;
  border-color: #ff0000;
  color: #ffffff;
}

.product-badge.bestseller {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.product-badge.promo {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.product-badge.percuma {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.product-badge.owned {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.ecom-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.ecom-card {
  position: relative;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 14px;
  padding: 10px;
}

.ecom-card h3 {
  margin: 10px 0 4px;
  font-size: 0.95rem;
  line-height: 1.4;
  min-height: 40px;
}

.ecom-price {
  margin: 0 0 8px;
  color: #0071e3;
  font-weight: 800;
}

.wishlist-toggle-form {
  margin: 0;
}

.wishlist-toggle {
  border: 1px solid #d8dee9;
  background: #fff;
  color: #5f6f84;
  border-radius: 999px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-weight: 700;
  cursor: pointer;
}

.wishlist-toggle.active {
  color: #d11a59;
  border-color: #f3b4cb;
  background: #fff2f7;
}

.ecom-card .wishlist-toggle-form {
  position: absolute;
  top: 10px;
  right: 10px;
}

.ecom-price.big {
  font-size: 1.8rem;
}

.ecom-product-detail .ecom-price.big {
  color: #000000;
}

.ecom-product {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}

.ecom-product-media .book-cover.large {
  width: 100%;
  height: 500px;
}

.ecom-product-detail .upload-cover-shell {
  background: #f8fafc;
}

.ecom-product-detail .upload-cover-shell > img {
  object-fit: contain;
  object-position: center top;
}

.ecom-product-thumbs {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: #c7d2e3 transparent;
}

.ecom-product-thumbs > span {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(130deg, #f3f6fb, #e8edf5);
  border: 1px solid #d2dbe8;
}

.ecom-product-thumbs::-webkit-scrollbar {
  height: 6px;
}

.ecom-product-thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.ecom-product-thumbs::-webkit-scrollbar-thumb {
  background: #c7d2e3;
  border-radius: 999px;
}

.ecom-product-info h1 {
  margin: 0 0 4px;
}

.ecom-product-detail {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}

.ecom-product-panel {
  border: 1px solid #e8eaee;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.ecom-rating-line {
  color: #c89b43;
  font-size: 0.9rem;
  font-weight: 700;
}

.ecom-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ecom-rating-line span {
  color: #516075;
}

.ecom-trust-row {
  margin: 8px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ecom-trust-row span {
  border: 1px solid #e1e8f1;
  background: #f8fbff;
  color: #42536d;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.ecom-buy-actions {
  margin-top: 10px;
}

.ecom-info-tabs {
  margin-top: 12px;
}

.ecom-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ecom-info-grid article {
  border: 1px solid #e8eaee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.ecom-info-grid h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.ecom-info-grid p {
  margin: 4px 0;
  color: #5a6578;
}

@media (max-width: 1100px) {
  .ecom-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ecom-topbar {
    grid-template-columns: 160px 1fr;
  }
  .ecom-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .market-layout {
    grid-template-columns: 1fr;
  }
  .market-sidebar {
    position: static;
  }
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .admin-panel-grid {
    grid-template-columns: 1fr;
  }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 860px) {
  .market-layout {
    display: flex;
    flex-direction: column;
  }

  .market-content {
    order: 1;
  }

  .market-sidebar {
    order: 2;
  }

  .ecom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ecom-hero {
    grid-template-columns: 1fr;
  }
  .ecom-product,
  .ecom-product-detail {
    grid-template-columns: 1fr;
  }
  .ecom-product-media .book-cover.large {
    height: 380px;
  }
  .ecom-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Bokifa-inspired home layout */
.bkf-page {
  background: #f6f6f6;
  color: #161616;
  font-family: Helvetica, Arial, sans-serif;
}

.bkf-header {
  background: #fff;
  border-bottom: 1px solid #e7e7e7;
}

.bkf-topline {
  background: #0f5132;
  color: #e8fff2;
  font-size: 0.78rem;
}

.bkf-topline-inner {
  min-height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bkf-topline a {
  color: #e8fff2;
  text-decoration: none;
}

.bkf-mainnav {
  min-height: 72px;
  display: grid;
  grid-template-columns: 170px 1fr 260px;
  align-items: center;
  gap: 12px;
}

.bkf-logo {
  text-decoration: none;
  color: #1b5d3f;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.bkf-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.bkf-search input {
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  padding: 10px 14px;
  background: #fafafa;
}

.bkf-search button {
  border: 0;
  background: #1b5d3f;
  color: #fff;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 700;
}

.bkf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.bkf-actions a {
  text-decoration: none;
  color: #364152;
  font-weight: 600;
  font-size: 0.88rem;
}

.bkf-subnav {
  min-height: 44px;
  border-top: 1px solid #f1f1f1;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
}

.bkf-subnav a {
  text-decoration: none;
  color: #343434;
  font-size: 0.87rem;
  white-space: nowrap;
}

.bkf-main {
  padding-top: 14px;
}

.bkf-hero {
  position: relative;
  background: linear-gradient(120deg, #dce7ef 0 55%, #f3e9c6 55% 100%);
  border-radius: 12px;
  border: 1px solid #dfdfdf;
  min-height: 300px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  padding: 26px;
  overflow: hidden;
}

.bkf-hero-copy p {
  margin: 0 0 6px;
  color: #51606d;
}

.bkf-hero-copy h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 1.05;
  font-family: Helvetica, Arial, sans-serif;
}

.bkf-hero-copy small {
  display: block;
  margin: 10px 0 14px;
  color: #5f6f7a;
}

.bkf-hero-books {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.bkf-book-mock {
  width: 82px;
  height: 126px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
}

.bkf-book-mock:nth-child(2) {
  background: linear-gradient(135deg, #0f766e, #22c55e);
  transform: translateY(-8px);
}

.bkf-book-mock:nth-child(3) {
  background: linear-gradient(135deg, #f97316, #eab308);
  transform: translateY(2px);
}

.bkf-book-mock:nth-child(4) {
  background: linear-gradient(135deg, #ef4444, #ec4899);
}

.bkf-hero-badge {
  position: absolute;
  right: 42%;
  top: 20%;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  text-align: center;
  font-size: 1rem;
  line-height: 1.1;
}

.bkf-icons-row {
  margin: 10px 0 12px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  color: #4f5964;
  font-size: 0.84rem;
}

.bkf-section {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.bkf-product-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.bkf-product-card {
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.bkf-product-card h3 {
  margin: 8px 0 4px;
  font-size: 0.84rem;
  line-height: 1.35;
  min-height: 0;
}

.bkf-product-card p {
  margin: 0;
  color: #126f42;
  font-size: 0.83rem;
  font-weight: 700;
}

.bkf-stats-line {
  margin-top: 4px !important;
  color: #64748b !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
}

.bkf-product-card a {
  margin-top: 6px;
  display: inline-block;
  color: #2c6b4a;
  text-decoration: none;
  font-size: 0.8rem;
}

.bkf-categories {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.bkf-categories a {
  text-decoration: none;
  color: #2f3742;
  background: #f7f7f7;
  border: 1px solid #ececec;
  border-radius: 999px;
  text-align: center;
  padding: 8px 10px;
  font-size: 0.84rem;
}

.bkf-promo-banner {
  margin: 12px 0;
  border-radius: 12px;
  border: 1px solid #263148;
  background: linear-gradient(130deg, #24304a, #1a2438);
  color: #fff;
  padding: 22px;
}

.bkf-promo-banner p {
  margin: 0;
  color: #a9bddf;
}

.bkf-promo-banner h3 {
  margin: 6px 0 14px;
  font-size: clamp(1.4rem, 2.2vw, 2.1rem);
}

.bkf-picks {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.bkf-picks-featured {
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  background: #f7f7f8;
  padding: 14px;
  display: grid;
  grid-template-columns: 44% 1fr;
  gap: 14px;
}

.bkf-picks-featured .book-cover {
  width: 100%;
  min-height: 430px;
  border-radius: 10px;
}

.bkf-picks-featured-copy h3 {
  margin: 6px 0 4px;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1.08;
  font-family: Helvetica, Arial, sans-serif;
}

.bkf-picks-featured-copy small {
  display: block;
  margin-bottom: 10px;
  color: #6c7382;
}

.bkf-picks-featured-copy p {
  margin: 0 0 12px;
  color: #3f4b5d;
  font-size: 0.95rem;
  line-height: 1.65;
}

.bkf-stars {
  color: #ca9f52;
  font-size: 0.88rem;
  font-weight: 700;
}

.bkf-stars span {
  color: #2a3445;
}

.bkf-pick-price-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.bkf-pick-price-line strong {
  color: #0f7b3e;
  font-size: 1.8rem;
  line-height: 1;
}

.bkf-pick-price-line span {
  color: #7d8594;
  text-decoration: line-through;
}

.bkf-picks-grid {
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  background: #f7f7f8;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.bkf-pick-item {
  text-decoration: none;
  color: #1f2937;
  border-bottom: 1px solid #e1e4eb;
  padding: 8px 4px;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
}

.bkf-pick-item .book-cover {
  width: 100%;
  min-height: 112px;
  border-radius: 8px;
}

.bkf-pick-item em {
  display: block;
  font-style: normal;
  color: #ca9f52;
  font-size: 0.78rem;
  font-weight: 700;
}

.bkf-pick-item em b {
  color: #253044;
}

.bkf-pick-item strong {
  display: block;
  margin-top: 2px;
  font-size: 0.94rem;
  line-height: 1.28;
}

.bkf-pick-item small {
  display: block;
  color: #788192;
  margin: 4px 0;
}

.bkf-pick-item u {
  text-decoration: none;
  color: #0f7b3e;
  font-weight: 800;
  font-size: 1.05rem;
}

.bkf-authors {
  display: flex;
  gap: 12px;
  overflow-x: auto;
}

.bkf-authors > div {
  min-width: 74px;
  text-align: center;
}

.bkf-authors > div span {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  margin: 0 auto 6px;
  display: block;
  background: linear-gradient(135deg, #d9d9d9, #bfbfbf);
}

.bkf-authors > div small {
  font-size: 0.76rem;
  color: #596273;
}

.bkf-reviews {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bkf-reviews article {
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fafafa;
  padding: 10px;
}

.bkf-reviews strong {
  color: #1b5d3f;
}

.bkf-reviews p {
  margin: 6px 0;
  font-size: 0.84rem;
  color: #4f5964;
}

.bkf-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bkf-news-grid article {
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 8px;
}

.bkf-news-grid article > div {
  height: 110px;
  border-radius: 8px;
  background: linear-gradient(140deg, #dadfe6, #adb8c7);
}

.bkf-news-grid h3 {
  margin: 8px 0 4px;
  font-size: 0.9rem;
}

.bkf-news-grid p {
  margin: 0;
  color: #5b6777;
  font-size: 0.82rem;
}

.bkf-footer {
  margin-top: 24px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}

.bkf-footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(130px, 1fr));
  gap: 24px;
  padding: 30px 0 22px;
}

.bkf-footer h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #171717;
}

.bkf-footer p {
  margin: 0;
  color: #586273;
  font-size: 0.88rem;
  line-height: 1.55;
}

.bkf-footer a {
  display: block;
  margin: 7px 0;
  text-decoration: none;
  color: #3d4757;
  font-size: 0.88rem;
}

.bkf-footer a:hover {
  color: #ff0000;
}

.bkf-footer-brand p {
  max-width: 360px;
}

.bkf-footer-social {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.bkf-footer-social a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #171717;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bkf-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 22px;
  border-top: 1px solid #eeeeee;
}

.bkf-footer-payments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.bkf-footer-payments span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #4b5563;
  font-size: 0.76rem;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .bkf-mainnav {
    grid-template-columns: 150px 1fr;
  }
  .bkf-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .bkf-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bkf-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bkf-reviews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .bkf-hero {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .bkf-hero-badge {
    right: 18px;
    top: 14px;
    width: 72px;
    height: 72px;
    font-size: 0.9rem;
  }
  .bkf-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bkf-picks {
    grid-template-columns: 1fr;
  }
  .bkf-picks-featured {
    grid-template-columns: 1fr;
  }
  .bkf-picks-featured .book-cover {
    min-height: 280px;
  }
  .bkf-picks-grid {
    grid-template-columns: 1fr;
  }
  .bkf-news-grid {
    grid-template-columns: 1fr;
  }
  .bkf-footer-grid {
    grid-template-columns: 1fr;
  }
  .bkf-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
  .bkf-footer-payments {
    justify-content: flex-start;
  }
}

/* EPUB reader shell cleanup */
.section-card.reader-shell.is-immersive.is-epub-reader {
  background: #f8fafc;
  margin-top: 0;
  padding: 0;
  box-shadow: none;
}

.reader-shell.is-immersive.reader-ui-hidden .reader-progress-bar-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  max-height: 0;
  overflow: hidden;
}

.reader-shell.is-immersive.is-epub-reader .reader-top {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-book-toggle {
  max-width: min(420px, 40vw);
  height: 52px;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  gap: 8px;
  border-right: 1px solid #edf2f7;
  background: transparent;
  padding: 4px 12px;
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-cover {
  width: 24px;
  height: 34px;
  border-radius: 3px;
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy strong {
  font-size: 0.88rem;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy small {
  font-size: 0.72rem;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-chevron {
  font-size: 1rem;
}

.reader-shell.is-immersive.is-epub-reader .reader-actions-epub {
  padding: 0 12px;
}

.reader-shell.is-immersive.is-epub-reader .reader-toolbar-group-right,
.reader-shell.is-immersive.is-epub-reader .reader-epub-tools {
  height: 34px;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-plus-btn,
.reader-shell.is-immersive.is-epub-reader .reader-epub-back-link {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 8px;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-plus-btn {
  font-size: 0.9rem;
}

.reader-shell.is-immersive.is-epub-reader .reader-main-grid {
  min-height: calc(100vh - 94px);
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-wrap {
  height: calc(100dvh - 52px);
  min-height: calc(100dvh - 52px);
  max-height: calc(100dvh - 52px);
  display: flex;
  align-items: stretch;
  padding: 10px 12px 0;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-flow-wrap {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  padding-top: 0;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-page {
  width: min(1132px, 100%);
  height: 100%;
  min-height: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: none;
  overflow-x: hidden;
}

.reader-shell.is-immersive.is-epub-reader .reader-epubjs-area {
  height: 100%;
  min-height: 100%;
  border-radius: 6px;
  overflow-x: hidden;
}

.reader-shell.is-immersive.is-epub-reader .flipbook-stage.is-native-epub-stage {
  background: #f8fafc;
}

.reader-shell.is-immersive.is-epub-reader[data-reader-theme="white"] .reader-flow-wrap,
.reader-shell.is-immersive.is-epub-reader[data-reader-theme="white"] .flipbook-stage.is-native-epub-stage {
  background: #f4f6f8;
}

.reader-shell.is-immersive.is-epub-reader[data-reader-theme="sepia"] .reader-flow-wrap,
.reader-shell.is-immersive.is-epub-reader[data-reader-theme="sepia"] .flipbook-stage.is-native-epub-stage {
  background: #efe5c8;
}

.reader-shell.is-immersive.is-epub-reader[data-reader-theme="night"] .reader-flow-wrap,
.reader-shell.is-immersive.is-epub-reader[data-reader-theme="night"] .flipbook-stage.is-native-epub-stage {
  background: #0f172a;
}

.reader-shell.is-immersive.is-epub-reader .flipbook-host.is-native-epub {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-page-host.is-native-epub {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-footer {
  margin-top: 0;
  padding: 8px 14px 10px;
  border-top: 0;
  background: transparent;
  backdrop-filter: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar {
  width: 100%;
  margin: 0;
  gap: 0;
}

.reader-progress-bar-top {
  position: sticky;
  top: 52px;
  z-index: 81;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top {
  display: block;
}

.reader-shell.is-immersive.reader-ui-hidden.reader-ui-overlay-open .reader-progress-bar-top {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  max-height: none;
  overflow: visible;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top .reader-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 0;
  background: #e5e7eb;
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top .reader-progress-fill {
  border-radius: 0;
  background: #c81e1e;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top .reader-progress-percent {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  min-width: 0;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: right;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-track {
  height: 6px;
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-percent {
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .reader-shell.is-immersive.is-epub-reader .reader-top {
    min-height: 58px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-book-toggle {
    height: 58px;
    width: calc(100% - 92px);
    flex: 0 0 calc(100% - 92px);
    max-width: calc(100% - 92px);
    grid-template-columns: 30px minmax(0, 1fr) 18px;
    gap: 6px;
    padding: 4px 8px 4px 10px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-cover {
    width: 22px;
    height: 30px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy strong {
    font-size: 0.84rem;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy small {
    font-size: 0.68rem;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-actions-epub {
    width: 92px;
    min-width: 92px;
    padding: 0 8px 0 0;
    gap: 6px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-toolbar-group-right,
  .reader-shell.is-immersive.is-epub-reader .reader-epub-tools,
  .reader-shell.is-immersive.is-epub-reader .reader-epub-plus-btn,
  .reader-shell.is-immersive.is-epub-reader .reader-epub-back-link {
    width: 34px;
    min-width: 34px;
    flex: 0 0 34px;
    height: 34px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-flow-wrap {
    height: calc(100dvh - 58px);
    min-height: calc(100dvh - 58px);
    max-height: calc(100dvh - 58px);
    padding: 8px 8px 0;
  }

  .reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-flow-wrap {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    padding-top: 0;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-flow-page,
  .reader-shell.is-immersive.is-epub-reader .reader-epubjs-area {
    min-height: 100%;
    height: 100%;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-footer {
    padding: 8px 12px 10px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top {
    top: 58px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top .reader-progress-percent {
    right: 10px;
    font-size: 0.78rem;
  }
}

/* Bokifa-style v2 override */
.bkf-page .container {
  width: min(var(--site-container), calc(100% - 32px));
}

.bkf-page .bkf-section {
  border-radius: 6px;
  border: 1px solid #ececec;
  padding: 14px 12px;
  background: #fff;
}

.bkf-page .section-head h2 {
  font-size: 2rem;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 500;
}

.bkf-page .bkf-product-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bkf-page .bkf-product-card {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.bkf-page .bkf-product-card .book-cover {
  border-radius: 2px;
  height: 300px;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.16);
}

.bkf-page .bkf-product-card h3 {
  margin-top: 8px;
  min-height: 0;
}

.bkf-page .bkf-product-card p {
  margin-top: 4px;
}

.bkf-page .bkf-product-card a {
  margin-top: 4px;
  color: #111827;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bkf-page .bkf-categories {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bkf-page .bkf-categories a {
  background: #fafafa;
  border: 1px solid #efefef;
  border-radius: 6px;
  text-align: left;
}

.bkf-page .bkf-promo-banner {
  background-image: linear-gradient(120deg, #222b44 30%, #273c6e 100%);
  border: 0;
  border-radius: 8px;
}

.bkf-page .bkf-picks-featured,
.bkf-page .bkf-pick-item,
.bkf-page .bkf-reviews article,
.bkf-page .bkf-news-grid article {
  border-radius: 6px;
}

@media (max-width: 1100px) {
  .bkf-page .bkf-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .bkf-page .section-head h2 {
    font-size: 1.45rem;
  }
  .bkf-page .bkf-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bkf-page .bkf-product-card .book-cover {
    height: 170px;
  }
}

/* Reusable app modal */
.app-modal,
.audit-modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(620px, 94vw);
}

.app-modal::backdrop,
.audit-modal::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(2px);
}

.app-modal-card,
.audit-modal-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #dbe5f1;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  padding: 18px;
}

.app-modal-head,
.audit-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.app-modal-head h3,
.audit-modal-head h3 {
  margin: 0;
}

.app-modal-head p,
.audit-modal-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.94rem;
}

.app-modal-close,
.audit-modal-x {
  border: 1px solid #d6deea;
  background: #ffffff;
  color: #334155;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.app-modal-form,
.audit-modal-form {
  margin-top: 14px;
}

.audit-retention-row input {
  width: 100%;
  border: 1px solid #d6deea;
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  font-weight: 600;
}

.audit-retention-presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-preset-btn {
  border: 1px solid #cfd8e6;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.audit-preset-btn:hover {
  background: #f8fafc;
}

.audit-preset-btn.active {
  border-color: #0071e3;
  background: #eaf2ff;
  color: #0f3f7a;
}

.app-modal-actions,
.audit-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

@media (max-width: 680px) {
  .app-modal-card,
  .audit-modal-card {
    border-radius: 14px;
    padding: 14px;
  }

  .app-modal-actions,
  .audit-modal-actions {
    flex-direction: column-reverse;
  }

  .app-modal-actions .btn,
  .audit-modal-actions .btn {
    width: 100%;
  }
}

/* Header v2 (ecommerce style) */
.topbar.topbar-v2 {
  display: contents;
  background: #fff;
  border-bottom: 1px solid #e6edf5;
}

.topbar-v2 .topbar-utility {
  background: #ff0000;
  color: #fff5f5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.topbar-v2 .utility-row {
  min-height: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar-v2 .utility-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-v2 .utility-links a {
  color: #fff5f5;
  text-decoration: none;
  font-size: 0.84rem;
}

.topbar-v2 .utility-links a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topbar-v2 .topbar-main-row {
  position: relative;
  top: auto;
  z-index: 46;
  background: #fff;
  min-height: 112px;
  display: grid;
  grid-template-columns: 230px minmax(390px, 1fr) auto;
  align-items: center;
  column-gap: 30px;
  row-gap: 12px;
  isolation: isolate;
  padding-top: 14px;
  padding-bottom: 10px;
}

.topbar-v2 .topbar-main-row::before {
  content: "";
  position: absolute;
  inset: 0 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: #fff;
  border-bottom: 1px solid #e6edf5;
  z-index: -1;
}

.topbar-v2 .brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-width: 0;
}

.topbar-v2 .brand img {
  display: block;
  width: auto;
  max-width: 194px;
  max-height: 54px;
  object-fit: contain;
}

.topbar-v2 .topbar-search {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 0;
  align-items: center;
}

.topbar-v2 .topbar-search input {
  width: 100%;
  height: 45px;
  border: 3px solid #9ca0a3;
  border-radius: 999px;
  padding: 0 52px 0 28px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.topbar-v2 .topbar-search input:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.12);
}

.topbar-v2 .topbar-search button {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: #8f9499;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.topbar-v2 .topbar-search button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.topbar-v2 .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  position: relative;
  z-index: 80;
}

.topbar-v2 .notification-menu,
.topbar-v2 .profile-menu {
  position: relative;
  z-index: 90;
}

.topbar-v2 .topbar-action-link {
  text-decoration: none;
  color: #334155;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.topbar-v2 .topbar-action-link:hover {
  background: #f1f5f9;
}

.topbar-v2 .topbar-action-tile {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 50px;
  border: 0;
  background: transparent;
  color: #171717;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
}

.topbar-v2 .profile-trigger.topbar-action-tile {
  align-items: center;
  min-width: 50px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #171717;
}

.topbar-v2 .topbar-action-tile svg {
  width: 29px;
  height: 29px;
  color: #b9bbbf;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-v2 .topbar-action-tile:hover svg,
.topbar-v2 .topbar-action-tile:hover span {
  color: #6b7280;
}

.topbar-v2 .topbar-action-tile span {
  white-space: nowrap;
}

.topbar-v2 .profile-trigger::-webkit-details-marker {
  display: none;
}

.topbar-v2 .profile-trigger::marker {
  content: "";
}

.topbar-v2 .topbar-cart-tile em {
  position: absolute;
  top: -5px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ff0000;
  color: #fff;
  font-size: 0.64rem;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid #fff;
}

.topbar-v2 .topbar-icon-link {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid #d8e1ec;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #334155;
  background: #fff;
}

.topbar-v2 .topbar-icon-link em {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.64rem;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid #fff;
}

.topbar-v2 .keyword-links {
  display: flex;
  gap: 20px 45px;
  flex-wrap: wrap;
}

.topbar-v2 .keyword-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #171717;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
}

.topbar-v2 .keyword-links a:hover {
  color: #0f172a;
}

.topbar-v2 .keyword-links svg {
  width: 28px;
  height: 28px;
  color: #c4c7cb;
  fill: #c4c7cb;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-v2 .topbar-menu-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 30px;
}

.topbar-v2 .topbar-breadcrumb-row {
  position: relative;
  z-index: 2;
  min-height: 48px;
  display: flex;
  align-items: center;
  background: #ffffff;
}

.topbar-v2 .topbar-breadcrumb-row::before {
  content: "";
  position: absolute;
  inset: 0 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: #ffffff;
  border-top: 1px solid #d8d8d8;
  border-bottom: 1px solid #f1f1f1;
  z-index: -1;
}

.topbar-v2 .topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #8b8f95;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar-v2 .topbar-breadcrumbs a,
.topbar-v2 .topbar-breadcrumbs span {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-v2 .topbar-breadcrumbs a:hover {
  color: #5f6368;
}

.topbar-v2 .topbar-breadcrumb-separator {
  color: #b6bbc1;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
}

.topbar-promo-row {
  padding-top: 14px;
  padding-bottom: 12px;
}

.topbar-promo-banner {
  position: relative;
  display: block;
  min-height: 250px;
  overflow: hidden;
  border-radius: 10px;
  color: #1d1d1f;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  background: #ffffff;
}

.topbar-promo-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.06) 100%);
  z-index: 2;
  pointer-events: none;
}

.topbar-promo-slides {
  position: relative;
  display: block;
  width: 100%;
  height: 250px;
}

.topbar-promo-slide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: topbarPromoSlider 15s infinite;
}

.topbar-promo-slide.slide-1 {
  animation-delay: 0s;
}

.topbar-promo-slide.slide-2 {
  animation-delay: 5s;
}

.topbar-promo-slide.slide-3 {
  animation-delay: 10s;
}

.topbar-promo-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 4;
  display: inline-flex;
  gap: 6px;
  transform: translateX(-50%);
}

.topbar-promo-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  animation: topbarPromoDot 15s infinite;
}

.topbar-promo-dots .dot-1 {
  animation-delay: 0s;
}

.topbar-promo-dots .dot-2 {
  animation-delay: 5s;
}

.topbar-promo-dots .dot-3 {
  animation-delay: 10s;
}

@keyframes topbarPromoSlider {
  0%,
  28% {
    opacity: 1;
  }

  33%,
  100% {
    opacity: 0;
  }
}

@keyframes topbarPromoDot {
  0%,
  28% {
    background: #ff0000;
    transform: scale(1.08);
  }

  33%,
  100% {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1);
  }
}

.topbar-genre-row {
  padding-bottom: 18px;
}

.topbar-genre-row p {
  margin: 0 0 9px;
  color: #171717;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0;
}

.topbar-genre-list {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.topbar-genre-list::-webkit-scrollbar {
  display: none;
}

.topbar-genre-list a {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 58px;
  color: #171717;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.topbar-genre-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.topbar-genre-icon img {
  width: 52px;
  height: 52px;
  display: block;
  object-fit: contain;
}

.topbar-genre-list a:hover .topbar-genre-icon {
  transform: translateY(-1px);
}

.topbar-genre-more {
  grid-template-columns: auto auto;
  align-items: center;
  justify-items: start;
  gap: 12px;
  min-width: 110px;
  min-height: 52px;
  color: #85898f;
  font-size: 1rem;
}

.topbar-genre-more span {
  color: #a8adb4;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
}

.topbar-genre-more strong {
  color: #85898f;
  font-size: 1rem;
}

@media (max-width: 1100px) {
  .topbar-v2 .topbar-main-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions" "search search";
    gap: 12px 16px;
    padding: 16px 0;
  }

  .topbar-v2 .brand {
    grid-area: brand;
  }

  .topbar-v2 .topbar-search {
    grid-area: search;
  }

  .topbar-v2 .topbar-actions {
    grid-area: actions;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 16px;
  }

  .topbar-v2 .brand img {
    max-width: 180px;
  }

  .topbar-promo-banner {
    min-height: 220px;
  }

  .topbar-promo-slides {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .topbar-v2 .topbar-main-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand actions" "search search";
    gap: 10px 12px;
    padding: 8px;
  }

  .topbar-v2 .brand {
    grid-area: brand;
  }

  .topbar-v2 .topbar-search {
    grid-area: search;
  }

  .topbar-v2 .topbar-actions {
    grid-area: actions;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 14px;
  }

  .topbar-v2 .topbar-action-tile span {
    display: none;
  }

  .topbar-v2 .topbar-action-tile svg {
    width: 24px;
    height: 24px;
  }

  .topbar-v2 .brand img {
    max-width: 100px;
    max-height: 36px;
  }
}

@media (max-width: 760px) {
  .topbar-v2 .profile-menu {
    position: relative;
    z-index: 1200;
  }

  .topbar-v2 .profile-card {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: auto;
    transform: none;
    width: min(360px, calc(100vw - 24px));
    max-width: min(360px, calc(100vw - 24px));
    z-index: 1200;
  }

  .topbar-v2 .utility-row {
    align-items: flex-start;
    padding: 8px;
  }

  .topbar-v2 .utility-links {
    gap: 8px 12px;
  }

  .topbar-v2 .topbar-menu-row {
    padding: 8px 0;
  }

  .topbar-v2 .topbar-breadcrumb-row {
    min-height: 42px;
    overflow-x: auto;
  }

  .topbar-v2 .topbar-breadcrumbs {
    gap: 10px;
    font-size: 0.82rem;
  }

  .topbar-v2 .keyword-links {
    gap: 14px 18px;
  }

  .topbar-v2 .topbar-search {
    grid-template-columns: 1fr;
  }

  .topbar-v2 .topbar-search input {
    height: 48px;
    padding-left: 20px;
  }

  .topbar-promo-row {
    padding-top: 10px;
  }

  .topbar-promo-banner {
    min-height: 170px;
  }

  .topbar-promo-slides {
    height: 170px;
  }

  .topbar-genre-list {
    gap: 16px;
  }

  .topbar-genre-icon {
    width: 48px;
    height: 48px;
  }
}

@media print {
  .reader-shell > * {
    display: none !important;
  }

  .reader-shell .print-block-note {
    display: block !important;
    padding: 24px;
    background: #fff;
    color: #000;
    font-size: 18px;
    border: 1px solid #000;
  }
}

/* Admin topbar (system management context) */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #0f172a, #1e293b);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-topbar-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-topbar-brand {
  color: #f8fafc;
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.admin-topbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-topbar-links a,
.admin-topbar-links button {
  color: #e2e8f0;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-topbar-links a.active {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.34);
}

.admin-topbar-links a:hover,
.admin-topbar-links button:hover {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28);
}

.admin-topbar-links form {
  margin: 0;
}

.admin-topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  margin-left: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

@media (max-width: 760px) {
  .admin-topbar-row {
    align-items: flex-start;
    padding: 9px 0;
  }

  .admin-topbar-links {
    justify-content: flex-end;
  }
}

/* Seller topbar (operation-focused) */
.seller-topbar {
  position: sticky;
  top: 0;
  z-index: 49;
  background: linear-gradient(90deg, #111827, #1f2937);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.seller-topbar-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seller-topbar-brand {
  color: #f8fafc;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 800;
}

.seller-topbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seller-topbar-links a,
.seller-topbar-links button {
  color: #e5e7eb;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 600;
}

.seller-topbar-links a.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.seller-topbar-links a:hover,
.seller-topbar-links button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.seller-topbar-links form {
  margin: 0;
}

.seller-kpi-strip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.seller-kpi-strip-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seller-kpi-strip-head strong {
  color: #0f172a;
  font-size: 0.95rem;
}

.seller-kpi-range {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seller-kpi-range-pill {
  text-decoration: none;
  color: #334155;
  border: 1px solid #d5deea;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
}

.seller-kpi-range-pill:hover {
  background: #f8fafc;
}

.seller-kpi-range-pill.active {
  color: #0f3f7a;
  border-color: #bcd4f7;
  background: #eaf2ff;
}

.seller-kpi-pill {
  text-decoration: none;
  color: #0f172a;
  border: 1px solid #e3eaf4;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 12px;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
}

.seller-kpi-pill small {
  color: #64748b;
  font-size: 0.78rem;
}

.seller-kpi-pill strong {
  font-size: 1.1rem;
  letter-spacing: 0.2px;
}

.seller-kpi-pill:hover {
  border-color: #cfdbe9;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .seller-topbar-row {
    align-items: flex-start;
    padding: 9px 0;
  }

  .seller-topbar-links {
    justify-content: flex-end;
  }

  .seller-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seller-kpi-strip-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.seller-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.seller-stepper-item {
  border: 1px solid #d8e0ec;
  border-radius: 999px;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  background: #fff;
}

.seller-stepper-item.active {
  border-color: #1d4ed8;
  color: #0f2a4d;
  font-weight: 700;
}

.seller-stepper-item.done {
  border-color: #22c55e;
  color: #166534;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.seller-summary-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
}

.onboard-summary {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 14px;
  margin: 10px 0 16px;
}

.onboard-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.onboard-summary-head h4 {
  margin: 0;
  font-size: 1.08rem;
  color: #0f172a;
}

.onboard-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #dbe4f0;
  color: #334155;
  background: #fff;
}

.summary-badge.ok {
  border-color: #86efac;
  color: #166534;
  background: #f0fdf4;
}

.summary-badge.pending {
  border-color: #fde68a;
  color: #92400e;
  background: #fffbeb;
}

.onboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.onboard-summary-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.onboard-summary-card-full {
  margin-top: 12px;
}

.onboard-summary-card h5 {
  margin: 0 0 10px;
  font-size: 0.94rem;
  color: #0f172a;
}

.summary-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.summary-list div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-top: 1px dashed #e9eef6;
  padding-top: 8px;
}

.summary-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.summary-list dt {
  color: #64748b;
  font-weight: 700;
  font-size: 0.8rem;
  margin: 0;
}

.summary-list dd {
  margin: 0;
  color: #0f172a;
  word-break: break-word;
}

@media (max-width: 900px) {
  .seller-stepper {
    grid-template-columns: 1fr 1fr;
  }
}

.verify-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  margin: 8px 0 4px;
}

.verify-card {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.verify-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #0f172a;
}

.verify-status {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dbe4f0;
}

.verify-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.verify-wide {
  grid-column: 1 / -1;
}

.shop-info-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.shop-info-card {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.shop-info-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #0f172a;
}

.shop-logistic-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.shop-logo-upload {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.shop-logo-preview {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: #eef3f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

.shop-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-logo-help ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #64748b;
  font-size: 0.86rem;
}

.onboard-form-shell {
  max-width: 920px;
  margin: 0 auto 10px;
  padding: 14px 10px 4px;
  border-top: 1px solid #e5eaf2;
  border-bottom: 1px solid #e5eaf2;
}

.onboard-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 0 14px;
}

.onboard-row .field-label {
  margin-top: 9px;
}

.seller-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.seller-type-card {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.seller-type-card input[type="radio"] {
  margin: 0;
}

.seller-type-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.seller-type-card small {
  color: #64748b;
  line-height: 1.35;
  font-size: 0.82rem;
}

.seller-type-card:has(input[type="radio"]:checked) {
  border-color: #3b82f6;
  background: #f7fbff;
  box-shadow: 0 0 0 1px #bfdbfe inset;
}

.seller-type-card.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8fafc;
}

@media (max-width: 960px) {
  .verify-shell {
    grid-template-columns: 1fr;
  }

  .verify-grid {
    grid-template-columns: 1fr;
  }

  .shop-info-layout {
    grid-template-columns: 1fr;
  }

  .shop-logo-upload {
    grid-template-columns: 1fr;
  }

  .shop-logo-preview {
    margin: 0 auto;
  }

  .onboard-form-shell {
    max-width: 100%;
    padding: 0;
    border-top: 0;
    border-bottom: 0;
  }

  .onboard-row {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .onboard-row .field-label {
    margin-top: 0;
  }

  .seller-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onboard-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .onboard-summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .seller-type-grid {
    grid-template-columns: 1fr;
  }
}

.category-tree {
  display: grid;
  gap: 12px;
}

.category-node {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
}

.category-node summary {
  list-style: none;
  cursor: pointer;
}

.category-node summary::-webkit-details-marker {
  display: none;
}

.category-node-head {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-node-head > div {
  display: grid;
  gap: 4px;
}

.category-node-head small {
  color: #64748b;
  font-size: 0.8rem;
}

.category-node-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.category-node-body {
  border-top: 1px solid #e8edf5;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.category-children {
  display: grid;
  gap: 8px;
}

.category-node-child {
  border-color: #e6edf7;
  background: #fbfdff;
}

.category-child-create summary {
  color: #0f3f7a;
  font-weight: 700;
}

.tree-simple {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.tree-simple > li {
  margin: 6px 0;
}

.tree-child {
  margin: 8px 0 2px 20px;
  border-left: 1px dashed #d8e0ec;
  padding-left: 10px;
}

.tree-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 6px 4px;
}

.tree-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #334155;
  transition: transform 0.15s ease;
  transform-origin: center;
  flex: 0 0 auto;
}

.tree-node:not([open]) > .tree-row .tree-caret {
  transform: rotate(-90deg);
}

.tree-row-child {
  padding: 4px 0;
}

.tree-title {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.tree-title-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: text;
}

.tree-inline-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tree-status-select {
  height: 30px;
  border: 1px solid #d5deea;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.8rem;
}

.tree-title small {
  color: #64748b;
  font-size: 0.78rem;
}

.tree-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tree-inline-form {
  display: inline-block;
}

.tree-inline-form > summary {
  list-style: none;
  cursor: pointer;
}

.tree-inline-form > summary::-webkit-details-marker {
  display: none;
}

.tree-inline-form[open] > form {
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.tree-inline-one {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-inline-one input[type="text"] {
  min-width: 240px;
  max-width: 420px;
}

.tree-title-edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.tree-title-edit input[type="text"] {
  width: min(420px, 42vw);
  min-width: 220px;
}

.tree-title-edit[hidden] {
  display: none !important;
}

.tree-title-view[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .tree-title-edit {
    flex-wrap: wrap;
    white-space: normal;
  }

  .tree-title-edit input[type="text"] {
    width: 100%;
    min-width: 0;
  }
}

.tree-edit-parent {
  margin: 2px 0 6px 26px;
}

.tree-add-line {
  margin-top: 6px;
  padding-left: 2px;
}

.tree-add-root {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #d8e0ec;
}

.tree-icon-btn {
  border: 1px solid #d5deea;
  background: #fff;
  color: #0f3f7a;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  line-height: 1;
  font-size: 16px;
  cursor: pointer;
}

.tree-icon-btn:hover {
  background: #f8fafc;
}

.tree-drag-handle {
  border: 0;
  background: transparent;
  width: auto;
  height: auto;
  padding: 0 2px;
  cursor: grab;
  color: #475569;
  font-size: 14px;
  letter-spacing: -1px;
}

.tree-drag-handle:active {
  cursor: grabbing;
}

.tree-simple > li[data-category-id] {
  transition: background-color 0.15s ease;
}

.tree-simple > li.tree-dragging {
  opacity: 0.65;
}

.tree-row.is-editing .chip,
.tree-row.is-editing .js-inline-edit {
  display: none !important;
}

.tree-row.is-editing .js-menu-inline-edit {
  display: none !important;
}

.category-dropdown-search {
  margin-bottom: 8px;
}

.category-picker {
  position: relative;
}

.category-picker-trigger {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d7dbe4;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  cursor: pointer;
  color: #1f2937;
  font-size: 0.98rem;
}

.category-picker-panel {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border: 1px solid #d7dbe4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  padding: 10px;
}

.category-picker-search {
  width: 100%;
  margin-bottom: 8px;
}

.category-picker-options {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.category-picker-group {
  border-top: 1px solid #edf1f7;
  padding-top: 6px;
}

.category-picker-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.category-picker-group-label {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 700;
}

.category-picker-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  color: #0f172a;
}

.category-picker-option:hover {
  background: #f3f6fb;
}

.category-picker-option.is-selected {
  background: #e9f0ff;
  color: #0f3f7a;
  font-weight: 700;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wizard-step-item {
  border: 1px solid #dbe4f1;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fbff;
  color: #52627d;
  cursor: pointer;
}

.wizard-step-item strong {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dbe4f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}

.wizard-step-item span {
  font-size: 0.84rem;
  font-weight: 700;
}

.wizard-step-item.is-active {
  border-color: #1d4ed8;
  background: #eff6ff;
  color: #1e3a8a;
}

.wizard-step-item.is-active strong,
.wizard-step-item.is-done strong {
  background: #1d4ed8;
  color: #fff;
}

.wizard-panel {
  display: none;
  gap: 10px;
}

.wizard-panel.is-active {
  display: grid;
}

.quick-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.seller-alert-strip {
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  margin: 10px 0 12px;
}

.seller-alert-inline {
  margin: 10px 0 12px;
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seller-alert-inline-item {
  min-width: 0;
  color: #0f172a;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.seller-alert-inline-item strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(68vw, 760px);
}

.seller-alert-inline-item small {
  color: #64748b;
  white-space: nowrap;
}

.seller-alert-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.seller-alert-inline-empty {
  color: #64748b;
}

.row-focus-pulse {
  outline: 2px solid #60a5fa;
  background: #eff6ff;
  animation: rowFocusPulse 1.2s ease-in-out 2;
}

@keyframes rowFocusPulse {
  0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
  50% { box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}

.inline-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbe4f1;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #0f172a;
}

.inline-radio-item input {
  margin: 0;
}

.content-mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.content-mode-card {
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  padding: 12px;
  cursor: pointer;
  color: #0f172a;
}

.content-mode-card strong {
  display: block;
  margin-bottom: 4px;
}

.content-mode-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.86rem;
}

.content-mode-card.is-active {
  border-color: #1d4ed8;
  background: #eff6ff;
}

.content-mode-card.is-locked,
.content-mode-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.reader-status-hint {
  border: 1px solid #dbe4f1;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px 12px;
}

.reader-upload-status {
  border: 1px solid #dbe4f1;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.reader-existing-file {
  border: 1px solid #dbe4f1;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.reader-existing-file span {
  color: #334155;
}

.reader-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reader-file-picker {
  border: 1px dashed #94a3b8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

.reader-file-picker:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.reader-file-meta {
  display: grid;
  gap: 2px;
}

.reader-file-meta strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.reader-file-meta span {
  color: #64748b;
  font-size: 0.8rem;
}

.reader-upload-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reader-upload-status-head p {
  margin: 0;
}

.reader-upload-status p {
  margin: 0;
}

.reader-upload-progress {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.reader-upload-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6 0%, #22c55e 100%);
  width: 0;
  transition: width 0.25s ease;
}

.reader-upload-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reader-upload-steps span {
  border: 1px solid #d5deea;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.76rem;
  color: #64748b;
}

.reader-upload-steps span.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.upload-process-row {
  display: flex;
  align-items: center;
  gap: 8px;
}


.reader-status-hint p {
  margin: 0;
}

.review-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pricing-modern-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pricing-modern-card {
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.pricing-modern-card > small {
  color: #64748b;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.price-input-inline {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe4f1;
  border-radius: 10px;
  background: #f8fbff;
  max-width: 260px;
  overflow: hidden;
}

.price-currency {
  padding: 0 12px;
  color: #334155;
  font-weight: 700;
  border-right: 1px solid #dbe4f1;
  background: #eff6ff;
  height: 42px;
  display: inline-flex;
  align-items: center;
}

.price-input-inline input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 170px;
  min-width: 0;
}

.review-card {
  border: 1px solid #dbe4f1;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.review-card small {
  color: #64748b;
}

.publish-preview-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}

.publish-product-card,
.publish-inline-card {
  border: 1px solid #dbe4f1;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.publish-cover-placeholder {
  min-height: 240px;
  border-radius: 12px;
  background: linear-gradient(160deg, #1e3a8a 0%, #0f172a 100%);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.publish-product-meta h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.publish-product-meta p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.publish-meta-tags {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.publish-inline-card h4 {
  margin: 0 0 10px;
}

.publish-inline-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #dbe4f1;
}

.publish-inline-row:last-of-type {
  border-bottom: 0;
}

.publish-inline-row > span {
  color: #475569;
  font-weight: 600;
}

.inline-edit-value {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid #bfdbfe;
  padding: 4px 0;
}

.inline-price-edit input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  width: 120px;
  padding: 0;
}

.inline-watermark-edit select {
  border: 0;
  background: transparent;
  outline: none;
  font-weight: 700;
  color: #0f172a;
  padding: 0;
}

.inline-category-edit .category-picker {
  width: 100%;
}

.inline-category-edit .category-picker-trigger {
  border: 0;
  border-radius: 0;
  background: transparent;
  width: 100%;
  justify-content: space-between;
  padding: 0;
  min-height: auto;
  font-weight: 700;
  color: #0f172a;
}

.inline-category-edit .category-picker-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.publish-inline-row.is-static strong {
  color: #0f172a;
}

.upload-cover-shell {
  position: relative;
  overflow: hidden;
}

.upload-cover-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-cover-shell > img,
.upload-cover-shell > .product-main-video,
.upload-cover-shell > .publish-cover-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.upload-cover-shell > img[hidden],
.upload-cover-shell > .product-main-video[hidden] {
  display: none !important;
}

.product-media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 3;
  cursor: pointer;
}

.product-media-nav.prev {
  left: 10px;
}

.product-media-nav.next {
  right: 10px;
}

.product-media-nav:hover {
  background: rgba(15, 23, 42, 0.78);
}

.cover-edit-btn {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.95);
}

.gallery-edit-btn {
  position: static;
  background: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

.ecom-product-thumbs {
  align-items: center;
  gap: 8px;
}

.media-inline-error {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #b91c1c;
  font-weight: 700;
}

.gallery-thumb {
  appearance: none;
  border: 1px solid #d5deeb;
  background: #f8fbff;
  padding: 0;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-thumb:disabled {
  cursor: default;
  opacity: 0.65;
}

.gallery-thumb.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb.is-video-thumb {
  background: #0f172a;
  border-color: #334155;
}

.gallery-thumb.is-video-thumb img {
  opacity: 0.92;
}

.product-main-video {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  display: block;
  background: #0b1020;
}

.video-thumb-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.video-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 9px;
  letter-spacing: 0.08em;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.9), rgba(15, 23, 42, 0.95));
}

.gallery-thumb img + .video-thumb-fallback {
  display: none;
}

.media-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.gallery-lightbox[hidden] {
  display: none !important;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 980px);
  min-height: 260px;
  max-height: 88vh;
  border-radius: 14px;
  background: #0b1325;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.5);
  display: grid;
  place-items: center;
}

.gallery-lightbox-dialog img {
  width: 100%;
  max-height: calc(88vh - 24px);
  object-fit: contain;
  border-radius: 10px;
}

.gallery-lightbox-dialog video {
  width: 100%;
  max-height: calc(88vh - 24px);
  border-radius: 10px;
  background: #000;
}

.gallery-lightbox-error {
  margin: 14px 0 6px;
  color: #e2e8f0;
  font-weight: 700;
}

.gallery-lightbox-close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.wizard-action-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border: 1px solid #dbe4f1;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wizard-action-bar [hidden] {
  display: none !important;
}

.publish-ready-note {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.small-note {
  font-size: 0.82rem;
}

.required-star {
  color: #dc2626;
  font-weight: 700;
}

@media (max-width: 900px) {
  .library-filter-form {
    grid-template-columns: 1fr;
  }

  .library-sort-shell {
    max-width: none;
  }

  .library-hero-card {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .library-hero-cover-link {
    justify-self: end;
  }

  .library-continue-row {
    grid-auto-columns: minmax(280px, 320px);
  }

  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-mode-cards {
    grid-template-columns: 1fr;
  }

  .pricing-modern-grid {
    grid-template-columns: 1fr;
  }

  .review-card-grid {
    grid-template-columns: 1fr;
  }

  .publish-preview-grid {
    grid-template-columns: 1fr;
  }

  .publish-inline-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .library-hero-cover {
    width: 72px;
    height: 104px;
  }

  .library-continue-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .library-continue-cover {
    height: 116px;
  }

  .library-book-cover {
    height: auto;
  }
}

/* Homepage refresh */
.bkf-page {
  --bkf-red: #dc2626;
  --bkf-red-dark: #991b1b;
  --bkf-red-soft: #fef2f2;
  --bkf-red-border: #fecaca;
}

.bkf-page .topbar-v2 .topbar-utility {
  background: #ff0000;
  color: #fff5f5;
}

.bkf-page .topbar-v2 .utility-links a {
  color: #fff5f5;
}

.bkf-page .btn.btn-primary {
  background: var(--bkf-red);
  border-color: var(--bkf-red);
  color: #fff;
}

.bkf-page .btn.btn-primary:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.bkf-page .bkf-product-card p,
.bkf-page .bkf-product-card a,
.bkf-page .bkf-pick-price-line strong,
.bkf-page .bkf-pick-item u {
  color: var(--bkf-red);
}

.bkf-page .bkf-hero-kicker,
.bkf-page .market-hero-kicker {
  background: rgba(220, 38, 38, 0.1);
  color: var(--bkf-red-dark);
}

.bkf-page .bkf-book-mock:nth-child(2) {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.bkf-hero-v3 {
  gap: 24px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.15), transparent 34%),
    linear-gradient(135deg, #fff7ed 0%, #fff1f2 44%, #f8fafc 100%);
}

.bkf-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: #0f6e64;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.bkf-hero-lead {
  max-width: 58ch;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 16px !important;
}

.bkf-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.bkf-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bkf-hero-stats article {
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(4px);
}

.bkf-hero-stats strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1;
  color: #102231;
}

.bkf-hero-stats span {
  display: block;
  margin-top: 6px;
  color: #607081;
  font-size: 0.83rem;
  font-weight: 600;
}

.bkf-hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(190px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}

.bkf-hero-feature,
.bkf-hero-stack-item {
  text-decoration: none;
  color: inherit;
}

.bkf-hero-feature {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 23, 41, 0.96), rgba(14, 32, 58, 0.9));
  box-shadow: 0 28px 44px rgba(15, 23, 42, 0.18);
}

.bkf-hero-feature .book-cover {
  width: 100%;
  min-height: 430px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.04);
}

.bkf-hero-feature-copy small {
  display: block;
  color: rgba(230, 236, 245, 0.76);
  margin-bottom: 8px;
}

.bkf-hero-feature-copy strong {
  display: block;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1.15;
  margin-bottom: 10px;
  font-family: Helvetica, Arial, sans-serif;
}

.bkf-hero-feature-copy span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff3c4;
  font-weight: 800;
}

.bkf-hero-stack {
  display: grid;
  gap: 14px;
}

.bkf-hero-stack-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bkf-hero-stack-item:hover,
.bkf-hero-feature:hover {
  transform: translateY(-2px);
}

.bkf-hero-stack-item .book-cover {
  min-height: 106px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
}

.bkf-hero-stack-item span {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1b2938;
}

.bkf-icons-row-v2 {
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fafb);
}

.bkf-icons-row-v2 span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f4f7f8;
  border: 1px solid #ebeff2;
  font-weight: 600;
}

.bkf-chip-section {
  background: linear-gradient(180deg, #fffdf8, #ffffff);
}

.bkf-categories-v2 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bkf-categories-v2 a {
  display: grid;
  gap: 6px;
  min-height: 88px;
  align-content: center;
  padding: 16px 14px;
  background: linear-gradient(180deg, #fff, #fbfcfc);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bkf-categories-v2 a:hover {
  transform: translateY(-2px);
  border-color: #dbe5ea;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.06);
}

.bkf-categories-v2 strong {
  font-size: 0.95rem;
}

.bkf-categories-v2 small,
.dashboard-note {
  color: #64748b;
}

.bkf-promo-banner-v2 {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.bkf-promo-banner-v2::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
}

.bkf-store-cta {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  padding: 28px 30px;
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 0, 0, 0.12), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #fff6f6 100%);
  border: 1px solid rgba(255, 0, 0, 0.1);
  border-radius: 8px;
}

.bkf-store-cta-copy h2 {
  margin: 8px 0 0;
  max-width: 640px;
  font-size: clamp(1.45rem, 2vw, 2.25rem);
  line-height: 1.12;
}

.bkf-store-cta-copy p {
  max-width: 620px;
  margin: 10px 0 0;
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.5;
}

.bkf-store-cta-copy strong {
  display: block;
  margin-top: 12px;
  color: #171717;
  font-size: 1.02rem;
  line-height: 1.4;
}

.bkf-store-cta .bkf-hero-actions {
  flex-shrink: 0;
  justify-content: flex-end;
}

.bkf-empty-state,
.bkf-empty-inline,
.bkf-empty-grid {
  display: grid;
  place-items: center;
  text-align: center;
  color: #64748b;
  border: 1px dashed #d7dfe7;
  border-radius: 14px;
  background: #fbfcfd;
}

.bkf-empty-state {
  min-height: 180px;
  padding: 18px;
}

.bkf-empty-state strong,
.bkf-empty-inline strong {
  color: #1f2e3d;
}

.bkf-empty-inline {
  min-height: 88px;
  padding: 16px;
}

.bkf-empty-grid {
  min-height: 240px;
  padding: 16px;
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .bkf-hero-v3 {
    grid-template-columns: 1fr;
  }

  .bkf-hero-stage,
  .bkf-hero-stats,
  .bkf-categories-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bkf-store-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .bkf-hero-v3,
  .bkf-promo-banner-v2,
  .bkf-store-cta {
    padding: 18px;
  }

  .bkf-hero-stage,
  .bkf-hero-stats,
  .bkf-categories-v2,
  .bkf-hero-stack-item {
    grid-template-columns: 1fr;
  }

  .bkf-hero-feature .book-cover {
    min-height: 320px;
  }

  .bkf-hero-stack-item .book-cover {
    min-height: 190px;
  }

  .bkf-icons-row-v2 span {
    width: 100%;
  }
}

/* Compact ebook marketplace home */
.bkf-market-main {
  padding-top: 12px;
}

.bkf-market-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(360px, 1.35fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.bkf-market-hero-copy {
  min-height: 130px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.bkf-market-hero-copy h1 {
  max-width: 13ch;
  margin: 0;
  color: #090909;
  font-size: clamp(1.85rem, 3vw, 3rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.bkf-market-hero-copy .btn {
  width: max-content;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.22);
}

.bkf-market-promo {
  position: relative;
  min-height: 130px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  background:
    linear-gradient(90deg, rgba(20, 18, 28, 0.92), rgba(109, 37, 28, 0.68)),
    linear-gradient(135deg, #1f2937, #f59e0b);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.bkf-market-promo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 74% 48%, rgba(255, 255, 255, 0.24), transparent 16%),
    linear-gradient(90deg, transparent 0 48%, rgba(255, 197, 100, 0.22) 48% 100%);
  pointer-events: none;
}

.bkf-market-promo span,
.bkf-market-promo img {
  position: relative;
  z-index: 1;
}

.bkf-market-promo small {
  display: block;
  color: #fed7aa;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bkf-market-promo strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.95;
  font-family: Helvetica, Arial, sans-serif;
  font-style: italic;
}

.bkf-market-promo em {
  display: block;
  max-width: 42ch;
  margin-top: 6px;
  color: #fff7ed;
  font-style: normal;
  font-weight: 700;
}

.bkf-market-promo img {
  width: 92px;
  height: 112px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
  transform: rotate(4deg);
}

.bkf-market-board {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.bkf-market-categories {
  position: sticky;
  top: 96px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ef2b24, #d51f1a);
  color: #fff;
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.22);
}

.bkf-market-categories h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 900;
}

.bkf-market-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bkf-market-category-grid a {
  min-height: 94px;
  display: grid;
  gap: 5px;
  justify-items: center;
  align-content: center;
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-align: center;
  text-decoration: none;
}

.bkf-market-category-grid a:hover {
  background: rgba(255, 255, 255, 0.22);
}

.bkf-market-category-grid span {
  width: 52px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--bkf-red);
  font-size: 1.45rem;
  font-weight: 900;
}

.bkf-market-category-grid strong {
  font-size: 0.78rem;
  line-height: 1.15;
}

.bkf-market-category-grid small {
  color: #ffe4e6;
  font-size: 0.7rem;
  font-weight: 700;
}

.bkf-market-category-grid p {
  grid-column: 1 / -1;
  margin: 0;
  color: #fff5f5;
  font-weight: 700;
}

.bkf-category-more {
  display: grid;
  place-items: center;
  margin-top: 12px;
  min-height: 30px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.bkf-market-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.bkf-market-section {
  min-width: 0;
}

.bkf-market-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bkf-market-section-head h2 {
  margin: 0;
  color: #111827;
  font-size: 1.18rem;
  line-height: 1;
  font-weight: 900;
}

.bkf-market-section-head a {
  color: var(--bkf-red);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.bkf-market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bkf-market-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 4px;
  color: #111827;
  text-decoration: none;
}

.bkf-market-cover {
  position: relative;
  aspect-ratio: 0.72;
  display: block;
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(135deg, #111827, #64748b);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.bkf-market-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.bkf-market-cover em {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 34px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--bkf-red);
  color: #fff;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 6px 12px rgba(127, 29, 29, 0.28);
}

.bkf-market-card > strong {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.35em;
  color: #111827;
  font-size: 0.79rem;
  line-height: 1.18;
  font-weight: 800;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bkf-market-price {
  color: #111827;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 800;
}

.bkf-market-card small {
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 800;
}

.myjilid-book-shelves {
  padding-top: 22px;
  padding-bottom: 30px;
}

.myjilid-book-shelf {
  position: relative;
  margin-bottom: 36px;
}

.home-resume-dock {
  position: relative;
  margin: 6px 0 30px;
}

.home-resume-dock summary {
  list-style: none;
}

.home-resume-dock summary::-webkit-details-marker {
  display: none;
}

.home-resume-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 14px 14px 0 0;
  background: #c5c7cb;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.home-resume-panel {
  display: none;
  margin-top: 0;
  padding: 24px 20px 20px;
  background: #c5c7cb;
  border-radius: 0 18px 18px 18px;
}

.home-resume-dock[open] .home-resume-panel {
  display: block;
}

.home-resume-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.home-resume-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
}

.home-resume-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
}

.home-resume-row {
  grid-auto-columns: minmax(320px, 380px);
}

.home-resume-item {
  background: #ffffff;
  border-color: #e5e7eb;
}

.myjilid-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.myjilid-shelf-head h2 {
  margin: 0;
  color: #151515;
  font-size: 1rem;
  line-height: 1;
  font-weight: 800;
  text-transform: lowercase;
}

.myjilid-shelf-head a {
  color: #ff0000;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.myjilid-book-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: 36px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 0 2px 6px;
}

.myjilid-book-row::-webkit-scrollbar {
  display: none;
}

.myjilid-book-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 32px 24px;
  padding: 0 2px 6px;
}

.myjilid-book-grid .myjilid-book-card {
  min-width: 0;
}

.myjilid-load-more {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 12px 0;
}

.myjilid-load-more.is-loading::after {
  content: '';
  width: 22px;
  height: 22px;
  border: 3px solid #e5e7eb;
  border-top-color: #ED1C24;
  border-radius: 999px;
  animation: myjilidSpin 0.7s linear infinite;
}

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

@media (max-width: 1100px) {
  .myjilid-book-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 28px 20px;
  }
}

@media (max-width: 900px) {
  .myjilid-book-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 26px 18px;
  }
}

.myjilid-book-card {
  position: relative;
  min-width: 0;
  color: #151515;
}

.myjilid-book-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 0.66;
  overflow: hidden;
  border-radius: 13px;
  background: #e5e7eb;
}

.myjilid-book-cover a:not(.myjilid-heart-link) {
  display: block;
  height: 100%;
}

.myjilid-book-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.myjilid-heart-form,
.myjilid-heart-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
}

.myjilid-heart-form button,
.myjilid-heart-link {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #ff0000;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
}

.myjilid-book-card h3 {
  margin: 10px 0 4px;
  min-height: 1.2em;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 800;
}

.myjilid-book-card h3 a {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.myjilid-book-author,
.myjilid-book-code {
  margin: 0 0 4px;
  color: #777b80;
  font-size: 0.76rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.myjilid-book-code {
  color: #151515;
}

.myjilid-book-rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 10px;
  color: #ff1d25;
  font-size: 0.9rem;
  line-height: 1;
}

.myjilid-book-rating .muted {
  color: #9ca3af;
}

.myjilid-book-rating small {
  display: inline-block;
  flex: 0 0 auto;
  margin-left: 4px;
  color: #151515;
  font-size: 0.72rem;
}

.myjilid-book-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.myjilid-book-buy strong {
  color: #151515;
  font-size: 0.82rem;
  line-height: 1;
  font-weight: 900;
}

.legal-page {
  display: grid;
  gap: 20px;
  padding: 22px 24px 26px;
}

.legal-page-head {
  margin-bottom: 0;
}

.legal-page-body {
  display: grid;
  gap: 18px;
}

.legal-page-section {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.legal-page-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-page-section h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #111827;
}

.legal-page-section h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

.legal-page-section p,
.legal-page-section li {
  color: #4b5563;
  line-height: 1.75;
}

.legal-page-section p,
.legal-page-section ul {
  margin: 0;
}

.legal-page-section ul {
  padding-left: 20px;
}

.legal-page-subsection {
  display: grid;
  gap: 8px;
}

.legal-check-list,
.legal-lock-list {
  list-style: none;
  padding-left: 0 !important;
}

.legal-check-list li,
.legal-lock-list li {
  position: relative;
  padding-left: 28px;
}

.legal-check-list li::before,
.legal-lock-list li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1rem;
}

.legal-check-list li::before {
  content: "✓";
  color: #059669;
}

.legal-lock-list li::before {
  content: "🔒";
}

.legal-contact-card a {
  color: #111827;
  font-weight: 700;
  text-decoration: none;
}

.legal-contact-card a:hover {
  color: #dc2626;
}

.bkf-footer-link-disabled {
  display: inline-block;
  color: rgba(255, 255, 255, 0.45);
  cursor: default;
  pointer-events: none;
}

.app-download-page {
  display: grid;
  gap: 22px;
  padding: 22px 24px 26px;
}

.app-download-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 360px);
  gap: 24px;
  align-items: center;
}

.app-download-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1f2;
  color: #dc2626;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.app-download-hero h2 {
  margin: 12px 0 10px;
  color: #111827;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.app-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.app-download-actions .btn.disabled {
  opacity: 0.7;
  pointer-events: none;
}

.app-download-device {
  display: grid;
  place-items: center;
}

.app-download-phone {
  width: min(260px, 100%);
  padding: 12px;
  border-radius: 28px;
  background: linear-gradient(160deg, #111827, #374151);
  box-shadow: 0 24px 46px rgba(17, 24, 39, 0.16);
}

.app-download-screen {
  min-height: 430px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff, #f3f4f6);
  text-align: center;
  padding: 28px;
}

.app-download-screen img {
  width: 92px;
  height: auto;
}

.app-download-screen strong {
  color: #111827;
  font-size: 1.35rem;
  line-height: 1;
}

.app-download-screen span {
  color: #6b7280;
  font-size: 0.94rem;
  line-height: 1.55;
}

.app-download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.app-download-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
}

.app-download-card h3 {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  font-weight: 800;
}

.app-download-card p,
.app-download-card li {
  color: #4b5563;
  line-height: 1.72;
}

.app-download-card ol,
.app-download-card ul {
  margin: 0;
  padding-left: 18px;
}

.app-download-upload-note code {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 0.86rem;
  word-break: break-all;
}

@media (max-width: 980px) {
  .app-download-hero,
  .app-download-grid {
    grid-template-columns: 1fr;
  }

  .app-download-device {
    order: -1;
  }
}

@media (max-width: 640px) {
  .app-download-page {
    padding: 18px 16px 20px;
  }

  .app-download-screen {
    min-height: 360px;
  }
}

.myjilid-book-buy form {
  margin: 0;
}

.myjilid-book-buy button,
.myjilid-book-buy a {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #bfc3c8;
  padding: 0;
  cursor: pointer;
}

.myjilid-book-buy svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.myjilid-shelf-arrow {
  position: absolute;
  top: 118px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #e3e5e8;
  border-radius: 999px;
  background: #ffffff;
  color: #aeb4bb;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.myjilid-shelf-arrow.left {
  left: -18px;
}

.myjilid-shelf-arrow.right {
  right: -18px;
}

.myjilid-listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 30px 34px;
  align-items: start;
}

.market-results-card .myjilid-book-card {
  max-width: 118px;
}

.market-results-card .myjilid-book-cover {
  box-shadow: none;
}

@media (max-width: 1180px) {
  .bkf-market-board {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .bkf-market-products {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .bkf-market-hero,
  .bkf-market-board {
    grid-template-columns: 1fr;
  }

  .bkf-market-categories {
    position: static;
  }

  .bkf-market-products {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .bkf-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bkf-market-promo {
    grid-template-columns: 1fr;
  }

  .myjilid-book-row {
    grid-auto-columns: 104px;
    gap: 24px;
  }

  .myjilid-book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 16px;
  }

  .myjilid-shelf-arrow {
    display: none;
  }
}

/* Marketplace listing refresh */
.market-hero {
  display: block;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
}

.market-hero[hidden] {
  display: none !important;
}

.market-hero-kicker {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: #0f6e64;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.market-hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.market-hero-copy p {
  margin: 0;
  max-width: 58ch;
  color: #5b6777;
  font-size: 0.98rem;
  line-height: 1.7;
}

.market-hero-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 18px;
}

.market-hero-banner-wrap {
  line-height: 0;
}

.market-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.market-hero-meta span,
.market-quick-chip,
.market-selected-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e3e9ee;
  background: rgba(255, 255, 255, 0.88);
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.market-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.market-quick-chip.active {
  border-color: #bcd4f7;
  background: #eaf2ff;
  color: #0f3f7a;
}

.market-hero-stage {
  display: grid;
}

.market-featured-book,
.market-featured-empty {
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(9, 23, 41, 0.96), rgba(14, 32, 58, 0.9));
  box-shadow: 0 28px 44px rgba(15, 23, 42, 0.18);
}

.market-featured-book .book-cover {
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.04);
}

.market-featured-copy {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.market-featured-copy small {
  color: rgba(230, 236, 245, 0.76);
}

.market-featured-copy strong {
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.15;
}

.market-featured-copy span {
  color: #fff3c4;
  font-size: 1.1rem;
  font-weight: 800;
}

.market-featured-empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: #d9e3ef;
}

.market-featured-empty strong {
  color: #fff;
}

.market-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.market-category-group {
  display: grid;
  gap: 12px;
  padding: 0 0 12px;
  border-top: 0;
}

.market-category-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.market-category-group-title {
  margin: 0 0 2px;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.market-category-group:first-child .market-category-group-title {
  color: #ff0000;
}

.market-category-group:first-child .market-category-group-title::before {
  content: "›";
  margin-right: 6px;
  color: #ff0000;
}

.market-category-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #151515;
  font-size: 0.94rem;
  line-height: 1.25;
  cursor: pointer;
}

.market-category-link input {
  display: none;
}

.market-category-link input:checked + span {
  color: #ff0000;
  font-weight: 800;
}

.market-filter-stack {
  display: grid;
  gap: 16px;
}

.market-filter-stack select,
.market-sidebar-filter input[type="text"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d7dbe0;
  border-radius: 0;
  background: #ffffff;
  color: #151515;
  padding: 0 10px;
}

.market-checkbox-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.market-checkbox-row small {
  color: #64748b;
  font-weight: 700;
}

.market-results-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.market-results-head {
  align-items: end;
}

.market-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.market-grid-refined {
  gap: 20px 16px;
}

.market-book-card {
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.market-book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 36px rgba(15, 23, 42, 0.08);
}

.market-book-card .book-cover {
  height: 310px;
  border-radius: 12px;
  overflow: hidden;
}

.market-book-card .ecom-card-meta {
  min-height: 34px;
}

.market-empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  border: 1px dashed #dbe5ea;
  border-radius: 16px;
  background: #fbfcfd;
  color: #64748b;
}

.market-empty-state strong {
  color: #0f172a;
}

.shop-public-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fff;
}

.shop-public-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.shop-public-logo,
.ecom-seller-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e4ebf2;
  background: #fff;
  color: #0f6e64;
  font-weight: 900;
}

.shop-public-logo {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  font-size: 1.55rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.shop-public-logo img,
.ecom-seller-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-public-head h1 {
  margin: 0 0 3px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.shop-public-head p {
  max-width: 58ch;
  margin: 0;
  color: #5b6777;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.shop-public-head .market-hero-kicker {
  min-height: 0;
  margin-bottom: 5px;
  padding: 4px 9px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.shop-public-head .market-hero-meta {
  gap: 6px;
  margin-top: 8px;
}

.shop-public-head .market-hero-meta span {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.76rem;
}

.shop-public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.shop-public-actions .btn {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.shop-public-layout {
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .market-hero,
  .market-layout {
    grid-template-columns: 1fr;
  }

  .market-filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .market-hero {
    padding: 0;
  }

  .shop-public-head {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-public-identity {
    grid-template-columns: 1fr;
  }

  .shop-public-logo {
    width: 64px;
    height: 64px;
    font-size: 1.35rem;
  }

  .shop-public-actions {
    justify-content: stretch;
  }

  .shop-public-actions .btn {
    flex: 1 1 150px;
  }

  .market-featured-book .book-cover,
  .market-book-card .book-cover {
    min-height: 280px;
    height: 280px;
  }

  .market-hero-meta,
  .market-quick-row,
  .market-selected-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
}

/* Product detail refresh */
.ecom-product-detail-v2 {
  gap: 24px;
}

.ecom-product-panel-v2 {
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.04);
}

.ecom-summary-title {
  margin: 18px 0 2px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.ecom-summary-lead {
  margin: 14px 0 12px;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ecom-summary-lead.is-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: none;
}

.summary-toggle {
  display: block;
  margin: -6px 0 12px;
  padding: 0;
  border: none;
  background: none;
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.summary-toggle:hover {
  text-decoration: underline;
}

.summary-toggle[hidden] {
  display: none;
}

.ecom-seller-shop-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: #fff;
}

.ecom-seller-logo {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  font-size: 1.25rem;
}

.ecom-seller-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ecom-seller-copy strong {
  color: #0f172a;
}

.ecom-seller-copy span {
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 560px) {
  .ecom-seller-shop-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ecom-seller-shop-card .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.detail-meta-grid span {
  margin: 0;
}

.ecom-info-tabs-v2 {
  background: linear-gradient(180deg, #fffdf9, #ffffff);
}

.review-card-grid .dashboard-note {
  grid-column: 1 / -1;
}

.market-book-card .ecom-title-link,
.market-book-card .ecom-price-link {
  text-decoration: none;
}

.market-book-card .ecom-title-link:hover,
.market-book-card .ecom-price-link:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .detail-meta-grid {
    grid-template-columns: 1fr;
  }
}

.market-loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(3px);
}

.market-loading[hidden] {
  display: none !important;
}

.market-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2);
}

.market-loading-card strong {
  font-size: 1rem;
}

.ecom-sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 24px));
  z-index: 70;
}

.ecom-sticky-cta[hidden] {
  display: none !important;
}

.ecom-sticky-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.16);
}

.ecom-sticky-cta-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ecom-sticky-cta-copy strong {
  font-size: 1rem;
  line-height: 1.25;
  color: #0f172a;
}

.ecom-sticky-cta-copy span {
  color: #0071e3;
  font-weight: 800;
  font-size: 1rem;
}

.ecom-sticky-cta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ecom-sticky-cta-actions form {
  margin: 0;
}

@media (max-width: 760px) {
  .ecom-sticky-cta {
    width: calc(100vw - 16px);
    bottom: 10px;
  }

  .ecom-sticky-cta-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .ecom-sticky-cta-actions,
  .ecom-sticky-cta-actions .btn,
  .ecom-sticky-cta-actions form {
    width: 100%;
  }
}

 .floating-cart {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dbe4ef;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
  text-decoration: none;
  color: #0f172a;
  backdrop-filter: blur(10px);
}

.floating-cart:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.16);
}

.floating-cart-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1rem;
}

.floating-cart-copy {
  display: grid;
  gap: 2px;
}

.floating-cart-copy strong {
  font-size: 0.92rem;
  line-height: 1;
}

.floating-cart-copy small {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.floating-cart em {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid #fff;
}

@media (max-width: 760px) {
  .floating-cart {
    top: auto;
    bottom: 16px;
    right: 12px;
    min-height: 52px;
    padding: 0 14px 0 12px;
  }

  .floating-cart-copy strong {
    font-size: 0.86rem;
  }

  .floating-cart-copy small {
    font-size: 0.72rem;
  }
}


.floating-cart-menu {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 65;
}

.floating-cart-menu summary {
  list-style: none;
}

.floating-cart-menu summary::-webkit-details-marker {
  display: none;
}

.floating-cart-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(360px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dbe4ef;
  box-shadow: 0 28px 48px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(10px);
  display: none;
}

.floating-cart-menu[open] .floating-cart-panel {
  display: grid;
  gap: 12px;
}

.floating-cart-head,
.floating-cart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.floating-cart-head a {
  text-decoration: none;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.84rem;
}

.floating-cart-items {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow: auto;
}

.floating-cart-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: #0f172a;
  padding: 8px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #e5edf6;
}

.floating-cart-item-cover {
  width: 54px;
  height: 76px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef2f7;
}

.floating-cart-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-cart-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.floating-cart-item-copy strong {
  font-size: 0.86rem;
  line-height: 1.3;
}

.floating-cart-item-copy small,
.floating-cart-empty,
.floating-cart-foot span {
  color: #64748b;
}

.floating-cart-empty {
  min-height: 80px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed #dbe4ef;
  border-radius: 12px;
  background: #fbfcfd;
}

@media (max-width: 760px) {
  .floating-cart-menu {
    bottom: 16px;
    right: 12px;
  }

  .floating-cart-panel {
    right: 0;
    bottom: 70px;
    width: min(330px, calc(100vw - 16px));
  }
}

.cart-empty-shell {
  display: grid;
  place-items: center;
  min-height: 420px;
}

.cart-empty-card {
  display: grid;
  gap: 12px;
  text-align: center;
  max-width: 420px;
}

.cart-empty-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 2rem;
}

.cart-layout-v2 {
  align-items: start;
}

.cart-items-shell,
.cart-summary-v2,
.checkout-success-summary-card,
.checkout-success-items {
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

.cart-list-v2 {
  display: grid;
  gap: 12px;
}

.cart-item-v2 {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.cart-item-cover {
  text-decoration: none;
  display: block;
  width: 92px;
  min-width: 0;
}

.cart-item-v2 .book-cover.mini {
  width: 92px;
  height: 128px;
  border-radius: 10px;
  overflow: hidden;
}

.cart-item-copy {
  overflow: hidden;
  min-width: 0;
}

.cart-item-copy h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-v2 .cart-item-copy h3 a {
  text-decoration: none;
  color: inherit;
}

.cart-summary-v2 {
  border-radius: 18px;
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.05);
}

.cart-summary-v2 form + a {
  display: block;
  margin-top: 10px;
}

.checkout-success-shell {
  display: grid;
  gap: 18px;
}

.checkout-success-hero {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid #dbe5ef;
  border-radius: 18px;
  background: linear-gradient(135deg, #effaf5, #f8fbff);
}

.checkout-success-icon {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #16a34a;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 900;
}
.checkout-success-icon--paid {
  background: #16a34a;
}
.checkout-success-icon--pending {
  background: #f59e0b;
}
.checkout-success-icon--failed {
  background: #dc2626;
}

.checkout-success-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.checkout-success-kicker--paid {
  background: #dcfce7;
  color: #166534;
}
.checkout-success-kicker--pending {
  background: #fef3c7;
  color: #92400e;
}
.checkout-success-kicker--failed {
  background: #fee2e2;
  color: #991b1b;
}

.checkout-success-hero h1 {
  margin: 0 0 6px;
}

.checkout-success-hero p {
  margin: 0;
  color: #475569;
}

.checkout-success-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.checkout-success-item-list {
  display: grid;
  gap: 12px;
}

.checkout-success-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: #fff;
}

.checkout-success-item-cover {
  width: 82px;
  height: 116px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
}

.checkout-success-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-success-item-copy {
  display: grid;
  gap: 4px;
}

.checkout-success-item-copy small {
  color: #64748b;
}

.checkout-success-item-copy a {
  text-decoration: none;
  color: #1d4ed8;
  font-weight: 700;
}

.checkout-success-summary {
  display: grid;
  gap: 14px;
}

.checkout-success-summary-card {
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  padding: 16px;
}

.checkout-success-summary-card h3 {
  margin: 0 0 10px;
}

.checkout-success-actions {
  display: grid;
  gap: 10px;
}

.floating-cart-item-form {
  margin: 0;
}

.floating-cart-item-remove {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.floating-cart-item-remove:hover {
  background: #f8fafc;
}

button.is-loading,
input.is-loading,
button[disabled].is-loading,
input[disabled].is-loading {
  opacity: 0.72;
  cursor: wait;
}

@media (max-width: 860px) {
  .cart-item-v2,
  .checkout-success-hero,
  .checkout-success-grid {
    grid-template-columns: 1fr;
  }
}

.app-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 1300;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.app-toast {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
  transform: translateY(10px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  font-weight: 900;
  color: #052e16;
  background: #22c55e;
}

.app-toast-info .app-toast-icon {
  background: #38bdf8;
  color: #082f49;
}

.app-toast-error .app-toast-icon {
  background: #fb7185;
  color: #4c0519;
}

.app-toast-text {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
}

.app-toast-action {
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}

.app-toast-action:hover {
  background: rgba(255, 255, 255, 0.16);
}

.orders-shell {
  display: grid;
  gap: 18px;
}

.orders-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.orders-hero h1 {
  margin: 0 0 8px;
}

.orders-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.orders-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.orders-stat-card {
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  display: grid;
  gap: 8px;
}

.orders-stat-card span {
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
}

.orders-stat-card strong {
  font-size: 1.3rem;
  color: #0f172a;
}

.orders-filter-form {
  grid-template-columns: minmax(260px, 1fr) 180px 180px auto auto;
  align-items: center;
}

.orders-filter-form .btn {
  white-space: nowrap;
}

.orders-empty-shell {
  margin-top: 16px;
}

.order-history-grid {
  display: grid;
  gap: 14px;
}

.order-history-card {
  display: grid;
  gap: 16px;
}

.order-history-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.order-history-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.order-history-body {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  align-items: start;
}

.order-history-cover {
  display: block;
  width: 100px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
}

.order-history-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-orders-shell .orders-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.admin-orders-filter-form {
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(140px, 1fr)) auto auto;
}

.admin-order-history-grid {
  margin-top: 24px;
}

.admin-order-card .order-history-summary {
  min-width: 240px;
}

.admin-order-detail-shell {
  display: grid;
  gap: 20px;
}

.admin-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.admin-order-detail-card {
  display: grid;
  gap: 14px;
}

.admin-order-kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e4ebf5;
  padding-bottom: 10px;
}

.admin-order-kv span {
  color: #5d7290;
}

.admin-order-kv strong {
  text-align: right;
  color: #132238;
}

.admin-order-kv-total strong {
  color: #0b67d0;
}

.admin-order-book-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-order-book-cell img {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d7e0ef;
}

.admin-order-book-cell small {
  display: block;
  color: #72839c;
  margin-top: 4px;
}

.admin-moderation-shell {
  display: grid;
  gap: 18px;
}

.admin-moderation-stats {
  margin-top: 20px;
}

.admin-moderation-filter-form {
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(140px, 1fr)) auto auto;
  align-items: center;
}

.admin-moderation-head {
  align-items: end;
}

.admin-moderation-head h3 {
  margin: 0 0 4px;
}

.admin-bulk-bar {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr) auto auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e4ebf5;
  border-radius: 14px;
  background: #f8fbff;
}

.admin-template-row {
  margin: 12px 0 16px;
}

.admin-moderation-list {
  display: grid;
  gap: 14px;
}

.admin-moderation-card {
  display: grid;
  grid-template-columns: auto 112px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid #e5edf6;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

.admin-moderation-check {
  padding-top: 6px;
}

.admin-moderation-cover {
  width: 112px;
  height: 158px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
  color: #64748b;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-moderation-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-moderation-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-moderation-title-row,
.admin-moderation-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
}

.admin-moderation-title-row h3 {
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 1.1rem;
}

.admin-moderation-badges,
.admin-moderation-actions {
  flex-wrap: wrap;
}

.admin-moderation-badges {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-moderation-summary {
  margin: 0;
  color: #475569;
  line-height: 1.55;
  max-width: 92ch;
}

.admin-moderation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-moderation-meta span {
  border: 1px solid #e3eaf4;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 0.82rem;
  padding: 6px 10px;
}

.admin-moderation-meta strong {
  color: #0f172a;
}

.admin-moderation-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #fff;
}

.admin-moderation-note strong {
  font-size: 0.78rem;
  color: #64748b;
  text-transform: uppercase;
}

.admin-moderation-note span {
  color: #334155;
}

.admin-moderation-note small {
  color: #64748b;
}

.admin-moderation-action-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
}

.admin-moderation-action-form input,
.admin-bulk-bar input,
.admin-bulk-bar select,
.admin-moderation-filter-form input,
.admin-moderation-filter-form select {
  min-height: 38px;
}

.admin-moderation-action-form input {
  min-width: 220px;
}

.hero-actions.compact {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-history-cover-empty {
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.order-history-content {
  display: grid;
  gap: 14px;
}

.order-history-items {
  display: grid;
  gap: 10px;
}

.order-history-item-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.order-history-item-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.order-history-item-row a {
  text-decoration: none;
  color: #0f172a;
}

.order-history-item-row small {
  display: block;
  margin-top: 3px;
  color: #64748b;
}

.order-history-summary {
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fbfdff;
}

.order-history-summary .checkout-row {
  margin-top: 10px;
}

.order-history-summary .checkout-row:first-child {
  margin-top: 0;
}

.order-history-summary small {
  color: #64748b;
}

.order-history-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .orders-hero,
  .orders-stat-grid,
  .order-history-body {
    grid-template-columns: 1fr;
  }

  .admin-orders-filter-form {
    grid-template-columns: 1fr;
  }

  .admin-moderation-filter-form,
  .admin-bulk-bar,
  .admin-moderation-card {
    grid-template-columns: 1fr;
  }

  .admin-moderation-cover {
    width: 100%;
    max-width: 150px;
    height: 210px;
  }

  .admin-moderation-title-row,
  .admin-moderation-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-moderation-badges {
    justify-content: flex-start;
  }

  .admin-moderation-action-form input,
  .admin-moderation-action-form .btn {
    width: 100%;
  }

  .orders-filter-form {
    grid-template-columns: 1fr;
  }

  .orders-hero-actions,
  .order-history-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .order-history-badges {
    justify-content: start;
  }

  .order-history-cover {
    width: 100%;
    max-width: 140px;
    height: 190px;
  }

  .app-toast-stack {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
  }

  .app-toast {
    grid-template-columns: 28px 1fr;
  }

  .app-toast-action {
    grid-column: 2;
    justify-self: start;
  }
}

/* ============================================================
   Reader pill chrome � restyle mengikut mobile app (Flutter)
   Paper / Sepia / Night � floating pills � auto-hide
   ============================================================ */
.reader-shell.is-immersive.is-epub-reader {
  --rd-chrome-bg: rgba(245, 235, 221, 0.96);
  --rd-chrome-bg-soft: rgba(245, 235, 221, 0.92);
  --rd-canvas: #eadbc8;
  --rd-page: #fdf8f1;
  --rd-text: #2d241e;
  --rd-muted: #7a6b5c;
  --rd-border: #e2d4c3;
  --rd-accent: #8b5e34;
  --rd-track: #e8ded0;
  --rd-shadow: rgba(45, 36, 30, 0.14);
  --rd-pill-top: 10px;
  --rd-pill-height: 54px;
  --rd-progress-top: 72px;
  background: var(--rd-canvas);
  color: var(--rd-text);
}

.reader-shell.is-immersive.is-epub-reader[data-reader-theme="white"] {
  --rd-chrome-bg: rgba(245, 235, 221, 0.96);
  --rd-chrome-bg-soft: rgba(245, 235, 221, 0.92);
  --rd-canvas: #eadbc8;
  --rd-page: #fdf8f1;
  --rd-text: #2d241e;
  --rd-muted: #7a6b5c;
  --rd-border: #e2d4c3;
  --rd-accent: #8b5e34;
  --rd-track: #e8ded0;
  --rd-shadow: rgba(45, 36, 30, 0.14);
}

.reader-shell.is-immersive.is-epub-reader[data-reader-theme="sepia"] {
  --rd-chrome-bg: rgba(233, 222, 201, 0.96);
  --rd-chrome-bg-soft: rgba(233, 222, 201, 0.92);
  --rd-canvas: #dccdaf;
  --rd-page: #f6eed8;
  --rd-text: #3d3226;
  --rd-muted: #776653;
  --rd-border: #d6c5a7;
  --rd-accent: #8a673a;
  --rd-track: #decfb3;
  --rd-shadow: rgba(61, 50, 38, 0.14);
}

.reader-shell.is-immersive.is-epub-reader[data-reader-theme="night"] {
  --rd-chrome-bg: rgba(18, 18, 18, 0.96);
  --rd-chrome-bg-soft: rgba(18, 18, 18, 0.92);
  --rd-canvas: #1b1b1b;
  --rd-page: #222222;
  --rd-text: #f4e9d8;
  --rd-muted: #c4b6a3;
  --rd-border: #343434;
  --rd-accent: #e0b869;
  --rd-track: #383838;
  --rd-shadow: rgba(0, 0, 0, 0.55);
}

/* ---- Top pill ---- */
.reader-shell.is-immersive.is-epub-reader .reader-top {
  position: sticky;
  top: var(--rd-pill-top);
  z-index: 90;
  min-height: var(--rd-pill-height);
  margin: var(--rd-pill-top) 12px 0;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--rd-border);
  border-radius: 24px;
  background: var(--rd-chrome-bg);
  box-shadow: 0 8px 18px var(--rd-shadow);
  backdrop-filter: blur(10px);
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), margin 0.28s cubic-bezier(0.22, 1, 0.36, 1), max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-book-toggle {
  max-width: min(460px, 46vw);
  height: 46px;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  gap: 10px;
  border-right: 0;
  border-radius: 18px;
  background: transparent;
  padding: 4px 10px;
  color: var(--rd-text);
  box-shadow: none;
  transition: background 0.18s ease;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-book-toggle:hover {
  background: rgba(139, 94, 52, 0.08);
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-cover {
  width: 28px;
  height: 40px;
  border-radius: 4px;
  background: var(--rd-track);
  box-shadow: 0 2px 6px var(--rd-shadow);
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--rd-text);
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy small {
  font-size: 0.72rem;
  color: var(--rd-muted);
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-chevron {
  color: var(--rd-muted);
  font-size: 1rem;
}

.reader-shell.is-immersive.is-epub-reader .reader-actions-epub {
  padding: 0 6px;
  gap: 6px;
}

.reader-shell.is-immersive.is-epub-reader .reader-toolbar-group-right,
.reader-shell.is-immersive.is-epub-reader .reader-epub-tools {
  height: 40px;
  gap: 4px;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-plus-btn,
.reader-shell.is-immersive.is-epub-reader .reader-epub-back-link {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--rd-text);
  font-weight: 800;
  font-size: 0.95rem;
  transition: background 0.18s ease;
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-plus-btn:hover,
.reader-shell.is-immersive.is-epub-reader .reader-epub-back-link:hover {
  background: rgba(139, 94, 52, 0.1);
}

.reader-shell.is-immersive.is-epub-reader .reader-epub-back-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--rd-text);
}

/* ---- Progress bar (pill) ---- */
.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top {
  position: sticky;
  top: var(--rd-progress-top);
  z-index: 81;
  display: block;
  width: auto;
  margin: 8px 28px 0;
  padding: 0;
  background: transparent;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top .reader-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--rd-track);
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top .reader-progress-fill {
  border-radius: 999px;
  background: var(--rd-accent);
  transition: width 0.22s ease;
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top .reader-progress-percent {
  display: none;
}

/* ---- Canvas + page card ---- */
.reader-shell.is-immersive.is-epub-reader .reader-main-grid {
  min-height: 0;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-wrap {
  height: calc(100dvh - 96px);
  min-height: calc(100dvh - 96px);
  max-height: calc(100dvh - 96px);
  display: flex;
  align-items: stretch;
  padding: 10px 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-flow-wrap {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  padding-top: 12px;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-page {
  width: min(1132px, 100%);
  height: 100%;
  min-height: 100%;
  border: 1px solid var(--rd-border);
  border-radius: 24px;
  background: var(--rd-page) !important;
  box-shadow: 0 10px 18px var(--rd-shadow);
  overflow-x: hidden;
}

.reader-shell.is-immersive.is-epub-reader .reader-epubjs-area {
  height: 100%;
  min-height: 100%;
  border-radius: 24px;
  overflow-x: hidden;
}

.reader-shell.is-immersive.is-epub-reader .flipbook-stage.is-native-epub-stage,
.reader-shell.is-immersive.is-epub-reader .flipbook-host.is-native-epub,
.reader-shell.is-immersive.is-epub-reader .reader-epub-page-host.is-native-epub {
  background: transparent;
  border: 0;
  border-radius: 24px;
  box-shadow: none;
}

/* ---- Bottom pill ---- */
.reader-shell.is-immersive.is-epub-reader .reader-footer {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 88;
  width: auto;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--rd-border);
  border-radius: 20px;
  background: var(--rd-chrome-bg-soft);
  box-shadow: 0 8px 18px var(--rd-shadow);
  backdrop-filter: blur(10px);
  color: var(--rd-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.reader-shell.is-immersive.is-epub-reader .reader-footer .reader-footer-chapter {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-shell.is-immersive.is-epub-reader .reader-footer .reader-footer-percent {
  flex: 0 0 auto;
  color: var(--rd-text);
  font-weight: 700;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-footer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

/* ---- Side nav buttons ---- */
.reader-shell.is-immersive.is-epub-reader .page-nav {
  width: 44px;
  height: 44px;
  border: 1px solid var(--rd-border);
  border-radius: 999px;
  background: var(--rd-chrome-bg-soft);
  color: var(--rd-text);
  font-size: 1rem;
  box-shadow: 0 6px 16px var(--rd-shadow);
  backdrop-filter: blur(6px);
  transition: background 0.18s ease, opacity 0.18s ease;
}

.reader-shell.is-immersive.is-epub-reader .page-nav:hover {
  background: var(--rd-chrome-bg);
}

.reader-shell.is-immersive.is-epub-reader .page-nav.left {
  left: 18px;
}

.reader-shell.is-immersive.is-epub-reader .page-nav.right {
  right: 18px;
}

/* ---- Hide transition (match app 280ms slide+fade) ---- */
.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  max-height: 0;
  overflow: hidden;
  box-shadow: none;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-progress-bar-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden.reader-ui-overlay-open .reader-top {
  top: max(10px, env(safe-area-inset-top));
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  max-height: none;
  border-width: 1px;
  margin-top: var(--rd-pill-top);
  padding-top: 4px;
  padding-bottom: 4px;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden.reader-ui-overlay-open .reader-progress-bar-top {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  max-height: none;
  margin-top: 8px;
}

/* ---- Show UI button ---- */
.reader-shell.is-immersive.is-epub-reader .reader-show-ui-btn {
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  bottom: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rd-border);
  border-radius: 999px;
  background: var(--rd-chrome-bg);
  color: var(--rd-text);
  box-shadow: 0 8px 18px var(--rd-shadow);
  backdrop-filter: blur(8px);
  z-index: 95;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-show-ui-btn {
  display: grid;
}

/* ---- Side nav buttons (EPUB, match mobile app: center-left/right, hide with chrome) ---- */
.reader-shell.is-immersive.is-epub-reader .reader-flow-page-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rd-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rd-page) 92%, transparent);
  color: var(--rd-text);
  font-size: 1rem;
  box-shadow: 0 6px 16px var(--rd-shadow);
  backdrop-filter: blur(6px);
  transition: opacity 0.28s ease, transform 0.28s ease, background 0.18s ease;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-page-nav.left {
  left: 12px;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-page-nav.right {
  right: 12px;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-page-nav:hover {
  background: var(--rd-page);
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-page-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-flow-page-nav {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-flow-page-nav.left {
  transform: translateY(-50%) translateX(-120%);
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-flow-page-nav.right {
  transform: translateY(-50%) translateX(120%);
}

.reader-shell.is-immersive.is-epub-reader.reader-ui-hidden.reader-ui-overlay-open .reader-flow-page-nav {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

/* ---- TOC / highlights bottom sheet (match mobile app) ---- */
.reader-shell.is-immersive.is-epub-reader .reader-flow-toc,
.reader-epub-toc-sheet {
  position: fixed;
  left: 50% !important;
  right: auto;
  top: auto !important;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(560px, 100dvw) !important;
  height: auto;
  max-height: min(80dvh, 620px);
  margin: 0;
  padding: 10px 0 calc(8px + env(safe-area-inset-bottom));
  border: 1px solid var(--rd-border) !important;
  border-bottom: 0 !important;
  border-radius: 24px 24px 0 0;
  background: var(--rd-page);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: none;
  overflow: hidden;
  animation: rd-toc-sheet-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rd-toc-sheet-in {
  from {
    transform: translateX(-50%) translateY(28px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.reader-toc-sheet-handle {
  flex-shrink: 0;
  width: 36px;
  height: 4px;
  margin: 4px auto 10px;
  border-radius: 999px;
  background: var(--rd-muted);
  opacity: 0.45;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-toc-head {
  position: relative;
  flex-shrink: 0;
  justify-content: center;
  min-height: 44px;
  padding: 4px 20px 12px;
  border-bottom: 1px solid var(--rd-border);
  color: var(--rd-text);
  text-align: center;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-toc-close {
  position: absolute;
  right: 14px;
  top: 2px;
  border-color: var(--rd-border);
  background: transparent;
  color: var(--rd-text);
}

.reader-shell.is-immersive.is-epub-reader #reader-flow-toc-list {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-toc-item {
  min-height: 50px;
  padding: 12px 20px 12px calc(20px + (var(--toc-depth, 0) * 16px));
  border-bottom-color: var(--rd-border);
  color: var(--rd-text);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-toc-item:hover {
  background: rgba(139, 94, 52, 0.08);
  color: var(--rd-accent);
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-toc-item.is-active {
  background: rgba(139, 94, 52, 0.12);
  color: var(--rd-accent);
  box-shadow: inset 4px 0 0 var(--rd-accent);
}

.reader-shell.is-immersive.is-epub-reader .reader-flow-toc-empty {
  padding: 24px 20px;
  color: var(--rd-muted);
}

@media (min-width: 561px) {
  .reader-shell.is-immersive.is-epub-reader .reader-flow-toc,
  .reader-epub-toc-sheet {
    bottom: 20px;
    border-bottom: 1px solid var(--rd-border) !important;
    border-radius: 24px;
  }
}

/* ---- Settings dropdown ---- */
.reader-shell.is-immersive.is-epub-reader .reader-epub-settings {
  border: 1px solid var(--rd-border);
  border-radius: 16px;
  background: var(--rd-page);
  box-shadow: 0 18px 38px var(--rd-shadow);
}

.reader-shell.is-immersive.is-epub-reader .reader-font-btn,
.reader-shell.is-immersive.is-epub-reader .reader-theme-btn {
  border-color: var(--rd-border);
  background: var(--rd-chrome-bg-soft);
  color: var(--rd-text);
}

.reader-shell.is-immersive.is-epub-reader .reader-theme-btn.is-active {
  border-color: var(--rd-accent);
  color: var(--rd-accent);
  background: rgba(139, 94, 52, 0.1);
}

.reader-shell.is-immersive.is-epub-reader .reader-setting-field {
  color: var(--rd-muted);
}

.reader-shell.is-immersive.is-epub-reader .reader-setting-field select {
  border-color: var(--rd-border);
  background: var(--rd-page);
  color: var(--rd-text);
}

.reader-shell.is-immersive.is-epub-reader .reader-progress-line {
  border-top-color: var(--rd-border);
  color: var(--rd-muted);
}

/* ---- Mobile tweaks ---- */
@media (max-width: 900px) {
  body.immersive-mode {
    background: #fdf8f1;
  }

  body.immersive-mode .reader-shell.is-immersive.is-epub-reader {
    background: #fdf8f1;
  }

  .reader-shell.is-immersive.is-epub-reader {
    --rd-pill-top: 8px;
    --rd-pill-height: 52px;
    --rd-progress-top: 68px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-top {
    margin: var(--rd-pill-top) 8px 0;
    padding: 4px 6px 4px 8px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-book-toggle {
    width: calc(100% - 100px);
    flex: 0 0 calc(100% - 100px);
    max-width: calc(100% - 100px);
    height: 44px;
    grid-template-columns: 26px minmax(0, 1fr) 16px;
    gap: 8px;
    padding: 4px 8px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-cover {
    width: 24px;
    height: 34px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy strong {
    font-size: 0.84rem;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-book-copy small {
    font-size: 0.68rem;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-actions-epub {
    width: 100px;
    min-width: 100px;
    padding: 0 4px 0 0;
    gap: 2px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-toolbar-group-right,
  .reader-shell.is-immersive.is-epub-reader .reader-epub-tools,
  .reader-shell.is-immersive.is-epub-reader .reader-epub-plus-btn,
  .reader-shell.is-immersive.is-epub-reader .reader-epub-back-link {
    width: 36px;
    min-width: 36px;
    flex: 0 0 36px;
    height: 36px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-progress-bar-top {
    margin: 8px 20px 0;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-flow-wrap {
    height: calc(100dvh - 90px);
    min-height: calc(100dvh - 90px);
    max-height: calc(100dvh - 90px);
    padding: 0;
  }

  .reader-shell.is-immersive.is-epub-reader.reader-ui-hidden .reader-flow-wrap {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    padding-top: 0;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-flow-page,
  .reader-shell.is-immersive.is-epub-reader .reader-epubjs-area {
    min-height: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .reader-shell.is-immersive.is-epub-reader .page-nav {
    width: 42px;
    height: 42px;
  }

  .reader-shell.is-immersive.is-epub-reader .page-nav.left {
    left: 12px;
  }

  .reader-shell.is-immersive.is-epub-reader .page-nav.right {
    right: 12px;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-footer {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 9px 14px;
    border-radius: 18px;
    font-size: 0.78rem;
  }

  .reader-shell.is-immersive.is-epub-reader .reader-flow-toc {
    top: calc(var(--rd-pill-top) + var(--rd-pill-height) + 12px);
    height: calc(100dvh - var(--rd-pill-top) - var(--rd-pill-height) - 70px);
  }

  .reader-shell.is-immersive.is-epub-reader .reader-epub-settings {
    width: min(280px, 92vw);
  }
}

/* ============================================================
   EPUB settings � bottom sheet (match mobile app)
   ============================================================ */
.reader-epub-settings.is-floating,
.reader-shell.is-immersive.is-epub-reader .reader-epub-settings {
  position: fixed;
  left: 50% !important;
  right: auto;
  top: auto !important;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 120;
  width: min(560px, 100dvw) !important;
  max-height: min(78dvh, 640px);
  overflow-y: auto;
  margin: 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--rd-border, #e2d4c3);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--rd-page, #fdf8f1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
  animation: rd-sheet-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rd-sheet-in {
  from {
    transform: translateX(-50%) translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.reader-epub-settings-handle {
  width: 36px;
  height: 4px;
  margin: 4px auto 14px;
  border-radius: 999px;
  background: var(--rd-muted, #7a6b5c);
  opacity: 0.45;
}

.reader-epub-settings-title {
  margin: 0 0 18px;
  color: var(--rd-text, #2d241e);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: left;
}

.reader-settings-group {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.reader-settings-label {
  color: var(--rd-muted, #7a6b5c);
  font-size: 0.85rem;
  font-weight: 700;
}

.reader-settings-label strong {
  color: var(--rd-text, #2d241e);
  font-weight: 800;
}

.reader-shell.is-immersive.is-epub-reader .reader-theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.reader-shell.is-immersive.is-epub-reader .reader-theme-btn {
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--rd-border, #e2d4c3);
  border-radius: 12px;
  background: transparent;
  color: var(--rd-text, #2d241e);
  font-size: 0.92rem;
  font-weight: 600;
}

.reader-shell.is-immersive.is-epub-reader .reader-theme-btn.is-active {
  border-color: var(--rd-accent, #8b5e34);
  background: rgba(139, 94, 52, 0.1);
  color: var(--rd-accent, #8b5e34);
  font-weight: 700;
}

.reader-shell.is-immersive.is-epub-reader .reader-theme-btn.is-active::before {
  content: "\2713\00a0";
  font-weight: 800;
}

.reader-shell.is-immersive.is-epub-reader .reader-setting-field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  color: var(--rd-muted, #7a6b5c);
  font-size: 0.85rem;
  font-weight: 700;
}

.reader-shell.is-immersive.is-epub-reader .reader-setting-field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--rd-border, #e2d4c3);
  border-radius: 12px;
  background: var(--rd-page, #fdf8f1);
  color: var(--rd-text, #2d241e);
  font-size: 0.95rem;
  font-weight: 600;
}

.reader-font-size-slider {
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.reader-font-size-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--rd-track, #e8ded0);
}

.reader-font-size-slider::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -9px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--rd-accent, #8b5e34);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.reader-font-size-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--rd-track, #e8ded0);
}

.reader-font-size-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: var(--rd-accent, #8b5e34);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (min-width: 561px) {
  .reader-epub-settings.is-floating,
  .reader-shell.is-immersive.is-epub-reader .reader-epub-settings {
    bottom: 20px;
    border-bottom: 1px solid var(--rd-border, #e2d4c3);
    border-radius: 24px;
  }
}

/* ============================================================
   Reader loading overlay (match mobile app loading card)
   ============================================================ */
.reader-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rd-canvas, #eadbc8);
}

.reader-loading-overlay[hidden] {
  display: none !important;
}

.reader-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--rd-border, #e2d4c3);
  border-radius: 18px;
  background: color-mix(in srgb, var(--rd-page, #fdf8f1) 96%, transparent);
  color: var(--rd-muted, #7a6b5c);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.reader-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--rd-track, #e8ded0);
  border-top-color: var(--rd-accent, #8b5e34);
  border-radius: 999px;
  animation: rd-loading-spin 0.8s linear infinite;
}

.reader-loading-version {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.6;
  letter-spacing: 0.02em;
}

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

/* ==========================================================================
   Admin system settings — layout ala GitHub Desktop "Options"
   (sidebar kategori + panel tunggal + footer Simpan/Batal)
   ========================================================================== */
.settings-modal {
  max-width: 880px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.settings-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #e6e8eb;
  background: #f6f8fa;
}

.settings-modal-head strong {
  font-size: 0.98rem;
}

.settings-close {
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #57606a;
  cursor: pointer;
  padding: 0 4px;
}

.settings-close:hover {
  color: #1f2328;
}

.settings-body {
  display: flex;
  min-height: 440px;
}

.settings-nav {
  width: 212px;
  flex: 0 0 212px;
  padding: 12px 10px;
  border-right: 1px solid #e6e8eb;
  background: #f6f8fa;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #1f2328;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.settings-nav-item svg {
  flex: 0 0 16px;
  opacity: 0.75;
}

.settings-nav-item:hover {
  background: #eaeef2;
}

.settings-nav-item.is-active {
  background: #0969da;
  color: #fff;
}

.settings-nav-item.is-active svg {
  opacity: 1;
}

.settings-panels {
  flex: 1;
  min-width: 0;
  padding: 22px 26px;
}

.settings-panel {
  display: none;
}

.settings-panel.is-active {
  display: block;
}

.settings-panel h4 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
}

.settings-help {
  margin: 6px 0 14px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #57606a;
}

.settings-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.settings-field label {
  min-width: 210px;
  font-size: 0.88rem;
  font-weight: 600;
}

.settings-field input:not([type='checkbox']):not([type='radio']),
.settings-field textarea {
  flex: 1;
  min-width: 160px;
}

.settings-field--stack {
  flex-direction: column;
  align-items: stretch;
}

.settings-field--stack label {
  min-width: 0;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: #0969da;
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid #e6e8eb;
  background: #f6f8fa;
}

@media (max-width: 767px) {
  .settings-body {
    flex-direction: column;
    min-height: 0;
  }

  .settings-nav {
    width: auto;
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid #e6e8eb;
  }

  .settings-nav-item {
    width: auto;
    font-size: 0.82rem;
  }

  .settings-panels {
    padding: 18px 16px;
  }

  .settings-field label {
    min-width: 0;
    width: 100%;
  }
}

/* ==========================================================================
   Admin coupons — form ikut reference layout (label kiri + Syarat Sah + modal edit)
   ========================================================================== */
.req-star {
  color: #d1242f;
}

.coupon-required-note {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: #d1242f;
  font-weight: 600;
}

.coupon-form-card {
  max-width: 880px;
}

.coupon-form-body {
  display: block;
  padding: 22px 26px;
}

.coupon-radio-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.coupon-radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.coupon-radio input[type='radio'] {
  width: 16px;
  height: 16px;
  accent-color: #0969da;
}

.coupon-divider {
  border: 0;
  border-top: 1px solid #e6e8eb;
  margin: 18px 0;
}

.coupon-unit-note {
  font-size: 0.78rem;
  color: #57606a;
}

.coupon-value-preview {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a7f37;
}

.settings-field input.coupon-value-input {
  flex: 0 0 auto;
  width: 110px;
  min-width: 0;
}

.coupon-conditions {
  margin: 12px 0 4px;
  padding: 14px 16px;
  border: 1px solid #e6e8eb;
  border-radius: 8px;
  background: #fafbfc;
}

.coupon-conditions.is-off,
.coupon-window-fields.is-off,
.coupon-usage-input.is-off {
  display: none;
}

.coupon-book-select {
  width: 100%;
  min-height: 170px;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  background: #fff;
  font-size: 0.86rem;
}

/* Pilih Buku: dual-list transfer (Tersedia <-> Dipilih) */
.book-transfer {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.book-transfer.is-off {
  opacity: 0.55;
  pointer-events: none;
}

.book-transfer-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.book-transfer-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  font-size: 0.86rem;
}

.book-transfer-head {
  margin: 8px 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5f697a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.book-transfer-head span {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef1f5;
  color: #1b2536;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0;
}

.book-transfer-list {
  flex: 1;
  min-height: 180px;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  background: #fff;
}

.book-transfer-item {
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 0.86rem;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}

.book-transfer-item:hover {
  background: #f1f4f8;
}

.book-transfer-item.is-selected {
  background: #dbe7ff;
  color: #12306b;
  font-weight: 600;
}

.book-transfer-empty {
  padding: 10px 8px;
  font-size: 0.8rem;
  color: #5f697a;
  text-align: center;
}

.book-transfer-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  align-items: stretch;
}

.book-transfer-btn {
  min-width: 40px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  background: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.book-transfer-btn:hover:not(:disabled) {
  background: #f1f4f8;
  border-color: #b6bec7;
}

.book-transfer-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.book-transfer-btn--wide {
  min-width: 104px;
  font-size: 0.78rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .book-transfer {
    flex-direction: column;
  }

  .book-transfer-actions {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
}

.coupon-usage-input {
  flex: 1;
  min-width: 150px;
}

.coupon-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1050;
  width: min(880px, calc(100vw - 24px));
  max-height: 88vh;
  overflow-y: auto;
  margin: 0;
  background: #fff;
}

.coupon-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1040;
}

@media (max-width: 767px) {
  .coupon-form-body {
    padding: 18px 16px;
  }

  .settings-field input:not([type='checkbox']):not([type='radio']),
  .settings-field textarea {
    min-width: 0;
    width: 100%;
    flex: none;
  }
}

.coupon-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 0 14px;
  border-bottom: 1px solid #e6e8eb;
  margin: 0 0 14px;
}

.coupon-table-head h3 {
  margin: 0;
}

.coupon-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.coupon-history-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
}

.coupon-stat-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  padding: 10px 14px;
  border: 1px solid #e6e8eb;
  border-radius: 8px;
  background: #fafbfc;
}

.coupon-stat-num {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1f2328;
}

.coupon-stat-label {
  font-size: 0.78rem;
  color: #57606a;
}

/* ===== Seller promotions (Shopee/TikTok-style) ===== */
.promo-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.promo-tab {
  border: 1px solid #d8dbe0;
  background: #fff;
  color: #57606a;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.promo-tab.is-active {
  background: #1f2328;
  border-color: #1f2328;
  color: #fff;
}

.promo-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.promo-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 16px;
  border: 1px solid #e6e8eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.promo-type-card:hover {
  border-color: #1f2328;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.promo-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f1f3f5;
  color: #1f2328;
  font-size: 1rem;
}

.promo-type-card strong {
  font-size: 1rem;
  color: #1f2328;
}

.promo-type-card small {
  color: #57606a;
  font-size: 0.8rem;
  line-height: 1.4;
  min-height: 2.2em;
}

.promo-type-audience {
  font-size: 0.75rem;
  color: #0969da;
  background: #ddf4ff;
  border-radius: 999px;
  padding: 3px 10px;
}

.promo-type-cta {
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1f2328;
}

/* ===== Kupon Saya (wallet) ===== */
.voucher-claim-form {
  margin: 0 0 22px;
  max-width: 520px;
}

.voucher-claim-form .cart-coupon-row input {
  flex: 1;
}

.voucher-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #d8dee4;
  margin-bottom: 18px;
}

.voucher-tabs .nav-link {
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #57606a;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.voucher-tabs .nav-link.active {
  color: #1f2328;
  border-bottom-color: #cf222e;
}

.voucher-tab-count {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: #eaeef2;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
  margin-left: 4px;
  color: #57606a;
}

.voucher-list {
  display: grid;
  gap: 12px;
}

.voucher-card {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid #d8dee4;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

.voucher-card-muted {
  opacity: 0.68;
}

.voucher-card-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ddf4ff;
  color: #0969da;
  font-weight: 800;
  font-size: 0.85rem;
}

.voucher-card-body {
  flex: 1;
  min-width: 0;
}

.voucher-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voucher-card-top strong {
  font-size: 0.98rem;
  color: #1f2328;
}

.voucher-badge {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.voucher-badge-aktif {
  background: #dafbe1;
  color: #1a7f37;
}

.voucher-badge-digunakan {
  background: #eaeef2;
  color: #57606a;
}

.voucher-badge-tamat {
  background: #ffebe9;
  color: #cf222e;
}

.voucher-discount {
  font-size: 1.1rem;
  font-weight: 800;
  color: #cf222e;
  margin-top: 3px;
}

.voucher-meta {
  font-size: 0.8rem;
  color: #57606a;
  margin: 4px 0 8px;
}

.voucher-code-row code {
  display: inline-block;
  background: #f6f8fa;
  border: 1px dashed #d0d7de;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.85rem;
  color: #1f2328;
}

.voucher-card-action {
  flex: 0 0 auto;
}

.voucher-empty strong {
  display: block;
  font-size: 1rem;
  color: #1f2328;
  margin-bottom: 6px;
}

.voucher-empty p {
  color: #57606a;
  font-size: 0.88rem;
}

/* ===== Strip kutip kupon (product page / shop page) ===== */
.claimable-voucher-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #d0d7de;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.claimable-voucher-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.claimable-voucher-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f6f8fa;
  border: 1px solid #d8dee4;
  border-radius: 12px;
  padding: 8px 12px;
}

.claimable-voucher-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.claimable-voucher-copy strong {
  font-size: 0.9rem;
  color: #1f2328;
}

.claimable-voucher-copy span {
  font-size: 0.78rem;
  color: #57606a;
}

/* ===== Pemilih kupon dalam cart ===== */
.cart-voucher-picker {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-voucher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cart-voucher-chip {
  border: 1px solid #d0d7de;
  border-radius: 10px;
  overflow: hidden;
  background: #f6f8fa;
}

.cart-voucher-chip button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.cart-voucher-chip button strong {
  font-size: 0.85rem;
  color: #1f2328;
}

.cart-voucher-chip button span {
  font-size: 0.75rem;
  color: #57606a;
}

.cart-voucher-chip:hover {
  border-color: #0969da;
}

.cart-pay-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.cart-pay-method {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #f6f8fa;
  cursor: pointer;
}

.cart-pay-method:has(input:checked) {
  border-color: #0969da;
  background: #ddf4ff;
}

.cart-pay-method input {
  margin-top: 3px;
}

.cart-pay-method strong {
  display: block;
  font-size: 0.9rem;
  color: #1f2328;
}

.cart-pay-method small {
  display: block;
  font-size: 0.75rem;
  color: #57606a;
}

.cart-pay-method-note {
  font-size: 0.8rem;
  color: #57606a;
  margin-bottom: 12px;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 350;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 0 9px rgba(0, 0, 0, 0.12);
  }

  body.has-bottom-nav {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-bottom-nav .mbn-item {
    flex: 1 0 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding-top: 4px;
    text-decoration: none;
    color: #6b7280;
  }

  .mobile-bottom-nav .mbn-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 32px;
    border-radius: 16px;
  }

  .mobile-bottom-nav .mbn-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: none;
  }

  .mobile-bottom-nav .mbn-label {
    max-width: 100%;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-bottom-nav .mbn-item.is-active {
    color: #0f172a;
  }

  .mobile-bottom-nav .mbn-item.is-active .mbn-icon {
    background: #d7e8fa;
  }

  .mobile-bottom-nav .mbn-badge {
    position: absolute;
    top: -4px;
    right: 2px;
    min-width: 16px;
    padding: 1px 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
  }
}

/* Market filter drawer (mobile, ala WoodMart wd-sidebar) */
.market-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

.market-filter-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.market-sidebar-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.market-sidebar-head strong {
  font-size: 15px;
  color: #0f172a;
}

.market-sidebar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
  cursor: pointer;
}

.market-sidebar-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.market-filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgba(15, 23, 42, 0.45);
}

.market-filter-backdrop[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .market-filter-toggle {
    display: flex;
  }

  .market-sidebar-head {
    display: flex;
  }

  .market-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 400;
    width: min(320px, 88vw);
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  .market-sidebar.is-open {
    transform: translateX(0);
  }

  body.market-filter-open {
    overflow: hidden;
  }
}

/* Clear (X) button on market search input */
.market-search-wrap {
  position: relative;
}

.market-search-wrap input {
  width: 100%;
  padding-right: 38px;
}

.market-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #e5e7eb;
  color: #0f172a;
  cursor: pointer;
}

.market-search-clear[hidden] {
  display: none;
}

.market-search-clear svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Clear (X) button on topbar search. X di-anchor ikut form (bukan wrap)
   sbb <=760px grid jadi 1fr - wrap jadi penuh, X jatuh atas ikon search. */
.topbar-v2 .topbar-search .topbar-search-wrap input {
  padding-right: 80px;
}

.topbar-v2 .topbar-search button.topbar-search-clear[hidden] {
  display: none;
}

.topbar-v2 .topbar-search button.topbar-search-clear {
  position: absolute;
  right: 46px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #e5e7eb;
  color: #4b5563;
  cursor: pointer;
  z-index: 2;
}

.topbar-v2 .topbar-search button.topbar-search-clear svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}


.payment-qr-shell {
  max-width: 520px;
  margin: 0 auto;
}

.payment-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.payment-qr-brand {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.qr-status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

.qr-status-pill--wait {
  background: #fef3c7;
  color: #92400e;
}

.qr-status-pill--ok {
  background: #dcfce7;
  color: #166534;
}

.qr-status-pill--fail {
  background: #fee2e2;
  color: #991b1b;
}

.payment-qr-amount {
  text-align: center;
  margin-bottom: 16px;
}

.payment-qr-amount strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  color: #0f172a;
}

.payment-qr-amount small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.84rem;
}

.payment-qr-canvas {
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 18px;
  background: #f8fafc;
}

.payment-qr-canvas img {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  background: #fff;
}

.payment-qr-countdown {
  margin: 12px 0 10px;
  font-size: 0.86rem;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.payment-qr-countdown span {
  font-weight: 800;
  color: #0f172a;
}

.payment-qr-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.payment-qr-error p {
  margin: 0 0 12px;
  color: #991b1b;
  font-size: 0.9rem;
}

.payment-qr-steps {
  margin: 18px 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 0.9rem;
}

.payment-qr-steps strong {
  color: #0f172a;
}

.payment-qr-actions {
  display: grid;
  gap: 10px;
}
