/* Ordia Questions candidate source
   This file contains Questions-owned implementation CSS and Questions-owned component variables only.
   It must not redefine shared foundation tokens.
   Dropdown and date primitives are Controls-owned and must not be restyled here.
*/

.question-shell,
.question-pair,
.q-utility-row,
.choice-stack,
.yn-attached-reveal-group,
.ms-attached-reveal-group,
.q-radio-stack,
.q-radio-reveal-group,
.q-option-grid,
.q-ranked-transfer,
.qt-eval-weight-group {
  --q-gap-prompt-support: 8px;
  --q-gap-answer-meta: 10px;
  --q-gap-question-stack: 18px;
  --q-gap-half-pair: 18px;
  --q-gap-utility-item: 10px;
  --q-gap-choice-stack: 10px;
  --q-gap-choice-copy: 4px;
  --q-gap-radio-stack: 10px;
  --q-gap-option-grid: var(--space-2-5, 10px);
}

.question-shell{display:grid;gap:var(--q-gap-question-stack);width:100%}
.question-shell.is-full{width:100%}
.question-shell.is-half{width:min(100%,32rem)}
.question-shell.is-half:not(.question-pair .question-shell){width:min(100%,27.5625rem)}
.question-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--q-gap-half-pair);align-items:start}

.question-prompt{display:grid;gap:var(--q-gap-prompt-support)}
.question-heading{font-size:17px;font-weight:600;line-height:1.35;color:var(--text)}
.question-support{font-size:13px;line-height:1.52;color:var(--helper)}

.answer-zone{display:grid;gap:var(--q-gap-answer-meta)}

.text-entry-shell,
.textarea-entry-shell{
  width:100%;
  border:0;
  border-radius:var(--radius-control);
  background:rgba(255,255,255,.028);
}

.text-entry-shell{min-height:48px}
.textarea-entry-shell{min-height:72px}

.text-entry-shell:focus-within,
.text-entry-shell.is-focus,
.textarea-entry-shell:focus-within,
.textarea-entry-shell.is-focus{
  background:rgba(255,255,255,.04);
  box-shadow:0 0 0 3px rgba(136,167,183,.08);
}

.text-entry-control,
.textarea-entry-control{
  width:100%;
  border:0;
  background:transparent;
  box-shadow:none;
  outline:none;
  color:var(--text);
  font:inherit;
}

.text-entry-control{min-height:48px;padding:12px 14px}
.textarea-entry-control{display:block;min-height:72px;padding:10px 13px;resize:vertical;overflow:auto;line-height:1.55}
.text-entry-control::placeholder,
.textarea-entry-control::placeholder{color:var(--text-faint)}

.meta-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:20px;
}

.q-meta-row-left,
.q-meta-row-right{
  display:inline-flex;
  align-items:center;
  min-width:0;
}

.q-meta-row-right{margin-left:auto;justify-content:flex-end}

.q-answer-check{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:28px;
  padding:8px 10px;
  border:0;
  border-radius:var(--radius-pill);
  background:rgba(255,255,255,.03);
  color:var(--helper);
  font:600 12px/1.2 "DM Sans",sans-serif;
  text-decoration:none;
  cursor:pointer;
}

.q-answer-check:hover,
.q-answer-check.is-hover{background:rgba(255,255,255,.045);color:var(--text)}
.q-answer-check:disabled,
.q-answer-check.is-disabled{color:var(--text-faint);cursor:default}

.q-word-count{
  display:inline-flex;
  align-items:center;
  gap:4px;
  color:var(--text-faint);
  font:400 12px/1.5 "DM Sans",sans-serif;
  white-space:nowrap;
}
.q-word-count-value{color:var(--text-faint)}

.q-utility-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--q-gap-utility-item);
}

.q-utility-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
  min-height: 36px;
}

.q-utility-selectable {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  grid-template-columns: 16px minmax(0, max-content);
  gap: 10px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-01);
  color: var(--text-muted);
  font: 600 12px/1.2 "DM Sans", sans-serif;
  box-shadow: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.q-utility-selectable.is-hover {background: rgba(255,255,255,0.036);color: var(--text)}
