:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-2: rgba(245, 158, 11, 0.08); /* Light yellow */
  --color-bg-3: rgba(34, 197, 94, 0.08); /* Light green */
  --color-bg-4: rgba(239, 68, 68, 0.08); /* Light red */
  --color-bg-5: rgba(147, 51, 234, 0.08); /* Light purple */
  --color-bg-6: rgba(249, 115, 22, 0.08); /* Light orange */
  --color-bg-7: rgba(236, 72, 153, 0.08); /* Light pink */
  --color-bg-8: rgba(6, 182, 212, 0.08); /* Light cyan */

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* RGB versions for opacity control (Dark Mode) */
    --color-gray-400-rgb: 119, 124, 124;
    --color-teal-300-rgb: 50, 184, 198;
    --color-gray-300-rgb: 167, 169, 169;
    --color-gray-200-rgb: 245, 245, 245;

    /* Background color tokens (Dark Mode) */
    --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
    --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
    --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
    --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
    --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
    --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
    --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
    --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

    /* Semantic Color Tokens (Dark Mode) */
    --color-background: var(--color-charcoal-700);
    --color-surface: var(--color-charcoal-800);
    --color-text: var(--color-gray-200);
    --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
    --color-primary: var(--color-teal-300);
    --color-primary-hover: var(--color-teal-400);
    --color-primary-active: var(--color-teal-800);
    --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
    --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
    --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
    --color-border: rgba(var(--color-gray-400-rgb), 0.3);
    --color-error: var(--color-red-400);
    --color-success: var(--color-teal-300);
    --color-warning: var(--color-orange-400);
    --color-info: var(--color-gray-300);
    --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
    --color-btn-primary-text: var(--color-slate-900);
    --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
    --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: var(--color-teal-300-rgb);
    --color-error-rgb: var(--color-red-400-rgb);
    --color-warning-rgb: var(--color-orange-400-rgb);
    --color-info-rgb: var(--color-gray-300-rgb);
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  /* RGB versions for opacity control (dark mode) */
  --color-gray-400-rgb: 119, 124, 124;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;

  /* Colorful background palette - Dark Mode */
  --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
  --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
  --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
  --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
  --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
  --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
  --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
  --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

  /* Semantic Color Tokens (Dark Mode) */
  --color-background: var(--color-charcoal-700);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-gray-200);
  --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
  --color-primary: var(--color-teal-300);
  --color-primary-hover: var(--color-teal-400);
  --color-primary-active: var(--color-teal-800);
  --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
  --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
  --color-border: rgba(var(--color-gray-400-rgb), 0.3);
  --color-error: var(--color-red-400);
  --color-success: var(--color-teal-300);
  --color-warning: var(--color-orange-400);
  --color-info: var(--color-gray-300);
  --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
  --color-btn-primary-text: var(--color-slate-900);
  --color-card-border: rgba(var(--color-gray-400-rgb), 0.15);
  --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
  --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: var(--color-teal-300-rgb);
  --color-error-rgb: var(--color-red-400-rgb);
  --color-warning-rgb: var(--color-orange-400-rgb);
  --color-info-rgb: var(--color-gray-300-rgb);
}

[data-color-scheme="light"] {
  /* RGB versions for opacity control (light mode) */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: var(--color-teal-500-rgb);
  --color-error-rgb: var(--color-red-500-rgb);
  --color-warning-rgb: var(--color-orange-500-rgb);
  --color-info-rgb: var(--color-slate-500-rgb);
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

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

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-hover);
}

.btn--secondary:active {
  background: var(--color-secondary-active);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

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

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

/* END PERPLEXITY DESIGN SYSTEM */
:root {
  --primary-purple: #5B2C91;
  --dark-purple: #3D1A5F;
  --light-purple: #6B3CA1;
  --bright-magenta: #E91E8C;
  --bright-orange: #FF6B35;
  --bright-cyan: #00D4FF;
  --result-blue: #00D4FF;
  --result-yellow: #FFD700;
  --result-orange: #FF6B35;
  --white: #FFFFFF;
  --text-light: rgba(255, 255, 255, 0.9);
  --text-dim: rgba(255, 255, 255, 0.7);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--dark-purple) 100%);
  color: var(--white);
  min-height: 100vh;
}

