.q20,
.q20-m {
  --q20-mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --q20-code-bg: #f2f6fa;
  --q20-blue-soft: #edf2f8;
  --q20-gold-soft: #f7f0e2;
  --q20-gold-ink: #7a5717;
  --q20-gold-line: #d9c6a2;
  --q20-pass-soft: #eef5f1;
  --q20-bad-soft: #f7edee;
  --q20-focus: #fbfdff;
}

.q20 {
  position: absolute;
  inset: 0;
  color: var(--ink);
}

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

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

.q20-head {
  position: absolute;
  left: 64px;
  top: 56px;
  width: 1472px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

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

.q20-state {
  margin: 5px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.q20-hand {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  background: var(--q20-gold-soft);
  border: 1px solid var(--q20-gold-line);
  border-radius: 8px;
  text-align: right;
}

.q20-hand-main {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--q20-gold-ink);
}

.q20-hand-sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.q20-program {
  position: absolute;
  left: 64px;
  top: 164px;
  width: 520px;
  height: 556px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}

.q20-panel-label {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
}

.q20-panel-label span {
  font-family: var(--q20-mono);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--q20-gold-ink);
}

.q20-code {
  margin-top: 16px;
  padding: 16px 16px 16px 10px;
  background: var(--q20-code-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.q20-code-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--q20-mono);
  font-size: 22px;
  line-height: 1.72;
  color: var(--navy);
}

.q20-ln {
  flex: 0 0 18px;
  width: 18px;
  text-align: right;
  font-size: 12px;
  line-height: 1.4;
  color: #5f7387;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.q20-code-line code {
  min-width: 0;
  font-family: inherit;
  font-size: 22px;
  line-height: 1.72;
  white-space: pre;
}

.q20-kw {
  color: var(--q20-gold-ink);
  font-weight: 600;
}

.q20-fn {
  color: var(--navy);
  font-weight: 600;
}

