/* ==========================================================================
   CREXTIO DESIGN SYSTEM & MOBILE UX ENGINE - KWIS CLOUD HUB
   Design System: Warm Cream Gradient, Charcoal Matte Contrast, Gold Accents
   Features:
   - Zero-Access Gatekeeper Auth Portal & Email Verification Modal
   - Mobile-First Floating Bottom Navigation Bar (Thumb Zone)
   - Slide-in Mobile Sidebar Drawer with Live Telemetry
   - Responsive Touch-Ergonomic Controls (>= 44px Tap Targets)
   - Multi-CLI Virtual Shell with 1-Tap Quick Command Bar
   - Fullscreen Odysseus & Logseq Mobile Experience
   ========================================================================== */

:root {
  /* Canvas & Base Layers */
  --bg-outer-canvas: #94A3B8;
  --bg-app: linear-gradient(135deg, #FBF9F4 0%, #F8F4EA 45%, #FEF3C7 100%);
  --bg-card: #FFFFFF;
  --bg-card-translucent: rgba(255, 255, 255, 0.88);
  --bg-card-subtle: #FBF9F5;
  --bg-dark-card: #1E1E24;
  --bg-dark-card-subtle: #27272E;
  --bg-base: #FFFFFF;
  --bg-surface-elevated: #F8F7F3;
  
  /* Typography Colors */
  --text-main: #18181B;
  --text-body: #3F3F46;
  --text-muted: #8C877D;
  --text-light: #A1A1AA;
  --text-on-dark: #FFFFFF;
  --text-on-dark-muted: #A1A1AA;

  /* Brand Accents */
  --accent-gold: #F59E0B;
  --accent-gold-bright: #FBBF24;
  --accent-gold-bg: #FEF3C7;
  --accent-gold-subtle: rgba(245, 158, 11, 0.12);
  
  --accent-dark: #1E1E24;
  --accent-dark-hover: #2D2D35;
  
  --accent-purple: #8B5CF6;
  --accent-purple-bg: #EDE9FE;
  
  --accent-emerald: #10B981;
  --accent-emerald-bg: #D1FAE5;
  
  --accent-rose: #EF4444;
  --accent-rose-bg: #FEE2E2;

  --accent-blue: #3B82F6;
  --accent-blue-bg: #DBEAFE;

  /* Borders & Shadows */
  --border-light: rgba(0, 0, 0, 0.07);
  --border-card: rgba(0, 0, 0, 0.06);
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.05);
  
  --shadow-app-frame: 0 25px 60px -15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.03), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-pill: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-dark-card: 0 12px 30px -4px rgba(0, 0, 0, 0.25);
  --shadow-bottom-nav: 0 -4px 24px rgba(0, 0, 0, 0.08);

  /* Radius */
  --radius-app: 32px;
  --radius-card: 20px;
  --radius-pill: 9999px;
  --radius-md: 14px;
  --radius-sm: 8px;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-app);
  font-family: var(--font-sans);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  position: relative;
}

/* ==========================================================================
   ZERO-ACCESS GATEKEEPER AUTH SCREEN (WHEN NOT LOGGED IN)
   ========================================================================== */
body.app-locked #app-root {
  display: none !important;
}

body.app-locked #gatekeeper-auth-screen {
  display: flex !important;
}

#gatekeeper-auth-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at top center, #272732 0%, #131317 65%, #0B0B0E 100%);
  color: #FFFFFF;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.gatekeeper-container {
  width: 100%;
  max-width: 440px;
  background: #1C1C23;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-card);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: gatekeeperEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gatekeeperEntrance {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gatekeeper-header {
  padding: 24px 24px 16px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.gatekeeper-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.gatekeeper-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.gatekeeper-subtitle {
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

.gatekeeper-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0 20px;
}

.gatekeeper-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #A1A1AA;
  transition: all 0.2s ease;
  min-height: 44px;
}

