.q28,
.q28-m {
  --q28-gold-ink: #7a5717;
  --q28-mono: "SFMono-Regular", "SF Mono", "Menlo", "Consolas",
    "Liberation Mono", monospace;
  color: var(--ink);
  font-family: var(--font-sans);
}

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

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

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

/* head */

.q28-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);
  margin-bottom: 20px;
}

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

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

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

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

/* body */

.q28-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 40px;
}

/* left: input and task */

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

.q28-left-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

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

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

.q28-records {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.q28-record {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.q28-record-key {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--navy);
  border-radius: 8px;
  background: var(--paper);
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
  color: var(--navy);
}

.q28-record-name {
  min-width: 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
}

.q28-task {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid var(--gold);
}

.q28-task p {
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink);
}

.q28-task strong {
  font-weight: 600;
  color: var(--navy);
}

.q28-task .q28-task-sub {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
}

.q28-mother-tag {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--q28-gold-ink);
}

/* right: signal, panels */

.q28-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q28-signal {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.q28-signal-copy {
  min-width: 0;
}

.q28-signal-kicker {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--q28-gold-ink);
}

.q28-signal-title {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q28-pass {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px 14px 16px;
  background: var(--navy);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(14, 43, 80, 0.18);
}

.q28-lamp {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--pass);
  border: 3px solid #0b3d2a;
  box-shadow: inset 0 6px 12px rgba(255, 255, 255, 0.2),
    inset 0 -8px 14px rgba(0, 0, 0, 0.28);
}

.q28-lamp::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 14%;
  width: 34%;
  height: 24%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.q28-pass-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.q28-pass-word {
  font-size: 38px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--white);
}

.q28-pass-sub {
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: #cfe3da;
}

/* panels */

.q28-panel {
  min-width: 0;
  flex: 0 0 auto;
  padding: 10px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.q28-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
}

