/* =========================================================
   RADIUS · SCALE PREVIEW
   assets/css/pages/radius-builder/preview/scale-preview.css
   =========================================================
   "Scale" tab. The swatches set their size, fill and per-cell
   corner inline (scale-preview.js); this file owns the
   responsive swatch grid and tokenizes the label/value text so
   it stays legible on both light and dark themes.
   ========================================================= */

/* .rd-sc is the flex-column wrapper (set inline); the linear scale lives in
   its own grid, visually separated from the special `full` token below.
   Fixed column counts (not auto-fill) so the 8 steps always fill complete
   rows — none, xs, sm, md / lg, xl, 2xl, 3xl — with no orphan. */
.rd-sc-grid {
    grid-template-columns: repeat(4, minmax(0, 120px));
    justify-content: center;
    justify-items: center;
    align-content: start;
    gap: 20px;
}

@media (max-width: 640px) {
    .rd-sc-grid {
        grid-template-columns: repeat(2, minmax(0, 120px));
    }
}

/* Card framing — each step reads as an intentional specimen, not a bare shape. */
.rd-sc-cell {
    width: 100%;
    max-width: 120px;
    padding: var(--space-3);
    background: var(--surface-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 0.85rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    box-sizing: border-box;
}

/* Relative magnitude bar — visualizes each step's share of the live scale. */
.rd-sc-bar {
    width: 100%;
    height: 4px;
    border-radius: 9999px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.rd-sc-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: var(--color-primary);
    transition: width var(--transition-fast);
}

/* Layout separation — `full` is not the 9th step of the scale, it's an
   independent token, so it gets its own divider and a distinct card. Kept
   short + faint so it groups quietly rather than drawing the eye. */
.rd-sc-divider {
    width: 56px;
    height: 1px;
    margin: 0 auto;
    background: var(--border-subtle);
    opacity: 0.6;
}

.rd-sc-full-wrap {
    width: 100%;
}

.rd-sc-cell--full {
    max-width: 160px;
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
}

/* Theme-safe chrome text (override inline demonstrative colors). */
.rd-sc-label {
    color: var(--text-primary) !important;
}

.rd-sc-value {
    color: var(--text-secondary) !important;
    font-variant-numeric: tabular-nums;
}

/* Same fixed 2-column collapse under the in-app mobile device toggle. */
.rd-preview-root--mobile .rd-sc-grid {
    grid-template-columns: repeat(2, minmax(0, 120px));
}
