:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-soft: #e8edf5;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --text: #182033;
  --muted: #667085;
  --line: rgba(24, 32, 51, 0.12);
  --accent: #ff8b2b;
  --accent-2: #2563eb;
  --danger: #d14d32;
  --nav: #111827;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
}

/* Desktop comic portal inspired by classic Vietnamese manga sites.
   Mobile keeps the app-like layout below. */
.desktop-comic-portal {
  display: none;
}

@media (min-width: 721px) {
  body:has(.desktop-comic-portal) {
    background:
      radial-gradient(circle at 18% 0%, rgba(255, 139, 43, 0.18), transparent 30%),
      linear-gradient(180deg, #050a14 0%, #0f172a 34%, #f3f6fb 34%);
  }

  .app-home-shell {
    max-width: 1530px;
    padding-inline: 18px;
  }

  .app-home-shell > .app-home-hero,
  .app-home-shell > .app-quick-actions {
    display: none;
  }

  .desktop-comic-portal {
    display: grid;
    gap: 16px;
    margin: -6px 0 26px;
    color: #f8fafc;
  }

  .desktop-portal-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  .desktop-portal-heading .eyebrow {
    margin: 0 0 6px;
    color: #fb923c;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .desktop-portal-heading h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(26px, 2.5vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.035em;
    text-transform: uppercase;
  }

  .desktop-portal-search {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    min-height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 16px;
    background: rgba(7, 10, 20, 0.9);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  }

  .desktop-portal-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
  }

  .desktop-portal-search input::placeholder {
    color: #94a3b8;
  }

  .desktop-portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 18px;
    align-items: start;
  }

  .desktop-portal-main {
    display: grid;
    gap: 0;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    background: #111827;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  }

  .desktop-feature {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px 250px;
    gap: 28px;
    min-height: 395px;
    padding: 38px 36px 70px;
    background:
      radial-gradient(circle at 43% 26%, rgba(255, 139, 43, 0.24), transparent 28%),
      linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.82)),
      #111827;
  }

  .desktop-feature-copy {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 22px;
    color: #ffffff;
    text-decoration: none;
  }

  .feature-star {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 69% 56%, 80% 92%, 50% 70%, 20% 92%, 31% 56%, 2% 35%, 38% 34%);
    background: #fde047;
    color: #111827;
    font-weight: 900;
  }

  .desktop-feature-copy h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    max-width: 18ch;
    color: #ffffff;
    font-size: clamp(24px, 2.2vw, 32px);
    line-height: 1.13;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .desktop-feature-copy p {
    max-width: 54ch;
    margin: 10px 0 0;
    color: #d1d5db;
    font-size: 15px;
    line-height: 1.62;
  }

  .desktop-feature-copy strong {
    display: block;
    margin-top: 16px;
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 0.03em;
  }

  .desktop-feature-copy small,
  .feature-tags {
    color: #fef3c7 !important;
    font-weight: 800;
  }

  .desktop-feature-cover {
    display: grid;
    overflow: hidden;
    width: 190px;
    height: 250px;
    place-items: center;
    align-self: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    text-decoration: none;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  }

  .desktop-feature-cover img,
  .desktop-week-card img,
  .rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .desktop-week-card {
    position: relative;
    display: grid;
    overflow: hidden;
    min-height: 260px;
    align-content: end;
    padding: 22px;
    color: #ffffff;
    text-decoration: none;
    isolation: isolate;
  }

  .desktop-week-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(6, 8, 16, 0.2), rgba(6, 8, 16, 0.92));
  }

  .desktop-week-card img {
    position: absolute;
    inset: 0;
    z-index: -2;
    filter: saturate(0.9);
  }

  .desktop-week-card .crown {
    position: absolute;
    top: 16px;
    right: 18px;
    color: #facc15;
    font-size: 58px;
    transform: rotate(18deg);
  }

  .desktop-week-card p {
    margin: 0 0 8px;
    color: #e5e7eb;
    font-weight: 900;
    text-transform: uppercase;
  }

  .desktop-week-card h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.18;
    text-transform: uppercase;
  }

  .desktop-feature-dots {
    position: absolute;
    bottom: 76px;
    left: 50%;
    display: flex;
    gap: 14px;
    transform: translateX(-50%);
  }

  .desktop-feature-dots span {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ffffff;
  }

  .desktop-feature-dots .active {
    background: #facc15;
  }

  .desktop-feature-stats {
    position: absolute;
    right: 28px;
    bottom: 18px;
    display: flex;
    gap: 16px;
    color: #94a3b8;
    font-size: 13px;
  }

  .desktop-feature-stats span {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
  }

  .desktop-feature-stats strong {
    color: #ffffff;
  }

  .desktop-community {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #111827;
  }

  .desktop-community-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 18px;
  }

  .desktop-community h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    text-transform: uppercase;
  }

  .desktop-community-head span {
    color: #94a3b8;
    font-size: 13px;
  }

  .desktop-community-list {
    display: grid;
    max-height: 260px;
    overflow: auto;
    scrollbar-color: #fb923c #111827;
  }

  .desktop-community article {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .desktop-community .avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 999px;
    background: #fb923c;
    color: #ffffff;
    font-weight: 900;
  }

  .desktop-community p {
    margin: 0;
    color: #f8fafc;
    line-height: 1.55;
  }

  .desktop-community strong {
    margin-right: 8px;
    color: #facc15;
  }

  .desktop-community mark {
    margin-right: 8px;
    border-radius: 4px;
    padding: 3px 6px;
    background: #facc15;
    color: #111827;
    font-size: 11px;
    font-weight: 900;
  }

  .desktop-community small {
    color: #9ca3af;
  }

  .desktop-rank-board {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #111827;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  }

  .desktop-rank-head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 16px 10px;
  }

  .desktop-rank-head h3 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 18px;
    text-transform: uppercase;
  }

  .desktop-rank-head div {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    border-radius: 3px;
    background: #0b1220;
    padding: 6px;
  }

  .desktop-rank-head button {
    min-height: 34px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #ffffff;
    font-weight: 800;
  }

  .desktop-rank-head button:first-child {
    background: #fb923c;
  }

  .desktop-rank-board ol {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .desktop-rank-board li {
    display: grid;
    grid-template-columns: 34px 70px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 108px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .rank-index {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 4px;
    color: #e5e7eb;
    font-weight: 900;
  }

  .rank-thumb {
    display: grid;
    overflow: hidden;
    width: 70px;
    height: 88px;
    place-items: center;
    border-radius: 6px;
    background: #0b1220;
    color: #94a3b8;
    text-decoration: none;
  }

  .rank-copy {
    min-width: 0;
    color: #ffffff;
    text-decoration: none;
  }

  .rank-copy strong,
  .rank-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rank-copy strong {
    font-size: 15px;
  }

  .rank-copy small {
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 13px;
  }

  .rank-copy em {
    display: block;
    margin-top: 8px;
    color: #facc15;
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0.04em;
  }

  .rank-copy em span {
    color: #9ca3af;
    letter-spacing: 0;
  }
}

@media (max-width: 1100px) and (min-width: 721px) {
  .desktop-portal-grid {
    grid-template-columns: 1fr;
  }

  .desktop-feature {
    grid-template-columns: minmax(0, 1fr) 170px;
  }

  .desktop-week-card {
    display: none;
  }
}

/* Home redesign v2: brighter, younger, cleaner desktop UX. */
@media (min-width: 721px) {
  body:has(.desktop-comic-portal) {
    background:
      radial-gradient(circle at 8% 6%, rgba(255, 139, 43, 0.18), transparent 32%),
      radial-gradient(circle at 94% 4%, rgba(37, 99, 235, 0.14), transparent 30%),
      linear-gradient(180deg, #fffaf3 0%, #f5f7fb 42%, #edf2f8 100%);
  }

  .home-shell .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 68px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.86);
    color: #111827;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
  }

  .home-shell .brand,
  .home-shell .brand-logo-fallback strong {
    color: #111827;
  }

  .home-shell .brand-logo-fallback small {
    color: #f97316;
  }

  .home-shell .main-nav a {
    min-height: 42px;
    border-radius: 999px;
    color: #344054;
    font-size: 14px;
    font-weight: 800;
  }

  .home-shell .main-nav a:hover {
    background: #fff7ed;
    color: #ea580c;
  }

  .home-shell .user-chip {
    border-color: rgba(249, 115, 22, 0.18);
    color: #111827;
    background: #fff7ed;
  }

  .desktop-comic-portal {
    gap: 18px;
    margin: 0 0 30px;
    color: #111827;
  }

  .desktop-portal-heading {
    align-items: end;
  }

  .desktop-portal-heading .eyebrow {
    display: none;
  }

  .desktop-portal-heading h2 {
    max-width: 940px;
    color: #101828;
    font-size: clamp(30px, 3vw, 44px);
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-transform: none;
  }

  .desktop-portal-search {
    min-width: min(360px, 34vw);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: #ffffff;
    color: #101828;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  }

  .desktop-portal-search input {
    color: #101828;
  }

  .desktop-portal-search input::placeholder {
    color: #98a2b3;
  }

  .desktop-portal-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 20px;
  }

  .desktop-portal-main {
    gap: 18px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .desktop-feature {
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    min-height: 420px;
    border: 1px solid rgba(255, 139, 43, 0.16);
    border-radius: 34px;
    padding: 40px 38px 74px;
    background:
      radial-gradient(circle at 72% 20%, rgba(255, 139, 43, 0.28), transparent 30%),
      radial-gradient(circle at 22% 8%, rgba(37, 99, 235, 0.12), transparent 28%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 237, 0.95));
    box-shadow: 0 28px 70px rgba(249, 115, 22, 0.14);
  }

  .desktop-feature-slides {
    position: relative;
    z-index: 1;
    min-width: 0;
  }

  .desktop-feature-slide {
    display: none;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    gap: 26px;
    align-items: center;
    min-width: 0;
  }

  .desktop-feature-slide.is-active {
    display: grid;
  }

  .desktop-feature::after {
    content: "";
    position: absolute;
    right: -86px;
    bottom: -120px;
    width: 300px;
    height: 300px;
    border-radius: 999px;
    background: rgba(255, 139, 43, 0.13);
    pointer-events: none;
  }

  .desktop-feature-copy {
    position: relative;
    z-index: 1;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
    color: #101828;
  }

  .feature-star {
    width: 58px;
    height: 58px;
    clip-path: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #ff8b2b, #facc15);
    color: #111827;
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.24);
  }

  .desktop-feature-copy h3 {
    max-width: 18ch;
    color: #101828;
    font-size: 38px;
    line-height: 1.04;
    letter-spacing: 0;
  }

  .desktop-feature-copy p {
    max-width: 58ch;
    color: #475467;
    font-size: 15px;
  }

  .desktop-feature-copy strong + p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .desktop-feature-copy strong {
    margin-top: 18px;
    color: #111827;
  }

  .desktop-feature-copy small,
  .feature-tags {
    color: #ea580c !important;
  }

  .desktop-feature-cover {
    position: relative;
    z-index: 1;
    overflow: hidden;
    width: min(210px, 100%);
    height: 292px;
    border: 8px solid #ffffff;
    border-radius: 24px;
    background: #f1f5f9;
    color: #667085;
    box-shadow: 0 24px 46px rgba(15, 23, 42, 0.2);
    transform: rotate(1.5deg);
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

  .desktop-feature-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }

  .desktop-feature-cover.is-image-broken {
    display: grid;
    place-items: center;
    text-align: center;
  }

  .desktop-feature-cover:hover {
    box-shadow: 0 28px 54px rgba(15, 23, 42, 0.24);
    transform: translateY(-3px) rotate(0deg);
  }

  .desktop-week-card {
    display: none;
    z-index: 1;
    min-height: 292px;
    align-self: center;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  }

  .desktop-week-card::before {
    background:
      linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.92)),
      radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.32), transparent 34%);
  }

  .desktop-week-card .crown {
    top: 14px;
    right: 18px;
    font-size: 48px;
  }

  .desktop-week-card p {
    color: #fed7aa;
    font-size: 13px;
  }

  .desktop-week-card h3 {
    font-size: 23px;
    letter-spacing: -0.03em;
  }

  .desktop-feature-dots {
    bottom: 26px;
    left: 38px;
    gap: 10px;
    transform: none;
  }

  .desktop-feature-dots span,
  .desktop-feature-dots button {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
    cursor: pointer;
  }

  .desktop-feature-dots .active,
  .desktop-feature-dots button.active {
    width: 28px;
    background: #ff8b2b;
  }

  .desktop-feature-stats {
    right: auto;
    bottom: 22px;
    left: 200px;
    color: #667085;
  }

  .desktop-feature-stats strong {
    color: #101828;
  }

  .desktop-rank-board {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
  }

  .desktop-rank-head {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 20px 20px 12px;
  }

  .desktop-rank-head h3 {
    color: #101828;
    font-size: 21px;
    letter-spacing: -0.03em;
    text-transform: none;
  }

  .desktop-rank-head div {
    border-radius: 999px;
    background: #f2f4f7;
    padding: 5px;
  }

  .desktop-rank-head button {
    border-radius: 999px;
    color: #475467;
  }

  .desktop-rank-head button:first-child {
    background: #ff8b2b;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(255, 139, 43, 0.24);
  }

  .desktop-rank-board li {
    grid-template-columns: 32px 64px minmax(0, 1fr);
    min-height: 96px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .rank-index {
    border-color: rgba(15, 23, 42, 0.1);
    color: #667085;
    background: #f8fafc;
  }

  .desktop-rank-board li:first-child .rank-index {
    border-color: transparent;
    background: #111827;
    color: #ffffff;
  }

  .rank-thumb {
    width: 64px;
    height: 78px;
    border-radius: 16px;
    background: #f2f4f7;
  }

  .rank-copy {
    color: #101828;
  }

  .rank-copy strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .rank-copy small {
    color: #667085;
    font-size: 12px;
  }

  .rank-copy em {
    color: #f59e0b;
  }

  .desktop-community {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
  }

  .desktop-community-head {
    min-height: 66px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0 22px;
  }

  .desktop-community h3 {
    color: #101828;
    font-size: 21px;
    letter-spacing: -0.03em;
    text-transform: none;
  }

  .desktop-community-head span {
    color: #667085;
  }

  .desktop-community-list {
    max-height: 252px;
    scrollbar-color: #ff8b2b #f2f4f7;
  }

  .desktop-community article {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 15px 22px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  }

  .desktop-community .avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ff8b2b, #facc15);
    color: #111827;
  }

  .desktop-community p {
    color: #344054;
  }

  .desktop-community strong {
    color: #111827;
  }

  .desktop-community mark {
    border-radius: 999px;
    background: #fff7ed;
    color: #ea580c;
  }

  .desktop-community article.is-pinned {
    background: #fff7ed;
  }

  .desktop-community-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .desktop-community-form input {
    min-width: 0;
    min-height: 42px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    padding: 0 12px;
    color: #101828;
    background: #ffffff;
  }

  .desktop-community-status,
  .desktop-community-empty {
    margin: 0;
    padding: 0 18px 14px;
    color: #667085;
    font-size: 13px;
  }

  .desktop-community-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    color: #667085;
    font-size: 13px;
  }

  .desktop-community small {
    color: #98a2b3;
  }

  .app-home-feed {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .app-home-feed .continue-section,
  .app-home-feed .panel-section,
  .app-home-feed .content-rail,
  .app-home-feed .tag-cloud,
  .app-home-feed .monetization-panel,
  .app-home-feed .home-ad {
    border-color: rgba(15, 23, 42, 0.08);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  }
}

