/* ─── Phone frame + in-phone app screens ───────────────────────────────────
 * The screen reproduces the real MOHE app (lib/features/swipe, chat) at a 390pt
 * logical width. Every in-screen size is expressed in `--u` = 1 logical pt, which
 * scales with the frame width via container query units, so the mock stays
 * proportional from the 200px home mock to the 330px demo phone. */

.phone {
  width: clamp(200px, 20vw, 250px);
  aspect-ratio: 393 / 852;
  padding: 10px;
  background: var(--phone-bezel);
  border-radius: 44px;
  box-shadow:
    0 0 0 2px #2d2b48,
    0 36px 60px -24px rgba(30, 22, 90, 0.55);
}
.phone__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 36px;
  background: var(--white);
  color: var(--neutral-800);
  overflow: hidden;
  container-type: inline-size;
  contain: inline-size; /* content (nowrap chips, bubbles) must not widen the phone */
  --u: calc(100cqw / 390);
  font-family: 'Roboto', var(--font-sans);
}
.phone--demo {
  width: clamp(280px, 24vw, 330px);
}

/* Status bar — dynamic island, time, signal (app SafeArea top = 47pt). */
.app-status {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: calc(47 * var(--u));
  padding: 0 calc(28 * var(--u)) calc(10 * var(--u));
  font-size: calc(15 * var(--u));
  font-weight: 600;
}
.app-status::before {
  content: '';
  position: absolute;
  top: calc(11 * var(--u));
  left: 50%;
  width: calc(120 * var(--u));
  height: calc(34 * var(--u));
  transform: translateX(-50%);
  border-radius: calc(20 * var(--u));
  background: #0a0a14;
}
.app-signal {
  display: inline-flex;
  gap: calc(2 * var(--u));
  align-items: flex-end;
  height: calc(12 * var(--u));
}
.app-signal i {
  width: calc(3 * var(--u));
  border-radius: 1px;
  background: currentColor;
}
.app-signal i:nth-child(1) { height: 40%; }
.app-signal i:nth-child(2) { height: 60%; }
.app-signal i:nth-child(3) { height: 80%; }
.app-signal i:nth-child(4) { height: 100%; }

