/* =========================================================================
   qa — live Q&A + polls per session (BRIEF §14 Batch A).
   Owns every .qa-* class. Colour comes from the shell tokens in css/app.css,
   so light and dark both follow the theme switch with no second palette here.
   ========================================================================= */

.qa-back { display: inline-block; margin-bottom: var(--s-3); }

.qa-section { margin-top: var(--s-6); }

.qa-h3 {
  margin: 0 0 var(--s-3);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
}

.qa-note {
  margin: var(--s-2) 0 0;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--muted);
}

.qa-day {
  margin: var(--s-4) 0 var(--s-2);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.qa-ico { flex: 0 0 auto; }

/* ------------------------------------------------------------------- pills */

.qa-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}

.qa-pill-live {
  background: color-mix(in srgb, var(--success) 18%, var(--surface));
  color: var(--success);
}

.qa-pill-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: qa-pulse 1.8s ease-in-out infinite;
}

.qa-pill-soon { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.qa-pill-past { background: var(--surface-2); color: var(--muted); }
.qa-pill-mod { background: var(--blue-soft); color: var(--accent); }

@keyframes qa-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
  .qa-pill-live::before { animation: none; }
}

/* -------------------------------------------------------------- hub header */

.qa-intro { margin-bottom: var(--s-4); }

.qa-focus {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue-soft) 70%, var(--surface)), var(--surface));
}

.qa-focus-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}

.qa-focus-kicker {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.qa-focus-title { margin: 0; font-size: 1.05rem; color: var(--ink); }

.qa-focus-when,
.qa-card-when,
.qa-when {
  margin: var(--s-1) 0 var(--s-3);
  font-size: .84rem;
  color: var(--muted);
}

.qa-focus .btn-row { margin-top: var(--s-3); }

/* --------------------------------------------------------------- hub cards */

.qa-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .qa-grid { grid-template-columns: 1fr 1fr; }
}

.qa-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.qa-card:hover { border-color: var(--line-strong); }
.qa-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.qa-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-2);
}

.qa-card-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.35;
}

.qa-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.qa-stat {
  font-size: .76rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 3px 9px;
}

.qa-stat-open { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.qa-stat-live { color: var(--success); background: color-mix(in srgb, var(--success) 14%, var(--surface)); }

/* ------------------------------------------------------------ board header */

.qa-head { margin-bottom: var(--s-3); }

.qa-title { margin: 0; font-size: 1.15rem; color: var(--ink); }

.qa-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.qa-tabs { margin-bottom: var(--s-4); }

/* app.css pins .segment.active to var(--navy), which does not move in the dark
   palette — near-black text on a dark card. Scoped fix for this module's tabs;
   the same rule would help every .segmented in the app (noted for the shell). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .qa-tabs .segment.active { color: #cfe0ff; }
}

:root[data-theme="dark"] .qa-tabs .segment.active { color: #cfe0ff; }

.qa-seg-count {
  margin-left: 6px;
  font-size: .72rem;
  font-weight: 700;
  opacity: .7;
}

/* ---------------------------------------------------------------- composer */

.qa-composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-3);
  box-shadow: var(--sh-1);
  margin-bottom: var(--s-3);
}

.qa-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 48px;
}

/* The ring moves to the whole composer card, so removing the field's own
   outline never leaves a keyboard user without a focus indicator. */
.qa-input:focus { outline: none; }

.qa-composer:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 28%, transparent);
}
.qa-input::placeholder { color: var(--muted); }

.qa-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}

.qa-count { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.qa-sorts { margin-bottom: var(--s-3); }

/* --------------------------------------------------------------- questions */

.qa-list { display: grid; gap: var(--s-3); }

.qa-q {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}

.qa-q.is-answered { opacity: .82; }

.qa-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  padding: var(--s-2) var(--s-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  align-self: start;
}

.qa-vote:hover { border-color: var(--accent); color: var(--accent); }
.qa-vote:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.qa-vote.voted {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.qa-vote-caret { font-size: .7rem; line-height: 1; }
.qa-vote-count { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.qa-q-body { min-width: 0; }

.qa-q-text {
  margin: 0 0 var(--s-2);
  font-size: .95rem;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.qa-q-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--muted);
}

.qa-q-name { font-weight: 600; color: var(--ink-2); }
.qa-q-company::before,
.qa-q-time::before { content: '· '; }

.qa-q-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s-2);
}

.qa-tag {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
}

