:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1d2430;
  --muted: #6b7280;
  --line: #e3e6eb;
  --accent: #1f5fbf;
  --match: #2f8f5b;
  --button: #c58a1a;
  --out: #b3433d;
  --verify: #8a5a00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
header { background: var(--panel); border-bottom: 1px solid var(--line); }
nav { display: flex; gap: 1.2rem; align-items: center; padding: 0.7rem 1.2rem; max-width: 1100px; margin: 0 auto; }
nav a { color: var(--ink); text-decoration: none; }
nav a.brand { font-weight: 700; color: var(--accent); margin-right: 0.6rem; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem 1.2rem 3rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
h1 { font-size: 1.4rem; margin: 0 0 0.8rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.6rem; display: inline; }
h3 { font-size: 1rem; margin: 0; }
h4 { margin: 0.6rem 0 0.2rem; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; }
.stack { display: grid; gap: 0.7rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > label, .row > input { flex: 1 1 240px; }
label { display: grid; gap: 0.25rem; font-size: 0.9rem; color: var(--muted); }
textarea, input { font: inherit; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; width: 100%; color: var(--ink); }
button { font: inherit; padding: 0.5rem 0.9rem; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; justify-self: start; }
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.muted { color: var(--muted); font-size: 0.9rem; }
.warn { color: var(--out); font-size: 0.9rem; margin: 0.2rem 1.2rem 0.6rem; }
.count { background: var(--line); border-radius: 999px; padding: 0.05rem 0.55rem; font-size: 0.85rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin-top: 0.4rem; }
th, td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.tag { padding: 0.05rem 0.45rem; border-radius: 4px; font-size: 0.8rem; background: var(--line); }
.tag.requirement { background: #fde2e1; color: var(--out); }
.tag.own_limit { background: #fff1d6; color: var(--verify); }
.tag.preference { background: #e0f0e7; color: var(--match); }
.card { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 6px; padding: 0.7rem 0.9rem; margin: 0.6rem 0; }
.card.match { border-left-color: var(--match); }
.card.button { border-left-color: var(--button); }
.card header { background: none; border: 0; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.badge { font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--line); }
.badge.band { background: #e3ecfb; color: var(--accent); }
.badge.points { background: #e0f0e7; color: var(--match); }
.badge.strength { background: #ede7fb; color: #5b3fb3; }
.badge.verify { background: #fff1d6; color: var(--verify); }
.reasons { margin: 0.4rem 0 0.2rem 1.1rem; padding: 0; }
details > summary { cursor: pointer; margin: 0.3rem 0; }
details > summary h2 { display: inline; }
pre { background: #f1f3f6; border-radius: 6px; padding: 0.7rem; overflow: auto; font-size: 0.82rem; white-space: pre-wrap; }
.transcript { display: grid; gap: 0.4rem; margin-bottom: 0.8rem; }
.turn { margin: 0; padding: 0.5rem 0.7rem; border-radius: 8px; max-width: 80%; }
.turn.recruiter { background: #e3ecfb; }
.turn.candidate { background: #eef0f3; justify-self: end; }
.who { font-weight: 600; margin-right: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.report h1 { font-size: 1.3rem; }
.report h2 { display: block; margin-top: 1.2rem; }
.report table { font-size: 0.85rem; }
.outcome-out { color: var(--out); font-weight: 600; }
.outcome-button { color: var(--button); font-weight: 600; }

/* Navigation */
.nav-spacer { flex: 1; }

/* Login page */
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, #eef3fb 0%, #f6f7f9 60%); }
.login { width: min(420px, 92vw); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem 1.6rem 1.4rem; box-shadow: 0 10px 30px rgba(29, 36, 48, 0.08); }
.login-brand { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.login-brand h1 { margin: 0; font-size: 1.5rem; }
.login-brand p { margin: 0; }
.login-mark, .avatar { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; flex: none; }
.login-text { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }
.login-error { color: var(--out); margin: 0; font-size: 0.9rem; }
.login-foot { text-align: center; margin-top: 1rem; }
.login .stack button { justify-self: stretch; padding: 0.65rem; }

/* Conversation */
.chat-page h1 { margin-bottom: 0.3rem; }
.transcript { display: grid; gap: 0.6rem; margin: 0.4rem 0 0.9rem; max-height: 60vh; overflow-y: auto; padding: 0.4rem 0.2rem; }
.turn { display: flex; gap: 0.6rem; align-items: flex-end; max-width: 85%; }
.turn p { margin: 0; padding: 0.6rem 0.85rem; border-radius: 14px; line-height: 1.45; }
.turn.recruiter p { background: #e3ecfb; border-bottom-left-radius: 4px; }
.turn.candidate { justify-self: end; flex-direction: row-reverse; }
.turn.candidate p { background: #eef0f3; border-bottom-right-radius: 4px; }
.avatar { width: 2rem; height: 2rem; font-size: 0.9rem; }
.chat-form { display: flex; gap: 0.6rem; align-items: center; }
.chat-form input { flex: 1; padding: 0.65rem 0.8rem; border-radius: 999px; }
.chat-form button { border-radius: 999px; padding: 0.6rem 1.1rem; }
.button-link { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.understood { margin-top: 0.9rem; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: flex; }
.typing p { color: var(--muted); }
.dots i { display: inline-block; width: 5px; height: 5px; margin-left: 3px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
.results { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.results h2 { display: block; margin-top: 0.6rem; }

/* Guide */
.guide h2 { display: block; margin-top: 1.3rem; }
.guide dl { margin: 0.4rem 0 0; }
.guide dt { font-weight: 600; margin-top: 0.6rem; }
.guide dd { margin: 0.15rem 0 0 0; color: #3a4350; }
.guide p { max-width: 70ch; }
[title] { cursor: help; }

/* Legend and tooltips */
.legend summary { cursor: pointer; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0.5rem 1.2rem; margin: 0.6rem 0 0.4rem; font-size: 0.9rem; }
.legend-grid b { display: block; color: var(--accent); margin-bottom: 0.1rem; }
.tip, .tip-host { position: relative; }
.tip { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; margin-left: 0.35rem; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 0.7rem; font-weight: 700; cursor: help; vertical-align: middle; }
.tip:hover, .tip:focus { background: var(--accent); color: #fff; }
.tip-host { cursor: help; }
.tip::after, .tip-host::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 320px; padding: 0.5rem 0.7rem; border-radius: 6px; background: var(--ink); color: #fff; font-size: 0.8rem; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; opacity: 0; pointer-events: none; transition: opacity 0.12s; z-index: 20; }
.tip:hover::after, .tip:focus::after, .tip-host:hover::after { opacity: 1; }
h2 .tip, summary .tip { vertical-align: middle; }

/* Skip the remaining questions */
.skip-form { margin-top: 0.4rem; }
.link-button { background: none; color: var(--muted); border: 0; padding: 0.2rem 0; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--accent); }
