:root {
    font-family: Segoe UI, Arial, sans-serif;
    color: #183043;
    background: #f3f6f8;
    --accent: #087f8c;
    --border: #d9e3e8
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

header {
    padding: 22px max(5vw, 20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--border);
    gap: 12px
}

.brand {
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 14px
}

.badge {
    font-size: 12px;
    background: #e3f4f2;
    color: #126b65;
    padding: 7px 12px;
    border-radius: 20px
}

main {
    max-width: 1100px;
    margin: auto;
    padding: 38px 20px
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 700
}

h1 {
    font-size: clamp(32px, 5vw, 54px);
    letter-spacing: -2px;
    margin: 12px 0
}

h2 {
    font-size: 23px;
    margin-top: 0
}

h3 {
    margin-bottom: 8px
}

p {
    line-height: 1.65
}

.intro {
    max-width: 740px;
    color: #506579;
    font-size: 18px;
    margin-bottom: 30px
}

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: 0 8px 28px #193c4a05
}

.explorer,
.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px
}

.explorer {
    align-items: center
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 14px 0 8px
}

input {
    font: inherit;
    padding: 11px;
    border: 1px solid #bdccd5;
    border-radius: 8px;
    background: #fbfdfe;
    width: 100%;
    color: #183043
}

input[type=range] {
    padding: 0;
    accent-color: var(--accent);
    margin: 12px 0
}

button {
    font: inherit;
    border: 1px solid #bdccd5;
    background: #fff;
    color: #183043;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer
}

button:hover {
    background: #e6f4f4
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid #e2a832;
    outline-offset: 3px
}

.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent)
}

.primary:hover {
    background: #086772
}

.presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 15px 0
}

svg {
    width: 100%;
    max-height: 270px
}

.legend {
    display: flex;
    gap: 25px;
    justify-content: center;
    font-size: 13px
}

.small {
    font-size: 12px;
    color: #607486
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    min-width: 510px
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px
}

th {
    color: #506579
}

table input {
    min-width: 95px
}

.blend-curve-card {
    margin-top: 16px;
    padding-top: 8px
}

.blend-source-editor {
    width: 100%
}

.blend-source-editor h2 {
    margin: 0 0 12px;
    font-size: 21px;
    color: #324d42
}

.blend-source-editor input[data-source-index] {
    width: 100%;
    min-width: 0;
    display: block;
    box-sizing: border-box;
    min-height: 38px;
    font-size: 16px;
    padding: 8px 10px
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 24px
}

.card {
    padding: 18px;
    border-radius: 12px;
    background: #edf7f6
}

.card strong {
    display: block;
    font-size: 27px;
    color: #08766f;
    margin-top: 8px
}

.card span {
    font-size: 13px
}

.warn {
    padding: 14px;
    background: #fff2df;
    border-left: 4px solid #d88713
}

.steps {
    background: #f6f8fa;
    padding: 18px;
    border-radius: 12px;
    margin-top: 18px
}

.steps p {
    margin: 8px 0
}

a {
    color: #087681
}

footer {
    text-align: center;
    padding: 26px;
    font-size: 13px;
    color: #587080
}

@media(max-width:700px) {

    .explorer,
    .two,
    .cards {
        grid-template-columns: 1fr
    }

    .panel {
        padding: 20px
    }

    .explorer {
        gap: 8px
    }

    .badge {
        font-size: 10px
    }
}

@media print {
    body {
        background: white
    }

    header,
    .presets,
    form button {
        display: none
    }

    .panel {
        break-inside: avoid;
        box-shadow: none
    }

    main {
        padding: 0
    }
}

/* Module workspace */
:root {
    --accent: #28654f;
    --border: #dce4db;
    color: #243c32;
    background: #f6f7f2;
    font-family: "Segoe UI", Arial, sans-serif
}

header {
    height: 78px;
    padding: 18px 4%;
    background: #fdfefb
}

.brand {
    text-decoration: none;
    color: #243c32;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 1.5px
}

.brand-icon {
    display: grid;
    place-items: center;
    background: #285c47;
    color: #fff;
    border-radius: 9px;
    width: 35px;
    height: 35px;
    font-family: Georgia;
    font-size: 25px
}

.brand small {
    border-left: 1px solid #ced7ce;
    padding-left: 14px;
    color: #879389;
    font-size: 11px
}

.header-note {
    font-size: 12px;
    color: #6a7d70
}

.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #65a078;
    border-radius: 50%;
    margin: 0 6px
}

.layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    max-width: 1600px;
    margin: auto
}

aside {
    padding: 34px 23px;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: calc(100vh - 78px);
    overflow-y: auto;
    scrollbar-width: thin
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.8px;
    color: #718476
}

.home-link {
    display: block;
    padding: 14px 8px;
    color: #45644f;
    text-decoration: none;
    font-size: 13px
}

.aside-label {
    margin-top: 38px
}

.module-name {
    font-weight: 700;
    font-size: 18px;
    margin: 16px 0
}

.module-name span {
    font-size: 10px;
    font-weight: 400;
    background: #e5ebe0;
    padding: 4px 7px;
    border-radius: 4px;
    margin-left: 10px
}

nav a {
    display: flex;
    gap: 10px;
    padding: 13px 10px;
    font-size: 12px;
    color: #65756a;
    text-decoration: none;
    border-radius: 7px;
    margin: 3px 0
}

nav a b {
    font-size: 10px;
    opacity: .6
}

nav a:hover,
nav a.active,
.home-link.active {
    background: #e3ecdf;
    color: #295c44
}

nav a.active {
    font-weight: 700
}

.aside-bottom {
    margin-top: 64px;
    font-size: 11px;
    color: #567660
}

.aside-bottom p {
    color: #8a958b;
    margin-left: 18px
}

main {
    width: 100%;
    max-width: 1250px;
    padding: 38px 46px 60px
}

.hero {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    gap: 25px;
    padding: 24px 0 43px;
    border-bottom: 1px solid var(--border)
}

.pill {
    font-size: 10px;
    letter-spacing: 1.6px;
    color: #4f7159;
    background: #e8eee1;
    padding: 7px 10px;
    border-radius: 4px
}

h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(36px, 4.2vw, 62px);
    line-height: 1.08;
    letter-spacing: -2px;
    margin: 24px 0 18px
}

h1 em {
    color: #48765b;
    font-weight: 400
}

.intro {
    font-size: 15px;
    line-height: 1.8;
    max-width: 590px;
    margin-bottom: 25px;
    color: #738074
}

.button {
    display: inline-flex;
    gap: 35px;
    padding: 13px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px
}

.hero-art {
    background: #eaf0e3;
    border-radius: 50% 50% 12px 12px;
    padding: 16px
}

.hero-art svg {
    max-height: 310px
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 28px 0 20px
}

.section-heading h2 {
    font-size: 19px;
    margin: 0
}

.section-heading span {
    font-size: 11px;
    color: #879184
}

.lab-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px
}

.lab-card {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 23px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: transform .18s, box-shadow .18s
}

.lab-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px #183b3010
}

.lab-number {
    font-size: 9px;
    letter-spacing: 1.4px;
    color: #8a9386
}

.card-symbol {
    height: 67px;
    display: flex;
    align-items: center;
    font-size: 31px;
    letter-spacing: 5px;
    color: #6c8761
}

.blue {
    color: #62949c
}

.orange {
    color: #be9167
}

.lab-card h3 {
    font-size: 16px;
    margin: 6px 0 10px
}

.lab-card h3 span {
    float: right;
    color: #94a390
}

.lab-card p {
    font-size: 12px;
    color: #7c877b;
    line-height: 1.8;
    min-height: 65px
}

.tag {
    display: inline-block;
    font-size: 9px;
    background: #f1f4ed;
    border-radius: 4px;
    padding: 6px 8px;
    color: #687962
}

.next-card {
    background: #eaf0e4;
    border-style: dashed
}

.next-card h3 {
    font: 25px Georgia;
    margin-top: 35px
}

.panel {
    box-shadow: none;
    border-radius: 10px;
    padding: 26px
}

.workspace {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 30px
}

.controls {
    border-right: 1px solid var(--border);
    padding-right: 25px
}

.controls h2 {
    font-size: 19px
}

select {
    font: inherit;
    width: 100%;
    padding: 11px;
    border: 1px solid #c9d3c7;
    border-radius: 7px;
    color: #314d3b;
    background: #fafcf8
}

label {
    font-size: 12px;
    color: #63715f
}

output {
    float: right;
    color: #285c47
}