.qa-tag-ok { background: color-mix(in srgb, var(--success) 16%, var(--surface)); color: var(--success); }
.qa-tag-pin { background: color-mix(in srgb, var(--orange) 20%, var(--surface)); color: var(--warn); }

.qa-q-answered {
  margin: var(--s-2) 0 0;
  font-size: .78rem;
  color: var(--success);
}

.qa-q-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px dashed var(--line);
}

.qa-q-tools .qa-danger { color: var(--danger); }

/* -------------------------------------------------------------- my questions */

.qa-mine {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.qa-mine:hover { border-color: var(--line-strong); }
.qa-mine:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.qa-mine-text {
  display: block;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.qa-mine-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  font-size: .76rem;
  color: var(--muted);
}

.qa-mine-votes { font-weight: 700; color: var(--ink-2); }

/* ------------------------------------------------------------------- polls */

.qa-polls { display: grid; gap: var(--s-4); }

.qa-poll-admin { margin-bottom: var(--s-1); }

.qa-poll-q {
  margin: 0 0 var(--s-3);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.qa-poll-options { display: grid; gap: var(--s-2); }

.qa-choice {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.qa-choice:hover { border-color: var(--accent); background: var(--blue-soft); }
.qa-choice:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.qa-choice-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.qa-choice:hover .qa-choice-dot { border-color: var(--accent); }

.qa-bar {
  position: relative;
  display: block;
  overflow: hidden;
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.qa-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  transition: width .45s ease;
}

.qa-bar.picked { border-color: var(--accent); }
.qa-bar.picked .qa-bar-fill { background: color-mix(in srgb, var(--accent) 52%, transparent); }

.qa-bar-text {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: .88rem;
  color: var(--ink);
}

.qa-bar-label { font-weight: 600; overflow-wrap: anywhere; }
.qa-bar-num { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .qa-bar-fill { transition: none; }
}

.qa-poll-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  font-size: .78rem;
  color: var(--muted);
}

.qa-poll-total { font-weight: 600; }
.qa-poll-mine { color: var(--success); font-weight: 700; }

.qa-open-poll { margin-bottom: var(--s-3); }

.qa-open-poll-session {
  margin: 0 0 var(--s-1);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------- new-poll sheet */

.qa-new .field { margin-bottom: var(--s-3); }
.qa-new-options { display: grid; gap: var(--s-2); }

/* ------------------------------------------------------------ session sheet */

.qa-sheet .qa-head { margin-top: var(--s-1); }
.qa-sheet-full { margin-top: var(--s-4); }

.qa-entry .btn {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.qa-entry-label { font-weight: 700; }
.qa-entry-count { font-size: .78rem; opacity: .75; }

/* -------------------------------------------------------- presenter view */

.qa-stage {
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--sh-2);
}

.qa-stage-head { margin-bottom: var(--s-4); }

.qa-stage-kicker {
  margin: 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9fc0ef;
}

.qa-stage-title {
  margin: var(--s-1) 0 0;
  font-size: clamp(1.3rem, 3.2vw, 2.1rem);
  line-height: 1.2;
  color: #fff;
}

.qa-stage-when { margin: var(--s-2) 0 0; color: #c6d6ef; font-size: .9rem; }

.qa-stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}

.qa-stage-q {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .08);
}

.qa-stage-votes {
  min-width: 46px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffd9a8;
}

.qa-stage-body { display: grid; gap: 6px; min-width: 0; }

.qa-stage-text {
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.qa-stage-who { font-size: .82rem; color: #c6d6ef; }

.qa-stage-body .btn.ghost {
  justify-self: start;
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
}

.qa-stage-empty { color: #c6d6ef; font-size: 1rem; margin: 0; }

.qa-stage-poll {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(255, 255, 255, .22);
  display: grid;
  gap: var(--s-2);
}

.qa-stage-poll-q {
  margin: 0 0 var(--s-2);
  font-size: clamp(1rem, 2.1vw, 1.3rem);
  font-weight: 700;
}

.qa-stage-poll .qa-bar {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
}

.qa-stage-poll .qa-bar-fill { background: rgba(159, 192, 239, .45); }
.qa-stage-poll .qa-bar-text { color: #fff; }

.qa-bar-lg { padding: var(--s-4) var(--s-3); }

.qa-stage-poll-total { margin: var(--s-2) 0 0; color: #c6d6ef; font-size: .85rem; }

/* The presenter view is meant for a room screen: give it the full width the
   shell allows and drop the card chrome around it on a big display. */
@media (min-width: 900px) {
  .qa-stage { padding: var(--s-7); }
}
