/* ==========================================================================
   DG HOUSE — SMART EASE MOBILE & RESPONSIVE DESIGN SYSTEM
   Color Tokens: Terracotta (#C27833), Sand (#F5EDE4), Off-White, Charcoal
   ========================================================================== */

:root {
  /* Surface Colors */
  --canvas-bg: #F5EDE4;
  --canvas-card: #FFFFFF;
  --canvas-subtle: #FAF7F2;
  --canvas-dark: #1E2125;
  
  /* Brand Amber / Terracotta */
  --brand-amber: #C27833;
  --brand-amber-dark: #A86224;
  --brand-amber-light: #FBEFE2;
  --brand-amber-glow: rgba(194, 120, 51, 0.25);
  --brand-amber-grad: linear-gradient(135deg, #D6853C 0%, #B86A24 100%);
  
  /* Charcoal & Black Accents */
  --charcoal-black: #1E2125;
  --charcoal-card: #272B31;
  --charcoal-hover: #141618;
  --charcoal-grad: linear-gradient(145deg, #2D3138 0%, #1A1C20 100%);

  /* Typography */
  --text-main: #1D2129;
  --text-body: #525966;
  --text-muted: #8E95A2;
  --text-dim: #B4B9C4;
  --text-white: #FFFFFF;
  
  /* Borders & Dividers */
  --border-light: #EFE7DE;
  --border-subtle: #F6EFE7;
  --border-active: #C27833;
  
  /* Badges */
  --badge-green: #10B981;
  --badge-green-bg: #E6F7F0;
  --badge-red: #EF4444;
  --badge-red-bg: #FEE2E2;

  /* Geometry & Shadows */
  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
  --shadow-amber: 0 8px 20px rgba(194, 120, 51, 0.28);
  --shadow-phone: 0 25px 60px -15px rgba(30, 33, 37, 0.25), 0 0 0 1px rgba(0,0,0,0.06);

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --font-family: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-family);
  background: var(--canvas-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
}

/* ==========================================================================
   TOP PRESENTATION HEADER (DESKTOP MODE)
   ========================================================================== */
.presentation-bar {
  width: 100%;
  max-width: 1360px;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  z-index: 100;
  background: rgba(245, 237, 228, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.brand-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--brand-amber-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  box-shadow: var(--shadow-amber);
}

.brand-texts h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-texts p {
  font-size: 0.75rem;
  color: var(--text-body);
  font-weight: 500;
}

.presentation-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-toggle-pill {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.view-toggle-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
  font-family: inherit;
}

.view-toggle-btn.active {
  background: var(--charcoal-black);
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-light);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-body);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--badge-green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   VIEWPORT WRAPPER & PHONE FRAME CONTAINER
   ========================================================================== */
.app-viewport-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 1360px;
  padding: 1.25rem 1rem 3rem;
  transition: var(--transition);
}

/* MODE 1: PHONE FRAME SIMULATOR (iPhone 16 Pro) */
.phone-frame {
  width: 410px;
  max-width: 100%;
  height: min(870px, calc(100vh - 105px));
  background: #FFFFFF;
  border-radius: 48px;
  box-shadow: var(--shadow-phone);
  border: 8px solid #1E2125;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}

/* MODE 2: RESPONSIVE DASHBOARD (FULL SCREEN MODE) */
.app-viewport-wrapper.full-screen-mode .phone-frame {
  width: 100%;
  max-width: 1100px;
  height: auto;
  min-height: 800px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}

.app-viewport-wrapper.full-screen-mode .phone-status-bar,
.app-viewport-wrapper.full-screen-mode .dynamic-island,
.app-viewport-wrapper.full-screen-mode .phone-home-indicator {
  display: none !important;
}

/* Phone Status Bar */
.phone-status-bar {
  height: 48px;
  padding: 0.8rem 1.75rem 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-main);
  z-index: 40;
  position: relative;
  background: transparent;
  flex-shrink: 0;
}

.status-time {
  font-weight: 700;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.dynamic-island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #000000;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: var(--transition);
}

.island-camera {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #111B27;
  border: 1px solid #1A2735;
}

.phone-home-indicator {
  width: 135px;
  height: 5px;
  background: #000000;
  border-radius: var(--radius-full);
  margin: 0.4rem auto 0.35rem;
  flex-shrink: 0;
  opacity: 0.35;
}

/* ==========================================================================
   SCROLLABLE SCREEN CONTAINER
   ========================================================================== */
.screen-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  background: #FFFFFF;
}

