/* Page-area styles on top of console.css (design.md).
   Owner: Agent 2: the job form, JD insights, add candidate (resume upload) and the candidate page.
   Only this area's own patterns belong here; shared components live in console.css.
   Every class is prefixed `jc-` (every page-area sheet loads on every page), except
   the candidate lifecycle's own hooks, restyled from lifecycle.css below. */

/* ============================================================
   Shared by these pages
   ============================================================ */

/* A page's own modal kept as an overlay: the scrim is a click target behind the
   card that carries the page's backdrop-close attribute. */
.jc-modal > .jc-scrim{position:absolute;inset:0}
.jc-modal > .dlg-card{position:relative}
.jc-modal .dlg-body{padding-bottom:10px}
.jc-textarea-tall{min-height:200px}

/* The job form's local confirmation, drawn as the design's toast (4.20). */
.jc-toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));z-index:120;max-width:calc(100vw - 32px);transform:translateX(-50%);pointer-events:none}
.jc-toast .toast{pointer-events:auto}

/* Dropzones that open the file chooser. */
.dropzone.jc-drop{cursor:pointer}
.dropzone.jc-drop b{font-size:14px}
.dropzone.jc-drop > span{max-width:62ch;font-size:13px;line-height:1.45}
.dropzone.jc-drop .field-hint{font-size:12.5px}
.dropzone.jc-drop[aria-invalid="true"]{border-color:var(--danger);background:var(--danger-soft)}

/* Four short fields to a row (the candidate forms); two, then one, when narrow. */
.form-grid.jc-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.form-grid .jc-span-2{grid-column:span 2}

/* A read-only link inside the design's link box (4.23). Its label sits above it
   like a field's, without .field (whose input rule would draw a second box). */
.jc-link-field{display:flex;flex-direction:column;gap:7px;min-width:0}
.linkbox .jc-link-input{flex:1;min-width:0;height:40px;padding:0;border:0;background:transparent;color:var(--text-2);font:inherit;font-size:13px;text-overflow:ellipsis;outline:none}
.jc-link-field .linkbox:focus-within{box-shadow:inset 0 0 0 1px var(--brand)}

/* A card that ends in a table: the table runs edge to edge under a rule. */
.card.jc-clip{overflow:hidden}
.card.jc-clip > .table-wrap{border-top:1px solid var(--line)}
/* A card head whose text shares the row with its actions (the text wraps first). */
.card-head.jc-head-fill > div:first-child{flex:1 1 320px}

/* ============================================================
   Candidate page
   ============================================================ */
.jc-cand-id{display:flex;align-items:center;gap:14px;min-width:0}
.jc-cand-id > div{min-width:0}
.jc-cand-id .avatar .i{width:22px;height:22px}
.jc-cand-name{overflow-wrap:anywhere}
.jc-toggle-ico{display:inline-grid;place-items:center}
/* A card whose body folds away: the head stands alone, the open body sits under a rule. */
.card.jc-collapse > .card-head{padding-bottom:18px}
.card.jc-collapse > .card-head + div > form > .card-body{padding-top:20px;border-top:1px solid var(--line)}

/* The lifecycle pipeline (candidate-form.js keeps lifecycle.css's hooks; this
   is their design: tinted stage tiles on a hairline, sentence-case labels, the
   stage details in the design's popover). */
/* The four stages always fit the card (no scroller), so the stage popover floats
   over what follows instead of reserving empty space for itself. */
