:root {
    --paper: #edf0ec;
    --paper-deep: #dfe4df;
    --ink: #17201e;
    --muted: #62706b;
    --line: #c3cbc5;
    --line-dark: #98a59e;
    --teal: #287c73;
    --teal-deep: #174f4a;
    --copper: #b65e3c;
    --amber: #d39b2b;
    --danger: #b33a3a;
    --white: #f9fbf8;
    --rail: 72px;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--teal) var(--paper-deep);
}
html {
    background: var(--paper);
    color: var(--ink);
    font-size: 17px;
}
*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
*::-webkit-scrollbar-track {
    background: var(--paper-deep);
    border-left: 1px solid var(--line);
}
*::-webkit-scrollbar-thumb {
    background: var(--teal);
    border: 3px solid var(--paper-deep);
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--teal-deep);
}
*::-webkit-scrollbar-corner {
    background: var(--paper-deep);
}
body {
    margin: 0;
    min-width: 320px;
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        linear-gradient(rgba(23, 32, 30, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 32, 30, 0.035) 1px, transparent 1px),
        var(--paper);
    background-size: 32px 32px;
}
a {
    color: inherit;
    text-decoration: none;
}
button,
input,
select {
    font: inherit;
}
button {
    cursor: pointer;
}
:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 3px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
}
.site-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
    background: var(--ink);
    color: var(--paper);
}
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    position: relative;
}
.brand-mark img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}
.brand-mark span {
    display: none;
}
.rail-line {
    width: 1px;
    flex: 1;
    margin: 18px 0;
    background: rgba(237, 240, 236, 0.22);
}
.rail-caption {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font:
        700 13px/1 "PT Sans Narrow",
        sans-serif;
    letter-spacing: 0.04em;
}
.rail-year {
    margin-top: 16px;
    font:
        700 16px/1 "PT Sans Narrow",
        sans-serif;
    color: #91b8b2;
}

.site-body {
    min-width: 0;
}
.site-header {
    min-height: 90px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-dark);
    background: rgba(237, 240, 236, 0.94);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
}
.wordmark {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px;
}
.wordmark strong {
    font:
        700 28px/1 "PT Sans Narrow",
        sans-serif;
    letter-spacing: 0.01em;
}
.wordmark span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 5px;
}
.site-nav {
    display: flex;
    align-items: stretch;
    border-left: 1px solid var(--line);
}
.site-nav a {
    display: grid;
    place-items: center;
    min-width: 112px;
    padding: 0 20px;
    color: var(--muted);
    font-size: 15px;
    border-right: 1px solid var(--line);
    position: relative;
}
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: transparent;
}
.site-nav a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.38);
}
.site-nav a.active {
    color: var(--ink);
    font-weight: 700;
}
.site-nav a.active::after {
    background: var(--copper);
}

main {
    padding: 0;
}
.content-container {
    width: min(calc(100% - 48px), 1440px);
    margin: 0 auto;
    padding-bottom: 72px;
}
.site-footer {
    min-height: 82px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 20px clamp(20px, 4vw, 60px);
    border-top: 1px solid var(--line-dark);
    color: var(--muted);
    font-size: 13px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.7fr);
    gap: clamp(30px, 6vw, 90px);
    padding: clamp(52px, 8vw, 108px) 0 56px;
    align-items: end;
}
.hero-copy {
    max-width: 780px;
}
.context-line,
.page-header p {
    margin: 0 0 22px;
    color: var(--teal-deep);
    font-size: 14px;
    font-weight: 700;
}
.hero-copy h1,
.page-header h1 {
    margin: 0;
    font:
        700 clamp(54px, 7.2vw, 108px)/0.84 "PT Sans Narrow",
        sans-serif;
    letter-spacing: -0.035em;
    max-width: 850px;
}
.hero-copy > p:last-child {
    margin: 30px 0 0;
    max-width: 650px;
    color: var(--muted);
    font-size: clamp(18px, 1.6vw, 22px);
    line-height: 1.55;
}

