/* ========================================================================
TOOL LANDING PAGE - CROSS-CULTURAL DESIGN SYSTEM
Target: RO / DACH / EN | Psychological: Trust + Clarity + Micro-reward
======================================================================== */
/* 1. VARIABLES & THEME =================================================== */
:root {
/* Colors */
--bg-page: #F8FAFC;
--bg-card: #FFFFFF;
--bg-surface: #F1F5F9;
--text-primary: #0F172A;
--text-secondary: #475569;
--text-muted: #94A3B8;
--accent: #2563EB;       /* Trust blue (universal) */
--accent-hover: #1D4ED8;
--warm: #D97706;         /* Approachable amber */
--success: #10B981;
--error: #EF4444;
--border: #E2E8F0;
--shadow-sm: 0 1px 3px rgba(15,23,42,0.08);
--shadow-md: 0 4px 12px rgba(15,23,42,0.12);
--focus-ring: 0 0 0 3px rgba(37,99,235,0.25);
/* Spacing */
--space-xs: 0.25rem;
--space-sm: 0.5rem;
--space-md: 1rem;
--space-lg: 1.5rem;
--space-xl: 2rem;
--space-2xl: 3rem;
/* Layout */
--radius: 12px;
--radius-sm: 8px;
--max-width: 1200px;
--header-height: 64px;
/* Typography */
--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
--text-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
--text-base: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
--text-lg: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
--text-xl: clamp(1.25rem, 1rem + 1vw, 1.5rem);
--text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
--text-3xl: clamp(1.875rem, 1.5rem + 1.5vw, 2.25rem);
/* Motion */
--ease: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
--ease-slow: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
:root {
--bg-page: #0B1120;
--bg-card: #111827;
--bg-surface: #1E293B;
--text-primary: #F1F5F9;
--text-secondary: #CBD5E1;
--text-muted: #64748B;
--border: #334155;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
--shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}
}
/* Manual theme override (JS toggles .theme-light / .theme-dark on <html>) */
html.theme-dark {
--bg-page: #0B1120;
--bg-card: #111827;
--bg-surface: #1E293B;
--text-primary: #F1F5F9;
--text-secondary: #CBD5E1;
--text-muted: #64748B;
--border: #334155;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
--shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

/* Shimmer effect for loading states */
.shimmer {
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
}
html.theme-dark .shimmer {
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
background-size: 200% 100%;
}

/* Badge pulse animation */
.badge-pulse {
animation: pulse 2s infinite;
}
/* 2. BASE & RESET ======================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
scroll-behavior: smooth;
-webkit-text-size-adjust: 100%;
text-rendering: optimizeLegibility;
font-feature-settings: "kern" 1, "liga" 1;
}
body {
font-family: var(--font-sans);
background: var(--bg-page);
color: var(--text-primary);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
min-height: 100vh;
display: flex;
flex-direction: column;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
ul, ol { list-style: none; }
/* 3. LAYOUT & CONTAINERS ================================================ */
.container {
width: 100%;
max-width: var(--max-width);
margin: 0 auto;
padding-inline: var(--space-lg);
}
.site-header {
position: sticky;
top: 0;
z-index: 50;
height: var(--header-height);
background: var(--bg-card);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
}
.site-header .container {
display: flex;
align-items: center;
justify-content: space-between;
height: 100%;
}
/* Header brand (favicon mark + wordmark) */
.logo {
display: inline-flex;
align-items: center;
gap: var(--space-sm);
color: var(--text-primary);
font-size: var(--text-lg);
line-height: 1.2;
transition: opacity var(--ease);
}
.logo:hover {
opacity: 0.9;
}
.logo-img {
width: 32px;
height: 32px;
flex-shrink: 0;
display: block;
border-radius: var(--radius-sm);
}
.logo strong {
font-weight: 700;
letter-spacing: -0.02em;
}
main { flex: 1; padding-block: var(--space-2xl); }
footer {
border-top: 1px solid var(--border);
padding-block: var(--space-xl);
color: var(--text-muted);
font-size: var(--text-sm);
}
/* 4. TYPOGRAPHY & UTILITIES ============================================= */
h1, h2, h3, h4 {
text-wrap: balance;
line-height: 1.2;
font-weight: 600;
}
h1 { font-size: var(--text-3xl); margin-bottom: var(--space-md); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-lg); }
h3 { font-size: var(--text-xl); }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
/* Screen Reader Only */
.sr-only {
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* 5. COMPONENTS ========================================================= */
/* Language Switcher - Pill Design */
.lang-switch {
display: inline-flex;
background: var(--bg-surface);
padding: 4px;
border-radius: 999px;
gap: 4px;
align-items: center;
/* Prevent flex-grow behavior that distorts the pill */
width: auto;
}
.lang-btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
border-radius: 999px;
font-size: var(--text-sm);
font-weight: 500;
color: var(--text-secondary);
background: transparent;
border: none;
transition: all 0.2s ease;
white-space: nowrap;
}
.lang-btn:hover {
color: var(--text-primary);
}
.lang-btn[aria-current="true"] {
background: var(--bg-card);
color: var(--accent);
font-weight: 600;
box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}
/* Theme Toggle */
.theme-toggle {
width: 36px; height: 36px;
border-radius: 50%;
border: 1px solid var(--border);
background: var(--bg-surface);
display: grid; place-items: center;
font-size: 1.1rem;
}
/* Hero Section */
.hero {
text-align: center;
padding-block: var(--space-2xl);
}
.hero p {
font-size: var(--text-lg);
color: var(--text-secondary);
max-width: 650px;
margin: var(--space-sm) auto var(--space-xl);
}
/* Tool count (replaces category filter pills on index) */
.tools-count-banner {
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}
/* Filters (legacy – kept for older pages / backups that still use filter pills) */
.filters {
display: flex;
flex-wrap: wrap;
gap: var(--space-sm);
justify-content: center;
margin-bottom: var(--space-xl);
}
.filter-btn {
padding: var(--space-xs) var(--space-md);
border: 1px solid var(--border);
background: var(--bg-card);
border-radius: 999px;
font-size: var(--text-sm);
color: var(--text-secondary);
transition: var(--ease);
}
.filter-btn:hover,
.filter-btn.is-active {
background: var(--accent);
color: #fff;
border-color: var(--accent);
}
/* Tool Grid */
.tool-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: var(--space-lg);
}
.tool-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: var(--space-lg);
box-shadow: var(--shadow-sm);
transition: var(--ease-slow);
display: flex;
flex-direction: column;
gap: var(--space-sm);
position: relative;
contain: layout style;
}
/* Touch devices get subtle lift only on active press */
@media (hover: hover) {
.tool-card:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
border-color: var(--accent);
}
}
.tool-card h3 {
margin: 0;
font-size: var(--text-lg);
line-height: 1.3;
}
.tool-icon {
width: 48px;
height: 48px;
border-radius: var(--radius-sm);
margin-bottom: var(--space-sm);
object-fit: contain;
}
.tool-card p {
margin: 0;
color: var(--text-secondary);
font-size: var(--text-sm);
flex: 1;
/* Graceful truncation for long German/Romanian text */
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.tool-card .btn {
margin-top: auto;
}
/* Badges */
.badge {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
padding: var(--space-xs) var(--space-sm);
border-radius: 999px;
font-size: var(--text-xs);
font-weight: 500;
line-height: 1;
}
.badge--daily {
background: var(--warm);
color: #fff;
}
.badge--daily::before {
content: "";
animation: pulse 2s infinite;
}
.badge--new { background: #DBEAFE ; color: #1E40AF; }
.badge--visited {
background: #D1FAE5; color: #065F46;
position: absolute; top: var(--space-sm); right: var(--space-sm);
padding: 2px 6px;
}
/* Streak Counter */
.streak {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
color: var(--text-secondary);
background: var(--bg-surface);
padding: var(--space-xs) var(--space-sm);
border-radius: var(--radius-sm);
}
.streak[data-days="7"] { background: #FEF3C7; color: #92400E; }
.streak[data-days="30"] { background: #D1FAE5; color: #065F46; }
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-xs);
padding: var(--space-sm) var(--space-md);
border-radius: var(--radius-sm);
font-size: var(--text-sm);
font-weight: 500;
border: 1px solid transparent;
background: var(--accent);
color: #fff;
transition: var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn--outline {
background: transparent;
border-color: var(--border);
color: var(--text-primary);
}
.btn--outline:hover { background: var(--bg-surface); }
/* Forms */
.form-group { margin-bottom: var(--space-md); }
.form-label {
display: block;
font-size: var(--text-sm);
font-weight: 500;
margin-bottom: var(--space-xs);
}
.form-input, .form-textarea {
width: 100%;
padding: var(--space-sm) var(--space-md);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--bg-card);
color: var(--text-primary);
font-size: var(--text-base);
transition: var(--ease);
}
.form-input:focus, .form-textarea:focus {
outline: none;
box-shadow: var(--focus-ring);
border-color: var(--accent);
}
.form-input.is-error, .form-textarea.is-error {
border-color: var(--error);
box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.form-help { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-xs); }
/* Newsletter / CTA Section */
.cta-box {
background: var(--bg-surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: var(--space-xl);
margin-top: var(--space-2xl);
text-align: center;
}
.cta-box form {
display: flex;
gap: var(--space-sm);
max-width: 400px;
margin: var(--space-md) auto 0;
flex-wrap: wrap;
}
.cta-box .form-input { flex: 1; min-width: 200px; }
/* ========================================================================
MODERN FOOTER
======================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-lg);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 2rem));
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.35), transparent);
}

.footer-grid-modern {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 320px;
}

.footer-logo {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.footer-tagline {
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color var(--ease), transform var(--ease);
}

.footer-links a:hover {
  color: var(--accent);
  transform: translateX(2px);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
}

.footer-bottom-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

@media (max-width: 900px) {
  .footer-grid-modern {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  .footer-brand {
    align-items: center;
  }

  .footer-column {
    align-items: center;
  }

  .footer-links {
    align-items: center;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .footer-links a:hover {
    transform: none;
  }
}

/* 6. STATES & ANIMATIONS ================================================ */
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.15); }
}
@keyframes shimmer {
to { background-position: -200% 0; }
}
.loading .tool-card {
background: linear-gradient(90deg, var(--bg-surface) 25%, #e2e8f0 50%, var(--bg-surface) 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
border-color: transparent;
}
@media (prefers-color-scheme: dark) {
.loading .tool-card {
background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
background-size: 200% 100%;
}
}
/* Focus Accessibility */
:focus-visible {
outline: none;
box-shadow: var(--focus-ring);
border-radius: var(--radius-sm);
}
/* 7. RESPONSIVE ========================================================= */
@media (max-width: 640px) {
:root {
--space-xl: 1.5rem;
--space-2xl: 2rem;
}
.tool-grid { grid-template-columns: 1fr; }
.cta-box form { flex-direction: column; }
/* Mobile specific fix for lang switcher */
.lang-btn span { display: none; } /* Hide text on very small screens, keep flags */
.lang-btn { padding: 6px 8px; font-size: 1.2rem; }
}
/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
/* Print */
@media print {
.site-header, .tools-count-banner, .btn, .theme-toggle, .lang-switch, footer { display: none; }
body { background: #fff; color: #000; }
.tool-card { break-inside: avoid; box-shadow: none; border: 1px solid #000; }
}
/* ========================================================================
STICKY DONATION BUTTON (Ethical UX)
======================================================================== */
.sticky-donate-wrapper {
position: fixed;
bottom: 24px;
right: 24px;
z-index: 90;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 8px;
opacity: 0;
transform: translateY(20px);
transition: opacity var(--ease), transform var(--ease);
pointer-events: none;
}
.sticky-donate-wrapper.is-visible {
opacity: 1;
transform: translateY(0);
pointer-events: auto;
}
.sticky-donate-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 16px;
background: linear-gradient(135deg, #FFDD00 0%, #FFC107 100%);
color: #111;
font-weight: 600;
font-size: var(--text-sm);
border-radius: 999px;
box-shadow: var(--shadow-md);
border: none;
text-decoration: none;
transition: transform var(--ease), box-shadow var(--ease);
}
.sticky-donate-btn:hover {
transform: translateY(-2px) scale(1.02);
box-shadow: 0 8px 16px rgba(255, 205, 0, 0.3);
}
.sticky-donate-btn:focus-visible {
outline: none;
box-shadow: var(--focus-ring);
}
.donate-icon { font-size: 1.2em; }
.sticky-donate-dismiss {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 50%;
width: 24px;
height: 24px;
display: grid;
place-items: center;
font-size: 12px;
color: var(--text-muted);
cursor: pointer;
transition: var(--ease);
align-self: flex-end;
}
@media (max-width: 640px) {
  .sticky-donate-wrapper { bottom: 16px; right: 16px; }
  /* Restore pill shape & keep text visible on mobile */
  .sticky-donate-btn { padding: 8px 14px; font-size: var(--text-xs); border-radius: 999px; }
  .sticky-donate-btn .donate-text { display: inline-flex !important; }
}
@media (prefers-reduced-motion: reduce) {
.sticky-donate-wrapper, .sticky-donate-btn {
transition: none !important;
animation: none !important;
}
}
#pwaInstallBtn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  gap: 6px;
}
#pwaInstallBtn:hover {
  background: var(--bg-surface);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  #pwaInstallBtn {
    bottom: 80px; /* above sticky donate button */
    left: 16px;
    padding: 6px 12px;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.modal-content {
  padding: var(--space-2xl);
  overflow-y: auto;
  max-height: 80vh;
}

.modal-content .modal-title {
  margin-top: 0;
  margin-bottom: var(--space-lg);
  font-size: var(--text-2xl);
  color: var(--text-primary);
}

.modal-loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

/* ========================================================================
   DONATION PAGE & MODAL EMBED (donation.php <main> via modal.js)
   Previously inline in donation.php <head>; must live here so XHR modal
   fragments receive layout when parent page only injects <main>.
   ======================================================================== */
.donation-card {
  max-width: 720px;
  margin: 0 auto;
}
.payment-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.qr-copy-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--space-md);
  align-items: center;
}
@media (max-width: 640px) {
  .qr-copy-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-sm);
  }
}
.bank-details {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.impact-list {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.impact-list li {
  background: var(--bg-surface);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border-left: 3px solid var(--accent);
}
.legal-note {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.donation-footer {
  margin-top: var(--space-xl);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}
.btn-donate-large {
  width: 100%;
  justify-content: center;
  background: #FFDD00;
  color: #000;
  font-weight: 700;
}
.btn-donate-large:hover {
  background: #e6c200;
  transform: translateY(-1px);
}
.btn-wallet {
  background: var(--accent);
}
.btn-wise {
  background: #4caf50;
}

/* ========================================================================
EMERGENCY PREP INVENTORY - APP-SPECIFIC STYLES
All colors/borders/shadows/radius use CSS custom properties from :root
======================================================================== */

/* ── App body override (design system sets display:flex; this app uses block) ── */
body.app-body { display: block; padding: var(--space-lg) var(--space-md); }
.app-body .container { max-width: 1600px; margin: 0 auto; }

/* ── Overlay (setup / login) ──────────────────────────────── */
.overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.85);
    display: flex; align-items: center; justify-content: center; z-index: 2000;
    backdrop-filter: blur(6px);
}
.overlay.hidden { display: none; }
.overlay-card {
    background: var(--bg-card); border-radius: var(--radius); padding: var(--space-xl) var(--space-lg);
    max-width: 460px; width: 92%; box-shadow: var(--shadow-md);
}
.overlay-card h2 { margin: 0 0 6px 0; font-size: var(--text-xl); color: var(--text-primary); }
.overlay-card .subtitle { color: var(--text-muted); font-size: var(--text-sm); margin: 0 0 var(--space-lg) 0; }
.overlay-card label { font-weight: 600; font-size: var(--text-xs); color: var(--text-secondary); display: block; margin-bottom: 4px; }
.overlay-card input {
    width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-size: var(--text-sm); margin-bottom: 14px;
    background: var(--bg-card); color: var(--text-primary);
}
.overlay-card input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.setup-step { margin-bottom: var(--space-lg); }
.setup-step h3 { font-size: var(--text-sm); margin: 0 0 10px 0; color: var(--accent); }
.setup-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.setup-row label { margin: 0; min-width: 90px; }
.setup-row input { margin: 0; width: 70px; text-align: center; }
.overlay-error { color: var(--error); font-size: var(--text-xs); margin: 8px 0; display: none; }
.overlay-error.visible { display: block; }

/* ── Summary bar ──────────────────────────────────────────── */
.summary-bar {
    background: var(--bg-card); border-radius: var(--radius); padding: var(--space-lg) var(--space-xl); margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.stats-row {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.stats { display: flex; gap: var(--space-xl); flex-wrap: wrap; }
.stat-card {
    background: var(--bg-surface); border-radius: var(--radius); padding: 8px var(--space-lg); text-align: center;
    border-left: 4px solid var(--accent);
}
.stat-number { font-size: var(--text-2xl); font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }

.category-summary {
    background: var(--bg-surface); border-radius: var(--radius); padding: var(--space-sm) var(--space-lg); margin-top: 8px;
}
.category-summary h4 {
    margin: 0 0 10px 0; font-size: var(--text-sm); color: var(--text-secondary); display: flex; align-items: center; gap: 8px;
}
.category-pills { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.cat-pill {
    background: var(--bg-card); border-radius: 999px; padding: 6px var(--space-md);
    display: inline-flex; align-items: center; gap: 10px;
    font-size: var(--text-xs); font-weight: 500; box-shadow: var(--shadow-sm);
    border-left: 3px solid; cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
}
.cat-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.cat-pill.critical { border-left-color: var(--error); background: rgba(239,68,68,0.08); }
.cat-pill.warning { border-left-color: var(--warm); background: rgba(217,119,6,0.08); }
.cat-pill.good { border-left-color: var(--success); background: rgba(16,185,129,0.08); }
.cat-name { font-weight: 600; }
.cat-stats { font-size: 11px; color: var(--text-secondary); }

.household-info {
    background: rgba(37,99,235,0.08); padding: 8px 18px; border-radius: 999px;
    font-size: var(--text-sm); font-weight: 500; cursor: default;
    display: flex; align-items: center; gap: 8px; color: var(--text-primary);
}
.household-info .edit-icon-sm {
    cursor: pointer; opacity: 0.5; transition: opacity 0.15s;
    display: none; /* shown only for admin */
}
.household-info .edit-icon-sm:hover { opacity: 1; }
body.admin-mode .household-info .edit-icon-sm { display: inline; }

.toolbar {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-lg); gap: var(--space-sm);
}

/* ── Button variants (override EXAMPLE .btn for app context) ── */
.btn-primary {
    background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
    background: var(--bg-surface); border-color: var(--border); color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
    background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--error);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn.active { background: rgba(37,99,235,0.1); border-color: var(--accent); color: var(--accent); }

.search-box {
    padding: 8px var(--space-md); border-radius: 999px; border: 1px solid var(--border);
    width: 260px; background: var(--bg-card); color: var(--text-primary); font-size: var(--text-sm);
}
.search-box:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.file-status {
    font-size: var(--text-xs); background: rgba(16,185,129,0.1); padding: 4px var(--space-sm); border-radius: 999px;
    color: var(--success); display: inline-flex; align-items: center; gap: 6px;
}

/* Admin-only controls */
.admin-only { display: none; }
body.admin-mode .admin-only { display: inline-flex; }

.table-wrapper {
    background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow-x: auto; border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); min-width: 1100px; }
th {
    background: var(--bg-surface); padding: 14px 12px; text-align: left; font-weight: 600;
    color: var(--text-primary); border-bottom: 1px solid var(--border); cursor: pointer;
    user-select: none; transition: background 0.15s;
}
th:hover { background: var(--border); }
.sort-indicator { display: inline-block; margin-left: 6px; font-size: 11px; opacity: 0.6; }
td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-primary); }
tr:hover { background: rgba(217,119,6,0.04); }
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.status-critical { background: rgba(239,68,68,0.1); color: var(--error); }
.status-warning { background: rgba(217,119,6,0.1); color: var(--warm); }
.status-adequate { background: rgba(37,99,235,0.1); color: var(--accent); }
.action-icons { display: flex; gap: 10px; }
.edit-icon, .delete-icon {
    cursor: pointer; font-weight: bold; padding: 4px 8px; border-radius: 999px;
    background: var(--bg-surface); transition: 0.1s; font-size: var(--text-xs); color: var(--text-secondary);
}
.edit-icon:hover { background: rgba(37,99,235,0.1); color: var(--accent); }
.delete-icon:hover { background: rgba(239,68,68,0.1); color: var(--error); }

