/* ==============================================================================
   apple-theme.css
   Signature Apple Dark Aesthetic: Pro Typography, Bento Grids, Glassmorphism,
   Full-Screen Responsive Scaling (Mobile to 4K Ultrawide),
   and Hardware-Accelerated 60/120fps Animations
   ============================================================================== */

:root {
  --apple-black: #000000;
  --apple-bg: #000000;
  --apple-surface: #161618;
  --apple-surface-hover: #1f1f23;
  --apple-card: rgba(22, 22, 24, 0.78);
  --apple-border: rgba(255, 255, 255, 0.08);
  --apple-border-hover: rgba(41, 151, 255, 0.35);
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-cyan: #2997ff;
  --apple-purple: #bf5af2;
  --apple-green: #30d158;
  --apple-orange: #ff9f0a;
  --apple-red: #ff453a;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-apple: cubic-bezier(0.16, 1, 0.3, 1);
  --max-content-width: min(1360px, 94vw);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-size: 16px;
}

body {
  background-color: var(--apple-black);
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  min-height: 100vh;
}

/* ==============================================================================
   Smooth Scroll Reveal Animations (IntersectionObserver)
   ============================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.85s var(--ease-apple), transform 0.85s var(--ease-apple);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ==============================================================================
   Ambient Glowing Background Light Orbs
   ============================================================================== */
.ambient-glow-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.glow-orb-primary {
  position: absolute;
  width: clamp(500px, 60vw, 900px);
  height: clamp(400px, 45vh, 650px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.22) 0%, rgba(41, 151, 255, 0.08) 45%, transparent 70%);
  filter: blur(90px);
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  animation: orb-breathe 10s ease-in-out infinite alternate;
}

.glow-orb-secondary {
  position: absolute;
  width: clamp(400px, 45vw, 700px);
  height: clamp(300px, 35vh, 500px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(191, 90, 242, 0.15) 0%, transparent 65%);
  filter: blur(100px);
  top: 300px;
  left: 55%;
  transform: translateX(-50%);
  animation: orb-breathe-subtle 14s ease-in-out infinite alternate-reverse;
}

@keyframes orb-breathe {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-48%) translateY(40px) scale(1.1); }
  100% { transform: translateX(-52%) translateY(-20px) scale(0.96); }
}

@keyframes orb-breathe-subtle {
  0% { transform: translateX(-50%) scale(0.95); opacity: 0.7; }
  100% { transform: translateX(-45%) scale(1.1); opacity: 1; }
}

/* ==============================================================================
   Header & Navigation (Full-Screen Fluid Frosted Glass)
   ============================================================================== */
.apple-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 54px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border-bottom: 1px solid var(--apple-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(20px, calc((100% - 1360px) / 2));
  transition: all 0.3s ease;
}

.apple-nav.scrolled {
  background: rgba(0, 0, 0, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

.apple-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity 0.2s;
}

.apple-brand:hover {
  opacity: 0.85;
}

.apple-brand .logo-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--apple-blue), var(--apple-cyan));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.4);
}

.apple-menu {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
}

.apple-menu a {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.apple-menu a:hover {
  color: var(--text-primary);
}

.nav-cta {
  background: var(--apple-blue);
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 7px 16px;
  border-radius: 980px;
  transition: all 0.25s var(--ease-apple);
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.3);
}

.nav-cta:hover {
  background: var(--apple-blue-hover);
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.5);
}

.apple-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--apple-border);
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 7px 16px;
  border-radius: 980px;
  text-decoration: none;
  transition: all 0.25s var(--ease-apple);
}

.apple-back-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(-3px);
  color: var(--apple-cyan) !important;
}

@media (max-width: 820px) {
  .apple-menu a:not(.nav-cta):not(.apple-back-btn):not([href="#studio"]) {
    display: none;
  }
}

/* ==============================================================================
   Hero Section (Fluid Full Screen)
   ============================================================================== */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 92vh;
  padding: clamp(110px, 14vh, 170px) clamp(16px, 4vw, 50px) clamp(60px, 8vh, 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 1;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 980px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--apple-cyan);
  margin-bottom: 24px;
  backdrop-filter: blur(14px);
  transition: all 0.3s ease;
}

