/* FOOTPASS® Messenger · refined (monochrome, minimal) */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --fp-green: #00A37E;
  --fp-green-tick: #00A37E;
  --fp-black: #0F0F0F;
  --fp-half-white: #EAEAEA;
  --ios-gray-1: #F2F2F7;
  --ios-gray-2: #E5E5EA;
  --ios-gray-3: #8E8E93;
  --ios-gray-4: #1C1C1E;
  --bubble-received: #F2F2F4;
  --bubble-sent: #0F0F0F;
  --hairline: rgba(0,0,0,0.08);
  --hairline-dark: rgba(255,255,255,0.09);
  --phone-scale: 1;
}

html, body {
  width: 100%;
  height: 100%;
  background: #070708;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: #EAEAEA;
}

#root { width: 100%; height: 100%; }

/* ═══════ SCENE ═══════ */
.scene {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 1000px 800px at 75% 85%, rgba(234,234,234,0.025), transparent 65%),
    linear-gradient(160deg, #0A0A0B 0%, #141416 40%, #0A0A0B 100%);
  z-index: 0;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.008) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.008) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 1;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 85%);
}

/* ═══════ SCENE CHROME ═══════ */
.scene-chrome {
  position: absolute;
  top: 32px;
  left: 32px;
  right: 32px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand-logo {
  height: 18px;
  width: auto;
  display: block;
}
.brand-wordmark {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #EAEAEA;
}
.brand-wordmark sup {
  font-size: 7px;
  top: -6px;
  margin-left: 2px;
  color: rgba(234,234,234,0.55);
  font-weight: 700;
}
.scene-meta {
  padding-left: 18px;
  border-left: 0.5px solid rgba(234,234,234,0.2);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 9px;
  color: rgba(234,234,234,0.45);
  letter-spacing: 0.2em;
}

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.toggle-track {
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.12);
  padding: 2px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
}
.toggle-thumb {
  width: 23px;
  height: 23px;
  border-radius: 12px;
  background: #EAEAEA;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 300ms cubic-bezier(0.4,0,0.2,1), background 200ms;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle-thumb.right {
  transform: translateX(24px);
  background: #1C1C1E;
}

/* ═══════ PHONE ═══════ */
.phone-wrap {
  position: relative;
  z-index: 5;
  transform: scale(var(--phone-scale, 1));
  transform-origin: center center;
}

.phone {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: 55px;
  background: #1a1a1c;
  padding: 12px;
  box-shadow:
    0 0 0 2px #2a2a2d,
    0 0 0 2.5px #4a4a4e,
    0 0 0 3px #1a1a1c,
    0 50px 100px -20px rgba(0,0,0,0.5),
    inset 0 0 0 1px rgba(255,255,255,0.04);
}

.phone-bezel {
  position: absolute;
  inset: 0;
  border-radius: 55px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 20%, transparent 80%, rgba(255,255,255,0.04) 100%);
}

.dynamic-island {
  position: absolute;
  top: 23px;
  left: 50%;
  transform: translateX(-50%);
  width: 124px;
  height: 36px;
  border-radius: 20px;
  background: #000;
  z-index: 100;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.phone.dark .phone-screen { background: #000; }

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0,0,0,0.3);
  z-index: 200;
}
.phone.dark .home-indicator { background: rgba(255,255,255,0.35); }

.phone-shadow {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  height: 60px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.3), transparent 70%);
  filter: blur(20px);
  z-index: -1;
}

/* ═══════ APP ═══════ */
.app {
  width: 100%;
  height: 100%;
  background: #fff;
  color: #0F0F0F;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.app.dark { background: #0F0F0F; color: #EAEAEA; }

/* ═══════ STATUS BAR ═══════ */
.statusbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 8px;
  height: 54px;
  flex-shrink: 0;
}
.sb-time {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  padding-left: 14px;
}
.sb-right {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
}

/* ═══════ HEADER · clean, minimal ═══════ */
.header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 14px;
  border-bottom: 0.5px solid var(--hairline);
  flex-shrink: 0;
  background: #fff;
}
.header.dark {
  background: #0F0F0F;
  border-bottom-color: var(--hairline-dark);
}

.h-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 150ms, background 150ms;
  color: inherit;
}
.h-btn:active { transform: scale(0.92); background: rgba(0,0,0,0.04); }
.header.dark .h-btn:active { background: rgba(255,255,255,0.06); }

