:root {
  color-scheme: light;
  --canvas: #f3f4ef;
  --paper: #fffefa;
  --ink: #172923;
  --muted: #4c6259;
  --forest: #142e27;
  --forest-soft: #224238;
  --teal: #175b47;
  --mint: #e0eee4;
  --line: #d6dfd6;
  --control-line: #738b7d;
  --amber: #78420d;
  --amber-bg: #fff0d5;
  --danger: #902e31;
  --danger-bg: #f9e7e4;
  --sans: "Aptos", "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
button:disabled { opacity: .55; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #17645d; outline-offset: 3px; }
.sidebar :focus-visible { outline-color: #b5f0c8; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.18; }
time, .money, .metric strong, .nav-count, .pagination, .source-list strong, .coverage dd { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.app-shell { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: 100vh; }
.skip-link { position: fixed; z-index: 4; top: 12px; left: 12px; padding: 8px 14px; background: var(--paper); color: var(--teal); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.sidebar {
  display: flex; flex-direction: column; align-self: start; position: sticky; top: 0; min-height: 100vh;
  padding: 32px 16px 24px; background: var(--forest); color: #f1f4ea;
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 48px; font-weight: 700; font-size: 1.06rem; line-height: 1.13; letter-spacing: -.02em; }
.brand div span { display: block; }
.brand-mark { display: flex; align-items: end; justify-content: center; gap: 3px; width: 38px; height: 38px; padding: 9px; border: 1px solid #57816b; border-radius: 9px; background: #274d3d; }
.brand-mark i { flex: 1; height: 45%; background: #9de5b3; border-radius: 1px; }
.brand-mark i:nth-child(2) { height: 70%; }
.brand-mark i:nth-child(3) { height: 100%; }
.nav-label { margin: 0 10px 10px; color: #b0c4b8; font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
  margin-block: 4px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px;
  text-align: left; color: #e8eee8; background: transparent; font-size: .91rem; font-weight: 600;
}
.nav-link[aria-current="page"] { background: var(--forest-soft); border-color: #486758; }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; width: 3px; height: 17px; left: -1px; border-radius: 2px; background: #a6e8b8; }
.nav-link:hover:not(:disabled) { background: var(--forest-soft); }
.nav-icon { position: relative; display: inline-block; width: 15px; height: 15px; flex: 0 0 15px; color: #b1ddc0; }
.overview .nav-icon { border: 1.5px solid currentColor; border-radius: 3px; }
.overview .nav-icon::after { content: ""; position: absolute; inset: 4px 2px 2px 4px; border-top: 1px solid currentColor; border-left: 1px solid currentColor; }
.import .nav-icon { border-bottom: 1.5px solid currentColor; border-radius: 2px; }
.import .nav-icon::before { content: ""; position: absolute; width: 1.5px; height: 11px; top: 0; left: 7px; background: currentColor; }
.import .nav-icon::after { content: ""; position: absolute; width: 7px; height: 7px; top: 3px; left: 4px; transform: rotate(45deg); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.findings .nav-icon { background: repeating-linear-gradient(to bottom, currentColor 0 1.5px, transparent 1.5px 5px); background-size: 11px 15px; background-position: center; background-repeat: no-repeat; height: 12px; }
.nav-count { margin-inline-start: auto; padding: 0 6px; border-radius: 4px; background: #355547; color: #f1f6eb; font-size: .75rem; }
.sidebar-footer { margin: auto 8px 0; padding-top: 18px; border-top: 1px solid #456256; display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; }
.sidebar-footer small { display: block; color: #b0c4b8; font-size: .77rem; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #a6e8b8; margin-top: 7px; flex: 0 0 7px; }

.workspace { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 67px; padding: 8px clamp(20px, 4vw, 58px); background: var(--paper); border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: .875rem; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.content { width: min(100%, 1450px); margin-inline: auto; padding: 37px clamp(20px, 4vw, 58px) 56px; }
.screen { min-width: 0; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font: 400 clamp(2.05rem, 4.1vw, 3.55rem)/1.08 var(--serif); letter-spacing: -.043em; margin: 4px 0 8px; }
.page-heading p:not(.eyebrow), .panel-heading p, .empty p { color: var(--muted); }
.eyebrow, .section-kicker { color: var(--teal); font-size: .77rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.split-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.replacement-note { margin-top: 5px; font-size: .88rem; }
.split-heading > button { flex-shrink: 0; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.panel-heading { min-width: 0; padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-heading h2, .source-strip h2 { font-size: 1.08rem; font-weight: 730; }
.panel-heading p, .source-strip p { margin-top: 3px; font-size: .9rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 14px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--control-line); border-radius: 7px;
  font-size: .9rem; font-weight: 680; line-height: 1.25; text-align: center;
}
.button.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.button.primary:hover:not(:disabled) { background: #104a3a; border-color: #104a3a; }
.button.secondary:hover:not(:disabled), .file-control:hover:not(:has(input:disabled)) { background: #eaf1e9; }
.button.compact { min-height: 36px; padding: 6px 10px; font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tag, .priority { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 8px; border-radius: 5px; font-size: .8rem; font-weight: 700; line-height: 1.35; }
.tag.teal { color: #215441; background: var(--mint); }
.tag.neutral { color: #445b51; background: #eaf0e9; }
.tag.amber, .priority.medium { color: var(--amber); background: var(--amber-bg); }
.priority.high { color: var(--danger); background: var(--danger-bg); }
.priority.low { color: #3b5b50; background: #eaf0e9; }
.priority { text-transform: capitalize; gap: 6px; }
.priority::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.welcome { display: grid; grid-template-columns: 1.36fr 1fr; min-height: 285px; overflow: clip; }
.welcome-main { padding: clamp(25px, 4vw, 44px); display: flex; flex-direction: column; align-items: start; justify-content: center; }
.welcome-main h2 { margin: 8px 0; font: 400 clamp(1.85rem, 3.2vw, 2.7rem)/1.15 var(--serif); letter-spacing: -.035em; }
.welcome-main p { color: var(--muted); max-width: 38ch; }
.welcome-main .actions { margin-top: 22px; }
.welcome-side { display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 3vw, 36px); border-left: 1px solid #ccdcd0; background: #e9f0e6; }
.welcome-side ol { list-style: none; padding: 0; margin-top: 13px; }
.welcome-side li { position: relative; padding: 9px 0 9px 17px; border-top: 1px solid #ccdcd0; }
.welcome-side li::before { content: ""; position: absolute; left: 0; top: 17px; width: 6px; height: 6px; border: 1px solid var(--teal); transform: rotate(45deg); }
.welcome-side li span { display: block; color: var(--muted); font-size: .88rem; }
.source-strip { margin-top: 18px; padding: 21px 22px; }
.source-strip p { color: var(--muted); }
.source-strip .source-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 17px; border: 1px solid var(--line); border-radius: 7px; }
.source-strip .source-list li { border-top: 0; min-height: 49px; }
.source-strip .source-list li + li { border-left: 1px solid var(--line); }
.source-list { padding: 0; list-style: none; }
.source-list li { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 14px; font-size: .9rem; }
.source-list li + li { border-top: 1px solid var(--line); }
.source-mark { flex: 0 0 15px; height: 17px; border: 1.5px solid #497661; border-radius: 3px; position: relative; }
.source-mark::before, .source-mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 1px; background: #497661; }
.source-mark::after { top: 9px; }

.run-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-left: 4px solid var(--teal); }
.run-main h2 { font: 400 clamp(1.35rem, 2.5vw, 2rem)/1.2 var(--serif); margin: 3px 0 4px; letter-spacing: -.02em; }
.run-main p { color: var(--muted); font-size: .87rem; }
.run-main time { color: var(--ink); }
.run-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 10px; }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.metric { padding: 17px 15px; }
.metric h2 { font-size: .89rem; font-weight: 710; }
.metric strong { display: block; font: 400 clamp(1.65rem, 3.35vw, 2.6rem)/1.15 var(--serif); margin: 8px 0 5px; overflow-wrap: anywhere; }
.metric p, .totals-note { color: var(--muted); font-size: .83rem; }
.totals-note { margin: 9px 2px 19px; }
.overview-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.source-panel .source-list li { padding-inline: 22px; }
.source-label { min-width: 0; }
.source-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.source-list strong { margin-inline-start: auto; }
.coverage dl { margin: 5px 22px 0; }
.coverage dl > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.coverage dt { font-size: .9rem; }
.coverage dd { font-size: 1.05rem; font-weight: 750; }
.coverage > p { margin: 9px 22px 12px; color: var(--muted); font-size: .82rem; }
.withheld { margin: 0 22px 15px; }
summary, .text-button { color: var(--teal); font-size: .93rem; font-weight: 700; }
summary { padding: 4px 0; }
.withheld ul, .validation-issues ul { list-style: none; padding: 0; }
.withheld li { display: grid; gap: 2px; border-top: 1px solid var(--line); padding: 7px 0; font-size: .85rem; overflow-wrap: anywhere; }
.withheld span { color: var(--muted); }

.upload-source + .upload-source { border-top: 1px solid var(--line); }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 14px 22px; min-height: 73px; }
.file-data { flex: 1; min-width: 0; }
.file-data h3 { font-size: .94rem; }
.file-data p { color: var(--muted); font-size: .85rem; }
.file-data .filename { color: var(--teal); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-control { position: relative; cursor: pointer; }
.file-control:focus-within { outline: 3px solid #17645d; outline-offset: 3px; }
.file-control:has(input:disabled) { opacity: .55; cursor: default; }
.file-control input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: inherit; }
.mapping { padding: 14px 22px 19px; background: #eef4eb; border-top: 1px solid var(--line); }
.mapping > p, .validation-issues p { color: var(--muted); font-size: .89rem; margin-bottom: 10px; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.mapping-field > span { min-width: 0; overflow-wrap: anywhere; }
.mapping-field small { font-size: .77rem; line-height: 1.35; }
.mapping-field > span small { color: var(--muted); font-weight: 500; }
.cell-example { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: var(--muted); }
.warning-text { color: var(--amber); }
.panel-footer { padding: 14px 22px; border-top: 1px solid var(--line); }
.panel-footer [role="status"] { color: var(--muted); font-size: .9rem; }
.inline-error { margin: 0 22px 13px; padding: 8px 10px; border-radius: 5px; color: var(--danger); background: var(--danger-bg); font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.top-error { margin-inline: 0; }
.validation-panel { margin-top: 16px; }
.validation-issues { padding: 14px 22px; border-bottom: 1px solid var(--line); }
.validation-issues li { border-top: 1px solid var(--line); font-size: .88rem; padding-block: 7px; }
.run-form { display: grid; gap: 14px; justify-items: start; padding: 18px 22px; }
.run-fields { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.run-form .inline-error { margin: 0; }
label:not(.button) { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: .86rem; font-weight: 650; }
label small { color: var(--muted); font-weight: 500; }
input:not([type="checkbox"], [type="file"]), select {
  display: block; width: 100%; min-width: 0; min-height: 40px; padding: 7px 9px; border: 1px solid var(--control-line);
  border-radius: 6px; background: var(--paper); color: var(--ink); font-weight: 500;
}
input::placeholder { color: #52655b; }
select[aria-invalid="true"] { border-color: var(--amber); }
label.check-label { display: flex; align-items: start; gap: 9px; font-weight: 550; }
input[type="checkbox"] { margin: 2px 0 0; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--teal); }

.filter-bar { display: grid; grid-template-columns: minmax(180px, 1.65fr) repeat(4, minmax(105px, 1fr)); gap: 12px; padding: 17px 20px; }
.results-meta { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 20px; border-block: 1px solid var(--line); font-size: .875rem; color: var(--muted); background: #f7f8f3; }
.text-button { border: 0; background: transparent; padding: 4px 1px; text-decoration: underline; text-underline-offset: 3px; }
.table-scroll-hint { display: none; }
.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: -3px; }
table { width: 100%; min-width: 625px; border-collapse: collapse; text-align: left; font-size: .9rem; }
thead th { background: #eaf0e9; font-size: .79rem; color: #344c41; }
th, td { padding: 9px 12px; }
th:first-child { padding-inline-start: 20px; }
td:last-child { padding-inline-end: 20px; }
tbody tr + tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: #f4f7f1; }
tbody th { font-weight: 500; }
td small, tbody th small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; overflow-wrap: anywhere; }
.finding-link { border: 0; padding: 3px 0; background: none; color: var(--teal); font-size: .95rem; font-weight: 750; text-align: left; line-height: 1.25; }
.finding-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.pagination { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.empty { padding: 24px 22px; }
.empty h2 { font-size: 1.08rem; margin-bottom: 5px; }
.empty .button { margin-top: 13px; }

.finding-dialog {
  width: min(680px, calc(100% - 30px)); max-height: min(810px, calc(100% - 30px)); padding: 0; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 13px; overflow: auto; scroll-padding-top: 88px;
}
.finding-dialog::backdrop { background: rgb(14 34 28 / .61); }
.dialog-header, .dialog-footer { padding: 15px 19px; background: var(--paper); }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: start; gap: 10px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font: 400 clamp(1.4rem, 3vw, 1.95rem)/1.15 var(--serif); margin-top: 4px; }
.dialog-content { padding: 16px 19px; }
.dialog-content > p, .evidence > p { color: var(--muted); margin: 8px 0 12px; font-size: .92rem; }
.comparison { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; background: #f1f5ee; }
.comparison > div { padding: 10px; overflow-wrap: anywhere; }
.comparison > div + div { border-left: 1px solid var(--line); }
.comparison dt, .evidence-row dt { color: var(--muted); font-size: .8rem; }
.comparison dd { margin-top: 3px; font-size: .92rem; font-weight: 700; }
.calculation { margin-top: 13px; max-height: 12rem; overflow: auto; overflow-wrap: anywhere; }
.calculation h3, .evidence h3 { font-size: 1rem; }
.calculation p { margin: 4px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; }
.evidence { margin-top: 17px; }
.evidence h3 span { margin-inline-start: 3px; color: var(--muted); font-size: .82rem; }
.evidence-row { border: 1px solid var(--line); border-radius: 6px; margin-top: 6px; overflow-wrap: anywhere; }
.evidence-row summary { padding: 8px 10px; }
.evidence-row summary span { margin-left: 8px; color: var(--muted); font-size: .8rem; font-weight: 550; }
.evidence-row p, .evidence-row dl { margin: 0 10px 8px; font-size: .88rem; color: var(--muted); }
.evidence-row dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 6px; padding: 3px 0; border-top: 1px solid var(--line); }
.evidence-row dd { color: var(--ink); }
.dialog-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 12px; border-top: 1px solid var(--line); }
.dialog-footer .check-label { grid-row: 2; grid-column: 1 / -1; }

@media (max-width: 1070px) {
  .filter-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
}
@media (min-width: 851px) and (max-width: 930px), (max-width: 655px) {
  .table-scroll-hint { display: block; padding: 6px 14px; color: var(--muted); font-size: .8rem; }
}
@media (max-width: 850px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; min-height: 0; padding: 11px 19px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .brand { margin: 0; font-size: .96rem; }
  .sidebar nav { display: flex; gap: 6px; }
  .nav-link { margin-block: 0; }
  .nav-label, .sidebar-footer { display: none; }
  .nav-count { display: none; }
  .topbar { min-height: 55px; }
  .content { padding-top: 26px; }
}
@media (max-width: 610px) {
  .sidebar { display: block; padding-inline: 14px; }
  .brand { margin-bottom: 9px; }
  .brand div span { display: inline; margin-left: .25em; }
  .brand-mark { width: 29px; height: 29px; padding: 6px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .public-demo .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-link { padding-inline: 7px; gap: 5px; justify-content: center; font-size: .83rem; }
  .nav-icon { display: none; }
  .content, .topbar { padding-inline: 14px; }
  .breadcrumb > span:first-child, .breadcrumb > span:nth-child(2) { display: none; }
  .topbar { min-height: 47px; }
  .page-heading { margin-bottom: 17px; }
  .split-heading { display: grid; justify-items: start; }
  .welcome, .overview-lower { grid-template-columns: minmax(0, 1fr); }
  .welcome-side { border-left: 0; border-top: 1px solid #ccdcd0; }
  .source-strip .source-list, .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-strip .source-list li:nth-child(3) { border-left: 0; }
  .source-strip .source-list li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .run-banner { align-items: start; flex-direction: column; }
  .run-actions { justify-content: start; }
  .mapping-grid, .run-fields { grid-template-columns: minmax(0, 1fr); }
  .upload-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; padding: 11px 12px; gap: 6px; }
  .upload-row .button:not(.file-control) { grid-column: 2; justify-self: start; }
  .file-control { grid-column: 3; grid-row: 1 / span 2; }
  .panel-heading, .panel-footer, .mapping, .run-form, .validation-issues { padding-inline: 12px; }
  .inline-error { margin-inline: 12px; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 8px; }
  .results-meta { padding-inline: 12px; }
  .comparison { grid-template-columns: minmax(0, 1fr); }
  .comparison > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .dialog-header, .dialog-footer, .dialog-content { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.topbar-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 10px; }
.workspace-sales { color: var(--teal); font-size: .875rem; font-weight: 650; padding: 8px 3px; }
.sales-showcase { max-width: 1100px; margin-inline: auto; }
.sales-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--forest); color: var(--paper); padding: 16px clamp(18px, 5vw, 52px);
}
.sales-header .brand { margin: 0; }
.sales-header a { color: #e3f2e6; font-size: .9rem; }
.sales-header a:focus-visible { outline-color: #b5f0c8; }
.sales-main { max-width: 790px; margin-inline: auto; padding: clamp(18px, 4.5vw, 46px); }
.sales-main .conversation { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.sales-main .chat-log { min-block-size: min(230px, 25dvh); max-block-size: min(430px, 48dvh); }

.copilot-dialog {
  position: fixed; inset: 12px 12px 12px auto; margin: auto 0 auto auto;
  max-inline-size: calc(100% - 24px); inline-size: 560px; block-size: min(780px, calc(100dvh - 24px));
  max-block-size: calc(100dvh - 24px); padding: 0; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 80px #142e2738;
}
.copilot-dialog[open] { display: flex; flex-direction: column; animation: chat-enter 140ms ease-out; }
.copilot-dialog::backdrop { background: #142e2766; }
@keyframes chat-enter { from { opacity: .7; transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .copilot-dialog[open] { animation: none; } }

.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-header h2 { margin-top: 3px; font: 400 clamp(1.55rem, 4vw, 2rem)/1.13 var(--serif); letter-spacing: -.035em; }
.conversation { display: flex; flex-direction: column; min-block-size: 0; flex: 1; }
.chat-log { position: relative; flex: 1; min-block-size: 0; overflow: auto; overscroll-behavior: contain; padding: 19px clamp(14px, 4vw, 24px); background: #f8faf5; }
.chat-log:focus-visible { outline-offset: -4px; }
.chat-intro { padding: 10px 14px; border-left: 3px solid var(--teal); color: var(--muted); background: #ebf2e9; border-radius: 0 7px 7px 0; }
.chat-intro, .chat-turn { margin-bottom: 15px; }
.chat-question {
  width: fit-content; max-width: 90%; margin: 0 0 8px auto; padding: 9px 13px; border-radius: 12px 12px 3px 12px;
  color: #183f32; background: var(--mint); font-weight: 650; overflow-wrap: anywhere;
}
.chat-reply { padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px 12px 12px 12px; background: var(--paper); overflow-wrap: anywhere; }
.chat-reply > p { white-space: pre-line; }
.chat-follow-up { margin-top: 10px; font-weight: 650; }
.chat-demo + .chat-demo { margin-inline-start: 16px; }
.chat-demo { display: inline-block; margin-top: 12px; color: var(--teal); font-weight: 700; padding-block: 3px; }
.chat-cards { display: grid; gap: 8px; padding: 0; margin-top: 12px; list-style: none; }
.chat-cards > li { border: 1px solid var(--line); border-radius: 8px; background: #f8faf5; }
.chat-evidence summary { padding: 9px 10px; }
.chat-evidence summary span { display: block; padding-left: 17px; color: var(--muted); font-size: .84rem; }
.chat-evidence-body { padding: 10px; border-top: 1px solid var(--line); font-size: .9rem; }
.chat-evidence-link { margin: 0 10px 6px; min-height: 36px; }
.chat-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-block: 10px; }
.chat-values dt, .chat-sources span { color: var(--muted); font-size: .82rem; }
.chat-calculation { padding: 8px 10px; background: var(--mint); border-radius: 6px; font-variant-numeric: tabular-nums; }
.chat-sources { list-style: none; padding: 0; margin-block: 8px; }
.chat-sources li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chat-queue { margin-top: 12px; }
.chat-controls { padding: 12px clamp(14px, 4vw, 24px) 8px; border-top: 1px solid var(--line); }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-suggestions:not(:empty) { margin-bottom: 12px; }
.chat-suggestions .button { min-height: 36px; font-size: .81rem; text-align: left; }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.chat-compose input { min-width: 0; padding: 8px 11px; color: var(--ink); background: var(--paper); border: 1px solid var(--control-line); border-radius: 7px; }
.chat-compose input::placeholder { color: var(--muted); }
.chat-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.chat-footer p { color: var(--muted); font-size: .78rem; }
.chat-footer button { flex-shrink: 0; min-height: 36px; }
.chat-error { color: var(--danger); font-size: .9rem; }
.chat-progress { color: var(--muted); font-size: .9rem; }
.chat-load, .chat-nav-error { padding: 16px 20px; }

@media (max-width: 610px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { justify-content: start; }
  .copilot-dialog { inset: auto 0 0; max-inline-size: 100%; inline-size: 100%; block-size: min(92dvh, 780px); border-radius: 14px 14px 0 0; }
  .chat-header { padding: 12px 14px; }
  .chat-log { padding-block: 12px; }
}
@media (max-height: 550px) {
  .chat-suggestions { flex-wrap: nowrap; overflow-x: auto; padding: 4px; }
  .chat-suggestions .button { flex: 0 0 auto; }
}
