@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&family=Inter:wght@300;400;500&family=Outfit:wght@700;800;900&display=swap');

/* --- STRICT premium design tokens --- */
:root {
  --color-bg: #161616;        /* Primary Core Canvas: Midnight Obsidian */
  --color-card: rgba(16, 35, 42, 0.65); /* Midnight Horizon Accent Glass */
  --color-text: #D3C3B9;      /* Ivory Sovereign Typography */
  --color-muted: #A79E9C;     /* Platinum Muted Prose */
  --color-accent: #B58863;    /* Burnished Copper Executive Trim */
  --color-slate: #3D4D55;     /* Steel Slate Vector Mid Tone */
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-tech: 'Fira Code', monospace;
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at 15% 25%, rgba(181, 136, 99, 0.08) 0%, transparent 45%),
                    radial-gradient(circle at 85% 75%, rgba(16, 35, 42, 0.3) 0%, transparent 55%),
                    radial-gradient(circle at 50% 50%, rgba(61, 77, 85, 0.05) 0%, transparent 50%),
                    linear-gradient(rgba(181, 136, 99, 0.008) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(181, 136, 99, 0.008) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  color: var(--color-text);
  font-family: var(--font-body);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 300;
  line-height: 1.6;
}

/* Core Layout */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 2rem;
  position: relative;
}

/* Dynamic Live Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--color-card);
  position: sticky;
  top: 0;
  background-color: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 12px;
  height: 12px;
  background-color: var(--color-accent);
  border-radius: 2px;
  animation: heartbeat 2s infinite ease-in-out;
  box-shadow: 0 0 12px var(--color-accent);
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--color-card);
  padding: 0.25rem;
  border-radius: 4px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-family: var(--font-tech);
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 2px;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-btn.active {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid rgba(140, 140, 140, 0.2);
}

.system-telemetry {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-tech);
  font-size: 0.7rem;
  color: var(--color-muted);
}

.telemetry-item span {
  color: var(--color-text);
  font-weight: 500;
}

/* Presentation / Deck Mode Layout (Enforced Full-Screen 16:9 Widescreen Presentation Mode) */
.deck-view {
  width: 100vw;
  height: 100vh;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  aspect-ratio: 16 / 9 !important;
  container-type: size; /* Enable modern Container Queries for absolute scaling autonomy */
  
  /* Absolute Centering in Viewport */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  padding: 6cqh 8cqw; /* Proportional full-screen slideshow margins */
  background-color: var(--color-bg); /* Solid Core Canvas background */
  border: none !important; /* Completely borderless */
  border-radius: 0 !important; /* No rounded card corners */
  box-shadow: none !important; /* No container shadows */
  display: none;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
}

.deck-view.active {
  display: flex;
}

.slide-frame {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.slide-frame.active {
  display: flex;
  animation: slideFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Grid Architecture for 1-of-1 Slides */
.slide-grid {
  display: grid;
  width: 100%;
  gap: 4cqw;
  align-items: center;
}

/* Editorial Split-Layouts */
.grid-asymmetric {
  grid-template-columns: 1.618fr 1fr;
}

.grid-equal {
  grid-template-columns: 1fr 1fr;
}

.grid-single {
  grid-template-columns: 1fr;
  max-width: 800px;
  margin: 0 auto;
}

/* Typography Hierarchy (Mathematically Scaled with Container Query Height for Widescreen Autonomy) */
.slide-meta-label {
  font-family: var(--font-tech);
  font-size: 2.2cqh;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-muted);
  margin-bottom: 2cqh;
  display: inline-block;
}

.slide-meta-label .accent-marker {
  color: var(--color-accent);
  margin-right: 0.25rem;
}

.slide-title {
  font-family: var(--font-display);
  font-size: 6cqh;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--color-text);
  margin-bottom: 2cqh;
}

.slide-title span.accent-text {
  color: var(--color-accent);
}

.slide-subtitle {
  font-family: var(--font-body);
  font-size: 3.2cqh;
  color: var(--color-muted);
  margin-bottom: 3cqh;
  max-width: 60ch;
  font-weight: 300;
}

.slide-content-text {
  font-size: 2.4cqh;
  color: var(--color-text);
  line-height: 1.6;
}

.slide-content-text p {
  margin-bottom: 2cqh;
}

.slide-bullet-list {
  list-style: none;
  margin-top: 2cqh;
}

.slide-bullet-list li {
  position: relative;
  padding-left: 3.5cqh;
  margin-bottom: 2cqh;
  font-size: 2.4cqh;
  color: var(--color-text);
  line-height: 1.5;
}

