main.shell-main.mks-main {
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 56px;
}

.mks-sheet {
  width: min(760px, 100%);
  margin: 12px auto 0;
  padding: 28px 22px 32px;
  color: #2c2a28;
  border-radius: 22px;
  background-color: #f4efe6;
  background-image: radial-gradient(rgba(44, 42, 40, 0.05) 0.6px, transparent 0.7px);
  background-size: 3px 3px;
  box-shadow: 0 18px 40px rgba(28, 22, 18, 0.28);
}

.mks-sheet section[hidden],
#mks-miss[hidden],
#mks-download[hidden],
#mks-canvas[hidden] {
  display: none !important;
}

.mks-title {
  margin: 0;
  color: #2c2a28;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.2;
  font-weight: 800;
}

.mks-lead,
.mks-skip,
.mks-safe,
.mks-read,
.mks-dim,
.mks-hard,
.mks-note,
.mks-miss {
  margin: 12px 0 0;
  color: #2c2a28;
  font-size: 1.02rem;
  line-height: 1.65;
}

.mks-skip,
.mks-safe,
.mks-hard {
  color: #4a463f;
}

.mks-gates {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.mks-gate-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #e7eef6;
  color: #2c2a28;
  font-size: 1rem;
  line-height: 1.45;
}

.mks-gate-row input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: 0 0 22px;
  accent-color: #2f6fbf;
}

.mks-gate-row input:checked {
  accent-color: #e23b3b;
}

.mks-start,
.mks-actions button,
#mks-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #e23b3b;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.mks-ghost,
#mks-download {
  background: transparent;
  color: #2c2a28;
  border: 1.5px solid #2c2a28;
}

.mks-countline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  color: #4a463f;
  font-weight: 700;
}

.mks-prefix {
  color: #2f6fbf;
  font-size: 0.95rem;
}

.mks-meter {
  display: flex;
  gap: 3px;
  margin-top: 10px;
}

.mks-seg {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: #d5e0ee;
}

.mks-seg.is-in {
  background: linear-gradient(90deg, #2f6fbf, #e23b3b);
}

.mks-prompt {
  margin: 16px 0 0;
  color: #2c2a28;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.35;
  font-weight: 750;
}

.mks-ruler {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.mks-tick {
  flex: 1 1 118px;
  min-width: 108px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1.5px solid #c9d3e0;
  border-radius: 14px;
  color: #2c2a28;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mks-tick:nth-child(1) { background: #d7e6f6; }
.mks-tick:nth-child(2) { background: #e7eef6; }
.mks-tick:nth-child(3) { background: #f6efe6; }
.mks-tick:nth-child(4) { background: #f8ddd4; }
.mks-tick:nth-child(5) { background: #f6c9c4; }

.mks-tick:hover,
.mks-tick:focus-visible {
  border-color: #e23b3b;
  outline: none;
}

.mks-tick.is-on {
  background: #fde4e0;
  border-color: #e23b3b;
  box-shadow: 0 0 0 3px rgba(226, 59, 59, 0.28);
  color: #2c2a28;
  transform: none;
}

.mks-figure {
  margin: 0;
}

.mks-stage {
  display: block;
  width: 100%;
  height: auto;
}

.mks-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.mks-barcol {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 92px;
}

.mks-bar {
  width: 100%;
  max-width: 54px;
  border-radius: 10px 10px 4px 4px;
  background: #2f6fbf;
}

.mks-barcol.is-max .mks-bar {
  background: #e23b3b;
}

.mks-figure.is-nope .mks-barcol.is-max .mks-bar {
  background: #2f6fbf;
}

.mks-barlabel {
  margin-top: 6px;
  color: #2c2a28;
  font-size: 0.82rem;
  font-weight: 700;
}

.mks-type {
  margin: 22px 0 0;
  color: #2c2a28;
  font-size: 1.7rem;
  line-height: 1.2;
}

.mks-kicker {
  margin: 22px 0 0;
  color: #9a3412;
  font-size: 0.92rem;
  font-weight: 800;
}

.mks-open {
  margin: 8px 0 0;
  padding-left: 1.2em;
  color: #2c2a28;
}

.mks-open li {
  margin: 6px 0;
}

.mks-clip {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8ddd4;
  color: #2c2a28;
  font-weight: 750;
}

.mks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mks-actions button {
  margin-top: 8px;
}

#mks-download {
  margin-top: 8px;
  text-decoration: none;
}

.mks-prompt:focus,
.mks-type:focus {
  outline: none;
}

.mks-tick:focus-visible,
.mks-start:focus-visible,
.mks-actions button:focus-visible,
#mks-download:focus-visible {
  outline: 2px solid #2c2a28;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .mks-tick {
    flex: 1 1 42%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mks-tick,
  .mks-bar,
  .mks-start {
    transition: none;
  }
}
