:root {
    font-family: Inter, Segoe UI, Arial, sans-serif;
    color: #213d4c;
    background: #eef3f5;
    font-synthesis: none;
    --ink: #15394c;
    --accent: #187f70;
    --line: #dce6eb
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

button,
input {
    font: inherit
}

button,
a,
input {
    outline-offset: 4px
}

button {
    cursor: pointer;
    border-radius: 7px;
    border: 1px solid transparent;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s
}

button:disabled {
    opacity: .45;
    cursor: not-allowed
}

a {
    color: var(--accent);
    text-decoration: none
}

button.primary {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 2px 3px #15394c15
}

.primary:hover:not(:disabled) {
    background: #205b72
}

.outline {
    background: white;
    border-color: #b7cdd5;
    color: var(--ink)
}

.outline:hover:not(:disabled) {
    background: #f0f6f7
}

.quiet {
    background: #f0f5f7;
    color: #375564;
    font-weight: 500
}

.full {
    width: 100%
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    border: 1px solid #46715f;
    color: #b6e2bf;
    border-radius: 10px;
    width: 60px;
    height: 60px;
    font: 600 24px Georgia, serif
}

.brand-mark.small {
    width: 33px;
    height: 33px;
    color: var(--ink);
    border-color: #ccdce2;
    font-size: 16px;
    border-radius: 7px
}

.eyebrow,
.section-label {
    font-size: 10px;
    letter-spacing: .14em;
    font-weight: 650
}

.section-label {
    color: #6d8793
}

.muted {
    color: #7d919a
}

.welcome {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(ellipse at 75% 25%, #d3e7e6, transparent 55%), #eef3f5
}

.welcome-card {
    background: #163d4b;
    color: white;
    border-radius: 18px;
    padding: 56px;
    box-shadow: 0 30px 80px #1b4b5628;
    width: min(520px, 90vw)
}

.welcome-card h1 {
    font: 400 54px/1.05 Georgia, serif;
    margin: 20px 0
}

.welcome-card p {
    color: #b4ced1;
    line-height: 1.6
}

.welcome-card .eyebrow {
    margin-top: 30px
}

.welcome-card button {
    margin: 24px 0;
    display: flex;
    gap: 36px;
    background: #e3f0e5;
    color: #15394c
}

.welcome-card small {
    display: block;
    color: #90acb5;
    font-size: 11px
}

header {
    height: 66px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    border-bottom: 1px solid var(--line)
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 13px
}

.brand strong {
    letter-spacing: .08em;
    font-size: 12px
}

.brand em {
    font-style: normal;
    color: #8aa2ad;
    margin-left: 4px
}

.divider {
    height: 22px;
    width: 1px;
    background: var(--line);
    margin: 0 5px
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #718c97
}

.header-right a {
    margin-left: 20px
}

.local-dot,
.status-dot {
    height: 6px;
    width: 6px;
    background: #259d7c;
    display: inline-block;
    border-radius: 50%
}

.layout {
    display: grid;
    grid-template-columns: 238px minmax(320px, 1fr) 318px;
    height: calc(100vh - 99px);
    min-height: 650px
}

.navigator {
    background: #f8fafb;
    border-right: 1px solid var(--line);
    padding: 28px 21px;
    display: flex;
    flex-direction: column
}

.navigator h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 14px 0 5px
}

.navigator>.muted {
    font-size: 11px;
    margin: 0 0 35px
}

.tree-title {
    font-size: 10px;
    color: #8298a2;
    display: flex;
    justify-content: space-between;
    letter-spacing: .08em;
    margin-bottom: 16px
}

.tree-title span {
    font-size: 10px;
    letter-spacing: 0
}

.tree-level {
    font-size: 12px;
    padding: 8px 0;
    display: flex;
    justify-content: space-between
}

.tree-level span {
    font-size: 10px;
    color: #8298a2
}

.object-list {
    margin: 8px 0 16px;
    max-height: 35vh;
    overflow: auto
}

.object-list button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: #69818e;
    font-size: 12px;
    font-weight: 400;
    margin: 4px 0;
    padding: 10px
}

.object-list button.selected {
    background: #e4eff0;
    color: #1d7265;
    box-shadow: inset 3px 0 #218d78
}

