/* questionnaire.css -- Wren Console Training / Ingestion Questionnaire Engine
   v=20260618k
   Full-page overlay, night palette, League Spartan / Arimo, mobile-first.
   Adds: .qz-html-wrap / .qz-html-bar / .qz-html-frame for self-contained HTML trainings.
*/

/* ---- Training cards in the main console ---- */
.qz-training-section { margin-top: 6px; }

.qz-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.qz-card:hover { border-color: var(--accentDeep); transform: translateY(-1px); }

.qz-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.qz-card-meta { display: flex; align-items: center; gap: 5px; }
.qz-entity-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.qz-entity-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.qz-card-status { margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--panel2); }
.qz-status-new { color: var(--faint); }
.qz-status-progress { color: var(--warm); background: color-mix(in srgb, var(--warm) 12%, var(--panel2)); }
.qz-status-done { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel2)); }

.qz-card-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 2px;
}
.qz-card-sub { font-size: 12.5px; color: var(--dim); margin-bottom: 8px; }

.qz-progress-bar {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin-top: 6px;
  overflow: hidden;
}
.qz-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width .3s ease;
}

/* ---- Full-page panel ---- */
.qz-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .25s ease, transform .25s ease;
}
.qz-panel.qz-panel-open {
  opacity: 1;
  transform: translateY(0);
}
.qz-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Panel header ---- */
.qz-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.qz-header-titles { flex: 1; min-width: 0; }
.qz-header-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qz-header-sub { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.qz-progress-wrap { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 80px; }
.qz-progress-label { font-size: 10.5px; color: var(--faint); font-weight: 600; letter-spacing: .03em; }
.qz-close { flex: none; padding: 6px 12px; }

/* ---- Scrollable body ---- */
.qz-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 80px;
  -webkit-overflow-scrolling: touch;
}

.qz-intro {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 14px;
  color: var(--dim);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ---- Sections ---- */
.qz-section { margin-bottom: 30px; }
.qz-section-title {
  font-family: 'League Spartan', sans-serif;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qz-section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.qz-section-intro { font-size: 13px; color: var(--faint); margin-bottom: 14px; line-height: 1.45; }

/* ---- Individual question card ---- */
.qz-question {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 12px;
  margin-bottom: 12px;
  transition: border-color .15s;
}
.qz-question.qz-q-answered { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

.qz-q-prompt {
  font-family: 'League Spartan', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.35;
}
.qz-q-context {
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 12px;
  line-height: 1.45;
  font-style: italic;
}
.qz-q-body { margin-bottom: 10px; }

/* ---- Single-select options ---- */
.qz-options { display: flex; flex-direction: column; gap: 7px; }

.qz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s, transform .1s;
  width: 100%;
}
.qz-opt:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.qz-opt.qz-opt-sel {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel2));
  color: var(--ink);
  font-weight: 600;
}
.qz-opt-check { flex: none; width: 18px; color: var(--faint); font-size: 15px; margin-top: 1px; }
.qz-opt.qz-opt-sel .qz-opt-check { color: var(--accent); }
.qz-opt-label { flex: 1; line-height: 1.45; }
.qz-rec { flex: none; align-self: center; }

/* multi-select */
.qz-multi-hint { font-size: 12px; color: var(--faint); margin-bottom: 6px; }
.qz-multi-save {
  margin-top: 8px;
  background: var(--accentDeep);
  border-color: var(--accentDeep);
  color: var(--accentInk);
}

/* ---- This or That ---- */
.qz-tot-row { display: flex; flex-direction: column; gap: 10px; }
.qz-tot-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 15px;
  font-size: 14px;
  color: var(--dim);
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s, transform .1s;
  width: 100%;
  font-weight: 500;
  line-height: 1.5;
}
.qz-tot-btn:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.qz-tot-btn.qz-tot-sel {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel2));
  color: var(--ink);
  font-weight: 600;
}
.qz-tot-label {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: var(--dim);
  margin-top: 1px;
}
.qz-tot-btn.qz-tot-sel .qz-tot-label { background: var(--accent); color: var(--accentInk); }
.qz-tot-text { flex: 1; }
.qz-tot-vs { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }

/* ---- Scale ---- */
.qz-scale-wrap { padding: 4px 0; }
.qz-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 10px;
  gap: 12px;
  line-height: 1.35;
}
.qz-scale-min-label { max-width: 45%; }
.qz-scale-max-label { max-width: 45%; text-align: right; }
.qz-scale-pips { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.qz-scale-pip {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--dim);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s, transform .1s;
}
.qz-scale-pip:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.qz-scale-pip.qz-pip-sel {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--panel2));
  color: var(--ink);
}
.qz-scale-val { text-align: center; font-size: 12.5px; color: var(--faint); }
.qz-scale-val b { color: var(--ink); }

/* ---- Rank ---- */
.qz-rank-list { display: flex; flex-direction: column; gap: 7px; }
.qz-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.qz-rank-pos {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  flex: none;
}
.qz-rank-lbl { flex: 1; font-size: 14px; font-weight: 500; color: var(--ink); }
.qz-rank-btns { display: flex; gap: 4px; flex: none; }
.qz-rank-mv { padding: 4px 10px; font-size: 14px; }
.qz-rank-mv-ph { width: 36px; display: inline-block; }
.qz-rank-save { margin-top: 4px; align-self: flex-start; background: var(--accentDeep); border-color: var(--accentDeep); color: var(--accentInk); }

/* ---- Note row ---- */
.qz-note-row { margin-top: 6px; }
.qz-note-toggle { color: var(--faint); font-size: 12px; padding: 4px 9px; }
.qz-note-field { margin-top: 6px; }
.qz-note-input {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  font: 13.5px/1.45 'Arimo', Arial, sans-serif;
  resize: vertical;
  min-height: 52px;
}
.qz-note-input:focus { outline: none; border-color: var(--accent); }
.qz-note-input::placeholder { color: var(--faint); }

/* ---- Submit zone ---- */
.qz-submit-zone { margin-top: 24px; padding: 18px 0 8px; border-top: 1px solid var(--line); text-align: center; }
.qz-submit-btn { padding: 13px 28px; font-size: 15px; border-radius: 12px; }
.qz-submit-hint { font-size: 14px; color: var(--faint); }

/* ---- Done screen ---- */
.qz-done { text-align: center; padding: 48px 20px 32px; }
.qz-done-mark {
  display: inline-block;
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel2));
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.qz-done-title { font-family: 'League Spartan', sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); margin-bottom: 12px; }
.qz-done-body { font-size: 14.5px; color: var(--dim); line-height: 1.55; max-width: 400px; margin: 0 auto 24px; }

/* ---- Loading state ---- */
.qz-loading { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 15px; }

/* ---- Unknown type ---- */
.qz-unknown { color: var(--warm); font-size: 13px; padding: 8px; }

/* ---- HTML training panel (iframe-based) ---- */
.qz-html-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
.qz-html-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.qz-html-bar-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.qz-html-frame {
  flex: 1;
  border: none;
  width: 100%;
  background: var(--bg);
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .qz-header { padding: 12px 14px; gap: 8px; }
  .qz-header-title { font-size: 14px; }
  .qz-body { padding: 16px 12px 80px; }
  .qz-progress-wrap { min-width: 60px; }
  .qz-scale-pip { width: 38px; height: 38px; font-size: 15px; }
  .qz-tot-btn { padding: 12px 12px; }
  .qz-question { padding: 14px 13px 10px; }
  .qz-submit-btn { padding: 12px 22px; font-size: 14px; width: 100%; }
}
