:root {
  --bg: #07070a;
  --surface: #101015;
  --surface-2: #17171e;
  --surface-3: #202029;
  --text: #f8f7fb;
  --muted: #9795a5;
  --line: rgba(255,255,255,.09);
  --accent: #e11d48;
  --accent-2: #ff425f;
  --accent-soft: rgba(225,29,72,.14);
  --header-bg: rgba(7,7,10,.86);
  --nav-bg: rgba(22,22,29,.9);
  --sheet-bg: #101014;
  --toast-bg: rgba(31,31,39,.95);
  --placeholder: #747281;
  --subtle-text: #d8d6df;
  --description: #bbb8c5;
  --badge-bg: rgba(16,16,21,.82);
  --reader-bg: #050507;
  --reader-page-bg: #0b0b0e;
  --reader-ui: rgba(34,34,42,.9);
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px), var(--telegram-safe-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px), var(--telegram-safe-bottom, 0px));
  --radius: 22px;
  --header-height: 70px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #ececf2;
  --surface-3: #dedee7;
  --text: #15151c;
  --muted: #6f6e7b;
  --line: rgba(19,19,28,.11);
  --accent-soft: rgba(225,29,72,.1);
  --header-bg: rgba(245,245,248,.9);
  --nav-bg: rgba(255,255,255,.92);
  --sheet-bg: #ffffff;
  --toast-bg: rgba(28,28,35,.95);
  --placeholder: #898896;
  --subtle-text: #393842;
  --description: #5e5c68;
  --badge-bg: rgba(255,255,255,.88);
  --reader-bg: #f5f5f8;
  --reader-page-bg: #ffffff;
  --reader-ui: rgba(255,255,255,.92);
  color-scheme: light;
}

html[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg: #f5f5f8;
    --surface: #ffffff;
    --surface-2: #ececf2;
    --surface-3: #dedee7;
    --text: #15151c;
    --muted: #6f6e7b;
    --line: rgba(19,19,28,.11);
    --accent-soft: rgba(225,29,72,.1);
    --header-bg: rgba(245,245,248,.9);
    --nav-bg: rgba(255,255,255,.92);
    --sheet-bg: #ffffff;
    --toast-bg: rgba(28,28,35,.95);
    --placeholder: #898896;
    --subtle-text: #393842;
    --description: #5e5c68;
    --badge-bg: rgba(255,255,255,.88);
    --reader-bg: #f5f5f8;
    --reader-page-bg: #ffffff;
    --reader-ui: rgba(255,255,255,.92);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); overscroll-behavior-y: none; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.is-hidden { display: none !important; }