/* Screen Management */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  padding: 0;
  flex-direction: column;
  padding-bottom: 140px; /* Space for footer */
  overflow-y: auto; /* Allow scrolling */
  overflow-x: hidden; /* Prevent horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.screen.active {
  display: flex;
}

/* Speech Bubbles Background Pattern */
.speech-bubbles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--dark-purple) 100%);
  z-index: 0;
  overflow: hidden;
}

.speech-bubbles-bg::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  top: 15%;
  left: 8%;
  border-radius: 50% 50% 50% 0;
  border: 3px solid rgba(255, 255, 255, 0.08);
  transform: rotate(-45deg);
}

.speech-bubbles-bg::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  bottom: 20%;
  right: 12%;
  border-radius: 50% 50% 0 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  transform: rotate(25deg);
}

.content-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  padding-bottom: 160px; /* Space for footer (140px) + margin (20px) */
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

/* On small screens, allow content to scroll naturally - match Information page behavior */
@media (max-height: 800px), (max-width: 480px) {
  .content-wrapper {
    justify-content: flex-start;
    padding-top: 1rem;
    padding-bottom: 160px;
  }
}

/* Auth Screen */
.brand-emblem {
  margin-bottom: 40px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

.hero-section {
  text-align: center;
  margin-bottom: 60px;
}

.app-name {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--bright-magenta) 0%, var(--bright-orange) 50%, var(--bright-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(233, 30, 140, 0.3);
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 50px;
  font-weight: 400;
  line-height: 1.5;
}

.mascot-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.mascot-bubble {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mascot-character {
  font-size: 5rem;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.speech-bubble {
  background: linear-gradient(135deg, var(--bright-magenta) 0%, var(--bright-orange) 100%);
  padding: 18px 30px;
  border-radius: 25px;
  position: relative;
  box-shadow: 0 8px 24px rgba(233, 30, 140, 0.4);
  animation: slideIn 0.5s ease-out;
}

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

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 12px solid var(--bright-magenta);
}

.setswana-text {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.translation {
  font-size: 0.95rem;
  opacity: 0.95;
  font-weight: 500;
}

.footer-section {
  text-align: center;
  width: 100%;
  margin-top: 20px;
}

.btn-get-started {
  background: var(--bright-magenta);
  color: var(--white);
  border: none;
  padding: 18px 60px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(233, 30, 140, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-get-started:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(233, 30, 140, 0.6);
  background: linear-gradient(135deg, var(--bright-magenta) 0%, #ff1e8c 100%);
}

.btn-get-started:active {
  transform: translateY(-1px);
}

.legal-text {
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  width: 100%;
  background: rgba(20, 10, 40, 0.85);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.header-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-emblem img {
  width: 40px;
  height: 40px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

@media (min-width: 768px) {
  .header-emblem img {
    width: 48px;
    height: 48px;
  }
}

.header-app-name {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 480px) {
  .header-nav {
    gap: 0.25rem;
  }
  
  .nav-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}

/* Top Navigation (legacy - keeping for compatibility) */
.top-nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.nav-btn:active {
  transform: translateY(0);
}

/* Daily Progress */
.daily-progress {
  margin-bottom: 30px;
}

.progress-dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-dot.normal { 
  background: var(--result-blue); 
  border-color: var(--result-blue);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.progress-dot.mild { 
  background: var(--result-yellow); 
  border-color: var(--result-yellow);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.progress-dot.risky { 
  background: var(--result-orange); 
  border-color: var(--result-orange);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
}

/* Hero Copy Section */
.hero-copy {
  text-align: center;
  margin-bottom: 1.5rem;
}

.hero-kicker {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  margin-top: 0.5rem;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* Relationship Hero Section */
.relationship-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.relationship-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(0.9rem, 2.5vw, 1.6rem);
  color: #fff;
  margin: 0;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
  flex: 1 1 auto;
  min-width: 0;
}

.relationship-mascot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: bounce-slow 3s ease-in-out infinite;
}

@keyframes bounce-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.relationship-mascot svg {
  width: clamp(56px, 7vw, 80px);
  height: auto;
  aspect-ratio: 1 / 1;
}

.relationship-mascot .eye {
  animation: blink 3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes blink {
  0%, 45%, 50%, 95%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  47%, 48%, 97%, 98% {
    opacity: 0.05;
    transform: scaleY(0.05);
  }
}

/* Screen Question */
.screen-question {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--white);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.screen-title {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--white);
  letter-spacing: -0.5px;
}

/* Quiz Circle Shell */
.quiz-circle-shell {
  position: relative;
  margin: 1.5rem auto 0;
  width: min(70vw, 340px);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}

#quizChart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.quiz-press-button {
  position: absolute;
  inset: 18%;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.25), rgba(43, 12, 80, 0.96));
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  animation: pulse-soft 2.2s infinite;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  transition: transform 0.2s ease;
}

.quiz-press-button:hover {
  transform: scale(1.05);
}

.quiz-press-button:active {
  transform: scale(0.98);
}

.quiz-result-label {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  padding: 0 20px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

@keyframes pulse-soft {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.45);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
  }
}

/* Circular Button Container (legacy - keeping for feelings screen) */
.circular-button-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circular-button-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.3));
}

.circular-button {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--dark-purple);
  border: 5px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 2px 8px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  line-height: 1.3;
}