.candidate-lifecycle-scroll{overflow:visible;padding:2px 0 0}
.candidate-lifecycle-track{--life-gap:16px;min-width:0;padding:0}
.candidate-lifecycle-line{left:calc((100% - 3 * var(--life-gap)) / 8);right:calc((100% - 3 * var(--life-gap)) / 8);top:19px;height:2px;border-radius:2px;background:var(--line)}
.candidate-lifecycle-line-segment{background:var(--line);transition:background .2s var(--ease)}
.candidate-lifecycle-line-segment.is-active{background:var(--tone,var(--brand))}
.candidate-lifecycle-items{grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--life-gap)}
.candidate-lifecycle-item{min-height:0}
.candidate-lifecycle-node{width:40px;height:40px;border:1px solid var(--line-2);border-radius:12px;background:var(--surface);color:var(--text-3);cursor:pointer;transition:background .15s var(--ease),border-color .15s var(--ease),color .15s var(--ease),transform .25s var(--spring)}
.candidate-lifecycle-node:hover{border-color:var(--text-3);color:var(--text-2)}
.candidate-lifecycle-node:active{transform:scale(.94)}
.candidate-lifecycle-node .i{width:18px;height:18px}
.candidate-lifecycle-node:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
/* The tint sits on the surface, so the track line never shows through a
   translucent dark-mode tint. */
.candidate-lifecycle-node.is-active{border-color:transparent;background:linear-gradient(var(--tone-soft),var(--tone-soft)) var(--surface);color:var(--tone)}
.candidate-lifecycle-node.is-active:hover{border-color:var(--tone)}
.candidate-lifecycle-label{margin-top:10px;color:var(--text);font-size:13px;font-weight:500;line-height:1.35;letter-spacing:0;text-transform:none}
.candidate-lifecycle-node.is-pending + .candidate-lifecycle-label{color:var(--text-3)}
.candidate-lifecycle-tooltip{top:58px;width:272px;border:1px solid var(--line);border-radius:16px;background:var(--pop);box-shadow:var(--shadow-pop);transform:translateX(-50%) translateY(-4px) scale(.98);transition:opacity .18s var(--ease),transform .18s var(--ease),visibility .18s var(--ease)}
.candidate-lifecycle-tooltip::before{display:none}
.candidate-lifecycle-item:hover .candidate-lifecycle-tooltip,.candidate-lifecycle-item:focus-within .candidate-lifecycle-tooltip,.candidate-lifecycle-item[data-open="true"] .candidate-lifecycle-tooltip{transform:translateX(-50%)}
.candidate-lifecycle-item:first-child .candidate-lifecycle-tooltip{left:0;transform:translateY(-4px) scale(.98)}
.candidate-lifecycle-item:last-child .candidate-lifecycle-tooltip{left:auto;right:0;transform:translateY(-4px) scale(.98)}
.candidate-lifecycle-item:first-child:hover .candidate-lifecycle-tooltip,.candidate-lifecycle-item:first-child:focus-within .candidate-lifecycle-tooltip,.candidate-lifecycle-item:first-child[data-open="true"] .candidate-lifecycle-tooltip,
.candidate-lifecycle-item:last-child:hover .candidate-lifecycle-tooltip,.candidate-lifecycle-item:last-child:focus-within .candidate-lifecycle-tooltip,.candidate-lifecycle-item:last-child[data-open="true"] .candidate-lifecycle-tooltip{transform:none}
.candidate-lifecycle-tooltip-title{padding:14px 16px 4px;border:0;color:var(--text);font-size:14px;font-weight:600}
.candidate-lifecycle-tooltip-body{max-height:9.5rem;padding:0 16px 14px;color:var(--text-2);font-size:13px;line-height:1.5}
.jc-life-line{margin:0 0 3px}
.jc-life-line:last-child{margin-bottom:0}
.jc-life-list{display:flex;flex-direction:column;gap:3px;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}
.jc-life-skel{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;padding:2px 0 8px}
.jc-life-skel-item{display:flex;flex-direction:column;align-items:center;gap:12px}
.jc-life-skel-node{width:40px;height:40px;border-radius:12px}

/* Schedules linked to the candidate. */
.jc-sched-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.jc-sched{display:flex;flex-direction:column;gap:10px;min-width:0;padding:16px 16px 14px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.jc-sched.is-latest{border-color:var(--brand-line);background:var(--brand-soft)}
.jc-sched-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-width:0}
.jc-sched-title{min-width:0;color:var(--text);font-size:14.5px;font-weight:500;line-height:1.35;overflow-wrap:anywhere}
.jc-sched-facts{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;color:var(--text-2);font-size:13px}
.jc-sched .row-gap{margin-top:2px}
.jc-sched-empty{grid-column:1/-1;padding:28px 12px}

