.comparison-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* optional: edge-to-edge scroll affordance */
    margin-inline: -16px;
    padding-inline: 16px;
}

/* --- Table sizing --- */
.comparison {
    margin: 40px auto;
    border-collapse: separate;        /* keep cells separate so radii are visible */
    border-spacing: 0;                /* we’ll add a spacer column for the gap */
    table-layout: fixed;              /* honors colgroup widths nicely */
    background: white;
}

/* Columns:
   - C1: size to content but shrinkable
   - C2/C4: shrinkable up to 280px
   - C3: spacer (the gap) */
.comparison col.c1  { width: auto; }
.comparison col.c2  { width: clamp(130px, 30vw, 350px); }
.comparison col.gap { width: 1px; }   /* visual gap between the “cards” */
.comparison col.c4  { width: clamp(130px, 25vw, 350px); }

/* --- Base cell styles --- */
.comparison th, .comparison td {
    padding: 15px 15px;
    font-size: 1.3em;
    vertical-align: middle;
    text-align: left;
    overflow-wrap: anywhere;
}

/* gap column cells (3rd column) */
.comparison th:nth-child(3),
.comparison td:nth-child(3) {
    padding: 3px;
}

/* other vendor column cells (4th column) */
.comparison th:nth-child(4),
.comparison td:nth-child(4) {
    color: gray;
    font-size: 1.1em;
}

/* Header row */
.comparison thead th {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-color-dark);
    background: #fff;                 /* header stays white */
}
.comparison thead th:nth-child(2),
.comparison thead th:nth-child(4) {
    text-align: center;
}

/* 1) First column: bold, plain white */
.comparison tbody td:first-child {
    font-weight: 700;
    background: #fff;
    text-align: right;
}

/* 2) “Tall card” look for columns 2 and 4 (Verimedis / Andere) */
/* Continuous outline on all cells in those columns */
.comparison td:nth-child(2),
.comparison td:nth-child(4) {
    border-left: 1px solid #eaeaea;
    border-right: 1px solid #eaeaea;
    position: relative;
    background: #fff;
}
/* top edges rounded + top border */
.comparison tbody tr:first-child td:nth-child(2),
.comparison tbody tr:first-child td:nth-child(4) {
    border-top: 1px solid #eaeaea;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    /* subtle downward shadow to suggest one tall card */
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
/* bottom edges rounded + bottom border */
.comparison tbody tr:last-child td:nth-child(2),
.comparison tbody tr:last-child td:nth-child(4) {
    border-bottom: 1px solid #eaeaea;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    /* a faint upward shadow to continue the illusion */
    box-shadow: 0 -1px 10px rgba(0,0,0,0.04);
}

/* 3) Gap column is just empty */
.comparison td.gap {
    padding: 0;
    border: 0;
    background: transparent;
}

/* 4) Alternating backgrounds ONLY inside columns 2 & 4 */
.comparison tbody tr:nth-child(even) td:nth-child(2),
.comparison tbody tr:nth-child(even) td:nth-child(4) {
    background: #fafafa;
}

/* Bullet layout: icon sticks left, text wraps to the right */
.bullet {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Center the column headers (Verimedis/Andere) over their columns */
.th-center { text-align: center; }

/* --- 1) Tweak sizing as the screen narrows (still tabular) --- */
@media (max-width: 900px) {
    .comparison th, .comparison td {
        padding: 12px 10px;
    }
    .comparison col.c2,
    .comparison col.c4 {
        /* flexible, shrink sooner */
        width: clamp(120px, 36vw, 250px);
    }
    .comparison col.gap { width: 8px; }
}

/* --- 2) Small phones: reflow each row into a stacked card --- */
/* This sacrifices the “single tall column card” (not feasible on tiny screens)
   in favor of readability. */
@media (max-width: 560px) {
    /* Turn table into blocks */
    .comparison,
    .comparison thead,
    .comparison tbody,
    .comparison tr,
    .comparison th,
    .comparison td {
        display: block;
    }

    /* Hide thead accessibly */
    .comparison thead {
        position: absolute;
        width: 1px; height: 1px;
        overflow: hidden; clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    /* Each TR becomes a card */
    .comparison tbody tr {
        margin: 14px 0;
        border: 1px solid #eaeaea;
        border-radius: 12px;
        box-shadow: var(--default-shadow);
        overflow: hidden;
        background: #fff;
    }

    /* Row title (original first column) */
    .comparison tbody td:first-child {
        font-weight: 700;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
        padding: 14px 12px;
        background: #fff; /* stays plain white */
    }

    /* Remove the gap “column” entirely */
    .comparison tbody td.gap {
        display: none;
    }

    /* Content blocks (original cols 2 & 4) */
    .comparison tbody td:nth-child(2),
    .comparison tbody td:nth-child(4) {
        border: 0;
        box-shadow: none;
        padding: 12px;
        background: #fff; /* base */
    }

    /* Labels via ::before to replace the missing header */
    .comparison tbody td:nth-child(2)::before,
    .comparison tbody td:nth-child(4)::before {
        display: block;
        font-size: 0.95em;
        font-weight: 700;
        margin-bottom: 6px;
        text-transform: none;
        letter-spacing: 0;
        color: var(--text-color-dark);
    }
    .comparison tbody td:nth-child(2)::before { content: "Verimedis"; }
    .comparison tbody td:nth-child(4)::before { content: "Andere Anbieter"; }

    /* Gray text only for “Andere Anbieter” block */
    .comparison tbody td:nth-child(4) { color: gray; }

    /* --- Clear alternating row backgrounds on mobile --- */
    .comparison tbody tr:nth-child(even) td:nth-child(2),
    .comparison tbody tr:nth-child(even) td:nth-child(4) {
        background: #fff !important;
    }

    /* --- Remove rounded corners from first & last rows in mobile view --- */
    .comparison tbody tr:first-child td:nth-child(2),
    .comparison tbody tr:first-child td:nth-child(4),
    .comparison tbody tr:last-child td:nth-child(2),
    .comparison tbody tr:last-child td:nth-child(4) {
        border: none;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}