.q34,
.q34-m {
  --q34-gold-ink: #7a5717;
  --q34-danger: #9b353b;
  --q34-pass: #1e6848;
  --q34-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --q34-surface-soft: #fbfcfe;
  --q34-danger-soft: #fdfbfb;
  --q34-danger-line: #d9c3c5;
  color: var(--ink);
  font-family: var(--font-sans);
}

.q34 {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 64px 64px 28px;
  background: var(--paper);
}

.q34 *,
.q34-m * {
  box-sizing: border-box;
}

.q34 [hidden],
.q34-m [hidden] {
  display: none !important;
}

/* head */

.q34-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.q34-heading {
  min-width: 0;
}

.q34-title {
  margin: 0;
  font-size: 40px;
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--navy);
}

.q34-sub {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
}

.q34-head-meta {
  flex: 0 0 auto;
  padding-bottom: 2px;
  text-align: right;
}

.q34-state {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.q34-tag {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--q34-gold-ink);
  white-space: nowrap;
}

/* body */

.q34-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 0 18px;
}

.q34-panel {
  width: 100%;
}

/* b0 task card */

.q34-b0 {
  max-width: 1180px;
  margin: 0 auto;
}

.q34-task {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.q34-task-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 30px 18px;
  background: var(--q34-surface-soft);
  border-bottom: 1px solid var(--line);
}

.q34-task-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q34-task-head p {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.q34-task-tag {
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
  letter-spacing: 0.02em;
  color: var(--q34-gold-ink) !important;
  white-space: nowrap;
}

.q34-task-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.q34-task-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-height: 112px;
  padding: 20px 30px;
  border-top: 1px solid var(--line);
}

.q34-task-row:first-child {
  border-top: 0;
}

.q34-task-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 44px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--paper);
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--q34-gold-ink);
}

.q34-task-main {
  min-width: 0;
}

.q34-task-line {
  margin: 0;
  font-size: 26px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--navy);
}

.q34-task-sub {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
}

/* b1 two-test comparison */

.q34-b1 {
  max-width: 1400px;
  margin: 0 auto;
}

.q34-b1-head {
  margin-bottom: 18px;
}

.q34-b1-lead {
  margin: 0;
  max-width: 1240px;
  font-size: 28px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--navy);
}

.q34-b1-sub {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
}

.q34-b1-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.q34-test-card {
  min-width: 0;
  padding: 22px 26px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.q34-test-card.is-remove {
  background: var(--q34-danger-soft);
  border-color: var(--q34-danger-line);
}

.q34-test-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.q34-test-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.q34-test-glyph {
  width: 24px;
  height: 24px;
}

.is-add .q34-test-icon {
  color: var(--q34-pass);
}

.is-remove .q34-test-icon {
  color: var(--q34-danger);
}

.q34-test-head h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q34-test-head p {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

.q34-diff {
  margin: 18px 0 0;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-color: var(--line) transparent;
  font-family: var(--q34-mono);
  font-size: 20px;
  line-height: 1.5;
  white-space: nowrap;
}

.q34-diff-line {
  display: block;
  font-variant-numeric: tabular-nums;
}

.q34-diff-line.is-add {
  color: var(--q34-pass);
}

.q34-diff-line.is-del {
  color: var(--q34-danger);
}

.q34-test-out {
  margin: 18px 0 0;
  font-size: 28px;
  line-height: 1.4;
  font-weight: 600;
}

.is-add .q34-test-out {
  color: var(--q34-pass);
}

.is-remove .q34-test-out {
  color: var(--q34-danger);
}

.q34-test-note {
  margin: 8px 0 0;
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);
}

.q34-test-tag {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.is-add .q34-test-tag {
  color: var(--q34-pass);
}

.is-remove .q34-test-tag {
  color: var(--q34-danger);
}

.q34-b1-scope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  margin: 18px 0 0;
  padding: 14px 4px 0;
  border-top: 2px solid var(--gold);
  font-size: 20px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--navy);
}

.q34-b1-scope span {
  display: inline-flex;
  align-items: center;
}

.q34-b1-scope span + span {
  margin-left: 22px;
}

.q34-b1-scope span + span::before {
  content: "";
  width: 1px;
  height: 18px;
  margin-right: 22px;
  background: var(--line);
}

/* b2 boundary loop */

.q34-b2 {
  max-width: 1400px;
  margin: 0 auto;
}

.q34-b2-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 6px;
}

.q34-b2-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q34-b2-head p {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  white-space: nowrap;
}

.q34-b2-canvas {
  width: 100%;
}

.q34-b2-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
}

.q34-b2-svg text {
  font-family: var(--font-sans);
}

.q34-node rect {
  fill: var(--white);
  stroke: var(--line);
  stroke-width: 1.5;
}

.q34-node-title {
  fill: var(--navy);
  font-size: 30px;
  font-weight: 600;
}

.q34-node-sub {
  fill: var(--muted);
  font-size: 18px;
}

