:root,
html.theme-light,
html.theme-dark,
body.light-mode,
.dark {
    --mp-radius: 12px;
    --mp-border: #e5e7eb;
    --mp-shadow: 0 2px 10px rgba(0,0,0,.05);
    --mp-transition: all .2s ease;
    --mp-bg: #0f172a;
    --mp-card: #1e293b;
    --mp-card-2: #263449;
    --mp-border-strong: #334155;
    --mp-text: #f8fafc;
    --mp-muted: #94a3b8;
    --mp-primary: #f8fafc;
    --mp-primary-hover: #e2e8f0;
    --mp-primary-text: #0f172a;
    --mp-button: #1e293b;
    --mp-button-hover: #263449;
    --mp-focus: #3b82f6;
    --mp-danger: #ef4444;
    --mp-warning: #f59e0b;
    --mp-success: #10b981;
}

html.theme-light,
body.light-mode,
html:not(.dark) body.bg-ios-bg {
    --mp-bg: #f8fafc;
    --mp-card: #ffffff;
    --mp-card-2: #f8fafc;
    --mp-border-strong: #e5e7eb;
    --mp-text: #111827;
    --mp-muted: #6b7280;
    --mp-primary: #111827;
    --mp-primary-hover: #1f2937;
    --mp-primary-text: #ffffff;
    --mp-button: #ffffff;
    --mp-button-hover: #f8fafc;
}

html.theme-dark,
body:not(.light-mode),
html.dark {
    --bg: var(--mp-bg) !important;
    --text: var(--mp-text) !important;
    --muted: var(--mp-muted) !important;
    --soft: var(--mp-muted) !important;
    --surface: var(--mp-card) !important;
    --surface-2: var(--mp-card-2) !important;
    --field: var(--mp-card) !important;
    --line: var(--mp-border-strong) !important;
    --strong-line: var(--mp-border-strong) !important;
    --shadow: var(--mp-shadow) !important;
    --scroll-track: var(--mp-bg) !important;
    --scroll-thumb: #475569 !important;
    --scroll-thumb-hover: #64748b !important;
}

html.theme-light,
body.light-mode {
    --bg: var(--mp-bg) !important;
    --text: var(--mp-text) !important;
    --muted: var(--mp-muted) !important;
    --soft: var(--mp-muted) !important;
    --surface: var(--mp-card) !important;
    --surface-2: var(--mp-card-2) !important;
    --field: #ffffff !important;
    --line: var(--mp-border) !important;
    --strong-line: var(--mp-border) !important;
    --shadow: var(--mp-shadow) !important;
    --scroll-track: #f8fafc !important;
    --scroll-thumb: #cbd5e1 !important;
    --scroll-thumb-hover: #94a3b8 !important;
}

html.theme-light body,
body.light-mode,
html:not(.dark) body.bg-ios-bg {
    background: #f8fafc !important;
    color: #111827 !important;
}

body.light-mode .bg-slate-900,
body.light-mode .bg-black,
body.light-mode .bg-slate-800,
body.light-mode .bg-slate-700 {
    background-color: var(--mp-card) !important;
}

body.light-mode .bg-slate-900\/50,
body.light-mode .bg-slate-800\/50,
body.light-mode .bg-black\/60,
body.light-mode .bg-black\/80 {
    background-color: rgba(255,255,255,.92) !important;
    color: #111827 !important;
}

body.light-mode .text-white,
body.light-mode .text-slate-200,
body.light-mode .text-slate-300,
body.light-mode .text-slate-400,
body.light-mode .text-slate-500 {
    color: var(--mp-text) !important;
}

body.light-mode .text-slate-300,
body.light-mode .text-slate-400,
body.light-mode .text-slate-500 {
    color: var(--mp-muted) !important;
}

body.light-mode .font-black,
body.light-mode .font-extrabold {
    font-weight: 600 !important;
}

body.light-mode .font-bold,
body.light-mode .font-semibold {
    font-weight: 500 !important;
}

body.light-mode input,
body.light-mode textarea,
body.light-mode select {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
}