.circular-button:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 2px 12px rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.circular-button:active {
  transform: scale(1.02);
}

.info-text {
  text-align: center;
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 500;
}

/* App Footer */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(12, 8, 32, 0.94);
  backdrop-filter: blur(16px);
  padding: 0.75rem 1rem 1.25rem;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.emergency-buttons {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .emergency-buttons {
    flex-direction: row;
  }
}

.emergency-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--white);
}

.emergency-btn.gbv-hotline {
  background: linear-gradient(135deg, var(--bright-magenta) 0%, #c91872 100%);
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.4);
}

.emergency-btn.find-me {
  background: linear-gradient(135deg, rgba(33, 128, 141, 0.9) 0%, rgba(26, 104, 115, 0.95) 100%);
  box-shadow: 0 4px 12px rgba(33, 128, 141, 0.3);
}

.emergency-btn.police {
  background: linear-gradient(135deg, rgba(168, 75, 47, 0.9) 0%, rgba(140, 60, 35, 0.95) 100%);
  box-shadow: 0 4px 12px rgba(168, 75, 47, 0.3);
}

.emergency-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.emergency-btn:active {
  transform: translateY(0);
}

.footer-legal {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.5;
}

.btn-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.btn-text {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  /* Let the cards auto-fit into the available space with a sensible minimum width */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 20px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.dashboard-card.locked {
  opacity: 0.7;
  cursor: not-allowed;
}

.lock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.dashboard-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.dashboard-card:active {
  transform: translateY(-2px);
}

/* Marketplace Grid */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  box-sizing: border-box;
}

.marketplace-app-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.marketplace-app-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.marketplace-app-card:active {
  transform: translateY(-4px);
}

.marketplace-app-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  line-height: 1;
}

.marketplace-app-card h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--white);
  font-weight: 700;
  width: 100%;
  word-wrap: break-word;
}

.marketplace-app-tagline {
  font-size: 0.95rem;
  color: var(--bright-magenta);
  margin-bottom: 12px;
  font-weight: 600;
}

.marketplace-app-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
  width: 100%;
  word-wrap: break-word;
}

.marketplace-app-category {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.8);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.marketplace-app-cta {
  margin-top: 16px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--bright-magenta) 0%, var(--bright-cyan) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.marketplace-app-cta:hover {
  transform: scale(1.05);
}

/* Hide footer when marketplace is fullscreen */
body.marketplace-fullscreen .app-footer {
  display: none;
}

/* Fullscreen marketplace container adjustments */
body.marketplace-fullscreen .screen#marketplaceScreen .content-wrapper {
  padding: 0;
  max-width: none;
}

/* Institutional Dashboard */
.inst-wrap {
  max-width: 1220px;
  margin: 0 auto;
  width: 100%;
}

.inst-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.inst-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 1.25rem;
}

.inst-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bright-magenta);
}

.inst-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.inst-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.inst-section h3 {
  color: white;
  margin-bottom: 0.75rem;
}

