/* The evaluation app (app.html) and the vendor form (v.html). */

.app-main { padding: 2rem 0 4rem; }
@media (max-width: 575.98px) { .app-main { padding-top: 1.25rem; } }
.app-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.25rem; }

/* Steps */
.step { background: var(--pw-surface); border: 1px solid var(--pw-line); border-radius: var(--pw-radius); margin-bottom: 0.75rem; }
.step.is-active { border-color: var(--pw-ink); box-shadow: 0 0 0 1px var(--pw-ink); }
.step-head {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; padding: 1rem 1.25rem;
  background: none; border: 0; color: inherit; text-align: left; border-radius: var(--pw-radius);
}
.step-head[disabled] { cursor: default; }
.step-head:not([disabled]):hover .step-title { text-decoration: underline; text-underline-offset: 3px; }
.step-num {
  flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--pw-font-head); font-weight: 700; font-size: 0.95rem;
  border: 1.5px solid var(--pw-line); color: var(--pw-muted); background: var(--pw-surface);
}
.step.is-active .step-num { background: var(--pw-ink); border-color: var(--pw-ink); color: #fff; }
.step.is-done .step-num { border-color: var(--pw-ink); color: var(--pw-ink); }
.step.is-done .step-num::after { content: ""; }
.step-title { font-family: var(--pw-font-head); font-weight: 700; font-size: 1.15rem; }
.step-sum { margin-left: auto; color: var(--pw-muted); font-size: 0.92rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.step.is-locked { background: transparent; border-style: dashed; }
.step.is-locked .step-title { color: var(--pw-muted); }
.step-body { padding: 0 1.25rem 1.5rem 4rem; }
@media (max-width: 575.98px) {
  .step-body { padding: 0 1rem 1.25rem; }
  .step-sum { display: none; }
}
.step-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1.5rem; }

/* Mode switch (step 1) */
.mode-switch { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.mode-switch legend { float: none; grid-column: 1 / -1; margin-bottom: 0.1rem; }
.mode-opt { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.75rem 0.85rem; border: 1.5px solid var(--pw-line); border-radius: var(--pw-radius-sm); cursor: pointer; background: var(--pw-surface); }
.mode-opt:has(input:checked) { border-color: var(--pw-ink); box-shadow: 0 0 0 1px var(--pw-ink); }
.mode-opt input { margin-top: 0.25rem; accent-color: var(--pw-ink); }
.mode-opt b { display: block; }
.mode-opt span span { display: block; }
@media (max-width: 575.98px) { .mode-switch { grid-template-columns: minmax(0, 1fr); } }

/* Checklist */
.group + .group { margin-top: 1.5rem; }
.group-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.group-head h3 { font-size: 1rem; margin: 0; }
.group-head .count { color: var(--pw-muted); font-size: 0.9rem; }
.group-toggle { width: 100%; background: none; border: 0; padding: 0.25rem 0; text-align: left; color: inherit; cursor: pointer; border-radius: var(--pw-radius-sm); }
.group-toggle:hover .count { color: var(--pw-ink); }
.group-toggle .bi { font-size: 0.85rem; color: var(--pw-muted); }
.group-toggle[aria-expanded="false"] { margin-bottom: 0; }

/* "Suggest vendors" */
/* "Use your own AI" panel (F5): three numbered steps, each one action. */
.ownai { border: 1px solid var(--pw-line); border-radius: var(--pw-radius-sm); background: var(--pw-surface); padding: 1rem 1.1rem; }
.ownai-steps { margin: 0; padding-left: 1.4rem; display: grid; gap: 1rem; }
.ownai-steps > li::marker { font-weight: 700; }
.ownai-h { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.ownai-ais { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ownai textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.suggest-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--pw-line); border-radius: var(--pw-radius-sm); background: var(--pw-surface); }
.suggest-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.45rem 0.75rem; }
.suggest-list li + li { border-top: 1px solid var(--pw-line-soft); }
.suggest-name { font-weight: 700; overflow-wrap: anywhere; }

/* The human check floats into view when Cloudflare asks for a tick. */
#turnstile-box.needs-check { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1080;
  background: var(--pw-surface); border: 1px solid var(--pw-line); border-radius: var(--pw-radius); padding: 0.6rem 0.75rem 0.5rem;
  box-shadow: 0 6px 24px rgba(23, 35, 46, 0.18); max-width: calc(100vw - 32px); }