.q-utility-selectable.is-selected {background: var(--selection);border-color: var(--selection-line);color: var(--text)}
.q-utility-selectable.is-disabled,
.q-utility-selectable:disabled {opacity: 0.42;cursor: default}

.q-utility-checkbox {
  width: 16px;height: 16px;border-radius: 4px;border: 1.5px solid currentColor;display: inline-flex;align-items: center;justify-content: center;color: var(--subtext);background: transparent;position: relative;
}

.q-utility-selectable.is-selected .q-utility-checkbox {border-color: var(--accent);background: var(--accent);color: var(--accent)}
.q-utility-selectable.is-selected .q-utility-checkbox:after {content: "";width: 7px;height: 4px;border-left: 1.8px solid #08110f;border-bottom: 1.8px solid #08110f;transform: rotate(-45deg) translateY(-1px)}

.yn-inline-decision{
  width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:start;padding:12px;border-radius:var(--radius-control);background:var(--surface-01);border:1px solid transparent;
}
.yn-inline-decision.is-yes-selected{background:var(--selection);border-color:var(--selection-line)}
.yn-inline-decision.has-attached-reveal{border-radius:var(--radius-control) var(--radius-control) 0 0}
.yn-inline-copy{min-width:0;display:grid;gap:var(--q-gap-prompt-support)}
.yn-inline-answer{display:flex;justify-content:flex-end;align-items:start;min-width:max-content}
.yn-group{display:inline-flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.yn-pill{min-width:80px;min-height:36px;padding:8px 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface-01);color:var(--text-muted);text-align:center;font:600 12px/1.2 "DM Sans",sans-serif}
.yn-pill.sel-yes{background:var(--selection);border-color:var(--selection-line);color:var(--text);box-shadow:inset 0 0 0 1px var(--selection-line)}
.yn-pill.sel-no,
.yn-pill.sel-qualified,
.yn-pill.sel-ns{background:rgba(136,167,183,.14);border-color:rgba(136,167,183,.62);color:var(--text);box-shadow:inset 0 0 0 1px rgba(136,167,183,.16)}

.choice-stack{display:grid;gap:var(--q-gap-choice-stack)}
.choice-card{position:relative;display:grid;grid-template-columns:18px minmax(0,1fr);gap:10px;align-items:center;min-height:42px;padding:9px 12px;border-radius:10px;border:1px solid transparent;background:var(--surface-01);cursor:pointer}
.choice-card.has-helper{align-items:start}
.choice-card.is-hover{background:rgba(255,255,255,.036)}
.choice-card.is-selected{background:var(--selection);border-color:var(--selection-line)}
.choice-card.is-disabled{opacity:.42;cursor:default}
.choice-input{position:absolute;opacity:0;pointer-events:none}
.choice-glyph{width:18px;height:18px;margin-top:0;border:1.5px solid currentColor;color:var(--subtext);background:transparent;position:relative}
.choice-glyph--checkbox{border-radius:4px}
.choice-card.has-helper .choice-glyph{margin-top:2px}
.choice-card.is-selected .choice-glyph--checkbox{border-color:var(--accent);color:var(--accent);background:var(--accent)}
.choice-card.is-selected .choice-glyph--checkbox::after{content:"";position:absolute;left:4px;top:4px;width:7px;height:4px;border-left:1.8px solid #08110f;border-bottom:1.8px solid #08110f;transform:rotate(-45deg)}
.choice-copy{display:grid;gap:var(--q-gap-choice-copy)}
.choice-copy strong{color:var(--text);font-size:14px}
.choice-copy span{color:var(--text-muted);font-size:13px}

.yn-attached-reveal-group,
.ms-attached-reveal-group{display:grid;gap:0}
.yn-attached-reveal-group{container-type:inline-size}
.yn-inline-reveal,
.ms-inline-reveal{width:100%;display:grid;gap:10px;padding:12px;margin-top:0;border:1px solid var(--selection-line);border-top:0;background:var(--attached-reveal-fill);border-radius:0 0 var(--radius-control) var(--radius-control)}
.ms-attached-reveal-group > .choice-card.is-selected{border-radius:10px 10px 0 0}
.q-reveal-prompt{color:var(--helper);font-size:13px;line-height:1.5}

/* ==========================================================================
   Full-bleed radio/single-select reveal stack
   ========================================================================== */

/*
  Questions-owned full-bleed radio answer pattern.

  Use for mutually exclusive answer choices that need full-width option rows,
  longer helper copy, or option-attached reveal content. Runtime owns selection,
  show/hide behaviour, value persistence, and validation policy.
*/

.q-radio-stack {
  display: grid;
  gap: var(--q-gap-radio-stack);
  width: 100%;
}

.q-radio-reveal-group {
  display: grid;
  gap: 0;
  width: 100%;
}

.q-radio-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-01);
  color: var(--text-muted);
  cursor: pointer;
}