.entry-console {
    min-width: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 26px;
    border-top: 6px solid var(--copper);
}
.console-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid #4b5652;
}
.console-heading h2 {
    margin: 0;
    font:
        700 27px/1 "PT Sans Narrow",
        sans-serif;
}
.console-heading span {
    color: #9fa9a5;
    font-size: 12px;
}
.entry-console label {
    display: block;
    margin: 0 0 7px;
    color: #d2d8d5;
    font-size: 13px;
}
.entry-console input,
.entry-console select,
.entry-console textarea {
    width: 100%;
    padding: 11px 12px;
    color: var(--white);
    background: #232e2b;
    border: 1px solid #56625e;
    border-radius: 0;
}
.entry-console input::placeholder {
    color: #83908b;
}
.entry-console textarea {
    min-height: 108px;
    resize: vertical;
    line-height: 1.5;
}
.entry-console textarea::placeholder {
    color: #83908b;
}
.measurement-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    width: 100%;
    min-width: 0;
    margin-top: 18px;
}
.form-row,
.value-control,
.note-control {
    width: 100%;
    min-width: 0;
}
.note-control textarea {
    display: block;
    min-width: 0;
    max-width: 100%;
}
.entry-console button {
    width: 100%;
    margin-top: 22px;
    padding: 12px 15px;
    border: 0;
    background: var(--copper);
    color: white;
    font-weight: 700;
}
.entry-console button:hover {
    background: #cc6b46;
}
.entry-console input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.entry-console input[type="number"]::-webkit-inner-spin-button,
.entry-console input[type="number"]::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}
.number-stepper {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #56625e;
    background: #232e2b;
}
.number-stepper:focus-within {
    outline: 3px solid var(--amber);
    outline-offset: 3px;
}
.number-stepper input {
    width: 100%;
    min-width: 0;
    border: 0;
    border-left: 1px solid #56625e;
    border-right: 1px solid #56625e;
}
.number-stepper input:focus-visible {
    outline: none;
}
.number-stepper button {
    width: 48px;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #31403c;
    color: var(--white);
    font:
        700 25px/1 "PT Sans Narrow",
        sans-serif;
}
.number-stepper button:focus-visible {
    outline: none;
}
.number-stepper button:hover {
    background: var(--teal);
}

.save-confirmation {
    margin-bottom: 14px;
    padding: 11px 14px;
    border-left: 5px solid var(--teal);
    background: #d5e5e1;
    font-size: 13px;
}
.cell-bank {
    display: grid;
    grid-template-columns: 1.45fr repeat(6, minmax(72px, 0.58fr)) 0.9fr;
    min-height: 276px;
    border: 1px solid var(--line-dark);
    border-bottom: 6px solid var(--ink);
    background: rgba(249, 251, 248, 0.72);
}
.shift-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 26px;
    border-right: 1px solid var(--line);
}
.shift-summary span {
    color: var(--muted);
    font-size: 14px;
}
.shift-summary strong {
    font:
        700 96px/0.9 "PT Sans Narrow",
        sans-serif;
    color: var(--teal-deep);
    margin: 10px 0;
}
.shift-summary small {
    max-width: 150px;
    font-weight: 700;
    line-height: 1.25;
}
.shift-summary time {
    color: var(--muted);
    font-size: 12px;
    margin-top: 18px;
}
.cell-gauge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 26px 8px 19px;
    border-right: 1px solid var(--line);
}
.cell-cap {
    width: 24px;
    height: 7px;
    position: absolute;
    top: 25px;
    background: var(--line-dark);
}
.gauge-track {
    position: relative;
    width: clamp(34px, 4vw, 50px);
    height: 142px;
    border: 2px solid var(--ink);
    background: #e7eae6;
    overflow: hidden;
}
.gauge-track::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to top,
        transparent 0 27px,
        rgba(23, 32, 30, 0.22) 28px,
        transparent 29px
    );
}
.gauge-track i {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--teal);
}
.gauge-track span {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    font:
        700 24px/1 "PT Sans Narrow",
        sans-serif;
    mix-blend-mode: multiply;
}
.cell-gauge > strong {
    margin-top: 12px;
    font:
        700 16px/1 "PT Sans Narrow",
        sans-serif;
    text-transform: uppercase;
}
.cell-gauge > small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
    text-align: center;
}
.gauge-medium .gauge-track i {
    background: var(--amber);
}
.gauge-high .gauge-track i {
    background: var(--copper);
}
.gauge-critical .gauge-track i {
    background: var(--danger);
}
.alert-count {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background: var(--paper-deep);
}
.alert-count strong {
    font:
        700 58px/1 "PT Sans Narrow",
        sans-serif;
    color: var(--copper);
}
.alert-count span {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
}

