:root {
  --bg: #fff8f5;
  --white: #ffffff;
  --text: #1a1412;
  --text-soft: #6b5e58;
  --border: #ede4df;
  --orange: #ff6236;
  --orange-dark: #e6552d;
  --orange-light: #faeae9;
  --green: #00a651;
  --green-dark: #008c45;
  --shadow: 0 10px 24px -12px rgba(255, 98, 54, 0.45);
  --shadow-soft: 0 8px 24px rgba(31, 20, 17, 0.05);
  --pad: 16px;
  --font: "Ravi", Tahoma, sans-serif;
}

@font-face {
  font-family: "Ravi";
  src:
    url("fonts/Ravi-VF.woff2") format("woff2-variations"),
    url("fonts/Ravi-VF.woff2") format("woff2"),
    url("fonts/Ravi-VF.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background:
    radial-gradient(700px 260px at 50% -100px, rgba(255, 98, 54, 0.14), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

img, svg {
  max-width: 100%;
  display: block;
}

a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 14px var(--pad) calc(24px + env(safe-area-inset-bottom));
  overflow-x: clip;
}

#app,
.card,
.intro,
.fields,
.name-row,
.soft-note,
label {
  max-width: 100%;
  min-width: 0;
}

.top {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 58%;
}

.brand img {
  height: 22px !important;
  width: auto !important;
  max-width: 148px !important;
  max-height: 22px !important;
  background: transparent;
  mix-blend-mode: multiply;
  object-fit: contain;
  object-position: right center;
  flex: 0 0 auto;
}

.brand span {
  display: none;
}

.partner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  max-width: 38%;
}

.partner-logo {
  width: auto !important;
  height: 15px !important;
  max-width: 84px !important;
  max-height: 15px !important;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.card {
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 18px 16px 16px;
  border: 1px solid var(--border);
  width: 100%;
  overflow: hidden;
}

.stage-in { animation: stage-in .24s ease; }

@keyframes stage-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.center-card { text-align: center; }

.kicker {
  margin: 0 0 8px;
  color: var(--orange);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

h1 {
  margin: 0 0 12px;
  font-size: 1.28rem;
  line-height: 1.55;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.lead {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 2;
  font-weight: 400;
}

.intro { display: grid; gap: 12px; }

.intro-hero {
  display: grid;
  gap: 0;
}

.intro-hero .lead {
  margin-bottom: 16px;
}

.gift-card {
  background: linear-gradient(180deg, #fff7f3, #ffefe8);
  border: 1px solid #ffd2c4;
  border-radius: 16px;
  padding: 14px;
  margin: 0 0 12px;
}

.gift-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.gift-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--orange-dark);
}

.gift-tag {
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 800;
}

.gift-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gift-logo {
  width: auto !important;
  height: 16px !important;
  max-width: 90px !important;
  max-height: 16px !important;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center;
}

.gift-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.gift-copy strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.gift-copy span {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-soft);
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.meta-chip {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
}

.clinic-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.clinic-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.clinic-head img {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  mix-blend-mode: multiply;
  flex: 0 0 auto;
}

.clinic-head-text h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.clinic-head-text p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.clinic-perks {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.clinic-perks li {
  position: relative;
  padding-right: 16px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.55;
}

.clinic-perks li::before {
  content: "";
  position: absolute;
  right: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.clinic-services {
  margin: 0;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.6;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.fine {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.65;
  margin: 10px 0 0;
}

.fine.inline { margin: 0; }

.actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.actions.stack { flex-direction: column; }

button, .button, .primary, .ghost, .linkish, .choice {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.primary, a.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 50px;
  padding: 13px 16px;
  margin: 0;
  border-radius: 14px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: var(--shadow);
  transition: .2s background;
}

.intro-hero > .primary {
  width: 100%;
  margin-top: 2px;
}

.primary:hover, a.primary:hover { background: var(--orange-dark); }

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.linkish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 0;
}

.quiz-card { padding-top: 14px; }

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.quiz-top .linkish {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 2px;
  color: var(--text);
}

.quiz-top .step-count {
  margin: 0;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 700;
}

.progress {
  height: 5px;
  background: #f3ebe7;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), #ff8f6d);
  border-radius: inherit;
  transition: width .25s ease;
}

.dots {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eaded8;
}

.dots span.done { background: #ffb198; }
.dots span.current { background: var(--orange); width: 16px; border-radius: 99px; }

.question {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.65;
  text-align: right;
}

.options { display: grid; gap: 8px; }

.choice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  direction: rtl;
  text-align: right;
  background: #fffaf8;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.65;
  padding: 12px 13px;
  border-radius: 12px;
  min-height: 48px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.choice.selected {
  border-color: var(--orange);
  background: var(--orange-light);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.question-stage {
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.question-panel { width: 100%; }

.slide-in-next,
.slide-in-back { animation: panel-in .26s ease; }

.slide-out-next,
.slide-out-back { animation: panel-out .14s ease forwards; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes panel-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-6px); }
}

.status-line {
  display: block;
  margin-top: 8px;
  min-height: 0;
}

.estimate-title {
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0 0 6px;
  font-weight: 900;
}

.result-caption {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.7;
}

.result-report {
  background: linear-gradient(180deg, #fffaf8, #fff4ef);
  border: 1px solid #ffd8c8;
  border-right: 3px solid var(--orange);
  border-radius: 14px;
  padding: 12px 14px;
}

.result-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
}

.result-row + .result-row {
  border-top: 1px dashed #f0d8cc;
}

.result-mark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--orange-light);
  color: var(--orange);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.result-row p {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.75;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

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

.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.name-row > * {
  min-width: 0;
}

label {
  display: grid;
  gap: 5px;
  font-weight: 700;
  font-size: 12.5px;
  width: 100%;
}

input[type="text"], input[type="tel"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: white;
  min-height: 48px;
  box-sizing: border-box;
}

input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 98, 54, 0.22);
  border-color: var(--orange);
}

.soft-note {
  margin-top: 12px;
  background: #eaf7ef;
  border: 1px solid #cfe8d7;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #1f6b3a;
  display: grid;
  gap: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.soft-note p { margin: 0; }

.analyzing-card {
  text-align: center;
  padding: 42px 20px 36px;
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
}

.analyzing-card h1 {
  margin: 8px 0 0;
  font-size: 1.25rem;
}

.analyzing-card .lead {
  max-width: 280px;
}

.analyzing-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid #ffe0d4;
  border-top-color: var(--orange);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hp {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.error {
  background: #fff1f0;
  color: #8d2b2b;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.65;
}

.success-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f7e9;
  color: var(--green);
  font-size: 26px;
  margin: 0 auto 10px;
}

.phone {
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 700;
}

.admin {
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 40px;
  overflow-x: hidden;
}

.admin-head {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-head h1 { margin: 0; font-size: 1.15rem; }

.stats-row {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.stat {
  min-width: 78px;
  text-align: center;
  padding: 10px 12px;
  background: var(--orange-light);
  border-radius: 14px;
  color: var(--orange-dark);
}

.stat b {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  color: var(--orange);
}

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

.lead-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.lead-summary {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: right;
  padding: 14px 16px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  font: inherit;
}

.lead-summary-main { display: grid; gap: 2px; min-width: 0; }

.lead-summary-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.lead-summary h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.lead-summary .phone {
  color: var(--text-soft);
  font-size: 14px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  max-width: 118px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3eeea;
  color: #6b5e58;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-chip.is-empty {
  background: #f6f1ee;
  color: #9a8c84;
  font-weight: 700;
}

.lead-card.status-booked .status-chip {
  background: rgba(0, 166, 81, 0.12);
  color: var(--green-dark);
}

.lead-card.status-followup .status-chip {
  background: var(--orange-light);
  color: var(--orange-dark);
}

.lead-card.status-no_answer .status-chip {
  background: #f1ece8;
  color: #7a6b63;
}

.lead-status-panel {
  padding: 0 14px 14px;
  display: grid;
  gap: 8px;
}

.lead-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.lead-status-note {
  min-height: 1em;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-dark);
}

.lead-status-panel.is-saving .lead-status-note {
  color: var(--text-soft);
}

.status-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: #f7f1ed;
  border: 1px solid #efe6e0;
}

.status-option {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6f6159;
  border-radius: 11px;
  padding: 9px 6px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}

.status-option:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.status-option:active {
  transform: scale(0.98);
}

.status-option.is-active {
  background: var(--white);
  box-shadow: 0 6px 16px rgba(31, 20, 17, 0.08);
}

.status-option.status-booked.is-active {
  color: var(--green-dark);
  box-shadow: 0 8px 18px rgba(0, 166, 81, 0.16);
}

.status-option.status-followup.is-active {
  color: var(--orange-dark);
  box-shadow: 0 8px 18px rgba(255, 98, 54, 0.16);
}

.status-option.status-no_answer.is-active {
  color: #5f534c;
}

.lead-status-panel.is-saving .status-option {
  pointer-events: none;
  opacity: 0.72;
}

@media (max-width: 420px) {
  .status-option {
    font-size: 11px;
    padding: 10px 4px;
  }

  .status-chip {
    max-width: 92px;
    font-size: 10.5px;
  }
}

.source-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 4px;
  background: var(--orange-light);
  color: var(--orange-dark);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
}

.attribution-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 10px;
  display: grid;
  gap: 6px;
}

.attribution-box p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-word;
}

.attribution-box .attr-link span {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 11.5px;
  color: var(--text-soft);
}

.utm-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.utm-list li {
  font-size: 12px;
  line-height: 1.6;
}

.utm-list span {
  display: inline-block;
  min-width: 74px;
  color: var(--text-soft);
  font-weight: 700;
}

.lead-chevron {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--orange-light);
  color: var(--orange);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 16px;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.lead-card.is-open .lead-chevron {
  transform: rotate(180deg);
  background: var(--orange);
  color: #fff;
}

.lead-details {
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px;
  background: #fffaf8;
}

.lead-card.is-open .lead-details { display: block; }

.detail-time {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
}

.qa {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qa li {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.7;
}

.qa small {
  display: block;
  color: var(--text-soft);
  font-size: 11.5px;
  margin-bottom: 2px;
}

.empty {
  padding: 22px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
}

@media (max-width: 380px) {
  :root { --pad: 14px; }
  .name-row { grid-template-columns: 1fr; }
  .top { gap: 14px; }
  .brand img {
    height: 22px !important;
    max-height: 22px !important;
    max-width: 108px !important;
  }
  .partner-logo {
    height: 15px !important;
    max-height: 15px !important;
    max-width: 88px !important;
  }
  h1 { font-size: 1.22rem; line-height: 1.55; }
  .lead { font-size: 13px; line-height: 1.9; }
  .gift-logo {
    height: 15px !important;
    max-height: 15px !important;
    max-width: 88px !important;
  }
  .gift-body { gap: 8px; }
  .gift-copy strong { font-size: 13px; }
  .gift-copy span { font-size: 11.5px; }
}

@media (min-width: 480px) {
  .wrap { padding-top: 18px; }
  .card { padding: 22px 20px 18px; }
  h1 { font-size: 1.5rem; }
  .question { font-size: 1.15rem; }
}