.screen-scrollable::-webkit-scrollbar {
  width: 6px;
}
.screen-scrollable::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 6px;
}

/* Screen Transitions */
.view-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  animation: fadeInScreen 0.25s ease-out;
}

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

/* Floating Toast Notifications */
.toast-floating {
  position: fixed;
  top: 54px;
  left: 50%;
  transform: translateX(-50%) translateY(-25px);
  background: rgba(30, 33, 37, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.825rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-floating.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-error-box {
  background: #FEF2F2;
  border: 1px solid #F87171;
  color: #991B1B;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: shakeError 0.3s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Floating Bottom Navigation Bar */
.floating-bottom-nav {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 44px);
  max-width: 380px;
  height: 60px;
  background: #FFFFFF;
  border-radius: var(--radius-full);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-light);
  padding: 0 0.5rem;
  z-index: 90;
}

.app-viewport-wrapper.full-screen-mode .floating-bottom-nav {
  position: static;
  transform: none;
  width: 100%;
  max-width: 440px;
  margin: 1.5rem auto 1rem;
}

.nav-tab-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.nav-tab-item:hover {
  color: var(--brand-amber);
  background: var(--brand-amber-light);
}

.nav-tab-item.active {
  background: var(--brand-amber-grad);
  color: white;
  box-shadow: var(--shadow-amber);
}

/* ==========================================================================
   1. SPLASH / ONBOARDING SCREEN (SCREEN 1)
   ========================================================================== */
.splash-wrapper {
  position: relative;
  min-height: 780px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-image: url('../assets/splash_woman.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.splash-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.2) 45%, rgba(15,17,20,0.85) 100%);
  pointer-events: none;
}

.splash-content-card {
  position: relative;
  z-index: 10;
  background: rgba(30, 33, 37, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 36px 36px 0 0;
  padding: 2.25rem 1.75rem 2.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.splash-pagination-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.splash-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: var(--transition);
}

.splash-dot.active {
  width: 22px;
  border-radius: var(--radius-full);
  background: var(--brand-amber);
}

.splash-title {
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.5px;
  color: #FFFFFF;
}

.splash-subtitle {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

.splash-cta-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #121417;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 6px 1.5rem 6px 6px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
}

.splash-cta-btn:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.splash-btn-lock {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #272B31;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 0.95rem;
}

.splash-btn-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #FFFFFF;
}

/* ==========================================================================
   2. LOGIN / AUTHENTICATION SCREEN (SCREEN 2)
   ========================================================================== */
.auth-wrapper {
  padding: 1.5rem 1.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #FFFFFF;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.auth-top-nav {
  display: flex;
  justify-content: flex-end;
}

.help-link {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.auth-brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.auth-logo-badge {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--brand-amber-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  box-shadow: var(--shadow-amber);
}

.auth-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.auth-header-texts {
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-header-texts h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.auth-header-texts p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-group-custom {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-pill-wrapper {
  display: flex;
  align-items: center;
  background: #FAFAF8;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.75rem 1.25rem;
  gap: 0.75rem;
  transition: var(--transition);
}

.input-pill-wrapper:focus-within {
  border-color: var(--brand-amber);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px var(--brand-amber-glow);
}

.input-pill-icon {
  font-size: 1rem;
  color: var(--text-muted);
}

.input-pill-select, .input-pill-field {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: inherit;
}

.input-pill-field::placeholder {
  color: var(--text-dim);
  font-weight: 500;
}

.input-pill-addon {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
}

.auth-aux-links {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.4rem;
}

.forgot-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.forgot-link span {
  color: var(--brand-amber);
  text-decoration: underline;
  font-weight: 600;
}

.btn-dark-pill {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--charcoal-black);
  color: white;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition);
  font-family: inherit;
}

.btn-dark-pill:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.auth-bottom-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  color: var(--text-body);
  margin-top: 0.25rem;
}

.auth-bottom-links a {
  color: var(--brand-amber);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.biometric-card {
  background: #FAF8F5;
  border: 1.5px dashed #DEC8B0;
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: var(--transition);
}

.biometric-card:hover {
  background: var(--brand-amber-light);
  border-color: var(--brand-amber);
  transform: translateY(-2px);
}

.biometric-icon {
  font-size: 1.5rem;
  color: var(--brand-amber);
}

.biometric-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-body);
  text-align: center;
}

/* ==========================================================================
   3. HOME DASHBOARD (SCREEN 3)
   ========================================================================== */
.home-wrapper {
  padding: 1.25rem 1.5rem 6.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.app-viewport-wrapper.full-screen-mode .home-wrapper {
  padding-bottom: 2rem;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-brand-mini {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mini-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background: var(--brand-amber-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.95rem;
  box-shadow: var(--shadow-amber);
}

.mini-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.home-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
}

.home-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

.avatar-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--badge-green);
  border: 2px solid white;
}

.home-headline {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.22;
  color: var(--text-main);
}

/* Hero Balcony Photo Card */
.hero-photo-card {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-image: url('../assets/balcony_hero.jpg');
  background-size: cover;
  background-position: center;
}

.hero-tags-container {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.hero-glass-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 33, 37, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-expand-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(30, 33, 37, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.hero-expand-btn:hover {
  background: #000000;
  transform: scale(1.08);
}

/* Dark Energy Consumption Card */
.energy-pill-card {
  background: var(--charcoal-black);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.energy-pill-card:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.energy-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.energy-bolt-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-amber-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  box-shadow: var(--shadow-amber);
}

.kwh-big {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.kwh-big span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kwh-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.energy-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.95rem;
}

/* Section Header Rows */
.section-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.section-row-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.header-action-icon {
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.header-action-icon:hover {
  color: var(--brand-amber);
}

/* Horizontal Categories */
.categories-slider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.categories-slider::-webkit-scrollbar {
  display: none;
}

.category-circle-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.category-circle-btn:hover {
  border-color: var(--brand-amber);
  color: var(--brand-amber);
  transform: translateY(-2px);
}

.category-circle-btn.active {
  background: var(--brand-amber-grad);
  border-color: var(--brand-amber);
  color: white;
  box-shadow: var(--shadow-amber);
}

/* Quick Control 2-Column Grid (Expands to 4 columns on Desktop) */
.quick-control-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 860px) {
  .app-viewport-wrapper.full-screen-mode .quick-control-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.device-card-quick {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  min-height: 145px;
  cursor: pointer;
  transition: var(--transition);
}

.device-card-quick:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #E2D3C2;
}

.device-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.device-info-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.device-info-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.device-image-thumb {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  height: 60px;
  margin-top: 0.5rem;
}

.device-image-thumb img {
  max-width: 75px;
  max-height: 55px;
  object-fit: contain;
}

.device-icon-large {
  font-size: 2.5rem;
  color: var(--brand-amber);
  opacity: 0.85;
}

/* Custom Switch Toggle */
.switch-custom {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-custom input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #E5E7EB;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .switch-slider {
  background-color: var(--brand-amber);
}

input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Automations List */
.automation-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.automation-item {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.automation-item:hover {
  border-color: #E2D3C2;
  box-shadow: var(--shadow-md);
}

.automation-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.automation-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: #F8F5EE;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-amber);
  font-size: 1.15rem;
}

.automation-text h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.automation-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Promo / News Card */
.promo-banner-card {
  background: #FAF8F5;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.promo-brand {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.promo-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-amber);
  margin: 3px 0;
}

.promo-sub {
  font-size: 0.78rem;
  color: var(--text-body);
}

.promo-btn {
  background: var(--charcoal-black);
  color: white;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.promo-btn:hover {
  background: #000000;
  transform: translateY(-2px);
}

/* ==========================================================================
   4. DEVICE DETAIL: CLIMATE CONTROL (SCREEN 4)
   ========================================================================== */
.detail-wrapper {
  padding: 1.25rem 1.75rem 6.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.app-viewport-wrapper.full-screen-mode .detail-wrapper {
  padding-bottom: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.detail-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-back-btn, .icon-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FAFAF8;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.icon-back-btn:hover, .icon-menu-btn:hover {
  background: var(--brand-amber-light);
  border-color: var(--brand-amber);
  color: var(--brand-amber);
}

.detail-title-group {
  text-align: center;
}

.detail-tag-id {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-amber);
}

.detail-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.climate-status-headline {
  display: flex;
  flex-direction: column;
  margin: 0.5rem 0;
}

.climate-mode-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.climate-temp-display {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.05;
  color: var(--text-main);
}

.climate-temp-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.appliance-showcase-box {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.appliance-showcase-box img {
  max-width: 220px;
  max-height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.12));
}

.mode-selectors-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0;
}

.mode-circle-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.mode-circle-btn:hover {
  border-color: var(--brand-amber);
  color: var(--brand-amber);
}

.mode-circle-btn.active {
  background: var(--brand-amber-grad);
  border-color: var(--brand-amber);
  color: white;
  box-shadow: var(--shadow-amber);
}

.timer-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timer-section-row h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.timer-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.timer-pill {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-full);
  background: #FAFAF8;
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-body);
  cursor: pointer;
  transition: var(--transition);
}

.timer-pill:hover {
  border-color: var(--brand-amber);
  color: var(--brand-amber);
}

.timer-pill.active {
  background: var(--brand-amber-grad);
  border-color: var(--brand-amber);
  color: white;
  box-shadow: var(--shadow-amber);
}

.split-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.split-card {
  background: #FAF8F5;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 135px;
}

.account-avatars-grid {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
}

.avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid white;
}

