/* ==========================================================================
   LifeDrop — Global Stylesheet
   Design tokens live at the top as CSS custom properties so the whole
   theme can be adjusted from one place.
   ========================================================================== */

:root {
  /* Brand colors (from brief) */
  --ink-black: #001524;
  --stormy-teal: #15616D;
  --papaya-whip: #FFECD1;
  --vivid-tangerine: #FF7D00;
  --brandy: #78290F;

  /* Supporting neutrals for contrast-safe text and surfaces */
  --white: #FFFFFF;
  --off-white: #FFF9F0;
  --gray-100: #F2ECE2;
  --gray-300: #D9D2C6;
  --gray-500: #7C8A8E;
  --gray-700: #3A4A4F;
  --overlay: rgba(0, 21, 36, 0.6);

  /* Semantic aliases */
  --color-bg: var(--off-white);
  --color-surface: var(--white);
  --color-text: var(--ink-black);
  --color-text-muted: var(--gray-700);
  --color-primary: var(--stormy-teal);
  --color-accent: var(--vivid-tangerine);
  --color-accent-dark: var(--brandy);
  --color-border: var(--gray-300);
  --color-success: #1E7E45;
  --color-error: #B3261E;

  /* Typography */
  --font-heading: 'Michroma', sans-serif;
  --font-body: 'Poppins', sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 3rem;

  --lh-tight: 1.2;
  --lh-normal: 1.6;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0, 21, 36, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 21, 36, 0.12);
  --shadow-lg: 0 20px 48px rgba(0, 21, 36, 0.18);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 450ms cubic-bezier(0.22, 1, 0.36, 1);

  --header-height: 76px;
  --straddle-offset: 3rem;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; margin: 0; padding: 0; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-4);
  color: var(--ink-black);
}

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

p { margin: 0 0 var(--space-4); color: var(--color-text-muted); }

@media (max-width: 640px) {
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  :root { --header-height: 64px; --straddle-offset: 1.75rem; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Visible focus states everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-black);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

section { padding-block: var(--space-8); }

.section-heading { max-width: 640px; margin-bottom: var(--space-6); }
.section-heading .eyebrow { display: block; margin-bottom: var(--space-2); }

.eyebrow {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* Pulse divider — the site's signature motif: an ECG heartbeat line that
   separates major sections, echoing the act of donating blood/life. */
.pulse-divider {
  display: block;
  width: 100%;
  height: 32px;
  margin-block: var(--space-2);
}
.pulse-divider path {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-pulse 1.8s ease-out forwards;
}
@keyframes draw-pulse {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-divider path { animation: none; stroke-dashoffset: 0; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-base);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-accent);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-accent-dark); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: transparent;
  color: var(--ink-black);
  border-color: var(--ink-black);
}
.btn-secondary:hover { background: var(--ink-black); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-ghost:hover { background: var(--color-primary); color: var(--white); }

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--fs-sm); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  color: var(--ink-black);
}
.brand .brand-mark {
  width: 32px;
  height: 32px;
  color: var(--color-accent);
}

.main-nav ul { display: flex; gap: var(--space-6); align-items: center; }
.main-nav a {
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--ink-black);
  border-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-black);
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle-label { font-size: var(--fs-sm); font-weight: 600; font-family: var(--font-body); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; z-index: 110; }
  .main-nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    height: calc(100vh - var(--header-height));
    background: var(--off-white);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    padding: var(--space-6) var(--space-6);
    display: flex;
    align-items: center;
    overflow: hidden;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
    width: 100%;
  }
  .main-nav a {
    font-size: var(--fs-xl);
    display: block;
    width: 100%;
    padding-block: var(--space-2);
  }
  body.nav-open { overflow: hidden; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-block: var(--space-9) calc(var(--space-8) + var(--straddle-offset, 3rem));
  background:
    linear-gradient(90deg, rgba(0, 21, 36, 0.92) 0%, rgba(0, 21, 36, 0.65) 45%, transparent 65%),
    url("../assets/images/hero-main.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  justify-items: start;
}

.hero-copy { max-width: 60%; width: 60%; text-align: left; }
.hero-copy .eyebrow { color: var(--vivid-tangerine); }
.hero h1 { color: var(--white); margin-bottom: var(--space-5); }
.hero h1 .accent { color: var(--vivid-tangerine); }
.hero p.lead {
  font-size: var(--fs-md);
  color: var(--papaya-whip);
  max-width: none;
}

.hero-actions { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); justify-content: flex-start; }

