/* Hire MSC Search (/ and /talent) and hiring projects (/projects). Loads after /app.css (tokens, base, app bar).
   The talent-core.js components plus the search page: hero, "Understood as", instant scoreboard in tiers,
   AI recruiter review lane. 8px grid, text never below 13px. */

/* ---------------------------------------------------------------------------
   Tokens. The shared ones (colours, type, radii, shadows, --bar-h) come from /app.css, which loads first;
   these are the few only the search and projects pages use. Light by default, dark via data-theme or the OS. */

:root {
  --good: #1f5f8b;
  --good-bg: #e7f1f9;
  --find-bg: #cfe0ff;
  --current-bg: #ffb35c;
  --top-h: var(--bar-h, 64px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --good: #9cc9f0;
    --good-bg: #16324a;
    --find-bg: #2b4f86;
    --current-bg: #a35c10;
  }
}

:root[data-theme="dark"] {
  --good: #9cc9f0;
  --good-bg: #16324a;
  --find-bg: #2b4f86;
  --current-bg: #a35c10;
}

/* ---------------------------------------------------------------------------
   Base (on top of app.css): list and button resets the talent components rely on. */

body.t-no-scroll { overflow: hidden; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { background: none; border: 0; padding: 0; }
button:disabled, button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

:focus-visible { border-radius: 4px; }

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  line-height: 18px;
}

.t-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.t-svg.sm { width: 14px; height: 14px; }

.t-muted { color: var(--muted); }
.t-muted.small, .t-hint { font-size: 13px; color: var(--muted); }
.t-error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }

.t-skip {
  position: fixed;
  top: -64px;
  left: 16px;
  z-index: 200;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.t-skip:focus { top: 8px; }

/* ---------------------------------------------------------------------------
   Buttons, inputs, segmented controls */

.t-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.t-btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--sunken); text-decoration: none; }
.t-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.t-btn.primary:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--accent-hover); border-color: var(--accent-hover); }
.t-btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.t-btn.ghost:hover:not(:disabled) { background: var(--accent-soft); }
.t-btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.t-btn.danger:hover:not(:disabled) { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--on-danger); }
.t-btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.t-btn.block { width: 100%; }
.t-btn .t-svg { width: 16px; height: 16px; }

.t-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  flex-shrink: 0;
}

.t-icon:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--sunken); color: var(--ink); }
.t-icon.small { width: 32px; height: 32px; }
.t-icon.small .t-svg { width: 16px; height: 16px; }
.t-icon.bordered { border: 1px solid var(--line); background: var(--surface); }

.t-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 0;
}

.t-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.t-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.t-input::placeholder, textarea::placeholder, input::placeholder { color: var(--faint); opacity: 1; }
.t-input:focus-visible { border-color: var(--accent); }
.t-input.small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
textarea.t-input { resize: vertical; line-height: 1.5; }
select.t-input { padding-right: 32px; }

.t-field-label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.t-field-label > .t-input { margin-top: 8px; font-weight: 400; }

.t-seg {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  min-width: 0;
}

.t-seg label { position: relative; display: inline-flex; }

.t-seg input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.t-seg span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.t-seg input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.t-seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.t-seg input:disabled + span { opacity: 0.5; cursor: not-allowed; }
.t-seg.compact span { min-height: 30px; padding: 2px 10px; }
.t-seg.full { display: flex; }
.t-seg.full label { flex: 1; }
.t-seg.full span { justify-content: center; width: 100%; padding: 4px 6px; }

.t-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}

.t-switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s;
  flex-shrink: 0;
}

.t-switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.t-switch input:checked { background: var(--accent); }
.t-switch input:checked::after { transform: translateX(16px); }

.t-row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.t-row-gap.end { justify-content: flex-end; margin-top: 8px; }

.t-count {
  display: inline-block;
  min-width: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.t-count:empty { display: none; }

.t-avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 13px/1 var(--font-head);
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.t-avatar.lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }

.t-menu {
  position: absolute;
  z-index: 60;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}


.t-menu > a, .t-menu > button, .t-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  text-align: left;
}

.t-menu > a:hover, .t-menu > button:hover, .t-menu-item:hover { background: var(--sunken); text-decoration: none; }


/* ---------------------------------------------------------------------------
   Page frame */

/* The search page is wider than the other pages (filters, scoreboard and AI lane side by side). The shared app bar
   (.app-bar-inner, max-width: var(--page-max)) widens with it, and both use the shell gutter, so the logo lines up
   with the page content at every width. */
.t-search-page { --page-max: 1480px; }

.t-main {
  max-width: var(--page-max, 1480px);
  margin: 0 auto;
  padding: 24px var(--gutter, 24px) 120px;
}

/* Visitors who are not signed in (docs/hiring-search-v3.md §11): the same page and cards (short names, firm
   categories). A slim banner offers a free account; a card, its profile and CV, and every action open the signup
   sheet. */
.t-guest-mode .t-switch, .t-guest-mode #savedCount { display: none; }
.t-guest-mode .t-row, .t-guest-mode .t-sb-row { cursor: pointer; }

.t-guest-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 12px;
  padding: 8px 12px 8px 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.t-guest-banner > .t-svg { flex-shrink: 0; color: var(--accent); }