.q-radio-option.has-helper {
  align-items: start;
}

.q-radio-option.is-hover,
.q-radio-option:hover {
  background: rgba(255, 255, 255, .036);
  color: var(--text);
}

.q-radio-option.is-selected,
.q-radio-option:has(.q-radio-input:checked) {
  background: var(--selection);
  border-color: var(--selection-line);
  color: var(--text);
}

.q-radio-option.is-disabled,
.q-radio-option:has(.q-radio-input:disabled) {
  opacity: .42;
  cursor: default;
}

.q-radio-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.q-radio-glyph {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-pill);
  color: var(--subtext);
  background: transparent;
  position: relative;
}

.q-radio-input:focus-visible + .q-radio-glyph,
.q-radio-option.is-focus .q-radio-glyph {
  box-shadow: 0 0 0 3px rgba(136, 167, 183, .14);
}

.q-radio-option.is-selected .q-radio-glyph,
.q-radio-option:has(.q-radio-input:checked) .q-radio-glyph {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.q-radio-option.is-selected .q-radio-glyph::after,
.q-radio-option:has(.q-radio-input:checked) .q-radio-glyph::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.q-radio-copy {
  display: grid;
  gap: var(--q-gap-choice-copy);
}

.q-radio-copy strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.q-radio-copy span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.q-radio-reveal-group > .q-radio-option.is-selected,
.q-radio-reveal-group > .q-radio-option:has(.q-radio-input:checked) {
  border-radius: 10px 10px 0 0;
}

.q-radio-inline-reveal {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--selection-line);
  border-top: 0;
  background: var(--attached-reveal-fill);
  border-radius: 0 0 var(--radius-control) var(--radius-control);
}

/*
  Questions-owned stacked content layout for attached reveal panels.

  Use inside an attached reveal panel when one parent answer exposes two or more
  canonical child controls. This wrapper owns only reveal-body rhythm, grouping,
  and state hooks; nested textarea, text, dropdown, and date controls keep their
  own Questions/Controls primitive styling.
*/

.q-reveal-stack {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.q-reveal-stack[hidden] {
  display: none;
}

.q-reveal-stack-items {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.q-reveal-child {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.q-reveal-child-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.q-reveal-child-support {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.q-reveal-child-control {
  width: 100%;
  min-width: 0;
}

.q-reveal-child.is-disabled,
.q-reveal-child[aria-disabled="true"] {
  opacity: .48;
}

/* ==========================================================================
   Two-column option grid
   ========================================================================== */

/*
  Questions-owned option-grid answer pattern.

  Use for non-reveal radio or checkbox answer groups that benefit from a denser
  two-column layout inside one question shell and one answer zone. If an option
  requires attached reveal content, use the full-bleed revealable single-select
  pattern unless a future DS package defines grid-compatible reveal behaviour.
*/

.q-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--q-gap-option-grid);
  width: 100%;
  min-width: 0;
}

.q-option-grid-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-01);
  color: var(--text-muted);
  cursor: pointer;
}

.q-option-grid-option.has-helper {
  align-items: start;
}

.q-option-grid-option.is-hover,
.q-option-grid-option:hover {
  background: rgba(255, 255, 255, .036);
  color: var(--text);
}

.q-option-grid-option.is-selected,
.q-option-grid-option:has(.q-option-grid-input:checked) {
  background: var(--selection);
  border-color: var(--selection-line);
  color: var(--text);
}

