.q05 {
  --q05-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Q05 stage */

.q05-stage {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.q05-head {
  flex: 0 0 auto;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.q05-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
  padding-top: 18px;
}

.q05-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-right: 40px;
}

.q05-left-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 30px;
}

.q05-left-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q05-left-head p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
}

.q05-code-card {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 12px 18px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.q05-code-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 20px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.q05-code-hint {
  letter-spacing: 0.01em;
}

.q05-code {
  margin: 6px 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  font-family: var(--q05-mono);
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre;
  scrollbar-width: thin;
}

.q05-code code {
  font: inherit;
}

.q05-eq {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  min-height: 44px;
}

.q05-eq-tag {
  flex: 0 0 auto;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.q05-eq-calc {
  font-family: var(--q05-mono);
  font-size: 28px;
  line-height: 1.4;
  color: var(--navy);
  white-space: nowrap;
}

.q05-eq-calc strong {
  font-size: 38px;
  line-height: 1;
  font-weight: 600;
  color: var(--gold);
}

.q05-eq-note {
  flex: 0 0 auto;
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

.q05-track-wrap {
  flex: 0 0 auto;
  margin-top: 12px;
}

.q05-track {
  position: relative;
  width: 760px;
  max-width: 100%;
  height: 200px;
  margin: 0 auto;
}

.q05-wall {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 622px;
  width: 52px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  border-radius: 5px 5px 2px 2px;
  box-shadow: inset 0 3px 0 var(--gold);
}

.q05-wall::after {
  content: "";
  position: absolute;
  top: 46px;
  left: 50%;
  height: 20px;
  border-left: 2px dashed var(--gold);
}

.q05-wall span {
  font-size: 23px;
  line-height: 1;
  font-weight: 600;
  color: var(--white);
}

.q05-wall em {
  position: absolute;
  top: 14px;
  left: calc(100% + 8px);
  font-size: 14px;
  line-height: 1.3;
  font-style: normal;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}

.q05-slots {
  position: absolute;
  top: 70px;
  left: 52px;
  display: grid;
  grid-template-columns: repeat(5, 120px);
  gap: 14px;
}

.q05-slot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.q05-card {
  width: 120px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
  color: var(--navy);
}

.q05-idx {
  font-size: 16px;
  line-height: 1.2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.q05-starts {
  position: absolute;
  top: 170px;
  left: 52px;
  display: grid;
  grid-template-columns: repeat(5, 120px);
  gap: 14px;
}

.q05-start {
  justify-self: center;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--q05-mono);
  font-size: 14px;
  line-height: 1.4;
  color: var(--navy);
  white-space: nowrap;
}

.q05-start:nth-child(1) {
  grid-column: 1;
}

.q05-start:nth-child(2) {
  grid-column: 3;
}

.q05-start:nth-child(3) {
  grid-column: 5;
}

.q05-start.is-stop {
  border: 1.5px dashed var(--gold);
  background: transparent;
  color: var(--navy);
}

.q05-left-note {
  flex: 0 0 auto;
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
}

.q05-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-left: 44px;
  border-left: 1px solid var(--line);
}

.q05-right-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
}

.q05-right-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q05-right-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.q05-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.q05-empty p {
  margin: 0;
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
}

.q05-question {
  flex: 0 0 auto;
  margin: 28px 0 0;
  font-size: 30px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--navy);
}

.q05-mark-box {
  flex: 0 0 auto;
  width: 160px;
  height: 160px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--gold);
  border-radius: 12px;
}

.q05-mark {
  font-size: 94px;
  line-height: 1;
  font-weight: 600;
  color: var(--gold);
}

.q05-reveal {
  flex: 0 0 auto;
  margin-top: 22px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.q05-need {
  margin: 0;
  font-size: 28px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q05-need-copy {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
}

.q05-need-bound {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.q05-takeaway {
  flex: 0 0 auto;
  min-height: 76px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.q05-takeaway-line {
  margin: 0;
  font-size: 24px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--navy);
}

.q05-contrast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 500px;
}

.q05-contrast-cell {
  min-width: 0;
}

.q05-contrast-cell:first-child {
  padding-right: 40px;
}

.q05-contrast-cell:last-child {
  padding-left: 44px;
  border-left: 1px solid var(--line);
}

.q05-contrast-tag {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.q05-contrast p {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.5;
  color: var(--navy);
}

.q05-contrast strong {
  font-weight: 600;
}

.q05-contrast em {
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
}

/* Q05 mobile */

.q05-mobile {
  color: var(--ink);
}

.q05-m-lede {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}

.q05-m-section {
  margin: 0 0 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.q05-m-section h2 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q05-m-code {
  max-width: 100%;
  overflow-x: auto;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.q05-m-code pre {
  margin: 0;
  font-family: var(--q05-mono);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre;
}

.q05-m-code code {
  font: inherit;
}

.q05-m-eq {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  font-family: var(--q05-mono);
  font-size: 19px;
  line-height: 1.5;
  color: var(--navy);
}

.q05-m-eq strong {
  font-size: 26px;
  line-height: 1;
  color: var(--gold);
}

.q05-m-note {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.q05-m-records {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}

.q05-m-records li {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 5px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
}

.q05-m-records b {
  font-size: 20px;
  line-height: 1.2;
  color: var(--navy);
}

.q05-m-records span {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.q05-m-state {
  padding: 16px 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.q05-m-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q05-m-state p {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
}

.q05-m-state p + p {
  margin-top: 10px;
}

/* Q05 reading */

.q05-read-formula {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 23px;
  line-height: 1.5;
  color: var(--navy);
}

.q05-read-formula strong {
  font-size: 31px;
  line-height: 1;
  color: var(--gold);
}

.q05-read-code {
  margin: 18px 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre;
  scrollbar-width: thin;
}

.q05-read-code code {
  font: inherit;
}

.q05-inline {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.q05-read-states {
  display: grid;
  gap: 16px;
  margin: 22px 0 0;
}

.q05-read-card {
  padding: 18px 20px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.q05-read-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--navy);
}

.q05-read-card h3 span {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.q05-read-card p {
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
}

.q05-read-contrast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0 0;
}

.q05-read-contrast div {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.q05-read-contrast strong {
  display: block;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--navy);
}

.q05-read-contrast span {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

@media (max-width: 680px) {
  .q05-read-formula {
    font-size: 20px;
    gap: 8px;
  }

  .q05-read-contrast {
    grid-template-columns: 1fr;
  }
}
