/* ── BODYSCULPT iPhone app demo (fixed layout, no transform scale) ── */

.bs-app-phone {
  --app-bg: #050507;
  --app-surface: rgba(255, 255, 255, 0.07);
  --app-border: rgba(255, 255, 255, 0.11);
  --app-text: #fff;
  --app-muted: rgba(255, 255, 255, 0.62);
  --app-dim: rgba(255, 255, 255, 0.4);
  --app-accent: #e8382f;
  --app-accent-deep: #8c1210;
  --app-green: #34d399;
  --iphone-w: 272px;
  --iphone-ratio: 844 / 390;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

.bs-app-phone[data-mode="showcase"] {
  --iphone-w: 288px;
}

.bs-app-phone__device {
  filter: drop-shadow(0 28px 44px rgba(0, 0, 0, 0.35));
}

/* iPhone 15-style frame */
.bs-app-phone__shell {
  position: relative;
  width: var(--iphone-w);
  padding: 5px;
  border-radius: 48px;
  background: linear-gradient(160deg, #585860 0%, #2c2c30 45%, #141416 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.5);
}

.bs-app-phone__shell::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 96px;
  width: 3px;
  height: 24px;
  border-radius: 2px 0 0 2px;
  background: #3a3a40;
  box-shadow: 0 34px 0 #3a3a40, 0 68px 0 #3a3a40;
  z-index: 2;
}

.bs-app-phone__shell::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 132px;
  width: 3px;
  height: 64px;
  border-radius: 0 2px 2px 0;
  background: #3a3a40;
  z-index: 2;
}

/* Screen — exact iPhone aspect ratio, everything lives inside */
.bs-app-phone__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 390 / 844;
  border-radius: 42px;
  overflow: hidden;
  background: var(--app-bg);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  isolation: isolate;
}

.bs-app-phone__island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  max-width: 118px;
  height: 30px;
  border-radius: 18px;
  background: #000;
  z-index: 20;
  pointer-events: none;
}

.bs-app-phone__status-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px 0;
  min-height: 44px;
  flex-shrink: 0;
}

.bs-app-phone__time {
  font-size: 14px;
  font-weight: 600;
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
}

.bs-app-phone__status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bs-app-phone__signal {
  width: 16px;
  height: 10px;
  background:
    linear-gradient(to top, #fff, #fff) 0 100% / 3px 35% no-repeat,
    linear-gradient(to top, #fff, #fff) 5px 100% / 3px 55% no-repeat,
    linear-gradient(to top, #fff, #fff) 10px 100% / 3px 75% no-repeat,
    linear-gradient(to top, #fff, #fff) 15px 100% / 3px 100% no-repeat;
}

.bs-app-phone__wifi {
  display: block;
  flex-shrink: 0;
  opacity: 0.95;
}

.bs-app-phone__battery {
  width: 22px;
  height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  padding: 1px;
  position: relative;
}

.bs-app-phone__battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 5px;
  border-radius: 0 1px 1px 0;
  background: rgba(255, 255, 255, 0.45);
}

.bs-app-phone__battery i {
  display: block;
  width: 70%;
  height: 100%;
  border-radius: 1px;
  background: #fff;
}

/* Panels — one visible at a time, simple fade */
.bs-app-phone__panels {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.bs-app-phone__panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.bs-app-phone__panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.bs-app-panel__body {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 14px 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.bs-app-panel__body--chat {
  padding-bottom: 4px;
}

.bs-app-panel__stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
}

/* In-app UI */
.bs-app-header__eyebrow {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-dim);
}

.bs-app-header__title {
  margin: 1px 0 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--app-text);
}

.bs-app-header__sub {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--app-muted);
}

.bs-app-hero-card {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(232, 56, 47, 0.24), rgba(100, 16, 14, 0.38));
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.bs-app-hero-card__label {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
}

.bs-app-hero-card h4 {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--app-text);
}

.bs-app-hero-card__meta {
  margin: 2px 0 8px;
  font-size: 11px;
  color: var(--app-muted);
}

.bs-app-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f04a3a, #b81814);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.bs-app-cta svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.bs-app-cta--sm {
  margin-top: 6px;
  font-size: 10px;
  padding: 5px 10px;
}

.bs-app-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex-shrink: 0;
}

.bs-app-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  color: var(--app-muted);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
}

.bs-app-chip.is-done {
  color: var(--app-green);
  border-color: rgba(52, 211, 153, 0.35);
}

.bs-app-chip.is-done svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  vertical-align: -1px;
}

.bs-app-card {
  padding: 10px;
  border-radius: 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  flex-shrink: 0;
}

.bs-app-card--workout h4 {
  margin: 4px 0 2px;
  font-size: 14px;
  color: var(--app-text);
}

.bs-app-card--workout p {
  margin: 0;
  font-size: 10px;
  color: var(--app-muted);
}

.bs-app-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--app-muted);
}

.bs-app-card__head strong {
  color: var(--app-text);
  font-size: 12px;
}

.bs-app-card__head strong small.down {
  color: var(--app-green);
}

.bs-app-card__label {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--app-muted);
}

.bs-app-rings {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.bs-app-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
}

.bs-app-ring--move { --c: #fa114f; }
.bs-app-ring--exercise { --c: #92e82a; }
.bs-app-ring--stand { --c: #00d4ff; }

.bs-app-macro-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--app-muted);
}

.bs-app-macro-row strong {
  color: var(--app-text);
  font-size: 11px;
}

.bs-app-macro-row small {
  color: var(--app-dim);
  font-weight: 500;
}

.bs-app-progress {
  margin-top: 5px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bs-app-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--app-accent), #ff7a45);
}