.q-option-grid-option.is-disabled,
.q-option-grid-option:has(.q-option-grid-input:disabled) {
  opacity: .42;
  cursor: default;
}

.q-option-grid-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.q-option-grid-glyph {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid currentColor;
  color: var(--subtext);
  background: transparent;
  position: relative;
}

.q-option-grid-glyph--radio {
  border-radius: var(--radius-pill);
}

.q-option-grid-glyph--checkbox {
  border-radius: 4px;
}

.q-option-grid-option.has-helper .q-option-grid-glyph {
  margin-top: 2px;
}

.q-option-grid-input:focus-visible + .q-option-grid-glyph,
.q-option-grid-option.is-focus .q-option-grid-glyph {
  box-shadow: 0 0 0 3px var(--focus-halo, rgba(136, 167, 183, .08));
}

.q-option-grid-option.is-selected .q-option-grid-glyph,
.q-option-grid-option:has(.q-option-grid-input:checked) .q-option-grid-glyph {
  border-color: var(--accent);
  color: var(--accent);
}

.q-option-grid-option.is-selected .q-option-grid-glyph--radio,
.q-option-grid-option:has(.q-option-grid-input:checked) .q-option-grid-glyph--radio {
  background: transparent;
}

.q-option-grid-option.is-selected .q-option-grid-glyph--radio::after,
.q-option-grid-option:has(.q-option-grid-input:checked) .q-option-grid-glyph--radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.q-option-grid-option.is-selected .q-option-grid-glyph--checkbox,
.q-option-grid-option:has(.q-option-grid-input:checked) .q-option-grid-glyph--checkbox {
  background: var(--accent);
}

.q-option-grid-option.is-selected .q-option-grid-glyph--checkbox::after,
.q-option-grid-option:has(.q-option-grid-input:checked) .q-option-grid-glyph--checkbox::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 7px;
  height: 4px;
  border-left: 1.8px solid var(--text-primary);
  border-bottom: 1.8px solid var(--text-primary);
  transform: rotate(-45deg);
}

.q-option-grid-copy {
  display: grid;
  gap: var(--q-gap-choice-copy);
  min-width: 0;
}

.q-option-grid-copy strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.q-option-grid-copy span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Ranked transfer
   ========================================================================== */

/*
  Questions-owned ranked transfer answer pattern.

  Use for ordered multi-select answers where items move from an available pool
  into a selected priority list. Runtime owns data mutation, dependency events,
  persistence, validation policy, announcements, and optional drag/drop logic.
*/