.slide-bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1cqh;
  width: 1cqh;
  height: 1cqh;
  background-color: var(--color-accent);
  border-radius: 1px;
}

.slide-bullet-list li strong {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text);
  display: block;
  margin-bottom: 0.5cqh;
  font-size: 2.7cqh;
}

/* Structural UI Containers */
.ui-panel {
  background-color: var(--color-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(181, 136, 99, 0.2);
  border-radius: 6px;
  padding: 3cqh 3.5cqw;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37),
              inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: var(--transition-smooth);
}

.ui-panel:hover {
  border-color: rgba(181, 136, 99, 0.45);
  box-shadow: 0 12px 40px 0 rgba(181, 136, 99, 0.06),
              0 8px 32px 0 rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ui-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.2cqh;
  border-bottom: 1px solid rgba(140, 140, 140, 0.1);
  padding-bottom: 1cqh;
}

.panel-title {
  font-family: var(--font-tech);
  font-size: 1.6cqh;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

.panel-status {
  display: flex;
  align-items: center;
  gap: 0.5cqw;
  font-family: var(--font-tech);
  font-size: 1.5cqh;
}

.status-dot {
  width: 1.2cqh;
  height: 1.2cqh;
  background-color: var(--color-accent);
  border-radius: 50%;
}

.status-dot.active {
  background-color: #00FF66;
  box-shadow: 0 0 8px #00FF66;
}

/* Control Navigation Bar */
/* Control Navigation Bar - Aligned to Bottom Right */
.deck-controls {
  position: absolute;
  bottom: 2rem;
  right: 2.5rem;
  z-index: 9999 !important;
  pointer-events: none; /* Allows clicks to pass through transparent empty space */
}

.minimal-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background-color: var(--color-card);
  border: 1px solid rgba(181, 136, 99, 0.35);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  pointer-events: auto; /* Re-enable clicks on control elements themselves */
}

.nav-arrow {
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-family: var(--font-tech);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0 0.25rem;
  user-select: none;
}

.nav-arrow:hover {
  color: var(--color-accent);
}

.nav-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.slide-counter {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  color: var(--color-text);
  font-weight: 500;
  letter-spacing: 0.05em;
  user-select: none;
}

/* --- DYNAMIC INTERACTIVE SIMULATIONS --- */

/* Slide 1 - Neural Wireframe Background */
.neural-wireframe {
  position: absolute;
  right: -5%;
  top: 5%;
  width: 50%;
  height: 90%;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}

.wireframe-svg {
  width: 100%;
  height: 100%;
}

/* Slide 2 - Interactive Input-to-Output Flow */
.flow-interactive-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comparison-box {
  background: var(--color-bg);
  border: 1px solid rgba(140, 140, 140, 0.1);
  padding: 1.2rem;
  border-radius: 4px;
}

.comparison-box.active-tier {
  border-color: rgba(255, 51, 51, 0.3);
}

.comparison-label {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  color: var(--color-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.flow-simulation {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flow-step {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: var(--color-card);
  border-left: 2px solid var(--color-muted);
  opacity: 0.5;
}

.flow-step.active {
  border-left-color: var(--color-accent);
  color: var(--color-accent);
  opacity: 1;
  animation: pulseOpacity 1.5s infinite;
}

/* Slide 4 - Network Topology Node Bus */
.node-bus-canvas {
  width: 100%;
  height: 35cqh;
  background: #0D0D0D;
  border: 1px solid rgba(140, 140, 140, 0.05);
  position: relative;
}

/* Slide 6 - Concierge Booking Itinerary Output */
.ticket-layout {
  background: #E6E1DA;
  color: #0A0A0A;
  padding: 2cqh;
  border-radius: 2px;
  font-family: var(--font-tech);
  width: 100%;
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px dashed #8C8C8C;
  padding-bottom: 1.5cqh;
  margin-bottom: 1.5cqh;
}

.ticket-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.2cqh;
}

.ticket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5cqh;
  font-size: 1.6cqh;
}

.ticket-item span {
  display: block;
  color: #8C8C8C;
  font-size: 1.3cqh;
  text-transform: uppercase;
}

/* Slide 7 - High Velocity Ledger Stream */
.ledger-stream {
  font-family: var(--font-tech);
  font-size: 1.5cqh;
  color: var(--color-muted);
  height: 28cqh;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5cqh;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(140, 140, 140, 0.05);
  padding: 0.4cqh 0;
}

.ledger-row.active {
  color: var(--color-accent);
}

.ledger-row .hash {
  color: var(--color-text);
}

/* Slide 8 - Radar Threat Guarddog */
.radar-wrapper {
  position: relative;
  width: 32cqh;
  height: 32cqh;
  margin: 0 auto;
  border: 1px solid rgba(140, 140, 140, 0.1);
  border-radius: 50%;
  overflow: hidden;
}

.radar-sweep {
  position: absolute;
  width: 100%;
  height: 100%;
  background: conic-gradient(from 0deg, rgba(255, 51, 51, 0.15) 0deg, transparent 90deg);
  border-radius: 50%;
  transform-origin: center;
  animation: radarRotate 4s linear infinite;
}

.radar-grid {
  position: absolute;
  width: 70%;
  height: 70%;
  border: 1px dashed rgba(140, 140, 140, 0.15);
  border-radius: 50%;
  left: 15%;
  top: 15%;
}

.radar-grid-inner {
  position: absolute;
  width: 40%;
  height: 40%;
  border: 1px dashed rgba(140, 140, 140, 0.15);
  border-radius: 50%;
  left: 30%;
  top: 30%;
}

.radar-target {
  position: absolute;
  width: 1.2cqh;
  height: 1.2cqh;
  background-color: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-accent);
  animation: blink 2s infinite ease-in-out;
}

