/**
 * 512Studio — estilos del editor frontend.
 *
 * REGLA DE CAPAS:
 *   - Motor (tema-cero) decide cómo funciona.
 *   - Child (le-corch-photo / atelier / etc.) decide cómo se ve (paleta + tipo).
 *   - Plugin (este archivo) decide qué hace y cómo se estructura por dentro.
 *
 * Por eso este CSS NO trae paleta hardcoded. Consume las variables del child
 * activo via `var(--color-*)` con fallback. El child inyecta esas variables
 * a través de su `dynamic-css.php` siempre que se ejecute `wp_head()` —
 * incluso cuando el CSS de componentes del child está dequeado en /panel/.
 *
 * Si mañana el child cambia de marino a verde a dorado, el panel acompaña
 * automáticamente. Si el cliente customiza desde el Customizer del sitio,
 * el panel también acompaña sin tocar este archivo.
 *
 * Sin !important. Mobile-first.
 */

:root {
    /* Tokens del look — heredados del child activo, con fallback marino LeCorch */
    --lcp-bg:           var(--color-fondo,        #0B1A2E);
    --lcp-surface:      var(--color-superficie,   #122443);
    --lcp-surface-2:    var(--color-secundario,   #1B3A5C);
    --lcp-border:       var(--color-borde,        rgba(255, 255, 255, 0.12));
    --lcp-text:         var(--color-texto,        #F2F4F7);
    --lcp-text-muted:   var(--color-texto-suave,  rgba(255, 255, 255, 0.65));
    --lcp-accent:       var(--color-secundario,   #4A8FB8);
    --lcp-font:         var(--font-cuerpo,        'Courier Prime', 'Courier New', Courier, ui-monospace, monospace);
    --lcp-radius:       var(--radio-md,           4px);
    --lcp-easing:       var(--lc-anim-easing,     cubic-bezier(0.22, 1, 0.36, 1));

    /* Tokens propios del editor (no provienen del child — son layout interno) */
    --lcp-success: #5CB85C;
    --lcp-error:   #E55353;
    --lcp-warn:    #E0A458;
    --lcp-pad:     16px;
    --lcp-gap:     12px;
    --lcp-shadow:  0 4px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body.lc-panel {
    margin: 0;
    background: var(--lcp-bg);
    color: var(--lcp-text);
    font-family: var(--lcp-font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.lc-panel * {
    box-sizing: border-box;
}

a { color: var(--lcp-accent); }
a:hover, a:focus-visible { color: #fff; }

/* ─────────────────────────────────────────────
 * AUTH (login + recover) — fullscreen centered
 * ───────────────────────────────────────────── */
.lc-panel--auth .lc-panel__auth-main {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.lc-panel__auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--lcp-surface);
    padding: 40px 32px;
    border-radius: var(--lcp-radius);
    box-shadow: var(--lcp-shadow);
}
.lc-panel__auth-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0 0 4px;
    text-align: center;
}
.lc-panel__auth-subtitle {
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--lcp-text-muted);
    text-align: center;
    margin: 0 0 32px;
}
.lc-panel__auth-help {
    font-size: 13px;
    color: var(--lcp-text-muted);
    margin: 0 0 24px;
}
.lc-panel__auth-link {
    text-align: center;
    margin: 24px 0 0;
    font-size: 13px;
}

/* ─────────────────────────────────────────────
 * LAYOUT autenticado
 * ───────────────────────────────────────────── */
.lc-panel--authenticated {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}
.lc-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--lcp-surface);
    border-bottom: 1px solid var(--lcp-border);
}
.lc-panel__brand {
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
}
.lc-panel__user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}
.lc-panel__user-name {
    color: var(--lcp-text-muted);
}
.lc-panel__user-link {
    text-decoration: none;
    color: var(--lcp-text);
}

.lc-panel__layout {
    display: grid;
    grid-template-columns: 1fr;
    flex: 1;
}
@media (min-width: 769px) {
    .lc-panel__layout {
        grid-template-columns: 220px 1fr;
    }
}

.lc-panel__sidebar {
    background: var(--lcp-surface);
    border-bottom: 1px solid var(--lcp-border);
    padding: 16px;
}
@media (min-width: 769px) {
    .lc-panel__sidebar {
        border-right: 1px solid var(--lcp-border);
        border-bottom: none;
        min-height: 100%;
    }
}
.lc-panel__nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
@media (min-width: 769px) {
    .lc-panel__nav {
        flex-direction: column;
    }
}
.lc-panel__nav-link {
    display: block;
    padding: 10px 14px;
    border-radius: var(--lcp-radius);
    color: var(--lcp-text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s var(--lcp-easing);
}
.lc-panel__nav-link:hover,
.lc-panel__nav-link:focus-visible {
    background: var(--lcp-surface-2);
}
.lc-panel__nav-link.is-active {
    background: var(--lcp-accent);
    color: #fff;
}

.lc-panel__main {
    padding: 32px;
    max-width: 100%;
}
@media (min-width: 769px) {
    .lc-panel__main {
        padding: 40px 48px;
    }
}
.lc-panel__title {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 24px;
}
.lc-panel__lead {
    color: var(--lcp-text-muted);
    margin: 0 0 24px;
}

/* ─────────────────────────────────────────────
 * STATS + ACTIONS (dashboard)
 * ───────────────────────────────────────────── */
.lc-panel__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.lc-panel__stat {
    display: block;
    background: var(--lcp-surface);
    padding: 24px;
    border-radius: var(--lcp-radius);
    text-decoration: none;
    color: var(--lcp-text);
    border: 1px solid var(--lcp-border);
    transition: border-color 0.2s var(--lcp-easing);
}
.lc-panel__stat:hover { border-color: var(--lcp-accent); }
.lc-panel__stat-value {
    display: block;
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}
.lc-panel__stat-label {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--lcp-text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.lc-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

/* ─────────────────────────────────────────────
 * BOTONES
 * ───────────────────────────────────────────── */
.lc-panel__btn {
    display: inline-block;
    padding: 12px 20px;
    border: 1px solid var(--lcp-border);
    background: var(--lcp-surface);
    color: var(--lcp-text);
    font-family: var(--lcp-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--lcp-radius);
    transition: all 0.2s var(--lcp-easing);
}
.lc-panel__btn:hover,
.lc-panel__btn:focus-visible {
    background: var(--lcp-surface-2);
    border-color: var(--lcp-accent);
    outline: none;
}
.lc-panel__btn--primary {
    background: var(--lcp-accent);
    border-color: var(--lcp-accent);
    color: #fff;
}
.lc-panel__btn--primary:hover {
    background: #5fa3ce;
    border-color: #5fa3ce;
}
.lc-panel__btn--small {
    padding: 6px 12px;
    font-size: 11px;
}
.lc-panel__btn--danger:hover {
    background: var(--lcp-error);
    border-color: var(--lcp-error);
    color: #fff;
}
.lc-panel__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─────────────────────────────────────────────
 * FORMS
 * ───────────────────────────────────────────── */
.lc-panel__form { max-width: 640px; }
.lc-panel__form--wide { max-width: 880px; }
.lc-panel__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 20px;
}
.lc-panel__field--checkbox { flex-direction: row; align-items: center; gap: 8px; }
.lc-panel__field--checkbox label { font-size: 14px; }
.lc-panel__field label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--lcp-text-muted);
}
.lc-panel__field input[type="text"],
.lc-panel__field input[type="email"],
.lc-panel__field input[type="url"],
.lc-panel__field input[type="number"],
.lc-panel__field input[type="password"],
.lc-panel__field textarea,
.lc-panel__field select {
    width: 100%;
    background: var(--lcp-surface);
    color: var(--lcp-text);
    border: 1px solid var(--lcp-border);
    border-radius: var(--lcp-radius);
    padding: 10px 12px;
    font-family: var(--lcp-font);
    font-size: 15px;
    transition: border-color 0.2s var(--lcp-easing);
}
.lc-panel__field input:focus,
.lc-panel__field textarea:focus,
.lc-panel__field select:focus {
    outline: none;
    border-color: var(--lcp-accent);
}
.lc-panel__field textarea { min-height: 80px; resize: vertical; }
.lc-panel__field--media {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}
.lc-panel__hint {
    font-size: 11px;
    color: var(--lcp-text-muted);
    font-style: italic;
}
.lc-panel__radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--lcp-text);
    font-weight: 400;
}
.lc-panel__fieldset {
    border: 1px solid var(--lcp-border);
    border-radius: var(--lcp-radius);
    padding: 20px 24px;
    margin: 0 0 24px;
}
.lc-panel__fieldset legend {
    padding: 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--lcp-text-muted);
}
.lc-panel__submit {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin: 24px 0 0;
}
.lc-panel__feedback { font-size: 13px; min-height: 1em; margin: 0; }
.lc-panel__feedback[data-state="ok"] { color: var(--lcp-success); }
.lc-panel__feedback[data-state="error"] { color: var(--lcp-error); }