/* ── Swipe tab ─────────────────────────────────────────────────────────── */
.app-swipe__top {
  height: calc(44 * var(--u)); /* top bar area left white, as in the app */
}
.app-swipe__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--neutral-300);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* A swipe card — square corners (Figma 22032:2418), photo cover, bottom scrim. */
.deck-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--neutral-300);
  transform-origin: 50% 110%;
  will-change: transform;
  transition: transform var(--duration-normal) var(--ease-out-expo), opacity var(--duration-normal);
}
.deck-card[data-depth='1'] { transform: scale(0.97); }
.deck-card[data-depth='2'] { transform: scale(0.94); }
.deck-card:not([data-depth='0']) > :not(.deck-card__photo) {
  display: none; /* only the top card carries UI chrome */
}
.deck-card.is-dragging {
  transition: none;
  cursor: grabbing;
}
.deck-card.is-leaving {
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.3, 1), opacity 420ms;
  opacity: 0;
  pointer-events: none;
}
.deck-card > .fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--duration-normal);
  pointer-events: none;
}
.deck-card[data-fx-ready] > .fx-canvas {
  opacity: 1;
}
.deck-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.deck-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.8) 100%);
  pointer-events: none;
}
/* Photo carousel dots: 10pt, gap 10, 33pt from the top (profileCarouselDotsTop). */
.deck-card__dots {
  position: absolute;
  top: calc(33 * var(--u));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: calc(10 * var(--u));
  pointer-events: none;
}
.deck-card__dots i {
  width: calc(10 * var(--u));
  height: calc(10 * var(--u));
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 0.5px var(--border);
}
.deck-card__dots i:first-child {
  background: var(--brand);
}
.deck-card__info-btn {
  position: absolute;
  top: calc(23 * var(--u));
  right: calc(20 * var(--u));
  width: calc(30 * var(--u));
  height: auto;
  pointer-events: none;
}
/* Right-hand filter / profile buttons (50pt and 49pt). */
.deck-card__side {
  position: absolute;
  right: calc(20 * var(--u));
  bottom: calc(27 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(10 * var(--u));
  pointer-events: none;
}
.deck-card__side img {
  width: calc(50 * var(--u));
  height: auto;
}
/* Decision stamps while dragging. */
.deck-card__stamp {
  position: absolute;
  top: calc(90 * var(--u));
  display: grid;
  place-items: center;
  width: calc(64 * var(--u));
  height: calc(64 * var(--u));
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 60ms, transform 120ms var(--ease-out-expo);
}
.deck-card__stamp--like { right: calc(20 * var(--u)); }
.deck-card__stamp--pass { left: calc(20 * var(--u)); }
.deck-card__stamp .glyph {
  width: calc(32 * var(--u));
  height: calc(32 * var(--u));
  background: var(--brand);
}
.deck-card[data-decision='like'] .deck-card__stamp--like,
.deck-card[data-decision='pass'] .deck-card__stamp--pass {
  opacity: 1;
  transform: scale(1);
}
/* Soft colour wash toward the drag direction (web-only hint; the app has none). */
.deck-card__scrim {
  transition: box-shadow 120ms;
}
.deck-card[data-decision='like'] .deck-card__scrim {
  box-shadow: inset calc(-28 * var(--u)) 0 calc(60 * var(--u)) calc(-20 * var(--u)) rgba(145, 126, 255, 0.55);
}
.deck-card[data-decision='pass'] .deck-card__scrim {
  box-shadow: inset calc(28 * var(--u)) 0 calc(60 * var(--u)) calc(-20 * var(--u)) rgba(80, 80, 100, 0.55);
}

/* ProfileInfoOverlay — left 20, bottom 13; pill → name row → distance row. */
.deck-card__info {
  position: absolute;
  left: calc(20 * var(--u));
  right: calc(90 * var(--u));
  bottom: calc(13 * var(--u));
  color: var(--white);
}
.online-pill {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--u));
  height: calc(22 * var(--u));
  padding: 0 calc(6 * var(--u));
  border-radius: calc(11 * var(--u));
  background: var(--brand);
  font-size: calc(16 * var(--u));
  line-height: 1;
}
.online-pill::before {
  content: '';
  width: calc(10 * var(--u));
  height: calc(10 * var(--u));
  border-radius: 50%;
  background: #00ff65;
}
.online-pill + .deck-card__name {
  margin-top: calc(5 * var(--u));
}
.deck-card__name {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  font-size: calc(25 * var(--u));
  font-weight: 700;
  line-height: calc(29 * var(--u));
  white-space: nowrap;
}
.deck-card__name .flag-sm {
  width: calc(30 * var(--u));
  height: calc(21 * var(--u));
  border-radius: calc(4 * var(--u));
  object-fit: cover;
  box-shadow: 0 0 0 0.5px var(--border);
}
.deck-card__name .badge {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
}
.deck-card__distance {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  margin-top: calc(5 * var(--u));
  font-size: calc(16 * var(--u));
  font-weight: 500;
  line-height: calc(24 * var(--u));
}
.deck-card__distance .pin {
  width: calc(17 * var(--u));
  height: calc(20 * var(--u));
}
.deck-card__distance .sns {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
}

/* SwipeActionBar — 70pt, padding 34, buttons 44·55·55·44, white discs. */
.app-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(70 * var(--u));
  padding: 0 calc(34 * var(--u));
}
.action-btn {
  display: grid;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 calc(2 * var(--u)) calc(10 * var(--u)) rgba(53, 41, 140, 0.16), var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out-expo), box-shadow var(--duration-fast);
}
.action-btn:hover { transform: translateY(-2px); }
.action-btn:active { transform: scale(0.94); }
.action-btn--lg {
  width: calc(55 * var(--u));
  height: calc(55 * var(--u));
}
.action-btn--static {
  cursor: default;
  pointer-events: none;
}
.glyph {
  display: block;
  width: calc(21 * var(--u));
  height: calc(21 * var(--u));
  background: #9a95b9; /* swipeActionGlyph */
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}
.action-btn--lg .glyph {
  width: calc(39 * var(--u));
  height: calc(39 * var(--u));
  background: var(--brand);
}
.action-btn img {
  width: calc(27 * var(--u));
  height: auto;
}
.glyph--rewind { --glyph: url('../assets/icons/rewind.svg'); }
.glyph--pass { --glyph: url('../assets/icons/pass.svg'); }
.glyph--like { --glyph: url('../assets/icons/like.svg'); }
.glyph--photo { --glyph: url('../assets/icons/photo.svg'); }
.glyph--emoji { --glyph: url('../assets/icons/emoji.svg'); }