@media (min-width: 1540px) {
  .desktop-feature {
    grid-template-columns: minmax(0, 1fr) 220px 250px;
  }

  .desktop-week-card {
    display: grid;
  }
}

@media (max-width: 1180px) and (min-width: 721px) {
  .desktop-portal-grid {
    grid-template-columns: 1fr;
  }

  .desktop-feature {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .desktop-week-card {
    display: none;
  }
}

@media (max-width: 900px) and (min-width: 721px) {
  .desktop-portal-heading {
    display: grid;
  }

  .desktop-portal-search {
    min-width: 0;
    width: 100%;
  }

  .desktop-feature {
    grid-template-columns: 1fr;
    padding: 30px;
  }

  .desktop-feature-slide {
    grid-template-columns: minmax(0, 1fr);
  }

  .desktop-feature-cover {
    width: 190px;
    height: 260px;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .admin-chapter-row,
  .series-continue-card {
    grid-template-columns: 1fr;
  }

  .series-continue-card {
    align-items: stretch;
    flex-direction: column;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
.is-pending {
  cursor: wait;
}

.is-pending {
  position: relative;
  pointer-events: none;
  opacity: 0.82;
}

.is-pending::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

.icon-btn.is-pending::after,
.brand.is-pending::after,
.reader-logo.is-pending::after {
  position: absolute;
  right: 8px;
  bottom: 7px;
  margin: 0;
  width: 11px;
  height: 11px;
}

.global-loading {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 100;
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border: 1px solid rgba(24, 32, 51, 0.12);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
}

.global-loading::before {
  content: "";
  position: fixed;
  top: -12px;
  left: 50%;
  width: auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 180% 100%;
  transform: translateX(-50%);
  animation: loading-bar 1.1s linear infinite;
}

.app-loading .global-loading {
  display: inline-flex;
}

.loader-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

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

@keyframes loading-bar {
  to {
    background-position: 180% 0;
  }
}

.app-shell {
  min-height: 100vh;
}

.library,
.site-shell {
  width: min(100%, 100vw);
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 18px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100vw;
  margin: 0 calc(50% - 50vw) 24px;
  min-height: 58px;
  padding: 0 max(18px, calc((100vw - 1220px) / 2));
  background: var(--nav);
  color: #f8fafc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #f8fafc;
  text-decoration: none;
}

.brand-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-logo img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-logo.compact img {
  width: 36px;
  height: 36px;
}

.brand-logo-fallback {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-logo-fallback strong {
  color: #f8fafc;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.brand-logo-fallback small {
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-btn {
  padding: 0 18px;
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
}

.icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

.import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 150px 112px;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
  margin-left: 14px;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 0 13px;
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.muted-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-heading {
  padding: 26px 0 10px;
}

.home-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 28px;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.home-main,
.popular-sidebar {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel-section,
.continue-section,
.popular-panel,
.search-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head h2 {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.small-orange {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.shelf-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shelf-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-color: #fed7aa;
  color: #f97316;
  background: #fff7ed;
}

.continue-list {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-auto-columns: minmax(312px, calc((100% - 28px) / 3));
  grid-auto-flow: column;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 14px;
  scroll-padding-inline: 14px;
  scroll-snap-type: x mandatory;
  scrollbar-color: #fb923c #ffedd5;
}

.continue-list::-webkit-scrollbar {
  height: 10px;
}

.continue-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #ffedd5;
}

.continue-list::-webkit-scrollbar-thumb {
  border: 2px solid #ffedd5;
  border-radius: 999px;
  background: #fb923c;
}

.continue-card {
  display: grid;
  grid-template-columns: 70px minmax(150px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 96px;
  border: 1px solid rgba(255, 139, 43, 0.32);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  cursor: pointer;
  scroll-snap-align: start;
}

.mini-cover,
.rank-cover,
.update-cover {
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 7px;
  background: #e5e7eb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.mini-cover {
  width: 70px;
  height: 88px;
}

.mini-cover img,
.rank-cover img,
.update-cover img,
.trending-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.continue-copy {
  min-width: 0;
}

.continue-copy strong {
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.continue-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.continue-chapter {
  overflow: hidden;
  margin-top: 8px;
  color: #374151;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-progress {
  margin-top: 2px;
}

.continue-cta {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--accent), #f97316);
  box-shadow: 0 10px 22px rgba(255, 139, 43, 0.25);
  font-size: 12px;
  font-weight: 800;
}

.mini-meter {
  overflow: hidden;
  height: 6px;
  margin-top: 8px;
  border-radius: 99px;
  background: #e5e7eb;
}

.mini-meter div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #22c55e);
}

.trending-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
}

.trending-card {
  flex: 0 1 170px;
  min-width: 0;
}

.trending-cover {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  place-items: center;
  border-radius: 8px;
  background: #e5e7eb;
  color: var(--muted);
  text-decoration: none;
}

.trending-cover small {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 4px;
  padding: 3px 6px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
}

.trending-card h3,
.updated-item h3 {
  margin: 9px 0 0;
  font-size: 14px;
  line-height: 1.35;
}

.trending-card a,
.updated-item a,
.rank-list a {
  color: #111827;
  text-decoration: none;
}

.trending-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.rating {
  margin-top: 5px;
  color: #f59e0b;
  font-size: 12px;
  letter-spacing: 0;
}

.rating span {
  color: var(--muted);
  margin-left: 3px;
}

.updated-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 22px;
  padding: 14px;
}

.updated-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.update-cover {
  width: 76px;
  height: 100px;
}

.chapter-mini-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.chapter-mini-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chapter-mini-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-mini-list small {
  color: #98a2b3;
}

.search-panel {
  padding: 10px;
}

.search-panel .search-box {
  min-height: 42px;
  border-radius: 7px;
  box-shadow: none;
}

.rank-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px;
}

.rank-tabs button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f6fb;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.rank-tabs button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.rank-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: 26px 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.rank-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.rank-cover {
  width: 58px;
  height: 48px;
}

.rank-list strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-band {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.content-rail,
.tag-cloud,
.chapter-panel,
.page-heading,
.admin-list {
  margin-top: 28px;
}

.page-heading {
  width: min(100%, calc(100vw - 36px));
}

.import-panel input,
.import-panel textarea,
.import-panel select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.import-panel textarea {
  min-height: 96px;
  resize: vertical;
  padding-block: 12px;
  line-height: 1.45;
}

.import-panel input:focus,
.import-panel textarea:focus,
.import-panel select:focus {
  border-color: var(--accent-2);
}

.status-line {
  min-height: 24px;
  margin: 14px 2px 28px;
  color: var(--muted);
}

.status-line.error {
  color: var(--danger);
}

.auth-card {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 58vh;
  place-items: center;
}

.auth-panel {
  display: grid;
  width: 100%;
  max-width: 430px;
  min-width: 0;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-panel h2,
.auth-panel p {
  margin: 0;
  overflow-wrap: anywhere;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.google-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.google-login-btn:hover {
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.google-login-btn span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #4285f4;
  font-weight: 900;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-panel input,
.filter-panel input,
.filter-panel select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.auth-panel input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--accent-2);
}

.inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tab-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 -8px;
  color: var(--muted);
}

.tab-summary strong {
  color: var(--accent);
  font-size: 22px;
}

.follow-btn.active {
  border-color: rgba(255, 139, 43, 0.55);
  background: #fff7ed;
  color: #c2410c;
}

.batch-status {
  display: grid;
  gap: 12px;
}

.batch-summary {
  color: var(--text);
  font-weight: 800;
}

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

.batch-progress-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.batch-url {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-progress {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 24, 33, 0.78);
  color: var(--text);
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.progress-copy strong {
  min-width: 0;
}

.progress-copy span,
.progress-grid {
  color: var(--muted);
  font-size: 13px;
}

.crawl-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 99px;
  background: #0d0f15;
}

.crawl-meter div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 240ms ease;
}

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

.progress-errors {
  display: grid;
  gap: 4px;
  color: #ffb199;
  font-size: 12px;
  line-height: 1.45;
}

.series-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.continue-card {
  display: grid;
  grid-template-columns: 70px minmax(150px, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 12px;
}

.continue-card strong,
.continue-card span {
  display: block;
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.series-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 300px;
  padding: 0;
}

.series-cover {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  place-items: center;
  background: #0d0f15;
  color: var(--muted);
  text-decoration: none;
}

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

.series-card-copy {
  padding: 14px 14px 0;
}

.series-card h2,
.series-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.series-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.series-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.series-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag-row a,
.tag-cloud a {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: #344054;
  background: #ffffff;
  font-size: 13px;
  text-decoration: none;
}

.tag-cloud > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud small,
.muted {
  color: var(--muted);
}

.series-detail {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin-top: 20px;
}

.detail-cover {
  display: grid;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-copy h2,
.page-heading h2 {
  margin: 12px 0;
  font-size: 34px;
  line-height: 1.1;
}

.detail-copy p,
.page-heading p {
  min-width: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.metric-strip span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--panel);
  color: var(--muted);
}

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

.chapter-list-inline {
  display: grid;
  gap: 8px;
}

.chapter-list-inline .chapter-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}

.chapter-list-inline .chapter-list-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chapter-list-inline small {
  color: var(--muted);
}

.ad-slot {
  display: grid;
  min-height: 84px;
  place-items: center;
  border: 1px dashed rgba(24, 32, 51, 0.16);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(24, 32, 51, 0.035);
  font-size: 13px;
}

.adsense-slot {
  position: relative;
  overflow: hidden;
  padding: 12px;
}

.adsense-slot .ad-label {
  position: absolute;
  top: 8px;
  left: 12px;
  color: rgba(102, 112, 133, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.adsense-slot .adsbygoogle {
  width: 100%;
  min-height: 72px;
}

.series-ad {
  max-width: 100%;
  margin: 18px 0;
}

.reader-ad {
  width: min(100%, 760px);
  margin: 24px auto;
}

.admin-shell .topbar {
  margin-bottom: 18px;
}

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

.revenue-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin: 18px 0;
}

.admin-panel.revenue-dashboard {
  grid-template-columns: minmax(0, 1fr);
}

.revenue-dashboard .admin-list-head {
  min-width: 0;
}

.revenue-range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.revenue-range-tabs .ghost-btn.active {
  border-color: rgba(255, 139, 43, 0.42);
  background: rgba(255, 139, 43, 0.12);
  color: #bf4f00;
}

.revenue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  min-width: 0;
}

.revenue-metrics article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #fff7ed);
}

.revenue-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.revenue-metrics strong {
  color: var(--ink);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1;
}

.revenue-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.revenue-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.revenue-table th,
.revenue-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
}

.revenue-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.revenue-table a {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.admin-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-login-card {
  max-width: 440px;
  margin: 56px auto;
}

.admin-login-panel {
  grid-template-columns: 1fr;
}

.admin-panel {
  grid-template-columns: minmax(260px, 1fr) 150px 150px 112px;
}

.admin-bulletin-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-bulletin-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.admin-bulletin-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.admin-bulletin-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.admin-bulletin-form textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--text);
  background: #ffffff;
  resize: vertical;
}

.admin-bulletin-list {
  display: grid;
  gap: 8px;
}

.admin-bulletin-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-2);
}

