/* Quick mode (js/quick/): the three plain steps, the fast question list, the ＋ New dialog and the ⚙️ Advanced switch. */

/* ---------- Top bar ---------- */
.tb.adv-sw {
  cursor: pointer;
  user-select: none;
}
.tb.adv-sw input {
  appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.3);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s;
}
.tb.adv-sw input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.tb.adv-sw input:checked {
  background: var(--orange);
}
.tb.adv-sw input:checked::after {
  transform: translateX(14px);
}
.tb.adv-sw input:focus-visible {
  outline: 3px solid #ffc83d;
  outline-offset: 2px;
}
/* Quick mode keeps the top bar short: version history lives in ⚙️ Advanced. */
body.quick #historyBtn {
  display: none;
}

/* ---------- Shared pieces ---------- */
.btn.big {
  height: 50px;
  padding: 0 24px;
  font-size: 17px;
  border-radius: 14px;
}
.big-in {
  width: 100%;
  height: 48px;
  font-size: 18px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  background: #fff;
}
.big-in:focus,
.quick-add textarea:focus,
.quick-add input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 61, 0.18);
}
.q-label {
  display: block;
  font-weight: 800;
  color: var(--navy);
  margin: 14px 0 6px;
}
.q-label:first-of-type {
  margin-top: 4px;
}
.card .num-in,
.num-in {
  width: 90px;
  flex: 0 0 auto;
  height: 42px;
  font-size: 17px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
}
.lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.lang-chips .chip {
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--soft);
  border: 2px solid var(--line);
  font-weight: 800;
}
.lang-chips .chip small {
  color: var(--muted);
  font-weight: 700;
}
.quick-next {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 30px;
}
.quick-back {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #fff1e8;
  border: 2px solid #ffd2bb;
}
.quick-back .small {
  flex: 1;
}

/* ---------- Start: choices as cards ---------- */
.new-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.new-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  text-align: start;
  background: var(--soft);
  border: 2px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
button.new-card:hover,
button.new-card:focus-visible {
  border-color: var(--orange);
  background: #fff8f3;
  outline: none;
}
.new-card .ic {
  font-size: 28px;
}
.new-card b {
  font-size: 17px;
  color: var(--navy);
}
.new-card > span:not(.ic) {
  font-size: 14px;
  color: var(--muted);
}
.new-card.now {
  cursor: default;
  background: #fff;
}
.new-card.now .btn {
  margin-top: auto;
}
.new-dialog {
  width: 760px;
  max-width: 94vw;
}
.new-dialog .new-cards {
  margin-top: 12px;
}

/* ---------- Questions: add row ---------- */
.quick-add textarea,
.quick-add input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.quick-add textarea {
  margin-top: 12px;
  resize: vertical;
  min-height: 58px;
}
.qa-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  margin-top: 10px;
}
.qa-row .btn {
  height: 48px;
}
.qa-guess {
  min-height: 20px;
  margin-top: 8px;
  color: var(--teal);
  font-weight: 700;
}

/* ---------- Questions: the list ---------- */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.bulk-bar.on {
  background: #eef8f7;
  border: 2px solid #bfe6e2;
  position: sticky;
  top: 0;
  z-index: 3;
}
.bulk-bar select {
  width: auto;
  height: 34px;
  border-radius: 10px;
  border: 2px solid var(--line);
  font: inherit;
  font-weight: 700;
  padding: 0 8px;
}
.tick-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy);
}
.qrows input[type='checkbox'],
.tick-all input {
  width: 20px;
  height: 20px;
  accent-color: var(--orange);
  flex: 0 0 auto;
}
.guess-note {
  background: #fff8e6;
  border: 2px solid #f6dfa4;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.qrows {
  list-style: none;
  counter-reset: q;
}
.qrow {
  counter-increment: q;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 8px;
  border-bottom: 1px solid var(--line);
  border-inline-start: 4px solid transparent;
}
.qrow.err {
  border-inline-start-color: var(--red);
}
.qrow.warn {
  border-inline-start-color: var(--amber);
}
.qrow-main {
  cursor: pointer;
  min-width: 0;
}
.qrow-main:hover .qrow-q {
  color: var(--orange-d);
}
.qrow-q::before {
  content: counter(q) '. ';
  color: var(--muted);
}
.qrow-q {
  font-weight: 800;
  color: var(--navy);
  font-size: 16px;
  overflow-wrap: anywhere;
}
.qrow-a {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.qrow-issue {
  font-size: 13px;
  font-weight: 700;
  margin-top: 3px;
}
.qrow-issue.err {
  color: var(--red);
}
.qrow-issue.warn {
  color: var(--amber);
}
.qrow-type {
  display: flex;
  align-items: center;
  gap: 6px;
}
.type-sel {
  height: 34px;
  max-width: 230px;
  border-radius: 10px;
  border: 2px solid var(--line);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0 6px;
  background: #fff;
}
.qrow-type .guess {
  font-size: 12px;
  font-weight: 800;
  color: #8a5a00;
  background: #ffe7a8;
  border-radius: 99px;
  padding: 2px 8px;
}

/* ---------- Try & publish ---------- */
.publish-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
}
.publish-step .pnum {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  font-size: 19px;
  display: grid;
  place-items: center;
}
.publish-step h3 {
  margin: 6px 0 4px;
}
.publish-step .btn.big {
  margin-top: 10px;
}
.publish-step .issues {
  margin-top: 10px;
}
.pub-choices {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}
.pub-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
}
.pub-choice.wide {
  padding: 0;
  border: none;
}
.pub-choice.wide .card {
  margin: 0;
  width: 100%;
}

/* ---------- Narrow windows ---------- */
@media (max-width: 760px) {
  .qa-row {
    grid-template-columns: 1fr;
  }
  .qrow {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .qrow-type,
  .qrow > .btn {
    grid-column: 2;
  }
}
