/* interact.css - styles of the interaction views (question, ask, ask-client, questions, cr, cr-new, crs) and of the forms
   that views.js shows in the feature and release views. Own classes only, all prefixed i-. Tokens only, so the report
   view (paper tokens) and print turn out right. Controls sit in .no-rep containers, which the shell hides in report
   view and print. Shared classes (.card .pill .tbl .sec .btn .note-box ...) belong to the shell. */

.i-view { min-width: 0; }
:where(.i-view) > * + * { margin-top: 24px; }
:where(.i-view) :where(p, dl, dd, ul, ol, h4) { margin: 0; }
:where(.i-view) :where(ul, ol) { padding: 0; list-style: none; }

/* text pieces */
.i-lead { font-size: 14px; line-height: 22px; white-space: pre-line; overflow-wrap: anywhere; }
.i-none { font-size: 13px; line-height: 18px; color: var(--muted); }
.i-sub { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.i-id { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }
.i-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i-warn { color: var(--warn); font-weight: 500; }
.i-crit { color: var(--crit); font-weight: 500; }
.i-sh { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; }
.i-sh:not(:first-child) { margin-top: 16px; }
.i-sh + .i-lead { margin-top: 4px; }
.i-after { margin-top: 12px; }
.i-fit { break-inside: avoid; }
.i-meta { font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.i-actor { overflow-wrap: anywhere; }
.i-cap { display: inline-block; }
.i-cap::first-letter { text-transform: uppercase; }
.i-rep-only { display: none; }
.rv .i-rep-only { display: block; }
.rv .i-facts > div.i-rep-only { display: block; }
.i-line { display: block; }
.i-line + .i-line { margin-top: 4px; }

/* summary block: lead text and facts */
.i-top > * + * { margin-top: 16px; }
.i-facts { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.i-facts > div { min-width: 0; break-inside: avoid; }
.i-facts dt { font-size: 12px; line-height: 16px; color: var(--muted); }
.i-facts dd { margin-top: 2px; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.i-lead + .i-facts { margin-top: 12px; }
.i-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* what a question blocks */
.i-blocks { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--warn-soft); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; break-inside: avoid; }
.i-blocks strong { color: var(--warn); font-weight: 600; }

/* options, and the answer that was chosen */
.i-opts { display: grid; gap: 8px; }
.i-opts > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); line-height: 24px; break-inside: avoid; }
.i-opts > li.is-chosen { grid-template-columns: 24px minmax(0, 1fr) auto; border-color: var(--ok); }
.i-opt-k, .i-letter { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-family: var(--font-mono); font-size: 12px; line-height: 1; font-weight: 500; }
.i-opt-t { min-width: 0; overflow-wrap: anywhere; }
.i-opt-end { display: flex; align-items: center; min-height: 24px; }
.i-chosen { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 24px; font-weight: 500; overflow-wrap: anywhere; }

/* answer, assessment and decision blocks */
.i-box { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); break-inside: avoid; }
.i-box > * + * { margin-top: 12px; }
.i-box-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.i-box-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.i-box-t { font-size: 14px; line-height: 20px; font-weight: 600; }
.i-box-warn .i-box-t { color: var(--warn); }
.i-sent { padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line)); border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok); font-size: 13px; line-height: 18px; font-weight: 500; }
.i-sent.is-partial { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); color: var(--warn); }

