:root {
    --bg: #0f1115;
    --house: #1c1f24;
    --line: #2e343d;
    --gold: #c9a227;
    --grass: #2d4a22;
    --grass-line: #3f6b2f;
    --neon: #00ff88;
    --text: #f0f2f5;
    --muted: #8b949e;
    --panel: #16181b;
    --panel-2: #1c1f24;
    font-family: Manrope, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    overflow: auto;
}

button {
    font: inherit;
    color: inherit;
}

/* DASHBOARD GERAL */
.dashboard {
    min-height: 100vh;
    background: var(--bg);
}

.topbar {
    height: 72px;
    border-bottom: 1px solid var(--line);
    background: #121417f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: relative;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    width: 29px;
    height: 29px;
    border: 1px solid var(--gold);
    border-radius: 5px;
    display: grid;
    place-items: center;
    position: relative;
}

.brand-mark:before,
.brand-mark:after {
    content: "";
    position: absolute;
    background: var(--gold);
}

.brand-mark:before {
    width: 15px;
    height: 1px;
}

.brand-mark:after {
    height: 15px;
    width: 1px;
}

.brand-mark i {
    width: 6px;
    height: 6px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    z-index: 1;
}

.brand b {
    display: block;
    font-size: 13px;
    letter-spacing: .16em;
}

.brand small {
    display: block;
    color: var(--muted);
    font: 9px "DM Mono", monospace;
    letter-spacing: .1em;
    margin-top: 4px;
}

.top-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font: 10px "DM Mono", monospace;
    letter-spacing: .06em;
}

.pulse-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.2);
}

.divider {
    height: 17px;
    width: 1px;
    background: var(--line);
    margin: 0 7px;
}

.round-button {
    height: 26px;
    width: 26px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.mono {
    font-family: "DM Mono", monospace;
}

/* PANÉIS */
.dashboard-grid {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-content {
    display: flex;
    align-items: flex-start;
    width: calc(600px + 480px * var(--plant-scale, 1));
}

.control-panel,
.detail-panel {
    background: var(--panel);
    flex: 0 0 290px;
    margin-top: var(--panel-offset, 125px);
    padding: 25px 20px;
}

.control-panel {
    margin-top: calc(var(--panel-offset, 125px) - 15px * var(--plant-scale, 1));
    padding-top: 14px;
    border-right: 1px solid var(--line);
}

.control-panel .camera-feed {
    border-top: 0;
    padding-top: 0;
}

.detail-panel {
    border-left: 1px solid var(--line);
}

.kicker,
.section-label {
    font: 9px "DM Mono", monospace;
    color: var(--muted);
    letter-spacing: .13em;
}

.panel-intro h1 {
    font-size: 21px;
    letter-spacing: -.04em;
    margin: 8px 0 4px;
}

.panel-intro p {
    font-size: 10px;
    color: var(--muted);
    margin: 0;
}

.phase-card {
    margin: 23px 0;
    padding: 14px;
    background: #1c1f24;
    border: 1px solid #2e343d;
    border-radius: 6px;
    position: relative;
}

.phase-card span {
    font: 8px "DM Mono";
    color: var(--gold);
    letter-spacing: .12em;
}

.phase-card strong {
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

.phase-card>b {
    position: absolute;
    right: 13px;
    top: 12px;
    font: 22px "DM Mono";
    color: #f0f2f51f;
}

.phase-line {
    height: 2px;
    background: #f0f2f51a;
    margin-top: 13px;
}

.phase-line i {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gold);
}

.control-section {
    border-top: 1px solid var(--line);
    padding: 19px 0 16px;
}

.section-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-label em {
    font-style: normal;
    color: var(--gold);
}

/* LISTA DE CÂMERAS NO PAINEL */
.point-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 5px;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text);
    margin-bottom: 2px;
}

.point-link:hover,
.point-link.active {
    background: #f0f2f50a;
}

.point-link>span {
    min-width: 0;
    flex: 1;
}

.cam-icon {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 5px;
    background: #121417;
    color: var(--neon);
    font-style: normal;
    font-size: 12px;
}

.point-link b,
.point-link small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.point-link b {
    font-size: 10px;
}