.q34-loop-arrow {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.q34-loop-label {
  fill: var(--q34-gold-ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.q34-boundary {
  stroke: var(--q34-danger);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  opacity: 0.7;
}

.q34-boundary-label {
  fill: var(--q34-danger);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.q34-branch-arrow {
  fill: none;
  stroke: var(--q34-danger);
  stroke-width: 2.5;
  stroke-dasharray: 7 5;
}

.q34-branch-label {
  fill: var(--q34-danger);
  font-size: 18px;
  font-weight: 600;
}

.q34-gap-box {
  fill: var(--paper);
  stroke: var(--q34-danger);
  stroke-width: 2;
  stroke-dasharray: 7 5;
}

.q34-gap-title {
  fill: var(--navy);
  font-size: 27px;
  font-weight: 600;
}

.q34-gap-sub {
  fill: var(--q34-danger);
  font-size: 21px;
  font-weight: 600;
}

.q34-return-arrow {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.q34-return-label {
  fill: var(--muted);
  font-size: 18px;
  font-weight: 600;
}

.q34-arrow-head-gold {
  fill: var(--gold);
}

.q34-arrow-head-danger {
  fill: var(--q34-danger);
}

.q34-arrow-head-muted {
  fill: var(--muted);
}

.q34-b2-svg [data-q34-step] {
  /* RAF reveals each step; no CSS replay after instant/deeplink settlement. */
  animation: none;
}

@keyframes q34-step-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* foot */

.q34-foot {
  flex: 0 0 auto;
  min-height: 64px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 2px solid var(--gold);
  display: flex;
  align-items: center;
}

.q34-foot-text {
  margin: 0;
  font-size: 28px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--navy);
}

/* mobile document flow */

.q34-m {
  min-width: 0;
}

.q34-m .q34-head {
  display: block;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.q34-m .q34-title {
  font-size: 28px;
  line-height: 1.38;
}

.q34-m .q34-sub {
  font-size: 16px;
  line-height: 1.6;
}

.q34-m .q34-head-meta {
  margin-top: 10px;
  text-align: left;
}

.q34-m .q34-state {
  font-size: 15px;
  line-height: 1.6;
  white-space: normal;
}

.q34-m .q34-tag {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
}

.q34-m .q34-body {
  display: block;
  padding: 0;
}

.q34-m .q34-b0,
.q34-m .q34-b1,
.q34-m .q34-b2 {
  max-width: none;
  margin: 0;
}

.q34-m .q34-task {
  border-radius: 10px;
}

.q34-m .q34-task-head {
  display: block;
  padding: 16px 18px;
}

.q34-m .q34-task-head h2 {
  font-size: 20px;
  line-height: 1.5;
}

.q34-m .q34-task-head p {
  font-size: 14px;
  line-height: 1.5;
}

.q34-m .q34-task-tag {
  margin-top: 6px !important;
  font-size: 14px !important;
}

.q34-m .q34-task-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  padding: 14px 18px;
}

.q34-m .q34-task-key {
  width: auto;
  height: auto;
  padding: 4px 10px;
  font-size: 14px;
  line-height: 1.4;
}

.q34-m .q34-task-line {
  font-size: 18px;
  line-height: 1.55;
}

.q34-m .q34-task-sub {
  font-size: 15px;
  line-height: 1.6;
}

.q34-m .q34-b1-lead {
  font-size: 21px;
  line-height: 1.55;
}

.q34-m .q34-b1-sub {
  font-size: 15px;
  line-height: 1.65;
}

.q34-m .q34-b1-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.q34-m .q34-test-card {
  padding: 16px 18px 18px;
  border-radius: 10px;
}

.q34-m .q34-test-head h3 {
  font-size: 19px;
  line-height: 1.5;
}

.q34-m .q34-test-head p {
  font-size: 14px;
  line-height: 1.55;
}

.q34-m .q34-test-icon {
  width: 36px;
  height: 36px;
}

.q34-m .q34-test-glyph {
  width: 20px;
  height: 20px;
}

.q34-m .q34-diff {
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.55;
}

.q34-m .q34-test-out {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.45;
}

.q34-m .q34-test-note {
  font-size: 16px;
  line-height: 1.65;
}

.q34-m .q34-test-tag {
  margin-top: 10px;
  font-size: 14px;
}

.q34-m .q34-b1-scope {
  display: block;
  margin-top: 16px;
  padding-top: 12px;
  font-size: 16px;
  line-height: 1.6;
}

.q34-m .q34-b1-scope span {
  display: block;
}

.q34-m .q34-b1-scope span + span {
  margin-left: 0;
  margin-top: 4px;
}

.q34-m .q34-b1-scope span + span::before {
  display: none;
}

.q34-m .q34-b2-head {
  display: block;
  margin-bottom: 10px;
}

.q34-m .q34-b2-head h2,
.q34-m .q34-m-h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--navy);
}

.q34-m .q34-b2-head p {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.6;
  white-space: normal;
}

.q34-m .q34-m-loop-note {
  margin: 6px 0 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.q34-m .q34-m-loop {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  display: grid;
  gap: 16px;
}

.q34-m .q34-m-loop::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--line);
}

.q34-m .q34-m-step {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.q34-m .q34-m-step::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 12px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--gold);
}

.q34-m .q34-m-step-k {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--white);
  font-size: 17px;
  line-height: 1;
  font-weight: 600;
  color: var(--q34-gold-ink);
}

.q34-m .q34-m-step h3 {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--navy);
}

.q34-m .q34-m-step p {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

.q34-m .q34-m-loop-return {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

.q34-m .q34-m-branch {
  margin-top: 18px;
  padding: 14px 16px 16px;
  border: 2px dashed var(--q34-danger);
  border-radius: 10px;
  background: var(--q34-danger-soft);
}

.q34-m .q34-m-branch-k {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--navy);
}

.q34-m .q34-m-branch-v {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--q34-danger);
}

.q34-m .q34-m-branch-return {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.q34-m .q34-foot {
  display: block;
  min-height: 0;
  margin-top: 24px;
  padding-top: 14px;
}

.q34-m .q34-foot-text {
  font-size: 21px;
  line-height: 1.55;
}

.q34-m-link {
  margin: 24px 0 0;
  font-size: 15px;
  line-height: 1.6;
}

/* instant and reduced motion */

.is-instant .q34 *,
.is-instant .q34-m * {
  transition: none !important;
  animation: none !important;
}

.is-instant .q34-b2-svg [data-q34-step] {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .q34 *,
  .q34-m * {
    transition: none !important;
    animation: none !important;
  }
}