.hero-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(41, 151, 255, 0.3);
  transform: translateY(-1px);
}

.hero-pill .glow-dot {
  width: 7px;
  height: 7px;
  background: var(--apple-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--apple-cyan);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(40px, 7.5vw, 92px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 1080px;
  margin: 0 auto 20px auto;
  color: #ffffff;
}

.hero-gradient-text {
  background: linear-gradient(90deg, #ffffff 0%, #2997ff 35%, #bf5af2 70%, #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 9s linear infinite;
}

@keyframes text-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-sub {
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto 36px auto;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.btn-apple-primary {
  background: var(--apple-blue);
  color: #ffffff;
  padding: 14px 30px;
  border-radius: 980px;
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s var(--ease-apple);
  box-shadow: 0 4px 24px rgba(0, 113, 227, 0.45);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-apple-primary:hover {
  background: var(--apple-blue-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 113, 227, 0.65);
}

.btn-apple-secondary {
  color: var(--apple-cyan);
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-apple-secondary:hover {
  color: #ffffff;
  gap: 10px;
}

/* ==============================================================================
   Live Interactive Studio Widget (Hero Showcase - Fluid Scale)
   ============================================================================== */
.showcase-container {
  width: 100%;
  max-width: min(1040px, 94vw);
  margin: 0 auto;
}

.apple-device-frame {
  background: linear-gradient(180deg, rgba(26, 26, 30, 0.88) 0%, rgba(13, 13, 16, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: clamp(20px, 3.5vw, 36px);
  box-shadow: 0 40px 120px -20px rgba(0, 113, 227, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px);
  text-align: left;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.apple-device-frame:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 50px 140px -20px rgba(0, 113, 227, 0.4);
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--apple-border);
  margin-bottom: 22px;
}

.device-dots {
  display: flex;
  gap: 7px;
}

.device-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.device-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* Attentive Interactive Service Selector */
.service-selector-panel {
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 18px 20px;
}

.service-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.service-selector-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-selector-hint {
  font-size: 12px;
  color: var(--apple-cyan);
  font-weight: 500;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 900px) {
  .service-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

.service-card-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--apple-border);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s var(--ease-apple);
  color: var(--text-secondary);
  user-select: none;
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  box-sizing: border-box;
  overflow: hidden;
}

.service-card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  color: #ffffff;
}

.service-card-btn.active {
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.28) 0%, rgba(22, 22, 24, 0.95) 100%);
  border-color: var(--apple-cyan);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(0, 113, 227, 0.45);
  transform: translateY(-2px);
}

.service-card-icon {
  font-size: 22px;
  margin-bottom: 5px;
  line-height: 1;
}

.service-card-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.3;
}

.service-card-sub {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.service-card-btn.active .service-card-sub {
  color: var(--apple-cyan);
  font-weight: 500;
}

.active-service-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(41, 151, 255, 0.08);
  border: 1px solid rgba(41, 151, 255, 0.2);
  border-radius: 12px;
  padding: 0 16px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  font-size: 13px;
  color: var(--apple-cyan);
  margin-bottom: 18px;
  gap: 12px;
  box-sizing: border-box;
  overflow: hidden;
}

.active-service-banner .banner-label-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.active-service-banner .banner-tag {
  font-weight: 700;
  color: var(--apple-cyan);
  flex-shrink: 0;
}

#activeModeText {
  color: #ffffff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-service-banner .banner-badge {
  font-size: 11px;
  color: var(--apple-green);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.5vw, 24px);
  align-items: stretch;
}

@media (max-width: 800px) {
  .studio-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.studio-input-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  box-sizing: border-box;
  overflow: hidden;
}

.service-guidance-box {
  font-size: 12px;
  color: var(--apple-cyan);
  line-height: 18px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.studio-mic-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  position: relative;
}

