/* The role page (#/roles?r=ID) in the inspector reading order of MAS UI system v2 §5: the header (with when
   and how the role was asked for, never a countdown), the opening panel and the one next step, the stage panel,
   Top candidates, the pipeline, then named groups that open on demand. Tokens only (studio.css :root); legacy
   talent.css rules are overridden by scope. */

/* One main work surface: a full role list or a selected role, never a second inventory beside the assistant. */
#rqWorkspace{display:block;border:0;background:var(--surface);min-block-size:0}
#rqWorkspace .rq-list{position:static;max-block-size:none;overflow:visible;border:0}
#rqWorkspace:not(.inspector-open) .rq-inspector,#rqWorkspace.inspector-open .rq-list{display:none}
#rqWorkspace .workspace-back{display:inline-flex}
#rqWorkspace .rq-row{border-radius:var(--radius-control);padding:var(--space-4)}
#rqWorkspace .rq-row-top b{font-family:var(--font-brand);font-size:var(--text);font-weight:700}
#rqWorkspace .rq-list-tools{padding:var(--space-3) var(--space-4);border:0}
#rqWorkspace .rq-row-meta{color:var(--ink2)}
#rqWorkspace .rq-complete{display:inline;font-size:var(--text-meta)}
#v-roles:has(.inspector-open)>.rq-head{display:none}

/* ---- Header: the role's name in the brand face, one meta line, the id quiet ---- */
#reqDetail .rq-command { padding: var(--space-6) var(--space-6) 0; border: 0; }
.rq-command .rq-name { margin: 0; font: 600 var(--mas-name)/1.1 var(--font-brand); letter-spacing: -.025em;
  overflow-wrap: anywhere; }
.rq-command .workspace-back { margin-block-end: var(--space-3); }
.rq-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-4);
  margin: var(--space-2) 0 0; color: var(--ink2); font-size: var(--text-2); }
.rq-meta > span { min-width: 0; overflow-wrap: anywhere; }
.rq-meta .rq-state { color: var(--ink); font-weight: 600; }
.rq-meta .rq-id { margin-inline-start: auto; font-size: var(--text-meta); }
#reqDetail .rq-body { padding: var(--space-2) var(--space-6) var(--space-12); }

/* ---- The next step for a draft: the facts that hold it, one action ---- */
.rq-body > .rq-readiness { margin-block: var(--space-4) 0; border-block: 0; }
.rq-readiness > .rq-readiness-action:first-child { border-block-start: 0; }
.rq-ready-line { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-3);
  color: var(--ink2); font-size: var(--text-2); }
.rq-ready-line .rq-ready-stat { padding: 0; border: 0; }
.rq-ready-line .rq-ready-stat b { display: inline; color: var(--ink); font-size: inherit; font-weight: 600; line-height: inherit; }
.rq-readiness .rq-readiness-head h3 { font-size: var(--text); }
.rq-readiness .rq-readiness-item::before { border-radius: 50%; background: var(--kashmir); }

/* ---- Stage panel: where the role stands, the segmented track (done Daintree, current half Bay) ---- */
.rq-stage { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--space-3); margin-block-start: var(--space-5);
  padding: var(--space-4) var(--space-4) var(--space-3); border-radius: var(--radius-object); background: var(--fill); }
.rq-stage-now { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0; }
.rq-stage-now b { font-size: var(--text); font-weight: 600; }
.rq-stage-line { color: var(--ink2); font-size: var(--text-2); }
.rq-stage .rq-flow { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: var(--space-1);
  margin: 0; padding: 0; list-style: none; overflow: visible; border: 0; }
.rq-stage .rq-step { display: grid; align-content: start; gap: var(--space-2); min-width: 0; padding: 0; color: var(--ink2);
  font-size: var(--text-meta); font-weight: 400; line-height: 1.3; }
.rq-stage .rq-step span { overflow-wrap: anywhere; }
/* The track's width, not the viewport's, decides whether its labels fit (the assistant panel narrows the page).
   Too narrow for whole words, the labels stay for screen readers; the current step is named above the track. */
.rq-stage { container-type: inline-size; }
@container (max-width: 34rem) {
  .rq-stage .rq-step span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.rq-stage .rq-step::before { content: ""; display: block; inline-size: auto; block-size: .3125rem; margin: 0;
  border: 0; border-radius: var(--radius-pill); background: var(--fill-strong); }
.rq-stage .rq-step::after { content: none; }
.rq-stage .rq-step.done::before { background: var(--ink); }
.rq-stage .rq-step.now { color: var(--ink); font-weight: 600; }
.rq-stage .rq-step.now::before { background: linear-gradient(90deg, var(--ink) 50%, var(--bay) 50%); }
.rq-stage .rq-step.done.now::before { background: var(--ink); }

/* ---- Top candidates and the pipeline: always in sight ---- */
.rq-top:not(:empty) { margin-block-start: var(--space-6); }
.rq-body > .rq-pipeline { margin-block-start: var(--space-6); padding-block: 0; border: 0; }
.rq-pipeline > .rq-section-head h3, .rq-group > summary h3 { font-size: var(--text); font-weight: 600; }
.rq-pipeline > .rq-section-head .text-link { margin-inline-start: auto; }
.rq-pipeline [data-rq-home="pipeline"]:not(:empty) { margin-block-end: var(--space-4); }
.rq-quiet-line { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-2);
  color: var(--ink2); font-size: var(--text-2); }
