/* ── floatingcards.css ── */

/* ─── Card stacks positioning ─── */
#left-stack {
    position: fixed;
    bottom: calc(var(--timebar-h) + 12px);
    left: 12px;
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: var(--card-w);
    transition: bottom 0.25s ease;
}
#left-stack.no-timebar { bottom: 12px; }

#right-stack {
    position: fixed;
    bottom: calc(var(--timebar-h) + 42px);
    right: 12px;
    z-index: 800;
    width: var(--card-w);
    transition: bottom 0.25s ease;
}
#right-stack.no-timebar { bottom: 42px; }

/* ─── Floating Card ─── */
.fcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.fcard:hover { box-shadow: var(--shadow-lg); }

.fcard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 9px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    cursor: default;
    user-select: none;
}

.fcard-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 13.5px;
    color: var(--text-1);
    letter-spacing: 0.01em;
}
.fcard-title svg { color: var(--accent); flex-shrink: 0; }

.fcard-toggle {
    width: 22px; height: 22px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3);
    transition: background 0.15s, color 0.15s, transform 0.2s;
}
.fcard-toggle:hover { background: var(--surface-2); color: var(--text-1); }
.fcard.collapsed .fcard-toggle { transform: rotate(180deg); }
.fcard.collapsed .fcard-body { display: none; }

.fcard-body {
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
}

.fcard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    color: var(--text-3);
    text-align: center;
    line-height: 1.5;
    font-size: 12px;
}

/* ─── Layer item (in Active Layers card, compact) ─── */
.layer-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
}
.layer-row:last-child { border-bottom: none; }

.layer-thumb {
    width: 38px; height: 38px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    overflow: hidden;
    flex-shrink: 0;
}
.layer-thumb img { width: 100%; height: 100%; object-fit: cover; }

.layer-info { flex: 1; overflow: hidden; }
.layer-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.layer-year {
    font-size: 10px;
    color: var(--accent);
    font-weight: 500;
    margin-top: 1px;
}

.layer-btns { display: flex; gap: 2px; }
.layer-btn {
    width: 24px; height: 24px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3);
    transition: background 0.12s, color 0.12s;
}
.layer-btn:hover { background: var(--surface-2); color: var(--text-1); }
.layer-btn.is-on { color: var(--accent); }
.layer-btn.rm:hover { background: var(--red-lt); color: var(--red); }

/* ─── Layer controls card (right side) ─── */
.lc-item {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 7px;
    overflow: hidden;
}
.lc-item:last-child { margin-bottom: 0; }

.lc-item-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.lc-name {
    flex: 1;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lc-year {
    font-size: 10px;
    padding: 1px 6px;
    background: var(--accent-lt);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    border-radius: 100px;
    font-weight: 500;
    flex-shrink: 0;
}

.lc-item-body { padding: 7px 8px; }

.lc-opacity-row {
    display: flex;
    align-items: center;
    gap: 7px;
}
.lc-opacity-label {
    font-size: 10.5px;
    color: var(--text-3);
    width: 44px;
    flex-shrink: 0;
}
.opacity-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}
.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    cursor: pointer;
}
.opacity-val {
    font-size: 10.5px;
    color: var(--text-2);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

.lc-order-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--border);
}
.lc-order-label {
    flex: 1;
    font-size: 10.5px;
    color: var(--text-3);
}
.lc-order-btn {
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 10.5px;
    color: var(--text-2);
    background: var(--bg);
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.lc-order-btn:hover:not(:disabled) {
    background: var(--accent-lt);
    border-color: var(--accent-border);
    color: var(--accent);
}
.lc-order-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── Recommendation mini-card ─── */
.rec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: background 0.12s;
}
.rec-item:last-child { border-bottom: none; }
.rec-item:hover { background: var(--surface-2); }

.rec-thumb {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    overflow: hidden; flex-shrink: 0;
}
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }

.rec-info { flex: 1; overflow: hidden; }
.rec-name {
    font-size: 11.5px; font-weight: 500;
    color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-meta { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.rec-why {
    font-size: 9.5px;
    color: var(--accent);
    background: var(--accent-lt);
    border: 1px solid var(--accent-border);
    border-radius: 100px;
    padding: 1px 6px;
    white-space: nowrap;
    margin-top: 2px;
    display: inline-block;
}

.rec-add {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.12s, transform 0.12s;
}
.rec-add:hover { background: var(--accent-hover); transform: scale(1.1); }