.admin-bulletin-list article.is-pinned {
  border-color: rgba(255, 139, 43, 0.32);
  background: #fff7ed;
}

.admin-bulletin-list strong {
  margin-right: 8px;
}

.admin-bulletin-list mark {
  margin-right: 8px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #ea580c;
  background: #ffedd5;
  font-size: 11px;
  font-weight: 900;
}

.admin-bulletin-list small {
  color: var(--muted);
  font-size: 12px;
}

.admin-bulletin-list p {
  margin: 5px 0 0;
  color: var(--text);
}

.admin-panel h2 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 18px;
}

.admin-series-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) repeat(3, minmax(130px, 1fr)) 120px;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.admin-series-card > div:first-child {
  display: grid;
  gap: 4px;
}

.admin-series-card > div:first-child span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-series-card input,
.admin-series-card select,
.admin-series-card textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
}

.admin-series-card textarea {
  min-height: 84px;
  resize: vertical;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
}

.empty-state {
  padding: 44px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.reader {
  min-height: 100vh;
  --reader-toolbar-height: 58px;
  --panel: #161821;
  --panel-2: #1f222d;
  --text: #f5f7fb;
  --muted: #9ba3b4;
  --line: rgba(255, 255, 255, 0.11);
  background: #050609;
  color: var(--text);
}

.reader-toolbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px max(12px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 9, 0.84);
  backdrop-filter: blur(18px);
  transition: transform 180ms ease, opacity 180ms ease;
  will-change: transform;
}

.reader.is-toolbar-hidden .reader-toolbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-100% - 8px));
}

.reader-logo {
  display: inline-flex;
  min-width: 136px;
  height: 42px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.reader .icon-btn,
.reader .ghost-btn {
  color: var(--text);
  background: var(--panel);
}

.reader .primary-btn {
  color: #ffffff;
}

.reader-continue-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #f97316);
  box-shadow: 0 12px 28px rgba(255, 139, 43, 0.28);
  font-weight: 800;
  white-space: nowrap;
}

.reader-title {
  min-width: 0;
  flex: 1;
}

.reader-title strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.chapter-stream {
  max-width: 920px;
  margin: 0 auto;
  padding: var(--reader-toolbar-height) 10px 120px;
}

.chapter-block {
  margin: 0;
  font-size: 0;
  line-height: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 1300px;
}

.chapter-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
}

.reader-page {
  position: relative;
  width: min(100%, 880px);
  min-height: 0;
  margin: 0 auto;
  background: #ffffff;
  overflow: hidden;
}

.page-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0 auto;
  border-radius: 0;
  background: #ffffff;
  object-fit: contain;
  overflow: hidden;
  vertical-align: top;
}

.chapter-block .reader-page + .reader-page {
  margin-top: -1px;
}

.reader-image-fallback {
  position: absolute;
  inset: 0;
  display: none;
  min-height: 160px;
  place-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: #e5e7eb;
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.92), rgba(15, 23, 42, 0.96));
}

.reader-image-fallback strong {
  font-size: 15px;
}

.reader-image-fallback span {
  max-width: 360px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
}

.reader-image-retry {
  min-height: 38px;
  border-color: rgba(255, 255, 255, 0.24);
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.reader-page[data-reader-state="retrying"] .reader-image-fallback,
.reader-page[data-reader-state="error"] .reader-image-fallback {
  display: grid;
}

.reader-page[data-reader-state="retrying"] .reader-image-retry {
  display: none;
}

.reader-page[data-reader-state="retrying"] .page-image,
.reader-page[data-reader-state="error"] .page-image {
  opacity: 0.22;
}

.page-missing,
.loader-row {
  display: grid;
  min-height: 120px;
  place-items: center;
  margin: 8px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-size: 14px;
  line-height: 1.4;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.42);
}

.chapter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  width: min(420px, 100vw);
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #11131a;
  box-shadow: var(--shadow);
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-header div {
  min-width: 0;
  flex: 1;
}

.drawer-header strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-header span {
  color: var(--muted);
  font-size: 13px;
}

.chapter-list {
  overflow: auto;
  padding: 10px;
}

.chapter-item {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.chapter-item:hover,
.chapter-item.active {
  border-color: var(--line);
  background: var(--panel-2);
}

.chapter-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.chapter-item small {
  color: var(--muted);
}

.admin-wide,
.admin-chapter-review {
  grid-column: 1 / -1;
}

.admin-series-heading,
.admin-chapter-review,
.admin-chapter-row > div {
  display: grid;
  gap: 4px;
}

.admin-chapter-review {
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.admin-chapter-review-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.admin-chapter-review-head strong {
  color: var(--text);
  font-size: 14px;
}

.admin-chapter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px minmax(140px, 0.8fr) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.admin-chapter-row span {
  color: var(--muted);
  font-size: 12px;
}

.static-page {
  min-height: 72vh;
}

.static-page-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.static-info-panel {
  display: grid;
  gap: 18px;
  max-width: 780px;
  border: 1px solid rgba(255, 139, 43, 0.18);
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
  box-shadow: var(--shadow);
}

.static-info-panel ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.65;
}

.static-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.series-continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  border: 1px solid rgba(255, 139, 43, 0.3);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  box-shadow: var(--shadow);
}

.series-continue-card strong,
.series-continue-card span {
  display: block;
}

.series-continue-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.reader-break,
.reader-chapter-actions {
  width: min(100%, 760px);
  margin: 24px auto;
}

.reader-break {
  display: grid;
  min-height: 64px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1.4;
}

.reader-chapter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .popular-sidebar {
    grid-template-columns: 1fr;
  }
  .main-nav {
    overflow-x: auto;
  }
}

@media (max-width: 1080px) {
  .trending-card {
    flex: 1 1 140px;
  }
}