@media (max-width: 1024px) {
  .hero-copy { max-width: 100%; width: 100%; }
}

@media (max-width: 860px) {
  .hero {
    background:
      linear-gradient(180deg, rgba(0, 21, 36, 0.88), rgba(0, 21, 36, 0.93)),
      url("../assets/images/hero-main.webp");
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
  }
  .hero .container { justify-items: center; text-align: center; }
  .hero-copy { text-align: center; margin-inline: auto; max-width: 100%; width: 100%; }
  .hero-copy p.lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
}

/* ==========================================================================
   Page hero banners (inner pages) — full width photo, boxed title card
   sits inside the same max-width container as the rest of the site
   ========================================================================== */

.page-hero {
  position: relative;
  padding-block: calc(var(--space-8) + 1.5em);
  color: var(--white);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

.page-hero .container { position: relative; z-index: 1; }

@media (max-width: 900px) {
  .page-hero { background-attachment: scroll; }
}

.page-hero-box {
  display: inline-block;
  max-width: 100%;
  background: rgba(0, 21, 36, 0.68);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  backdrop-filter: blur(2px);
}

.page-hero-box h1 { color: var(--white); margin: 0; font-size: var(--fs-xl); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--papaya-whip);
  margin-bottom: var(--space-3);
}
.breadcrumb a { color: var(--papaya-whip); opacity: 0.85; }
.breadcrumb a:hover { opacity: 1; text-decoration: underline; }
.breadcrumb i { font-size: 0.65em; opacity: 0.7; }
.breadcrumb span[aria-current="page"] { color: var(--vivid-tangerine); font-weight: 600; }

@media (max-width: 700px) {
  .page-hero-box { display: block; max-width: none; }
}

.page-hero--about   { background-image: url("../assets/images/hero-about.webp"); }
.page-hero--register{ background-image: url("../assets/images/doner-regestration.webp"); }
.page-hero--search   { background-image: url("../assets/images/search-doner.webp"); }
.page-hero--emergency{ background-image: url("../assets/images/emergency-request.webp"); }
.page-hero--admin-login{ background-image: url("../assets/images/admin-login.webp"); }
.page-hero--privacy { background-image: url("../assets/images/privacy-policy.webp"); }
.page-hero--manage  { background-image: url("../assets/images/doner-regestration.webp"); }
.page-hero--blog    { background-image: url("../assets/images/blog-page.webp"); }
.page-hero--faq     { background-image: url("../assets/images/faq.webp"); }

/* ==========================================================================
   Urgent requests promo banner (homepage)
   ========================================================================== */

.urgent-banner-wrap {
  margin-top: calc(-1 * var(--straddle-offset, 3rem));
  position: relative;
  z-index: 2;
}

.section-after-straddle {
  padding-top: var(--space-8) !important;
}

.urgent-banner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: var(--white);
  border: 1.5px solid #F3CFC7;
  border-left: 5px solid var(--color-error);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.urgent-banner .urgent-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #FBEAE9;
  color: var(--color-error);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  animation: urgent-pulse 2s ease-in-out infinite;
}

@keyframes urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(179, 38, 30, 0); }
}

.urgent-banner .urgent-copy { flex: 1; min-width: 200px; }
.urgent-banner .urgent-copy strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  color: var(--ink-black);
  margin-bottom: var(--space-1);
}
.urgent-banner .urgent-copy span { font-size: var(--fs-sm); color: var(--color-text-muted); }

.urgent-banner .btn-urgent {
  background: var(--color-error);
  color: var(--white);
  flex-shrink: 0;
}
.urgent-banner .btn-urgent:hover { background: #8f1e18; }

@media (prefers-reduced-motion: reduce) {
  .urgent-banner .urgent-icon { animation: none; }
}

@media (max-width: 640px) {
  .urgent-banner { padding: var(--space-4); gap: var(--space-4); }
  .urgent-banner .urgent-copy { min-width: 100%; order: 2; }
  .urgent-banner .btn-urgent { order: 3; width: 100%; justify-content: center; }

  .urgent-banner-wrap {
    margin-top: -7em;
  }
  .section-after-straddle {
    padding-top: var(--space-6) !important;
  }
  .hero {
    padding-bottom: 10em;
  }
}

/* ==========================================================================
   Stats strip
   ========================================================================== */

.stats-strip {
  background: var(--stormy-teal);
  color: var(--white);
  padding-block: var(--space-6);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  text-align: center;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  color: var(--papaya-whip);
  display: block;
}
.stat-label { font-size: var(--fs-sm); color: var(--gray-100); margin-top: var(--space-1); }

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* ==========================================================================
   How it works
   ========================================================================== */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--papaya-whip);
  color: var(--color-accent-dark);
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
}
.step-index {
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  color: var(--color-primary);
  display: block;
  margin-bottom: var(--space-2);
}