.object-list button span {
    float: right;
    font-size: 10px;
    color: #849ba4
}

.nav-bottom {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid var(--line);
    line-height: 1.7
}

.nav-bottom p {
    font-size: 12px;
    margin: 10px 0
}

.nav-bottom small {
    font-size: 10px;
    color: #8298a2
}

.model-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #eef3f5
}

.model-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    height: 66px;
    border-bottom: 1px solid #e2eaee;
    background: #f5f8f9
}

.revision {
    font-size: 11px;
    color: #65808e;
    margin-left: 14px;
    border: 1px solid #cfdee5;
    padding: 4px 7px;
    border-radius: 4px
}

.view-controls {
    display: flex;
    gap: 8px
}

.quiet {
    font-size: 11px;
    padding: 7px 10px
}

.canvas-wrap {
    position: relative;
    flex: 1;
    min-height: 300px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 30%, #f9fbfc, #eaf1f4)
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none
}

.empty-model {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center
}

.empty-icon {
    font-size: 58px;
    color: #9db8c0;
    line-height: 1
}

.empty-model h2 {
    font: 400 29px Georgia, serif;
    margin: 18px 0 0
}

.empty-model p {
    font-size: 12px;
    color: #7c959f;
    line-height: 1.8
}

.empty-model button {
    margin-top: 12px
}

.canvas-hint {
    position: absolute;
    bottom: 20px;
    left: 22px;
    font-size: 10px;
    color: #8aa0aa;
    pointer-events: none
}

.canvas-hint span {
    margin: 0 7px
}

.axis-label {
    position: absolute;
    bottom: 20px;
    right: 22px;
    color: #73949e;
    font-size: 10px
}

.axis-label span {
    margin: 0 10px
}

.activity {
    height: 142px;
    flex-shrink: 0;
    background: #fafcfd;
    border-top: 1px solid var(--line);
    padding: 17px 21px;
    overflow: auto
}

.activity-heading {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px
}

.activity-heading>span:last-child {
    font-size: 10px;
    color: #529380
}

#activity-list {
    font-size: 11px;
    color: #6e8793;
    line-height: 1.75
}

#activity-list p {
    margin: 3px 0
}

.inspector {
    background: #fff;
    border-left: 1px solid var(--line);
    overflow: auto
}

.inspector section {
    padding: 25px 23px;
    border-bottom: 1px solid var(--line)
}

.inspector h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 7px
}

.inspector p.muted {
    font-size: 11px;
    line-height: 1.7;
    margin: 0 0 18px
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px
}

label {
    font-size: 11px;
    color: #6a8490;
    display: block
}

label span {
    float: right;
    color: #9bb0b8;
    font-size: 10px
}

input {
    display: block;
    width: 100%;
    min-width: 0;
    margin-top: 7px;
    padding: 9px;
    border: 1px solid #d3e0e5;
    border-radius: 5px;
    color: #213e4d;
    background: #fcfdfd;
    font-size: 13px
}

input:focus {
    border-color: #218d78;
    outline: 2px solid #218d781a
}

.quantity {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin: 20px 0;
    color: #8197a1
}

.quantity strong {
    font-size: 12px;
    color: #355b68
}

.fine {
    font-size: 9px;
    color: #98aab2;
    line-height: 1.7;
    margin: 12px 0 0
}

.agent-panel {
    background: #f9fcfb
}

.agent-panel h2 {
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 21px
}

.agent-input {
    margin: 15px 0
}

.proposal-header {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin-top: 22px;
    font-size: 11px
}

.proposal-header strong {
    color: #20806b
}

.proposal-header span {
    color: #8ba2aa
}

#proposal-detail {
    font-size: 12px;
    line-height: 1.65;
    color: #446575
}

.proposal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

#proposal-card small {
    font-size: 10px;
    line-height: 1.7;
    color: #8a9da4;
    display: block;
    margin-top: 12px
}

.warning {
    font-size: 11px;
    line-height: 1.6;
    color: #9b6e2d;
    background: #fff6e6;
    padding: 10px;
    border-radius: 5px
}