.bs-app-progress--sm {
  margin-top: 3px;
  height: 3px;
}

.bs-app-workout-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  background: var(--app-accent);
}

.bs-app-exercise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
}

.bs-app-exercise-list li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  color: var(--app-muted);
}

.bs-app-exercise-list li strong {
  color: var(--app-text);
  font-size: 10px;
}

.bs-app-exercise-list li.is-next {
  background: rgba(232, 56, 47, 0.1);
  margin: 0 -6px;
  padding: 7px 6px;
  border-radius: 8px;
  border-bottom: none;
  color: var(--app-text);
}

.bs-app-fuel-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.bs-app-calorie-ring {
  position: relative;
}

.bs-app-calorie-ring svg {
  width: 100%;
  transform: rotate(-90deg);
}

.bs-app-calorie-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.bs-app-calorie-ring__fill {
  fill: none;
  stroke: var(--app-accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 68;
}

.bs-app-calorie-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bs-app-calorie-ring__label strong {
  font-size: 13px;
  color: var(--app-text);
}

.bs-app-calorie-ring__label span {
  font-size: 8px;
  color: var(--app-dim);
}

.bs-app-macro-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 9px;
  color: var(--app-muted);
}

.bs-app-macro-stack strong {
  display: block;
  color: var(--app-text);
  font-size: 11px;
  margin-top: 1px;
}

.bs-app-meal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
}

.bs-app-meal-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.bs-app-meal-list li span {
  display: block;
  font-size: 9px;
  color: var(--app-dim);
  margin-top: 1px;
}

.bs-app-meal-list li.is-active {
  background: rgba(255, 255, 255, 0.04);
  margin: 0 -6px;
  padding: 6px;
  border-radius: 8px;
}

.bs-app-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  margin-top: 6px;
}

.bs-app-sparkline span {
  flex: 1;
  height: calc(var(--h) * 1%);
  min-height: 6px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--app-accent), var(--app-accent-deep));
}

.bs-app-photo-compare {
  position: relative;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
  cursor: ew-resize;
}

.bs-app-photo-compare__before,
.bs-app-photo-compare__after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.bs-app-photo-compare__before {
  background: linear-gradient(160deg, #3d4454, #1a1f28);
}

.bs-app-photo-compare__after {
  background: linear-gradient(160deg, #4a5568, #252b38);
  clip-path: inset(0 46% 0 0);
}

.bs-app-photo-compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 54%;
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
  z-index: 2;
  touch-action: none;
}

.bs-app-photo-compare__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.bs-app-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.bs-app-stat-row > div {
  padding: 7px 4px;
  border-radius: 10px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  text-align: center;
  font-size: 8px;
  color: var(--app-dim);
}

.bs-app-stat-row strong {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--app-text);
}

/* Messaging */
.bs-app-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.bs-app-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-deep));
}

.bs-app-chat-header strong {
  display: block;
  font-size: 12px;
  color: var(--app-text);
}

.bs-app-chat-header span {
  font-size: 9px;
  color: var(--app-dim);
}

.bs-app-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
  overflow: hidden;
}

.bs-app-bubble {
  max-width: 86%;
  padding: 7px 9px;
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.4;
}

.bs-app-bubble time {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  opacity: 0.55;
}

.bs-app-bubble--coach {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
  color: var(--app-text);
  border-bottom-left-radius: 3px;
}

.bs-app-bubble--client {
  align-self: flex-end;
  background: linear-gradient(135deg, #f04a3a, #b81814);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.bs-app-bubble.is-new {
  box-shadow: 0 0 0 1px rgba(232, 56, 47, 0.4);
}

.bs-app-chat-input {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  font-size: 10px;
  color: var(--app-dim);
  flex-shrink: 0;
}

/* Tab bar */
.bs-app-phone__tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 46px;
  padding: 2px 2px 0;
  background: rgba(5, 5, 7, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 5;
}

.bs-app-phone__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: none;
  background: transparent;
  color: var(--app-dim);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.bs-app-phone__tab.is-active {
  color: var(--app-accent);
}

.bs-app-phone__tab-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.bs-app-phone__tab-label {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.bs-app-phone__home-bar {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 7, 0.98);
  flex-shrink: 0;
}

.bs-app-phone__home-bar span {
  width: 112px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.bs-app-phone__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--bs-dim, rgba(100, 100, 100, 0.85));
  text-align: center;
}

/* Marketing page integration */
body.marketing .k-hero-phone {
  position: relative;
  z-index: 3;
  transform: none !important;
}

@media (max-width: 900px) {
  body.marketing .k-hero-visual .k-float-card {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.marketing .k-hero-visual {
    min-height: auto;
    padding-bottom: 0.5rem;
  }
}

body.marketing .k-hero-phone .bs-app-phone {
  pointer-events: auto;
}

body.marketing .k-float-card {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.marketing .k-float-card.is-highlight {
  border-color: var(--bs-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--bs-accent-soft);
}

body.marketing .k-show-app-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.marketing .k-checklist--interactive li {
  cursor: pointer;
  border-radius: 8px;
  margin-left: -0.35rem;
  padding-left: calc(1.35rem + 0.35rem);
  padding-right: 0.35rem;
  transition: background 0.2s ease;
}

body.marketing .k-checklist--interactive li:hover,
body.marketing .k-checklist--interactive li.is-active {
  background: var(--bs-accent-soft);
}

body.marketing .k-checklist--interactive li.is-active {
  font-weight: 600;
}

@media (max-width: 900px) {
  .bs-app-phone {
    --iphone-w: min(260px, 84vw);
  }

  .bs-app-phone[data-mode="showcase"] {
    --iphone-w: min(272px, 88vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bs-app-phone__panel {
    transition: none;
  }
}