body.light-mode .shadow-sm,
body.light-mode .shadow,
body.light-mode .shadow-md,
body.light-mode .shadow-lg,
body.light-mode .shadow-xl,
body.light-mode .shadow-2xl {
    box-shadow: var(--mp-shadow) !important;
}

* {
    letter-spacing: 0 !important;
}

body {
    background: var(--mp-bg) !important;
    color: var(--mp-text) !important;
    font-family: Inter, "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-weight: 400 !important;
}

h1,
h2,
h3,
.brand-name,
.panel-title,
.page-title-motion,
.reader-title-motion,
.font-black,
.font-extrabold {
    font-weight: 600 !important;
}

h4,
h5,
h6,
strong,
label,
.font-bold,
.font-semibold,
.brand-note,
.panel-kicker,
button,
.primary-button,
.secondary-button,
.text-button,
.auth-button {
    font-weight: 500 !important;
}

p,
span,
input,
textarea,
select,
a,
li {
    font-weight: 400;
}

.topbar,
header.liquid-glass,
.liquid-glass {
    background: color-mix(in srgb, var(--mp-card) 92%, transparent) !important;
    border-color: var(--mp-border-strong) !important;
    box-shadow: var(--mp-shadow) !important;
    border-radius: 0 !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
}

.auth-panel,
.dialog-card,
article,
.bg-slate-800,
.bg-slate-700,
.bg-white,
.dark .liquid-glass {
    background: var(--mp-card) !important;
    border: 1px solid var(--mp-border-strong) !important;
    border-radius: var(--mp-radius) !important;
    box-shadow: var(--mp-shadow) !important;
}

.auth-panel {
    padding: 32px !important;
    animation: none !important;
}

.dialog-card {
    padding: 32px !important;
}

.bg-slate-900,
.bg-black,
.dark\:bg-ios-darkbg:is(.dark *),
.dark .dark\:bg-ios-darkbg {
    background: var(--mp-bg) !important;
}

.bg-black\/80,
.bg-black\/60 {
    background: rgba(15, 23, 42, .72) !important;
}

.bg-black\/30,
.bg-black\/20,
.bg-black\/10,
.bg-black\/5,
.dark\:bg-white\/10:is(.dark *),
.dark .dark\:bg-white\/10 {
    background: color-mix(in srgb, var(--mp-card-2) 86%, transparent) !important;
}

.text-white,
.text-slate-200,
.text-gray-900,
.dark\:text-white:is(.dark *),
.dark .dark\:text-white {
    color: var(--mp-text) !important;
}

.text-slate-300,
.text-slate-400,
.text-slate-500,
.text-gray-500,
.text-gray-400,
.dark\:text-gray-400:is(.dark *),
.dark .dark\:text-gray-400 {
    color: var(--mp-muted) !important;
}

.border,
.border-slate-800,
.border-slate-700,
.border-slate-600,
.border-white\/10,
.border-gray-100 {
    border-color: var(--mp-border-strong) !important;
}

body.light-mode .border,
html.theme-light .border,
body.light-mode .border-slate-800,
body.light-mode .border-slate-700,
body.light-mode .border-slate-600,
body.light-mode .border-white\/10 {
    border-color: var(--mp-border) !important;
}

.shadow,
.shadow-sm,
.shadow-md,
.shadow-lg,
.shadow-xl,
.shadow-2xl,
[class*="shadow-blue-"],
[class*="shadow-purple-"],
[class*="shadow-pink-"],
[class*="shadow-orange-"],
[class*="shadow-rose-"] {
    box-shadow: var(--mp-shadow) !important;
}

.rounded-lg,
.rounded-xl,
.rounded-2xl,
.rounded-3xl,
.rounded-\[14px\],
.rounded-\[16px\],
.rounded-\[20px\],
.rounded-\[24px\],
.rounded-\[32px\],
.rounded-\[36px\] {
    border-radius: var(--mp-radius) !important;
}

.rounded-full {
    border-radius: 999px !important;
}

