/**
 * Dey Well PWA — UI/UX Hardening Stylesheet
 * ===========================================
 * MVC-UI-S38-2026
 * 
 * DROP-IN: Add to your React PWA's index.css or import in App.jsx
 * 
 * What this fixes:
 * ─ Touch targets: All interactive elements ≥ 44px (WCAG 2.5.8)
 * ─ Mobile viewport: No horizontal scroll, safe area insets
 * ─ Loading states: Skeleton screens, spinners, pulse animations
 * ─ Offline indicator: Banner when connection lost
 * ─ 3G optimization: Reduced animations on slow connections
 * ─ Typography: Readable on small screens, RTL-ready
 * ─ Form UX: Better inputs on mobile keyboards
 * ─ Accessibility: Focus rings, reduced motion, contrast
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DESIGN TOKENS — Dey Well Brand
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root {
  /* Brand Colors */
  --dw-primary: #0A6847;        /* MVC green */
  --dw-primary-light: #10B981;
  --dw-primary-dark: #064E3B;
  --dw-accent: #F59E0B;         /* Warm amber */
  --dw-danger: #DC2626;
  --dw-success: #16A34A;
  --dw-warning: #F59E0B;
  --dw-info: #2563EB;

  /* Neutral Palette */
  --dw-bg: #FFFFFF;
  --dw-bg-secondary: #F9FAFB;
  --dw-bg-tertiary: #F3F4F6;
  --dw-text: #111827;
  --dw-text-secondary: #6B7280;
  --dw-text-muted: #9CA3AF;
  --dw-border: #E5E7EB;
  --dw-border-focus: #0A6847;

  /* Spacing */
  --dw-space-xs: 4px;
  --dw-space-sm: 8px;
  --dw-space-md: 16px;
  --dw-space-lg: 24px;
  --dw-space-xl: 32px;
  --dw-space-2xl: 48px;

  /* Touch targets */
  --dw-touch-min: 44px;         /* WCAG minimum */
  --dw-touch-comfortable: 48px; /* Recommended */

  /* Typography */
  --dw-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --dw-font-size-xs: 0.75rem;   /* 12px */
  --dw-font-size-sm: 0.875rem;  /* 14px */
  --dw-font-size-base: 1rem;    /* 16px — prevents iOS zoom */
  --dw-font-size-lg: 1.125rem;  /* 18px */
  --dw-font-size-xl: 1.25rem;   /* 20px */
  --dw-font-size-2xl: 1.5rem;   /* 24px */
  --dw-line-height: 1.5;

  /* Borders & Radius */
  --dw-radius-sm: 6px;
  --dw-radius-md: 10px;
  --dw-radius-lg: 16px;
  --dw-radius-full: 9999px;

  /* Shadows */
  --dw-shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --dw-shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --dw-shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

  /* Transitions */
  --dw-transition: 150ms ease;

  /* Safe areas (notch/gesture bar) */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BASE RESET & MOBILE VIEWPORT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px; /* Prevents iOS auto-zoom on inputs */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--dw-font);
  font-size: var(--dw-font-size-base);
  line-height: var(--dw-line-height);
  color: var(--dw-text);
  background: var(--dw-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Accommodate safe areas */
  padding-top: var(--sat);
  padding-right: var(--sar);
  padding-bottom: var(--sab);
  padding-left: var(--sal);
}

/* Prevent horizontal overflow from any child */
#root, .app-container {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TOUCH TARGETS — All interactive ≥ 44px
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
button,
[role="button"],
a,
input[type="submit"],
input[type="button"],
input[type="reset"],
.touchable {
  min-height: var(--dw-touch-min);
  min-width: var(--dw-touch-min);
  /* Increase hit area without changing visual size */
  position: relative;
}