@media (max-width: 860px) {
  .steps-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Cards / donor results
   ========================================================================== */

.donor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.donor-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

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

.blood-badge {
  font-family: var(--font-heading);
  font-size: var(--fs-md);
  color: var(--white);
  background: var(--brandy);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  min-width: 3.5rem;
  text-align: center;
}

.donor-name { font-weight: 600; font-size: var(--fs-md); margin: 0; }
.donor-meta { font-size: var(--fs-sm); color: var(--color-text-muted); display: flex; gap: var(--space-2); align-items: center; }

.donor-contact-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: auto; }
.donor-contact-row[hidden] { display: none; }
.donor-contact-row > * { flex: 1 1 auto; }

.contact-masked { font-family: monospace; letter-spacing: 0.05em; color: var(--gray-500); }

/* Share dropdown menu, used on urgent request cards. The trigger itself
   now reuses the shared .btn .btn-sm .btn-secondary theme so it visually
   matches the WhatsApp and Call buttons beside it. */
.share-wrap { position: relative; flex: 1 1 auto; }
.share-wrap .share-btn { width: 100%; }

.share-menu {
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 0;
  min-width: 11rem;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: var(--space-2);
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 50;
}

.share-menu.open { display: flex; }

.share-menu button, .share-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  font-family: var(--font-body);
  color: var(--ink-black);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.share-menu button:hover, .share-menu a:hover { background: var(--papaya-whip); }

.share-menu i { width: 1.1rem; text-align: center; color: var(--stormy-teal); }

.request-card--highlight {
  border-color: var(--vivid-tangerine);
  box-shadow: 0 0 0 3px rgba(255, 125, 0, 0.25);
}

/* Multi-select dropdown used for the blood group search filter */
.multiselect { position: relative; }

.multiselect-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: inset 0 1px 2px rgba(0, 21, 36, 0.04);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--color-text);
  cursor: pointer;
}

.multiselect-toggle:hover, .multiselect-toggle:focus-visible { border-color: var(--color-primary); }

.multiselect-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.multiselect-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: var(--space-2);
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 16rem;
  overflow-y: auto;
}

.multiselect-menu.open { display: flex; }

.multiselect-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
}

.multiselect-option:hover { background: var(--color-bg); }

/* Skeleton loading state */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-300) 37%, var(--gray-100) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton-card { height: 168px; border-radius: var(--radius-md); }

.empty-state, .no-results {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--color-text-muted);
}
.empty-state i, .no-results i { font-size: 2rem; color: var(--color-primary); margin-bottom: var(--space-3); display: block; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-7);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  margin-inline: auto;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-6); min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid > .field { min-width: 0; }

.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); min-width: 0; }
.field label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink-black); }
.field .hint { font-size: var(--fs-xs); color: var(--color-text-muted); }

.field input[type="text"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="email"],
.field input[type="password"],
.field select {
  width: 100%;
  min-width: 0;
  padding: var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: inset 0 1px 2px rgba(0, 21, 36, 0.04);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field input::placeholder { color: var(--gray-500); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2315616D'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.19l3.71-3.96a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 18px;
  padding-right: var(--space-8);
}
.field input:focus,
.field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(21, 97, 109, 0.12);
  outline: none;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--color-error); }
.field-error { color: var(--color-error); font-size: var(--fs-xs); display: none; }
.field-error.visible { display: block; }

.radio-group { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.radio-option {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-sm); font-weight: 500;
  border: 1.5px solid var(--color-border);
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.radio-option:has(input:checked) { border-color: var(--color-primary); background: var(--papaya-whip); }
.radio-option input { accent-color: var(--color-primary); width: 16px; height: 16px; }

.checkbox-field { display: flex; align-items: flex-start; gap: var(--space-3); background: var(--off-white); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-4); }
.checkbox-field input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--color-accent); flex-shrink: 0; }
.checkbox-field label { font-weight: 400; font-size: var(--fs-sm); color: var(--color-text-muted); }

