/* -----------------------------------------------------------
   UNIVERSAL TABLE BASE — LIGHT MODE
----------------------------------------------------------- */
table[class$="-table"],
.infinitives-table,
.psd-table,
.benchmarks-table,
.thinking-table,
.infinitives2-table,
.psd-stages-table,
.benchmarks2-table,
.house-thinking-table,
.five-infinitives-adolescence,
.problem-solving-adolescence,
.adolescent-benchmarks,
.seven-facets-adolescence,
.adulthood1,
.problem-solving-adult-1,
.benchmarks-adult1,
.seven-facets-adult1,
.five-infinitives-adult2,
.problem-solving-adult2,
.benchmarks-adult2,
.adult2-seven-facets,
.five-infinitives-pleroma,
.problem-solving-pleroma,
.pleroma-benchmarks,
.seven-facets-pleroma {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    background: #ffffff;
    color: #000000;
}

table[class$="-table"] th,
table[class$="-table"] td {
    border: 1px solid #444;
    padding: 8px;
    text-align: center;
    vertical-align: top;
}

table[class$="-table"] thead th {
    background: #cccccc;
    color: #000;
    font-size: 0.9rem;
}

/* -----------------------------------------------------------
   SPIRITUAL STAGE COLORS — LIGHT MODE (canonical)
----------------------------------------------------------- */
.stage-childhood  { background: #ffcc99; color: #000; }
.stage-adolescence{ background: #ffcc66; color: #000; }
.stage-adulthood  { background: #aee07d; color: #000; }
.stage-maturity   { background: #ada94d; color: #000; }

/* Highlights mapped to the same four colors */
.highlight,
.infinitives2-highlight { background: #ffcc99; }

.five-infinitives-adolescence .highlight,
.problem-solving-adolescence .highlight,
.adolescent-benchmarks .highlight,
.seven-facets-adolescence .highlight { background: #ffcc66; }

.adulthood1 .highlight,
.problem-solving-adult-1 .highlight,
.benchmarks-adult1 .highlight,
.seven-facets-adult1 .highlight { background: #aee07d; }

.five-infinitives-adult2 .highlight,
.problem-solving-adult2 .stage,
.problem-solving-adult2 .adult2,
.benchmarks-adult2 .highlight,
.benchmarks-adult2 .green,
.adult2-seven-facets .green,
.adult2-seven-facets .facet {
    background: #aee07d;
    color: #000;
}

/* Pleroma golds — LIGHT MODE */
.five-infinitives-pleroma .gold,
.problem-solving-pleroma .gold,
.pleroma-benchmarks .gold,
.seven-facets-pleroma .gold { background: #b3af67; }

.five-infinitives-pleroma .gold-dark,
.problem-solving-pleroma .gold-dark,
.pleroma-benchmarks .gold-dark,
.seven-facets-pleroma .gold-dark { background: #ada94d; }

/* -----------------------------------------------------------
   DARK MODE — ONLY OVERRIDES TABLE CHROME + STAGE COLORS
----------------------------------------------------------- */
@media (prefers-color-scheme: dark) {

    /* Table chrome only */
    table[class$="-table"],
    .infinitives-table,
    .psd-table,
    .benchmarks-table,
    .thinking-table,
    .infinitives2-table,
    .psd-stages-table,
    .benchmarks2-table,
    .house-thinking-table,
    .five-infinitives-adolescence,
    .problem-solving-adolescence,
    .adolescent-benchmarks,
    .seven-facets-adolescence,
    .adulthood1,
    .problem-solving-adult-1,
    .benchmarks-adult1,
    .seven-facets-adult1,
    .five-infinitives-adult2,
    .problem-solving-adult2,
    .benchmarks-adult2,
    .adult2-seven-facets,
    .five-infinitives-pleroma,
    .problem-solving-pleroma,
    .pleroma-benchmarks,
    .seven-facets-pleroma {
        background: #1e1e1e;
        color: #e6e6e6;
    }

    table[class$="-table"] th,
    table[class$="-table"] td {
        border-color: #666;
    }

    table[class$="-table"] thead th {
        background: #555;
        color: #fff;
    }

    /* Stage colors — DARK MODE (aligned, non‑neon) */
    .stage-childhood  { background: #8a5f3a; color: #fff; }
    .stage-adolescence{ background: #8a6a2a; color: #fff; }
    .stage-adulthood  { background: #4f6b3a; color: #fff; }
    .stage-maturity   { background: #5c5a2a; color: #fff; }

    /* Highlights follow stage colors */
    .highlight,
    .infinitives2-highlight { background: #8a5f3a; color: #fff; }

    .five-infinitives-adolescence .highlight,
    .problem-solving-adolescence .highlight,
    .adolescent-benchmarks .highlight,
    .seven-facets-adolescence .highlight { background: #8a6a2a; color: #fff; }

    /* Adult 1 — FIXED */
    .adulthood1 .highlight,
    .problem-solving-adult-1 .highlight,
    .benchmarks-adult1 .highlight,
    .seven-facets-adult1 .highlight {
        background: #4f6b3a;
        color: #fff;
    }

    /* Adult 2 */
    .five-infinitives-adult2 .highlight,
    .problem-solving-adult2 .stage,
    .problem-solving-adult2 .adult2,
    .benchmarks-adult2 .highlight,
    .benchmarks-adult2 .green,
    .adult2-seven-facets .green,
    .adult2-seven-facets .facet {
        background: #4f6b3a;
        color: #fff;
    }

    /* Pleroma golds — DARK MODE */
    .five-infinitives-pleroma .gold,
    .problem-solving-pleroma .gold,
    .pleroma-benchmarks .gold,
    .seven-facets-pleroma .gold { background: #5c5a33; color: #fff; }

    .five-infinitives-pleroma .gold-dark,
    .problem-solving-pleroma .gold-dark,
    .pleroma-benchmarks .gold-dark,
    .seven-facets-pleroma .gold-dark { background: #5c5a2a; color: #fff; }
}
