:root {
  color-scheme: light;
  --ink: #263c40;
  --muted: #617477;
  --page: #f1f5f5;
  --line: #dce6e6;
  --brand: #0bbcc1;
  --accent: #087b7f;
  --accent-dark: #055e60;
  --accent-soft: #eaf7f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-size: 18px;
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; color: var(--ink); background: var(--page); }
button, textarea, input { font: inherit; }
button { cursor: pointer; transition: background .15s, border-color .15s; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.app-shell { position: relative; display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: white; }
.topbar { display: flex; flex: 0 0 auto; align-items: center; gap: 18px; padding: 12px 28px; border-bottom: 1px solid var(--line); }
.brand-logo { display: block; width: 76px; height: 76px; object-fit: contain; }
.brand-title { min-width: 0; }
.eyebrow { display: block; margin: 0 0 5px; color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 1.2rem; font-weight: 650; letter-spacing: -.025em; }
#new-conversation { margin-left: auto; }
.secondary-button, .primary-button, .document-button { min-height: 48px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 9px; font-size: .9rem; font-weight: 650; }
.secondary-button { color: var(--ink); background: white; }
.secondary-button:hover:enabled { background: var(--page); border-color: #b7caca; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; color: white; background: var(--accent); border-color: var(--accent); }
.primary-button:hover:enabled { background: var(--accent-dark); }
.workspace { display: grid; grid-template-columns: clamp(300px, 22vw, 380px) minmax(0, 1fr); flex: 1; min-height: 0; }
.documents-panel { position: relative; padding: 28px 22px; overflow-y: auto; border-right: 1px solid var(--line); background: #f8fafa; }
.panel-heading h2 { margin: 0 0 8px; font-size: 1.06rem; letter-spacing: -.02em; }
.panel-heading > p, .dossier-tip p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.document-slots { display: grid; gap: 14px; margin-top: 24px; }
.document-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.document-card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.file-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 36px; border: 1px solid #b8dfde; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: .65rem; font-weight: 750; }
.document-card h3 { margin: 0; font-size: .95rem; font-weight: 650; }
.document-state { min-width: 0; margin-bottom: 12px; }
.candidate-card + .candidate-card { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
#compare-candidates { margin-top: 16px; }
.document-name { margin: 0 0 6px; font-size: .9rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.document-meta, .empty-document { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.6; overflow-wrap: anywhere; }
.document-badge { display: inline-block; margin-bottom: 7px; padding: 4px 8px; border-radius: 5px; color: var(--accent-dark); background: var(--accent-soft); font-size: .75rem; font-weight: 650; }
.document-badge.pending { color: #805519; background: #fff5df; }
.document-button { width: 100%; color: var(--accent-dark); background: white; border-color: #b5d6d5; }
.document-button:hover:enabled { background: var(--accent-soft); border-color: var(--accent); }
.document-actions { display: grid; gap: 6px; }
.text-button { min-height: 42px; padding: 8px 0; border: 0; color: var(--accent); background: transparent; font-size: .85rem; font-weight: 600; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.format-note { margin: 16px 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.document-status { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.6; }
.dossier-tip { margin-top: 24px; padding: 14px; border-radius: 9px; background: #edf3f3; }
.dossier-tip strong { display: block; margin-bottom: 5px; font-size: .85rem; font-weight: 650; }
.dossier-tip p { font-size: .82rem; }
.chat-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-heading { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 32px; border-bottom: 1px solid #edf2f2; }
.chat-heading h2 { margin: 0; font-size: .95rem; font-weight: 600; }
#activity-status { max-width: 60%; color: var(--muted); font-size: .8rem; text-align: right; overflow-wrap: anywhere; }
#activity-status::before { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); content: ""; }
.conversation { flex: 1; min-height: 0; padding: 32px clamp(20px, 4vw, 60px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.message { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: .6rem; font-weight: 750; }
.bubble { min-width: 0; max-width: calc(100% - 42px); padding: 3px 0; }
.message-author { margin: 0 0 8px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.bubble p { line-height: 1.75; }
.answer-text { font-size: 1rem; overflow-wrap: anywhere; }
.answer-text p { margin: 0; white-space: pre-wrap; }
.answer-text > * + * { margin-top: 14px; }
.answer-text h3 { margin-bottom: 9px; font-size: 1.12rem; line-height: 1.5; }
.answer-text ul, .answer-text ol { padding-left: 22px; line-height: 1.75; }
.answer-text li + li { margin-top: 6px; }
.answer-text code { padding: 2px 4px; border-radius: 4px; background: var(--page); font-size: .83em; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.answer-text table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.answer-text th, .answer-text td { min-width: 100px; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }
.answer-text th { background: var(--page); font-weight: 650; }
.user-message { justify-content: flex-end; }
.user-message .bubble { padding: 14px 18px; border: 1px solid #d7e9e7; border-radius: 14px 14px 3px 14px; background: #edf6f5; }
.user-message .message-author { color: var(--accent-dark); }
.welcome-message { justify-content: center; margin: clamp(20px, 7vh, 80px) 0 30px; text-align: center; }
.welcome-message .avatar, .welcome-message .message-author { display: none; }
.welcome-bubble { width: 720px; max-width: 100%; }
.welcome-mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 22px; border: 1px solid #c8e7e5; border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-size: 1.4rem; }
.welcome-bubble h2 { margin: 0 0 12px; font-size: clamp(1.35rem, 2.3vw, 1.85rem); font-weight: 600; letter-spacing: -.04em; }
.welcome-bubble .answer-text { max-width: 600px; margin: auto; color: var(--muted); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.suggestion { min-height: 44px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: .85rem; }
.suggestion:hover:enabled { border-color: var(--accent); background: var(--accent-soft); }
.progress-bubble { color: var(--muted); }
.progress-bubble::after { display: block; width: 30px; height: 3px; margin-top: 12px; border-radius: 3px; background: var(--brand); animation: pulse 1s ease-in-out infinite; content: ""; }
@keyframes pulse { 50% { opacity: .3; } }
.sources, .requirements { margin-top: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--accent); font-size: .88rem; font-weight: 600; }
.sources blockquote { margin: 12px 0 0; padding: 12px 14px; border-left: 3px solid #b6deda; color: var(--muted); background: #f6f9f9; font-size: .86rem; overflow-wrap: anywhere; }
.sources blockquote p { margin: 5px 0 0; white-space: pre-wrap; }
.requirement-card { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.requirement-card h3 { margin: 0 0 8px; font-size: .95rem; }
.requirement-card p { margin: 6px 0; font-size: .9rem; }
.requirement-status { color: var(--accent-dark); font-weight: 600; }
.verification-note { margin: 14px 0 0; color: var(--muted); font-size: .83rem; line-height: 1.6; }
.copy-button { min-height: 44px; margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: white; font-size: .82rem; }
.copy-button:hover { color: var(--accent); border-color: var(--accent); }
.composer-area { flex: 0 0 auto; padding: 0 clamp(16px, 3vw, 40px) 12px; background: white; }
.composer { position: relative; padding: 12px; border: 1px solid #bfcece; border-radius: 14px; background: white; box-shadow: 0 4px 20px rgb(38 60 64 / 5%); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.composer textarea { display: block; width: 100%; min-height: 80px; max-height: 160px; padding: 8px; resize: none; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 1rem; line-height: 1.6; }
.composer textarea::placeholder { color: var(--muted); }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 6px; }
#composer-help { color: var(--muted); font-size: .75rem; }
.session-note { margin: 10px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; text-align: center; }
.error, .pending-notice { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; font-size: .87rem; line-height: 1.55; overflow-wrap: anywhere; }
.error { max-height: 110px; overflow-y: auto; border: 1px solid #e7c5c0; color: #8d3429; background: #fff4f1; }
.pending-notice { color: #73541f; background: #fff8e9; }
dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 26px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: 0 24px 100px rgb(15 40 43 / 20%); }
dialog::backdrop { background: rgb(22 47 50 / 35%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; font-size: 1.1rem; }
.dismiss-button { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 1.4rem; }
#ao-dialog-help { color: var(--muted); font-size: .83rem; line-height: 1.6; }
dialog label { display: block; margin: 18px 0 8px; font-size: .8rem; font-weight: 600; }
dialog textarea { display: block; width: 100%; min-height: 180px; max-height: 40dvh; padding: 12px; resize: vertical; border: 1px solid #b8caca; border-radius: 9px; color: var(--ink); font-size: .86rem; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.field-error { color: #8d3429; font-size: .78rem; }
#document-preview { width: min(960px, calc(100% - 32px)); }
.preview-name { margin: 16px 0 8px; color: var(--accent-dark); font-size: .9rem; font-weight: 650; overflow-wrap: anywhere; }
#preview-help { color: var(--muted); font-size: .85rem; line-height: 1.6; }
.extracted-text { max-height: 50dvh; margin: 16px 0 0; padding: 18px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #f8fafa; font-family: inherit; font-size: 1rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.notyf { padding: 24px; }
.notyf__toast { width: min(440px, 100%); max-width: 440px; padding: 0 18px; border-radius: 12px; box-shadow: 0 8px 28px rgb(38 60 64 / 18%); }
.notyf__wrapper { padding-block: 18px; }
.notyf__message { min-width: 0; font-size: .88rem; line-height: 1.6; overflow-wrap: anywhere; }
.notyf__icon { flex-shrink: 0; }
.notyf__dismiss { width: 40px; margin-right: -18px; }
.notyf__toast--dismissible .notyf__wrapper { padding-right: 38px; }
.notyf__dismiss-btn { opacity: .8; }
.notyf__dismiss-btn:focus-visible { outline: 2px solid white; outline-offset: -5px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 270px minmax(0, 1fr); }
  .documents-panel { padding: 24px 16px; }
  .chat-heading { padding: 20px; }
  #composer-help { max-width: 155px; line-height: 1.5; }
}
@media (max-width: 680px) {
  :root { font-size: 16px; }
  html, body { height: auto; overflow: visible; }
  .app-shell { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; border: 0; }
  .topbar { gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
  .brand-logo { width: 48px; height: 48px; }
  .topbar h1 { font-size: 1rem; }
  .brand-title .eyebrow { font-size: .55rem; }
  #new-conversation { padding: 8px 10px; font-size: .8rem; }
  .workspace { display: flex; flex-direction: column; }
  .documents-panel { padding: 18px 14px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-heading .eyebrow, .panel-heading > p, .dossier-tip { display: none; }
  .panel-heading h2 { font-size: .9rem; }
  .document-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
  .document-card { padding: 12px; }
  .document-card-heading { gap: 7px; }
  .document-card h3 { font-size: .85rem; }
  .file-icon { width: 25px; height: 30px; font-size: .58rem; }
  .document-button { padding: 8px; font-size: .85rem; }
  .text-button { font-size: .8rem; }
  .format-note { margin: 10px 0; font-size: .75rem; }
  .format-note br { display: none; }
  .document-status { padding-top: 10px; font-size: .8rem; }
  .chat-panel { min-height: 65dvh; }
  .chat-heading { padding: 16px; }
  .conversation { flex: 1 0 auto; padding: 24px 16px; overflow: visible; }
  .welcome-message { margin-top: 20px; }
  .bubble { max-width: calc(100% - 36px); }
  .message { gap: 8px; }
  .welcome-bubble { max-width: 100%; }
  .avatar { width: 28px; height: 28px; }
  .composer-area { padding: 12px 12px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid #edf2f2; }
  #composer-help { max-width: 150px; font-size: .7rem; }
  .session-note { font-size: .7rem; }
  .composer textarea, dialog textarea { font-size: 1rem; }
  dialog { padding: 18px; }
  .notyf { padding: 12px; }
  .notyf__toast { width: 100%; max-width: 440px; border-radius: 10px; }
  .notyf__message { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .notyf__toast, .notyf__message, .notyf__icon, .notyf__dismiss { opacity: 1; transform: none; }
  /* Notyf needs animationend to remove dismissed notifications from the DOM. */
  .notyf__toast--disappear { animation: notification-dismiss .01ms linear forwards !important; }
}
@keyframes notification-dismiss { to { opacity: 0; } }