/* Bottom navigation — 64pt, five tabs (swipe · feed · mohe · messages · profile). */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: calc(64 * var(--u));
  padding: 0 calc(12 * var(--u));
}
.app-nav img {
  width: calc(32 * var(--u));
  height: calc(30 * var(--u));
  object-fit: contain;
}
.app-home {
  display: block;
  width: calc(134 * var(--u));
  height: calc(5 * var(--u));
  margin: 0 auto calc(8 * var(--u));
  border-radius: calc(3 * var(--u));
  background: #d0d2e6;
}

/* Deck end state (demo only). */
.deck-end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--u));
  padding: calc(24 * var(--u));
  text-align: center;
  background: var(--brand-surface-light);
}
.deck-end img {
  width: calc(96 * var(--u));
  height: auto;
}
.deck-end__title {
  margin: calc(8 * var(--u)) 0 0;
  font-size: calc(18 * var(--u));
  font-weight: 700;
  color: var(--ink);
}
.deck-end p {
  font-size: calc(14 * var(--u));
  color: var(--ink-soft);
}
.deck-end__more {
  margin-top: calc(6 * var(--u));
  font-size: calc(13 * var(--u));
  font-weight: 500;
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.deck-end .btn {
  margin-top: calc(8 * var(--u));
  min-height: calc(44 * var(--u));
  padding: calc(10 * var(--u)) calc(22 * var(--u));
  font-size: calc(15 * var(--u));
}

/* ── Chat room ─────────────────────────────────────────────────────────── */
.app-chat {
  background: var(--neutral-300); /* app: Scaffold neutral300 behind the messages */
}
.app-chat .app-status {
  background: var(--white);
}
.chat-appbar {
  display: flex;
  align-items: center;
  gap: calc(16 * var(--u));
  height: calc(64 * var(--u));
  padding: 0 calc(16 * var(--u)) 0 calc(8 * var(--u));
  background: var(--white);
}
.chat-appbar__back {
  display: grid;
  place-items: center;
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  border-radius: 50%;
  color: var(--neutral-800);
}
.chat-appbar__back .icon {
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
}
.chat-appbar__avatar {
  width: calc(50 * var(--u));
  height: calc(50 * var(--u));
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #bababa;
}
.chat-appbar__name {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  min-width: 0;
  font-size: calc(18 * var(--u));
  font-weight: 700;
  color: var(--neutral-900);
  white-space: nowrap;
}
.chat-appbar__name .flag-sm {
  width: calc(24 * var(--u));
  height: calc(16 * var(--u));
  border-radius: calc(3 * var(--u));
  object-fit: cover;
  box-shadow: 0 0 0 0.5px var(--border);
}
.chat-appbar__name .badge {
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
}
.chat-appbar__spacer { flex: 1; }
.demo-chip {
  display: inline-flex;
  align-items: center;
  height: calc(22 * var(--u));
  padding: 0 calc(10 * var(--u));
  border-radius: var(--radius-pill);
  background: var(--brand-surface-light);
  border: 1px solid var(--border);
  font-size: calc(11 * var(--u));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--u));
  padding: calc(16 * var(--u)) calc(16 * var(--u)) calc(8 * var(--u));
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.chat-log::-webkit-scrollbar { display: none; }
.chat-log .msg {
  display: flex;
  align-items: flex-start;
  gap: calc(10 * var(--u));
}
.chat-log .msg--out { justify-content: flex-end; }
.chat-log .msg__avatar {
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #bababa;
  flex: none;
}
.chat-log .msg__body {
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  max-width: 78%;
}
.chat-log .msg--out .msg__body { align-items: flex-end; }
.chat-log .bubble {
  padding: calc(8 * var(--u)) calc(20 * var(--u));
  font-size: calc(14 * var(--u));
  line-height: 1.5;
  border-radius: calc(20 * var(--u));
  background: var(--white);
  color: #101010;
  overflow-wrap: anywhere;
}
.chat-log .msg--in .bubble { border-bottom-left-radius: 0; }
.chat-log .msg--out .bubble {
  padding-block: calc(10 * var(--u));
  background: var(--brand);
  color: var(--white);
  border-bottom-right-radius: 0;
}
.chat-log time {
  font-size: calc(12 * var(--u));
  color: #3f3f3f;
}
.msg--system { justify-content: center; }
.msg--system .bubble {
  background: transparent;
  color: var(--neutral-700);
  font-size: calc(12 * var(--u));
  text-align: center;
}
.typing {
  display: inline-flex;
  gap: calc(4 * var(--u));
  align-items: center;
  height: calc(36 * var(--u));
  padding: 0 calc(16 * var(--u));
  border-radius: calc(20 * var(--u));
  border-bottom-left-radius: 0;
  background: var(--white);
}
.typing i {
  width: calc(6 * var(--u));
  height: calc(6 * var(--u));
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.4;
  animation: typingDot 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(calc(-4 * var(--u))); opacity: 1; }
}
.nudge {
  margin: calc(4 * var(--u)) 0 0;
  padding: calc(14 * var(--u));
  border-radius: calc(16 * var(--u));
  background: var(--white);
  text-align: center;
}
.nudge strong {
  display: block;
  font-size: calc(14 * var(--u));
  color: var(--ink);
}
.nudge p {
  margin-top: calc(4 * var(--u));
  font-size: calc(12 * var(--u));
  color: var(--ink-soft);
}
.nudge .btn {
  margin-top: calc(10 * var(--u));
  min-height: calc(40 * var(--u));
  padding: calc(8 * var(--u)) calc(18 * var(--u));
  font-size: calc(14 * var(--u));
}