input {
    color: #304b3b;
    background: #fafcf8
}

button {
    font-size: 12px
}

.visual {
    min-width: 0
}

.visual-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 9px;
    letter-spacing: 1px;
    color: #768371;
    margin: 7px 0 15px
}

.visual svg,
#sieveChart {
    max-height: none;
    display: block
}

.ratio-bar {
    display: flex;
    height: 34px;
    margin: 24px 0 18px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 11px;
    text-align: center;
    line-height: 34px
}

.ratio-bar div {
    transition: width .25s;
    white-space: nowrap
}

#solidBar {
    background: #688665;
    color: white
}

#voidBar {
    background: #e9eee4;
    color: #607657
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
}

.metrics span {
    display: block;
    font-size: 10px;
    color: #7e8b78
}

.metrics strong {
    display: block;
    font-size: 25px;
    font-weight: 500;
    color: #32573e;
    margin-top: 8px
}

.hint {
    background: #edf3e8;
    border-left: 3px solid #82a175;
    border-radius: 3px;
    padding: 13px;
    font-size: 12px;
    color: #57704f
}

.legend {
    font-size: 10px;
    gap: 18px;
    flex-wrap: wrap;
    color: #85917e
}

.green {
    color: #28654f
}

.small {
    color: #84907d;
    line-height: 1.7
}

footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 22px 4%;
    font-size: 11px
}

footer span::before {
    content: "\00b7";
    margin-right: 8px
}

[hidden] {
    display: none !important
}

.pass {
    color: #397349
}

.fail {
    color: #b26730
}

.view>h1 {
    font-size: 43px
}

.card strong {
    font-size: 23px
}

.card {
    background: #edf3e8
}

a {
    color: #3b6a51
}


.sieve-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sieve-workspace .panel {
    margin: 0;
    min-width: 0;
}

.sieve-stack-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1.8fr);
    gap: 20px;
    align-items: start;
}

.sieve-setup-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.sieve-stack-controls label {
    margin: 0;
}

.sieve-stack-controls .small {
    margin: 0 0 6px;
}

.sieve-stack-controls select,
#sampleMass {
    width: 100%;
    max-width: none;
}

.sieve-stack-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    grid-column: 1 / -1;
}

.sieve-list-header {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.sieve-selection-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.sieve-selection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f5f6f0;
    font-size: 13px;
    cursor: pointer;
}

.sieve-selection-item:has(input:checked) {
    background: #e4eddb;
    border-color: #99ad87;
}

.sieve-selection-item input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

#sieveStackSvg {
    display: block;
    width: 100%;
    max-width: 680px;
    max-height: none;
    height: auto;
    margin: 24px auto;
}

.sieve-measurements {
    grid-column: 1 / -1;
}

.sieve-results {
    grid-column: 1 / -1;
}

#sieveTable table {
    width: 100%;
}

#sieveTable input {
    width: 100%;
    min-width: 82px;
    max-width: 160px;
}

.sieve-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sieve-metrics>div {
    background: #edf3e8;
    padding: 16px;
    border-radius: 8px;
}

.sieve-metrics span {
    display: block;
    font-size: 12px;
    color: #526450;
}

.sieve-metrics strong {
    display: block;
    margin-top: 6px;
    font-size: 23px;
}

#sieveChart {
    width: 100%;
    height: auto;
}

#sieveStackSvg.shaking {
    animation: shake .15s 5 alternate ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    #sieveStackSvg.shaking {
        animation: none;
    }
}

@media (max-width: 760px) {
    .sieve-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .sieve-stack-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .sieve-metrics {
        gap: 6px;
    }

    .sieve-metrics>div {
        padding: 10px;
    }

    .sieve-metrics strong {
        font-size: 18px;
    }
}

#packingSvg {
    overflow: hidden;
    will-change: transform
}

.vibrating {
    animation: shake .18s infinite alternate ease-in-out
}

@keyframes shake {

    0% {
        transform: translateX(-1px) scale(1.001)
    }

    50% {
        transform: translateX(1px) scale(1.002)
    }

    100% {
        transform: translateX(-1px) scale(1.001)
    }
}

@media(min-width:1500px) {
    main {
        padding-top: 45px
    }

    .hero {
        padding-top: 35px;
        padding-bottom: 48px
    }

    .lab-card {
        padding: 27px
    }
}

@media(max-width:1100px) {
    .layout {
        grid-template-columns: 200px minmax(0, 1fr)
    }

    main {
        padding: 30px 25px
    }

    .lab-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .workspace {
        grid-template-columns: 1fr
    }

    .controls {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 0 0 20px
    }

    .hero-art {
        padding: 3px
    }
}

@media(max-width:700px) {
    header {
        height: auto;
        padding: 15px 18px
    }

    .brand small,
    .header-note {
        display: none
    }

    .layout {
        display: block
    }

    aside {
        position: static;
        height: auto;
        padding: 15px 18px;
        border-right: 0;
        border-bottom: 1px solid var(--border)
    }

    aside>.eyebrow,
    .module-name,
    .aside-bottom,
    .home-link {
        display: none
    }

    nav {
        display: flex;
        overflow: auto;
        gap: 5px
    }

    nav a {
        flex: none;
        padding: 10px;
        font-size: 11px
    }

    main {
        padding: 24px 18px
    }

    .hero {
        grid-template-columns: 1fr
    }

    .hero-art {
        display: none
    }

    .lab-grid {
        grid-template-columns: 1fr
    }

    .lab-card p {
        min-height: 0
    }

    .section-heading {
        align-items: start;
        gap: 10px
    }

    .section-heading span {
        max-width: 80px;
        text-align: right
    }

    .view>h1 {
        font-size: 35px
    }

    .metrics strong {
        font-size: 21px
    }

    footer span {
        display: block;
        float: none;
        margin-top: 8px
    }

    footer span::before {
        content: none
    }

    .panel {
        padding: 18px
    }

    .legend {
        gap: 10px
    }

    .workspace {
        gap: 18px
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}

@media print {
    aside {
        display: none
    }

    .layout {
        display: block
    }

    .view[hidden] {
        display: none !important
    }
}

button[aria-pressed="true"] {
    background: #e1ebdb;
    border-color: #739367;
    color: #305b3e
}

.legend-grain {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #789572;
    margin-right: 4px
}

.legend-grain.fine {
    background: #b99358
}

.legend-grain.void {
    background: #f1f4ea;
    border: 1px solid #a3b099
}

#homogeneityDescription {
    margin-top: 0
}

input:disabled {
    opacity: .45
}

.pathway-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 18px 0 12px
}

.pathway-toggle input {
    width: auto;
    accent-color: var(--accent)
}

.pore-key {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 4px;
    border: 1px solid #9aaebb;
    border-radius: 3px
}

.pore-key.open {
    background: white
}

.pore-key.water {
    background: #38bdf8
}

.pore-key.closed {
    border-color: #947849;
    background: repeating-linear-gradient(135deg, #f2e6cf 0 3px, #a98c58 3px 4px)
}

.pore-zoom {
    margin-top: 16px;
    padding: 15px;
    background: #f6f8fa;
    border: 1px solid var(--border);
    border-radius: 9px
}

.pore-zoom h3 {
    font-size: 15px;
    margin-top: 0
}

.pore-zoom-viewport {
    margin: 0 auto;
    width: min(100%, 340px);
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #9eb4bf;
    background: #edf4f6;
    box-shadow: inset 0 0 0 1px rgba(96, 116, 128, .2)
}

.pore-zoom-viewport svg {
    display: block;
    width: 100%;
    height: 100%
}

.pore-zoom svg {
    max-height: 340px;
    width: 100%;
    display: block
}

.pore-legend {
    margin-top: 12px
}


.mix-reference {
    background: #f5f8f0;
}

.mix-reference svg {
    max-width: 850px;
    margin: auto;
}

#batch svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
}

.mix-slider-grid,
.mix-experiment {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.mix-experiment>.panel {
    min-width: 0;
    margin: 0;
}

.mix-condition label,
.mix-before label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.mix-condition output,
.mix-before output {
    font-weight: 700;
    white-space: nowrap;
}

#batch input[type=range] {
    accent-color: #386b52;
    cursor: pointer;
    padding: 0;
    width: 100%;
    height: 26px;
}

.mix-state {
    padding: 12px 16px;
    border-radius: 8px;
    background: #edf3e8;
    font-weight: 600;
    color: #386b52;
}

.mix-after {
    border: 2px solid #c98678;
    transition: border-color .2s, background .2s;
}

.mix-after.mix-unmatched {
    border-color: #c47565;
    background: #fffaf8;
}

