/* Card kit (public/js/lib/deck.js): one decision or one discussion per card. A card says the plain question, why it
   matters in one line and the trade-off in one line; everything else waits behind "More about this". The cards of a
   category share a live readout. Selectors are prefixed .deck-; hosts add their own (.evaluate-…) for what is specific.
   Colour follows CLAUDE.md principle 1: teal is on plan, amber a caution, salmon a real problem; selection is ink on a soft tint. */

/* ---------- stepper over the categories ---------- */
.deck-steps { margin: 0 0 8px; }
.deck-steps ol { list-style: none; margin: 0; padding: 4px; display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; overflow-x: auto; scrollbar-width: thin; }
.deck-step { flex: 1 1 auto; min-width: min-content; }
/* positioned, so the visually hidden text inside stays in the stepper (and never widens the page) */
.deck-step-btn { position: relative; width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; background: none; border: 0; border-radius: 10px; padding: 5px 12px 5px 6px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold); white-space: nowrap; }
.deck-step-btn:hover { background: var(--band); }
.deck-step-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--fw-bold); font-size: var(--fs-xs); background: var(--band-2); color: var(--ink); }
.deck-step.is-done .deck-step-dot { background: var(--teal-soft); color: var(--teal-deep); }
.deck-step.is-default .deck-step-dot { background: #fff; box-shadow: inset 0 0 0 2px var(--teal-ui); color: var(--teal-deep); }
.deck-step.is-optional:not(.is-current) .deck-step-dot { background: none; box-shadow: none; border: 1.5px dashed var(--border-strong); color: var(--muted); }
.deck-step.is-charter:not(.is-current) .deck-step-dot { background: var(--tint); box-shadow: none; color: var(--ink); }
.deck-step.is-current .deck-step-btn { background: var(--tint); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
/* A card that is not open yet (Assess: the team answer waits for your six answers, the result for the lock). */
.deck-step.is-locked .deck-step-btn { cursor: not-allowed; color: var(--muted); }
.deck-step.is-locked .deck-step-btn:hover { background: none; }
.deck-step.is-locked .deck-step-dot { background: var(--band); box-shadow: inset 0 0 0 1.5px var(--border); color: var(--muted); }
.deck-step.is-current .deck-step-dot { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); border: 0; color: var(--ink); }

/* ---------- the card ---------- */
.deck-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 12px 18px 10px; animation: rise .35s var(--ease) both; }
.deck-head { margin-bottom: 8px; }
.deck-kicker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-on-tint); }
.deck-kicker .deck-roles { letter-spacing: 0; text-transform: none; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.deck-icon { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--band-2); color: var(--ink); }
/* Where this card is inside its category: done, default (the board's default applies) or open. */
.deck-dots { display: inline-flex; gap: 5px; align-items: center; margin-left: 2px; }
.deck-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--band-2); box-shadow: inset 0 0 0 1.5px var(--border); }
.deck-dots i.is-done { background: var(--teal-ui); box-shadow: none; }
.deck-dots i.is-default { background: #fff; box-shadow: inset 0 0 0 2px var(--teal-ui); }
.deck-dots i.is-current { width: 20px; border-radius: 999px; background: var(--ink); box-shadow: none; }
.deck-q { margin: 4px 0 0; font-size: clamp(var(--fs-lg), 1.5vw, 20px); line-height: 1.25; letter-spacing: -.01em; color: var(--ink); font-weight: var(--fw-heavy); }
.deck-q:focus { outline: none; }
.deck-q:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.deck-why { margin: 4px 0 0; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.45; }
.deck-trade { margin: 8px 0 0; display: flex; gap: 8px; align-items: flex-start; padding: 7px 12px; border-radius: 10px; background: var(--band); color: var(--ink); font-size: var(--fs-sm); line-height: 1.4; max-width: 100%; }
.deck-trade svg { flex: none; margin-top: 1px; color: var(--steel); }
.deck-trade b { color: var(--ink); font-weight: var(--fw-bold); margin-right: 4px; }
.deck-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* One click opens the depth, in place; nothing opens on its own. */
.deck-more { margin-top: 4px; }
.deck-more-slot { display: contents; }
.deck-more-panel { margin-bottom: 4px; }
.deck-more-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 2px; cursor: pointer; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--link); }
.deck-more-btn:hover { color: var(--link-hover); text-decoration: underline; }
.deck-more-panel { margin-top: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface); display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; animation: rise .25s var(--ease) both; }
.deck-more-panel h4 { margin: 0; font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.deck-more-panel p { margin: 0; }
.deck-more-panel ul { margin: 0; padding-left: 18px; }

/* ---------- the live readout of a category ---------- */
.deck-readout { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--band); display: flex; flex-direction: column; gap: 6px; }
.deck-readout-row { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; }
.deck-readout-k { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--muted-on-tint); }
.deck-live { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-ui); animation: deckPulse 2.2s ease-in-out infinite; }
@keyframes deckPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 168, 140, .45); } 50% { box-shadow: 0 0 0 5px rgba(0, 168, 140, 0); } }
@media (prefers-reduced-motion: reduce) { .deck-live { animation: none; } }
.deck-ro { display: inline-flex; gap: 6px; align-items: baseline; font-size: var(--fs-sm); color: var(--ink-2); }
.deck-ro-l { color: var(--muted-on-tint); }
.deck-ro-v { color: var(--ink); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.deck-ro.is-warn .deck-ro-v { color: var(--amber-ink); }
.deck-ro.is-bad .deck-ro-v { color: var(--salmon-ink); }
.deck-ro.is-good .deck-ro-v { color: var(--teal-deep); }
.deck-ro-note { margin-left: 2px; font-size: var(--fs-xs); font-weight: 400; color: var(--muted-on-tint); }

/* ---------- back and next ---------- */
.deck-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.deck-foot .deck-more-btn { margin-left: 4px; }
/* The dock: the readout and the buttons stay at the bottom of the window (above the ready bar) while a tall card scrolls. */
.deck-dock { background: var(--surface); margin: 0 -18px -10px; padding: 0 18px 10px; border-radius: 0 0 var(--radius) var(--radius); }
@media (min-width: 720px) { .deck-dock { position: sticky; bottom: var(--readybar-h, 70px); z-index: 5; } .deck-card.has-more-open .deck-dock { position: static; } }
/* Everything on one page: a card's own actions (Confirm, Lock) close the card where it is, not at the bottom of the window. */
.pdeck-all .deck-dock { position: static; }
.deck-foot .btn-primary { min-height: 44px; }

/* ---------- the choices ---------- */
.deck-opts { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.deck-opts.is-2 { --cols: 2; }
.deck-opts.is-3 { --cols: 3; }
.deck-opts.is-4 { --cols: 4; }
@media (max-width: 1100px) { .deck-opts.is-4 { --cols: 2; } }
@media (max-width: 760px) { .deck-opts, .deck-opts.is-2, .deck-opts.is-3, .deck-opts.is-4 { --cols: 1; } }
.deck-opt { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; background: #fff; border: 1.5px solid var(--hairline); border-radius: 14px; padding: 10px 12px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: var(--fs-sm); line-height: 1.35; transition: border-color .2s, box-shadow .2s, background .2s; }
.deck-opt:hover:not([disabled]) { border-color: var(--border-strong); }
.deck-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.deck-opt.is-selected { border: 2px solid var(--ink); padding: 9.5px 11.5px; background: var(--tint); }
.deck-opt[disabled] { cursor: default; }
/* After the lock: the chosen option in full colour, the others outline-only, never faded. */
.deck-opt.readonly-choice.is-chosen .deck-opt-name { color: var(--ink); }
.deck-opt-head { display: flex; gap: 8px; align-items: center; min-width: 0; }
.deck-opt-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; color: #fff; }
.is-selected > .deck-opt-head > .deck-opt-mark { background: var(--ink); border-color: var(--ink); }
.deck-opt-name { font-weight: var(--fw-bold); color: var(--ink); font-size: var(--fs-md); line-height: 1.25; min-width: 0; }
.deck-opt-sub { font-size: var(--fs-xs); font-weight: var(--fw-strong); color: var(--muted); }
.deck-opt-line { color: var(--ink-2); }
.deck-opt-tag { margin-left: auto; align-self: flex-start; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--muted); background: var(--band); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.deck-opt.is-selected .deck-opt-tag { background: #fff; color: var(--ink); }
.deck-opt-meta { margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--hairline); display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-xs); color: var(--ink); }
.deck-opt-meta svg { flex: none; color: var(--steel); margin-top: 1px; }

/* A line under the choices: what is set now, and what a click does. */
.deck-note { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-2); }
.deck-note b { color: var(--ink); }

/* Value streams as chips: click one to set it differently; the dot shows its level or option. */
.deck-chips-head { display: flex; gap: 8px 14px; align-items: baseline; flex-wrap: wrap; }
.deck-chips-k { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.deck-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-chip { display: inline-flex; gap: 7px; align-items: center; min-height: 32px; border: 1.5px solid var(--hairline); background: #fff; border-radius: 999px; padding: 3px 12px 3px 8px; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-strong); color: var(--ink); cursor: pointer; }
.deck-chip:hover:not([disabled]) { border-color: var(--border-strong); }
.deck-chip[disabled] { cursor: default; }
.deck-chip.is-unset { border-style: dashed; }
.deck-chip.is-selected { border-color: var(--ink); background: var(--tint); }
.deck-chip i { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--band-2); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.deck-chip i.is-l1, .deck-chip i.is-automate { background: #9FB4C4; box-shadow: none; }
.deck-chip i.is-l2 { background: #7FD8C6; box-shadow: none; }
.deck-chip i.is-l3, .deck-chip i.is-gated { background: var(--teal-ui); box-shadow: none; }
.deck-chip i.is-autonomous { background: var(--amber-ui); box-shadow: none; }
.deck-chip i.is-own { background: var(--ink); box-shadow: none; }
/* The row that opens under the chips for the one value stream picked. */
.deck-edit { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--band); min-height: 50px; }
.deck-edit-k { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink); }
.deck-edit.is-hint { color: var(--muted); font-size: var(--fs-sm); }
.deck-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--band); flex-wrap: wrap; }
.deck-seg button { border: 0; background: none; min-height: 32px; padding: 0 12px; font: inherit; font-weight: var(--fw-bold); font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.deck-seg button + button { border-left: 1px solid var(--hairline); }
.deck-seg button:hover:not([disabled]) { background: var(--band-2); color: var(--ink); }
.deck-seg button.is-active { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: 9px; }
.deck-seg button[disabled] { cursor: default; }

/* ---------- short windows ---------- */
/* A laptop with the browser's own bars leaves 650–800 px: the same cards, tighter, so the choices and the dock still fit. */
@media (min-width: 720px) and (max-height: 820px) {
  .deck-steps { margin-bottom: 6px; }
  .deck-step-btn { min-height: 32px; }
  .deck-card { padding: 10px 16px 8px; }
  .deck-dock { margin: 0 -16px -8px; padding: 0 16px 8px; }
  .deck-head { margin-bottom: 6px; }
  .deck-q { margin-top: 2px; }
  .deck-why { margin-top: 2px; line-height: 1.35; }
  .deck-trade { margin-top: 6px; padding: 5px 10px; }
  .deck-body { gap: 6px; }
  .deck-opts { gap: 8px; }
  .deck-opt { padding: 8px 10px; gap: 3px; }
  .deck-opt.is-selected { padding: 7.5px 9.5px; }
  .deck-readout { margin-top: 6px; padding: 6px 12px; gap: 4px; }
  .deck-foot { margin-top: 6px; padding-top: 6px; }
  .deck-foot .btn-primary { min-height: 40px; }
}
/* On a phone a long "Next: …" wraps inside the button instead of pushing the page sideways. */
@media (max-width: 719px) { .deck-foot .btn-primary { max-width: 100%; white-space: normal; text-align: left; } }

/* the card the facilitator is on, and the cards they skipped for every team (v1.9.0) */
.focus-slot { display: contents; }
.focus-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--tint); border: 1px solid var(--border); border-left: 3px solid var(--ink); color: var(--ink); font-weight: var(--fw-bold); }
.focus-banner-ic { display: inline-grid; place-items: center; color: var(--steel); }
.focus-banner-t { flex: 1 1 14rem; min-width: 0; }
.deck-step.is-skipped .deck-step-label, .build-step.is-skipped .build-step-label { text-decoration: line-through; opacity: .65; }
.deck-step.is-skipped .deck-step-dot, .build-step.is-skipped .build-step-dot { border-style: dashed; opacity: .65; }

/* ---------- a phase as cards: the Lobby, Discover and a round's results (v1.9.1, player/phase-guide.js) ---------- */
.pdeck-head { margin-bottom: 10px; }
.pdeck-head-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
.pdeck-head-t { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; min-width: 0; }
.pdeck-h1 { margin: 0; font-size: var(--fs-lg); }
.pdeck-head-r { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.pdeck-card { min-width: 0; }
.pdeck-all { display: flex; flex-direction: column; gap: 16px; }
/* What closes the last card: the line that says what the button does, beside the button. */
.pdeck-next { flex: 1 1 18rem; min-width: 0; font-size: var(--fs-sm); color: var(--ink-2); text-align: right; }
/* Short windows: the card gets the air the page kept under it (the ready bar is sticky below), and the header sits tighter. */
@media (max-height: 760px) { .pdeck-head { margin-bottom: 6px; } .pdeck-page { padding-bottom: 24px; } }
