@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;550;600;650&display=swap');

:root {
  --paper: #fafbfd; --ink: #252e3c; --muted: #606c7d; --line: #d5dce6;
  --accent: #345b89; --pale: #eaf0f8; --strong-line: #a5b6cc;
  font-family: Geist, system-ui, sans-serif;
  color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.7;
}
* { box-sizing: border-box; }
body { margin: 0; height: var(--app-height, 100dvh); display: flex; flex-direction: column; overflow: hidden; }
a { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 15px; border: 1px solid var(--line);
  border-radius: 3px; background: var(--paper); color: var(--accent); font-size: 14px; font-weight: 500;
}
button:hover { background: var(--pale); }
button:disabled { opacity: .65; cursor: progress; }
.btn-primary { color: var(--action-ink); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--action-hover); }
input, textarea { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); padding: 10px 12px; min-height: 44px; }
textarea { width: 100%; resize: none; max-height: 160px; }
label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; }
form { margin: 0; }
p { margin: 0 0 12px; }
h1 { font-size: 22px; line-height: 1.3; font-weight: 550; letter-spacing: -.5px; margin: 0 0 4px; }
h2, h3 { font-size: 16px; line-height: 1.4; font-weight: 550; margin: 0 0 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.lane { width: calc(100% - 48px); max-width: 1440px; margin-inline: auto; }
.app-header { border-bottom: 1px solid var(--line); flex: none; }
.header-content { display: flex; align-items: center; gap: 24px; min-height: 54px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 23px; letter-spacing: -1px; font-weight: 650; color: var(--ink); text-decoration: none; }
.brand img { flex: none; width: 28px; height: 28px; }
.workspace-label { font-size: 12px; color: var(--muted); margin-left: auto; }
.candidate-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 0; }
.screening-view, .application, .screening { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vacancy { flex: none; margin-bottom: 12px; }
.vacancy-heading { display: flex; gap: 12px; align-items: center; }
.company-logo { width: 32px; height: 32px; object-fit: contain; flex: none; }
.vacancy-meta { font-size: 12px; color: var(--muted); margin: 0; }
.vacancy-details { position: relative; }
summary { color: var(--accent); font-size: 12px; padding: 6px 0; }
/* Lucide 0.468.0; full ISC/Feather notice at /static/icons/lucide/LICENSE.txt. */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; display: inline-block; width: 18px; height: 18px; margin-left: 6px; vertical-align: middle; background: currentColor; mask: url('/static/icons/lucide/chevron-down.svg') center / contain no-repeat; }
details[open] > summary::after { transform: rotate(180deg); }
/* candidate.js replaces the correction label: a mask survives both labels. */
[data-correction-toggle]::before { content: ''; width: 18px; height: 18px; flex: none; background: currentColor; mask: url('/static/icons/lucide/square-pen.svg') center / contain no-repeat; }
[data-correction-toggle][aria-expanded=true]::before { mask-image: url('/static/icons/lucide/chevron-up.svg'); }
.vacancy-body { padding: 16px; margin-top: 4px; display: grid; grid-template-columns: minmax(0,1fr) 195px; gap: 24px; border: 1px solid var(--line); border-radius: 3px; max-height: min(32dvh, 280px); overflow: auto; }
.vacancy-copy { min-width: 0; }
.facts { padding-left: 20px; border-left: 1px solid var(--line); margin: 0; }
.facts dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.facts dd { margin: 0 0 14px; font-size: 14px; }
.chat-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 5px; position: relative; background: var(--surface); overflow: hidden; }
.screening-workspace { position: relative; flex: 1; min-height: 0; display: flex; gap: 12px; overflow: hidden; }
.screening-workspace .chat-panel { min-width: 0; }
.profile-panel { position: relative; width: 440px; flex: none; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); overflow: hidden; }
.profile-panel-heading { padding: 10px 18px; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.profile-panel-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 15px; margin: 0; }
.profile-panel-heading h2 .action-icon { color: var(--accent); }
#profile-close { width: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.profile-panel-body { flex: 1; padding: 20px 22px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; font-size: 13px; }
.profile-panel-body > .help-text { margin: 0 0 22px; padding: 11px 12px; background: var(--subtle); border: 1px solid var(--line); border-radius: 4px; line-height: 1.6; }
.profile-panel .profile-review { border: 0; padding: 0; margin: 0; }
.profile-panel .profile-facts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 20px; }
.profile-panel .profile-email { grid-column: 1 / -1; }
.profile-panel .profile-facts dt { font-size: 11px; margin-bottom: 3px; }
.profile-panel h3 { display: flex; align-items: center; gap: 9px; font-size: 13px; margin: 22px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.profile-panel h3 .action-icon { color: var(--muted); }
.profile-panel .profile-identity h3 { font-size: 21px; letter-spacing: -.4px; border: 0; padding: 0; margin: 0 0 20px; }
.profile-panel .profile-review h3:first-child { margin-top: 0; }
.profile-panel .profile-history { padding: 0; list-style: none; }
.profile-panel .profile-history li { margin-bottom: 16px; }
.profile-panel .profile-dates { font-size: 11px; }
.profile-panel-footer { flex: none; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--paper); font-size: 12px; color: var(--muted); }
.profile-panel-footer > span { display: flex; gap: 8px; align-items: center; }
#profile-continue { width: 100%; }
.profile-rail { width: 44px; flex: none; display: none; flex-direction: column; align-items: center; gap: 10px; }
#profile-toggle { position: relative; width: 44px; padding: 0; }
.profile-rail-label { writing-mode: vertical-rl; font-size: 12px; color: var(--muted); }
.profile-update-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; background: var(--accent); border: 1px solid var(--surface); border-radius: 50%; }
.profile-is-closed .profile-rail { display: flex; }
.profile-is-closed .profile-panel { position: absolute; inset: 0 0 0 auto; transform: translateX(105%); visibility: hidden; pointer-events: none; transition: transform .2s ease, visibility 0s .2s; }
.profile-panel { transition: transform .2s ease, visibility 0s; }
.profile-change, .profile-field-changed { background: var(--pale); border-left: 2px solid var(--accent); padding: 6px 8px; }
.profile-change { font-size: 12px; }
.profile-recap { padding: 0; list-style: none; }
.profile-skills { padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.profile-skills li { background: var(--subtle); border: 1px solid var(--line); border-radius: 4px; padding: 3px 9px; font-size: 12px; }
.profile-recap li { margin-bottom: 12px; }
.profile-recap p { margin-bottom: 3px; }
.profile-recap a { font-size: 11px; text-underline-offset: 3px; }
@media (max-width: 959px) {
  .profile-rail { display: flex; }
  .profile-panel { position: absolute; inset: 0 0 0 auto; width: min(440px, calc(100% - 12px)); z-index: 4; box-shadow: -12px 0 36px var(--shadow); }
  .profile-scrim:not([hidden]) { position: absolute; inset: 0; z-index: 3; background: var(--scrim); }
}
.chat-heading { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.chat-heading h2 { font-size: 12px; margin: 0; }
.chat-heading > span { font-size: 12px; color: var(--muted); }
.conversation { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 24px 24px; scroll-padding: 16px; }
.conversation:focus-visible { outline-offset: -3px; }
.conversation > .message, .conversation > [data-evidence-id] { max-width: 720px; margin-inline: auto; }
.message { padding: 16px 0; }
.message-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--accent); }
.message-header img { width: 20px; height: 20px; }
.message-human { padding: 12px 16px; background: var(--pale); margin-block: 8px; border-radius: 3px; }
.message-human .message-header { color: var(--muted); }
.message-human p:last-child { margin-bottom: 0; }
.reading-content { overflow-wrap: anywhere; }
.reading-content p:last-child { margin-bottom: 0; }
.reading-content h1, .reading-content h2, .reading-content h3, .reading-content h4 { font-size: 16px; letter-spacing: normal; line-height: 1.4; }
.reading-content ul, .reading-content ol { padding-left: 24px; }
.reading-content pre { white-space: pre-wrap; }
.help-text { font-size: 12px; color: var(--muted); margin-top: 10px; }
.inline-action { display: inline-block; }
.text-button { min-height: 40px; border-color: transparent; padding: 6px 0; font-size: 12px; }
.email-options { margin-top: 4px; }
.email-options summary { min-height: 40px; }
.email-options form { margin: 8px 0; }
.composer-area { flex: none; border-top: 1px solid var(--line); background: var(--paper); padding: 12px 24px max(12px, env(safe-area-inset-bottom)); max-height: 55%; overflow-y: auto; }
.composer, .summary-composer, .composer-status, .request-error { max-width: 720px; margin-inline: auto; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer-row input, .composer-row textarea { flex: 1; width: 100%; }
.composer-row button { flex: none; }
.composer-status { font-size: 12px; color: var(--muted); margin-block: 0; padding: 8px 0; }
.suggested-reply { min-height: 32px; margin-top: 8px; padding: 3px 10px; font-size: 12px; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#correction-form { margin-top: 12px; }
.resume-upload input[type=file] { padding: 8px; font-size: 12px; }
.profile-review { max-width: 720px; padding: 16px; margin: 0 auto 16px; border: 1px solid var(--line); border-radius: 3px; }
.profile-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 24px; margin: 0 0 20px; }
.profile-facts dt { font-size: 12px; color: var(--muted); }
.profile-facts dd { margin: 0; overflow-wrap: anywhere; }
.profile-review h3 { font-size: 14px; margin-top: 16px; }
.profile-review h3:first-child { margin-top: 0; }
.profile-history { padding-left: 22px; }
.profile-history li { margin-bottom: 12px; }
.profile-dates { display: block; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.request-error:empty { display: none; }
.request-error:not(:empty) { margin-bottom: 10px; color: var(--ink); font-size: 12px; padding: 8px 12px; background: var(--pale); border-left: 2px solid var(--accent); }
.new-message { position: absolute; z-index: 2; top: 48px; right: 16px; background: var(--pale); min-height: 36px; font-size: 12px; box-shadow: 0 2px 8px var(--shadow); }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
.htmx-request { cursor: progress; }
.skip-link { position: absolute; top: -60px; left: 18px; padding: 10px; background: var(--paper); z-index: 100; }
.skip-link:focus { top: 8px; }
h1, p, dd, section { overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .lane { width: calc(100% - 24px); }
  .brand { font-size: 21px; }
  .header-content { gap: 12px; min-height: 50px; }
  .workspace-label { font-size: 11px; }
  .candidate-page { padding: 10px 0 max(8px, env(safe-area-inset-bottom)); }
  h1 { font-size: 18px; }
  .vacancy { margin-bottom: 8px; }
  .vacancy-body { display: flex; flex-direction: column; gap: 16px; padding: 12px; }
  .facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 20px; border: 0; padding: 0; width: 100%; }
  .facts dd { margin: 0; font-size: 13px; }
  .chat-heading { padding: 8px 14px; }
  .conversation { padding: 8px 14px 16px; }
  .message-human { padding: 12px; }
  .composer-area { padding-inline: 12px; }
  .composer-row { gap: 8px; }
  .composer-row button { padding-inline: 10px; max-width: 145px; }
  .composer-row input, .composer-row textarea { font-size: 16px; }
  #correction-form .composer-row { flex-direction: column; align-items: stretch; }
  #correction-form .composer-row button { align-self: flex-end; }
  .profile-facts { grid-template-columns: minmax(0,1fr); }
  .profile-review { padding: 12px; }
}
@media (max-height: 500px) {
  .vacancy-meta, .workspace-label { display: none; }
  .candidate-page { padding-block: 6px; }
  .vacancy { margin-bottom: 4px; }
  .chat-heading { padding-block: 4px; }
  .composer-area { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-panel, .profile-is-closed .profile-panel { transition: none; }
  * { scroll-behavior: auto !important; }
}