.mix-after.mix-matched {
    border-color: #4b9263;
    background: #f1f8ed;
}

#mixMatch {
    color: #a44937;
    display: block;
    margin-top: 24px;
    font-size: 18px;
}

.mix-matched #mixMatch {
    color: #2f713f;
}

.mix-hint {
    border-top: 1px solid #dce3d4;
    padding-top: 14px;
    font-weight: 600;
}

.mix-fine-adjust {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.mix-fine-adjust button {
    padding: 10px 8px;
    min-height: 44px;
    font-size: 12px;
    white-space: nowrap;
}

.mix-fine-adjust button:disabled {
    opacity: .45;
    cursor: default;
}

.brand-name {
    text-transform: uppercase;
}

.brand-icon {
    flex: 0 0 35px;
}

.material-tabs {
    display: flex;
    gap: 8px;
    padding: 8px 4%;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: #fdfefb;
}

.material-tabs a {
    flex: 0 0 auto;
    padding: 12px 22px;
    margin: 0;
    font-size: 14px;
    border-radius: 7px;
    border-bottom: 3px solid transparent;
}

.material-tabs a.active {
    border-bottom-color: #28654f;
}

#aggregateSidebar[hidden],
#cementSidebar[hidden] {
    display: none;
}

.layout.material-landing {
    grid-template-columns: minmax(0, 1fr);
}

.material-placeholder {
    max-width: 900px;
    margin: 28px auto;
}

.material-placeholder .panel {
    margin-top: 32px;
    padding: 40px;
}

.material-placeholder h2 {
    margin-top: 24px;
}

.material-placeholder .button {
    margin-top: 20px;
    display: inline-flex;
    gap: 20px;
}

.card-symbol svg {
    width: 96px;
    height: 58px;
    display: block;
}

@media(max-width:700px) {
    .brand-name {
        font-size: 12px;
        letter-spacing: .8px;
    }

    .material-tabs {
        padding: 8px 18px;
    }

    .material-tabs a {
        padding: 10px 16px;
        font-size: 13px;
    }

    .material-placeholder .panel {
        padding: 24px;
    }
}

#mixExplanation,
.mix-hint {
    font-size: 14px;
}

@media(max-width:1000px) {
    .mix-experiment {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media(max-width:700px) {
    .mix-slider-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
}

/* Cement manufacturing explorer */
#cement-manufacturing .intro {
    max-width: 850px;
}

.cement-overview-art {
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #eaf0e3;
    padding: 16px 16px 0;
}

.cement-overview-art svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 310px;
}

.cement-overview-art figcaption {
    padding: 12px 0 16px;
    color: #647866;
    font-size: 12px;
    line-height: 1.5;
}

.cement-lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cement-lab-card>img {
    display: block;
    width: 100%;
    height: 175px;
    margin: 18px 0;
    border-radius: 8px;
    object-fit: cover;
}

.cement-next-module {
    max-width: 850px;
    margin-top: 32px;
    padding: 40px;
}

.cement-next-module h2 {
    margin-top: 24px;
}

.cement-next-module .button {
    display: inline-flex;
    margin-top: 18px;
}

.cement-plant-panel {
    padding: 24px;
}

.cement-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
}

.cement-route-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cement-route-buttons button {
    min-height: 44px;
}

.cement-inspect-control {
    width: 280px;
    max-width: 100%;
}

.cement-inspect-control label {
    margin: 0 0 8px;
}

.cement-diagram-scroll {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 8px;
}

#cementPlantSvg {
    display: block;
    width: 100%;
    min-width: 980px;
    height: auto;
    max-height: none;
}

.cement-hit {
    fill: #f7f9f3;
    stroke: #d3dfce;
    stroke-width: 1.5;
}

.cement-node {
    cursor: pointer;
    outline: none;
}

.cement-node:hover .cement-hit,
.cement-node:focus .cement-hit,
.cement-node.selected .cement-hit {
    fill: #e7f0df;
    stroke: #386f50;
    stroke-width: 3;
}

.cement-node-label {
    font-size: 15px;
    font-weight: 600;
    fill: #305340;
}

.cement-node-hint {
    font-size: 11px;
    fill: #71876e;
}

.cement-row-label {
    font-size: 12px;
    font-weight: 700;
    fill: #7a8d75;
    letter-spacing: 1.7px;
}

.cement-flow {
    fill: none;
    stroke: #4f7964;
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.cement-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 18px;
    font-size: 12px;
    color: #5c755c;
}

.cement-legend span {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.cement-flow-key {
    width: 28px;
    border-top: 3px solid #4f7964;
}

.cement-heat-key {
    width: 28px;
    border-top: 2px dashed #cc8651;
}

.cement-sources {
    margin: 28px 0;
    font-size: 12px;
    color: #60735b;
}

.cement-sources summary {
    cursor: pointer;
    font-weight: 600;
}

#cementInspector {
    width: min(1000px, calc(100vw - 32px));
    max-height: 90vh;
    padding: 28px;
    border: 1px solid #bfd1b7;
    border-radius: 14px;
    background: #fdfefa;
    color: #294638;
    box-shadow: 0 25px 100px #132b3540;
}

#cementInspector::backdrop {
    background: #152c26aa;
}

.cement-dialog-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: start;
    border-bottom: 1px solid #dce4d7;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.cement-dialog-heading h2 {
    margin-bottom: 0;
}

.cement-dialog-heading .eyebrow {
    margin-top: 0;
}

#cementInspectorClose {
    flex-shrink: 0;
    min-height: 44px;
}

.cement-photo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.cement-photo-layout figure {
    margin: 0;
    min-width: 0;
}

.cement-photo-layout img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: #edf0e8;
    border-radius: 8px;
}

.cement-photo-layout figcaption {
    font-size: 11px;
    line-height: 1.6;
    margin-top: 10px;
    overflow-wrap: anywhere;
    color: #6c7b63;
}

.cement-component-detail {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.cement-equipment-preview {
    width: 100%;
    height: auto;
    max-height: none;
}

.cement-description {
    margin-top: 0;
}

.cement-properties {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    background: #edf3e7;
}

.cement-properties dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #71836a;
}

.cement-properties dd {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.cement-callout {
    padding: 16px;
    background: #f3efdf;
    border-left: 3px solid #bf9658;
    border-radius: 4px;
    font-size: 14px;
}

.cement-kiln-detail svg {
    display: block;
    min-width: 800px;
    width: 100%;
    height: auto;
    max-height: none;
}

.cement-kiln-zone {
    cursor: pointer;
    outline: none;
}

.cement-kiln-zone:hover rect,
.cement-kiln-zone:focus rect,
.cement-kiln-zone.selected rect {
    stroke: #714c2e;
    stroke-width: 4;
}

.cement-zone-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.cement-zone-buttons button {
    min-height: 44px;
}

@media(max-width:700px) {

    .cement-plant-panel,
    #cementInspector {
        padding: 18px;
    }

    .cement-photo-layout,
    .cement-component-detail {
        grid-template-columns: minmax(0, 1fr);
    }

    .cement-equipment-preview {
        max-width: 160px;
        margin: auto;
    }

    .cement-dialog-heading {
        gap: 10px;
    }

    .cement-dialog-heading h2 {
        font-size: 22px;
    }

    .cement-inspect-control {
        width: 100%;
    }

    .cement-overview-art svg {
        max-height: 240px;
    }

    .cement-lab-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cement-next-module {
        padding: 24px;
    }
}

.cement-dialog-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fdfefa;
}

/* Cement hydration lab (Lab 02): five canvas steps driven by one clock */
.hydrate-console {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.hydrate-clock .presets {
    margin: 14px 0 0;
}

.hydrate-jumps button {
    padding: 7px 10px;
    font-size: 11px;
}

.hydrate-play-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.hydrate-play-row label {
    margin: 0;
    font-size: 11px;
}

.hydrate-play-row button {
    min-height: 40px;
}

.hydrate-play-row select {
    width: auto;
    padding: 8px 10px;
}

.hydrate-meter .eyebrow {
    margin-top: 0;
}

.hydrate-big {
    margin: 4px 0 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 56px;
    line-height: 1;
    color: #285c47;
}

.hydrate-bar {
    height: 12px;
    border-radius: 6px;
    background: #e8eee1;
    overflow: hidden;
}

.hydrate-bar div {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6f9c8a, #3f7a5c);
    transition: width .15s linear;
}

.hydrate-meter .small {
    margin: 10px 0 6px;
}

.hydrate-compound-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px 88px;
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #eef2ea;
    font-size: 12px;
}