/* Invisible touch area expander for small icons */
.touch-expand::after {
  content: '';
  position: absolute;
  top: -8px; right: -8px; bottom: -8px; left: -8px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BUTTONS — Consistent, accessible
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--dw-space-sm);
  min-height: var(--dw-touch-comfortable);
  padding: 12px 24px;
  border: none;
  border-radius: var(--dw-radius-md);
  font-size: var(--dw-font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dw-transition);
  user-select: none;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.dw-btn-primary {
  background: var(--dw-primary);
  color: white;
}
.dw-btn-primary:hover { background: var(--dw-primary-dark); }
.dw-btn-primary:active { transform: scale(0.98); }

.dw-btn-secondary {
  background: transparent;
  color: var(--dw-primary);
  border: 2px solid var(--dw-primary);
}

.dw-btn-danger {
  background: var(--dw-danger);
  color: white;
}

.dw-btn-full {
  width: 100%;
}

.dw-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Loading state button */
.dw-btn-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.dw-btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: dw-spin 0.6s linear infinite;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FORM INPUTS — Mobile keyboard optimization
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-input,
.dw-textarea,
.dw-select {
  width: 100%;
  min-height: var(--dw-touch-comfortable);
  padding: 12px 16px;
  border: 2px solid var(--dw-border);
  border-radius: var(--dw-radius-md);
  font-size: var(--dw-font-size-base); /* 16px prevents iOS zoom */
  font-family: var(--dw-font);
  color: var(--dw-text);
  background: var(--dw-bg);
  transition: border-color var(--dw-transition);
  appearance: none;
  -webkit-appearance: none;
}

.dw-input:focus,
.dw-textarea:focus,
.dw-select:focus {
  outline: none;
  border-color: var(--dw-border-focus);
  box-shadow: 0 0 0 3px rgba(10, 104, 71, 0.15);
}

.dw-input::placeholder {
  color: var(--dw-text-muted);
}

/* Phone number input — numeric keyboard */
input[type="tel"],
input[inputmode="numeric"],
.dw-input-phone {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* OTP input — large, centered digits */
.dw-otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: var(--dw-font-size-2xl);
  font-weight: 700;
  border: 2px solid var(--dw-border);
  border-radius: var(--dw-radius-md);
  caret-color: var(--dw-primary);
}
.dw-otp-input:focus {
  border-color: var(--dw-primary);
  box-shadow: 0 0 0 3px rgba(10, 104, 71, 0.15);
}

/* Label */
.dw-label {
  display: block;
  font-size: var(--dw-font-size-sm);
  font-weight: 600;
  color: var(--dw-text);
  margin-bottom: 6px;
}

/* Error state */
.dw-input-error {
  border-color: var(--dw-danger) !important;
}
.dw-error-text {
  color: var(--dw-danger);
  font-size: var(--dw-font-size-xs);
  margin-top: 4px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CARDS & CONTAINERS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-card {
  background: var(--dw-bg);
  border-radius: var(--dw-radius-lg);
  border: 1px solid var(--dw-border);
  padding: var(--dw-space-lg);
  box-shadow: var(--dw-shadow-sm);
}

.dw-card-interactive {
  cursor: pointer;
  transition: all var(--dw-transition);
}
.dw-card-interactive:hover {
  box-shadow: var(--dw-shadow-md);
  border-color: var(--dw-primary-light);
}
.dw-card-interactive:active {
  transform: scale(0.99);
}

/* Page container — consistent padding, safe area aware */
.dw-page {
  padding: var(--dw-space-md);
  padding-bottom: calc(var(--dw-space-2xl) + var(--sab));
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LOADING STATES — Skeletons & Spinners
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Full-screen loader */
.dw-loader-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--dw-space-md);
}

/* Spinner */
.dw-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--dw-border);
  border-top-color: var(--dw-primary);
  border-radius: 50%;
  animation: dw-spin 0.7s linear infinite;
}
.dw-spinner-sm { width: 20px; height: 20px; border-width: 2px; }
.dw-spinner-lg { width: 56px; height: 56px; border-width: 4px; }

@keyframes dw-spin {
  to { transform: rotate(360deg); }
}