.gatekeeper-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.gatekeeper-tab-btn.active {
  background: #FFFFFF;
  color: #18181B;
  border-color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.gatekeeper-body {
  padding: 20px 24px 24px 24px;
}

.gatekeeper-body.hidden {
  display: none !important;
}

.auth-form-group {
  margin-bottom: 14px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #D4D4D8;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0 18px;
  background: #141418;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 16px; /* 16px prevents iOS Safari auto-zoom */
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  border-color: #8B5CF6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.btn-auth-submit {
  width: 100%;
  height: 46px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
  color: #FFFFFF;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
  transition: all 0.2s ease;
  margin-top: 6px;
  margin-bottom: 12px;
  min-height: 44px;
}

.btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-auth-submit:active {
  transform: scale(0.98);
}

.btn-auth-demo {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-auth-demo:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: #F59E0B;
}

/* ==========================================================================
   APP MAIN WRAPPER
   ========================================================================== */
.crextio-app-wrapper {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-app);
  padding: 24px 32px 48px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Background warm glow */
.crextio-app-wrapper::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -100px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(253, 230, 138, 0.55) 0%, rgba(254, 243, 199, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   TOPBAR NAVIGATION
   ========================================================================== */
.crextio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
  margin-bottom: 24px;
  gap: 16px;
  width: 100%;
}

.crextio-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-pill);
  cursor: pointer;
  transition: transform 0.2s ease;
  min-height: 40px;
}

.crextio-brand-pill:hover {
  transform: translateY(-1px);
}

.crextio-brand-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.crextio-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.75; }
}

.crextio-view-badge-pill {
  display: none;
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  box-shadow: var(--shadow-pill);
}

.crextio-nav-pill-bar {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-pill);
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.crextio-nav-pill-bar::-webkit-scrollbar {
  display: none;
}

.crextio-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  min-height: 36px;
}

.crextio-nav-link:hover {
  color: var(--text-main);
}

.crextio-nav-link.active {
  background: var(--accent-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(30, 30, 36, 0.2);
}

.crextio-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crextio-action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: all 0.2s ease;
  min-height: 40px;
}

.crextio-action-pill-btn:hover {
  background: #FFFFFF;
  transform: translateY(-1px);
}

.crextio-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.crextio-icon-btn:hover {
  transform: translateY(-1px);
}

.crextio-icon-btn:active {
  transform: scale(0.95);
}

.crextio-avatar-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #3B82F6);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  border: 2px solid #FFFFFF;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.crextio-avatar-pill:active {
  transform: scale(0.95);
}

.btn-mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  flex-shrink: 0;
}

/* ==========================================================================
   FLOATING USER PROFILE POPUP
   ========================================================================== */
.user-profile-popup {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  background: #1C1C24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  animation: fadeInDown 0.2s ease;
}

.user-profile-popup.active {
  display: flex;
}

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

.profile-popup-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-popup-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #3B82F6);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.profile-popup-info {
  overflow: hidden;
}