.apple-mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apple-blue), #0052a3);
  color: white;
  border: none;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 113, 227, 0.5);
  transition: all 0.3s var(--ease-apple);
  position: relative;
  z-index: 2;
}

.apple-mic-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 44px rgba(0, 113, 227, 0.7);
}

.apple-mic-btn.recording {
  background: linear-gradient(135deg, var(--apple-red), #b91c1c);
  animation: apple-pulse 1.3s infinite;
}

.apple-mic-btn.recording::before,
.apple-mic-btn.recording::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 69, 58, 0.5);
  animation: mic-ripple 1.6s var(--ease-apple) infinite;
  pointer-events: none;
}

.apple-mic-btn.recording::after {
  animation-delay: 0.8s;
}

@keyframes mic-ripple {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.65); opacity: 0; }
}

@keyframes apple-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.7); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(255, 69, 58, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
}

.soundwave-anim {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  margin-top: 12px;
}

.wave-bar {
  width: 3.5px;
  height: 6px;
  background: var(--apple-cyan);
  border-radius: 3px;
  transition: height 0.25s ease;
}

.apple-mic-btn.recording ~ .soundwave-anim .wave-bar {
  animation: wave-bounce 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { animation-delay: 0.1s; }
.wave-bar:nth-child(2) { animation-delay: 0.2s; }
.wave-bar:nth-child(3) { animation-delay: 0.35s; }
.wave-bar:nth-child(4) { animation-delay: 0.5s; }
.wave-bar:nth-child(5) { animation-delay: 0.65s; }

@keyframes wave-bounce {
  0% { height: 6px; }
  100% { height: 24px; }
}

.studio-status-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
  height: 18px;
  line-height: 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sample-prompts-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-buttons-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 120px;
  min-height: 120px;
  max-height: 120px;
  box-sizing: border-box;
  overflow: hidden;
}

.sample-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--apple-border);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s var(--ease-apple);
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.sample-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(41, 151, 255, 0.3);
  transform: translateX(3px);
}

.sample-btn strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 2px;
}

.sample-btn .sample-btn-text,
.sample-btn div {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

/* Studio Output Decision Card */
.studio-output-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 520px;
  min-height: 520px;
  max-height: 520px;
  box-sizing: border-box;
  overflow: hidden;
}

.studio-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
}

.studio-transcript-box {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: #ffffff;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  line-height: 1.4;
  overflow-y: auto;
  box-sizing: border-box;
  padding-right: 4px;
  transition: opacity 0.2s;
}

.studio-transcript-box::-webkit-scrollbar {
  width: 4px;
}

.studio-transcript-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.decision-meter-wrapper {
  margin: 12px 0;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.meter-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--apple-cyan);
}

.apple-meter-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.apple-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--apple-cyan), var(--apple-blue));
  border-radius: 6px;
  transition: width 0.8s var(--ease-apple);
}

.output-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  height: 154px;
  min-height: 154px;
  max-height: 154px;
  box-sizing: border-box;
}

.output-metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--apple-border);
  border-radius: 14px;
  padding: 10px 12px;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.output-metric .lbl {
  font-size: 10.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.output-metric .val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.studio-output-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--apple-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 22px;
  box-sizing: border-box;
}

@media (max-width: 800px) {
  .studio-input-box,
  .studio-output-box {
    height: auto;
    min-height: 480px;
    max-height: none;
    padding: 18px;
  }
  .active-service-banner {
    height: auto;
    min-height: 44px;
    max-height: none;
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .active-service-banner .banner-label-group {
    white-space: normal;
  }
  #activeModeText {
    white-space: normal;
  }
}

/* ==============================================================================
   SECTION: KPI Graphs & Cost Advantage vs Traditional Chatbots
   ============================================================================== */
.kpi-section {
  padding: clamp(70px, 10vh, 120px) clamp(16px, 4vw, 50px);
  max-width: var(--max-content-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
}

.kpi-hero-banner {
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.12) 0%, rgba(22, 22, 24, 0.85) 100%);
  border: 1px solid rgba(41, 151, 255, 0.3);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 48px);
  margin-bottom: 40px;
  backdrop-filter: blur(25px);
  box-shadow: 0 30px 80px -20px rgba(0, 113, 227, 0.25);
}

