/* synergex-formu.css — page-only overlay for synergexFormulations.php */

#contents {
    max-width: 1200px;
    margin: 12px auto 16px;
    padding: 8px 16px 24px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px 24px;
    height: 800px;
    max-height: 800px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(47, 79, 79, 0.4);
    border-radius: 6px;
    background-color: rgba(240, 248, 255, 0.22);
    scrollbar-width: thin;
    scrollbar-color: #3d6b6b rgba(47, 79, 79, 0.12);
}

#contents::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
#contents::-webkit-scrollbar-track {
    background: rgba(47, 79, 79, 0.1);
    border-radius: 8px;
}
#contents::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5f8f8f, #2f4f4f);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
#contents::-webkit-scrollbar-thumb:hover {
    background: #1f3a3a;
}
#contents::-webkit-scrollbar-corner {
    background: transparent;
}

#contents > hr,
#contents > .footer,
#contents > .syn-lipo,
#contents > .syn-rp,
#contents > .syn-cards,
#contents > .syn-top,
#contents > .syn-wet,
#contents > section:not(.paper) {
    flex: 1 1 100%;
    width: 100%;
}

#contents section.paper {
    flex: 0 1 auto;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#contents section.paper:not(:has(table)) {
    flex: 1 1 100%;
    width: 100%;
}

#contents section.paper:has(table tr > :nth-child(6)) {
    flex: 1 1 100%;
    width: 100%;
}

#contents section.paper:has(table.guide),
#contents section.paper:has(table tr > :nth-child(5)):not(:has(table tr > :nth-child(6))) {
    flex: 1 1 520px;
    width: auto;
}

#contents section.paper:has(table.blurb),
#contents section.paper:has(table tr > :nth-child(2):last-child) {
    flex: 1 1 280px;
    max-width: 560px;
}

#contents section.paper.limitWidth { max-width: 100%; }

#contents section.paper > h2,
#contents section.paper > h3 {
    margin: 0 0 12px;
    line-height: 1.35;
    font-weight: bold;
}

#contents section.paper > p,
#contents section.paper > ul {
    max-width: 72em;
    line-height: 1.55;
}

#contents h1 {
    flex: 1 1 100%;
    width: 100%;
    height: 48px;
    margin: 20px 0 12px;
    font-size: 0;
    line-height: 0;
}

#contents h1 + section.paper > h2:first-child {
    margin-top: 12px;
    padding-top: 8px;
}

#contents section.paper aside,
#contents aside.copy {
    display: block;
    float: none;
    width: auto;
    max-width: 100%;
    margin: 0 0 16px;
    box-sizing: border-box;
}

#contents img.thumb {
    width: 150px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
}

#contents img.chart {
    max-width: 450px;
    width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}

/* RUST PHOTO size — change this one value (450px + 15% = 480px) */
#contents img.rust-photo,
#contents .syn-rp-photo img.rust-photo,
#contents .syn-rp-photo img.chart {
    width: 480px !important;
    max-width: 480px !important;
    height: auto !important;
}

#contents img.note-img {
    max-width: 200px;
    margin: 10px 8px 10px 0;
}

#contents table.formula,
#contents table.noborder,
#contents section.paper table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.95em;
}

/* Space above tables (after title / paragraph) and below (before next block) */
#contents section.paper > h2:has(+ table),
#contents section.paper > h3:has(+ table),
#contents section.paper > p:has(+ table),
#contents section.paper > ul:has(+ table) {
    margin-bottom: 20px;
}
#contents section.paper > table,
#contents section.paper > .syn-salt-block > table {
    margin-top: 4px;
    margin-bottom: 28px;
}
#contents section.paper > table + p.note,
#contents section.paper > table + p.pnote,
#contents section.paper > .syn-salt-block > table + p.note {
    margin-top: -18px;
}
#contents section.paper > table + p:not(.note):not(.pnote),
#contents section.paper > table + ul,
#contents section.paper > table + h2,
#contents section.paper > table + h3 {
    margin-top: 8px;
}

#contents section.paper:has(table tr > :nth-child(6)) table { width: 100%; }

