* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  user-select: none;
  -webkit-user-select: none;
  font-family: "Inter", sans-serif;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.page-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Header ── */
.header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.share-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition:
    color 0.12s,
    background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.share-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-family: "Inter", sans-serif;
}

.header-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.header-title {
  font-family: "Inter Tight", sans-serif;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -1px;
}

/* ── Form ── */
.form-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.hint:empty {
  display: none;
}

/* ── Segmented control ── */
.segmented {
  display: flex;
  background: var(--surface);
  border-radius: 10px;
  padding: 3px;
  position: relative;
}

.segment-slider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: calc(100% / 3 - 3px);
  background: var(--segment-slider-bg);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.segment {
  flex: 1;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--segment-color);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}

.segment.active {
  color: var(--text);
}

/* ── Operation pills ── */
.ops {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.op-pill {
  height: 52px;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 400;
  background: var(--surface);
  color: var(--text-muted);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}

.op-pill:hover {
  background: var(--surface-hover);
}

.op-pill.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border-color: var(--btn-primary-bg);
}

.op-pill.active:hover {
  background: var(--btn-primary-bg-hover);
}

/* ── Example question ── */
.example {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: none;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}

.example:hover {
  background: var(--surface-hover);
}

.example:active {
  background: var(--surface-hover-alt);
}

.example-label,
.example-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

.example-text {
  font-family: "Inter Tight", sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-feature-settings: "calt" 0;
  font-variant-ligatures: no-contextual;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}

/* ── Stepper ── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-radius: 10px;
  padding: 6px;
  height: 44px;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.stepper-btn:hover {
  background: var(--surface-hover-alt);
}

.stepper-value {
  font-size: 16px;
  font-weight: 500;
  min-width: 28px;
  text-align: center;
  cursor: text;
}

.stepper-input {
  font-size: 16px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  color: var(--text);
  width: 48px;
  text-align: center;
  background: none;
  border: none;
  border-bottom: 1.5px solid var(--border-stepper);
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-input:focus {
  border-bottom-color: var(--text);
}

/* ── Start button ── */
.go-button {
  width: 100%;
  padding: 15px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.1s,
    transform 0.08s;
}

.go-button:hover {
  background: var(--btn-primary-bg-hover);
}

.go-button:active {
  transform: scale(0.98);
}

/* ── Footer ── */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-link {
  color: inherit;
  text-decoration: underline;
}

.footer-link:hover {
  color: var(--text-muted);
}

@media (max-width: 359px) {
  .header-title {
    font-size: 40px;
  }
}