:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --border: #dfe3ea;
  --accent: #2f6fed;
  --accent-hover: #2558c4;
  --success: #15905a;
  --danger: #c93c3c;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1d2128;
    --text: #e6e8ec;
    --muted: #9aa1ad;
    --border: #2f3540;
    --accent: #5b8cff;
    --accent-hover: #7aa2ff;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 18px; padding: 20px 20px 16px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none;
}
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); }
.ai-status { font-size: 13px; color: var(--muted); }
.ai-status .ok { color: var(--success); }
.ai-status .bad { color: var(--danger); }
.ai-provider { display: block; margin-bottom: 6px; }
.ai-provider select { display: block; width: 100%; margin-top: 4px; }

main { flex: 1; min-width: 0; max-width: 1000px; padding: 24px 32px 48px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head h1 { margin: 0; font-size: 24px; }
.view-head p { margin: 4px 0 0; }

.top-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px 0; }
.top-grid .card { margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
.list.scroll { max-height: 260px; overflow-y: auto; }
.add-jobs { display: flex; gap: 10px; align-items: stretch; margin: 8px 0 4px; }
.add-jobs textarea { flex: 1; }
.add-actions { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 600px) {
  .add-jobs { flex-direction: column; }
  .add-actions { flex-direction: row; }
}

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .brand { padding: 14px 16px 8px; }
  .sidebar nav { flex-direction: row; padding: 0 8px 8px; }
  .sidebar nav a { flex: 1; }
  .sidebar-foot { display: none; }
  main { padding: 16px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
}
.card h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.step {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px;
}
.badge { background: var(--border); border-radius: 999px; padding: 0 9px; font-size: 13px; }

.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0; }
.grow { flex: 1 1 260px; }
.spacer { flex: 1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

input[type=text], input[type=search], input[type=password], input[type=email], input[type=date], select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button, .button {
  font: inherit; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  border-radius: 8px; padding: 8px 14px;
  text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.success { background: var(--success); border-color: var(--success); color: #fff; }
.danger { color: var(--danger); }
.ghost { background: transparent; }
.icon { padding: 2px 8px; border: none; background: transparent; color: var(--muted); }
.icon:hover { color: var(--danger); }

.muted { color: var(--muted); }
.small { font-size: 13px; font-weight: normal; }
.center { text-align: center; }

.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px; border-bottom: 1px solid var(--border);
}
.list li:last-child { border-bottom: none; }
#pdResumes li { flex-wrap: wrap; padding: 12px 4px; }
.resume-prompt { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 6px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.resume-prompt textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.list li .name { flex: 1; overflow-wrap: anywhere; }
.list.compact li { padding: 4px; font-size: 14px; }

/* Tables scroll inside their own box, capped to the window height, so the horizontal scrollbar is always
   on screen (not only under the last row) and the header row stays visible while scrolling down. */
.table-wrap { margin-top: 10px; }
.table-wrap > table > thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.table-total { text-align: right; font-size: 12px; color: var(--muted); margin-top: 10px; }
.table-total:empty { display: none; }
.table-total + .table-wrap { margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
/* Long text in a table cell (app.js): one line ending in "…", the full text in the tooltip */
td .ell { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap !important; cursor: help; }
#parsedTable td .ell { max-width: 100%; } /* fixed column widths */
td.status-cell .status { display: inline-block; }
td.status-cell small { display: block; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.queued { background: var(--border); color: var(--muted); }
.status.generating, .status.rendering { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.ats-btn { padding: 0; border: none; background: none; text-align: left; line-height: 1.25; }
.ats-btn:hover .ats { text-decoration: underline; }
.ats { font-weight: 700; font-size: 15px; }
.ats.hi { color: var(--success); }
.ats.mid { color: #c98a12; }
.ats.lo { color: var(--danger); }
.ats-btn small { display: block; color: var(--muted); font-size: 12px; }
td.link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.link a { display: block; overflow: hidden; text-overflow: ellipsis; }
td.link .host { font-weight: 600; }
td.desc { color: var(--muted); overflow-wrap: anywhere; }
td.desc .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
a { color: var(--accent); }

.bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 12px; }
#barFill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.status { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--border); }
.status.done { background: var(--success); color: #fff; }
.status.failed { background: var(--danger); color: #fff; }
.status.generating, .status.rendering { background: var(--accent); color: #fff; }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); max-width: min(800px, 92vw); }
dialog pre { white-space: pre-wrap; max-height: 60vh; overflow: auto; font-size: 13px; }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #222; color: #fff; padding: 10px 16px; border-radius: 8px; max-width: 90vw; z-index: 10;
}
#toast.error { background: var(--danger); }

/* ---- resumes / templates ---- */
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--border); color: var(--muted); vertical-align: middle; }
.ac-roles { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-roles .role-tag { font-size: 13px; padding: 2px 10px; font-weight: 600; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); }
.chip.ok { color: var(--success); }
.chip.miss { color: var(--muted); border-style: dashed; }
.howto { margin: 0 0 12px; padding-left: 20px; }
.howto li { margin: 4px 0; }
.style-map { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.list li .button { padding: 8px 14px; }

/* ---- jobs ---- */
button.tiny { padding: 2px 8px; font-size: 12px; margin-left: 4px; }
.status.fetching { background: var(--accent); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.status.fetched { background: var(--border); color: var(--success); }

/* ---- editor dialog ---- */
dialog.editor { width: min(900px, 94vw); }
dialog.editor form { display: flex; flex-direction: column; gap: 8px; }
dialog.editor h3 { margin: 0; }
dialog.editor textarea { font-size: 13px; line-height: 1.45; min-height: 50vh; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }

/* ===== Generate page (wide layout) ===== */
main:has(.view.wide:not([hidden])) { max-width: none; }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 700; margin: 6px 0 2px; }
.accent-green { color: var(--success); }

.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.seg-btn { border: none; background: transparent; padding: 6px 14px; }
.seg-btn.active { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.guide { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.guide summary { font-weight: 600; cursor: pointer; }
.guide ol { margin: 8px 0; padding-left: 20px; }
.guide li { margin: 3px 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar button, .toolbar .button { font-size: 14px; padding: 7px 12px; }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
label.inline select { width: auto; min-width: 180px; }
.zip-opts { display: inline-flex; gap: 10px; align-items: center; }
.zip-opts label { flex-direction: row; align-items: center; gap: 4px; }
.paste-box { margin-bottom: 10px; }
.progress-box { margin-bottom: 14px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card)); border-radius: 10px; padding: 12px 14px; }
.progress-box p { margin: 2px 0 0; }
.progress-head { display: flex; justify-content: space-between; gap: 8px; }

.right { text-align: right; }

.quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.quick-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.snippet { display: block; margin-top: 3px; max-width: 340px; overflow-wrap: anywhere; }
mark { background: color-mix(in srgb, #f5c542 55%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
#startAt { width: 70px; padding: 4px 6px; }

/* Every table: its own scroll box with an always-visible horizontal scrollbar, short enough that it stays on screen (wide tables scroll
   sideways instead of squeezing their columns; headers stay on one line). The Jobs table always shows its vertical bar. */
.table-wrap { max-height: 65vh; overflow-x: scroll; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.table-wrap > table > thead th { white-space: nowrap; }
#view-jobs .table-wrap { overflow-y: scroll; }
/* Always-visible scrollbars (Windows 11 / Chromium overlay scrollbars otherwise hide until hovered) */
.table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.table-wrap::-webkit-scrollbar-track { background: var(--bg); }
.table-wrap::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 6px; border: 2px solid var(--bg); }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.table-wrap::-webkit-scrollbar-corner { background: var(--bg); }
@supports not selector(::-webkit-scrollbar) {
  .table-wrap { scrollbar-width: auto; scrollbar-color: var(--muted) var(--bg); }
}
/* Found jobs: wide enough for its columns; narrower screens scroll sideways */
#view-found .table-wrap > table { min-width: 1350px; }
#view-found .table-wrap .job-cell { min-width: 280px; max-width: 420px; }
/* the other columns take ~1680px; the rest (at least ~370px) goes to the Job column */
#parsedTable { table-layout: fixed; min-width: 2050px; }
#parsedTable th { font-size: 12px; white-space: nowrap; }
#parsedTable td { font-size: 13px; }
#parsedTable tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
#parsedTable .c-job { width: auto; }
#parsedTable .c-check { width: 34px; }
#parsedTable .c-num { width: 44px; }
#parsedTable .c-status { width: 190px; }
#parsedTable .c-date { width: 100px; }
#parsedTable .c-by { width: 120px; }
.added-by { display: block; }
:is(#parsedTable, #subsTable) .job-cell { min-width: 0; }
:is(#parsedTable, #subsTable) .job-title { font-weight: 600; overflow-wrap: anywhere; }
:is(#parsedTable, #subsTable) .job-company { color: var(--muted); margin-top: 1px; }
:is(#parsedTable, #subsTable) .link { margin-top: 2px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(#parsedTable, #subsTable) .link a { display: block; overflow: hidden; text-overflow: ellipsis; }
:is(#parsedTable, #subsTable) .link .host { font-weight: 600; }
#subsTable .job-cell { max-width: 320px; }
#subsTable .sub-note { max-width: 240px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.shot-cell { max-width: 280px; }
.shot-link { display: block; margin-top: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-thumb { width: 120px; height: 68px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 6px; display: block; }
#parsedTable .pill-cell small { display: block; margin-top: 4px; line-height: 1.35; overflow-wrap: anywhere; }
#parsedTable .snippet { max-width: none; }
#parsedTable .actions { flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
#parsedTable td:nth-child(3) { white-space: nowrap; }
#parsedTable .exports.row { flex-direction: row; flex-wrap: wrap; }

#jobsTable { table-layout: fixed; min-width: 1280px; }
#jobsTable th { font-size: 12px; text-align: center; }
#jobsTable td { vertical-align: top; font-size: 13px; }
#jobsTable .c-check { width: 34px; }
#jobsTable .c-num { width: 40px; }
#jobsTable .c-link { width: 190px; }
#jobsTable .c-role { width: 210px; }
#jobsTable .c-company { width: 100px; }
#jobsTable .c-pill { width: 96px; }
#jobsTable .c-q { width: 64px; }
#jobsTable .c-pill2 { width: 120px; }
#jobsTable .c-ats { width: 96px; }
#jobsTable .c-export { width: 118px; }
#jobsTable .c-actions { width: 150px; }
#jobsTable tr.busy-row { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.link-cell { display: flex; align-items: center; gap: 2px; }
.link-input { font: inherit; font-size: 13px; padding: 5px 7px; min-width: 0; width: 100%; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
.link-cell .icon { padding: 2px 5px; text-decoration: none; color: var(--muted); }
.role { overflow-wrap: anywhere; }
.role + small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pill-cell small { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.pill-cell small.err { color: var(--danger); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.pill.ok { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.pill.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.pill.busy { background: var(--accent); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.pill.idle { background: var(--border); color: var(--muted); }
.quality { font-weight: 600; }
.quality.hi { color: var(--success); } .quality.mid { color: #c98a12; } .quality.lo { color: var(--danger); }
.ats-chip { display: inline-block; min-width: 30px; text-align: center; padding: 2px 6px; border-radius: 999px; font-weight: 600; font-size: 12px; background: var(--border); }
.ats-chip.hi { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.ats-chip.mid { background: color-mix(in srgb, #c98a12 16%, transparent); color: #c98a12; }
.ats-chip.lo { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.exports { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.exp { font-size: 12px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text); white-space: nowrap; }
.exp:hover { border-color: var(--accent); }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.act { width: 28px; height: 28px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; font-size: 14px; }
.act.gen { background: var(--accent); border-color: var(--accent); color: #fff; }
.act.del:hover { border-color: var(--danger); }
a.act { text-decoration: none; color: inherit; }
table.plain td, table.plain th { font-size: 13px; }

/* Dashboard */
.dash-section { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 8px; }
.dash-grid .card { margin: 0; }
.dash-tile .stat-value { font-variant-numeric: tabular-nums; }
.dash-table td.right, .dash-table th.right { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.dash-table td b { font-weight: 600; }
.dash-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.dash-filters .quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.dash-filters .grow { flex: 1 1 220px; }
.dash-period { text-transform: none; letter-spacing: 0; font-weight: 400; }
#dashCallersCard { margin-top: 16px; }

/* Jobs page (parsed jobs) */
#parsedSearch { width: 340px; max-width: 100%; }
#parsedDates input[type=date] { width: auto; padding: 4px 8px; }
#parsedTable .c-jd { width: 84px; }
#parsedTable .c-tries { width: 150px; }
#parsedTable .c-tailored { width: 90px; }
#parsedTable .c-type { width: 90px; }
#parsedTable .c-location { width: 140px; }
#parsedTable .c-mode { width: 90px; }
#parsedTable .location { display: block; overflow-wrap: anywhere; }
#parsedTable .c-actions { width: 150px; }

/* ---- sign-in, users & roles ---- */
[hidden] { display: none !important; }
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.auth-card .brand { padding: 0; }
.auth-card p { margin: 0; }
.user-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.user-box .row { margin: 6px 0 0; gap: 6px; }
.user-box button.tiny { margin-left: 0; }
form.stack { display: flex; flex-direction: column; gap: 10px; width: min(480px, 86vw); }
form.stack h3 { margin: 0; }
form.stack h4 { margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.notice { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fff6e0; border: 1px solid #f0d58a; font-size: 13px; }
.perm-list { border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.perm-list legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.perm-list label.inline { align-items: flex-start; color: var(--text); }
.perm-list input { margin-top: 3px; }

/* ---- profiles ---- */
#profilesBody tr[data-open], #runsBody tr[data-open] { cursor: pointer; }
#profilesBody tr[data-open]:hover td { background: var(--bg); }
#profilesBody a:not(.button) { color: inherit; text-decoration: none; }
.nowrap { white-space: nowrap; }
.back { display: inline-block; margin-bottom: 4px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }
form.stack.full { width: auto; }
.card-head .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; }
.profile-grid label.full { grid-column: 1 / -1; }
.profile-entry + .profile-entry { border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 4px; }
.profile-entry-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pe-entry { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pe-entry .row { align-items: flex-end; }
.pe-status:empty { display: none; }
.pe-status small { display: block; }
.pe-entry small.err { color: var(--danger); }
.pe-ms { align-items: center; gap: 10px; }
.pe-ms .ok-text { color: var(--success); font-weight: 600; }
.pe-ms-flow { border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; line-height: 1.9; }
.pe-ms-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.15em; letter-spacing: 1px; }

/* ---- job list owner (admin), submissions ---- */
.scroll-list { max-height: 180px; overflow-y: auto; }
.shot-box { display: flex; flex-direction: column; gap: 6px; }
.shot-box p { margin: 0; }
.sub-files { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-file { position: relative; width: 160px; }
.sub-file img, .sub-file video { width: 160px; height: 90px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 8px; display: block; background: #000; }
.sub-file .icon { position: absolute; top: 4px; right: 4px; }
.sub-file small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-list { display: flex; flex-wrap: wrap; gap: 6px; }
.shot-video { width: 120px; height: 68px; border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 22px; text-decoration: none; background: var(--panel, #f4f4f4); }
#subJob { margin: 0; overflow-wrap: anywhere; }
#pdAssign { padding: 10px; max-height: 260px; }

/* Submissions page: jobs not submitted yet (a row opens the submission dialog) */
table.clickable tbody tr[data-pending] { cursor: pointer; }
table.clickable tbody tr[data-pending]:hover td { background: var(--hover, rgba(127, 127, 127, .08)); }
#subDlg { width: min(720px, 94vw); }
.sub-job { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius); }
.sub-job-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; align-items: start; font-size: 13px; }
.sub-job details pre { max-height: 30vh; }

/* Submission dialog: selectable screenshots (Ctrl+C), live preview of the shared screen */
.sub-file { cursor: pointer; border-radius: 10px; outline: none; }
.sub-file.selected img, .sub-file:focus img { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sub-file .icon.copy { right: 34px; }
.sub-file .icon { background: var(--card); border-radius: 6px; }
.share-box { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.share-box video { width: 200px; height: 112px; object-fit: contain; background: #000; border-radius: 6px; }
.share-box p { margin: 4px 0 8px; }

/* Form validation (submission dialog) */
.req { color: var(--danger); }
.field-err { display: block; color: var(--danger); font-size: 12px; }
.field-err:empty { display: none; }
.invalid select, select.invalid { border-color: var(--danger); }
fieldset.invalid, .shot-box.invalid { border: 1px solid var(--danger); border-radius: 8px; }
.shot-box.invalid { padding: 8px; }
.form-errors { border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.form-errors ul { margin: 4px 0 0; padding-left: 18px; }

/* Job sites */
#sitesTable .actions { flex-wrap: nowrap; justify-content: flex-end; }
#sitesTable .job-cell small { display: block; }
.test-out { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 12px; max-height: 260px; overflow: auto;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; }
.mcp-box { padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; }
.mcp-box textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.tool-pick { cursor: pointer; text-decoration: underline; }
.rules-head { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 14px; }
.rules-row { align-items: center; }
.proxy-box { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.proxy-box label.grow { display: flex; flex-direction: column; gap: 4px; }
.proxy-box textarea { width: 100%; box-sizing: border-box; font-size: 12px; }
.proxy-row { align-items: center; flex-wrap: wrap; }
#pProxyBox input[type=text] { width: 100%; box-sizing: border-box; }
#pProxyTestUrl { flex: 1 1 220px; min-width: 0; }
input.num { width: 70px; }
label.grow { flex: 1; }

/* Interviews page: calendar invites */
dialog.wide-dlg { width: min(860px, 94vw); }
/* Sized to the media: the dialog wraps the image / video, which fits within the viewport. */
dialog.media-dlg { width: auto; min-width: min(520px, 96vw); max-width: 96vw; max-height: 96vh; padding: 12px 14px; overflow: hidden; }
.media-form { display: flex; flex-direction: column; gap: 10px; }
.media-head { display: flex; align-items: center; gap: 8px; }
.media-head #mediaName { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-stage { display: flex; align-items: center; justify-content: center; gap: 8px; }
#mediaBody { display: flex; align-items: center; justify-content: center; min-width: 0; }
#mediaBody img, #mediaBody video { display: block; max-width: calc(96vw - 140px); max-height: calc(96vh - 90px); width: auto; height: auto; object-fit: contain; border-radius: 6px; background: #000; }
.media-nav { flex: none; font-size: 28px; line-height: 1; padding: 6px 12px; opacity: .8; }
.media-nav:hover { opacity: 1; }
.media-nav[hidden] { display: none; }
.shot-open { cursor: zoom-in; }
#invAssign { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
#invAssign legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.inv-when b { display: block; white-space: nowrap; }
.inv-when small { white-space: nowrap; }
.inv-soon { color: var(--accent); font-weight: 600; }
tr.inv-cancelled td { opacity: .55; }
tr.inv-cancelled .job-title { text-decoration: line-through; }
.inv-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 14px; margin: 4px 0 8px; }
.inv-meta dt { color: var(--muted); }
.inv-meta dd { margin: 0; overflow-wrap: anywhere; }
.inv-desc { white-space: pre-wrap; max-height: 180px; overflow: auto; font-size: 13px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 0; }
.inv-session { border-top: 1px solid var(--border); padding: 8px 0; }
.nowrap { white-space: nowrap; }
/* Transcript viewer (interview sessions) */
.transcript { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.tr-line { display: grid; grid-template-columns: 64px 1fr; gap: 8px; font-size: 14px; line-height: 1.45; }
.tr-line .tr-at { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.tr-line .tr-who { font-weight: 600; margin-right: 6px; }
.tr-line.you .tr-who { color: var(--accent); }
.tr-line.hidden { display: none; }
.transcript mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 2px; }
.inv-calls-h { margin: 12px 0 2px; }
.inv-sess-body { padding: 6px 0 2px; }
.inv-tr { max-height: 280px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.inv-session video { width: 100%; max-height: 360px; background: #000; border-radius: 8px; margin-top: 6px; }

/* ---- Interviews calendar (Google Calendar / Outlook look) ---- */
#invMode, #calRange { margin-bottom: 0; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.cal-bar h2 { margin: 0 0 0 6px; font-size: 20px; font-weight: 500; }
.cal-nav { font-size: 20px; line-height: 1; padding: 4px 10px; }
.cal-opt { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.cal-bar select { width: auto; }
.toolbar #invProfile { width: auto; min-width: 160px; }
.cal { --line: var(--border); --today: #1a73e8; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.cal button { font: inherit; }
.cal-head, .cal-allday, .cal-body { display: grid; }
.cal-head { border-bottom: 1px solid var(--line); }
.cal-head, .cal-allday, .cal-scroll { overflow-y: hidden; scrollbar-gutter: stable; } /* columns line up with the scrolling grid */
.cal-tz { font-size: 10px; color: var(--muted); padding: 6px 4px; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.cal-dayhead { border: 0; background: none; border-left: 1px solid var(--line); border-radius: 0; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--text); }
.cal-dayhead .dow { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-dayhead .dnum { font-size: 22px; width: 40px; height: 40px; line-height: 40px; border-radius: 50%; }
.cal-dayhead:hover .dnum { background: var(--bg); }
.cal-dayhead.today .dow { color: var(--today); }
.cal-dayhead.today .dnum { background: var(--today); color: #fff; }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 26px; }
.cal-allday > div:not(.cal-tz) { border-left: 1px solid var(--line); padding: 2px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-scroll { height: 620px; max-height: 70vh; overflow-y: auto !important; }
.cal-body { position: relative; }
.cal-hours { position: relative; }
.cal-hours div { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.cal-col { position: relative; border-left: 1px solid var(--line); min-width: 0;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #ea4335; z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #ea4335; }

.cal-ev { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; overflow: hidden; color: #fff;
  background: var(--ev); border-radius: 4px; padding: 2px 6px; font-size: 12px; line-height: 1.3; min-width: 0; }
.cal-ev:hover { filter: brightness(.92); }
.cal-ev .ev-t { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev .ev-time, .cal-ev .ev-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .92; }
.cal-ev.ev-timed { position: absolute; z-index: 2; box-shadow: 0 0 0 1px var(--card); }
.cal-ev.ev-timed.short { display: flex; gap: 6px; align-items: center; padding-top: 0; padding-bottom: 0; }
.cal-ev.ev-timed.short .ev-sub { display: none; }
.cal-ev.ev-timed.short .ev-t { flex: 0 1 auto; }
.cal-ev.cancelled { opacity: .5; }
.cal-ev.cancelled .ev-t { text-decoration: line-through; }

.cal-mhead { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal-mhead div { text-align: center; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 0; }
.cal-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(110px, auto); }
.cal-mcell { border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 2px 4px 4px; min-width: 0;
  display: flex; flex-direction: column; gap: 2px; }
.cal-mgrid .cal-mcell:nth-child(7n + 1) { border-left: 0; }
.cal-mgrid .cal-mcell:nth-child(-n + 7) { border-top: 0; }
.cal-mcell.other { background: var(--bg); }
.cal-mcell.other .cal-daynum { color: var(--muted); }
.cal-daynum { align-self: center; border: 0; background: none; font-size: 12px; font-weight: 500; min-width: 24px; height: 24px;
  border-radius: 12px; padding: 0 6px; cursor: pointer; color: var(--text); }
.cal-daynum:hover { background: var(--bg); }
.cal-mcell.today .cal-daynum { background: var(--today); color: #fff; }
.cal-ev.ev-month { background: none; color: var(--text); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.cal-ev.ev-month:hover { background: var(--bg); filter: none; }
.cal-ev.ev-month .ev-t { font-weight: 500; display: inline; }
.cal-ev.ev-month .ev-time { display: inline; opacity: 1; color: var(--muted); flex: none; overflow: visible; }
.cal-ev.ev-month .ev-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ev); flex: none; }
.cal-more { border: 0; background: none; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 6px; cursor: pointer; }
.cal-more:hover { color: var(--text); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; margin-top: 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* Outlook: Monday first, half-hour lines, light event blocks with a colored bar on the left */
.cal-outlook { --today: #0f6cbd; border-radius: 4px; }
.cal-outlook .cal-dayhead { flex-direction: row; justify-content: center; gap: 6px; align-items: baseline; padding: 8px 0; }
.cal-outlook .cal-dayhead .dnum { font-size: 18px; width: auto; height: auto; line-height: 1.2; border-radius: 0; font-weight: 600; }
.cal-outlook .cal-dayhead:hover .dnum { background: none; }
.cal-outlook .cal-dayhead .dow { text-transform: none; font-size: 13px; letter-spacing: 0; }
.cal-outlook .cal-dayhead.today { box-shadow: inset 0 3px 0 var(--today); }
.cal-outlook .cal-dayhead.today .dnum { background: none; color: var(--today); }
.cal-outlook .cal-col.today { background-color: color-mix(in srgb, var(--today) 6%, transparent); }
.cal-outlook .cal-col { background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 24px,
  color-mix(in srgb, var(--line) 45%, transparent) 24px 25px, transparent 25px 48px); }
.cal-outlook .cal-ev:not(.ev-month) { color: var(--text); background: color-mix(in srgb, var(--ev) 18%, var(--card));
  border-left: 4px solid var(--ev); border-radius: 2px; }
.cal-outlook .cal-ev:not(.ev-month):hover { background: color-mix(in srgb, var(--ev) 28%, var(--card)); filter: none; }
.cal-outlook .cal-now { background: var(--today); }
.cal-outlook .cal-now::before { background: var(--today); left: -4px; top: -3px; width: 8px; height: 8px; }
.cal-outlook .cal-mcell.today { box-shadow: inset 0 3px 0 var(--today); }
.cal-outlook .cal-mcell.today .cal-daynum { background: none; color: var(--today); font-weight: 700; }
.cal-outlook .cal-daynum { align-self: flex-start; }
.cal-outlook .ev-dot { border-radius: 2px; width: 4px; height: 14px; }

@media (max-width: 720px) {
  .cal-scroll { height: 520px; }
  .cal-dayhead .dnum { font-size: 16px; width: 30px; height: 30px; line-height: 30px; }
  .cal-mgrid { grid-auto-rows: minmax(70px, auto); }
  .cal-ev.ev-month .ev-time { display: none; }
}

/* ---- sign-up / approval ---- */
.auth-note { background: color-mix(in srgb, var(--success) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
  color: var(--text); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 0; }
.auth-card .center { text-align: center; margin: 4px 0 0; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
  min-width: 18px; padding: 1px 6px; text-align: center; }
.pending-note { background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; }

/* ---- interviews: callers of one invite ---- */
#invCallers .scroll-list { max-height: 220px; }
.caller-table th, .caller-table td { padding: 5px 6px; vertical-align: middle; }
.caller-table th { position: sticky; top: 0; background: var(--card, #fff); }
.caller-table td.center input { margin: 0; }

/* Spinner on a button while the API request it started is running (see the fetch hook in the JS). */
button.is-loading, .button.is-loading { pointer-events: none; cursor: progress; }
button.is-loading::before, .button.is-loading::before {
  content: ""; display: inline-block; box-sizing: border-box; width: 1em; height: 1em;
  margin-right: .45em; vertical-align: -.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Job boards page: a tile per board of job-site-apis.yaml, with its buttons */
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.board { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.board-urls { margin: 0; padding-left: 16px; font-size: 12px; }
.board-urls code { word-break: break-all; }
.board-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 4px; font-size: 13px; }
.board-note { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.board-foot .actions { display: flex; flex-wrap: wrap; gap: 4px; }
.targets-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; font-size: 13px; }
.targets-info code { word-break: break-all; }

/* Jobright sign-in: the server's browser screen (remote_login.py) */
dialog.rb-dlg { width: min(1300px, 96vw, calc((96vh - 160px) * 1.6 + 28px)); max-width: 96vw; max-height: 96vh; padding: 10px 14px; }
dialog.rb-dlg h3 { margin: 0; }
.rb-screen-wrap { background: #000; border-radius: 6px; overflow: hidden; line-height: 0; }
.rb-screen { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 800; cursor: default; outline: none; user-select: none; }
.rb-screen:focus { box-shadow: inset 0 0 0 2px var(--accent, #4a7cff); }

/* Jobs page: delete confirmation */
#jobDelDlg { width: min(620px, 92vw); }
.jdel-list { max-height: 40vh; overflow: auto; margin: 8px 0; padding-left: 20px; font-size: 13px; }
.jdel-list li.gen { color: var(--danger); }
#jdelType { width: 120px; margin-left: 6px; }

/* ---- brand row + notifications (sidebar) ---- */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 17px; padding-right: 14px; }
.brand-row > span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.notif-btn.is-loading::before { display: none; }
.brand-logo { width: 24px; height: 24px; }
.notif-btn { position: relative; border: none; background: transparent; padding: 4px 6px; font-size: 18px; line-height: 1; }
.notif-btn .nav-badge { position: absolute; top: -4px; right: -6px; margin: 0; }
.notif-panel { position: fixed; left: 12px; top: 58px; width: min(380px, calc(100vw - 24px)); max-height: 70vh; z-index: 20;
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.notif-list li { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.notif-list li:hover { background: var(--bg); }
.notif-list li.unread { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.notif-list li.unread b::before { content: "● "; color: var(--accent); }
.notif-list li p { margin: 3px 0 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-list li small { color: var(--muted); }
.notif-list .empty { cursor: default; color: var(--muted); text-align: center; }

/* ---- comments on submissions ---- */
.cmt-btn { white-space: nowrap; }
.cmt-btn.has { color: var(--accent); font-weight: 600; }
form.cmt-form { width: auto; }
.cmt-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.cmt-list .empty { color: var(--muted); text-align: center; padding: 16px; }
.cmt { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--card); }
.cmt.mine { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.cmt-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.cmt-head small { color: var(--muted); }
.cmt-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; font-size: 14px; }
.cmt-actions { display: flex; gap: 2px; margin-left: auto; }
.cmt-actions button { padding: 0 6px; font-size: 12px; border: none; background: transparent; color: var(--muted); }
.cmt-actions button:hover { color: var(--accent); }
.cmt-replies { margin: 8px 0 0 18px; display: flex; flex-direction: column; gap: 8px; border-left: 2px solid var(--border); padding-left: 10px; }
.cmt-replies .cmt { background: var(--bg); }
.cmt.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }
.cmt-new textarea { font-family: inherit; font-size: 14px; }
.cmt-replyto { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.drive-state { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.drive-state.bad { color: var(--danger); }

/* ---- Mail page ---- */
.mail-pane { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 14px; min-height: 60vh; }
@media (max-width: 900px) { .mail-pane { grid-template-columns: 1fr; } }
.mail-list-wrap { display: flex; flex-direction: column; min-width: 0; }
.mail-list { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 8px;
  overflow-y: auto; max-height: 70vh; }
.mail-list li { padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; min-width: 0; }
.mail-list li:last-child { border-bottom: none; }
.mail-list li:hover { background: var(--bg); }
.mail-list li.active { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.mail-list li.unseen .mail-from, .mail-list li.unseen .mail-subj { font-weight: 700; }
.mail-list .mail-top { display: flex; gap: 8px; font-size: 13px; }
.mail-list .mail-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .mail-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mail-list .mail-subj { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .empty { cursor: default; color: var(--muted); text-align: center; padding: 20px; }
.mail-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.mail-read { border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.mail-empty { margin: auto; padding: 40px; }
.mail-head { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.mail-head h2 { margin: 0 0 6px; font-size: 17px; overflow-wrap: anywhere; }
.mail-head .mail-meta { font-size: 13px; color: var(--muted); display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; }
.mail-head .mail-meta span:nth-child(odd) { font-weight: 600; }
.mail-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.mail-atts { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.mail-atts a { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; text-decoration: none; }
.mail-frame { flex: 1; width: 100%; min-height: 60vh; border: 0; background: #fff; }
.mail-text { margin: 0; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.5 system-ui, sans-serif; }

/* ---- Downloads page ---- */
.rel-latest { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding: 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.rel-latest .rel-ver { font-size: 26px; font-weight: 700; }
.rel-latest .rel-files { display: flex; flex-direction: column; gap: 6px; }
.rel-latest .rel-notes { flex: 1 1 260px; white-space: pre-wrap; font-size: 13px; margin: 0; }
.rel-older { margin-top: 12px; }
.rel-older summary { cursor: pointer; font-weight: 600; font-size: 14px; }

/* ---- landing page ---- */
.landing { min-height: 100vh; background:
  radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, #7a5cff 18%, transparent), transparent),
  radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent), var(--bg); }
.landing[hidden] { display: none; }
.ld-nav { display: flex; align-items: center; gap: 10px; max-width: 1120px; margin: 0 auto; padding: 18px 24px; }
.ld-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; }
.ld-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; max-width: 1120px; margin: 0 auto; padding: 48px 24px 32px; }
.ld-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 4px 10px; border-radius: 999px; }
.ld-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; margin: 16px 0; letter-spacing: -.02em; }
.ld-grad { background: linear-gradient(90deg, #2f6fed, #7a5cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld-hero p { font-size: 17px; color: var(--muted); max-width: 560px; margin: 0; }
.ld-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 8px; }
.ld-big { padding: 12px 22px; font-size: 16px; font-weight: 600; border-radius: 10px; }
.landing .ld-small { font-size: 13px; }
.ld-mock { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 24px 60px rgba(20, 30, 60, .16); transform: rotate(1.5deg); }
.ld-mock-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.ld-mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.ld-mock-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 10px; font-size: 14px; }
.ld-mock-sub { font-size: 12px; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.ld-mock-sub:last-child { border-bottom: none; }
.ld-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 1120px; margin: 0 auto; padding: 24px; }
.ld-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.ld-card h3 { margin: 10px 0 6px; font-size: 17px; }
.ld-card p { margin: 0; font-size: 14px; color: var(--muted); }
.ld-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-size: 20px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ld-roles { max-width: 1120px; margin: 0 auto; padding: 24px 24px 40px; }
.ld-roles h2 { font-size: 24px; margin: 8px 0 16px; }
.ld-role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ld-role-grid > div { border-left: 3px solid var(--accent); padding: 4px 14px; }
.ld-role-grid p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.ld-foot { display: flex; gap: 10px; max-width: 1120px; margin: 0 auto; padding: 20px 24px 32px; font-size: 13px;
  color: var(--muted); border-top: 1px solid var(--border); }
@media (max-width: 860px) {
  .ld-hero { grid-template-columns: 1fr; padding-top: 24px; }
  .ld-hero-art { display: none; }
  .ld-features, .ld-role-grid { grid-template-columns: 1fr; }
  .ld-nav, .ld-hero, .ld-features, .ld-roles, .ld-foot { padding-left: 16px; padding-right: 16px; }
}

/* ---- rejected jobs, profile change requests ---- */
.rejected-note { margin-top: 4px; font-size: 12px; color: var(--danger); }
.pcr-card { border-color: color-mix(in srgb, #c98a12 45%, var(--border)); }
.pcr { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.pcr-head { font-size: 14px; }
.pcr p { margin: 6px 0 0; }
.pcr-table { margin-top: 6px; }
.pcr-table td:first-child, .pcr-table th:first-child { width: 28px; }

/* ---- guide ---- */
.guide-tabs { margin: 14px 0 2px; }
.guide-tabs a.chip-btn { border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13px; padding: 4px 12px; }
.guide-tabs a.chip-btn.active { color: #fff; }
.card.guide p { margin: 8px 0 0; line-height: 1.55; }
.guide-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.55; }
.guide code { font-size: 12.5px; background: var(--border); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
.guide kbd { font: 12px ui-monospace, Consolas, monospace; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
.card.guide p.guide-must { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #d97706; border-radius: 8px; background: rgba(217, 119, 6, .1); }

/* Found jobs: sortable headers, pager */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--accent); }
th.sortable[data-dir="asc"]::after { content: " ▲"; font-size: 10px; }
th.sortable[data-dir="desc"]::after { content: " ▼"; font-size: 10px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.pager-btns { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pager-btns button { padding: 4px 10px; }
.found-filters select { width: auto; }

/* Job detail page */
.det-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; }
.det-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; align-items: baseline; }
.det-k { color: var(--muted); white-space: nowrap; }
.det-v { overflow-wrap: anywhere; min-width: 0; }
.det-v small { display: block; }
.det-desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; max-height: 70vh; overflow: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 0; }
.det-cols .card { min-width: 0; }
a.job-link { color: inherit; text-decoration: none; }
a.job-link:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 600px) { .det-grid { grid-template-columns: 1fr; gap: 2px; } .det-k { margin-top: 6px; } }

/* Search / filter cards above the table cards (every page) */
.search-card .card-head { margin-bottom: 6px; }
.search-card .card-head h2 { font-size: 15px; margin: 0; }
.search-card .quick:last-child, .search-card .toolbar:last-child { margin-bottom: 0; }
.search-card > input[type="search"] { width: 100%; max-width: 520px; }