.rq-quiet-line b { color: var(--ink); font-weight: 600; }
.rq-pipeline .rq-shortlist-row { grid-template-columns: minmax(0,1fr) auto auto; min-height: var(--target);
  padding-inline: var(--space-2); border-radius: var(--radius-control); color: var(--ink); text-decoration: none;
  transition: background-color var(--micro) var(--ease); }
.rq-pipeline a.rq-shortlist-row:hover { background: var(--fill); }
.rq-pipeline .rq-shortlist-row b { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-shortlist-stage { color: var(--ink2); font-size: var(--text-2); }
.rq-shortlist-figure { color: var(--ink2); font-size: var(--text-meta); text-align: end; white-space: nowrap; }
.rq-shortlist-figure b { color: var(--ink); font-size: var(--text-2); font-weight: 600; }
.rq-sub-head { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-2); font-weight: 600; }
.rq-sub { margin-block-start: var(--space-4); border-block-start: 1px solid var(--hair-soft); }
.rq-sub > summary { display: flex; align-items: center; gap: var(--space-3); min-height: var(--target); cursor: pointer; list-style: none; }
.rq-sub > summary::-webkit-details-marker { display: none; }
.rq-sub[open] > summary .rq-chev { transform: rotate(90deg); }
.rq-sub > summary h4 { margin: 0; font-size: var(--text-2); font-weight: 600; }

/* ---- Named groups: the rest of the role, closed until it waits on the viewer or a link names it ---- */
.rq-groups { display: grid; margin-block-start: var(--space-6); border-block-start: 1px solid var(--hair-soft); }
.rq-group { min-width: 0; border-block-end: 1px solid var(--hair-soft); }
.rq-group > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  min-height: var(--target); padding-block: var(--space-2); cursor: pointer; list-style: none; }
.rq-group > summary::-webkit-details-marker { display: none; }
.rq-group > summary h3 { margin: 0; }
.rq-group > summary:hover h3 { color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-strong); }
.rq-chev { flex: none; color: var(--ink2); transition: transform var(--micro) var(--ease); }
.rq-group[open] > summary .rq-chev { transform: rotate(90deg); }
.rq-group-note { margin-inline-start: auto; color: var(--ink2); font-size: var(--text-2); }
.rq-group-body { padding-block: var(--space-2) var(--space-6); }
.rq-group-body > [data-rq-home]:empty { display: none; }
.rq-group-body > .rq-section:first-of-type { padding-block-start: var(--space-2); }
.rq-group-body > [data-rq-home]:not(:empty) + .rq-section { border-block-start: 1px solid var(--hair-soft); }
.rq-person-role { color: var(--ink2); font-size: var(--text-meta); font-weight: 600; }

@media (max-width: 47.5rem) {
  #reqDetail .rq-command { padding: var(--space-4) var(--space-4) 0; }
  #reqDetail .rq-body { padding-inline: var(--space-4); }
  .rq-command .rq-name { font-size: 1.5rem; }
  .rq-meta .rq-id { display: none; }
  /* The panel already names the current step above the track; on a phone the labels stay for screen readers. */
  .rq-stage .rq-step span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* The stage sits under the name, so a long stage ("Shared in the portal · not sent yet") never cuts the person to "V…". */
  .rq-pipeline .rq-shortlist-row { grid-template-columns: minmax(0,1fr) auto; row-gap: 0; padding-block: var(--space-1); }
  .rq-pipeline .rq-shortlist-stage { grid-column: 1; grid-row: 2; }
  .rq-pipeline .rq-shortlist-figure { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
.rq-opening-context{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-5);align-items:start;margin-block-start:var(--space-5);font-size:var(--text-2)}
.rq-opening-context dl{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-5);margin:0;min-inline-size:0}
.rq-opening-context dl>div{display:grid;gap:var(--space-1);min-inline-size:0}
.rq-opening-context dt{color:var(--ink2)}
.rq-opening-context dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.rq-opening-context>details{flex-basis:100%;min-inline-size:0}
.rq-opening-context summary{cursor:pointer;min-block-size:var(--target);display:flex;align-items:center;color:var(--ink2);text-decoration:underline;text-underline-offset:3px}
.rq-context-requirements{margin:0;white-space:pre-line;overflow-wrap:anywhere}
.rq-opening-context>.text-link{min-block-size:var(--target)}
@media (prefers-reduced-motion: reduce) {
  .rq-chev, .rq-pipeline .rq-shortlist-row { transition: none; }
}