/* ============================================================
   Add candidate (resume upload)
   ============================================================ */
/* The chosen JD, echoed back beside the picker. */
.jc-scope{display:flex;flex-direction:column;justify-content:center;gap:6px;min-width:0;min-height:42px;padding:12px 14px;border-radius:14px;background:var(--sunk);color:var(--text-2);font-size:13px;line-height:1.45;align-self:end}
.jc-scope > .skel{background:var(--line)}
.jc-scope-title{color:var(--text);font-size:14px;font-weight:500;overflow-wrap:anywhere}
.jc-scope-facts{display:flex;flex-wrap:wrap;gap:4px 14px}
.jc-scope-facts .with-ico{white-space:normal}
.jc-scope-meta{color:var(--text-3)}
.jc-scope-meta.with-ico{white-space:normal;color:var(--text-2)}
/* The numbered step beside each method's title. */
.jc-method-head{display:flex;align-items:flex-start;gap:12px;min-width:0}
.jc-method-head > div{min-width:0}
.jc-step{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:10px;background:var(--brand-soft);color:var(--brand);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
/* Upload on the left, what was picked and what came back on the right. */
.jc-upload-split{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:20px;align-items:start}
.jc-counts .kpi{padding:11px 12px 12px 14px;gap:6px}
.jc-counts .kpi-n{font-size:22px}
.jc-subpanel{display:flex;flex-direction:column;gap:12px;min-width:0;padding:16px;border:1px solid var(--line);border-radius:16px}
.jc-subpanel-title{margin:0;color:var(--text);font-size:14px;font-weight:600}
.jc-file-list{display:flex;flex-wrap:wrap;align-content:flex-start;gap:8px;max-height:18rem;overflow-y:auto}
.jc-file-list > .card{flex:1 1 100%}
.jc-file-chip{min-width:0;padding:0 4px 0 10px;background:var(--sunk);border-color:transparent}
.jc-file-chip > .i{width:15px;height:15px;color:var(--text-3)}
.jc-file-name{min-width:0;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jc-file-chip small{flex:none;font-variant-numeric:tabular-nums}
.icon-btn.jc-chip-x{width:26px;height:26px;border-radius:999px}
.icon-btn.jc-chip-x .i{width:14px;height:14px}
.jc-result-list{display:flex;flex-direction:column;gap:8px;max-height:18rem;margin:0;padding:0;overflow-y:auto;list-style:none}
.jc-result-list .note div div{margin-top:1px;color:inherit;opacity:.9}
.jc-empty-line{margin:0;padding:14px 16px;border:1px dashed var(--line-2);border-radius:14px;color:var(--text-3);font-size:13px;list-style:none}
.jc-file-list > .jc-empty-line{flex:1 1 100%}
.jc-result-skel{display:grid;grid-template-columns:30px minmax(0,1fr);align-items:center;gap:12px;padding:12px 14px}
.jc-result-skel + .jc-result-skel{border-top:1px solid var(--line)}
/* "or" between the two methods: they are alternatives, not a sequence. */
.jc-or{display:flex;justify-content:center;margin:-6px 0;color:var(--text-3);font-size:13px;font-weight:500}
/* The long tail of optional fields, folded away. */
.jc-more{display:flex;flex-direction:column;gap:16px;padding-top:16px;border-top:1px solid var(--line)}
.jc-more-toggle{display:inline-flex;align-items:center;gap:8px;align-self:flex-start;height:34px;margin-left:-10px;padding:0 14px 0 10px;border:0;border-radius:999px;background:transparent;color:var(--text-2);font-size:13.5px;font-weight:500;cursor:pointer;transition:background .15s var(--ease),color .15s var(--ease),transform .25s var(--spring)}
.jc-more-toggle:hover{background:var(--hover);color:var(--text)}
.jc-more-toggle:active{transform:scale(.97)}
.jc-more-toggle .i{width:17px;height:17px;transition:transform .2s var(--ease)}
.jc-more-toggle[aria-expanded="true"] .i{transform:rotate(180deg)}
.jc-more-body{display:flex;flex-direction:column;gap:16px}

/* ============================================================
   JD insights
   ============================================================ */
.jc-title-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;min-width:0}
.jc-title-row .card-title{overflow-wrap:anywhere}
/* The JD's facts: four read-only label/value pairs in a row. */
.jc-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0}
.jc-fact{display:flex;flex-direction:column;gap:6px;min-width:0;padding-left:16px;border-left:1px solid var(--line)}
.jc-fact:first-child{padding-left:0;border-left:0}
.jc-fact dt{color:var(--text-3);font-size:13px}
.jc-fact dd{margin:0;min-width:0;color:var(--text);font-weight:500;overflow-wrap:anywhere}
.jc-fact dd .with-ico{white-space:normal}
.jc-span-all{grid-column:1/-1}
/* Bar charts as labelled meters. */
.jc-bars{display:flex;flex-direction:column;gap:16px}
.jc-bar{display:flex;flex-direction:column;gap:8px;min-width:0}
.jc-bar-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.jc-bar-label{min-width:0;color:var(--text);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jc-bar-value{flex:none;color:var(--text);font-weight:500;font-variant-numeric:tabular-nums}
.jc-bar .meter{height:10px}
.jc-scores{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
/* The best candidates: small cards, scrolled when there are many. */
.jc-top-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:22rem;overflow-y:auto;align-content:start}
.jc-top-card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:14px 16px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.jc-top-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.jc-top-head .person{min-width:0;flex:1}
.jc-top-score{flex:none;color:var(--text);font-weight:600;font-variant-numeric:tabular-nums}
.jc-top-foot{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.jc-top-match{color:var(--text-2);font-size:13px;font-variant-numeric:tabular-nums}
.jc-top-link{margin-left:auto}

/* ============================================================
   Loading skeletons shaped like these pages' content
   ============================================================ */
.jc-form-skel{display:flex;flex-direction:column;gap:20px}
.jc-skel-head{display:flex;flex-direction:column;gap:9px}
.jc-skel-input{height:42px;border-radius:12px}
.jc-skel-area{height:150px;border-radius:12px}
.jc-list-skel{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:16px;overflow:hidden}
.jc-list-skel-row{display:grid;grid-template-columns:38px minmax(0,1fr) 72px 56px;align-items:center;gap:14px;padding:14px 18px}
.jc-list-skel-row + .jc-list-skel-row{border-top:1px solid var(--line)}
.jc-list-skel-text{display:flex;flex-direction:column;gap:7px;min-width:0}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width:1100px){
  .form-grid.jc-cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jc-upload-split{grid-template-columns:minmax(0,1fr)}
  .jc-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jc-fact:nth-child(odd){padding-left:0;border-left:0}
}
@media (max-width:720px){
  .form-grid.jc-cols-4{grid-template-columns:minmax(0,1fr)}
  .form-grid .jc-span-2{grid-column:auto}
  .jc-list-skel-row{grid-template-columns:38px minmax(0,1fr)}
  .jc-list-skel-row > .skel-line{display:none}
  .kpis.jc-counts{grid-template-columns:repeat(3,minmax(0,1fr))}
  .candidate-lifecycle-track{--life-gap:8px}
  .candidate-lifecycle-label{font-size:12.5px}
  .candidate-lifecycle-tooltip{width:min(272px,calc(100vw - 64px))}
  .jc-life-skel{gap:8px}
  .jc-scores{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jc-top-grid{grid-template-columns:minmax(0,1fr)}
  .jc-top-link{margin-left:0}
}
@media (max-width:480px){
  .jc-facts{grid-template-columns:minmax(0,1fr)}
  .jc-fact,.jc-fact:nth-child(odd){padding:0 0 12px;border-left:0;border-bottom:1px solid var(--line)}
  .jc-fact:last-child{padding-bottom:0;border-bottom:0}
}