/* Skeleton screens */
.dw-skeleton {
  background: linear-gradient(
    90deg,
    var(--dw-bg-tertiary) 25%,
    var(--dw-bg-secondary) 37%,
    var(--dw-bg-tertiary) 63%
  );
  background-size: 200% 100%;
  animation: dw-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--dw-radius-sm);
}

.dw-skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  width: 100%;
}
.dw-skeleton-text:last-child { width: 60%; }

.dw-skeleton-heading {
  height: 24px;
  width: 40%;
  margin-bottom: 16px;
}

.dw-skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.dw-skeleton-card {
  height: 100px;
  margin-bottom: 12px;
}

@keyframes dw-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pulse animation for subtle loading */
.dw-pulse {
  animation: dw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes dw-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   OFFLINE INDICATOR
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--dw-danger);
  color: white;
  text-align: center;
  padding: 8px 16px;
  font-size: var(--dw-font-size-sm);
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.dw-offline-banner.visible {
  transform: translateY(0);
}

/* Reconnecting state */
.dw-reconnecting-banner {
  background: var(--dw-warning);
  color: var(--dw-text);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CHAT UI — Consultation Messages
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-chat-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--dw-space-md);
  padding-bottom: 80px; /* Space for input */
}

.dw-chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: var(--dw-font-size-base);
  line-height: 1.4;
  word-wrap: break-word;
  animation: dw-bubble-in 0.2s ease;
}

.dw-chat-patient {
  align-self: flex-end;
  background: var(--dw-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.dw-chat-provider {
  align-self: flex-start;
  background: var(--dw-bg-tertiary);
  color: var(--dw-text);
  border-bottom-left-radius: 4px;
}

.dw-chat-system {
  align-self: center;
  background: transparent;
  color: var(--dw-text-muted);
  font-size: var(--dw-font-size-xs);
  text-align: center;
  max-width: 90%;
}

.dw-chat-time {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
  text-align: right;
}
.dw-chat-provider .dw-chat-time {
  color: var(--dw-text-muted);
}

/* Typing indicator */
.dw-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  align-self: flex-start;
  background: var(--dw-bg-tertiary);
  border-radius: 16px;
}
.dw-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--dw-text-muted);
  border-radius: 50%;
  animation: dw-typing 1.4s infinite;
}
.dw-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.dw-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dw-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

