:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    background: #090c13;
    color: #edf2f7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #172033, #090c13 48rem); }
button, a { font: inherit; }
a { color: #9fc5ff; }

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem clamp(1rem, 4vw, 4rem);
    border-bottom: 1px solid #293247;
    background: rgba(8, 12, 20, 0.82);
}

.page-header h1 { margin: 0; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 0.95; }
.page-header p { max-width: 48rem; color: #aeb9ca; }
.eyebrow { margin: 0 0 0.6rem; color: #f0b36b !important; letter-spacing: 0.16em; text-transform: uppercase; }

.gallery-shell { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: calc(100vh - 10rem); }
.gallery-sidebar { padding: 1.5rem; border-right: 1px solid #293247; background: rgba(12, 17, 28, 0.8); }
.gallery-sidebar h2 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: #9ba8ba; }

.filter-button {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 0.25rem 0;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #c9d1de;
    text-align: left;
    cursor: pointer;
}

.filter-button:hover, .filter-button.active { background: #27334a; color: #fff; }
.management-note { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #293247; color: #aeb9ca; font-size: 0.9rem; }
.gallery-workspace { min-width: 0; padding: clamp(1rem, 3vw, 2.5rem); }

.drop-zone {
    display: grid;
    place-items: center;
    min-height: 8rem;
    margin-bottom: 1.5rem;
    border: 2px dashed #526078;
    border-radius: 0.8rem;
    color: #aeb9ca;
    transition: 160ms ease;
}

.drop-zone.dragover { border-color: #70c5ff; background: rgba(70, 160, 255, 0.09); color: #fff; }
.drop-zone strong { font-size: 1.1rem; }
.upload-status { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; color: #cfe8ff; }
.spinner { width: 1.2rem; height: 1.2rem; border: 2px solid #43506a; border-top-color: #8bd5ff; border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); align-items: start; gap: 1rem; }
.asset-card { overflow: hidden; border: 1px solid #2d374c; border-radius: 0.75rem; background: #131a27; box-shadow: 0 0.8rem 2rem rgba(0,0,0,0.2); }
.asset-card[draggable="true"] { cursor: grab; }
.asset-card.dragging { opacity: 0.35; }
.asset-card.drop-target { outline: 2px solid #70c5ff; }
.asset-card[hidden] { display: none; }
.asset-preview { display: block; width: 100%; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; background: #05070b; cursor: zoom-in; }
.asset-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.asset-summary { height: 9rem; overflow: hidden; padding: 0.9rem; }
.asset-summary h2 { display: -webkit-box; overflow: hidden; margin: 0.35rem 0; font-size: 1rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.asset-summary p { display: -webkit-box; overflow: hidden; margin: 0; color: #9da9ba; font-size: 0.82rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.asset-status { color: #f0b36b; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.empty-message { color: #9da9ba; }

.asset-dialog { width: min(92vw, 86rem); max-height: 92vh; padding: 1rem; border: 1px solid #3a465d; border-radius: 0.8rem; background: #0b101a; color: #fff; }
.asset-dialog::backdrop { background: rgba(0,0,0,0.88); }
.asset-dialog img { display: block; max-width: 100%; max-height: 78vh; margin: auto; object-fit: contain; }
.asset-dialog p { max-width: 60rem; margin: 0.5rem auto; color: #b7c2d2; line-height: 1.5; }
.dialog-close { position: absolute; top: 0.5rem; right: 0.7rem; border: 0; background: transparent; color: #fff; font-size: 2rem; cursor: pointer; }

@media (max-width: 760px) {
    .page-header { align-items: start; flex-direction: column; }
    .gallery-shell { grid-template-columns: 1fr; }
    .gallery-sidebar { border-right: 0; border-bottom: 1px solid #293247; }
    .asset-grid { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
}
