/* 4As HiReXL — UI v2 */
:root {
	--bg: #f6f7fb;
	--bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(139, 92, 246, .10), transparent 60%), radial-gradient(900px 500px at -10% 0%, rgba(6, 182, 212, .08), transparent 55%);
	--card: #ffffff;
	--card-2: #fafbfe;
	--ink: #0d1124;
	--ink-2: #2b3150;
	--muted: #646b85;
	--line: #e6e8f2;
	--line-2: #eff1f7;
	--brand: #5b4cf0;
	--brand-2: #8b5cf6;
	--brand-3: #06b6d4;
	--brand-ink: #ffffff;
	--brand-soft: #efedff;
	--grad: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 55%, #06b6d4 100%);
	--good: #0f8a5f;
	--good-soft: #e3f6ee;
	--warn: #b25e00;
	--warn-soft: #fff4e2;
	--bad: #c0261a;
	--bad-soft: #fdeceb;
	--radius: 14px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(16, 20, 45, .04), 0 8px 28px -12px rgba(16, 20, 45, .12);
	--shadow-lg: 0 24px 64px -20px rgba(16, 20, 45, .35);
	--ring: 0 0 0 4px rgba(91, 76, 240, .16);
	--top-h: 64px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0a0c16;
		--bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(139, 92, 246, .16), transparent 60%), radial-gradient(900px 500px at -10% 0%, rgba(6, 182, 212, .10), transparent 55%);
		--card: #12152a;
		--card-2: #161a32;
		--ink: #eceefa;
		--ink-2: #c9cde3;
		--muted: #9097b4;
		--line: #252a45;
		--line-2: #1c2039;
		--brand: #8f84ff;
		--brand-ink: #ffffff;
		--brand-soft: #231f4d;
		--good: #4fd1a1;
		--good-soft: #0f2f26;
		--warn: #f5b862;
		--warn-soft: #34270f;
		--bad: #ff8b80;
		--bad-soft: #3a1a1a;
		--shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -14px rgba(0, 0, 0, .6);
		--shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .7);
		--ring: 0 0 0 4px rgba(143, 132, 255, .22);
	}
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.55;
	background: var(--bg-grad), var(--bg);
	background-attachment: fixed;
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "cv11", "ss01", "ss03";
	min-height: 100vh;
}
::selection { background: rgba(139, 92, 246, .25); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h2 {
	font-size: 15px;
	font-weight: 650;
	letter-spacing: -.01em;
	margin: 0 0 14px;
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}
.hx-muted { color: var(--muted); }
.hx-small { font-size: 12px; font-weight: 450; letter-spacing: 0; }

/* ---------- Brand ---------- */
.hx-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 750;
	font-size: 18px;
	letter-spacing: -.03em;
	color: var(--ink);
	white-space: nowrap;
}
.hx-brand-lg { font-size: 30px; gap: 14px; justify-content: center; }
.hx-brand-lg .hx-mark { width: 52px; height: 52px; }
.hx-mark { flex: none; display: block; filter: drop-shadow(0 6px 14px rgba(91, 76, 240, .35)); }
.hx-word { display: inline-flex; align-items: baseline; }
.hx-word em {
	font-style: normal;
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.hx-by {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .01em;
	color: var(--muted);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 2px 7px;
	margin-left: 2px;
	align-self: center;
}
.hx-brand-lg .hx-by { font-size: 12px; }
.hx-logo { display: none; }

/* ---------- Auth screens ---------- */
.hx-auth {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 32px 16px;
	background:
		radial-gradient(700px 400px at 15% 10%, rgba(79, 70, 229, .22), transparent 60%),
		radial-gradient(700px 420px at 90% 90%, rgba(6, 182, 212, .18), transparent 60%),
		radial-gradient(500px 300px at 80% 10%, rgba(139, 92, 246, .18), transparent 60%),
		var(--bg);
}
.hx-auth-card {
	width: min(420px, 100%);
	background: color-mix(in srgb, var(--card) 86%, transparent);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border: 1px solid var(--line);
	border-radius: 22px;
	padding: 36px 32px 28px;
	box-shadow: var(--shadow-lg);
	text-align: center;
}
.hx-auth-card > p { margin: 10px 0 0; color: var(--muted); }
.hx-auth-card form { margin-top: 22px; text-align: left; }
.hx-auth-card form p { margin: 0 0 14px; }
.hx-auth-card label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hx-auth-card .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); }
.hx-auth-card input[type=text], .hx-auth-card input[type=password] { width: 100%; height: 44px; }
.hx-auth-card input[type=submit] {
	width: 100%;
	height: 46px;
	border: 0;
	border-radius: 12px;
	background: var(--grad);
	color: #fff;
	font: inherit;
	font-weight: 650;
	cursor: pointer;
	box-shadow: 0 10px 24px -10px rgba(91, 76, 240, .7);
	transition: transform .15s, box-shadow .15s, filter .15s;
}
.hx-auth-card input[type=submit]:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ---------- Top bar ---------- */
.hx-top {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--top-h);
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 0 24px;
	background: color-mix(in srgb, var(--card) 78%, transparent);
	backdrop-filter: saturate(1.6) blur(16px);
	-webkit-backdrop-filter: saturate(1.6) blur(16px);
	border-bottom: 1px solid var(--line);
}
.hx-top::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -1px;
	height: 1px;
	background: var(--grad);
	opacity: .55;
}
.hx-tabs {
	display: flex;
	gap: 2px;
	padding: 4px;
	background: var(--line-2);
	border: 1px solid var(--line);
	border-radius: 12px;
}
.hx-tab {
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-weight: 550;
	padding: 7px 14px;
	border-radius: 9px;
	cursor: pointer;
	transition: color .15s, background .15s, box-shadow .15s;
	white-space: nowrap;
}
.hx-tab:hover { color: var(--ink); }
.hx-tab.is-active {
	background: var(--card);
	color: var(--ink);
	box-shadow: 0 1px 2px rgba(16, 20, 45, .08), 0 2px 8px -2px rgba(16, 20, 45, .10);
}
.hx-user {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 13px;
	white-space: nowrap;
}
.hx-user a { color: var(--muted); font-weight: 500; }
.hx-user a:hover { color: var(--ink); text-decoration: none; }
.hx-user-name {
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.hx-user-name::before {
	content: "";
	width: 26px; height: 26px;
	border-radius: 50%;
	background: var(--grad);
	box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line);
}
.hx-user #hx-stats {
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--line-2);
	border: 1px solid var(--line);
}