.avatar-add-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--charcoal-black);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.avatar-add-btn:hover {
  background: #000000;
  transform: scale(1.08);
}

.schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.schedule-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.schedule-time-box {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.temp-adjust-floating-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}

.btn-adjust-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  cursor: pointer;
  transition: var(--transition);
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-light);
}

.btn-adjust-circle:hover {
  background: #F4EFE8;
  transform: translateY(-2px);
}

.btn-adjust-circle.amber {
  background: var(--brand-amber-grad);
  color: white;
  box-shadow: var(--shadow-amber);
  border: none;
}

.btn-adjust-circle.amber:hover {
  box-shadow: 0 12px 28px rgba(194, 120, 51, 0.4);
}

/* ==========================================================================
   5. ENERGY ANALYSIS (SCREEN 5)
   ========================================================================== */
.analysis-big-stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kwh-huge {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-main);
  line-height: 1;
}

.kwh-huge span {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-badge-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  color: var(--text-body);
}

.energy-chart-container {
  background: #FAF8F5;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1.5rem 1rem 1rem;
  box-shadow: var(--shadow-sm);
  margin-top: 0.5rem;
}

.bar-chart-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 160px;
  padding: 0 0.5rem;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  flex: 1;
}

.bar-pillar {
  width: 28px;
  border-radius: var(--radius-xs);
  background: #E8DCCF;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
  transition: var(--transition);
}

