:root {
    --ink: #0f1f1c;
    --paper: #f8f9fa;
    --rose: #c9ada7;
    --green: #4a7c59;
    --line: rgba(15, 31, 28, 0.14);
    --muted: rgba(15, 31, 28, 0.62);
    --white: #ffffff;
    --gold: #d7b45f;
    --blue: #315c6b;
    --shadow: 0 24px 70px rgba(15, 31, 28, 0.12);
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(90deg, rgba(15, 31, 28, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(15, 31, 28, 0.035) 1px, transparent 1px),
        var(--paper);
    background-size: 44px 44px;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.rail {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 24px 18px;
    background: var(--ink);
    color: var(--paper);
}

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

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

.nav button,
.ghost-button,
.primary-button,
.vote-options button {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0 14px;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav button {
    width: 100%;
    background: transparent;
    color: rgba(248, 249, 250, 0.68);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0;
}

.nav button:hover,
.nav button.is-active {
    background: rgba(248, 249, 250, 0.1);
    color: var(--paper);
}

.source-box {
    margin-top: auto;
    border-top: 1px solid rgba(248, 249, 250, 0.18);
    padding-top: 18px;
}

.source-box span,
.eyebrow,
.section-title span,
small,
dt {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.rail .source-box span {
    color: rgba(248, 249, 250, 0.55);
}

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

.topline {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: clamp(38px, 6vw, 72px);
    line-height: 0.9;
}

h2 {
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1;
}

.top-actions {
    display: flex;
    align-items: end;
    gap: 10px;
}

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

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

.search input {
    width: min(260px, 42vw);
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
}

.ghost-button {
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--line);
    color: var(--ink);
}

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

.ghost-button:hover,
.primary-button:hover,
.vote-options button:hover,
.case-row:hover {
    transform: translateY(-1px);
}

.screen {
    display: none;
    animation: rise 260ms ease both;
}

.screen.is-active {
    display: block;
}

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

.split-dashboard,
.detail-grid,
.report-grid {
    display: grid;
    grid-template-columns: minmax(270px, 0.78fr) minmax(380px, 1.22fr);
    gap: 18px;
}

.timeline-pane,
.active-card,
.sheet,
.inspector {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
}

.timeline-pane,
.active-card,
.sheet {
    padding: 20px;
}

.section-title,
.case-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.workflow-map {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.workflow-step {
    min-height: 104px;
    border-left: 4px solid var(--rose);
    background: rgba(201, 173, 167, 0.18);
    padding: 12px 10px;
}

.workflow-step strong,
.workflow-step small {
    display: block;
}

.workflow-step span {
    display: block;
    margin-bottom: 14px;
    color: var(--green);
    font-weight: 800;
}

.case-list {
    display: grid;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
    padding-right: 2px;
}

.case-row {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: rgba(248, 249, 250, 0.9);
    color: var(--ink);
    text-align: left;
}

.case-row.is-selected {
    border-color: rgba(74, 124, 89, 0.7);
    background: rgba(74, 124, 89, 0.1);
}

.case-row span,
.vote-card span,
.vendor-strip span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.case-row strong,
.task-row strong,
.calendar-row strong,
.vote-card strong,
.vendor-strip strong {
    overflow-wrap: anywhere;
}

.active-card {
    min-height: 560px;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(145deg, rgba(15, 31, 28, 0.96), rgba(15, 31, 28, 0.88)),
        var(--ink);
    color: var(--paper);
    overflow: hidden;
    position: relative;
}

.active-card::after {
    content: "";
    position: absolute;
    right: -50px;
    bottom: -70px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(201, 173, 167, 0.55);
    transform: rotate(29deg);
}

.active-card > * {
    position: relative;
    z-index: 1;
}

.active-card .eyebrow,
.active-card small {
    color: rgba(248, 249, 250, 0.6);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border-radius: 999px;
    padding: 0 12px;
    background: var(--rose);
    color: var(--ink);
    white-space: nowrap;
}

.case-body {
    max-width: 620px;
    margin: 34px 0 auto;
    color: rgba(248, 249, 250, 0.82);
    font-family: Arial, sans-serif;
    font-size: clamp(18px, 2.5vw, 28px);
    line-height: 1.55;
}

.score-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.score-block {
    border-top: 1px solid rgba(248, 249, 250, 0.22);
    padding-top: 12px;
}

.score-block span {
    display: block;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 800;
}

.progress-line {
    height: 8px;
    margin-top: 18px;
    border-radius: 99px;
    background: rgba(248, 249, 250, 0.12);
    overflow: hidden;
}

.progress-line span {
    display: block;
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg, var(--green), var(--gold));
    transition: width 260ms ease;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

dd {
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.task-list,
.calendar-list,
.vote-list,
.insights,
.vendor-strip {
    display: grid;
    gap: 10px;
}

.task-row,
.calendar-row,
.vote-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(248, 249, 250, 0.74);
}

.task-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.task-row small,
.calendar-row small {
    display: block;
    margin-top: 4px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
}

.status-blocked {
    background: #9d3d3d;
}

.status-review {
    background: var(--gold);
}

.status-done {
    background: var(--blue);
}

.calendar-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 110px;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.calendar-row time {
    color: var(--green);
    font-weight: 800;
}

.calendar-row > span {
    justify-self: end;
    color: var(--blue);
}

.report-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.report-metric {
    min-height: 118px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: rgba(74, 124, 89, 0.08);
}

.report-metric span,
.report-metric strong {
    display: block;
}

.report-metric strong {
    margin-top: 20px;
    font-size: 34px;
}

.vote-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.vote-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(15, 31, 28, 0.12);
}

.vote-bar i {
    display: block;
    height: 100%;
    background: var(--green);
}

.vote-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.vote-options button {
    background: var(--white);
    border-color: var(--line);
    color: var(--ink);
}

.inspector {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    padding: 24px;
    background: #ffffff;
}

.atlas-mark {
    width: 76px;
    height: 76px;
}

.atlas-mark img {
    width: 100%;
    height: 100%;
}

.gauge {
    display: grid;
    place-items: center;
    width: 170px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 18px solid rgba(74, 124, 89, 0.22);
    box-shadow: inset 0 0 0 1px var(--line);
}

.gauge span {
    display: block;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
}

.gauge small {
    display: block;
}

.insights p,
.vendor-strip article {
    margin: 0;
    border-left: 3px solid var(--rose);
    padding: 10px 0 10px 12px;
    font-family: Arial, sans-serif;
    line-height: 1.45;
}

.vendor-strip article {
    display: grid;
    gap: 3px;
    background: rgba(201, 173, 167, 0.13);
}

.empty {
    color: var(--muted);
    font-family: Arial, sans-serif;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .inspector {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 90px 1fr 170px;
        align-items: center;
    }
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

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

    .brand {
        min-width: 150px;
    }

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

    .nav button {
        width: auto;
    }

    .source-box {
        display: none;
    }

    .workspace {
        padding: 16px;
    }

    .topline,
    .top-actions,
    .split-dashboard,
    .detail-grid,
    .report-grid,
    .score-row,
    .workflow-map,
    .inspector {
        display: grid;
        grid-template-columns: 1fr;
    }

    .search input {
        width: 100%;
    }

    .active-card {
        min-height: 520px;
    }

    .detail-list div,
    .calendar-row,
    .vote-options {
        grid-template-columns: 1fr;
    }

    .calendar-row > span {
        justify-self: start;
    }
}