/* Honeypot field — hidden from real users, visible to bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-feedback {
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-size: var(--fs-sm);
  display: none;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.form-feedback.visible { display: flex; }
.form-feedback.success { background: #E4F3E9; color: var(--color-success); }
.form-feedback.error { background: #FBEAE9; color: var(--color-error); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: var(--space-5); }
}

/* ==========================================================================
   Search filters bar
   ========================================================================== */

.filter-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: var(--space-6);
}
.filter-bar .field { margin-bottom: 0; min-width: 180px; flex: 1; }
.filter-bar > .btn { align-self: flex-end; }

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--header-height)); }
.admin-sidebar {
  background: var(--ink-black);
  color: var(--papaya-whip);
  padding: var(--space-6) var(--space-5);
}
.admin-sidebar h2 { color: var(--white); font-size: var(--fs-md); }
.admin-sidebar ul { display: flex; flex-direction: column; gap: var(--space-2); }
.admin-sidebar a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--papaya-whip);
  white-space: nowrap;
  transition: background var(--transition-fast);
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.08); color: var(--white); }

.admin-main { padding: var(--space-7); min-width: 0; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: var(--space-5); margin-bottom: var(--space-7); }
.admin-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  min-width: 0;
}
.admin-stat-card .stat-value { color: var(--ink-black); font-size: var(--fs-xl); }
.admin-stat-card .stat-label { color: var(--color-text-muted); }

.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: var(--space-4); border-bottom: 1px solid var(--color-border); font-size: var(--fs-sm); white-space: nowrap; }
th { font-family: var(--font-heading); font-size: var(--fs-xs); letter-spacing: 0.05em; color: var(--color-text-muted); text-transform: uppercase; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; }
.badge-pending { background: #FFF1DB; color: var(--brandy); }
.badge-approved { background: #E4F3E9; color: var(--color-success); }
.badge-rejected { background: #FBEAE9; color: var(--color-error); }
.badge-verified { background: #E6F0FE; color: var(--stormy-teal); }

.row-actions { display: flex; gap: var(--space-2); }
.icon-btn {
  background: none; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--color-primary); color: var(--white); border-color: var(--color-primary); }
.icon-btn.danger:hover { background: var(--color-error); border-color: var(--color-error); }

/* ==========================================================================
   Admin: tab sections, toolbar, bulk bar, checkboxes, modal, charts
   ========================================================================== */

.admin-panel-section { display: none; }
.admin-panel-section.active { display: block; }

.admin-toolbar {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.admin-toolbar .search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 340px;
}
.admin-toolbar .search-box i {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}
.admin-toolbar .search-box input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 22px);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--white);
}
.admin-toolbar .search-box input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(21, 97, 109, 0.12);
}
.admin-toolbar-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.bulk-bar {
  display: none;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  background: var(--ink-black);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  margin-bottom: var(--space-4);
}
.bulk-bar.visible { display: flex; }
.bulk-bar .bulk-count { font-weight: 600; font-size: var(--fs-sm); flex: 1; }
.bulk-bar .btn { padding: var(--space-2) var(--space-4); font-size: var(--fs-sm); }

.select-col { width: 40px; }
.row-checkbox, .select-all-checkbox {
  width: 18px; height: 18px; accent-color: var(--color-primary); cursor: pointer;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}
.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  min-width: 0;
}
.chart-card h3 { font-size: var(--fs-sm); margin-bottom: var(--space-4); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--font-heading); }
.chart-card canvas { max-width: 100%; }
.chart-card .chart-empty { text-align: center; color: var(--color-text-muted); padding: var(--space-6) 0; font-size: var(--fs-sm); }

@media (max-width: 760px) {
  .charts-grid { grid-template-columns: 1fr; }
}

/* Modal (edit donor) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 200;
}
.modal-overlay.visible { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-box h2 { font-size: var(--fs-lg); margin-bottom: var(--space-5); }
.modal-actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); }
.modal-actions .btn { flex: 1; }
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  cursor: pointer;
}
.modal-box { position: relative; }

@media (max-width: 640px) {
  .modal-box { padding: var(--space-5); }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-toolbar .search-box { max-width: none; }
  .admin-toolbar-actions { justify-content: stretch; }
  .admin-toolbar-actions .btn { flex: 1; }
}

/* Welcome / manage link reminder popup */
.welcome-popup-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 300;
}
.welcome-popup-overlay.visible { display: flex; }

