/* ===================================
   UI COMPONENTS — BloxUI Studio
   FILE: css/components.css
   ROLE: Buttons, layers tree, inspector widgets, color picker, eyedropper, modals, Settings cards
   RELATED JS: js/inspector.js, js/layersTree.js, js/smartGuides.js
   =================================== */

/* ========== BUTTONS ========== */
.btn-download {
    background: #ff6a00;
    color: white;
    border: none;
    padding: 7px 14px;
    height: 34px;
    box-sizing: border-box;
    border-radius: 7px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.25);
    transition: background 0.15s;
}

.btn-download:hover {
    background: #ff7d1a;
}

.btn-download:active {
    transform: translateY(0);
}

/* Кнопка «Сохранить в базу» / «Обновить проект» (Solid Синий) */
.btn-save-db {
    height: 34px;
    padding: 0 14px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.btn-save-db svg {
    flex-shrink: 0;
}

.btn-save-db.dirty {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn-save-db.dirty:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-save-db.clean {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted, #8b949e);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    cursor: default;
}

.btn-save-db.clean:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: none;
}

.btn-save-db.saving {
    background: #2563eb;
    color: #fff;
    opacity: 0.7;
    cursor: wait;
}

.btn-save-db:disabled {
    pointer-events: none;
}

/* Кнопка создания превью шаблона в шапке */
.btn-capture-preview {
    background: var(--bg-surface, #1e222d);
    color: var(--text-main, #e0e6ed);
    border: 1px solid var(--border, #2d3343);
    border-radius: 6px;
    padding: 7px 13px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 35px;
    box-sizing: border-box;
    transition: 0.2s;
}

.btn-capture-preview:hover {
    background: var(--bg-hover, #2a3142);
    border-color: var(--accent, #00a2ff);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-capture-preview:active {
    transform: translateY(0);
}

/* ========== AUTOSAVE STATUS (локальный Autosave в браузере) ========== */
.autosave-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted, #8b949e);
    user-select: none;
    padding: 4px 6px;
    background: transparent;
    border: none;
    transition: color 0.2s ease;
}

.autosave-status .autosave-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
    display: inline-block;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.autosave-status .autosave-text {
    line-height: 1;
    white-space: nowrap;
}

.autosave-status.is-saving {
    color: var(--accent, #00a2ff);
}

.autosave-status.is-saving .autosave-dot {
    background: #00a2ff;
    box-shadow: 0 0 6px rgba(0, 162, 255, 0.45);
    animation: autosave-pulse 0.9s infinite alternate ease-in-out;
}

.autosave-status.is-saved {
    color: var(--text-muted, #8b949e);
}

.autosave-status.is-saved .autosave-dot {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.autosave-status.is-error {
    color: #ff4d4f;
}

.autosave-status.is-error .autosave-dot {
    background: #ff4d4f;
    box-shadow: 0 0 6px rgba(255, 77, 79, 0.45);
}

@keyframes autosave-pulse {
    0% { opacity: 0.35; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1.15); }
}

.btn-capture-preview.is-hidden {
    display: none !important;
}

.btn-capture-preview.is-capturing {
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
}

/* ========== COMPONENTS GRID (8 UI Elements) ========== */
.components-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.comp-item {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: grab;
    transition: all 0.2s;
    color: var(--text-main);
    user-select: none;
    -webkit-user-select: none;
}

.comp-item:hover {
    border-color: var(--blue-roblox);
    background: rgba(41, 121, 255, 0.08);
    transform: translateY(-2px);
}

.comp-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.comp-item.is-dragging {
    opacity: 0.4;
    transform: scale(0.96);
    cursor: grabbing;
}

.comp-item svg,
.comp-item i {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    color: var(--blue-roblox);
    pointer-events: none;
}

/* ========== LAYERS TREE ========== */
.layers-tree {
    padding: 10px 10px 36px;
    font-size: 13px;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.tree-node {
    display: flex;
    flex-direction: column;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: grab;
    color: var(--text-main);
    transition: 0.15s;
    position: relative;
    user-select: none;
    -webkit-user-drag: none;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-item.selected {
    background: rgba(255, 122, 0, 0.15);
    color: var(--focus-color);
}

.layer-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.tree-children {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    border-left: 1px dashed var(--border);
    margin-left: 10px;
}

.tree-children.collapsed {
    display: none;
}

.chevron {
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: 0.15s;
}

.chevron:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tree-indent {
    width: 14px;
    display: inline-block;
    flex-shrink: 0;
}

.layer-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-item.is-root {
    cursor: pointer;
}

.layer-item.is-dragging {
    opacity: 0.4;
}

.layer-item.drop-before::before,
.layer-item.drop-after::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--focus-color);
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 0 1px rgba(255, 122, 0, 0.25);
}

.layer-item.drop-before::before {
    top: 0;
}

.layer-item.drop-after::after {
    bottom: 1px;
}

.layer-item.drop-inside {
    outline: 1px dashed var(--focus-color);
    background: rgba(255, 122, 0, 0.18);
}

.layer-rename-input {
    flex: 1;
    min-width: 0;
    background: var(--bg-main);
    border: 1px solid var(--focus-color);
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    outline: none;
    user-select: text;
    cursor: text;
}

body.is-layer-dragging {
    user-select: none !important;
}

body.is-layer-dragging,
body.is-layer-dragging * {
    cursor: grabbing !important;
}

/* ========== INSPECTOR PROPERTIES ========== */
.prop-section {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.prop-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.prop-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.prop-label-with-warn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.prop-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    flex: 1;
    transition: 0.15s;
}

.input-group:focus-within {
    border-color: var(--blue-roblox);
}

.input-group input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    font-size: 12px;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.15s;
}

.input-icon:hover {
    color: var(--blue-roblox);
}

/* ========== COLOR PICKER ========== */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="color"] {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    height: 32px;
    width: 42px;
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-swatch {
    width: 42px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 2px var(--bg-main);
}

.color-swatch:hover,
.color-swatch:focus-visible {
    border-color: var(--blue-roblox);
    outline: none;
}

.color-hex-input {
    flex: 1;
    min-width: 0;
    height: 32px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    padding: 6px 10px;
    outline: none;
}

.color-hex-input:focus {
    border-color: var(--blue-roblox);
}

.color-popover {
    position: fixed;
    z-index: 4000;
    width: 220px;
    padding: 10px;
    background: var(--bg-activity, #1e1e1e);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    display: none;
    user-select: none;
}

.color-popover.is-open {
    display: block;
}

.color-sv {
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: 6px;
    overflow: hidden;
    cursor: crosshair;
    background: #ff0000;
    touch-action: none;
}

.color-sv-white,
.color-sv-black {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.color-sv-white {
    background: linear-gradient(to right, #ffffff, transparent);
}

.color-sv-black {
    background: linear-gradient(to top, #000000, transparent);
}

.color-sv-cursor {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-hue {
    position: relative;
    height: 14px;
    margin-top: 10px;
    border-radius: 7px;
    cursor: pointer;
    touch-action: none;
    background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.color-hue-cursor {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 18px;
    border: 2px solid #ffffff;
    border-radius: 3px;
    background: transparent;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-popover-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.color-popover-preview {
    width: 32px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.color-popover-hex {
    flex: 1;
    min-width: 0;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    padding: 6px 8px;
    outline: none;
}

.color-popover-hex:focus {
    border-color: var(--blue-roblox);
}

.color-eyedropper-btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    cursor: pointer;
    padding: 0;
}

.color-eyedropper-btn svg {
    width: 14px;
    height: 14px;
}

.color-eyedropper-btn:hover,
.color-eyedropper-btn:focus-visible {
    border-color: var(--blue-roblox);
    color: var(--blue-roblox);
    outline: none;
}

.color-eyedropper-btn.is-active {
    background: var(--blue-roblox);
    border-color: var(--blue-roblox);
    color: #ffffff;
}

.color-eyedropper-lens {
    position: fixed;
    z-index: 5000;
    display: none;
    pointer-events: none;
    transform: translate(14px, 18px);
    background: var(--bg-activity, #1e1e1e);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    align-items: center;
    gap: 8px;
}

.color-eyedropper-lens.is-visible {
    display: flex;
}

.color-eyedropper-lens-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.color-eyedropper-lens-hex {
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text-main);
    min-width: 4.5em;
}

body.is-color-eyedropping,
body.is-color-eyedropping * {
    cursor: crosshair !important;
}

body.is-color-eyedropping .color-popover,
body.is-color-eyedropping .color-popover * {
    cursor: default !important;
}

body.is-color-eyedropping .color-eyedropper-btn,
body.is-color-eyedropping .color-eyedropper-btn * {
    cursor: pointer !important;
}

/* ========== SLIDERS ========== */
.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

input[type="range"] {
    flex: 1;
    accent-color: var(--blue-roblox);
    cursor: pointer;
    touch-action: none;
}

.slider-val {
    font-size: 12px;
    width: 48px;
    text-align: right;
    color: var(--text-main);
    font-weight: 600;
}

/* ========== TOGGLE BUTTONS ========== */
.toggle-group {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.toggle-btn {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    line-height: 1.2;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: 0.15s;
}

.toggle-btn:disabled {
    cursor: not-allowed;
}

.toggle-btn:hover {
    border-color: var(--blue-roblox);
    color: var(--text-main);
}

.toggle-btn.active {
    background: var(--blue-roblox);
    border-color: var(--blue-roblox);
    color: white;
}

.toggle-group.is-locked {
    opacity: 0.55;
    pointer-events: none;
}

.toggle-group.is-locked .toggle-btn {
    cursor: not-allowed;
}

.scale-preview-group,
.scale-type-group {
    flex-wrap: wrap;
}

.scale-type-group .toggle-btn {
    flex: 1 1 calc(33.33% - 4px);
    min-width: 0;
    padding: 6px 8px;
}

.scale-type-extras {
    margin: 0 0 10px;
}

.scale-type-extras .prop-row {
    margin-bottom: 6px;
}

.scale-preview-group .toggle-btn {
    min-width: 0;
    padding: 6px 8px;
    font-size: 10px;
}

/* ========== ALIGNMENT BUTTONS ========== */
.align-group {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.align-btn {
    flex: 1;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}

.align-btn:hover {
    border-color: var(--blue-roblox);
    color: var(--text-main);
}

.align-btn.active {
    background: var(--blue-roblox);
    border-color: var(--blue-roblox);
    color: white;
}

.align-btn svg {
    width: 16px;
    height: 16px;
}

/* ========== SCREEN ALIGN / ASPECT / ANCHOR PIN ========== */
.screen-align-card {
    background: var(--bg-activity);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
}

.screen-align-card .image-hint {
    margin-bottom: 8px;
}

.screen-align-grid-wrap {
    display: flex;
    justify-content: center;
}

.screen-align-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 150px;
    height: 120px;
    background: var(--bg-main);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.screen-align-btn {
    background: var(--bg-card, var(--bg-panel));
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    transition: 0.12s;
}

.screen-align-btn:hover {
    border-color: var(--blue-roblox);
    color: var(--text-main);
    background: rgba(0, 162, 255, 0.1);
}

.screen-align-btn.active {
    background: var(--blue-roblox);
    border-color: var(--blue-roblox);
    color: #fff;
}

.aspect-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.aspect-card .aspect-toggle {
    margin-bottom: 0;
}

.aspect-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
}

.aspect-options .option-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.prop-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pivot-toggle {
    margin-bottom: 0;
    font-weight: 500;
}

/* ========== GRADIENT TEXT PREVIEW ========== */
.canvas-element .gradient-text {
    background-size: 100% 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ========== MULTI-STOP GRADIENT EDITOR ========== */
.gradient-editor {
    position: relative;
    margin: 4px 0 10px;
    padding-top: 6px;
    padding-bottom: 8px;
}

.gradient-track {
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--border);
    position: relative;
    cursor: crosshair;
    background: #111;
}

.gradient-stop {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.gradient-stop:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.15);
}

.gradient-stop.is-active {
    border: 3px solid var(--blue-roblox);
    z-index: 20;
    box-shadow: 0 0 0 2px rgba(41, 121, 255, 0.35);
}

.rot-preset-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.rot-preset-btn {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.rot-preset-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.rot-preset-btn.active {
    background: var(--blue-roblox);
    color: #fff;
    border-color: var(--blue-roblox);
}

.rotation-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.warn-badge {
    display: none;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 12px;
    cursor: help;
    position: relative;
    flex-shrink: 0;
}

.warn-badge.is-visible {
    display: inline-flex;
}

/* Nested .tooltip is only a text source. The visible tip is position:fixed
   on document.body so .inspector / .panel-content overflow cannot clip it. */
.warn-badge .tooltip {
    display: none;
}

.warn-tooltip {
    position: fixed;
    z-index: 4500;
    width: 240px;
    max-width: calc(100vw - 16px);
    background: var(--bg-card);
    color: var(--text-main);
    text-align: left;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: break-word;
    border: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}

.warn-tooltip.is-visible {
    visibility: visible;
    opacity: 1;
    transform: none;
}

.warn-tooltip.is-wide {
    width: 300px;
}

.checkbox-group .warn-badge {
    margin-left: 2px;
}

/* ========== IMAGE PREVIEW ========== */
.image-preview,
.image-preview-card {
    width: 100%;
    height: 120px;
    background: var(--bg-activity);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 14px;
    color: var(--text-muted);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.image-preview-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.image-preview-card svg {
    width: 28px;
    height: 28px;
    opacity: 0.7;
}

.image-asset-group input {
    min-width: 0;
}

.image-preview-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: rgba(16, 18, 23, 0.82);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 3px 8px;
    border-radius: 999px;
}

/* ========== IMAGE UPLOAD ========== */
.image-prop-section .prop-label {
    margin-top: 4px;
}

.upload-image-wrapper {
    margin-bottom: 12px;
}

.upload-image-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-main);
    border: 1px dashed var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.upload-image-btn svg {
    width: 16px;
    height: 16px;
}

.upload-image-btn:hover {
    border-color: var(--blue-roblox);
    color: var(--text-main);
    background: rgba(41, 121, 255, 0.08);
}

.uploaded-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 7px 10px;
    background: rgba(41, 121, 255, 0.1);
    border: 1px solid rgba(41, 121, 255, 0.28);
    border-radius: 6px;
}

.uploaded-info-icon {
    width: 14px;
    height: 14px;
    color: var(--blue-roblox);
    flex-shrink: 0;
}

.uploaded-filename {
    font-size: 11px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.upload-clear-btn {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.upload-clear-btn:hover {
    color: var(--red-close);
}

.image-asset-group {
    margin-bottom: 6px;
}

.asset-prefix {
    color: var(--text-muted);
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    margin-right: 6px;
    flex-shrink: 0;
    user-select: none;
}

.image-hint {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.image-publish-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    margin-top: 2px;
    background: var(--blue-roblox);
    border: 1px solid var(--blue-roblox);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.image-publish-btn svg {
    width: 15px;
    height: 15px;
}

.image-publish-btn:hover:not(:disabled) {
    background: var(--blue-hover);
    border-color: var(--blue-hover);
}

.image-publish-btn.is-locked {
    background: var(--bg-main);
    border-color: var(--border);
    color: var(--text-main);
}

.image-publish-btn.is-locked:hover:not(:disabled) {
    border-color: var(--blue-roblox);
    background: rgba(41, 121, 255, 0.08);
}

.image-publish-btn.is-disabled,
.image-publish-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.image-publish-btn.is-busy {
    opacity: 0.75;
    pointer-events: none;
}

/* Secondary button: pick an image from Roblox (picker modal) */
.image-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.image-picker-btn svg {
    width: 15px;
    height: 15px;
    color: var(--blue-roblox);
}

.image-picker-btn:hover {
    border-color: var(--blue-roblox);
    background: rgba(41, 121, 255, 0.08);
}

/* Upload status line */
.image-publish-status {
    margin-top: 6px;
    min-height: 14px;
}

.image-publish-status.is-ok {
    color: #4cd964;
}

.image-publish-status.is-warn {
    color: #f5a623;
}

.image-publish-status.is-error {
    color: var(--red-close, #ff5252);
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-panel);
    padding: 25px;
    border-radius: 12px;
    max-width: 500px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--blue-roblox);
    font-size: 18px;
}

.modal-content p,
.modal-content li {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.6;
}

.modal-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    float: right;
    margin-top: 15px;
    font-weight: 600;
    transition: 0.2s;
}

.modal-btn:hover {
    background: var(--accent-hover);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px;
}

.modal-actions .modal-btn {
    float: none;
    margin-top: 0;
}

.modal-btn-ghost {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.modal-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

.settings-group {
    margin-bottom: 28px;
}

.settings-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.settings-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.settings-card-spaced {
    margin-bottom: 16px;
}

.settings-card .checkbox-group {
    margin: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.settings-card .checkbox-group:last-child {
    border-bottom: none;
}

.settings-card .checkbox-group:hover {
    background: rgba(255, 255, 255, 0.02);
}

.settings-card .custom-checkbox {
    width: 18px;
    height: 18px;
}

.settings-card .checkbox-label {
    font-size: 13.5px;
    font-weight: 500;
}

.settings-slider-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}

.settings-slider-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 12px;
}

.settings-slider-card .slider-val {
    width: auto;
    color: var(--blue-roblox);
    font-size: 13px;
    font-weight: 700;
}

.settings-slider-card input[type="range"] {
    width: 100%;
    flex: none;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 4px;
    background: var(--bg-main);
    outline: none;
}

.settings-slider-card input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--blue-roblox);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 8px rgba(41, 121, 255, 0.45);
}

.settings-slider-card input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--blue-roblox);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 8px rgba(41, 121, 255, 0.45);
}

.settings-placeholder {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px 18px;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

/* ========== CHECKBOX ========== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.custom-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--border);
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.15s;
}

.checkbox-group:hover .custom-checkbox {
    border-color: var(--blue-roblox);
}

.checkbox-group input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--blue-roblox);
    border-color: var(--blue-roblox);
}

.checkbox-group input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '';
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.checkbox-group input[type="checkbox"] {
    display: none;
}

.checkbox-label {
    font-size: 12px;
    color: var(--text-main);
}

/* ========== RICH TEXT BUILDER ========== */
.richtext-builder {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.richtext-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    padding: 8px 10px;
}

.richtext-tool {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.12s;
}

.richtext-tool:hover {
    border-color: var(--blue-roblox);
    color: #fff;
}

.richtext-tool:active {
    transform: scale(0.92);
}

.richtext-editor {
    width: 100%;
    min-height: 85px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px 14px;
    color: #FFFFFF;
    font-family: Fredoka, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    word-break: break-word;
    white-space: pre-wrap;
}

.richtext-editor:focus {
    border-color: var(--blue-roblox);
}

.richtext-editor b,
.richtext-editor strong {
    font-weight: 800;
}

.richtext-editor s,
.richtext-editor strike,
.richtext-editor del {
    text-decoration: line-through;
    text-decoration-color: currentColor;
}

.richtext-color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--bg-main);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.richtext-color-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.richtext-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.richtext-preset {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: 0.15s;
}

.richtext-preset:hover {
    border-color: var(--blue-roblox);
    background: var(--bg-panel);
}

/* ========== GOOGLE FONTS PICKER ========== */
.font-picker {
    position: relative;
    margin-bottom: 8px;
}

.font-picker-current {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: 0.15s;
}

.font-picker-current:hover,
.font-picker.is-open .font-picker-current {
    border-color: var(--blue-roblox);
}

.font-picker-preview {
    width: 36px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    flex-shrink: 0;
}

.font-picker-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.font-picker-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-picker-cat {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.font-picker-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.font-picker.is-open .font-picker-chevron {
    transform: rotate(180deg);
}

.font-picker-panel {
    margin-top: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.font-picker-search {
    margin: 8px;
    flex: none;
}

.font-picker-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 8px 8px;
}

.font-cat-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.12s;
}

.font-cat-btn:hover {
    border-color: var(--blue-roblox);
    color: var(--text-main);
}

.font-cat-btn.active {
    background: rgba(41, 121, 255, 0.16);
    border-color: var(--blue-roblox);
    color: #fff;
}

.font-picker-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 0 6px 8px;
}

.font-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
}

.font-option:hover {
    background: var(--bg-panel);
    border-color: var(--border);
}

.font-option.is-selected {
    background: rgba(41, 121, 255, 0.12);
    border-color: var(--blue-roblox);
}

.font-option-preview {
    width: 28px;
    flex-shrink: 0;
    font-size: 15px;
    text-align: center;
}

.font-option-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-option-cat {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.font-picker-empty {
    padding: 16px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ========== HEADER AUTH (Roblox OAuth) ========== */
.auth-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.auth-login-btn svg {
    width: 14px;
    height: 14px;
    color: var(--blue-roblox);
}

.auth-login-btn:hover {
    border-color: var(--blue-roblox);
    background: rgba(41, 121, 255, 0.08);
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
}

.auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg-activity);
    flex-shrink: 0;
}

.auth-avatar-fallback {
    display: inline-block;
    background: var(--blue-roblox);
}

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

.auth-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.auth-logout-btn svg {
    width: 14px;
    height: 14px;
}

.auth-logout-btn:hover {
    border-color: var(--red-close, #ff5252);
    color: var(--red-close, #ff5252);
}

/* ========== ROBLOX ASSET PICKER MODAL (DEMO MATCH) ========== */
#asset-picker-modal {
    --bg-dark: #0b0e14;
    --modal-bg: #141820;
    --card-bg: #1a202c;
    --card-hover: #222a3a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #3b82f6;
    --text-main: #f1f5f9;
    --text-muted: #8b949e;
    --accent-blue: #2563eb;
    --accent-hover: #1d4ed8;
    --skeleton-base: #1b212c;
    --skeleton-highlight: #283243;

    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#asset-picker-modal.active {
    display: flex;
}

#asset-picker-modal .modal-box {
    width: 100%;
    max-width: 680px;
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: assetPickerFadeIn 0.2s ease-out;
}

@keyframes assetPickerFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Шапка модалки */
#asset-picker-modal .modal-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

#asset-picker-modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #60a5fa;
    margin: 0;
    line-height: 1.2;
}

#asset-picker-modal .close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#asset-picker-modal .close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

/* Табы переключения */
#asset-picker-modal .tabs-bar {
    display: flex;
    padding: 16px 24px 0 24px;
    gap: 10px;
}

#asset-picker-modal .tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

#asset-picker-modal .tab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

#asset-picker-modal .tab-btn.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent-blue);
    color: #93c5fd;
}

/* Тело модалки */
#asset-picker-modal .modal-body {
    padding: 18px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Строка поиска */
#asset-picker-modal .search-row {
    display: flex;
    gap: 10px;
}

#asset-picker-modal .search-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

#asset-picker-modal .search-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

#asset-picker-modal .search-input {
    width: 100%;
    height: 42px;
    background: #0f131a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 14px 0 40px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#asset-picker-modal .search-input::placeholder {
    color: #4b5563;
}

#asset-picker-modal .search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

#asset-picker-modal .submit-btn {
    height: 42px;
    padding: 0 20px;
    background: var(--accent-blue);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}

#asset-picker-modal .submit-btn:hover {
    background: var(--accent-hover);
}

