@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap');

:root {
    --bg: #071016;
    --panel: rgba(15, 28, 36, .82);
    --panel-solid: #0f1c24;
    --panel-2: #13242d;
    --border: rgba(255,255,255,.09);
    --text: #eef7f8;
    --muted: #8fa5ad;
    --primary: #6ef2c1;
    --primary-2: #7fc7ff;
    --danger: #ff6d7a;
    --warning: #ffd57a;
    --shadow: 0 24px 80px rgba(0,0,0,.36);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.aurora {
    position: fixed;
    pointer-events: none;
    filter: blur(90px);
    opacity: .34;
    border-radius: 999px;
    z-index: -1;
}
.aurora-a { width: 420px; height: 420px; background: #35e6b1; top: -180px; right: 8%; }
.aurora-b { width: 460px; height: 460px; background: #458bff; left: -220px; top: 38%; opacity: .18; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: Manrope, sans-serif;
    font-weight: 800;
    letter-spacing: -.03em;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #06120e;
    background: linear-gradient(135deg, var(--primary), #b6ffe5);
    box-shadow: 0 8px 30px rgba(110,242,193,.18);
}

.btn {
    border: 1px solid transparent;
    border-radius: 12px;
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
    color: #06120e;
    background: linear-gradient(135deg, var(--primary), #a5ffdd);
    box-shadow: 0 10px 28px rgba(110,242,193,.14);
}
.btn-primary:hover { box-shadow: 0 14px 36px rgba(110,242,193,.22); }
.btn-soft { background: rgba(255,255,255,.055); border-color: var(--border); }
.btn-soft:hover, .btn-ghost:hover { background: rgba(255,255,255,.09); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-lg { min-height: 52px; padding-inline: 22px; border-radius: 14px; }
.btn-sm { min-height: 36px; padding-inline: 13px; font-size: 13px; }
.btn-block { width: 100%; }

.site-header {
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.landing-body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 80% 10%, rgba(110,242,193,.08), transparent 28%),
        radial-gradient(circle at 10% 50%, rgba(127,199,255,.06), transparent 30%),
        var(--bg);
}
.hero {
    min-height: 670px;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    align-items: center;
    gap: 60px;
    padding-block: 60px 100px;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.03);
    color: #b7c9cf;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(110,242,193,.1);
}
.hero h1 {
    margin: 20px 0 18px;
    font-family: Manrope, sans-serif;
    font-size: clamp(48px, 6vw, 76px);
    line-height: .98;
    letter-spacing: -.055em;
}
.gradient-text {
    background: linear-gradient(100deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    color: transparent;
}
.hero-text {
    max-width: 620px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.75;
}
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.mini-points {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: #9ab0b7;
    font-size: 13px;
}
.hero-panel { position: relative; }
.mock-window {
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(9,19,25,.72);
    backdrop-filter: blur(18px);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
}
.mock-top {
    height: 52px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
}
.mock-dot { width: 8px; height: 8px; border-radius: 50%; background: #40515a; }
.mock-address {
    margin-left: 10px;
    height: 28px;
    min-width: 220px;
    padding: 0 13px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    color: #6f838b;
    font-size: 11px;
    background: rgba(255,255,255,.035);
}
.mock-content { display: grid; grid-template-columns: 96px 1fr; min-height: 390px; }
.mock-sidebar { border-right: 1px solid var(--border); padding: 22px 14px; }
.mock-logo { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); margin-bottom: 30px; }
.mock-line { height: 8px; border-radius: 9px; background: #283943; margin: 17px 0; }
.mock-line.active { background: rgba(110,242,193,.45); }
.mock-line.short { width: 65%; }
.mock-main { padding: 28px 24px; }
.mock-heading { height: 18px; width: 34%; border-radius: 9px; background: #364953; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.mock-stats div { height: 58px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock-image {
    height: 105px;
    border-radius: 13px;
    position: relative;
    background: linear-gradient(135deg, rgba(110,242,193,.18), rgba(127,199,255,.08));
    border: 1px solid var(--border);
}
.mock-image.second { background: linear-gradient(135deg, rgba(127,199,255,.18), rgba(115,96,255,.08)); }
.mock-image.third { background: linear-gradient(135deg, rgba(255,213,122,.16), rgba(110,242,193,.08)); }
.mock-image.fourth { background: linear-gradient(135deg, rgba(255,109,122,.12), rgba(127,199,255,.08)); }
.mock-image span {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 7px;
    letter-spacing: .08em;
    padding: 3px 5px;
    border-radius: 4px;
    background: rgba(0,0,0,.28);
}
.floating-card {
    position: absolute;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(18,33,42,.88);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 36px rgba(0,0,0,.25);
    font-size: 12px;
    font-weight: 700;
}
.card-one { right: -24px; top: 25%; }
.card-two { left: -28px; bottom: 14%; }

.features { padding: 80px 0 110px; }
.section-heading { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-heading h2 { font-family: Manrope; font-size: 38px; letter-spacing: -.04em; margin: 14px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature-card {
    padding: 25px;
    min-height: 210px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018));
}
.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(110,242,193,.1);
    color: var(--primary);
    font-weight: 800;
}
.feature-card h3 { margin: 22px 0 8px; font-family: Manrope; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.landing-footer {
    border-top: 1px solid var(--border);
    min-height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6f848c;
    font-size: 13px;
}

/* Auth */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 0, rgba(110,242,193,.07), transparent 30%),
        var(--bg);
}
.auth-brand { position: fixed; top: 28px; left: 32px; }
.auth-shell { width: min(430px, calc(100% - 32px)); }
.auth-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 34px;
    background: rgba(12,25,33,.85);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}
.auth-badge {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--primary);
    background: rgba(110,242,193,.08);
    border: 1px solid rgba(110,242,193,.12);
}
.auth-card h1 { font-family: Manrope; font-size: 34px; letter-spacing: -.04em; margin: 18px 0 7px; }
.auth-card > p { margin: 0 0 25px; color: var(--muted); font-size: 14px; }
.auth-form { display: grid; gap: 17px; }
.auth-form label > span, .modal label > span {
    display: block;
    margin-bottom: 8px;
    color: #b8c6ca;
    font-size: 12px;
    font-weight: 700;
}
.auth-form input, .modal input {
    width: 100%;
    min-height: 48px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.16);
    color: var(--text);
    outline: none;
    padding: 0 13px;
    transition: .2s;
}
.auth-form input:focus, .modal input:focus {
    border-color: rgba(110,242,193,.5);
    box-shadow: 0 0 0 3px rgba(110,242,193,.08);
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.show-password {
    position: absolute;
    right: 7px;
    top: 7px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 9px;
    color: #a9bdc4;
    background: rgba(255,255,255,.05);
    cursor: pointer;
}
.btn-login { margin-top: 5px; min-height: 50px; }
.auth-note {
    border-top: 1px solid var(--border);
    margin-top: 25px;
    padding-top: 20px;
    text-align: center;
    color: #70848b;
    font-size: 12px;
}
.alert { padding: 11px 13px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; }
.alert-error { background: rgba(255,109,122,.09); border: 1px solid rgba(255,109,122,.18); color: #ffadb5; }

/* Dashboard */
.dashboard-body { min-height: 100vh; background: #081218; }
.sidebar {
    width: 240px;
    position: fixed;
    inset: 0 auto 0 0;
    border-right: 1px solid var(--border);
    background: #0a151c;
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    z-index: 50;
}
.sidebar-brand { padding: 5px 8px 24px; }
.side-nav { display: grid; gap: 4px; }
.side-nav > a, .sidebar-bottom a {
    min-height: 42px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    color: #8fa3aa;
    font-size: 13px;
    font-weight: 600;
}
.side-nav > a:hover, .side-nav > a.active, .sidebar-bottom a:hover {
    color: var(--text);
    background: rgba(255,255,255,.05);
}
.side-nav > a.active { box-shadow: inset 2px 0 var(--primary); }
.nav-icon { width: 18px; color: #7d929a; }
.side-nav small { margin-left: auto; color: #62777f; }
.nav-label { margin: 24px 10px 9px; color: #53676f; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--border); padding-top: 12px; }

.dashboard-main { margin-left: 240px; padding: 34px; min-height: 100vh; }
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}
.page-kicker { color: #587078; font-size: 9px; font-weight: 800; letter-spacing: .15em; margin-bottom: 5px; }
.dashboard-header h1 { font-family: Manrope; letter-spacing: -.04em; margin: 0; font-size: 28px; }
.header-actions { display: flex; gap: 8px; }
.mobile-menu { display: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    background: linear-gradient(180deg, #0f1c24, #0d1920);
}
.stat-label { color: #82969d; font-size: 11px; font-weight: 700; }
.stat-value { font-family: Manrope; font-weight: 800; font-size: 28px; letter-spacing: -.04em; margin: 7px 0 5px; }
.stat-sub { color: #53676e; font-size: 11px; }

.panel {
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #0e1a21;
    overflow: hidden;
}
.compact-panel { margin-bottom: 14px; padding: 14px 17px; overflow: visible; }
.panel-head {
    min-height: 78px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.panel-head h2 { margin: 0 0 5px; font-family: Manrope; font-size: 17px; letter-spacing: -.02em; }
.panel-head p { margin: 0; color: #71858d; font-size: 12px; }

.folder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
.folder-card {
    min-height: 94px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255,255,255,.018);
    display: flex;
    align-items: center;
    padding: 13px;
    transition: .2s;
}
.folder-card:hover { border-color: rgba(110,242,193,.22); background: rgba(255,255,255,.03); }
.folder-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.folder-icon {
    width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
    flex: 0 0 auto; color: var(--primary); background: rgba(110,242,193,.08);
}
.folder-main h3 { margin: 0 0 5px; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.folder-main p { margin: 0; color: #667b83; font-size: 10px; }
.folder-actions { display: flex; gap: 4px; margin-left: 6px; }
.icon-btn {
    width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px;
    background: transparent; color: #70858c; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.icon-btn.danger:hover { color: #ff929d; background: rgba(255,109,122,.08); }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-icon {
    width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 16px;
    display: grid; place-items: center; background: rgba(110,242,193,.07); color: var(--primary); font-size: 22px;
}
.empty-state h3 { margin: 0 0 7px; font-family: Manrope; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }

.folder-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: #51666d; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.image-count { color: #6f848c; font-size: 11px; }

.image-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
}
.image-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #101e26;
}
.image-preview {
    position: relative;
    aspect-ratio: 1 / 0.78;
    max-height: 145px;
    background:
        linear-gradient(45deg, #13232c 25%, transparent 25%),
        linear-gradient(-45deg, #13232c 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #13232c 75%),
        linear-gradient(-45deg, transparent 75%, #13232c 75%),
        #0d1a21;
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0px;
}
.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    content-visibility: auto;
}
.format-chip {
    position: absolute; top: 8px; right: 8px; padding: 4px 6px; border-radius: 6px;
    background: rgba(4,10,14,.75); backdrop-filter: blur(5px); font-size: 8px; font-weight: 800; letter-spacing: .06em;
}
.image-info { padding: 12px 12px 8px; }
.image-info h3 { margin: 0 0 5px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.image-info p { margin: 0; color: #61767e; font-size: 9px; }
.link-box { margin: 0 10px 10px; height: 36px; display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.link-box input { min-width: 0; flex: 1; border: 0; outline: none; color: #6f858d; background: rgba(0,0,0,.12); padding: 0 9px; font-size: 9px; }
.copy-btn {
    border: 0; border-left: 1px solid var(--border); background: rgba(255,255,255,.035);
    color: var(--primary); font-weight: 700; font-size: 9px; padding: 0 9px; cursor: pointer;
}
.image-actions {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
    padding: 0 10px 10px;
}
.btn-action {
    min-height: 31px; padding: 0 7px; border-radius: 8px; border: 1px solid var(--border);
    background: rgba(255,255,255,.025); color: #95a9b0; font-size: 9px;
}
.btn-action:hover { background: rgba(255,255,255,.055); }
.btn-action.danger:hover { color: #ff929d; border-color: rgba(255,109,122,.2); }

/* Modals */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center;
    padding: 20px;
    background: rgba(2,8,11,.72);
    backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transition: .2s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
    width: min(410px, 100%);
    position: relative;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #101d24;
    box-shadow: var(--shadow);
    padding: 27px;
    transform: translateY(8px) scale(.98);
    transition: .2s;
}
.modal-backdrop.open .modal { transform: none; }
.modal-wide { width: min(520px, 100%); }
.modal-close {
    position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
    border-radius: 9px; border: 1px solid var(--border); background: rgba(255,255,255,.035);
    color: #81959c; cursor: pointer; font-size: 18px;
}
.modal-icon {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(110,242,193,.08); color: var(--primary);
}
.modal h2 { font-family: Manrope; margin: 16px 0 5px; font-size: 20px; }
.modal > p { color: #71868d; margin: 0 0 20px; font-size: 12px; }
.modal form { display: grid; gap: 14px; }
.dropzone {
    min-height: 190px;
    border: 1px dashed rgba(110,242,193,.28);
    border-radius: 14px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    background: rgba(110,242,193,.025);
    overflow: hidden;
}
.drop-icon { font-size: 26px; color: var(--primary); }
.dropzone strong { font-size: 13px; }
.dropzone span { color: #6c8189; font-size: 10px; }
.file-summary { color: #8da1a8; font-size: 11px; min-height: 16px; }

.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 9px; }
.toast {
    width: min(340px, calc(100vw - 40px));
    border: 1px solid rgba(110,242,193,.18);
    border-radius: 12px;
    padding: 12px 14px;
    background: #13262d;
    box-shadow: 0 12px 36px rgba(0,0,0,.3);
    color: #ccece0;
    font-size: 12px;
    opacity: 0; transform: translateY(10px); transition: .22s;
}
.toast.error { border-color: rgba(255,109,122,.2); color: #ffc2c8; background: #2b1a20; }
.toast.show { opacity: 1; transform: none; }
.spinner {
    width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
    display: inline-block; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    .hero { grid-template-columns: 1fr; padding-top: 70px; }
    .hero-panel { max-width: 680px; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .folder-grid { grid-template-columns: repeat(2, 1fr); }
    .image-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: .22s ease; box-shadow: 16px 0 50px rgba(0,0,0,.3); }
    .sidebar.open { transform: none; }
    .dashboard-main { margin-left: 0; padding: 22px; }
    .mobile-menu {
        display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
        border: 1px solid var(--border); background: rgba(255,255,255,.035); cursor: pointer;
    }
    .dashboard-header { justify-content: flex-start; }
    .header-actions { margin-left: auto; }
    .image-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
    .container { width: min(100% - 28px, 1180px); }
    .hero { padding-top: 45px; gap: 35px; }
    .hero h1 { font-size: 48px; }
    .hero-text { font-size: 16px; }
    .feature-grid { grid-template-columns: 1fr; }
    .mock-content { grid-template-columns: 70px 1fr; }
    .card-one { right: -8px; }
    .card-two { left: -8px; }
    .landing-footer { flex-direction: column; justify-content: center; gap: 8px; }
    .auth-brand { left: 20px; top: 20px; }
    .auth-card { padding: 26px 20px; }
    .dashboard-main { padding: 16px; }
    .dashboard-header { align-items: flex-start; flex-wrap: wrap; }
    .header-actions { width: 100%; margin-left: 0; }
    .header-actions .btn { flex: 1; }
    .stat-grid, .folder-grid, .image-grid { grid-template-columns: 1fr; }
    .folder-toolbar { align-items: flex-start; flex-direction: column; }
    .panel-head { align-items: flex-start; }
}


/* Mass uploader + copy-all */
.btn-copy-all {
    color: #07140f;
    background: linear-gradient(135deg, #8ef4d0, #b7ffe5);
    border-color: rgba(110,242,193,.25);
}
.btn-copy-all:hover { box-shadow: 0 10px 28px rgba(110,242,193,.16); }

.modal-upload {
    width: min(680px, 100%);
    max-height: min(780px, calc(100vh - 40px));
    overflow: auto;
}
.dropzone.dragging {
    border-color: var(--primary);
    background: rgba(110,242,193,.07);
    box-shadow: inset 0 0 0 1px rgba(110,242,193,.16);
}
.upload-selection-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 9px 0 0;
}
.upload-selection-head > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.upload-selection-head strong {
    font-size: 12px;
}
.upload-selection-head span,
.upload-hint {
    color: #6c8189;
    font-size: 10px;
}
.upload-queue {
    display: grid;
    gap: 6px;
    max-height: 240px;
    overflow: auto;
    padding-right: 3px;
}
.upload-queue:empty { display: none; }
.upload-queue-item {
    min-height: 49px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    background: rgba(255,255,255,.018);
}
.queue-file-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: rgba(110,242,193,.07);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .04em;
}
.queue-file-meta {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.queue-file-meta strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 10px;
}
.queue-file-meta span {
    color: #62777f;
    font-size: 8px;
}
.queue-file-status {
    min-width: 82px;
    text-align: right;
    color: #71858c;
    font-size: 9px;
    font-weight: 700;
}
.queue-file-status.uploading { color: var(--primary-2); }
.queue-file-status.success { color: var(--primary); }
.queue-file-status.error { color: var(--danger); }
.queue-remove {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    background: transparent;
    color: #70858c;
}
.queue-remove:hover {
    color: #ff929d;
    background: rgba(255,109,122,.08);
}
.upload-progress-wrap {
    display: grid;
    gap: 7px;
    padding: 2px 0;
}
.upload-progress-wrap[hidden] { display: none; }
.upload-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #80949b;
    font-size: 10px;
}
.upload-progress-head strong { color: #b8ccc8; }
.upload-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.055);
}
.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    transition: width .12s linear;
}
.upload-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding-top: 3px;
}
.upload-footer .btn { min-width: 180px; }

@media (max-width: 620px) {
    .upload-footer {
        align-items: stretch;
        flex-direction: column;
    }
    .upload-footer .btn { width: 100%; }
    .upload-queue-item {
        grid-template-columns: 32px minmax(0,1fr) 28px;
    }
    .queue-file-status {
        grid-column: 2 / 3;
        text-align: left;
        min-width: 0;
    }
    .queue-remove {
        grid-column: 3;
        grid-row: 1 / 3;
    }
}

/* v3 modal/uploader layout fixes */
.modal-upload {
    width: min(720px, calc(100vw - 32px));
    max-height: min(820px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-upload > p {
    flex: 0 0 auto;
}
.modal-upload #uploadForm {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.modal-upload .dropzone {
    flex: 0 0 auto;
    min-height: 170px;
    cursor: pointer;
    user-select: none;
    outline: none;
}
.modal-upload .dropzone:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(110,242,193,.08);
}
.modal-upload .upload-selection-head {
    flex: 0 0 auto;
}
.modal-upload .upload-queue {
    min-height: 0;
    max-height: 250px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.modal-upload .upload-progress-wrap,
.modal-upload .upload-footer {
    flex: 0 0 auto;
}
.upload-footer {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}
#startUploadBtn {
    min-height: 44px;
}
#startUploadBtn:disabled {
    opacity: .45;
}
@media (max-height: 720px) {
    .modal-upload .dropzone {
        min-height: 120px;
    }
    .modal-upload .upload-queue {
        max-height: 170px;
    }
}


/* v4: compact six-column image gallery */
@media (max-width: 1450px) and (min-width: 1101px) {
    .image-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (max-width: 1100px) and (min-width: 821px) {
    .image-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 820px) and (min-width: 621px) {
    .image-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* v5: center image preview inside image card */
.image-card {
    display: flex;
    flex-direction: column;
}

.image-preview {
    width: calc(100% - 20px);
    margin: 10px auto 0;
    align-self: center;
    border-radius: 10px;
    overflow: hidden;
}

.image-preview img {
    margin: 0 auto;
}