#turnstile-box.needs-check::before { content: "Tick the box to continue"; display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.35rem; }
.feat {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.75rem;
  padding: 0.8rem 0.9rem; border: 1px solid var(--pw-line); border-radius: var(--pw-radius-sm); background: var(--pw-surface);
}
.feat + .feat { margin-top: 0.5rem; }
.feat-must_have { border-left: 4px solid var(--pw-ink); }
.feat-nice_to_have { border-left: 4px solid var(--pw-ink-2); border-left-style: double; }
.feat-optional { border-left: 4px dashed var(--pw-muted); }
.feat-title { font-weight: 700; }
.feat-q { color: var(--pw-ink-2); font-size: 0.95rem; }
.feat-why { color: var(--pw-muted); font-size: 0.88rem; margin-top: 0.2rem; }
.feat-tools { display: flex; gap: 0.25rem; align-items: flex-start; }
.feat-tools .form-select { width: auto; padding: 0.25rem 2rem 0.25rem 0.5rem; font-size: 0.88rem; }
.feat-tag { font-size: 0.78rem; color: var(--pw-muted); border: 1px solid var(--pw-line); border-radius: 99px; padding: 0.05rem 0.5rem; margin-left: 0.35rem; font-weight: 400; vertical-align: 0.1em; }
.feat.is-new { animation: pw-in 0.25s ease; }
@keyframes pw-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.feat-edit .form-control { margin-bottom: 0.4rem; }
@media (max-width: 575.98px) { .feat { grid-template-columns: minmax(0, 1fr); } .feat-tools { justify-content: flex-start; } }

.peers { margin-top: 1.5rem; padding: 0.9rem 1rem; border: 1px solid var(--pw-line); border-radius: var(--pw-radius-sm); background: var(--pw-paper); }
.peers-head { font-weight: 700; margin-bottom: 0.5rem; display: flex; gap: 0.45rem; align-items: center; }
.peers ul { list-style: none; padding: 0; margin: 0 0 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.peers li { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; }

.generating { display: flex; align-items: center; gap: 0.6rem; color: var(--pw-ink-2); padding: 0.5rem 0 1rem; }
.basics-note { margin-top: 1.5rem; padding: 0.9rem 1rem; border: 1px dashed var(--pw-line); border-radius: var(--pw-radius-sm); font-size: 0.93rem; color: var(--pw-ink-2); }
.basics-note summary { cursor: pointer; font-weight: 700; color: var(--pw-ink); }
.basics-note ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }

