:root {
  color-scheme: light;
  --paper: #f7f9f8;
  --surface: #ffffff;
  --ink: #17201c;
  --muted: #66736d;
  --line: #d8e0dc;
  --teal: #0f766e;
  --teal-dark: #0b4d48;
  --coral: #c2413d;
  --gold: #b8860b;
  --blue: #365f91;
  --shadow: 0 22px 70px rgba(23, 32, 28, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  text-decoration: none;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 45%, rgba(15, 118, 110, 0.28) 46% 54%, transparent 55%),
    linear-gradient(0deg, transparent 42%, rgba(194, 65, 61, 0.22) 43% 50%, transparent 51%);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  white-space: nowrap;
}

.experience {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.72fr);
  gap: 28px;
  width: min(1180px, calc(100% - 40px));
  margin: 34px auto 56px;
  align-items: stretch;
}

.intro {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr);
  min-height: calc(100vh - 130px);
  gap: 28px;
}

.intro-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal-dark);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.intro-text {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.trust-row span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
  color: #33423c;
  font-weight: 700;
  font-size: 0.9rem;
}

.palm-stage {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(54, 95, 145, 0.08)),
    #eef4f1;
  box-shadow: var(--shadow);
}

#palmCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
}

.scan-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.scan-label,
#visualSignal {
  color: var(--muted);
  font-size: 0.86rem;
}

.scan-panel strong {
  font-size: 1.18rem;
}

.tool {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 12px;
}

.progress-wrap,
.flow-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(23, 32, 28, 0.08);
}

.progress-wrap {
  padding: 14px;
}

.step-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e8eeeb;
}

.progress-track span {
  display: block;
  width: 16.6%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.flow-panel {
  min-height: 560px;
  padding: 22px;
}

#screenHost {
  min-height: 430px;
}

.screen {
  display: grid;
  gap: 18px;
}

.screen h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.screen p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.option-grid {
  display: grid;
  gap: 10px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.option-card:hover {
  border-color: rgba(15, 118, 110, 0.58);
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.1);
}

.option-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.option-card:has(input:checked) {
  border-color: var(--teal);
  background: #edf8f6;
}

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

.field label,
.consent-line {
  color: #293632;
  font-weight: 800;
}

.text-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbfcfc;
}

.text-input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.upload-grid {
  display: grid;
  gap: 12px;
}

.upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.camera-box,
.photo-preview,
.pdf-cover {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2ef;
}

.camera-box video,
.photo-preview img {
  display: block;
  width: 100%;
  max-height: 270px;
  object-fit: cover;
}

.photo-preview {
  display: none;
}

.photo-preview.is-visible {
  display: block;
}

.consent-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.consent-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.consent-line input {
  margin-top: 3px;
  accent-color: var(--teal);
}

.form-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  padding-top: 16px;
}

.primary {
  color: #fff;
  background: var(--teal);
  font-weight: 850;
}

.primary:hover {
  background: var(--teal-dark);
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #f8faf9;
  font-weight: 800;
}

.danger {
  border: 1px solid rgba(194, 65, 61, 0.42);
  color: var(--coral);
  background: #fff8f7;
  font-weight: 800;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.message {
  border-radius: 8px;
  padding: 12px;
  background: #f0f5fb;
  color: #26466d;
  line-height: 1.45;
}

.message.error {
  background: #fff0ef;
  color: #8f2521;
}

.preview-layout {
  display: grid;
  gap: 16px;
}

.pdf-cover {
  position: relative;
  min-height: 220px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(194, 65, 61, 0.1)),
    #f6faf8;
}

.pdf-cover::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(23, 32, 28, 0.12);
  filter: blur(1px);
}

.pdf-cover strong {
  position: relative;
  display: block;
  max-width: 220px;
  font-size: 1.6rem;
  line-height: 1.1;
}

.pdf-cover span {
  position: relative;
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.excerpt-list,
.included-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.excerpt-list li,
.included-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.excerpt-list strong {
  display: block;
  margin-bottom: 4px;
}

.price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfc;
}

.price-line strong {
  font-size: 2rem;
}

.report-actions {
  display: grid;
  gap: 10px;
}

.small-note {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 920px) {
  .experience {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 680px);
    margin-top: 24px;
  }

  .intro {
    min-height: auto;
  }

  .tool {
    position: static;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    display: none;
  }

  .experience {
    width: min(100% - 20px, 680px);
  }

  .flow-panel {
    padding: 16px;
  }

  h1 {
    font-size: clamp(3rem, 18vw, 4.5rem);
  }

  .trust-row span {
    width: 100%;
  }

  .upload-actions,
  .form-actions {
    grid-template-columns: 1fr;
  }
}