.kpi-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.kpi-big-stat {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-big-stat .number {
  font-size: clamp(38px, 4.5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-big-stat .stat-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Visual Comparison Bar Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 880px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: 24px;
  padding: clamp(22px, 3vw, 32px);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.chart-title {
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
}

.chart-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.chart-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 980px;
  white-space: nowrap;
}

.chart-bars-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
}

.bar-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.bar-progress {
  height: 100%;
  border-radius: 6px;
  transition: width 1.2s var(--ease-apple);
}

/* Cost Table Comparison (Inference Economics) */
.cost-table-wrapper {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: 24px;
  overflow: hidden;
  margin-top: 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cost-table-header {
  padding: 24px clamp(18px, 3vw, 32px);
  border-bottom: 1px solid var(--apple-border);
  background: rgba(255, 255, 255, 0.02);
  width: 100%;
  box-sizing: border-box;
}

.cost-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.cost-table-scroll::-webkit-scrollbar {
  height: 6px;
}

.cost-table-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.cost-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.cost-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.cost-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--apple-border);
  white-space: nowrap;
}

.cost-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--apple-border);
  color: var(--text-secondary);
  line-height: 1.45;
}

.cost-table tr:last-child td {
  border-bottom: none;
}

.cost-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.highlight-row td {
  background: rgba(0, 113, 227, 0.06);
  color: #fff;
  font-weight: 500;
}

.table-mobile-hint {
  display: none;
  font-size: 11.5px;
  color: var(--apple-cyan);
  text-align: center;
  padding: 10px 16px;
  background: rgba(41, 151, 255, 0.06);
  border-top: 1px solid var(--apple-border);
  font-weight: 500;
}

/* Interactive ROI Calculator */
.roi-calculator-box {
  background: linear-gradient(180deg, #161619 0%, #0f0f12 100%);
  border: 1px solid var(--apple-border);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 44px);
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.roi-calc-inputs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.slider-group {
  margin-bottom: 24px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
}

.slider-val-display {
  font-size: 16px;
  font-weight: 700;
  color: var(--apple-cyan);
}

/* Custom Apple Range Slider */
input[type=range].apple-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type=range].apple-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 113, 227, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type=range].apple-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.calc-results-panel {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
}

.calc-gain-highlight {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
  color: var(--apple-green);
  letter-spacing: -0.03em;
  margin: 8px 0;
}

.calc-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid var(--apple-border);
}

