@font-face {
  font-family: 'Inter Preview';
  src: url('../assets/fonts/inter-preview.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto Preview';
  src: url('../assets/fonts/roboto-preview.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Segoe UI Web';
  src: url('../assets/fonts/segoeui-web-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Segoe UI Web';
  src: url('../assets/fonts/segoeui-web-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Segoe UI Web';
  src: url('../assets/fonts/segoeui-web-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-stack-system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-stack-inter: 'Inter Preview', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-stack-roboto: 'Roboto Preview', Roboto, 'Noto Sans', 'Droid Sans', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-stack-segoe: 'Segoe UI Variable Text', 'Segoe UI Variable Display', 'Segoe UI Variable', 'Segoe UI Web', 'Segoe UI', sans-serif;
  --font-ui-sans: var(--font-stack-system);
  --shell-stage-bg: #1a1a1a;
}

html[data-font-profile='inter'] {
  --font-ui-sans: var(--font-stack-inter);
}

html[data-font-profile='roboto'] {
  --font-ui-sans: var(--font-stack-roboto);
}

html[data-font-profile='segoe'] {
  --font-ui-sans: var(--font-stack-segoe);
}

html[data-shell-bg='white'] {
  --shell-stage-bg: #f5f4ef;
}

html[data-shell-bg='gray'] {
  --shell-stage-bg: #a9aaa4;
}

* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  background: var(--shell-stage-bg);
  font-family: var(--font-ui-sans);
  transition: background-color 180ms ease;
}

.phone-frame {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 48px;
  overflow: hidden;
  box-shadow: 0 0 2px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.14);
}

/* ===== Shell Switchers (Liquid Glass) ===== */
.device-switcher,
.font-switcher,
.background-switcher {
  position: fixed;
  right: 24px;
  z-index: 9999;
  display: flex;
  padding: 4px;
  border-radius: 14px;
  background: rgba(128, 128, 128, 0.15);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.5),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.06);
}

.device-switcher {
  top: 20px;
}

.font-switcher {
  top: 72px;
  gap: 2px;
}

.background-switcher {
  top: 124px;
  gap: 2px;
}

.device-tab,
.font-tab,
.background-tab {
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.device-tab,
.font-tab {
  padding: 7px 18px;
  color: rgba(255, 255, 255, 0.7);
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.font-tab {
  padding: 6px 12px;
  font-size: 12px;
}

.background-tab {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.background-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

.background-tab.active .background-swatch {
  transform: scale(1.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.background-tab[data-shell-bg='white'] .background-swatch {
  background: #f5f4ef;
}

.background-tab[data-shell-bg='gray'] .background-swatch {
  background: #a9aaa4;
}

.background-tab[data-shell-bg='black'] .background-swatch {
  background: #1a1a1a;
}

.font-tab[data-font-profile='system'] {
  font-family: var(--font-stack-system);
}

.font-tab[data-font-profile='inter'] {
  font-family: var(--font-stack-inter);
}

.font-tab[data-font-profile='roboto'] {
  font-family: var(--font-stack-roboto);
}

.font-tab[data-font-profile='segoe'] {
  font-family: var(--font-stack-segoe);
}

.device-tab.active,
.font-tab.active,
.background-tab.active {
  background: rgba(255, 255, 255, 0.72);
  color: rgba(0, 0, 0, 0.85);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.82),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.device-tab:hover:not(.active),
.font-tab:hover:not(.active),
.background-tab:hover:not(.active) {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

/* Light background (Copilot Mode or shell stage) */
body.copilot-mode .device-tab,
body.copilot-mode .font-tab,
html[data-shell-bg='white'] .device-tab,
html[data-shell-bg='white'] .font-tab,
html[data-shell-bg='gray'] .device-tab,
html[data-shell-bg='gray'] .font-tab {
  color: rgba(0, 0, 0, 0.5);
}
body.copilot-mode .device-tab.active,
body.copilot-mode .font-tab.active,
html[data-shell-bg='white'] .device-tab.active,
html[data-shell-bg='white'] .font-tab.active,
html[data-shell-bg='gray'] .device-tab.active,
html[data-shell-bg='gray'] .font-tab.active {
  color: rgba(0, 0, 0, 0.85);
}
body.copilot-mode .device-tab:hover:not(.active),
body.copilot-mode .font-tab:hover:not(.active),
html[data-shell-bg='white'] .device-tab:hover:not(.active),
html[data-shell-bg='white'] .font-tab:hover:not(.active),
html[data-shell-bg='gray'] .device-tab:hover:not(.active),
html[data-shell-bg='gray'] .font-tab:hover:not(.active) {
  color: rgba(0, 0, 0, 0.7);
}

/* ===== Device Views ===== */
.device-view {
  display: none;
}

.device-view.active {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.device-mobile {
  position: absolute;
  inset: 0;
}

.device-tablet {
  position: absolute;
  inset: 0;
}

.tablet-frame {
  width: 1376px;
  height: 1024px;
  border: none;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 0 2px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.14);
  transform-origin: center center;
  /* Scale down to fit viewport */
  transform: scale(var(--tablet-scale, 0.75));
}

.tab-swipe-backdrop {
  position: fixed;
  inset: 0;
  background: #6b6259;
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition: opacity 0.18s ease;
}

/* Voice call overlay */
.voice-call-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #f6efe7 0%, #e9dfd3 60%, #d9ccbb 100%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.voice-call-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.voice-call-stage {
  width: 100%;
  max-width: 520px;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}
.voice-call-orb {
  width: 180px;
  height: 180px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-call-orb-ring,
.voice-call-orb-ring.r2 {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffb872, #d97a3a 55%, #8a3f17 100%);
  opacity: 0.35;
  filter: blur(6px);
  transform: scale(0.85);
  animation: orb-pulse 3.6s ease-in-out infinite;
}
.voice-call-orb-ring.r2 {
  animation-delay: 1.8s;
}
.voice-call-orb-core {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd9b3, #ea9b58 45%, #a65822 100%);
  box-shadow: 0 12px 40px rgba(130, 60, 20, 0.3), inset 0 -8px 30px rgba(90, 40, 10, 0.35);
}
.voice-call-orb.listening .voice-call-orb-ring { animation-duration: 2.4s; opacity: 0.45; }
.voice-call-orb.thinking .voice-call-orb-ring { animation-duration: 1.6s; opacity: 0.65; filter: blur(10px); }
.voice-call-orb.speaking .voice-call-orb-ring { animation-duration: 0.9s; opacity: 0.75; filter: blur(4px); }
@keyframes orb-pulse {
  0%, 100% { transform: scale(0.85); }
  50% { transform: scale(1.12); }
}
.voice-call-transcript {
  min-height: 90px;
  font-size: 17px;
  line-height: 1.45;
  color: #3a3129;
  max-width: 440px;
}
.voice-call-user {
  color: #6a5a4c;
  font-style: italic;
  min-height: 24px;
  margin-bottom: 10px;
}
.voice-call-assistant {
  color: #2a231d;
  font-weight: 500;
  min-height: 24px;
}
.voice-call-status {
  font-size: 13px;
  color: #8a7b6c;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.voice-call-hangup {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(130, 60, 20, 0.12);
  color: #5a2a10;
  font-size: 24px;
  cursor: pointer;
}
.voice-call-hangup:active { opacity: 0.6; }

/* ===== Solution Switcher (Liquid Glass) ===== */
.solution-switcher {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(128, 128, 128, 0.15);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.5),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.06);
}

.solution-label {
  padding: 0 10px 0 8px;
  color: rgba(255, 255, 255, 0.75);
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  user-select: none;
}

.solution-tab {
  min-width: 30px;
  padding: 7px 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.solution-tab:hover {
  color: rgba(255, 255, 255, 0.95);
}

.solution-tab.active {
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ===== Per-solution overrides — define each solution's logic below =====
   Solution 1 = baseline (no overrides needed).
   Add rules like:  html[data-solution="2"] .uc-composer { ... }
*/

