:root {
    --ink: #0f1f1c;
    --paper: #f8f9fa;
    --rose: #c9ada7;
    --leaf: #4a7c59;
    --line: rgba(15, 31, 28, 0.16);
    --muted: rgba(15, 31, 28, 0.62);
    --cream: #efe8df;
    --blue: #284d63;
    --shadow: 0 18px 50px rgba(15, 31, 28, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--paper);
    color: var(--ink);
    font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
}

body {
    margin: 0;
    min-width: 320px;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100vh;
}

.rail {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-height: 100vh;
    padding: 24px 18px;
    background: var(--ink);
    color: var(--paper);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}

.brand img {
    flex: 0 0 auto;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-item {
    min-height: 44px;
    border: 1px solid rgba(248, 249, 250, 0.12);
    background: transparent;
    color: rgba(248, 249, 250, 0.72);
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    letter-spacing: 0;
}

.nav-item.is-active,
.nav-item:hover {
    background: var(--paper);
    color: var(--ink);
}

.rail-note {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(248, 249, 250, 0.18);
    padding-top: 18px;
    color: rgba(248, 249, 250, 0.7);
}

.rail-note strong {
    color: var(--rose);
}

.workspace {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    gap: 24px;
    align-items: end;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.eyebrow,
.metric-block span,
.section-head span,
.offer-fields dt,
.version-item em,
.timeline-row span,
.timeline-row em,
.calendar-slot span,
.report-row span {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 860px;
    margin-bottom: 0;
    font-size: clamp(32px, 5vw, 62px);
    line-height: 0.96;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 24px;
    line-height: 1.1;
}

h3 {
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.2;
}

.search {
    display: grid;
    gap: 8px;
}

.search label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

.search input:focus {
    border-color: var(--leaf);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.16);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 24px 0;
    background: var(--line);
    border: 1px solid var(--line);
}

.metric-block {
    min-height: 104px;
    background: #fff;
    padding: 16px;
}

.metric-block strong {
    display: block;
    margin-top: 12px;
    font-size: 36px;
    line-height: 1;
}

.screen {
    display: none;
}

.screen.is-visible {
    display: block;
    animation: rise 220ms ease-out;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 42vw);
    gap: 24px;
    align-items: start;
}

.timeline-pane,
.detail-sheet,
.report-panel {
    min-width: 0;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.ghost-btn,
.solid-btn {
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 9px 13px;
}

.ghost-btn {
    background: #fff;
    color: var(--ink);
}

.solid-btn {
    background: var(--leaf);
    border-color: var(--leaf);
    color: #fff;
}

.stage-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: #fff;
    margin-bottom: 18px;
}

.stage-node {
    display: grid;
    gap: 6px;
    min-height: 118px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    padding: 14px;
    text-align: left;
    transition: background 160ms ease, transform 160ms ease;
}

.stage-node:last-child {
    border-right: 0;
}

.stage-node:hover {
    background: var(--cream);
    transform: translateY(-2px);
}

.stage-node span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
}

.stage-node strong {
    font-size: 17px;
}

.stage-node em {
    color: var(--leaf);
    font-style: normal;
}

.timeline {
    display: grid;
    gap: 10px;
}

.timeline-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 86px;
    gap: 12px;
    align-items: center;
    min-height: 68px;
    width: 100%;
    border: 1px solid var(--line);
    border-left: 4px solid var(--rose);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 12px;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.timeline-row:hover {
    border-color: rgba(74, 124, 89, 0.5);
    box-shadow: var(--shadow);
}

.timeline-row strong {
    overflow-wrap: anywhere;
}

.offer-focus {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
    box-shadow: var(--shadow);
}

.offer-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.offer-head strong {
    color: var(--leaf);
    font-size: 22px;
    white-space: nowrap;
}

.status {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--ink);
    font-size: 12px;
}

.offer-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
}

.offer-fields div {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.offer-fields dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.version-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.version-item,
.decision-card,
.appointment-row,
.calendar-slot,
.report-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.version-item {
    padding: 14px;
}

.version-item span {
    color: var(--blue);
    font-weight: 800;
}

.version-item strong {
    display: block;
    margin: 8px 0;
}

.version-item p,
.report-row p {
    margin-bottom: 8px;
    color: var(--muted);
    line-height: 1.55;
}

.decision-grid {
    display: grid;
    gap: 12px;
}

.decision-card {
    padding: 14px;
}

.decision-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.decision-title span {
    color: var(--leaf);
    font-size: 12px;
    text-transform: uppercase;
}

.vote-bar {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--rose);
    margin: 12px 0;
}

.vote-bar i {
    display: block;
    height: 100%;
    background: var(--leaf);
    transition: width 220ms ease;
}

.vote-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.vote-actions button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    padding: 8px 10px;
    overflow-wrap: anywhere;
}

.appointment-grid,
.calendar-list,
.report-layout {
    display: grid;
    gap: 12px;
}

.appointment-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) 96px;
    gap: 14px;
    align-items: center;
    min-height: 78px;
    padding: 14px;
}

.appointment-row > span,
.calendar-slot time {
    color: var(--blue);
    font-weight: 800;
}

.appointment-row em,
.calendar-slot em {
    display: block;
    color: var(--muted);
    font-style: normal;
}

.appointment-row mark {
    border-radius: 999px;
    background: var(--cream);
    color: var(--ink);
    padding: 7px 10px;
    text-align: center;
}

.calendar-slot {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 120px;
    gap: 14px;
    align-items: center;
    min-height: 72px;
    padding: 14px;
}

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

.report-panel {
    border-top: 3px solid var(--ink);
    padding-top: 14px;
}

.report-row {
    padding: 14px;
    margin-bottom: 10px;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    max-width: min(360px, calc(100vw - 36px));
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    padding: 12px 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .rail {
        position: sticky;
        top: 0;
        z-index: 5;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding: 12px;
    }

    .nav {
        display: flex;
        min-width: max-content;
    }

    .rail-note {
        display: none;
    }

    .split,
    .topbar,
    .report-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .workspace {
        padding: 18px 14px 28px;
    }

    h1 {
        font-size: 34px;
        line-height: 1;
    }

    .metrics,
    .stage-track,
    .version-strip,
    .vote-actions,
    .offer-fields {
        grid-template-columns: 1fr;
    }

    .stage-node,
    .metric-block {
        min-height: auto;
    }

    .timeline-row,
    .appointment-row,
    .calendar-slot {
        grid-template-columns: 1fr;
    }

    .offer-head,
    .section-head,
    .decision-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .offer-head strong {
        white-space: normal;
    }
}