.lc-panel__media-preview {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 16 / 9;
    background: var(--lcp-surface);
    border: 1px dashed var(--lcp-border);
    border-radius: var(--lcp-radius);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.lc-panel__media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lc-panel__media-preview:empty::before {
    content: "—";
    color: var(--lcp-text-muted);
}

.lc-panel__msg {
    padding: 12px 16px;
    border-radius: var(--lcp-radius);
    font-size: 14px;
    margin: 0 0 16px;
}
.lc-panel__msg--success { background: rgba(92, 184, 92, 0.15); border: 1px solid var(--lcp-success); }
.lc-panel__msg--error   { background: rgba(229, 83, 83, 0.15); border: 1px solid var(--lcp-error); }
.lc-panel__msg--info    { background: rgba(74, 143, 184, 0.15); border: 1px solid var(--lcp-accent); }
.lc-panel__warn {
    padding: 12px 16px;
    background: rgba(224, 164, 88, 0.15);
    border: 1px solid var(--lcp-warn);
    border-radius: var(--lcp-radius);
    margin: 24px 0;
}

/* ─────────────────────────────────────────────
 * UPLOADER (vista pieces)
 * ───────────────────────────────────────────── */
.lc-panel__toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.lc-panel__uploader {
    background: var(--lcp-surface);
    padding: 24px;
    border-radius: var(--lcp-radius);
    margin-bottom: 32px;
}
.lc-panel__uploader-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (min-width: 600px) {
    .lc-panel__uploader-form { grid-template-columns: 1fr 1fr; }
}
.lc-panel__dropzone {
    border: 3px dashed var(--lcp-border);
    border-radius: var(--lcp-radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.2s var(--lcp-easing);
}
.lc-panel__dropzone:hover,
.lc-panel__dropzone:focus-visible,
.lc-panel__dropzone[data-dragover="true"] {
    border-color: var(--lcp-accent);
    background: rgba(74, 143, 184, 0.08);
    outline: none;
}
.lc-panel__dropzone-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}
.lc-panel__dropzone-hint {
    font-size: 13px;
    color: var(--lcp-text-muted);
    margin: 0 0 12px;
}
.lc-panel__queue {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.lc-panel__queue:empty { display: none; }
.lc-panel__queue-item {
    background: var(--lcp-bg);
    border: 1px solid var(--lcp-border);
    border-radius: var(--lcp-radius);
    padding: 12px;
    position: relative;
}
.lc-panel__queue-item-thumb {
    aspect-ratio: 16/9;
    background: var(--lcp-surface-2);
    overflow: hidden;
    border-radius: 2px;
    margin-bottom: 8px;
}
.lc-panel__queue-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lc-panel__queue-item-name {
    font-size: 12px;
    word-break: break-all;
    margin: 0 0 4px;
}
.lc-panel__queue-item-status {
    font-size: 11px;
    color: var(--lcp-text-muted);
    margin: 0;
}
.lc-panel__queue-item[data-state="ok"] { border-color: var(--lcp-success); }
.lc-panel__queue-item[data-state="ok"] .lc-panel__queue-item-status { color: var(--lcp-success); }
.lc-panel__queue-item[data-state="error"] { border-color: var(--lcp-error); }
.lc-panel__queue-item[data-state="error"] .lc-panel__queue-item-status { color: var(--lcp-error); }
.lc-panel__queue-item-progress {
    height: 4px;
    background: var(--lcp-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}
.lc-panel__queue-item-progress-bar {
    height: 100%;
    background: var(--lcp-accent);
    width: 0;
    transition: width 0.2s var(--lcp-easing);
}

/* ─────────────────────────────────────────────
 * PIEZAS LIST
 * ───────────────────────────────────────────── */
.lc-panel__section-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 32px 0 16px;
}
.lc-panel__pieces {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.lc-panel__piece {
    background: var(--lcp-surface);
    border-radius: var(--lcp-radius);
    overflow: hidden;
    border: 1px solid var(--lcp-border);
}
.lc-panel__piece-thumb {
    aspect-ratio: 16/9;
    background: var(--lcp-surface-2);
    position: relative;
}
.lc-panel__piece-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lc-panel__piece-thumb-empty {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--lcp-text-muted);
}
.lc-panel__piece-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(4px);
}
.lc-panel__piece-meta {
    padding: 12px 16px;
}
.lc-panel__piece-title {
    font-size: 15px;
    margin: 0 0 4px;
    font-weight: 700;
}
.lc-panel__piece-cats,
.lc-panel__piece-status {
    font-size: 12px;
    color: var(--lcp-text-muted);
    margin: 0;
}
.lc-panel__piece-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
    flex-wrap: wrap;
}
.lc-panel__empty {
    color: var(--lcp-text-muted);
    font-style: italic;
    margin: 32px 0;
}