/* Viewer mode: hide action columns */
body:not(.admin-mode) .action-col { display: none; }
body:not(.admin-mode) .action-icons { display: none; }

/* ── App-specific Modals ─────────────────────────────────── */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000;
}
.modal.visible { display: flex; }
.modal .modal-content {
    background: var(--bg-card); max-width: 750px; width: 90%; border-radius: var(--radius);
    padding: var(--space-lg) var(--space-xl); max-height: 85vh; overflow-y: auto;
}
.modal .modal-content h2 { margin: 0 0 var(--space-lg) 0; color: var(--text-primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.full-width { grid-column: span 2; }
.modal label { font-weight: 600; font-size: var(--text-xs); color: var(--text-secondary); display: block; margin-bottom: 4px; }
.dropdown-with-add { display: flex; gap: 8px; align-items: center; }
.dropdown-with-add select, .dropdown-with-add input { flex: 1; }
.small-btn {
    background: rgba(37,99,235,0.08); border: 1px solid var(--border); border-radius: 999px;
    padding: 6px var(--space-sm); font-size: var(--text-xs); cursor: pointer; font-weight: 500; color: var(--text-primary);
}
.modal input, .modal select {
    width: 100%; padding: 8px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-size: var(--text-xs); background: var(--bg-card); color: var(--text-primary);
}
.modal input:focus, .modal select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.modal-buttons { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-lg); }

/* ── Settings Modal ───────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.settings-section { margin-bottom: var(--space-lg); }
.settings-section h3 { font-size: var(--text-base); color: var(--accent); margin: 0 0 var(--space-sm) 0; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.settings-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.settings-row label { min-width: 120px; margin: 0; }
.settings-row input { width: 80px; text-align: center; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-msg {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--bg-surface); color: var(--text-primary);
    padding: 10px 20px; border-radius: 999px; font-size: var(--text-xs); z-index: 1100;
    opacity: 0; transition: opacity 0.2s; pointer-events: none;
    border: 1px solid var(--border); box-shadow: var(--shadow-md);
}

.category-filter-badge {
    background: var(--border); border-radius: 999px; padding: 4px var(--space-sm); font-size: var(--text-xs);
    display: inline-flex; align-items: center; gap: 6px; margin-left: var(--space-sm); color: var(--text-primary);
}
.clear-filter { cursor: pointer; color: var(--accent); font-weight: bold; }

/* ── Language switcher (in-app) ────────────────────────────── */
.language-switch { display: flex; gap: 8px; }
.language-switch .lang-btn { padding: 4px 10px !important; font-size: var(--text-xs) !important; }
.language-switch .lang-btn.active { background: rgba(37,99,235,0.1); border-color: var(--accent); color: var(--accent); }

/* ── Promo banner ─────────────────────────────────────────── */
.promo-banner {
    background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(37,99,235,0.03) 50%, rgba(37,99,235,0.02) 100%);
    border: 1px solid rgba(37,99,235,0.2); border-radius: var(--radius);
    padding: var(--space-sm) var(--space-lg); margin-bottom: var(--space-lg); font-size: var(--text-xs); color: var(--accent);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.promo-banner .promo-icon { font-size: 20px; }
.promo-banner .promo-text { flex: 1; min-width: 200px; color: var(--text-primary); }
.promo-banner .promo-text strong { font-weight: 700; }
.promo-banner a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.promo-banner a:hover { color: var(--accent-hover); }

/* ── Viewer banner ────────────────────────────────────────── */
.viewer-banner {
    background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.3); border-radius: var(--radius);
    padding: 10px 18px; margin-bottom: var(--space-lg); font-size: var(--text-xs); color: var(--warm);
    display: flex; align-items: center; gap: 10px;
}
.viewer-banner.hidden { display: none; }
.viewer-banner .login-link { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ── Recipes page specific ─────────────────────────────────── */
.recipe-card {
    background: var(--bg-card); border-radius: var(--radius); padding: var(--space-lg) var(--space-xl); margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    page-break-inside: avoid;
}
.recipe-card.emergency { border: 2px solid var(--error); background: rgba(239,68,68,0.04); }
.recipe-card.normalcy { border: 2px solid #8b5cf6; background: rgba(139,92,246,0.04); }
.recipe-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border);
}
.recipe-title { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); margin: 0; }
.recipe-number {
    background: rgba(37,99,235,0.08); color: var(--accent); font-weight: 700;
    padding: 4px var(--space-sm); border-radius: 999px; font-size: var(--text-xs);
}
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.priority-badge, .fuel-badge, .emergency-badge, .normalcy-badge {
    display: inline-block; padding: 4px var(--space-sm); border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.priority-urgent { background: rgba(239,68,68,0.08); color: var(--error); border: 1px solid rgba(239,68,68,0.3); }
.priority-soon { background: rgba(217,119,6,0.08); color: var(--warm); border: 1px solid rgba(217,119,6,0.3); }
.priority-normal { background: rgba(16,185,129,0.08); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.fuel-zero { background: rgba(16,185,129,0.08); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.fuel-low { background: rgba(37,99,235,0.08); color: var(--accent); border: 1px solid rgba(37,99,235,0.3); }
.fuel-medium { background: rgba(217,119,6,0.08); color: var(--warm); border: 1px solid rgba(217,119,6,0.3); }
.emergency-badge { background: var(--error); color: #fff; }
.normalcy-badge { background: #8b5cf6; color: #fff; }
.recipe-meta {
    display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-md);
}
.meta-pill {
    background: var(--bg-surface); border-radius: 999px; padding: 6px 14px;
    font-size: var(--text-xs); font-weight: 500; color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 6px;
}
.recipe-section { margin-bottom: var(--space-md); }
.recipe-section h4 {
    font-size: var(--text-sm); font-weight: 700; color: var(--text-primary); margin: 0 0 8px 0;
    display: flex; align-items: center; gap: 8px;
}
.ingredients-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px;
}
.ingredients-list li {
    font-size: var(--text-xs); color: var(--text-secondary); padding: 4px 0;
    display: flex; align-items: center; gap: 8px;
}
.ingredients-list li::before {
    content: "\2022"; color: var(--success); font-weight: bold; font-size: 18px;
}
.instructions-list {
    list-style: none; padding: 0; margin: 0; counter-reset: step;
}
.instructions-list li {
    font-size: var(--text-xs); color: var(--text-secondary); padding: 6px 0 6px 28px;
    position: relative; line-height: 1.5;
}
.instructions-list li::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 0; top: 6px;
    background: var(--accent); color: #fff; font-weight: 700;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
}
.child-box {
    background: rgba(217,119,6,0.06); border-left: 4px solid var(--warm);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: var(--space-sm) 0;
}
.child-box h4 { color: var(--warm); margin: 0 0 8px 0; font-size: var(--text-sm); font-weight: 700; }
.child-box p { margin: 0; font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; }
.tip-box {
    background: rgba(16,185,129,0.06); border-left: 4px solid var(--success);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: var(--space-sm) 0;
}
.tip-box h4 { color: var(--success); margin: 0 0 8px 0; font-size: var(--text-sm); font-weight: 700; }
.tip-box p { margin: 0; font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; }
.resource-alert {
    background: rgba(37,99,235,0.06); border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: var(--space-sm) 0;
    display: flex; justify-content: space-between; align-items: center;
}
.resource-alert h4 { color: var(--accent); margin: 0; font-size: var(--text-sm); font-weight: 700; }
.resource-alert p { margin: 0; font-size: var(--text-xs); color: var(--accent); }
.fuel-icon { font-size: 16px; }
.critical-alert {
    background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius);
    padding: var(--space-sm) var(--space-md); margin-top: var(--space-sm); font-size: var(--text-xs); color: var(--error);
    display: flex; align-items: flex-start; gap: 10px;
}
.critical-alert strong { font-weight: 700; }
.critical-alert.hidden { display: none; }
.critical-alert .urgent { color: var(--error); font-weight: 700; }
.footer-note {
    text-align: center; padding: var(--space-lg); font-size: var(--text-xs); color: var(--text-secondary);
}

/* ── Header row (recipes page) ── */
.header-row {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.header-title { font-size: var(--text-2xl); font-weight: 800; color: var(--text-primary); margin: 0; }
.header-subtitle { font-size: var(--text-sm); color: var(--text-secondary); margin: 4px 0 0 0; }

/* ── Print styles for recipes ─────────────────────────────── */
@media print {
    body { background: white !important; padding: 0 !important; }
    .container { max-width: 100%; }
    .summary-bar, .toolbar, .footer-note, .site-header, .site-footer, .sticky-donate-wrapper {
        background: white !important; border: none !important; box-shadow: none !important;
    }
    .language-switch, .btn:not(.print-only), .theme-toggle { display: none !important; }
    .recipe-card {
        border: 1px solid #000 !important; box-shadow: none !important;
        page-break-inside: avoid; margin-bottom: 16px;
    }
    .recipe-card.emergency { border: 3px solid #000 !important; background: #fff !important; }
    .recipe-card.emergency::before {
        content: "\26A0\uFE0F EMERGENCY ONLY \26A0\uFE0F";
        display: block; font-weight: bold; font-size: 14px; text-align: center;
        padding: 5px; border-bottom: 2px solid #000; margin-bottom: 10px;
    }
    .recipe-card.normalcy { border: 2px dashed #000 !important; background: #fff !important; }
    .recipe-card.normalcy::before {
        content: "\uD83C\uDFE0 COMFORT / NORMALCY";
        display: block; font-weight: bold; font-size: 12px; text-align: center;
        padding: 5px; border-bottom: 1px dashed #000; margin-bottom: 10px;
    }
    .critical-alert { background: #fff !important; border: 1px solid #000 !important; color: #000 !important; }
    .child-box, .tip-box, .resource-alert { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .recipe-meta, .meta-pill { background: var(--bg-surface) !important; -webkit-print-color-adjust: exact; }
    a { text-decoration: none; color: inherit; }
    /* Force all text to black */
    * { color: #000 !important; }
    /* Priority badges */
    .priority-urgent { border: 2px solid #000 !important; background: #fff !important; }
    .priority-urgent::after { content: " [USE FIRST!]"; font-weight: bold; }
    .priority-soon { border: 1px solid #000 !important; background: #fff !important; }
    .priority-normal { border: 1px solid #999 !important; background: #fff !important; }
    /* Fuel badges */
    .fuel-zero::after { content: " [NO FUEL!]"; font-weight: bold; }
    .fuel-low::after { content: " [LOW FUEL]"; }
    .fuel-medium::after { content: " [MED FUEL]"; }
    /* Stat cards */
    .stat-card.critical { border: 3px solid #000 !important; border-left: 4px solid #000 !important; }
    .stat-card.warning { border: 2px solid #000 !important; border-left: 4px solid #000 !important; }
    .stat-card { border: 1px solid #999 !important; border-left: 4px solid #000 !important; }
    /* Child & Tip boxes */
    .child-box { border: 2px solid #000 !important; border-left: 4px solid #000 !important; background: #fff !important; }
    .child-box::before { content: "\uD83D\uDC76 CHILD VERSION"; display: block; font-weight: bold; font-size: 11px; margin-bottom: 5px; }
    .tip-box { border: 2px solid #000 !important; border-left: 4px solid #000 !important; background: #fff !important; }
    .tip-box::before { content: "\uD83D\uDCA1 SURVIVAL TIP"; display: block; font-weight: bold; font-size: 11px; margin-bottom: 5px; }
    .resource-alert { border: 2px solid #000 !important; border-left: 4px solid #000 !important; background: #fff !important; }
    .critical-alert { border: 3px solid #000 !important; background: #fff !important; }
    .critical-alert .urgent { text-decoration: underline; font-weight: bold; }
    .site-header, .site-footer, .sticky-donate-wrapper { display: none !important; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .settings-grid { grid-template-columns: 1fr; }
    body.app-body { padding: var(--space-md); }
    .header-row { flex-direction: column; align-items: flex-start; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .recipe-header { flex-direction: column; gap: 8px; }
}