/* Quick replies (demo helper, sits on the message area above the composer). */
.quick-replies {
  display: flex;
  width: 0;
  min-width: 100%;
  gap: calc(8 * var(--u));
  padding: calc(6 * var(--u)) calc(16 * var(--u)) calc(8 * var(--u));
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 40px), transparent 100%);
}
.quick-replies::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: none;
  height: calc(28 * var(--u));
  padding: 0 calc(12 * var(--u));
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--white);
  font: inherit;
  font-size: calc(11 * var(--u));
  color: var(--brand-dark);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast);
}
.chip-btn:hover { background: var(--brand-surface-light); }

/* ChatComposer — white bar, pill input (border), photo/emoji icons, brand send disc. */
.composer {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  padding: calc(10 * var(--u)) calc(16 * var(--u)) calc(28 * var(--u));
  background: var(--white);
}
.composer__field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  min-height: calc(44 * var(--u));
  padding: 0 calc(6 * var(--u)) 0 calc(20 * var(--u));
  border-radius: var(--radius-pill);
  border: 1px solid var(--neutral-200);
  background: var(--white);
}
.composer__field:focus-within { border-color: var(--brand); }
.composer__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: calc(15 * var(--u));
  color: var(--neutral-800);
  outline: none;
}
.composer__input::placeholder { color: var(--neutral-500); }
.composer__icon {
  display: grid;
  place-items: center;
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #3f3f3f;
  cursor: pointer;
}
.composer__icon .glyph {
  width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  background: #3f3f3f;
}
.composer__icon .icon {
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
}
.composer__icon:hover { background: var(--brand-surface-light); }
.composer__send {
  display: grid;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  cursor: pointer;
  transition: background-color var(--duration-fast), transform var(--duration-fast);
}
.composer__send:hover { background: var(--brand-dark); }
.composer__send:disabled {
  background: var(--neutral-200);
  color: var(--neutral-500);
  cursor: default;
}
.composer__send .icon {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
}