.q-ranked-transfer {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.q-ranked-transfer-instructions {
  margin: 0;
  color: var(--helper);
  font-size: 13px;
  line-height: 1.5;
}

.q-ranked-transfer-zones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-ranked-transfer-zone {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.q-ranked-transfer-zone--selected {
  order: 1;
}

.q-ranked-transfer-zone--available {
  order: 3;
}

.q-ranked-transfer-divider {
  display: none;
  order: 2;
  height: 1px;
  margin: 5px 0;
  background: rgba(255, 255, 255, .07);
}

.q-ranked-transfer-divider.is-visible {
  display: block;
}

.q-ranked-transfer-zone-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 10px;
}

.q-ranked-transfer-zone-title {
  margin: 0;
  color: var(--guidance-blue, #88a7b7);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.q-ranked-transfer-zone-meta {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.q-ranked-transfer-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.q-ranked-transfer-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .028);
  color: var(--text-muted, #b6c1c8);
  text-align: left;
}

.q-ranked-transfer-list--available .q-ranked-transfer-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.q-ranked-transfer-item.is-selected {
  background: rgba(0, 163, 136, .07);
  color: var(--text);
}

.q-ranked-transfer-item.is-selected:hover {
  background: rgba(0, 163, 136, .07);
  color: var(--text);
}

.q-ranked-transfer-item.is-hover,
.q-ranked-transfer-item:hover {
  background: rgba(255, 255, 255, .036);
  color: var(--text);
}

.q-ranked-transfer-item.is-focus,
.q-ranked-transfer-item:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px rgba(136, 167, 183, .28);
}

.q-ranked-transfer-item.is-unavailable,
.q-ranked-transfer-item[aria-disabled="true"] {
  opacity: .48;
}

.q-ranked-transfer-item.is-dragging,
.q-ranked-transfer-item.is-grabbed,
.q-ranked-transfer-item[aria-grabbed="true"] {
  background: rgba(0, 163, 136, .075);
  box-shadow:
    inset 0 0 0 1px rgba(0, 163, 136, .55),
    0 10px 22px rgba(0, 0, 0, .28);
  transform: translateY(-1px);
}

.q-ranked-transfer-item.is-drop-target,
.q-ranked-transfer-item.drag-over {
  box-shadow: 0 0 0 2px rgba(136, 167, 183, .28);
}

.q-ranked-transfer-rank {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--warning, #ffc000);
  color: #111820;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.q-ranked-transfer-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border: 1.5px solid #737373;
  border-radius: 4px;
  color: inherit;
  flex: none;
}

.q-ranked-transfer-check svg {
  display: block;
  opacity: 0;
}

.q-ranked-transfer-item.is-selected .q-ranked-transfer-check {
  border-color: var(--accent, #00a388);
  background: var(--accent, #00a388);
}

.q-ranked-transfer-item.is-selected .q-ranked-transfer-check svg {
  opacity: 1;
}

.q-ranked-transfer-copy {
  display: grid;
  gap: var(--q-gap-choice-copy);
  min-width: 0;
}

.q-ranked-transfer-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.q-ranked-transfer-copy span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.q-ranked-transfer-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

.q-ranked-transfer-control-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  justify-self: end;
}

.q-ranked-transfer-reorder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.q-ranked-transfer-reorder-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  outline: 0;
  border-radius: var(--radius-pill);
  background: var(--affordance-fill, rgba(255,255,255,.055));
  color: var(--affordance-icon, #b6c1c8);
  font: 800 10px/1 "DM Sans", sans-serif;
  cursor: pointer;
  box-shadow: none;
}

.q-ranked-transfer-reorder-button:hover,
.q-ranked-transfer-reorder-button.is-hover {
  background: var(--affordance-fill-active, rgba(136,167,183,.12));
  color: var(--affordance-icon-active, #bdcbd1);
}

.q-ranked-transfer-reorder-button:focus-visible {
  outline: none;
  box-shadow: none;
}

.q-ranked-transfer-reorder-button:disabled,
.q-ranked-transfer-reorder-button.is-disabled {
  opacity: .34;
  cursor: default;
}

.q-ranked-transfer-action {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(136, 167, 183, .72);
  font: 700 12px/1 "DM Sans", sans-serif;
  cursor: pointer;
}

.q-ranked-transfer-action--check {
  min-width: 15px;
  min-height: 15px;
  border-radius: 4px;
  color: inherit;
}

.q-ranked-transfer-action:hover,
.q-ranked-transfer-action.is-hover {
  background: rgba(255, 255, 255, .06);
  color: #eef4f7;
}

.q-ranked-transfer-action:focus-visible,
.q-ranked-transfer-action.is-focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(136, 167, 183, .45);
}

.q-ranked-transfer-action:disabled,
.q-ranked-transfer-action.is-disabled {
  opacity: .45;
  cursor: default;
}

.q-ranked-transfer-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 24px;
  color: rgba(136, 167, 183, .62);
  font-size: 15px;
  letter-spacing: -3px;
  line-height: 1;
  cursor: grab;
}

.q-ranked-transfer-drag-handle:active,
.q-ranked-transfer-item.is-grabbed .q-ranked-transfer-drag-handle,
.q-ranked-transfer-item[aria-grabbed="true"] .q-ranked-transfer-drag-handle {
  color: var(--affordance-icon-active, #bdcbd1);
  cursor: grabbing;
}

.q-ranked-transfer-grip {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  grid-template-rows: repeat(3, 3px);
  gap: 3px;
  width: 9px;
  height: 15px;
}

.q-ranked-transfer-grip i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.q-ranked-transfer-empty,
.q-ranked-transfer-note,
.q-ranked-transfer-status {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .018);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.q-ranked-transfer-empty {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
}

.q-ranked-transfer-note.is-invalid {
  border-color: rgba(255, 183, 77, .42);
  background: rgba(255, 183, 77, .08);
  color: var(--text);
}

.q-ranked-transfer-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.q-ranked-transfer-insertion-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 20px;
  color: var(--guidance-blue);
}

.q-ranked-transfer-insertion-rail::before,
.q-ranked-transfer-insertion-rail::after {
  content: "";
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
  box-shadow: 0 0 12px rgba(110, 168, 255, .22);
}

.q-ranked-transfer-insertion-plus {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: rgba(110, 168, 255, .18);
  color: #d9e7ff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

/* ==========================================================================
   Compact multi-select rows and selected-option inline reveals
   ========================================================================== */

.q-compact-choice-list {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.q-compact-choice-reveal-group {
  display: grid;
  gap: 0;
  min-width: 0;
}

.q-compact-choice-row {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-01);
  color: var(--text-muted);
  cursor: pointer;
}

.q-compact-choice-row.is-hover,
.q-compact-choice-row:hover {
  background: rgba(255, 255, 255, .036);
  color: var(--text);
}

.q-compact-choice-row.is-selected,
.q-compact-choice-row:has(.q-compact-choice-input:checked) {
  background: var(--selection);
  border-color: var(--selection-line);
  color: var(--text);
}

.q-compact-choice-row.is-disabled,
.q-compact-choice-row:has(.q-compact-choice-input:disabled) {
  opacity: .42;
  cursor: default;
}

.q-compact-choice-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.q-compact-choice-glyph {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  color: var(--subtext);
  background: transparent;
  position: relative;
}

.q-compact-choice-input:focus-visible + .q-compact-choice-glyph,
.q-compact-choice-row.is-focus .q-compact-choice-glyph {
  box-shadow: 0 0 0 3px var(--focus-halo, rgba(136, 167, 183, .08));
}

.q-compact-choice-row.is-selected .q-compact-choice-glyph,
.q-compact-choice-row:has(.q-compact-choice-input:checked) .q-compact-choice-glyph {
  border-color: var(--accent);
  background: var(--accent);
}

.q-compact-choice-row.is-selected .q-compact-choice-glyph::after,
.q-compact-choice-row:has(.q-compact-choice-input:checked) .q-compact-choice-glyph::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 7px;
  height: 4px;
  border-left: 1.8px solid var(--text-primary);
  border-bottom: 1.8px solid var(--text-primary);
  transform: rotate(-45deg);
}

.q-compact-choice-copy {
  display: grid;
  gap: var(--q-gap-choice-copy);
  min-width: 0;
}

.q-compact-choice-copy strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.q-compact-choice-copy span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.q-compact-choice-reveal-group > .q-compact-choice-row.is-selected,
.q-compact-choice-reveal-group > .q-compact-choice-row:has(.q-compact-choice-input:checked) {
  border-radius: 10px 10px 0 0;
}

.q-compact-choice-inline-reveal {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--selection-line);
  border-top: 0;
  border-radius: 0 0 var(--radius-control) var(--radius-control);
  background: var(--attached-reveal-fill);
}

/* ==========================================================================
   Generated question group stack
   ========================================================================== */

.q-generated-group-stack {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.rebuild-question-stack {
  display: grid;
  gap: calc(var(--space-3) + var(--space-2-5) + var(--space-2));
}

.question-shell.is-disabled .question-heading,
.question-shell.is-disabled .question-support {
  color: var(--text-disabled);
}

.text-entry-shell.is-disabled,
.question-shell.is-disabled .text-entry-shell {
  background: transparent;
}

.q-generated-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, .018);
}