.bar-col:hover .bar-pillar {
  background: #DEC8B3;
  transform: scaleY(1.04);
}

.bar-pillar.active-highlight {
  background: var(--brand-amber-grad);
  box-shadow: var(--shadow-amber);
}

.bar-lightning-badge {
  color: white;
  font-size: 0.85rem;
  animation: pulseLight 1.5s infinite;
}

.bar-label-month {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bar-col.active-col .bar-label-month {
  color: var(--brand-amber);
}

.per-device-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.per-device-item {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.per-device-item:hover {
  border-color: #E2D3C2;
  box-shadow: var(--shadow-md);
}

.per-device-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.per-device-kwh {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   6. ADD NEW DEVICE (SCREEN 6)
   ========================================================================== */
.step-label-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.5rem;
}

.device-preview-card {
  background: #FAF8F5;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.device-preview-img {
  width: 180px;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
}

.device-meta-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  border-top: 1px solid var(--border-light);
  padding-top: 0.75rem;
}

.barcode-scan-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  background: #F4EFE8;
  border: 1.5px dashed var(--brand-amber);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: var(--transition);
}

.barcode-scan-btn:hover {
  background: var(--brand-amber-light);
  border-style: solid;
}

/* ==========================================================================
   MODAL DIALOGS & OVERLAYS (Modern Glassmorphism)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

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

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #F8F5EE;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: #EFE7DE;
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: #FAF8F5;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   MODULE 1: AVATAR EDIT & PREVIEW
   ========================================================================== */