.hydrate-compound-row:last-of-type {
    border-bottom: 0;
}

.hydrate-compound-name {
    color: #3c5548;
}

.hydrate-mini {
    display: block;
    height: 8px;
    background: #edf1e9;
    border-radius: 4px;
    overflow: hidden;
}

.hydrate-mini i {
    display: block;
    height: 100%;
    width: 0;
    transition: width .15s linear;
}

.hydrate-compound-value {
    text-align: right;
    color: #63715f;
    font-variant-numeric: tabular-nums;
}

.hydrate-step-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.hydrate-step-no {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    color: #93a08f;
    line-height: 1;
    padding-top: 4px;
}

.hydrate-step-head h2 {
    margin: 0 0 6px;
}

.hydrate-step-head .small {
    margin: 0;
}

.hydrate-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.hydrate-grid.visual-first {
    grid-template-columns: minmax(0, 1.45fr) minmax(240px, 340px);
}

.hydrate-canvas {
    display: block;
    width: 100%;
    height: 330px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfdfb;
}

.hydrate-canvas.tall {
    height: 400px;
}

/* Per-graph playback: each canvas keeps its own clock and play button. */
.hydrate-player {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    margin-top: 12px;
}

.hydrate-player button {
    min-height: 40px;
}

.hydrate-player input[type=range] {
    flex: 1 1 160px;
    min-width: 120px;
    margin: 0;
}

.hydrate-player-time {
    min-width: 62px;
    text-align: right;
    font-size: 12px;
    color: #63715f;
    font-variant-numeric: tabular-nums;
}

.hydrate-player .hydrate-type {
    margin: 0;
    font-size: 11px;
    color: #63715f;
}

.hydrate-player select {
    width: auto;
    min-width: 150px;
    max-width: 240px;
    padding: 8px 10px;
    font-size: 12px;
}

.hydrate-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 16px;
    margin-top: 12px;
    font-size: 11px;
    color: #6c7b63;
}

.hydrate-legend.column {
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
}

.hydrate-swatch {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -1px;
}

.hydrate-swatch.dashed {
    width: 14px;
    height: 0;
    border-radius: 0;
    border-top: 2px dashed #7f8f83;
    vertical-align: 4px;
}

.hydrate-facts {
    margin: 18px 0 0;
    padding-left: 18px;
}

.hydrate-facts li {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.65;
    color: #3f5748;
}

.hydrate-facts li.active {
    background: #eef4ea;
    border-left: 3px solid #82a175;
    border-radius: 4px;
    padding: 8px 12px;
    list-style: none;
    margin-left: -21px;
}

.hydrate-eq {
    background: #f3f6f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    margin-top: 18px;
}

.hydrate-eq p {
    margin: 6px 0;
}

.hydrate-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.hydrate-check input {
    width: auto;
    margin-top: 2px;
}

.hydrate-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.hydrate-chip {
    display: flex;
    gap: 8px;
    align-items: baseline;
    background: #f1f4ed;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
}

.hydrate-chip em {
    color: #7c877b;
    font-style: normal;
}

.hydrate-chip b {
    font-size: 18px;
    color: #285c47;
}

.hydrate-chip span {
    color: #84907d;
    font-size: 11px;
}

@media(max-width:1000px) {
    .hydrate-console {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .hydrate-compounds {
        grid-column: 1 / -1;
    }

    .hydrate-grid,
    .hydrate-grid.visual-first {
        grid-template-columns: minmax(0, 1fr);
    }

    .hydrate-canvas {
        height: 300px;
    }

    .hydrate-canvas.tall {
        height: 340px;
    }
}

@media(max-width:700px) {
    .hydrate-console {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .hydrate-big {
        font-size: 44px;
    }

    .hydrate-canvas {
        height: 250px;
    }

    .hydrate-canvas.tall {
        height: 300px;
    }

    .hydrate-play-row select {
        width: 100%;
    }

    .hydrate-player select {
        width: 100%;
        max-width: none;
    }
}

@media print {
    .hydrate-canvas {
        display: none;
    }
}

/* Cement lab 03: clinker chemistry (oxides -> Bogue compounds + control ratios) */
.clinker-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.clinker-controls h2 {
    margin-top: 0;
}

.clinker-oxides {
    display: grid;
    gap: 2px;
    margin-top: 4px;
}

.clinker-oxide label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin: 10px 0 2px;
}

.clinker-oxide output {
    float: none;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.clinker-presets {
    margin: 12px 0 8px;
}

.clinker-presets button.active {
    border-color: #285c47;
    background: #eef6f0;
    color: #1d4a38;
}

.clinker-canvas {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfdfb;
}

.clinker-canvas.bars {
    height: 186px;
}

.clinker-canvas.ratios {
    height: 210px;
    margin-top: 12px;
}

.clinker-gauges-readout {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin-top: 10px;
    font-size: 12px;
    color: #63715f;
}

.clinker-gauges-readout b {
    color: #285c47;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}

.clinker-gauges-readout em {
    display: block;
    font-style: normal;
    font-size: 10px;
    color: #84907d;
}

.clinker-verdicts {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.clinker-verdicts li {
    padding: 9px 12px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.55;
}

.clinker-verdicts li.ok {
    background: #f2f7f0;
    border-color: #d9e6d4;
    color: #31543f;
}

.clinker-verdicts li.warn {
    background: #fdf7ec;
    border-color: #f0e2c8;
    color: #7a5b2d;
}

.clinker-verdicts li.bad {
    background: #fdf1ee;
    border-color: #f0d3cb;
    color: #8a4234;
}

.clinker-compounds {
    margin-top: 20px;
}

.clinker-compound-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 84px;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eef2ea;
    font-size: 12px;
}

.clinker-compound-row:last-of-type {
    border-bottom: 0;
}

.clinker-compound-name b {
    color: #243c32;
}

.clinker-compound-name em {
    font-style: normal;
    color: #84907d;
    font-size: 11px;
}

.clinker-compound-role {
    color: #63715f;
}

.clinker-transfer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #eef2ea;
}

.clinker-transfer .small {
    margin: 0;
    flex: 1 1 240px;
}

@media(max-width:1000px) {
    .clinker-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .clinker-canvas.bars {
        height: 168px;
    }

    .clinker-canvas.ratios {
        height: 200px;
    }
}

@media(max-width:700px) {
    .clinker-compound-row {
        grid-template-columns: minmax(0, 1fr) 70px;
    }

    .clinker-compound-role {
        display: none;
    }
}

@media print {
    .clinker-canvas {
        display: none;
    }
}

/* Cement lab 04: family gallery and selection game */
.ctype-layout {
    display: grid;
    grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.ctype-gallery {
    display: grid;
    gap: 9px;
}

.ctype-card {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid #d7e0d4;
    background: #fdfefd;
}

.ctype-card:hover {
    border-color: #9bb39f;
}

.ctype-card[aria-pressed=true] {
    border-color: #285c47;
    background: #f2f8f3;
}

.ctype-card.picked-best {
    border-color: #3f7a5c;
    box-shadow: inset 3px 0 0 #3f7a5c;
}

.ctype-card.picked-ok {
    border-color: #b98d4d;
    box-shadow: inset 3px 0 0 #b98d4d;
}

.ctype-card.picked-bad {
    border-color: #b0603f;
    box-shadow: inset 3px 0 0 #b0603f;
}

.ctype-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
}

.ctype-card-head b {
    font-size: 13px;
    color: #243c32;
}

.ctype-card-head em {
    font-style: normal;
    font-size: 10px;
    color: #84907d;
}

.ctype-card-sub {
    display: block;
    font-size: 11px;
    color: #63715f;
    margin-top: 2px;
}

.ctype-mini {
    display: flex;
    height: 8px;
    border-radius: 5px;
    overflow: hidden;
    background: #edf1e9;
    margin: 7px 0 5px;
}

.ctype-mini i {
    display: block;
    height: 100%;
}

.ctype-card-meta {
    font-size: 10px;
    color: #84907d;
}

.ctype-detail {
    background: #fbfdfb;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
}

.ctype-detail-head h3 {
    margin: 0;
}

.ctype-detail-sub {
    margin: 2px 0 10px;
    color: #63715f;
    font-size: 12px;
}

.ctype-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ctype-chip {
    font-size: 10.5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef4ef;
    color: #3c5548;
    border: 1px solid #dbe6dc;
}

.ctype-chip.use {
    background: #f6f8f3;
}

.ctype-chip.tag {
    background: #fdf7ec;
    border-color: #f0e2c8;
    color: #7a5b2d;
}

.ctype-phase-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px 96px;
    gap: 10px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eef2ea;
    font-size: 12px;
}

.ctype-phase-row:last-of-type {
    border-bottom: 0;
}

.ctype-phase-name {
    color: #3c5548;
}

.ctype-phase-value {
    text-align: right;
    color: #63715f;
    font-variant-numeric: tabular-nums;
}

.ctype-bar {
    display: block;
    height: 9px;
    border-radius: 5px;
    background: #edf1e9;
    overflow: hidden;
}

.ctype-bar i {
    display: block;
    height: 100%;
}

.ctype-uses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

.ctype-caution {
    font-size: 12px;
    line-height: 1.55;
    color: #7a5b2d;
    background: #fdf7ec;
    border: 1px solid #f0e2c8;
    border-radius: 8px;
    padding: 9px 12px;
    margin: 0;
}

.ctype-game {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #eef2ea;
}

.ctype-game h3 {
    margin: 4px 0 6px;
}

.ctype-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
}

