/* ============================================================
   OPERATION SAVES — Design System
   ============================================================ */

/* --- Variables --- */
:root {
  --bg: #eef2f7;
  --bg-gradient: linear-gradient(160deg, #e8f0fe 0%, #f0f4f8 50%, #e8f5e9 100%);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-blur: blur(14px);
  --glass-border: rgba(255, 255, 255, 0.6);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.09);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  --text-primary: #1a1f2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --blue: #4a90d9;
  --blue-light: rgba(74, 144, 217, 0.12);
  --green: #22c55e;
  --green-light: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-light: rgba(239, 68, 68, 0.12);
  --yellow: #f59e0b;
  --yellow-light: rgba(245, 158, 11, 0.12);
  --purple: #7c3aed;
  --purple-light: rgba(124, 58, 237, 0.12);

  --header-h: 58px;
  --footer-h: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* --- App Shell --- */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
#app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px;
  z-index: 50;
}

.header-logo {
  grid-column: 2;
  height: 42px;
  width: 42px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

#logout-btn {
  grid-column: 3;
  justify-self: end;
  background: none;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
#logout-btn:hover {
  border-color: #4a90d9;
  color: #4a90d9;
}

/* --- Main Content --- */
#app-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--footer-h) + 8px);
}

#page-container {
  padding: 16px 14px;
  min-height: 100%;
}

/* --- Footer Nav --- */
#app-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--footer-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

#footer-nav {
  display: flex;
  height: 100%;
  align-items: center;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}

.nav-btn.active { color: var(--blue); }

.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 11px; font-weight: 500; }

.nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 24px);
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* --- Loading --- */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(74, 144, 217, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   GLASS CARDS
   ============================================================ */

.glass-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* --- Card Accent Borders --- */

/* Left border only */
.accent-left {
  position: relative;
  padding-left: 16px;
}
.accent-left::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.accent-left.accent-blue::before   { background: var(--blue); }
.accent-left.accent-green::before  { background: var(--green); }
.accent-left.accent-red::before    { background: var(--red); }
.accent-left.accent-yellow::before { background: var(--yellow); }
.accent-left.accent-purple::before { background: var(--purple); }

/* Full border */
.accent-full {
  position: relative;
}
.accent-full::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius) + 2px);
  z-index: -1;
}
.accent-full.accent-red::before    { background: var(--red); }
.accent-full.accent-blue::before   { background: var(--blue); }
.accent-full.accent-green::before  { background: var(--green); }
.accent-full.accent-purple::before { background: var(--purple); }

