/* ── Design tokens ── */
:root {
  --bg: #F7F7F8;
  --surface: #FFFFFF;
  --surface-2: #F2F2F5;
  --border: #E4E4EB;
  --text-primary: #0F0F12;
  --text-secondary: #6B6B80;
  --text-muted: #ABABBB;
  --accent: #FF2D6B;
  --accent-2: #FF8C00;
  --gradient-cta: linear-gradient(90deg, #FF2D6B 0%, #FF8C00 100%);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --shadow-soft: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-mid: 0 8px 32px rgba(0,0,0,0.12);
}

html, body {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
}

body.inbox-surface-body {
  background: var(--bg) !important;
  color: var(--text-primary) !important;
}

.inbox-surface-shell {
  background: var(--bg) !important;
}

/* Hide decorative ambient blobs */
.ambient {
  display: none !important;
}

.inbox-surface-frame {
  width: min(100%, 500px);
  padding-top: 0.5rem;
  /* Override Tailwind pb-[8.5rem] — no tabbar on inbox pages */
  padding-bottom: 2rem !important;
}

.mobile-app-frame.profile-surface-frame {
  width: min(100%, 620px);
}

.mobile-app-frame {
  width: min(100%, 430px);
}

.mobile-topbar {
  position: sticky;
  top: max(0.65rem, env(safe-area-inset-top));
  z-index: 20;
}

.mobile-menu-dot {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 9999px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

.mobile-tabbar {
  position: fixed;
  left: 50%;
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  width: calc(100% - 1.2rem);
  max-width: 410px;
  border-radius: 1.3rem;
  padding: 0.45rem;
  z-index: 60;
}

.mobile-tabbar.is-hidden {
  display: none;
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0.95rem;
  min-height: 3.05rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: 180ms ease;
}

.mobile-tab.is-active {
  background: rgba(255, 45, 107, 0.1);
  color: var(--accent);
}

.mobile-tab-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.mobile-tab-label {
  margin-top: 0.22rem;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

img {
  max-width: 100%;
  height: auto;
}

.ambient {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}

.ambient-one {
  width: 24rem;
  height: 24rem;
  top: -5rem;
  right: -3rem;
  background: rgba(138, 164, 255, 0.28);
}

.ambient-two {
  width: 20rem;
  height: 20rem;
  left: -6rem;
  top: 22rem;
  background: rgba(115, 255, 213, 0.16);
}

.ambient-three {
  width: 22rem;
  height: 22rem;
  right: 8%;
  bottom: 5%;
  background: rgba(255, 143, 112, 0.15);
}

.glass-panel {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.brand-mark {
  display: inline-flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: var(--gradient-cta);
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(255,45,107,0.28);
}

.nav-pill {
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0.7rem 1rem;
  color: var(--text-secondary);
  transition: 180ms ease;
}

.nav-pill:hover {
  background: var(--surface);
  color: var(--accent);
}

.hero-kicker {
  display: inline-flex;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0.5rem 0.85rem;
  font-size: 0.73rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.cta-primary,
.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.95rem 1.3rem;
  font-weight: 700;
  transition: transform 180ms ease, opacity 180ms ease;
}

.cta-primary {
  background: var(--gradient-cta);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(255,45,107,0.28);
}

.cta-secondary {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.cta-primary:hover,
.cta-secondary:hover {
  transform: translateY(-1px);
}

.info-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem 0.95rem;
}

.story-preview-frame {
  width: min(100%, 23rem);
  margin-top: 1.25rem;
  border-radius: 2rem;
  padding: 0.8rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.32);
}

.story-preview-card {
  min-height: 38rem;
  border-radius: 1.7rem;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(115, 255, 213, 0.14), transparent 24%),
    radial-gradient(circle at bottom left, rgba(255, 143, 112, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(56, 64, 125, 0.95), rgba(14, 21, 37, 0.98));
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  line-height: 1.6;
}

.feature-dot {
  margin-top: 0.45rem;
  height: 0.55rem;
  width: 0.55rem;
  flex: 0 0 auto;
  border-radius: 9999px;
  background: var(--gradient-cta);
  box-shadow: 0 0 0 6px rgba(255,45,107,0.08);
}

.metric-card {
  border-radius: 1.65rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.4rem;
  box-shadow: var(--shadow-soft);
}

.metric-card-dark {
  background: var(--surface-2);
}

.metric-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.metric-value {
  margin-top: 0.7rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-note {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.flow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
}

.flow-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.preset-rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: scroll;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.preset-rail-wrap {
  position: relative;
  padding: 0 2.4rem;
}

.preset-scroll-btn {
  position: relative;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.preset-scroll-btn-left {
  left: auto;
}

.preset-scroll-btn-right {
  right: auto;
}

.preset-rail::-webkit-scrollbar {
  height: 0;
}

.template-card {
    position: relative;
    display: block;
    flex: 0 0 270px;
    width: 270px;
    min-width: 270px;
    min-height: 430px;
    overflow: hidden;
    border-radius: 2rem;
    /* border: 1px solid rgba(255, 255, 255, 0.12); */
    background: #f6f6f8;
    box-shadow: 0 26px 70px rgba(3, 8, 24, 0.34);
    scroll-snap-align: start;
    text-align: left;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.template-card:hover,
.template-card.is-selected {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-mid);
}

.template-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 42%;
    background: linear-gradient(
      135deg,
      var(--card-start) 0%,
      color-mix(in srgb, var(--card-start) 50%, var(--card-end) 50%) 52%,
      var(--card-end) 100%
    );
}

.template-card-avatar {
  position: absolute;
  z-index: 2;
  top: 1.15rem;
  left: 50%;
  width: 3.6rem;
  height: 3.6rem;
  margin-left: -1.8rem;
  border-radius: 999px;
  overflow: visible;
  background: radial-gradient(circle at 50% 32%, #a8a8a8 0 20%, transparent 21%), linear-gradient(180deg, #efefef, #cfcfcf);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.4);
}

.template-card-avatar-custom {
  overflow: visible;
  box-shadow: 0 10px 22px rgba(2, 8, 24, 0.28), inset 0 0 0 3px rgba(255, 255, 255, 0.42);
}

.template-card-avatar-upload {
  cursor: pointer;
}

.template-card-avatar-edit {
  position: absolute;
  z-index: 5;
  right: -0.08rem;
  bottom: -0.08rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 1px 5px rgba(2, 8, 24, 0.35);
}

.template-card-avatar.has-image {
  background: #d1d5db;
  box-shadow: 0 10px 22px rgba(2, 8, 24, 0.28), inset 0 0 0 3px rgba(255, 255, 255, 0.42);
}

.template-card-avatar-image-hidden {
  display: none;
}

.template-card-avatar.has-image .template-card-avatar-image-hidden {
  display: block;
}

.template-card-custom {
  background: linear-gradient(145deg, rgba(194, 159, 148, 0.88), rgba(66, 77, 104, 0.82));
  isolation: isolate;
}

.template-card-custom .template-card-banner {
  display: flex;
  z-index: 3;
}

.template-card-custom .template-card-avatar {
  top: 0.7rem;
  width: 2.7rem;
  height: 2.7rem;
  margin-left: -1.35rem;
  z-index: 4;
  pointer-events: auto;
}

.template-card-custom .template-card-body {
  top: 12.6rem;
  bottom: 0;
  min-height: auto;
  padding: 0.8rem 1rem 2.9rem;
  background: transparent;
}

.template-card-custom .template-card-question-input {
  max-width: 14ch;
  min-height: 4.8rem;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
  font-size: 1.55rem;
  line-height: 1.03;
  text-shadow: 0 2px 14px rgba(2, 8, 24, 0.55);
}

.template-card-custom .template-card-question-input::placeholder {
  color: rgba(255, 255, 255, 0.88);
  transition: opacity 140ms ease;
}

.template-card-custom .template-card-question-input.is-rotating::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.template-card-custom .template-card-question-input.is-placeholder-fading::placeholder {
  opacity: 0.12;
}

.template-card-dice {
  position: absolute;
  right: 0.68rem;
  bottom: 0.7rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #eef0f3;
  color: #111827;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(2, 8, 24, 0.16);
}
.template-card-custom::before {
  z-index: 0;
  background: linear-gradient(145deg, rgba(196, 149, 135, 0.55), rgba(88, 102, 132, 0.52));
}

.template-card-custom::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--custom-avatar-bg);
  background-size: cover;
  background-position: center;
  filter: blur(14px);
  transform: scale(1.12);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.template-card-custom.has-avatar-bg::after {
  opacity: 1;
}

.template-card-custom.has-avatar-bg::before {
  inset: 0;
  height: 100%;
  z-index: 1;
  background: rgba(5, 10, 20, 0.68);
}

.template-card-custom.has-avatar-bg .template-card-body {
  background: transparent;
}

.template-card-custom.has-avatar-bg .template-card-question-input {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
}

.template-card-custom.has-avatar-bg .template-card-question-input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

.template-card-custom .template-card-body {
  position: absolute;
  z-index: 2;
}

.template-card-custom .template-card-question-input {
  position: relative;
  z-index: 2;
}

.template-card-custom .template-card-dice {
  z-index: 2;
}

.template-card-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.template-card-banner {
  position: absolute;
  z-index: 2;
  top: 8.6rem;
  left: 2.1rem;
  right: 2.1rem;
  display: flex;
  justify-content: center;
}

.template-card-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.2rem;
  border-radius: 1.1rem;
  background: #080808;
  padding: 0.8rem 1.3rem;
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.template-card-body {
    position: absolute;
    left: 0px;
    right: 0;
    bottom: 29px;
    display: flex;
    min-height: 42%;
    align-items: center;
    justify-content: center;
    padding: 1.7rem 1.4rem 1.8rem;
    background: var(--surface);
}

.template-card-dice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.template-card-dice:hover {
  transform: rotate(20deg);
}

.template-card-question {
  display: block;
  max-width: 14ch;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.03;
  color: #0b0b0d;
}

.template-card-question-editable {
  min-height: 4.2rem;
  width: 100%;
  max-width: 14ch;
  outline: none;
  cursor: text;
}

.template-card-question-editable:empty::before {
  content: attr(data-placeholder);
  color: #1f2937;
  opacity: 0.85;
}

.template-card-question-input {
  width: 100%;
  max-width: 13ch;
  min-height: 4rem;
  border: 0;
  resize: none;
  outline: none;
  background: transparent;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--accent);
  direction: ltr;
  unicode-bidi: plaintext;
  overflow: hidden;
}

.template-card-question-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.public-question-shell {
  padding: 0.45rem 0 1.4rem;
}

.public-question-top {
  text-align: center;
  margin-bottom: 1rem;
}

.public-question-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.public-question-title {
  margin-top: 0.7rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.02;
  color: var(--text-primary);
}

.public-card {
  overflow: hidden;
  border-radius: 1.65rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 60px rgba(3, 8, 24, 0.32);
}

.public-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  background: #ffffff;
}

.public-card-avatar {
  display: inline-flex;
  width: 3.25rem;
  height: 3.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--gradient-cta);
  color: #ffffff;
  font-weight: 800;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.public-card-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.public-card-meta {
  min-width: 0;
}

.public-card-username {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.public-card-bio {
  margin-top: 0.16rem;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.12;
  color: var(--text-primary);
}

.public-card-body {
  min-height: 170px;
  background: linear-gradient(160deg, #ff9a56 0%, #ff6b6b 40%, #e91e8c 100%);
}

.public-card-textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 0;
  background: transparent;
  padding: 1rem 1rem 1.1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.55;
  color: #ffffff;
  outline: none;
}

.public-card-textarea::placeholder {
  color: rgba(255, 255, 255, 0.82);
}

.public-card-anon {
  padding: 0.7rem 1rem 0.9rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.public-card-message-empty {
  padding: 1.6rem;
  font-weight: 700;
  color: #1f2937;
}

.public-story-preview-wrap {
  margin-top: 1rem;
  border-radius: 1.6rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0.85rem;
}

.public-story-preview {
  width: 100%;
  border-radius: 1.3rem;
  box-shadow: 0 22px 50px rgba(3, 8, 24, 0.32);
}

.public-send-btn {
  width: 100%;
  border: 0;
  border-radius: 9999px;
  background: var(--gradient-cta);
  padding: 1rem 1.2rem;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(255,45,107,0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.public-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(255,45,107,0.36);
}

.public-proof {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
}

.preset-step-card {
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.preset-step-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
}

.preset-link-preview {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-all;
  min-height: 2.5rem;
}

.preset-step-btn {
  width: 100%;
  margin-top: 0.95rem;
  border-radius: 9999px;
  border: 0;
  padding: 0.88rem 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  transition: transform 180ms ease, opacity 180ms ease;
  touch-action: manipulation;
}

.preset-step-btn:hover {
  transform: translateY(-1px);
}

.preset-step-btn-copy {
  border: 2px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
}

.preset-step-btn-share {
  background: linear-gradient(90deg, #ff00a8, #ff0030 58%, #ff1d00);
  color: #fff;
}

.create-flow {
  max-width: 460px;
  margin: 0 auto;
}

.create-shell {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding-top: 0.5rem;
}

.create-topbar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.create-top-tab {
  justify-self: center;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #d1d5db;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.create-top-tab-active {
  color: #111827;
}

.create-top-tab-muted {
  color: #d1d5db;
}

.create-top-dot {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 999px;
  background: #ff1f39;
  display: inline-block;
}

.create-top-gear {
  justify-self: end;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 9999px;
  background: #eceef2;
  border: 1px solid #dde1e8;
  color: #8b93a3;
  font-size: 1.35rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.create-flow .preset-rail {
  gap: 0.65rem;
  padding: 0 0.9rem 0.2rem;
  scroll-snap-type: x mandatory;
}

.create-flow .template-card {
    flex: 0 0 82%;
    width: 82%;
    min-width: 82%;
    min-height: 300px;
    border-radius: 2rem;
    border: 1px solid #e6eaf2;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
    scroll-snap-align: center;
}

.create-flow .preset-scroll-btn {
  display: none;
}

.create-carousel-dots {
  margin-top: 0.6rem;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.create-carousel-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 9999px;
  background: #d1d5db;
}

.create-carousel-dot.is-active {
  background: #29a6ff;
}

.create-flow .template-card-avatar {
  width: 3.3rem;
  height: 3.3rem;
  margin-left: -1.65rem;
}

.create-flow .template-card-banner {
    top: 5.2rem;
    left: 1rem;
    right: 1rem;
}

.create-flow .template-card-title {
    min-height: 0.35rem;
    border-radius: 1.05rem;
    padding: 0.62rem 1rem;
    font-size: 1.08rem;
}

.create-flow .template-card:not(.template-card-custom) .template-card-title {
  background: transparent;
  padding: 0.3rem 0.55rem;
  min-height: 0;
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: none;
  text-shadow:
    0 2px 0 rgba(21, 37, 66, 0.38),
    0 0 0 #ffffff,
    1px 0 0 #ffffff,
    -1px 0 0 #ffffff,
    0 1px 0 #ffffff,
    0 -1px 0 #ffffff;
}

.create-flow .template-card-custom .template-card-title {
  background: rgba(13, 16, 26, 0.82);
}

.create-flow .template-card-custom .template-card-avatar {
  top: 0.7rem;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: -1.25rem;
}

.create-flow .template-card-custom .template-card-body {
  top: 7.7rem;
  min-height: auto;
  padding: 0.75rem 0.85rem 2.35rem;
}

.create-flow .template-card-custom .template-card-question-input {
  font-size: 0.95rem;
  min-height: 3.7rem;
  max-width: 15ch;
}

.create-flow .template-card-body {
  padding: 0.95rem 0.95rem 1.2rem;
}

.create-flow .template-card-question {
    max-width: 17ch;
    font-size: 0.78rem;
    line-height: 1.06;
    font-weight: 900;
}

.create-flow .template-card-question-input {
  max-width: 14ch;
  min-height: 3.7rem;
  font-size: 1.15rem;
  line-height: 1.1;
}

.create-flow #presetActions,
.create-flow #questionResult {
  margin-bottom: calc(7rem + env(safe-area-inset-bottom));
}

.create-flow #presetActions {
  background: #eef0f4;
  border: 0;
  box-shadow: none;
  border-radius: 1.6rem;
  padding: 1rem;
}

.create-flow .preset-step-card {
  background: #eef0f4;
  border: 0;
  border-radius: 1.45rem;
  box-shadow: none;
  padding: 0.55rem 0.35rem;
}

.create-flow .preset-step-title {
  font-size: 1.05rem;
  color: #111827;
}

.create-flow .preset-link-preview {
  text-transform: uppercase;
  color: #9ca3af;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.create-flow .preset-step-btn-copy {
  background: #eef0f4;
  /* border: 3px solid #3b82f6; */
  /* color: #2563eb; */
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: lowercase;
}

.create-flow .preset-step-btn-share {
  border-radius: 9999px;
  /* background: linear-gradient(90deg, #14a7ff 0%, #5647f8 100%); */
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
}

.create-flow #storyImage {
  max-width: 220px;
  max-height: 392px;
}

.inbox-feed-shell {
  min-height: calc(100vh - 2rem);
  padding: 0.25rem 0 7.5rem;
  color: #101828;
}

.inbox-feed-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.4rem 0.15rem 0.8rem;
}

.inbox-feed-tab,
.inbox-feed-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.inbox-feed-tab-muted {
  justify-self: center;
  color: #d1d5db;
}

.inbox-feed-title {
  color: #000000;
}

.inbox-feed-gear {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.35rem;
  border: 1px solid var(--border);
}

.inbox-feed-list {
  margin-top: 0.15rem;
}

.inbox-feed-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1.05rem 0.1rem;
  border-top: 1px solid #e5e7eb;
  text-decoration: none;
}

.inbox-feed-item:first-child {
  border-top: 0;
}

.inbox-feed-avatar-wrap {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
}

.inbox-feed-avatar {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--surface-2);
  font-size: 2rem;
}

.inbox-feed-badge {
  position: absolute;
  top: -0.05rem;
  right: -0.15rem;
  display: none;
  width: 1.8rem;
  height: 1.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--success, #22c55e);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 0 0 4px var(--bg);
}

.inbox-feed-badge.is-read {
  display: inline-flex;
}

.inbox-feed-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.inbox-feed-message {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.inbox-feed-time {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.inbox-feed-arrow {
  color: var(--border);
  font-size: 2rem;
  line-height: 1;
}

.inbox-feed-empty {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 1rem 1.1rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-soft);
}

.inbox-feed-footer {
  position: fixed;
  left: 50%;
  bottom: calc(1.4rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 430px;
}

.inbox-feed-cta {
  width: 100%;
  border: 0;
  border-radius: 9999px;
  background: var(--gradient-cta);
  padding: 1rem 1.2rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(255,45,107,0.28);
}

.inbox-message-shell {
  min-height: calc(100vh - 2rem);
  padding: 0.1rem 0 3rem;
  text-align: center;
  color: var(--text-primary);
}

.inbox-message-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 2.8rem;
}

.inbox-message-icon {
  display: inline-flex;
  width: 2.9rem;
  height: 2.9rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.6rem;
  border: 1px solid var(--border);
}

/* Platform switcher: Snapchat | Instagram | WhatsApp */
.platform-switcher {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  align-items: center;
  background: var(--surface-2);
  border-radius: 9999px;
  padding: 0.25rem;
  border: 1px solid var(--border);
}

.platform-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.platform-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  flex-shrink: 0;
}

.platform-btn[data-platform="whatsapp"].platform-btn-active {
  background: #25d366;
  color: #ffffff;
}

.platform-btn[data-platform="instagram"].platform-btn-active {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  color: #ffffff;
}

.platform-btn[data-platform="snapchat"].platform-btn-active {
  background: #fffc00;
  color: #1a1a1a;
}

.inbox-message-card-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
}