.profile-popup-name {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-popup-email {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.profile-popup-badges {
  display: flex;
  gap: 6px;
}

.profile-popup-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.profile-stat-label {
  color: var(--text-on-dark-muted);
}

.profile-stat-val {
  color: #FFFFFF;
  font-weight: 600;
}

.profile-popup-actions {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-profile-action {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: #E4E4E7;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.btn-profile-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.profile-popup-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.btn-profile-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.btn-profile-logout:hover {
  background: #EF4444;
  color: #FFFFFF;
}

/* ==========================================================================
   MOBILE SIDEBAR DRAWER & BACKDROP OVERLAY
   ========================================================================== */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9980;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-sidebar-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 310px;
  max-width: 86vw;
  background: #14141A;
  color: #FFFFFF;
  z-index: 9985;
  transform: translateX(-100%);
  visibility: hidden;
  box-shadow: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-sidebar-drawer.active {
  transform: translateX(0);
  visibility: visible;
  box-shadow: 15px 0 45px rgba(0, 0, 0, 0.5);
}

.mobile-drawer-header {
  padding: 20px 20px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-drawer-user-card {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-drawer-nav-list {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.mobile-drawer-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #D4D4D8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s ease;
  min-height: 46px;
  cursor: pointer;
}

.mobile-drawer-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.mobile-drawer-nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.2));
  border-color: rgba(139, 92, 246, 0.45);
  color: #FFFFFF;
}

.mobile-drawer-telemetry-footer {
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11px;
  color: var(--text-on-dark-muted);
}

/* ==========================================================================
   MOBILE FLOATING BOTTOM NAVIGATION BAR (THUMB ZONE)
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-bottom-nav);
  z-index: 990;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.15s ease;
  min-height: 48px;
}

.mobile-bottom-nav-item i,
.mobile-bottom-nav-item svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.mobile-bottom-nav-item.active {
  color: var(--accent-dark);
}

.mobile-bottom-nav-item.active i,
.mobile-bottom-nav-item.active svg {
  transform: translateY(-2px);
  color: var(--accent-dark);
}

/* ==========================================================================
   CREXTIO HERO & METRICS SECTION
   ========================================================================== */
.crextio-hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}

.crextio-greeting-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.crextio-progress-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crextio-metric-capsule {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  height: 36px;
  transition: all 0.2s ease;
}

.capsule-dark {
  background: var(--accent-dark);
  color: #FFFFFF;
  min-width: 150px;
}

.capsule-gold {
  background: var(--accent-gold);
  color: #18181B;
}

.capsule-striped {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.capsule-outline {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-main);
}

.crextio-hero-kpi-group {
  display: flex;
  align-items: center;
  gap: 32px;
}

.crextio-stat-counter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crextio-stat-counter-icon {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

.crextio-stat-counter-val {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.crextio-stat-counter-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   CREXTIO 6-PANEL GRID LAYOUT
   ========================================================================== */
.crextio-grid-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 260px;
  grid-template-rows: auto auto;
  gap: 20px;
  width: 100%;
}

.crextio-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  position: relative;
  transition: all 0.2s ease;
  overflow: hidden;
}

.crextio-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.crextio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.crextio-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.crextio-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.crextio-arrow-btn:hover {
  background: var(--accent-dark);
  color: #FFFFFF;
  border-color: var(--accent-dark);
}

/* Schedule Card Date Strip */
.crextio-date-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 4px 14px 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.date-col-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

.date-col-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.date-col-num.active {
  background: var(--accent-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(30, 30, 36, 0.25);
}

.crextio-timeline-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-event-card {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Telemetry Spline Wave Canvas */
.chart-canvas-container {
  width: 100%;
  height: 180px;
  position: relative;
}

.chart-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.chart-header-legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-body);
}

.legend-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-circle.dark { background: var(--accent-dark); }
.legend-circle.gold { background: var(--accent-gold); }

/* Donut Resource Allocation */
.donut-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 10px auto;
}

.donut-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.donut-center-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

.donut-legend-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 10px;
}

/* ==========================================================================
   VIEW SECTIONS
   ========================================================================== */
.view-section {
  display: none;
  width: 100%;
  animation: fadeIn 0.25s ease;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   VIEW 3: AI CLI STUDIO (BEDROCK, AGY, CODEX, ROOT)
   ========================================================================== */
.cli-studio-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cli-studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cli-windows-grid {
  display: grid;
  gap: 16px;
  width: 100%;
}

.cli-windows-grid.layout-single {
  grid-template-columns: 1fr;
}

.cli-windows-grid.layout-split {
  grid-template-columns: 1fr 1fr;
}

.cli-windows-grid.layout-quad {
  grid-template-columns: 1fr 1fr;
}

.cli-window-card {
  background: #111116;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 600px;
  overflow: hidden;
}

.cli-window-header {
  padding: 10px 16px;
  background: #181820;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Quick Command Chips Bar (Touch Ergonomic) */
.cli-window-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #15151B;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cli-window-chips-bar::-webkit-scrollbar {
  display: none;
}

.cli-chip-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #E4E4E7;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.cli-chip-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.cli-chip-btn:active {
  transform: scale(0.96);
}

.cli-window-body {
  flex: 1;
  padding: 14px 16px;
  background: #0D0D11;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #E4E4E7;
  line-height: 1.45;
}

.cli-window-input-bar {
  padding: 10px 14px;
  background: #181820;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cli-window-input {
  flex: 1;
  background: #0D0D11;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 13px;
  border-radius: var(--radius-pill);
  padding: 0 14px;
  height: 38px;
  outline: none;
}

/* ==========================================================================
   VIEW 4: AI STUDIO (AMAZON BEDROCK, GEMINI, CHATGPT, CLAUDE)
   ========================================================================== */
.crextio-ai-layout {
  width: 100%;
}