.point-link small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
}

.point-link>strong {
    font: 9px "DM Mono";
    color: var(--gold);
}

/* SWITCHES */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    font-size: 10px;
    color: var(--text);
    cursor: pointer;
}

.switch-row span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-row input {
    position: absolute;
    opacity: 0;
}

.layer-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.layer-dot.cameras {
    background: var(--neon);
}

.layer-dot.focus {
    background: var(--gold);
    border-radius: 50%;
}

.switch {
    height: 15px;
    width: 28px;
    border-radius: 10px;
    background: #2e343d;
    position: relative;
}

.switch:after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    height: 11px;
    width: 11px;
    border-radius: 50%;
    background: var(--muted);
    transition: .2s;
}

.switch-row input:checked+.switch {
    background: #2e343d;
}

.switch-row input:checked+.switch:after {
    transform: translateX(13px);
    background: var(--neon);
}

/* WORKSPACE DO MAPA / ABAS */
.map-workspace {
    display: flex;
    flex: 0 0 calc(480px * var(--plant-scale, 1) + 20px);
    flex-direction: column;
    min-width: 500px;
    background: var(--bg);
    position: relative;
}

.workspace-head {
    width: calc(600px + 480px * var(--plant-scale, 1));
    min-height: 88px;
    padding: 20px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(110deg, var(--panel), #11181a);
    border: 1px solid var(--line);
    border-top: 2px solid #315747;
    border-radius: 0 0 10px 10px;
}

.workspace-heading .kicker {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .16em;
}

.workspace-head h1 {
    margin: 6px 0 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.04em;
}

.map-tools {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.map-tools button {
    min-height: 40px;
    padding: 0 22px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s;
}

.map-tools button:hover {
    background: #1c2529;
    color: var(--text);
}

.map-tools button.active-tab-btn {
    background: #1b2d26;
    color: #b6e8ce;
    border-color: #345e49;
}

.map-tools button:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 3px;
}

.map-viewport {
    flex: 1;
    position: relative;
    background: var(--bg);
}

/* CONTAINER DO MAPA */
#map-layer {
    display: flex;
    justify-content: center;
    padding: 30px 10px 70px;
}

/* ESTILO DA ABA DE DOCUMENTAÇÃO */
.docs-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 28px 0 50px;
    background: var(--bg);
}

.docs-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 35px;
}

.docs-container h2 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 5px;
    letter-spacing: -0.03em;
}

.docs-subtitle {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 18px;
}

.doc-section {
    margin-bottom: 30px;
}

.doc-section h3 {
    font-size: 14px;
    color: var(--neon);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-family: "DM Mono", monospace;
    letter-spacing: 0.05em;
}

.doc-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.comp-box {
    padding: 15px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
}

.comp-box.bad {
    background: rgba(255, 77, 77, 0.05);
    border: 1px solid rgba(255, 77, 77, 0.2);
    color: #ff9999;
}

.comp-box.good {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: #99ffcc;
}

.comp-box h4 {
    margin-bottom: 8px;
    font-size: 12px;
}

.comp-box ul {
    padding-left: 15px;
    color: var(--text);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 11px;
}

.docs-table th,
.docs-table td {
    border: 1px solid var(--line);
    padding: 10px;
    text-align: left;
}

.docs-table th {
    background: #121417;
    color: var(--text);
    font-family: "DM Mono", monospace;
}

.docs-table td {
    color: var(--muted);
}

.docs-table td strong {
    color: var(--text);
}