.owner-inline-card {
  width: min(100%, 320px);
  border-radius: 1.15rem;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  background: #ffffff;
  position: relative;
  z-index: 1;
}

.owner-inline-card-header {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #ff00a8, #ff8820);
  color: #ffffff;
}

.owner-inline-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.owner-inline-card-body {
  background: #f8f8f8;
  color: #151515;
  min-height: 166px;
  padding: 1.2rem 1rem 1.35rem;
  display: grid;
  align-content: center;
  text-align: center;
}

.owner-inline-card-answer {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 800;
  word-break: break-word;
}

/* Background layer (hidden until a photo background is chosen) */
.inbox-message-bg {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}

/* When a photo background is active */
.inbox-message-card-wrap.has-bg {
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: 1.5rem;
  overflow: hidden;
}

.inbox-message-card-wrap.has-bg .inbox-message-bg {
  display: block;
}

.inbox-message-card-wrap.has-bg .owner-inline-card {
  width: 88%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.inbox-share-source {
  display: none;
}

.inbox-message-tools {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.inbox-message-tool {
  width: 3.3rem;
  height: 3.3rem;
  border: 0;
  border-radius: 9999px;
  background: #ececef;
}

.inbox-message-tool-color {
  background: conic-gradient(from 180deg, #ff2d55, #ff9500, #ffd60a, #30d158, #0a84ff, #bf5af2, #ff2d55);
}

.inbox-message-tool-camera {
  color: #9ca3af;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

label.inbox-message-tool {
  cursor: pointer;
}

.inbox-message-brand {
  margin-top: 1.8rem;
  font-size: 0.95rem;
  color: #111827;
}

.inbox-message-actions {
  margin-top: 1.35rem;
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

.inbox-message-reply,
.inbox-message-download {
  width: min(100%, 27rem);
  border-radius: 9999px;
  padding: 1rem 1.2rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.inbox-message-reply {
  border: 0;
  background: #000000;
  color: #ffffff;
}

.inbox-message-download {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
  .mobile-app-frame {
    padding-bottom: calc(11rem + env(safe-area-inset-bottom));
  }

  .story-preview-card {
    min-height: 31rem;
  }

  .hero-panel,
  .glass-panel,
  .metric-card,
  .public-card,
  .preset-step-card {
    border-radius: 1.35rem !important;
  }

  .preset-scroll-btn {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 1.1rem;
  }

  #createQuestionForm {
    margin-bottom: 0.5rem;
  }

  .create-flow #presetActions,
  .create-flow #questionResult {
    margin-bottom: calc(7.5rem + env(safe-area-inset-bottom));
    padding-bottom: 0.25rem;
  }

  button,
  a,
  .template-card {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .public-question-title {
    font-size: 1.55rem;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .preset-step-title {
    font-size: 1.15rem;
  }

  .story-preview-frame {
    width: 100%;
    max-width: 15rem;
  }

  .site-shell {
    padding-bottom: calc(env(safe-area-inset-bottom) + 0.35rem);
  }

  .inbox-surface-frame {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-bottom: 1rem;
  }

  .inbox-feed-shell,
  .inbox-message-shell {
    min-height: calc(100vh - 1rem);
  }
}

@media (min-width: 769px) {
  .mobile-app-frame {
    width: min(100%, 1200px);
  }
}
