/* TEMCO: restrained conversational application shell. Screen styles only. */
:root {
  --bg:#fff;--canvas:#fff;--surface:#fff;--surface-raised:#fff;
  --surface-hover:#f4f4f4;--surface-subtle:#f7f7f7;--surface-inverse:#202020;
  --text-primary:#202020;--text-secondary:#626262;--text-muted:#737373;
  --border:#e8e8e8;--border-subtle:#efefef;--border-strong:#d4d4d4;
  --brand:#24645a;--brand-hover:#194d45;--brand-soft:#eff5f3;
  --shadow-sm:0 1px 3px #00000005;--shadow-md:0 8px 28px #00000008;
  --shadow-lg:0 14px 48px #00000012;
  --font-sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --radius-lg:18px;--radius-xl:22px;
}
:root[data-theme="dark"],html.theme-dark {
  --bg:#212121;--canvas:#212121;--surface:#262626;--surface-raised:#2c2c2c;
  --surface-hover:#333;--surface-subtle:#292929;--surface-inverse:#eee;
  --text-primary:#ececec;--text-secondary:#bbb;--text-muted:#aaa;
  --border:#3b3b3b;--border-subtle:#343434;--border-strong:#555;
  --brand:#87b8a9;--brand-soft:#253832;
}
body,.app-shell,.app-content {background:var(--canvas);background-image:none}
.topbar {background:var(--surface);border-bottom:1px solid var(--border);box-shadow:none;backdrop-filter:none}
.billing-sidebar {background:var(--surface-subtle);border-right:1px solid var(--border);box-shadow:none}
.brand-mark {background:transparent;box-shadow:none;color:var(--brand);border:1px solid var(--border)}
.brand-copy strong {letter-spacing:-.035em}
.billing-sidebar a {border-radius:10px}
.billing-sidebar a.active {background:var(--surface-hover);color:var(--text-primary);box-shadow:none}
.billing-sidebar .nav-family {background:transparent;border-color:transparent}
.card,.billing-choice,.home-status {background:var(--surface);background-image:none;border:1px solid var(--border);box-shadow:none}
.billing-choice:hover {box-shadow:var(--shadow-md);transform:translateY(-2px)}
.billing-choice::before,.billing-choice::after,.home-header::before {display:none}
.home-header h1 {font-weight:550;letter-spacing:-.045em}
.home-subtitle {color:var(--text-secondary)}
.choice-icon {background:var(--surface-subtle);color:var(--brand);box-shadow:none}
.choice-actions a {background:var(--surface-subtle);border-color:var(--border);box-shadow:none}
.choice-actions a:hover {background:var(--surface-hover)}
.btn {box-shadow:none}
.btn-primary {background:var(--text-primary);color:var(--canvas);border-color:var(--text-primary);box-shadow:none}
.btn-primary:hover {background:var(--text-secondary);border-color:var(--text-secondary);box-shadow:none}
input,select,textarea {background:var(--surface);border-color:var(--border-strong);box-shadow:none}
input:focus,textarea:focus,select:focus {border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
:root[data-theme="dark"] .topbar,:root[data-theme="dark"] .card,:root[data-theme="dark"] .billing-choice,:root[data-theme="dark"] input,:root[data-theme="dark"] select,:root[data-theme="dark"] textarea {background:var(--surface);background-image:none}
:root[data-theme="dark"] .billing-sidebar {background:var(--surface-subtle)}
:root[data-theme="dark"] .choice-actions a {background:var(--surface-subtle)}
:root[data-theme="dark"] .btn-primary {background:var(--text-primary);color:var(--canvas)}

.assistant-launch {position:fixed;right:24px;bottom:22px;z-index:75;display:flex;align-items:center;gap:8px;padding:12px 18px;min-height:48px;border:1px solid var(--border);border-radius:999px;background:var(--text-primary);color:var(--canvas);font:inherit;cursor:pointer;box-shadow:var(--shadow-lg)}
.assistant-launch svg {width:22px;height:22px}
.assistant-panel[hidden] {display:none}
.assistant-panel {position:fixed;right:24px;bottom:84px;width:min(420px,calc(100vw - 32px));height:min(640px,calc(100dvh - 110px));z-index:80;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:22px;background:var(--surface);box-shadow:0 16px 64px #0002;overflow:hidden}
.assistant-header {display:flex;justify-content:space-between;align-items:center;padding:20px;border-bottom:1px solid var(--border);gap:12px}
.assistant-header h2 {margin:0;font-size:15px;font-weight:600}.assistant-header p {margin:4px 0 0;color:var(--text-secondary);font-size:12px}
.assistant-messages {flex:1;min-height:0;overflow:auto;padding:20px;overscroll-behavior:contain}
.assistant-welcome {text-align:center;padding:22px 2px}.assistant-welcome h3 {font-size:21px;letter-spacing:-.03em;margin:18px 0 10px}.assistant-welcome p {font-size:14px;line-height:1.65;color:var(--text-secondary)}
.assistant-spark {font-size:38px;color:var(--brand)}
.assistant-suggestion {margin-top:14px;border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--surface-subtle);color:var(--text-primary);font:inherit;font-size:13px;cursor:pointer}
.assistant-message {margin:0 0 22px;overflow-wrap:anywhere}.assistant-message strong {font-size:12px;font-weight:600;color:var(--text-secondary)}.assistant-message p {white-space:pre-wrap;line-height:1.7;margin:6px 0 0;font-size:14px}.assistant-message.user {margin-left:30px;padding:12px 16px;background:var(--surface-subtle);border-radius:18px}.assistant-message.incomplete {border-left:2px solid var(--warning);padding-left:12px}
.assistant-source {display:block;font-size:12px;margin-top:8px;color:var(--brand);text-decoration:underline;text-underline-offset:3px}
.assistant-status {margin:0;padding:8px 20px;color:var(--text-secondary);font-size:12px;line-height:1.5}
.assistant-composer {margin:6px 16px 10px;padding:8px;display:flex;align-items:end;gap:6px;border:1px solid var(--border-strong);border-radius:20px;background:var(--surface-subtle)}
.assistant-composer textarea {flex:1;min-width:0;border:0;background:transparent;resize:none;font-size:14px;min-height:50px;padding:8px}.assistant-composer .btn {min-width:36px;width:36px;height:36px;min-height:36px;border-radius:50%;padding:0;font-size:22px}.assistant-footer {display:flex;justify-content:space-between;gap:8px;align-items:center;padding:0 20px 14px;font-size:10px;color:var(--text-secondary)}.assistant-footer button {background:none;border:0;color:var(--text-secondary);font:inherit;cursor:pointer;padding:6px 0;text-decoration:underline}
.invoice-generating {position:fixed;inset:0;z-index:200;background:#000;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#e4e4e4;padding:24px;outline:none}
.invoice-generating p {width:min(384px,80vw);font-size:14px;margin:0 0 24px}.invoice-generating canvas {width:min(384px,80vw);height:auto;aspect-ratio:1}.invoice-generating small {font-size:12px;color:#aaa;margin-top:24px;text-align:center}.invoice-generating.waiting canvas {opacity:.45;transition:opacity 200ms}
.generated-document {margin:24px 0 0;animation:invoice-reveal 200ms ease-out}.generated-document h2 {font-size:18px;font-weight:550}.generated-document-canvas {padding:16px;border:1px solid var(--border);border-radius:18px;background:var(--surface-subtle);overflow:hidden}.generated-document-canvas>div {margin:auto}.generated-document iframe {width:794px;height:1123px;border:0;background:white;transform-origin:top left;box-shadow:0 8px 24px #0001}
.invoice-result-reveal {animation:invoice-reveal 200ms ease-out}
@keyframes invoice-reveal {from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(max-width:720px){.assistant-launch {right:16px;bottom:16px}.assistant-panel {right:8px;bottom:8px;width:calc(100vw - 16px);height:calc(100dvh - 16px);border-radius:18px}.assistant-header {padding:16px}.assistant-footer {padding-bottom:max(14px,env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.billing-choice:hover{transform:none}}
/* Header contrast follows the selected theme. */
.topbar,.topbar .brand-copy strong,.topbar .brand-copy small,.topbar .user-chip,.topbar .btn-ghost {color:var(--text-primary)}
.topbar .brand-copy small,.topbar .user-chip {color:var(--text-secondary)}
.topbar .btn-ghost:hover {background:var(--surface-hover);color:var(--text-primary)}
.topbar .user-chip {background:var(--surface-subtle);border-color:var(--border)}
.dash-metric-card,.dash-metric-card.highlight-card,.dash-metric-card.is-warning {background:var(--surface);background-image:none;box-shadow:none}
.dash-metric-card.highlight-card {border-color:var(--border)}
.local-choice .choice-icon {background:var(--surface-subtle);color:var(--brand);box-shadow:none}
:root[data-theme="dark"] .dash-metric-card {background:var(--surface)}
:root:not([data-theme="dark"]) .topbar .theme-icon-dark,:root[data-theme="dark"] .topbar .theme-icon-light {color:var(--text-secondary)}
@media(min-width:721px){.topbar .menu-toggle{display:none}}

/* Complete the authenticated shell using the same theme tokens. */
.app-shell {min-height:calc(100dvh - var(--header-height))}
.app-content {padding-bottom:80px}
.table-wrap,.table-container,.invoice-table,.scheduled-table,.invoice-library-table,
.dash-attention-panel,.dash-attention-row,.attention-row-avatar {background:var(--surface);border-color:var(--border)}
thead,th {background:var(--surface-subtle);color:var(--text-secondary)}
td {color:var(--text-primary);border-color:var(--border)}
.btn-secondary,.pdf-action-btn {background:var(--surface-subtle);color:var(--text-primary);border-color:var(--border)}
.btn svg,.pdf-action-btn svg,.choice-actions svg,.home-footnote svg {fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.page-header h1 {font-weight:550;letter-spacing:-.04em;line-height:1.15}
.page-header p,.page-description {color:var(--text-secondary);line-height:1.6}
.attention-row-action {display:flex;flex-wrap:wrap;gap:8px}
.attention-row-action form {margin:0}
.assistant-panel {transform-origin:bottom right;box-shadow:0 18px 70px #0003}
.assistant-panel[data-state="opening"] {animation:assistant-open 300ms cubic-bezier(.2,.8,.2,1) both}
.assistant-panel[data-state="closing"] {animation:assistant-close 180ms ease-in both;pointer-events:none}
@keyframes assistant-open {from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}
@keyframes assistant-close {from{opacity:1;transform:none}to{opacity:0;transform:translateY(10px) scale(.98)}}
@media(max-width:720px){.assistant-panel{transform-origin:bottom center}}

.page-header .eyebrow {color:var(--brand)}
:root[data-theme="dark"] .compact-invoice-table th {background:var(--surface-subtle)}
:is(:root[data-theme="dark"],html.theme-dark) :is(.recent-table-card,.dash-attention-section,.dash-attention-row,.attention-row-avatar,.metric-subtag,.period-badge,.attention-period-pill,.action-mini-icon,.pdf-action-btn,.btn-secondary) {background:var(--surface-subtle);border-color:var(--border);color:var(--text-primary);box-shadow:none}
:is(:root[data-theme="dark"],html.theme-dark) .compact-invoice-table th {color:var(--text-secondary);border-color:var(--border)}
:is(:root[data-theme="dark"],html.theme-dark) :is(.pdf-action-btn,.dash-attention-row,.choice-actions a):hover {background:var(--surface-hover);border-color:var(--border-strong);box-shadow:none}
:is(:root[data-theme="dark"],html.theme-dark) .billing-sidebar a.active {background:var(--surface-hover);color:var(--text-primary);border-color:var(--border);box-shadow:none}
:is(:root[data-theme="dark"],html.theme-dark) .nav-family.active-family {background:transparent}
:is(:root[data-theme="dark"],html.theme-dark) :is(input,select,textarea):focus {background:var(--surface);border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}

:is(:root[data-theme="dark"],html.theme-dark) body {background:var(--canvas);background-image:none}
/* The launcher and chat share one growing surface. */
.assistant-shell {position:fixed;right:24px;bottom:22px;width:54px;height:54px;border-radius:27px;background:var(--text-primary);z-index:80;box-shadow:0 12px 40px #0003;overflow:hidden;transition:width 360ms cubic-bezier(.16,1,.3,1),height 360ms cubic-bezier(.16,1,.3,1),border-radius 360ms,background-color 180ms}
.assistant-shell[data-open="true"] {width:min(480px,calc(100vw - 32px));height:min(720px,calc(100dvh - 44px));border-radius:22px;background:var(--surface);border:1px solid var(--border)}
.assistant-shell[data-state="closing"] {transition-duration:240ms}
.assistant-shell[data-open="true"].is-review {width:min(760px,calc(100vw - 32px));height:min(840px,calc(100dvh - 44px))}
.assistant-shell .assistant-launch {position:absolute;inset:0;width:54px;height:54px;min-height:54px;border:0;border-radius:50%;padding:0;display:grid;place-items:center;box-shadow:none;transition:opacity 100ms,transform 180ms}
.assistant-shell[data-open="true"] .assistant-launch {opacity:0;pointer-events:none;transform:scale(.75)}
.assistant-shell .assistant-panel {position:absolute;inset:0;right:auto;bottom:auto;width:100%;height:100%;max-height:100%;border:0;border-radius:inherit;box-shadow:none;animation:none;transform:none}
.assistant-shell .assistant-panel>* {opacity:0;transform:translateY(5px);transition:opacity 160ms,transform 200ms}
.assistant-shell[data-open="true"] .assistant-panel>* {opacity:1;transform:none;transition-delay:140ms}
.assistant-shell[data-state="closing"] .assistant-panel>* {opacity:0;transition-delay:0ms}
.assistant-shell .assistant-tools {padding:8px 16px 0;flex-shrink:0}
.assistant-shell .assistant-composer {flex-shrink:0}
.assistant-shell .assistant-composer .audio-action {flex-shrink:0;background:transparent;color:var(--text-secondary);font-size:14px}
.audio-action svg {width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6}
.assistant-recording {padding:8px 16px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:12px;background:var(--surface-subtle)}
.assistant-recording[hidden],.assistant-tools button[hidden],.assistant-composer button[hidden] {display:none}
.assistant-recording canvas {height:32px;width:100%;max-width:320px}
.assistant-invoice-card {padding:16px;margin:14px 0;border:1px solid var(--border);border-radius:16px;background:var(--surface-subtle);overflow:hidden;animation:invoice-reveal 200ms ease-out}
.assistant-invoice-card h3 {margin:0 0 14px;font-size:17px;font-weight:600;letter-spacing:-.02em}
.assistant-invoice-card p {font-size:13px;line-height:1.6;color:var(--text-secondary)}
.chat-card-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.chat-card-actions .btn {font-size:13px;min-height:40px}
.chat-field-form {display:grid;gap:10px}.chat-field-form label {font-size:12px;color:var(--text-secondary)}
.chat-summary {display:grid;gap:1px}.chat-summary-row {text-align:left;color:var(--text-primary);background:transparent;border:0;border-bottom:1px solid var(--border);padding:10px 0;overflow-wrap:anywhere;font:inherit;font-size:13px;cursor:pointer}
.chat-summary-row:hover {color:var(--brand)}
.chat-review-generating {border-radius:14px;background:#000;color:#eee;padding:20px;text-align:center}
.chat-review-generating canvas {width:min(100%,384px);height:auto;aspect-ratio:1}.chat-review-generating p {color:#eee}.chat-review-generating small {color:#aaa}
.chat-review-generating.waiting canvas {opacity:.4}
.chat-document {padding:8px;overflow:auto;background:var(--canvas);border:1px solid var(--border);border-radius:12px}
.chat-document-page {margin:auto}.chat-document iframe {width:794px;height:1123px;transform-origin:top left;display:block;background:#fff;border:0}
.chat-document-zoom .chat-document-page {width:794px!important;height:1123px!important}.chat-document-zoom iframe {transform:none!important}
.assistant-invoice-card .chat-total {font-weight:600;color:var(--text-primary)}
@media(max-width:720px){.assistant-shell {right:16px;bottom:calc(16px + var(--keyboard-offset,0px))}.assistant-shell[data-open="true"],.assistant-shell[data-open="true"].is-review {right:8px;bottom:calc(8px + var(--keyboard-offset,0px));width:calc(100vw - 16px);height:var(--assistant-height,calc(100dvh - 16px));border-radius:18px}.assistant-shell .assistant-messages{padding:14px}.assistant-shell .assistant-footer{padding-bottom:max(14px,env(safe-area-inset-bottom))}.assistant-shell .assistant-composer{margin-inline:10px}}

.chat-document {max-height:420px;overscroll-behavior:contain}
@media(max-width:720px){.chat-document{max-height:260px}}
.assistant-shell .assistant-launch {inset:auto 0 0 auto;z-index:1}
.assistant-shell .assistant-panel {background:transparent}
/* Borradores rápidos, revisión y catálogos conservan los temas del producto. */
.chat-mode-switch,.chat-review-toolbar .chat-card-actions{display:flex;gap:8px;flex-wrap:wrap}
.chat-mode-switch{margin-bottom:16px}.chat-mode-switch [aria-pressed=true]{outline:2px solid var(--accent,#10a99a);outline-offset:1px}
.chat-fast-form fieldset{min-width:0;border:1px solid var(--border,#676767);border-radius:14px;padding:14px;margin:12px 0}.chat-fast-form legend{padding:0 6px;font-weight:650}
.chat-fast-form input,.chat-catalog input{width:100%;min-height:40px}.chat-catalog{padding:10px 0;border-bottom:1px solid var(--border,#676767);margin-bottom:12px}.chat-catalog label{display:block;margin-bottom:6px}.chat-catalog button{margin-top:8px}.chat-catalog-results{max-height:180px;overflow:auto}.chat-field-error{color:var(--danger,#d95555);font-size:13px;margin:6px 0}
.chat-review-toolbar{position:sticky;bottom:0;z-index:2;padding:12px;background:var(--surface,#262626);border:1px solid var(--border,#676767);border-radius:14px;margin-top:10px;box-shadow:0 -6px 24px #0002}.chat-review-toolbar .chat-total{margin:0 0 8px}.chat-document-expanded{max-height:none!important;height:calc(var(--assistant-height,90vh) - 240px)!important}.document-expanded .assistant-welcome,.document-expanded .assistant-composer{display:none}
.assistant-message p{margin:6px 0}.assistant-message ul{padding-left:20px;margin:8px 0}.assistant-message code{white-space:pre-wrap;overflow-wrap:anywhere}.assistant-message a{text-decoration:underline}
.dashboard-upcoming{margin:24px 0}.dashboard-upcoming ul{list-style:none;padding:0}.dashboard-upcoming li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--border,#676767)}.dashboard-upcoming time{color:var(--text-secondary,#a8a8a8);font-size:13px}.home-header-badge{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
@media(max-width:720px){.document-expanded{width:calc(100vw - 16px)!important;height:var(--assistant-height)!important}.chat-review-toolbar{padding:10px}.dashboard-upcoming li{align-items:flex-start;flex-direction:column}.simple-filter-bar{flex-wrap:wrap}.simple-filter-bar .form-group{min-width:120px}}

.assistant-capabilities{font-size:11px;color:var(--text-secondary);padding:0 16px;margin:6px 0;flex-shrink:0}.chat-field-error{color:#b33c3c}:root[data-theme="dark"] .chat-field-error,html.theme-dark .chat-field-error{color:#ffa9a9}

.invoice-detail-document{margin-bottom:24px}.invoice-detail-document iframe{display:block;width:100%;height:70vh;min-height:380px;border:1px solid var(--border);background:#fff;border-radius:12px}.invoice-detail-document .card-header{flex-wrap:wrap;gap:12px}.chat-review-changes,.chat-other-tab{border:1px solid var(--border-strong);border-radius:12px;padding:12px;margin:12px 0;background:var(--surface-subtle)}.chat-review-changes ul{padding-left:20px;overflow-wrap:anywhere}.scheduled-table small{display:block;color:var(--text-secondary);margin-top:4px}@media(max-width:720px){.invoice-detail-document iframe{height:60vh}.invoice-detail-document .page-actions{flex-wrap:wrap}}
/* Cohesive screen presentation; invoice HTML and PDFs stay untouched. */
.page-header h1,.home-header h1 {font-size:clamp(28px,3vw,40px);line-height:1.15}
.page-header {gap:20px;margin-bottom:24px}.page-header .subtitle {font-size:14px}
.housing-choice .choice-icon,.local-choice .choice-icon {background:var(--brand-soft);color:var(--brand);border:1px solid var(--border);box-shadow:none}
.choice-actions .action-mini-icon {background:var(--surface);color:var(--brand);box-shadow:none}
.card-title {font-weight:600;letter-spacing:-.02em}.btn {border-radius:10px;font-weight:550}
.btn:focus-visible,summary:focus-visible,.assistant-conversation-toggle:focus-visible {outline:2px solid var(--brand);outline-offset:3px}
.assistant-invoice-card {border:0;background:transparent;padding:0;margin:8px 0 0;overflow:visible}
.assistant-invoice-card h3 {font-size:18px;margin-bottom:16px}.assistant-invoice-card p {font-size:14px}
.chat-fast-form fieldset {border:0;border-top:1px solid var(--border);border-radius:0;padding:16px 0;margin:16px 0}
.chat-mode-switch [aria-pressed=true] {outline-color:var(--brand)}
.assistant-shell.has-draft .assistant-tools {display:none}
.assistant-shell.is-review .assistant-messages {padding:14px 18px}
.assistant-shell.is-review .assistant-invoice-card {display:flex;flex-direction:column}
.assistant-shell.is-review:not(.review-conversation) .assistant-welcome,.assistant-shell.is-review:not(.review-conversation) .assistant-message {display:none}
.assistant-shell.is-review:not(.review-conversation) .assistant-composer,.assistant-shell.is-review .assistant-footer {display:none}
.assistant-conversation-toggle {align-self:flex-start;background:none;border:0;color:var(--text-secondary);font:inherit;font-size:13px;cursor:pointer;padding:8px 18px}
.assistant-conversation-toggle[hidden] {display:none}
.chat-review-toolbar {border:0;border-top:1px solid var(--border);border-radius:0;box-shadow:none;margin-top:12px;padding:12px 0;background:var(--surface)}
.chat-confirm-actions {margin-top:8px}.chat-confirm-actions .btn {flex:1}
.chat-review-secondary {margin-top:12px;font-size:13px;color:var(--text-secondary)}.chat-review-secondary summary {cursor:pointer;min-height:32px;padding:6px 0}.chat-review-secondary .chat-card-actions {margin-top:4px}
.document-controls {display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 10px;flex-shrink:0}.document-controls .btn {min-height:36px;font-size:12px;padding:6px 9px}.document-controls output {font-size:12px;color:var(--text-secondary);min-width:44px;text-align:center}.document-controls [aria-pressed=true] {background:var(--surface-hover);color:var(--text-primary)}
.document-viewport,.chat-document.document-viewport {position:relative;overflow:auto;overscroll-behavior:contain;background:var(--surface-subtle);border:0;border-radius:12px;padding:16px;height:clamp(280px,48dvh,480px);max-height:none;flex-shrink:0}
.document-page,.chat-document-page {position:relative;margin:0 auto;box-shadow:0 2px 12px #0002;background:white}
.document-viewport iframe,.invoice-detail-document .document-viewport iframe {display:block;width:794px;height:1123px;min-height:0;border:0;border-radius:0;background:#fff;transform-origin:top left}
.invoice-detail-document .document-viewport {height:72dvh;min-height:380px}
.document-expanded .chat-document.document-viewport {height:calc(var(--assistant-height,90dvh) - 250px)!important}
.document-expanded .assistant-capabilities,.document-expanded .assistant-status,.document-expanded .assistant-conversation-toggle {display:none}
.document-fullscreen {position:fixed;inset:12px;z-index:150;margin:0!important;display:flex;flex-direction:column;overflow:auto;background:var(--surface)}
.document-fullscreen .document-viewport {flex:1;min-height:200px;height:auto}
.delivery-status {display:flex;gap:10px;align-items:center;margin:0 0 20px;font-size:13px;color:var(--text-secondary)}.delivery-status>div {display:flex;align-items:center;flex-wrap:wrap;gap:10px}.delivery-status strong {color:var(--text-primary);padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface-subtle);font-weight:550}.delivery-status-attention {padding:14px;border:1px solid var(--border-strong);border-radius:12px;background:var(--surface-subtle)}
.assistant-capabilities {display:flex;gap:12px;padding:0 18px;margin:4px 0;font-size:12px}.assistant-capabilities details {position:relative}.assistant-capabilities summary {cursor:pointer;list-style:none;min-height:28px;display:flex;align-items:center;gap:5px}.assistant-capabilities summary::-webkit-details-marker {display:none}.assistant-capabilities summary::before {content:"";width:6px;height:6px;background:var(--text-secondary);border-radius:50%}.assistant-capabilities [data-available=true] summary::before {background:var(--brand)}.assistant-capabilities details>span {position:absolute;bottom:32px;left:0;z-index:5;width:max-content;max-width:210px;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--surface-raised,var(--surface));color:var(--text-primary);box-shadow:var(--shadow-md)}
@media(max-width:720px){.page-header h1,.home-header h1 {font-size:28px}.assistant-shell.is-review .assistant-messages {padding:12px}.document-controls .btn {font-size:12px;padding:6px}.chat-document.document-viewport {height:42dvh;min-height:220px}.document-fullscreen {inset:8px;padding:12px}.invoice-detail-document .document-viewport {min-height:280px}.delivery-status>div {align-items:flex-start}.delivery-status span {line-height:1.6}}
:is(:root[data-theme="dark"],html.theme-dark) .housing-choice .choice-icon {background:var(--brand-soft);color:var(--brand);border-color:var(--border);box-shadow:none}
.local-choice .choice-icon {color:#896329;background:#f5f1e8;border-color:var(--border);box-shadow:none}
:is(:root[data-theme="dark"],html.theme-dark) .local-choice .choice-icon {color:#c8b586;background:#302d27;border-color:var(--border);box-shadow:none}
.billing-choice:hover .choice-icon {box-shadow:none}
@media(max-width:720px){.document-controls .btn {min-height:44px}.assistant-capabilities summary {min-height:36px}}
/* Motion language: short, spatially anchored, interruptible. */
:root {--motion-quick:140ms;--motion-normal:220ms;--motion-ease:cubic-bezier(.16,1,.3,1)}
.assistant-shell {transition:background-color 180ms,box-shadow 220ms;border-radius:27px}
.assistant-shell[data-state="open"] {transition:width 260ms var(--motion-ease),height 260ms var(--motion-ease),background-color 180ms,box-shadow 220ms}
.assistant-shell:is([data-state="opening"],[data-state="closing"]) {will-change:clip-path}
.assistant-shell .assistant-panel>* {transition:opacity 140ms ease,transform 220ms var(--motion-ease);transform:translateY(8px)}
.assistant-shell[data-open="true"] .assistant-panel>* {transition-delay:100ms}
.assistant-shell[data-open="true"] .assistant-header {transition-delay:70ms}
.assistant-shell[data-open="true"] .assistant-messages {transition-delay:110ms}
.assistant-shell[data-open="true"] :is(.assistant-composer,.assistant-footer) {transition-delay:140ms}
.assistant-shell[data-state="closing"] .assistant-panel>* {opacity:0;transform:translateY(6px);transition-delay:0ms;pointer-events:none}
.assistant-shell .assistant-launch {transition:opacity 120ms,transform 220ms var(--motion-ease);transform-origin:center}
.assistant-shell[data-open="true"] .assistant-launch {transform:rotate(35deg) scale(.8)}
.assistant-shell[data-state="closing"] .assistant-launch {opacity:1;transform:rotate(0deg) scale(1);transition-delay:80ms}
.assistant-shell:not([data-open="true"]):hover {box-shadow:0 8px 28px #0003}
.assistant-shell:not([data-open="true"]) .assistant-launch:hover svg {transform:rotate(12deg) scale(1.06)}
.assistant-launch svg {transition:transform 220ms var(--motion-ease)}
.btn,.assistant-suggestion,.chat-summary-row,.billing-sidebar a,.choice-actions a {transition:background-color var(--motion-quick),border-color var(--motion-quick),color var(--motion-quick),box-shadow var(--motion-normal),transform var(--motion-normal) var(--motion-ease)}
@media(hover:hover) and (pointer:fine){.btn:not(:disabled):hover {transform:translateY(-1px)}.billing-choice {transition:transform 240ms var(--motion-ease),box-shadow 240ms,border-color 160ms}.billing-choice:hover {transform:translateY(-3px)}.choice-actions a:hover {transform:translateX(2px)}}
.btn:not(:disabled):active,.assistant-launch:active svg {transform:scale(.97);transition-duration:80ms}
.btn:disabled {transform:none}
:is(.invoice-library-table,.scheduled-table,.compact-invoice-table) tbody tr {transition:background-color 140ms}
:is(.invoice-library-table,.scheduled-table,.compact-invoice-table) tbody tr:hover {background:var(--surface-hover)}
.home-header,.page-header {animation:temco-rise 300ms var(--motion-ease) both}
.dash-metrics-strip .dash-metric-card {animation:temco-rise 320ms var(--motion-ease) both}
.dash-metrics-strip .dash-metric-card:nth-child(2) {animation-delay:30ms}.dash-metrics-strip .dash-metric-card:nth-child(3) {animation-delay:60ms}.dash-metrics-strip .dash-metric-card:nth-child(4) {animation-delay:90ms}
.assistant-message {animation:temco-rise 180ms var(--motion-ease) both}
.assistant-invoice-card {animation:temco-rise 200ms var(--motion-ease) both}
.chat-review-generating {animation:temco-fade 160ms ease-out both}
.invoice-result-reveal {animation:temco-document 200ms var(--motion-ease) both}
.status-dot,.home-status .status-dot {animation:none}
@keyframes temco-rise {from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes temco-fade {from{opacity:0}to{opacity:1}}
@keyframes temco-document {from{opacity:0;transform:translateY(5px) scale(.995)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.assistant-shell,.assistant-shell[data-state="open"] {transition:none!important;will-change:auto}.assistant-shell .assistant-panel>* {transform:none!important}.btn:hover,.billing-choice:hover,.choice-actions a:hover,.assistant-launch svg {transform:none!important}}
.assistant-shell[data-state="closing"] .assistant-launch {pointer-events:auto}
::view-transition-old(root) {animation:temco-page-out 100ms ease-out both}
::view-transition-new(root) {animation:temco-fade 160ms ease-out both}
@keyframes temco-page-out {to{opacity:0}}
@media(prefers-reduced-motion:reduce){
  @view-transition {navigation:none}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*) {animation:none!important}
}
@starting-style {
  .assistant-shell[data-open="true"] .assistant-panel>* {opacity:0;transform:translateY(8px)}
}
