/* Styles used only by the HR pages (jobs, applicants). Shared pieces live in app.css. */

.small { font-size: 13px; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.flash.warn { background: var(--amber-surface); border-color: #f0d79b; color: #5f3f00; }
.card > :last-child { margin-bottom: 0; }
.card > * + .flash, .card > * + .actions, .card > .flash + form { margin-top: 14px; }

/* ---- Tables ---- */
/* On a phone the table keeps a readable width and scrolls sideways inside its frame. */
.scroll { overflow-x: auto; }
.scroll table.grid { min-width: 780px; }
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td { overflow-wrap: anywhere; }
table.grid .actions { flex-wrap: nowrap; }
.actions button, .actions a { white-space: nowrap; }
.nowrap { white-space: nowrap; }
table.grid td .small { margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---- Buttons that sit in a row, each in its own form ---- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
form.inline { margin: 6px 0 0; }

/* ---- New job form: two columns, one on a phone ---- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fields .wide { grid-column: 1 / -1; }
.fields textarea.tall { min-height: 170px; }
.fields label .hint { margin-top: 4px; }
@media (max-width: 720px) { .fields { grid-template-columns: 1fr; } }
input[type='file'] { display: block; margin: 6px 0; font: inherit; max-width: 100%; }

/* ---- Job page ---- */
details.card > summary { cursor: pointer; font-weight: 600; list-style-position: inside; }
details.card > summary::marker { color: var(--faint); }
details.card[open] > summary { margin-bottom: 12px; }
ul.plain { margin: 0 0 12px; padding-left: 20px; }

/* ---- Interview guide: the card on the job page and its edit page ---- */
#guide { scroll-margin-top: 12px; }
.guide-head h2 { margin: 0; }
ol.guide-list { margin-bottom: 0; padding-left: 22px; }
.guide-list > li + li { margin-top: 14px; }
.guide-list > li::marker { font-weight: 600; }
.guide-list h3 { margin: 0 0 2px; }
.guide-list p { margin: 0; }
.guide-list details { margin-top: 6px; }
.guide-list summary { cursor: pointer; color: var(--info); font-size: 14px; }
.guide-list details[open] > summary { margin-bottom: 8px; }
.guide-list .label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.guide-list details > .label:first-of-type { margin-top: 0; }
textarea.guide-text { min-height: 560px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }

/* ---- Applicant page ---- */
/* Two columns: evidence on the left, the decision rail (score, actions, invite) sticky on the right. */
.dossier { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'evidence rail'; gap: 20px; align-items: start; }
.dossier .rail { grid-area: rail; position: sticky; top: 24px; }
.dossier .evidence { grid-area: evidence; min-width: 0; }
.dossier .rail > * + *, .dossier .evidence > * + * { margin-top: 18px; }
@media (max-width: 960px) { .dossier { grid-template-columns: 1fr; grid-template-areas: 'rail' 'evidence'; } .dossier .rail { position: static; } }
.decision .row { gap: 14px; }
.dial { position: relative; width: 88px; height: 88px; display: grid; place-items: center; }
.dial svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.dial circle { fill: none; stroke-width: 7; }
.dial-track { stroke: var(--border); }
.dial-arc { stroke-linecap: round; }
.dial.pass .dial-arc { stroke: var(--green); }
.dial.below .dial-arc { stroke: var(--brass-deep); }
.dial-mark { stroke: var(--navy); stroke-width: 12; }
.score { font-size: 28px; line-height: 1; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; } }
.quote { margin: 0 0 6px; padding-left: 10px; border-left: 2px solid var(--signal); font-style: italic; }
.resume-text {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  max-height: 560px;
  overflow: auto;
}
input[readonly], textarea[readonly] { background: var(--sunken); }
textarea.message { min-height: 300px; }
input[type='file']::file-selector-button { font: inherit; font-weight: 560; margin-right: 12px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--navy); cursor: pointer; }
table.grid td.num { font-weight: 620; font-size: 16px; letter-spacing: -0.01em; }

/* ---- Jobs list: a pipeline per job ---- */
.job-link { color: var(--ink); font-weight: 620; font-size: 15.5px; text-decoration: none; letter-spacing: -0.01em; }
.job-link:hover { color: var(--info); }
.pipe-cell { width: 260px; vertical-align: middle !important; }
.pipe { display: block; width: 100%; height: 10px; }
.pipe .p0 { fill: #e6eaf3; }
.pipe .p1 { fill: #b9cff8; }
.pipe .p2 { fill: var(--signal); }
.pipe .p3 { fill: var(--navy); }
table.jobs td.num { font-size: 15px; }
table.jobs td.s1::before, table.jobs td.s2::before, table.jobs td.s3::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 7px; vertical-align: 1px; }
table.jobs td.s1::before { background: #b9cff8; }
table.jobs td.s2::before { background: var(--signal); }
table.jobs td.s3::before { background: var(--navy); }

/* ---- New job: explanation on the left, fields on the right ---- */
.setup { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; padding: 32px; }
.setup-intro h2 { font-size: 20px; }
@media (max-width: 900px) { .setup { grid-template-columns: 1fr; gap: 16px; padding: 22px; } }

/* ---- Decision rail: the one dark surface on the HR side ---- */
.decision {
  color: #e9eeff;
  border: 0;
  background:
    radial-gradient(300px 200px at 100% 0%, rgba(61, 139, 255, 0.3), transparent 70%),
    linear-gradient(160deg, #15224f, var(--night));
  box-shadow: 0 24px 50px -24px rgba(11, 20, 48, 0.7);
}
.decision .muted { color: #a9b4d4; }
.decision .dial-track { stroke: rgba(255, 255, 255, 0.12); }
.decision .dial.pass .dial-arc { stroke: #4ade9a; }
.decision .dial.below .dial-arc { stroke: var(--brass); }
.decision .dial-mark { stroke: #fff; }
.decision .score { color: #fff; }
.decision .secondary { background: rgba(255, 255, 255, 0.06); color: #fff; border-color: rgba(255, 255, 255, 0.18); box-shadow: none; }
.decision .secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.decision .danger { background: transparent; color: #ff9b91; border-color: rgba(255, 130, 120, 0.35); }
.decision .chip { background: rgba(255, 255, 255, 0.08); color: #dbe3fb; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.decision .chip.ok { color: #6ee7a8; }
.decision .chip.warn { color: #f5c76c; }
.decision .chip.bad { color: #ff9b91; }
.decision .chip.info { color: #8fb6ff; }
.decision .flash { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); color: #e9eeff; }
.decision .actions { padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 18px; }
table.jobs td:first-child { min-width: 200px; overflow-wrap: normal; }
.evidence .scroll table.grid { min-width: 620px; }

/* ---- Job page: the brief on the left, upload and delete on the right ---- */
.job-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; }
.job-head h1 { margin: 0; }
.stats { display: flex; gap: 8px; margin: 0; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 16px; min-width: 96px; }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.side > * + * { margin-top: 16px; }
@media (max-width: 960px) { .job-layout { grid-template-columns: 1fr; } }
.brief { padding: 28px; }
.brief > * + * { margin-top: 18px; }
.brief h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14.5px; margin: 0 0 10px; }
.brief > h3 { margin-top: 28px; }
.weight { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.lede { font-size: 15.5px; color: #3b4566; margin: 0; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.req-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 640px) { .req-cols { grid-template-columns: 1fr; } }
.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reqs li { position: relative; padding: 10px 12px 10px 36px; border-radius: 10px; font-size: 14.5px; line-height: 1.45; }
.reqs li::before { content: ''; position: absolute; left: 13px; top: 15px; width: 11px; height: 11px; border-radius: 50%; }
.reqs.must li { background: var(--info-surface); }
.reqs.must li::before { background: var(--signal); box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.2); }
.reqs.nice li { background: var(--sunken); border: 1px dashed var(--border-strong); }
.reqs.nice li::before { border: 2px solid var(--faint); }
.plan { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.plan li { counter-increment: q; position: relative; padding: 4px 0 18px 46px; font-size: 14.5px; }
.plan li::before { content: counter(q); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 620; background: var(--navy); color: #fff; }
.plan li::after { content: ''; position: absolute; left: 14.5px; top: 34px; bottom: 2px; width: 1px; background: var(--border-strong); }
.plan li:last-child { padding-bottom: 0; }
.plan li:last-child::after { display: none; }
.plan li.ai::before { content: 'AI'; background: linear-gradient(135deg, var(--signal), #8fb6ff); box-shadow: 0 0 14px rgba(61, 139, 255, 0.5); }
.who-asks { display: block; font-size: 12.5px; color: var(--muted); }
.drop { display: grid; gap: 4px; place-items: center; text-align: center; padding: 26px 16px; border: 1.5px dashed #b9cff8; border-radius: 14px; background: linear-gradient(180deg, #f5f9ff, #eef4ff); cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.drop:hover, .drop:focus-within { border-color: var(--signal); }
.drop-title { font-size: 15px; font-weight: 620; color: var(--navy); }
.drop input[type='file'] { margin-top: 10px; font-size: 13px; max-width: 100%; }
.side .primary { width: 100%; }
details.manage > summary { font-size: 14px; color: var(--red); font-weight: 560; }
details.manage { padding: 14px 18px; box-shadow: none; }
.drop { justify-items: stretch; }
.drop > * { min-width: 0; }
.drop input[type='file'] { justify-self: center; }
.job-title { display: grid; gap: 10px; }
.reason { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
table.grid tr.total td { background: var(--sunken); font-weight: 620; }
.evidence .scroll table.grid { min-width: 640px; }
table.grid td.req { width: 34%; }
table.grid td.req + td + td + td { width: 42%; }
.vgroup + .vgroup { margin-top: 20px; }
.vgroup-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.vgroup-head h3 { margin: 0; font-size: 15px; }
.verdicts { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.verdicts > li { padding: 14px 18px; }
.verdicts > li + li { border-top: 1px solid var(--border); }
.v-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.v-req { font-weight: 560; }
.v-mark { display: flex; align-items: center; gap: 10px; flex: none; }
.v-pts { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 72px; text-align: right; }
.verdicts .reason { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.v-quote { margin-top: 6px; font-size: 13.5px; }
.v-quote summary { cursor: pointer; color: var(--info); }
.v-quote .quote { margin: 6px 0 0; }
.v-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding: 12px 18px; border-radius: var(--radius); background: var(--sunken); border: 1px solid var(--border); font-weight: 620; }
.v-total strong { font-size: 20px; }
@media (max-width: 560px) { .v-head { flex-direction: column; gap: 6px; } }
.vtable td { vertical-align: top; }
.vtable th:nth-child(2), .vtable td:nth-child(2) { width: 130px; }
.vtable th:nth-child(3), .vtable td:nth-child(3) { width: 110px; }
.vtable .reason { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* ---- Audit pass ---- */
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions a:not(.button) { font-weight: 560; font-size: 14px; }
.side .primary { width: 100%; }

/* Log in: its own screen, no navigation. */
body.admin.bare { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; background:
    radial-gradient(70vw 60vh at 50% -10%, rgba(61, 139, 255, 0.28), transparent 70%),
    var(--night); }
body.admin.bare main { background: none; width: 100%; }
body.admin.bare .page { padding: 24px 16px; }
.card.login { max-width: 400px; margin: 0 auto; padding: 32px; border: 0; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.6); }
.card.login > * + * { margin-top: 16px; }
.card.login h1 { margin: 24px 0 0; font-size: 28px; }
.card.login .muted { margin: 4px 0 0; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand > span { display: grid; line-height: 1.25; }
.login-brand img { border-radius: 11px; }
.login-brand .product { color: var(--info); }

/* Requirement tables: fixed columns so the requirement text gets the room. */
.vtable { table-layout: fixed; }

/* Phones: tables become stacked rows, so nothing scrolls sideways. */
@media (max-width: 720px) {
  .bar { position: static; }
  .scroll:has(> .stackable) { overflow: visible; }
  .scroll table.grid, .evidence .scroll table.grid { min-width: 0; }
  table.stackable thead, table.vtable thead { display: none; }
  table.stackable, table.stackable tbody, table.stackable tr, table.stackable td { display: block; width: auto; }
  table.stackable tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.stackable tr:last-child { border-bottom: 0; }
  table.stackable td { border: 0; padding: 4px 0; text-align: left !important; }
  table.stackable td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  table.stackable td[data-label]::before { content: attr(data-label); font-size: 13px; color: var(--muted); font-weight: 500; flex: none; }
  table.stackable td:first-child { padding-bottom: 8px; }
  table.jobs td:first-child { min-width: 0; }
  .pipe-cell { width: auto; padding: 4px 0 8px !important; }
  table.stackable .actions { flex-wrap: wrap; justify-content: flex-end; }
  table.vtable, table.vtable tbody, table.vtable tr { display: block; }
  table.vtable tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.vtable tr:last-child { border-bottom: 0; }
  table.vtable td { display: block; width: auto !important; border: 0; padding: 0; }
  table.vtable td:first-child { grid-column: 1 / -1; }
  table.vtable td.num { text-align: right; }
  .vgroup-head { flex-wrap: wrap; }
  .job-head { align-items: start; }
  .stats div { min-width: 0; flex: 1; padding: 8px 12px; }
  .stats { width: 100%; }
}
.dossier > *, .job-layout > * { min-width: 0; }
body.admin.bare { grid-template-columns: 1fr; }
@media (max-width: 720px) {
  table.jobs td.s1::before, table.jobs td.s2::before, table.jobs td.s3::before { width: auto; height: auto; margin: 0; border-radius: 0; background: none; vertical-align: baseline; }
  .bar nav { align-items: center; }
  .bar nav .linkish { line-height: 1.5; }
}

/* Resume and interview scores side by side in the decision panel. */
.scores { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.scores:empty { display: none; }
.score-block { display: flex; align-items: center; gap: 12px; }
.score-block .dial { width: 72px; height: 72px; flex: none; }
.score-block .dial svg { width: 72px; height: 72px; }
.score-block .score { font-size: 22px; }
.score-label { font-weight: 620; color: #fff; }
.decision .dial.plain .dial-arc { stroke: #8fb6ff; }
.dial.plain .dial-arc { stroke: var(--signal); }
@media (max-width: 400px) { .scores { grid-template-columns: 1fr; } }
table.stackable td:first-child { min-width: 150px; }


/* Invitation, compact enough to stay pinned with the scores. */
.card.invite { padding: 18px 20px; }
.card.invite > * + * { margin-top: 10px; }
.card.invite h2 { font-size: 15px; margin: 0; }
.card.invite p { margin-bottom: 0; }
.invite-link { display: flex; gap: 8px; }
.invite-link input { margin: 0; min-width: 0; flex: 1; font-size: 13px; padding: 7px 10px; }
.invite-message summary { cursor: pointer; font-size: 13.5px; color: var(--info); }
.invite-message textarea { margin-top: 8px; min-height: 220px; font-size: 13px; }
.dossier .rail .decision { padding: 18px 20px; }
.dossier .rail > * + * { margin-top: 12px; }
.interview-record table.grid td:first-child { overflow-wrap: normal; min-width: 140px; }

/* ---- Pinned side panel, compact: the scores never leave the screen. ---- */
.dossier .rail {
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.dossier .rail > * + * { margin-top: 10px; }
.dossier .rail .decision, .card.invite { padding: 16px; }
.rail .scores { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.rail .score-block { gap: 8px; }
.rail .score-block .dial, .rail .score-block .dial svg { width: 56px; height: 56px; }
.rail .score-block .score { font-size: 18px; }
.rail .score-label { font-size: 13.5px; }
.rail .score-block .muted { font-size: 12px; line-height: 1.3; }
.rail .chip { font-size: 11.5px; padding: 2px 8px 2px 7px; }
.rail .row { gap: 6px; }
.rail .flash { font-size: 13px; padding: 8px 10px; }
.rail .actions { gap: 6px; }
.rail .decision .actions { padding-top: 12px; margin-top: 12px; }
.rail button, .rail .button { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.card.invite h2 { font-size: 14px; }
.card.invite p { font-size: 12.5px; line-height: 1.45; }
.card.invite > * + * { margin-top: 8px; }
.invite-link input { font-size: 12.5px; padding: 5px 9px; min-height: 32px; }
.invite-message summary { font-size: 13px; }
@media (max-width: 960px) { .dossier .rail { max-height: none; overflow: visible; } }
.dossier .rail .decision { box-shadow: none; }

/* Interview summary table: same table, smaller type, so it fits its card without a scrollbar. */
.interview-record .scroll table.grid, .evidence .interview-record .scroll table.grid { min-width: 0; font-size: 12.5px; line-height: 1.45; }
.interview-record table.grid th { font-size: 11.5px; }
.interview-record table.grid th, .interview-record table.grid td { padding: 8px 10px; }
.interview-record table.grid td:first-child { min-width: 0; }
.interview-record table.grid .chip { font-size: 11px; }

/* Must-haves and nice-to-haves fold away; the header keeps the points in view. */
details.vgroup { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
details.vgroup > summary { cursor: pointer; list-style: none; padding: 12px 16px; margin: 0; align-items: center; }
details.vgroup > summary::-webkit-details-marker { display: none; }
details.vgroup > summary h3::before { content: '▸'; display: inline-block; width: 16px; color: var(--muted); transition: transform 0.15s; }
details.vgroup[open] > summary h3::before { transform: rotate(90deg); }
details.vgroup[open] > summary { border-bottom: 1px solid var(--border); }
details.vgroup > .vtable { border: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
.vgroup + .vgroup { margin-top: 10px; }
/* The panel no longer scrolls inside itself; the open message box is sized to fit (admin.js). */
.dossier .rail { max-height: none; overflow: visible; }
.invite-message textarea { min-height: 220px; resize: none; }
table.stackable .actions { flex-wrap: wrap; }

/* Narrow screens: the side panel is not pinned there, so once its scores scroll away a slim bar
   slides down from the top with both scores (admin.js adds .shown). */
.score-strip { display: none; }
@media (max-width: 960px) {
  .score-strip {
    display: flex; gap: 8px; position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 10px 16px;
    background: linear-gradient(180deg, rgba(242, 244, 249, 0.96), rgba(242, 244, 249, 0.85));
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
    transform: translateY(-100%); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.28s ease, visibility 0s linear 0.28s;
  }
  .score-strip.shown { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.28s ease, visibility 0s; }
  .strip-score {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 13px; border-radius: 999px; font-size: 13px;
    color: #c3cde6; background: linear-gradient(160deg, #15224f, var(--night)); box-shadow: 0 4px 12px -4px rgba(11, 20, 48, 0.5);
  }
  .strip-score strong { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
  .strip-score.pass strong { color: #6ee7a8; }
  .strip-score.below strong { color: var(--brass); }
  .strip-score.plain strong { color: #8fb6ff; }
}
@media (max-width: 960px) and (prefers-reduced-motion: reduce) { .score-strip, .score-strip.shown { transition: none; } }
@media (max-width: 720px) { .interview-record .scroll table.grid, .evidence .interview-record .scroll table.grid { min-width: 560px; } }
/* Only the invitation scrolls inside the pinned panel (its height is set by admin.js). */
.dossier .rail .card.invite { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
@media (max-width: 960px) { .dossier .rail .card.invite { overflow: visible; } }

/* Modals (native <dialog>). */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
dialog.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 80px -30px rgba(11, 20, 48, 0.55); }
dialog.modal::backdrop { background: rgba(11, 20, 48, 0.5); backdrop-filter: blur(3px); }
dialog.modal h2 { margin: 0 0 4px; font-size: 20px; }
dialog.modal[open] { animation: modal-in 0.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open] { animation: none; } }
dialog.modal, .card > dialog.modal:last-child { margin: auto; inset: 0; }

/* Applicant files as tiles: icon with the type, name below, X at the top right. */
.files { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.files h3 { margin: 0 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.tile { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); min-height: 132px; }
.tile:hover { border-color: var(--border-strong); }
.tile-body, .tile-add label { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px 12px; height: 100%; text-decoration: none; color: var(--ink); cursor: pointer; font-weight: 500; }
.tile-icon { position: relative; width: 40px; height: 50px; border-radius: 4px 12px 4px 4px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border-strong); display: grid; place-items: center; }
.tile-icon::after { content: ''; position: absolute; top: 0; right: 0; width: 12px; height: 12px; border-radius: 0 12px 0 4px; background: var(--border); }
.tile-icon span { font-size: 10px; font-weight: 700; letter-spacing: 0.02em; color: var(--info); background: var(--info-surface); padding: 1px 4px; border-radius: 4px; }
.tile-name { font-size: 12px; line-height: 1.35; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-badge { position: absolute; top: 6px; left: 6px; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--navy); color: #fff; }
.tile-x { position: absolute; top: 4px; right: 4px; margin: 0; }
.tile-x button { min-height: 0; width: 24px; height: 24px; padding: 0; border-radius: 50%; font-size: 16px; line-height: 1; background: var(--surface); color: var(--muted); border: 1px solid var(--border-strong); }
.tile-x button:hover { color: var(--red); border-color: #efc2bd; }
.tile-use { margin: 0; text-align: center; padding: 0 6px 10px; }
.tile-use .linkish { font-size: 12px; color: var(--info); }
.tile-add { border: 1.5px dashed #b9cff8; background: linear-gradient(180deg, #f5f9ff, #eef4ff); }
.tile-add:hover { border-color: var(--signal); }
.tile-add input[type='file'] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tile-add:focus-within { outline: 2px solid var(--signal); outline-offset: 2px; }
.tile-plus { width: 40px; height: 50px; display: grid; place-items: center; font-size: 26px; color: var(--signal); }
.modal-actions { margin-top: 20px; }
dialog.modal { width: min(600px, calc(100vw - 32px)); }
.tile { display: flex; flex-direction: column; }
.tile-body, .tile-add label { flex: 1; height: auto; }
.tile-use { padding: 0 6px 10px; }

/* Applicants list: even column spacing on desktop. */
@media (min-width: 721px) {
  table.applicants th, table.applicants td { padding: 14px 14px; }
  table.applicants td:first-child { min-width: 170px; }
  table.applicants td:first-child a { white-space: nowrap; }
  table.applicants th.num, table.applicants td.num { width: 1%; white-space: nowrap; text-align: center; }
  table.applicants td:nth-child(4), table.applicants td:nth-child(5) { width: 20%; }
  table.applicants td:last-child { width: 1%; }
  table.applicants td:last-child .actions { flex-wrap: wrap; min-width: 180px; }
}
table.usage tr.total td { font-weight: 620; background: var(--sunken); }
table.usage { font-size: 13px; }
table.usage th, table.usage td { padding: 9px 12px; }
table.usage td.num, table.usage th.num, table.usage td:nth-child(3) { white-space: nowrap; }
table.usage td.num { font-size: 13px; font-weight: 560; letter-spacing: 0; }