#asset-picker-modal .submit-btn:active {
    transform: scale(0.98);
}

/* Контейнер результатов */
#asset-picker-modal .results-container {
    min-height: 250px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
}

#asset-picker-modal .results-container::-webkit-scrollbar {
    width: 6px;
}

#asset-picker-modal .results-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Сетка карточек */
#asset-picker-modal .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    width: 100%;
}

/* Анимация Скелетона (Shimmer) */
@keyframes assetPickerShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

#asset-picker-modal .skeleton-card {
    height: 155px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: assetPickerShimmer 1.4s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Индикатор загрузки под скелетоном */
#asset-picker-modal .loading-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    color: #93c5fd;
    font-size: 13px;
    animation: assetPickerPulse 1.5s infinite ease-in-out;
}

@keyframes assetPickerPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

#asset-picker-modal .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(147, 197, 253, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: assetPickerSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes assetPickerSpin {
    to { transform: rotate(360deg); }
}

/* Реальная карточка ассета */
#asset-picker-modal .asset-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease-out;
    outline: none;
    text-align: left;
    user-select: none;
}

#asset-picker-modal .asset-card:hover,
#asset-picker-modal .asset-card:focus-visible {
    background: var(--card-hover);
    border-color: rgba(96, 165, 250, 0.4);
    transform: translateY(-2px);
}

#asset-picker-modal .asset-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #0d1117;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}

#asset-picker-modal .asset-thumb img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

#asset-picker-modal .asset-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#asset-picker-modal .asset-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#asset-picker-modal .asset-id {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Подсказка внизу */
#asset-picker-modal .modal-footer-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}

/* Пустые состояния */
#asset-picker-modal .asset-picker-empty {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 13px;
    line-height: 1.5;
}

#asset-picker-modal .asset-picker-empty .empty-icon {
    font-size: 34px;
    margin-bottom: 10px;
    line-height: 1;
}

#asset-picker-modal .asset-picker-empty p {
    margin: 0;
    max-width: 400px;
}

/* ---- Toast notifications ---- */
#toast-container {
    position: fixed;
    top: 52px;
    right: 14px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #fff;
    background: #33383f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: #1f6b3a; border-color: #2ea45c; }
.toast-error   { background: #7a2430; border-color: #b0404e; }
.toast-info    { background: #2b4a6f; border-color: #3f6da3; }