@media (max-width: 720px) {
  .library {
    padding-top: 22px;
  }

  .site-shell {
    padding: 22px 14px 56px;
  }

  .topbar,
  .series-detail {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    margin: -22px -14px 18px;
    padding: 12px 14px;
  }

  .top-actions {
    width: 100%;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .main-nav {
    width: 100%;
    margin-left: 0;
    padding-bottom: 2px;
  }

  .main-nav a {
    min-height: 36px;
    padding: 0 10px;
  }

  .home-heading h2 {
    font-size: 22px;
  }

  .page-heading,
  .page-heading p {
    max-width: calc(100vw - 28px);
  }

  .auth-panel {
    justify-self: start;
    width: 300px;
    max-width: calc(100vw - 56px);
    padding: 20px;
  }

  .auth-panel h2 {
    font-size: 22px;
    line-height: 1.2;
  }

  .trending-grid,
  .updated-grid {
    grid-template-columns: 1fr 1fr;
  }

  .trending-card {
    flex-basis: calc(50% - 7px);
  }

  .continue-list {
    grid-auto-columns: minmax(280px, 86vw);
    grid-template-columns: none;
    grid-template-rows: repeat(2, minmax(0, auto));
    padding: 12px;
    scroll-padding-inline: 12px;
  }

  .continue-card {
    grid-template-columns: 64px minmax(138px, 1fr);
    min-height: 108px;
  }

  .series-detail {
    display: flex;
  }

  .detail-cover {
    width: min(220px, 100%);
  }

  .import-panel,
  .admin-panel,
  .admin-bulletin-form,
  .admin-series-card {
    grid-template-columns: 1fr;
  }

  .admin-bulletin-list article {
    grid-template-columns: 1fr;
  }

  .progress-copy,
  .progress-grid {
    grid-template-columns: 1fr;
  }

  .progress-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .reader-toolbar {
    gap: 6px;
    min-height: 52px;
    padding: 7px 8px;
  }

  .reader-logo {
    min-width: 0;
  }

  .reader-logo .brand-logo-fallback {
    display: none;
  }

  .reader-logo .brand-logo.compact img {
    width: 30px;
    height: 30px;
  }

  .reader-title strong {
    font-size: 13px;
  }

  .reader-title span {
    font-size: 11px;
  }

  .reader .icon-btn,
  .reader .ghost-btn,
  .reader-continue-btn {
    min-height: 36px;
  }

  .reader-continue-btn {
    padding: 8px 11px;
    font-size: 12px;
  }

  .reader-menu-btn {
    min-width: 38px;
  }
  }

  .topbar .brand-logo img {
    width: 40px;
    height: 40px;
  }

  .chapter-stream {
    padding-inline: 0;
  }

  .page-image {
    border-radius: 0;
  }

  .reader-chapter-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    width: 100%;
    margin: 18px auto 0;
    padding: 10px 10px max(18px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(5, 6, 9, 0), rgba(5, 6, 9, 0.95) 22%);
  }
}


.monetization-panel {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 1.25rem;
  border: 1px solid rgba(151, 123, 76, 0.22);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 250, 238, 0.96), rgba(239, 231, 211, 0.72));
  box-shadow: 0 18px 45px rgba(75, 55, 30, 0.08);
}

