/* ============================================================
   DUSTKISS ARTWORK LAB
   Dark premium streetwear lab UI. Vanilla CSS, no framework.
   ============================================================ */

:root {
    --bg:          #0a0a0a;
    --panel:       #111111;
    --panel-alt:   #171717;
    --panel-hi:    #1e1e1e;
    --text:        #f1eee7;
    --muted:       #8c8c8c;
    --accent:      #ff6a1a;
    --accent-soft: rgba(255, 106, 26, 0.14);
    --accent-dim:  #c1500f;
    --border:      #2a2a2a;
    --border-hi:   #3a3a3a;
    --ok:          #7dd18b;
    --bad:         #ff6a5e;
    --work:        #ffc46a;

    --radius:   10px;
    --radius-s: 7px;
    --gap:      22px;
    --wrap:     1320px;

    --font: "Helvetica Neue", Helvetica, "Segoe UI", Inter, system-ui, -apple-system, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0.01em;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

code, .mono { font-family: var(--mono); font-size: 0.86em; color: var(--muted); }

.is-hidden { display: none !important; }

.muted { color: var(--muted); }

/* ---------------- top bar ---------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px clamp(16px, 4vw, 44px);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #0d0d0d, var(--bg));
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand__mark {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    flex: none;
}
.brand__mark--lg { width: 20px; height: 20px; margin: 0 auto 14px; }

.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text strong {
    font-size: 15px; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
}
.brand__text em {
    font-style: normal; font-size: 11px; color: var(--muted);
    letter-spacing: 0.1em; text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav__link {
    text-decoration: none;
    font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted);
    padding: 9px 13px; border-radius: 999px;
    border: 1px solid transparent;
    transition: color .16s, border-color .16s, background .16s;
}
.nav__link:hover { color: var(--text); border-color: var(--border-hi); }
.nav__link.is-active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.nav__link--muted:hover { color: var(--bad); }

/* ---------------- layout ---------------- */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(20px, 3.4vw, 40px) clamp(16px, 4vw, 44px) 70px;
    flex: 1 0 auto;
}

.block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    padding: clamp(18px, 2.4vw, 28px);
    margin-bottom: var(--gap);
}

.block__head { margin-bottom: 18px; }
.block__head--row {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
}
.block__head p { margin: 4px 0 0; font-size: 13px; }

.h2 {
    margin: 0;
    font-size: 13px; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase;
}

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--tools { gap: 14px; margin-bottom: 16px; align-items: flex-end; }

.foot {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 20px; border-top: 1px solid var(--border);
    color: var(--muted); font-size: 11px;
    letter-spacing: 0.16em; text-transform: uppercase;
}
.foot__dot { color: var(--border-hi); }