.ctype-feedback {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.6;
    border: 1px solid;
}

.ctype-feedback p {
    margin: 6px 0 0;
}

.ctype-feedback.prompt {
    background: #f6f8f3;
    border-color: #e2e9de;
    color: #63715f;
}

.ctype-feedback.best {
    background: #f2f7f0;
    border-color: #d9e6d4;
    color: #31543f;
}

.ctype-feedback.ok {
    background: #fdf7ec;
    border-color: #f0e2c8;
    color: #7a5b2d;
}

.ctype-feedback.bad {
    background: #fdf1ee;
    border-color: #f0d3cb;
    color: #8a4234;
}

.ctype-summary {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f2f7f0;
    border: 1px solid #d9e6d4;
    color: #31543f;
    font-size: 13px;
    line-height: 1.55;
}

.ctype-summary p {
    margin: 6px 0 0;
}

.ctype-game-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-top: 16px;
}

.ctype-score {
    margin-left: auto;
    font-size: 12px;
    color: #63715f;
    font-variant-numeric: tabular-nums;
}

.ctype-standards {
    overflow-x: auto;
}

.ctype-standards table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 8px 0 14px;
}

.ctype-standards th,
.ctype-standards td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #eef2ea;
    vertical-align: top;
}

.ctype-standards thead th {
    color: #3c5548;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ctype-standards tbody th {
    font-weight: 600;
    color: #243c32;
}

@media(max-width:1000px) {
    .ctype-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media(max-width:700px) {
    .ctype-phase-row {
        grid-template-columns: minmax(0, 1fr) 46px;
    }

    .ctype-bar {
        display: none;
    }

    .ctype-score {
        margin-left: 0;
        flex: 1 1 100%;
    }
}

/* Cement lab 05: virtual testing benches */
.test-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.test-station {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    background: #fdfefd;
}

.test-station header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.test-station h2 {
    margin: 0;
    font-size: 17px;
}

.test-station header .eyebrow {
    margin: 2px 0 0;
}

.test-no {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    color: #93a08f;
    line-height: 1;
    padding-top: 2px;
}

.test-station .small {
    margin-top: 0;
}

.test-canvas {
    display: block;
    width: 100%;
    height: 200px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfdfb;
    margin-top: 10px;
}

.test-canvas.tall {
    height: 250px;
}

.test-readouts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 10px;
    font-size: 12px;
    color: #63715f;
}

.test-readouts b {
    color: #285c47;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}

.test-verdict {
    margin: 12px 0 0;
    padding: 9px 12px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.55;
}

.test-verdict.ok {
    background: #f2f7f0;
    border-color: #d9e6d4;
    color: #31543f;
}

.test-verdict.warn {
    background: #fdf7ec;
    border-color: #f0e2c8;
    color: #7a5b2d;
}

.test-verdict.bad {
    background: #fdf1ee;
    border-color: #f0d3cb;
    color: #8a4234;
}

.test-gauges {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.test-gauge-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    color: #3c5548;
    margin-bottom: 4px;
}

.test-gauge-head b {
    color: #285c47;
    font-variant-numeric: tabular-nums;
}

.test-gauge-head em {
    font-style: normal;
    margin-left: auto;
    font-size: 10px;
    color: #84907d;
}

.test-bar {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: #edf1e9;
    overflow: hidden;
}

.test-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 6px;
    transition: width .15s linear;
}

.test-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.test-type-row label {
    margin: 0;
    font-size: 12px;
    white-space: nowrap;
}

.test-type-row select {
    width: auto;
    min-width: 150px;
    max-width: 240px;
    padding: 8px 10px;
    font-size: 12px;
}

@media(max-width:1000px) {
    .test-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media(max-width:700px) {
    .test-canvas {
        height: 180px;
    }

    .test-canvas.tall {
        height: 220px;
    }

    .test-type-row {
        flex-wrap: wrap;
    }

    .test-type-row select {
        width: 100%;
        max-width: none;
    }
}

@media print {
    .test-canvas {
        display: none;
    }
}

/* Cement lab 06: heat in the pour */
.thermal-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.thermal-controls {
    display: grid;
    gap: 6px;
}

.thermal-control label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin: 8px 0 2px;
}

.thermal-control output {
    float: none;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.thermal-control select {
    width: 100%;
    padding: 9px 10px;
    font-size: 13px;
}

.thermal-control .small {
    margin: 8px 0 0;
}

.test-canvas.chart {
    height: 320px;
}

.thermal-visual .test-gauge {
    margin-top: 12px;
}

.thermal-visual .test-verdict {
    margin-top: 12px;
}

.thermal-visual .small {
    margin: 10px 0 0;
}

@media(max-width:1000px) {
    .thermal-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media(max-width:700px) {
    .test-canvas.chart {
        height: 260px;
    }
}

@media print {
    .thermal-canvas {
        display: none;
    }
}

/* Cement lab 07: blended binder designer */
.scm-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.scm-controls {
    display: grid;
    gap: 2px;
}

.scm-control label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    margin: 8px 0 2px;
}

.scm-control output {
    float: none;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.scm-controls .small b {
    color: #285c47;
    font-variant-numeric: tabular-nums;
}

.scm-bar {
    position: relative;
    display: block;
    overflow: visible;
}

.scm-mark {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: #b98d4d;
}

.scm-gauges {
    margin-top: 12px;
}

.scm-brief {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eef2ea;
}

.scm-brief-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 8px;
}

.scm-brief-row label {
    margin: 0;
    font-size: 12px;
    white-space: nowrap;
}

.scm-brief-row select {
    width: auto;
    min-width: 220px;
    max-width: 320px;
    padding: 9px 10px;
    font-size: 13px;
}

.scm-requirements {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.scm-requirements li {
    font-size: 12.5px;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid;
}

.scm-requirements li.ok {
    background: #f2f7f0;
    border-color: #d9e6d4;
    color: #31543f;
}

.scm-requirements li.miss {
    background: #fdf1ee;
    border-color: #f0d3cb;
    color: #8a4234;
}

@media(max-width:1000px) {
    .scm-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media(max-width:700px) {
    .scm-brief-row {
        flex-wrap: wrap;
    }

    .scm-brief-row select {
        width: 100%;
        max-width: none;
    }
}

/* --- Aggregate lab 06: specific gravity & absorption --- */
.sg-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr);
    gap: 22px;
    align-items: start;
}

.sg-metrics {
    margin: 0;
}

.sg-gauges {
    display: grid;
    gap: 18px;
}

.sg-band {
    position: relative;
    height: 14px;
    border-radius: 8px;
    border: 1px solid #d6dfc8;
}

.sg-band-density {
    background: linear-gradient(90deg, #e3ead6 0 50%, #d9e6cf 50% 81%, #d8d3c4 81% 100%);
}

.sg-band-absorption {
    background: linear-gradient(90deg, #dce8df 0 8.3%, #e6ecdc 8.3% 41.7%, #f0e4d2 41.7% 100%);
}

.sg-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 4px;
    border-radius: 3px;
    background: #28654f;
    transform: translateX(-50%);
    box-shadow: 0 0 0 2px #fbfdf8;
}

.sg-band-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 5px;
    font-size: 10.5px;
    color: #7d8976;
}

.sg-class {
    margin: 6px 0 0;
    font-size: 13px;
}

@media(max-width:860px) {
    .sg-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --- Aggregate lab 07: bulk density & voids --- */
.bulk-mass-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.bulk-table {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.bulk-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) .7fr .8fr .8fr;
    gap: 10px;
    align-items: center;
    background: #f5f8f0;
    border: 1px solid #e2e9d8;
    border-radius: 10px;
    padding: 10px 12px;
}

.bulk-row.densest {
    border-color: #b9d0ae;
    background: #eef4e6;
}

.bulk-row .bulk-name {
    font-weight: 600;
}

.bulk-flag {
    font-size: 10.5px;
    letter-spacing: .5px;
    color: #31543f;
    background: #dcebcf;
    border-radius: 6px;
    padding: 2px 6px;
}

.bulk-bar {
    grid-column: 1 / -1;
    height: 12px;
    border-radius: 7px;
    background: repeating-linear-gradient(45deg, #e7ecdc 0 6px, #f2f5ea 6px 12px);
    border: 1px solid #dfe6d2;
    overflow: hidden;
}

.bulk-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #8fae7f, #5d8163);
}

@media(max-width:760px) {
    .bulk-mass-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .bulk-row {
        grid-template-columns: minmax(120px, 1.2fr) .7fr .8fr .8fr;
    }
}

/* --- Aggregate lab 08: bulking of sand --- */
.bulking-batch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 10px;
}