#contents table.formula th,
#contents table.formula td,
#contents section.paper table th,
#contents section.paper table td {
    border: 1px solid #2f4f4f;
    padding: 6px 8px;
    vertical-align: middle;
    word-break: break-word;
    text-align: center;
}

/* Mid-table <th> labels stay gray; only true header rows get the green */
#contents table.formula th {
    background: rgba(47, 79, 79, 0.08);
    color: inherit;
    font-weight: bold;
}
#contents table.formula tr:first-child th,
#contents table.formula tr:nth-child(2):has(> th):not(:has(> td)) th {
    background: rgba(51, 153, 102, 0.3);
    color: saddlebrown;
    font-weight: 900;
}

#contents table.formula td:first-child,
#contents table.formula.left td:first-child,
#contents section.paper table td:first-child { text-align: left; }

#contents table.formula .data,
#contents table.formula td.data,
#contents table.formula td:nth-child(n+3) {
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#contents table.guide th:nth-child(3) {
    min-width: 3.2em;
    max-width: 4.5em;
    white-space: normal;
    line-height: 1.25;
}

#contents table.guide td:nth-child(2) {
    text-align: center;
    white-space: normal;
}

#contents table.blurb td {
    text-align: left;
    max-width: 16em;
}

/* Concentrate recipe: wide nowrap labels, narrow wrapping amounts */
#contents table.formula.syn-conc {
    width: auto;
    table-layout: auto;
}
#contents table.formula.syn-conc td:first-child {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    min-width: max-content;
}
#contents table.formula.syn-conc td:last-child {
    width: 11em;
    max-width: 11em;
    min-width: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    text-align: center;
    line-height: 1.35;
}

#contents table.formula th:nth-last-child(-n+2),
#contents table.formula td:nth-last-child(-n+2),
#contents table.formula td.data {
    padding-left: 16px;
    padding-right: 16px;
    min-width: 3.6em;
}

#contents table.formula:has(tr > :nth-child(6)) th:nth-last-child(-n+2),
#contents table.formula:has(tr > :nth-child(6)) td:nth-last-child(-n+2) {
    padding-left: 12px;
    padding-right: 12px;
    min-width: 3em;
}

#contents .syn-lipo-table table.formula th:nth-last-child(-n+2),
#contents .syn-lipo-table table.formula td:nth-last-child(-n+2) {
    padding-left: 22px;
    padding-right: 22px;
    min-width: 4.8em;
}

#contents table.noborder th,
#contents table.noborder td {
    border: none;
    padding: 4px 12px 4px 0;
    vertical-align: top;
    text-align: left;
}

#contents p.note,
#contents p.pnote,
#contents ul.note,
#contents li.note {
    font-size: 0.88em;
    color: #333;
    line-height: 1.45;
}
#contents p.note + p.note,
#contents p.pnote + p.pnote {
    margin-top: 2px;
}

#contents span.warn { color: #c00; font-weight: bold; }

#contents .syn-legal,
#contents .syn-legal.paper {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

#contents .syn-legal > p {
    max-width: none !important;
    width: 100%;
    text-align: justify;
}

#contents .syn-top {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

#contents .syn-top > .paper,
#contents .syn-top > .paper:has(table.guide),
#contents .syn-top > .paper:has(table.blurb),
#contents .syn-top > .paper:has(table tr > :nth-child(2):last-child),
#contents .syn-top > .paper:has(table tr > :nth-child(5)),
#contents .syn-top > .paper:has(table tr > :nth-child(6)),
#contents .syn-top > .syn-blurb-wrap {
    flex: 0 0 auto !important;
    width: 100%;
    max-width: 100%;
    display: block;
    min-height: 0 !important;
}

#contents .syn-top table.formula,
#contents .syn-top table.guide,
#contents .syn-top table.blurb {
    width: 100%;
    max-width: 100%;
}

#contents .syn-top table.blurb td {
    max-width: none;
}

/* Four blurbs — edit these two values only */
#contents .syn-blurb-wrap {
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    margin-top: 60px !important;
    margin-bottom: 78px !important;
}

#contents .syn-blurb {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 64px;
    row-gap: 28px;
    width: 100%;
    max-width: 56em;
}