.monetization-panel h2 { margin: 0.15rem 0 0; }
.support-note { color: var(--muted, #6f665a); margin: 0.4rem 0 0; }
.support-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.home-ad, .reader-ad {
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(97, 75, 45, 0.28);
  border-radius: 18px;
  color: var(--muted, #6f665a);
  background: rgba(255, 252, 244, 0.72);
}

.admin-series-card {
  display: block;
  overflow: hidden;
  padding: 0;
  border-radius: 12px;
}

.admin-series-disclosure {
  display: block;
}

.admin-series-summary {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.admin-series-summary::-webkit-details-marker {
  display: none;
}

.admin-series-summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: -3px;
}

.admin-series-cover {
  display: grid;
  overflow: hidden;
  width: 82px;
  aspect-ratio: 3 / 4;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #e8edf5, #ffffff);
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

.admin-series-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-series-summary-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.admin-series-summary-copy strong {
  overflow: hidden;
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-series-summary-copy > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-series-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-series-badges span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.admin-series-status.is-public {
  border-color: rgba(2, 122, 72, 0.22);
  background: #ecfdf3;
  color: #027a48;
}

.admin-series-status.is-draft {
  border-color: rgba(37, 99, 235, 0.2);
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-series-status.is-removed {
  border-color: rgba(209, 77, 50, 0.2);
  background: #fff1f2;
  color: var(--danger);
}

.admin-series-open-hint {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-series-disclosure[open] .admin-series-open-hint {
  border-color: rgba(255, 139, 43, 0.28);
  background: #fff7ed;
  color: #c2410c;
}

.admin-series-details-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) repeat(3, minmax(130px, 1fr)) 120px;
  gap: 10px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #fbfdff;
}

.admin-series-details-grid > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .admin-series-summary {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }

  .admin-series-cover {
    width: 64px;
    border-radius: 8px;
  }

  .admin-series-open-hint {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
  }

  .admin-series-details-grid {
    grid-template-columns: 1fr;
  }
}
.admin-series-details-grid .support-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 0;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.admin-series-details-grid .support-actions .ghost-btn {
  min-width: 180px;
  border-color: rgba(37, 99, 235, 0.18);
  background: #ffffff;
  font-weight: 800;
}

.admin-series-details-grid .support-actions .ghost-btn:disabled {
  opacity: 0.82;
}

.admin-update-status {
  margin: 0;
}

.admin-update-status.import-progress {
  gap: 12px;
  border: 1px solid rgba(255, 139, 43, 0.22);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(135deg, #fff7ed, #ffffff 58%, #f8fbff);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.admin-update-status.import-progress.error {
  border-color: rgba(209, 77, 50, 0.28);
  background: linear-gradient(135deg, #fff1f2, #ffffff);
}

.admin-update-status .progress-copy {
  align-items: flex-start;
}

.admin-update-status .progress-copy strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.35;
}

.admin-update-status .progress-copy span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.admin-update-status .crawl-meter {
  height: 10px;
  background: #ffedd5;
}

.admin-update-status .crawl-meter div {
  background: linear-gradient(90deg, var(--accent), #22c55e);
}

.admin-update-status .progress-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: #667085;
}

.admin-update-status .progress-grid span {
  border: 1px solid rgba(24, 32, 51, 0.08);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.35;
}

.admin-update-status .progress-errors {
  border-radius: 10px;
  padding: 10px;
  background: #fff1f2;
  color: var(--danger);
}

.admin-series-details-grid > .primary-btn[type="submit"] {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 220px;
}

@media (max-width: 720px) {
  .revenue-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-series-details-grid .support-actions,
  .admin-series-details-grid .support-actions .ghost-btn,
  .admin-series-details-grid > .primary-btn[type="submit"] {
    width: 100%;
  }

  .admin-update-status .progress-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .revenue-metrics {
    grid-template-columns: 1fr;
  }
}
.admin-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-list-head .section-title {
  margin-bottom: 4px;
}

.admin-series-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.admin-series-list-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  padding: 12px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
}

.admin-series-list-card .admin-series-summary {
  grid-template-columns: 76px minmax(0, 1fr);
  padding: 0;
}

.admin-series-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-series-card-actions .primary-btn,
.admin-series-card-actions .ghost-btn {
  min-height: 38px;
  flex: 1 1 128px;
  text-align: center;
}

.admin-series-list-card .admin-update-status {
  min-height: 0;
}

.admin-detail-shell {
  max-width: 1120px;
}

.admin-detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-series-editor {
  display: grid;
  gap: 16px;
}

.admin-detail-hero,
.admin-editor-section,
.admin-editor-savebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-detail-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(220px, 300px);
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff, #f8fbff 54%, #fff7ed);
}

.admin-series-cover.is-large {
  width: 150px;
  border-radius: 14px;
  font-size: 28px;
}

.admin-detail-title {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.admin-detail-title h2,
.admin-detail-title p {
  margin: 0;
}

.admin-detail-title h2 {
  color: #111827;
  font-size: 28px;
  line-height: 1.15;
}

.admin-detail-title > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.admin-detail-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.admin-detail-actions .ghost-btn {
  min-height: 44px;
  font-weight: 900;
}

.admin-editor-section {
  overflow: hidden;
}

.admin-editor-section-head {
  border-bottom: 1px solid var(--line);
}

.admin-series-editor .admin-series-details-grid {
  border-top: 0;
  background: transparent;
}

.admin-series-editor .admin-chapter-review {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.production-publish-panel {
  display: grid;
  gap: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 139, 43, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fbff 72%);
}

.production-publish-panel .section-head {
  gap: 14px;
}

.production-publish-panel .primary-btn {
  min-width: 190px;
}

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

.production-flow-grid span,
.production-step {
  border: 1px solid rgba(24, 32, 51, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.production-flow-grid span {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.production-flow-grid b {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
}

.production-publish-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #667085;
  font-size: 13px;
}

.production-publish-note a {
  color: #c2410c;
  font-weight: 900;
}

.production-publish-status {
  margin: 0;
}

.production-progress {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(255, 139, 43, 0.24);
  border-radius: 14px;
  background: #fffaf4;
}

.production-progress.error {
  border-color: rgba(209, 77, 50, 0.28);
  background: #fff1f2;
}

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

.production-step {
  display: grid;
  gap: 5px;
  padding: 10px;
  color: #667085;
  font-size: 12px;
}

.production-step b {
  color: #111827;
  font-size: 13px;
}

.production-step small {
  overflow: hidden;
  color: #667085;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-step-progress {
  display: grid;
  gap: 7px;
}

.production-step-progress .crawl-meter {
  height: 6px;
  margin: 2px 0 0;
}

.production-step-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.production-step-metrics span {
  overflow: hidden;
  border-radius: 8px;
  padding: 5px 7px;
  background: rgba(15, 23, 42, 0.04);
  color: #475467;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-step.is-running {
  border-color: rgba(255, 139, 43, 0.38);
  background: #fff7ed;
}

.production-step.is-completed {
  border-color: rgba(2, 122, 72, 0.18);
  background: #ecfdf3;
}

.production-step.is-failed {
  border-color: rgba(209, 77, 50, 0.28);
  background: #fff1f2;
}

.production-log {
  display: grid;
  gap: 5px;
  max-height: 180px;
  overflow: auto;
  border-radius: 10px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "Cascadia Mono", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.admin-editor-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.admin-editor-savebar .primary-btn {
  min-width: 220px;
}

@media (max-width: 900px) {
  .admin-detail-hero {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .admin-series-cover.is-large {
    width: 110px;
  }

  .admin-detail-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .admin-series-list-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail-hero {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .admin-series-cover.is-large {
    width: 88px;
    border-radius: 10px;
  }

  .admin-detail-title h2 {
    font-size: 20px;
  }

  .production-publish-panel .section-head,
  .production-publish-panel .primary-btn {
    width: 100%;
  }

  .production-flow-grid,
  .production-step-list {
    grid-template-columns: 1fr;
  }

  .admin-editor-savebar {
    bottom: 0;
    margin-inline: -14px;
    border-radius: 14px 14px 0 0;
  }

  .admin-editor-savebar .primary-btn {
    width: 100%;
  }
}
/* Admin catalog list polish: keep list cards compact without inheriting editor grid. */
.admin-series-list-card {
  grid-template-columns: minmax(0, 1fr) 164px;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.admin-series-list-card .admin-series-summary {
  grid-template-columns: 92px minmax(0, 1fr);
  min-width: 0;
  gap: 14px;
}

.admin-series-list-card .admin-series-cover {
  width: 92px;
  border-radius: 12px;
}

.admin-series-cover {
  position: relative;
}

.admin-series-cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  background: linear-gradient(135deg, #e8edf5, #ffffff);
  color: #667085;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.admin-series-cover img {
  position: relative;
  z-index: 1;
  display: block;
  background: #e8edf5;
}

.admin-series-cover.is-missing img {
  display: none;
}

.admin-series-list-card .admin-series-summary-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-series-list-card .admin-series-summary-copy > span {
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-production-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.admin-production-badge-row small {
  color: #667085;
  font-size: 11px;
  line-height: 1.3;
}

.admin-production-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
  color: #475467;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.admin-production-badge.is-ok {
  border-color: rgba(16, 185, 129, 0.34);
  background: #ecfdf3;
  color: #047857;
}

.admin-production-badge.is-syncing {
  border-color: rgba(59, 130, 246, 0.3);
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-production-badge.is-warning {
  border-color: rgba(245, 158, 11, 0.38);
  background: #fffbeb;
  color: #b45309;
}

.admin-production-badge.is-draft,
.admin-production-badge.is-unchecked {
  border-color: rgba(148, 163, 184, 0.32);
  background: #f8fafc;
  color: #667085;
}

.admin-series-list-card .admin-series-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.admin-series-list-card .admin-series-card-actions .primary-btn,
.admin-series-list-card .admin-series-card-actions .ghost-btn {
  width: 100%;
  min-height: 42px;
  flex: none;
  padding-inline: 10px;
}

.admin-series-list-card .admin-update-status {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .admin-series-list-card {
    grid-template-columns: 1fr;
  }

  .admin-series-list-card .admin-series-summary {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .admin-series-list-card .admin-series-cover {
    width: 78px;
  }

  .admin-series-list-card .admin-series-card-actions {
    grid-template-columns: 1fr 1fr;
  }

  .admin-series-list-card .admin-series-card-actions .ghost-btn:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }
}
/* Homepage polish: resume carousel and support/donate block. */
.continue-section {
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 139, 43, 0.14), transparent 32%),
    linear-gradient(135deg, #ffffff, #fffaf4);
}

.continue-section .section-head {
  min-height: 64px;
  border-bottom-color: rgba(255, 139, 43, 0.18);
  padding: 12px 18px;
}

.continue-section .section-head h2 {
  color: #101828;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.continue-section .section-head p {
  color: #667085;
}

.continue-section .shelf-controls {
  gap: 10px;
}

.continue-section .shelf-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-color: rgba(255, 139, 43, 0.28);
  border-radius: 14px;
  background: #fff7ed;
  color: #f97316;
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.12);
}

.continue-list {
  display: grid;
  grid-auto-flow: initial;
  grid-auto-columns: initial;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: none;
  gap: 14px;
  overflow: visible;
  padding: 18px;
  scroll-snap-type: none;
  scrollbar-width: none;
}

.continue-list::-webkit-scrollbar {
  display: none;
}

.continue-card {
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 148px;
  border-color: rgba(255, 139, 43, 0.22);
  border-radius: 16px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.88), rgba(255, 255, 255, 0.98)),
    #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.continue-card:hover {
  border-color: rgba(255, 139, 43, 0.42);
  transform: translateY(-2px);
}

.continue-card .mini-cover {
  width: 86px;
  height: 108px;
  border-radius: 13px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.continue-copy strong {
  color: #0f172a;
  font-size: 16px;
  line-height: 1.28;
  -webkit-line-clamp: 2;
}

.continue-copy span {
  color: #667085;
}

.continue-chapter {
  color: #344054 !important;
  font-weight: 800;
}

.continue-cta {
  border-radius: 12px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #ff8b2b, #ff6f1a);
  box-shadow: 0 12px 22px rgba(255, 139, 43, 0.28);
}

.mini-meter {
  height: 7px;
  background: #e4e7ec;
}

.home-ad {
  min-height: 96px;
  margin: 22px 0;
  border-color: rgba(255, 139, 43, 0.2);
  border-radius: 22px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 139, 43, 0.04) 0 8px, rgba(255, 139, 43, 0.01) 8px 16px),
    #fffdf8;
  color: #667085;
}

.monetization-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin: 22px 0 28px;
  border-radius: 22px;
  padding: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 139, 43, 0.18), transparent 34%),
    linear-gradient(135deg, #ffffff, #fff7ed);
}

.monetization-panel .eyebrow {
  margin: 0 0 8px;
  color: #f97316;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.monetization-panel h2 {
  margin: 0;
  color: #101828;
  font-size: 24px;
  line-height: 1.2;
}

.support-note {
  max-width: 780px;
  color: #667085;
  font-size: 15px;
  line-height: 1.6;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 22px;
  background: linear-gradient(135deg, #ff8b2b, #ff6f1a);
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(255, 139, 43, 0.28);
}

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

@media (max-width: 980px) {
  .continue-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .continue-section .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .continue-section .shelf-controls {
    display: none;
  }

  .continue-list {
    grid-auto-columns: minmax(286px, 86vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: repeat(2, minmax(0, auto));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 14px;
    scroll-snap-type: x mandatory;
  }

  .continue-card {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 132px;
    scroll-snap-align: start;
  }

  .continue-card .mini-cover {
    width: 72px;
    height: 92px;
  }

  .monetization-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .primary-action,
  .support-actions {
    width: 100%;
  }
}

/* Desktop reader scale: keep mobile full width, make desktop images calmer by default. */
@media (min-width: 901px) {
  .chapter-stream {
    max-width: 680px;
  }

  .reader-page {
    width: min(100%, 616px);
  }

  .page-image {
    width: 100%;
  }

  .reader-break,
  .reader-chapter-actions,
  .reader-ad {
    width: min(100%, 616px);
  }
}

/* Desktop reader scale refinement: smaller default reading canvas. */
@media (min-width: 901px) {
  .chapter-stream {
    max-width: 560px;
  }

  .reader-page {
    width: min(100%, 528px);
  }

  .page-image {
    width: 100%;
  }

  .reader-break,
  .reader-chapter-actions,
  .reader-ad {
    width: min(100%, 528px);
  }
}

/* Desktop reader toolbar compact mode to match smaller page scale. */
@media (min-width: 901px) {
  .reader {
    --reader-toolbar-height: 44px;
  }

  .reader-toolbar {
    min-height: 44px;
    padding-top: 5px;
    padding-bottom: 5px;
    gap: 8px;
  }

  .reader-logo {
    min-width: 112px;
    height: 34px;
  }

  .reader-logo .brand-logo.compact img {
    width: 30px;
    height: 30px;
  }

  .reader-logo .brand-logo-fallback strong {
    font-size: 15px;
  }

  .reader-title strong {
    font-size: 13px;
  }

  .reader-title span {
    margin-top: 1px;
    font-size: 11px;
  }

  .reader .icon-btn,
  .reader .ghost-btn,
  .reader-continue-btn {
    min-height: 34px;
  }

  .reader .icon-btn {
    width: 34px;
    height: 34px;
  }

  .reader .ghost-btn,
  .reader-continue-btn {
    padding-inline: 11px;
    font-size: 12px;
  }
}

/* Mobile app UX pass: reader controls, safe areas, and compact catalog cards. */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.reader-bottom-bar {
  display: none;
}

.mobile-search-panel {
  display: none;
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  body {
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
  }

  body:has(.reader) {
    background: #050609;
  }

  .site-shell,
  .library {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-bottom: max(72px, calc(64px + var(--safe-bottom)));
  }

  .topbar {
    min-height: 52px;
    margin-bottom: 16px;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .main-nav {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .home-heading {
    padding: 18px 0 8px;
  }

  .home-heading h2 {
    font-size: clamp(21px, 6vw, 26px);
    line-height: 1.18;
  }

  .home-heading p {
    font-size: 14px;
    line-height: 1.5;
  }

  .home-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .popular-sidebar {
    order: -1;
  }

  .search-panel {
    position: sticky;
    top: 0;
    z-index: 9;
    margin-inline: -12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0 0 18px 18px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .continue-section,
  .panel-section,
  .popular-panel,
  .monetization-panel {
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  }

  .continue-section .section-head,
  .section-head {
    min-height: 54px;
    padding: 11px 12px;
  }

  .continue-list {
    grid-auto-columns: minmax(272px, 84vw);
    grid-template-rows: none;
    gap: 12px;
    padding: 12px;
  }

  .continue-card {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 122px;
    border-radius: 16px;
    padding: 12px;
  }

  .continue-card .mini-cover {
    width: 74px;
    height: 96px;
  }

  .continue-copy strong {
    font-size: 15px;
  }

  .continue-cta,
  .primary-btn,
  .ghost-btn,
  .icon-btn {
    min-height: 44px;
  }

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

  .trending-card {
    min-width: 0;
  }

  .updated-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 12px 12px;
  }

  .updated-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 11px;
    min-height: 108px;
  }

  .update-cover {
    width: 72px;
    height: 96px;
    border-radius: 12px;
  }

  .series-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .series-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 0;
    border-radius: 18px;
    overflow: hidden;
  }

  .series-cover {
    width: 92px;
    height: 126px;
    aspect-ratio: auto;
  }

  .series-card-copy {
    min-width: 0;
    padding: 12px 12px 0;
  }

  .series-card h2,
  .series-card h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .series-card p {
    font-size: 12px;
    line-height: 1.35;
  }

  .series-card .card-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .tag-row {
    overflow: hidden;
    max-height: 34px;
  }

  .popular-panel {
    display: none;
  }

  .reader {
    --reader-toolbar-height: 50px;
    min-height: 100svh;
    background: #050609;
    color: #f8fafc;
  }

  .reader-toolbar {
    top: 0;
    min-height: calc(var(--reader-toolbar-height) + var(--safe-top));
    padding: max(6px, var(--safe-top)) 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 6, 9, 0.88);
    backdrop-filter: blur(18px);
    transform: translateY(0);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .reader.is-toolbar-hidden .reader-toolbar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(-100% - var(--safe-top)));
  }

  .reader-logo {
    display: none;
  }

  .reader-title {
    min-width: 0;
    flex: 1;
  }

  .reader-title strong {
    display: -webkit-box;
    overflow: hidden;
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .reader-title span {
    color: #cbd5e1;
    font-size: 11px;
  }

  .reader-continue-btn {
    display: none;
  }

  .reader-menu-btn,
  .reader-toolbar .icon-btn {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
  }

  .reader-bottom-bar {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, var(--safe-bottom));
    left: max(10px, env(safe-area-inset-left));
    z-index: 24;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    min-height: 58px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 7px;
    background: rgba(12, 14, 19, 0.88);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
    transform: translateY(0);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .reader.is-toolbar-hidden .reader-bottom-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(120% + var(--safe-bottom)));
  }

  .reader-bottom-action {
    display: grid;
    min-width: 0;
    min-height: 44px;
    place-items: center;
    border: 0;
    border-radius: 15px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
  }

  .reader-bottom-action:first-child {
    background: linear-gradient(135deg, #ff8b2b, #ff6f1a);
    color: #ffffff;
  }

  .chapter-stream {
    width: 100vw;
    max-width: 100vw;
    padding: calc(var(--reader-toolbar-height) + var(--safe-top)) 0 calc(94px + var(--safe-bottom));
    overflow-x: hidden;
    background: #050609;
  }

  .chapter-block {
    margin: 0;
    padding: 0;
    content-visibility: visible;
    contain-intrinsic-size: auto;
  }

  .chapter-heading {
    margin: 14px 0 8px;
    border-radius: 0;
    background: #0b0d12;
    color: #cbd5e1;
    font-size: 12px;
  }

  .reader-page {
    width: 100vw;
    max-width: 100vw;
    background: #07080c;
  }

  .page-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 0;
    background: #07080c;
    vertical-align: middle;
  }

  .chapter-block .reader-page + .reader-page {
    margin-top: 0;
  }

  .reader-break,
  .reader-ad {
    width: calc(100vw - 20px);
    margin: 14px auto;
    border-radius: 18px;
  }

  .reader-chapter-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-bottom: calc(82px + var(--safe-bottom));
  }

  .chapter-drawer {
    width: min(92vw, 380px);
    padding-bottom: var(--safe-bottom);
    border-radius: 22px 0 0 22px;
  }

  .drawer-header {
    padding-top: max(14px, var(--safe-top));
  }
}

@media (display-mode: standalone) and (max-width: 720px) {
  .topbar {
    padding-top: var(--safe-top);
  }
}

/* Full homepage redesign: app-like, mobile-first, calm desktop fallback. */
.app-home-shell {
  max-width: 1120px;
  padding-bottom: 88px;
}

.app-home-hero {
  display: grid;
  gap: 18px;
  margin: 18px 0;
  border: 1px solid rgba(255, 139, 43, 0.18);
  border-radius: 32px;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 139, 43, 0.2), transparent 36%),
    radial-gradient(circle at 90% 12%, rgba(37, 99, 235, 0.12), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fff8ef 58%, #f7fbff 100%);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.1);
}

