/* =========================================================
   SHADOW · ANATOMY PREVIEW
   assets/css/pages/shadow-builder/preview/anatomy-preview.css
   =========================================================
   Visual anatomy, not a debug table. Each elevation is a compact card:
   a head (full combined shadow + title), then one row per layer showing a
   real specimen of THAT layer (Ambient = soft haze, Direct = crisp edge),
   its data as chips, and the full box-shadow in a code well. Colours come
   from the themed --sh-surface-* vars; no new colours.
   ========================================================= */

.sh-anat {
    align-items: center;
}

.sh-anat-intro,
.sh-anat-block {
    width: 100%;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Block ──────────────────────────────────────────────── */
.sh-anat-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--sh-surface-panel, #fff);
    color: var(--sh-surface-fg, #0f172a);
    border: 1px solid var(--sh-surface-border, rgba(15, 23, 42, 0.06));
    border-radius: 12px;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

/* ── Head — full combined shadow + title ────────────────── */
.sh-anat-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sh-anat-swatch {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--sh-surface-panel, #fff);
    border: 1px solid var(--sh-surface-border, rgba(15, 23, 42, 0.06));
    transition: box-shadow 0.18s ease;
}

.sh-anat-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
}

.sh-anat-level {
    font-size: 11px;
    line-height: 1.3;
    color: var(--sh-surface-muted, #64748b);
    margin-top: 1px;
}

.sh-anat-flat {
    font-size: 12px;
    font-style: italic;
    color: var(--sh-surface-muted, #64748b);
}

/* ── Layers — card rows, not a spreadsheet ──────────────── */
.sh-anat-layers {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sh-anat-layer {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 6px 8px;
    border-radius: 9px;
    background: var(--sh-surface-bg, #eef2f7);
}

/* Specimen — the white chip floats on the grey row carrying THIS layer's own
   shadow, so Ambient reads as a soft halo and Direct as a tight contact edge. */
.sh-anat-layer-spec {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 34px;
}

.sh-anat-layer-swatch {
    width: 24px;
    height: 15px;
    border-radius: 4px;
    background: var(--sh-surface-panel, #fff);
    border: 1px solid var(--sh-surface-border, rgba(15, 23, 42, 0.06));
    transition: box-shadow 0.18s ease;
    /* box-shadow = the layer's own css (set inline) */
}

.sh-anat-layer-meta {
    flex: 0 0 auto;
    width: 74px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sh-anat-layer-role {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sh-anat-layer-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sh-surface-muted, #64748b);
}

.sh-anat-layer--ambient .sh-anat-layer-dot { background: var(--sh-surface-muted, #94a3b8); }
.sh-anat-layer--direct  .sh-anat-layer-dot { background: var(--sh-surface-fg, #475569); }

.sh-anat-layer-rolename {
    font-size: 12px;
    font-weight: 600;
}

.sh-anat-layer-cap {
    font-size: 10px;
    color: var(--sh-surface-muted, #64748b);
}

/* Value chips — all the data kept, just lighter than a table. */
.sh-anat-layer-vals {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sh-anat-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--sh-surface-panel, #fff);
    border: 1px solid var(--sh-surface-border, rgba(15, 23, 42, 0.05));
}

.sh-anat-chip-k {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sh-surface-muted, #64748b);
}

.sh-anat-chip-v {
    font-size: 11px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-weight: 500;
    color: var(--sh-surface-fg, #0f172a);
}

/* ── box-shadow — premium code well ─────────────────────── */
.sh-anat-css-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.sh-anat-css-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sh-surface-muted, #64748b);
}

.sh-anat-css {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    line-height: 1.5;
    color: var(--sh-surface-fg, #0f172a);
    background: var(--sh-surface-bg, #eef2f7);
    border: 1px solid var(--sh-surface-border, rgba(15, 23, 42, 0.08));
    border-left: 2px solid var(--color-primary, #6366f1);
    border-radius: 7px;
    padding: 8px 10px;
    word-break: break-word;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}


/* =========================================================
   MOBILE — let the value chips wrap below the meta
   ========================================================= */

.sh-preview-area--mobile .sh-anat-block {
    max-width: 100%;
}

.sh-preview-area--mobile .sh-anat-layer {
    flex-wrap: wrap;
}

.sh-preview-area--mobile .sh-anat-layer-vals {
    width: 100%;
}