.welcome-popup {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6) var(--space-6);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.welcome-popup-overlay.visible .welcome-popup { transform: translateY(0) scale(1); opacity: 1; }

.welcome-popup::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--stormy-teal), var(--vivid-tangerine));
}

.welcome-popup-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--papaya-whip);
  color: var(--brandy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto var(--space-4);
}

.welcome-popup h2 { font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.welcome-popup p { color: var(--color-text-muted); font-size: var(--fs-sm); line-height: 1.6; margin-bottom: var(--space-6); }

.welcome-popup-actions { display: flex; flex-direction: column; gap: var(--space-3); }
.welcome-popup-actions .btn { justify-content: center; }

.welcome-popup .modal-close { top: var(--space-3); right: var(--space-3); font-size: 1.15rem; }

@media (max-width: 480px) {
  .welcome-popup { padding: var(--space-7) var(--space-4) var(--space-5); }
  .welcome-popup-icon { width: 56px; height: 56px; font-size: 1.25rem; }
}

/* Activity log list */
.activity-list { display: flex; flex-direction: column; gap: var(--space-3); }
.activity-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}
.activity-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.9rem;
  background: var(--papaya-whip); color: var(--color-accent-dark);
}
.activity-icon.reject, .activity-icon.delete { background: #FBEAE9; color: var(--color-error); }
.activity-icon.approve { background: #E4F3E9; color: var(--color-success); }
.activity-body { flex: 1; min-width: 0; }
.activity-body .activity-title { font-weight: 600; font-size: var(--fs-sm); }
.activity-body .activity-meta { font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 2px; }

.login-shell {
  min-height: calc(100vh - var(--header-height));
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  position: relative;
  background:
    linear-gradient(180deg, rgba(0, 21, 36, 0.75), rgba(0, 21, 36, 0.85)),
    url("../assets/images/admin-login.webp");
  background-size: cover;
  background-position: center;
}

@media (max-width: 700px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .field { min-width: 0; flex: none; width: 100%; }
  .filter-bar > .btn { align-self: stretch; width: 100%; }

  .table-wrap { overflow-x: visible; }
  table { min-width: 0; width: 100%; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr {
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-3) 0;
  }
  tr:last-child { border-bottom: none; }
  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2) var(--space-4);
    border-bottom: none;
    white-space: normal;
    text-align: right;
  }
  td::before {
    content: attr(data-label);
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    text-align: left;
    flex-shrink: 0;
  }
  td.row-actions { justify-content: flex-end; }
  td.row-actions::before { display: none; }
  td.select-col { justify-content: flex-start; padding-bottom: 0; }
  td.select-col::before { content: "Select"; }
}

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-4);
  }
  .admin-sidebar h2 { flex-shrink: 0; margin: 0; white-space: nowrap; }
  .admin-sidebar ul { flex-direction: row; flex-shrink: 0; }
  .admin-main { padding: var(--space-5); }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .admin-sidebar h2 { font-size: var(--fs-sm); }
  .admin-main { padding: var(--space-4); }
  .admin-stats { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .admin-stat-card { padding: var(--space-4); }
  .admin-stat-card .stat-value { font-size: var(--fs-lg); }
}

/* ==========================================================================
   Content pages (about / privacy)
   ========================================================================== */

.prose { max-width: 760px; margin-inline: auto; }
.prose h2 { margin-top: var(--space-7); }
.prose ul { list-style: disc; padding-left: 1.4rem; margin-bottom: var(--space-4); }
.prose li { color: var(--color-text-muted); margin-bottom: var(--space-2); }

.info-strip {
  background: var(--papaya-whip);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-block: var(--space-6);
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
}

@media (max-width: 760px) {
  .why-grid { grid-template-columns: 1fr; }
  .why-grid svg { order: 1; }
}

/* ==========================================================================
   404
   ========================================================================== */

.error-page {
  min-height: calc(100vh - var(--header-height));
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: var(--space-6);
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(0, 21, 36, 0.8), rgba(0, 21, 36, 0.9)),
    url("assets/images/404.webp");
  background-size: cover;
  background-position: center;
}
.error-page p { color: var(--papaya-whip); }
.error-code {
  font-family: var(--font-heading);
  font-size: 6rem;
  color: var(--vivid-tangerine);
  line-height: 1;
  margin-bottom: var(--space-4);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink-black);
  color: var(--gray-100);
  padding-block: var(--space-7) var(--space-6);
  margin-top: var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.footer-brand .brand { color: var(--white); margin-bottom: var(--space-3); }