.crextio-ai-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
  min-height: calc(100dvh - 160px);
  overflow: hidden;
}

.crextio-ai-topbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

#ai-bedrock-submodels-bar .cli-chip-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  box-shadow: var(--shadow-pill);
}

#ai-bedrock-submodels-bar .cli-chip-btn:hover {
  background: var(--accent-dark);
  color: #FFFFFF;
}

.crextio-ai-chat-stream {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card-subtle);
}

/* AI Welcome Card & Suggestion Chips */
.ai-welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.ai-suggestion-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.ai-suggestion-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.ai-suggestion-chip:hover {
  background: #FFFFFF;
  border-color: #0066FF;
  transform: translateY(-1px);
  box-shadow: var(--shadow-pill);
}

.chip-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chip-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

/* Chat Bubbles */
.chat-bubble-user-wrapper {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.chat-bubble-user {
  max-width: 80%;
  background: var(--accent-dark);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  font-size: 13.5px;
  line-height: 1.5;
}

.chat-bubble-bot-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.chat-bubble-bot {
  max-width: 85%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 4px 18px 18px 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  font-size: 13.5px;
  line-height: 1.6;
}

/* DeepSeek R1 Thought Process Accordion */
.ai-thought-drawer {
  background: rgba(0, 102, 255, 0.04);
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.ai-thought-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #0066FF;
  user-select: none;
  background: rgba(0, 102, 255, 0.06);
}

.ai-thought-summary:hover {
  background: rgba(0, 102, 255, 0.1);
}

.ai-thought-content {
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
  border-top: 1px solid rgba(0, 102, 255, 0.12);
  background: #FFFFFF;
}

/* Tool Execution Badges */
.ai-tool-calls-container {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.ai-tool-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-tool-badges-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-tool-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px;
  background: #FFFFFF;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  font-size: 11px;
}

.ai-tool-pill .tool-name {
  font-weight: 800;
  font-family: var(--font-mono);
  color: #0066FF;
}

.ai-tool-pill .tool-args {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.ai-tool-pill .tool-status-tag {
  font-weight: 800;
  color: #10B981;
  font-size: 10px;
}

/* Chat Action Footer */
.chat-action-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.btn-chat-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chat-action:hover {
  background: var(--accent-dark);
  color: #FFFFFF;
  border-color: var(--accent-dark);
}

.ai-pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 1.2s infinite ease-in-out;
}

.chat-code-block {
  background: #18181B;
  color: #F4F4F5;
  border-radius: var(--radius-md);
  margin: 10px 0;
  overflow: hidden;
}

.chat-code-block .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #27272A;
  color: #A1A1AA;
  border-bottom: 1px solid #3F3F46;
}

.chat-code-block .copy-code-btn {
  background: transparent;
  border: none;
  color: #A1A1AA;
  cursor: pointer;
  font-size: 11px;
}

.chat-code-block .copy-code-btn:hover {
  color: #FFFFFF;
}

.chat-code-block code {
  display: block;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
}

.inline-code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #D946EF;
}

.crextio-ai-input-bar {
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.crextio-ai-input {
  flex: 1;
  height: 46px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  padding: 0 18px;
  font-size: 14px;
  background: #FFFFFF;
  color: var(--text-main);
  outline: none;
}

/* ==========================================================================
   APPLE-STYLE CALENDAR STUDIO (MOBILE-FIRST iOS DESIGN)
   ========================================================================== */
.apple-cal-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header Bar */
.apple-cal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 12px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
}

.apple-cal-title-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apple-nav-chevron {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.apple-nav-chevron:hover {
  background: var(--accent-dark);
  color: #FFFFFF;
}

.apple-title-date-group {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.apple-title-date-group:hover {
  background: rgba(0, 0, 0, 0.04);
}

.apple-month-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

.apple-today-pill {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 59, 48, 0.1);
  color: #FF3B30;
  border: 1px solid rgba(255, 59, 48, 0.25);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.apple-today-pill:hover {
  background: #FF3B30;
  color: #FFFFFF;
}

/* iOS Segmented Control: [Day | Month | List] */
.apple-segmented-control {
  display: inline-flex;
  align-items: center;
  background: #EFEAE1;
  padding: 3px;
  border-radius: var(--radius-pill);
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.apple-seg-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 30px;
}

.apple-seg-btn.active {
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header Actions */
.apple-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apple-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: #FF3B30;
  color: #FFFFFF;
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255, 59, 48, 0.3);
  transition: all 0.15s ease;
  min-height: 36px;
}

.apple-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.4);
}

