*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: Manrope, system-ui, sans-serif;
  background: #1C1917;
  color: #F5E6D3;
  min-height: 100dvh;
  line-height: 1.5;
}

a { color: #D97706; text-decoration: none; }
button, input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #D97706; outline-offset: 2px; }

.wrap {
  width: min(430px, 100%);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.mast {
  background: #292524;
  border-bottom: 1px solid #B45309;
  padding-top: env(safe-area-inset-top);
}

.mast .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
}

.mast span {
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #B45309;
  color: #D97706;
  padding: 4px 8px;
}

h1 {
  margin: 18px 0 6px;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.lead, .note, footer { color: #A8A29E; font-size: 0.92rem; }

.book { margin: 16px 0 24px; }

.leaf {
  margin-bottom: 10px;
  padding: 16px;
  background: #292524;
  border: 1px solid #44403C;
  box-shadow: inset 0 0 0 1px #1C1917;
}

.tab {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #D97706;
  margin-bottom: 6px;
}

.num {
  font-size: clamp(1.35rem, 6vw, 1.7rem);
  font-weight: 800;
  margin-bottom: 12px;
  white-space: nowrap;
}

.num.sm { font-size: 1.2rem; }

.row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.chip {
  min-height: 42px;
  border: 1px solid #44403C;
  background: #1C1917;
  color: #F5E6D3;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.chip.is-on { background: #B45309; border-color: #B45309; color: #FFF7ED; }
.chip:disabled { opacity: 0.45; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, #B45309 var(--progress, 25%), #44403C var(--progress, 25%));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  background: #D97706;
  border: 2px solid #1C1917;
}

input[type="range"]::-moz-range-track { height: 4px; background: #44403C; }
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #D97706;
  border: 2px solid #1C1917;
}

.ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #A8A29E;
}

.note { margin: 12px 0 14px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border: 0;
  background: #B45309;
  color: #FFF7ED;
  font-weight: 800;
  cursor: pointer;
}

.btn.ghost {
  margin-top: 8px;
  background: transparent;
  border: 1px solid #44403C;
  color: #F5E6D3;
}

.btn:disabled { opacity: 0.5; }

.wait { text-align: center; padding: 32px 0; font-weight: 800; }
.out { text-align: center; padding: 6px 0; }

.k {
  font-size: 12px;
  font-weight: 800;
  color: #D97706;
  text-transform: uppercase;
}

.code {
  margin: 8px 0 12px;
  padding: 14px;
  background: #292524;
  border: 1px solid #B45309;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.faq-item {
  margin-bottom: 8px;
  background: #292524;
  border: 1px solid #44403C;
}

.faq-q {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  color: #F5E6D3;
}

.faq-a { display: none; padding: 0 14px 12px; color: #A8A29E; font-size: 0.9rem; }
.faq-item.is-open .faq-a { display: block; }

footer {
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

.legal { padding-top: 8px; }
.legal h1 { font-size: 1.5rem; }
.paper {
  margin: 16px 0 32px;
  padding: 18px 16px;
  background: #292524;
  border: 1px solid #B45309;
}
.paper h2 { margin: 18px 0 8px; font-size: 1rem; color: #D97706; }
.paper p, .paper li { color: #A8A29E; }
.paper ul { padding-left: 18px; margin-top: 8px; }
.back { display: inline-block; margin-bottom: 10px; }
