/* Docflow interface. Accent palette supplied by the user. */
:root {
  --brand-green: #a7cf43;
  --brand-blue: #5b97de;
  --brand-orange: #ff8401;
  --background: #f4f6f8;
  --surface: #fff;
  --text: #172c3e;
  --muted: #5f6f7e;
  --line: #e1e7ec;
  --primary: #2465ad;
  --primary-dark: #19538f;
  --primary-soft: #edf5fd;
  --success: #42691f;
  --danger: #b33443;
  --radius: 12px;
  --shadow: 0 2px 4px rgb(23 44 62 / 3%);
  font-size: 14px;
  line-height: 1.55;
}
::selection { background: #dcebf9; color: #172c3e; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
a { text-underline-offset: 3px; }
h1 { font-size: clamp(26px, 2.3vw, 34px); font-weight: 650; letter-spacing: -.7px; line-height: 1.25; }
h3 { font-size: 15px; font-weight: 650; margin: 16px 0 8px; }
pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); line-height: 1.65; }
.app-shell { grid-template-columns: 242px minmax(0, 1fr); }
.sidebar { height: 100dvh; padding: 24px 16px 18px; color: var(--text); background: #fff; border-right: 1px solid var(--line); overflow-y: auto; z-index: 40; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; }
.sidebar .brand { padding: 0 8px; }
.brand { gap: 13px; color: var(--text); letter-spacing: 0; }
.brand-name { font-size: 24px; font-weight: 750; letter-spacing: 1px; }
.nav-list { gap: 28px; margin-top: 38px; }
.nav-group { display: grid; gap: 4px; }
.nav-heading { color: var(--muted); font-size: 11px; letter-spacing: .9px; text-transform: uppercase; padding: 0 12px 7px; font-weight: 600; }
.nav-item { min-height: 46px; padding: 11px 12px; font-size: 13px; font-weight: 550; color: #435767; gap: 11px; border-radius: 8px; }
.nav-item:hover { background: #f3f6f9; color: var(--text); }
.nav-item.is-active { color: #19538f; background: #eaf3fc; box-shadow: inset 3px 0 0 var(--brand-blue); font-weight: 650; }
.nav-item .icon { width: 19px; height: 19px; }
.sidebar-bottom { border-top: 1px solid var(--line); margin-top: auto; padding: 20px 8px 0; gap: 10px; }
.workspace-mark { background: #f0f7e5; color: #42691f; width: 36px; height: 36px; }
.workspace-name { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sidebar .nav-label, .sidebar .brand > span:last-child, .sidebar .workspace-name { display: block; }
.topbar { position: sticky; top: 0; z-index: 25; min-height: 74px; padding: 14px 32px; gap: 16px; }
.topbar-location { display: flex; gap: 12px; align-items: center; min-width: 0; }
.breadcrumb { color: var(--muted); font-size: 13px; gap: 8px; flex-wrap: wrap; line-height: 1.4; overflow-wrap: anywhere; }
.breadcrumb a, .breadcrumb-current { color: #435767; }
.breadcrumb-current { max-width: 35vw; }
.topbar-actions { gap: 10px; }
.user-avatar { background: #eaf3fc; color: #19538f; width: 34px; height: 34px; font-size: 13px; }
.user-name { font-size: 13px; color: #435767; }
.report-trigger { font-size: 12px; color: var(--muted); }
.page-content { padding: 32px 32px 56px; max-width: 1640px; }
.page-heading { margin-bottom: 24px; gap: 16px; align-items: center; }
.page-heading > div { min-width: 0; }
.eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.page-heading > .button { flex-shrink: 0; }
.button { border-radius: 8px; padding: 11px 16px; min-height: 44px; font-size: 13px; font-weight: 600; white-space: normal; text-align: center; }
.button-primary { background: var(--primary); box-shadow: 0 1px 2px rgb(23 44 62 / 8%); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { border-color: #ccd6df; color: #354c5e; }
.button-secondary:hover { background: #f4f8fc; border-color: #8aa9c9; }
.button-ghost { color: #435767; }
.button-ghost:hover { background: #eef3f7; }
.button:disabled { color: #667889; border-color: var(--line); background: #edf0f3; opacity: .8; }
.button-compact, .button-small { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.icon-button { width: 38px; height: 38px; color: #5f6f7e; border-radius: 8px; flex-shrink: 0; }
.icon-button.small { width: 32px; height: 32px; }
.panel { border-color: var(--line); border-radius: var(--radius); }
.panel-heading { padding: 19px 22px; min-height: 64px; gap: 12px; flex-wrap: wrap; }
.panel-heading h2 { font-size: 15px; line-height: 1.4; font-weight: 650; color: var(--text); }
.panel-heading h2 .icon { color: var(--primary); width: 18px; height: 18px; }
.panel-body { padding: 22px; overflow-wrap: anywhere; }
.panel > .panel-body + .panel-body { border-top: 1px solid var(--line); }
.small-label, .muted { font-size: 12px; color: var(--muted); }
.count-badge { font-size: 12px; color: #435767; background: #eff3f6; min-width: 26px; height: 25px; border-radius: 6px; }
.filter-bar { gap: 10px; padding: 18px 22px; flex-wrap: wrap; }
.search-input { flex: 1; max-width: 460px; min-width: 180px; border-color: #ccd6df; }
.search-input input:not([type=checkbox]):not([type=radio]) { min-height: 42px; font-size: 14px; }
.search-input .icon { color: var(--muted); }
.filter-bar select { width: auto; max-width: 100%; min-height: 44px; font-size: 13px; flex: 0 1 200px; }
.filter-bar .button { min-height: 44px; }
.data-table { min-width: 0; }
.data-table th { padding: 14px 20px; background: #f8fafb; color: #536777; font-size: 12px; font-weight: 600; white-space: normal; }
.data-table td { padding: 19px 20px; font-size: 13px; color: #354c5e; border-color: #e9eef2; overflow-wrap: anywhere; }
.data-table td:last-child { width: auto; padding-left: 20px; }
.data-table th:last-child:has(.sr-only), .data-table td:last-child:has(> .icon-button) { width: 56px; padding-left: 8px; padding-right: 16px; }
.data-table tbody tr:hover { background: #f7faff; }
.table-main-link { color: var(--text); font-size: 14px; font-weight: 600; }
.data-table td > a:not(.button):not(.icon-button):not(.status) { color: #19538f; }
.table-main-link:hover, .data-table td > a:hover { text-decoration: underline; }
.table-secondary { color: var(--muted); font-size: 12px; margin-top: 6px; }
.table-date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px !important; }
.table-date span { font-size: 12px; color: var(--muted); }
.owner-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.owner-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-blue); flex-shrink: 0; }
.owner-label.is-free { color: #42691f; }
.owner-label.is-free::before { background: var(--brand-green); }
.status { padding: 6px 9px; border-radius: 6px; line-height: 1.35; font-size: 11px; font-weight: 600; color: #536777; background: #eff3f6; white-space: normal; }
.status > span { flex-shrink: 0; }
.status-processing, .status-running, .status-queued, .status-sending { background: #edf5fd; color: #19538f; }
.status-needs_input, .status-proposed, .status-pending { background: #fff2e1; color: #8a4a00; }
.status-ready, .status-succeeded, .status-completed, .status-approved, .status-sent { background: #eef6df; color: #42691f; }
.status-error, .status-failed { background: #fff0f1; color: #a42d3b; }
.status-stale, .status-rejected, .status-cancelled { background: #eff3f6; color: #536777; }
.empty-state { padding: 64px 24px; gap: 20px; }
.empty-icon { background: #edf5fd; color: #487fb9; border-radius: 14px; width: 56px; height: 56px; }
.empty-state h2, .chat-empty h2 { font-size: 16px; color: #435767; font-weight: 550; }
.back-link { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.form-panel { max-width: 840px; }
.standard-form { padding: 28px; }
.form-section { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 24px; margin: 0 0 24px; min-width: 0; }
.form-section legend { font-size: 15px; font-weight: 650; padding: 0; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .form-field { margin-bottom: 0; min-width: 0; }
.form-grid .form-field:has(textarea), .form-grid .form-field[data-field=name], .form-grid .form-field[data-field=title], .form-grid .form-field[data-field=companies] { grid-column: 1 / -1; }
.form-field { margin-bottom: 22px; }
.form-field label { color: #354c5e; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.form-field input, .form-field select, .form-field textarea { font-size: 14px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { min-height: 44px; border-color: #c9d4de; border-radius: 8px; padding: 11px 12px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #6b7b89; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #dcebf9; }
select[multiple] { min-height: 140px; }
.checkbox-field { min-height: 44px; }
.checkbox-field label { margin: 0; }
.form-field[data-field=companies] > div[id] { max-height: 230px; overflow: auto; padding: 8px 12px; border: 1px solid #c9d4de; border-radius: 8px; }
.form-field[data-field=companies] > div[id]:empty { display: none; }
.form-field[data-field=companies] > div[id] label { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0; font-weight: 400; }
.form-actions { gap: 10px; padding-top: 8px; }
.standard-form > .form-actions { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.form-section + .form-actions { border: 0; margin-top: 0; padding-top: 0; }
.form-side-link, .text-link { font-size: 13px; }
.field-errors, .form-errors, .inline-error { font-size: 13px; color: #a42d3b; }
.has-error input:not([type=checkbox]):not([type=radio]), .has-error select, .has-error textarea { border-color: #b33443; }
input[type=file] { font-size: 12px !important; color: var(--muted) !important; }
input[type=file]::file-selector-button { color: #19538f; background: #edf5fd; padding: 9px; }
.deal-meta { font-size: 13px; color: var(--muted); line-height: 1.6; }
.deal-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
.deal-main, .deal-aside { gap: 24px; }
.claim-panel { margin-bottom: 24px; border-left: 3px solid var(--brand-green); }
.claim-panel .panel-heading { border: 0; padding: 16px 20px; }
.claim-panel .panel-heading h2 { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.claim-panel .small-label { font-size: 14px; font-weight: 600; color: var(--text); }
.claim-panel .form-actions { padding: 0; }
.claim-panel details.panel-body { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.claim-panel ul { line-height: 1.8; padding-left: 18px; }
.chat-panel { min-height: 560px; height: clamp(560px, calc(100dvh - 275px), 900px); max-height: none; }
.chat-history { padding: 24px; background: #fbfcfd; flex: 1; min-height: 0; height: auto; }
.chat-message { gap: 12px; margin-bottom: 24px; }
.message-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; background: #eef6df; color: #42691f; }
.message-assistant .message-avatar, .message-telegram .message-avatar { background: #e5f0fb; color: #2465ad; }
.message-system .message-avatar { background: #edf0f3; color: #5f6f7e; }
.message-meta { flex-wrap: wrap; gap: 6px 10px; padding: 2px 0 8px; font-size: 11px; color: var(--muted); }
.message-meta strong { font-size: 13px; color: var(--text); }
.message-meta time { font-size: 11px; color: var(--muted); margin-left: auto; }
.message-text { font-size: 14px; color: #354c5e; line-height: 1.7; }
.message-system .message-text { color: var(--muted); font-size: 12px; }
.message-assistant .message-body { background: #edf5fd; border: 1px solid #dcebf9; border-radius: 0 10px 10px 10px; padding: 12px 14px; }
.message-attachment { background: #fff; font-size: 13px; color: #19538f; }
.chat-composer { padding: 18px 22px; }
.chat-composer textarea { min-height: 72px; font-size: 14px; padding: 10px 12px; border: 1px solid #c9d4de; border-radius: 8px; margin-bottom: 12px; background: #fff; }
.chat-composer textarea:focus { border: 1px solid var(--primary); box-shadow: 0 0 0 3px #dcebf9; }
.attachment-button { padding: 8px; color: #435767; }
.previous-report { font-size: 13px; color: var(--muted); }
.previous-report[open] > summary { margin-bottom: 10px; }
.document-info > a, .package-item strong { font-size: 13px; color: #354c5e; }
.document-info > span, .package-meta, .version-badge { font-size: 11px; color: var(--muted); }
.package-actions, .deal-link-actions { flex-wrap: wrap; }
.document-file-icon, .template-file-icon { background: #edf5fd; color: #2465ad; }
.section-empty, .connection-empty, .empty-template { color: var(--muted); font-size: 13px; line-height: 1.6; }
.finding { background: #fffaf3; border-color: #f1d6ad; }
.finding-title { font-size: 12px; color: #8a4a00; }
.finding p { font-size: 13px; color: #435767; }
.finding-blocker { background: #fff6f6; border-color: #efc9ce; }
.finding-blocker .finding-title { color: #a42d3b; }
.finding-info { background: #f4f9fe; border-color: #d6e6f6; }
.finding-info .finding-title { color: #19538f; }
.evidence, .extracted-field dt { font-size: 12px; color: var(--muted); }
.evidence-content blockquote { color: #536777; }
.extracted-field dd { color: #354c5e; font-size: 13px; }
.alert-warning, .flash-warning, .missing-documents { background: #fff5e8; color: #8a4a00; border-color: #f1d6ad; }
.alert-error, .flash-error { background: #fff0f1; color: #a42d3b; border-color: #efc9ce; }
.flash-success { background: #f0f7e5; color: #42691f; border-color: #d5e6ba; }
.flash-info { background: #edf5fd; color: #19538f; border-color: #d6e6f6; }
.missing-documents ul { color: #7c541e; font-size: 13px; }
.check-success { color: #42691f; font-size: 13px; }
.participant-item { color: #435767; font-size: 13px; flex-wrap: wrap; }
.templates-layout { grid-template-columns: minmax(0, 1fr) 360px; }
.template-info strong { font-size: 15px; }
.template-info > span, .template-info > span.small-label { font-size: 12px; color: var(--muted); }
.settings-layout { grid-template-columns: minmax(0, 760px) minmax(270px, 1fr); max-width: 1200px; gap: 24px; }
.settings-layout > div, .settings-layout > section, .templates-layout > section { min-width: 0; }
.connection-state { font-size: 12px; color: #536777; padding: 5px 8px; border-radius: 6px; background: #eff3f6; white-space: normal; }
.connection-state.is-connected { color: #42691f; background: #eef6df; }
.connection-state.is-connected > span { background: #62972d; }
.connection-details dt { font-size: 12px; color: var(--muted); margin-top: 16px; }
.connection-details dt:first-child { margin-top: 0; }
.connection-details dd { font-size: 14px; color: #354c5e; margin-top: 5px; }
.connection-details:last-child { margin-bottom: 0; }
.settings-panel .panel-body + .standard-form { border-top: 1px solid var(--line); }
.version-entry { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.version-entry:last-child { border: 0; padding-bottom: 0; margin-bottom: 0; }
.version-entry p, .audit-entry { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 6px 0 12px; }
.audit-entry { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.audit-entry:last-child { border: 0; margin-bottom: 0; padding-bottom: 0; }
.prompt-layout { grid-template-columns: minmax(0, 1fr) 310px; max-width: none; }
.prompt-layout textarea { min-height: 500px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.75; }
.prompt-layout pre { font-size: 12px !important; }
.conversation-grid { grid-template-columns: minmax(0, 1.4fr) minmax(310px, 1fr); gap: 24px; }
.conversation-transcript { background: #fbfcfd; max-height: 640px; padding: 22px; }
.conversation-message { padding: 16px; border-radius: 10px; }
.conversation-message.is-internal { background: #fff8ed; border-color: #f1dbb9; }
.conversation-message.is-outgoing { background: #edf5fd; border-color: #d6e6f6; }
.conversation-text { font-size: 14px; line-height: 1.7; }
.conversation-message-meta { font-size: 12px; color: var(--muted); }
.conversation-message-meta strong { font-size: 13px; }
.conversation-action { padding: 20px 22px; }
.conversation-action h3 { margin-top: 8px; }
.conversation-empty { font-size: 13px; padding: 28px 22px; }
.partner-facts { gap: 20px 40px; }
.partner-facts dt { font-size: 12px; }
.partner-facts dd { font-size: 15px; font-weight: 550; }
.partner-section { margin-top: 24px; }
.notification-count { background: #b33443; font-size: 10px; min-width: 17px; top: 1px; right: 0; }
.notification-popover { top: 48px; width: 370px; border-radius: 12px; }
.popover-heading { font-size: 14px; }
.notification-item { font-size: 13px; color: #435767; }
.notification-item.is-unread { background: #edf5fd; color: #19538f; }
.notification-item time { font-size: 11px; color: var(--muted); }
.processing-indicator, .analysis-running { color: #19538f; font-size: 13px; }
.spinner { border-color: #d6e6f6; border-top-color: var(--primary); }
.login-page { background: #f4f6f8; min-height: 100dvh; padding: 30px 20px; }
.login-card { padding: 40px; max-width: 460px; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 12px 48px rgb(23 44 62 / 7%); border-top: 4px solid var(--brand-blue); }
.login-brand { margin-bottom: 36px; }
.login-brand .brand-name { font-size: 28px; }
.login-card h1 { max-width: none; font-size: 26px; line-height: 1.3; }
.login-card .standard-form { padding-top: 28px; }
.login-card .button { min-height: 46px; }
.error-code { color: #19538f; font-size: 14px; }
.error-page > p { color: var(--muted); font-size: 14px; }
.nav-toggle, .nav-close, .nav-backdrop { display: none; }
@media (min-width: 1600px) {
  .page-content { padding: 40px 40px 64px; }
  .deal-grid { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .page-content, .topbar { padding-left: 24px; padding-right: 24px; }
  .deal-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
  .templates-layout, .settings-layout, .prompt-layout { grid-template-columns: minmax(0, 1fr); max-width: none; }
  .conversation-grid { grid-template-columns: 1fr; }
  .upload-template-panel { max-width: none; }
  .report-trigger span { display: none; }
}
@media (max-width: 1000px) {
  .app-shell { display: block; padding-bottom: 0; }
  .sidebar { position: static; width: 100%; height: auto; padding: 20px; align-items: stretch; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 8px; }
  .nav-list { margin-top: 24px; gap: 24px; }
  .nav-item { justify-content: flex-start; padding: 11px 12px; flex-direction: row; font-size: 14px; border-radius: 8px; flex: initial; }
  .nav-item.is-active { box-shadow: inset 3px 0 0 var(--brand-blue); background: #eaf3fc; }
  .sidebar-bottom { margin-top: 24px; justify-content: flex-start; }
  .js .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, calc(100vw - 40px)); height: 100dvh; display: flex; transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility .18s; border-right: 1px solid var(--line); }
  .js .nav-toggle, .js .nav-close { display: inline-flex; }
  .js .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(15 35 51 / 35%); z-index: 35; cursor: default; }
  .js .nav-open .sidebar { transform: translateX(0); visibility: visible; }
  body.nav-open { overflow: hidden; }
  .js .sidebar-bottom { margin-top: auto; }
  .topbar { min-height: 68px; }
  .deal-grid { grid-template-columns: minmax(0, 1fr); }
  .deal-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
  .analysis-panel { grid-row: auto; }
  .chat-panel { height: 620px; min-height: 500px; }
  .data-table { min-width: 0; }
}
@media (max-width: 700px) {
  .page-content { padding: 24px 16px 36px; }
  .topbar { padding: 12px 16px; gap: 10px; min-height: 64px; }
  .topbar-location { gap: 8px; }
  .topbar-actions { gap: 4px; }
  .topbar-divider, .user-name, .topbar .user-avatar, .report-trigger { display: none; }
  .breadcrumb { font-size: 12px; }
  .breadcrumb-current { max-width: 42vw; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .page-heading > .button { min-height: 42px; font-size: 13px; margin-top: 0; padding: 10px 14px; }
  h1, .deal-heading h1 { font-size: 26px; }
  .eyebrow { font-size: 12px; }
  .filter-bar { padding: 16px; gap: 10px; }
  .search-input { min-width: 0; flex: 1 1 100%; max-width: none; }
  .filter-bar select { flex: 1; min-width: 0; }
  .filter-bar > .button { font-size: 13px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-panel .standard-form, .standard-form, .panel-body { padding: 20px; }
  .form-field input, .form-field select, .form-field textarea, input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }
  .form-side-link { margin-left: 0; width: 100%; }
  .form-actions { gap: 10px; }
  .panel-heading { padding: 18px 20px; }
  .panel-heading h2 { font-size: 15px; }
  .table-scroll { overscroll-behavior-x: contain; }
  .data-table:not([data-responsive]) { min-width: 580px; }
  .data-table[data-responsive], .data-table[data-responsive] tbody { display: block; width: 100%; }
  .data-table[data-responsive] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table[data-responsive] tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 18px 20px; border-bottom: 1px solid var(--line); gap: 12px; }
  .data-table[data-responsive] tbody tr:last-child { border-bottom: 0; }
  .data-table[data-responsive] td { display: block; padding: 0; border: 0; width: auto; font-size: 13px; min-width: 0; }
  .data-table[data-responsive] td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
  .data-table[data-responsive] td:first-child::before, .data-table[data-responsive] td[data-label=""]::before { display: none; }
  .data-table[data-responsive] td:last-child:has(> .icon-button) { display: none; }
  .data-table[data-responsive] .table-main-link { font-size: 15px; }
  .data-table[data-responsive] td[colspan] { text-align: center; }
  .data-table[data-responsive] td[colspan] .empty-state { padding: 30px 0; }
  .table-date span { display: inline; margin-left: 8px; }
  .claim-panel { margin-bottom: 20px; }
  .claim-panel .panel-heading { gap: 16px; }
  .claim-panel .form-actions { width: 100%; }
  .deal-meta { font-size: 12px; }
  .deal-main, .deal-aside { gap: 20px; }
  .deal-aside { display: flex; }
  .chat-panel { min-height: 500px; height: 600px; }
  .chat-history { padding: 20px 16px; }
  .chat-message { gap: 9px; }
  .message-avatar { width: 29px; height: 29px; }
  .message-meta strong { font-size: 12px; }
  .message-meta time { font-size: 11px; }
  .message-text { font-size: 14px; }
  .message-assistant .message-body { padding: 10px 12px; }
  .chat-composer { padding: 16px; }
  .chat-composer textarea { font-size: 16px; }
  .button-small, .button-compact, .icon-button, .icon-button.small { min-height: 42px; }
  .icon-button, .icon-button.small { min-width: 42px; }
  .conversation-transcript { padding: 16px; max-height: 520px; }
  .conversation-action { padding: 20px; }
  .conversation-header-actions { gap: 8px; }
  .conversation-inbound-actions { grid-template-columns: 1fr; }
  .template-item { padding: 20px; gap: 12px; }
  .notification-popover { position: fixed; top: 66px; right: 12px; width: calc(100vw - 24px); max-height: min(480px, calc(100dvh - 90px)); }
  .login-card { padding: 30px 24px; }
  .prompt-layout textarea { min-height: 420px; font-size: 16px; }
  .report-files li { flex-wrap: wrap; }
}
@media print {
  .sidebar, .topbar, .nav-backdrop, .chat-composer, .form-actions { display: none !important; }
  .app-shell, .deal-grid, .deal-aside { display: block; }
  .page-content { padding: 0; }
  .chat-panel, .chat-history { height: auto; max-height: none; overflow: visible; }
  .panel { break-inside: avoid; margin-bottom: 16px; }
}

.brand-name { font-size: 27px; letter-spacing: -.8px; font-weight: 720; }
.brand-mark { width: 34px; height: 38px; color: var(--primary); }
.brand-dot { color: #6f9226; }
.login-brand .brand-mark { color: var(--primary); width: 38px; height: 42px; }
.login-brand .brand-name { font-size: 32px; }

.action-heading { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.agent-actions-panel [data-action-status=proposed] { border-left: 3px solid var(--brand-orange); background: #fffaf3; }
.section-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 24px; }
.section-nav a { padding: 8px 14px; border: 1px solid #d9e2ea; border-radius: 7px; background: #fff; color: #435767; font-size: 13px; }
.section-nav a:hover { color: var(--primary); border-color: var(--brand-blue); }
#deal-chat, #agent-actions, #deal-documents, .conversation-message { scroll-margin-top: 96px; }
.quote-meta, .quote-conditions { font-size: 13px; margin-top: 7px; color: var(--muted); }
@media (max-width: 700px) { .section-nav a { min-height: 42px; display: flex; align-items: center; } }

.settings-panel .connection-details { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); gap: 16px 20px; align-items: baseline; }
.settings-panel .connection-details dt, .settings-panel .connection-details dd { margin: 0; }
.settings-panel .form-grid { margin-bottom: 22px; }
.form-grid .form-errors { grid-column: 1 / -1; }
.nav-support { display: none; }
@media (max-width: 1000px) { .nav-support { display: flex; } .sidebar-brand, .sidebar-bottom { flex-shrink: 0; } }
@media (max-width: 700px) { .settings-panel .connection-details { grid-template-columns: 1fr; gap: 4px; } .settings-panel .connection-details dd { margin-bottom: 14px; } .settings-panel .connection-details dd:last-child { margin-bottom: 0; } }
@media (max-width: 1000px) {
  .sidebar .brand { display: flex; }
  .sidebar .sidebar-bottom { display: flex; }
  .sidebar .nav-list { flex-direction: column; height: auto; flex: 0 0 auto; width: 100%; }
  .sidebar .nav-item { height: auto; min-height: 46px; flex: initial; }
  .sidebar .nav-group { display: grid; gap: 4px; }
}

.sidebar { border-top: 0; }
.form-field[data-field=companies] > .field-empty { border: 0; padding: 0; font-size: 13px; color: var(--muted); }