.hx-main { max-width: 1440px; margin: 0 auto; padding: 28px 24px 64px; }
.hx-panel { display: none; }
.hx-panel.is-active { display: block; animation: hx-in .25s ease; }
@keyframes hx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hx-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
	box-shadow: var(--shadow);
	margin-bottom: 20px;
}
.hx-grid-match {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}
.hx-grid-match .hx-card { margin-bottom: 0; }
.hx-grid-match { margin-bottom: 20px; }
.hx-grid-match:has(#hx-terms-card:not([hidden])) { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); }
.hx-grid-match:has(#hx-terms-card:not([hidden])) textarea { min-height: 150px; }

.hx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hx-between { justify-content: space-between; }
.hx-center { justify-content: center; }
.hx-options {
	gap: 8px 16px;
	padding: 10px 12px;
	background: var(--card-2);
	border: 1px solid var(--line-2);
	border-radius: var(--radius-sm);
	color: var(--ink-2);
	font-size: 13px;
}
.hx-options label { display: inline-flex; align-items: center; gap: 6px; }
.hx-options input[type=number] { width: 72px; height: 32px; padding: 4px 8px; }
.hx-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hx-check input { accent-color: var(--brand); width: 16px; height: 16px; }

input[type=text], input[type=search], input[type=number], input[type=email], input[type=password], textarea, select {
	font: inherit;
	color: var(--ink);
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	padding: 9px 12px;
	transition: border-color .15s, box-shadow .15s;
	max-width: 100%;
}
textarea { width: 100%; min-height: 200px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=search] {
	padding-left: 34px;
	background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23878ea8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m14 14-3.2-3.2'/%3E%3C/svg%3E") no-repeat 11px center;
	min-width: 240px;
}

.hx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 38px;
	padding: 0 16px;
	font: inherit;
	font-weight: 600;
	font-size: 13.5px;
	color: var(--ink);
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: transform .12s, box-shadow .15s, border-color .15s, background .15s, filter .15s;
	box-shadow: 0 1px 2px rgba(16, 20, 45, .05);
}
.hx-btn:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); text-decoration: none; transform: translateY(-1px); }
.hx-btn:active { transform: none; }
.hx-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.hx-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.hx-primary, .hx-ai-btn {
	color: #fff;
	border-color: transparent;
	background: var(--grad);
	box-shadow: 0 10px 22px -10px rgba(91, 76, 240, .75);
}
.hx-primary:hover, .hx-ai-btn:hover { filter: brightness(1.07); border-color: transparent; }
.hx-ghost { background: transparent; box-shadow: none; }
.hx-ghost:hover { background: var(--line-2); }
.hx-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.hx-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.hx-btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.hx-link {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-weight: 620;
	color: var(--ink);
	cursor: pointer;
	text-align: left;
}
.hx-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Chips & tags ---------- */
.hx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hx-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 6px 4px 11px;
	border-radius: 999px;
	background: var(--brand-soft);
	color: var(--brand);
	font-size: 12.5px;
	font-weight: 600;
	border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.hx-chip.is-must { background: var(--grad); color: #fff; border-color: transparent; }
.hx-chip.is-must button { color: rgba(255, 255, 255, .85); }
.hx-chip.is-adhoc { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.hx-chip button {
	border: 0;
	background: none;
	cursor: pointer;
	color: inherit;
	opacity: .65;
	padding: 0 3px;
	font-size: 13px;
	line-height: 1;
	border-radius: 6px;
}
.hx-chip button:hover { opacity: 1; }
.hx-chip button.on { color: #ffd166; opacity: 1; }
.hx-tag {
	display: inline-block;
	padding: 2px 8px;
	margin: 0 4px 4px 0;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 550;
	background: var(--line-2);
	color: var(--ink-2);
	border: 1px solid var(--line);
	white-space: nowrap;
}
.hx-tag-ok { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 20%, transparent); }
.hx-tag-miss { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 18%, transparent); text-decoration: line-through; text-decoration-thickness: 1px; }
.hx-tag-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.hx-tag-ai { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }

/* ---------- Tables ---------- */
.hx-table-wrap { overflow: auto; margin: 0 -22px; border-top: 1px solid var(--line); }
.hx-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.hx-table th, .hx-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.hx-table th:first-child, .hx-table td:first-child { padding-left: 22px; }
.hx-table th:last-child, .hx-table td:last-child { padding-right: 22px; }
.hx-table th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--card-2);
	font-size: 11px;
	font-weight: 650;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--muted);
	white-space: nowrap;
	border-bottom: 1px solid var(--line);
}
.hx-table tbody tr { transition: background .12s; }
.hx-table tr:hover td { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.hx-table tr:last-child td { border-bottom: 0; }
.hx-nowrap { white-space: nowrap; }
.hx-score { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.hx-score-bar { flex: 1; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 60px; }
.hx-score-bar span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.hx-score b { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 34px; }
.hx-kw-cell { max-width: 420px; }

/* ---------- Upload ---------- */
.hx-drop {
	position: relative;
	border: 1.5px dashed color-mix(in srgb, var(--brand) 40%, var(--line));
	border-radius: 18px;
	padding: 44px 24px;
	text-align: center;
	background:
		radial-gradient(400px 160px at 50% 0%, color-mix(in srgb, var(--brand-soft) 90%, transparent), transparent 70%),
		var(--card-2);
	transition: border-color .15s, background .15s, transform .15s;
}
.hx-drop.is-over { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.005); box-shadow: var(--ring); }
.hx-progress { margin: 14px 0; }
.hx-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.hx-bar span { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s ease; }
.hx-status-added { color: var(--good); font-weight: 600; }
.hx-status-updated { color: var(--brand); font-weight: 600; }
.hx-status-duplicate { color: var(--muted); }
.hx-status-error, .hx-status-skipped { color: var(--bad); font-weight: 600; }

/* ---------- Keywords ---------- */
.hx-kw-form { gap: 8px; }
.hx-kw-form input { flex: 1; min-width: 160px; }
.hx-kw-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.hx-kw-group h3 { margin: 0 0 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hx-kw-group .hx-chip b { font-weight: 500; opacity: .7; font-size: 11px; }
.hx-pager { margin-top: 16px; }

/* ---------- Modal ---------- */
.hx-modal {
	border: 1px solid var(--line);
	border-radius: 20px;
	padding: 0;
	width: min(900px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	background: var(--card);
	color: var(--ink);
	box-shadow: var(--shadow-lg);
}
.hx-modal[open] { animation: hx-pop .2s ease; }
@keyframes hx-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.hx-modal::backdrop { background: rgba(8, 10, 24, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#hx-modal-body { padding: 26px 28px; }
.hx-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 14px 0; }
.hx-form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.hx-resume-text {
	white-space: pre-wrap;
	font-size: 12.5px;
	line-height: 1.7;
	background: var(--card-2);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 16px 18px;
	max-height: 380px;
	overflow: auto;
	color: var(--ink-2);
}
.hx-resume-text mark { background: color-mix(in srgb, #ffd166 60%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }

.hx-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: #11142a;
	color: #fff;
	padding: 11px 18px;
	border-radius: 12px;
	z-index: 1000;
	max-width: calc(100vw - 32px);
	font-weight: 500;
	box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .45);
	border: 1px solid rgba(255, 255, 255, .08);
	animation: hx-toast .25s ease;
}
.hx-toast[hidden] { display: none; }
@keyframes hx-toast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.hx-empty { text-align: center; color: var(--muted); padding: 40px 16px !important; }

/* ---------- AI Copilot ---------- */
.hx-spark { flex: none; }
.hx-ai-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 11px;
	border-radius: 999px;
	font: inherit;
	font-size: 12px;
	font-weight: 650;
	cursor: pointer;
	color: var(--muted);
	background: var(--line-2);
	border: 1px solid var(--line);
}
.hx-ai-pill.is-on {
	color: #fff;
	background: var(--grad);
	border-color: transparent;
	box-shadow: 0 6px 18px -8px rgba(91, 76, 240, .8);
}
.hx-ai-pill.is-on .hx-spark { animation: hx-twinkle 2.4s ease-in-out infinite; }
@keyframes hx-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(20deg); } }

.hx-ai-bar, .hx-ai-brief-bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 14px 16px;
	margin: 14px 0 16px;
	border-radius: 14px;
	background:
		linear-gradient(var(--card), var(--card)) padding-box,
		var(--grad) border-box;
	border: 1px solid transparent;
}
.hx-ai-bar::before, .hx-ai-brief-bar::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(135deg, rgba(79, 70, 229, .07), rgba(6, 182, 212, .06));
	pointer-events: none;
}
.hx-ai-bar-text { display: flex; flex-direction: column; gap: 2px; max-width: 560px; position: relative; }
.hx-ai-bar-text b, .hx-ai-brief-bar b { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 700; }
.hx-ai-bar-text span { color: var(--muted); font-size: 12.5px; }
.hx-ai-bar .hx-btn, .hx-ai-brief-bar .hx-btn { position: relative; }
.hx-ai-brief-bar > span { position: relative; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hx-ai-brief { margin-bottom: 18px; }
.hx-ai-brief-out { padding: 4px 4px 8px; }
.hx-ai-brief-out p { margin: 8px 0 12px; color: var(--ink-2); }

.hx-ai-out {
	margin: 0 0 18px;
	padding: 18px;
	border-radius: 16px;
	background: var(--card-2);
	border: 1px solid var(--line);
}
.hx-ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.hx-ai-head b { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--brand); }
.hx-ai-head p { margin: 4px 0 0; color: var(--ink-2); }
.hx-ai-sub { margin: 14px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hx-ai-bool { display: flex; gap: 10px; align-items: flex-start; }
.hx-ai-bool code {
	flex: 1;
	font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 9px 12px;
	color: var(--ink-2);
	word-break: break-word;
}
.hx-icon-btn { border: 0; background: var(--line-2); color: var(--muted); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
.hx-icon-btn:hover { color: var(--ink); background: var(--line); }
.hx-ai-list { display: grid; gap: 12px; margin-top: 16px; }
.hx-ai-cand {
	display: flex;
	gap: 16px;
	padding: 16px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 14px;
	transition: border-color .15s, box-shadow .15s, transform .15s;
	animation: hx-in .3s ease both;
}
.hx-ai-cand:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow); }
.hx-ai-cand-body { flex: 1; min-width: 0; }
.hx-ai-cand-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hx-rank { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.hx-ai-name { font-size: 15px; }
.hx-ai-headline { margin: 6px 0 10px; color: var(--ink-2); }
.hx-ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.hx-ai-cols h4, .hx-ai-brief-out h4 { margin: 6px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.hx-ai-plus, .hx-ai-minus { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.hx-ai-plus li, .hx-ai-minus li { position: relative; padding-left: 20px; }
.hx-ai-plus li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.hx-ai-minus li::before { content: "–"; position: absolute; left: 2px; color: var(--warn); font-weight: 800; }
.hx-ai-qs { margin-top: 10px; font-size: 13px; }
.hx-ai-qs summary { cursor: pointer; color: var(--brand); font-weight: 600; width: max-content; }
.hx-ai-qs ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 4px; }
.hx-ai-foot { margin-top: 14px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.hx-ai-error { padding: 12px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 550; }

.hx-ring {
	--c: var(--brand);
	flex: none;
	width: 58px; height: 58px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
	position: relative;
}
.hx-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--card); }
.hx-ring b { position: relative; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hx-ring.is-strong { --c: #10b981; }
.hx-ring.is-good { --c: #6366f1; }
.hx-ring.is-partial { --c: #f59e0b; }
.hx-ring.is-weak { --c: #ef4444; }
.hx-verdict { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.hx-verdict.is-strong { background: var(--good-soft); color: var(--good); }
.hx-verdict.is-good { background: var(--brand-soft); color: var(--brand); }
.hx-verdict.is-partial { background: var(--warn-soft); color: var(--warn); }
.hx-verdict.is-weak { background: var(--bad-soft); color: var(--bad); }

.hx-skel { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-top: 12px; display: grid; gap: 10px; }
.hx-skel i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: hx-shimmer 1.2s linear infinite; }
.hx-skel i:nth-child(1) { width: 40%; height: 14px; }
.hx-skel i:nth-child(2) { width: 92%; }
.hx-skel i:nth-child(3) { width: 74%; }
@keyframes hx-shimmer { to { background-position: -200% 0; } }
.hx-dots { display: inline-flex; gap: 3px; }
.hx-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: hx-dot 1s infinite ease-in-out; }
.hx-dots i:nth-child(2) { animation-delay: .15s; }
.hx-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hx-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.hx-grid-match:has(#hx-terms-card:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
	.hx-user #hx-stats { display: none; }
}
@media (max-width: 900px) {
	.hx-top { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
	.hx-tabs { order: 3; width: 100%; overflow-x: auto; }
	.hx-tab { flex: 1; }
	.hx-main { padding: 18px 16px 48px; }
}
@media (max-width: 640px) {
	.hx-card { padding: 16px; border-radius: 12px; }
	.hx-table-wrap { margin: 0 -16px; }
	.hx-table th:first-child, .hx-table td:first-child { padding-left: 16px; }
	.hx-user-name, .hx-by { display: none; }
	.hx-ai-cols { grid-template-columns: 1fr; }
	.hx-ai-cand { flex-direction: column; }
	#hx-modal-body { padding: 18px; }
	input[type=search] { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- Brand: H + R accent (Human Resources) ---------- */
.hx-word .hx-hr { font-weight: inherit; background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }


/* ---------- v1.1: History, learned keywords, byline ---------- */
.hx-hist-req { min-width: 260px; max-width: 520px; }
.hx-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.hx-sugg { margin: 18px 0 6px; padding: 14px 16px; border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: var(--radius-sm); background: var(--card-2); }
.hx-sugg h3 { margin: 0; font-size: 13px; font-weight: 700; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.hx-sugg p { margin: 8px 0 10px; }
.hx-sugg select { padding: 5px 10px; height: 30px; font-size: 12.5px; }
.hx-sugg .hx-chip b { font-weight: 500; opacity: .7; font-size: 11px; }
button.hx-chip { cursor: pointer; }
.hx-by { white-space: nowrap; }
/* Keep the candidate count visible: make room by compacting the user area instead. */
@media (max-width: 1400px) { .hx-top { gap: 16px; } .hx-user { gap: 10px; } .hx-user #hx-stats { display: inline-block; padding: 4px 8px; } .hx-user-name { font-size: 0; gap: 0; } }
@media (max-width: 1290px) { .hx-ai-pill span { display: none; } }
@media (max-width: 1100px) { .hx-user #hx-stats { display: inline-block; } }
@media (max-width: 1200px) and (min-width: 901px) { .hx-top .hx-by { display: none; } }