#contents .syn-blurb article h3 {
    margin: 0 0 8px;
    font-size: 1.05em;
    font-weight: bold;
    line-height: 1.3;
}

#contents .syn-blurb article p {
    margin: 0;
    max-width: none;
    line-height: 1.45;
}

@media (max-width: 700px) {
    #contents .syn-blurb {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

#contents .syn-wet {
    display: flex;
    flex-flow: row wrap;
    align-items: flex-start !important;
    gap: 24px 32px;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
}

#contents .syn-wet > .paper,
#contents .syn-wet-table,
#contents .syn-wet-coolant,
#contents .syn-wet-photo {
    flex: 0 1 auto !important;
    width: max-content !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: block;
}

#contents .syn-wet-table table.formula th {
    white-space: normal;
    line-height: 1.25;
    max-width: 6.5em;
}

#contents .syn-wet-coolant {
    flex: 0 1 auto;
    width: max-content;
    max-width: 100%;
}

#contents .syn-wet-photo {
    flex: 0 0 auto;
}

#contents .syn-wet-notes {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
}

#contents .syn-wet-photo img.foil,
#contents .syn-wet-photo img.thumb {
    width: 195px;
    max-width: 100%;
    height: auto;
    margin: 0 !important;
    display: block;
    vertical-align: top;
}

@media (max-width: 480px) {
    #contents .syn-wet-photo img.foil,
    #contents .syn-wet-photo img.thumb {
        width: 100%;
    }
}

#contents .syn-cards {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px 28px;
    width: 100%;
}

#contents .syn-card {
    flex: 1 1 calc(50% - 16px);
    width: auto;
    max-width: calc(50% - 16px);
    min-width: min(100%, 280px);
}

#contents .syn-card > h2 {
    width: 100%;
}

#contents .syn-card > p {
    width: 100%;
    max-width: 42em;
}

#contents .syn-card aside {
    display: inline-block;
    vertical-align: top;
    width: auto;
    max-width: 100%;
    margin: 0 20px 8px 0;
}

#contents .syn-card table.formula,
#contents .syn-card table.noborder {
    width: auto;
}

#contents .syn-card table.formula th,
#contents .syn-card table.formula td {
    white-space: nowrap;
}

#contents .syn-card table.noborder td {
    padding: 6px 14px 6px 0;
    white-space: nowrap;
}

/* Benefits card stays one full-width 3-col block; never stacks */
#contents .syn-card:has(.syn-benefits) {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#contents .syn-benefits {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 8px 36px;
    width: max-content;
    max-width: none;
    min-width: 0;
}

#contents .syn-benefits ul {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 10em;
}

#contents .syn-benefits ul:nth-child(n+2) li {
    list-style-image: url(../images/bulletTri9.gif);
    padding-left: 10px;
    margin-left: 15px;
}

#contents .syn-benefits li {
    margin: 0 0 6px;
    padding: 0;
    line-height: 1.45;
    white-space: nowrap;
}

#contents .syn-benefits li.syn-benefits-hd {
    margin-bottom: 8px;
}

#contents .syn-card-salt .syn-salt-block {
    display: block;
    width: 100%;
    max-width: 36em;
}

#contents .syn-card-salt .syn-salt-lead {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0 0 10px;
}

#contents .syn-card-salt .syn-pair,
#contents .syn-card-salt .syn-pair-table,
#contents .syn-card-salt .syn-pair-note {
    display: block;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

#contents .syn-card-salt table.formula {
    width: 100%;
    min-width: 0;
}

#contents .syn-card-salt table.formula th,
#contents .syn-card-salt table.formula td {
    padding: 10px 18px;
    font-size: 1.05em;
}

#contents .syn-card.center table.formula th,
#contents .syn-card.center table.formula td {
    white-space: nowrap;
    padding-left: 16px;
    padding-right: 16px;
    min-width: 4em;
}

#contents .syn-card.center aside {
    float: none !important;
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    margin-right: 20px !important;
}

#contents .syn-card.center ul.note {
    min-width: 22em;
    margin: 0;
}

#contents .syn-card.center ul.note li {
    white-space: nowrap;
}

