.q40,
.q40-m {
  --q40-gold-ink: #7a5717;
  --q40-gold-soft: #fbf3e2;
  --q40-gold-line: #e4d2ae;
  --q40-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--ink);
  font-family: var(--font-sans);
}

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

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

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

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

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

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

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

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

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

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

.q40-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 0 12px;
}

.q40-panel {
  height: 100%;
  min-height: 0;
}

.q40-panel[hidden] {
  display: none !important;
}

.q40-b0 {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  grid-template-rows: auto 1fr;
  gap: 22px 44px;
}

.q40-report {
  grid-column: 1;
  min-width: 0;
  padding: 20px 24px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.q40-kicker {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--q40-gold-ink);
}

.q40-code {
  margin: 10px 0 0;
  padding: 14px 18px;
  overflow-x: auto;
  border: 1px solid #dbe4ec;
  border-radius: 8px;
  background: #f2f6fa;
  color: var(--navy);
  font-family: var(--q40-mono);
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  scrollbar-color: var(--line) transparent;
}

.q40-known {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.q40-known-k {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.q40-known ul {
  margin: 0;
  padding-left: 1.1em;
}

.q40-known li {
  font-size: 21px;
  line-height: 1.75;
  color: var(--ink);
}

.q40-commission {
  grid-column: 2;
  min-width: 0;
  padding: 18px 24px 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 12px;
  background: var(--white);
}

.q40-rules {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.q40-rule {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.q40-rule:last-child {
  border-bottom: 0;
}

.q40-rule-k {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.q40-rule-v {
  font-size: 21px;
  line-height: 1.65;
  color: var(--navy);
}

.q40-commission-note {
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
}

.q40-candidates {
  grid-column: 1 / -1;
  min-width: 0;
  align-self: center;
}

.q40-candidates-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

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

.q40-coexist {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--q40-gold-ink);
  white-space: nowrap;
}

.q40-candidate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}

.q40-candidate {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

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

.q40-candidate p {
  margin: 6px 0 0;
  font-size: 19px;
  line-height: 1.75;
  color: var(--muted);
}

.q40-foot {
  flex: 0 0 auto;
  min-height: 104px;
  display: flex;
  align-items: center;
  padding-top: 12px;
  border-top: 2px solid var(--gold);
}

.q40-foot > div {
  width: 100%;
}

.q40-footline {
  margin: 0;
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--navy);
}

.q40-question {
  margin: 0;
  font-size: 34px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--navy);
}

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

.q40-work {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.q40-actions {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.q40-action {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  transition: background-color 180ms ease-out, border-color 180ms ease-out;
}

.q40-action-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

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

.q40-action-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--navy);
}

.q40-action-sub {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.75;
  color: var(--muted);
}

.q40-action.is-muted {
  background: #f1f4f7;
  border-color: #dbe4ec;
}

.q40-action.is-muted .q40-action-title {
  color: var(--muted);
}

.q40-action.is-muted .q40-action-sub {
  color: var(--muted);
}

.q40-action.is-muted .q40-action-key {
  border-color: var(--line);
  background: var(--white);
  color: var(--muted);
}

.q40-evalboard {
  flex: 0 0 210px;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
  border-top: 2px solid var(--gold);
}

.q40-evalboard-head {
  min-height: 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.q40-evalboard-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy);
}

.q40-eval-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.q40-eval-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.q40-eval-meta {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.q40-eval-key {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.q40-eval-action {
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

.q40-eval-body {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: flex-start;
}

.q40-eval-status {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--navy);
}

.q40-eval-status.is-fact {
  color: var(--navy);
}

.q40-eval-status.is-mech {
  color: var(--q40-gold-ink);
}

.q40-eval-status.is-none {
  color: var(--muted);
}

.q40-eval-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
}

.q40-order {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.q40-order-step {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--navy);
  border-radius: 8px;
  background: var(--white);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.q40-order-arrow {
  font-size: 28px;
  line-height: 1;
  color: var(--gold);
}

.q40-order-note {
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
}

@keyframes q40-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.q40-motion [data-q40-b2-reveal].q40-in {
  animation: q40-rise 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.q40.q40-m {
  position: static;
  inset: auto;
  display: block;
  height: auto;
  padding: 0;
  background: transparent;
}

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

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

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

.q40-m .q40-sub {
  font-size: 16px;
  line-height: 1.75;
}

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

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

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

.q40-m .q40-body {
  padding: 0;
}

.q40-m .q40-panel,
.q40-m .q40-work,
.q40-m .q40-b0 {
  height: auto;
}

.q40-m .q40-b0 {
  display: block;
}

.q40-m .q40-report,
.q40-m .q40-commission {
  margin-bottom: 20px;
  padding: 16px;
}

.q40-m .q40-code {
  font-size: 30px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.q40-m .q40-known {
  grid-template-columns: 1fr;
  gap: 12px;
}

.q40-m .q40-known li {
  font-size: 17px;
  line-height: 1.7;
}

.q40-m .q40-rule-v {
  font-size: 17px;
  line-height: 1.7;
}

.q40-m .q40-commission-note {
  font-size: 15px;
  line-height: 1.7;
}

.q40-m .q40-candidates-head {
  display: block;
}

.q40-m .q40-coexist {
  display: block;
  margin-top: 4px;
  white-space: normal;
}

.q40-m .q40-candidate-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.q40-m .q40-candidate {
  padding: 15px 16px;
}

.q40-m .q40-candidate h3 {
  font-size: 21px;
  line-height: 1.45;
}

.q40-m .q40-candidate p {
  font-size: 16px;
  line-height: 1.7;
}

.q40-m .q40-work {
  display: block;
}

.q40-m .q40-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.q40-m .q40-action {
  padding: 16px;
}

.q40-m .q40-action-title {
  font-size: 21px;
  line-height: 1.45;
}

.q40-m .q40-action-sub {
  font-size: 16px;
  line-height: 1.75;
}

.q40-m .q40-evalboard {
  flex: none;
  margin-top: 24px;
  padding-top: 12px;
}

.q40-m .q40-eval-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.q40-m .q40-eval-cell {
  padding: 12px 14px;
}

.q40-m .q40-eval-action {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
  display: block;
}

.q40-m .q40-eval-body {
  min-height: 0;
}

.q40-m .q40-eval-status {
  font-size: 20px;
  line-height: 1.4;
}

.q40-m .q40-eval-text {
  font-size: 16px;
  line-height: 1.7;
}

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

.q40-m .q40-question {
  font-size: 24px;
  line-height: 1.45;
}

.q40-m .q40-question-sub {
  font-size: 16px;
  line-height: 1.7;
}

.q40-m .q40-footline {
  font-size: 22px;
  line-height: 1.6;
}

.q40-m .q40-order {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.q40-m .q40-order-step {
  width: 100%;
  justify-content: center;
  font-size: 20px;
}

.q40-m .q40-order-arrow {
  transform: rotate(90deg);
}

.q40-m .q40-order-note {
  font-size: 15px;
  line-height: 1.65;
}

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

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

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