.t-guest-banner-text { flex: 1 1 280px; min-width: 0; color: var(--ink); font-weight: 600; }
.t-guest-banner-note { font-weight: 400; color: var(--muted); }
.t-guest-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The signup sheet: a small dialog holding the quick signup form (app.css .qs-*). */
.t-signup-sheet .t-dialog-body { padding-top: 12px; }
.t-sheet-lead { color: var(--muted); }
.t-sheet-form .auth-form { margin-top: 16px; }
.t-sheet-form .auth-success { margin-top: 4px; }
.t-sheet-login { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.t-dialog-foot:empty { display: none; }

@media (max-width: 720px) {
  .t-guest-banner { padding: 12px; }
  .t-guest-banner-actions { flex: 1 1 100%; }
  .t-guest-banner-actions .t-btn { flex: 1; justify-content: center; }
  /* The sheet rises from the bottom on phones. */
  .t-modal:has(.t-signup-sheet) { place-items: end stretch; padding: 0; }
  .t-signup-sheet { width: 100%; max-height: 94vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

/* The profile drawer when a free account's daily unlocks are used (429 unlock_limit). */
.t-unlock-limit { text-align: left; }
.t-unlock-limit > .t-svg { width: 28px; height: 28px; color: var(--warning); }

.t-pool {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.t-pool .t-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Hero: describe the role, "Understood as", keyword search */

.t-hero {
  display: grid;
  gap: 16px;
  padding: 24px 24px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent-soft) 70%, transparent) 0%, transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.t-hero-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.t-hero-title { font: 800 26px/1.2 var(--font-head); letter-spacing: -0.4px; color: var(--ink); }

.t-brief-label {
  display: block;
  margin-bottom: 8px;
  font: 700 15px/1.3 var(--font-head);
  color: var(--ink);
}

.t-brief-box {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.t-brief-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }

.t-brief-box textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  max-height: 260px;
  padding: 14px 16px 6px;
  border: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  resize: none;
}

.t-brief-box textarea:focus-visible { outline: none; }

.t-brief-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
  padding: 6px 8px 8px 16px;
}

.t-brief-keys { margin-right: auto; color: var(--muted); font-size: 13px; }
.t-brief-keys kbd { font-size: 13px; }
.t-brief-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.t-brief-bar .t-btn { min-height: 44px; padding: 8px 22px; border-radius: 999px; }

.t-brief-read { font-size: 13px; font-weight: 600; color: var(--muted); }

.t-kwbox { border-top: 1px solid var(--line); padding-top: 12px; }

.t-kwbox > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-height: 32px;
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

.t-kwbox > summary::-webkit-details-marker { display: none; }
.t-kwbox > summary::before { content: '▸'; color: var(--muted); transition: transform 0.15s; }
.t-kwbox[open] > summary::before { transform: rotate(90deg); }
.t-kwbox > summary small { color: var(--muted); font-weight: 400; font-size: 13px; }
.t-kwbox .t-kw { margin-top: 12px; padding-top: 0; border-top: 0; }

.t-kw {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.t-kw-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 360px;
  min-width: 0;
}

.t-kw-field > .t-svg {
  position: absolute;
  left: 12px;
  color: var(--faint);
  pointer-events: none;
}

.t-kw-field input {
  width: 100%;
  min-height: 44px;
  padding: 8px 48px 8px 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.t-kw-field input:focus-visible { border-color: var(--accent); }
.t-kw-field .t-icon { position: absolute; right: 6px; }
.t-kw-field .t-icon[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }

.t-popover {
  top: calc(100% + 8px);
  left: 0;
  width: min(480px, calc(100vw - 32px));
  padding: 16px;
}

.t-popover h2 { font: 700 15px/1.3 var(--font-head); margin-bottom: 8px; }

.t-syntax { display: grid; gap: 4px; margin-bottom: 12px; }

.t-syntax div {
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}

.t-syntax dd { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------------------
   Layout: filters | instant results | AI review (lanes become tabs below 1200px) */

.t-layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.t-lanes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.t-drawer-only { display: none !important; }

.t-filters {
  position: sticky;
  top: calc(var(--top-h) + 16px);
  max-height: calc(100vh - var(--top-h) - 32px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.t-filters-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.t-filters-head h2 { font: 700 16px/1.3 var(--font-head); margin-right: auto; }

.t-filter-groups { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.t-filters-foot { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }

.t-fgroup { border-bottom: 1px solid var(--line); }
.t-fgroup:last-child { border-bottom: 0; }

.t-fgroup h3 { margin: 0; }

.t-fgroup-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  color: var(--ink);
  font: 700 14px/1.3 var(--font-head);
  text-align: left;
}

.t-fgroup-toggle:hover { background: var(--surface-2); }
.t-fgroup-toggle .t-svg { margin-left: auto; color: var(--faint); transition: transform 0.15s; }
.t-fgroup-toggle[aria-expanded="false"] .t-svg { transform: rotate(-90deg); }

.t-fgroup-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 13px/1 var(--font);
}

.t-fgroup-body { padding: 0 16px 16px; display: grid; gap: 12px; }

.t-fsub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.t-fsub + .t-opts, .t-fsub + .t-seg, .t-fsub + .t-quick { margin-top: -4px; }

.t-fnote { font-size: 13px; color: var(--muted); }

.t-opts { display: grid; gap: 0; }

.t-opts-head {
  display: grid;
  grid-template-columns: 1fr 44px 44px;
  gap: 4px;
  padding: 0 4px 4px 32px;
  color: var(--faint);
  font-size: 13px;
  text-align: right;
}

.t-opt {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.t-opt.dual { grid-template-columns: 20px minmax(0, 1fr) 44px 44px; }
.t-opt:hover { background: var(--surface-2); }

.t-opt input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.t-opt-label { overflow-wrap: anywhere; line-height: 1.35; }

.t-opt-count {
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* City counts: the column that the current city mode uses is emphasised; the other stays readable. */
.t-opt.dual .t-opt-count { color: var(--ink); font-weight: 600; }
.t-opt.dual .t-opt-count.dim, .t-opts-head .t-opt-count.dim { color: var(--faint); font-weight: 400; }
.t-opt.zero .t-opt-label { color: var(--faint); }
.t-opt input:checked ~ .t-opt-label { font-weight: 600; color: var(--ink); }

.t-more {
  justify-self: start;
  padding: 4px 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.t-fsearch { position: relative; }
.t-fsearch .t-input { padding-left: 32px; }
.t-fsearch .t-svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }

.t-quick { display: flex; flex-wrap: wrap; gap: 8px; }

.t-quick button, .t-pillbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.t-quick button:hover, .t-pillbtn:hover { border-color: var(--accent); color: var(--accent); }
.t-quick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.t-quick button small { font-weight: 500; opacity: 0.85; font-size: 13px; }

.t-inline-field { display: flex; align-items: center; gap: 8px; }
.t-inline-field .t-input { flex: 1; min-width: 0; }
.t-inline-field .t-prefix { color: var(--muted); font-size: 14px; }

.t-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.t-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.t-check small { display: block; color: var(--muted); font-size: 13px; }

.t-firm-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------------------
   Chips */

.t-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.t-chips:empty { display: none; }

.t-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 32px;
  padding: 2px 4px 2px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.t-chip > span { overflow-wrap: anywhere; }
.t-chip.modifier { background: var(--surface); border-style: dashed; color: var(--muted); }
.t-chip.static { padding-right: 12px; }

.t-chip button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: inherit;
  flex-shrink: 0;
}

.t-chip button:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.t-chip button .t-svg { width: 14px; height: 14px; }

.t-selectall { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 32px; }
.t-selectall input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

.t-chip-list { display: flex; flex-wrap: wrap; gap: 4px 8px; }

.t-chip-list li, .t-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.t-chip-list.neg li { text-decoration: line-through; color: var(--muted); }

/* ---------------------------------------------------------------------------
   Results header, banners, states */

.t-results { min-width: 0; }

.t-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.t-results-count { font: 750 22px/1.25 var(--font-head); letter-spacing: -0.3px; }
.t-results-count:focus { outline: none; }
.t-results-title .t-muted { font-size: 13px; margin-top: 2px; }

.t-results-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

.t-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.t-sort select { width: auto; }

.t-saved { position: relative; display: inline-flex; gap: 4px; }
.t-saved-menu { right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 32px)); max-height: 420px; overflow-y: auto; }

.t-saved-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-sm);
}

.t-saved-item:hover { background: var(--sunken); }

.t-saved-item > button:first-child {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.t-saved-item strong { font-size: 14px; overflow-wrap: anywhere; }
.t-saved-item small { font-size: 13px; color: var(--muted); }
.t-saved-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.t-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
}

.t-banner > .t-svg { color: var(--accent); margin-top: 2px; }
.t-banner.warn { border-color: var(--warning-line); background: var(--warning-bg); }
.t-banner.warn > .t-svg { color: var(--warning); }
.t-banner-body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.t-banner-body strong { font-weight: 700; }
.t-banner .t-quick { margin-top: 4px; }

.t-progress {
  position: relative;
  height: 3px;
  margin: -16px 0 13px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--accent-soft);
}