.apple-feeds-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.apple-feeds-btn:hover {
  background: #FFFFFF;
  color: var(--text-main);
}

/* Filter Chips Bar */
.apple-feed-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}

.apple-feed-filter-bar::-webkit-scrollbar {
  display: none;
}

.apple-feed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-pill);
  min-height: 32px;
}

.apple-feed-chip.active {
  background: var(--accent-dark);
  color: #FFFFFF;
  border-color: var(--accent-dark);
  box-shadow: 0 3px 10px rgba(30, 30, 36, 0.25);
}

.apple-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Apple 7-Day Interactive Week Scroller Strip */
.apple-week-strip-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
}

.apple-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.apple-week-day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 2px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 68px;
}

.apple-week-day-btn:hover {
  background: var(--bg-card-subtle);
}

.apple-week-day-letter {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.apple-week-day-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.apple-week-day-btn.selected .apple-week-day-num {
  border: 2px solid #FF3B30;
  color: #FF3B30;
}

.apple-week-day-btn.today .apple-week-day-num {
  background: #FF3B30 !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 10px rgba(255, 59, 48, 0.4);
}

.apple-week-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 6px;
}

.apple-micro-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.apple-micro-dot.empty {
  opacity: 0;
}

/* View Panels */
.apple-viewport-container {
  width: 100%;
}

.apple-panel-view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.apple-panel-view.active {
  display: block;
}

/* Panel 1: Day Timeline View */
.apple-day-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.apple-day-heading {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.apple-day-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.apple-allday-container {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.apple-allday-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.apple-allday-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apple-allday-card {
  padding: 8px 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.apple-timeline-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.apple-timeline-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.apple-timeline-time-col {
  width: 50px;
  flex-shrink: 0;
  padding-top: 8px;
  text-align: right;
}

.apple-time-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.apple-timeline-card-col {
  flex: 1;
}

.apple-event-bubble {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.apple-event-bubble:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.apple-event-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.apple-event-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.apple-event-desc {
  font-size: 11.5px;
  color: var(--text-body);
  margin-top: 6px;
  background: var(--bg-card-subtle);
  padding: 6px 8px;
  border-radius: 6px;
}

.apple-mini-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.apple-mini-icon-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.apple-empty-day-state {
  text-align: center;
  padding: 36px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
}

.apple-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.apple-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.apple-empty-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Panel 2: Month Grid View */
.apple-month-weekdays-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  padding: 10px 0;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-card);
  border-top-right-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  border-bottom: none;
}

.apple-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-card);
  border-bottom-left-radius: var(--radius-card);
  border-bottom-right-radius: var(--radius-card);
  overflow: hidden;
}

.apple-month-day-cell {
  background: var(--bg-card);
  min-height: 72px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.apple-month-day-cell:hover {
  background: var(--bg-card-subtle);
}

.apple-month-day-cell.other-month {
  opacity: 0.35;
}

.apple-month-day-cell.is-selected {
  background: rgba(255, 59, 48, 0.06);
}

.apple-day-cell-top {
  display: flex;
  align-items: center;
  justify-content: center;
}

.apple-day-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.apple-day-num.today-pill {
  background: #FF3B30 !important;
  color: #FFFFFF !important;
  font-weight: 800;
}

.apple-month-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 6px;
  flex-wrap: wrap;
}

/* Panel 3: Agenda Stream View */
.apple-agenda-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.apple-agenda-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apple-agenda-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  box-shadow: var(--shadow-pill);
}

.apple-agenda-sticky-header.today-highlight {
  border-color: rgba(255, 59, 48, 0.35);
  background: rgba(255, 59, 48, 0.08);
  color: #FF3B30;
}

.apple-agenda-cards-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apple-agenda-card {
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.apple-agenda-card:hover {
  transform: translateX(2px);
}

.apple-agenda-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.apple-agenda-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   BUTTONS & PILLS UTILITIES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-height: 40px;
}

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