.app-home-hero-copy {
  display: grid;
  gap: 9px;
}

.app-home-hero .eyebrow {
  margin: 0;
  color: #f97316;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-home-hero h2 {
  max-width: 680px;
  margin: 0;
  color: #0f172a;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.app-home-hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: #667085;
  font-size: 16px;
  line-height: 1.65;
}

.app-home-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  padding: 0 17px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.app-home-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 16px;
}

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

.app-home-stats span {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.66);
}

.app-home-stats strong {
  color: #111827;
  font-size: 22px;
  line-height: 1;
}

.app-home-stats small {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.app-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.app-quick-actions a {
  display: grid;
  gap: 4px;
  min-height: 74px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: 15px;
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.app-quick-actions strong {
  font-size: 15px;
}

.app-quick-actions span {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.app-home-feed {
  display: grid;
  gap: 18px;
}

.app-home-feed .continue-section,
.app-home-feed .panel-section,
.app-home-feed .content-rail,
.app-home-feed .tag-cloud,
.app-home-feed .monetization-panel,
.app-home-feed .home-ad {
  margin: 0;
}

.mobile-home-tabbar {
  display: none;
}

@media (max-width: 720px) {
  body:not(:has(.reader)) {
    background:
      radial-gradient(circle at 10% -6%, rgba(255, 139, 43, 0.18), transparent 32%),
      linear-gradient(180deg, #fff8ef 0%, #f3f6fb 42%, #eef2f8 100%);
  }

  .app-home-shell {
    max-width: none;
    padding: 0 12px calc(92px + var(--safe-bottom));
  }

  .app-home-shell .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: calc(100% + 24px);
    min-height: calc(56px + var(--safe-top));
    margin: 0 -12px 12px;
    border-radius: 0 0 24px 24px;
    padding: var(--safe-top) 12px 0;
    background: rgba(17, 24, 39, 0.94);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px);
  }

  .app-home-shell .brand {
    min-width: 124px;
    gap: 8px;
  }

  .app-home-shell .brand-logo img {
    width: 34px;
    height: 34px;
  }

  .app-home-shell .brand-logo-fallback strong {
    font-size: 15px;
  }

  .app-home-shell .brand-logo-fallback small,
  .app-home-shell .brand p,
  .app-home-shell .top-actions {
    display: none;
  }

  .app-home-shell .main-nav {
    gap: 6px;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .app-home-shell .main-nav::-webkit-scrollbar {
    display: none;
  }

  .app-home-shell .main-nav a {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 12px;
  }

  .app-home-hero {
    position: relative;
    gap: 14px;
    margin: 0 0 12px;
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 18px 42px rgba(249, 115, 22, 0.13);
  }

  .app-home-hero .eyebrow {
    font-size: 11px;
  }

  .app-home-hero h2 {
    max-width: 10ch;
    font-size: clamp(34px, 10vw, 42px);
    line-height: 0.94;
  }

  .app-home-hero p:not(.eyebrow) {
    max-width: 31ch;
    font-size: 14px;
    line-height: 1.55;
  }

  .app-home-search {
    position: sticky;
    top: calc(62px + var(--safe-top));
    z-index: 36;
    order: -1;
    min-height: 50px;
    margin: -4px -4px 2px;
    border-radius: 20px;
    padding: 0 14px;
  }

  .app-home-search input {
    font-size: 16px;
  }

  .app-home-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .app-home-stats span {
    border-radius: 16px;
    padding: 10px 9px;
  }

  .app-home-stats strong {
    font-size: 18px;
  }

  .app-home-stats small {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-quick-actions {
    display: grid;
    grid-auto-columns: minmax(146px, 43vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 10px;
    overflow-x: auto;
    margin: 0 -12px 12px;
    padding: 0 12px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .app-quick-actions::-webkit-scrollbar {
    display: none;
  }

  .app-quick-actions a {
    min-height: 70px;
    border-radius: 22px;
    padding: 13px;
    scroll-snap-align: start;
  }

  .app-home-feed {
    gap: 12px;
  }

  .app-home-feed .continue-section,
  .app-home-feed .panel-section,
  .app-home-feed .content-rail,
  .app-home-feed .tag-cloud,
  .app-home-feed .monetization-panel,
  .app-home-feed .home-ad {
    overflow: hidden;
    border: 0;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
  }

  .app-home-feed .section-head,
  .app-home-feed .continue-section .section-head,
  .app-home-feed .content-rail .section-title,
  .app-home-feed .tag-cloud .section-title {
    min-height: auto;
    margin: 0;
    border-bottom: 0;
    padding: 16px 16px 8px;
  }

  .app-home-feed .section-head h2,
  .app-home-feed .continue-section .section-head h2,
  .app-home-feed .section-title {
    color: #101828;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-transform: none;
  }

  .app-home-feed .section-head p {
    max-width: 31ch;
    margin-top: 4px;
    color: #667085;
    font-size: 12px;
    line-height: 1.4;
  }

  .app-home-feed .continue-list {
    display: grid;
    grid-auto-columns: minmax(282px, 84vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: none;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 16px 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .app-home-feed .continue-list::-webkit-scrollbar {
    display: none;
  }

  .app-home-feed .continue-card {
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 126px;
    border: 1px solid rgba(255, 139, 43, 0.2);
    border-radius: 22px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.11);
    scroll-snap-align: start;
  }

  .app-home-feed .continue-card .mini-cover {
    width: 76px;
    height: 100px;
    border-radius: 17px;
  }

  .app-home-feed .continue-list > .empty-state {
    display: grid;
    width: min(304px, calc(100vw - 72px));
    min-height: 112px;
    place-items: center;
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .app-home-feed .trending-grid {
    display: grid;
    grid-auto-columns: minmax(124px, 36vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 16px 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .app-home-feed .trending-grid::-webkit-scrollbar {
    display: none;
  }

  .app-home-feed .trending-card {
    min-width: 0;
    scroll-snap-align: start;
  }

  .app-home-feed .trending-cover {
    border-radius: 20px;
    box-shadow: 0 13px 28px rgba(15, 23, 42, 0.13);
  }

  .app-home-feed .trending-card h3 {
    display: -webkit-box;
    overflow: hidden;
    min-height: 36px;
    font-size: 13px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .app-home-feed .updated-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 12px 14px;
  }

  .app-home-feed .updated-item {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 11px;
    min-height: 110px;
    border: 0;
    border-radius: 20px;
    padding: 10px;
    background: #f8fafc;
  }

  .app-home-feed .update-cover {
    width: 70px;
    height: 94px;
    border-radius: 16px;
  }

  .app-home-feed .updated-item h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.24;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .app-home-feed .chapter-mini-list a {
    min-height: 30px;
    border-radius: 999px;
    padding: 0 10px;
    background: #ffffff;
    align-items: center;
  }

  .app-home-feed .series-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px 12px 14px;
  }

  .app-home-feed .series-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    min-height: 0;
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  }

  .app-home-feed .series-cover {
    width: 88px;
    height: 122px;
    aspect-ratio: auto;
  }

  .app-home-feed .series-card-copy {
    min-width: 0;
    padding: 12px 12px 0;
  }

  .app-home-feed .series-card h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .app-home-feed .series-card .card-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 9px 12px 12px;
  }

  .app-home-feed .tag-cloud > div {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px 16px;
    scrollbar-width: none;
  }

  .app-home-feed .tag-cloud > div::-webkit-scrollbar {
    display: none;
  }

  .app-home-feed .tag-cloud a {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    white-space: nowrap;
  }

  .app-home-feed .monetization-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .app-home-feed .monetization-panel h2 {
    overflow-wrap: anywhere;
    font-size: 20px;
    line-height: 1.2;
  }

  .app-home-feed .support-actions,
  .app-home-feed .primary-action {
    width: 100%;
  }

  .mobile-home-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 42;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + var(--safe-bottom)) max(12px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px);
  }

  .mobile-home-tabbar a {
    display: grid;
    min-height: 44px;
    place-items: center;
    border-radius: 16px;
    color: #475467;
    font-size: 11px;
    text-decoration: none;
  }

  .mobile-home-tabbar a:first-child {
    background: #fff7ed;
    color: #f97316;
  }
}

/* Mobile genre shelves: compact 3x3 app-style blocks under latest updates. */
.desktop-genre-stack {
  display: none;
}

@media (min-width: 721px) {
  .desktop-genre-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
  }

  .desktop-genre-section {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 28px;
    background:
      radial-gradient(circle at 12% 0%, rgba(251, 146, 60, 0.12), transparent 36%),
      linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  }

  .desktop-genre-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 12px;
  }

  .desktop-genre-head p {
    margin: 0 0 4px;
    color: #f97316;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .desktop-genre-head h2 {
    margin: 0;
    color: #101828;
    font-size: clamp(20px, 1.7vw, 26px);
    letter-spacing: -0.035em;
  }

  .desktop-genre-head a {
    flex: 0 0 auto;
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 999px;
    padding: 9px 13px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
  }

  .desktop-genre-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 12px;
    padding: 0 18px 18px;
  }

  .desktop-genre-grid > .empty-state {
    grid-column: 1 / -1;
    margin: 0;
  }

  .desktop-genre-card {
    min-width: 0;
    color: #101828;
    text-decoration: none;
  }

  .desktop-genre-cover {
    display: grid;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    place-items: center;
    border-radius: 18px;
    background: #f1f5f9;
    color: #f97316;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  }

  .desktop-genre-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
  }

  .desktop-genre-card:hover .desktop-genre-cover img {
    transform: scale(1.035);
  }

  .desktop-genre-card strong {
    display: -webkit-box;
    overflow: hidden;
    min-height: 38px;
    margin-top: 9px;
    color: #101828;
    font-size: 14px;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .desktop-genre-card small {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 980px) and (min-width: 721px) {
  .desktop-genre-stack {
    grid-template-columns: 1fr;
  }
}

.mobile-series-stack {
  display: none;
}

@media (max-width: 720px) {
  .desktop-updated-feed {
    display: none;
  }

  .mobile-series-stack {
    display: grid;
    gap: 12px;
  }

  .mobile-series-showcase {
    overflow: hidden;
    border-radius: 26px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 241, 0.94)),
      #ffffff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
  }

  .mobile-series-showcase-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 14px 10px;
  }

  .mobile-series-showcase-head p {
    margin: 0 0 3px;
    color: #f97316;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .mobile-series-showcase-head h2 {
    margin: 0;
    color: #101828;
    font-size: 17px;
    line-height: 1.12;
    letter-spacing: -0.02em;
  }

  .mobile-series-showcase-head a {
    flex: 0 0 auto;
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 999px;
    padding: 8px 11px;
    background: #fff7ed;
    color: #f97316;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
  }

  .mobile-series-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 9px;
    padding: 0 12px 15px;
  }

  .mobile-series-mini-grid > .empty-state {
    grid-column: 1 / -1;
    margin: 0;
    border-radius: 18px;
    padding: 18px 12px;
    font-size: 13px;
    text-align: center;
  }

  .mobile-series-mini-card {
    display: grid;
    min-width: 0;
    color: #101828;
    text-decoration: none;
  }

  .mobile-series-mini-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border-radius: 16px;
    background:
      linear-gradient(135deg, rgba(255, 139, 43, 0.22), rgba(15, 23, 42, 0.08)),
      #f3f4f6;
    box-shadow: 0 11px 22px rgba(15, 23, 42, 0.14);
  }

  .mobile-series-mini-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-series-mini-cover > span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #f97316;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-series-mini-card strong {
    display: -webkit-box;
    overflow: hidden;
    min-height: 32px;
    margin-top: 8px;
    color: #101828;
    font-size: 12px;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .mobile-series-mini-card small {
    overflow: hidden;
    margin-top: 3px;
    color: #667085;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Mobile home correction: clean app-like layout without oversized web sections. */
@media (max-width: 720px) {
  .home-shell {
    padding: 0 12px calc(84px + var(--safe-bottom));
  }

  .home-shell .topbar {
    width: calc(100% + 24px);
    margin: 0 -12px 12px;
    border-radius: 0 0 22px 22px;
  }

  .mobile-search-panel {
    position: sticky;
    top: calc(54px + var(--safe-top));
    z-index: 26;
    display: block;
    margin: 0 -2px 12px;
    border: 0;
    border-radius: 22px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(16px);
  }

  .desktop-search-panel {
    display: none;
  }

  .mobile-search-panel .search-box {
    min-height: 48px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: none;
  }

  .mobile-search-panel input {
    font-size: 16px;
  }

  .home-heading {
    margin: 0 0 12px;
    border-radius: 22px;
    padding: 16px;
    background:
      radial-gradient(circle at 12% 0%, rgba(255, 139, 43, 0.22), transparent 38%),
      linear-gradient(135deg, #ffffff, #fff7ed);
  }

  .home-heading h2 {
    max-width: 100%;
    font-size: clamp(21px, 5.9vw, 24px);
    line-height: 1.12;
    letter-spacing: -0.028em;
  }

  .home-heading p {
    max-width: 34ch;
    margin-top: 8px;
    font-size: 14px;
  }

  .home-layout {
    padding: 0;
  }

  .home-main,
  .home-layout {
    gap: 12px;
  }

  .continue-section,
  .panel-section,
  .tag-cloud,
  .monetization-panel,
  .home-ad {
    width: 100%;
    overflow: hidden;
    border-radius: 24px;
  }

  .section-head,
  .continue-section .section-head {
    padding: 15px 15px 7px;
  }

  .continue-list {
    grid-auto-columns: minmax(274px, 82vw);
    padding: 8px 14px 15px;
  }

  .continue-list > .empty-state {
    display: grid;
    width: min(304px, calc(100vw - 72px));
    min-height: 112px;
    justify-self: center;
    place-items: center;
    border-radius: 18px;
    padding: 18px;
    font-size: 14px;
    text-align: center;
    white-space: normal !important;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    line-height: 1.45;
  }

  .continue-card {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 118px;
    border-radius: 20px;
  }

  .continue-card .mini-cover {
    width: 72px;
    height: 94px;
    border-radius: 15px;
  }

  .trending-section .trending-grid {
    grid-auto-columns: minmax(122px, 36vw);
    padding: 8px 14px 15px;
  }

  .trending-cover {
    border-radius: 18px;
  }

  .updated-section .updated-grid,
  .content-rail .series-grid {
    padding: 8px 10px 12px;
  }

  .updated-item {
    grid-template-columns: 68px minmax(0, 1fr);
    border-radius: 18px;
  }

  .update-cover {
    width: 68px;
    height: 90px;
  }

  .monetization-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }

  .monetization-panel h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 20px;
    line-height: 1.2;
  }

  .support-note {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 14px;
  }

  .support-actions,
  .support-actions .primary-action,
  .primary-action {
    width: 100%;
  }

  .home-ad {
    min-height: 64px;
    border-radius: 20px;
    font-size: 13px;
  }

  .tag-cloud > div {
    margin: 0;
    padding: 0 14px 14px;
  }
}

