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

:root {
    --bg: #0f0d0c;
    --sidebar: #15100e;
    --sidebar-bottom: #1f1816;
    --card: #191311;
    --card-hover: #1e1714;
    --border: #241d1a;
    --orange: #e44a2b;
    --orange-hover: #d43e1e;
    --text: #e9e5e4;
    --text-muted: #8a8380;
    --text-dim: #5c5552;
    --nav-inactive: #8f8884;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.28);
    --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

.layout {
    display: flex;
    min-height: 100vh;
    zoom: 0.9;
    -moz-transform: scale(0.9);
    -moz-transform-origin: top left;
    -moz-width: 111.11%;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 272px;
    min-width: 272px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--sidebar) 0%, #13100e 100%);
    border-right: 1px solid #221b18;
    display: flex;
    flex-direction: column;
    padding: 28px 18px 22px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.logo {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 6px;
}

.logo-icon {
    width: 250px;
    height: 112px;
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.nav {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    color: #59504c;
    letter-spacing: 1.8px;
    margin: 0 0 10px 16px;
}

.nav-label + .nav-label,
.nav-item + .nav-label {
    margin-top: 30px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin-bottom: 3px;
    color: var(--nav-inactive);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    opacity: 0.85;
}

.nav-item:hover {
    color: #ddd8d6;
    background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
    color: #f4aE98;
    background: linear-gradient(90deg, rgba(228, 74, 43, 0.16) 0%, rgba(228, 74, 43, 0.08) 100%);
    box-shadow: inset 3px 0 0 var(--orange);
}

/* Sidebar bottom */
.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.social-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    transition: filter 0.15s, transform 0.15s;
}

.social-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.social-btn.telegram { background: #2aabee; }

.user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.user:hover { background: rgba(255, 255, 255, 0.04); }

.user.logged-in { background: rgba(228, 74, 43, 0.12); }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e44a2b, #c33a20);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--nav-inactive);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.theme-toggle i { width: 20px; text-align: center; font-size: 15px; }
.theme-toggle:hover { color: #ddd8d6; background: rgba(255,255,255,0.035); }

/* ---------- Main ---------- */
.content {
    flex: 1;
    background: radial-gradient(900px 500px at 100% 0%, rgba(228, 74, 43, 0.05), transparent 55%), var(--bg);
    padding: 28px 32px;
    overflow-x: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
}

.stats {
    display: flex;
    gap: 12px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 22px;
    min-width: 172px;
    box-shadow: var(--shadow-card);
}

.stat i { font-size: 20px; }
.stat.total i { color: var(--orange); }
.stat.free i { color: #22a55a; }

.stat div {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 23px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.4px;
}

/* ---------- Grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
}

.card:hover {
    background: var(--card-hover);
    transform: translateY(-3px);
    border-color: #322a26;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1.04;
    background: #241d1a;
    overflow: hidden;
}

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

.tag {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #eee;
    letter-spacing: 0.2px;
    z-index: 2;
}

.flag { font-size: 13px; }

.sponsored-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--orange);
    color: #fff;
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    z-index: 2;
}

.card-body {
    padding: 11px 13px;
}

.card-body h3 {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    letter-spacing: -0.1px;
}

.card-body p {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.9;
}

.download {
    position: absolute;
    bottom: 42px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e44a2b, #cf3c20);
    border: none;
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(228, 74, 43, 0.35);
    transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}

.download svg {
    width: 16px;
    height: 16px;
}

.download:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(228, 74, 43, 0.45);
}

.download:active { transform: translateY(0); }

/* Premium locked cards */
.card.premium-locked {
    cursor: not-allowed;
}

.card.premium-locked:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
    background: var(--card);
}

.card.premium-locked .thumb img {
    filter: blur(5px) brightness(0.75);
    transform: scale(1.06);
}

.premium-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 7, 6, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 3;
    text-align: center;
    padding: 12px;
}

.premium-overlay i {
    font-size: 26px;
    color: var(--orange);
    filter: drop-shadow(0 3px 8px rgba(228, 74, 43, 0.4));
}

.premium-overlay span {
    font-size: 12px;
    font-weight: 700;
    color: #f0a48e;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    max-width: 160px;
    line-height: 1.35;
}

html[data-theme="light"] .premium-overlay {
    background: rgba(30, 24, 21, 0.3);
}

html[data-theme="light"] .premium-overlay span { color: #ffb49d; }

/* Sponsored */
.card.sponsored .card-body {
    position: relative;
    padding: 16px 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card.sponsored .card-body h3 {
    white-space: normal;
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 14px;
}

.upload {
    background: var(--orange);
    border: none;
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: background 0.15s;
}

.upload:hover { background: var(--orange-hover); }
.upload i { font-size: 12px; }

/* Scrollbar */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2e2724; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a322e; }

/* Responsive */
@media (max-width: 1500px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1200px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } .sidebar { width: 220px; min-width: 220px; } }
@media (max-width: 760px) {
    .topbar { flex-direction: column; align-items: stretch; }
    .stats { width: 100%; }
    .stat { flex: 1; }
    .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Detail Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(180deg, #171211 0%, #131010 100%);
    border: 1px solid #2e2521;
    border-radius: 18px;
    width: 100%;
    max-width: 1180px;
    max-height: 90vh;
    display: flex;
    gap: 26px;
    padding: 26px;
    position: relative;
    overflow-y: auto;
    box-shadow: var(--shadow-pop);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #241d1a;
    border: 1px solid #3a322e;
    color: #c9c4c1;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 5;
}

.modal-close:hover { background: #332a26; color: #fff; }

.modal-media {
    flex: 0 0 40%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #241d1a;
}

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

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-right: 6px;
}

.modal-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 26px;
    letter-spacing: -0.6px;
    line-height: 1.2;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.m-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.m-stat i { font-size: 18px; color: var(--orange); }
.m-value { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.m-label { font-size: 9px; font-weight: 700; color: var(--text-dim); letter-spacing: 1.2px; text-transform: uppercase; }

.modal-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
    padding-top: 16px;
    border-top: 1px solid #241d1a;
}

.m-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.m-key {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 1.3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m-val { font-size: 15px; font-weight: 500; color: #e9e5e4; }

.modal-download-wrap {
    position: relative;
    margin-bottom: 16px;
}

.modal-download {
    width: 100%;
    background: linear-gradient(135deg, var(--orange), var(--orange-hover));
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(228, 74, 43, 0.25);
    transition: filter 0.15s, box-shadow 0.15s;
}

.modal-download:hover { filter: brightness(1.08); box-shadow: 0 6px 16px rgba(228, 74, 43, 0.35); }

.modal-download.disabled {
    background: #2b2422;
    color: #8a8380;
    cursor: not-allowed;
    box-shadow: none;
}

.modal-download .fa-chevron-down {
    transition: transform 0.2s;
}

.modal-download.open .fa-chevron-down {
    transform: rotate(180deg);
}

.modal-download-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #171211;
    border: 1px solid #2e2521;
    border-radius: var(--radius-sm);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-pop);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 10;
}

.modal-download-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modal-download-menu .m-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 12px;
    color: #e9e5e4;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.modal-download-menu .m-link:hover {
    background: #241d1a;
    border-color: #3a322e;
}

.modal-download-menu .m-link i {
    color: #8a8380;
    font-size: 15px;
    width: 20px;
    text-align: left;
    flex-shrink: 0;
}

.modal-download-menu .m-link.download-here {
    background: rgba(228, 74, 43, 0.12);
    border-color: rgba(228, 74, 43, 0.35);
    color: #f0a48e;
}

.modal-download-menu .m-link.download-here:hover {
    background: rgba(228, 74, 43, 0.2);
    border-color: var(--orange);
}

.modal-download-menu .m-link.download-here i {
    color: var(--orange);
}

/* ---------- Auth / Sign-in modal ---------- */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    z-index: 300;
    overflow-y: auto;
}

.auth-overlay.show { display: flex; }

.auth-card {
    background: linear-gradient(180deg, #16100e 0%, #120e0d 100%);
    border: 1px solid #2e2521;
    border-radius: 18px;
    width: 100%;
    max-width: 440px;
    padding: 36px 36px 32px;
    position: relative;
    box-shadow: var(--shadow-pop);
}

.auth-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #241d1a;
    border: 1px solid #3a322e;
    color: #c9c4c1;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.auth-close:hover { background: #332a26; color: #fff; }

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--orange), var(--orange-hover));
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 6px 16px rgba(228, 74, 43, 0.35);
}