/* ---------------- buttons + fields ---------------- */
.btn {
    appearance: none; cursor: pointer;
    font-family: inherit; font-size: 12px; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text);
    background: var(--panel-alt);
    border: 1px solid var(--border-hi);
    border-radius: 999px;
    padding: 12px 22px;
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .16s, border-color .16s, color .16s, transform .1s, opacity .16s;
}
.btn:hover { background: var(--panel-hi); border-color: #4a4a4a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.btn--primary {
    background: var(--accent); border-color: var(--accent); color: #140800;
}
.btn--primary:hover { background: #ff7d38; border-color: #ff7d38; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--bad); border-color: #48302e; background: transparent; }
.btn--danger:hover { background: #2a1917; border-color: var(--bad); color: #ffb0a8; }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 34px; font-size: 13px; }
.btn--sm { padding: 8px 15px; font-size: 11px; }

.link {
    appearance: none; background: none; border: 0; padding: 0;
    font: inherit; font-size: 12px; letter-spacing: 0.08em;
    color: var(--accent); cursor: pointer; text-decoration: none;
    text-transform: uppercase;
}
.link:hover { color: #ff9a5f; text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field--inline { margin-bottom: 0; }
.field--grow { flex: 1 1 220px; }
.field__label {
    font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted);
}
.field__label em { text-transform: none; letter-spacing: 0.02em; font-style: normal; }

.input {
    font-family: inherit; font-size: 14px;
    color: var(--text);
    background: var(--panel-alt);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    width: 100%;
    transition: border-color .16s, background .16s;
}
.input:focus { outline: none; border-color: var(--accent); background: #191919; }
.input--sm { padding: 9px 12px; font-size: 13px; }
.input--area { resize: vertical; min-height: 74px; line-height: 1.5; }
select.input { cursor: pointer; }

.search { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.search .input { min-width: 170px; }
@media (max-width: 620px) {
    .search { flex-wrap: wrap; }
    .search .input { min-width: 140px; flex: 1 1 140px; }
}

/* ---------------- alerts, tags, status ---------------- */
.alert {
    border: 1px solid var(--border-hi);
    border-left: 3px solid var(--muted);
    border-radius: var(--radius-s);
    background: var(--panel-alt);
    padding: 13px 16px; margin: 0 0 var(--gap);
    font-size: 13.5px;
}
.alert--bad { border-left-color: var(--bad); color: #ffc9c3; }
.alert--ok  { border-left-color: var(--ok); }

.tag {
    display: inline-block;
    font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 999px;
    border: 1px solid var(--border-hi); color: var(--muted);
}
.tag--ok   { color: var(--ok);    border-color: #26492c; background: #142016; }
.tag--bad  { color: var(--bad);   border-color: #4a2b28; background: #221413; }
.tag--work { color: var(--work);  border-color: #4a3b1f; background: #211a0f; }
.tag--wait { color: var(--muted); }

.status { margin: 12px 0 0; font-size: 13px; color: var(--muted); min-height: 20px; }
.status--inline { margin: 0; }
.status.is-ok  { color: var(--ok); }
.status.is-bad { color: var(--bad); }
.status.is-work { color: var(--work); }

.empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------------- login ---------------- */
body.is-bare { justify-content: center; }
.login {
    flex: 1 0 auto;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
}
.login__card {
    width: 100%; max-width: 380px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 34px 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.login__brand { text-align: center; margin-bottom: 26px; }
.login__brand h1 {
    margin: 0; font-size: 14px; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase;
}
.login__brand p {
    margin: 6px 0 0; font-size: 11px; color: var(--muted);
    letter-spacing: 0.1em; text-transform: uppercase;
}
.login__form { margin-top: 8px; }
.login__note {
    margin: 22px 0 0; font-size: 11.5px; color: var(--muted);
    text-align: center; line-height: 1.5;
}

/* ---------------- dropzone ---------------- */
.dropzone {
    border: 1px dashed var(--border-hi);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: clamp(30px, 6vw, 62px) 20px;
    text-align: center;
    transition: border-color .16s, background .16s;
}
.dropzone.is-over { border-color: var(--accent); background: #1a1310; }
.dropzone.is-busy { opacity: .6; pointer-events: none; }
.dropzone__inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dropzone__icon {
    width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--border-hi);
    position: relative; margin-bottom: 6px;
}
.dropzone__icon::before,
.dropzone__icon::after {
    content: ""; position: absolute; background: var(--accent);
    left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.dropzone__icon::before { width: 2px; height: 17px; }
.dropzone__icon::after  { width: 17px; height: 2px; }
.dropzone__title {
    margin: 0; font-size: 15px; font-weight: 600;
    letter-spacing: 0.06em;
}
.dropzone__or { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; }
.dropzone__hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); min-height: 18px; }

/* ---------------- panels ---------------- */
.pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

.panel {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-alt);
    overflow: hidden;
}
.panel--accent { border-color: #33220f; }
.panel--stage { background: var(--panel-alt); }

.panel__cap {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted);
}
.panel--accent .panel__cap { color: var(--accent); }

.panel__body {
    min-height: 190px;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background:
        repeating-conic-gradient(#141414 0% 25%, #101010 0% 50%) 50% / 22px 22px;
}
.panel__body--stage { min-height: 300px; }

.preview {
    max-height: 62vh;
    width: auto; max-width: 100%;
    object-fit: contain;
    cursor: zoom-in;
    border-radius: 4px;
}
.preview--stage { max-height: 72vh; }

.skeleton {
    /* Must sit above the .is-loading shimmer overlay, or a deliberate
       spinner would be hidden behind it. */
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 44px 20px;
    color: var(--muted); font-size: 12px;
    letter-spacing: 0.16em; text-transform: uppercase;
}
.skeleton em { font-style: normal; }

.spinner {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid var(--border-hi);
    border-top-color: var(--accent);
    animation: dk-spin .8s linear infinite;
    display: block;
}
@keyframes dk-spin { to { transform: rotate(360deg); } }

/* ---------------- style selector ---------------- */
.styles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.style {
    position: relative;
    display: flex; flex-direction: column; gap: 5px;
    padding: 14px 15px;
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-s);
    background: var(--panel-alt);
    cursor: pointer;
    transition: border-color .16s, background .16s, transform .1s;
}
.style:hover { border-color: #4d4d4d; background: var(--panel-hi); }
.style:has(.style__box:checked) {
    border-color: var(--accent);
    background: linear-gradient(180deg, #1d130c, #161211);
}
.style:has(.style__box:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.style__box { position: absolute; opacity: 0; pointer-events: none; }

.style__name {
    font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
    padding-right: 22px;
}
.style__name::after {
    content: ""; position: absolute; right: 14px; top: 16px;
    width: 13px; height: 13px; border-radius: 3px;
    border: 1px solid var(--border-hi);
}
.style:has(.style__box:checked) .style__name::after {
    background: var(--accent); border-color: var(--accent);
}
.style__desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.style__swatches { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.style__swatches i {
    font-style: normal; font-size: 9.5px; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--muted);
    border: 1px solid var(--border); border-radius: 3px;
    padding: 2px 5px; white-space: nowrap;
}

.convert {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    padding-top: 18px; border-top: 1px solid var(--border);
}
.convert__meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.convert__meta strong { color: var(--text); }

/* ---------------- progress ---------------- */
.progress { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 7px; }
.progress__item {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--muted);
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    background: var(--panel-alt);
}
.progress__dot {
    width: 9px; height: 9px; border-radius: 50%;
    border: 1px solid var(--border-hi); flex: none;
}
.progress__item.is-work { color: var(--work); border-color: #4a3b1f; }
.progress__item.is-work .progress__dot { background: var(--work); border-color: var(--work); animation: dk-pulse 1s ease-in-out infinite; }
.progress__item.is-done { color: var(--ok); border-color: #26492c; }
.progress__item.is-done .progress__dot { background: var(--ok); border-color: var(--ok); }
.progress__item.is-fail { color: var(--bad); border-color: #4a2b28; }
.progress__item.is-fail .progress__dot { background: var(--bad); border-color: var(--bad); }
.progress__msg { margin-left: auto; font-size: 11.5px; text-align: right; }
@keyframes dk-pulse { 50% { opacity: .35; } }

/* ---------------- grids + cards ---------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--gap);
}
.grid--album { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-alt);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color .16s, transform .16s;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); }

.card__media {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 4 / 5;
    background: repeating-conic-gradient(#141414 0% 25%, #101010 0% 50%) 50% / 22px 22px;
    overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: contain; }
.card__nomedia { font-size: 11px; color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; }

.card__body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 7px; }
.card__title { margin: 0; font-size: 13.5px; font-weight: 600; word-break: break-word; }
.card__title a { text-decoration: none; }
.card__title a:hover { color: var(--accent); }
.card__meta { margin: 0; font-size: 11.5px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card__actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 5px; }

.card__skeleton { pointer-events: none; }
.card__skeleton .card__media {
    background: linear-gradient(90deg, #131313 25%, #1b1b1b 37%, #131313 63%);
    background-size: 400% 100%;
    animation: dk-shimmer 1.3s ease-in-out infinite;
}
@keyframes dk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------------- tabs ---------------- */
.tabs {
    display: flex; gap: 7px; flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    /* many renders must not push the viewer off the screen */
    max-height: 132px;
    overflow-y: auto;
    scrollbar-color: var(--border-hi) transparent;
}
.tab {
    appearance: none; cursor: pointer;
    font: inherit; font-size: 11.5px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border-hi);
    border-radius: 999px;
    padding: 8px 15px;
    transition: color .16s, border-color .16s, background .16s;
}
.tab:hover { color: var(--text); border-color: #4d4d4d; }
.tab.is-active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* ---------------- carousel ---------------- */
.carousel {
    display: flex; gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x proximity;
    scrollbar-color: var(--border-hi) transparent;
}
.thumb {
    flex: 0 0 190px;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    background: var(--panel-alt);
    overflow: hidden;
    scroll-snap-align: start;
    display: flex; flex-direction: column;
    position: relative;
}
.thumb.is-fav { border-color: var(--accent); }
.thumb__btn {
    appearance: none; border: 0; padding: 0; cursor: pointer;
    background: repeating-conic-gradient(#141414 0% 25%, #101010 0% 50%) 50% / 18px 18px;
    aspect-ratio: 4 / 5;
    display: flex; align-items: center; justify-content: center;
}
.thumb__btn img { width: 100%; height: 100%; object-fit: contain; }
.thumb__meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.thumb__meta strong { font-size: 12px; font-weight: 600; }
.thumb__meta em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.thumb__custom { color: var(--accent) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb__actions {
    display: flex; gap: 5px; padding: 0 10px 10px;
    margin-top: auto;
}
.icon-btn {
    appearance: none; cursor: pointer; text-decoration: none;
    width: 28px; height: 28px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; line-height: 1;
    color: var(--muted);
    background: var(--panel); border: 1px solid var(--border-hi);
    transition: color .16s, border-color .16s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn--danger:hover { color: var(--bad); border-color: var(--bad); }
.thumb.is-fav [data-fav] { color: var(--accent); border-color: var(--accent); }

/* ---------------- compare slider ---------------- */
.compare {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: repeating-conic-gradient(#141414 0% 25%, #101010 0% 50%) 50% / 22px 22px;
    user-select: none;
    touch-action: pan-y;
}
.compare__img--left {
    position: relative;
    display: block;
    width: 100%; height: auto;
    max-height: 78vh;
    object-fit: contain;
    margin: 0 auto;
    pointer-events: none;
}
/* The right image sits exactly on top of the left one and is revealed
   with clip-path, so both stay in the same box whatever their size. */
.compare__img--right {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    pointer-events: none;
    clip-path: inset(0 0 0 50%);
}
.compare__line {
    position: absolute; top: 0; bottom: 0;
    left: 50%;
    width: 1px; margin-left: -0.5px;
    background: rgba(255, 106, 26, .7);
    pointer-events: none;
}
.compare__handle {
    position: absolute; top: 0; bottom: 0;
    left: 50%;
    width: 46px; margin-left: -23px;
    cursor: ew-resize;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; padding: 0;
}
.compare__handle:focus-visible { outline: 2px solid var(--accent); }
.compare__grip {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(255,106,26,.18), 0 6px 20px rgba(0,0,0,.6);
    position: relative;
}
.compare__grip::before,
.compare__grip::after {
    content: ""; position: absolute; top: 50%; width: 0; height: 0;
    border: 6px solid transparent;
}
.compare__grip::before { left: 5px;  transform: translateY(-50%); border-right-color: #140800; }
.compare__grip::after  { right: 5px; transform: translateY(-50%); border-left-color: #140800; }
.compare__tags {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; justify-content: space-between;
    padding: 10px 14px;
    font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--muted);
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.65));
    gap: 12px;
}
.compare__tags span {
    max-width: 46%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- lightbox ---------------- */
.lightbox {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(5,5,5,.94);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 60px 70px;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__close,
.lightbox__nav {
    position: absolute; appearance: none; cursor: pointer;
    background: rgba(20,20,20,.8);
    border: 1px solid var(--border-hi);
    color: var(--text);
    border-radius: 50%;
    width: 42px; height: 42px;
    font-size: 22px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.lightbox__close { top: 18px; right: 18px; }
.lightbox__nav--prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__close:hover, .lightbox__nav:hover { border-color: var(--accent); color: var(--accent); }
.lightbox__cap {
    position: absolute; bottom: 22px; left: 0; right: 0;
    text-align: center; margin: 0;
    font-size: 11.5px; color: var(--muted);
    letter-spacing: 0.16em; text-transform: uppercase;
}

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
    .topbar { flex-direction: column; align-items: flex-start; gap: 12px; position: static; }
    .convert { flex-direction: column; align-items: stretch; }
    .convert .btn { width: 100%; }
    .styles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .preview, .preview--stage { max-height: 52vh; }
    .lightbox { padding: 20px 12px 60px; }
    .lightbox__nav { width: 36px; height: 36px; }
}

@media (max-width: 520px) {
    body { font-size: 14.5px; }
    .styles { grid-template-columns: 1fr 1fr; }
    .style__desc { display: none; }
    .style__swatches { display: none; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .thumb { flex-basis: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   ROLES, OWNERSHIP, ADMIN FILTERS  (v2)
   ============================================================ */

.whoami {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; margin-left: 6px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--panel-alt);
    font-size: 11.5px; line-height: 1;
    max-width: 100%;
}
.whoami__name { color: var(--text); font-weight: 600; }
.whoami__user { color: var(--muted); font-size: 10.5px; }

.role {
    font-size: 9px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    padding: 3px 7px; border-radius: 3px;
    border: 1px solid var(--border-hi); color: var(--muted);
    white-space: nowrap;
}
.role--admin  { color: var(--accent); border-color: #5a3316; background: #1d1209; }
.role--design { color: #8fd0e8; border-color: #234450; background: #101c21; }

.owner {
    display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
    font-size: 11.5px;
}
.owner em { font-style: normal; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 9.5px; }
.owner strong { font-weight: 600; }
.owner__user { color: var(--muted); font-size: 10.5px; }
.owner--none strong { color: var(--muted); }

.filters {
    display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
    max-width: 760px;
}
.filters .field { margin-bottom: 0; }
.filters .input { min-width: 128px; }
.filters .field--grow { flex: 1 1 160px; }

.tabs--view { max-height: none; overflow: visible; margin-bottom: 20px; }
.tabs--view .tab { text-decoration: none; }

.group { margin-bottom: 34px; }
.group:last-child { margin-bottom: 0; }
.group__head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    padding-bottom: 10px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.group__name {
    margin: 0; font-size: 12px; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.group__name .owner__user { letter-spacing: 0.02em; text-transform: none; }

@media (max-width: 860px) {
    .whoami { margin-left: 0; }
    .filters { max-width: none; }
    .filters .field--grow { flex-basis: 100%; }
}

/* ============================================================
   LOADING STATE FOR IMAGES AND PENDING RENDERS
   ============================================================ */

/* Shimmer over any image area whose image has not decoded yet. */
.card__media.is-loading,
.thumb__btn.is-loading,
.panel__body.is-loading { position: relative; }

.card__media.is-loading::after,
.thumb__btn.is-loading::after,
.panel__body.is-loading::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, #131313 25%, #1d1d1d 37%, #131313 63%);
    background-size: 400% 100%;
    animation: dk-shimmer 1.3s ease-in-out infinite;
    pointer-events: none;
}

/* A render that has been queued but not produced yet. */
.thumb--pending { border-color: #3a2c18; }
.thumb--pending .thumb__meta em { color: var(--work); }

.thumb__btn--pending {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 4 / 5;
    background: repeating-conic-gradient(#141414 0% 25%, #101010 0% 50%) 50% / 18px 18px;
    border: 0;
}

.thumb--failed { border-color: #4a2b28; }
.thumb--failed .thumb__meta em { color: var(--bad); }
.thumb--failed .thumb__btn--pending .spinner { display: none; }
.thumb--failed .thumb__btn--pending::before {
    content: "!";
    color: var(--bad);
    font-size: 22px; font-weight: 700;
}

.spinner--sm { width: 15px; height: 15px; border-width: 2px; }

/* "still running" banner */
.alert--work {
    border-left-color: var(--work);
    color: var(--work);
    display: flex; align-items: center; gap: 11px;
}
.alert--work .spinner { flex: none; }