.journal-section {
    margin-top: 54px;
    border-top: 4px solid var(--ink);
    background: rgba(249, 251, 248, 0.62);
}
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 28px;
    padding: 20px 0 16px;
}
.section-heading h2 {
    margin: 0;
    font:
        700 31px/1 "PT Sans Narrow",
        sans-serif;
}
.section-heading p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}
.table-scroll {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
    background: rgba(249, 251, 248, 0.58);
    font-size: 14px;
    line-height: 1.5;
}
.data-table th {
    padding: 13px 15px;
    text-align: left;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--line-dark);
    background: var(--paper-deep);
}
.data-table td {
    padding: 14px 13px;
    vertical-align: top;
    border: 1px solid var(--line);
}
.data-table tbody tr:hover {
    background: rgba(40, 124, 115, 0.06);
}
.data-table td strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}
.data-table td small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px;
}
.numeric {
    font:
        700 24px/1 "PT Sans Narrow",
        sans-serif;
    font-variant-numeric: tabular-nums;
}
.numeric small {
    font-family: "Manrope", sans-serif;
    font-weight: 400;
}
.muted {
    color: var(--muted);
}
.risk-tag {
    display: inline-block;
    padding: 7px 9px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.risk-low {
    background: var(--teal);
    color: white;
}
.risk-medium {
    background: var(--amber);
    color: var(--ink);
}
.risk-high {
    background: var(--copper);
    color: white;
}
.risk-critical {
    background: var(--danger);
    color: white;
}

.page-header {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.55fr);
    gap: clamp(30px, 8vw, 120px);
    align-items: end;
    padding: clamp(54px, 8vw, 104px) 0 48px;
    border-bottom: 1px solid var(--line-dark);
}
.page-header h1 {
    font-size: clamp(50px, 6vw, 88px);
}
.page-header > span {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.resource-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 70px;
    margin-top: 64px;
}
.process-line {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line-dark);
}
.process-line li {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    min-height: 64px;
    border-bottom: 1px solid var(--line);
}
.process-line span {
    font:
        700 28px/1 "PT Sans Narrow",
        sans-serif;
    color: var(--copper);
}
.process-line strong {
    font-size: 15px;
}
.carbon-ledger {
    border-top: 4px solid var(--teal-deep);
}
.carbon-total {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 24px 0;
    border-bottom: 1px solid var(--line-dark);
}
.carbon-total strong {
    font:
        700 80px/0.8 "PT Sans Narrow",
        sans-serif;
    color: var(--teal-deep);
}
.carbon-total span {
    max-width: 110px;
    color: var(--muted);
    font-size: 13px;
}
.carbon-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 45px;
    gap: 8px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.carbon-row strong,
.carbon-row small {
    display: block;
}
.carbon-row strong {
    font-size: 14px;
}
.carbon-row small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}
.carbon-row > span {
    font:
        700 25px/1 "PT Sans Narrow",
        sans-serif;
    text-align: right;
}
.carbon-row i {
    grid-column: 1 / -1;
    display: block;
    width: var(--share);
    height: 5px;
    background: var(--copper);
}

.risk-register {
    margin-top: 0;
}
.risk-score {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    font:
        700 24px/1 "PT Sans Narrow",
        sans-serif;
    color: white;
}
.score-critical {
    background: var(--danger);
}
.score-high {
    background: var(--copper);
}
.score-medium {
    background: var(--amber);
    color: var(--ink);
}
.file-note {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--line-dark);
    color: var(--muted);
    font-size: 13px;
}
.file-note span {
    color: var(--ink);
    font-weight: 700;
}
.file-note code {
    overflow-wrap: anywhere;
    color: var(--teal-deep);
}

.incident-list {
    margin-top: 52px;
    border-top: 4px solid var(--ink);
}
.incident-head,
.incident-row {
    display: grid;
    grid-template-columns:
        minmax(210px, 0.8fr) minmax(280px, 1fr) minmax(280px, 1fr)
        132px;
}
.incident-head {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    background: var(--paper-deep);
}
.incident-head span {
    padding: 11px 14px;
    border: 1px solid var(--line-dark);
    border-top: 0;
}
.incident-row {
    background: rgba(249, 251, 248, 0.55);
}
.incident-row > div {
    padding: 18px 14px;
    border: 1px solid var(--line);
    border-top: 0;
}
.incident-row h2 {
    margin: 10px 0 6px;
    font:
        700 25px/1 "PT Sans Narrow",
        sans-serif;
}
.incident-row p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}
.incident-row small {
    display: block;
    margin-top: 10px;
    color: var(--teal-deep);
    font-size: 11px;
    font-weight: 700;
}
.incident-row button {
    align-self: stretch;
    border: 0;
    border-bottom: 1px solid var(--paper);
    color: white;
    background: var(--teal-deep);
    font-size: 13px;
    font-weight: 700;
}
.incident-row button:hover {
    background: var(--teal);
}
.incident-state {
    display: inline-block;
    padding: 5px 7px;
    color: white;
    font-size: 11px;
    font-weight: 700;
}
.state-done {
    background: var(--teal);
}
.state-pending {
    background: var(--amber);
    color: var(--ink);
}

