main.shell-main.cnsw-main {
  padding-bottom: calc(128px + env(safe-area-inset-bottom));
}

.cnsw-stage {
  width: min(720px, 100%);
  margin: 12px auto 28px;
  padding: 28px 22px 32px;
  color: #f6efe6;
  background:
    radial-gradient(900px 280px at 0% 0%, rgba(227, 148, 74, 0.2), transparent 58%),
    linear-gradient(180deg, #2a1a36 0%, #140e1c 72%);
  border: 1px solid rgba(138, 164, 184, 0.38);
  border-radius: 24px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.cnsw-title {
  margin: 0 0 10px;
  color: #fff6ea;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1.2;
  font-weight: 700;
}

.cnsw-lead,
.cnsw-hint,
.cnsw-foot,
.cnsw-saved {
  margin: 0;
  color: #eadccb;
  font-size: 1.05rem;
  line-height: 1.55;
}

.cnsw-lead {
  margin-bottom: 22px;
}

.cnsw-check {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 10px;
  padding: 16px 16px;
  border-radius: 14px;
  background: #2c2138;
  color: #f6efe6;
  font-size: 1.16rem;
  line-height: 1.35;
  cursor: pointer;
}

.cnsw-check input {
  width: 22px;
  height: 22px;
  accent-color: #e3944a;
  flex: 0 0 auto;
}

.cnsw-begin,
.cnsw-actions button,
.cnsw-opt {
  font: inherit;
  cursor: pointer;
}

.cnsw-begin,
.cnsw-actions button {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid #e3944a;
  background: #e3944a;
  color: #1a120c;
  font-size: 1.08rem;
  font-weight: 700;
}

.cnsw-begin {
  width: 100%;
  margin-top: 12px;
}

.cnsw-begin:disabled {
  background: transparent;
  color: #f6efe6;
  border-color: rgba(246, 239, 230, 0.45);
  cursor: not-allowed;
}

.cnsw-begin:focus-visible,
.cnsw-actions button:focus-visible,
.cnsw-opt:focus-visible,
.cnsw-check:focus-within {
  outline: 2px solid #ffd7a8;
  outline-offset: 3px;
}

.cnsw-progress {
  margin: 0 0 8px;
  color: #e3944a;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.cnsw-prompt {
  margin: 0 0 8px;
  color: #fff6ea;
  font-size: clamp(1.28rem, 3vw, 1.55rem);
  line-height: 1.45;
  font-weight: 600;
}

.cnsw-hint {
  min-height: 1.4em;
  margin-bottom: 14px;
  color: #ffd7a8;
}

.cnsw-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cnsw-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 14px 16px;
  text-align: left;
  color: #f6efe6;
  background: #2c2138;
  border: 1px solid rgba(227, 148, 74, 0.32);
  border-radius: 16px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.cnsw-opt:hover {
  border-color: #e3944a;
}

.cnsw-n {
  width: 2rem;
  color: #e3944a;
  font-weight: 700;
  font-size: 1.15rem;
}

.cnsw-lab {
  font-size: 1.08rem;
}

.cnsw-opt.is-on {
  background: #e3944a;
  color: #1a120c;
  border-color: #e3944a;
}

.cnsw-opt.is-on .cnsw-n {
  color: #1a120c;
}

.cnsw-readout {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.cnsw-lamp {
  width: 92px;
  height: 92px;
  margin: 0 auto;
  border-radius: 50%;
  background: #2a2433;
  box-shadow: inset 0 0 0 10px #3a3144, 0 0 0 8px rgba(20, 14, 28, 0.4);
}

.cnsw-readout[data-result="list"] .cnsw-lamp {
  background: radial-gradient(circle at 38% 36%, #fff1d4, #e3944a 58%, #8a4514);
  box-shadow: 0 0 28px rgba(227, 148, 74, 0.62), inset 0 0 0 8px rgba(255, 220, 170, 0.35);
}

.cnsw-readout[data-result="locked"] .cnsw-lamp {
  background: radial-gradient(circle at 38% 36%, #fffaf0, #ffb25a 42%, #d25410);
  box-shadow: 0 0 42px rgba(255, 176, 80, 0.82), inset 0 0 0 6px rgba(255, 236, 200, 0.55);
}

.cnsw-door {
  position: relative;
  min-height: 168px;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, #4a5c6e, #24303c);
  border: 1px solid #8aa4b8;
  overflow: hidden;
}

.cnsw-latch {
  position: absolute;
  right: 16px;
  top: 74px;
  width: 28px;
  height: 16px;
  border-radius: 4px;
  background: #e7eef3;
  box-shadow: 0 0 0 3px #1b2630;
}

.cnsw-readout[data-result="locked"] .cnsw-latch {
  top: 68px;
  height: 28px;
  background: #f7fbfe;
}

.cnsw-list {
  display: none;
  margin: 18px 56px 18px 18px;
  padding: 0;
  list-style: none;
  color: #f6efe6;
}

.cnsw-readout[data-result="list"] .cnsw-list {
  display: block;
}

.cnsw-list li {
  position: relative;
  margin: 0;
  padding: 8px 0 8px 26px;
  border-bottom: 1px dashed rgba(246, 239, 230, 0.45);
}

.cnsw-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 13px;
  height: 13px;
  border: 1.5px solid #f6efe6;
  border-radius: 3px;
}

.cnsw-kicker {
  margin: 0 0 6px;
  color: #8aa4b8;
  letter-spacing: 0.08em;
  font-size: 0.86rem;
}

.cnsw-type {
  margin: 0 0 8px;
  color: #fff6ea;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  line-height: 1.2;
}

.cnsw-axiom {
  margin: 0 0 8px;
  color: #ffd7a8;
  font-size: 1.12rem;
  font-weight: 700;
}

.cnsw-line,
.cnsw-red,
.cnsw-tell,
.cnsw-foot {
  margin: 0 0 10px;
  color: #f6efe6;
  font-size: 1.05rem;
  line-height: 1.55;
}

.cnsw-red {
  color: #ffb4a8;
}

.cnsw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cnsw-actions a {
  align-self: center;
  color: #ffd7a8;
}

.cnsw-copied {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: #ffd7a8;
}

@media (max-width: 640px) {
  .cnsw-stage {
    padding: 22px 14px 26px;
    border-radius: 18px;
  }

  .cnsw-readout {
    grid-template-columns: 1fr;
  }

  .cnsw-actions button {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cnsw-opt {
    transition: none;
  }
}