.footer-brand p { max-width: 36ch; color: var(--gray-100); }
.footer-col h4 { color: var(--white); font-size: var(--fs-sm); margin-bottom: var(--space-4); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col a { color: var(--gray-100); font-size: var(--fs-sm); transition: color var(--transition-fast); }
.footer-col a:hover { color: var(--vivid-tangerine); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: var(--space-5);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3);
  font-size: var(--fs-xs); color: var(--gray-500);
}
.credit-link {
  color: var(--vivid-tangerine);
  font-weight: 600;
  transition: color var(--transition-fast);
}
.credit-link:hover { color: var(--papaya-whip); }
.social-links { display: flex; gap: var(--space-3); }
.social-links a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast);
}
.social-links a:hover { background: var(--vivid-tangerine); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Utility
   ========================================================================== */

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: var(--white); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Blog / awareness section
   ========================================================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.blog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.blog-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--papaya-whip);
  color: var(--brandy);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-md);
  margin-bottom: var(--space-2);
}

.blog-card h3 { margin: 0; font-size: var(--fs-md); }
.blog-card p { margin: 0; font-size: var(--fs-sm); }

/* ==========================================================================
   FAQ accordion
   ========================================================================== */

.faq-list { display: flex; flex-direction: column; gap: var(--space-3); }

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-md);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary .faq-icon {
  color: var(--color-primary);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-item[open] summary .faq-icon { transform: rotate(45deg); }

.faq-item p { margin: var(--space-3) 0 0; color: var(--color-text-muted); }

/* LifeDrop Assistant chat widget */
.chat-widget {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 500;
}

.chat-fab {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: var(--white);
  font-size: 1.4rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.chat-fab:hover, .chat-fab:focus-visible { background: var(--color-accent-dark); transform: scale(1.05); }

/* Small teaser bubble that appears next to the fab on load and auto-hides.
   Kept fully separate from the chat panel so it never affects panel state. */
.chat-tooltip {
  position: absolute;
  right: calc(100% + var(--space-3));
  bottom: 50%;
  transform: translateY(50%);
  width: max-content;
  max-width: 15rem;
  background: var(--color-primary);
  color: var(--white);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-sm);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  animation: chat-tooltip-in 0.3s ease-out;
}

.chat-tooltip[hidden] { display: none; }

.chat-tooltip span { color: var(--white); }

.chat-tooltip button {
  background: none;
  border: none;
  color: var(--white);
  opacity: 0.75;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.chat-tooltip button:hover { opacity: 1; }

@keyframes chat-tooltip-in {
  from { opacity: 0; transform: translateY(calc(50% + 0.4rem)); }
  to { opacity: 1; transform: translateY(50%); }
}

/* The [hidden] attribute alone can lose to author rules with equal or higher
   specificity, so force it explicitly for the panel to avoid it rendering
   open by default. */
.chat-panel[hidden] { display: none; }

.chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-3));
  width: min(22rem, 88vw);
  max-height: min(32rem, 70vh);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-primary);
}

.chat-panel-title {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  margin: 0;
  color: var(--white) !important;
}

.chat-panel-subtitle {
  font-size: var(--fs-xs);
  margin: var(--space-1) 0 0;
  color: var(--white) !important;
  opacity: 0.9;
}


.chat-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  padding: var(--space-1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-bg);
}

.chat-bubble {
  max-width: 85%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--color-primary);
  color: var(--white);
  border-bottom-right-radius: var(--space-1);
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: var(--space-1);
}

.chat-typing { display: flex; gap: 0.3rem; align-items: center; padding: var(--space-3) var(--space-4); }
.chat-typing span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--gray-500);
  animation: chat-typing-bounce 1.1s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-0.25rem); opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.chat-input-row input {
  flex: 1;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
}

.chat-input-row input:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

.chat-send {
  width: 2.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.chat-send:hover, .chat-send:focus-visible { background: var(--color-accent-dark); }

@media (max-width: 480px) {
  .chat-widget { right: var(--space-3); bottom: var(--space-3); }
  .chat-panel { width: min(92vw, 22rem); right: 0; }
  .chat-tooltip { right: 0; left: auto; bottom: calc(100% + var(--space-3)); transform: none; max-width: min(13rem, calc(100vw - 4rem)); }
}