.inspector-footer {
    padding: 20px 23px;
    color: #839ba5;
    font-size: 10px
}

.inspector-footer .status-dot {
    margin-right: 5px
}

footer {
    height: 33px;
    background: #fff;
    border-top: 1px solid var(--line);
    font-size: 10px;
    color: #7a939e;
    display: flex;
    justify-content: space-between;
    padding: 9px 25px
}

footer .muted {
    margin-left: 12px
}

.notice {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 7px;
    padding: 13px 20px;
    background: #173c4c;
    color: #eef8f8;
    font-size: 12px;
    box-shadow: 0 8px 30px #173c4c33;
    max-width: 80vw;
    z-index: 10
}

.notice.error {
    background: #854d38
}

[hidden] {
    display: none !important
}

@media(max-width:1100px) {
    .layout {
        grid-template-columns: 185px minmax(300px, 1fr) 280px
    }

    .navigator {
        padding: 25px 15px
    }

    .inspector section {
        padding: 23px 18px
    }

    .brand #project-name {
        display: none
    }
}

@media(max-width:800px) {
    .layout {
        height: auto;
        grid-template-columns: 1fr
    }

    .navigator {
        display: none
    }

    .model-area {
        height: 62vh;
        min-height: 470px
    }

    .inspector {
        display: grid;
        grid-template-columns: 1fr 1fr;
        border-left: 0;
        border-top: 1px solid var(--line)
    }

    .inspector-footer {
        grid-column: 1/-1
    }

    header {
        padding: 0 16px
    }

    .header-right>span:not(.local-dot) {
        display: none
    }

    .header-right a {
        margin-left: 7px
    }

    .model-toolbar {
        padding: 12px
    }

    .section-label {
        letter-spacing: .08em
    }

    .revision {
        margin-left: 6px
    }

    .view-controls {
        gap: 3px
    }

    .quiet {
        padding: 7px
    }

    .activity {
        height: 105px
    }

    .canvas-hint {
        left: 12px;
        font-size: 9px
    }

    .axis-label {
        right: 12px
    }

    footer {
        padding: 9px 12px
    }

    #receipt-label {
        max-width: 50%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis
    }
}