/* Gmail 4-color border */
.accent-full.accent-gmail::before {
  background: linear-gradient(90deg, #EA4335 0%, #EA4335 25%, #FBBC04 25%, #FBBC04 50%, #34A853 50%, #34A853 75%, #4285F4 75%, #4285F4 100%);
}

/* Instagram gradient border */
.accent-full.accent-instagram::before {
  background: linear-gradient(135deg, #F77737, #E1306C, #C13584, #833AB4);
}

/* TikTok diagonal split */
.accent-full.accent-tiktok::before {
  background: linear-gradient(135deg, #69C9D0 50%, #EE1D52 50%);
}

/* Facebook blue */
.accent-full.accent-facebook::before {
  background: #1877F2;
}

/* ============================================================
   ACTION NEEDED TAG
   ============================================================ */
.tag-action-needed {
  display: inline-flex;
  align-items: center;
  background: var(--red-light);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  margin-bottom: 6px;
}

/* ============================================================
   STATUS BUBBLES
   ============================================================ */
.status-bubbles {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

.bubble {
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  padding: 0 6px;
}
.bubble.red   { background: var(--red); }
.bubble.green { background: var(--green); }

/* ============================================================
   SECTION HEADERS (Workflow)
   ============================================================ */
.section-wrap {
  margin-bottom: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
}

.section-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.section-header.expanded {
  border-bottom-color: rgba(0,0,0,0.06);
}

.section-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.section-titles {
  flex: 1;
  min-width: 0;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.section-chevron {
  font-size: 13px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.section-chevron.open { transform: rotate(180deg); }

.section-body {
  display: none;
  padding: 14px;
}

.section-body.open { display: block; }

/* ============================================================
   CARD COMMON STYLES
   ============================================================ */
.card {
  position: relative;
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: visible;
}

.card:last-child { margin-bottom: 0; }

.card:active { transform: scale(0.985); }

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.card-meta {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
  cursor: pointer;
}
.btn:active { transform: scale(0.96); opacity: 0.85; }

.btn-primary   { background: var(--blue);   color: white; }
.btn-green     { background: var(--green);  color: white; }
.btn-red       { background: var(--red);    color: white; }
.btn-ghost     { background: rgba(74,144,217,0.1); color: var(--blue); }
.btn-outline   { background: white; border: 1.5px solid #e5e7eb; color: var(--text-primary); }
.btn-full      { width: 100%; }
.btn-sm        { padding: 6px 14px; font-size: 13px; }

.btn-complete  {
  background: white;
  border: 1.5px solid var(--green);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   CAROUSEL
   ============================================================ */
.carousel-wrap {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: calc(100% - 32px);
}

.carousel-slide.peek { width: calc(85% - 20px); }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d5db;
  transition: background 0.2s, transform 0.2s;
}

.dot.active {
  background: var(--blue);
  transform: scale(1.3);
}

/* ============================================================
   MODAL
   ============================================================ */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.25s;
}

#modal-overlay.hidden { display: none; }
#modal-overlay.visible { display: flex; }

#modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  max-height: 90vh;
  background: rgba(255,255,255,0.96);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px 36px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

#modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.07);
  font-size: 20px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  padding-right: 36px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 14px 0;
}

.modal-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   MAP PLACEHOLDER
   ============================================================ */
.map-placeholder {
  background: #e8edf3;
  border-radius: var(--radius-sm);
  height: 160px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.map-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.3) 0, rgba(255,255,255,0.3) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.3) 0, rgba(255,255,255,0.3) 1px, transparent 1px, transparent 40px);
}

.map-pin {
  font-size: 36px;
  position: relative;
  z-index: 1;
}

.map-address-bar {
  background: rgba(30,30,30,0.75);
  color: white;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
}

.map-address-bar strong { font-weight: 600; }

/* ============================================================
   ATTENDING ANIMALS (Event modal)
   ============================================================ */
.animal-avatars {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.animal-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.animal-avatar img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.animal-avatar span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   VET CARD SPECIFIC
   ============================================================ */
.vet-volunteer {
  color: var(--red);
  font-weight: 600;
}

/* ============================================================
   DOCUMENT VERIFICATION MODAL
   ============================================================ */
.doc-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9ff;
  border-radius: var(--radius-xs);
  padding: 13px 15px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid #e8ecff;
}
.doc-link-row:hover { background: #eef0ff; }
.doc-link-row span { font-size: 14px; font-weight: 600; color: var(--blue); }
.doc-link-row .ext-icon { font-size: 18px; color: var(--text-muted); }

.doc-info-box {
  background: #f9fafb;
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
}
.doc-info-box h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.doc-info-box p  { font-size: 13px; color: var(--text-secondary); }

.btn-row-approve-deny {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

/* ============================================================
   FOLLOW-UP CHECKLIST
   ============================================================ */
.followup-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.followup-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.followup-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.followup-icon.sent     { background: var(--green); color: white; }
.followup-icon.scheduled{ background: var(--blue-light); color: var(--blue); font-size: 10px; }
.followup-icon.pending  { background: var(--red-light); color: var(--red); }

.followup-item .label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.followup-item .sublabel { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   CALLS & TEXTS
   ============================================================ */
.subsection-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  margin-top: 4px;
}

.ai-note {
  font-size: 12px;
  color: var(--text-secondary);
  border-left: 2px solid #e5e7eb;
  padding-left: 8px;
  margin-top: 6px;
  font-style: italic;
}

/* Chat bubble modal */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 14px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.chat-bubble.them {
  background: #4a90d9;
  color: white;
  border-bottom-left-radius: 4px;
  align-self: flex-end;
}

.chat-bubble.ai {
  background: #f3f4f6;
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
  align-self: flex-start;
}

.transcript-box {
  background: #f9fafb;
  border-radius: var(--radius-xs);
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  border: 1px solid #e5e7eb;
}

/* ============================================================
   EMAIL MODAL
   ============================================================ */
.email-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-message {
  background: white;
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
}

.email-message-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.email-from { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.email-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; margin-left: 8px; }
.email-body { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ============================================================
   FINALIZED ADOPTIONS CARD
   ============================================================ */
.adoption-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: block;
}

.adoption-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 5px;
}

.check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.check-icon.done   { background: var(--green); color: white; }
.check-icon.not    { background: var(--red-light); color: var(--red); border: 1.5px solid var(--red); }
.check-icon.done-text   { color: var(--text-primary); }
.check-icon.not-text    { color: var(--red); }

/* ============================================================
   NEW ANIMALS — Compatibility / Household
   ============================================================ */
.compat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.compat-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
}

.compat-item.good    { background: var(--green-light); color: #15803d; }
.compat-item.bad     { background: var(--red-light);   color: #b91c1c; }
.compat-item.unknown { background: #f3f4f6; color: var(--text-muted); }

.compat-icon { font-size: 16px; }
.compat-status { font-size: 15px; margin-left: auto; }

/* ============================================================
   NEW APPLICATIONS / PETFINDER
   ============================================================ */
.app-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.app-card-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
}

.app-card-info { flex: 1; }
.app-card-title { font-size: 16px; font-weight: 700; }
.app-card-sub { font-size: 13px; color: var(--text-secondary); }

.app-count-big {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.app-count-label { font-size: 11px; color: var(--text-muted); text-align: right; line-height: 1.2; }

/* Applications modal swipe */
.app-modal-counter {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.app-modal-applicant {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.app-modal-submitted {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.ai-approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
}
.ai-approved-badge.approved { background: var(--green-light); color: #15803d; }
.ai-approved-badge.flagged  { background: var(--red-light);   color: #b91c1c; }

/* ============================================================
   SOCIAL POSTS
   ============================================================ */
.social-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.social-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.social-card-body {
  padding: 12px 14px;
  background: white;
}

.social-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}

.social-stat { text-align: center; }
.social-stat-num { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.social-stat-label { font-size: 11px; color: var(--text-muted); }

.platform-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.platform-tag.instagram { background: var(--yellow-light); color: #c2410c; }
.platform-tag.facebook  { background: var(--blue-light);   color: #1d4ed8; }
.platform-tag.tiktok    { background: rgba(105,201,208,0.15); color: #0891b2; }

/* ============================================================
   HOME PAGE
   ============================================================ */
.ai-assist-card {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 18px;
}

.ai-assist-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}

.ai-search-box {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e5e7eb;
  background: white;
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  display: block;
}

.ai-search-box:hover { border-color: var(--blue); }

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.ai-suggestion-chip {
  background: var(--blue-light);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
}
.ai-suggestion-chip:hover { background: rgba(74,144,217,0.2); }

.ai-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

.home-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.all-clear {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-secondary);
}

.all-clear-icon { font-size: 40px; margin-bottom: 10px; }
.all-clear-text { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.all-clear-sub  { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   RESOURCES PAGE
   ============================================================ */
.resource-card {
  background: white;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #e8ecf0;
  box-shadow: var(--shadow-card);
}

.resource-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.resource-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.resource-desc {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 16px 12px;
}

.resource-detail {
  display: none;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 16px 14px;
  line-height: 1.6;
  border-top: 1px solid #f3f4f6;
  padding-top: 10px;
}

.resource-detail.open { display: block; }
.resource-chevron { color: var(--text-muted); font-size: 13px; transition: transform 0.2s; }
.resource-chevron.open { transform: rotate(180deg); }

/* ============================================================
   AI CHAT PAGE
   ============================================================ */
#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
}

.chat-msg {
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-msg.ai {
  background: white;
  border: 1px solid #e5e7eb;
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  background: var(--blue);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.typing-dot {
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.9);
  border-top: 1px solid #e5e7eb;
  position: sticky;
  bottom: 0;
}

#chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 22px;
  border: 1.5px solid #e5e7eb;
  font-size: 14px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 0.2s;
}
#chat-input:focus { border-color: var(--blue); }

#chat-send {
  padding: 10px 18px;
  border-radius: 22px;
  background: var(--blue);
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* ============================================================
   PF LOGO (Petfinder)
   ============================================================ */
.pf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: #8b1bf5;
  border-radius: 6px;
  color: white;
  font-size: 11px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }
.color-muted { color: var(--text-muted); }
.color-secondary { color: var(--text-secondary); }

/* Refresh btn */
.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  margin: 0 auto;
  margin-top: 12px;
}