/* ─────────────────────────────────────────────
 * CATEGORIES LIST
 * ───────────────────────────────────────────── */
.lc-panel__categories,
.lc-panel__subcategories {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lc-panel__categories > .lc-panel__category {
    margin-bottom: 12px;
}
.lc-panel__category-row {
    display: flex;
    gap: 16px;
    align-items: center;
    background: var(--lcp-surface);
    padding: 12px;
    border-radius: var(--lcp-radius);
    border: 1px solid var(--lcp-border);
    flex-wrap: wrap;
}
.lc-panel__category--child .lc-panel__category-row {
    margin-left: 24px;
    background: var(--lcp-bg);
    border-style: dashed;
}
.lc-panel__category-thumb {
    width: 80px;
    aspect-ratio: 16/9;
    background: var(--lcp-surface-2);
    border-radius: 2px;
    overflow: hidden;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.lc-panel__category-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lc-panel__category-meta { flex: 1; min-width: 200px; }
.lc-panel__category-name {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lc-panel__category-count {
    font-size: 12px;
    color: var(--lcp-text-muted);
    margin: 0;
}
.lc-panel__badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--lcp-accent);
    color: #fff;
    font-size: 10px;
    letter-spacing: 1px;
    border-radius: 2px;
    text-transform: uppercase;
}
.lc-panel__category-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.lc-panel__subcategories {
    margin-top: 4px;
}

/* ─────────────────────────────────────────────
 * DIALOGS
 * ───────────────────────────────────────────── */
.lc-panel__dialog {
    width: 100%;
    max-width: 640px;
    background: var(--lcp-surface);
    color: var(--lcp-text);
    border: 1px solid var(--lcp-border);
    border-radius: var(--lcp-radius);
    padding: 32px;
    box-shadow: var(--lcp-shadow);
}
.lc-panel__dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
}
.lc-panel__dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--lcp-text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}
.lc-panel__dialog-close:hover { color: #fff; }
.lc-panel__dialog-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 24px;
}