.inst-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.inst-card-title {
  color: white;
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.inst-donut {
  --risky: 0;
  --mild: 0;
  --normal: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(
    rgba(255,107,53,0.9) 0deg,
    rgba(255,107,53,0.9) calc(var(--risky) * 3.6deg),
    rgba(253,215,44,0.85) calc(var(--risky) * 3.6deg),
    rgba(253,215,44,0.85) calc((var(--risky) + var(--mild)) * 3.6deg),
    rgba(72,185,248,0.9) calc((var(--risky) + var(--mild)) * 3.6deg),
    rgba(72,185,248,0.9) 360deg
  );
  position: relative;
  margin: 0 auto 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inst-donut::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  background: rgba(12, 14, 24, 0.9);
  border-radius: 50%;
}

.inst-donut-center {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
  font-weight: 700;
}

.inst-donut-center small {
  display: block;
  font-size: 0.7rem;
  opacity: 0.75;
}

.inst-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
.legend-swatch.risky { background: rgba(255,107,53,0.9); }
.legend-swatch.mild { background: rgba(253,215,44,0.85); }
.legend-swatch.normal { background: rgba(72,185,248,0.9); }

.inst-risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.inst-risk-card {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.inst-risk-card.risky {
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.3);
}
.inst-risk-card.mild {
  background: rgba(253, 215, 44, 0.12);
  border-color: rgba(253, 215, 44, 0.28);
}
.inst-risk-card.normal {
  background: rgba(72, 185, 248, 0.15);
  border-color: rgba(72, 185, 248, 0.3);
}

.inst-risk-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
}

.inst-risk-label {
  color: rgba(255, 255, 255, 0.8);
}

.inst-mini-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: end;
}

.mini-bar {
  text-align: center;
}

.mini-bar-fill {
  background: linear-gradient(180deg, rgba(233, 30, 140, 0.8), rgba(233, 30, 140, 0.4));
  border-radius: 6px 6px 0 0;
  width: 100%;
  min-height: 6px;
  transition: height 0.3s ease;
}

.mini-bar-fill.feelings {
  background: linear-gradient(180deg, rgba(72, 185, 248, 0.8), rgba(72, 185, 248, 0.4));
}

.mini-bar-fill.time {
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.85), rgba(255, 193, 7, 0.5));
}

.mini-bar-label {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.inst-tools-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.inst-tool-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.inst-tool-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inst-tool-icon {
  font-size: 1.1rem;
}

.inst-tool-track {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.inst-tool-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(233, 30, 140, 0.9), rgba(155, 89, 182, 0.9));
}

