:root {
  --orange: #D35519;
  --text: #333333;
  --muted: #565454;
  --line: #EBEBEB;
  --bg: #ffffff;
  --soft: #F7F7F7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.quiz-shell {
  width: min(886px, calc(100% - 10px));
  margin: 30px auto;
}

.quiz-main,
.summary {
  border: 1px solid var(--orange);
  background: var(--bg);
  border-radius: 4px;
}

.quiz-main {
  padding: 24px;
}

.quiz-kicker {
  margin-bottom: 8px;
  color: var(--orange);
  font-size: 14px;
  font-weight: 600;
}

.quiz-head {
  display: grid;
  gap: 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 600;
}

.quiz-head p,
.step-text,
.summary-note,
.field small {
  color: var(--muted);
  line-height: 1.45;
}

.step-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.step-count {
  white-space: nowrap;
}

.progress {
  width: 100%;
  height: 4px;
  background: #eeeeee;
  border-radius: 10px;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  transition: width .2s ease;
}

.step {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.step h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
}

.step-text {
  margin-bottom: 18px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-btn {
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s ease, color .2s ease;
}

.option-btn strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.option-btn span {
  color: var(--muted);
  font-size: 14px;
}

.option-btn:hover,
.option-btn.is-selected {
  border-color: var(--orange);
}

.option-btn.is-selected strong {
  color: var(--orange);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px!important;
  color: var(--text);
  background: #fff;
}

.select {
  padding-right: 44px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    calc(100% - 24px) 50%,
    calc(100% - 18px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.select-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.preview-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: stretch;
}

.preview-card img {
  display: block;
  width: 100%;
  height: 116px;
  object-fit: cover;
  background: var(--soft);
}

.preview-card div {
  padding: 14px 16px;
  font-weight: 600;
  line-height: 1.3;
  align-self: center;
  min-width: 0;
}

.preview-card a {
  color: var(--orange);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
}

.preview-card a:hover {
  text-decoration: underline;
}

.preview-empty {
  display: block;
  grid-template-columns: 1fr;
}

.preview-empty div {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 600;
}

.warning {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #f3d0bb;
  border-radius: 4px;
  background: #fff7f2;
  color: #8c3a0d;
}

.volume-control {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.range {
  width: 100%;
  height: 22px;
  accent-color: var(--orange);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  background: #eeeeee;
  border-radius: 10px;
}

.range::-webkit-slider-thumb {
  width: 12px;
  height: 24px;
  margin-top: -10px;
  border: 2px solid var(--orange);
  border-radius: 3px;
  background: var(--orange);
  cursor: pointer;
  -webkit-appearance: none;
}

.range::-moz-range-track {
  height: 4px;
  background: #eeeeee;
  border-radius: 10px;
}

.range::-moz-range-progress {
  height: 4px;
  background: var(--orange);
  border-radius: 10px;
}

.range::-moz-range-thumb {
  width: 10px;
  height: 22px;
  border: 2px solid var(--orange);
  border-radius: 3px;
  background: var(--orange);
  cursor: pointer;
}

.volume-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.volume-presets button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--orange);
  padding: 4px 14px;
  cursor: pointer;
}

.volume-presets button:hover {
  border-color: var(--orange);
}

.calculation {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  background: var(--soft);
  border-radius: 4px;
}

.calc-row strong {
  text-align: right;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  padding: 3px 22px;
  cursor: pointer;
  font-weight: 400;
  transition: opacity .2s ease, border-color .2s ease;
}

.btn-main {
  min-height: 50px;
  padding-left: 30px;
  padding-right: 30px;
  background: var(--orange);
  color: #fff;
  font-size: 17px;
}

.btn-main:hover {
  opacity: .888;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--orange);
}

.btn-ghost:hover {
  opacity: .777;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.summary {
  margin-top: 18px;
  padding: 22px 24px;
}

.summary h2 {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 600;
}

.summary-note {
  margin-bottom: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0 0 18px;
}

.summary-row {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
}

.summary dd {
  margin: 0;
  font-weight: 600;
}

.summary-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.final-prices {
  margin-top: 10px;
  margin-bottom: 18px;
}

.price-box,
.total-box {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 4px;
}

.price-box {
  background: var(--soft);
}

.total-box {
  background: #333;
  color: #fff;
}

.price-box span,
.total-box span {
  font-size: 13px;
  opacity: .78;
}

.price-box strong,
.total-box strong {
  font-size: 25px;
  line-height: 1.2;
}

.status {
  padding: 12px 14px;
  border-radius: 4px;
  margin-top: 14px;
  border: 1px solid var(--line);
}

.status.is-ok {
  background: #f1f8f3;
  color: #23693e;
  border-color: #c8e5d0;
}

.status.is-error {
  background: #fff4f4;
  color: #a22121;
  border-color: #ffd0d0;
}

@media (max-width: 760px) {
  .quiz-shell {
    width: calc(100% - 10px);
    margin: 16px auto;
  }

  .quiz-main,
  .summary {
    padding: 18px;
  }

  h1 {
    font-size: 26px;
  }

  .option-grid,
  .select-row,
  .field-grid,
  .summary-grid,
  .summary-prices {
    grid-template-columns: 1fr;
  }

  .preview-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .preview-card img {
    height: 96px;
  }

  .volume-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .volume-presets button {
    padding-left: 8px;
    padding-right: 8px;
  }

  .quiz-actions {
    padding-top: 12px;
  }
}