.calc-metric-number {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.calc-cta-btn {
  justify-content: center;
  font-size: 14.5px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

/* Mobile Media Queries for Inference Economics & ROI Alignment */
@media (max-width: 850px) {
  .cost-table-wrapper {
    margin-top: 24px;
    border-radius: 20px;
  }

  .cost-table-header {
    padding: 18px 16px;
  }

  .table-mobile-hint {
    display: block;
  }

  .roi-calculator-box {
    grid-template-columns: 1fr;
    margin-top: 24px;
    padding: 22px 18px;
    border-radius: 20px;
    gap: 24px;
  }

  .calc-results-panel {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .calc-gain-highlight {
    font-size: clamp(30px, 7vw, 38px);
  }

  .calc-cta-btn {
    white-space: normal;
    padding: 13px 16px;
  }
}

@media (max-width: 480px) {
  .cost-table th,
  .cost-table td {
    padding: 12px 14px;
    font-size: 13px;
  }

  .roi-calculator-box {
    padding: 18px 14px;
    gap: 18px;
  }

  .calc-results-panel {
    padding: 16px 12px;
  }

  .calc-metric-number {
    font-size: 17px;
  }
}

/* ==============================================================================
   Apple Bento Grid Section ("Engineered for Certainty")
   ============================================================================== */
.bento-section {
  padding: clamp(70px, 10vh, 120px) clamp(16px, 4vw, 50px);
  max-width: var(--max-content-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
}

.section-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.035em;
  text-align: center;
  margin-bottom: 18px;
  color: #ffffff;
}

.section-desc {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-secondary);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px auto;
  line-height: 1.45;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 960px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

.bento-card {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: 28px;
  padding: clamp(26px, 3.5vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.4s var(--ease-apple), border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  border-color: var(--apple-border-hover);
  transform: translateY(-6px);
  background: var(--apple-surface-hover);
  box-shadow: 0 20px 50px -15px rgba(0, 113, 227, 0.25);
}

.bento-card.col-span-2 {
  grid-column: span 2;
}

@media (max-width: 960px) {
  .bento-card.col-span-2 {
    grid-column: span 1;
  }
}

.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}

.bento-card:hover .bento-icon {
  transform: scale(1.1);
}

.bento-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #ffffff;
}

.bento-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.bento-chip-row {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.bento-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--apple-border);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
}

/* ==============================================================================
   Apple Pricing Section
   ============================================================================== */
.pricing-section {
  padding: clamp(70px, 10vh, 110px) clamp(16px, 4vw, 50px);
  max-width: var(--max-content-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

@media (max-width: 960px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: 28px;
  padding: clamp(28px, 3.5vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(18px);
  position: relative;
  transition: all 0.35s var(--ease-apple);
}

.pricing-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

.pricing-card.featured {
  border-color: var(--apple-blue);
  box-shadow: 0 0 60px -10px rgba(0, 113, 227, 0.45);
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.1) 0%, rgba(22, 22, 24, 0.95) 100%);
}

.pricing-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  background: var(--apple-blue);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 980px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pricing-tier {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #ffffff;
}

.pricing-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  min-height: 42px;
  margin-bottom: 24px;
  line-height: 1.45;
}

.pricing-price {
  font-size: clamp(38px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: #ffffff;
  margin-bottom: 24px;
}

.pricing-price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-bottom: 34px;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: "✓";
  color: var(--apple-cyan);
  font-weight: 700;
}

/* ==============================================================================
   Smooth FAQ Accordions
   ============================================================================== */
details.apple-faq-item {
  background: var(--apple-card);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
  padding: 22px 24px;
  cursor: pointer;
  transition: all 0.3s var(--ease-apple);
  backdrop-filter: blur(14px);
}

details.apple-faq-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--apple-surface-hover);
}

