* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #1c1915;
  background: #f3efe6;
  font: 17px/1.45 "Segoe UI", sans-serif;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #1c1915;
  background: #f7f4ee;
}

.brand {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.chapter-line {
  margin: 4px 0 0;
  color: #5c564c;
}

.scheme-link {
  color: #1c1915;
  white-space: nowrap;
}

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 108px 118px;
  min-height: 0;
}

.side {
  align-self: center;
  height: 64px;
  margin: 10px;
  border: 1px solid #1c1915;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.side:disabled {
  color: #8a847a;
  cursor: default;
}

#sheet {
  padding: 22px 8px 32px;
  min-width: 0;
}

@keyframes rise {
  from { opacity: 0.35; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.kicker {
  margin: 0 0 8px;
  color: #5c564c;
  font-size: 14px;
}

h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 650;
}

.lead, .after {
  max-width: 42rem;
  margin: 0 0 12px;
}

.points {
  max-width: 42rem;
  margin: 0 0 12px;
  padding-left: 1.2rem;
}

.note {
  margin: 0;
  color: #5c564c;
  font-size: 14px;
}

.shot {
  width: min(100%, 420px);
  min-height: 160px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 2px dashed #1c1915;
  background: #fff;
}

.shot-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shot p:last-child { margin: 0; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 20px;
  align-items: start;
}

.step-name {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
}

.meta {
  margin: 0 0 8px;
  color: #5c564c;
}

.step-btn {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid #1c1915;
  background: #1e4d8c;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.step-btn:disabled {
  background: #d9d3c7;
  color: #5c564c;
  cursor: default;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.chips button {
  border: 1px solid #1c1915;
  background: #fff;
  font: inherit;
  padding: 4px 8px;
  cursor: pointer;
}

.chips button[aria-current="true"] {
  background: #1c1915;
  color: #fff;
}

.diagram {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #1c1915;
}

.kinds, .blocks, .facts {
  margin: 0 0 12px;
  padding-left: 1.2rem;
}

.blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.blocks li {
  flex: 1 1 140px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #1c1915;
  background: #fff;
}

.extra {
  margin: 0;
}

.question {
  max-width: 42rem;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d9d3c7;
}

.question p { margin: 0 0 8px; }

.answer {
  margin: 8px 0 0;
}

.well {
  position: relative;
  margin: 16px 12px 16px 0;
  padding: 8px 0 8px 18px;
  border-left: 3px solid #cfc6b8;
}

.well-fill {
  position: absolute;
  left: -3px;
  top: 0;
  width: 3px;
  background: #1e4d8c;
}

.well button {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: #8a847a;
}

.well button.open {
  color: #1c1915;
  cursor: pointer;
}

.well button.here {
  font-weight: 650;
  color: #1e4d8c;
}

.well button::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 0.35em;
  width: 9px;
  height: 9px;
  border: 2px solid #1c1915;
  border-radius: 50%;
  background: #f3efe6;
}

.well button.here::before {
  background: #1e4d8c;
  border-color: #1e4d8c;
}

@media (max-width: 900px) {
  .stage {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    grid-template-rows: auto 1fr;
  }

  .well {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    gap: 8px;
    margin: 8px;
    padding: 0 0 8px;
    border-left: 0;
    border-bottom: 3px solid #cfc6b8;
    overflow-x: auto;
  }

  .well-fill { display: none; }

  .well button {
    margin: 0;
    white-space: nowrap;
  }

  .well button::before { display: none; }

  .side { margin: 6px; padding: 0; }

  .split { grid-template-columns: 1fr; }

  h1 { font-size: 28px; }
}
