/* --- CSS Variables --- */
.dex-wrapper {
    --dex-border-light: #edf2f7; /* Fix 2: Very light and subtle border for rows */
    --dex-border-dark: #cbd5e1;  /* Slightly darker for separators so they are visible */
    --dex-bg-head: #f8fafc;
    --dex-glow: #22c55e;
    --dex-tint: #dcfce7;
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 2rem;
    
    /* Fix 1: Container Padding (Left/Right gap to match the images) */
    padding: 15px 17px; 
    box-sizing: border-box;
}

/* Single View Mode Hide Logic */
.dex-wrapper.mode-single .dex-sep,
.dex-wrapper.mode-single .box-b,
.dex-wrapper.mode-single .hide-on-single {
    display: none !important;
}

/* --- Container Header --- */
.dex-wrapper.has-border {
    border: 1px solid var(--dex-border-dark);
    border-radius: 12px; /* Smooth corners for the main box */
}

.dex-header {
    display: flex;
    font-weight: 700;
    padding: 14px 0;
    margin-bottom: 12px; /* Clear separation between header and rows */
    border-radius: 8px;
    background: var(--dex-bg-head);
    border: 1px solid var(--dex-border-light);
}

.dex-th {
    flex: 1;
    text-align: center;
    padding: 0 10px;
    word-break: break-word;
}

/* --- Rows (Fix 1 & 2) --- */
.dex-row {
    display: flex;
    flex-direction: column;
    padding: 14px 10px; 
    margin-bottom: 8px; /* Fix 1: 8px prominent gap between every row */
    border-radius: 10px;
    position: relative;
    background: var(--row-bg, #ffffff);
    
    /* Fix 2: Explicitly thin (1px) and light border */
    border: 1px solid transparent; 
    box-sizing: border-box;
}

/* Row Border Options (Now strictly 1px thin) */
.dex-row.border-solid { border-color: var(--dex-border-light); border-style: solid; border-width: 1px; }
.dex-row.border-dashed { border-color: var(--dex-border-dark); border-style: dashed; border-width: 1px; }
.dex-row.border-dotted { border-color: #94a3b8; border-style: dotted; border-width: 1px; }

/* Row Label Centered on Top */
.row-label-wrap {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px; /* Space between label and A/B values */
    display: flex;
    justify-content: center;
    align-items: center;
}

.row-icon {
    margin-right: 6px;
    font-size: 1.3em;
}

/* The A vs B Values Container */
.row-data-wrap {
    display: flex;
    align-items: center;
    width: 100%;
}

.data-box {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 1.05rem;
}

/* --- Separators (Fix 3: Now strictly visible) --- */
.dex-sep {
    width: 1px;
    min-width: 1px; /* Prevents flexbox from squeezing it to 0px */
    flex-shrink: 0; /* Forces the line to stay visible */
    background: var(--dex-border-dark);
    align-self: stretch;
    min-height: 25px; /* Gives the line good height */
    margin: 0 10px; /* Slight breathing room around the line */
}
.dex-wrapper.sep-dashed .dex-sep { background: none; border-right: 1px dashed var(--dex-border-dark); }
.dex-wrapper.sep-gradient .dex-sep { background: linear-gradient(to bottom, transparent, #a4b2c6, transparent); }

/* --- Winner Highlights --- */
.dex-wrapper.style-glow .is-winner { color: var(--dex-glow); text-shadow: 0 0 12px rgba(34,197,94,0.35); font-weight: 800; }
.dex-wrapper.style-tint .is-winner { background: var(--dex-tint); color: #064e3b; border-radius: 6px; padding: 4px; }
.dex-wrapper.style-icon .is-winner::after { content: " 👑"; margin-left: 5px; font-size: 0.8em; }

/* --- Mobile View Optimization --- */
@media (max-width: 600px) {
    .dex-wrapper { padding: 8px; }
    .dex-row { padding: 14px 8px; margin-bottom: 6px; }
    .row-label-wrap { font-size: 0.7rem; margin-bottom: 10px; }
    .data-box, .dex-th { font-size: 0.95rem; }
    .dex-sep { margin: 0 6px; } /* Slightly tighter line on mobile */
}

/* Editor Helper */
.block-editor-block-list__layout .dex-wrapper { outline: 1px dashed rgba(0,0,0,0.05); }
