
:root {
  color-scheme: light;
  --ink: #111c2d;
  --muted: #5d6c82;
  --line: #ced9e7;
  --paper: #f7f9fc;
  --panel: #ffffff;
  --accent: #4e89d8;
  --accent-dark: #254b7b;
  --blue: #376fab;
  --amber: #b66b17;
  --danger: #a33129;
  --soft: #e9f1fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { border: 0; border-radius: 6px; min-height: 42px; padding: 0 18px; background: var(--accent); color: #fff; cursor: pointer; }
button:hover { background: var(--accent-dark); }
button:disabled { opacity: .56; cursor: wait; }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ghost:hover { background: #edf3fb; }
.compact { min-height: 36px; padding: 0 14px; }
.hidden { display: none !important; }
.preview-notice { padding: 10px 22px; border-bottom: 1px solid #d7c58c; background: #fff8e8; color: #66531a; text-align: center; font-size: 13px; font-weight: 700; }
.eyebrow { margin: 0 0 4px; color: var(--accent-dark); font-size: 11px; text-transform: uppercase; letter-spacing: 0; font-weight: 750; }
.topbar { min-height: 108px; display: flex; align-items: center; gap: 18px; padding: 8px 22px; border-bottom: 1px solid var(--line); background: rgba(247,249,252,.96); position: sticky; top: 0; z-index: 4; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.ui-language-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ui-language-control select { width: auto; min-width: 126px; padding: 8px 28px 8px 10px; }
.brand { display: flex; min-width: 0; align-items: center; }
.brand-logo { display: block; width: clamp(215px, 18vw, 305px); max-height: 92px; object-fit: contain; object-position: left center; }
.mode-tabs { position: absolute; left: 50%; display: flex; align-items: center; gap: 4px; margin: 0; transform: translateX(-50%); }
.mode-tab { position: relative; min-height: 40px; padding: 0 15px; color: var(--muted); background: transparent; border-bottom: 3px solid transparent; border-radius: 5px 5px 0 0; text-align: center; }
.mode-tab::before { margin-right: 7px; color: currentColor; font-size: 16px; line-height: 1; content: attr(data-icon); }
.mode-tab:hover { color: var(--ink); background: #edf3fb; }
.mode-tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); background: var(--soft); font-weight: 750; }
.workspace-subnav { display: flex; align-items: center; gap: 8px; width: fit-content; margin-top: 8px; padding: 0; }
.workspace-subtab { min-height: 40px; padding: 0 22px; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--muted); font-size: 14px; font-weight: 700; }
.workspace-subtab { border-radius: 7px; }
.workspace-subtab:hover { position: relative; background: var(--soft); color: var(--accent-dark); }
.workspace-subtab.active { position: relative; border-color: var(--accent); background: var(--accent); color: #fff; }
.workspace-subtab.active:hover { background: var(--accent-dark); color: #fff; }
.source-scope { position: relative; display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 8px clamp(16px,2vw,32px); border-bottom: 1px solid var(--line); background: #f0f5fb; z-index: 3; }
.source-scope-title { min-width: 150px; }
.source-scope-title h2 { margin: 0; font-size: 15px; }
.selected-case-scope { display: grid; min-width: 170px; gap: 2px; }
.selected-case-scope span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.selected-case-scope strong { max-width: 260px; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.source-picker { position: relative; width: min(360px, 100%); margin-left: 0; }
.source-picker summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px; padding: 9px 12px; border: 1px solid #bdcce0; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 650; list-style: none; }
.source-picker summary::-webkit-details-marker { display: none; }
.source-picker summary::after { content: "▾"; color: var(--muted); }
.source-picker[open] summary::after { content: "▴"; }
#sourcePickerCount { min-width: 25px; padding: 2px 7px; border-radius: 12px; background: var(--soft); color: var(--accent-dark); text-align: center; font-size: 11px; }
.source-picker-menu { position: absolute; top: calc(100% + 6px); left: 0; width: min(420px, calc(100vw - 32px)); max-height: min(480px, calc(100vh - 170px)); overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 14px 32px rgba(23,32,39,.14); }
.source-picker-section + .source-picker-section { border-top: 1px solid var(--line); }
.source-picker-section > p, .source-picker-tools > p { margin: 0; padding: 9px 12px 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.source-picker-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px 5px 2px; }
.source-picker-tools > p { padding-right: 0; }
.source-type-options { max-height: 236px; overflow: auto; padding: 5px 0; }
.source-case-options { max-height: 180px; }
.source-type-option { display: flex; align-items: center; gap: 9px; padding: 9px 12px; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.source-type-option:hover { background: #f3f7fc; }
.source-type-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.source-type-option span { min-width: 0; overflow-wrap: anywhere; }
.source-type-group { min-width: 0; margin: 0; padding: 3px 0 7px; border: 0; }
.source-type-group + .source-type-group { border-top: 1px solid var(--line); }
.source-type-group legend { width: 100%; padding: 9px 12px 5px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.source-picker-error { margin: 0; color: var(--danger); font-size: 12px; }
.source-web-control { flex: 0 0 auto; white-space: nowrap; }
.mode-panel { display: none; }
.mode-panel.active { display: block; }
.preview-case-workspace { display: grid; grid-template-columns: 200px minmax(0, 1fr) 210px; min-height: calc(100vh - 117px); background: var(--paper); }
.preview-case-menu { display: grid; align-content: start; gap: 8px; padding: 26px 14px; border-right: 1px solid var(--line); background: #f9faf9; }
.preview-case-menu .eyebrow { margin: 0 6px 10px; }
.preview-case-action { min-height: 44px; padding: 0 12px; border-left: 3px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); text-align: left; }
.preview-case-action:hover { background: #edf3fb; color: var(--ink); }
.preview-case-action.active { border-left-color: var(--accent); background: var(--soft); color: var(--accent-dark); font-weight: 750; }
.preview-case-main { min-width: 0; padding: 24px; }
.preview-selected-case { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.preview-selected-case span { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.preview-selected-case strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-selected-case .compact { margin-left: auto; }
.preview-case-view { display: none; }
.preview-case-view.active { display: block; }
.preview-case-view h1 { margin: 0 0 18px; font-size: 25px; letter-spacing: -.025em; }
.preview-search input { min-height: 44px; }
.preview-case-list { display: grid; gap: 10px; margin-top: 16px; }
.preview-case-card { display: grid; gap: 5px; width: 100%; min-height: 0; padding: 16px; border: 1px solid var(--line); border-left: 3px solid transparent; background: #fff; color: var(--ink); text-align: left; }
.preview-case-card:hover { border-color: #a9c3ec; background: #f7faff; }
.preview-case-card.active { border-left-color: var(--accent); background: var(--soft); }
.preview-case-card span, .preview-no-results { color: var(--muted); font-size: 13px; line-height: 1.45; }
.preview-case-form { display: grid; gap: 16px; max-width: 690px; }
.preview-upload-placeholder { display: grid; gap: 7px; min-height: 132px; padding: 18px; border: 1px dashed #9db5d4; border-radius: 7px; background: #f8fbff; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.preview-upload-placeholder.drag-active { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 3px rgba(78,137,216,.14); }
.preview-upload-placeholder span, .preview-upload-placeholder small { color: var(--muted); font-size: 12px; }
.preview-upload-placeholder small { min-height: 16px; color: var(--accent-dark); font-weight: 700; }
.preview-upload-placeholder > div { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-file-picker { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.preview-file-picker:hover { border-color: var(--accent); color: var(--accent-dark); }
.preview-file-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.preview-source-toggles { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.preview-source-toggles label { display: flex; align-items: center; gap: 7px; width: auto; padding: 9px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; }
.preview-source-toggles input { width: 15px; height: 15px; padding: 0; accent-color: var(--accent); }
.preview-document-canvas { min-height: 320px; padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 4px 18px rgba(23,32,39,.035); }
.preview-document-canvas p:last-child { max-width: 420px; color: var(--muted); line-height: 1.55; }
.preview-work-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.preview-template-panel { padding: 26px 18px; border-left: 1px solid var(--line); background: #f9faf9; }
.preview-template-panel h2 { margin: 0 0 12px; font-size: 17px; }
.preview-template-panel p:last-child { color: var(--muted); font-size: 13px; line-height: 1.5; }
.report-layout { --left-panel-width: 250px; --right-panel-width: 340px; display: grid; grid-template-columns: var(--left-panel-width) minmax(0, 1fr) var(--right-panel-width); width: 100%; min-height: calc(100vh - 117px); transition: grid-template-columns .22s ease; }
.chat-layout { --left-panel-width: 250px; --right-panel-width: 350px; display: grid; grid-template-columns: var(--left-panel-width) minmax(0, 1fr) var(--right-panel-width); width: 100%; min-height: calc(100vh - 117px); transition: grid-template-columns .22s ease; }
.dynamic-layout.left-collapsed { --left-panel-width: 0px; }
.dynamic-layout.right-collapsed { --right-panel-width: 0px; }
.collapsible-panel { position: relative; transition: padding .22s ease, background .22s ease; }
.panel-collapse { position: absolute; top: 10px; z-index: 2; display: grid; width: 28px; min-height: 28px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 21px; line-height: 1; box-shadow: 0 2px 8px rgba(23,32,39,.08); transition: width .18s ease, min-height .18s ease, border-radius .18s ease, background .18s ease; }
.panel-collapse:hover { background: var(--soft); color: var(--accent-dark); }
.left-panel .panel-collapse { right: -14px; }.right-panel .panel-collapse { left: -14px; }
.collapsible-panel.collapsed { overflow: visible; padding: 24px 0; }
.collapsible-panel.collapsed > *:not(.panel-collapse) { visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.collapsible-panel.collapsed .panel-collapse span { display: block; transform: rotate(180deg); }
.collapsible-panel.collapsed .panel-collapse { top: 50%; width: 34px; min-height: 104px; border-radius: 18px; background: #fff; font-size: 22px; transform: translateY(-50%); }
.collapsible-panel.collapsed .panel-collapse::after { content: attr(data-collapsed-label); display: block; margin-top: 2px; color: var(--accent-dark); font-size: 9px; font-weight: 800; letter-spacing: .04em; line-height: 1; text-transform: uppercase; writing-mode: vertical-rl; }
.chat-viewer-panel.collapsed .panel-collapse { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 5px 16px rgba(78,137,216,.28); }
.chat-viewer-panel.collapsed .panel-collapse::after { color: #fff; }
.chat-viewer-panel.collapsed .panel-collapse:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; box-shadow: 0 7px 20px rgba(37,75,123,.34); }
.report-layout .collapsible-panel.collapsed .panel-collapse { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 5px 16px rgba(78,137,216,.28); }
.report-layout .collapsible-panel.collapsed .panel-collapse::after { color: #fff; }
.report-layout .collapsible-panel.collapsed .panel-collapse:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; box-shadow: 0 7px 20px rgba(37,75,123,.34); }
.dynamic-layout:has(.left-panel.collapsed:hover) { --left-panel-width: 250px; }
.dynamic-layout:has(.right-panel.collapsed:hover) { --right-panel-width: 340px; }
.chat-layout:has(.right-panel.collapsed:hover) { --right-panel-width: 350px; }
.collapsible-panel.collapsed:hover { padding-left: 14px; padding-right: 14px; }
.collapsible-panel.collapsed:hover > *:not(.panel-collapse) { visibility: visible; opacity: 1; pointer-events: auto; }
.collapsible-panel.collapsed:hover .panel-collapse span { transform: rotate(0deg); }
.report-main, .chat-column { width: 100%; padding: 24px; min-width: 0; transition: width .22s ease, padding .22s ease; }
.chat-column { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 117px); }
.research-panel, .run-panel { padding: 24px 20px; border-left: 1px solid var(--line); background: #f9faf9; min-width: 0; }
.history-panel { padding: 24px 14px; border-right: 1px solid var(--line); background: #f9faf9; min-width: 0; }
.history-panel .panel-head { padding: 0 6px 14px; }
.history-panel .compact { min-height: 32px; padding: 0 9px; font-size: 12px; }
.activity-history-row .history-item { gap: 5px; }
.history-kind { display: inline-flex; width: fit-content; padding: 2px 6px; border-radius: 999px; background: #e8eef0; color: #51616a; font-size: 10px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.history-kind.written { background: #e6f2ef; color: var(--accent-dark); }
.history-kind.chat { background: #edf0fa; color: #375b85; }
.history-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 12px; }
.archive-filter { display: flex; align-items: center; grid-template-columns: auto 1fr; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.archive-filter input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.history-empty { margin: 8px 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.history-list { display: grid; min-width: 0; }
.history-row { position: relative; min-width: 0; max-width: 100%; overflow: hidden; border-top: 1px solid var(--line); }
.history-item { display: grid; gap: 5px; width: 100%; min-width: 0; max-width: 100%; min-height: 0; overflow: hidden; padding: 12px 10px; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.history-row .history-item { border-top: 0; }
.history-row.has-actions .history-item { padding-right: 76px; }
.history-item:hover { background: #eef1f0; }
.history-item.active { background: var(--soft); box-shadow: inset 3px 0 0 var(--accent); }
.history-actions { position: absolute; top: 6px; right: 6px; display: grid; gap: 4px; }
.history-action { min-height: 26px; padding: 0 7px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 10px; }
.history-action:hover { border-color: var(--accent); background: #fff; color: var(--accent-dark); }
.history-delete { color: var(--danger); }
.history-delete:hover { border-color: var(--danger); color: var(--danger); }
.history-title { display: block; min-width: 0; overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { display: grid; grid-template-columns: minmax(0,1fr); gap: 3px; min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.history-state { min-width: 0; overflow-wrap: anywhere; color: var(--accent-dark); font-weight: 700; }
.history-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-state.errored, .history-state.terminated { color: var(--danger); }
.history-state.partial { color: var(--amber); }
.report-form { display: grid; gap: 17px; max-width: 980px; }
.field-row { display: flex; align-items: end; gap: 14px; }
.grow { flex: 1; }
.language-field, .report-mode-field { width: 180px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78,137,216,.18); }
.dictation-field { position: relative; display: block; }
.dictation-field textarea { display: block; padding-right: 52px; }
.dictation-button { position: absolute; top: 9px; right: 9px; display: grid; width: 34px; min-height: 34px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--accent-dark); font-size: 16px; line-height: 1; }
.dictation-button svg { width: 18px; height: 18px; }
.dictation-button:hover { border-color: var(--accent); background: var(--soft); }
.dictation-button.is-listening { border-color: var(--accent); background: var(--accent); color: #fff; animation: dictation-pulse 1.25s infinite ease-in-out; }
.dictation-status { min-height: 16px; color: var(--muted); font-size: 11px; font-weight: 550; }
@keyframes dictation-pulse { 50% { box-shadow: 0 0 0 6px rgba(78,137,216,.18); } }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 2px; }
.check-control { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 550; }
.check-control input { width: 17px; height: 17px; accent-color: var(--accent); }
.switch-control { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 650; cursor: pointer; user-select: none; }
.switch-control input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.switch-indicator { position: relative; flex: 0 0 auto; width: 42px; height: 24px; border: 1px solid #aeb9bd; border-radius: 999px; background: #c9d0d2; transition: background .18s ease, border-color .18s ease; }
.switch-indicator::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(23,32,39,.22); content: ""; transition: transform .18s ease; }
.switch-control input:checked + .switch-indicator { border-color: var(--accent); background: var(--accent); }
.switch-control input:checked + .switch-indicator::after { transform: translateX(18px); }
.switch-control input:focus-visible + .switch-indicator { outline: 3px solid rgba(78,137,216,.28); outline-offset: 2px; }
.switch-control input:disabled + .switch-indicator { opacity: .55; }
.action-buttons, .download-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-submit-button { display: grid; width: 42px; min-height: 42px; place-items: center; border: 0; border-radius: 50%; background: var(--accent-dark); color: #fff; padding: 0; box-shadow: 0 2px 8px rgba(37,75,123,.18); transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.icon-submit-button svg { width: 20px; height: 20px; }
.icon-submit-button:hover:not(:disabled), .icon-submit-button:focus-visible:not(:disabled) { background: var(--accent); box-shadow: 0 4px 14px rgba(78,137,216,.28); transform: translateY(-1px); }
.icon-submit-button:disabled { background: #bdc7ca; box-shadow: none; }
.icon-submit-button.is-working svg { animation: icon-submit-pulse 1.15s infinite ease-in-out; }
@keyframes icon-submit-pulse { 50% { opacity: .38; transform: translateY(-2px); } }
.result-actions { display: grid; justify-items: end; gap: 8px; }
.translation-form { display: flex; align-items: end; gap: 8px; }
.translation-form label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.translation-form select { width: auto; min-width: 126px; padding: 8px 28px 8px 10px; }
.translation-status { min-height: 17px; color: var(--muted); font-size: 12px; }
.translation-download-group { display: contents; }
.panel-head, .result-head, .sources-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2, .result-head h2, .sources-head h2 { margin: 0; font-size: 16px; }
#reportPercent, #elapsed { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.report-execution-details { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.report-execution-details summary { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 64px; padding: 11px 13px; cursor: pointer; list-style: none; }
.report-execution-details summary::-webkit-details-marker { display: none; }
.report-execution-details summary::after { content: "⌄"; grid-column: 3; grid-row: 1; justify-self: end; color: var(--muted); font-size: 15px; transform: translateX(1px); }
.report-execution-details[open] summary::after { transform: translateX(1px) rotate(180deg); }
.report-execution-details summary > #reportPercent { grid-column: 3; grid-row: 1; margin-right: 22px; }
.report-execution-details summary .eyebrow { display: block; margin: 0 0 2px; }
.report-execution-details summary strong { display: block; color: var(--ink); font-size: 15px; }
.execution-indicator { width: 10px; height: 10px; border-radius: 50%; background: #9aa5ab; }
.report-execution-details.running { border-color: #b9cdea; }
.execution-indicator.running { background: var(--accent); animation: chat-pulse 1.4s infinite ease-out; }
.execution-indicator.complete { background: var(--accent); }
.execution-indicator.error { background: var(--danger); }
.report-execution-detail { border-top: 1px solid var(--line); padding: 0 14px 14px; }
.report-preview-panel { margin-top: 14px; min-height: 278px; }
.report-preview-panel iframe { height: min(39vh, 350px); }
.report-sources-head { margin-top: 16px; }
.source-count { min-width: 24px; border-radius: 999px; background: var(--soft); color: var(--accent-dark); padding: 3px 8px; text-align: center; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.report-sources { min-height: 150px; max-height: 34vh; overflow: auto; }
.research-panel:has(.report-sources) { display: grid; grid-template-rows: auto auto auto minmax(150px, 34vh); align-content: start; gap: 12px; }
.research-panel:has(.report-sources) .report-preview-panel { min-height: 0; margin: 0; }
.research-panel:has(.report-sources) .report-preview-panel iframe { height: min(27vh, 250px); }
.progress-track { height: 6px; margin-top: 18px; overflow: hidden; background: #dfe4e5; border-radius: 3px; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .35s ease; }
.status-message { min-height: 42px; margin: 14px 0 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.stage-heading { margin-top: 18px; }
.stage-overview { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.stage-overview li { position: relative; min-height: 29px; padding: 6px 4px 6px 23px; color: var(--muted); border-left: 1px solid var(--line); font-size: 12px; line-height: 1.35; }
.stage-overview li::before { content: ""; position: absolute; left: -5px; top: 10px; width: 8px; height: 8px; border: 1px solid #9aa5ab; border-radius: 50%; background: #f9faf9; }
.stage-overview li.done { color: #40505a; }
.stage-overview li.done::before { border-color: var(--accent); background: var(--accent); }
.stage-overview li.current { color: var(--ink); font-weight: 700; }
.stage-overview li.current::before { border: 2px solid var(--accent); background: #fff; }
.trace { display: grid; gap: 9px; margin: 14px 0 0; padding-left: 20px; }
.trace li { color: var(--muted); font-size: 13px; line-height: 1.35; }
.trace li:last-child { color: var(--ink); font-weight: 650; }
.metrics { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 24px 0 0; border-top: 1px solid var(--line); padding-top: 18px; font-size: 13px; }
.metrics dt { color: var(--muted); }
.metrics dd { margin: 0; text-align: right; font-weight: 700; }
.report-result { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 24px; }
.report-preview { width: 100%; max-height: 68vh; overflow: auto; margin: 18px 0 0; padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #26323b; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.download-actions a { display: inline-flex; min-height: 36px; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; background: #fff; font-size: 13px; }
.download-actions a:hover { border-color: var(--accent); color: var(--accent-dark); }
.report-chat { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
.report-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-chat-head h2 { margin: 0; font-size: 16px; }
#reportChatState { color: var(--muted); font-size: 12px; }
.report-chat-messages { display: grid; align-content: start; gap: 10px; min-height: 82px; max-height: 52vh; margin-top: 16px; overflow: auto; }
.report-chat-message { max-width: 88%; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; background: #fff; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.report-chat-message.user { justify-self: end; background: var(--soft); border-color: #b9cdea; }
.report-chat-message.system { max-width: 100%; border: 0; padding: 5px 0; background: transparent; color: var(--muted); font-size: 13px; }
.report-chat-sources { display: grid; gap: 6px; margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
.report-chat-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.report-chat-source { cursor: pointer; border-radius: 5px; padding: 3px 5px; transition: background .15s ease; }
.report-chat-source:hover, .report-chat-source:focus-within, .report-chat-source.selected { background: var(--soft); }
.report-chat-source-link, .source-download { color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.report-chat-source-link:hover, .source-download:hover { text-decoration: underline; }
.report-chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: end; gap: 10px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.report-chat-composer textarea { min-height: 74px; max-height: 220px; }
.report-chat-composer button { width: 112px; }
.messages { display: grid; flex: 1 1 auto; align-content: start; gap: 23px; width: min(100%, 960px); min-height: 310px; margin: 0 auto; overflow: auto; padding: 26px 10px 12px; scroll-behavior: smooth; }
.message { width: fit-content; max-width: min(88%, 880px); border-radius: 16px; border: 1px solid var(--line); background: var(--panel); padding: 15px 17px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.message.user { justify-self: end; max-width: min(76%, 720px); margin-left: auto; border-color: #d9dfe2; border-radius: 22px 22px 6px 22px; background: #eceff1; color: #273138; box-shadow: 0 1px 2px rgba(23,32,39,.04); }
.message.assistant:not(.pending) { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 12px; width: min(100%, 900px); max-width: 100%; padding: 3px 0; border-color: transparent; background: transparent; box-shadow: none; }
.assistant-avatar { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--accent-dark); color: #fff; font-size: 10px; font-weight: 850; letter-spacing: -.03em; }
.assistant-content { min-width: 0; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.assistant-content > :first-child { margin-top: 0; }
.assistant-content > :last-child { margin-bottom: 0; }
.assistant-content p { margin: 0 0 12px; }
.assistant-content h3, .assistant-content h4 { margin: 18px 0 9px; color: var(--accent-dark); font-weight: 800; line-height: 1.3; }
.assistant-content h3 { font-size: 17px; }
.assistant-content h4 { font-size: 15px; }
.assistant-content ul, .assistant-content ol { margin: 0 0 13px; padding-left: 22px; }
.assistant-content li { margin: 4px 0; padding-left: 2px; }
.assistant-content strong { color: #111c2d; font-weight: 780; }
.assistant-content a { color: var(--accent-dark); font-weight: 700; text-decoration-color: rgba(13, 119, 112, .45); text-underline-offset: 2px; }
.assistant-content a:hover { text-decoration-color: currentColor; }
.assistant-content code { border-radius: 4px; background: var(--soft); padding: 1px 4px; color: var(--accent-dark); font: .91em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.message.system { justify-self: start; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.message.pending { display: flex; align-items: center; gap: 10px; min-height: 54px; color: var(--muted); }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; width: 28px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: chat-dot 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: .16s; }
.typing-dots span:nth-child(3) { animation-delay: .32s; }
.composer { display: grid; gap: 10px; }
.chat-composer-top { position: sticky; bottom: 0; z-index: 1; align-self: center; width: min(100%, 960px); margin: 0 -4px -4px; border: 1px solid #d9dfe2; border-radius: 24px; background: #fff; padding: 8px 8px 8px 16px; box-shadow: 0 -12px 30px rgba(23,32,39,.10); }
.chat-composer-main { display: grid; grid-template-columns: 40px minmax(0,1fr) 44px; align-items: end; gap: 10px; }
.chat-composer-main .dictation-field { min-width: 0; }
.chat-composer-main textarea { min-height: 68px; max-height: 240px; border: 0; padding: 10px 44px 10px 0; background: transparent; box-shadow: none; }
.chat-composer-main textarea:focus { border: 0; box-shadow: none; }
.chat-composer-main > .icon-submit-button { width: 42px; min-height: 42px; align-self: center; }
.chat-composer-top .chat-workspace-actions { width: 100%; margin: 0; padding-top: 1px; }
.chat-composer-top .workspace-subtab { min-height: 32px; padding: 0 15px; border-radius: 999px; font-size: 12px; }
.chat-composer-main > .chat-attachment-button { display: grid; width: 36px; min-height: 36px; place-items: center; align-self: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); padding: 0; font-size: 25px; font-weight: 360; line-height: 1; transition: background .15s ease, border-color .15s ease; }
.chat-composer-main > .chat-attachment-button:hover, .chat-composer-main > .chat-attachment-button:focus-visible { border-color: var(--accent); background: var(--soft); color: var(--accent-dark); }
.chat-composer-top.drag-active { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 3px rgba(78,137,216,.18), 0 -12px 30px rgba(23,32,39,.10); }
.chat-attachment-tray { display: flex; flex-wrap: wrap; gap: 6px; max-height: 92px; overflow: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.chat-source-error { margin: 0; border: 1px solid #e7b7b2; border-radius: 10px; background: #fff3f2; color: var(--danger); padding: 8px 10px; font-size: 12px; font-weight: 700; line-height: 1.35; }
.chat-attachment-chip { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; border: 1px solid #b9cdea; border-radius: 999px; background: var(--soft); color: var(--accent-dark); padding: 4px 5px 4px 10px; font-size: 11px; font-weight: 700; }
.chat-attachment-chip span { overflow: hidden; max-width: 260px; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment-chip button { display: grid; width: 20px; height: 20px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--accent-dark); font-size: 16px; line-height: 1; }
.chat-attachment-chip button:hover { background: #cfe5e1; }
.chat-attachment-status { min-height: 0; margin: -2px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.chat-activity { display: flex; align-items: flex-start; gap: 10px; min-height: 64px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.chat-activity-indicator { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: #9aa5ab; }
.chat-activity strong, .chat-activity span { display: block; }
.chat-activity strong { color: var(--ink); font-size: 13px; }
.chat-activity div > span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.chat-activity.running { border-color: #b9cdea; background: var(--soft); }
.chat-activity.running .chat-activity-indicator { background: var(--accent); animation: chat-pulse 1.4s infinite ease-out; }
.chat-activity.success .chat-activity-indicator { background: var(--accent); }
.chat-activity.error { border-color: #e1b8b6; background: #fff8f7; }
.chat-activity.error .chat-activity-indicator { background: var(--danger); }
.run-panel { display: grid; grid-template-rows: auto auto minmax(120px,.8fr) auto minmax(180px,1fr); gap: 14px; }
.chat-viewer-panel { grid-template-rows: auto auto minmax(150px, 34vh); align-content: start; gap: 12px; }
.chat-viewer-panel .sources { min-height: 150px; max-height: 34vh; }
.chat-preview-panel { min-height: 0; margin: 0; }
.chat-preview-panel iframe { height: min(27vh, 250px); }
.sources, .run-panel .trace { overflow: auto; }
.source { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.source:hover, .source:focus, .source.selected { border-color: var(--accent); background: var(--soft); box-shadow: inset 3px 0 0 var(--accent); outline: 0; }
.source strong { display: block; font-size: 13px; margin-bottom: 5px; }
.source p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.source-download { display: inline-flex; margin-top: 9px; font-size: 12px; }
.consultation-download-actions { justify-content: flex-end; }
.case-selector { width: 100%; padding: 34px 28px 30px; border-bottom: 1px solid var(--line); }
.case-selector-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.case-selector h1 { margin: 0; font-size: 25px; }
.case-selector-head p:not(.eyebrow), .case-selection-summary { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.case-selection-summary { flex: 0 0 auto; margin: 0; color: var(--accent-dark); font-weight: 700; }
.case-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 22px; }
.case-source-group { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.case-source-group.case { border-top: 3px solid #456a9d; background: #f8fafd; }
.case-source-group.public { border-top: 3px solid #4f8468; background: #f8fbf9; }
.case-source-group.restricted { border-top: 3px solid #9a7b40; background: #fcfaf5; }
.case-source-group-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 14px; margin-bottom: 13px; }
.case-source-group-head h2 { margin: 0; font-size: 16px; }
.case-source-group-head p { grid-column: 1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.case-source-group-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 32px; border-radius: 12px; padding: 4px 8px; background: #fff; color: var(--muted); text-align: center; font-size: 11px; font-weight: 750; }
.case-source-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.case-option { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 11px; min-height: 58px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.case-option:hover { border-color: #9fbae1; background: #f7faff; }
.case-option:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.case-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.case-option-copy { min-width: 0; }
.case-option-name, .case-option-description, .case-option-code { display: block; overflow-wrap: anywhere; }
.case-option-name { font-size: 14px; font-weight: 700; }
.case-option-description { display: -webkit-box; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.case-option-code { margin-top: 3px; color: var(--muted); font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.case-search { display: block; max-width: 620px; margin: 18px 0 12px; }
.case-search input { width: 100%; }
.case-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.case-actions button { min-width: 150px; }
.case-management-heading { width: 100%; padding: 26px 28px 0; }
.case-management-heading h2 { margin: 0; font-size: 18px; }
.upload-layout { display: grid; grid-template-columns: minmax(0,1fr) 390px; width: 100%; min-height: calc(100vh - 117px); }
.upload-main { padding: 28px; min-width: 0; }
.upload-main > .panel-head { max-width: 820px; margin-bottom: 18px; }
.upload-main h2, .upload-activity-panel h2 { margin: 0; font-size: 19px; }
.upload-form { display: grid; gap: 18px; width: 100%; max-width: none; }
.upload-mode-fieldset { margin: 0; padding: 0; border: 0; }
.upload-mode-fieldset legend { margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.segmented-control { display: inline-grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.segmented-control label { display: block; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { display: block; min-width: 160px; padding: 10px 14px; color: var(--muted); text-align: center; cursor: pointer; }
.segmented-control label + label span { border-left: 1px solid var(--line); }
.segmented-control input:checked + span { background: var(--accent); color: #fff; font-weight: 700; }
.upload-field-grid { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 14px; }
#newUploadBlockFields { grid-template-columns: minmax(0,1fr) 120px; }
.upload-case-description { grid-column: 1 / -1; }
.upload-case-description textarea { min-height: 104px; }
.case-documents-panel { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.case-documents-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.case-documents-head .eyebrow { margin-bottom: 3px; }
.case-documents-head h3 { margin: 0; font-size: 15px; }
.case-documents-count { min-width: 30px; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--accent-dark); text-align: center; font-size: 12px; font-weight: 750; }
.case-documents-search input { width: 100%; }
.case-documents-list { max-height: 260px; overflow: auto; border-top: 1px solid var(--line); }
.case-document-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; padding: 11px 3px; border-bottom: 1px solid var(--line); }
.case-document-row strong, .case-document-row span { overflow-wrap: anywhere; }
.case-document-row strong { font-size: 13px; }
.case-document-row span { color: var(--muted); font-size: 11px; }
.case-document-row a { align-self: center; font-size: 12px; }
.case-document-row:hover, .case-document-row.selected { margin: 0 -7px; padding: 11px 10px; border-radius: 6px; border-bottom-color: transparent; background: var(--accent-dark); color: #fff; cursor: pointer; }
.case-document-row:hover span, .case-document-row.selected span { color: #d9e8fb; }
.case-document-row:hover a, .case-document-row.selected a { color: #fff; }
.case-preview-panel { display: grid; gap: 9px; margin: 0 0 18px; padding: 13px; border: 1px solid #b9cdea; border-radius: 8px; background: var(--soft); }
.case-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.case-preview-head .eyebrow { margin-bottom: 2px; }
.case-preview-head strong { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.case-preview-panel iframe { width: 100%; height: 280px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.case-preview-message { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.upload-drop-zone { display: grid; gap: 14px; padding: 22px; border: 1px dashed #9db5d4; border-radius: 6px; background: #f8fbff; outline: none; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.upload-drop-zone:hover, .upload-drop-zone:focus-visible, .upload-drop-zone.drag-active { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 3px rgba(78,137,216,.14); }
.upload-drop-zone.busy { opacity: .65; pointer-events: none; }
.upload-drop-copy { display: grid; gap: 4px; }
.upload-drop-copy strong { font-size: 15px; }
.upload-drop-copy span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.upload-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-picker-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.upload-picker-button:hover { border-color: var(--accent); color: var(--accent-dark); }
.upload-picker-button:has(input:disabled) { opacity: .55; cursor: default; }
.upload-picker-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-file-list { display: grid; gap: 5px; max-height: 210px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.upload-file-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 24px; font-size: 12px; }
.upload-file-name { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.upload-file-size { color: var(--muted); }
.upload-help, .upload-selection-summary { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.help-mascot-button { position: fixed; right: 22px; bottom: 20px; z-index: 12; display: grid; width: 76px; min-height: 76px; place-items: end center; overflow: hidden; border: 2px solid #c7d9f1; border-radius: 50%; background: radial-gradient(circle at 50% 25%, #f8fbff 0 38%, #dce9f8 100%); box-shadow: 0 8px 26px rgba(37,75,123,.25); padding: 0; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.help-mascot-button img { display: block; width: 106px; max-width: none; transform: translateY(7px); }
.help-mascot-button:hover, .help-mascot-button:focus-visible { border-color: var(--accent); box-shadow: 0 11px 30px rgba(37,75,123,.34); transform: translateY(-3px) scale(1.03); }
.help-assistant { position: fixed; right: 22px; bottom: 108px; z-index: 13; display: grid; width: min(370px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 132px)); gap: 12px; overflow: hidden; border: 1px solid #b9cdea; border-radius: 18px; background: #fff; padding: 17px; box-shadow: 0 18px 46px rgba(23,32,39,.24); }
.help-assistant-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.help-assistant-head h2 { margin: 0; font-size: 18px; }
.help-assistant-head .eyebrow { margin-bottom: 2px; }
.help-assistant-head .ghost { min-height: 32px; padding: 0 11px; font-size: 20px; line-height: 1; }
.help-assistant-intro { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.help-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.help-suggestions button { min-height: 30px; border: 1px solid #b9cdea; border-radius: 999px; background: var(--soft); color: var(--accent-dark); padding: 0 10px; font-size: 11px; font-weight: 750; }
.help-suggestions button:hover { background: #dce9f8; }
.help-messages { display: grid; align-content: start; gap: 10px; min-height: 0; max-height: 260px; overflow: auto; padding-right: 2px; }
.help-message { width: fit-content; max-width: 92%; border-radius: 12px; background: #f0f4f3; padding: 9px 11px; color: var(--ink); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.help-message.user { justify-self: end; background: var(--accent-dark); color: #fff; }
.help-message.pending { color: var(--muted); font-style: italic; }
.help-form { display: grid; grid-template-columns: minmax(0,1fr) 40px; align-items: end; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.help-form .help-dictation-field textarea { min-height: 54px; max-height: 130px; resize: vertical; font-size: 13px; }
.help-form .dictation-status { grid-column: 1 / -1; }
.help-form button { display: grid; width: 40px; min-height: 40px; place-items: center; border-radius: 50%; padding: 0; font-size: 20px; }
.upload-activity-panel { padding: 28px 20px; border-left: 1px solid var(--line); background: #f9faf9; min-width: 0; }
.upload-readiness { display: grid; grid-template-columns: 11px minmax(0,1fr); align-items: start; gap: 10px; margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.upload-readiness-indicator { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: #9aa3a8; }
.upload-readiness-copy { display: grid; gap: 3px; min-width: 0; }
.upload-readiness-copy strong { font-size: 13px; line-height: 1.35; }
.upload-readiness-copy span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.upload-readiness.running { border-color: #9fbae1; background: var(--soft); }
.upload-readiness.running .upload-readiness-indicator { background: var(--accent); animation: chat-pulse 1.8s infinite; }
.upload-readiness.success { border-color: #6fa69e; background: #edf7f4; }
.upload-readiness.success .upload-readiness-indicator { background: var(--accent); }
.upload-readiness.warning { border-color: #d6b37f; background: #fff8ed; }
.upload-readiness.warning .upload-readiness-indicator { background: var(--amber); }
.upload-readiness.error { border-color: #d8a5a1; background: #fff4f3; }
.upload-readiness.error .upload-readiness-indicator { background: var(--danger); }
.upload-history { display: grid; gap: 9px; }
.upload-job { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.upload-job-head, .upload-job-meta { display: flex; justify-content: space-between; gap: 10px; }
.upload-job-title { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.upload-job-state { color: var(--accent-dark); font-size: 11px; font-weight: 750; }
.upload-job-state.error { color: var(--danger); }
.upload-job-meta, .upload-job-message { color: var(--muted); font-size: 11px; line-height: 1.4; }
.upload-job .progress-track { height: 5px; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; }
@keyframes chat-dot { 0%, 70%, 100% { transform: translateY(0); opacity: .35; } 35% { transform: translateY(-4px); opacity: 1; } }
@keyframes chat-pulse { 0% { box-shadow: 0 0 0 0 rgba(78,137,216,.38); } 70%, 100% { box-shadow: 0 0 0 8px rgba(78,137,216,0); } }
.login-page { display: grid; place-items: center; padding: 24px; }
.login-language { position: fixed; top: 20px; right: 20px; }
.login-language label { display: flex; align-items: center; gap: 8px; }
.login-language select { width: auto; min-width: 126px; }
.login-shell { display: grid; grid-template-columns: minmax(280px,520px) minmax(280px,420px); width: min(100%,1020px); gap: 58px; align-items: center; }
.login-intro { display: grid; gap: 14px; }
.login-intro h1 { max-width: 460px; margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(34px,5vw,58px); letter-spacing: -.045em; line-height: .98; }
.login-intro p:not(.eyebrow) { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.55; }
.login-intro video { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: #172027; box-shadow: 0 20px 50px rgba(23,32,39,.13); }
.login-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px; box-shadow: 0 18px 50px rgba(23,32,39,.08); }
.login-panel h1 { margin: 0; font-size: 24px; }
.login-form { display: grid; gap: 16px; margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.landing-page { background: #f7f9fc; color: var(--ink); }
.landing-header, .landing-hero, .landing-steps, .landing-trust, .landing-video-section, .landing-footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.landing-header { display: flex; align-items: center; justify-content: space-between; min-height: 82px; gap: 22px; border-bottom: 1px solid #dfe2dc; }
.landing-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.landing-brand img { display: block; width: clamp(195px, 20vw, 285px); height: auto; max-height: 90px; object-fit: contain; object-position: left center; }
.landing-nav { display: flex; gap: 22px; margin-left: auto; }
.landing-nav a, .landing-access, .text-link, .landing-footer a { color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.landing-nav a:hover, .text-link:hover, .landing-footer a:hover { color: var(--accent-dark); }
.landing-actions { display: flex; align-items: center; gap: 13px; }
.landing-language select { min-height: 34px; width: 54px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.landing-access { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; }
.landing-access:hover { border-color: var(--accent); color: var(--accent-dark); }
.landing-hero { display: grid; grid-template-columns: 1.04fr .96fr; gap: 56px; min-height: 600px; align-items: center; padding: 72px 0 86px; }
.landing-copy h1, .landing-steps h2, .landing-trust h2, .landing-video-section h2 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 500; letter-spacing: -.052em; }
.landing-copy h1 { max-width: 620px; font-size: clamp(47px,6vw,76px); line-height: .96; }
.landing-kicker { margin: 0 0 14px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.landing-lede { max-width: 510px; margin: 25px 0 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.landing-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 31px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 750; text-decoration: none; }
.button-link:hover { background: var(--accent-dark); }
.landing-proof { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 510px; margin: 70px 0 0; padding-top: 19px; border-top: 1px solid #d9ddd8; }
.landing-proof dt { font-size: 13px; font-weight: 800; }.landing-proof dd { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.landing-visual { position: relative; min-height: 465px; overflow: hidden; border-radius: 2px; background: #e2ecf9; }
.visual-orbit { position: absolute; border: 1px solid rgba(37,75,123,.22); border-radius: 50%; }.orbit-one { width: 580px; height: 580px; top: -160px; right: -260px; }.orbit-two { width: 400px; height: 400px; bottom: -250px; left: -180px; }
.visual-card { position: absolute; border: 1px solid rgba(37,75,123,.18); background: rgba(255,255,255,.82); box-shadow: 0 18px 45px rgba(37,75,123,.12); backdrop-filter: blur(5px); }.visual-card-main { display: grid; gap: 18px; width: min(78%,350px); top: 105px; left: 13%; padding: 30px; }.visual-card-main strong { max-width: 220px; font-family: Georgia, 'Times New Roman', serif; font-size: 28px; font-weight: 500; line-height: 1.05; }.visual-label { color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .14em; }.visual-line { height: 7px; width: 72%; background: #dce6f3; }.visual-line.wide { width: 100%; background: #b9cdea; }.visual-line.short { width: 43%; }.visual-card-note { display: flex; align-items: center; gap: 9px; right: 7%; bottom: 74px; padding: 14px 17px; color: #254b7b; font-size: 12px; font-weight: 750; }.visual-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.landing-steps { display: grid; grid-template-columns: .76fr 1.24fr; gap: 70px; padding: 90px 0; border-top: 1px solid #dce5f0; }.landing-steps h2, .landing-trust h2, .landing-video-section h2 { font-size: clamp(34px,4vw,49px); line-height: 1.01; }.landing-steps ol { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin: 0; padding: 0; list-style: none; }.landing-steps li { border-top: 2px solid #9fbae1; padding-top: 16px; }.landing-steps li span { color: var(--accent-dark); font-size: 11px; font-weight: 800; }.landing-steps h3 { margin: 24px 0 8px; font-size: 15px; }.landing-steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.landing-trust { max-width: 100%; width: 100%; padding: 92px max(24px,calc((100% - 1180px)/2)); background: #111c2d; color: #f5f8fd; }.landing-trust .landing-kicker { color: #9fc2ef; }.landing-trust h2 { max-width: 680px; }.landing-trust p:last-child { max-width: 590px; margin: 22px 0 0; color: #d3e0f1; font-size: 16px; line-height: 1.6; }
.landing-video-section { display: grid; grid-template-columns: .72fr 1.28fr; align-items: center; gap: 62px; padding: 105px 0; }.landing-video-section p:not(.landing-kicker) { margin: 18px 0 0; color: var(--muted); line-height: 1.55; }.landing-video { display: block; width: 100%; border: 1px solid #254b7b; border-radius: 8px; background: #111c2d; box-shadow: 0 24px 60px rgba(23,32,39,.16); }.landing-footer { display: flex; justify-content: space-between; padding: 24px 0 34px; border-top: 1px solid #dce5f0; color: var(--muted); font-size: 12px; }
@media (max-width: 1040px) {
  .preview-case-workspace { grid-template-columns: 172px minmax(0,1fr) 172px; }
  .preview-case-main { padding: 18px; }
  .preview-template-panel { padding: 22px 14px; }
}
@media (max-width: 640px) {
  .landing-header, .landing-hero, .landing-steps, .landing-video-section { width: min(100% - 36px, 680px); }.landing-header { min-height: 70px; }.landing-nav { display: none; }.landing-hero, .landing-steps, .landing-video-section, .login-shell { grid-template-columns: 1fr; gap: 34px; }.landing-hero { min-height: 0; padding: 52px 0 62px; }.landing-copy h1 { font-size: clamp(45px,13vw,66px); }.landing-visual { min-height: 350px; }.landing-proof { margin-top: 48px; }.landing-steps { padding: 66px 0; }.landing-steps ol { grid-template-columns: 1fr; }.landing-trust { padding: 68px 18px; }.landing-video-section { padding: 68px 0; }.landing-footer { width: min(100% - 36px,680px); }.login-shell { width: min(100%,620px); }.login-intro { order: 2; }.login-panel { order: 1; }
  .topbar { min-height: 0; align-items: flex-start; flex-wrap: wrap; gap: 8px 14px; padding: 8px 14px; }.brand-logo { width: min(210px, 58vw); max-height: 66px; }.mode-tabs { position: static; order: 3; width: 100%; margin: 0; transform: none; }.mode-tab { flex: 1; min-height: 38px; padding: 0 10px; }.topbar-actions { margin-left: auto; }
  .workspace-subnav { width: 100%; }.workspace-subtab { flex: 1; min-height: 38px; padding: 0 12px; }
  .source-scope { align-items: stretch; flex-direction: column; gap: 8px; }
  .selected-case-scope { min-width: 0; }
  .selected-case-scope strong { max-width: none; }
  .source-picker { width: 100%; }
  .source-web-control { white-space: normal; }
  .report-layout, .chat-layout { grid-template-columns: 1fr; min-height: 0; }
  .dynamic-layout.left-collapsed, .dynamic-layout.right-collapsed { --left-panel-width: 1fr; --right-panel-width: 1fr; }
  .chat-layout .chat-column, .report-layout .report-main { order: 1; min-height: min(68dvh, 680px); }
  .chat-layout .consultation-history-panel, .report-layout .history-panel { order: 2; }
  .chat-layout .chat-viewer-panel, .report-layout .research-panel { order: 3; }
  .panel-collapse { position: static; display: grid; width: 36px; min-height: 36px; margin: 0 0 0 auto; place-items: center; border-radius: 50%; }
  .collapsible-panel.collapsed { min-height: 54px; padding: 9px 18px; }
  .collapsible-panel.collapsed > :not(.panel-collapse) { display: none; }
  .collapsible-panel.collapsed .panel-collapse { transform: rotate(90deg); }
  .upload-layout { grid-template-columns: 1fr; }
  .preview-case-workspace { grid-template-columns: 1fr; }
  .preview-case-menu { grid-template-columns: repeat(3,1fr); padding: 16px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-case-menu .eyebrow { grid-column: 1 / -1; }
  .preview-template-panel { border-left: 0; border-top: 1px solid var(--line); }
  .case-selector { padding: 26px 18px; }
  .case-selector-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .case-options, .case-source-grid { grid-template-columns: 1fr; }
  .case-actions { flex-direction: column; }
  .case-actions button { width: 100%; }
  .case-management-heading { padding: 24px 18px 0; }
  .history-panel { max-height: 46dvh; overflow: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .research-panel, .run-panel { border-left: 0; border-top: 1px solid var(--line); }
  .upload-activity-panel { border-left: 0; border-top: 1px solid var(--line); }
  .report-main, .chat-column, .history-panel, .research-panel, .run-panel { padding: 18px; }
  .field-row { align-items: stretch; flex-direction: column; }
  .language-field, .report-mode-field { width: 100%; }
  .form-actions, .result-head { align-items: stretch; flex-direction: column; }
  .topbar { align-items: flex-start; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; }
  .ui-language-control span { display: none; }
  .result-actions { justify-items: stretch; }
  .translation-form { align-items: stretch; flex-direction: column; }
  .translation-form label { align-items: stretch; flex-direction: column; }
  .action-buttons button { flex: 1; }
  .report-chat-head { align-items: flex-start; }
  .report-chat-composer { grid-template-columns: 1fr; }
  .report-chat-composer button { width: 100%; }
  .report-chat-message { max-width: 96%; }
  .chat-composer-main { grid-template-columns: 40px minmax(0,1fr) 44px; }
  .chat-composer-main > button { grid-column: 1 / -1; width: 100%; }
  .chat-composer-main > .chat-attachment-button { grid-column: auto; width: 36px; }
  .chat-composer-main > .icon-submit-button { grid-column: auto; width: 42px; }
  .messages { height: auto; min-height: 42dvh; max-height: 60dvh; }
  .upload-field-grid, #newUploadBlockFields { grid-template-columns: 1fr; }
  .upload-picker-actions { flex-direction: column; }
  .upload-picker-actions > * { width: 100%; }
  .help-mascot-button { right: 14px; bottom: 14px; width: 66px; min-height: 66px; }.help-mascot-button img { width: 92px; }.help-assistant { right: 14px; bottom: 92px; width: min(370px, calc(100vw - 28px)); }
  .segmented-control { width: 100%; }
  .segmented-control span { min-width: 0; }
}
