:root {
  --premium-bg: linear-gradient(180deg, #f1e9ff 0%, #f9f8ff 100%);
  --premium-surface: #ffffff;
  --premium-border: rgba(102, 126, 234, 0.16);
  --premium-shadow: 0 24px 55px -22px rgba(98, 72, 191, 0.35);
  --premium-primary: #667eea;
  --premium-primary-dark: #5a3dba;
  --premium-secondary: #764ba2;
  --premium-text: #1f2041;
  --premium-text-muted: #6663a4;
  --premium-success: #10b981;
  --premium-warning: #f59e0b;
  --premium-danger: #ef4444;
}

html, body {
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--premium-text);
  background: var(--premium-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
}

a {
  color: var(--premium-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

/* Shared cards */
.premium-card {
  background: var(--premium-surface);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--premium-border);
  box-shadow: var(--premium-shadow);
}

.premium-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(102, 126, 234, 0.12);
  color: var(--premium-primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Bottom navigation */
.nav-medical {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 20px calc(env(safe-area-inset-bottom, 0) + 12px);
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 -12px 28px -18px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

.nav-medical-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  border-radius: 18px;
  color: var(--premium-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-medical-item .nav-medical-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.nav-medical-item.active {
  background: linear-gradient(135deg, var(--premium-primary), var(--premium-secondary));
  color: #ffffff;
  box-shadow: 0 18px 30px -22px rgba(102, 126, 234, 0.75);
}

.nav-medical-item.active .nav-medical-icon {
  color: inherit;
}

/* Alerts */
.alert-premium {
  border-radius: 18px;
  padding: 16px;
  font-size: 0.9rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--premium-border);
  background: rgba(255, 255, 255, 0.86);
}

.alert-premium.success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.alert-premium.error {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.alert-premium.info {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.alert-premium .alert-title {
  font-weight: 600;
}

/* Floating assistant widget placeholder */
.mathy-floating {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0) + 88px);
  right: 16px;
  display: grid;
  gap: 10px;
  z-index: 30;
}

.mathy-floating button {
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--premium-secondary), var(--premium-primary));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 46px -24px rgba(118, 75, 162, 0.7);
}

@media (min-width: 768px) {
  .nav-medical {
    max-width: 640px;
  }
}