.avatar-edit-box {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.avatar-edit-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-amber);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: 2.5px solid #FFFFFF;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.avatar-edit-box:hover .avatar-edit-badge {
  transform: scale(1.15);
}

.avatar-crop-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.avatar-crop-preview {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid var(--brand-amber);
  box-shadow: 0 8px 24px rgba(194, 120, 51, 0.25);
  overflow: hidden;
  position: relative;
  background: #F3ECE2;
}

.avatar-crop-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.1s linear;
}

/* ==========================================================================
   MODULE 2: FAMILLE ET ENFANTS
   ========================================================================== */
.family-hero-card {
  background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  margin: 1rem 0 1.25rem;
}

.family-hero-card::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(214, 133, 60, 0.25);
  border-radius: 50%;
  filter: blur(25px);
}

.family-hero-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.family-hero-card p {
  font-size: 0.82rem;
  color: #CBD5E1;
  max-width: 85%;
}

.child-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: var(--transition);
}

.child-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #E2D3C2;
}

.child-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.child-user-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.child-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-amber-light);
}

.curfew-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
}

.curfew-pill.active {
  background: #FEE2E2;
  color: #991B1B;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  background: #F8F5EE;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}

.chip-item.selected {
  background: var(--brand-amber);
  color: #FFFFFF;
  border-color: var(--brand-amber);
}

/* ==========================================================================
   MODULE 3: ESP32 HARDWARE STUDIO & GPIO MATRIX
   ========================================================================== */
.esp32-stage-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1rem 0;
}

.board-selector-bar {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.board-tab-btn {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-body);
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.board-tab-btn.active {
  background: var(--charcoal-black);
  color: #FFFFFF;
  border-color: var(--charcoal-black);
}

.esp32-visual-chassis {
  background: #14171C;
  border: 2px solid #282E39;
  border-radius: 18px;
  padding: 1.25rem 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  position: relative;
}

.esp32-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #232936;
}

.esp32-chip-badge {
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-family: 'Outfit', monospace;
  font-weight: 800;
  font-size: 0.82rem;
  color: #38BDF8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.esp32-usb-port {
  width: 36px;
  height: 18px;
  background: #64748B;
  border-radius: 4px;
  border: 1px solid #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #0F172A;
  font-weight: 900;
}

.esp32-pinout-grid {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.esp32-pin-column {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.pin-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: #1A1F28;
  border: 1px solid #262D3B;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pin-row:hover {
  background: #232A37;
  border-color: #3B82F6;
  transform: translateX(2px);
}

.pin-row.right {
  flex-direction: row-reverse;
  text-align: right;
}

.pin-row.right:hover {
  transform: translateX(-2px);
}

.pin-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #475569;
  border: 2px solid #0F172A;
  flex-shrink: 0;
}