.q28-panel-title {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q28-panel-sub {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.q28-panel-status {
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--q28-gold-ink);
}

.q28-panel-status:empty {
  display: none;
}

.q28-panel-body {
  margin-top: 8px;
}

/* actual */

.q28-array {
  display: block;
  margin: 0;
  overflow-x: auto;
  font-family: var(--q28-mono);
  font-size: 20px;
  line-height: 1.5;
  color: var(--navy);
  white-space: pre;
}

.q28-pages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.q28-page {
  min-width: 0;
  min-height: 60px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.q28-page-k {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.q28-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.q28-chips b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--white);
  border: 1px solid var(--navy);
  border-radius: 6px;
  font-size: 17px;
  line-height: 1;
  font-weight: 600;
  color: var(--navy);
}

.q28-page.is-missing {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  text-align: center;
  background: transparent;
  border: 2px dashed var(--gold);
}

.q28-page.is-missing .q28-page-k {
  position: absolute;
  top: 6px;
  left: 10px;
}

.q28-missing-mark {
  font-size: 26px;
  line-height: 1;
  font-weight: 600;
  color: var(--muted);
}

.q28-missing-note {
  font-size: 13px;
  line-height: 1.3;
  color: var(--q28-gold-ink);
  white-space: nowrap;
}

.q28-actual-note {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

/* expected comparison */

.q28-cmp {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.q28-cmp-var {
  font-family: var(--q28-mono);
  font-size: 22px;
  line-height: 1.4;
  color: var(--navy);
}

.q28-cmp-op {
  padding: 0 2px;
  font-family: var(--q28-mono);
  font-size: 34px;
  line-height: 1;
  font-weight: 600;
  color: var(--gold);
}

.q28-cmp-lit {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  font-family: var(--q28-mono);
  font-size: 20px;
  line-height: 1.5;
  color: var(--navy);
  white-space: pre;
}

.q28-cmp-e {
  font-weight: 600;
  color: var(--q28-gold-ink);
  border-bottom: 2px solid var(--gold);
}

.q28-cmp-out {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--danger);
  border-radius: 6px;
}

.q28-cmp-out b {
  font-family: var(--q28-mono);
  font-size: 20px;
  line-height: 1.2;
  color: var(--danger);
}

.q28-cmp-out span {
  font-size: 15px;
  line-height: 1.4;
  color: var(--danger);
}

.q28-expect-note {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

/* function */

.q28-code {
  margin: 0;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--q28-mono);
  font-size: 19px;
  line-height: 1.5;
  color: var(--navy);
  white-space: pre;
}

.q28-code-line {
  display: block;
}

.q28-code-line.is-indented {
  padding-left: 2ch;
}

.q28-redbox {
  display: inline-block;
  padding: 1px 6px;
  background: #fbf0f1;
  border: 2px solid var(--danger);
  border-radius: 4px;
  font-weight: 600;
  color: var(--danger);
}

.q28-func-note {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

/* foot */

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

.q28-foot-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.q28-question {
  margin: 0;
  max-width: 1320px;
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q28-question-sub {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted);
}

.q28-conclusion {
  margin: 0;
  max-width: 1360px;
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q28-conclusion-key {
  color: var(--q28-gold-ink);
}

/* connector from PASS to the missing E slot */

.q28-link-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease-out;
}

.q28-link-layer.is-on {
  opacity: 1;
}

.q28-link-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.q28-link-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 7 7;
  opacity: 0.9;
}

.q28-link-dot {
  fill: var(--gold);
}

/* staged reveal */

.q28-panel-body,
.q28-foot-group,
.q28-code-line.q28-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}

.q28-panel-body.is-on,
.q28-foot-group.is-on,
.q28-code-line.q28-reveal.is-on {
  opacity: 1;
  transform: none;
}

.q28-panel-body.is-reset,
.q28-foot-group.is-reset,
.q28-code-line.q28-reveal.is-reset {
  transition: none !important;
}

/* mobile document flow */

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

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

.q28-m .q28-title {
  margin: 0;
  font-size: 27px;
  line-height: 1.4;
}

.q28-m .q28-head-meta {
  text-align: left;
  margin-top: 8px;
}

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

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

.q28-m .q28-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.q28-m .q28-left {
  padding-right: 0;
  border-right: 0;
}

.q28-m .q28-left-head {
  display: block;
}

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

.q28-m .q28-left-head p {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.6;
}

.q28-m .q28-records {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.q28-m .q28-record {
  min-height: 48px;
  padding: 0 10px;
  gap: 10px;
}

.q28-m .q28-record-key {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

.q28-m .q28-record-name {
  font-size: 15px;
}

.q28-m .q28-task {
  margin-top: 18px;
  padding-top: 14px;
}

.q28-m .q28-task p {
  font-size: 17px;
  line-height: 1.65;
}

.q28-m .q28-task .q28-task-sub {
  font-size: 15px;
}

.q28-m .q28-mother-tag {
  margin-top: 12px;
  font-size: 13px;
}

.q28-m .q28-right {
  gap: 14px;
}

.q28-m .q28-signal {
  min-height: 0;
  padding-bottom: 14px;
  gap: 14px;
  flex-wrap: wrap;
}

.q28-m .q28-signal-title {
  font-size: 20px;
  line-height: 1.5;
}

.q28-m .q28-pass {
  padding: 10px 16px 10px 12px;
  gap: 12px;
}

.q28-m .q28-lamp {
  width: 48px;
  height: 48px;
  border-width: 2px;
}

.q28-m .q28-pass-word {
  font-size: 28px;
}

.q28-m .q28-pass-sub {
  font-size: 12px;
}

.q28-m .q28-panel {
  padding: 10px 12px;
}

.q28-m .q28-panel-head {
  gap: 8px;
}

.q28-m .q28-panel-title {
  display: block;
  font-size: 17px;
  line-height: 1.5;
}

.q28-m .q28-panel-sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
}

.q28-m .q28-panel-status {
  font-size: 12px;
}

.q28-m .q28-panel-body {
  margin-top: 8px;
}

.q28-m .q28-array {
  font-size: 15px;
  line-height: 1.6;
}

.q28-m .q28-pages {
  gap: 6px;
  margin-top: 8px;
}

.q28-m .q28-page {
  min-height: 56px;
  padding: 6px;
}

.q28-m .q28-page-k {
  font-size: 11px;
}

.q28-m .q28-chips b {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.q28-m .q28-missing-mark {
  font-size: 22px;
}

.q28-m .q28-missing-note {
  font-size: 11px;
}

.q28-m .q28-actual-note {
  font-size: 14px;
  line-height: 1.6;
}

.q28-m .q28-cmp {
  gap: 6px 8px;
}

.q28-m .q28-cmp-var {
  font-size: 16px;
}

.q28-m .q28-cmp-op {
  font-size: 26px;
}

.q28-m .q28-cmp-lit {
  flex: 1 1 100%;
  font-size: 15px;
  line-height: 1.6;
}

.q28-m .q28-cmp-out {
  margin-left: 0;
  padding: 3px 8px;
}

.q28-m .q28-cmp-out b {
  font-size: 16px;
}

.q28-m .q28-cmp-out span {
  font-size: 13px;
}

.q28-m .q28-expect-note {
  font-size: 14px;
  line-height: 1.6;
}

.q28-m .q28-code {
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.7;
}

.q28-m .q28-func-note {
  font-size: 14px;
  line-height: 1.6;
}

.q28-m .q28-foot {
  flex: none;
  height: auto;
  margin-top: 24px;
  padding-top: 16px;
}

.q28-m .q28-question,
.q28-m .q28-conclusion {
  font-size: 21px;
  line-height: 1.55;
}

.q28-m .q28-question-sub {
  font-size: 15px;
  line-height: 1.65;
}

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

/* instant and reduced motion */

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

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

/* Coordinator: keep the revealed function panel clear of the fixed footer. */
.q28 .q28-right { gap: 8px; }
.q28 .q28-panel { padding-top: 8px; padding-bottom: 8px; }
.q28 .q28-panel-body { margin-top: 6px; }