details.apple-faq-item summary {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

details.apple-faq-item summary::-webkit-details-marker {
  display: none;
}

details.apple-faq-item summary span.icon {
  color: var(--apple-cyan);
  font-size: 22px;
  transition: transform 0.35s var(--ease-apple);
}

details.apple-faq-item[open] summary span.icon {
  transform: rotate(45deg);
  color: var(--apple-red);
}

details.apple-faq-item p {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
  animation: faq-expand 0.4s var(--ease-apple);
}

@keyframes faq-expand {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   Footer
   ============================================================================== */
.apple-footer {
  border-top: 1px solid var(--apple-border);
  padding: 50px clamp(16px, 4vw, 50px) 70px clamp(16px, 4vw, 50px);
  background: #000000;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  width: 100%;
}

.footer-content {
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.footer-disclaimer {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--apple-border);
  margin-bottom: 24px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ==============================================================================
   SECTION: Apple Live Console & Chat System (/chat - index.html)
   ============================================================================== */
.console-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: clamp(80px, 11vh, 100px) clamp(16px, 3.5vw, 40px) 40px clamp(16px, 3.5vw, 40px);
  width: 100%;
  position: relative;
  z-index: 1;
}

.console-device-frame {
  background: linear-gradient(180deg, rgba(26, 26, 30, 0.88) 0%, rgba(13, 13, 16, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: clamp(18px, 2.5vw, 28px);
  box-shadow: 0 40px 120px -20px rgba(0, 113, 227, 0.35),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.console-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(16px, 2.5vw, 24px);
  align-items: stretch;
}

@media (max-width: 960px) {
  .console-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Console Sidebar Cards */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.apple-console-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 18px 20px;
  backdrop-filter: blur(20px);
  transition: all 0.3s var(--ease-apple);
}

.apple-console-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.apple-console-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Domain Select Dropdown */
.apple-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--apple-border);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  cursor: pointer;
  transition: all 0.25s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232997ff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.apple-select:focus,
.apple-select:hover {
  border-color: var(--apple-cyan);
  box-shadow: 0 0 16px rgba(41, 151, 255, 0.25);
}

.apple-select option {
  background: #161618;
  color: #ffffff;
  padding: 8px;
}

/* Sample Prompts Chips */
.samples-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.samples-list::-webkit-scrollbar {
  width: 4px;
}
.samples-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s var(--ease-apple);
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.sample-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(41, 151, 255, 0.35);
  transform: translateX(3px);
}

.sample-chip strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-chip span {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Chat Main Console */
.chat-container {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  height: 680px;
  overflow: hidden;
  position: relative;
  min-width: 0;
  width: 100%;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--apple-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-green);
  background: rgba(48, 209, 88, 0.12);
  border: 1px solid rgba(48, 209, 88, 0.25);
  padding: 5px 12px;
  border-radius: 980px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 10px var(--apple-green);
  animation: apple-pulse 1.8s infinite;
}

/* Chat Message Stream */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
}

.message-row {
  display: flex;
  gap: 12px;
  max-width: 86%;
  animation: msg-appear 0.35s var(--ease-apple);
}

@keyframes msg-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row.bot {
  align-self: flex-start;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border: 1px solid var(--apple-border);
}

.message-row.user .avatar {
  background: linear-gradient(135deg, var(--apple-blue), #0052a3);
  border-color: rgba(41, 151, 255, 0.4);
}

.bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  word-break: break-word;
}

.message-row.bot .bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--apple-border);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.message-row.user .bubble {
  background: linear-gradient(135deg, var(--apple-blue) 0%, #0056b3 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.35);
}

.audio-player-container audio {
  height: 32px;
  max-width: 260px;
  margin-top: 8px;
  border-radius: 16px;
  filter: invert(1) hue-rotate(180deg);
}

/* Chat Decision Card */
.decision-card {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(41, 151, 255, 0.25);
  border-radius: 16px;
  padding: 16px;
}

.decision-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.urgency-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 980px;
  letter-spacing: 0.04em;
}