/* Slide 11 - Cyber-Physical Design Polygon Mesh */
.cad-mesh-box {
  width: 100%;
  height: 36cqh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mesh-svg {
  width: 80%;
  height: 80%;
}

.mesh-polygon {
  fill: none;
  stroke: var(--color-muted);
  stroke-width: 0.5px;
}

.mesh-polygon.stressed {
  stroke: var(--color-accent);
  animation: strokeBlink 2.5s infinite;
}

.mesh-nodes circle {
  fill: var(--color-text);
}

.mesh-nodes circle.stressed {
  fill: var(--color-accent);
}

/* Slide 12 - Android Phone Farm Telemetry Grid */
.device-farm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1cqw;
}

.device-node {
  background: var(--color-bg);
  border: 1px solid rgba(140, 140, 140, 0.1);
  padding: 1cqh;
  border-radius: 2px;
  font-family: var(--font-tech);
  font-size: 1.4cqh;
}

.device-node.alarm {
  border-color: var(--color-accent);
}

.device-status-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5cqh;
}

.device-val {
  color: var(--color-text);
}

/* Slide 14 - Multi-Agent Council Consensus Console */
.council-orchestration-widget {
  display: flex;
  flex-direction: column;
  gap: 1.5cqh;
}

.agent-nodes-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.agent-node-card {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid rgba(140, 140, 140, 0.1);
  padding: 0.75rem;
  text-align: center;
  border-radius: 2px;
  transition: var(--transition-fast);
}

.agent-node-card.analyzing {
  border-color: var(--color-accent);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.1);
}

.agent-node-card.passed {
  border-color: #00FF66;
}

.agent-node-avatar {
  font-family: var(--font-tech);
  font-size: 0.6rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.agent-node-name {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text);
}

.agent-node-status {
  font-family: var(--font-tech);
  font-size: 0.6rem;
  margin-top: 0.25rem;
  color: var(--color-muted);
}

.council-debate-box {
  background: #0D0D0D;
  border: 1px solid rgba(140, 140, 140, 0.1);
  padding: 1rem;
  font-family: var(--font-tech);
  font-size: 0.7rem;
  height: 120px;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.btn-trigger-action {
  background: var(--color-accent);
  color: var(--color-text);
  border: none;
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.75rem;
  cursor: pointer;
  width: 100%;
  border-radius: 2px;
  text-transform: uppercase;
  transition: var(--transition-fast);
}

.btn-trigger-action:hover {
  background: #E60000;
}

/* Slide 15 - Human-In-The-Loop Governance */
.hitl-slider-wrapper {
  margin: 1.5rem 0;
}

.hitl-val-display {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-tech);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.hitl-slider {
  width: 100%;
  -webkit-appearance: none;
  background: rgba(140, 140, 140, 0.2);
  height: 4px;
  border-radius: 2px;
  outline: none;
}

.hitl-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
}

/* Slide 19 - Technical 6-Week Implementation Timeline */
.timeline-horizontal {
  position: relative;
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.timeline-horizontal::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(140, 140, 140, 0.2);
  z-index: 1;
}

.timeline-horizontal-active {
  position: absolute;
  top: 50%;
  left: 0;
  width: 33.33%;
  height: 1px;
  background: var(--color-accent);
  z-index: 1;
  transition: var(--transition-smooth);
}