@media(max-width:760px) {
    .bulking-batch-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --- Aggregate lab 09: flakiness & elongation --- */
.shape-band-fi {
    background: linear-gradient(90deg, #dfe9d4 0 66.7%, #f0e2c6 66.7% 83.3%, #efd3c6 83.3% 100%);
}

.shape-band-ei {
    background: linear-gradient(90deg, #dfe9d4 0 33.3%, #f0e2c6 33.3% 66.7%, #efd3c6 66.7% 100%);
}

/* --- Aggregate lab 10: toughness --- */
.tough-band-aiv {
    background: linear-gradient(90deg, #dfe9d4 0 60%, #f0e2c6 60% 90%, #efd3c6 90% 100%);
}

.tough-band-la {
    background: linear-gradient(90deg, #dfe9d4 0 50%, #f0e2c6 50% 83.3%, #efd3c6 83.3% 100%);
}

/* --- Concrete lab 01: workability --- */
.wk-band {
    background: linear-gradient(90deg, #dbe6d2 0 11.4%, #e4edda 11.4% 22.7%, #eef4e6 22.7% 45.5%, #f0e2c6 45.5% 68.2%, #efd3c6 68.2% 100%);
}

/* --- Concrete lab 02: segregation & bleeding --- */
.seg-band-bleed {
    background: linear-gradient(90deg, #dfe9d4 0 41.7%, #f0e2c6 41.7% 66.7%, #efd3c6 66.7% 100%);
}

.seg-band-index {
    background: linear-gradient(90deg, #dfe9d4 0 20%, #f0e2c6 20% 40%, #efd3c6 40% 100%);
}

/* --- Concrete lab 03: air content & freeze-thaw --- */
.air-band {
    background: linear-gradient(90deg, #efd3c6 0 30%, #e6efe0 30% 60%, #efd3c6 60% 100%);
}

.air-zone {
    position: absolute;
    top: -2px;
    bottom: -2px;
    border-left: 1px dashed #5d8163;
    border-right: 1px dashed #5d8163;
    background: rgba(93, 129, 99, .16);
}

.air-spacing {
    background: linear-gradient(90deg, #dfe9d4 0 40%, #f0e2c6 40% 46%, #efd3c6 46% 100%);
}

/* --- Concrete lab 04: curing & maturity --- */
.cur-band-strength {
    background: linear-gradient(90deg, #efd3c6 0 75%, #f0e2c6 75% 90%, #dfe9d4 90% 100%);
}

.cur-band-maturity {
    background: linear-gradient(90deg, #f2f5ea 0 94.3%, #dfe9d4 94.3% 100%);
}

/* --- Concrete lab 05: strength & specimens --- */
.str-band {
    background: linear-gradient(90deg, #f2f5ea 0 100%);
}

.str-zone {
    position: absolute;
    top: -2px;
    bottom: -2px;
    background: rgba(93, 129, 99, .15);
    border-left: 1px dashed #5d8163;
}

.str-tick {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: #c47b6a;
    transform: translateX(-50%);
}

.str-tick.strong {
    background: #5d8163;
    width: 3px;
}

/* --- Concrete lab 06: NDT rebound & UPV --- */
.ndt-band-r {
    background: linear-gradient(90deg, #f2f5ea 0 100%);
}

.ndt-band-v {
    background: linear-gradient(90deg, #efd3c6 0 4.5%, #f0ddc0 4.5% 35%, #f0e2c6 35% 55.3%, #e6efe0 55.3% 85.8%, #dfe9d4 85.8% 100%);
}

/* --- Concrete lab 07: permeability & durability --- */
/* log10 k over 1e-14 .. 1e-9 (five decades): dam line 8e-12 at 58.1 %, granite 5.35e-11 at 74.6 % */
.dur-band-k {
    background: linear-gradient(90deg, #dfe9d4 0 58.1%, #f0e2c6 58.1% 74.6%, #efd3c6 74.6% 100%);
}

/* years 0-100: < 30 miss, 30-50 warn, 50+ ok */
.dur-band-y {
    background: linear-gradient(90deg, #efd3c6 0 30%, #f0e2c6 30% 50%, #dfe9d4 50% 100%);
}

/* --- Concrete lab 08: mix design capstone --- */
.mix-band {
    background: #dfe9d4;
}

/* the illegal zone past the exposure cap - left and width set inline per brief */
.mix-over {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #efd3c6;
}

/* the strength strip: red to target - 2.5, amber to the target */
.mix-z1 {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    background: #efd3c6;
}

.mix-z2 {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #f0e2c6;
}

.mix-tick {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: #5d8163;
    transform: translateX(-50%);
}

.mix-tick.red {
    background: #c47b6a;
}

/* --- Asphalt lab 01: binder tests --- */
/* penetration strip 20-110 (0.1 mm): the four classic identification bands */
.ab-band-pen {
    background: linear-gradient(90deg, #f2f5ea 0 22.2%, #efd3c6 22.2% 33.3%, #f0e2c6 33.3% 44.4%, #e6efe0 44.4% 55.6%, #f2f5ea 55.6% 66.7%, #dfe9d4 66.7% 88.9%, #f2f5ea 88.9% 100%);
}

/* softening point strip 35-60 C: the floors climb 40 / 45 / 47 / 50 */
.ab-band-sp {
    background: linear-gradient(90deg, #efd3c6 0 20%, #f0e2c6 20% 40%, #eef2df 40% 48%, #e6efe0 48% 60%, #dfe9d4 60% 100%);
}

.toughness-plays,
.clean-plays,
.asr-plays,
.rca-plays,
.wk-plays,
.seg-plays,
.air-plays,
.cur-plays,
.str-plays,
.ndt-plays,
.dur-plays,
.mix-plays,
.ab-plays,
.asg-plays {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.wk-plays {
    grid-template-columns: minmax(0, 1fr);
}

.toughness-plays .play,
.clean-plays .play,
.asr-plays .play,
.rca-plays .play,
.wk-plays .play,
.seg-plays .play,
.air-plays .play,
.cur-plays .play,
.str-plays .play,
.ndt-plays .play,
.dur-plays .play,
.mix-plays .play,
.ab-plays .play,
.asg-plays .play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.play-icon {
    font-size: 10px;
    line-height: 1;
}

.toughness-plays .play.playing,
.clean-plays .play.playing,
.asr-plays .play.playing,
.rca-plays .play.playing,
.wk-plays .play.playing,
.seg-plays .play.playing,
.air-plays .play.playing,
.cur-plays .play.playing,
.str-plays .play.playing,
.ndt-plays .play.playing,
.dur-plays .play.playing,
.mix-plays .play.playing,
.ab-plays .play.playing,
.asg-plays .play.playing {
    background: #e3ecd8;
    border-color: #a9c39c;
    color: #31543f;
}

.tough-uses {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.tough-uses li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    border: 1px solid #e2e9d8;
    border-radius: 10px;
    background: #f7faf2;
    padding: 10px 12px;
    font-size: 13.5px;
}

.tough-uses li.ok {
    border-color: #b9d0ae;
    background: #eef4e6;
}

.tough-uses li.miss {
    border-color: #ecd2c8;
    background: #fbf1ec;
}

.tough-uses li .tough-tick {
    font-weight: 700;
}

.tough-uses li.ok .tough-tick {
    color: #3f7a5c;
}

.tough-uses li.miss .tough-tick {
    color: #b0603f;
}

.tough-uses li.wait .tough-tick {
    color: #8fa6a0;
}

.tough-uses .tough-need {
    display: block;
    font-size: 11.5px;
    color: #667560;
}

.tough-uses em {
    display: block;
    font-size: 11.5px;
    font-style: normal;
    margin-top: 3px;
    color: #8a4234;
}

.tough-uses li.wait em {
    color: #667560;
}

.tough-uses li.warn {
    border-color: #e8d9b5;
    background: #faf4e6;
}

.tough-uses li.warn .tough-tick {
    color: #b98d4d;
}

/* --- Aggregate lab 11: cleanliness --- */
.clean-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.clean-chip {
    font-size: 11.5px;
    color: #31543f;
    background: #eef4e6;
    border: 1px solid #d9e6d4;
    border-radius: 999px;
    padding: 5px 10px;
}

/* --- Asphalt lab 02: grades & climate --- */
.asg-chart svg {
    display: block;
    width: 100%;
    height: auto;
}

.asg-band-mix {
    background: linear-gradient(90deg, #eef3e8 0 100%);
}

.asg-band-lay,
.asg-band-roll {
    background: linear-gradient(90deg, #f5f8f0 0 100%);
}

/* the aggregate marker rides beside the binder marker - grey, not ink */
.sg-marker.agg {
    background: #7c8a84;
}

/* --- Asphalt lab 03: grading for mixes --- */
.agr-chart svg {
    display: block;
    width: 100%;
    height: auto;
    margin: 10px 0 4px;
}

.agr-table {
    display: grid;
    gap: 4px;
    margin-top: 12px;
}

.agr-row {
    display: grid;
    grid-template-columns: 70px 90px minmax(60px, .6fr) minmax(80px, 1fr);
    gap: 10px;
    align-items: center;
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid #e7ecdf;
    border-radius: 8px;
    background: #fafcf7;
}

.agr-row.head {
    border: none;
    background: none;
    font-size: 10px;
    letter-spacing: .6px;
    color: #7d8976;
}

.agr-row.near {
    border-color: #e8d9b5;
    background: #faf4e6;
}

.agr-row.out {
    border-color: #ecd2c8;
    background: #fbf1ec;
}

.agr-row .agr-state {
    color: #667560;
    font-size: 11px;
}

.agr-row.out .agr-state {
    color: #8a4234;
    font-weight: 600;
}

.agr-row.near .agr-state {
    color: #9a7333;
}

.agr-plays {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.agr-plays .play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.agr-plays .play.playing {
    background: #e3ecd8;
    border-color: #a9c39c;
    color: #31543f;
}

/* --- Asphalt lab 04: Marshall mix design --- */
.asm-chart svg {
    display: block;
    width: 100%;
    height: auto;
    margin: 12px 0 6px;
}

.asm-plays {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.asm-plays .play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.asm-plays .play.playing {
    background: #e3ecd8;
    border-color: #a9c39c;
    color: #31543f;
}

.asm-band-stab,
.asm-band-flow,
.asm-band-va,
.asm-band-vfb,
.asm-band-vma {
    background: #f5f8f0;
}

#asmCriteria {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.asm-crit {
    display: grid;
    grid-template-columns: minmax(140px, 1.1fr) 90px minmax(140px, 1.4fr);
    gap: 10px;
    align-items: center;
    font-size: 12px;
    padding: 7px 12px;
    border: 1px solid #e7ecdf;
    border-radius: 8px;
    background: #fafcf7;
}

.asm-crit b {
    font-size: 13px;
    color: #32573e;
}

.asm-crit em {
    font-style: normal;
    font-size: 11px;
    color: #7d8976;
}

.asm-crit.warn {
    border-color: #e8d9b5;
    background: #faf4e6;
}

.asm-crit.warn b {
    color: #9a7333;
}

.asm-crit.miss {
    border-color: #ecd2c8;
    background: #fbf1ec;
}

.asm-crit.miss b {
    color: #8a4234;
}

@media(max-width:860px) {
    .asm-crit {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }
}

/* --- Asphalt lab 05: moisture damage --- */
.amo-plays {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.amo-plays .play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.amo-plays .play.playing {
    background: #e3ecd8;
    border-color: #a9c39c;
    color: #31543f;
}

/* TSR strip 40-100 with the 80 % floor two thirds along */
.amo-band-tsr {
    background: linear-gradient(90deg, #efd3c6 0 66.7%, #dfe9d4 66.7% 100%);
}

/* coating strip 60-100 with the 95 % floor at 87.5 % */
.amo-band-coat {
    background: linear-gradient(90deg, #efd3c6 0 87.5%, #dfe9d4 87.5% 100%);
}

/* --- Pavement labs: plays rows and bands --- */
.pcb-plays,
.ptw-plays,
.pd-plays,
.psk-plays {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.ptw-plays,
.pd-plays,
.psk-plays {
    grid-template-columns: minmax(0, 1fr);
}

.pcb-plays .play,
.ptw-plays .play,
.pd-plays .play,
.psk-plays .play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pcb-plays .play.playing,
.ptw-plays .play.playing,
.pd-plays .play.playing,
.psk-plays .play.playing {
    background: #e3ecd8;
    border-color: #a9c39c;
    color: #31543f;
}

/* BPN strip 20-90; MTD strip 0.2-1.6 mm - the site requirement rides as a tick */
.psk-band-bpn {
    background: linear-gradient(90deg, #efd3c6 0 35.7%, #f0e2c6 35.7% 57.1%, #dfe9d4 57.1% 100%);
}

.psk-band-mtd {
    background: linear-gradient(90deg, #efd3c6 0 32.1%, #f0e2c6 32.1% 57.1%, #dfe9d4 57.1% 100%);
}

/* the condition index strip: failed 0-25, poor to 55, fair to 70, satisfactory to 85, good beyond */
.pdx-band {
    background: linear-gradient(90deg, #efd3c6 0 25%, #f0ded0 25% 40%, #f0e2c6 40% 55%, #e9efdd 55% 70%, #dfe9d4 70% 85%, #d5e6cd 85% 100%);
}

/* Concrete Laboratory Device Showcase & Upgrades */
.lab-device-showcase {
    background: #fbfdfa;
    border: 1px solid #d5e0d2;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(36, 60, 50, 0.04);
}

.device-spotlight-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1.15fr) minmax(280px, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 14px;
}

.device-spotlight-grid.dual-device {
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
}

.device-figure {
    margin: 0;
    background: #ffffff;
    border: 1px solid #dbe5d8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(36, 60, 50, 0.05);
}

.device-figure img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    background: #edf1ea;
}

.device-figure figcaption {
    font-size: 12px;
    line-height: 1.55;
    padding: 12px 16px;
    color: #4a5c50;
    background: #f7faf5;
    border-top: 1px solid #e5ede2;
}

.device-figure figcaption strong {
    color: #243c32;
    display: block;
    margin-bottom: 4px;
    font-size: 12.5px;
}

.device-guide {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.device-guide h3 {
    margin: 0;
    font-size: 15px;
    color: #243c32;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.device-guide-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e1ede0;
    color: #2e6047;
}

.device-parts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.device-parts-list li {
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e1e9de;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #3b4d42;
}

.device-parts-list li strong {
    color: #243c32;
    display: inline;
}

.device-parts-list li span.part-tag {
    display: inline-block;
    background: #edf2eb;
    color: #28654f;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.device-protocol-box {
    background: #f2f7ef;
    border-left: 3px solid #3f7a5c;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 12px;
    line-height: 1.6;
    color: #314437;
}

.device-protocol-box strong {
    color: #243c32;
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .device-spotlight-grid,
    .device-spotlight-grid.dual-device {
        grid-template-columns: 1fr;
    }
}

/* --- Concrete Lab Enrichment & Interactive Modules --- */
.preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 14px;
}

.preset-chip {
    background: #edf3e7;
    border: 1px solid #c7d8be;
    color: #274d3a;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    line-height: 1.3;
}

.preset-chip:hover {
    background: #2e6047;
    color: #ffffff;
    border-color: #2e6047;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(46, 96, 71, 0.2);
}

.preset-chip:active {
    transform: translateY(0);
}

/* Mathematical Derivations & Calculations Card */
.math-breakdown {
    background: #ffffff;
    border: 1px solid #dce5d6;
    border-radius: 10px;
}

.math-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.equation-box {
    background: #f8faf6;
    border: 1px solid #e2ebd9;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.equation-box .eq-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2e6047;
    margin: 0;
}

.equation-box .formula {
    background: #ffffff;
    border: 1px solid #d5e2cf;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Cambria Math', 'Latin Modern Math', 'Times New Roman', serif;
    font-size: 15.5px;
    color: #1a2e24;
    text-align: center;
    letter-spacing: 0.3px;
    overflow-x: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 48px;
}

.math-frac {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    padding: 0 4px;
    line-height: 1.15;
    font-size: 0.92em;
}

.math-frac-num {
    border-bottom: 1.5px solid #2e6047;
    padding-bottom: 2px;
}

.math-frac-den {
    padding-top: 2px;
}

.formula em {
    font-style: italic;
    font-family: 'Cambria Math', 'Times New Roman', serif;
}

.formula sub,
.formula sup {
    font-size: 0.75em;
    line-height: 0;
}

.equation-box .eq-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #455a4d;
    margin: 0;
}

.equation-box .eq-vars {
    font-size: 11px;
    line-height: 1.5;
    color: #677b6e;
    border-top: 1px dashed #dbe5d4;
    padding-top: 6px;
    margin: 0;
}

/* Forensic Case Studies & Field Lessons */
.forensic-case {
    background: #fbf9f4;
    border: 1px solid #ebd9c0;
    border-left: 4px solid #b5762a;
    border-radius: 8px;
    padding: 18px 20px;
    margin-top: 14px;
}

.forensic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.forensic-header h3 {
    margin: 0;
    font-size: 15px;
    color: #5c3b12;
}

.forensic-badge {
    background: #faebd7;
    color: #8a4b08;
    border: 1px solid #e8cb9e;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.forensic-body {
    font-size: 12.5px;
    line-height: 1.6;
    color: #4a3825;
    margin: 0 0 10px 0;
}

.forensic-takeaway {
    background: #ffffff;
    border: 1px solid #e8dec9;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: #3b2d18;
}

.forensic-takeaway strong {
    color: #8a4b08;
}

/* Interactive Student Challenge Missions */
.lab-challenge-panel {
    background: #f4f8f2;
    border: 1px solid #cfe0c6;
    border-radius: 8px;
    padding: 12px 18px;
    margin-top: 14px;
}

.lab-challenge-panel summary {
    font-weight: 700;
    font-size: 13.5px;
    color: #204c37;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.lab-challenge-panel summary:hover {
    color: #113324;
}

.challenge-grid {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.challenge-card {
    background: #ffffff;
    border: 1px solid #d8e5d2;
    border-radius: 8px;
    padding: 14px 16px;
}

.challenge-card h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: #27523c;
    display: flex;
    align-items: center;
    gap: 6px;
}

.challenge-card p {
    font-size: 12px;
    line-height: 1.5;
    color: #3f5245;
    margin: 0 0 8px 0;
}

.challenge-solution {
    background: #edf5eb;
    border-left: 3px solid #3c825a;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: #244230;
}

.challenge-solution strong {
    color: #1b4d32;
}

/* Causal Diagnosis & Consequence Cards across Concrete Labs */
.causal-card {
    background: #ffffff;
    border: 1.5px solid #d4e3ce;
    border-radius: 9px;
    padding: 16px 20px;
    margin-top: 14px;
    box-shadow: 0 2px 6px rgba(32, 60, 48, 0.05);
    transition: all 0.25s ease;
}

.causal-card.optimal {
    border-left: 5px solid #2e7d54;
    background: #fcfdfc;
}

.causal-card.suboptimal {
    border-left: 5px solid #c78d38;
    background: #fffdf9;
}

.causal-card.disaster {
    border-left: 5px solid #b84a39;
    background: #fdfafa;
}

.causal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.causal-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1d3b2c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.causal-badge {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 9px;
    border-radius: 20px;
}

.badge-optimal {
    background: #e3f2e7;
    color: #1e6b3f;
    border: 1px solid #b7ddc4;
}

.badge-warning {
    background: #fef4e5;
    color: #9c6819;
    border: 1px solid #f2d2a4;
}

.badge-danger {
    background: #fbeae8;
    color: #aa2f23;
    border: 1px solid #f1bdb6;
}

.causal-body {
    font-size: 12.5px;
    line-height: 1.6;
    color: #384d41;
    margin: 0 0 12px 0;
}

.causal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dce6d6;
}

.causal-metric {
    background: #f6f9f4;
    border: 1px solid #e1ebdc;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
}

.causal-metric span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c7e73;
    margin-bottom: 2px;
}

.causal-metric strong {
    font-size: 14px;
    font-weight: 700;
    color: #1d3b2c;
}

.causal-metric.alert strong {
    color: #b84a39;
}

.causal-metric.success strong {
    color: #2e7d54;
}

/* Sequence buttons & Step pills */
.sequence-selector {
    display: grid;
    gap: 8px;
    margin: 10px 0 14px 0;
}

.sequence-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid #cfdeca;
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
    color: #284435;
    text-align: left;
    transition: all 0.2s ease;
}

.sequence-btn:hover {
    border-color: #3b7b58;
    background: #f4f8f2;
}

.sequence-btn.active {
    border-color: #266b46;
    background: #eaf3e7;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(40, 107, 70, 0.2);
}

.sequence-steps-list {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 11.5px;
    color: #42584a;
    line-height: 1.5;
}

.sequence-steps-list li {
    margin-bottom: 4px;
}

/* ==========================================================================
   Interactive Apparatus Modal & Trigger Styling (ASTM / AASHTO / EN)
   ========================================================================== */

.inspect-device-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #1b4b36;
    background: #eef6f1;
    border: 1px solid #9dc3ae;
    border-radius: 20px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0.3px;
}

.inspect-device-btn:hover {
    background: #d6ebe0;
    border-color: #2e7d54;
    color: #0d3021;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(46, 125, 84, 0.15);
}

.device-trigger {
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.device-trigger:hover {
    filter: drop-shadow(0 2px 8px rgba(32, 90, 60, 0.35)) brightness(1.05);
}

#deviceModal {
    width: min(940px, calc(100vw - 32px));
    max-height: 90vh;
    padding: 0;
    border: 1px solid #bfd3c7;
    border-radius: 16px;
    background: #ffffff;
    color: #183023;
    box-shadow: 0 25px 90px rgba(10, 30, 20, 0.4);
    overflow: hidden;
    margin: auto;
}

#deviceModal::backdrop {
    background: rgba(14, 28, 20, 0.72);
    backdrop-filter: blur(4px);
}

.device-modal-card {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.device-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #dce8e0;
    background: #f7fbf8;
    position: sticky;
    top: 0;
    z-index: 10;
}

.device-modal-std {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #216d47;
    background: #e5f3ec;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid #b7dfc8;
}

.device-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #153324;
    line-height: 1.25;
}

.device-modal-close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #cfdeca;
    background: #ffffff;
    font-size: 24px;
    line-height: 1;
    color: #3b5245;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.device-modal-close:hover {
    background: #fdf2ef;
    border-color: #d97864;
    color: #a43a25;
    transform: rotate(90deg);
}

.device-modal-body {
    padding: 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
    gap: 26px;
    align-items: start;
}

.device-modal-media figure {
    margin: 0;
}

.device-modal-media img {
    display: block;
    width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: 10px;
    background: #f0f4f1;
    border: 1px solid #c7d8ce;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.device-modal-media figcaption {
    font-size: 11.5px;
    line-height: 1.5;
    color: #556c60;
    margin-top: 10px;
    padding: 0 4px;
}

.device-modal-citation {
    margin-top: 8px;
    padding: 8px 10px;
    background: #eef5f1;
    border-radius: 6px;
    border-left: 3px solid #2e7d54;
    font-size: 11px;
    line-height: 1.45;
    color: #234332;
    word-break: break-word;
}

.device-modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.device-modal-content section {
    border-bottom: 1px solid #edf2ee;
    padding-bottom: 14px;
}

.device-modal-content section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.device-modal-content h3 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #284435;
    margin: 0 0 8px 0;
}

.device-modal-specs {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #2b3e34;
}

.device-modal-specs li {
    margin-bottom: 6px;
}

.device-modal-content p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: #2b3e34;
}

.device-modal-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12.5px;
}

.device-modal-alert.caution {
    background: #fff8f0;
    border-left: 4px solid #c87a2a;
}

.device-modal-alert.caution h3 {
    color: #8f4f11;
}

.device-modal-alert.info {
    background: #f0f7f4;
    border-left: 4px solid #2e7d54;
}

.device-modal-alert.info h3 {
    color: #1e5a3c;
}

@media (max-width: 780px) {
    .device-modal-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
    #deviceModal {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }
}