.h-back {
  position: relative;
  padding: 0;
  width: 36px;
  min-width: 36px;
}

.h-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.1);
  background: #F2F2F7;
}
.app.dark .avatar { box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.1); }

.h-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.h-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.h-name {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,163,126,0.12);
  color: #00A37E;
  flex-shrink: 0;
}
.app.dark .h-lock {
  background: rgba(0,196,154,0.16);
  color: #00C49A;
}
.h-role {
  font-size: 12px;
  color: var(--ios-gray-3);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-dot { margin: 0 5px; opacity: 0.5; }

.h-actions {
  display: flex;
  gap: 2px;
}

/* ═══════ THREAD ═══════ */
.thread {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 16px 12px;
  scroll-behavior: smooth;
  touch-action: pan-y;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Slide-left reveal: bubbles translate, timestamps revealed at right edge */
.thread .msg {
  transform: translateX(var(--slide-x, 0px));
  transition: transform 80ms linear;
  position: relative;
}
.thread .msg::after {
  content: attr(data-time);
  position: absolute;
  top: 50%;
  right: -52px;
  transform: translateY(-50%);
  font: 500 11px/1 'Inter', -apple-system, sans-serif;
  color: rgba(0,0,0,0.5);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: calc(var(--slide-x, 0px) / -56);
  transition: opacity 80ms linear;
}
.app.dark .thread .msg::after { color: rgba(234,234,234,0.6); }
.thread .msg[data-time=""]::after, .thread .msg:not([data-time])::after { content: none; }

.thread::-webkit-scrollbar { display: none; }

/* Floating date pill · appears while scrolling, fades out (WhatsApp style) */
.thread-floating-date {
  position: absolute;
  top: 118px;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms, transform 220ms;
}
.thread-floating-date.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.thread-floating-date span {
  display: inline-block;
  padding: 5px 13px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font: 600 10px/1 'Inter', -apple-system, sans-serif;
  letter-spacing: 0.10em;
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.app.dark .thread-floating-date span {
  background: rgba(255,255,255,0.18);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.day-label {
  display: block;
  margin: 18px auto 12px;
  padding: 5px 13px;
  width: fit-content;
  background: rgba(0,0,0,0.05);
  text-align: center;
  font-size: 10px;
  color: #8E8E93;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
}
.app.dark .day-label {
  background: rgba(255,255,255,0.09);
  color: #98989E;
}

/* ═══════ E2EE BANNER ═══════ */
.e2ee-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px auto 16px;
  padding: 7px 14px;
  max-width: fit-content;
  background: rgba(0,163,126,0.08);
  border-radius: 999px;
  font-size: 11px;
  color: #00A37E;
  font-weight: 500;
  letter-spacing: 0.005em;
}
.app.dark .e2ee-banner {
  background: rgba(0,196,154,0.12);
  color: #00C49A;
}

/* ═══════ TIME SEPARATOR ═══════ */
.time-sep {
  text-align: center;
  margin: 14px 0 8px;
  font-size: 11px;
  color: var(--ios-gray-3);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.time-sep span { padding: 0 8px; }

.msg {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}
.msg.received { align-items: flex-start; }
.msg.sent { align-items: flex-end; }
/* Group-aware spacing: tighter when same sender, breathing room on switch */
.msg + .msg { margin-top: 1px; }
.msg.received + .msg.sent,
.msg.sent + .msg.received { margin-top: 12px; }
/* Larger gap before a new day-label */
.day-label + .msg { margin-top: 4px; }
.msg + .day-label { margin-top: 14px; }

.bubble {
  max-width: 78%;
  padding: 8px 12px 7px;
  border-radius: 22px;
  font-size: 16px;
  line-height: 1.32;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  transition: transform 150ms cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.bubble:active { transform: scale(0.98); }

/* WhatsApp-style: text + inline meta (time + check) sharing the last line */
.bubble-text {
  display: inline;
}
.bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  float: right;
  margin: 8px 0 -2px 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(0,0,0,0.42);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateY(2px);
}
.bubble-time { line-height: 1; }
.bubble.sent .bubble-meta { color: rgba(255,255,255,0.7); }
.app.dark .bubble.received .bubble-meta { color: rgba(234,234,234,0.5); }
.app.dark .bubble.sent .bubble-meta { color: rgba(15,15,15,0.55); }

/* DoubleCheck color override inside sent bubble for legibility */
.bubble.sent .bubble-meta svg path { stroke: #00C49A; }
.app.dark .bubble.sent .bubble-meta svg path { stroke: #00A37E; }

.bubble.received {
  background: var(--bubble-received);
  color: #0F0F0F;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}
.app.dark .bubble.received {
  background: #1C1C1E;
  color: #EAEAEA;
}

.bubble.sent {
  background: var(--bubble-sent);
  color: #fff;
  border-radius: 18px;
  border-bottom-right-radius: 6px;
}
.app.dark .bubble.sent {
  background: #EAEAEA;
  color: #0F0F0F;
}

/* When same sender sends multiple in a row, soften corner of inner ones
   (handled via :not adjacent selectors below) */
.msg.received + .msg.received .bubble.received { border-bottom-left-radius: 18px; border-top-left-radius: 18px; }
.msg.received:has(+ .msg.received) .bubble.received { border-bottom-left-radius: 18px; }
.msg.sent + .msg.sent .bubble.sent { border-bottom-right-radius: 18px; border-top-right-radius: 18px; }
.msg.sent:has(+ .msg.sent) .bubble.sent { border-bottom-right-radius: 18px; }
/* Last in group always keeps its tail */
.msg.received:not(:has(+ .msg.received)) .bubble.received { border-bottom-left-radius: 6px; }
.msg.sent:not(:has(+ .msg.sent)) .bubble.sent { border-bottom-right-radius: 6px; }

/* legacy .msg-time / .time-sep · no longer used, hide if encountered */
.msg-time, .time-sep { display: none; }

.msg-time {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 400;
  color: var(--ios-gray-3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.msg.received .msg-time { padding-left: 10px; }
.msg.sent .msg-time { padding-right: 10px; }

/* ═══════ AUDIO BUBBLE ═══════ */
.bubble.audio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  min-width: 220px;
}
.audio-play {
  width: 34px; height: 34px; border-radius: 50%;
  background: #0F0F0F; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; padding-left: 2px;
  transition: transform 150ms;
}
.audio-play:active { transform: scale(0.92); }
.app.dark .audio-play { background: #EAEAEA; }
.app.dark .audio-play svg path, .app.dark .audio-play svg rect { fill: #0F0F0F; }
.audio-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.wave { height: 22px; display: flex; align-items: center; gap: 2px; }
.wbar { flex: 1; background: #C7C7CC; border-radius: 1px; min-height: 3px; }
.app.dark .wbar { background: #48484A; }
.wbar.played { background: #0F0F0F; }
.app.dark .wbar.played { background: #EAEAEA; }
.audio-duration {
  font-size: 10px; color: var(--ios-gray-3); font-weight: 500;
  letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
}
/* Audio bubble meta sits flush bottom-right, alongside duration */
.bubble.audio .bubble-meta.audio-meta {
  float: none;
  margin: 0 0 0 6px;
  align-self: flex-end;
  transform: none;
}

/* ═══════ COMPOSER · + | field | mic/send ═══════ */
.composer {
  padding: 8px 12px 28px;
  flex-shrink: 0;
  background: #fff;
  border-top: 0.5px solid var(--hairline);
}
.composer.dark { background: #0F0F0F; border-top-color: var(--hairline-dark); }

.composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.compose-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F2F2F7;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 200ms cubic-bezier(0.4,0,0.2,1), background 150ms;
  color: #0F0F0F;
  margin-bottom: 1px;
}
.compose-plus:active { transform: scale(0.9); }
.compose-plus.active {
  transform: rotate(45deg);
  background: #0F0F0F;
  color: #fff;
}
.compose-plus.active svg path { stroke: #fff; }
.composer.dark .compose-plus {
  background: #1C1C1E;
  color: #EAEAEA;
}
.composer.dark .compose-plus.active {
  background: #EAEAEA;
  color: #0F0F0F;
}
.composer.dark .compose-plus.active svg path { stroke: #0F0F0F; }

.compose-field {
  flex: 1;
  position: relative;
  background: #F2F2F7;
  border: none;
  border-radius: 20px;
  min-height: 34px;
  display: flex;
  align-items: center;
}
.composer.dark .compose-field { background: #1C1C1E; }
.composer.focused .compose-field { background: #EAEAEE; }
.composer.dark.focused .compose-field { background: #262629; }

.compose-input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: #0F0F0F;
  padding: 7px 14px;
  outline: none;
  letter-spacing: -0.01em;
}
.compose-input::placeholder { color: var(--ios-gray-3); font-weight: 400; }
.composer.dark .compose-input { color: #EAEAEA; }

.compose-mic-btn,
.compose-send {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-bottom: 1px;
  color: inherit;
  transition: transform 150ms;
}
.compose-mic-btn:active { transform: scale(0.88); }
.compose-send {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C49A 0%, #00A37E 100%);
  margin-bottom: 3px;
  box-shadow: 0 1px 3px rgba(0,163,126,0.35);
  animation: sendIn 240ms cubic-bezier(0.34,1.56,0.64,1);
}
.compose-send:active { transform: scale(0.88); }
@keyframes sendIn {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ─── Inline mic (transcription) · sits inside the field ─── */
.compose-inline-mic {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 2px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 160ms;
}
.compose-inline-mic:hover { opacity: 1; }
.compose-inline-mic:active { transform: scale(0.88); }

/* ─── Voice orb (audio recording) · round black ChatGPT-style ─── */
.compose-voice-orb {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #0F0F0F;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-bottom: 1px;
  transition: transform 150ms;
  position: relative;
}
.compose-voice-orb::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #00C49A, #0F0F0F, #0F0F0F, #0F0F0F, #00C49A);
  z-index: -1;
  opacity: 0;
  transition: opacity 200ms;
}
.compose-voice-orb:hover::before { opacity: 0.5; }
.compose-voice-orb:active { transform: scale(0.92); }
.composer.dark .compose-voice-orb { background: #fff; }

/* ═══════ PLUS MENU ═══════ */
.plus-menu {
  flex-shrink: 0;
  background: #F2F2F7;
  padding: 18px 14px 32px;
  animation: plusIn 220ms cubic-bezier(0.2, 0, 0, 1);
  z-index: 40;
}
.plus-menu.dark { background: #1C1C1E; }
@keyframes plusIn {
  from { transform: translateY(20%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.plus-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
}
.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 150ms;
}
.plus-item:active { transform: scale(0.94); }
.plus-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0F0F0F;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.plus-menu.dark .plus-icon {
  background: #2C2C2E;
  color: #EAEAEA;
}
.plus-item.accent .plus-icon {
  background: #fff;
  border: 1.5px solid rgba(0,163,126,0.25);
  box-shadow: 0 4px 12px rgba(0,163,126,0.12);
}
.plus-menu.dark .plus-item.accent .plus-icon {
  background: #2C2C2E;
  border-color: rgba(0,196,154,0.3);
}
.plus-label {
  font-size: 12px;
  font-weight: 500;
  color: #0F0F0F;
  letter-spacing: -0.01em;
}
.plus-menu.dark .plus-label { color: #EAEAEA; }
.plus-item.accent .plus-label { color: #00A37E; font-weight: 600; }
.plus-menu.dark .plus-item.accent .plus-label { color: #00C49A; }

/* ═══════ AUDIO RECORDER ═══════ */
.recorder {
  background: #fff;
  flex-shrink: 0;
  animation: recIn 200ms cubic-bezier(0.2, 0, 0, 1);
}
.recorder.dark { background: #0F0F0F; }
@keyframes recIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* v2 wraps content in column · old single-row layout still works
   when .rec-row is the direct child */
.rec-v2 {
  display: flex;
  flex-direction: column;
  padding: 0 0 28px;
}
.rec-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
}

/* Mode tabs */
.rec-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px 6px;
  border-top: 0.5px solid rgba(0,0,0,0.06);
}
.recorder.dark .rec-tabs { border-top-color: rgba(255,255,255,0.08); }
.rec-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  color: #5A5A5F;
  font: 500 12px/1 'Inter', -apple-system, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 160ms;
}
.recorder.dark .rec-tab { background: rgba(255,255,255,0.10); color: #B5B5BA; }
.rec-tab.on {
  background: #0F0F0F;
  color: #fff;
}
.recorder.dark .rec-tab.on { background: #fff; color: #0F0F0F; }
.rec-tab svg { opacity: 0.95; }

.rec-cancel {
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ios-gray-3);
  flex-shrink: 0;
}
.rec-cancel:active { transform: scale(0.88); }
.rec-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,59,48,0.08);
  padding: 8px 14px;
  border-radius: 22px;
  min-height: 36px;
}
.recorder.dark .rec-body { background: rgba(255,59,48,0.16); }
.rec-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF3B30;
  flex-shrink: 0;
  animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.rec-time {
  font-size: 14px;
  font-weight: 500;
  color: #FF3B30;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  min-width: 42px;
}
.rec-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  overflow: hidden;
}
.rec-wbar {
  flex: 1;
  background: #FF3B30;
  border-radius: 1px;
  min-height: 3px;
  animation: recBar 1.2s ease-in-out infinite;
  transform-origin: center;
}
@keyframes recBar {
  0%, 100% { height: 12%; opacity: 0.5; }
  50% { height: 80%; opacity: 1; }
}
.rec-send {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C49A 0%, #00A37E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,163,126,0.35);
  transition: transform 150ms;
}
.rec-send:active { transform: scale(0.9); }

/* ─── Transcription mode ─── */
.rec-transcribe {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 4px;
  gap: 12px;
  min-height: 200px;
}
.rec-tx-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 11px;
  border-bottom: 0.5px solid rgba(0,0,0,0.07);
}
.recorder.dark .rec-tx-head { border-bottom-color: rgba(255,255,255,0.09); }
.rec-tx-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  height: 32px;
  width: 32px;
  padding: 8px 7px;
  border-radius: 50%;
  background: rgba(0,163,126,0.1);
  flex-shrink: 0;
}
.recorder.dark .rec-tx-eq { background: rgba(0,196,154,0.14); }
.rec-tx-eq .rec-tx-eqbar { align-self: center; }
.rec-tx-eqbar {
  flex: 1;
  background: #00A37E;
  border-radius: 1px;
  min-height: 4px;
  animation: recTxEq 1.1s ease-in-out infinite;
}
@keyframes recTxEq {
  0%, 100% { height: 25%; opacity: 0.8; }
  50% { height: 90%; opacity: 1; }
}
.rec-tx-label { flex: 1; min-width: 0; }
.rec-tx-title {
  font: 600 15px/1.25 'Inter', -apple-system, sans-serif;
  color: #0F0F0F;
  letter-spacing: -0.022em;
}
.recorder.dark .rec-tx-title { color: #fff; }
.rec-tx-meta {
  margin-top: 2px;
  font: 400 11px/1.2 'Inter', -apple-system, sans-serif;
  color: var(--ios-gray-3);
  letter-spacing: 0.01em;
}
.recorder.dark .rec-tx-meta { color: #98989E; }
.rec-tx-close {
  width: 30px; height: 30px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  color: #5A5A5F;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms, transform 150ms;
}
.rec-tx-close:active { transform: scale(0.92); }
.recorder.dark .rec-tx-close {
  background: rgba(255,255,255,0.12);
  color: #B5B5BA;
}

.rec-tx-text {
  font: 400 17px/1.55 'Inter', -apple-system, sans-serif;
  color: #0F0F0F;
  letter-spacing: -0.012em;
  text-wrap: pretty;
  min-height: 92px;
  max-height: 168px;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 12px 15px;
  background: rgba(0,0,0,0.035);
  border-radius: 16px;
  border: 0.5px solid rgba(0,0,0,0.06);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 6px), transparent 100%);
}
.recorder.dark .rec-tx-text {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.09);
}
.rec-tx-w {
  display: inline;
  animation: recTxWord 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes recTxWord {
  from { opacity: 0; filter: blur(3px); }
  to { opacity: 1; filter: blur(0); }
}
.rec-tx-interim {
  color: #9A9AA0;
  opacity: 0.8;
}
.recorder.dark .rec-tx-interim { color: #888; }
@media (prefers-reduced-motion: reduce) { .rec-tx-w { animation: none; } }
.rec-tx-caret {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: #00A37E;
  margin-left: 2px;
  vertical-align: -3px;
  animation: recTxCaret 1s steps(2) infinite;
}
@keyframes recTxCaret {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.rec-tx-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rec-tx-secondary, .rec-tx-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  font: 590 14px/1 'Inter', -apple-system, sans-serif;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 150ms, background 150ms;
}
.rec-tx-secondary {
  flex: 1;
  background: rgba(0,0,0,0.05);
  color: #0F0F0F;
}
.recorder.dark .rec-tx-secondary {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.rec-tx-primary {
  flex: 1;
  background: linear-gradient(135deg, #00C49A 0%, #00A37E 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,163,126,0.32);
}
.rec-tx-secondary:active, .rec-tx-primary:active { transform: scale(0.97); }

/* When keyboard is open, composer loses bottom safe area (keyboard fills that) */
.app.kb-open .composer { padding-bottom: 0; padding-top: 6px; }


/* ═══════ KEYBOARD · iOS QWERTZ, uppercase shift-active ═══════ */
.kb {
  flex-shrink: 0;
  background: #D1D3D9;
  padding: 4px 3px 0;
  position: relative;
  z-index: 40;
  animation: kbIn 280ms cubic-bezier(0.2, 0, 0, 1);
}
.kb.dark { background: #2A2A2D; }
@keyframes kbIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Suggestions */
.kb-suggest {
  display: flex; align-items: center;
  padding: 10px 0 8px;
  font-size: 15px; color: #0F0F0F;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.kb.dark .kb-suggest { color: #EAEAEA; }
.kb-suggest > span:not(.kb-sep) {
  flex: 1; text-align: center;
}
.kb-sep {
  width: 1px; height: 20px;
  background: rgba(60,60,67,0.25);
  flex-shrink: 0;
}
.kb.dark .kb-sep { background: rgba(235,235,245,0.25); }

/* Rows */
.kb-rows {
  display: flex; flex-direction: column;
  gap: 11px;
  padding: 0 3px 8px;
}
.kb-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.kb-row-2 { padding: 0 21px; }

.kb-key {
  flex: 1; min-width: 0;
  height: 42px;
  background: #FCFCFD;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: 400;
  color: #0F0F0F;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 0 rgba(0,0,0,0.28);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  user-select: none;
  cursor: pointer;
}
.kb.dark .kb-key {
  background: #6C6C70;
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

/* Modifiers: shift / delete / 123 / emoji / return */
.kb-shift, .kb-delete {
  flex: 0 0 38px;
  background: #ADB3BC;
  color: #0F0F0F;
}
.kb.dark .kb-shift, .kb.dark .kb-delete {
  background: #48484A;
  color: #fff;
}
/* Shift active state (like the reference screenshot) */
.kb-shift-active {
  background: #FCFCFD !important;
  color: #0F0F0F !important;
}
.kb.dark .kb-shift-active {
  background: #EAEAEA !important;
}
.kb.dark .kb-shift-active svg path { stroke: #0F0F0F; fill: #0F0F0F; }

.kb-mod {
  background: #ADB3BC;
  color: #0F0F0F;
  font-size: 16px;
}
.kb.dark .kb-mod {
  background: #48484A;
  color: #fff;
}
.kb-wide { flex: 0 0 46px; }
.kb-emoji { flex: 0 0 38px; }
.kb-return { flex: 0 0 78px; font-size: 16px; font-weight: 400; }
.kb-space { flex: 1; position: relative; font-size: 16px; color: transparent; }
.kb-space-lang {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 500;
  color: rgba(60,60,67,0.45);
  letter-spacing: 0.04em;
}
.kb.dark .kb-space-lang { color: rgba(235,235,245,0.45); }

/* Bottom chrome bar (globe + mic) on black band */
.kb-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 12px;
  background: transparent;
}
.kb-chrome-btn {
  width: 30px; height: 30px;
  background: transparent; border: none;
  display: flex; align-items: center; justify-content: center;
  color: #0F0F0F;
  cursor: pointer;
  opacity: 0.85;
}
.kb.dark .kb-chrome-btn { color: #EAEAEA; }
.scene-footer {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
}
.footer-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 8.5px;
  color: rgba(234,234,234,0.35);
  letter-spacing: 0.2em;
}
.dot-sep { opacity: 0.5; }

@media (max-height: 820px) { .scene-footer { bottom: 14px; } }
@media (max-height: 760px) { .scene-footer { display: none; } }
@media (max-height: 640px) { .scene-chrome { display: none; } }

/* ═══════ SCENE FOOTER ═══════ */