.splash {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  overflow: hidden; background: #f6f3ed;
  animation: splash-darken 1.05s ease 1.45s forwards, splash-away .52s cubic-bezier(.7,0,.3,1) 3.15s forwards;
}
.splash.splash-disabled { display: none; }
.splash::before {
  content: ""; position: absolute; inset: -20%; opacity: 0;
  background: radial-gradient(circle, rgba(255,124,30,.18), transparent 35%);
  animation: splash-heat 1.3s ease 1.55s forwards;
}
.splash-scene { position: relative; width: min(78vw,340px); aspect-ratio: 1; display: grid; place-items: center; }
.splash-orbit { position: absolute; inset: -4%; width: 108%; height: 108%; overflow: visible; }
.splash-orbit path {
  fill: none; stroke: #111015; stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 590; stroke-dashoffset: 590; opacity: .86;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.12));
  animation: splash-draw-orbit .82s cubic-bezier(.3,.8,.3,1) .18s forwards, splash-ink-away .52s ease 1.42s forwards;
}
.splash-orbit path + path { stroke-width: 3; animation-delay: .34s, 1.42s; }
.splash-brush-mark { position: relative; z-index: 2; width: 62%; height: 62%; overflow: visible; filter: url(#brushRoughness); }
.splash-brush-stroke {
  fill: #07070a; stroke: none; clip-path: inset(0 100% 0 0);
  animation: splash-draw-x .48s cubic-bezier(.18,.74,.25,1) forwards, splash-ignite .82s ease 1.5s forwards;
}
.splash-brush-stroke-a { animation-delay: .64s, 1.5s; }
.splash-brush-stroke-b { animation-delay: .94s, 1.5s; }
.splash-ink-dot { fill: #07070a; opacity: 0; animation: splash-dot-in .18s ease forwards, splash-dot-ignite .7s ease 1.5s forwards; }
.splash-ink-dot-a { animation-delay: .78s, 1.5s; }
.splash-ink-dot-b { animation-delay: 1.12s, 1.5s; }
.splash-ink-dot-c { animation-delay: 1.18s, 1.5s; }
.splash-fire {
  position: absolute; z-index: 1; width: 48%; aspect-ratio: 1; opacity: 0; border-radius: 38%;
  background: conic-gradient(from 12deg, #ffcf5a, #ff5b16, #ffb62e, #ff3514, #ffd36c, #ff5b16);
  filter: blur(16px); transform: rotate(45deg) scale(.58);
  animation: splash-fire-bloom .9s cubic-bezier(.16,.85,.28,1) 1.48s forwards;
}
.splash-embers { position: absolute; z-index: 3; inset: 50%; }
.splash-embers i {
  position: absolute; width: 3px; height: 18px; border-radius: 99px; opacity: 0;
  background: linear-gradient(#fff6bd, #ff8c24 44%, transparent);
  box-shadow: 0 0 9px #ff5b16;
  animation: splash-ember .82s ease-out calc(1.62s + var(--d)) forwards;
}
.splash-brand {
  position: absolute; z-index: 4; left: 50%; bottom: 7%; display: flex; gap: .2em;
  color: white; font-size: clamp(28px,8vw,42px); font-weight: 900; letter-spacing: -.07em;
  opacity: 0; transform: translate(-50%,12px) scale(.92); text-shadow: 0 4px 28px rgba(0,0,0,.65);
  animation: splash-brand-in .5s cubic-bezier(.2,.8,.2,1) 2.1s forwards;
}
.splash-brand b { color: #ff5b24; text-shadow: 0 0 18px rgba(255,99,36,.85); }
.splash-flash {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0, #fff7db 12%, rgba(255,121,29,.64) 27%, transparent 58%);
  transform: scale(.35);
  animation: splash-flare .48s ease-out 2.66s forwards;
}
@keyframes splash-draw-orbit { to { stroke-dashoffset: 0; } }
@keyframes splash-ink-away { to { opacity: 0; transform: scale(1.08); } }
@keyframes splash-draw-x { to { clip-path: inset(0 0 0 0); } }
@keyframes splash-ignite {
  0% { fill: #07070a; filter: none; }
  34% { fill: #ffdd75; filter: drop-shadow(0 0 5px #ffad31); }
  100% { fill: #ff5b16; filter: drop-shadow(0 0 8px #ff7a18) drop-shadow(0 0 24px #ff3514); }
}
@keyframes splash-dot-in { to { opacity: .82; } }
@keyframes splash-dot-ignite { to { fill: #ff7a18; opacity: .9; filter: drop-shadow(0 0 7px #ff4a12); } }
@keyframes splash-darken { to { background: #08090d; } }
@keyframes splash-heat { 35% { opacity: 1; } 100% { opacity: .42; transform: scale(1.18); } }
@keyframes splash-fire-bloom { 28% { opacity: .95; } 100% { opacity: .48; transform: rotate(49deg) scale(1.22); } }
@keyframes splash-ember {
  0% { opacity: 0; transform: translate(0,0) rotate(var(--r)) scale(.4); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx),var(--ty)) rotate(var(--r)) scale(.05); }
}
@keyframes splash-brand-in { to { opacity: 1; transform: translate(-50%,0) scale(1); } }
@keyframes splash-flare { 0% { opacity: 0; transform: scale(.35); } 35% { opacity: .96; } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes splash-away { to { opacity: 0; visibility: hidden; transform: scale(1.035); } }

.app-shell { max-width: 760px; min-height: 100vh; margin: 0 auto; background: var(--bg); }
.app-header {
  position: sticky; top: 0; z-index: 60; height: calc(var(--header-height) + var(--safe-top));
  padding: var(--safe-top) 12px 0; display: grid; grid-template-columns: 44px 1fr auto; align-items: center;
  border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(20px) saturate(140%);
}
html.app-fullscreen .app-header {
  --app-fullscreen-safe-top: max(var(--safe-top), 100px);
  height: calc(var(--header-height) + var(--app-fullscreen-safe-top));
  padding-top: var(--app-fullscreen-safe-top);
}
.brand { position: absolute; left: 50%; transform: translateX(-50%); border: 0; background: transparent; color: var(--text); font-weight: 900; font-size: 23px; letter-spacing: -.055em; cursor: pointer; }
.brand b { color: var(--accent-2); margin-left: 4px; font-size: 26px; }
.header-actions { display: flex; justify-self: end; gap: 0; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; cursor: pointer; }
.icon-button:active { background: var(--surface-2); transform: scale(.95); }
.icon-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-back { justify-self: start; }
.header-back.is-hidden { display: grid !important; visibility: hidden; pointer-events: none; }
.main-content { padding: 0 18px calc(102px + var(--safe-bottom)); }
.view { display: none; animation: view-in .28s ease-out; }
.view-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

.hero-copy { padding: 30px 2px 22px; }
.eyebrow { display: block; color: var(--accent-2); font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .16em; }
.hero-copy h1 { margin: 10px 0 0; font-size: clamp(31px, 8.3vw, 48px); line-height: .99; letter-spacing: -.058em; }
.hero-copy h1 em { color: var(--muted); font-style: normal; font-weight: 550; }
.search-box { height: 58px; padding: 0 15px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: rgba(255,66,95,.6); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-box svg { width: 23px; height: 23px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-box input::placeholder { color: var(--placeholder); }
.clear-search { border: 0; background: transparent; color: var(--muted); font-size: 26px; cursor: pointer; }
.search-mode .hero-copy,
.search-mode .sort-row,
.search-mode .filter-row { display: none; }
.search-mode .search-box { margin-top: 14px; }
.search-mode .section-heading { margin-top: 18px; }
.sort-row { display: flex; gap: 8px; padding: 14px 0 12px; overflow-x: auto; scrollbar-width: none; }
.sort-row::-webkit-scrollbar { display: none; }
.sort-chip { flex: 1; min-width: max-content; border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.sort-chip.is-active { border-color: var(--text); background: var(--text); color: var(--bg); }
.filter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 26px; }
.filter-row-single { grid-template-columns: 1fr; }
.filter-button { min-width: 0; padding: 11px 7px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--subtle-text); font-size: 13px; font-weight: 650; cursor: pointer; }
.filter-button svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-button-wide { min-height: 58px; padding: 9px 14px; justify-content: flex-start; text-align: left; }
.filter-button-wide > span { flex: 1; }
.filter-button-wide strong, .filter-button-wide small { display: block; }
.filter-button-wide strong { color: var(--text); font-size: 14px; }
.filter-button-wide small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.filter-button-wide b { min-width: 25px; padding: 5px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-2); text-align: center; font-size: 11px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 5px 1px 16px; }
.section-heading h2 { margin: 7px 0 0; font-size: 22px; letter-spacing: -.035em; }
.result-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.manga-card { position: relative; border: 0; padding: 0; overflow: hidden; aspect-ratio: .69; border-radius: 18px; background: var(--surface-2); color: #f8f7fb; text-align: left; cursor: pointer; isolation: isolate; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.manga-card:active { transform: scale(.975); }
.manga-card::after { content: ""; position: absolute; inset: 26% 0 0; z-index: 1; background: linear-gradient(transparent, rgba(5,5,8,.68) 36%, rgba(5,5,8,.98)); }
.manga-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.manga-card:hover img { transform: scale(1.035); }
.card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(145deg,#2b1b24,#111116); color: var(--accent-2); font-size: 42px; font-weight: 900; }
.card-badge { position: absolute; top: 9px; left: 9px; z-index: 2; padding: 5px 8px; border-radius: 8px; background: rgba(7,7,10,.76); color: #f8f7fb; backdrop-filter: blur(10px); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.card-info { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 11px; }
.card-info strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; line-height: 1.13; letter-spacing: -.025em; }
.card-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px 9px; color: #cfccd6; font-size: 11px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.skeleton { min-height: 245px; border-radius: 18px; background: linear-gradient(100deg,var(--surface) 20%,var(--surface-2) 40%,var(--surface) 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }
.empty-state { padding: 58px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-icon { color: var(--accent-2); font-size: 56px; }
.empty-state h3 { margin: 8px 0 4px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }
.primary-button, .outline-button { width: 100%; border-radius: 15px; padding: 15px 18px; font-weight: 800; cursor: pointer; }
.primary-button { border: 0; background: var(--accent); color: white; box-shadow: 0 10px 30px rgba(225,29,72,.22); }
.outline-button { margin-top: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }

.detail-hero { position: relative; margin: 0 -18px; min-height: 500px; overflow: hidden; }
.detail-backdrop { position: absolute; inset: 0 0 auto; height: 450px; overflow: hidden; }
.detail-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(18px) saturate(.7); transform: scale(1.12); opacity: .36; }
.detail-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(7,7,10,.08), var(--bg) 94%); }
.detail-content { position: relative; z-index: 1; padding: 30px 22px 12px; text-align: center; }
.detail-cover { width: min(64vw, 280px); aspect-ratio: .7; object-fit: cover; border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.55); background: var(--surface-2); }
.detail-badges { margin: 17px auto 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.detail-badges span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--badge-bg); color: var(--subtle-text); font-size: 12px; }
.detail-title { margin: 22px auto 0; max-width: 620px; font-size: clamp(29px, 8vw, 44px); line-height: 1.04; letter-spacing: -.055em; }
.original-title { margin: 10px auto 0; max-width: 580px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; margin: 22px auto 0; max-width: 560px; }
.favorite-button { border: 0; border-radius: 15px; padding: 14px 16px; background: var(--accent); color: white; font-weight: 800; cursor: pointer; }
.favorite-button.is-favorite { background: var(--surface-2); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(255,66,95,.3); }
.list-button { border: 1px solid var(--line); border-radius: 15px; padding: 14px 10px; background: var(--surface); color: var(--text); font-weight: 800; cursor: pointer; }
.list-button.is-listed { border-color: rgba(255,66,95,.42); background: var(--accent-soft); color: var(--accent-2); }
.share-button { width: 50px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.share-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.detail-block { padding: 21px 0 4px; border-top: 1px solid var(--line); }
.detail-block h3 { margin: 0 0 13px; display: flex; align-items: center; gap: 9px; font-size: 21px; }
.detail-block p { margin: 0; color: var(--description); font-size: 15px; line-height: 1.65; }
.genre-list { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-pill { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--subtle-text); background: var(--surface); font-size: 12px; }
.chapter-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chapter-header h3 { margin: 0; }
.chapter-header span { color: var(--muted); font-size: 12px; }
.chapter-list { display: grid; gap: 8px; }
.chapter-row { width: 100%; min-height: 66px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; cursor: pointer; }
.chapter-row:active { background: var(--surface-2); }
.chapter-row strong { font-size: 14px; }
.chapter-row span { color: var(--muted); font-size: 12px; }
.chapter-row i { color: var(--accent-2); font-style: normal; }

.favorites-header, .profile-header { padding: 35px 2px 20px; }
.favorites-header h1, .profile-header h1 { margin: 8px 0 0; font-size: 36px; letter-spacing: -.055em; }
.favorites-header p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.library-tabs { margin: 0 -18px 20px; padding: 0 18px 6px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.library-tabs::-webkit-scrollbar { display: none; }
.library-tab { flex: 0 0 auto; min-height: 43px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); font-weight: 750; cursor: pointer; }
.library-tab > span { color: var(--accent-2); font-size: 16px; }
.library-tab b { min-width: 22px; padding: 3px 6px; border-radius: 99px; background: var(--surface-2); color: var(--subtle-text); font-size: 10px; }
.library-tab.is-active { border-color: rgba(255,66,95,.5); background: var(--accent-soft); color: var(--text); }
.library-tab.is-active b { background: rgba(255,66,95,.18); color: var(--accent-2); }
.library-current-heading { margin: 0 2px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.library-current-heading > div { display: flex; align-items: center; gap: 8px; }
.library-current-heading > div > span { color: var(--accent-2); font-size: 20px; }
.library-current-heading h2 { margin: 0; font-size: 21px; }
.library-current-heading small { color: var(--muted); }
.library-empty { padding: 34px 22px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; background: var(--surface); }
.library-empty > div { color: var(--accent-2); font-size: 32px; }
.library-empty h3 { margin: 8px 0 4px; }
.library-empty p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.favorite-list { display: grid; gap: 10px; }
.favorite-list-item { width: 100%; padding: 9px; display: grid; grid-template-columns: 67px 1fr 34px; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; cursor: pointer; }
.favorite-list-item img { width: 67px; aspect-ratio: .72; object-fit: cover; border-radius: 11px; }
.favorite-list-copy { min-width: 0; }
.favorite-list-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.favorite-list-copy small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.favorite-list-item b { color: var(--accent-2); font-size: 22px; }
.profile-card { position: relative; overflow: hidden; padding: 25px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg,#21121a,var(--surface) 55%); }
.profile-card::after { content: "X"; position: absolute; top: -32px; right: 5px; color: rgba(255,66,95,.08); font-size: 180px; font-weight: 1000; transform: rotate(8deg); }
.avatar { position: relative; z-index: 1; width: 78px; height: 78px; padding: 0; overflow: hidden; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: white; font-size: 28px; font-weight: 900; box-shadow: 0 0 0 6px rgba(225,29,72,.12); cursor: pointer; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit > span { position: absolute; right: 0; bottom: 0; width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); color: white; font-size: 12px; }
.profile-avatar-button { position: relative; z-index: 1; margin-top: 15px; padding: 10px 13px; border: 1px solid rgba(255,66,95,.4); border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); font-size: 12px; font-weight: 800; cursor: pointer; }
.profile-card h2 { position: relative; z-index: 1; margin: 17px 0 4px; font-size: 25px; }
.profile-status { position: relative; z-index: 1; color: var(--accent-2); font-size: 13px; font-weight: 700; }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 18px; }
.stat-card { padding: 16px 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: center; }
.stat-card strong { display: block; font-size: 21px; }
.stat-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.profile-note { margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1.55; }
.recent-reading { margin-top: 24px; }
.recent-reading-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.recent-reading-heading h2 { margin: 7px 0 0; font-size: 22px; letter-spacing: -.035em; }
.recent-reading-heading small { color: var(--muted); font-size: 11px; }
.recent-reading-list { display: grid; gap: 9px; }
.recent-reading-item { width: 100%; min-width: 0; padding: 9px; display: grid; grid-template-columns: 56px minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.recent-reading-item img, .recent-reading-placeholder { width: 56px; height: 76px; border-radius: 11px; object-fit: cover; }
.recent-reading-placeholder { display: grid; place-items: center; background: linear-gradient(145deg,#2b1b24,#111116); color: var(--accent-2); font-size: 25px; font-weight: 900; }
.recent-reading-copy { min-width: 0; }
.recent-reading-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.recent-reading-copy small { display: block; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recent-reading-copy i { display: block; height: 4px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.recent-reading-copy i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--accent-2)); }
.recent-reading-action { color: var(--accent-2); font-size: 11px; font-weight: 800; white-space: nowrap; }

.bottom-nav { position: fixed; z-index: 70; left: 50%; bottom: max(10px, var(--safe-bottom)); transform: translateX(-50%); width: min(calc(100% - 26px), 700px); min-height: 66px; padding: 6px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 22px; background: var(--nav-bg); backdrop-filter: blur(24px) saturate(140%); box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.nav-item { border: 0; border-radius: 16px; background: transparent; color: #8f8d9b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10px; font-weight: 700; cursor: pointer; }
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent-2); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: end; background: rgba(0,0,0,.67); backdrop-filter: blur(5px); }
.sheet { width: min(100%,760px); max-height: 87vh; margin: 0 auto; padding: 8px 20px calc(22px + var(--safe-bottom)); overflow-y: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; background: var(--sheet-bg); animation: sheet-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-handle { width: 42px; height: 4px; margin: 2px auto 18px; border-radius: 99px; background: #5f5d67; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; }
.sheet-header h2 { margin: 7px 0 0; font-size: 27px; }
.sheet-header .icon-button { border: 1px solid var(--line); font-size: 26px; }
.sheet-group { margin-top: 24px; }
.sheet-group h3 { margin: 0 0 11px; color: var(--subtle-text); font-size: 14px; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 13px; cursor: pointer; }
.choice.is-active { border-color: rgba(255,66,95,.56); background: var(--accent-soft); color: var(--accent-2); }
.choice-scroll { max-height: 190px; overflow-y: auto; }
.sheet-apply { margin-top: 28px; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(94px + var(--safe-bottom)); max-width: calc(100% - 32px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--toast-bg); color: white; box-shadow: 0 12px 40px rgba(0,0,0,.35); transform: translate(-50%,25px); opacity: 0; pointer-events: none; transition: .25s ease; font-size: 13px; text-align: center; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

.theme-sheet { padding-bottom: calc(28px + var(--safe-bottom)); }
.theme-options { display: grid; gap: 10px; margin-top: 24px; }
.theme-choice { width: 100%; min-height: 72px; padding: 10px 14px; display: grid; grid-template-columns: 42px 1fr 24px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; cursor: pointer; }
.theme-choice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-2); color: var(--accent-2); font-size: 22px; }
.theme-choice strong, .theme-choice small { display: block; }
.theme-choice strong { font-size: 15px; }
.theme-choice small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.theme-choice b { visibility: hidden; color: var(--accent-2); font-size: 18px; }
.theme-choice.is-active { border-color: rgba(255,66,95,.56); background: var(--accent-soft); }
.theme-choice.is-active b { visibility: visible; }

.app-settings-sheet { padding-bottom: calc(26px + var(--safe-bottom)); }
.app-setting-group { margin-top: 24px; }
.app-setting-group h3 { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.app-toggle-list { display: grid; margin-top: 20px; border-top: 1px solid var(--line); }
.app-toggle-list > button { min-height: 66px; padding: 9px 2px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.app-toggle-list span, .app-toggle-list small { display: block; }
.app-toggle-list small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.app-toggle-list b { flex: 0 0 auto; width: 43px; height: 25px; position: relative; border-radius: 99px; background: #3a3942; }
.app-toggle-list b::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .2s; }
.app-toggle-list button.is-active b { background: var(--accent); }
.app-toggle-list button.is-active b::after { transform: translateX(18px); }
.settings-reset-button { width: 100%; margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-weight: 750; cursor: pointer; }
.settings-version { margin: 15px 0 0; color: var(--muted); font-size: 9px; text-align: center; }

.library-sheet { padding-bottom: calc(28px + var(--safe-bottom)); }
.library-choices { display: grid; gap: 9px; margin-top: 22px; }
.library-choice { width: 100%; min-height: 66px; padding: 9px 13px; display: grid; grid-template-columns: 42px 1fr 24px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.library-choice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-2); color: var(--accent-2); font-size: 20px; font-weight: 900; }
.library-choice-copy { min-width: 0; }
.library-choice-copy strong, .library-choice-copy small { display: block; }
.library-choice-copy strong { font-size: 15px; }
.library-choice-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.library-choice b { color: var(--accent-2); visibility: hidden; }
.library-choice.is-active { border-color: rgba(255,66,95,.54); background: var(--accent-soft); }
.library-choice.is-active b { visibility: visible; }
.new-list-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 16px; }
.new-list-form input { min-width: 0; height: 50px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text); }
.new-list-form button { padding: 0 16px; border: 0; border-radius: 13px; background: var(--accent); color: white; font-weight: 800; cursor: pointer; }
.library-section { margin-top: 22px; }
.library-section h2 { margin: 0 0 11px; font-size: 20px; }
.library-section-title { display: flex; align-items: center; justify-content: space-between; }
.library-section-title span { color: var(--muted); font-size: 12px; }

.reader { position: fixed; inset: 0; z-index: 500; overflow-y: auto; background: var(--reader-bg); color: var(--text); overscroll-behavior-y: contain; }
.reader-header { position: fixed; top: 0; left: 0; right: 0; z-index: 6; min-height: calc(58px + var(--safe-top)); padding: var(--safe-top) 8px 0; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; background: var(--reader-ui); backdrop-filter: blur(20px) saturate(135%); border-bottom: 1px solid var(--line); transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .2s ease; will-change: transform, opacity; }
.reader.reader-fullscreen .reader-header {
  --reader-fullscreen-safe-top: max(var(--safe-top), 100px);
  min-height: calc(58px + var(--reader-fullscreen-safe-top));
  padding-top: var(--reader-fullscreen-safe-top);
}
.reader-icon { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.reader-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.reader-title { min-width: 0; text-align: center; }
.reader-title strong, .reader-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-title strong { font-size: 13px; }
.reader-title span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.reader-loading { min-height: calc(100vh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.reader-logo { font-size: 30px; font-weight: 900; letter-spacing: -.05em; }
.reader-logo b { color: var(--accent-2); }
.progress-track { width: min(240px,65vw); height: 4px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.progress-track i { display: block; width: 8%; height: 100%; border-radius: inherit; background: var(--accent-2); transition: width .25s; }
.reader-loading span { color: var(--muted); font-size: 12px; }
.reader-pages { width: min(100%,980px); min-height: 100vh; margin: 0 auto; padding-bottom: calc(82px + var(--safe-bottom)); background: var(--reader-page-bg); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.reader-pages img { display: block; width: 100%; min-width: 100%; height: auto; object-fit: contain; background: var(--reader-page-bg); user-select: none; -webkit-user-drag: none; }
.reader.reader-fit-height:not(.reader-mode-paged) .reader-pages img { width: auto; min-width: 0; max-width: 100%; max-height: 100vh; margin: 0 auto; }
.reader.reader-mode-paged { overflow: hidden; }
.reader.reader-mode-paged .reader-pages { width: 100%; height: 100vh; min-height: 0; padding: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.reader.reader-mode-paged .reader-pages::-webkit-scrollbar { display: none; }
.reader.reader-mode-paged .reader-pages img { flex: 0 0 100%; width: 100%; min-width: 100%; height: 100vh; object-fit: contain; scroll-snap-align: start; }
.reader-controls { position: fixed; z-index: 6; left: 50%; bottom: max(10px,var(--safe-bottom)); transform: translateX(-50%); width: min(calc(100% - 22px),640px); height: 61px; padding: 5px; display: grid; grid-template-columns: repeat(7,1fr); align-items: center; border: 1px solid var(--line); border-radius: 21px; background: var(--reader-ui); backdrop-filter: blur(25px) saturate(135%); box-shadow: 0 10px 40px rgba(0,0,0,.35); transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .2s ease; will-change: transform, opacity; }
.reader.reader-chrome-hidden .reader-header { transform: translateY(calc(-100% - 4px)); opacity: 0; pointer-events: none; }
.reader.reader-chrome-hidden .reader-controls { transform: translateX(-50%) translateY(calc(100% + 30px)); opacity: 0; pointer-events: none; }
.reader-controls button { height: 48px; border: 0; border-radius: 15px; background: transparent; display: grid; place-items: center; cursor: pointer; }
.reader-controls button:disabled { opacity: .2; }
.reader-controls button:active { background: rgba(255,255,255,.08); }
.reader-controls button.is-active { background: var(--accent-soft); color: var(--accent-2); }
.reader-controls .auto-stop-icon { display: none; }
.reader-controls #readerAutoScroll.is-active .auto-play-icon { display: none; }
.reader-controls #readerAutoScroll.is-active .auto-stop-icon { display: block; }
.reader-controls svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reader-controls strong { text-align: center; font-size: 15px; }
.reader-page-number { position: fixed; z-index: 5; left: 50%; bottom: calc(82px + var(--safe-bottom)); transform: translateX(-50%); padding: 6px 10px; border-radius: 10px; background: rgba(12,12,16,.76); color: white; font-size: 11px; backdrop-filter: blur(12px); }

.reader-chapter-backdrop { position: fixed; inset: 0; z-index: 10; display: flex; align-items: end; overflow: hidden; overscroll-behavior: contain; touch-action: pan-y; background: rgba(0,0,0,.7); backdrop-filter: blur(7px); }
.reader-chapter-panel { width: min(100%,760px); max-height: 82vh; margin: 0 auto; padding: 8px 16px calc(18px + var(--safe-bottom)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; background: var(--sheet-bg); color: var(--text); animation: sheet-in .26s cubic-bezier(.2,.8,.2,1); }
.reader-chapter-heading { display: flex; align-items: center; justify-content: space-between; }
.reader-chapter-heading h2 { margin: 6px 0 0; font-size: 26px; }
.reader-chapter-heading .icon-button { border: 1px solid var(--line); }
.resume-reading-button { width: 100%; margin: 18px 0 12px; padding: 14px; border: 1px solid rgba(255,66,95,.45); border-radius: 14px; background: rgba(225,29,72,.14); color: #ff6078; font-weight: 800; cursor: pointer; }
.reader-chapter-list { display: grid; gap: 8px; }
.reader-chapter-choice { width: 100%; min-height: 58px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; }
.reader-chapter-choice span { color: var(--muted); font-size: 11px; }
.reader-chapter-choice.is-current { border-color: rgba(255,66,95,.52); background: rgba(225,29,72,.14); color: #ff6078; }
.reader-settings-panel { max-height: 90vh; }
.reader.reader-overlay-open { overflow: hidden !important; overscroll-behavior: none; touch-action: none; }
.reader-setting-group { margin-top: 22px; }
.reader-setting-group h3 { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.reader-segmented { display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.reader-theme-segmented { grid-template-columns: repeat(3,1fr); }
.reader-segmented button { min-height: 42px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.reader-segmented button.is-active { background: var(--surface-3); color: var(--text); }
.reader-toggle-list { display: grid; margin-top: 20px; border-top: 1px solid var(--line); }
.reader-toggle-list > button { min-height: 62px; padding: 9px 2px; display: flex; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.reader-toggle-list span, .reader-toggle-list small { display: block; }
.reader-toggle-list small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.reader-toggle-list b { width: 43px; height: 25px; position: relative; border-radius: 99px; background: #3a3942; }
.reader-toggle-list b::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .2s; }
.reader-toggle-list button.is-active b { background: var(--accent); }
.reader-toggle-list button.is-active b::after { transform: translateX(18px); }
.reader-range { display: block; margin-top: 22px; }
.reader-range span { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.reader-range input { width: 100%; margin-top: 12px; accent-color: var(--accent); }
.comment-compose { display: grid; gap: 9px; margin-top: 20px; }
.comment-compose textarea { width: 100%; min-height: 90px; resize: vertical; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; }
.comment-list { display: grid; gap: 9px; margin-top: 18px; }
.comment-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.comment-card header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.comment-card strong { color: #ff6078; }
.comment-badge { margin-left: 4px; color: var(--text); font-size: 9px; font-weight: 800; }
.comment-card p { margin: 8px 0 0; color: var(--text); font-size: 13px; line-height: 1.45; }
.comment-empty { padding: 28px 10px; color: var(--muted); text-align: center; }

@media (min-width: 620px) {
  .main-content { padding-left: 28px; padding-right: 28px; }
  .catalog-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 14px; }
  .detail-hero { margin-left: -28px; margin-right: -28px; }
  .manga-card { aspect-ratio: .7; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .splash { animation-delay: .25s !important; }
  .splash-brand { opacity: 1; transform: translate(-50%,0); }
}

/* Liquid Glass visual system */
:root {
  --glass: rgba(25,25,33,.58);
  --glass-strong: rgba(24,24,32,.78);
  --glass-soft: rgba(255,255,255,.055);
  --glass-border: rgba(255,255,255,.14);
  --glass-highlight: rgba(255,255,255,.22);
  --glass-shadow: 0 18px 50px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.13);
  --glass-shadow-soft: 0 10px 30px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.1);
  --glass-blur: blur(26px) saturate(165%);
}

html[data-theme="light"] {
  --glass: rgba(255,255,255,.53);
  --glass-strong: rgba(255,255,255,.74);
  --glass-soft: rgba(255,255,255,.42);
  --glass-border: rgba(255,255,255,.76);
  --glass-highlight: rgba(255,255,255,.96);
  --glass-shadow: 0 18px 50px rgba(61,58,78,.16), inset 0 1px 0 rgba(255,255,255,.92);
  --glass-shadow-soft: 0 10px 30px rgba(61,58,78,.11), inset 0 1px 0 rgba(255,255,255,.86);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --glass: rgba(255,255,255,.53);
    --glass-strong: rgba(255,255,255,.74);
    --glass-soft: rgba(255,255,255,.42);
    --glass-border: rgba(255,255,255,.76);
    --glass-highlight: rgba(255,255,255,.96);
    --glass-shadow: 0 18px 50px rgba(61,58,78,.16), inset 0 1px 0 rgba(255,255,255,.92);
    --glass-shadow-soft: 0 10px 30px rgba(61,58,78,.11), inset 0 1px 0 rgba(255,255,255,.86);
  }
}

html,
body,
.app-shell {
  background:
    radial-gradient(ellipse 72% 42% at 7% 4%, rgba(255,66,95,.16), transparent 66%),
    radial-gradient(ellipse 58% 38% at 96% 34%, rgba(128,90,255,.11), transparent 70%),
    radial-gradient(ellipse 58% 42% at 30% 92%, rgba(255,66,95,.08), transparent 72%),
    var(--bg);
  background-attachment: fixed;
}

.app-shell { position: relative; isolation: isolate; }
.app-shell::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: 16%;
  left: 50%;
  width: min(92vw,680px);
  height: 290px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,66,95,.1), transparent 68%);
  filter: blur(42px);
  transform: translateX(-50%);
  pointer-events: none;
}

.app-header,
.bottom-nav,
.reader-header,
.reader-controls {
  border-color: var(--glass-border);
  background: linear-gradient(145deg, var(--glass-highlight) -130%, var(--glass-strong) 48%, var(--glass-soft) 160%);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}

.app-header {
  border-bottom-color: var(--glass-border);
  box-shadow: 0 10px 36px rgba(0,0,0,.13), inset 0 1px 0 var(--glass-highlight);
}

.brand {
  padding: 8px 12px;
  border-radius: 14px;
  text-shadow: 0 1px 16px rgba(255,255,255,.1);
}

.icon-button,
.reader-icon {
  border: 1px solid transparent;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.icon-button:active,
.reader-icon:active {
  border-color: var(--glass-border);
  background: var(--glass-soft);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.search-box,
.filter-button,
.sort-chip,
.empty-state,
.outline-button,
.detail-badges span,
.favorite-button,
.list-button,
.share-button,
.genre-pill,
.chapter-row,
.library-tab,
.library-empty,
.favorite-list-item,
.profile-card,
.stat-card,
.profile-note,
.recent-reading-item,
.theme-choice,
.choice,
.library-choice,
.new-list-form input,
.reader-segmented,
.reader-chapter-choice,
.comment-compose textarea,
.comment-card,
.settings-reset-button {
  border-color: var(--glass-border);
  background: linear-gradient(145deg, var(--glass-highlight) -150%, var(--glass) 44%, var(--glass-soft) 160%);
  box-shadow: var(--glass-shadow-soft);
}

.search-box {
  border-radius: 20px;
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.search-box:focus-within {
  border-color: rgba(255,92,117,.7);
  background: linear-gradient(145deg, rgba(255,255,255,.15), var(--glass-strong));
  box-shadow: 0 0 0 4px var(--accent-soft), var(--glass-shadow-soft);
}

.sort-chip,
.filter-button,
.library-tab,
.choice,
.theme-choice,
.library-choice,
.reader-segmented button,
.nav-item,
.reader-controls button {
  transition: transform .18s ease, color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.sort-chip:active,
.filter-button:active,
.library-tab:active,
.choice:active,
.theme-choice:active,
.library-choice:active,
.chapter-row:active,
.favorite-list-item:active {
  transform: scale(.975);
}

.sort-chip.is-active,
.nav-item.is-active,
.library-tab.is-active,
.choice.is-active,
.theme-choice.is-active,
.library-choice.is-active,
.reader-segmented button.is-active,
.reader-controls button.is-active {
  border-color: rgba(255,89,114,.48);
  background: linear-gradient(145deg, rgba(255,86,111,.29), rgba(225,29,72,.14));
  color: var(--accent-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 24px rgba(225,29,72,.12);
}

.sort-chip.is-active { color: #fff; }

.manga-card {
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 42px rgba(0,0,0,.3), inset 0 1px 0 var(--glass-highlight);
}

.manga-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.2), transparent 22%, transparent 72%, rgba(255,66,95,.08));
  pointer-events: none;
}

.card-badge {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(18,18,24,.52);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}

.detail-cover {
  border: 1px solid var(--glass-border);
  box-shadow: 0 28px 70px rgba(0,0,0,.5), inset 0 1px 0 var(--glass-highlight);
}

.profile-card {
  background:
    radial-gradient(circle at 12% 0, rgba(255,94,119,.25), transparent 48%),
    linear-gradient(145deg, var(--glass-highlight) -150%, var(--glass-strong) 50%, var(--glass-soft));
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  backdrop-filter: blur(22px) saturate(155%);
}

.avatar {
  border: 1px solid rgba(255,255,255,.3);
  background: linear-gradient(145deg, #ff6078, #c9133d);
  box-shadow: 0 0 0 6px rgba(225,29,72,.12), 0 14px 34px rgba(225,29,72,.24), inset 0 1px 0 rgba(255,255,255,.4);
}

.bottom-nav,
.reader-controls {
  overflow: hidden;
}

.bottom-nav::before,
.reader-controls::before {
  content: "";
  position: absolute;
  top: 0;
  left: 9%;
  width: 55%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
  pointer-events: none;
}

.nav-item.is-active {
  border: 1px solid rgba(255,92,117,.2);
}

.sheet-backdrop,
.reader-chapter-backdrop {
  background: rgba(2,2,5,.47);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}

.sheet,
.reader-chapter-panel {
  border-color: var(--glass-border);
  background:
    linear-gradient(145deg, var(--glass-highlight) -170%, var(--glass-strong) 36%, var(--glass) 100%);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  backdrop-filter: blur(34px) saturate(170%);
  box-shadow: 0 -24px 70px rgba(0,0,0,.35), inset 0 1px 0 var(--glass-highlight);
}

.sheet-handle {
  background: linear-gradient(90deg, rgba(255,255,255,.25), rgba(255,255,255,.8), rgba(255,255,255,.25));
  box-shadow: 0 1px 8px rgba(255,255,255,.14);
}

.app-toggle-list > button,
.reader-toggle-list > button {
  border-color: var(--glass-border);
}

.app-toggle-list b,
.reader-toggle-list b {
  border: 1px solid var(--glass-border);
  background: rgba(95,93,106,.48);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.2);
}

.app-toggle-list button.is-active b,
.reader-toggle-list button.is-active b {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 5px 14px rgba(225,29,72,.28), inset 0 1px 0 rgba(255,255,255,.35);
}

.primary-button,
.favorite-button,
.new-list-form button {
  background: linear-gradient(145deg, #ff536e, #cf153f);
  box-shadow: 0 12px 30px rgba(225,29,72,.24), inset 0 1px 0 rgba(255,255,255,.38);
}

.reader {
  background:
    radial-gradient(ellipse 65% 30% at 50% 0, rgba(255,66,95,.08), transparent 72%),
    var(--reader-bg);
}

.reader-header {
  border-bottom-color: var(--glass-border);
  box-shadow: 0 10px 34px rgba(0,0,0,.19), inset 0 1px 0 var(--glass-highlight);
}

.reader-controls {
  border-radius: 24px;
}

.reader-page-number,
.toast {
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--glass-shadow-soft);
}

.reader-page-number {
  border-color: rgba(255,255,255,.28);
  background: rgba(8,11,24,.84);
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
  box-shadow: 0 8px 24px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.16);
}

.progress-track {
  border: 1px solid var(--glass-border);
  background: var(--glass-soft);
  box-shadow: inset 0 1px 5px rgba(0,0,0,.2);
}

.progress-track i {
  background: linear-gradient(90deg, #ff3f61, #ff7890);
  box-shadow: 0 0 14px rgba(255,66,95,.55);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .app-header,
  .bottom-nav,
  .reader-header,
  .reader-controls,
  .sheet,
  .reader-chapter-panel { background: var(--surface); }
}

@media (max-width: 420px) {
  .bottom-nav { width: calc(100% - 18px); bottom: max(7px,var(--safe-bottom)); }
  .reader-controls { width: calc(100% - 14px); bottom: max(7px,var(--safe-bottom)); }
  .main-content { padding-left: 14px; padding-right: 14px; }
  .detail-hero { margin-left: -14px; margin-right: -14px; }
}