/* Vendors */
.vendor { border: 1px solid var(--pw-line); border-radius: var(--pw-radius-sm); padding: 0.9rem 1rem; }
.vendor + .vendor { margin-top: 0.75rem; }
.vendor-head { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.vendor-name { font-family: var(--pw-font-head); font-weight: 700; font-size: 1.1rem; }
.chip { font-size: 0.82rem; border-radius: 99px; padding: 0.15rem 0.6rem; background: var(--pw-line-soft); color: var(--pw-ink-2); }
.chip-done { background: #e3f1ec; color: var(--pw-yes); font-weight: 700; }
.vendor-link { display: flex; gap: 0.4rem; margin-top: 0.75rem; flex-wrap: wrap; }
.vendor-link .form-control { flex: 1 1 260px; font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; background: var(--pw-paper); }

/* Answer editor (buyer's manual entry and the vendor form) */
.ans { padding: 0.85rem 0; border-top: 1px solid var(--pw-line-soft); }
.ans:first-child { border-top: 0; }
.ans-title { font-weight: 700; }
.ans-q { color: var(--pw-ink-2); font-size: 0.95rem; margin-bottom: 0.55rem; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.seg button {
  display: inline-flex; align-items: center; gap: 0.4rem; border: 1.5px solid var(--pw-line); background: var(--pw-surface);
  border-radius: 99px; padding: 0.3rem 0.8rem 0.3rem 0.55rem; font: inherit; font-size: 0.93rem; color: var(--pw-ink);
}
.seg button:hover { border-color: var(--pw-ink-2); }
.seg button[aria-pressed="true"] { border-color: currentColor; font-weight: 700; }
.seg button[aria-pressed="true"].s-yes { color: var(--pw-yes); background: #eef7f3; }
.seg button[aria-pressed="true"].s-partial { color: var(--pw-partial); background: #fbf4e7; }
.seg button[aria-pressed="true"].s-planned { color: var(--pw-planned); background: #eff2fd; }
.seg button[aria-pressed="true"].s-no { color: var(--pw-no); background: #fbefed; }
.seg button[disabled] { opacity: 1; cursor: default; }
.ans-controls { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.ans-row { display: flex; flex-wrap: nowrap; gap: 0.75rem; align-items: center; flex: 1 1 340px; min-width: 0; }
.ans-row .form-control { flex: 1 1 auto; min-width: 0; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.ans-row .form-check { white-space: nowrap; }
@media (max-width: 575.98px) { .ans-row { flex-wrap: wrap; } .ans-row .form-control { flex-basis: 100%; } }
.note-count { font-size: 0.82rem; color: var(--pw-muted); min-width: 4.5rem; text-align: right; }
.note-count.is-bad { color: var(--pw-no); font-weight: 700; }
.ans .form-check { margin: 0; }
.ans-buyer { margin-top: 0.5rem; padding-left: 0.75rem; border-left: 3px solid var(--pw-line); }
.ans-buyer .form-control-sm { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.ans-buyer .form-label { font-size: 0.85rem; color: var(--pw-muted); margin: 0; font-weight: 400; }
.section-label { font-family: var(--pw-font-head); font-weight: 700; font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }

/* Compare */
.compare-wrap { overflow-x: auto; margin: 1rem -0.25rem 0; padding: 0 0.25rem; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.93rem; }
.compare th, .compare td { padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--pw-line-soft); vertical-align: top; text-align: left; }
.compare thead th { position: sticky; top: 0; background: var(--pw-surface); font-family: var(--pw-font-head); font-size: 1rem; border-bottom: 2px solid var(--pw-ink); min-width: 9.5rem; }
.compare thead th:first-child { min-width: 13rem; }
.compare tbody th { font-weight: 400; }
.compare tbody th .prio { margin-bottom: 0.3rem; }
.compare .cell-status { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.compare .cell-note { color: var(--pw-ink-2); font-size: 0.86rem; margin-top: 0.2rem; }
.compare .cell-flags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.flag { font-size: 0.75rem; border-radius: 99px; padding: 0.05rem 0.45rem; border: 1px solid var(--pw-line); color: var(--pw-ink-2); white-space: nowrap; }
.flag-extra { border-color: var(--pw-partial); color: #8a5a12; }
.flag-seen { border-color: var(--pw-yes); color: var(--pw-yes); }
.compare .score-row th, .compare .score-row td { background: var(--pw-paper); border-bottom: 1px solid var(--pw-line); }
.compare .score { font-family: var(--pw-font-head); font-weight: 700; font-size: 1.7rem; line-height: 1; }
.compare .score-warn { display: block; color: var(--pw-no); font-weight: 700; font-size: 0.8rem; margin-top: 0.35rem; }
.compare .group-row th { background: transparent; font-family: var(--pw-font-head); font-weight: 700; font-size: 0.95rem; padding-top: 1.1rem; border-bottom: 1px solid var(--pw-line); }
.compare .st-none { color: var(--pw-muted); font-weight: 400; }
.compare-swipe { display: none; margin: .75rem 0 0; }
/* Phones: a table with a checklist column plus a column per option doesn't fit, and the options past the first
   were hidden off to the right. Each checklist item gets its own full-width line, with the options side by side
   under it. Up to three options fit the screen (6rem each); more scroll sideways. */
@media (max-width: 639.98px) {
  .compare-wrap { margin-left: 0; margin-right: 0; padding: 0; }
  .compare-swipe { display: block; }
  .compare, .compare thead, .compare tbody { display: block; }
  .compare { width: 100%; }
  .compare thead, .compare tbody { min-width: calc(var(--n, 3) * 6rem); }
  .compare tr { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
  .compare tbody th[scope="row"], .compare .group-row th { grid-column: 1 / -1; border-bottom: 0; padding-bottom: .15rem; }
  .compare tbody th[scope="row"] { font-weight: 700; padding-top: .8rem; }
  .compare .group-row th { border-bottom: 1px solid var(--pw-line); padding-bottom: .4rem; }
  .compare thead th:first-child { display: none; }
  .compare thead th { position: static; min-width: 0; font-size: .92rem; }
  .compare th, .compare td { padding-left: .45rem; padding-right: .45rem; }
  .compare .score-row th { border-bottom: 0; }
  .compare .score { font-size: 1.4rem; }
}
.legend-inline { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.88rem; color: var(--pw-ink-2); margin-top: 0.9rem; }
.legend-inline span { display: inline-flex; align-items: center; gap: 0.35rem; }
.advice { margin-top: 1.25rem; padding: 1.1rem 1.25rem; border: 1.5px solid var(--pw-ink); border-radius: var(--pw-radius-sm); background: var(--pw-surface); }
.advice ol { margin: 0.6rem 0 0; padding-left: 1.3rem; }
.advice li + li { margin-top: 0.6rem; }
.advice .check { color: var(--pw-ink-2); font-size: 0.92rem; margin-top: 0.3rem; }
.advice .check ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.advice .check li + li { margin-top: 0.15rem; }

/* Help panel */
.help { position: sticky; top: 1.25rem; }
@media (max-width: 991.98px) { .help { position: static; margin-top: 1rem; } }
.help-card { padding: 1.25rem 1.25rem 1rem; }
.help-card h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }
.help-list { list-style: none; padding: 0; margin: 0; }
.help-list li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0 0.6rem; padding: 0.6rem 0.5rem; border-radius: var(--pw-radius-sm); }
.help-list li + li { margin-top: 0.1rem; }
.help-list .n { grid-row: span 2; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-family: var(--pw-font-head); font-weight: 700; font-size: 0.85rem; border: 1.5px solid var(--pw-line); color: var(--pw-muted); }
.help-list b { font-size: 0.98rem; }
.help-list span { color: var(--pw-ink-2); font-size: 0.9rem; }
.help-list li.is-on { background: var(--pw-paper); }
.help-list li.is-on .n { background: var(--pw-ink); border-color: var(--pw-ink); color: #fff; }
.help-list .or { grid-column: 2; font-size: 0.82rem; color: var(--pw-muted); }
.help-privacy { margin-top: 0.75rem; padding-top: 0.9rem; border-top: 1px solid var(--pw-line); font-size: 0.86rem; color: var(--pw-ink-2); }
.help-privacy p { margin: 0 0 0.4rem; display: flex; gap: 0.5rem; }
.help-privacy .bi { color: var(--pw-muted); }
.demo-note { font-size: 0.84rem; color: var(--pw-muted); border: 1px dashed var(--pw-line); border-radius: var(--pw-radius-sm); padding: 0.6rem 0.75rem; margin-top: 0.75rem; }

/* Toast */
.pw-toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 1rem); background: var(--pw-ink); color: #fff; padding: 0.6rem 1rem; border-radius: var(--pw-radius-sm); font-size: 0.93rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 1080; max-width: calc(100% - 2rem); }
.pw-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Vendor form page */
.vform-intro { max-width: 60ch; }
.vform-card { padding: 0.5rem 1.25rem 1.25rem; }
.vform-submit { position: sticky; bottom: 0; background: var(--pw-surface); border-top: 1px solid var(--pw-line); padding: 0.9rem 0; margin-top: 1.5rem; z-index: 5; }
.vform-progress { color: var(--pw-ink-2); font-size: 0.93rem; }

/* Step 1: what the two ways to build a checklist do */
.choice-help { list-style: none; padding: 0; margin: .75rem 0 0; color: var(--pw-ink-2); max-width: 46rem; }
.choice-help li + li { margin-top: .3rem; }

/* Quick start page (app.html?start=emr) */
#turnstile-box.is-inline { position: static; transform: none; margin: .25rem 0 .35rem; min-height: 65px; }
.quick-note { display: flex; gap: .5rem; align-items: flex-start; }
.quick-items { list-style: none; padding: 0; margin: 0; }
.quick-items li { padding: .5rem 0; border-top: 1px solid var(--pw-line-soft); }
.quick-items li b { display: block; }
.quick-items li span { color: var(--pw-ink-2); font-size: .92rem; }
.quick-done .btn { margin-right: .5rem; }
.quick-check { padding: 1rem 1.1rem; }

/* Required fields */
.req { color: #b42318; font-weight: 700; margin-left: .15rem; }
.req-note { color: var(--pw-ink-2); }