.timeline-node {
  position: relative;
  z-index: 2;
  text-align: center;
  background: var(--color-bg);
  padding: 0 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.timeline-dot {
  width: 10px;
  height: 10px;
  background: var(--color-card);
  border: 2px solid var(--color-muted);
  border-radius: 50%;
  margin: 0 auto 0.5rem auto;
  transition: var(--transition-fast);
}

.timeline-node.active .timeline-dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

.timeline-node-title {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-muted);
}

.timeline-node.active .timeline-node-title {
  color: var(--color-text);
}

/* Reference Dashboard Mode Layout */
.dashboard-view {
  display: none;
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-view.active {
  display: block;
  animation: slideFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  height: calc(100vh - 180px);
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid var(--color-card);
  padding-right: 1.5rem;
}

.dash-nav-btn {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dash-nav-btn.active {
  color: var(--color-accent);
  background: var(--color-card);
  border-left: 2px solid var(--color-accent);
  padding-left: 1.25rem;
}

.dashboard-content-panel {
  overflow-y: auto;
  padding-right: 1rem;
}

.dashboard-feature-section {
  display: none;
}

.dashboard-feature-section.active {
  display: block;
}

.dashboard-feature-section p {
  margin-bottom: 1.5rem;
}

.dashboard-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Base Animations */
@keyframes heartbeat {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes breathe-slow {
  0% { transform: scale(0.96); }
  100% { transform: scale(1.04); }
}

/* Organic Pulse Waveform style */
svg[viewBox="0 0 100 20"] line {
  transform-origin: bottom;
  animation: wavePulse 1.8s ease-in-out infinite alternate;
}
svg[viewBox="0 0 100 20"] line:nth-child(2n) {
  animation-delay: 0.25s;
  animation-duration: 2.2s;
}
svg[viewBox="0 0 100 20"] line:nth-child(3n) {
  animation-delay: 0.5s;
  animation-duration: 1.5s;
}

@keyframes wavePulse {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1.3); }
}

@keyframes radarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes strokeBlink {
  0%, 100% { stroke-opacity: 0.5; }
  50% { stroke-opacity: 1; }
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Custom Scrollbar for dashboard */
.dashboard-content-panel::-webkit-scrollbar {
  width: 4px;
}
.dashboard-content-panel::-webkit-scrollbar-track {
  background: var(--color-bg);
}
.dashboard-content-panel::-webkit-scrollbar-thumb {
  background: var(--color-card);
  border-radius: 2px;
}
.dashboard-content-panel::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}
.dashboard-content-panel::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}

/* Interactive Sovereign Chat Telegram/WhatsApp Thread Widget */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 42cqh;
  background-color: #0c1214;
  background-image: radial-gradient(rgba(181, 136, 99, 0.04) 1px, transparent 1px);
  background-size: 2cqw 2cqh;
  border: 1px solid rgba(181, 136, 99, 0.25);
  border-radius: 6px;
  overflow: hidden;
}

/* App Header styling (Telegram/WhatsApp bar) */
.chat-app-header {
  display: flex;
  align-items: center;
  gap: 1cqw;
  padding: 0.8cqh 1.5cqw;
  background-color: #10232A;
  border-bottom: 1px solid rgba(181, 136, 99, 0.15);
}

.chat-avatar {
  width: 3.8cqh;
  height: 3.8cqh;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1.5px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(181, 136, 99, 0.3);
}

.chat-avatar-inner {
  width: 1.5cqh;
  height: 1.5cqh;
  background-color: var(--color-accent);
  border-radius: 50%;
  animation: heartbeat 2s infinite ease-in-out;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
}