.auth-eyebrow {
    display: block;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.auth-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.6px;
    margin-bottom: 10px;
}

.auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 26px;
}

.auth-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #c9c4c1;
    margin: 0 0 7px 2px;
}

.auth-input-wrap {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    margin-bottom: 18px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input-wrap:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(228, 74, 43, 0.12); }

.auth-input-wrap i {
    color: var(--text-dim);
    font-size: 15px;
    margin-right: 12px;
}

.auth-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.auth-input-wrap input::placeholder { color: #5c5552; }

.auth-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--orange), var(--orange-hover));
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(228, 74, 43, 0.25);
    transition: filter 0.15s, box-shadow 0.15s;
    margin-top: 6px;
}

.auth-submit:hover { filter: brightness(1.08); box-shadow: 0 6px 16px rgba(228, 74, 43, 0.35); }
.auth-submit:disabled { opacity: 0.6; cursor: wait; filter: none; }

.auth-error {
    min-height: 16px;
    color: #f0a48e;
    font-size: 12px;
    text-align: center;
    margin-top: 12px;
}

.auth-switch {
    text-align: center;
    color: #8a8380;
    font-size: 13px;
    margin-top: 14px;
}

.auth-switch a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover { text-decoration: underline; }

.creds-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    margin-bottom: 18px;
}