.q20-input {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.q20-input-label {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
}

.q20-input-value {
  margin: 0;
  font-family: var(--q20-mono);
  font-size: 24px;
  line-height: 1.2;
  color: var(--navy);
  white-space: nowrap;
}

.q20-input-value strong {
  font-size: 38px;
  line-height: 1;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.q20-rules {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.q20-rules p {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

.q20-rules span {
  min-width: 66px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.q20-rules strong {
  font-family: var(--q20-mono);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--q20-gold-ink);
}

.q20-hand-note {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.q20-traces {
  position: absolute;
  left: 616px;
  top: 164px;
  width: 920px;
}

.q20-trace {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  height: 186px;
}

.q20-trace + .q20-trace {
  border-top: 1px solid var(--line);
}

.q20-trace-aside {
  display: none;
}

.q20-trace-side {
  min-width: 0;
}

.q20-trace-name {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--navy);
}

.q20-trace-kind {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.q20-trace-status {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.q20-trace-status.is-pass {
  color: var(--pass);
}

.q20-trace-status.is-bad {
  color: var(--danger);
}

.q20-chain {
  display: flex;
  align-items: center;
  min-width: 0;
}

.q20-cell {
  flex: 0 0 100px;
  width: 100px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.q20-cell-tag {
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.q20-cell-value {
  font-family: var(--q20-mono);
  font-size: 38px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.q20-cell.is-final {
  border: 2px solid var(--gold);
}

.q20-cell.is-final .q20-cell-tag {
  color: var(--q20-gold-ink);
}

.q20-arrow {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 92px;
}

.q20-arrow-line {
  position: absolute;
  left: 4px;
  right: 16px;
  top: 50%;
  border-top: 2px solid var(--control-line);
}

.q20-arrow-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--control-line);
  border-right: 2px solid var(--control-line);
  transform: rotate(45deg);
}

.q20-arrow-slot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(50% + 12px);
  display: flex;
  justify-content: center;
}

.q20-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.q20-formula {
  margin: 0;
  font-family: var(--q20-mono);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.q20-check.is-bad .q20-formula {
  color: var(--danger);
}

.q20-verdict {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
}

.q20-verdict.is-pass {
  color: var(--pass);
}

.q20-verdict.is-bad {
  color: var(--danger);
}

.q20-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  overflow: visible;
}

.q20-icon circle,
.q20-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.q20-arrow-note {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 10px);
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--danger);
}

.q20-next {
  position: absolute;
  left: 616px;
  top: 552px;
  width: 920px;
  height: 168px;
  padding: 16px 20px;
  background: var(--q20-focus);
  border: 1px solid var(--q20-gold-line);
  border-top: 2px solid var(--gold);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.q20-next-side {
  min-width: 0;
}

.q20-next-label {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--q20-gold-ink);
}

.q20-next-input {
  margin: 5px 0 0;
  font-family: var(--q20-mono);
  font-size: 21px;
  line-height: 1.2;
  color: var(--navy);
  white-space: nowrap;
}

.q20-next-input strong {
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
}

.q20-next-prompt {
  margin: 7px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.q20-next-chain {
  display: flex;
  align-items: center;
  min-width: 0;
}

.q20-cell.is-small {
  flex: 0 0 92px;
  width: 92px;
  height: 78px;
}

.q20-cell.is-small .q20-cell-value {
  font-size: 32px;
}

.q20-arrow.is-small {
  height: 78px;
}

.q20-arrow.is-small .q20-formula {
  font-size: 15px;
}

.q20-mainline {
  position: absolute;
  left: 64px;
  top: 748px;
  width: 1472px;
  margin: 0;
  padding-top: 14px;
  border-top: 2px solid var(--gold);
  font-size: 30px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--navy);
}

.q20-boundaries {
  position: absolute;
  left: 64px;
  top: 744px;
  width: 1472px;
  padding-top: 10px;
  border-top: 2px solid var(--gold);
}

.q20-boundary {
  margin: 0;
  padding: 8px 0;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.q20-boundary-label {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.q20-boundary-label::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.q20-boundary.is-checked .q20-boundary-label {
  color: var(--navy);
}

.q20-boundary.is-checked .q20-boundary-label::before {
  background: currentColor;
}

.q20-boundary.is-unchecked .q20-boundary-label {
  color: var(--q20-gold-ink);
}

.q20-boundary-text {
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
}

.q20.is-q20-animating .q20-check,
.q20-m.is-q20-animating .q20-check {
  animation: q20-rise 240ms ease-out both;
}

.q20.is-q20-animating .q20-trace-status,
.q20-m.is-q20-animating .q20-trace-status {
  animation: q20-rise 200ms ease-out both;
}

.q20.is-q20-animating .q20-cell-value.is-fresh,
.q20-m.is-q20-animating .q20-cell-value.is-fresh {
  animation: q20-pop 260ms ease-out both;
}

.q20.is-q20-animating .q20-arrow-note,
.q20.is-q20-animating .q20-trace-aside,
.q20-m.is-q20-animating .q20-arrow-note,
.q20-m.is-q20-animating .q20-trace-aside {
  animation: q20-rise 220ms ease-out both;
}

.q20.is-q20-animating .q20-boundary,
.q20-m.is-q20-animating .q20-boundary {
  animation: q20-rise 240ms ease-out both;
}

@keyframes q20-rise {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes q20-pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.q20-m {
  min-width: 0;
  color: var(--ink);
}

.q20-m .q20-head {
  position: static;
  width: auto;
  display: block;
  padding-bottom: 14px;
}

.q20-m .q20-title {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.45;
}

.q20-m .q20-state {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.q20-m .q20-hand {
  width: fit-content;
  margin-top: 12px;
  padding: 7px 10px;
  text-align: left;
}

.q20-m .q20-hand-main {
  font-size: 13px;
}

.q20-m .q20-hand-sub {
  font-size: 12px;
}

.q20-m .q20-program {
  position: static;
  width: auto;
  height: auto;
  margin-top: 20px;
  padding: 18px;
}

.q20-m .q20-panel-label {
  font-size: 13px;
}

.q20-m .q20-code {
  margin-top: 14px;
  padding: 12px 12px 12px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.q20-m .q20-code::-webkit-scrollbar {
  height: 8px;
}

.q20-m .q20-code::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.q20-m .q20-code-line {
  gap: 10px;
  min-width: max-content;
  font-size: 15px;
  line-height: 1.9;
}

.q20-m .q20-ln {
  flex-basis: 14px;
  width: 14px;
  font-size: 10px;
}

.q20-m .q20-code-line code {
  font-size: 15px;
  line-height: 1.9;
}

.q20-m .q20-input {
  margin-top: 16px;
  padding-top: 12px;
}

.q20-m .q20-input-label {
  font-size: 14px;
}

.q20-m .q20-input-value {
  font-size: 20px;
}

.q20-m .q20-input-value strong {
  font-size: 32px;
}

.q20-m .q20-rules {
  margin-top: 10px;
}

.q20-m .q20-rules p {
  gap: 10px;
  font-size: 15px;
}

.q20-m .q20-rules span {
  min-width: 58px;
  font-size: 13px;
}

.q20-m .q20-rules strong {
  font-size: 16px;
}

.q20-m .q20-hand-note {
  margin-top: 14px;
  padding-top: 12px;
  font-size: 13px;
  line-height: 1.65;
}

.q20-m .q20-traces {
  position: static;
  width: auto;
  margin-top: 22px;
}

.q20-m .q20-trace {
  grid-template-columns: 1fr;
  gap: 10px;
  height: auto;
  padding: 18px 0;
}

.q20-m .q20-trace + .q20-trace {
  border-top: 1px solid var(--line);
}

.q20-m .q20-trace-side {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.q20-m .q20-trace-name {
  font-size: 24px;
  line-height: 1.2;
}

.q20-m .q20-trace-kind {
  margin: 0;
  font-size: 12px;
}

.q20-m .q20-trace-status {
  margin: 0 0 0 auto;
  font-size: 12px;
  line-height: 1.4;
}

.q20-m .q20-cell {
  flex: 0 0 60px;
  width: 60px;
  height: 72px;
}

.q20-m .q20-cell-tag {
  font-size: 10px;
}

.q20-m .q20-cell-value {
  font-size: 24px;
}

.q20-m .q20-arrow {
  height: 72px;
}

.q20-m .q20-arrow-slot {
  bottom: calc(50% + 8px);
}

.q20-m .q20-formula {
  font-size: 11px;
  line-height: 1.3;
}

.q20-m .q20-verdict {
  gap: 3px;
  font-size: 10px;
  line-height: 1.2;
}

.q20-m .q20-icon {
  width: 11px;
  height: 11px;
}

.q20-m .q20-arrow-note {
  display: none;
}

.q20-m .q20-trace-aside {
  grid-column: 1 / -1;
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--danger);
}

.q20-m .q20-next {
  position: static;
  width: auto;
  height: auto;
  margin-top: 20px;
  padding: 14px;
  display: block;
}

.q20-m .q20-next-label {
  font-size: 13px;
}

.q20-m .q20-next-input {
  margin-top: 4px;
  font-size: 18px;
}

.q20-m .q20-next-input strong {
  font-size: 26px;
}

.q20-m .q20-next-prompt {
  margin-top: 6px;
  font-size: 14px;
}

.q20-m .q20-next-chain {
  margin-top: 12px;
}

.q20-m .q20-cell.is-small {
  flex-basis: 60px;
  width: 60px;
  height: 68px;
}

.q20-m .q20-cell.is-small .q20-cell-value {
  font-size: 24px;
}

.q20-m .q20-arrow.is-small {
  height: 68px;
}

.q20-m .q20-arrow.is-small .q20-formula {
  font-size: 11px;
}

.q20-m .q20-mainline {
  position: static;
  width: auto;
  margin-top: 22px;
  padding-top: 14px;
  font-size: 21px;
  line-height: 1.55;
}

.q20-m .q20-boundaries {
  position: static;
  width: auto;
  margin-top: 22px;
  padding-top: 10px;
}

.q20-m .q20-boundary {
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 12px 0;
}

.q20-m .q20-boundary-label {
  font-size: 15px;
}

.q20-m .q20-boundary-text {
  font-size: 18px;
  line-height: 1.7;
}

.q20-m-link {
  margin: 26px 0 0;
  font-size: 16px;
  line-height: 1.6;
}

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

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