/* Mobile home app polish: make the landing/catalog feel like a native reading app. */
@media (max-width: 720px) {
  body:not(:has(.reader)) {
    background:
      radial-gradient(circle at 18% -4%, rgba(255, 139, 43, 0.22), transparent 34%),
      linear-gradient(180deg, #fffaf3 0%, #f3f6fb 34%, #eef2f8 100%);
  }

  .home-shell {
    max-width: none;
    padding: 0 0 calc(92px + var(--safe-bottom));
  }

  .home-shell .topbar {
    position: sticky;
    top: 0;
    z-index: 32;
    min-height: calc(56px + var(--safe-top));
    margin: 0 0 8px;
    padding: var(--safe-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    background: rgba(17, 24, 39, 0.92);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
  }

  .home-shell .brand {
    min-width: 128px;
    gap: 8px;
  }

  .home-shell .brand-logo img {
    width: 34px;
    height: 34px;
  }

  .home-shell .brand-logo-fallback strong {
    font-size: 15px;
  }

  .home-shell .brand-logo-fallback small,
  .home-shell .brand p {
    display: none;
  }

  .home-shell .main-nav {
    justify-content: flex-start;
    margin-left: 2px;
    padding-bottom: 2px;
  }

  .home-shell .main-nav a {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 12px;
  }

  .home-shell .top-actions {
    display: none;
  }

  .home-heading {
    margin: 12px 12px 10px;
    border: 1px solid rgba(255, 139, 43, 0.18);
    border-radius: 26px;
    padding: 20px 18px;
    background:
      radial-gradient(circle at 8% 0%, rgba(255, 139, 43, 0.24), transparent 44%),
      linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.96));
    box-shadow: 0 20px 42px rgba(249, 115, 22, 0.12);
  }

  .home-heading h2 {
    max-width: 12ch;
    color: #111827;
    font-size: clamp(26px, 8vw, 34px);
    line-height: 0.98;
    letter-spacing: -0.05em;
    text-transform: none;
  }

  .home-heading p {
    max-width: 30ch;
    margin-top: 12px;
    color: #667085;
    font-size: 14px;
  }

  .home-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 12px;
  }

  .home-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .popular-sidebar {
    display: block;
    order: -1;
  }

  .search-panel {
    top: calc(56px + var(--safe-top));
    z-index: 28;
    margin: 0 -12px;
    border: 0;
    border-radius: 0 0 24px 24px;
    padding: 10px 12px 12px;
    background: rgba(243, 246, 251, 0.86);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  }

  .search-panel .search-box {
    min-height: 48px;
    border: 1px solid rgba(24, 32, 51, 0.08);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  }

  .search-panel input {
    font-size: 16px;
  }

  .continue-section,
  .panel-section,
  .tag-cloud,
  .monetization-panel,
  .home-ad {
    margin: 0;
    border: 0;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
  }

  .continue-section {
    background:
      radial-gradient(circle at 12% 0%, rgba(34, 197, 94, 0.12), transparent 32%),
      linear-gradient(135deg, #ffffff, #fff7ed);
  }

  .section-head,
  .continue-section .section-head {
    min-height: auto;
    border-bottom: 0;
    padding: 16px 16px 8px;
  }

  .section-head h2,
  .continue-section .section-head h2 {
    color: #101828;
    font-size: 17px;
    letter-spacing: -0.02em;
    text-transform: none;
  }

  .section-head p {
    max-width: 28ch;
    margin-top: 4px;
    color: #667085;
    font-size: 12px;
  }

  .continue-list {
    display: grid;
    grid-auto-columns: minmax(286px, 86vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: none;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 8px 16px 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .continue-list::-webkit-scrollbar {
    display: none;
  }

  .continue-card {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 132px;
    border: 1px solid rgba(255, 139, 43, 0.18);
    border-radius: 22px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.12);
    scroll-snap-align: start;
  }

  .continue-card .mini-cover {
    width: 78px;
    height: 104px;
    border-radius: 18px;
  }

  .continue-copy strong {
    font-size: 15px;
    line-height: 1.22;
  }

  .continue-cta {
    min-height: 38px;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 12px;
  }

  .trending-section .trending-grid {
    display: grid;
    grid-auto-columns: minmax(132px, 39vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 8px 16px 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .trending-section .trending-grid::-webkit-scrollbar {
    display: none;
  }

  .trending-card {
    scroll-snap-align: start;
  }

  .trending-cover {
    border-radius: 22px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  }

  .trending-card h3 {
    display: -webkit-box;
    overflow: hidden;
    min-height: 36px;
    font-size: 13px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .updated-section .updated-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 12px 14px;
  }

  .updated-item {
    min-height: 112px;
    border: 0;
    border-radius: 20px;
    padding: 10px;
    background: #f8fafc;
  }

  .updated-item h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .chapter-mini-list {
    gap: 6px;
  }

  .chapter-mini-list a {
    min-height: 30px;
    border-radius: 999px;
    padding: 0 10px;
    background: #ffffff;
    align-items: center;
  }

  .content-rail {
    margin: 0;
  }

  .content-rail .section-title {
    margin: 0;
    padding: 16px 16px 8px;
    font-size: 17px;
  }

  .content-rail .series-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px 12px 14px;
  }

  .series-card {
    grid-template-columns: 88px minmax(0, 1fr);
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  }

  .series-cover {
    width: 88px;
    height: 122px;
    border-radius: 0 18px 18px 0;
  }

  .series-card .card-actions {
    padding: 8px 12px 12px;
  }

  .series-card .card-actions .primary-btn,
  .series-card .card-actions .ghost-btn {
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
  }

  .tag-cloud {
    padding-bottom: 14px;
  }

  .tag-cloud .section-title {
    padding: 16px 16px 8px;
  }

  .tag-cloud > div {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px;
    scrollbar-width: none;
  }

  .tag-cloud > div::-webkit-scrollbar {
    display: none;
  }

  .tag-cloud a {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    white-space: nowrap;
  }

  .monetization-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .monetization-panel h2 {
    font-size: 20px;
  }

  .support-actions {
    display: grid;
    width: 100%;
  }

  .primary-action {
    width: 100%;
    min-height: 48px;
  }

  .home-ad {
    min-height: 76px;
    border: 1px dashed rgba(255, 139, 43, 0.2);
  }
}

/* Keep the public header visually identical across home, follow, history and browse routes. */
@media (min-width: 721px) {
  .site-shell:not(.admin-shell) .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 68px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
  }

  .site-shell:not(.admin-shell) .brand,
  .site-shell:not(.admin-shell) .brand-logo-fallback strong {
    color: #111827;
  }

  .site-shell:not(.admin-shell) .brand-logo-fallback small {
    color: #f97316;
  }

  .site-shell:not(.admin-shell) .main-nav a {
    min-height: 42px;
    border-radius: 999px;
    color: #344054;
    font-size: 14px;
    font-weight: 800;
  }

  .site-shell:not(.admin-shell) .main-nav a:hover,
  .site-shell:not(.admin-shell) .main-nav a.active,
  .site-shell:not(.admin-shell) .main-nav a[aria-current="page"] {
    background: #fff7ed;
    color: #ea580c;
  }

  .site-shell:not(.admin-shell) .top-actions {
    align-items: center;
    flex-wrap: nowrap;
  }

  .site-shell:not(.admin-shell) .user-chip {
    border-color: rgba(249, 115, 22, 0.18);
    color: #111827;
    background: #fff7ed;
  }

  .site-shell:not(.admin-shell) .muted-btn {
    border-color: rgba(249, 115, 22, 0.22);
    background: #fff7ed;
    color: #c2410c;
  }
}

@media (max-width: 720px) {
  .site-shell:not(.admin-shell) .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    align-items: center;
    gap: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 44;
    min-height: calc(56px + var(--safe-top));
    margin: -22px -14px 14px;
    border-radius: 0 0 22px 22px;
    padding: var(--safe-top) 12px 10px;
    background: rgba(17, 24, 39, 0.94);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(18px);
  }

  .site-shell:not(.admin-shell) .brand {
    grid-area: brand;
    min-width: 0;
    gap: 8px;
  }

  .site-shell:not(.admin-shell) .brand-logo img {
    width: 34px;
    height: 34px;
  }

  .site-shell:not(.admin-shell) .brand-logo-fallback strong {
    font-size: 15px;
  }

  .site-shell:not(.admin-shell) .brand-logo-fallback small,
  .site-shell:not(.admin-shell) .brand p {
    display: none;
  }

  .site-shell:not(.admin-shell) .main-nav {
    grid-area: nav;
    width: 100%;
    margin-left: 0;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .site-shell:not(.admin-shell) .main-nav::-webkit-scrollbar {
    display: none;
  }

  .site-shell:not(.admin-shell) .main-nav a {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 12px;
    font-weight: 800;
  }

  .site-shell:not(.admin-shell) .main-nav a.active,
  .site-shell:not(.admin-shell) .main-nav a[aria-current="page"] {
    background: #ffffff;
    color: #ea580c;
  }

  .site-shell:not(.admin-shell) .top-actions {
    display: flex;
    grid-area: actions;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .site-shell:not(.admin-shell) .user-chip {
    max-width: min(34vw, 132px);
    min-height: 34px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 12px;
  }

  .site-shell:not(.admin-shell) .login-btn {
    min-height: 34px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 12px;
  }

  .site-shell:not(.admin-shell) .logout-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Featured tags home section. Keep near the end so it overrides generic tag-cloud rules. */
.app-home-feed .app-all-series {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.app-home-feed .app-all-series .section-title {
  margin: 0;
  padding: 20px 22px 4px;
  color: #101828;
  font-size: 20px;
  line-height: 1.2;
}

.app-home-feed .app-all-series .series-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 16px 20px 22px;
}

.app-home-feed .app-all-series .series-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.app-home-feed .app-all-series .series-cover {
  width: 100%;
  height: 210px;
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: 0;
}

.app-home-feed .app-all-series .series-card-copy {
  min-width: 0;
  padding: 10px 10px 0;
}

.app-home-feed .app-all-series .series-card h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 36px;
  color: #101828;
  font-size: 14px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-home-feed .app-all-series .series-card p {
  display: none;
}

.app-home-feed .app-all-series .tag-row {
  max-height: 28px;
  overflow: hidden;
  gap: 5px;
  margin-top: 8px;
}

.app-home-feed .app-all-series .tag-row a {
  min-height: 24px;
  border-color: rgba(249, 115, 22, 0.18);
  border-radius: 999px;
  padding: 4px 7px;
  color: #c2410c;
  background: #fff7ed;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.app-home-feed .app-all-series .card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.app-home-feed .app-all-series .card-actions .primary-btn,
.app-home-feed .app-all-series .card-actions .ghost-btn {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 720px) {
  .app-home-feed .app-all-series {
    border-radius: 22px;
  }

  .app-home-feed .app-all-series .section-title {
    padding: 16px 14px 6px;
    font-size: 18px;
  }

  .app-home-feed .app-all-series .series-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 8px 12px 16px;
  }

  .app-home-feed .app-all-series .series-card {
    display: flex;
    grid-template-columns: none;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  }

  .app-home-feed .app-all-series .series-cover {
    width: 100%;
    height: 184px;
    aspect-ratio: auto;
    overflow: hidden;
    border-radius: 0;
  }

  .app-home-feed .app-all-series .series-card-copy {
    padding: 9px 9px 0;
  }

  .app-home-feed .app-all-series .series-card h3 {
    min-height: 34px;
    font-size: 13px;
    line-height: 1.3;
  }

  .app-home-feed .app-all-series .tag-row {
    display: none;
  }

  .app-home-feed .app-all-series .card-actions {
    grid-column: auto;
    grid-template-columns: 1fr;
    padding: 9px;
  }

  .app-home-feed .app-all-series .card-actions .ghost-btn {
    display: none;
  }
}

.app-featured-tags {
  overflow: hidden;
  border: 1px solid rgba(255, 139, 43, 0.22);
  border-radius: 26px;
  padding: 22px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 139, 43, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.86));
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.featured-tags-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.featured-tags-head .eyebrow {
  margin: 0 0 5px;
  color: #fb923c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.featured-tags-head .section-title {
  margin: 0;
}

.featured-tags-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 139, 43, 0.12);
  color: #c2410c;
  font-size: 12px;
  font-weight: 900;
}