.btn-primary {
  background: var(--accent-dark);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-dark-hover);
}

.btn-secondary {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #FFFFFF;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 11.5px;
  min-height: 32px;
}

.soft-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
}

.pill-emerald { background: var(--accent-emerald-bg); color: #047857; }
.pill-purple { background: var(--accent-purple-bg); color: #6D28D9; }
.pill-gold { background: var(--accent-gold-bg); color: #B45309; }
.pill-rose { background: var(--accent-rose-bg); color: #B91C1C; }
.pill-gray { background: #F4F4F5; color: #71717A; }

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9990;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  max-height: 88dvh;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.2s ease;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-body.hidden {
  display: none !important;
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: #18181E;
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-pill.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-danger { border-left: 4px solid var(--accent-rose); }
.toast-warning { border-left: 4px solid var(--accent-gold); }
.toast-info { border-left: 4px solid var(--accent-purple); }

/* ==========================================================================
   RESPONSIVE DESIGN (DESKTOP, TABLETS & MOBILE OPTIMIZATIONS)
   ========================================================================== */
@media (max-width: 1200px) {
  .crextio-grid-layout {
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 900px) {
  body {
    padding: 0;
  }

  .crextio-app-wrapper {
    padding: 14px 12px calc(80px + env(safe-area-inset-bottom)) 12px;
    border-radius: 0;
  }

  .crextio-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
  }

  .crextio-nav-pill-bar {
    display: none !important;
  }

  .crextio-view-badge-pill {
    display: inline-flex;
  }

  .btn-mobile-menu-toggle {
    display: inline-flex;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  #toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
    align-items: center;
  }

  .toast-pill {
    width: 100%;
    max-width: 380px;
    font-size: 12px;
    padding: 8px 14px;
  }

  .crextio-hero-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
  }

  .crextio-greeting-title {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .crextio-progress-ribbon {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .crextio-metric-capsule {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 11.5px;
  }

  .capsule-dark {
    min-width: unset;
  }

  .crextio-hero-kpi-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .crextio-stat-counter {
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-card);
    padding: 10px 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-card);
  }

  .crextio-stat-counter-icon {
    display: none;
  }

  .crextio-stat-counter-val {
    font-size: 22px;
  }

  .crextio-stat-counter-label {
    font-size: 10px;
  }

  .crextio-grid-layout {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .cli-windows-grid,
  .cli-windows-grid.layout-split,
  .cli-windows-grid.layout-quad {
    grid-template-columns: 1fr !important;
  }

  .cli-window-card {
    min-height: 360px;
    max-height: 460px;
  }

  .crextio-ai-card {
    min-height: calc(100vh - 140px);
    min-height: calc(100dvh - 140px);
  }

  .crextio-ai-topbar {
    padding: 12px 14px;
    gap: 10px;
  }

  .crextio-ai-chat-stream {
    padding: 12px;
  }

  .crextio-ai-input-bar {
    padding: 8px 12px;
  }

  .crextio-ai-input {
    font-size: 16px; /* Prevents auto-zoom on iOS */
    height: 42px;
  }

  .modal-card {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    margin: 8px;
  }

  .user-profile-popup {
    position: fixed;
    top: auto;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    width: auto;
    max-width: 100%;
  }

  /* Apple Calendar Mobile Adaptations */
  .apple-cal-header-bar {
    padding: 12px 14px;
    gap: 10px;
  }

  .apple-cal-title-nav {
    width: 100%;
    justify-content: space-between;
  }

  .apple-month-title {
    font-size: 16.5px;
  }

  .apple-segmented-control {
    width: 100%;
    justify-content: space-between;
  }

  .apple-seg-btn {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    font-size: 11.5px;
  }

  .apple-header-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .apple-add-btn {
    flex: 1;
    justify-content: center;
  }

  .apple-feeds-btn {
    flex: 1;
    justify-content: center;
  }

  .apple-week-strip-card {
    padding: 8px 6px;
  }

  .apple-week-strip {
    gap: 3px;
  }

  .apple-week-day-btn {
    padding: 6px 1px;
    min-height: 60px;
  }

  .apple-week-day-num {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .apple-month-day-cell {
    min-height: 54px;
    padding: 4px 2px;
  }

  .apple-day-num {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
}