.pin-bullet.output {
  background: #F59E0B;
  box-shadow: 0 0 8px #F59E0B;
}

.pin-bullet.input {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.pin-bullet.conflict {
  background: #EF4444;
  box-shadow: 0 0 10px #EF4444;
}

.pin-bullet.forbidden {
  background: #334155;
  opacity: 0.4;
}

.pin-number {
  font-family: 'Outfit', monospace;
  font-weight: 800;
  color: #94A3B8;
  min-width: 42px;
}

.pin-assigned-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-assigned-tag.sensor {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.3);
}

.pin-assigned-tag.forbidden {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.conflict-alert-box {
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: #991B1B;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.82rem;
  margin: 0.85rem 0;
}

.conflict-alert-box i {
  font-size: 1.1rem;
  margin-top: 2px;
}

.hardware-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.hw-btn {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.hw-btn:hover {
  background: #F8F5EE;
  border-color: var(--brand-amber);
  transform: translateY(-2px);
}

.hw-btn i {
  font-size: 1.15rem;
  color: var(--brand-amber);
}

.hw-btn.primary {
  background: var(--brand-amber-grad);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 14px rgba(194, 120, 51, 0.35);
}

.hw-btn.primary i {
  color: #FFFFFF;
}

.hw-btn.code-action {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.hw-btn.code-action i {
  color: #FFFFFF;
}

.hw-btn.code-action:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  transform: translateY(-2px);
}

.modal-card.modal-lg {
  max-width: 680px;
}

.code-viewer-container {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid #334155;
  background: #0F172A;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.code-viewer-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1E293B;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid #334155;
}

.code-tab-group {
  display: flex;
  gap: 0.4rem;
}

.code-tab-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #94A3B8;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.code-tab-btn:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.06);
}

.code-tab-btn.active {
  color: #10B981;
  background: #0F172A;
  border: 1px solid #334155;
}

.code-editor-box {
  margin: 0;
  padding: 1rem;
  background: #0F172A;
  color: #E2E8F0;
  font-family: 'Fira Code', 'Cascadia Code', Consolas, Monaco, monospace;
  font-size: 0.74rem;
  line-height: 1.55;
  max-height: 280px;
  overflow: auto;
  white-space: pre;
  tab-size: 2;
  user-select: text;
}

.code-editor-box code {
  font-family: inherit;
  color: inherit;
}

.code-editor-box::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.code-editor-box::-webkit-scrollbar-track {
  background: #0F172A;
}

.code-editor-box::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

/* ==========================================================================
   NATIVE MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    background: #FFFFFF;
  }
  .presentation-bar {
    display: none;
  }
  .app-viewport-wrapper {
    padding: 0;
  }
  .phone-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .esp32-pinout-grid {
    flex-direction: column;
    gap: 0.75rem;
  }
  .pin-row.right {
    flex-direction: row;
    text-align: left;
  }
}

/* ==========================================================================
   ESP32 QUICK CARD & HEADER CHIP
   ========================================================================== */
.esp32-quick-card {
  background: linear-gradient(135deg, #111827 0%, #1F2937 100%);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  margin: 1.1rem 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.esp32-quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.esp32-quick-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.esp32-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10B981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.esp32-quick-info {
  min-width: 0;
}

.esp32-quick-info h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 2px 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.esp32-quick-info p {
  font-size: 0.72rem;
  color: #9CA3AF;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.esp32-quick-info code {
  color: #34D399;
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.68rem;
}

.btn-esp32-generate {
  height: 38px;
  padding: 0 0.95rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #FFFFFF;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.btn-esp32-generate:hover {
  opacity: 0.92;
}

.esp32-header-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-full);
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

.esp32-header-chip:hover {
  background: #D1FAE5;
}