.text-button,
.secondary-button,
button:not(.swal2-confirm):not(.swal2-cancel),
a.secondary-button,
a.text-button,
#btn-subscribe-notifications,
#theme-toggle,
#btn-top,
.close-button {
    background: var(--mp-button) !important;
    border: 1px solid var(--mp-border-strong) !important;
    color: var(--mp-text) !important;
    border-radius: var(--mp-radius) !important;
    box-shadow: var(--mp-shadow) !important;
    transition: var(--mp-transition) !important;
    transform: none !important;
}

html.theme-light .text-button,
html.theme-light .secondary-button,
body.light-mode button:not(.swal2-confirm):not(.swal2-cancel),
body.light-mode a.secondary-button,
body.light-mode a.text-button,
body.light-mode #btn-subscribe-notifications,
body.light-mode #theme-toggle,
body.light-mode #btn-top {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
    color: #374151 !important;
}

.primary-button,
.auth-button,
button[type="submit"],
#btn-login,
#btn-reg,
#load-more-btn,
#confirmUnlockBtn,
#btn-unlock,
#btn-comment {
    background: var(--mp-primary) !important;
    border: 1px solid var(--mp-primary) !important;
    color: var(--mp-primary-text) !important;
    border-radius: var(--mp-radius) !important;
    box-shadow: var(--mp-shadow) !important;
    font-weight: 500 !important;
    transition: var(--mp-transition) !important;
    transform: none !important;
}

.primary-button:hover,
.auth-button:hover,
button[type="submit"]:hover,
#btn-login:hover,
#btn-reg:hover,
#load-more-btn:hover,
#confirmUnlockBtn:hover,
#btn-unlock:hover,
#btn-comment:hover {
    background: var(--mp-primary-hover) !important;
    border-color: var(--mp-primary-hover) !important;
}

.text-button:hover,
.secondary-button:hover,
button:not(.swal2-confirm):not(.swal2-cancel):hover,
a.secondary-button:hover,
a.text-button:hover,
#btn-subscribe-notifications:hover,
#theme-toggle:hover,
#btn-top:hover {
    background: var(--mp-button-hover) !important;
}

input,
textarea,
select,
.field input {
    min-height: 48px !important;
    background: var(--mp-card) !important;
    color: var(--mp-text) !important;
    border: 1px solid #d1d5db !important;
    border-radius: var(--mp-radius) !important;
    box-shadow: none !important;
    font-weight: 400 !important;
    outline: none !important;
    transition: var(--mp-transition) !important;
}

html.theme-dark input,
html.theme-dark textarea,
html.theme-dark select,
body:not(.light-mode) input,
body:not(.light-mode) textarea,
body:not(.light-mode) select {
    border-color: #334155 !important;
}

input:focus,
textarea:focus,
select:focus,
.field input:focus {
    border-color: var(--mp-focus) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15) !important;
}

h1 {
    font-size: clamp(34px, 5.4vw, 72px) !important;
    line-height: 1.04 !important;
    animation: none !important;
}

.panel-title {
    font-size: clamp(24px, 3vw, 32px) !important;
    line-height: 1.14 !important;
}

.lead {
    line-height: 1.58 !important;
}

.proof-item,
.step {
    border-color: var(--mp-border-strong) !important;
}

.gsi-wrap,
.g_id_signin {
    width: 100% !important;
}

.gsi-wrap iframe {
    border-radius: var(--mp-radius) !important;
}

.page-title-motion,
.reader-title-motion,
.animate-fade-in-up,
.animate-float,
.animate-pop-in {
    animation: none !important;
}

article:hover,
.group:hover {
    transform: translateY(-1px);
}

.comic-meta,
.comic-badge {
    border: 1px solid var(--mp-border-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--mp-card) 90%, transparent);
    color: var(--mp-muted);
    box-shadow: var(--mp-shadow);
    font-weight: 500;
}

.comic-badge.vip {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #6d28d9;
}