.inst-tool-count {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.inst-epa-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.epa-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.epa-label {
  color: white;
  font-weight: 600;
}

.epa-track {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.epa-fill {
  height: 100%;
  border-radius: 999px;
}

.epa-count {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.inst-driver-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.inst-driver-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.inst-driver-label {
  color: white;
  font-weight: 600;
}

.inst-driver-score {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}
.inst-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.inst-tool-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inst-tool-name {
  color: white;
  font-weight: 600;
}

.inst-tool-count {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.inst-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.inst-region-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1rem;
}

.inst-region-title {
  color: white;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.inst-region-row {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.inst-risk-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  height: 8px;
  margin-top: 0.5rem;
  border-radius: 6px;
  overflow: hidden;
}
.inst-risk-mini .mini-fill { height: 100%; }
.inst-risk-mini .mini-fill.risky { background: rgba(255,107,53,0.85); }
.inst-risk-mini .mini-fill.mild { background: rgba(253,215,44,0.8); }
.inst-risk-mini .mini-fill.normal { background: rgba(72,185,248,0.85); }

.inst-empty {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.inst-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Hide footer when marketplace iframe is shown fullscreen */
.marketplace-fullscreen .app-footer {
  display: none;
}

.marketplace-app-cta.purchase {
  background: linear-gradient(135deg, #93329E 0%, #E91E8C 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 12px 20px;
  box-shadow: 0 4px 15px rgba(147, 50, 158, 0.3);
}

.marketplace-app-cta.purchase:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(147, 50, 158, 0.5);
}

.marketplace-app-cta .cta-primary {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.marketplace-app-cta .cta-secondary {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 500;
}

.marketplace-access-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10B981;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.marketplace-access-badge.premium {
  background: rgba(72, 185, 248, 0.2);
  border-color: rgba(72, 185, 248, 0.4);
  color: #48B9F8;
}

.marketplace-access-badge.price {
  background: rgba(233, 30, 140, 0.2);
  border-color: rgba(233, 30, 140, 0.4);
  color: #E91E8C;
}

.marketplace-app-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  justify-content: center;
}

.feature-tag {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
}
  box-shadow: 0 4px 12px rgba(233, 30, 140, 0.4);
}

/* Admin Panel Styles - Updated to match app theme */
.admin-tier-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.25rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.admin-tier-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(233, 30, 140, 0.1) 0%, rgba(155, 89, 182, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.admin-tier-btn:hover {
  border-color: rgba(233, 30, 140, 0.6);
  box-shadow: 0 8px 25px rgba(233, 30, 140, 0.2);
  transform: translateY(-2px);
}

.admin-tier-btn:hover::before {
  opacity: 1;
}

.admin-tier-btn.active {
  background: linear-gradient(135deg, rgba(233, 30, 140, 0.2) 0%, rgba(155, 89, 182, 0.2) 100%);
  border-color: var(--bright-magenta);
  box-shadow: 0 8px 25px rgba(233, 30, 140, 0.3);
}

.admin-tier-btn.active::before {
  opacity: 1;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.dashboard-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--white);
  font-weight: 700;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.3;
}

.dashboard-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.4;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  margin: 0;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, var(--dark-purple) 0%, #2a1547 100%);
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.modal-header {
  padding: 30px 25px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  font-size: 1.6rem;
  color: var(--white);
  margin-bottom: 12px;
  font-weight: 700;
}

.modal-description {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 10px;
}

.modal-body {
  padding: 30px 25px;
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-modal-action {
  background: var(--bright-magenta);
  color: var(--white);
  border: none;
  padding: 14px 36px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-modal-action:hover {
  background: linear-gradient(135deg, var(--bright-magenta) 0%, #ff1e8c 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 30, 140, 0.5);
}

.btn-modal-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bright-magenta) 0%, var(--bright-cyan) 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(233, 30, 140, 0.5);
}

.question-counter {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Quiz Question */
.quiz-question {
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 24px;
  line-height: 1.5;
  font-weight: 600;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quiz-option {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  font-weight: 500;
}

.quiz-option:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--bright-cyan);
  transform: translateX(4px);
}

.quiz-option.selected {
  background: linear-gradient(135deg, var(--bright-magenta) 0%, #c91872 100%);
  border-color: var(--bright-magenta);
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.4);
  font-weight: 600;
}

/* Results */
.results-body {
  text-align: center;
}

.result-chart-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.result-category {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--white);
  font-weight: 700;
}

.result-message {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.6;
  font-weight: 500;
}

.result-details {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.result-details p {
  margin-bottom: 12px;
  color: var(--text-light);
  line-height: 1.6;
}

.result-details strong {
  color: var(--bright-cyan);
  font-weight: 700;
}

/* Feelings Grid */
.feelings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feeling-option {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 24px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feeling-option:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
  border-color: var(--bright-cyan);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.feeling-emoji {
  font-size: 3.5rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.feeling-label {
  font-size: 1rem;
  color: var(--white);
  font-weight: 600;
}

/* Scripture Display */
.scripture-body {
  max-height: 70vh;
  overflow-y: auto;
}

.scripture-section,
.encouragement-section,
.prayer-section,
.notepad-section {
  margin-bottom: 28px;
}

.scripture-section h4,
.encouragement-section h4,
.prayer-section h4,
.notepad-section h4 {
  color: var(--bright-cyan);
  font-size: 1.2rem;
  margin-bottom: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scripture-text,
.encouragement-text,
.prayer-text {
  color: var(--text-light);
  line-height: 1.8;
  font-size: 1.05rem;
  font-weight: 400;
}

#personalNotes {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  color: var(--white);
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
  transition: all 0.3s ease;
}

#personalNotes::placeholder {
  color: var(--text-dim);
}

#personalNotes:focus {
  outline: none;
  border-color: var(--bright-cyan);
  background: rgba(255, 255, 255, 0.12);
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group label {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 700;
}

.form-group input {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  color: var(--white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.form-group input:focus {
  outline: none;
  border-color: var(--bright-cyan);
  background: rgba(255, 255, 255, 0.12);
}

/* Dashboard Stats */
.dashboard-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-label {
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 600;
}

.stat-value {
  color: var(--bright-cyan);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Resources List */
.resources-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.resource-item {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 18px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resource-item:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--bright-cyan);
  transform: translateX(4px);
}

.resource-item strong {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
}

/* Safety Tips */
.safety-tips h4 {
  color: var(--bright-cyan);
  font-size: 1.3rem;
  margin-bottom: 16px;
  margin-top: 24px;
  font-weight: 700;
}

.safety-tips h4:first-child {
  margin-top: 0;
}

.safety-tips ul {
  list-style: none;
  padding: 0;
}

.safety-tips li {
  color: var(--text-light);
  padding: 12px 0;
  padding-left: 30px;
  position: relative;
  line-height: 1.6;
  font-size: 1rem;
}

.safety-tips li::before {
  content: '•';
  color: var(--bright-magenta);
  font-size: 1.8rem;
  position: absolute;
  left: 0;
  top: 8px;
  font-weight: 700;
}

/* Analytics */
.analytics-chart-container {
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-item {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.summary-item h4 {
  color: var(--bright-cyan);
  font-size: 1.1rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.summary-item p {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-name {
    font-size: 2rem;
  }
  
  .screen-question {
    font-size: 1.6rem;
  }
  
  .quiz-circle-shell {
    width: min(75vw, 300px);
    max-width: 100%;
  }
  
  .circular-button-container {
    width: 260px;
    height: 260px;
    max-width: calc(100vw - 40px);
  }
  
  .circular-button {
    width: 170px;
    height: 170px;
    font-size: 1.1rem;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 15px 20px;
    box-sizing: border-box;
    overflow-x: hidden;
    max-width: 100%;
  }
  
  .dashboard-card h3 {
    font-size: 1.15rem;
  }
  
  .dashboard-card p {
    font-size: 0.9rem;
  }
  
  .feelings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .relationship-hero {
    flex-wrap: wrap;
    gap: 0.75rem;
    overflow-x: hidden;
  }
  
  .relationship-title {
    white-space: normal;
    word-wrap: break-word;
  }
}

@media (max-width: 480px) {
  .app-name {
    font-size: 1.8rem;
  }
  
  .mascot-bubble {
    flex-direction: column;
    gap: 12px;
  }
  
  .speech-bubble::before {
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid var(--bright-magenta);
    border-top: none;
  }
  
  .emergency-btn {
    padding: 12px 8px;
  }
  
  .btn-text {
    font-size: 0.75rem;
  }
  
  .btn-icon {
    font-size: 1.6rem;
  }
  
  .modal-content {
    max-width: 95%;
  }
  
  /* Ensure header doesn't overflow on very small screens */
  .app-header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow-x: hidden;
  }
  
  .dashboard-grid {
    padding: 0 10px 20px;
    gap: 12px;
    max-width: 100%;
  }
  
  .dashboard-card {
    padding: 20px 15px;
    min-height: auto;
  }
  
  .dashboard-card h3 {
    font-size: 1.1rem;
  }
  
  .dashboard-card p {
    font-size: 0.85rem;
  }
  
  .card-icon {
    font-size: 2.5rem;
  }
  
  .header-brand {
    flex-shrink: 0;
    min-width: 0;
    max-width: calc(100% - 200px);
  }
  
  .header-app-name {
    font-size: clamp(0.85rem, 3vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .header-nav {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  
  /* Ensure content fits on small screens */
  .content-wrapper {
    padding: 15px;
    padding-bottom: 160px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
  }
  
  .quiz-circle-shell {
    width: min(85vw, 300px);
    max-width: 100%;
  }
  
  .circular-button-container {
    width: min(85vw, 260px);
    height: min(85vw, 260px);
    max-width: calc(100vw - 40px);
  }
  
  .relationship-hero {
    padding: 0 10px;
    gap: 0.5rem;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .relationship-title {
    font-size: clamp(0.8rem, 4vw, 1.2rem);
    white-space: normal;
    word-wrap: break-word;
    flex: 1 1 100%;
    text-align: center;
    max-width: 100%;
    overflow-wrap: break-word;
  }
  
  .relationship-mascot {
    flex-shrink: 0;
    max-width: 100%;
  }
  
  .relationship-mascot svg {
    width: clamp(48px, 6vw, 80px);
    height: auto;
    max-width: 100%;
  }
}

/* Extra small screens (Samsung Galaxy S8 and similar - 360px width) */
@media (max-width: 360px) {
  .relationship-hero {
    padding: 0 8px;
    gap: 0.4rem;
  }
  
  .relationship-title {
    font-size: clamp(0.75rem, 3.5vw, 1rem);
    line-height: 1.3;
  }
  
  .relationship-mascot svg {
    width: clamp(40px, 5vw, 70px);
  }
  
  .content-wrapper {
    padding: 12px;
    padding-bottom: 160px;
  }
  
  .quiz-circle-shell {
    width: min(90vw, 280px);
    max-width: 100%;
  }
  
  .circular-button-container {
    width: min(90vw, 240px);
    height: min(90vw, 240px);
    max-width: calc(100vw - 24px);
  }
}

@media (min-width: 769px) {
  .dashboard-grid {
    max-width: 900px;
  }
  
  .dashboard-card {
    padding: 35px 25px;
  }
  
  .dashboard-card h3 {
    font-size: 1.3rem;
  }
  
  .dashboard-card p {
    font-size: 0.95rem;
  }
}

@media (min-width: 1024px) {
  .dashboard-grid {
    max-width: 1200px;
  }
  
  .dashboard-card {
    padding: 40px 30px;
  }
  
  .dashboard-card h3 {
    font-size: 1.4rem;
  }
  
  .dashboard-card p {
    font-size: 1rem;
  }
  
  .card-icon {
    font-size: 3.5rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Smooth scrolling for modals */
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Enhanced Quiz Results Modal Styles */
.results-header {
  border-radius: 24px 24px 0 0;
  position: relative;
  overflow: hidden;
}

.results-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

#statusIndicator {
  transition: left 1s cubic-bezier(0.4, 0, 0.2, 1);
}

#indicatorDot {
  transition: background-color 0.3s ease;
}

.action-nav-btn:hover {
  opacity: 1 !important;
  transform: scale(1.1);
}

.action-nav-btn:active {
  transform: scale(0.95);
}

#actionCard {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#actionCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#actionCompleteBtn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

#actionCompleteBtn:active {
  transform: scale(0.95);
}

#actionDots button:hover {
  transform: scale(1.2);
}

/* Responsive adjustments for quiz results modal */
@media (max-width: 768px) {
  .results-header {
    padding: 1.5rem 1rem 2rem !important;
  }
  
  #resultEmoji {
    font-size: 3rem !important;
  }
  
  #resultScore {
    font-size: 2rem !important;
  }
  
  #resultCategoryLabel {
    font-size: 1rem !important;
  }
  
  #resultTitle {
    font-size: 1rem !important;
  }
  
  #actionCard {
    min-height: 200px !important;
    padding: 1rem !important;
  }
  
  #actionIcon {
    font-size: 2.5rem !important;
  }
  
  .action-nav-btn {
    width: 2rem !important;
    height: 2rem !important;
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
  }
}

/* Coping Toolkit Styles */
.glass-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.coping-tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
}

.coping-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.coping-tab-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.breathing-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.25), rgba(43, 12, 80, 0.96));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 4s ease-in-out, opacity 4s ease-in-out;
  transform: scale(1);
  opacity: 0.9;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
}

/* Journal Styles */
.journal-view-btn {
  flex: 1;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
}

.journal-view-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.journal-view-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.journal-mood-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
}

.journal-mood-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Auth Gate Overlay Styles */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--dark-purple) 100%);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  overflow-y: auto;
  padding: 2rem 1rem;
}