/* ─────────────────────────────────────────────
 * DETAILS / PROFILE
 * ───────────────────────────────────────────── */
.lc-panel__section { margin-bottom: 40px; }
.lc-panel__details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--lcp-text-muted);
    font-size: 14px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms;
        transition-duration: 0.01ms;
    }
}

/* =========================================================================
   v1.1 · Drag handle + modal biblioteca (Google Drive style, paleta oscura)
   ========================================================================= */

/* Drag handle de categorías */
.lc-panel__drag {
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
    line-height: 1;
    letter-spacing: -2px;
    cursor: grab;
    user-select: none;
    padding: 8px 4px;
    border-radius: 4px;
    transition: color 140ms ease, background 140ms ease;
    flex-shrink: 0;
}
.lc-panel__drag:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
}
.lc-panel__drag:active { cursor: grabbing; }

/* Que el drag handle quede a la izquierda del thumb */
.lc-panel__category-row {
    align-items: center;
    gap: 12px;
}

.lc-panel__category-placeholder {
    background: rgba(139, 92, 246, 0.15);
    border: 2px dashed rgba(139, 92, 246, 0.5);
    border-radius: 8px;
    margin: 4px 0;
    min-height: 80px;
}

.lc-panel__hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0 0 16px;
    font-style: italic;
}

