:root {
  --bg: #f7f7f8; --panel: #ffffff; --ink: #111114; --dim: #6e6e73; --line: #e5e5ea;
  --me: #0a84ff; --me-ink: #ffffff; --them: #e9e9eb; --them-ink: #111114; --ok: #047857; --bad: #b91c1c; --warn: #b45309;
  --radius: 20px; --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --panel: #1c1c1e; --ink: #f2f2f7; --dim: #98989f; --line: #2c2c2e; --them: #262629; --them-ink: #f2f2f7; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.layout { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .layout { grid-template-columns: minmax(0, 1fr) 380px; } }

.chat { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #34c759, #0a84ff); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.who { flex: 1; min-width: 0; }
.who .name, .who .status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name { font-weight: 600; font-size: 16px; }
.status { font-size: 12px; color: var(--dim); }
.status.on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #34c759; margin-right: 5px; }
.jobsel { min-width: 0; }
.jobsel select { max-width: 46vw; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); padding: 0 10px; font-size: 15px; }
.hr-toggle { min-height: 44px; border: 0; border-radius: 12px; padding: 0 12px; background: #eef4ff; color: #0b5ed7; font-weight: 600; font-size: 14px; }
@media (min-width: 980px) { .hr-toggle { display: none; } }
@media (max-width: 520px) {
  .bar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .avatar { width: 34px; height: 34px; font-size: 13px; }
  .jobsel select { max-width: 34vw; font-size: 14px; padding: 0 6px; }
  .hr-toggle { padding: 0 9px; font-size: 13px; }
}
.job-banner { font-size: 13px; color: var(--dim); text-align: center; padding: 8px 14px 0; }

.messages { flex: 1; overflow-y: auto; padding: 12px 12px 6px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.msg { display: flex; margin: 3px 0; animation: pop .18s ease-out; }
.msg.me { justify-content: flex-end; }
.bubble { max-width: 78%; padding: 9px 14px; border-radius: var(--radius); font-size: 16px; line-height: 1.35; white-space: pre-wrap;
  overflow-wrap: anywhere; }
.msg.them .bubble { background: var(--them); color: var(--them-ink); border-bottom-left-radius: 6px; }
.msg.me .bubble { background: var(--me); color: var(--me-ink); border-bottom-right-radius: 6px; }
.msg.me .bubble img { display: block; max-width: 220px; border-radius: 14px; }
.msg .meta { font-size: 11px; color: var(--dim); margin: 2px 8px; }
.stamp { text-align: center; color: var(--dim); font-size: 12px; margin: 10px 0 6px; }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.typing { display: flex; align-items: center; gap: 4px; padding: 4px 18px 8px; color: var(--dim); font-size: 13px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
.typing em { font-style: normal; margin-left: 6px; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 1px solid var(--line);
  background: var(--panel); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border: 1px solid var(--line); border-radius: 22px;
  padding: 11px 15px; font: inherit; font-size: 16px; background: var(--bg); color: var(--ink); outline: none; }
.composer textarea:focus { border-color: var(--me); }
.icon { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--me); display: grid;
  place-items: center; cursor: pointer; }
.icon svg { width: 24px; height: 24px; fill: currentColor; }
.icon.send { background: var(--me); color: #fff; }
.icon.send:disabled { opacity: .35; }
.icon.mic.recording { background: #ff3b30; color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255, 59, 48, .2); } }
.rec { padding: 6px 14px calc(6px + var(--safe-b)); font-size: 14px; color: var(--bad); background: var(--panel); }
.rec .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; margin-right: 4px; }
.rec button { min-height: 32px; border: 0; background: none; color: var(--me); font-size: 14px; }

.employer { background: var(--panel); border-left: 1px solid var(--line); padding: 18px; overflow-y: auto; }
@media (max-width: 979px) {
  .employer { position: fixed; inset: auto 0 0 0; max-height: 72dvh; border-radius: 20px 20px 0 0; border: 1px solid var(--line);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); z-index: 5; padding-bottom: calc(18px + var(--safe-b)); }
}
.emp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.emp-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.emp-title { font-weight: 700; font-size: 17px; }
.score { font-size: 26px; font-weight: 800; color: var(--me); white-space: nowrap; }
.emp-name { font-size: 20px; font-weight: 700; margin-top: 12px; }
.emp-meta { font-size: 13px; color: var(--dim); }
.emp-status { display: inline-block; margin: 8px 0; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: #fef3c7; color: var(--warn); }
.emp-status.good { background: #d1fae5; color: var(--ok); } .emp-status.bad { background: #fee2e2; color: var(--bad); }
.emp-summary { font-size: 15px; line-height: 1.45; }
.emp-fields { width: 100%; border-collapse: collapse; font-size: 14px; }
.emp-fields th, .emp-fields td { text-align: left; padding: 7px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.emp-fields th { color: var(--dim); font-weight: 500; width: 46%; }
.emp-fields tr.fresh td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #fff7c2; } to { background: transparent; } }
.emp-doc { margin-top: 12px; font-size: 14px; }
.emp-doc img { width: 100%; border-radius: 12px; margin-top: 8px; border: 1px solid var(--line); }
.emp-link { display: inline-block; margin-top: 14px; min-height: 44px; line-height: 44px; color: var(--me); font-weight: 600; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }
.ts-box { display: flex; justify-content: center; margin: 12px 0; }
.legal { margin: 0; padding: 0 12px calc(6px + var(--safe-b)); font-size: 11px; line-height: 1.35; color: var(--dim); text-align: center; }
.legal a { color: inherit; }
.demo-note { margin: 0; padding: 6px 12px; font-size: 12px; line-height: 1.35; text-align: center; background: #fff4d6; color: #5c4400; border-bottom: 1px solid #f0d58a; }
@media (prefers-color-scheme: dark) { .demo-note { background: #3a2f10; color: #f3dc9a; border-color: #5c4a14; } }