.urgency-low {
  background: rgba(48, 209, 88, 0.16);
  color: var(--apple-green);
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.urgency-mid {
  background: rgba(255, 159, 10, 0.16);
  color: var(--apple-orange);
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.urgency-high {
  background: rgba(255, 69, 58, 0.2);
  color: var(--apple-red);
  border: 1px solid rgba(255, 69, 58, 0.4);
}

.urgency-meter {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
}

.urgency-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s var(--ease-apple);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.metric-item .label {
  font-size: 10.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.metric-item strong {
  font-size: 13.5px;
  color: #ffffff;
}

/* Chat Input Panel */
.chat-input-panel {
  padding: 16px 20px;
  border-top: 1px solid var(--apple-border);
  background: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voice-recorder-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--apple-border);
  padding: 10px 16px;
  border-radius: 14px;
}

.voice-status-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.record-btn {
  background: linear-gradient(135deg, var(--apple-blue), #0056b3);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-apple);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.4);
}

.record-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.6);
}

.record-btn.recording {
  background: linear-gradient(135deg, var(--apple-red), #b91c1c);
  animation: apple-pulse 1.3s infinite;
  box-shadow: 0 4px 18px rgba(255, 69, 58, 0.5);
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.chat-input {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--apple-border);
  border-radius: 980px;
  padding: 12px 18px;
  color: #ffffff;
  font-size: 14px;
  font-family: var(--font-family);
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
  text-overflow: ellipsis;
}

.chat-input:focus {
  border-color: var(--apple-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(41, 151, 255, 0.25);
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.send-btn {
  background: var(--apple-blue);
  color: #ffffff;
  border: none;
  padding: 0 20px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 980px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-apple);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.send-btn:hover {
  background: var(--apple-blue-hover);
  transform: scale(1.04);
}

.send-btn:active {
  transform: scale(0.97);
}

/* ==============================================================================
   SECTION: Live Console Responsive Optimization (Mobile / Tablet)
   ============================================================================== */
@media (max-width: 768px) {
  .console-container {
    padding: 76px 12px 32px 12px;
  }
  .console-device-frame {
    padding: 14px 12px;
    border-radius: 20px;
  }
  .chat-container {
    height: clamp(520px, 75vh, 660px);
    border-radius: 16px;
    min-width: 0;
  }
  .chat-header {
    padding: 12px 14px;
    gap: 8px;
  }
  .chat-messages {
    padding: 14px 12px;
    gap: 12px;
  }
  .chat-input-panel {
    padding: 10px 12px;
    gap: 10px;
  }
  .voice-recorder-bar {
    padding: 8px 12px;
    gap: 8px;
  }
  .voice-status-text {
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .record-btn {
    padding: 7px 12px;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .input-row {
    gap: 8px;
  }
  .chat-input {
    padding: 10px 14px;
    font-size: 13px;
  }
  .send-btn {
    padding: 0 16px;
    height: 40px;
    font-size: 13px;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .console-container {
    padding: 70px 8px 24px 8px;
  }
  .console-device-frame {
    padding: 10px 8px;
    border-radius: 16px;
  }
  .device-header {
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 12px;
    margin-bottom: 14px;
  }
  .device-title {
    font-size: 11.5px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .chat-container {
    height: clamp(480px, 72vh, 600px);
    border-radius: 14px;
  }
  .chat-header {
    padding: 10px 8px;
  }
  .chat-messages {
    padding: 12px 8px;
  }
  .chat-input-panel {
    padding: 8px 8px;
    gap: 8px;
  }
  .voice-recorder-bar {
    padding: 6px 8px;
    gap: 6px;
  }
  .voice-status-text {
    font-size: 11px;
  }
  .record-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .input-row {
    gap: 6px;
  }
  .chat-input {
    padding: 9px 12px;
    font-size: 12.5px;
  }
  .send-btn {
    padding: 0 13px;
    height: 38px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .send-btn {
    padding: 0 10px;
    font-size: 11.5px;
  }
  .record-btn {
    padding: 5px 8px;
    font-size: 10.5px;
  }
}

/* ==============================================================================
   SECTION: Apple Business Dashboard (/dashboard - dashboard.html)
   ============================================================================== */
.dashboard-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: clamp(80px, 11vh, 100px) clamp(16px, 3.5vw, 40px) 60px clamp(16px, 3.5vw, 40px);
  width: 100%;
  position: relative;
  z-index: 1;
}

.dashboard-header-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Dashboard KPI Stat Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.apple-stat-card {
  background: rgba(22, 22, 24, 0.78);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 22px 24px;
  backdrop-filter: blur(20px);
  transition: all 0.3s var(--ease-apple);
  position: relative;
  overflow: hidden;
}

.apple-stat-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(0, 113, 227, 0.25);
}

.apple-stat-card .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.apple-stat-card .value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.apple-stat-card .stat-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Dashboard Table Card */
.table-card {
  background: linear-gradient(180deg, rgba(26, 26, 30, 0.88) 0%, rgba(13, 13, 16, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 30px 80px -20px rgba(0, 113, 227, 0.2);
  backdrop-filter: blur(30px);
  overflow: hidden;
}

.apple-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.apple-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.apple-table th {
  padding: 16px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--apple-border);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.apple-table td {
  padding: 16px 20px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--apple-border);
  color: var(--text-primary);
  vertical-align: middle;
}

.apple-table tbody tr {
  transition: background 0.2s ease;
}

.apple-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-cyan);
  background: rgba(41, 151, 255, 0.1);
  border: 1px solid rgba(41, 151, 255, 0.25);
  padding: 4px 10px;
  border-radius: 980px;
}

.status-select {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--apple-border);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family);
  border-radius: 10px;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.status-select:focus,
.status-select:hover {
  border-color: var(--apple-cyan);
}

.status-select option {
  background: #161618;
  color: #ffffff;
}