/* CSS ESTRUTURAL DO CONDOMÍNIO */
.regiao-container {
    width: 480px;
    flex-shrink: 0;
    zoom: var(--plant-scale, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.rua-superior-container {
    width: var(--street-width, 1080px);
    height: 80px;
    background-color: #16181b;
    color: #5b6773;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 2px;
    border-bottom: 4px solid #2f363d;
    border-top: 4px solid #2f363d;
}

.condominio-container {
    width: 480px;
    height: 1040px;
    background-color: #000000;
    border: 3px solid #4a545e;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: visible;
    position: relative;
}

.condominio-externo-container {
    width: 480px;
    height: 160px;
    background-color: #d9d9d9;
    border-bottom: 2px dashed #ff4d4d;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.s01,
.s02,
.guarita,
.portao,
.lixeiras,
.s03,
.s04 {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    border: 1px solid #7f8c8d;
}

.s01,
.s02,
.s03,
.s04 {
    width: 64px;
    background-color: #1e272e;
    color: #8c97a1;
    border: 1px solid #141a1f;
}

.guarita,
.lixeiras {
    width: 32px;
    background-color: #4a545e;
    color: #ffffff;
    writing-mode: vertical-rl;
}

.portao {
    width: 160px;
    background-color: #2c3e50;
    color: #f1c40f;
}

.condominio-interno-container {
    width: 480px;
    height: 880px;
    background-color: #2b2b2b;
    display: flex;
    flex-direction: column;
}

.condominio-interno-container-meio {
    width: 480px;
    height: 544px;
    display: flex;
    flex-direction: row;
    border-bottom: 2px dashed #ff4d4d;
}

.condominio-interno-container-esquerda {
    width: 144px;
    height: 544px;
    background-color: #13171a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-right: 1px solid #232a31;
}

.campinho {
    width: 144px;
    height: 48px;
    background-color: #1a422b;
    color: #4cd137;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    border: 1px solid #10291b;
}

.salao {
    width: 144px;
    height: 48px;
    background-color: #3b4248;
    color: #a5b1bc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    border: 1px solid #232a31;
}

.condominio-interno-container-alameda {
    width: 192px;
    height: 544px;
    background-color: #0f1115;
    color: #5c4e16;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    border-left: 2px dashed #2f363d;
    border-right: 2px dashed #2f363d;
}

.condominio-interno-container-direita {
    width: 144px;
    height: 544px;
    background-color: #13171a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-left: 1px solid #232a31;
}

.sobrado-lateral {
    width: 144px;
    height: 48px;
    background-color: #1e272e;
    color: #8c97a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    border: 1px solid #141a1f;
}

.condominio-interno-container-fundo {
    width: 480px;
    height: 336px;
    display: flex;
    flex-direction: column;
}

.condominio-interno-container-fundo-alameda {
    width: 480px;
    height: 192px;
    background-color: #0f1115;
    color: #5c4e16;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    border-bottom: 2px dashed #2f363d;
}

.condominio-interno-container-fundo-sobrados {
    width: 480px;
    height: 144px;
    display: flex;
    flex-direction: row;
}

.sobrado-fundo {
    width: 80px;
    height: 144px;
    background-color: #1e272e;
    color: #8c97a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    border: 1px solid #141a1f;
}

/* CÂMERAS E ANIMAÇÕES */
#cam-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.cam-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--neon);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon);
    transform: translate(-50%, -50%);
    z-index: 60;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s;
}

.cam-node::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 1px solid var(--neon);
    transition: all 0.2s;
}

.cam-node.pulse::before {
    animation: pulse 2s infinite;
}

.cam-label {
    position: absolute;
    color: var(--neon);
    font-size: 10px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    top: -15px;
    left: 10px;
    white-space: nowrap;
    pointer-events: none;
    transition: color 0.2s;
}

.cam-fov {
    position: absolute;
    background: radial-gradient(circle at 50% 0%, rgba(0, 255, 136, 0.35) 0%, rgba(0, 255, 136, 0.05) 65%, transparent 100%);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform-origin: 50% 0;
    z-index: 40;
    transition: background 0.2s;
    pointer-events: none;
}

/* Cobertura cruzada da fachada: feixes visíveis também sobre a rua. */
.cam-fov-front {
    background: linear-gradient(to bottom, rgba(0, 255, 136, 0.55), rgba(0, 255, 136, 0.18));
}

.cam-fov-front::after {
    content: "";
    position: absolute;
    top: 18px;
    left: calc(50% - 4px);
    width: 8px;
    height: 145px;
    background: var(--neon);
    clip-path: polygon(35% 0, 65% 0, 65% 88%, 100% 88%, 50% 100%, 0 88%, 35% 88%);
}

.cam-fov-front.selected {
    background: linear-gradient(to bottom, rgba(201, 162, 39, 0.7), rgba(201, 162, 39, 0.25));
}

.cam-fov-front.selected::after {
    background: var(--gold);
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.cam-node.selected {
    background-color: var(--gold);
    border-color: #fff;
    box-shadow: 0 0 14px var(--gold);
    z-index: 99;
}

.cam-node.selected::before {
    border-color: var(--gold);
    animation: pulse 1.5s infinite;
}

.cam-node.selected .cam-label {
    color: var(--gold);
    z-index: 99;
    font-size: 11px;
}

.cam-fov.selected {
    background: radial-gradient(circle at 50% 0%, rgba(201, 162, 39, 0.55) 0%, rgba(201, 162, 39, 0.05) 75%, transparent 100%);
    z-index: 45;
}

.map-legend {
    position: absolute;
    left: 18px;
    bottom: 17px;
    background: #1c1f24e8;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 9px 11px;
    display: flex;
    gap: 13px;
    color: var(--muted);
    font: 8px "DM Mono";
    z-index: 10;
}

.map-legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 4px;
}

.legend-camera {
    background: var(--neon);
}

.legend-phase {
    background: var(--gold);
}

.legend-wall {
    background: #8b949e;
}

.map-hint {
    position: absolute;
    right: 18px;
    bottom: 19px;
    color: var(--muted);
    font: 8px "DM Mono";
    letter-spacing: .07em;
    z-index: 10;
}

/* PAINEL DE DETALHES */
.detail-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    height: 61px;
    align-items: end;
}