/* forms */
.i-form { display: grid; gap: 16px; max-width: 640px; }
.i-field { min-width: 0; }
.i-label { display: block; margin: 0 0 4px; font-size: 13px; line-height: 18px; font-weight: 500; }
.i-req, .i-opt { margin-left: 6px; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--muted); }
.i-req { font-weight: 600; }
.i-hint { margin: 0 0 6px; font-size: 12px; line-height: 16px; color: var(--muted); }
.i-input, .i-select {
  max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--fg);
  font: inherit; font-size: 14px; line-height: 20px; transition: border-color .12s;
}
.i-input { display: block; width: 100%; min-height: 38px; padding: 8px 10px; }
.i-area { min-height: 84px; resize: vertical; }
.i-select { height: 34px; padding: 0 10px; font-size: 13px; line-height: 18px; cursor: pointer; }
.i-input.i-select { height: auto; min-height: 38px; font-size: 14px; line-height: 20px; }
.i-input:focus-visible, .i-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.i-input[aria-invalid="true"] { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit); }
.i-err { margin: 6px 0 0; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--crit); }
.i-choices { display: grid; gap: 8px; }
.i-segs { display: flex; flex-wrap: wrap; gap: 8px; }
.i-segs .i-choice { flex: 1 1 96px; }
.i-choice, .i-check {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; transition: border-color .12s, background-color .12s;
}
.i-choice:has(.i-letter) { grid-template-columns: 18px 24px minmax(0, 1fr); }
.i-choice:has(input:checked), .i-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.i-choice:has(input:focus-visible), .i-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.i-radio, .i-box-in { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.i-choice-t, .i-check-t { min-width: 0; overflow-wrap: anywhere; }
.i-choice-l { display: block; font-weight: 500; }
.i-choice-s { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--muted); }
.i-checks { display: grid; gap: 6px; }
.i-confirm { max-width: 640px; }
.i-actions, .i-withdraw, .i-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.i-status, .i-fail { min-width: 0; font-size: 13px; line-height: 18px; font-weight: 500; overflow-wrap: anywhere; }
.i-status { color: var(--ok); }
.i-fail { color: var(--crit); }
.i-status:empty, .i-fail:empty { display: none; }
.i-actions .btn:disabled, .i-withdraw .btn:disabled, .i-act .btn:disabled { opacity: .6; cursor: not-allowed; }
.i-actions .btn-primary:disabled:hover, .i-act .btn-primary:disabled:hover { background: var(--accent); }
.i-lock { margin: 0; }

/* developer forms (SPEC-v7): answer options as rows, two fields side by side, assign controls */
.i-optrows { display: grid; gap: 12px; }
.i-optrows:not(:empty) { margin-bottom: 12px; }
.i-optrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 8px; }
.i-optrow .i-err { grid-column: 1 / -1; margin-top: 0; }
.i-optrow-f { min-width: 0; }
.i-optadd { display: flex; }
.i-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.i-date { max-width: 220px; }
.i-assign { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.i-assign > .i-sent { flex: 1 1 100%; }
.i-assign .i-form { gap: 8px; }
.i-assign .i-hint { margin: 0; }

/* lists: filters, and the two tables (live for the screen, full for report view and print) */
.i-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.i-filter label { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; line-height: 18px; color: var(--muted); }
.i-filter .i-sub { margin-top: 0; }
.i-all { display: none; }
.i-view > .i-filter + .i-live, .i-view > .i-live + .i-all { margin-top: 0; }
.sheet.rv .i-filter, .sheet.rv .i-live { display: none; }
.sheet.rv .i-all { display: block; }
.rv .i-all { margin-top: 0; }

/* report view: keep the gap after a hidden interactive section */
.rv .i-view > * + .no-rep + .sec, .rv .v-view > * + .no-rep + .sec { margin-top: 24px; }

@media (max-width: 559px) {
  .i-facts { gap: 12px 24px; }
  .i-pair { grid-template-columns: minmax(0, 1fr); }
  .i-date { max-width: 100%; }
  .i-input, .i-input.i-select { font-size: 16px; }
  .i-opts > li.is-chosen { grid-template-columns: 24px minmax(0, 1fr); }
  .i-opt-end { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .i-input, .i-select, .i-choice, .i-check { transition: none; }
}
@media print {
  .i-filter, .i-live { display: none; }
  .i-all { display: block; }
  .i-view > .i-filter + .i-live { margin-top: 0; }
  .i-select { display: none; }
}