.t-progress::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  background: var(--accent);
  animation: t-progress 1.1s ease-in-out infinite;
}

@keyframes t-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.t-state {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.t-state h2, .t-state h3 { font: 700 17px/1.35 var(--font-head); }
.t-state p { color: var(--muted); }
.t-state.error { border-style: solid; border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--danger-bg); }
.t-state.error p { color: var(--ink); }

/* ---------------------------------------------------------------------------
   Result rows */

.t-list { display: grid; gap: 12px; }

.t-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px 16px;
  padding: 16px 16px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.t-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.t-row.selected { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.t-row.active, .t-row:focus-within { border-color: var(--accent); }
.t-row:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

.t-row-select { padding-top: 8px; }
.t-row-select input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }

.t-row-main { min-width: 0; display: grid; gap: 8px; }

.t-row-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.t-row-id { min-width: 0; display: grid; gap: 2px; }

.t-name {
  display: inline;
  padding: 0;
  color: var(--ink);
  font: 700 16px/1.3 var(--font-head);
  text-align: left;
  overflow-wrap: anywhere;
}

.t-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.t-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

.t-loc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 13px;
}

.t-loc .t-svg { width: 14px; height: 14px; color: var(--faint); }
.t-loc-label { color: var(--faint); font-size: 12px; font-weight: 600; }
.t-loc-sep { color: var(--faint); }

.t-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunken);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}

.t-badge.tier { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.t-badge.anywhere { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.t-badge.active { background: var(--success-bg); border-color: transparent; color: var(--success); font-weight: 500; }

.t-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--muted);
}

.t-fact { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 4px; min-width: 0; }
.t-fact-label { white-space: nowrap; }
.t-fact .t-svg { width: 14px; height: 14px; color: var(--faint); }
.t-fact strong { color: var(--ink); font-weight: 600; }
.t-fact.firm strong { overflow-wrap: anywhere; }

.t-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.t-tags-label { font-size: 13px; color: var(--faint); margin-right: 2px; }
.t-tag.more { color: var(--muted); border-style: dashed; }
.t-tag.hit { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.t-snippets { display: grid; gap: 4px; }

.t-snippet {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--accent-line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.t-snippet-label { font-weight: 700; color: var(--faint); margin-right: 4px; }

.t-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.t-row-icons { display: flex; gap: 4px; }

.t-skel {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--sunken) 0%, var(--line) 50%, var(--sunken) 100%);
  background-size: 200% 100%;
  animation: t-shimmer 1.4s ease-in-out infinite;
}

.t-skel.line { height: 14px; margin: 8px 0; }
.t-skel.title { height: 18px; width: 40%; }
.t-skel.block { height: 160px; margin-top: 16px; }
.t-skel.w60 { width: 60%; }
.t-skel.w40 { width: 40%; }
.t-skel.w80 { width: 80%; }
.t-skel.circle { width: 36px; height: 36px; border-radius: 50%; }
.t-row.skeleton { pointer-events: none; }
.t-row.skeleton .t-row-main { gap: 4px; }

@keyframes t-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------------------------------------------------------------------------
   Pagination and bulk bar */