.method-grid {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.85fr);
    gap: 70px;
    margin-top: 52px;
}
.formula-board {
    border-top: 4px solid var(--teal-deep);
}
.formula {
    display: grid;
    grid-template-columns: 1fr 34px 1fr 34px 1fr;
    align-items: center;
    min-height: 76px;
    border-bottom: 1px solid var(--line-dark);
}
.formula span {
    font:
        700 22px/1 "PT Sans Narrow",
        sans-serif;
}
.formula strong,
.formula i {
    font:
        700 28px/1 "PT Sans Narrow",
        sans-serif;
    text-align: center;
    color: var(--copper);
    font-style: normal;
}
.risk-scale {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 24px;
}
.risk-scale span {
    padding: 14px;
    font-size: 13px;
    line-height: 1.45;
}
.risk-scale b {
    font-size: 11px;
}
.method-note {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
    margin-top: 18px;
    max-width: 560px;
}
.lean-list {
    border-top: 1px solid var(--line-dark);
}
.lean-list article {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 18px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}
.lean-list h3,
.lean-list p {
    margin: 0;
}
.lean-list h3 {
    font:
        700 21px/1.1 "PT Sans Narrow",
        sans-serif;
}
.lean-list p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}
.legal-section {
    margin-top: 64px;
}
.legal-note {
    color: var(--muted);
    font-size: 12px;
    padding: 15px 0;
}

@media (max-width: 1120px) {
    .site-header {
        display: block;
    }
    .wordmark {
        min-height: 72px;
    }
    .site-nav {
        overflow-x: auto;
        border-top: 1px solid var(--line);
        border-left: 0;
    }
    .site-nav a {
        min-width: 120px;
        min-height: 46px;
    }
    .cell-bank {
        grid-template-columns: 1.3fr repeat(3, 1fr);
    }
    .cell-gauge:nth-of-type(4) {
        border-right: 0;
    }
    .cell-gauge:nth-of-type(n + 5) {
        border-top: 1px solid var(--line);
    }
    .alert-count {
        border-top: 1px solid var(--line);
    }
    .incident-head {
        display: none;
    }
    .incident-row {
        grid-template-columns: 1fr 1fr;
        margin-bottom: 16px;
        border-top: 3px solid var(--ink);
    }
    .incident-row button {
        min-height: 48px;
    }
}

@media (max-width: 820px) {
    :root {
        --rail: 0px;
    }
    .app-shell {
        display: block;
    }
    .site-rail {
        display: none;
    }
    .dashboard-hero,
    .page-header,
    .resource-layout,
    .method-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .hero-copy h1,
    .page-header h1 {
        font-size: clamp(50px, 16vw, 76px);
    }
    .site-header {
        position: static;
    }

    .cell-bank {
        grid-template-columns: repeat(3, 1fr);
    }
    .shift-summary {
        grid-column: 1 / -1;
        min-height: 210px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .alert-count {
        grid-column: 1 / -1;
        min-height: 120px;
    }
    .section-heading {
        display: block;
    }
    .section-heading p {
        margin-top: 8px;
    }
    .site-footer {
        display: block;
    }
    .site-footer span {
        display: block;
        margin: 6px 0;
    }
    .formula {
        grid-template-columns: 1fr 28px 1fr;
    }
    .formula i {
        display: none;
    }
    .formula span:last-child {
        grid-column: 3;
    }
}

@media (max-width: 560px) {
    .content-container {
        width: calc(100% - 32px);
    }
    .site-nav a {
        min-width: 108px;
        padding: 0 13px;
    }
    .cell-bank {
        grid-template-columns: repeat(2, 1fr);
    }
    .shift-summary {
        grid-column: 1 / -1;
    }
    .alert-count {
        grid-column: 1 / -1;
    }
    .incident-row {
        grid-template-columns: 1fr;
    }
    .incident-row button {
        min-height: 54px;
    }
    .risk-scale {
        grid-template-columns: 1fr 1fr;
    }
    .lean-list article {
        grid-template-columns: 1fr;
        gap: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