.creds-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 0;
}

.creds-row + .creds-row { border-top: 1px solid #241d1a; }

.creds-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.creds-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
    font-family: 'SFMono-Regular', Consolas, monospace;
    letter-spacing: 0.3px;
}

@media (max-width: 900px) {
    .modal { flex-direction: column; max-height: 92vh; }
    .modal-media { flex: 0 0 280px; }
    .modal-stats { grid-template-columns: repeat(2, 1fr); }
    .modal-meta { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Light theme ---------- */
html[data-theme="light"] {
    --bg: #f2efec;
    --sidebar: #faf8f6;
    --sidebar-bottom: #f0ece8;
    --card: #ffffff;
    --card-hover: #f6f2ef;
    --border: #e3dcd7;
    --text: #221d1a;
    --text-muted: #6f6761;
    --text-dim: #9b938c;
    --nav-inactive: #7d746e;
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] body {
    background: var(--bg);
}

html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #faf8f6 0%, #f3efec 100%);
    border-right: 1px solid #e6dfda;
}

html[data-theme="light"] .logo-text { color: #1c1714; }
html[data-theme="light"] .logo-icon { }

html[data-theme="light"] .nav-label { color: #a89f98; }

html[data-theme="light"] .nav-item:hover {
    color: #4a423d;
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .nav-item.active { color: #c2472a; }

html[data-theme="light"] .user:hover { background: rgba(0, 0, 0, 0.05); }
html[data-theme="light"] .user.logged-in { background: rgba(228, 74, 43, 0.1); }

html[data-theme="light"] .theme-toggle:hover {
    color: #4a423d;
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .content {
    background: radial-gradient(900px 500px at 100% 0%, rgba(228, 74, 43, 0.04), transparent 55%), var(--bg);
}

html[data-theme="light"] .card:hover { border-color: #d8cfc9; }
html[data-theme="light"] .thumb { background: #ece6e1; }

html[data-theme="light"] ::-webkit-scrollbar-track { background: #f2efec; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cfc7c1; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #bdb4ad; }

html[data-theme="light"] .modal {
    background: linear-gradient(180deg, #ffffff 0%, #f7f4f1 100%);
    border: 1px solid #e3dcd7;
}

html[data-theme="light"] .modal-close,
html[data-theme="light"] .auth-close {
    background: #f0ebe7;
    border: 1px solid #d8cfc9;
    color: #6f6761;
}

html[data-theme="light"] .modal-close:hover,
html[data-theme="light"] .auth-close:hover {
    background: #e6e0db;
    color: #221d1a;
}

html[data-theme="light"] .modal-media { background: #ece6e1; }
html[data-theme="light"] .modal-info h2 { color: #1c1714; }
html[data-theme="light"] .m-val { color: #221d1a; }
html[data-theme="light"] .modal-meta { border-top: 1px solid #ece5df; }

html[data-theme="light"] .modal-download.disabled {
    background: #e6e0db;
    color: #9b938c;
}

html[data-theme="light"] .modal-download-menu {
    background: #ffffff;
    border: 1px solid #e3dcd7;
}

html[data-theme="light"] .modal-download-menu .m-link { color: #221d1a; }
html[data-theme="light"] .modal-download-menu .m-link:hover {
    background: #f4efeb;
    border-color: #e3dcd7;
}

html[data-theme="light"] .modal-download-menu .m-link i { color: #9b938c; }
html[data-theme="light"] .modal-download-menu .m-link.download-here { color: #c2472a; }

html[data-theme="light"] .auth-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f4f1 100%);
    border: 1px solid #e3dcd7;
}

html[data-theme="light"] .auth-title { color: #1c1714; }
html[data-theme="light"] .auth-label { color: #5f5751; }
html[data-theme="light"] .auth-input-wrap input { color: #221d1a; }
html[data-theme="light"] .auth-input-wrap input::placeholder { color: #b3aaa2; }
html[data-theme="light"] .auth-switch { color: #6f6761; }
html[data-theme="light"] .auth-error { color: #c2472a; }

html[data-theme="light"] .creds-row + .creds-row { border-top: 1px solid #ece5df; }
html[data-theme="light"] .creds-value { color: #221d1a; }

/* ---------- Download info modal ---------- */
.dl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 400;
}

.dl-overlay.show { display: flex; }

.dl-card {
    background: linear-gradient(180deg, #16100e 0%, #120e0d 100%);
    border: 1px solid #2e2521;
    border-radius: 18px;
    width: 100%;
    max-width: 460px;
    padding: 34px 34px 32px;
    position: relative;
    box-shadow: var(--shadow-pop, 0 14px 40px rgba(0, 0, 0, 0.5));
    max-height: 92vh;
    overflow-y: auto;
}

.dl-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #241d1a;
    border: 1px solid #3a322e;
    color: #c9c4c1;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.dl-close:hover { background: #332a26; color: #fff; }

.dl-logo {
    width: 56px;
    height: 56px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--orange), var(--orange-hover));
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 6px 16px rgba(228, 74, 43, 0.35);
}

.dl-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.dl-sub {
    text-align: center;
    color: var(--muted, #8a8380);
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 22px;
}

.dl-steps {
    background: var(--card, #191311);
    border: 1px solid var(--border, #241d1a);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
}

.dl-steps b {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.dl-steps ol {
    margin: 0 0 8px;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dl-steps li {
    font-size: 13px;
    color: #a39d99;
    line-height: 1.45;
}

.dl-steps-note {
    font-size: 12px;
    color: var(--dim, #5c5552);
}

.dl-password {
    margin-bottom: 18px;
}

.dl-pw-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--dim, #5c5552);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.dl-pw-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dl-pw-row input {
    flex: 1;
    background: var(--card, #191311);
    border: 1px solid rgba(228, 74, 43, 0.4);
    border-radius: 10px;
    color: #fff;
    padding: 12px 14px;
    font-size: 14px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    outline: none;
    min-width: 0;
}

.dl-pw-note {
    font-size: 12px;
    color: var(--dim, #5c5552);
    margin-top: 8px;
}

.dl-now {
    width: 100%;
    background: linear-gradient(135deg, var(--orange), var(--orange-hover));
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(228, 74, 43, 0.25);
    transition: filter 0.15s;
}

.dl-now:hover { filter: brightness(1.08); }

html[data-theme="light"] .dl-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f4f1 100%);
    border-color: #e3dcd7;
}

html[data-theme="light"] .dl-close {
    background: #f0ebe7;
    border-color: #d8cfc9;
    color: #6f6761;
}

html[data-theme="light"] .dl-close:hover { background: #e6e0db; color: #221d1a; }
html[data-theme="light"] .dl-title { color: #1c1714; }
html[data-theme="light"] .dl-steps b { color: #221d1a; }
html[data-theme="light"] .dl-steps li { color: #6f6761; }
html[data-theme="light"] .dl-pw-row input { color: #221d1a; }