.lc-panel__order-status {
    margin: 0 0 12px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}
.lc-panel__order-status.is-ok    { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.lc-panel__order-status.is-error { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }

/* ===== Modal biblioteca Google Drive (paleta oscura) ===== */

.lc-lib-modal {
    position: fixed;
    inset: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: var(--font, system-ui, sans-serif);
}
.lc-lib-modal[hidden] { display: none !important; }

.lc-lib-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lc-lib-modal__panel {
    position: relative;
    width: min(1120px, 100%);
    height: min(820px, calc(100vh - 48px));
    background: #111827;
    border-radius: 16px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFF;
}

.lc-lib-modal__head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0F172A;
}
.lc-lib-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #FFF;
}
.lc-lib-modal__search input {
    width: 280px;
    padding: 9px 12px 9px 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #FFF;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
.lc-lib-modal__search input:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.lc-lib-modal__search { position: relative; }
.lc-lib-modal__search::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-size: contain;
    pointer-events: none;
}

.lc-lib-modal__close {
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 120ms ease, color 120ms ease;
}
.lc-lib-modal__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFF;
}

.lc-lib-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.lc-lib-modal__drop {
    border: 2px dashed rgba(139, 92, 246, 0.45);
    border-radius: 12px;
    padding: 36px 24px;
    text-align: center;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
    color: #FFF;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
    cursor: pointer;
}
.lc-lib-modal__drop:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.16) 0%, rgba(59, 130, 246, 0.08) 100%);
}
.lc-lib-modal__drop.is-dragging {
    background: rgba(139, 92, 246, 0.25);
    border-color: #8B5CF6;
    transform: scale(1.01);
}
.lc-lib-modal__drop-icon {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 10px;
    color: #8B5CF6;
}
.lc-lib-modal__drop-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 500;
}
.lc-lib-modal__drop-hint {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}
.lc-lib-modal__drop-hint b {
    color: #C4B5FD;
    font-weight: 600;
    text-decoration: underline;
}

.lc-lib-modal__upload-status {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
}
.lc-lib-modal__upload-status[data-state="ok"]    { background: rgba(34, 197, 94, 0.2);  color: #86efac; }
.lc-lib-modal__upload-status[data-state="error"] { background: rgba(239, 68, 68, 0.2);  color: #fca5a5; }

.lc-lib-modal__lib-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.lc-lib-modal__lib-head h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.5);
}
.lc-lib-modal__count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.lc-lib-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.lc-lib-item {
    background: rgba(255, 255, 255, 0.04);
    border: 3px solid transparent;
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
    position: relative;
}
.lc-lib-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lc-lib-item__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.35);
    font-size: 32px;
}
.lc-lib-item__video-mark {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    pointer-events: none;
}
.lc-lib-item:hover {
    border-color: #8B5CF6;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.25);
}
.lc-lib-item.is-current {
    border-color: #C4B5FD;
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.18);
}
.lc-lib-item.is-current::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #C4B5FD;
    color: #1F1B33;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 2;
}
.lc-lib-item.is-selected {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.3);
}
.lc-lib-item.is-selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #8B5CF6;
    color: #FFF;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 2;
}
.lc-lib-item--skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: lc-lib-shimmer 1.4s infinite;
    cursor: default;
    pointer-events: none;
}
@keyframes lc-lib-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.lc-lib-modal__empty {
    text-align: center;
    padding: 36px 24px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-style: italic;
}

.lc-lib-modal__foot {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0F172A;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.lc-lib-modal__more {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
.lc-lib-modal__more:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.lc-lib-modal__multi {
    display: flex;
    align-items: center;
    gap: 16px;
}
.lc-lib-modal__multi-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

@media (max-width: 720px) {
    .lc-lib-modal { padding: 0; }
    .lc-lib-modal__panel { height: 100vh; max-height: 100vh; border-radius: 0; }
    .lc-lib-modal__head {
        grid-template-columns: 1fr auto;
    }
    .lc-lib-modal__title { grid-column: 1 / -1; }
    .lc-lib-modal__search input { width: 100%; }
    .lc-lib-modal__grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
