/* ═══════════════════════════════════════════════════════════════════════
   THE VERSIONS LIST (PLAN 4.7 / 4.8) - the read-only list of a surface's or a
   form's saved versions, opened from the Surface Builder's and the form
   designer's toolbars (UI.Portal/Components/Versions/LayoutVersionsList).
   Calm by default: neutral rows, one quiet "Current" mark, the fingerprint in
   mono. Every lv-* class is owned by THIS file alone; --theme-* tokens only
   (no hex), so a light and a dark tenant theme both read.
   ═══════════════════════════════════════════════════════════════════════ */

.lv-panel {
    margin: 8px 16px;
    padding: 12px 16px;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    background: var(--theme-background-raised);
    color: var(--theme-text);
    font-family: var(--theme-font);
    font-size: var(--theme-font-size-sm);
    max-height: 320px;
    overflow: auto;
    box-shadow: var(--theme-shadow);
}

.lv-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.lv-head-icon {
    color: var(--theme-text-muted);
}

.lv-title {
    margin: 0;
    font-size: var(--theme-font-size-base);
    font-weight: 600;
    color: var(--theme-text-emphasis);
}

.lv-state {
    color: var(--theme-text-muted);
}

.lv-head-tools {
    margin-left: auto;
    display: inline-flex;
    gap: 4px;
}

.lv-icon-btn {
    border: 1px solid transparent;
    border-radius: var(--theme-radius-button);
    background: transparent;
    color: var(--theme-text-muted);
    padding: 2px 8px;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color var(--theme-transition), color var(--theme-transition);
}

.lv-icon-btn:hover:not(:disabled) {
    background: var(--theme-background-hover);
    color: var(--theme-text);
}

.lv-icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--theme-focus-ring);
}

.lv-icon-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.lv-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lv-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    padding: 6px 8px;
    border-top: 1px solid var(--theme-border-subtle);
}

.lv-row:first-child {
    border-top: none;
}

.lv-row--current {
    background: var(--theme-primary-muted);
    border-radius: var(--theme-radius);
}

.lv-num {
    min-width: 3ch;
    font-weight: 600;
    color: var(--theme-text-emphasis);
}

.lv-when,
.lv-by {
    color: var(--theme-text-secondary);
}

.lv-hash {
    font-family: var(--theme-font-mono);
    font-size: var(--theme-font-size-xs);
    color: var(--theme-text-muted);
    background: var(--theme-background-subtle);
    border-radius: var(--theme-radius-button);
    padding: 0 6px;
}

.lv-current {
    font-size: var(--theme-font-size-xs);
    font-weight: 600;
    color: var(--theme-primary);
    border: 1px solid var(--theme-primary);
    border-radius: var(--theme-radius-button);
    padding: 0 8px;
}

.lv-note {
    flex-basis: 100%;
    color: var(--theme-text-muted);
    font-style: italic;
}

.lv-message {
    margin: 4px 0 8px;
    color: var(--theme-text-muted);
}

.lv-message--problem {
    color: var(--theme-danger);
}

.lv-hint {
    margin: 8px 0 0;
    color: var(--theme-text-muted);
    font-size: var(--theme-font-size-xs);
}

/* "In use" - where the page puts the impact list's entry point (PLAN 4.8: what still uses an older version, review and
   move). The line itself is conv-impact-notice (conv-impact.css owns it); this only spaces it under the list. */
.lv-in-use {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--theme-border-subtle);
}

.lv-in-use-title {
    margin: 0 0 6px;
    color: var(--theme-text-muted);
    font-size: var(--theme-font-size-xs);
    font-weight: 600;
}

/* The current version's number beside a builder's title ("v3" - the form designer; the Surface Builder keeps its own
   sb-title-ver pill). The toolbars' Versions buttons carry no lv-* class - each toolbar styles its own buttons. */
.lv-version-chip {
    margin-left: 6px;
    font-size: var(--theme-font-size-xs);
    font-weight: 600;
    color: var(--theme-text-muted);
    background: var(--theme-background-subtle);
    border: 1px solid var(--theme-border-subtle);
    border-radius: var(--theme-radius-button);
    padding: 0 6px;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .lv-panel {
        margin: 8px;
        padding: 8px 12px;
    }

    .lv-row {
        gap: 6px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lv-icon-btn {
        transition: none;
    }
}