@keyframes dw-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Fixed chat input bar */
.dw-chat-input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dw-bg);
  border-top: 1px solid var(--dw-border);
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--sab));
  display: flex;
  gap: 8px;
  align-items: flex-end;
  z-index: 100;
}
.dw-chat-input-bar input,
.dw-chat-input-bar textarea {
  flex: 1;
  min-height: var(--dw-touch-comfortable);
  max-height: 120px;
  resize: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   NAVIGATION — Bottom Tab Bar (Mobile)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dw-bg);
  border-top: 1px solid var(--dw-border);
  display: flex;
  justify-content: space-around;
  padding-bottom: var(--sab);
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.dw-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  min-height: var(--dw-touch-min);
  color: var(--dw-text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  transition: color var(--dw-transition);
}
.dw-nav-item.active {
  color: var(--dw-primary);
}
.dw-nav-item svg {
  width: 24px;
  height: 24px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TRIAGE SEVERITY INDICATOR
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-severity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--dw-radius-full);
  font-size: var(--dw-font-size-xs);
  font-weight: 600;
}
.dw-severity-low { background: #DCFCE7; color: #166534; }
.dw-severity-moderate { background: #FEF3C7; color: #92400E; }
.dw-severity-high { background: #FEE2E2; color: #991B1B; }
.dw-severity-emergency { background: #991B1B; color: white; }

.dw-severity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dw-severity-low .dw-severity-dot { background: #16A34A; }
.dw-severity-moderate .dw-severity-dot { background: #F59E0B; }
.dw-severity-high .dw-severity-dot { background: #DC2626; }
.dw-severity-emergency .dw-severity-dot { background: white; animation: dw-pulse 1s infinite; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STATUS BADGES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--dw-radius-full);
  font-size: var(--dw-font-size-xs);
  font-weight: 600;
}
.dw-badge-success { background: #DCFCE7; color: #166534; }
.dw-badge-warning { background: #FEF3C7; color: #92400E; }
.dw-badge-danger { background: #FEE2E2; color: #991B1B; }
.dw-badge-info { background: #DBEAFE; color: #1E40AF; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TOAST / SNACKBAR NOTIFICATIONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-toast-container {
  position: fixed;
  bottom: calc(72px + var(--sab)); /* Above bottom nav */
  left: var(--dw-space-md);
  right: var(--dw-space-md);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.dw-toast {
  background: var(--dw-text);
  color: white;
  padding: 12px 16px;
  border-radius: var(--dw-radius-md);
  font-size: var(--dw-font-size-sm);
  box-shadow: var(--dw-shadow-lg);
  animation: dw-toast-in 0.3s ease, dw-toast-out 0.3s ease 2.7s forwards;
  pointer-events: auto;
}
.dw-toast-success { background: var(--dw-success); }
.dw-toast-error { background: var(--dw-danger); }
.dw-toast-warning { background: var(--dw-warning); color: var(--dw-text); }

@keyframes dw-toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dw-toast-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   EMPTY STATES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.dw-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--dw-space-2xl) var(--dw-space-lg);
  text-align: center;
  min-height: 40vh;
}
.dw-empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--dw-text-muted);
  margin-bottom: var(--dw-space-md);
}
.dw-empty-state h3 {
  font-size: var(--dw-font-size-lg);
  color: var(--dw-text);
  margin: 0 0 8px;
}
.dw-empty-state p {
  color: var(--dw-text-secondary);
  font-size: var(--dw-font-size-sm);
  margin: 0;
  max-width: 280px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACCESSIBILITY
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Visible focus ring — keyboard only */
:focus-visible {
  outline: 2px solid var(--dw-primary);
  outline-offset: 2px;
}

/* Remove focus ring for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link */
.dw-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--dw-primary);
  color: white;
  padding: 8px 16px;
  border-radius: var(--dw-radius-md);
  z-index: 10000;
  transition: top 0.2s;
}
.dw-skip-link:focus {
  top: 16px;
}

/* Screen reader only */
.dw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   REDUCED MOTION — Respect user preferences
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .dw-skeleton { animation: none; background: var(--dw-bg-tertiary); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   3G / SLOW CONNECTION — Reduced visuals
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (prefers-reduced-data: reduce) {
  .dw-hero-image, .dw-decorative { display: none; }
  .dw-skeleton { animation: none; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE BREAKPOINTS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Small phones (< 360px) — tighter spacing */
@media (max-width: 359px) {
  .dw-page { padding: var(--dw-space-sm); }
  .dw-card { padding: var(--dw-space-md); }
  .dw-btn { padding: 10px 16px; font-size: var(--dw-font-size-sm); }
}

/* Standard mobile (360-480px) — default styles above */

/* Large phones / small tablets (481-768px) */
@media (min-width: 481px) {
  .dw-page { padding: var(--dw-space-lg); max-width: 540px; }
}

/* Tablet / Desktop (769px+) */
@media (min-width: 769px) {
  .dw-page { max-width: 480px; } /* Keep mobile feel even on desktop */
  .dw-nav-bottom { display: none; } /* Hide bottom nav on desktop */
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DARK MODE SUPPORT (optional, system preference)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (prefers-color-scheme: dark) {
  :root {
    --dw-bg: #0F172A;
    --dw-bg-secondary: #1E293B;
    --dw-bg-tertiary: #334155;
    --dw-text: #F1F5F9;
    --dw-text-secondary: #94A3B8;
    --dw-text-muted: #64748B;
    --dw-border: #334155;
    --dw-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --dw-shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  }
  
  .dw-chat-provider { background: var(--dw-bg-tertiary); }
  .dw-toast { background: #334155; }
}