.detail-tabs button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0 0 14px;
    font-size: 10px;
    cursor: pointer;
}

.detail-tabs button.active {
    color: var(--text);
    border-bottom: 2px solid var(--neon);
}

.detail-content {
    display: none;
    padding-top: 0;
}

.detail-content.active {
    display: block;
}

.detail-content h2 {
    font-size: 23px;
    letter-spacing: -0.05em;
    margin: 0 0 7px;
}

.detail-content p {
    font-size: 11px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 16px 0;
    padding: 6px 8px;
    border-radius: 4px;
    background: #121417;
    color: var(--neon);
    font: 8px "DM Mono";
}

.status-chip i {
    height: 5px;
    width: 5px;
    border-radius: 50%;
    background: var(--neon);
}

.zone-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 17px;
}

.zone-metrics div {
    padding: 10px 7px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.zone-metrics b,
.zone-metrics small {
    display: block;
}

.zone-metrics b {
    font: 11px "DM Mono";
    color: var(--neon);
}

.zone-metrics small {
    color: var(--muted);
    font-size: 8px;
    margin-top: 5px;
}

.photo-card {
    border: 1px solid var(--line);
    border-radius: 5px;
    overflow: hidden;
    background: var(--panel-2);
    margin-bottom: 12px;
}

.photo-card img {
    width: 100%;
    height: 125px;
    object-fit: cover;
    display: block;
    filter: grayscale(.25) contrast(1.05);
}

.photo-card div {
    padding: 9px 10px;
}

.photo-card span {
    display: block;
    color: var(--muted);
    font: 8px "DM Mono";
    letter-spacing: .1em;
}

.photo-card b {
    display: block;
    font-size: 10px;
    margin-top: 5px;
}
/* Apresentação do projeto ocupa também o espaço dos painéis da planta. */
.project-view .control-panel,
.project-view .detail-panel {
    display: none;
}

.project-view .map-workspace {
    flex: 1;
    min-width: 0;
}

.project-intro > p:last-child,
.project-steps {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.project-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 28px 0 36px;
}

.project-summary > div {
    padding: 20px;
    background: #15211c;
    border: 1px solid #2a4035;
    border-radius: 8px;
}

.project-summary strong,
.project-summary span {
    display: block;
}

.project-summary strong {
    color: #b6e8ce;
    font-size: 18px;
    margin-bottom: 10px;
}

.project-summary span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.coverage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.coverage-grid article {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.coverage-grid h4 {
    margin: 0 0 8px;
    font-size: 15px;
}

.coverage-grid p {
    margin: 0;
}

.project-steps {
    padding-left: 24px;
}

.project-steps li {
    padding: 6px 0;
}

.project-steps strong {
    color: var(--text);
}

.project-next {
    margin-bottom: 0;
}

.doc-section a {
    color: #b6e8ce;
    text-underline-offset: 4px;
}

.doc-section a:hover {
    color: var(--neon);
}

.materials-heading {
    margin: 28px 0 12px;
    font-size: 17px;
    color: var(--text);
}

.materials-table-wrap {
    overflow-x: auto;
}

.materials-table-wrap .docs-table {
    font-size: 13px;
    line-height: 1.6;
}

.materials-table-wrap td:first-child {
    width: 21%;
    color: var(--text);
    font-weight: 600;
}

.materials-table-wrap td:nth-child(2) {
    width: 16%;
}

.materials-table-wrap td:last-child {
    width: 15%;
    color: #b6e8ce;
}

.materials-table-wrap td {
    vertical-align: top;
}

.network-flow {
    padding: 20px;
    margin: 18px 0;
    border: 1px solid #2a4035;
    border-radius: 8px;
    background: #15211c;
    color: #b6e8ce;
    font-size: 14px;
    line-height: 1.9;
}

/* Orçamento online: ofertas, provisões e serviços separados. */
.budget-container {
    background: transparent;
    border: 0;
    padding: 0;
}

.budget-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(120deg, var(--panel), #122019);
}

.budget-intro h2 {
    margin: 10px 0;
    font-size: 30px;
}

.budget-intro p,
.budget-section-heading p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.budget-date {
    flex: 0 0 190px;
    padding: 16px;
    border: 1px solid #345e49;
    border-radius: 8px;
    background: #13221b;
}

.budget-date span,
.budget-date time,
.budget-date small {
    display: block;
}

.budget-date span {
    color: var(--muted);
    font-size: 11px;
}

.budget-date time {
    margin: 6px 0 9px;
    color: #b6e8ce;
    font-size: 21px;
    font-weight: 600;
}

.budget-date small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.budget-notice,
.budget-scenario-note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin: 18px 0;
}

.budget-notice {
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.budget-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 26px;
}

.budget-controls label {
    flex: 1;
    min-width: 270px;
    color: var(--muted);
    font-size: 12px;
}

.budget-controls select {
    display: block;
    width: 100%;
    min-height: 46px;
    margin-top: 8px;
    padding: 0 12px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.budget-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0 40px;
}

.budget-overview > div {
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.budget-overview span,
.budget-overview strong,
.budget-overview small {
    display: block;
}

.budget-overview span {
    font-size: 12px;
    color: var(--muted);
}

.budget-overview strong {
    font-size: 23px;
    line-height: 1.5;
    letter-spacing: -.04em;
    margin: 12px 0;
}

.budget-overview small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.budget-overview .budget-overview-main {
    border-color: #345e49;
    background: #15251c;
}

.budget-overview-main strong {
    color: #b6e8ce;
}

.budget-section {
    margin: 36px 0;
}

.budget-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.budget-section-heading > span {
    padding: 8px 10px;
    background: #1b2d26;
    border: 1px solid #345e49;
    border-radius: 7px;
    color: #b6e8ce;
    font: 12px "DM Mono", monospace;
}

.budget-section-heading h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 600;
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.budget-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.budget-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.budget-badge {
    padding: 4px 7px;
    border-radius: 4px;
    background: #202a27;
    color: #b6e8ce;
}

.budget-card h4 {
    font-size: 17px;
    line-height: 1.4;
    margin: 18px 0 10px;
}

.budget-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 20px;
    flex: 1;
}

.budget-unit,
.budget-item-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.budget-unit {
    font-size: 12px;
    color: var(--muted);
}

.budget-unit b {
    color: var(--text);
    font-weight: 500;
}

.budget-item-total {
    margin: 12px 0 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.budget-item-total strong {
    color: var(--text);
    font-size: 17px;
}

.budget-shop,
.budget-access a {
    color: #b6e8ce;
    font-size: 12px;
    line-height: 1.6;
    text-decoration: none;
}

.budget-shop:hover,
.budget-access a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.budget-unquoted {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.budget-card-optional {
    border-style: dashed;
}

.budget-card-included {
    border-color: #477459;
    border-style: solid;
    background: #17221b;
}

.budget-include {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.budget-include input {
    accent-color: #83cfa5;
    width: 17px;
    height: 17px;
}

.budget-services {
    font-size: 14px;
    line-height: 1.6;
}

.budget-services td:first-child {
    width: 70%;
}

.budget-services strong,
.budget-services small {
    display: block;
}

.budget-services strong {
    color: var(--text);
    font-weight: 500;
}

.budget-services small {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.budget-services tfoot td {
    background: #15251c;
    color: #b6e8ce;
    font-weight: 600;
}

.budget-service-profiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.budget-service-profiles article,
.budget-access {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.budget-service-profiles h4 {
    margin: 0 0 14px;
    font-size: 16px;
}

.budget-service-profiles strong {
    color: #b6e8ce;
    font-size: 21px;
}

.budget-service-profiles p,
.budget-access > p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.budget-access a {
    display: inline-block;
    margin: 8px 18px 0 0;
}

.budget-controls select:focus-visible,
.budget-include input:focus-visible,
.budget-shop:focus-visible {
    outline: 2px solid #83cfa5;
    outline-offset: 3px;
}

.project-recording-note {
    margin: 20px 0;
    padding: 22px;
    border: 1px solid #345e49;
    border-radius: 8px;
    background: #15251c;
}

.project-recording-note > strong {
    color: #b6e8ce;
    font-size: 16px;
}

.contract-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 24px;
}

.contract-intro .docs-subtitle {
    margin-bottom: 0;
}

.contract-print {
    padding: 11px 16px;
    border: 1px solid #345e49;
    border-radius: 6px;
    background: #15251c;
    color: #b6e8ce;
    font: inherit;
    cursor: pointer;
}

.contract-print:hover {
    background: #213b2d;
}

.contract-print:focus-visible {
    outline: 2px solid #83cfa5;
    outline-offset: 3px;
}

.contract-notice {
    padding: 18px 20px;
    margin-bottom: 20px;
    border-left: 3px solid #83cfa5;
    background: #15251c;
    color: #b6e8ce;
    line-height: 1.7;
    font-size: 13px;
}

.contract-notice p {
    color: var(--muted);
    margin-top: 8px;
}

.contract-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.contract-summary span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-size: 12px;
}

.contract-clause p + p {
    margin-top: 14px;
}

.contract-clause p > strong {
    color: var(--text);
    margin-right: 6px;
}

.contract-references {
    border-top: 1px solid var(--line);
    padding-top: 22px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.contract-references a {
    display: inline-block;
    margin: 10px 16px 0 0;
    color: #b6e8ce;
}

@media print {
    @page {
        margin: 18mm;
    }

    body:has(.contract-view) {
        background: white;
        color: black;
    }

    body:has(.contract-view) .dashboard,
    .dashboard-grid.contract-view,
    .contract-view .dashboard-content,
    .contract-view .map-workspace,
    .contract-view #contract-viewport,
    .contract-view .contract-container {
        display: block !important;
        width: auto !important;
        max-width: none;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        margin: 0;
        padding: 0;
        border: 0;
        background: white;
        box-shadow: none;
    }

    .contract-view .workspace-head,
    .contract-view .control-panel,
    .contract-view .detail-panel,
    .contract-view #map-viewport,
    .contract-view #docs-viewport,
    .contract-view #budget-viewport,
    .contract-view .contract-print,
    .contract-view .contract-summary {
        display: none !important;
    }

    .contract-view .contract-container * {
        color: black !important;
        background: transparent !important;
        font-family: Arial, sans-serif;
    }

    .contract-view .contract-clause h3 {
        break-after: avoid;
        font-size: 12pt;
        letter-spacing: normal;
    }

    .contract-view .contract-clause p {
        font-size: 10pt;
        line-height: 1.5;
        orphans: 3;
        widows: 3;
    }

    .contract-view .contract-notice {
        border-color: #555;
    }
}
