:root { color-scheme: light; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #15313d; background: #eef3f3; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 0%, #d4e8e6, transparent 35%), #eef3f3; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { max-width: 1060px; margin: auto; padding: 0 28px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d7e3e2; }
.brand { display: flex; gap: 12px; align-items: center; font-size: 15px; font-weight: 800; letter-spacing: .08em; }
.brand small { display: block; font-size: 10px; letter-spacing: .17em; color: #6a878c; margin-top: 2px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: white; background: #126c72; font-size: 21px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(42px, 6vw, 72px); letter-spacing: -.065em; line-height: 1.05; margin-bottom: 18px; }
h2 { font-size: 28px; letter-spacing: -.035em; margin-bottom: 0; }
h3 { font-size: 19px; }
.eyebrow { color: #11747b; text-transform: uppercase; font-weight: 800; font-size: 11px; letter-spacing: .19em; margin-bottom: 13px; }
.hero { padding: 65px 0 41px; max-width: 730px; }
.hero > p:last-child, .login > p:not(.eyebrow) { color: #57717a; font-size: 17px; line-height: 1.65; }
.panel { background: #fff; border: 1px solid #dce7e7; box-shadow: 0 20px 65px rgba(18, 54, 63, .06); border-radius: 18px; }
.workspace, .results { padding: 32px; margin-bottom: 25px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.limit { color: #7b9195; font-size: 12px; }
#upload-form > label[for="job-prompt"] { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
#job-prompt { display: block; width: 100%; min-height: 118px; margin-bottom: 22px; padding: 14px; border: 1px solid #adc7c7; border-radius: 8px; color: #15313d; resize: vertical; line-height: 1.5; }
#project-name { display: block; width: 100%; margin-bottom: 22px; padding: 13px 14px; border: 1px solid #adc7c7; border-radius: 8px; color: #15313d; }
.project-table-wrap { width: 100%; overflow-x: auto; }
.project-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.project-table th { padding: 12px 10px; border-bottom: 1px solid #cbdedb; color: #627f84; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.project-table td { padding: 15px 10px; border-bottom: 1px solid #e5eeec; color: #49686f; }
.project-table td:first-child { color: #183e47; font-weight: 700; overflow-wrap: anywhere; }
.project-table td:last-child { text-align: right; }
.project-table button { border: 0; background: none; color: #126c72; font-weight: 800; }
.project-table button:hover { text-decoration: underline; }
.project-empty { margin: 22px 0 0; color: #657f85; font-size: 13px; }
.project-toolbar { display: flex; align-items: center; gap: 18px; margin: -12px 0 22px; }
.project-toolbar #project-title { flex: 1; color: #24474f; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.danger-button { border: 1px solid #d8a5a5; border-radius: 8px; padding: 9px 14px; color: #a12f2f; background: #fff7f7; font-size: 12px; font-weight: 800; }
.danger-button:hover { background: #ffeded; }
.saved-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 34px; }
.saved-sources h3 { margin-bottom: 8px; }
.saved-sources .output-row { font-size: 12px; }
.saved-sources .output-row small { overflow-wrap: anywhere; }
.dropzone { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; border: 2px dashed #aacdca; border-radius: 13px; background: #f6fbfa; color: #56757c; cursor: pointer; transition: .2s; padding: 24px; }
.dropzone:hover, .dropzone.dragging { background: #e7f5f3; border-color: #168188; }
.dropzone strong { color: #1c424c; font-size: 18px; }
.dropzone > span:last-child { font-size: 13px; }
.drop-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: #dcf0ed; color: #14767a; font-size: 28px; }
#files { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-list { list-style: none; padding: 0; margin: 14px 0 0; }
.file-list li, .output-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 4px; border-bottom: 1px solid #e8eeee; }
.file-list small, .output-row small { color: #82959b; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding-top: 26px; }
.form-footer p { color: #718990; font-size: 12px; line-height: 1.5; max-width: 460px; margin: 0; }
.primary { border: 0; border-radius: 8px; background: #126c72; color: white; padding: 13px 23px; font-weight: 700; white-space: nowrap; }
.primary:hover { background: #0b545b; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.secondary { border: 1px solid #b9d2d0; border-radius: 8px; background: #eef8f6; color: #146b72; padding: 10px 17px; font-weight: 700; }
.secondary:hover { background: #dff0ed; }
.link-button { display: inline-block; text-decoration: none; font-size: 14px; }
.text-button { background: none; border: 0; color: #507278; font-weight: 700; }
.status { display: flex; gap: 25px; align-items: center; padding: 26px 32px; margin: 24px 0; }
.status h2 { font-size: 19px; margin-bottom: 5px; }
.status p { color: #6a858a; font-size: 13px; margin-bottom: 12px; }
.status > div:last-child { flex: 1; }
.status { align-items: flex-start; }
.activity-heading { margin-top: 19px; color: #1b424a; font-size: 12px; font-weight: 800; }
.activity-lines { max-height: 230px; overflow-y: auto; margin: 8px 0 0; padding: 12px 12px 12px 31px; border: 1px solid #dbe9e7; border-radius: 8px; background: #f7fbfa; color: #486870; font-size: 12px; line-height: 1.5; }
.activity-lines li { padding: 3px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.activity-lines li.activity-ai { color: #174f58; }
.activity-lines li.activity-stage { font-weight: 700; }
.ai-log { padding: 32px; margin: 24px 0; }
.ai-log .section-heading { margin-bottom: 10px; }
.ai-log > p { color: #6f858c; font-size: 13px; line-height: 1.5; }
#ai-log-content { max-height: 520px; overflow: auto; margin: 18px 0 0; padding: 17px; border: 1px solid #d4e3e1; border-radius: 8px; background: #f7fbfa; color: #23434a; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.spinner { width: 32px; height: 32px; border: 3px solid #cfe5e3; border-top-color: #126c72; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { height: 5px; background: #e3efed; border-radius: 5px; overflow: hidden; }
#progress-bar { width: 0; height: 100%; background: #138188; transition: width .2s; }
.results > p { color: #6f858c; font-size: 13px; }
.output-row strong, .output-row small { display: block; }
.output-row strong { margin-bottom: 4px; }
.output-row a { color: #11747b; font-weight: 700; text-decoration: none; }
.data-summary { margin-top: 30px; padding: 24px; border: 1px solid #d5e5e2; border-radius: 13px; background: #f7fbfa; }
.summary-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; }
.summary-heading .eyebrow { margin-bottom: 5px; }
.summary-heading h3 { margin-bottom: 0; }
#summary-count { color: #6d858a; font-size: 12px; white-space: nowrap; }
.summary-intro { color: #617a80; font-size: 13px; line-height: 1.5; margin: 13px 0 18px; }
#summary-content { display: grid; gap: 12px; }
.summary-card { padding: 16px 18px; border: 1px solid #e1ecea; border-radius: 10px; background: #fff; }
.summary-card h4 { margin: 0 0 10px; color: #1b424a; font-size: 14px; }
.summary-card p:last-child { margin-bottom: 0; }
.summary-value { margin: 0 0 5px; font-size: 13px; }
.summary-source { display: block; color: #758b90; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.summary-item { display: grid; gap: 4px; padding: 9px 0; border-top: 1px solid #edf2f1; font-size: 13px; }
.summary-item:first-of-type { border-top: 0; padding-top: 0; }
.summary-item strong { color: #24474f; }
.summary-ports { color: #536e74; line-height: 1.45; }
.summary-details { padding: 9px 0; border-top: 1px solid #edf2f1; font-size: 13px; }
.summary-details:first-of-type { border-top: 0; padding-top: 0; }
.summary-details summary { cursor: pointer; color: #27545a; font-weight: 650; line-height: 1.5; }
.summary-details ul, .summary-review ul { margin: 9px 0 12px; padding-left: 19px; line-height: 1.55; }
.summary-details .summary-source { margin-top: 8px; }
.summary-review { background: #fffaf2; border-color: #ecd8b4; }
.summary-review h4 { color: #825018; }
.summary-review li { font-size: 13px; margin: 5px 0; }
.summary-empty { color: #617a80; font-size: 13px; margin: 0; }
#preview-section { margin-top: 35px; }
#cad-section { margin-top: 32px; }
.cad-tabs { display: flex; gap: 6px; margin-top: 18px; border-bottom: 1px solid #c8d9d8; }
.cad-tab { padding: 11px 20px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; color: #5d777d; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.cad-tab:hover { background: #eef8f6; color: #146b72; }
.cad-tab[aria-selected="true"] { position: relative; top: 1px; border-color: #c8d9d8; background: #f6fbfa; color: #126c72; }
.cad-tab:focus-visible { outline: 2px solid #126c72; outline-offset: 2px; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.preview-heading h3 { margin-bottom: 0; }
#cad-status { color: #70878c; font-size: 12px; margin: 10px 0 14px; }
#cad-canvas { width: 100%; height: 560px; border: 1px solid #c8d9d8; border-radius: 8px; background: #152c35; overflow: hidden; }
.cad-inspector { margin-top: 12px; padding: 15px 18px; min-height: 54px; border: 1px solid #d5e5e2; border-radius: 8px; background: #f7fbfa; color: #536e74; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.cad-inspector strong { display: block; color: #1b424a; font-size: 14px; margin-bottom: 8px; }
.cad-inspector dl { display: grid; grid-template-columns: 85px 1fr; gap: 5px 12px; margin: 0; }
.cad-inspector dt { color: #70878c; }
.cad-inspector dd { margin: 0; color: #24474f; }
#preview { display: block; width: 100%; height: auto; border: 1px solid #dce7e7; border-radius: 8px; }
.error { color: #b33131; font-size: 13px; min-height: 20px; }
.login { width: min(460px, 100%); margin: 12vh auto 16vh; padding: 40px; }
.login h1 { font-size: 44px; }
.login label { display: block; font-weight: 700; font-size: 13px; margin: 26px 0 8px; }
.login input, .login select { display: block; width: 100%; padding: 13px; border: 1px solid #adc7c7; border-radius: 8px; margin-bottom: 18px; }
.login .primary { width: 100%; }
footer { color: #91a4a8; text-align: center; font-size: 10px; letter-spacing: .18em; padding: 35px 0 50px; }
footer span { margin: 0 8px; }
@media (max-width: 700px) { .shell { padding: 0 16px; } .hero { padding-top: 45px; } .workspace, .results { padding: 23px; } .form-footer, .section-heading { align-items: stretch; flex-direction: column; } .form-footer .primary { width: 100%; } .data-summary { padding: 18px; } .summary-heading { align-items: start; flex-direction: column; gap: 7px; } .saved-sources { grid-template-columns: 1fr; } .project-toolbar { flex-wrap: wrap; } }
.evidence-panel, .conversation-panel { padding: 32px; margin: 24px 0; }
.evidence-panel > p, .conversation-panel > p { color: #617a80; font-size: 13px; line-height: 1.5; }
.evidence-panel label, .conversation-panel label { display: block; color: #24474f; font-size: 13px; font-weight: 700; margin: 16px 0 8px; }
#evidence-query, #conversation-question { display: block; width: 100%; padding: 12px 14px; border: 1px solid #adc7c7; border-radius: 8px; color: #15313d; }
#conversation-question { resize: vertical; line-height: 1.5; }
.evidence-items { max-height: 450px; overflow: auto; margin-top: 17px; }
.evidence-item { padding: 14px 3px; border-top: 1px solid #e5eeec; font-size: 12px; }
.evidence-item strong { display: block; color: #24474f; overflow-wrap: anywhere; }
.evidence-item p { margin: 7px 0 0; color: #536e74; white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation-messages { max-height: 570px; overflow: auto; padding: 15px; border: 1px solid #d5e5e2; border-radius: 9px; background: #f7fbfa; }
.conversation-message { margin: 0 0 14px; padding: 14px 16px; border: 1px solid #e1ecea; border-radius: 9px; background: #fff; }
.conversation-message:last-child { margin-bottom: 0; }
.conversation-user { background: #eaf5f3; }
.conversation-message strong { color: #1b424a; font-size: 12px; }
.conversation-message p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; margin: 7px 0; }
.conversation-message small { display: block; margin-top: 6px; }
.conversation-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
#conversation-status { color: #58787e; font-size: 12px; }
@media (max-width: 700px) { .evidence-panel, .conversation-panel { padding: 23px; } .conversation-actions { align-items: stretch; flex-direction: column; } .conversation-actions .primary { width: 100%; } }

.evidence-controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr); gap: 16px; }
#evidence-category { display: block; width: 100%; padding: 12px 14px; border: 1px solid #adc7c7; border-radius: 8px; color: #15313d; background: #fff; }
@media (max-width: 700px) { .evidence-controls { grid-template-columns: 1fr; gap: 0; } }

.word-bank-details { margin-top: 17px; color: #536e74; font-size: 12px; }
.word-bank-details summary { cursor: pointer; color: #146b72; font-weight: 700; }
#word-bank-terms { margin: 10px 0 0; padding: 12px 15px; border: 1px solid #e1ecea; border-radius: 8px; background: #f7fbfa; }
#word-bank-terms p { margin: 0 0 7px; line-height: 1.5; }
#word-bank-terms p:last-child { margin-bottom: 0; }

.evidence-item pre, .conversation-message pre { max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

.fact-card { padding: 16px 0; border-bottom: 1px solid #dce9e7; overflow-wrap: anywhere; }
.fact-card h3 { margin: 0 0 7px; font-size: 16px; }
.fact-card p { font-size: 13px; line-height: 1.5; }
.fact-status { display: inline-block; padding: 4px 8px; border-radius: 5px; background: #edf5f3; color: #21565a; font-size: 12px; }
.fact-warning { background: #fff3dc; color: #735019; }
.fact-source-button { display: block; margin: 8px 0; max-width: 100%; text-align: left; white-space: normal; }
.fact-source-view { padding: 13px; border: 1px solid #dce9e7; border-radius: 8px; background: #f7fbfa; }
.fact-source-view pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; font-size: 12px; }
.fact-pagination { display: flex; gap: 12px; align-items: center; margin-top: 18px; }

.account-identity { font-size: .85rem; color: #52606d; margin-left: auto; }
.fact-review { border-top: 1px solid #dbe2e8; margin-top: 1rem; padding-top: .8rem; }
.fact-review-form { display: grid; gap: .7rem; padding-top: .7rem; }
.fact-review-form label { display: grid; gap: .35rem; }
.fact-review-form textarea, .fact-review-form select, .fact-review-form input { width: 100%; box-sizing: border-box; font: inherit; padding: .55rem; border: 1px solid #b9c5ce; border-radius: .35rem; }
.fact-history-item { border-left: 3px solid #dbe2e8; padding-left: .6rem; margin: .6rem 0; }

/* Review workbench: independent source inspection beside the paged review queue. */
.workbench-open .shell { max-width: 1660px; }
.workbench-open .hero { display: none; }
.review-workbench { margin: 26px 0; scroll-margin-top: 20px; }
.workbench-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 18px; }
.workbench-heading > p { max-width: 440px; font-size: 14px; color: #57717a; margin-bottom: 0; }
.workbench-columns { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(0, 1.3fr); gap: 20px; align-items: start; }
.workbench-left, .workbench-right { height: min(82vh, 1050px); min-height: 640px; overflow: auto; scrollbar-gutter: stable; }
.workbench-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; padding: 14px; background: #f5faf9; border-bottom: 1px solid #dce7e7; }
.workbench-tabs button { border: 1px solid #cbdedb; background: white; border-radius: 7px; padding: 9px 12px; color: #3f656a; font-weight: 700; font-size: 13px; }
.workbench-tabs button[aria-pressed="true"] { background: #126c72; border-color: #126c72; color: white; }
.workbench-left .panel { border: 0; border-radius: 0; box-shadow: none; padding: 20px; margin-bottom: 0; }
.workbench-left h2 { font-size: 21px; }
.workbench-left .section-heading { gap: 12px; }
.workbench-left section > p { font-size: 13px; color: #57717a; line-height: 1.5; }
.workbench-left[data-view="facts"] #project-issues, .workbench-left[data-view="facts"] #project-evidence,
.workbench-left[data-view="issues"] #project-facts, .workbench-left[data-view="issues"] #project-evidence,
.workbench-left[data-view="evidence"] #project-facts, .workbench-left[data-view="evidence"] #project-issues { display: none; }
.workbench-left .fact-card { padding: 15px; border-radius: 10px; }
.workbench-fact-title { display: block; border: 0; background: none; padding: 0; color: #174952; font-size: 17px; font-weight: 750; text-align: left; margin-bottom: 12px; }
.workbench-fact-title:hover { text-decoration: underline; }
.workbench-selected { border-color: #15858a !important; box-shadow: 0 0 0 2px #d1eeeb; }
.workbench-right > section { padding: 20px; }
.workbench-right h3 { font-size: 17px; overflow-wrap: anywhere; }
.workbench-locator { background: #eef6f5; border-radius: 7px; padding: 11px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.workbench-note { font-size: 13px; color: #647d84; line-height: 1.5; }
.workbench-excerpt { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; font: 12px/1.6 ui-monospace, monospace; background: #f3f7f7; padding: 12px; border-radius: 6px; }
.workbench-right details { margin: 16px 0; }
.workbench-right summary { cursor: pointer; font-weight: 650; font-size: 13px; }
.workbench-figure { margin: 15px 0; }
.workbench-figure figcaption { font-size: 12px; color: #607b83; margin-bottom: 8px; }
.workbench-figure img { width: 100%; height: auto; border: 1px solid #dae6e4; border-radius: 5px; display: block; }
.workbench-cell-wrap { overflow: auto; max-height: 550px; margin: 16px 0; }
.workbench-cell-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.workbench-cell-table th { position: sticky; top: 0; padding: 9px; background: #eff6f5; color: #4d6d73; text-align: left; }
.workbench-cell-table td { min-width: 110px; max-width: 250px; padding: 9px; border: 1px solid #dce7e7; vertical-align: top; overflow-wrap: anywhere; }
.workbench-cell-table td small { display: block; color: #6c7f83; margin-top: 6px; }
.workbench-cell-address { display: block; color: #688087; font-size: 10px; margin-bottom: 6px; }
.workbench-cell-selected { background: #fff3ce; outline: 2px solid #e8a837; outline-offset: -2px; }
.workbench-draft-controls { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.workbench-draft-controls label { display: grid; gap: 6px; font-size: 12px; }
.workbench-draft-controls input, .workbench-draft-controls select, .workbench-draft-controls button { border: 1px solid #b5cecb; border-radius: 6px; padding: 8px; background: white; }
.workbench-draft-controls input { width: 75px; }
.workbench-files > details > summary { font-size: 16px; font-weight: 750; cursor: pointer; }
.workbench-files > details[open] > summary { margin-bottom: 25px; }
@media (max-width: 960px) {
 .workbench-columns { grid-template-columns: 1fr; }
 .workbench-left, .workbench-right { height: auto; min-height: 0; max-height: 78vh; }
 .workbench-heading { display: block; }
 .workbench-heading > p { margin-top: 12px; }
 .workbench-tabs { flex-wrap: wrap; }
}

.workbench-left .fact-source-button, .workbench-right .fact-source-button { display: inline-block; margin: 5px 4px 7px 0; padding: 8px 10px; border: 1px solid #cadfdb; border-radius: 6px; background: #f4faf9; color: #1b656c; text-align: left; text-decoration: none; font-size: 12px; line-height: 1.4; }
