:root {
  --primary: #1877f2;
  --primary-strong: #0866ff;
  --page-bg: #f0f2f5;
  --surface: #ffffff;
  --text: #1c1e21;
  --muted: #65676b;
  --line: #d8dadf;
  --danger: #c52a35;
  --success: #238636;
  --phone-width: 430px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.demo-badge {
  position: fixed;
  z-index: 60;
  top: 10px;
  right: max(10px, calc((100vw - var(--phone-width)) / 2 + 10px));
  padding: 4px 7px;
  border-radius: 5px;
  color: #fff;
  background: #16181c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  box-shadow: 0 2px 6px rgb(0 0 0 / 22%);
}

.phone-shell {
  width: 100%;
  max-width: var(--phone-width);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--page-bg);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 9px 48px 9px 14px;
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.brand svg { width: 26px; height: 26px; color: var(--primary); }
.skin-switcher { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: #eef0f3; }
.skin-option { border: 0; border-radius: 6px; padding: 6px 8px; background: transparent; color: #5f6368; font-size: 11px; font-weight: 700; cursor: pointer; }
.skin-option:hover { color: var(--text); }
.skin-option:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 34%, transparent); outline-offset: 2px; }
.skin-option.is-active { color: #fff; background: var(--primary); }

.stories { display: none; }
.feed { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 24px; }
.post { position: relative; background: var(--surface); border-top: 1px solid #e2e4e8; border-bottom: 1px solid #e2e4e8; }
.post-header { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 13px; }
.avatar { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; }
.avatar-one { background: linear-gradient(145deg, #d9768a, #604f91); }
.avatar-two { background: linear-gradient(145deg, #377b83, #79af7e); }
.avatar-three { background: linear-gradient(145deg, #c37643, #803c3c); }
.avatar-four { background: linear-gradient(145deg, #53729f, #57a7a0); }
.avatar-coffee { background: #355f52; }
.avatar-agency { background: var(--primary); }
.avatar-run { background: #263238; }
.post-author { display: flex; min-width: 0; flex: 1; flex-direction: column; font-size: 13px; line-height: 1.35; }
.post-author strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.post-author span { color: var(--muted); font-size: 12px; }
.post-author .ig-handle { display: none; }
.icon-button, .sheet-close, .sheet-back { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover, .sheet-close:hover, .sheet-back:hover { background: #eef0f3; }
.icon-button svg, .sheet-close svg, .sheet-back svg { width: 21px; height: 21px; }
.post-copy { margin: 0; padding: 0 13px 11px; font-size: 14px; line-height: 1.42; text-wrap: pretty; }
.media, .ad-creative { position: relative; overflow: hidden; width: 100%; background: #d9dde2; }
.media svg, .ad-creative svg { display: block; width: 100%; height: auto; }
.engagement { display: flex; justify-content: space-between; padding: 9px 14px 7px; color: var(--muted); font-size: 12px; }
.actions { display: flex; margin: 0 12px; border-top: 1px solid #e4e6eb; }
.actions button { display: flex; flex: 1; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; }
.actions button:hover { background: #f3f4f6; }
.actions svg { width: 19px; height: 19px; }
.ig-icon, .ig-save { display: none !important; }
.reel { max-height: 520px; }

.ad-card { scroll-margin-block: 12vh; }
.ad-creative { background: #e8f2ff; }
.ad-offer { position: relative; display: flex; align-items: center; gap: 10px; padding: 13px; background: #f0f2f5; }
.ad-offer > div:first-child { min-width: 0; flex: 1; }
.ad-offer small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.ad-offer h2 { margin: 0 0 3px; font-size: 16px; letter-spacing: -.015em; line-height: 1.2; text-wrap: balance; }
.ad-offer p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cta-button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border: 0; border-radius: 7px; color: #fff; background: var(--primary); font-size: 13px; font-weight: 750; cursor: pointer; transition: transform 160ms var(--ease-out), filter 160ms ease; }
.cta-button:hover { filter: brightness(.94); }
.cta-button:active { transform: scale(.97); }
.ad-actions { margin-bottom: 2px; }

.coach { position: absolute; z-index: 6; display: none; align-items: center; color: #fff; filter: drop-shadow(0 2px 2px rgb(0 0 0 / 35%)); pointer-events: none; animation: coach-bob 1.4s ease-in-out infinite; }
.coach.is-visible { display: flex; }
.coach span { padding: 5px 8px; border-radius: 6px; background: #16181c; font-size: 12px; font-weight: 750; white-space: nowrap; }
.coach svg { width: 48px; height: 48px; }
.coach-ad { top: 54px; right: 12px; flex-direction: column; align-items: flex-end; }
.coach-ad svg { transform: rotate(30deg); }
.coach-cta { right: 5px; bottom: 43px; flex-direction: column; align-items: flex-end; }
.coach-cta svg { transform: rotate(16deg); }
@keyframes coach-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.sheet-layer { position: fixed; z-index: 40; inset: 0; display: flex; justify-content: center; align-items: flex-end; visibility: hidden; }
.sheet-layer.is-open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(8 12 18 / 52%); opacity: 0; cursor: default; transition: opacity 220ms ease; }
.sheet-layer.is-open .sheet-backdrop { opacity: 1; }
.bottom-sheet { position: relative; display: flex; width: 100%; max-width: var(--phone-width); max-height: min(92vh, 780px); min-height: min(560px, 82vh); flex-direction: column; overflow: hidden; border-radius: 16px 16px 0 0; background: #fff; box-shadow: 0 -6px 8px rgb(0 0 0 / 10%); transform: translateY(102%); transition: transform 280ms var(--ease-out); }
.sheet-layer.is-open .bottom-sheet { transform: translateY(0); }
.drag-handle { width: 38px; height: 4px; margin: 8px auto 2px; border-radius: 999px; background: #c8cbd1; }
.sheet-header { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; min-height: 52px; padding: 0 10px; border-bottom: 1px solid #ebedf0; }
.sheet-back.is-hidden { visibility: hidden; }
.progress-dots { display: flex; justify-content: center; gap: 6px; }
.progress-dot { width: 7px; height: 7px; border-radius: 50%; background: #c9cdd3; transition: width 180ms var(--ease-out), background 180ms ease; }
.progress-dot.is-current { width: 20px; border-radius: 99px; background: var(--primary); }
.progress-dot.is-complete { background: color-mix(in srgb, var(--primary) 58%, #fff); }
.sheet-content { flex: 1; overflow-y: auto; padding: 26px 22px max(24px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.step-view { display: flex; min-height: 100%; flex-direction: column; animation: step-in 200ms var(--ease-out); }
@keyframes step-in { from { opacity: .35; transform: translateY(8px); } }
.step-kicker { margin: 0 0 8px; color: var(--primary); font-size: 13px; font-weight: 750; }
.step-view h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.16; letter-spacing: -.025em; text-wrap: balance; }
.step-view > p { max-width: 52ch; margin: 0 0 24px; color: #565b63; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.intro-visual { display: grid; place-items: center; width: 100%; height: 150px; margin: 6px 0 25px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 10%, #f5f7fa); }
.intro-visual svg { width: 84px; height: 84px; color: var(--primary); }
.button-primary, .button-secondary { width: 100%; min-height: 48px; padding: 0 18px; border-radius: 8px; font-size: 15px; font-weight: 750; cursor: pointer; }
.button-primary { margin-top: auto; border: 0; color: #fff; background: var(--primary); }
.button-primary:hover { filter: brightness(.94); }
.button-primary:disabled { cursor: not-allowed; opacity: .62; }
.button-secondary { border: 1px solid #c9cdd3; background: #fff; }
.field-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field legend { color: #30343a; font-size: 14px; font-weight: 700; }
.field .required { color: var(--danger); }
.field input, .field select { width: 100%; min-height: 48px; border: 1px solid #aeb3bb; border-radius: 8px; padding: 10px 12px; background: #fff; color: #1c1e21; font-size: 16px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #555 50%), linear-gradient(135deg, #555 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.field input::placeholder { color: #60656d; opacity: 1; }
.field.has-error input, .field.has-error select, .radio-group.has-error { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field-error, .form-error { margin: 0; color: var(--danger); font-size: 13px; line-height: 1.35; }
fieldset.field { margin: 0; padding: 0; border: 0; }
.radio-group { display: flex; gap: 8px; border-radius: 8px; }
.radio-option { position: relative; flex: 1; }
.radio-option input { position: absolute; opacity: 0; pointer-events: none; }
.radio-option label { display: grid; min-height: 46px; place-items: center; border: 1px solid #aeb3bb; border-radius: 8px; cursor: pointer; }
.radio-option input:checked + label { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, #fff); box-shadow: inset 0 0 0 1px var(--primary); }
.radio-option input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--primary) 34%, transparent); outline-offset: 2px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 10px; }
.contact-grid .field-wide { grid-column: 1 / -1; }
.review-list { margin: 0 0 26px; border-top: 1px solid #e1e4e8; }
.review-row { display: grid; grid-template-columns: minmax(110px, .85fr) 1.15fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid #e1e4e8; font-size: 14px; line-height: 1.35; }
.review-row dt { color: #656b73; }
.review-row dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.result-view { align-items: center; justify-content: center; text-align: center; }
.result-icon { display: grid; width: 72px; height: 72px; margin-bottom: 22px; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 38px; font-weight: 700; }
.result-icon.error { background: var(--danger); font-size: 30px; }
.result-view .demo-note { margin: 5px 0 24px; padding: 12px; border-radius: 8px; color: #4b525b; background: #f0f2f5; font-size: 13px; line-height: 1.45; }
.spinner { width: 48px; height: 48px; margin-bottom: 24px; border: 4px solid color-mix(in srgb, var(--primary) 18%, #fff); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

body.skin-instagram { --page-bg: #f5f5f5; --text: #0b0b0c; --muted: #5f6368; }
.skin-instagram .topbar { min-height: 54px; border-bottom-color: #dbdbdb; }
.skin-instagram .brand { font-size: 18px; font-weight: 800; }
.skin-instagram .brand svg { color: #111; }
.skin-instagram .skin-switcher { background: #efefef; }
.skin-instagram .skin-option.is-active { background: linear-gradient(120deg, #7a36ba, var(--primary), #f77737); }
.skin-instagram .stories { display: flex; gap: 13px; overflow-x: auto; padding: 12px 10px 10px; border-bottom: 1px solid #ddd; background: #fff; scrollbar-width: none; }
.skin-instagram .story { display: flex; min-width: 58px; align-items: center; flex-direction: column; gap: 5px; font-size: 11px; }
.skin-instagram .story .avatar { width: 54px; height: 54px; border: 2px solid #fff; outline: 2px solid var(--primary); }
.skin-instagram .story small { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-instagram .avatar-you { color: #222; background: #eee; outline-color: #c6c6c6 !important; font-size: 22px; font-weight: 400; }
.skin-instagram .feed { gap: 10px; padding-top: 0; background: #f5f5f5; }
.skin-instagram .post { border-color: #dbdbdb; }
.skin-instagram .post-header { min-height: 54px; padding-block: 8px; }
.skin-instagram .post-header .avatar { width: 34px; height: 34px; border: 2px solid #fff; outline: 1px solid var(--primary); font-size: 10px; }
.skin-instagram .post-author > span:not(.ig-handle):not(.sponsored-label) { display: none; }
.skin-instagram .post-author .ig-handle { display: inline; }
.skin-instagram .post-copy { padding-top: 10px; }
.skin-instagram .business-post .post-copy { order: 4; }
.skin-instagram .engagement { justify-content: flex-start; padding: 8px 13px 0; color: #171717; font-weight: 650; }
.skin-instagram .engagement span:last-child { display: none; }
.skin-instagram .actions { margin: 0; padding: 4px 7px 0; border: 0; }
.skin-instagram .actions button { min-height: 38px; flex: 0 0 38px; color: #111; }
.skin-instagram .actions button:hover { background: transparent; color: var(--primary); }
.skin-instagram .actions svg { width: 23px; height: 23px; }
.skin-instagram .actions .ig-save { display: flex !important; margin-left: auto; }
.skin-instagram .fb-icon, .skin-instagram .fb-label { display: none; }
.skin-instagram .ig-icon { display: block !important; }
.skin-instagram .ad-offer { background: #fff; border-top: 1px solid #eee; }
.skin-instagram .cta-button { background: linear-gradient(115deg, #8f36b4, var(--primary), #ef6c37); }
.skin-instagram .ad-actions { border-top: 1px solid #eee; }
.skin-instagram .ad-card .sponsored-label { display: inline !important; color: #5c6066; font-size: 11px; }

@media (min-width: 500px) {
  body { padding: 20px 0 40px; }
  .phone-shell { min-height: calc(100vh - 40px); border-radius: 18px; box-shadow: 0 5px 8px rgb(23 30 40 / 15%); }
  .topbar { border-radius: 18px 18px 0 0; }
  .post { border-right: 1px solid #e2e4e8; border-left: 1px solid #e2e4e8; }
  .bottom-sheet { bottom: 20px; border-radius: 16px; }
  .sheet-layer { padding-bottom: 20px; }
}

@media (max-width: 360px) {
  .brand span { display: none; }
  .topbar { padding-right: 45px; }
  .ad-offer { align-items: stretch; flex-direction: column; }
  .cta-button { width: 100%; }
  .coach-cta { bottom: 48px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid .field-wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .coach { animation: none; }
}