.chat-header-title {
  font-family: var(--font-display);
  font-size: 1.5cqh;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.chat-header-status {
  font-family: var(--font-body);
  font-size: 1.2cqh;
  color: #00FF66;
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5cqh 2cqw;
  display: flex;
  flex-direction: column;
  gap: 1.2cqh;
  font-size: 1.5cqh;
  scroll-behavior: smooth;
  font-family: var(--font-body);
}

.chat-messages::-webkit-scrollbar {
  width: 3px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(181, 136, 99, 0.15);
  border-radius: 2px;
}

.chat-bubble {
  max-width: 80%;
  padding: 1cqh 1.5cqw 1.2cqh 1.5cqw;
  border-radius: 12px;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  animation: messageFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-bubble.agent {
  align-self: flex-start;
  background-color: #162429;
  border: 1px solid rgba(181, 136, 99, 0.1);
  color: #E2D7D0;
  border-bottom-left-radius: 2px;
  text-align: left;
}

.chat-bubble.user {
  align-self: flex-end;
  background-color: #2D3930;
  border: 1px solid rgba(0, 255, 102, 0.05);
  color: #E2EDD2;
  border-bottom-right-radius: 2px;
  text-align: left;
}

/* Message info row (timestamp + checks) */
.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5cqw;
  font-family: var(--font-tech);
  font-size: 1.1cqh;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.4cqh;
  text-align: right;
}

.user .bubble-meta {
  color: rgba(255, 255, 255, 0.45);
}

.double-check {
  color: var(--color-accent);
  font-weight: bold;
}

.chat-bubble.system {
  align-self: center;
  font-family: var(--font-tech);
  font-size: 1.2cqh;
  color: var(--color-muted);
  background: rgba(16, 35, 42, 0.6);
  border: 1px solid rgba(181, 136, 99, 0.1);
  padding: 0.6cqh 1.2cqw;
  border-radius: 20px;
  box-shadow: none;
  opacity: 0.85;
}

.chat-chips-row {
  display: flex;
  gap: 1cqw;
  padding: 0.8cqh 1.5cqw;
  background: rgba(16, 35, 42, 0.8);
  border-top: 1px solid rgba(181, 136, 99, 0.15);
  overflow-x: auto;
  white-space: nowrap;
}

.chat-chip {
  background: #0c1214;
  border: 1px solid rgba(181, 136, 99, 0.3);
  color: var(--color-text);
  font-family: var(--font-tech);
  font-size: 1.3cqh;
  padding: 0.5cqh 1cqw;
  border-radius: 2cqh;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-chip:hover {
  border-color: var(--color-accent);
  background: rgba(181, 136, 99, 0.08);
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 1cqw;
  border-top: 1px solid rgba(181, 136, 99, 0.15);
  background: #10232A;
  padding: 0.8cqh 1.5cqw;
}

.chat-input-field {
  flex: 1;
  background: #0c1214;
  border: 1px solid rgba(181, 136, 99, 0.15);
  border-radius: 3cqh;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.5cqh;
  padding: 0.8cqh 1.5cqw;
  outline: none;
  transition: var(--transition-fast);
}

.chat-input-field:focus {
  border-color: var(--color-accent);
}

.chat-input-field::placeholder {
  color: var(--color-muted);
  opacity: 0.4;
}

.chat-send-btn {
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  font-size: 1.6cqh;
  width: 3.8cqh;
  height: 3.8cqh;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  padding: 0;
}

.chat-send-btn:hover {
  background: #C49672;
  transform: scale(1.05);
}

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

/* --- MOBILE RESPONSIVENESS AND TABLET ADAPTABILITY --- */
@media (max-width: 768px) {
  /* Proportional scaling handles the layout. We optimize padding and specific micro grids here */
  .deck-view {
    padding: 4cqh 5cqw;
  }
  
  .slide-frame {
    min-height: auto;
  }
  
  .ui-panel {
    padding: 2.5cqh 2.5cqw;
  }
  
  /* Slide-Specific Interactions on Mobile */
  .device-farm-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .agent-nodes-row {
    flex-wrap: nowrap;
    gap: 0.5cqw;
  }
}

/* --- PRINT MEDIA QUERY (CTRL + P SUPPORT) --- */
@media print {
  @page {
    size: A4 landscape; /* Force standard widescreen slide print format */
    margin: 0;
  }
  
  html, body {
    background: #161616 !important; /* Retain premium obsidian canvas on print */
    color: #D3C3B9 !important;
    overflow: visible !important;
    height: auto !important;
    width: auto !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  .app-container {
    padding: 0 !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
    display: block !important;
  }
  
  .deck-view {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    display: block !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }
  
  .slide-frame {
    display: flex !important; /* Force ALL slides to display during print */
    opacity: 1 !important;
    visibility: visible !important;
    height: 100vh !important; /* Scale to exactly one full viewport page height */
    width: 100% !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    break-after: page !important;
    border: none !important;
    box-sizing: border-box !important;
    padding: 3rem 4rem !important; /* Keep elegant padding margins */
    align-items: center !important;
    justify-content: center !important;
    background-color: #161616 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Hide interactive slide controls, trigger buttons, and chat input elements during printing */
  .deck-controls,
  .btn-trigger-action,
  .chat-chips-row,
  .chat-input-bar {
    display: none !important;
  }
}