.q-generated-group.is-active {
  border-color: rgba(0, 163, 136, .24);
  background: rgba(0, 163, 136, .045);
}

.q-generated-group.is-inactive {
  opacity: .62;
}

.q-generated-group.is-warning {
  border-color: rgba(255, 183, 77, .42);
  background: rgba(255, 183, 77, .07);
}

.q-generated-group-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.q-generated-group-title {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.q-generated-group-support {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.q-generated-group-meta {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.q-generated-group-note,
.q-generated-group-empty {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .018);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.q-generated-group-empty {
  border-style: dashed;
}

/* ==========================================================================
   Generated priority workspace
   ========================================================================== */

/*
  Questions-owned generated priority workspace pattern.

  Use when upstream ordered priorities generate downstream detail groups. The
  workspace wrapper owns the priority navigation/disclosure structure; nested
  generated choices consume existing multiselect choice-card rows unchanged.
*/

.q-generated-priority-workspace {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.q-generated-priority-intro {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.q-generated-priority-intro strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.q-generated-priority-intro span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.q-generated-priority-list {
  display: grid;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.q-generated-priority-group {
  display: grid;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.q-generated-priority-group + .q-generated-priority-group {
  margin-top: 8px;
}

.q-generated-priority-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-01);
  color: var(--text-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.q-generated-priority-trigger:hover,
.q-generated-priority-trigger.is-hover {
  background: rgba(255, 255, 255, .036);
  color: var(--text);
}

.q-generated-priority-trigger:focus-visible,
.q-generated-priority-trigger.is-focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.q-generated-priority-group.is-active .q-generated-priority-trigger,
.q-generated-priority-trigger[aria-expanded="true"] {
  border-color: var(--selection-line);
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  background: var(--selection);
  color: var(--text);
}

.q-generated-priority-group.is-unavailable .q-generated-priority-trigger,
.q-generated-priority-trigger:disabled {
  opacity: .42;
  cursor: default;
}

.q-generated-priority-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.q-generated-priority-title {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.q-generated-priority-title-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.q-generated-priority-rank {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: var(--radius-pill);
  background: var(--tab-active-underline, #ffc000);
  color: #111111;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.q-generated-priority-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--selection-line);
  border-top: 0;
  border-radius: 0 0 var(--radius-control) var(--radius-control);
  background: var(--attached-reveal-fill);
}

.q-generated-priority-body[hidden] {
  display: none;
}

.q-generated-priority-panel-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.q-generated-priority-panel-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.q-generated-priority-panel-support,
.q-generated-priority-warning,
.q-generated-priority-empty {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.q-generated-priority-warning,
.q-generated-priority-empty {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .018);
}

.q-generated-priority-warning {
  border-color: var(--warning-note-border, rgba(255, 192, 0, .26));
  background: var(--warning-note-surface, rgba(255, 192, 0, .055));
  color: var(--text);
}

.q-generated-priority-empty {
  border-style: dashed;
}

.q-generated-priority-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--q-gap-choice-stack);
  width: 100%;
  min-width: 0;
}

/* ==========================================================================
   Evaluation criteria weighting group
   ========================================================================== */

/*
  Questions-owned grouped weighting answer mechanic.

  Use when one visible fieldset/question stem owns a fixed group of percentage
  dropdown sub-answers plus a computed total guidance row. Runtime owns source
  keys, defaults, completion, total calculation, persistence, and derived group
  status. Controls own the nested dropdown trigger/menu primitives.
*/

.qt-eval-weight-group {
  display: grid;
  gap: 0;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, .018);
  overflow: hidden;
}

.qt-eval-weight-group.has-open-menu,
.qt-eval-weight-group.is-open {
  overflow: visible;
}

.qt-eval-weight-list {
  display: grid;
  gap: 0;
  min-width: 0;
}

.qt-eval-weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(128px, 140px);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
}

.qt-eval-weight-row:hover,
.qt-eval-weight-row.is-hover {
  background: rgba(255, 255, 255, .036);
  color: var(--text);
}

.qt-eval-weight-row:focus-within,
.qt-eval-weight-row.is-focus {
  background: var(--selection);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--selection-line);
}

.qt-eval-weight-row.is-disabled,
.qt-eval-weight-row[aria-disabled="true"] {
  opacity: .48;
  cursor: default;
}

.qt-eval-weight-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.qt-eval-weight-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.qt-eval-weight-suggestion {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.qt-eval-weight-control {
  position: relative;
  width: min(100%, 140px);
  min-width: 0;
  justify-self: end;
}

.qt-eval-weight-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  width: 100%;
}

.qt-eval-weight-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(128px, 140px);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .035);
  color: var(--text);
}

.qt-eval-weight-total-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.qt-eval-weight-total-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.qt-eval-weight-total-status {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.qt-eval-weight-total-value {
  justify-self: end;
  width: min(100%, 140px);
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}

.qt-eval-weight-total.is-balanced {
  border-top: 1px solid var(--success-note-border);
  background: var(--success-note-surface);
}

.qt-eval-weight-total.is-balanced .qt-eval-weight-total-value {
  color: var(--success-note-accent);
}

.qt-eval-weight-total.is-under {
  border-top: 1px solid var(--warning-note-border);
  background: var(--warning-note-surface);
}

.qt-eval-weight-total.is-under .qt-eval-weight-total-value {
  color: var(--warning-note-accent);
}

.qt-eval-weight-total.is-over {
  border-top: 1px solid var(--error-note-border);
  background: var(--error-note-surface);
}

.qt-eval-weight-total.is-over .qt-eval-weight-total-value {
  color: var(--error-note-accent);
}

@media(max-width:980px){.question-pair{grid-template-columns:1fr}}
@media(max-width:720px){
  .meta-row{flex-wrap:wrap;row-gap:8px}
  .q-meta-row-right{margin-left:0;width:100%;justify-content:flex-start}
  .yn-inline-decision{grid-template-columns:1fr}
  .yn-inline-answer{width:100%;min-width:0;justify-content:flex-start}
  .yn-group{width:100%;justify-content:flex-start}
  .q-option-grid{grid-template-columns:1fr}
  .q-ranked-transfer-zones{display:flex;flex-direction:column}
  .q-ranked-transfer-zone--selected{order:1}
  .q-ranked-transfer-zone--available{order:3}
  .q-ranked-transfer-item,
  .q-ranked-transfer-list--available .q-ranked-transfer-item{grid-template-columns:auto minmax(0,1fr);align-items:start}
  .q-ranked-transfer-rank{justify-self:start}
  .q-ranked-transfer-actions{justify-content:flex-start}
  .q-generated-group-head{display:grid}
  .q-generated-priority-trigger{grid-template-columns:minmax(0,1fr) auto}
  .q-generated-priority-title{align-items:flex-start}
  .q-generated-priority-choice-grid{grid-template-columns:1fr}
  .qt-eval-weight-row,
  .qt-eval-weight-total{grid-template-columns:1fr}
  .qt-eval-weight-control,
  .qt-eval-weight-total-value{width:100%;justify-self:stretch}
  .qt-eval-weight-total-value{padding:0}
}

@container (max-width: 520px) {
  .yn-inline-decision{grid-template-columns:1fr}
  .yn-inline-answer{width:100%;min-width:0;justify-content:flex-start}
  .yn-group{width:100%;justify-content:flex-start}
}

@media (prefers-reduced-motion: reduce) {
  .q-ranked-transfer-item,
  .q-compact-choice-row,
  .q-generated-group,
  .q-generated-priority-trigger,
  .qt-eval-weight-row {
    transition: none;
  }
}

/* ==========================================================================
   Single-select pill group
   ========================================================================== */

/*
  Questions-owned compact single-select answer pattern.

  Use for short, mutually exclusive answer choices where a full choice-card
  stack would be too heavy, and where yes/no semantics do not apply.

  Examples:
  - Sector choice in project setup
  - Importance choice in Review add/manage item
*/

.q-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.q-select-pill {
  appearance: none;
  -webkit-appearance: none;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-01);
  color: var(--text-muted);
  font: 600 12px/1.2 "DM Sans", sans-serif;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.q-select-pill:hover,
.q-select-pill.is-hover {
  background: rgba(255, 255, 255, 0.036);
  color: var(--text);
}

.q-select-pill.is-selected,
.q-select-pill[aria-pressed="true"],
.q-select-pill[aria-checked="true"] {
  background: var(--selection);
  border-color: var(--selection-line);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--selection-line);
}

.q-select-pill:disabled,
.q-select-pill.is-disabled {
  opacity: 0.42;
  cursor: default;
}

.q-pill-group[aria-disabled="true"] .q-select-pill {
  opacity: 0.42;
  cursor: default;
}

@media (max-width: 520px) {
  .q-select-pill {
    flex: 1 1 auto;
  }
}