@media(max-width:480px) {
    .inspector {
        grid-template-columns: 1fr
    }

    .model-toolbar .section-label {
        display: none
    }

    .welcome-card {
        padding: 35px
    }

    .welcome-card h1 {
        font-size: 45px
    }

    .brand {
        gap: 9px
    }

    .brand .divider {
        display: none
    }
}
/* Central agent chat */
.agent-chat h2{font-family:Georgia,serif;font-weight:400;font-size:21px}
.agent-messages{max-height:280px;overflow:auto;display:flex;flex-direction:column;gap:8px;margin:12px 0;padding:4px 0}
.agent-msg{padding:9px 12px;border-radius:14px;font-size:13px;line-height:1.5;max-width:92%;white-space:pre-wrap;word-break:break-word}
.agent-msg.user{align-self:flex-end;background:#1c2b31;color:#fff;border-bottom-right-radius:4px}
.agent-msg.assistant{align-self:flex-start;background:#e9f1f0;color:#1c2b31;border-bottom-left-radius:4px}
.agent-tool{align-self:stretch;border:1px solid #c9d8d6;border-radius:10px;padding:8px 10px;font-size:12px;background:#f3f8f7}
.agent-tool strong{display:block;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:#4d6a70}
.agent-tool p{margin:4px 0 6px;color:#1c2b31}
.agent-tool.proposed{border-color:#d9b65b}
.agent-tool.rejected{border-color:#c0645a;background:#fbf1ef}
#agent-form textarea{width:100%;box-sizing:border-box;resize:vertical;font:inherit;font-size:13px;padding:9px 11px;border:1px solid #c9d8d6;border-radius:10px;margin-bottom:8px}
#agent-status.error{color:#b23b30}
.agent-tool.committed{border-color:#7fa98f;opacity:.75}
#agent-commit-all{margin:4px 0 10px}
.agent-ai{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;margin:4px 0 8px}
.agent-ai span{flex:1 1 100%}
.agent-sub{display:flex;flex-direction:column;gap:6px;margin:6px 0 10px;padding:10px;border:1px solid #c9d8d6;border-radius:10px}
.agent-sub input[type=text],.agent-sub input[type=password],.agent-sub input[type=number],.agent-sub select,.agent-sub textarea{font:inherit;font-size:12px;padding:7px 9px;border:1px solid #c9d8d6;border-radius:8px;box-sizing:border-box;width:100%}
.agent-row{display:flex;gap:6px}
.agent-check{font-size:12px;display:flex;align-items:center;gap:4px}
.agent-token textarea{font-family:ui-monospace,Menlo,monospace;font-size:11px}
.agent-delegate{display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:11px;padding:4px 0;border-top:1px solid #c9d8d6}
.agent-delegate.revoked{opacity:.55}
.agent-check input{width:auto!important;flex:0 0 auto;margin:0}
.agent-check span{flex:1}
.agent-plan{border:1px solid #c9d8d6;border-radius:10px;padding:8px 10px;margin-bottom:8px;font-size:12px}
.agent-plan strong{display:block;font-size:12px;margin-bottom:4px}
.agent-plan ol{margin:0;padding-left:18px}.agent-plan li{margin:2px 0}
.agent-plan li.done,.agent-plan li.changed_by_person{opacity:.6}.agent-plan li.proposed{color:#a07f2a}
.agent-plan .fine{margin:6px 0 0}
.agent-msg.question{border-left:3px solid #d9b65b}
.agent-note{align-self:stretch;font-size:12px;opacity:.75;font-style:italic}
.agent-brief ul{margin:4px 0;padding-left:16px}.agent-brief li{margin:2px 0}.agent-brief li button{margin-left:6px;padding:0 6px;font-size:11px}
.agent-brief-add{display:flex;gap:6px;margin-top:4px}.agent-brief-add input{flex:1;min-width:0}
.agent-render-row{display:flex;gap:6px;margin-top:6px}.agent-render-row figure{margin:0;flex:1;min-width:0}.agent-render-row img{width:100%;border-radius:6px;background:#fff}.agent-render-row figcaption{font-size:11px;opacity:.75}
/* pictures DAVINCI painted (make_picture): side by side, two per row for options */
.agent-picture-row{display:grid;grid-template-columns:1fr;gap:8px;margin-top:4px}.agent-picture-row.n2,.agent-picture-row.n3,.agent-picture-row.n4{grid-template-columns:1fr 1fr}.agent-picture-row figure{margin:0;min-width:0}.agent-picture-row img{display:block;width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:8px;background:#0002}.agent-picture-row figcaption{font-size:12px;margin-top:4px;opacity:.85}

.v8-survey-north-up { position: absolute; right: 24px; top: 140px; z-index: 3; font-size: 12px; }

.v8-new-project-dialog { width: min(420px, calc(100vw - 32px)); box-sizing: border-box; padding: 24px; border-radius: var(--dv-r-menu); }
.v8-new-project-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.v8-new-project-dialog form, .v8-new-project-dialog label { display: grid; gap: 12px; }
.v8-new-project-dialog input { width: 100%; box-sizing: border-box; }
.v8-new-project-dialog form > div { display: flex; gap: 8px; justify-content: flex-end; }
.v8-new-project-dialog p:empty { display: none; }

.v8-new-project-floors { display: grid; gap: 12px; max-height: 40vh; overflow: auto; }
.v8-cad-preview { width: min(920px, calc(100vw - 32px)); max-height: 90vh; padding: 20px; color: #222; background: #fff; }
.v8-cad-preview::backdrop { background: rgb(0 0 0 / 35%); }
.v8-cad-preview h2 { overflow-wrap: anywhere; }
.v8-cad-preview svg { display: block; width: 100%; height: min(58vh, 580px); margin-bottom: 12px; background: #f6f7f8; }


.v8-play-wall-properties { width: min(460px, calc(100vw - 32px)); max-height: 80dvh; box-sizing: border-box; padding: 16px; overflow: auto; }
.v8-play-wall-properties::backdrop { background: rgb(0 0 0 / 22%); }
.v8-play-wall-properties .properties { padding: 12px 0 0; }
.v8-play-wall-properties #v8-play-wall-status:empty { display: none; }