.t-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.t-pager button {
  min-width: 40px;
  min-height: 40px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.t-pager button:hover:not(:disabled) { background: var(--sunken); }
.t-pager button[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.t-pager .t-gap { padding: 0 4px; color: var(--faint); }
.t-pager-summary { flex-basis: 100%; text-align: center; color: var(--muted); font-size: 13px; margin-top: 4px; }

.t-bulk {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: #112b4b;
  color: #edf4ff;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}

.t-bulk-count { font-weight: 700; margin-right: 8px; white-space: nowrap; }
.t-bulk .t-btn { border-radius: 999px; }
.t-bulk .t-btn:not(.primary) { background: #1b3d65; border-color: #52739a; color: #f5f8ff; }
.t-bulk .t-btn:not(.primary):hover:not(:disabled) { background: #285282; }
.t-bulk .t-btn.primary { background: #edf4ff; border-color: #edf4ff; color: #112b4b; }
.t-bulk .t-btn.primary:hover:not(:disabled) { background: #fff; }
.t-bulk :focus-visible { outline-color: #acd0ff; }

/* ---------------------------------------------------------------------------
   Modals, dialogs, toasts, blocking screen */

.t-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.t-backdrop { position: fixed; inset: 0; background: var(--backdrop); }

.t-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(90vh, 900px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.t-dialog, .t-dialog-body { min-width: 0; }
.t-dialog.small { width: min(440px, 100%); }
.t-dialog.wide { width: min(1120px, 100%); }

.t-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 16px 24px;
  border-bottom: 1px solid var(--line);
}

.t-dialog-head h2 { font: 700 18px/1.35 var(--font-head); overflow-wrap: anywhere; }
.t-dialog-body { padding: 16px 24px 24px; overflow-y: auto; }
.t-dialog-body > p + p { margin-top: 8px; }

.t-dialog-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.t-radio-list { display: grid; gap: 8px; }

.t-radio-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.t-radio-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.t-radio-row input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.t-radio-row span { display: flex; flex-direction: column; min-width: 0; }
.t-radio-row small { color: var(--muted); font-size: 13px; }
.t-new-project { padding: 4px 0 0; }

.t-toasts {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 150;
  display: grid;
  gap: 8px;
  width: min(480px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.t-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--radius);
  background: #142644;
  color: #f2f6ff;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  pointer-events: auto;
  animation: t-rise 0.18s ease-out;
}

.t-toast > span { flex: 1; min-width: 0; }
.t-toast.error { background: #7d1f27; }
.t-toast .t-icon { color: #c9d7ee; }
.t-toast .t-icon:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.t-toast-action {
  color: #bcd4ff;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  padding: 4px 8px;
}

@keyframes t-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.t-blocking {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
}

.t-blocking-card {
  display: grid;
  gap: 16px;
  justify-items: start;
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.t-blocking-card h2 { font: 750 22px/1.3 var(--font-head); }
.t-blocking-card p { color: var(--muted); }

.t-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: t-spin 0.8s linear infinite;
}

@keyframes t-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   Compare dialog */

.t-compare-wrap { overflow-x: auto; }

.t-compare {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.t-compare th, .t-compare td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.t-compare thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  font: 700 15px/1.3 var(--font-head);
  color: var(--ink);
}

.t-compare thead td { position: sticky; left: 0; z-index: 2; background: var(--surface); }

.t-compare tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 160px;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
}

.t-compare td { color: var(--ink); }
.t-compare .t-cmp-head { display: grid; gap: 8px; justify-items: start; }
.t-compare .t-chip-list li { font-size: 13px; }
.t-compare .t-miss { color: var(--warning); font-weight: 600; }

/* ---------------------------------------------------------------------------
   Profile drawer */

.t-drawer-wrap { position: fixed; inset: 0; z-index: 90; }

.t-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(820px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  outline: none;
  animation: t-slide 0.2s ease-out;
}

@keyframes t-slide {
  from { transform: translateX(24px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

.t-drawer-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.t-drawer-pos { min-width: 64px; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-kbd-hint { margin-left: 12px; font-size: 13px; color: var(--faint); }
.t-drawer-close { margin-left: auto; }

.t-drawer-content { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.t-drawer-loading { padding: 24px; }
.t-drawer-content > .t-state { margin: 24px; }

.t-profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: 24px 24px 16px;
}

.t-profile-id { display: grid; gap: 4px; min-width: 0; }
.t-drawer-name { font: 750 22px/1.25 var(--font-head); letter-spacing: -0.3px; overflow-wrap: anywhere; }

.t-pipeline-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}

.t-pipeline-status:empty { display: none; }
.t-pipeline-status .t-svg { width: 15px; height: 15px; }

.t-profile-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.t-contact-row { display: flex; flex-wrap: wrap; gap: 8px; }

.t-profile-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.t-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.t-tabs [role="tab"] {
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.t-tabs [role="tab"]:hover { color: var(--ink); }
.t-tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.t-tabpanel { padding: 24px; flex: 1; min-height: 0; }
.t-tabpanel:focus-visible { outline-offset: -3px; }

.t-psec { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.t-psec:last-of-type { border-bottom: 0; }

.t-psec h3 {
  margin-bottom: 8px;
  color: var(--faint);
  font: 700 13px/1.4 var(--font);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.t-dl { display: grid; gap: 8px; }

.t-dl-row {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
  gap: 16px;
}

.t-dl dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
.t-dl dd { color: var(--ink); overflow-wrap: anywhere; }

.t-link-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.t-ext { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.t-meta-foot { margin-top: 8px; color: var(--faint); font-size: 13px; }

.t-cv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.t-cv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* A CV download in progress: every control that starts one waits. */
[data-cv-download][aria-busy="true"] { cursor: progress; }

.t-cv-body { display: flex; flex-direction: column; min-height: 0; }

.t-cv-frame {
  width: 100%;
  height: calc(100vh - 300px);
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.t-cv-loading { display: flex; align-items: center; gap: 12px; padding: 24px; color: var(--muted); }

.t-cv-find { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.t-cv-find .t-input { flex: 1; min-width: 0; max-width: 320px; }
.t-find-count { margin-left: 8px; font-size: 13px; color: var(--muted); }
.t-cv-legend { margin-bottom: 12px; font-size: 13px; color: var(--muted); }

.t-cv-text {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.t-cv-text mark.kw { background: var(--mark-bg); color: var(--mark-ink); }
.t-cv-text mark.find { background: var(--find-bg); color: var(--ink); }
.t-cv-text mark.current { background: var(--current-bg); color: #1b1200; outline: 2px solid var(--current-bg); }
.t-cv-legend mark.kw { background: var(--mark-bg); color: var(--mark-ink); }

.t-membership {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.t-membership header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.t-membership header a { font: 700 15px/1.3 var(--font-head); }
.t-membership select { width: auto; }

.t-notes { display: grid; gap: 8px; }

.t-notes li {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.t-notes time { display: block; margin-top: 4px; color: var(--faint); font-size: 13px; }

/* ---------------------------------------------------------------------------
   Responsive */

@media (max-width: 1279px) {
  .t-kbd-hint { display: none; }
  .t-layout { grid-template-columns: minmax(0, 1fr); }
  .t-drawer-only { display: inline-flex !important; }
  .t-filters-foot.t-drawer-only { display: block !important; }

  .t-filters {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 95;
    width: min(380px, 92vw);
    max-height: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    border-left: 0;
    box-shadow: var(--shadow-lg);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.2s ease-out, visibility 0s linear 0.2s;
  }

  .t-filters.open { transform: none; visibility: visible; transition: transform 0.2s ease-out, visibility 0s; }
  .t-filters-backdrop { z-index: 94; }
}

@media (max-width: 1199px) {
  .t-lanes { grid-template-columns: minmax(0, 1fr); }
  .t-ai { position: static; max-height: none; }
}

@media (max-width: 720px) {
  .t-main { padding: 16px var(--gutter, 16px) 120px; }
  .t-hero { padding: 16px; gap: 12px; }
  .t-hero-title { font-size: 21px; }
  .t-brief-keys { display: none; }
  .t-brief-bar .t-btn { flex: 1 1 100%; }
  .t-kw .t-seg { flex: 1 1 auto; }
  .t-kw .t-seg label { flex: 1; }
  .t-kw .t-seg span { justify-content: center; width: 100%; }
  .t-kw > .t-btn { flex: 1 1 100%; }
  .t-results-count { font-size: 19px; }
  .t-results-tools { width: 100%; justify-content: flex-start; }
  .t-results-tools .t-sort { flex: 1 1 140px; }
  .t-results-tools .t-sort select { flex: 1; min-width: 0; }
  .t-row { grid-template-columns: 24px minmax(0, 1fr); padding: 12px; }
  .t-row-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .t-profile-head { padding: 16px; }
  .t-tabs { padding: 0 8px; }
  .t-tabpanel { padding: 16px; }
  .t-dl-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .t-cv-frame { height: 70vh; min-height: 360px; }
  .t-dialog-body { padding: 16px; }
  .t-dialog-foot { padding: 12px 16px; }
  .t-bulk { bottom: 12px; border-radius: var(--radius); padding: 8px; justify-content: center; }
  .t-bulk-count { flex-basis: 100%; text-align: center; margin: 0; }
  .t-syntax div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .t-compare tbody th { width: 112px; }
  .t-compare { min-width: 480px; }
  .t-ex-row { flex-direction: column; align-items: stretch; }

  /* Comfortable touch targets. */
  .t-btn.small, .t-icon.small, .t-quick button, .t-pager button, .t-chip button { min-height: 40px; }
  .t-icon.small { width: 40px; }
  .t-chip button { width: 36px; height: 36px; }
  .t-chip .t-chip-move { width: auto; }
  .t-opt { min-height: 40px; }
  .t-brief-box textarea, .t-kw-field input, .t-input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  [data-app-shell], .t-skip, .t-filters, .t-hero, .t-bulk, .t-pager, .t-row-actions, .t-row-select, .t-listbar, .t-results-tools, .t-sb-sel, .t-sb-actions, .t-lanetabs, .t-ai-actions { display: none !important; }
  .t-layout, .t-lanes { display: block; }
  .t-ai { position: static; max-height: none; margin-top: 24px; }
  .t-row, .t-sb-row, .t-ai-item { break-inside: avoid; }
}

/* Late additions: grouped quick buttons, results container. */
.t-quickset { display: grid; gap: 8px; }
.t-results-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.t-results:focus { outline: none; }
.t-numfield .t-fsub { margin-bottom: 4px; }
.t-firmpicker { display: grid; gap: 8px; }
.t-firmpicker .t-fsub { margin-bottom: -4px; }

/* ---------------------------------------------------------------------------
   MSC Portal profiles: "Looking for" chips, brief examples and notes, ranges,
   role badges, profile overview extras and CV page images. */

.t-fgroup[data-group="roles"] { background: var(--surface-2); }
.t-fgroup[data-group="roles"] .t-fgroup-toggle { font-size: 15px; }

.t-roles { display: flex; flex-wrap: wrap; gap: 8px; }

.t-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 8px 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 14px/1.2 var(--font);
  text-align: left;
}

.t-role-chip:first-child { padding-right: 12px; }
.t-role-chip:hover { border-color: var(--accent); color: var(--accent); }
.t-role-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.t-role-chip.zero { color: var(--muted); border-style: dashed; }

.t-role-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font: 700 13px/1 var(--font);
  font-variant-numeric: tabular-nums;
}

.t-role-chip[aria-pressed="true"] .t-role-count { background: color-mix(in srgb, var(--on-accent) 22%, transparent); color: var(--on-accent); }

.t-badge.role { background: var(--surface); border-color: var(--accent-line); color: var(--accent); }
.t-badge.role.hit { background: var(--accent-soft); }

.t-brief-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.t-example {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.t-example:hover { border-color: var(--accent); border-style: solid; color: var(--accent); }

.t-brief-notes { flex-basis: 100%; display: grid; gap: 4px; }

.t-brief-notes li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
}

.t-brief-notes .t-svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }

.t-range { display: grid; gap: 4px; }
.t-range-row { display: flex; align-items: center; gap: 8px; }
.t-range-row .t-input { flex: 1; min-width: 0; }

.t-profile-badges { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.t-profile-badges:empty { display: none; }
.t-profile-headline { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.t-psummary { color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }

.t-bullets { display: grid; gap: 4px; padding-left: 18px; list-style: disc; }
.t-bullets li { overflow-wrap: anywhere; }

.t-cv-note { margin-bottom: 12px; color: var(--muted); font-size: 13px; }

.t-cv-pages { display: grid; gap: 12px; }

.t-cv-page {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

@media (max-width: 720px) {
  .t-role-chip { min-height: 40px; }
  .t-example { min-height: 40px; }
  /* Keep the results near the fold on phones: two examples are enough. */
  .t-example:nth-of-type(n+3) { display: none; }
}

/* ---------------------------------------------------------------------------
   v3: "Understood as" (Must have / Nice to have / Context) */

.t-understood {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.t-understood-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.t-understood-head h2 { font: 700 16px/1.3 var(--font-head); }
.t-understood-head .t-hint { flex: 1 1 320px; }

.t-req-groups { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 980px) { .t-req-groups { grid-template-columns: minmax(0, 1fr); } }

.t-req-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--strong, var(--success));
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.t-req-group[data-kind="must"] { border-top-color: var(--success); }
.t-req-group[data-kind="nice"] { border-top-color: var(--good); }
.t-req-group[data-kind="context"] { border-top-color: var(--line-strong); }
.t-req-group h3 { font: 700 13px/1.3 var(--font); letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.t-req-group .t-chips:empty { display: flex; }

.t-chip.req { padding-left: 12px; }
.t-chip.req.must { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 35%, transparent); color: var(--success); }
.t-chip.req.nice { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good); }
.t-chip.req.context { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.t-chip.req.modifier { background: var(--surface); border-style: dashed; color: var(--muted); }
.t-chip .t-chip-move { width: auto; padding: 0 8px; gap: 4px; border-radius: 999px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; }
.t-chip .t-chip-move .t-svg { width: 14px; height: 14px; }
.t-req-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.t-req-add .t-link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.t-req-add .t-svg { width: 14px; height: 14px; }
.t-brief-unparsed strong { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------------------
   v3: filter groups with a Must / Nice to have switch */

.t-filters-note { padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.t-filters-note strong { color: var(--ink); font-weight: 600; }
.t-modebox { display: grid; gap: 4px; }
.t-modeseg span { min-height: 30px; }
.t-fgroup[data-mode="prefer"] { box-shadow: inset 3px 0 0 var(--good); }
.t-fgroup[data-mode="prefer"] .t-modeseg input:checked + span { color: var(--good); }
.t-fgroup-mode {
  padding: 0 8px;
  border-radius: 999px;
  background: var(--good-bg);
  color: var(--good);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}
.t-fother strong { color: var(--good); font-weight: 600; }

/* ---------------------------------------------------------------------------
   v3: results header, summary bar, exclusion breakdown */

.t-results-title { display: grid; gap: 6px; min-width: 0; }

.t-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--muted); }
.t-sum { display: inline-flex; align-items: center; gap: 6px; }
.t-sum strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.t-sum-dot, .t-tier-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.t-sum.strong .t-sum-dot, .t-tier-dot.strong { background: var(--success); }
.t-sum.good .t-sum-dot, .t-tier-dot.good { background: var(--good); }
.t-sum.close .t-sum-dot, .t-tier-dot.close { background: var(--warning); }
.t-sum-sep { color: var(--faint); }
.t-sum.took { color: var(--faint); font-size: 13px; }

button.t-sum.out {
  min-height: 32px;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

button.t-sum.out:hover { border-color: var(--accent); color: var(--accent); }
button.t-sum.out .t-svg { width: 14px; height: 14px; transition: transform 0.15s; }
button.t-sum.out[aria-expanded="true"] .t-svg { transform: rotate(180deg); }

.t-listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0 8px; }

.t-excluded {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius);
  background: var(--warning-bg);
}

.t-ex-head { display: grid; gap: 4px; margin-bottom: 12px; }
.t-ex-head h3 { font: 700 15px/1.35 var(--font-head); color: var(--ink); }
.t-ex-head .t-hint { color: var(--ink); opacity: 0.85; }
.t-ex-list { display: grid; gap: 8px; }

.t-ex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.t-ex-text { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.t-ex-n { font-variant-numeric: tabular-nums; }
.t-ex-text small { color: var(--muted); font-size: 13px; }
.t-ex-actions { display: flex; flex-wrap: wrap; gap: 4px; flex-shrink: 0; }

/* ---------------------------------------------------------------------------
   v3: tier headers, requirement state marks, score */

.t-tier-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 400 13px/1.4 var(--font); color: var(--muted); }
.t-tier-title strong { font: 700 15px/1.3 var(--font-head); color: var(--ink); }
.t-tier-n {
  min-width: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.t-tier-note { color: var(--muted); }

.t-tier-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  width: 100%;
  min-height: 36px;
  text-align: left;
  border-radius: var(--radius-sm);
}
.t-tier-toggle > .t-svg { width: 16px; height: 16px; color: var(--muted); transition: transform 0.15s; }
.t-tier-toggle[aria-expanded="false"] > .t-svg { transform: rotate(-90deg); }
.t-tier-toggle:hover strong { color: var(--accent); }

.t-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font: 700 14px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;
  flex-shrink: 0;
}
.t-mark.met { background: var(--success-bg); color: var(--success); }
.t-mark.partial { background: var(--warning-bg); color: var(--warning); }
.t-mark.missing { background: var(--danger-bg); color: var(--danger); }
.t-mark.unknown { background: var(--sunken); color: var(--muted); border: 1px dashed var(--line-strong); }

.t-score { display: inline-flex; }
.t-score-btn {
  display: inline-grid;
  grid-template-columns: auto 40px;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.t-score-btn:hover { background: var(--sunken); }
.t-score-n { font: 800 15px/1 var(--font-head); color: var(--ink); min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.t-score-bar { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; border: 1px solid var(--line); }
.t-score-bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* ---------------------------------------------------------------------------
   v3: scoreboard table */

.t-sb-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.t-sb-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: 13px; }
.t-sb-legend .t-mark { width: 20px; height: 20px; font-size: 13px; }
.t-sb-legend .t-mark + span { margin-right: 8px; }

.t-sb-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.t-sb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }

.t-sb thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 8px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.t-sb th, .t-sb td { vertical-align: middle; }
.t-sb td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.t-sb .t-sb-sel { width: 30px; padding-left: 10px; }
.t-sb .t-sb-sel input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.t-sb td.t-sb-rank, .t-sb th.t-sb-rank { width: 32px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.t-sb thead .t-sb-crit, .t-sb td.t-sb-crit { text-align: center; width: 48px; padding-left: 4px; padding-right: 4px; }
.t-sb thead .t-sb-crit { white-space: normal; line-height: 1.2; min-width: 44px; }
.t-sb td.t-sb-crit { cursor: help; }
.t-sb .t-sb-nice { text-align: center; white-space: nowrap; }
.t-nice-n { font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }
.t-sb .t-sb-score { width: 92px; }
.t-sb .t-sb-actions { width: 1%; padding-right: 10px; }
.t-sb .t-row-icons { justify-content: flex-end; }

.t-sb-cand {
  min-width: 168px;
  max-width: 260px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.t-sb-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.t-sb-name .t-name { font-size: 15px; }
.t-sb-line { display: flex; align-items: center; gap: 2px 6px; margin-top: 2px; min-width: 0; color: var(--muted); font-size: 13px; }
.t-sb-line > span:not(.t-badge):not(.sr-only) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-sb-line .t-badge { flex-shrink: 0; }
.t-sb-line .t-svg { width: 14px; height: 14px; color: var(--faint); }
.t-sb-line.faint { color: var(--faint); }
/* The scoreboard row's location in words, as the cards (owner, 2026-10-16); the row's title has it in full. */
.t-sb-loc .t-loc-sep { flex-shrink: 0; }
.t-sb-firm { color: var(--ink); }

.t-sb-tierrow th {
  padding: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}

.t-sb-tier + .t-sb-tier .t-sb-tierrow th { border-top: 8px solid var(--bg); }
.t-sb-row { outline: none; }
.t-sb-row:hover > * { background: var(--surface-2); }
.t-sb-row.selected > * { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.t-sb-row.active > :first-child { box-shadow: inset 3px 0 0 var(--accent); }
.t-sb-row:focus-visible > * { background: var(--accent-soft); }
.t-sb-row:focus-visible > :first-child { box-shadow: inset 3px 0 0 var(--accent); }
.t-sb-row.strong > .t-sb-rank { color: var(--success); font-weight: 700; }
.t-sb-row.close > .t-sb-rank { color: var(--warning); }
.t-sb tbody:last-child tr:last-child > * { border-bottom: 0; }

/* The scoreboard as stacked rows on phones: candidate + score, then the must-have marks, then actions. */
@media (max-width: 720px) {
  .t-sb-scroll { overflow: visible; border: 0; background: transparent; }
  .t-sb, .t-sb tbody { display: block; }
  .t-sb thead { display: none; }
  .t-sb tr.t-sb-tierrow { display: block; }
  .t-sb tr.t-sb-tierrow > th { display: block; padding: 12px 4px 8px; background: transparent; border: 0; }
  .t-sb tr.t-sb-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }
  .t-sb tr.t-sb-row > td, .t-sb tr.t-sb-row > th { display: block; width: auto; min-width: 0; max-width: none; padding: 0; border: 0; background: transparent; }
  .t-sb tr.t-sb-row > .t-sb-sel { flex: 0 0 22px; align-self: flex-start; padding-top: 2px; }
  .t-sb tr.t-sb-row > .t-sb-rank { display: none; }
  .t-sb tr.t-sb-row > .t-sb-cand { flex: 1 1 calc(100% - 110px); order: 1; }
  .t-sb tr.t-sb-row > .t-sb-score { flex: 0 0 auto; align-self: flex-start; order: 2; }
  .t-sb tr.t-sb-row > .t-sb-crit, .t-sb tr.t-sb-row > .t-sb-nice { order: 3; }
  .t-sb tr.t-sb-row > .t-sb-actions { order: 4; }
  .t-sb tr.t-sb-row > .t-sb-crit, .t-sb tr.t-sb-row > .t-sb-nice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 2px 8px 2px 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font-size: 13px;
  }
  .t-sb tr.t-sb-row > .t-sb-crit::after { content: attr(data-label); }
  .t-sb tr.t-sb-row > .t-sb-nice { padding-left: 8px; }
  .t-sb tr.t-sb-row > .t-sb-nice::before { content: 'Nice'; color: var(--muted); }
  .t-sb tr.t-sb-row > .t-sb-crit .t-mark { width: 22px; height: 22px; font-size: 13px; }
  .t-sb tr.t-sb-row > .t-sb-actions { flex: 1 0 100%; padding-top: 8px; border-top: 1px solid var(--line); }
  .t-sb .t-score-btn { grid-template-columns: auto; }
  .t-sb .t-score-bar { display: none; }
  .t-sb-row.active, .t-sb-row:focus-visible { border-color: var(--accent); }
  .t-sb tr.t-sb-row:hover > *, .t-sb tr.t-sb-row.selected > *, .t-sb tr.t-sb-row:focus-visible > * { background: transparent; }
  .t-sb tr.t-sb-row.selected { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
  .t-sb tr.t-sb-row.active > :first-child, .t-sb tr.t-sb-row:focus-visible > :first-child { box-shadow: none; }
}

/* ---------------------------------------------------------------------------
   v3: card view */

.t-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.t-tier-section { display: grid; gap: 10px; }
.t-row.strong { border-left: 4px solid var(--success); padding-left: 13px; }
.t-row.good { border-left: 4px solid var(--good); padding-left: 13px; }
.t-row.close { border-left: 4px solid var(--warning-line); padding-left: 13px; }
.t-row-rank { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.t-badge.tierbadge.strong { background: var(--success-bg); border-color: transparent; color: var(--success); }
.t-badge.tierbadge.good { background: var(--good-bg); border-color: transparent; color: var(--good); }
.t-badge.tierbadge.close { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }

.t-crit-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.t-crit { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: 13px; color: var(--ink); }
.t-crit .t-mark { width: 20px; height: 20px; font-size: 13px; }
.t-crit small { color: var(--muted); font-size: 13px; }
.t-crit-nice { color: var(--good); font-weight: 600; }

/* ---------------------------------------------------------------------------
   v3: AI recruiter review lane */

.t-ai {
  position: sticky;
  top: calc(var(--top-h) + 16px);
  max-height: calc(100vh - var(--top-h) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.t-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.t-ai-head h2 { display: inline-flex; align-items: center; gap: 8px; font: 750 17px/1.3 var(--font-head); }
.t-ai-head h2 .t-svg { color: var(--accent); }

.t-ai-note {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--muted);
  font-size: 13px;
}

.t-ai-status { display: grid; gap: 8px; }
.t-ai-status:empty { display: none; }
.t-ai-line { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.t-ai-line .t-spinner { width: 18px; height: 18px; flex-shrink: 0; }
.t-ai-line.done .t-svg { color: var(--success); }
.t-ai-line.failed { color: var(--danger); }
.t-ai-text { flex: 1; min-width: 0; }
.t-ai-elapsed { color: var(--muted); font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; }
.t-ai-progress { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.t-ai-progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.4s ease-out; }
.t-row-gap.tight { margin-top: 0; }

.t-ai-stale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: var(--ink);
  font-size: 13px;
}

.t-ai-body { display: grid; gap: 12px; }
.t-ai-body.stale .t-ai-list, .t-ai-body.stale .t-ai-memo { opacity: 0.6; }
.t-ai-empty { display: grid; gap: 12px; justify-items: start; color: var(--muted); }

.t-ai-memo {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink);
}

.t-ai-memo h3 { display: inline-flex; align-items: center; gap: 6px; font: 700 14px/1.3 var(--font-head); color: var(--accent); }
.t-ai-memo h3 .t-svg { width: 16px; height: 16px; }

.t-ai-list { display: grid; gap: 8px; }

.t-ai-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.t-ai-item.shortlist { border-left: 4px solid var(--success); }
.t-ai-item.consider { border-left: 4px solid var(--good); }
.t-ai-item.reject { border-left: 4px solid var(--line-strong); }
.t-ai-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-ai-top .t-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.t-ai-rank { font: 800 15px/1 var(--font-head); color: var(--muted); font-variant-numeric: tabular-nums; }
.t-ai-fit {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--ink);
  font: 800 14px/1 var(--font-head);
  font-variant-numeric: tabular-nums;
}
.t-ai-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.t-verdict { padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 24px; }
.t-verdict.shortlist { background: var(--success-bg); color: var(--success); }
.t-verdict.consider { background: var(--good-bg); color: var(--good); }
.t-verdict.reject { background: var(--danger-bg); color: var(--danger); }
.t-verdict.na { background: var(--sunken); color: var(--muted); }
.t-link.small { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.t-move { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.t-move.up { color: var(--success); }
.t-move.down { color: var(--danger); }
.t-move.same { color: var(--muted); }
.t-ai-reason { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }

.t-ai-more > summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.t-ai-more[open] > summary { margin-bottom: 8px; }
.t-ai-why { font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.t-ai-points { display: grid; gap: 6px; margin-bottom: 10px; }
.t-ai-points h4 { font: 700 13px/1.3 var(--font); letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }
.t-ai-points.pos h4 { color: var(--success); }
.t-ai-points.neg h4 { color: var(--danger); }
.t-ai-points ul { display: grid; gap: 8px; }
.t-ai-points li { display: grid; gap: 4px; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.t-ai-points .t-crit { display: flex; }
.t-ai-quotes { display: grid; gap: 4px; }
.t-ai-quote {
  margin: 0;
  padding: 4px 10px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  white-space: pre-line;
}
.t-ai-noev { color: var(--faint); font-size: 13px; }
.t-ai-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.t-ai-foot { color: var(--faint); font-size: 13px; }

/* Lane tabs (below 1200px). */
.t-lanetabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
}

.t-lanetab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.t-lanetab[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.t-lanetab .t-svg { width: 16px; height: 16px; }
.t-lane-state { font-weight: 600; font-size: 13px; color: var(--muted); }
.t-lane-state:empty { display: none; }
.t-lane-state[data-phase="running"], .t-lane-state[data-phase="queued"], .t-lane-state[data-phase="starting"] { color: var(--accent); }
.t-lane-state[data-phase="done"] { color: var(--success); }
.t-lane-state[data-phase="failed"], .t-lane-state[data-phase="error"] { color: var(--danger); }

/* Floating tooltip for scoreboard evidence and score breakdowns. */
.t-tip {
  position: fixed;
  z-index: 120;
  max-width: min(360px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--on-navy);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
}

:root[data-theme="dark"] .t-tip { background: #edf3ff; color: #0d1728; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-tip { background: #edf3ff; color: #0d1728; } }

.t-skel-list { display: grid; gap: 10px; }
.t-skel-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 80px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.t-skel-lines { display: grid; gap: 2px; }

@media (min-width: 1600px) {
  .t-layout { grid-template-columns: 272px minmax(0, 1fr); }
  .t-lanes { grid-template-columns: minmax(0, 1fr) 380px; }
}

/* AI review: candidates scored but not compared (the compare step failed or ran out of time). */
.t-ai-item.scored { border-left: 4px solid var(--accent-line); }
.t-verdict.scored { background: var(--accent-soft); color: var(--accent); }
.t-ai-partial { display: flex; gap: 6px; align-items: flex-start; }

/* ---------------------------------------------------------------------------
   Cards and the drawer, owner feedback of 2026-10-06 (talent-core.js): photos on the avatar, "+n" that opens the
   profile, required skills marked listed or not, the candidate's expected stipend, "Customize card view", the phone
   number shown in place on a desktop, and PDF CVs drawn by PDF.js on white, fit to the drawer's width. */

.t-avatar { position: relative; overflow: hidden; }
.t-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.15s ease-out; }
.t-avatar.has-photo .t-avatar-img { opacity: 1; }
.t-avatar.has-photo { background: var(--sunken); color: transparent; }

button.t-tag.more { cursor: pointer; font: inherit; font-size: 13px; }
button.t-tag.more:hover { border-color: var(--accent); color: var(--accent); }
.t-loc-more { appearance: none; background: none; border: 1px dashed var(--line-strong, var(--line)); border-radius: 999px; padding: 0 6px; font: inherit; font-size: 12px; line-height: 18px; color: var(--muted); cursor: pointer; }
.t-loc-more:hover { border-color: var(--accent); color: var(--accent); }
.t-loc-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-tag.miss { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); background: transparent; border-style: dashed; }
.t-fact.stipend .t-fact-label { color: var(--muted); }
/* School scores on a card: "Class X 94.3% CV · XII 95.4%" ("CV": read from the CV text, not a profile field). */
.t-fact.school { gap: 0 3px; }
.t-fact.school .t-fact-label { color: var(--muted); }
.t-fact-sep { color: var(--faint); }
.t-src { display: inline-flex; align-items: center; padding: 0 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 11px; font-weight: 650; line-height: 16px; letter-spacing: 0.2px; }
/* The either/or requirement said in the Articleship filters, with Remove. */
.t-either { display: block; padding: 8px 10px; border: 1px dashed var(--accent-line); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); overflow-wrap: anywhere; }
.t-either[hidden] { display: none; }
.t-either strong { font-weight: 700; }
.t-either .t-link { margin-left: 2px; }
/* The CA Final attempt window in the CA journey filters: From / By, each a month and a year. */
.t-month-window { display: grid; gap: 8px; }
.t-fsub + .t-month-window { margin-top: -4px; }
.t-month-row { display: grid; gap: 4px; }
.t-month-row .t-fsub { justify-content: flex-start; gap: 4px; }
.t-month-row .t-fsub small { color: var(--faint); font-weight: 500; }
.t-month-row .t-inline-field .t-input { flex: 1 1 0; }
.t-fact.final-attempt { gap: 0 3px; }
.t-fact.final-attempt .t-fact-label { color: var(--muted); }

.t-cardview { position: relative; }
.t-cardview-menu { right: 0; top: calc(100% + 6px); width: min(320px, calc(100vw - 32px)); display: grid; gap: 2px; padding: 12px; }
.t-cardview-menu[hidden] { display: none; }
.t-cardview-title { margin: 0 4px 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
.t-cardview-row { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; }
.t-cardview-row:hover { background: var(--sunken); }
.t-cardview-row input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.t-cardview-auto { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.t-cardview-row.auto { align-items: center; justify-content: space-between; cursor: default; }
.t-cardview-row.auto label { min-width: 0; cursor: pointer; }
.t-cardview-select { width: auto; flex-shrink: 0; }
.t-cardview-reset { justify-self: start; margin: 6px 8px 0; color: var(--accent); font-size: 13px; font-weight: 650; }

.t-reveal { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 4px 2px 10px; border: 1px solid var(--accent-line); border-radius: var(--radius-sm); background: var(--accent-soft); }
.t-reveal[hidden] { display: none; }
.t-reveal-number { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: 0.2px; user-select: all; }
.t-profile-loading { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.t-profile-loading .t-spinner { width: 14px; height: 14px; }

.t-pdf { display: grid; gap: 12px; }
.t-pdf-page { position: relative; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-sm); }
.t-pdf-canvas { display: block; width: 100%; height: 100%; }
.t-cv-page { max-width: 100%; }

@media (max-width: 720px) {
  .t-cardview-menu { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-height: 70vh; overflow-y: auto; }
  .t-contact-row .t-reveal { width: 100%; }
}
