:root {
  --bg: #fff7df;
  --paper: #fffdf8;
  --ink: #211c16;
  --muted: #756c5d;
  --line: #eadfc6;
  --accent: #e85d2a;
  --accent-dark: #8d3218;
  --green: #176a4d;
  --yellow: #ffe08a;
  --soft: #f6ead0;
  --shadow: 0 24px 70px rgba(75, 48, 22, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 224, 138, .85), transparent 24rem),
    radial-gradient(circle at 8% 28%, rgba(232, 93, 42, .16), transparent 22rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: max(14px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid rgba(33, 28, 22, .08);
  background: rgba(255, 247, 223, .88);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  color: white;
  background: var(--accent);
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 850;
}

main {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 26px 18px calc(38px + env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  align-items: center;
  gap: 34px;
  min-height: min(660px, calc(100svh - 88px));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

h1, h2 { margin: 0; line-height: 1.04; }
h1 { max-width: 650px; font-size: clamp(45px, 7vw, 82px); }
h2 { font-size: 29px; }

.subtitle {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.48;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-button, .secondary-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 10px;
  border: 0;
  padding: 0 18px;
  font-weight: 900;
}

.primary-button {
  color: white;
  background: var(--ink);
  box-shadow: 0 16px 36px rgba(33, 28, 22, .18);
}

.secondary-button {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.ghost-button {
  min-height: 38px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.wide { width: 100%; }
.compact { min-height: 42px; }

.phone-card {
  padding: 18px;
  border: 1px solid rgba(33, 28, 22, .1);
  border-radius: 28px;
  background: rgba(255, 255, 255, .56);
  box-shadow: var(--shadow);
}

.phone-screen {
  display: grid;
  gap: 14px;
  min-height: 460px;
  padding: 28px;
  border: 10px solid #211c16;
  border-radius: 34px;
  background: linear-gradient(180deg, #fffdf7, #fff2ca);
}

.mini-label {
  width: fit-content;
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.phone-screen strong {
  font-size: 36px;
  line-height: 1.05;
}

.phone-screen p, .phone-screen small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  margin: 18px auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 62%, #f0e4ca 0);
}

.score-ring span {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: white;
  font-size: 44px;
  font-weight: 950;
}

.panel, .decision-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, .88);
  box-shadow: 0 14px 46px rgba(75, 48, 22, .08);
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.section-title { margin-bottom: 16px; }
.compact-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.item-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  color: var(--ink);
  background: white;
}

.photo-picker {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  color: white;
  background: var(--accent);
  place-items: center;
  text-align: center;
}

.photo-picker input { display: none; }

.photo-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.questions {
  display: grid;
  gap: 10px;
}

.question-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.question-card strong, .question-card span { display: block; }
.question-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice-row button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fffaf0;
  font-size: 13px;
  font-weight: 850;
}

.choice-row button.active {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
}

.actions-bar { margin: 18px 0; }

.result-section {
  margin-bottom: 16px;
}

.decision-card {
  overflow: hidden;
}

.decision-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  color: white;
  background: var(--ink);
}

.decision-hero.wait { background: #9a5a08; }
.decision-hero.skip { background: #6e2f23; }
.decision-hero.buy { background: var(--green); }
.decision-hero.research { background: #315d76; }

.decision-hero h2 { font-size: 40px; }
.decision-hero p { margin: 8px 0 0; opacity: .86; }

.result-score {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  font-size: 32px;
  font-weight: 950;
}

.decision-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.reason {
  padding: 12px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.35;
}

.reason strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.history-panel { margin-top: 20px; }

.money-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 11px;
  background: var(--ink);
  color: white;
}

.money-line span { opacity: .78; }
.money-line strong { font-size: 30px; }

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.history-item strong, .history-item span { display: block; }
.history-item span { color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }

@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 0 18px;
  }
  h1 { font-size: 48px; }
  .phone-card { display: none; }
  .item-grid, .question-card {
    grid-template-columns: 1fr;
  }
  .choice-row {
    grid-template-columns: 1fr;
  }
  .decision-hero {
    grid-template-columns: 1fr;
  }
  .reason-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body { background: white; }
  .topbar, .hero, .panel, .actions-bar, .result-actions { display: none !important; }
  main { width: 100%; padding: 0; }
  .result-section { display: block !important; }
  .decision-card { box-shadow: none; border-color: #ddd; }
}