.comic-badge.score {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.comic-badge.views {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.comic-badge.likes {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

body.light-mode .comic-badge.vip {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #6d28d9 !important;
}

body.light-mode .comic-badge.score {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

body.light-mode .comic-badge.views {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

body.light-mode .comic-badge.likes {
    background: #fff1f2 !important;
    border-color: #fecdd3 !important;
    color: #be123c !important;
}

body:not(.light-mode) .comic-badge.vip,
html.theme-dark .comic-badge.vip {
    background: rgba(124,58,237,.16);
    border-color: rgba(167,139,250,.35);
    color: #c4b5fd;
}

body:not(.light-mode) .comic-badge.score,
html.theme-dark .comic-badge.score {
    background: rgba(245,158,11,.16);
    border-color: rgba(251,191,36,.35);
    color: #fcd34d;
}

body:not(.light-mode) .comic-badge.views,
html.theme-dark .comic-badge.views {
    background: rgba(59,130,246,.16);
    border-color: rgba(147,197,253,.35);
    color: #93c5fd;
}

body:not(.light-mode) .comic-badge.likes,
html.theme-dark .comic-badge.likes {
    background: rgba(244,63,94,.16);
    border-color: rgba(253,164,175,.35);
    color: #fda4af;
}

#theme-toggle,
#btn-top {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important;
}

.mp-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex: 0 0 auto;
}

.mp-star-button {
    width: 42px;
    height: 42px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mp-radius) !important;
    color: #94a3b8 !important;
}

.mp-star-button .mp-star {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: transparent;
    transition: var(--mp-transition);
}

.mp-star-button:hover,
.mp-star-button.is-active {
    color: #f59e0b !important;
    border-color: rgba(245,158,11,.35) !important;
    background: rgba(245,158,11,.10) !important;
}

.mp-star-button:hover .mp-star,
.mp-star-button.is-active .mp-star {
    fill: currentColor;
}

.mp-notification-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    width: min(340px, calc(100vw - 48px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--mp-border-strong);
    border-radius: var(--mp-radius);
    background: color-mix(in srgb, var(--mp-card) 94%, transparent);
    color: var(--mp-text);
    box-shadow: var(--mp-shadow);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    transform: translateX(150%);
    opacity: 0;
    transition: var(--mp-transition);
    cursor: pointer;
}

.mp-notification-toast__icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mp-border-strong);
    border-radius: var(--mp-radius);
    background: var(--mp-button);
    color: var(--mp-text);
}

.mp-notification-toast h4 {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 600 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-notification-toast p {
    margin: 0;
    color: var(--mp-muted);
    font-size: 13px;
    line-height: 1.45;
    word-wrap: break-word;
}

.mp-notification-toast__close {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--mp-muted) !important;
}

img.rounded-full {
    border: 1px solid var(--mp-border-strong) !important;
    box-shadow: var(--mp-shadow) !important;
}

.bg-gradient-to-r,
.bg-gradient-to-tr,
[class*="from-purple-"],
[class*="from-blue-"],
[class*="from-amber-"],
[class*="to-pink-"],
[class*="to-indigo-"],
[class*="to-orange-"] {
    background-image: none !important;
}

.primary-button,
.auth-button,
button[type="submit"],
#btn-login,
#btn-reg,
#load-more-btn,
#confirmUnlockBtn,
#btn-unlock,
#btn-comment {
    background: var(--mp-primary) !important;
    border-color: var(--mp-primary) !important;
    color: var(--mp-primary-text) !important;
}

.primary-button:hover,
.auth-button:hover,
button[type="submit"]:hover,
#btn-login:hover,
#btn-reg:hover,
#load-more-btn:hover,
#confirmUnlockBtn:hover,
#btn-unlock:hover,
#btn-comment:hover {
    background: var(--mp-primary-hover) !important;
    border-color: var(--mp-primary-hover) !important;
    color: var(--mp-primary-text) !important;
}

@media (max-width: 560px) {
    .auth-panel,
    .dialog-card {
        padding: 24px !important;
    }

    h1 {
        font-size: clamp(32px, 10vw, 48px) !important;
    }
}