.featured-tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.featured-tag-chip {
  display: grid;
  gap: 4px;
  min-height: 70px;
  align-content: center;
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  color: #111827;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.featured-tag-chip:hover,
.featured-tag-chip:focus-visible {
  border-color: rgba(249, 115, 22, 0.55);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.16);
  transform: translateY(-2px);
}

.featured-tag-chip strong {
  overflow: hidden;
  color: #111827;
  font-size: 15px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-tag-chip small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.featured-tags-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  border: 1px dashed rgba(249, 115, 22, 0.32);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.66);
  color: #64748b;
}

.featured-tags-empty strong {
  color: #111827;
}

.admin-origin-picker {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.9), rgba(255, 255, 255, 0.82));
}

.admin-origin-picker > div:first-child {
  display: grid;
  gap: 3px;
}

.admin-origin-picker > div:first-child strong {
  color: #111827;
}

.admin-origin-picker > div:first-child span {
  color: #667085;
  font-size: 13px;
}

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

.admin-origin-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 74px;
  border: 1px solid rgba(24, 32, 51, 0.12);
  border-radius: 15px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.admin-origin-option:hover,
.admin-origin-option:focus-within,
.admin-origin-option.active {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 12px 26px rgba(249, 115, 22, 0.12);
  transform: translateY(-1px);
}

.admin-origin-option input {
  margin-top: 3px;
  accent-color: #f97316;
}

.admin-origin-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-origin-option strong {
  color: #111827;
  font-size: 14px;
}

.admin-origin-option small {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.production-pipeline-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.production-pipeline-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.production-pipeline-step strong {
  display: block;
  color: #111827;
  font-size: 15px;
}

.production-pipeline-step p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.production-pipeline-step .ghost-btn {
  min-width: 148px;
}

@media (max-width: 720px) {
  .app-featured-tags {
    border-radius: 22px;
    padding: 18px;
  }

  .featured-tags-head {
    align-items: start;
  }

  .featured-tags-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .featured-tag-chip {
    min-height: 64px;
    border-radius: 16px;
    padding: 11px 12px;
  }

  .featured-tag-chip strong {
    font-size: 14px;
  }

  .admin-origin-options {
    grid-template-columns: 1fr;
  }

  .production-pipeline-step {
    grid-template-columns: 1fr;
  }

  .production-pipeline-step .ghost-btn {
    width: 100%;
  }
}