@media (min-width: 700px) {
    #contents section.paper aside {
        display: inline-block;
        vertical-align: top;
        width: auto;
        max-width: 48%;
        margin-right: 2%;
    }
    #contents section.paper aside:last-child { margin-right: 0; }
    #contents .syn-card-salt .syn-salt-block {
        width: 100%;
        max-width: 36em;
    }
}

@media (max-width: 480px) {
    #contents { padding: 6px 10px 20px; gap: 16px; }
    #contents section.paper,
    #contents section.paper:not(:has(table)),
    #contents section.paper:has(table.guide),
    #contents section.paper:has(table.blurb),
    #contents section.paper:has(table tr > :nth-child(5)),
    #contents section.paper:has(table tr > :nth-child(6)),
    #contents section.paper:has(table tr > :nth-child(2):last-child) {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }
    #contents .syn-wet > .paper,
    #contents .syn-wet-table,
    #contents .syn-wet-coolant,
    #contents .syn-wet-photo {
        flex: 0 1 auto !important;
        width: max-content !important;
        max-width: 100% !important;
    }
    #contents .syn-wet-notes {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
    #contents table.formula,
    #contents section.paper table {
        font-size: 0.68em;
        table-layout: auto;
    }
    #contents table.formula th,
    #contents table.formula td,
    #contents section.paper table th,
    #contents section.paper table td {
        padding: 4px 5px;
        white-space: nowrap;
        word-break: keep-all;
        overflow-wrap: normal;
        hyphens: none;
    }
    #contents table.formula.syn-conc td:last-child {
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
        width: 11em;
        max-width: 11em;
    }
    #contents table.formula td:nth-child(2),
    #contents table.blurb td,
    #contents table.guide td:nth-child(2) {
        white-space: normal;
    }
    #contents section.paper aside { width: 100%; max-width: 100%; margin-right: 0; }
    #contents img.thumb,
    #contents img.chart,
    #contents img.note-img {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 10px 0;
    }
    #contents .syn-card {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }
    #contents .syn-card aside {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    #contents .syn-card.center ul.note li {
        white-space: normal;
    }
    #contents .syn-card table.noborder td {
        white-space: normal;
    }
}

@media (min-width: 1920px) {
    #contents {
        max-width: 1760px;
    }
    #contents .syn-card {
        flex: 1 1 320px;
        max-width: none;
    }
    #contents .syn-lipo {
        display: grid;
        grid-template-columns: minmax(560px, 1.15fr) minmax(480px, 1fr);
        grid-template-areas:
            "lead lead"
            "table charts";
        gap: 12px 32px;
        align-items: start;
        width: 100%;
    }
    #contents .syn-lipo-lead {
        grid-area: lead;
        width: 100%;
        max-width: none;
    }
    #contents .syn-lipo-table {
        grid-area: table;
        width: 100%;
        max-width: none;
    }
    #contents .syn-lipo-charts {
        grid-area: charts;
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
    #contents .syn-lipo-charts > .paper {
        width: 100%;
        max-width: none;
    }
    #contents .syn-lipo img.chart,
    #contents .syn-lipo img.note-img {
        max-width: 100%;
        width: 100%;
        height: auto;
    }
    #contents .syn-lipo aside {
        max-width: 100%;
        width: 100%;
        margin-right: 0;
    }

    #contents .syn-rp {
        display: grid;
        grid-template-columns: max-content minmax(0, max-content);
        grid-template-areas:
            "table photo"
            "note note";
        gap: 16px 36px;
        align-items: start;
        width: 100%;
    }
    #contents .syn-rp-table {
        grid-area: table;
        width: max-content;
        max-width: 100%;
        flex: none;
    }
    #contents .syn-rp-table table {
        width: auto !important;
    }
    #contents .syn-rp-photo {
        grid-area: photo;
        width: 100%;
        max-width: none;
        flex: none;
    }
    #contents .syn-rp-photo img.rust-photo,
    #contents .syn-rp-photo img.chart {
        width: 480px !important;
        max-width: 480px !important;
        height: auto !important;
    }
    #contents .syn-rp-note {
        grid-area: note;
        width: 100%;
        max-width: none;
        flex: none;
    }
    #contents .syn-rp-note > p {
        max-width: none;
    }
}