/* Ensure speech bubbles show through auth gate background */
.auth-gate-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--dark-purple) 100%);
  opacity: 0.95;
  z-index: -1;
}

.auth-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-inner {
  max-width: 500px;
  width: 100%;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  background: rgba(61, 26, 95, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 10;
}

.auth-gate-logo {
  margin: 0 auto 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-gate-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(1.75rem, 4vw, 2rem);
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.auth-gate-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.auth-gate-description {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: clamp(0.8rem, 1.8vw, 0.85rem);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.auth-gate-character {
  margin: 1.5rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-gate-tagline {
  margin: 2rem 0;
  display: flex;
  justify-content: center;
}

.auth-gate-speech-bubble {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  position: relative;
}

.auth-gate-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(255, 255, 255, 0.1);
}

.auth-gate-setswana {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--white);
  margin-bottom: 0.25rem;
}

.auth-gate-translation {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

.auth-gate-disclaimer {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: clamp(0.75rem, 1.6vw, 0.9rem);
  color: rgba(255, 255, 255, 0.7);
  margin: 2rem 0 1.5rem;
  line-height: 1.5;
  padding: 0 1rem;
}

.auth-gate-button {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--white);
  background: rgba(233, 30, 140, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(233, 30, 140, 0.4);
  border-radius: 0.75rem;
  padding: 1rem 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(233, 30, 140, 0.3);
}

.auth-gate-button:hover {
  background: rgba(233, 30, 140, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.5);
  border-color: rgba(233, 30, 140, 0.6);
}

.auth-gate-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(233, 30, 140, 0.3);
}

.auth-gate-privacy-notice {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-gate-privacy-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.auth-gate-privacy-subtext {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: clamp(0.75rem, 1.6vw, 0.9rem);
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.auth-gate-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-gate-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-gate-footer-link {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-gate-footer-link:hover {
  color: rgba(255, 255, 255, 0.9);
}

.auth-gate-footer-separator {
  color: rgba(255, 255, 255, 0.4);
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
}

.auth-gate-footer-credits {
  font-family: 'Montserrat', sans-serif;
  font-weight: 200;
  font-size: clamp(0.65rem, 1.4vw, 0.8rem);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  text-align: center;
}

.auth-gate-footer-credits p {
  margin: 0.25rem 0;
}

/* Auth Login Container */
.auth-login-container {
  margin-top: 1.5rem;
}

.auth-tier-banner {
  background: linear-gradient(to right, rgba(72, 185, 248, 0.2), rgba(49, 138, 228, 0.2));
  border: 1px solid rgba(72, 185, 248, 0.4);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tier-banner:hover {
  background: linear-gradient(to right, rgba(72, 185, 248, 0.3), rgba(49, 138, 228, 0.3));
}

.auth-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-login-btn {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  backdrop-filter: blur(10px);
}

.auth-btn-primary {
  background: rgba(233, 30, 140, 0.6);
  border-color: rgba(233, 30, 140, 0.4);
  box-shadow: 0 4px 12px rgba(233, 30, 140, 0.3);
}

.auth-btn-primary:hover {
  background: rgba(233, 30, 140, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(233, 30, 140, 0.5);
  border-color: rgba(233, 30, 140, 0.6);
}

.auth-btn-secondary {
  background: rgba(72, 185, 248, 0.6);
  border-color: rgba(72, 185, 248, 0.4);
  box-shadow: 0 4px 12px rgba(72, 185, 248, 0.3);
}

.auth-btn-secondary:hover {
  background: rgba(72, 185, 248, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(72, 185, 248, 0.5);
  border-color: rgba(72, 185, 248, 0.6);
}

.auth-btn-tertiary {
  background: rgba(16, 185, 129, 0.6);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.auth-btn-tertiary:hover {
  background: rgba(16, 185, 129, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
  border-color: rgba(16, 185, 129, 0.6);
}

.auth-privacy-notice {
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem;
  font-family: 'Montserrat', sans-serif;
}

.auth-privacy-notice p {
  font-family: 'Montserrat', sans-serif;
}

/* Auth Credentials Form */
.auth-credentials-form {
  margin-top: 1.5rem;
}

.auth-form-group {
  margin-bottom: 1rem;
}

.auth-form-input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  color: white;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
}

.auth-form-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.auth-form-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
}

/* Responsive adjustments for auth gate */
@media (max-width: 480px) {
  .auth-gate-inner {
    padding: 2rem 1.5rem;
  }
  
  .auth-gate-logo {
    margin-bottom: 1.5rem;
  }
  
  .auth-gate-logo svg {
    width: 80px;
    height: 80px;
  }
  
  .auth-gate-footer-credits {
    font-size: 0.7rem;
  }
}