.applies-to-pet-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.applies-to-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid #d4d4d8;
  background: #f8fafc;
  color: #334155;
  margin-left: 8px;
}

.pet-dashboard-family-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pet-dashboard-family-panel {
  min-height: 114px;
  padding: 15px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 3px 10px rgba(15, 23, 42, 0.055),
    0 12px 24px rgba(15, 23, 42, 0.075);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.pet-dashboard-family-panel--clickable {
  cursor: pointer;
}

.pet-dashboard-family-panel--clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(85, 53, 141, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 5px 16px rgba(15, 23, 42, 0.08),
    0 18px 34px rgba(15, 23, 42, 0.11);
}

.pet-dashboard-family-panel--clickable:active {
  transform: scale(0.985);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 2px 8px rgba(15, 23, 42, 0.06);
}

.pet-dashboard-family-panel--clickable:focus {
  outline: 2px solid var(--purple, #3F5A3A);
  outline-offset: 2px;
}

.pet-dashboard-family-panel--clickable:focus:not(:focus-visible) {
  outline: none;
}

.pet-dashboard-family-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pet-dashboard-family-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pet-dashboard-family-panel-icon {
  font-size: 1rem;
  line-height: 1;
}

.pet-dashboard-family-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}

.pet-dashboard-family-panel-chevron {
  color: #94a3b8;
  font-size: 1.06rem;
  line-height: 1;
}

.pet-dashboard-family-panel-main {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 600;
  color: #1f2937;
}

.pet-dashboard-family-panel-meta {
  margin-top: 5px;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #64748b;
}

.pet-dashboard-family-empty {
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: none;
}

.pet-dashboard-family-empty-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.pet-dashboard-family-empty-copy {
  margin-top: 4px;
  font-size: 0.79rem;
  color: #64748b;
}
/* ==========================================================================
   HorseHub+ Styles
   Sections
   --------------------------------------------------------------------------
   1. CSS variables & base
   2. Layout & typography
   3. Shared cards & buttons
   4. Forms
   5. Home tab
   6. Pets tab
   7. Vets tab
   8. Insurance tab
   9. Calendar tab
  10. AI tab
  11. Shop tab
  12. Bottom navigation
  13. Responsive/mobile tweaks
   ========================================================================== */

/* style.css extracted from index.html */

:root {
  --purple: #3F5A3A;
  --purple-soft: #AEBEAA;
  --bg-home: #F0F3EE;
  --bg-pets: #fef6e7;
  --bg-vets: #e9f7ff;
  --bg-insurance: #f4f8ff;
  --bg-calendar: #f4fff7;
  --bg-ai: #f7f3ff;
  --bg-shop: #fff7f5;
  --bg-tags: #f4fff7;
  --card-bg: #ffffff;
  --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.10);
  --muted: #6b7280;
  --danger: #b33939;
}

* {
  box-sizing: border-box;
}

/* iOS WKWebView: reliable tap/click on buttons and interactive elements */
button,
.btn,
.tab-btn,
a[href],
[data-section-link],
.card-header-row button,
.pet-list-header button,
.form-actions button,
.ai-send-btn,
#newLicenceBtn,
#newTravelBtn,
#newShopBtn,
#newAiChatBtn,
#newReminderBtn,
#newVetBtn,
#newPetBtn {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Guideline 4.0: scroll-margin so focused input stays visible above keyboard when scrollIntoView runs */
input,
textarea,
select {
  scroll-margin-top: 16px;
  scroll-margin-bottom: 120px;
}

body.standalone-safe-area {
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg-home);
  color: #111827;
  /* iOS safe areas: ensure content is never drawn under notch/Dynamic Island or home indicator */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.section-home {
  background: var(--bg-home);
}
body.section-pet-dashboard {
  background: var(--bg-home);
}
body.section-pets {
  background: var(--bg-pets);
}
body.section-vets {
  background: var(--bg-vets);
}
body.section-insurance {
  background: var(--bg-insurance);
}
body.section-travel {
  background: #e0f7f5;
}
body.section-licence {
  background: #E8EDE5;
}
body.section-treatments {
  background: #E8EDE5;
}
body.section-calendar {
  background: var(--bg-calendar);
}
body.section-ai {
  background: var(--bg-ai);
}
body.section-shop {
  background: var(--bg-shop);
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* iOS: use dynamic viewport so content fits visible area */
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 0; /* new */
}

/* Paw watermark in the background for the whole app */
.app-shell::before {
  content: "";
  position: absolute;              /* was fixed */
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 420px 420px;
  opacity: 1.18;                   /* keep / tweak as you like */
  pointer-events: none;
  z-index: -1;                     /* sit behind all app-shell content */
}

body.section-insurance .app-shell::before,
body.section-licence .app-shell::before {
  background-size: 240px 240px;
  background-position: right 32px bottom 150px;
  opacity: 0.12;
}


header.app-header {
  margin: 12px 16px 8px 16px;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #5C7A53 0%, #1A2918 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  color: white;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.app-title-icon {
  display: inline-block;
  width: 29px;
  height: 29px;
  margin-right: 2px;
  background: url("Horse_logo_Transparent_Green.png") no-repeat center center;
  background-size: contain;
}


.app-title h1,
.app-logo-btn {
  margin: 0;
  font-size: 1.9rem;
}

.app-logo-btn {
  background: none;
  border: none;
  padding: 0;
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-logo-btn:focus {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 3px;
}

.app-subtitle {
  font-size: 0.9rem;
  opacity: 0.85;
}

main {
  flex: 1;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  /* Extra bottom padding so content doesn't sit flush when scrolled – safe area for home indicator / nav bar */
}

h2.section-title {
  margin: 6px 0 10px;
  font-size: 1.25rem;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 8px;
}

h2.section-title span.label-pill {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(55, 35, 69, 0.1);
  color: var(--purple);
}

p.muted,
small.muted {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 10px;
  background: rgba(55, 35, 69, 0.06);
  color: #374151;
  font-size: 0.8rem;
}

.pill strong {
  font-weight: 600;
}

/* Make FullCalendar title smaller and cleaner */
.fc .fc-toolbar-title {
  font-size: 1rem !important;
  font-weight: 600;
  color: #3F5A3A;
}

/* Calendar: one consistent font size for toolbar (today, month/week/day, date) */
#section-calendar .fc .fc-toolbar-title,
#section-calendar .fc .fc-button {
  font-size: 0.95rem !important;
}

/* FullCalendar: mobile header containment + wrap (fixes Fri/Sat spilling/merging in week/day views) */
@media (max-width: 520px) {
  /* Make the header grid fixed so each day column keeps its own width */
  .fc .fc-scrollgrid-section-header table,
  .fc .fc-timegrid-header table {
    table-layout: fixed !important;
  }

  /* Stop header text from painting into neighbouring columns */
  .fc .fc-col-header-cell {
    overflow: hidden !important;
  }

  /* Allow "Tue 2/10" to wrap on two lines only when very narrow */
  .fc .fc-col-header-cell-cushion {
    display: block !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    text-align: center !important;
    padding: 4px 2px !important;
    font-size: 0.8rem !important;
  }
}


/* Optional: slightly tighten up toolbar spacing */
.fc .fc-toolbar {
  margin-bottom: 0.4rem;
}

/* Prev/next arrows + today: stacked vertically, one above the other */
#section-calendar .fc .fc-toolbar-chunk:first-child {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 4px !important;
}
#section-calendar .fc .fc-prev-button,
#section-calendar .fc .fc-next-button {
  padding: 3px 6px !important;
  min-width: 26px !important;
}
#section-calendar .fc .fc-prev-button .fc-icon,
#section-calendar .fc .fc-next-button .fc-icon {
  font-size: 0.9em !important;
}
#section-calendar .fc .fc-today-button {
  padding: 4px 10px !important;
  line-height: 1.25 !important;
  margin-left: 0 !important;
  align-self: flex-start !important;
}

/* Fix header actions & Home button layout */
.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

/* Plan chip (free / premium) — subtle, not loud */
.header-plan-label {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 168px;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}
.header-plan-label:hover:not(.header-plan-label--premium) {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}
.header-plan-label:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}
.header-plan-label--premium {
  cursor: default;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.9);
}
.header-plan-label--limit:not(.header-plan-label--premium) {
  color: rgba(255, 237, 200, 0.92);
}

.header-plan-label-wrap {
  flex: 0 0 auto;
  max-width: 240px;
}
.header-plan-label-limit-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.25;
}
.header-plan-label-limit-row[hidden] {
  display: none !important;
}
.header-plan-label-wrap--limit .header-plan-label-limit-text {
  color: rgba(255, 237, 200, 0.95);
}
.header-plan-label-sep {
  color: rgba(255, 255, 255, 0.42);
  user-select: none;
}
.header-plan-label-upgrade {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 1px 4px;
  margin: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
  border-radius: 4px;
}
.header-plan-label-upgrade:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.header-plan-label-upgrade:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.header-home-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 0.8rem !important;
  padding: 3px 10px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  flex: 0 0 auto !important;
  max-width: 120px !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-home-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.header-home-btn.active {
  background: #f9fafb;
  color: #111827;
}
/* ---------- Shared card style (Pets/Vets/Insurance/Calendar/AI/Shop) ---------- */
.card,
.pet-card,
.vet-card,
.insurance-card,
.calendar-card,
.ai-card,
.shop-card,
.home-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 18px;
  transition: transform 0.14s ease, box-shadow 0.14s ease,
    background 0.15s ease;
  overflow-x: hidden; /* keep content inside card on all devices */
  min-width: 0; /* allow flex/grid children to shrink */
}

.card:hover,
.pet-card:hover,
.vet-card:hover,
.insurance-card:hover,
.calendar-card:hover,
.ai-card:hover,
.shop-card:hover,
.home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.25);
}

.card:active,
.pet-card:active,
.vet-card:active,
.insurance-card:active,
.calendar-card:active,
.ai-card:active,
.shop-card:active,
.home-card:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}



/* Column helpers */
.col-12 { grid-column: span 12; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

/* Larger, clearer inputs/selects */


/* Make the Pet selector feel like a primary control */
#tagPetSelect {
  min-width: 220px;
}

.postage-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(16, 185, 129, 0.12);
}

.postage-pill-label {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.9);
}

.postage-pill-value {
  font-weight: 700;
}


/* Pricing note */
.pricing-box {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.55);
}

.pricing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  font-weight: 700;
  font-size: 13px;
}

.price-badge strong {
  font-weight: 900;
}

.price-badge.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35);
}

.pricing-sub {
  margin-top: 8px;
  color: rgba(15, 23, 42, 0.75);
  font-size: 12.5px;
  font-weight: 600;
}



@media (max-width: 900px) {
  .col-6, .col-4 { grid-column: span 12; }
}

/* ---------- Insurance policy cards (click anywhere to open) ---------- */
.policy-card {
  cursor: pointer;
}

.policy-card:focus {
  outline: 3px solid rgba(92, 122, 83, 0.35);
  outline-offset: 3px;
}

.policy-card-chevron {
  font-size: 24px;
  line-height: 1;
  opacity: 0.55;
  padding-left: 10px;
  user-select: none;
}

/* Paperclip indicator on list cards that have documents attached (Licence, Travel, Insurance) */
.card-doc-indicator {
  font-size: 0.75rem;
  font-weight: normal;
  margin-left: 2px;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Title block can shrink so the button stays visible; button must not shrink */
.card-header-row > div:first-child {
  min-width: 0;
}
.card-header-row .btn,
.card-header-row button {
  flex-shrink: 0;
}

.card-title-main {
  font-weight: 600;
  margin-bottom: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-subline {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Subscription paywall: show full description, don't cut off mid-word */
.card-subline-wrap {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* Subscription option buttons: term and price only */
.subscription-option-btn {
  text-align: left;
  padding: 10px 14px;
}
.subscription-option-btn .subscription-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* -------- Family sharing page -------- */

.bullet-list {
  margin: 0;
  padding-left: 1.1rem;
}

.bullet-list li {
  margin-bottom: 2px;
}

/* Family invite / join card */
.family-card {
  margin-top: 16px;
}

.family-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.family-code-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.family-premium-chip {
  font-size: 0.72rem;
  color: #6b7280;
}

.family-invite-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(8px);
  background: #111827;
  color: #fff;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10050;
}

.family-invite-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.family-code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.family-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-top: 2px;
}

.family-code-placeholder {
  color: #9ca3af;
}

.join-family-form {
  margin-top: 6px;
}

.join-family-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  min-width: 0; /* Allow flex container to shrink */
}

.join-family-row input {
  flex: 1;
  min-width: 0; /* Allow input to shrink below content size */
}

.join-family-row button {
  flex-shrink: 0; /* Prevent button from shrinking */
  white-space: nowrap; /* Keep button text on one line */
}

.btn-text {
  transition: transform 0.12s ease, background 0.12s ease;
  background: none;
  border: none;
  padding: 0;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--purple);
  cursor: pointer;
  text-decoration: underline;
}


/* ---------- Buttons ---------- */

button,
.btn {
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: break-word;
  text-align: center;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
  transition: background 0.14s ease, transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 10px 24px rgba(55, 35, 69, 0.35);
}
.btn-primary:hover {
  background: #2d1b3b;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(55, 35, 69, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(55, 35, 69, 0.3);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  transition: background 0.14s ease, transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
}
.btn-secondary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}
.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn-small {
  transition: transform 0.12s ease, background 0.12s ease;
  font-size: 0.78rem;
  padding: 4px 10px;
}

.btn-ghost {
  transition: transform 0.12s ease, background 0.12s ease;
  background: transparent;
  color: #374151;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  background: #E8EDE5;
  color: #4338ca;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

/* ---------- Home layout ---------- */
#section-home {
  display: block;
}

.home-overview-hero {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.94) 0%, rgba(249, 250, 251, 0.88) 100%);
  border-radius: 20px;
  padding: 14px 16px 12px;
  margin-bottom: 12px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

#section-home .home-overview-hero h2.section-title {
  margin-top: 0;
  margin-bottom: 6px;
}

#section-home .home-overview-hero > p.muted {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.pet-selector-home-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pet-selector-panel {
  background: linear-gradient(160deg, rgba(232, 237, 229, 0.95) 0%, rgba(240, 243, 238, 0.98) 52%, #ffffff 100%);
  border-radius: 20px;
  border: 1px solid rgba(63, 90, 58, 0.2);
  box-shadow: 0 14px 34px rgba(63, 90, 58, 0.14);
}

.pet-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pet-selector-title {
  margin: 0;
  color: #1F3919;
  font-size: 1.05rem;
}

.pet-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.pet-selector-card {
  border: 1px solid rgba(38, 20, 68, 0.16);
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pet-selector-card:hover {
  border-color: rgba(85, 53, 141, 0.35);
  box-shadow: 0 4px 14px rgba(38, 20, 68, 0.08);
  transform: translateY(-1px);
}

.pet-selector-card:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.pet-selector-card:focus-visible {
  outline: 2px solid #3F5A3A;
  outline-offset: 2px;
}

.pet-selector-card.is-selected {
  border-color: #3F5A3A;
  background: linear-gradient(145deg, #F5F7F2 0%, #ffffff 100%);
  box-shadow:
    0 0 0 2px rgba(85, 53, 141, 0.28),
    0 8px 22px rgba(85, 53, 141, 0.14);
}

.pet-selector-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: #E8EDE5;
  color: #2D4527;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.pet-selector-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-selector-name {
  font-weight: 700;
  color: #1f2937;
}

.pet-selector-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pet-selector-missing-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.64rem;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  border: 1px solid rgba(127, 29, 29, 0.42);
  box-shadow: 0 3px 10px rgba(185, 28, 28, 0.24);
}

.pet-selector-missing-warning {
  margin-top: 4px;
  font-size: 0.74rem;
  line-height: 1.35;
  font-weight: 700;
  color: #9a3412;
}

.pet-selector-card-missing {
  border-color: rgba(220, 38, 38, 0.45);
  background: linear-gradient(148deg, #fff1f2 0%, #fff7ed 65%, #ffffff 100%);
  box-shadow:
    0 0 0 2px rgba(249, 115, 22, 0.16),
    0 10px 24px rgba(185, 28, 28, 0.1);
}

.pet-selector-card-missing:hover {
  border-color: rgba(220, 38, 38, 0.65);
  box-shadow:
    0 0 0 2px rgba(249, 115, 22, 0.22),
    0 12px 26px rgba(185, 28, 28, 0.16);
}

.pet-selector-summary {
  margin-top: 2px;
  font-size: 0.78rem;
  color: #6b7280;
}

/* ---------- Pet dashboard (scoped: do not affect Home grid cards) ---------- */
#section-pet-dashboard .pet-dashboard-back-wrap {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#section-pet-dashboard .pet-dashboard-back-to-pets-btn {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(38, 20, 68, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f8f7fc 100%);
  color: #1F3919;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 8px rgba(38, 20, 68, 0.08);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

#section-pet-dashboard .pet-dashboard-back-to-pets-btn:hover {
  border-color: rgba(85, 53, 141, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 6px 18px rgba(38, 20, 68, 0.12);
}

#section-pet-dashboard .pet-dashboard-back-to-pets-btn:active {
  transform: scale(0.98);
}

#section-pet-dashboard .pet-dashboard-shell {
  background: linear-gradient(180deg, #F5F7F2 0%, #F8FAF5 42%, #fffdf8 100%);
  border: 1px solid rgba(38, 20, 68, 0.1);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 18px 42px rgba(38, 20, 68, 0.085);
}

#section-pet-dashboard .pet-dashboard-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 20px;
  row-gap: 24px;
  padding: 18px 18px 20px;
  margin: 0 0 4px;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(232, 237, 229, 0.95) 0%, rgba(220, 227, 216, 0.9) 100%);
  border: 1px solid rgba(38, 20, 68, 0.08);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

#section-pet-dashboard .pet-dashboard-hero-photo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(145deg, #E8EDE5, #F0F3EE);
  color: #2D4527;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow:
    0 2px 6px rgba(38, 20, 68, 0.06),
    0 8px 22px rgba(85, 53, 141, 0.12);
  border: 1px solid rgba(85, 53, 141, 0.14);
}

#section-pet-dashboard .pet-dashboard-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#section-pet-dashboard .pet-dashboard-hero-main {
  min-width: 0;
  padding-top: 2px;
}

#section-pet-dashboard .pet-dashboard-hero-name {
  margin: 0;
  color: #13081f;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

#section-pet-dashboard .pet-dashboard-hero-status {
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: #475569;
}

#section-pet-dashboard .pet-dashboard-hero-status:empty {
  display: none;
}

#section-pet-dashboard .pet-dashboard-missing-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1.1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  border: 1px solid rgba(127, 29, 29, 0.4);
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.28);
}

/* [hidden] must win: the rule above sets display:inline-flex and would otherwise keep the badge visible. */
#section-pet-dashboard .pet-dashboard-missing-badge[hidden] {
  display: none !important;
}

#section-pet-dashboard p.pet-dashboard-hero-status.muted:not(:empty) {
  display: inline-block;
  max-width: 100%;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  background: linear-gradient(180deg, #f1f5f9 0%, #e8eef5 100%);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#section-pet-dashboard .pet-dashboard-hero-name,
#section-pet-dashboard .pet-dashboard-hero-status {
  max-width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}










#section-pet-dashboard .pet-dashboard-shell-missing {
  border-color: rgba(127, 29, 29, 0.34);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 18px 42px rgba(127, 29, 29, 0.11);
}

#section-pet-dashboard .pet-dashboard-shell-missing .pet-dashboard-hero {
  border-color: rgba(127, 29, 29, 0.24);
  background: linear-gradient(165deg, rgba(255, 245, 245, 0.97) 0%, rgba(255, 251, 235, 0.93) 100%);
}

#section-pet-dashboard .pet-dashboard-shell-missing .pet-dashboard-hero-photo {
  border-color: rgba(220, 38, 38, 0.4);
  background: linear-gradient(145deg, #ffe4e6, #ffedd5);
  color: #991b1b;
}

#section-pet-dashboard .pet-dashboard-shell-missing p.pet-dashboard-hero-status.muted:not(:empty) {
  color: #7f1d1d;
  background: linear-gradient(180deg, #ffe4e6 0%, #fff1f2 100%);
  border-color: rgba(220, 38, 38, 0.38);
}




@media (max-width: 640px) {
  #section-pet-dashboard .pet-dashboard-hero {
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 16px;
    padding: 14px 14px 16px;
  }

  #section-pet-dashboard .pet-dashboard-hero-photo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  #section-pet-dashboard .pet-dashboard-hero-main {
    min-width: 0;
  }

  #section-pet-dashboard .pet-dashboard-hero-name {
    font-size: 1.1rem;
    line-height: 1.2;
  }

  #section-pet-dashboard p.pet-dashboard-hero-status.muted:not(:empty) {
    display: block;
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }


}

#section-pet-dashboard .pet-dashboard-group:not(.pet-dashboard-group-secondary) {
  margin-top: 30px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(85, 53, 141, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#section-pet-dashboard .pet-dashboard-group:nth-of-type(1) {
  background: linear-gradient(180deg, rgba(220, 227, 216, 0.9) 0%, rgba(246, 238, 255, 0.78) 100%);
}

#section-pet-dashboard .pet-dashboard-group:nth-of-type(2) {
  background: linear-gradient(180deg, rgba(220, 232, 215, 0.94) 0%, rgba(233, 243, 255, 0.82) 100%);
}

#section-pet-dashboard .pet-dashboard-group:nth-of-type(3) {
  background: linear-gradient(180deg, rgba(255, 232, 206, 0.94) 0%, rgba(255, 245, 228, 0.84) 100%);
}

#section-pet-dashboard .pet-dashboard-group + .pet-dashboard-group {
  margin-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

#section-pet-dashboard .pet-dashboard-group-title {
  margin: 0 0 14px;
  padding-bottom: 8px;
  color: #2e2450;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  border-bottom: 1px solid rgba(85, 53, 141, 0.16);
}

#section-pet-dashboard .pet-dashboard-grid {
  display: grid;
  gap: 14px;
}

#section-pet-dashboard .pet-dashboard-grid-primary {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Small phone portrait: keep a denser grid (existing compact look). */
@media (max-width: 480px) and (orientation: portrait) {
  #section-pet-dashboard .pet-dashboard-grid-primary {
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  }
}

/* Phone landscape / small tablets: wider tracks so titles + icon column do not collide. */
@media (orientation: landscape) and (min-width: 480px) {
  #section-pet-dashboard .pet-dashboard-grid-primary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Tablet and up: comfortable columns for long Pet care titles. */
@media (min-width: 768px) {
  #section-pet-dashboard .pet-dashboard-grid-primary {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme] {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.065);
  border-radius: 16px;
  padding: 14px 16px 14px 16px;
  margin-bottom: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 4px 12px rgba(15, 23, 42, 0.07),
    0 14px 28px rgba(38, 20, 68, 0.095);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease,
    filter 0.14s ease;
  min-height: 102px;
  min-width: 0;
  position: relative;
  text-align: left;
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme]:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 7px 18px rgba(15, 23, 42, 0.095),
    0 20px 38px rgba(38, 20, 68, 0.13);
  border-color: rgba(85, 53, 141, 0.22);
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme]:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 1px 5px rgba(15, 23, 42, 0.07);
  filter: brightness(0.99);
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  column-gap: 10px;
  align-items: start;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card-title-wrap {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card-title {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card-subtitle {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 0.76rem;
  line-height: 1.22;
  font-weight: 500;
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Room for two subtitle lines on larger cards; ellipsis still applies when clamped. */
@media (min-width: 600px) {
  #section-pet-dashboard .pet-dashboard-grid-primary .home-card-subtitle {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme] .home-card-icon {
  grid-column: 2;
  grid-row: 1;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  box-sizing: border-box;
  justify-self: end;
  align-self: start;
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.08));
  opacity: 1;
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card-prem-badge:not([hidden]) {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 8px;
  justify-self: start;
  max-width: 100%;
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="pets"] {
  border-left: 3px solid #f59e0b;
}
#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="vets"] {
  border-left: 3px solid #38bdf8;
}
#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="calendar"] {
  border-left: 3px solid #fb7185;
}
#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="treatments"] {
  border-left: 3px solid #a78bfa;
}
#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="travel"] {
  border-left: 3px solid #2dd4bf;
}
#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="licence"] {
  border-left: 3px solid #7A8471;
}
#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="insurance"] {
  border-left: 3px solid #4ade80;
}

#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="treatments"]::before {
  opacity: 0.05;
}

#section-pet-dashboard .pet-dashboard-group-secondary {
  margin-top: 34px;
  padding: 24px 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(22, 163, 74, 0.26);
  border-top: 1px solid rgba(22, 163, 74, 0.34);
  background: linear-gradient(180deg, rgba(232, 250, 239, 0.96) 0%, rgba(244, 253, 247, 0.88) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 12px 28px rgba(21, 128, 61, 0.1);
}

#section-pet-dashboard .pet-dashboard-group-secondary .pet-dashboard-group-title {
  margin: 0 0 16px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #14532d;
  border-bottom: 1px solid rgba(22, 163, 74, 0.22);
}

#section-pet-dashboard .pet-dashboard-grid-secondary {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
}

@media (max-width: 480px) and (orientation: portrait) {
  #section-pet-dashboard .pet-dashboard-grid-secondary {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
}

@media (orientation: landscape) and (min-width: 480px) {
  #section-pet-dashboard .pet-dashboard-grid-secondary {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme] {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.065);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 0;
  min-width: 0;
  position: relative;
  min-height: 116px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 4px 12px rgba(15, 23, 42, 0.07),
    0 14px 28px rgba(38, 20, 68, 0.095);
  transition:
    transform 0.14s ease,
    background 0.12s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    filter 0.14s ease;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme]:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: rgba(85, 53, 141, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 7px 18px rgba(15, 23, 42, 0.095),
    0 20px 38px rgba(38, 20, 68, 0.13);
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme]:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 1px 5px rgba(15, 23, 42, 0.07);
  filter: brightness(0.99);
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="ai"] {
  border: 1.5px solid rgba(92, 122, 83, 0.34);
  background: linear-gradient(140deg, #fdfbff 0%, #f7f1ff 62%, #f2e9ff 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 6px 16px rgba(15, 23, 42, 0.09),
    0 18px 34px rgba(63, 90, 58, 0.14);
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="ai"]:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 8px 20px rgba(15, 23, 42, 0.11),
    0 22px 40px rgba(63, 90, 58, 0.17);
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="ai"]:active {
  transform: translateY(0) scale(0.98);
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="ai"] .home-card-title {
  font-weight: 800;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="ai"] .home-card-subtitle {
  color: #433862;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="ai"] .home-card-icon {
  filter: drop-shadow(0 1px 2px rgba(63, 90, 58, 0.28));
  opacity: 1;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="guide"]::before {
  opacity: 0.06;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  column-gap: 10px;
  align-items: start;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card-title {
  font-size: 0.9rem;
  line-height: 1.25;
  font-weight: 700;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card-icon {
  grid-column: 2;
  grid-row: 1;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  box-sizing: border-box;
  justify-self: end;
  align-self: start;
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.08));
  opacity: 1;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card-title-wrap {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card-subtitle {
  font-size: 0.72rem;
  line-height: 1.28;
  font-weight: 550;
  color: #4b5563;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#section-pet-dashboard .pet-dashboard-grid-secondary .home-card[data-theme="places"] .home-card-title {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  font-size: 0.84rem;
  line-height: 1.2;
}

.pet-dashboard-card {
  width: 100%;
  margin-bottom: 0;
}

.home-card {
  cursor: pointer;
  border-color: rgba(15, 23, 42, 0.1);
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

/* Home: Premium upsell — same metrics as other cards; soft gold (distinct from Pets / Shop peach) */
#section-home .home-grid > .home-card.home-card-premium-upsell[data-theme="premium-upsell"] {
  cursor: default;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 18px;
  /* !important: wins over shared .home-card #fff (see web/netlify.toml + horsehub-asset-version) */
  background: linear-gradient(135deg, #d4bc88, #faf3e3) !important;
}

#section-home .home-card-premium-upsell .home-card-title {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
}

.home-card-premium-upsell .home-premium-upsell-meta {
  margin: 0 0 6px;
  font-size: 0.68rem;
  line-height: 1.3;
  font-weight: 400;
  color: #5c4f3a;
}

.home-card-premium-upsell .home-premium-upsell-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 0;
}

.home-card-premium-upsell .home-premium-upsell-cta {
  font-size: 0.72rem;
  padding: 4px 11px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(45, 28, 58, 0.35);
  flex: 0 0 auto;
}

.home-card-premium-upsell .home-premium-upsell-why {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.65rem;
  font-weight: 500;
  color: #6b5220;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font-family: inherit;
  flex: 0 0 auto;
}

.home-card-premium-upsell[hidden] {
  display: none !important;
}

.home-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
  margin-bottom: 8px;
}

.home-card-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: rgba(15, 23, 42, 0.06);
  justify-self: end;
}

#section-home .home-card[data-theme="pets"] .home-card-icon { background: rgba(105, 138, 96, 0.14); }
#section-home .home-card[data-theme="vets"] .home-card-icon { background: rgba(37, 99, 235, 0.14); }
#section-home .home-card[data-theme="calendar"] .home-card-icon { background: rgba(5, 150, 105, 0.14); }
#section-home .home-card[data-theme="treatments"] .home-card-icon { background: rgba(92, 122, 83, 0.14); }
#section-home .home-card[data-theme="travel"] .home-card-icon { background: rgba(14, 116, 144, 0.14); }
#section-home .home-card[data-theme="licence"] .home-card-icon { background: rgba(63, 90, 58, 0.14); }
#section-home .home-card[data-theme="insurance"] .home-card-icon { background: rgba(59, 130, 246, 0.14); }
#section-home .home-card[data-theme="ai"] .home-card-icon { background: rgba(139, 167, 130, 0.14); }
#section-home .home-card[data-theme="shop"] .home-card-icon { background: rgba(249, 115, 22, 0.14); }
#section-home .home-card[data-theme="tags"] .home-card-icon { background: rgba(16, 185, 129, 0.14); }

/* Home: free-tier usage lines (paired with inline styles in index.html) */
.home-card-limited-free .home-card-header {
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 2px;
}
.home-card-limited-free .home-card-title {
  order: 1;
  flex: 1 1 auto;
}
.home-card-limited-free .home-card-icon {
  order: 2;
  margin-left: auto;
}
.home-card-free-status-stack {
  grid-column: 1 / -1;
  flex: 1 1 100%;
  order: 3;
  margin-top: 2px;
}
.home-card-free-status {
  display: block;
  font-size: 0.65rem;
  line-height: 1.25;
  font-weight: 500;
  color: #6b7280;
}
.home-card-free-status-action {
  display: block;
  margin-top: 3px;
  font-size: 0.62rem;
  line-height: 1.25;
  font-weight: 500;
  color: #64748b;
}
.home-card-free-status.home-card-free-status--limit {
  color: #9a3412;
  font-weight: 600;
}
.home-card-free-status-action.home-card-free-status-action--limit {
  color: #9a3412;
  font-weight: 600;
}
.home-card-free-status-action.home-card-free-status-action--calendar-upgrade {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--horsehub-purple, #3F5A3A);
  margin-top: 4px;
}

.home-pets-family-share-prompt {
  margin-top: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.62rem;
  line-height: 1.25;
  font-weight: 500;
  color: #64748b;
  opacity: 0.95;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.home-card.home-card-calendar-limit-reached {
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.45);
  border-radius: inherit;
}

/* NEW: Vet quick actions */
.home-quick-actions {
  margin-top: 6px;
  display: none; /* shown when at least one quick action exists */
}

.home-quick-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.home-quick-actions-meta {
  font-size: 0.8rem;
}

/* Premium: document uploads (insurance, travel, licence, treatment attachments) */
.horsehub-doc-upload-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.horsehub-doc-upload-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3F5A3A;
  background: rgba(63, 90, 58, 0.1);
  border: 1px solid rgba(63, 90, 58, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.horsehub-doc-upload-hint {
  display: block;
  margin: 4px 0 2px;
  font-size: 0.78rem;
}
.horsehub-doc-upload-wrap--premium .horsehub-doc-upload-badge,
.horsehub-doc-upload-wrap--premium .horsehub-doc-upload-hint {
  display: none;
}

/* Home: Pets onboarding checklist (Supabase-driven) — inline in card, no inner panel */
.home-pets-onboarding {
  margin: 8px 0 10px;
  padding: 0;
  margin-inline-start: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
}
.home-pets-onboarding-progress {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #334155;
  margin: 0 0 10px;
  padding: 7px 11px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  line-height: 1.35;
  text-indent: 0;
  background: rgba(255, 255, 255, 0.7);
  box-sizing: border-box;
}
.home-pets-onboarding-start-cue {
  margin: 0 0 6px;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(110, 55, 16, 0.88);
  line-height: 1.3;
}
.home-pets-onboarding-warning {
  font-size: 0.78rem;
  font-weight: 500;
  color: #92400e;
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.35;
  text-indent: 0;
}
.home-pets-onboarding-list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-inline-start: 0;
  margin-inline-start: 0;
}
.home-pets-onboarding-list > li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-pets-onboarding-list > li + li {
  margin-top: 2px;
}
.home-pets-onboarding-item-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.home-pets-onboarding-tag-dismiss {
  margin: 0;
  padding: 2px 0 5px;
  padding-inline-start: calc(1.15rem + 8px);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: rgba(120, 65, 20, 0.1);
  touch-action: manipulation;
}
.home-pets-onboarding-tag-dismiss:hover {
  color: #475569;
}
.home-pets-onboarding-tag-dismiss:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(180, 100, 30, 0.35);
  border-radius: 4px;
}
.home-pets-onboarding-item {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
  margin: 0;
  padding: 5px 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  color: #4b5563;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
  border: 0;
  background: transparent;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(120, 65, 20, 0.12);
  touch-action: manipulation;
}
.home-card[data-theme="pets"] .home-pets-onboarding-item:hover {
  background: rgba(120, 65, 20, 0.07);
}
.home-card[data-theme="pets"] .home-pets-onboarding-item:active {
  background: rgba(120, 65, 20, 0.12);
}
.home-pets-onboarding-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(180, 100, 30, 0.35);
}
.home-pets-onboarding-icon {
  display: block;
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: center;
  opacity: 0.95;
}
.home-pets-onboarding-label {
  min-width: 0;
}
.home-pets-onboarding-item--done {
  color: #166534;
}
.home-pets-onboarding-item--done .home-pets-onboarding-label {
  font-weight: 400;
  color: #15803d;
}
.home-pets-onboarding-item:not(.home-pets-onboarding-item--done) .home-pets-onboarding-label {
  color: #374151;
}
.home-pets-onboarding-item--primary {
  padding-top: 8px;
  padding-bottom: 8px;
}
.home-pets-onboarding-item--primary .home-pets-onboarding-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: #111827;
  letter-spacing: -0.02em;
}
.home-pets-onboarding-item--primary .home-pets-onboarding-icon {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(110, 55, 16, 0.9);
  opacity: 1;
}
.home-pets-onboarding-item--secondary:not(.home-pets-onboarding-item--done) {
  font-size: 0.8rem;
  padding-top: 4px;
  padding-bottom: 4px;
  opacity: 0.94;
}
.home-pets-onboarding-item--secondary:not(.home-pets-onboarding-item--done) .home-pets-onboarding-label {
  font-weight: 500;
  color: #6b7280;
}
.home-pets-onboarding-item--secondary:not(.home-pets-onboarding-item--done) .home-pets-onboarding-icon {
  opacity: 0.75;
}
.home-pets-onboarding-complete {
  text-align: left;
}
.home-pets-onboarding-complete-msg {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #166534;
  line-height: 1.4;
}
.home-pets-onboarding-manage {
  margin-top: 2px;
}
.home-pets-card-tagline {
  margin-top: 8px;
  font-size: 0.82rem;
  opacity: 0.88;
}

/* Family members: owner-managed items are hidden; keep note unobtrusive */
.home-pets-onboarding-member-note {
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1.38;
  font-weight: 400;
  color: var(--muted, #6b7280);
  opacity: 0.88;
}

/* ---------- Layouts: split list/detail ---------- */
.split-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.9fr);
  gap: 14px;
}

/* When a section switches to single-record detail mode, use full-width canvas. */
#section-treatments.treatment-detail-active .split-layout,
#section-travel.travel-detail-active .split-layout,
#section-licence.licence-detail-active .split-layout,
#section-pets.pets-detail-active .split-layout {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 840px) {
  .split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Calendar: more Outlook-style proportions (narrow sidebar, wide calendar) */
#section-calendar .split-layout {
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 2.1fr);
  align-items: flex-start;
}

@media (max-width: 840px) {
  #section-calendar .split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel {
  border-radius: 18px;
  padding: 12px 12px;
}



/* Home card themes (use data-theme so order doesn't matter) */
@media (prefers-reduced-motion: no-preference) {
}
@media (prefers-reduced-motion: reduce) {
}





/* display:flex must not override the HTML hidden attribute (otherwise banner stays visible in safe state) */
.home-pets-missing-indicator {
  font-size: 0.82rem;
  color: #8b3a3a;
  margin-top: 4px;
  margin-bottom: 4px;
  font-weight: 500;
}
.home-card[data-theme="pets"] {
  background: linear-gradient(135deg, #ffc470, #fff3dd);
}

/* Home Overview: Pets card reads as the primary entry point (subtle lift vs other cards) */
#section-home .home-grid > .home-card[data-theme="pets"] {
  box-shadow:
    0 0 0 1px rgba(160, 88, 28, 0.14),
    0 22px 50px rgba(15, 23, 42, 0.21),
    0 7px 16px rgba(15, 23, 42, 0.11);
  border-color: rgba(150, 82, 24, 0.22);
}
#section-home .home-grid > .home-card[data-theme="pets"]:hover {
  box-shadow:
    0 0 0 1px rgba(160, 88, 28, 0.2),
    0 24px 56px rgba(15, 23, 42, 0.28),
    0 10px 22px rgba(15, 23, 42, 0.14);
}
#section-home .home-grid > .home-card[data-theme="pets"]:active {
  box-shadow:
    0 0 0 1px rgba(160, 88, 28, 0.16),
    0 12px 28px rgba(15, 23, 42, 0.18),
    0 5px 12px rgba(15, 23, 42, 0.1);
}
.home-card[data-theme="vets"] {
  background: linear-gradient(135deg, #9fe0ff, #e9f8ff);
}
.home-card[data-theme="insurance"] {
  background: linear-gradient(135deg, #b7f0c1, #eaffee);
}

/* Premium-only home cards: keep only real badge under title (no generated duplicate text). */
#section-home .home-card-premium-only.home-card-premium-locked .home-card-header::after,
#section-home .home-card-premium-only.home-card-premium-locked .home-card-title::after {
  content: none !important;
  display: none !important;
}

#section-home .home-card-premium-only.home-card-premium-locked .home-card-prem-badge {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

#section-home .home-card-premium-only.home-card-premium-locked .home-card-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}
.home-card[data-theme="treatments"] {
  background: linear-gradient(135deg, #C9D5C5, #DCE3D8);
  position: relative;
}
.home-card[data-theme="treatments"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
  opacity: 0.12;
  pointer-events: none;
}
.home-card[data-theme="travel"] {
  background: linear-gradient(135deg, #4fd1c7, #e0f7f5);
}
.home-card[data-theme="licence"] {
  background: linear-gradient(135deg, #7A8471, #E8EDE5);
}
.home-card[data-theme="calendar"] {
  background: linear-gradient(135deg, #ffbac4, #ffecef);
}
.home-card[data-theme="ai"] {
  background: linear-gradient(135deg, #D4C9B5, #F5F2E8);
}
.home-card[data-theme="shop"] {
  background: linear-gradient(135deg, #ffd3a1, #fff2e2);
}
.home-card[data-theme="tags"] {
  background: linear-gradient(135deg, #a4f3d5, #e4fff1);
}
.home-card[data-theme="places"] {
  background: linear-gradient(135deg, #b9d1ff, #eef3ff);
}
/* Premium upsell: soft gold / warm amber (fallback if not under #section-home grid) */
.home-card[data-theme="premium-upsell"] {
  background: linear-gradient(135deg, #d4bc88, #faf3e3) !important;
}
.home-card[data-theme="premium-upsell"] .home-card-title,
.home-card[data-theme="premium-upsell"] .home-card-icon {
  color: #3d3428;
}
.home-card[data-theme="admin"] {
  background: linear-gradient(135deg, #A8B5A0, #F0F3EE);
}
.home-card[data-theme="guide"] {
  background: linear-gradient(135deg, #C9A883, #F5EBDC);
  position: relative;
}
.home-card[data-theme="guide"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
  opacity: 0.15;
  pointer-events: none;
}

/* Make inner "mini" cards match their parent card */
.home-card[data-theme] .card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.home-card[data-theme="pets"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(255,243,221,0.95)); }
.home-card[data-theme="vets"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(233,248,255,0.95)); }
.home-card[data-theme="insurance"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(234,255,238,0.95)); }
.home-card[data-theme="treatments"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(233,213,255,0.95)); }
.home-card[data-theme="travel"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(224,247,245,0.95)); }
.home-card[data-theme="licence"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(232, 237, 229,0.95)); }
.home-card[data-theme="calendar"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(255,236,239,0.95)); }
.home-card[data-theme="ai"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(245, 242, 232,0.95)); }
.home-card[data-theme="shop"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(255,242,226,0.95)); }
.home-card[data-theme="tags"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(228,255,241,0.95)); }
.home-card[data-theme="places"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(238,243,255,0.95)); }
.home-card[data-theme="admin"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(240, 243, 238,0.95)); }
.home-card[data-theme="guide"] .card { background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(245, 235, 220,0.95)); }
/* Safe state (no pets missing): calm reassurance — static glow + tick, no animation */
/* No pets yet: neutral inner card — not “protected” */
@media (prefers-reduced-motion: no-preference) {
}
@media (prefers-reduced-motion: reduce) {
}


:root {
}

.pet-list-lost-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.pet-list-lost-badge-safe {
  border-color: rgba(92, 61, 94, 0.25);
}
.pet-list-lost-badge-safe:hover {
  background: rgba(92, 61, 94, 0.18);
}
.pet-list-lost-badge-missing {
  background: #b91c1c;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pet-list-lost-badge-missing:hover {
  background: #991b1b;
  color: #fff;
}


/* Admin page cards */
#section-admin .home-grid .home-card:nth-child(1) { /* Family sharing */
  background: linear-gradient(135deg, #c7f0ff, #ecf9ff);
}
#section-admin .home-grid .home-card:nth-child(2) { /* Subscription */
  background: linear-gradient(135deg, #cec6ff, #F0F3EE);
}
#section-admin .home-grid .home-card:nth-child(3) { /* My Details */
  background: linear-gradient(135deg, #d8e1ee, #f3f7fb);
}
#section-admin .home-grid .home-card:nth-child(4) { /* Legal */
  background: linear-gradient(135deg, #c7d2fe, #E8EDE5);
}
#section-admin .home-grid .home-card:nth-child(5) { /* Sign out */
  background: linear-gradient(135deg, #cbd5e1, #f1f5f9);
}
#section-admin .home-grid .home-card.home-card-interactive {
  cursor: pointer;
}
#section-admin .home-grid .home-card.home-card-interactive:hover {
  filter: brightness(0.98);
}
#section-admin .home-grid .home-card.home-card-interactive:active {
  filter: brightness(0.95);
}
#section-admin .home-grid .home-card:nth-child(6) { /* Delete my account */
  background: linear-gradient(135deg, #fde2e2, #fff5f5);
}

/* Section card tints to match home tiles */
#section-pets .card {
  background: linear-gradient(135deg, #ffc470, #fff3dd);
}

#section-vets .card {
  background: linear-gradient(135deg, #9fe0ff, #e9f8ff);
}

#section-insurance .card {
  background: #ffffff;
}

#section-insurance #insurance-list-column > .card {
  background: linear-gradient(135deg, #b7f0c1, #eaffee);
}
#section-treatments .card {
  background: linear-gradient(135deg, #C9D5C5, #E8EDE5);
}

#section-travel .card {
  background: linear-gradient(135deg, #4fd1c7, #e0f7f5);
}

#section-licence .card {
  background: linear-gradient(135deg, #6366f1, #E8EDE5);
}

/* Readable text on coloured section cards (Licence, Insurance, Travel, etc.) – avoid faint grey on tinted backgrounds */



/* Europe (Zazzle): force green card (overrides generic .card white), dark readable text */

/* Europe (Zazzle) pet select: readable text and placeholder */

/* Guide section - each card explanation matches its home card color */
#section-guide .guide-card-pets {
  background: linear-gradient(135deg, #ffc470, #fff3dd);
  position: relative;
}
#section-guide .guide-card-pets::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}


#section-guide .guide-card-vets {
  background: linear-gradient(135deg, #9fe0ff, #e9f8ff);
  position: relative;
}
#section-guide .guide-card-vets::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-insurance {
  background: linear-gradient(135deg, #b7f0c1, #eaffee);
  position: relative;
}
#section-guide .guide-card-insurance::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-travel {
  background: linear-gradient(135deg, #4fd1c7, #e0f7f5);
  position: relative;
}
#section-guide .guide-card-travel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-licence {
  background: linear-gradient(135deg, #7A8471, #E8EDE5);
  position: relative;
}
#section-guide .guide-card-licence::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-calendar {
  background: linear-gradient(135deg, #ffbac4, #ffecef);
  position: relative;
}
#section-guide .guide-card-calendar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-treatments {
  background: linear-gradient(135deg, #C9D5C5, #DCE3D8);
  position: relative;
}
#section-guide .guide-card-treatments::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-ai {
  background: linear-gradient(135deg, #D4C9B5, #F5F2E8);
  position: relative;
}
#section-guide .guide-card-ai::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-shop {
  background: linear-gradient(135deg, #ffd3a1, #fff2e2);
  position: relative;
}
#section-guide .guide-card-shop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-tags {
  background: linear-gradient(135deg, #a4f3d5, #e4fff1);
  position: relative;
}
#section-guide .guide-card-tags::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-places {
  background: linear-gradient(135deg, #b9d1ff, #eef3ff);
  position: relative;
}
#section-guide .guide-card-places::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-premium-upsell {
  background: linear-gradient(135deg, #d4bc88, #faf3e3);
  position: relative;
}
#section-guide .guide-card-premium-upsell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card-admin {
  background: linear-gradient(135deg, #A8B5A0, #F0F3EE);
  position: relative;
}
#section-guide .guide-card-admin::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}

#section-guide .guide-card {
  padding: 20px;
  border-radius: 18px;
  position: relative;
  z-index: 1;
}

#section-guide .guide-card-guide::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  opacity: 0.12;
  pointer-events: none;
}




















@media (max-width: 820px) {
}

/* Calendar sidebar: let the care-item list scroll within its panel */
#section-calendar #remindersContainer {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Calendar body: give FullCalendar a bit more vertical room, Outlook-style */
#section-calendar #fullCalendar {
  min-height: 520px;
}

/* Day columns: wider so "Tue 2/10" fits; one layout for all day headers */
#section-calendar .fc .fc-col-header-cell,
#section-calendar .fc .fc-timegrid-col,
#section-calendar .fc .fc-daygrid-day {
  min-width: 72px !important;
}
#section-calendar .fc .fc-col-header-cell-cushion {
  font-size: 0.85rem !important;
  padding: 4px 2px !important;
  line-height: 1.2 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Two-line day headers: weekday on first line, date (M/D) on second line */
#section-calendar .fc .fc-col-header-cell-cushion:has(.fc-day-header-two-line) {
  font-size: 0 !important; /* hide default "Sun 2/8" text when we show custom two-line */
}
#section-calendar .fc .fc-day-header-two-line {
  display: block !important;
  text-align: center !important;
  font-size: 0.85rem !important;
  line-height: 1.25 !important;
}
#section-calendar .fc .fc-day-header-weekday {
  display: block !important;
}
#section-calendar .fc .fc-day-header-date {
  display: block !important;
  font-weight: 600 !important;
}

/* Keep month title centered with just nav controls visible */
#section-calendar .fc .fc-toolbar {
  align-items: flex-start !important;
}
#section-calendar .fc .fc-toolbar-chunk:nth-child(3) {
  display: none !important;
}

/* Calendar cards: make the main calendar panel more neutral */
#section-calendar #calendar-detail-panel .card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.20);
}

/* Keep the left-hand list card softly tinted like the Calendar home tile */
#section-calendar .card {
  background: linear-gradient(135deg, #ffbac4, #ffecef);
}

#section-ai {
  padding-bottom: 20px;
}

#section-ai .section-title {
  margin-bottom: 14px;
}

#section-ai .card {
  background: linear-gradient(135deg, #D4C9B5, #F5F2E8);
}

#section-shop .card {
  background: linear-gradient(135deg, #ffd3a1, #fff2e2);
}


#section-places .card {
  background: linear-gradient(135deg, #b9d1ff, #eef3ff);
}


#section-family .card {
  background: linear-gradient(135deg, #c7f0ff, #ecf9ff);
}

#section-subscription .card {
  background: linear-gradient(135deg, #cec6ff, #F0F3EE);
}
/* Pets list & detail containers use cards inside panels */
.empty-state {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 8px 0;
}

/* ---------- Form layout ---------- */
form {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

label {
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 7px 9px;
  font-size: 0.9rem;
  font-family: inherit;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

input[type="file"] {
  font-size: 0.85rem;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ---------- Pets ---------- */
#section-pets {
  display: none;
}

.pet-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eef1f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #6b7280;
}

.pet-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#petProfilePhoto {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #eef1f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}

#petProfilePhoto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#petProfileName {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---------- Pet profile (edit) — premium layout ---------- */
.pet-detail-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pet-detail-view-title {
  margin-bottom: 0;
}








@media (max-width: 520px) {


}

.pet-profile-shell {
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(248, 246, 255, 0.92) 55%,
    #f3f0ff 100%
  );
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
  padding: 14px 14px 16px;
}

.pet-profile-topbar {
  margin-bottom: 10px;
}

.pet-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 8px 4px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 6px;
}

.pet-profile-hero__photo-block {
  position: relative;
  width: 172px;
  height: 172px;
}

.pet-profile-hero__ring {
  width: 172px;
  height: 172px;
  border-radius: 999px;
  padding: 4px;
  background: linear-gradient(145deg, rgba(63, 90, 58, 0.35), rgba(63, 90, 58, 0.06));
  box-shadow: 0 14px 34px rgba(63, 90, 58, 0.18);
}

.pet-detail-view #petProfilePhoto {
  width: 164px;
  height: 164px;
  min-width: 164px;
  min-height: 164px;
  margin: 0 auto;
  border-radius: 999px;
  border: 3px solid #fff;
  background: #f4f2fb;
  font-size: 2.5rem;
  box-shadow: inset 0 0 0 1px rgba(63, 90, 58, 0.08);
}

.pet-profile-photo-fab {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #4c3e7b;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(63, 90, 58, 0.35);
  border: 2px solid #fff;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pet-profile-photo-fab:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(63, 90, 58, 0.42);
}

.pet-profile-hero__text {
  max-width: 22rem;
}

.pet-profile-hero__name,
.pet-detail-view #petProfileName {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #352763;
}

.pet-profile-hero__tagline {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #5b6478;
}

.pet-profile-hero__hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
}

.pet-profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.pet-profile-section {
  margin-top: 0;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(121, 117, 128, 0.2);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.pet-profile-section__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.pet-profile-section__icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #4c3e7b;
  background: rgba(63, 90, 58, 0.1);
}

.pet-profile-section__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4c3e7b;
}

.pet-profile-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 12px;
}

@media (min-width: 560px) {
  .pet-profile-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pet-profile-field-span {
    grid-column: 1 / -1;
  }
}

.pet-profile-section__stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pet-detail-view .pet-profile-form .field-group {
  margin-bottom: 0;
}

.pet-detail-view .pet-profile-form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #5f687c;
  letter-spacing: 0.02em;
}

.pet-detail-view .pet-profile-form input[type="text"],
.pet-detail-view .pet-profile-form input[type="number"],
.pet-detail-view .pet-profile-form input[type="date"],
.pet-detail-view .pet-profile-form select,
.pet-detail-view .pet-profile-form textarea {
  border-radius: 12px;
  border: 1px solid rgba(121, 117, 128, 0.28);
  background: #fdfcfe;
  padding: 9px 11px;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pet-detail-view .pet-profile-form input:focus,
.pet-detail-view .pet-profile-form select:focus,
.pet-detail-view .pet-profile-form textarea:focus {
  outline: none;
  border-color: rgba(63, 90, 58, 0.55);
  box-shadow: 0 0 0 3px rgba(63, 90, 58, 0.12);
}

.pet-profile-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.pet-profile-actions__save {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(63, 90, 58, 0.28);
}

.pet-profile-actions__ai {
  width: 100%;
  justify-content: center;
}

.pet-profile-actions__row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pet-profile-actions__row2 .btn-small {
  width: 100%;
  justify-content: center;
}

.pet-medical-history-card {
  margin-top: 0;
  border-radius: 22px;
  border: 1px solid rgba(121, 117, 128, 0.2);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 246, 255, 0.55) 100%
  );
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  padding: 14px 14px 12px;
}

.pet-medical-history-card__head {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.pet-medical-history-card__titles {
  flex: 1;
  min-width: 0;
}

.pet-medical-history-card__head .card-title-main {
  font-size: 1.02rem;
}

.pet-medical-history-card__add {
  margin-left: auto;
}

.pet-medical-history-list {
  gap: 10px;
}

.pet-medical-history-list .pet-medical-history-item {
  margin-bottom: 0;
  border-radius: 14px;
  border: 1px solid rgba(121, 117, 128, 0.16);
  background: rgba(252, 249, 248, 0.95);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 12px 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.pet-medical-history-list .pet-medical-history-item:hover {
  border-color: rgba(63, 90, 58, 0.28);
  box-shadow: 0 6px 16px rgba(63, 90, 58, 0.08);
}

.pet-medical-history-empty {
  margin-top: 6px;
}

/* ---------- Vets ---------- */
#section-vets {
  display: none;
}

#section-vets .vets-split {
  align-items: flex-start;
}

#section-vets .vets-list-card,
#section-vets .vets-detail-card {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(230, 246, 255, 0.65) 50%,
    #e3f4ff 100%
  );
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}

#section-vets .vets-list-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 520px) {
  #section-vets .vets-list-hero {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }
}

#section-vets .vets-list-hero__copy {
  flex: 1;
  min-width: 0;
}

#section-vets .vets-list-hero__lede {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 40rem;
}

#section-vets .vets-add-btn {
  flex-shrink: 0;
  align-self: stretch;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 14px;
}

@media (min-width: 520px) {
  #section-vets .vets-add-btn {
    align-self: center;
  }
}

#section-vets .vets-record-list {
  gap: 12px;
}

#section-vets .vets-empty-state {
  text-align: center;
  padding: 28px 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

#section-vets .vets-empty-state__title {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #111827;
}

#section-vets .vets-empty-state__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 22rem;
  margin-inline: auto;
}

#section-vets .vet-record-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border-radius: 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  text-align: left;
}

#section-vets .vet-record-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.1);
  border-color: rgba(55, 35, 69, 0.12);
}

#section-vets .vet-record-card--primary {
  background: linear-gradient(180deg, #ffffff 0%, #f6f3ff 100%);
  border-color: rgba(63, 90, 58, 0.35);
  box-shadow:
    0 0 0 1px rgba(63, 90, 58, 0.1),
    0 10px 28px rgba(63, 90, 58, 0.12);
}

#section-vets .vet-record-card--primary:hover {
  border-color: rgba(63, 90, 58, 0.48);
}

#section-vets .vet-record-card__primary {
  background: #4c3e7b;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
}

#section-vets .vet-record-card__quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

#section-vets .vet-record-card__quick-actions--single {
  grid-template-columns: 1fr;
}

#section-vets .vet-record-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 10px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
}

#section-vets a.vet-record-action-btn--call {
  background: #4c3e7b;
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(63, 90, 58, 0.28);
}

#section-vets a.vet-record-action-btn--call:active {
  transform: scale(0.98);
}

#section-vets a.vet-record-action-btn--email {
  background: rgba(255, 255, 255, 0.98);
  color: #4c3e7b;
  border: 2px solid rgba(63, 90, 58, 0.42);
}

#section-vets a.vet-record-action-btn--email:hover {
  background: rgba(63, 90, 58, 0.07);
}

#section-vets .vet-record-action-btn--disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

#section-vets span.vet-record-action-btn--disabled.vet-record-action-btn--call,
#section-vets span.vet-record-action-btn--disabled.vet-record-action-btn--email {
  background: #e5e7eb;
  color: #9ca3af;
  border: 1px solid #d1d5db;
}

#section-vets .vet-record-card:focus-visible {
  outline: 2px solid var(--purple, #3F5A3A);
  outline-offset: 2px;
}

#section-vets .vet-record-card__icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: linear-gradient(145deg, #dbeafe, #eff6ff);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

#section-vets .vet-record-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#section-vets .vet-record-card__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#section-vets .vet-record-card__name {
  font-weight: 600;
  font-size: 1.02rem;
  color: #0f172a;
  letter-spacing: -0.01em;
}

#section-vets .vet-record-card__primary {
  font-weight: 600;
}

#section-vets .vet-record-card__phones {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#section-vets .vet-record-phone-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

#section-vets .vet-record-phone-row--main {
  border-left: 3px solid rgba(59, 130, 246, 0.55);
}

#section-vets .vet-record-phone-row--emergency {
  background: linear-gradient(90deg, rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.5));
  border-color: rgba(245, 158, 11, 0.28);
  border-left: 3px solid rgba(217, 119, 6, 0.85);
}

#section-vets .vet-record-phone-row__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  min-width: 4.5rem;
}

#section-vets .vet-record-phone-row--emergency .vet-record-phone-row__label {
  color: #b45309;
}

#section-vets .vet-record-phone-row__value {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  text-decoration: none;
  word-break: break-word;
}

#section-vets a.vet-record-phone-row__value {
  color: #1d4ed8;
}

#section-vets a.vet-record-phone-row__value:hover {
  text-decoration: underline;
}

#section-vets .vet-record-phone-row--emergency a.vet-record-phone-row__value {
  color: #b45309;
}

#section-vets .vet-record-phone-row__call-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: #4c3e7b;
  border: 1px solid rgba(63, 90, 58, 0.45);
  box-shadow: 0 4px 10px rgba(63, 90, 58, 0.2);
}

#section-vets .vet-record-phone-row__call-btn--disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#section-vets .vet-record-phone-row--emergency .vet-record-phone-row__call-btn {
  background: #b45309;
  border-color: rgba(180, 83, 9, 0.45);
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.2);
}

#section-vets .vet-record-card__meta {
  line-height: 1.35;
}

#section-vets .vet-record-card__trail {
  align-self: stretch;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#section-vets .vet-record-card__open-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 8px 8px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  color: #64748b;
  font: inherit;
  line-height: 1;
}

#section-vets .vet-record-card__open-btn:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #334155;
}

#section-vets .vet-record-card__open-btn:focus-visible {
  outline: 2px solid var(--purple, #3F5A3A);
  outline-offset: 2px;
}

#section-vets .vet-record-card__open-label {
  font-size: 0.78rem;
  font-weight: 600;
}

#section-vets .vet-record-card__chev {
  font-size: 1.2rem;
  font-weight: 300;
  color: #94a3b8;
  line-height: 1;
}

#section-vets .vets-detail-topbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

#section-vets .vets-back-btn {
  flex-shrink: 0;
  border-radius: 12px;
}

#section-vets .vets-detail-topbar__text {
  flex: 1;
  min-width: 0;
}

#section-vets .vets-detail-subline {
  margin: 4px 0 0;
  line-height: 1.4;
}

#section-vets #vetForm.vet-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
}

#section-vets .vet-form-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
}

#section-vets .vet-form-panel--phones {
  background: linear-gradient(155deg, #4c3e7b 0%, #5a4a8f 48%, #3d3166 100%);
  border: 1px solid rgba(63, 90, 58, 0.45);
  color: #fff;
  box-shadow: 0 16px 40px rgba(63, 90, 58, 0.22);
}

#section-vets .vet-form-panel--phones .vet-form-panel__title,
#section-vets .vet-form-panel--phones .vet-form-panel__hint {
  color: rgba(255, 255, 255, 0.9);
}

#section-vets .vet-form-panel--phones .muted,
#section-vets .vet-form-panel--phones p.muted,
#section-vets .vet-form-panel--phones small.muted {
  color: rgba(255, 255, 255, 0.9);
}

#section-vets .vet-form-panel--phones .field-group label {
  color: rgba(255, 255, 255, 0.92);
}

#section-vets .vet-form-panel--phones .vet-field-main-phone {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
}

#section-vets .vet-form-panel--phones .vet-field-main-phone input {
  background: #fff;
  color: #111827;
}

#section-vets .vet-form-panel--phones .vet-field-main-phone input::placeholder {
  color: #6b7280;
}

#section-vets .vet-form-panel--phones .vet-field-emergency {
  background: rgba(254, 226, 226, 0.96);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
}

#section-vets .vet-form-panel--phones .vet-field-emergency label,
#section-vets .vet-form-panel--phones .vet-emergency-label {
  color: #9a3412;
}

#section-vets .vet-form-panel--phones .vet-field-emergency input {
  border-color: rgba(220, 38, 38, 0.35);
  background: #fff;
  color: #111827;
  font-weight: 600;
}

#section-vets .vet-form-panel--phones .vet-field-emergency input::placeholder {
  color: #7f1d1d;
}

#section-vets .vet-form-panel--phones .vet-field-emergency input:focus {
  border-color: rgba(185, 28, 28, 0.65);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.22);
}

#section-vets .vet-form-panel--practice,
#section-vets .vet-form-panel--location,
#section-vets .vet-form-panel--prefs {
  box-shadow: 0 10px 30px -5px rgba(63, 90, 58, 0.07);
}

#section-vets .vet-form-panel__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #475569;
}

#section-vets .vet-form-panel__hint {
  margin: -4px 0 12px;
}

#section-vets .vet-form-panel .field-group {
  margin-bottom: 0;
}

#section-vets .vet-form-panel .field-group + .field-group {
  margin-top: 12px;
}

#section-vets .vet-primary-field small {
  display: block;
  margin-top: 6px;
}

#section-vets .vet-form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 4px;
}

#section-vets .vet-form-save {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
}

#section-vets .vet-form-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (min-width: 480px) {
  #section-vets .vet-form-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  #section-vets .vet-form-save {
    width: auto;
    min-width: 140px;
    order: 2;
  }

  #section-vets .vet-form-actions-secondary {
    order: 1;
    justify-content: flex-start;
  }
}

/* ---------- Insurance ---------- */
#section-insurance {
  display: none;
}

#section-insurance.insurance-detail-active .insurance-page-shell {
  grid-template-columns: 1fr;
}

#section-insurance .insurance-page-shell {
  background: linear-gradient(155deg, #b7f0c1 0%, #eaffee 56%, #f5fff7 100%);
  border: 1px solid rgba(63, 90, 58, 0.14);
  border-radius: 20px;
  box-shadow: 0 14px 30px rgba(63, 90, 58, 0.1);
  padding: 18px;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  margin: 4px 0 16px;
}

#section-insurance .insurance-page-shell::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 120px;
  height: 120px;
  background: url("Horse_logo_Transparent_Green.png") no-repeat center center;
  background-size: contain;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

#section-insurance .horsehub-insurance-page-header {
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

#section-insurance .horsehub-insurance-page-title {
  color: #2d2054;
  margin-bottom: 6px;
}

#section-insurance .horsehub-insurance-page-subtitle {
  margin: 0;
  color: #5c5b61;
}

#section-insurance .horsehub-insurance-detail-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(234, 255, 238, 0.98) 0%, rgba(234, 255, 238, 0.86) 100%);
  backdrop-filter: blur(4px);
  border-radius: 14px;
  padding: 8px 10px;
}

#section-insurance .horsehub-insurance-detail-shell {
  border: 1px solid rgba(63, 90, 58, 0.14);
  border-radius: 22px;
  box-shadow: 0 14px 26px rgba(63, 90, 58, 0.1);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

#section-insurance .horsehub-insurance-accent-bar {
  height: 5px;
  background: #c8f3de;
}

#section-insurance .horsehub-insurance-detail-header {
  padding: 16px 16px 0;
}

#section-insurance .horsehub-insurance-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px 16px 16px;
}

#section-insurance #insurance-list-column > .card {
  position: relative;
  z-index: 1;
}

#section-insurance .insurance-overview-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(155deg, rgba(255,255,255,0.96), rgba(229,255,239,0.88));
  border: 1px solid rgba(48, 138, 93, 0.22);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(23, 73, 53, 0.12);
  padding: 16px;
}

#section-insurance .horsehub-insurance-form-main {
  display: grid;
  gap: 12px;
}

#section-insurance #insuranceForm .field-group input,
#section-insurance #insuranceForm .field-group select,
#section-insurance #insuranceForm .field-group textarea {
  background: #f7f3f0;
  border: 0;
  border-bottom: 2px solid #d8d0df;
  border-radius: 12px 12px 6px 6px;
}

#section-insurance #insuranceForm .field-group input:focus,
#section-insurance #insuranceForm .field-group select:focus,
#section-insurance #insuranceForm .field-group textarea:focus {
  border-bottom-color: #4c3e7b;
  box-shadow: 0 0 0 2px rgba(63, 90, 58, 0.14);
}

#section-insurance .horsehub-insurance-renewal-callout {
  background: #f0ede8;
  border: 1px solid rgba(63, 90, 58, 0.12);
  border-radius: 16px;
  padding: 10px;
}

#section-insurance .horsehub-insurance-renewal-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
}

#section-insurance .horsehub-insurance-calendar-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(63, 90, 58, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#section-insurance .horsehub-insurance-renewal-note {
  grid-column: 1 / -1;
  margin: 0;
}

#section-insurance .horsehub-insurance-docs-wrap {
  background: #fcf9f8;
  border-radius: 14px;
  border: 1px dashed rgba(63, 90, 58, 0.3);
  padding: 12px;
}

#section-insurance .horsehub-insurance-save-btn {
  background: linear-gradient(135deg, #4c3e7b 0%, #635594 100%);
  border: 0;
  color: #fff;
  box-shadow: 0 10px 20px rgba(63, 90, 58, 0.28);
}

#section-insurance .horsehub-insurance-form-actions {
  border-top: 1px solid rgba(63, 90, 58, 0.12);
  padding-top: 12px;
}

#section-insurance .horsehub-insurance-summary-card {
  background: #ffffff;
  border: 1px solid rgba(63, 90, 58, 0.16);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 20px rgba(63, 90, 58, 0.09);
}

#section-insurance .horsehub-insurance-summary-title {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5e5b67;
}

#section-insurance .horsehub-insurance-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

#section-insurance .horsehub-insurance-summary-status {
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ede9f8;
  color: #3f316d;
}

#section-insurance .horsehub-insurance-summary-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #ece7f7;
  overflow: hidden;
}

#section-insurance .horsehub-insurance-summary-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4c3e7b, #7a63c3);
  transition: width 180ms ease;
}

#section-insurance .horsehub-insurance-summary-note {
  margin: 10px 0 0;
}

@media (min-width: 960px) {
  #section-insurance .insurance-page-shell {
    grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
    align-items: start;
  }
  #section-insurance .horsehub-insurance-form-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
  }
}

#section-insurance.insurance-detail-active .insurance-overview-panel {
  display: none;
}

#section-insurance.insurance-detail-active .insurance-page-shell::after {
  display: none;
}

.policy-record-card {
  border-radius: 18px;
  border-left: 4px solid #5cb88a;
  background: linear-gradient(160deg, rgba(255,255,255,0.92), rgba(248,255,252,0.82));
  box-shadow: 0 12px 24px rgba(22, 52, 35, 0.08);
  border-top: 1px solid rgba(255,255,255,0.65);
  border-right: 1px solid rgba(188, 206, 228, 0.35);
  border-bottom: 1px solid rgba(188, 206, 228, 0.35);
}

.licence-card.policy-record-card {
  border-left-color: #7d77e8;
  background: linear-gradient(160deg, rgba(255,255,255,0.92), rgba(245,246,255,0.84));
}

.policy-card-row {
  align-items: flex-start;
  gap: 10px;
}

.policy-card-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  margin-top: 2px;
}

.policy-card-icon-badge.insurance { background: rgba(24, 148, 100, 0.14); }
.policy-card-icon-badge.licence { background: rgba(99, 102, 241, 0.16); }

.policy-card-content {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.policy-card-title { font-size: 1rem; font-weight: 700; }
.policy-card-subtitle { font-size: 0.8rem; color: #556172; }
.policy-card-meta-line { font-size: 0.82rem; color: #2f3a49; }

.policy-card-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-self: flex-start;
}

.policy-card-pill {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.policy-card-pill.good { background: #e9f9ee; color: #18663c; border-color: #c9ecd8; }
.policy-card-pill.warn { background: #fff5df; color: #8a5a00; border-color: #f3dfae; }
.policy-card-pill.danger { background: #ffe9ea; color: #9f1f2a; border-color: #f1c6cb; }
.policy-card-pill.neutral { background: #edf0f5; color: #3d4a60; border-color: #dde3ec; }

.overview-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(63, 90, 58, 0.14);
}

.overview-title {
  margin: 0;
  font-size: 0.95rem;
}

.overview-subtitle {
  margin: 6px 0 12px;
  font-size: 0.82rem;
}

.overview-stats {
  display: grid;
  gap: 8px;
}

.overview-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(63, 90, 58, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.overview-stat strong {
  font-size: 0.88rem;
  color: #2f2752;
}

@media (max-width: 820px) {
  .policy-card-pill-row {
    justify-content: flex-start;
  }
}

#section-licence .licence-page-shell {
  position: relative;
  gap: 16px;
  margin: 4px 0 16px;
  grid-template-columns: minmax(0, 1fr);
}

#section-licence .licence-page-shell::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 112px;
  height: 112px;
  background: url("Horse_logo_Transparent_Green.png") no-repeat center center;
  background-size: contain;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

#section-licence #licence-list-column > .card,
#section-licence .licence-overview-panel {
  position: relative;
  z-index: 1;
}

#section-licence .licence-overview-panel {
  background: linear-gradient(155deg, rgba(255,255,255,0.96), rgba(236,237,255,0.92));
  border: 1px solid rgba(92, 90, 194, 0.24);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(54, 48, 119, 0.13);
  padding: 16px;
}

#section-licence.licence-detail-active .licence-overview-panel {
  display: none;
}

#section-licence.licence-detail-active .licence-page-shell::after {
  display: none;
}

@media (min-width: 960px) {
  #section-licence .licence-page-shell {
    grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
    align-items: start;
  }
}

/* ---------- Calendar ---------- */
#section-calendar {
  display: none;
}

/* Calendar layout: BoatMatey-style — calendar on top, care items below */
#section-calendar .calendar-top-card {
  margin-bottom: 1.5rem;
}
#section-calendar .calendar-subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}
#section-calendar .calendar-care-section {
  margin-top: 0;
}
#section-calendar .calendar-grid-card {
  padding: 0.75rem;
}
#section-calendar .calendar-care-section > .card {
  background: linear-gradient(135deg, #ffcad6, #ffecef);
}
#section-calendar .calendar-care-section .pet-list-header {
  margin-bottom: 10px;
}
#section-calendar .calendar-care-section .pet-list-header .pill {
  background: rgba(255, 255, 255, 0.5);
}
/* Highlight days that have at least one appointment (BoatMatey-style) */
#section-calendar .fc .fc-daygrid-day.horsehub-day-has-appointment {
  background-color: rgba(249, 115, 22, 0.2);
}
#section-calendar .fc .fc-daygrid-day.horsehub-day-has-appointment .fc-daygrid-day-number {
  background-color: rgba(234, 88, 12, 0.35);
  color: #c2410c;
  font-weight: 600;
  border-radius: 50%;
  min-width: 1.6em;
  text-align: center;
}
/* Repeat until hint when type has prefilled repeat (18‑month rolling) */
.repeat-until-hint {
  font-size: 0.85rem;
  margin-top: 0.35rem;
  line-height: 1.35;
}

.repeat-premium-hint {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

.field-group.horsehub-repeat-locked-basic label {
  color: #9ca3af;
}

.field-group.horsehub-repeat-locked-basic select,
.field-group.horsehub-repeat-locked-basic input[type="date"] {
  opacity: 0.75;
  cursor: not-allowed;
}

/* Calendar sidebar: keep care items scrollable like an Outlook list */
#section-calendar #remindersContainer {
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Slightly tighter calendar cards to feel more app-like than "big tiles" */
#section-calendar .card {
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
}

/* Calendar filter row */
.calendar-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 6px 0 10px;
  font-size: 0.85rem;
}
.calendar-filter-row label {
  color: #6b7280;
}
.calendar-filter-select {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 35, 69, 0.25);
  background: #ffffff;
  font-size: 0.85rem;
  outline: none;
}
.calendar-filter-select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 1px rgba(55, 35, 69, 0.15);
}

/* Birthday & insurance event accents in calendar */
.fc-event.calendar-birthday-event,
.calendar-birthday-event .fc-event-main-frame {
  background: #f97316;
  border-color: #ea580c;
  color: #ffffff;
}
.fc-event.calendar-insurance-event,
.calendar-insurance-event .fc-event-main-frame {
  background: #0ea5e9;
  border-color: #0284c7;
  color: #ffffff;
}
.calendar-reminder-birthday {
  border-color: #ea580c;
  background: #fff7ed;
}

.fc-toolbar-title {
  font-size: 1.1rem;
  font-weight: 600;
}
@media (max-width: 600px) {
  .fc-toolbar-title {
    font-size: 1rem;
  }
}

/* Calendar visual refresh (Stitch-inspired, logic unchanged) */
#section-calendar .horsehub-calendar-page-shell {
  background: linear-gradient(150deg, #f6f2ff 0%, #fefcff 52%, #ffffff 100%);
  border: 1px solid rgba(63, 90, 58, 0.16);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(63, 90, 58, 0.12);
  padding: 16px;
  margin-bottom: 16px;
}
#section-calendar .horsehub-calendar-page-header {
  margin-bottom: 12px;
}
#section-calendar .horsehub-calendar-kicker {
  margin: 0 0 6px;
  color: #4c3e7b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
}
#section-calendar .horsehub-calendar-main-title {
  margin-bottom: 6px;
}
#section-calendar .horsehub-calendar-main-subtitle {
  margin-bottom: 0;
  max-width: 70ch;
  line-height: 1.45;
}
#section-calendar .horsehub-calendar-grid-shell {
  border: 1px solid rgba(63, 90, 58, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  padding: 12px;
}
#section-calendar .horsehub-calendar-grid-header {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(63, 90, 58, 0.12), rgba(63, 90, 58, 0.04));
}
#section-calendar .horsehub-calendar-grid-title {
  margin: 0 0 3px;
  font-size: 1rem;
  color: #1F3919;
}
#section-calendar .horsehub-calendar-grid-subtitle {
  margin: 0;
  font-size: 0.84rem;
}

#section-calendar .horsehub-calendar-care-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
#section-calendar .horsehub-calendar-care-title {
  margin-bottom: 4px;
}
#section-calendar .horsehub-calendar-add-top-btn {
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(63, 90, 58, 0.24);
}
#section-calendar .horsehub-calendar-care-card {
  border-radius: 16px;
  border: 1px solid rgba(63, 90, 58, 0.16);
  box-shadow: 0 10px 24px rgba(20, 35, 18, 0.12);
}
#section-calendar .horsehub-calendar-upcoming-head {
  margin: 4px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(63, 90, 58, 0.14);
}
#section-calendar .horsehub-calendar-upcoming-title {
  margin: 0;
  font-size: 0.92rem;
  color: #352763;
}

#section-calendar #remindersContainer {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
#section-calendar #remindersContainer .calendar-card {
  border: 1px solid rgba(63, 90, 58, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 5px 14px rgba(63, 90, 58, 0.1);
}
#section-calendar #remindersContainer .calendar-card:hover {
  border-color: rgba(63, 90, 58, 0.35);
  box-shadow: 0 9px 20px rgba(63, 90, 58, 0.14);
}
#section-calendar #remindersContainer .calendar-card .card-header-row {
  align-items: flex-start;
}
#section-calendar #remindersContainer .calendar-card .card-title-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.25;
}
#section-calendar #remindersContainer .calendar-card .card-subline {
  margin-top: 4px;
  font-size: 0.82rem;
}

#section-calendar #reminderForm {
  margin-top: 12px !important;
  border-top: 1px solid rgba(63, 90, 58, 0.18);
  padding-top: 12px;
}
#section-calendar #reminderForm .field-group {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(63, 90, 58, 0.12);
  border-radius: 12px;
  padding: 10px;
}
#section-calendar #reminderForm .field-group label {
  font-size: 0.82rem;
  color: #43385f;
}
#section-calendar #reminderForm .field-group input,
#section-calendar #reminderForm .field-group select,
#section-calendar #reminderForm .field-group textarea {
  margin-top: 4px;
  background: #F8FAF5;
  border-color: #cfc6e8;
}
#section-calendar #reminderForm .field-group input:focus,
#section-calendar #reminderForm .field-group select:focus,
#section-calendar #reminderForm .field-group textarea:focus {
  border-color: #4c3e7b;
  box-shadow: 0 0 0 3px rgba(63, 90, 58, 0.14);
}
#section-calendar .horsehub-calendar-form-actions {
  margin-top: 6px;
}
#section-calendar .horsehub-calendar-form-actions #saveReminderBtn {
  font-weight: 700;
}

@media (max-width: 768px) {
  #section-calendar .horsehub-calendar-page-shell {
    padding: 12px;
    border-radius: 16px;
  }
  #section-calendar .horsehub-calendar-grid-shell {
    padding: 10px;
  }
  #section-calendar .horsehub-calendar-add-top-btn {
    width: 100%;
    justify-content: center;
  }
  #section-calendar #remindersContainer {
    max-height: 360px;
  }
}

/* ---------- Home: upcoming birthdays / today / this week ---------- */
.home-birthdays-card {
  margin-bottom: 16px;
}
.home-birthday-list {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-birthday-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(55, 35, 69, 0.12);
}
.home-birthday-item:last-child {
  border-bottom: none;
}
.home-birthday-name {
  font-weight: 600;
}
.home-birthday-date {
  font-weight: 500;
}
.home-birthday-meta {
  font-size: 0.8rem;
  color: #6b7280;
  margin-left: 8px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .home-birthdays-card {
    margin-bottom: 12px;
  }
  .home-birthday-item {
    font-size: 0.85rem;
  }
}

/* ---------- AI tab ---------- */
.ai-page-header {
  margin-bottom: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #e3d2ff 0%, #f5eeff 65%, #fbf8ff 100%);
  border: 1px solid rgba(74, 44, 95, 0.16);
  border-radius: 20px;
  box-shadow: 0 14px 28px -18px rgba(55, 35, 69, 0.55);
}

.ai-page-header__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-page-header__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-page-header__title {
  margin: 0;
}

.ai-page-header__pill {
  background: rgba(74, 44, 95, 0.12);
  color: #2f1b43;
  border: 1px solid rgba(74, 44, 95, 0.16);
}

.ai-page-header__subtitle {
  margin: 0;
  color: #4b5563;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(0, 1.9fr);
  gap: 18px;
  align-items: start;
}

.ai-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 520px;
  max-height: 560px;
  padding: 14px;
}

.ai-sidebar-panel {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(55, 35, 69, 0.14);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(248, 243, 255, 0.74));
}

.ai-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ai-sidebar-intro {
  margin: 0;
  font-size: 0.88rem;
}

.ai-usage-card {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(74, 44, 95, 0.14);
  background: linear-gradient(135deg, rgba(215, 224, 210, 0.48), rgba(245, 237, 255, 0.9));
}

.ai-usage-card__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #3F5A3A;
  margin-bottom: 8px;
}

.ai-usage-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  color: #43374f;
  display: grid;
  gap: 7px;
}

.ai-chatgpt-link {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(74, 44, 95, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #2f1b43;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.ai-chatgpt-link:hover {
  opacity: 0.85;
}

.ai-consent-withdraw {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(55, 35, 69, 0.12);
}

.ai-consent-withdraw .btn-secondary {
  width: 100%;
}

.ai-consent-withdraw .muted {
  margin: 7px 0 0;
  font-size: 0.78rem;
}

.ai-chats-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.ai-chats-panel__title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #3F5A3A;
  margin-bottom: 8px;
}

.ai-chat-shell {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: 560px;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 14px 30px -20px rgba(55, 35, 69, 0.45);
}

.ai-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(245, 237, 255, 0.28) 100%);
}

.ai-conversation-card {
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  border: 1px solid rgba(55, 35, 69, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
}

.ai-conversation-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(55, 35, 69, 0.15);
  transform: translateX(2px);
}

.ai-conversation-card.active {
  border-color: var(--purple);
  background: rgba(55, 35, 69, 0.08);
  box-shadow: 0 2px 8px rgba(55, 35, 69, 0.12);
}

.ai-conversation-card > div:first-child {
  flex: 1;
  min-width: 0;
}

.ai-conversation-card > div:first-child > div:first-child {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-conversation-card > div:first-child > div:last-child {
  font-size: 0.75rem;
  color: var(--muted);
}

.ai-input-wrapper {
  padding: 12px 12px 13px;
  border-top: 1px solid rgba(55, 35, 69, 0.12);
  background: rgba(245, 242, 232, 0.62);
  flex-shrink: 0;
}

.ai-remaining-requests {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(55, 35, 69, 0.05);
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(55, 35, 69, 0.1);
}

.ai-remaining-requests.low {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.ai-remaining-requests.premium {
  background: rgba(139, 167, 130, 0.1);
  border-color: rgba(139, 167, 130, 0.2);
}

.ai-remaining-requests .remaining-text {
  font-weight: 500;
  color: inherit;
}

.ai-remaining-requests .upgrade-hint {
  font-size: 0.75rem;
  color: var(--purple);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.ai-remaining-requests .upgrade-hint:hover {
  opacity: 0.8;
}

.ai-remaining-requests.cooldown {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.ai-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ai-attach-btn {
  flex: 0 0 auto;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border-radius: 12px;
}

/* iOS: ensure AI text area is tappable and receives focus (not blocked by overlay or tap handler) */
.ai-input-wrapper,
.ai-input-row,
#aiInput {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  touch-action: manipulation;
}

.ai-input-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(55, 35, 69, 0.2);
  background: rgba(255, 255, 255, 0.94);
}

.ai-input-row input[type="text"]:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(55, 35, 69, 0.1);
}

.ai-send-btn {
  flex: 0 0 auto;
  padding: 12px 18px;
  font-weight: 600;
  border-radius: 14px;
  white-space: nowrap;
  min-width: 78px;
  box-shadow: 0 8px 18px -12px rgba(55, 35, 69, 0.8);
}

.ai-image-badge {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
  padding-left: 52px;
  line-height: 1.3;
}

/* Chat bubbles */
.ai-message {
  position: relative;
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  transition: opacity 0.2s ease;
}

.ai-message.system {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(55, 35, 69, 0.12);
  color: #1f2937;
}

.ai-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4F6B45, #3F5A3A);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(55, 35, 69, 0.25);
}

.ai-message strong {
  font-weight: 600;
  color: inherit;
}

.ai-message .muted {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Per-message delete button – subtle in top-right corner */
.ai-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  border-radius: 999px;
  border: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.08);
  color: #6b7280;
  opacity: 0.7;
  transition: all 0.15s ease;
}

.ai-message:hover .ai-delete-btn {
  opacity: 1;
}

.ai-message.user .ai-delete-btn {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.ai-delete-btn:hover {
  background: rgba(15, 23, 42, 0.15);
  transform: scale(1.1);
}

.ai-message.user .ai-delete-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* AI empty state */
#aiConversationsEmpty {
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* AI messages empty state */
.ai-messages:has(.ai-message.system:only-child) {
  justify-content: center;
  align-items: center;
}

.ai-message.system:only-child {
  max-width: 94%;
  text-align: center;
  padding: 24px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(210, 220, 200, 0.15), rgba(245, 242, 232, 0.25));
  border: 1px dashed rgba(55, 35, 69, 0.2);
  box-shadow: 0 8px 26px -22px rgba(55, 35, 69, 0.7);
}

.ai-message.system:only-child::before {
  content: "✨";
  display: block;
  font-size: 1.8rem;
  margin-bottom: 8px;
  opacity: 0.7;
}

/* Mobile layout for AI */
@media (max-width: 700px) {
  .ai-page-header {
    border-radius: 16px;
    padding: 14px;
  }

  .ai-layout {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .ai-chat-shell {
    order: 1;
    min-height: 320px;
    max-height: 430px;
    border-radius: 16px;
  }

  .ai-sidebar {
    order: 2;
    max-height: unset;
    min-height: 0;
    padding: 12px;
    border-radius: 16px;
  }

  .ai-messages {
    padding: 12px 10px;
    gap: 8px;
  }

  .ai-message {
    max-width: 90%;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .ai-input-wrapper {
    padding: 10px 10px 10px;
  }

  .ai-input-row {
    gap: 6px;
  }

  .ai-attach-btn {
    min-width: 40px;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .ai-input-row input[type="text"] {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .ai-send-btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    min-width: 60px;
  }

  .ai-image-badge {
    font-size: 0.7rem;
    padding-left: 46px;
    margin-top: 4px;
  }

  #section-ai {
    padding: 10px;
  }
}

/* ---------- Shop tab ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.shop-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.shop-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-card-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.shop-card-url {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: #6b7280;
  word-break: break-all;
}

.shop-card-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.shop-card-actions button {
  font-size: 0.75rem;
}

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

/* Bottom navigation – respect safe area (nav bar / gesture bar) */
.tab-bar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0 16px 16px 16px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  border-radius: 22px;
  background: linear-gradient(135deg, #5C7A53 0%, #1A2918 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  justify-content: center;
  z-index: 20;
}

/* Bottom nav: 2 rows max, up to 4 per row */
.tab-bar-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 columns = 2 rows for 7 tabs */
  column-gap: 6px;
  row-gap: 6px;
  width: 100%;
  max-width: 900px;
}

/* 5-tab bar: Home, AI, Cal, Shop, Settings – single row, short labels so it fits */
.tab-bar-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tab-bar-five .tab-btn {
  font-size: 0.7rem;
  padding: 3px 4px;
  gap: 3px;
  min-width: 0;
}

.tab-bar-five .tab-btn span.icon {
  font-size: 0.95rem;
}

/* Slightly tighter tabs so 4 per row fits on phones */
.tab-btn {
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 5px 0;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  text-align: center;
  min-width: 0;
}

.tab-btn span.icon {
  font-size: 1rem;
}

.tab-btn .tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-btn.active {
  background: #f9fafb;
  color: #111827;
}

/* Responsive tweaks – main content above bottom nav and safe area */
@media (max-width: 600px) {
  main {
    padding: 10px 10px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}



/* ---------- Onboarding / Auth overlay with paw watermark ---------- */

/* ---------- Public marketing landing page (hosted web only) ---------- */
.landing-page {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: radial-gradient(circle at top, #5C7A53 0, #1A2918 55%, #0D110B 100%);
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  padding: calc(14px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.landing-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 320px 320px;
  opacity: 0.18;
  pointer-events: none;
}
.landing-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.landing-headline {
  margin: 0;
  font-size: clamp(1.65rem, 4.5vw, 1.95rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 0 24px rgba(0,0,0,0.15);
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.landing-subtext {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.92;
  line-height: 1.45;
  color: rgba(255,255,255,0.95);
  max-width: 420px;
}
.landing-video-wrap {
  width: 100%;
  max-width: 480px;
  margin: 16px 0 8px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.1);
  background: #000;
  aspect-ratio: 16 / 9;
}
.landing-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.landing-store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
/* Hide store badges on mobile/tablet landing (all orientations, including tablet landscape); desktop only shows badges */
@media (max-width: 1400px) {
  .landing-page .landing-store-badges {
    display: none !important;
  }
}
.landing-store-btn {
  display: inline-block;
  line-height: 0;
}
.landing-store-btn img {
  display: block;
  width: 160px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}
@media (min-width: 480px) {
  .landing-store-btn img {
    width: 200px;
    max-height: 60px;
  }
}
.landing-reassurance {
  margin: 8px 0 0;
  font-size: 0.875rem;
  opacity: 0.85;
  color: rgba(255,255,255,0.9);
}
.landing-cta-wrap {
  margin-top: 8px;
  width: 100%;
  max-width: 320px;
}
.landing-cta-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #3F5A3A;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.landing-cta-btn:hover {
  background: #fff;
}
.landing-cta-btn:active {
  transform: scale(0.98);
}
.landing-cta-btn:focus {
  outline: 2px solid rgba(255,255,255,0.65);
  outline-offset: 2px;
}

/* Full-screen onboarding overlay */
.onboarding-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;

  color:#fff;
  background: radial-gradient(circle at top, #5C7A53 0, #1A2918 55%, #0D110B 100%);

  /* Prevent weird WebView "shrink" behaviour */
  overflow: hidden;

  /* Prevent double-tap zoom on iPad (App Store Guideline 4.0) */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;

  /* Safe areas on all sides (notch, Dynamic Island, home indicator, landscape) */
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  padding-left: max(14px, env(safe-area-inset-left));
}

/* Paw watermark behind the slides */
.onboarding-overlay::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:url("Horse_logo_Transparent_Green.png");
  background-repeat:no-repeat;
  background-position:center 42%;
  background-size:320px 320px;
  opacity:0.18;
  pointer-events:none;
}

/* First-time setup wizard (sibling of .onboarding-inner inside #onboardingOverlay) */
.horsehub-first-time-setup-flow {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100% - 28px));
  max-width: 560px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  box-sizing: border-box;
  padding: 0.5rem 0;
}
.onboarding-overlay.horsehub-first-setup-open .horsehub-first-time-setup-flow {
  display: flex !important;
  flex-direction: column;
}
.horsehub-first-time-setup-flow .fts-step-mount {
  width: 100%;
}
.horsehub-first-time-setup-flow .fts-step {
  padding: 0.25rem 0 1rem;
}
.horsehub-first-time-setup-flow .fts-title {
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.horsehub-first-time-setup-flow .fts-subtitle {
  margin: 0 0 0.5rem;
  color: rgba(255, 255, 255, 0.92);
}
.horsehub-first-time-setup-flow .fts-support.muted {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}
.horsehub-first-time-setup-flow .fts-actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.horsehub-first-time-setup-flow .fts-protect-lost-note {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}
.horsehub-first-time-setup-flow .fts-card-actions--protect {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}
.horsehub-first-time-setup-flow .fts-protect-tag-note {
  margin-top: 0.75rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
}
.horsehub-first-time-setup-flow .fts-contact-saved-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-align: left;
}
.horsehub-first-time-setup-flow .fts-contact-saved-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: #86efac;
}
.horsehub-first-time-setup-flow .fts-contact-saved-text .fts-action-card-title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.horsehub-first-time-setup-flow .fts-contact-saved-text .fts-action-card-desc {
  display: block;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}
.horsehub-first-time-setup-flow .fts-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin: 0.65rem 0 0.35rem;
}
.horsehub-first-time-setup-flow .fts-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 1rem;
}
.horsehub-first-time-setup-flow .fts-err {
  color: #fecaca;
  font-size: 0.85rem;
  margin: 0.65rem 0 0;
}

.horsehub-first-time-setup-flow .fts-premium-lede {
  margin-top: 0.5rem;
  line-height: 1.45;
}
.horsehub-first-time-setup-flow .fts-premium-value-list {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.45;
}
.horsehub-first-time-setup-flow .fts-premium-value-list li {
  margin: 0.35rem 0;
}
.horsehub-first-time-setup-flow .fts-premium-footnote,
.horsehub-first-time-setup-flow .fts-protect-tag-footnote {
  margin-top: 1rem;
  font-size: 0.82rem;
  line-height: 1.4;
}
.horsehub-first-time-setup-flow .fts-protect-tag-footnote {
  margin-top: 0.75rem;
}
.horsehub-first-time-setup-flow .fts-btn-secondary {
  width: 100%;
}

.fts-lost-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.fts-lost-contact-modal[hidden] {
  display: none !important;
}
.fts-lost-contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.fts-lost-contact-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  max-height: min(90vh, 520px);
  overflow-y: auto;
  padding: 1.25rem 1.25rem 1.1rem;
  border-radius: 18px;
  background: radial-gradient(circle at top, #5C7A53 0, #1A2918 55%, #0D110B 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.55);
}
.fts-lost-contact-modal__title {
  margin-top: 0;
}
.fts-lost-contact-modal__lede {
  margin-bottom: 0.25rem;
}
.fts-lost-contact-modal__actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* The panel (the "box") - force an explicit height so Android WebView can't collapse it */
.onboarding-inner{
  position: relative;
  z-index: 1;

  width: min(560px, calc(100% - 28px));
  max-width: 560px;

  /* Hard height: account for top and bottom safe areas (iOS notch, home indicator) */
  height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 520px;
  max-height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));

  display:flex;
  flex-direction:column;

  padding: 14px 18px 12px;
  border-radius: 24px;

  /* Avoid backdrop-filter (can render oddly in some WebViews) */
  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 55px rgba(0,0,0,0.45);

  overflow:hidden; /* slide body scrolls, not the whole panel */
}

/* Slide content scrolls inside the panel */
.onboarding-slide{
  flex: 1 1 auto;
  min-height: 0;              /* critical for flex + overflow on mobile */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  position: relative;
  z-index: 1;
}

/* Signup slide: top padding so wordmark isn’t clipped (negative margins on children are visible only with scroll room) */
.onboarding-slide[data-step="1"]{
  padding-top: 12px;
  scroll-padding-top: 8px;
}

/* Align first-line content to the same vertical start as step 2’s inner card (see .onboarding-overview-card padding) */
.onboarding-slide[data-step="3"]{
  padding-top: clamp(16px, 3.2vw, 22px);
  box-sizing: border-box;
}

.onboarding-slide[data-step="3"] > h2:first-of-type{
  margin-top: 2px;
}

.onboarding-slide h2{
  margin:0 0 8px;
  font-size:1.6rem;
}
.onboarding-slide p{
  margin:0;
  font-size:0.95rem;
  opacity:0.9;
}

/* Step 1 landing hero: top-anchored stack (same top inset as step 2 overview card), horizontally centred */
.onboarding-landing-stack{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.onboarding-single-hero{
  min-height: 0;
  justify-content: flex-start;
}
.onboarding-branding{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  margin: 0;
}
/* Primary header: wordmark + paw scale together (hero on signup card) */
.onboarding-brand-lockup{
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.22em;
  max-width: 100%;
  box-sizing: border-box;
  font-size: clamp(1.88rem, 6.5vw, 4.05rem);
  line-height: 1;
}
.onboarding-brand-icon{
  width: 1.22em;
  height: 1.22em;
  flex-shrink: 0;
  display: block;
  background-image: url("Horse_logo_Transparent_Green.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 1;
}
.onboarding-brand-name{
  margin: 0;
  padding: 0;
  font-size: 1em;
  line-height: 1.02;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    0 4px 24px rgba(0, 0, 0, 0.45),
    0 0 4px rgba(255, 255, 255, 0.9),
    0 0 36px rgba(255, 255, 255, 0.18);
}
.onboarding-brand-trust{
  margin: 0 0 48px;
  max-width: 22rem;
  font-size: clamp(0.68rem, 1.85vw, 0.78rem);
  line-height: 1.24;
  font-weight: 400;
  letter-spacing: 0.035em;
  color: rgba(255, 255, 255, 0.5);
}

/* Step 1: avoid negative top margin — it pulls content above scrollTop 0 and clips in WebView */
.onboarding-slide[data-step="1"] .onboarding-landing-stack{
  margin-top: 0;
  gap: 7px;
}
.onboarding-slide[data-step="1"] #authForm{
  margin-top: 0;
}

/* Slide 1: embedded demo video */
.onboarding-slide--intro-video .onboarding-demo-video-wrap {
  margin: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
  flex-shrink: 0;
}
.onboarding-demo-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(38vh, 260px);
  object-fit: contain;
  vertical-align: bottom;
  background: #000;
}

/* Title + subtitle block: tagline→headline gap via .onboarding-brand-trust margin-bottom */
.onboarding-step1-hero{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}
.onboarding-step1-hero .onboarding-step1-headline{
  margin: 0 0 1px;
  padding: 0;
  width: 100%;
  max-width: 100%;
  text-align: center;
  /* Clearly subordinate to HorseHub+ wordmark */
  font-size: clamp(0.98rem, 3.05vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.28;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.onboarding-step1-hero .onboarding-step1-subtitle{
  margin: 0 0 14px;
  padding: 0;
  width: 100%;
  max-width: min(25rem, 94vw);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: clamp(0.8rem, 2.05vw, 0.93rem);
  line-height: 1.36;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.7);
  opacity: 1;
}

.onboarding-slide[data-step="1"] .onboarding-demo-video-wrap{
  max-width: 340px;
  margin: -2px auto 0;
}

.onboarding-step1-store-badges{
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

/* Native app only: hide Play / App Store badges (user already installed). Hosted web keeps them at all viewports. */
html.horsehub-native-shell .onboarding-step1-store-badges {
  display: none !important;
}

.onboarding-store-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
}

.onboarding-store-badge--play{
  width: 126px;
  height: 40px;
}

.onboarding-store-badge--play img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.onboarding-store-badge--appstore{
  width: 126px;
  height: 40px;
}

.onboarding-store-badge--appstore img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.onboarding-step1-trial-note{
  margin: 5px 0 0;
  padding: 0;
  width: 100%;
  max-width: 36ch;
  text-align: center;
  font-size: 0.69rem;
  font-weight: 400;
  line-height: 1.35;
  color: rgba(255,255,255,0.44);
}

.onboarding-step1-auth-btn{
  width: min(420px, 100%);
  margin: 11px auto 0;
  display: block;
  flex-shrink: 0;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  background: #3F5A3A;
  border: none;
  box-shadow: 0 8px 22px rgba(0,0,0,0.32);
  white-space: nowrap;
}

/* Password rules: readable on the dark sage overlay; still quieter than headline / CTA */
.onboarding-overlay .onboarding-step1-password-hint.muted,
.onboarding-overlay p.onboarding-step1-password-hint {
  font-size: clamp(0.66rem, 1.9vw, 0.76rem) !important;
  line-height: 1.35;
  font-weight: 400 !important;
  color: rgba(255, 255, 255, 0.58) !important;
  opacity: 1 !important; /* override .onboarding-slide p { opacity: 0.9 } */
  margin-top: 2px !important;
  margin-bottom: 0 !important;
}

.onboarding-step1-auth-btn:hover{
  background: #2D4527;
}

/* Legal links inside dark overlays inherit the sage palette instead of the
   browser-default blue/purple. */
.onboarding-overlay .horsehub-legal-link,
.horsehub-legal-update-banner .horsehub-legal-link {
  color: #C9D5C5;
  text-decoration: underline;
}
.onboarding-overlay .horsehub-legal-link:visited,
.horsehub-legal-update-banner .horsehub-legal-link:visited {
  color: #C9D5C5;
}
.horsehub-legal-link {
  color: #3F5A3A;
}
.horsehub-legal-link:visited {
  color: #3F5A3A;
}

/* Intro slide (step 1: "Everything your pet needs") – stronger hierarchy, premium spacing */
.onboarding-slide[data-step="1"] .onboarding-intro-headline{
  font-size: clamp(1.65rem, 4.5vw, 1.95rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 0 24px rgba(0,0,0,0.15);
  margin-top: 0;
  margin-bottom: 0.75em;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.onboarding-slide[data-step="1"] .onboarding-bullets{
  margin: 0;
  padding-left: 22px;
  font-size: 0.95rem;
  opacity: 0.92;
  list-style: disc;
}
.onboarding-slide[data-step="1"] .onboarding-bullets li{
  margin: 10px 0;
  line-height: 1.4;
}
.onboarding-slide[data-step="1"] .onboarding-bullets li::marker{
  color: var(--purple-soft);
}
.onboarding-slide[data-step="1"] .onboarding-bullets li strong{
  font-weight: 600;
  color: #fff;
}
.onboarding-slide[data-step="1"] .onboarding-intro-footer-note{
  margin: 14px 0 0;
  font-size: 0.875rem;
  opacity: 0.82;
  color: rgba(255,255,255,0.92);
  line-height: 1.4;
}

/* Step 2 overview slide (matches mobile screenshot layout) */
.onboarding-slide[data-step="2"] .onboarding-intro-headline{
  font-size: clamp(1.55rem, 4.3vw, 2.05rem);
  font-weight: 700;
  color: #fff;
  margin: 2px 0 0.72em;
  line-height: 1.18;
  max-width: 20ch;
}
.onboarding-slide[data-step="2"] .onboarding-bullets{
  margin: 0;
  padding-left: 1.05rem;
  list-style: disc;
  opacity: 0.95;
}
.onboarding-slide[data-step="2"] .onboarding-bullets li{
  margin: 0.48rem 0;
  line-height: 1.35;
  font-size: 1.01rem;
}
.onboarding-slide[data-step="2"] .onboarding-bullets li::marker{
  color: rgba(255,255,255,0.9);
}
.onboarding-slide[data-step="2"] .onboarding-bullets li strong{
  font-weight: 700;
  color: #fff;
}
.onboarding-slide[data-step="2"] .onboarding-intro-footer-note{
  margin-top: 0.78rem;
  color: rgba(255,255,255,0.92);
  font-size: 1.01rem;
  line-height: 1.32;
  max-width: 30ch;
}

.onboarding-slide[data-step="2"] .onboarding-overview-card{
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(16px, 3.2vw, 22px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.onboarding-slide .onboarding-bullets{
  margin:12px 0 0;
  padding-left:20px;
  font-size:0.95rem;
  opacity:0.9;
  list-style:disc;
}
.onboarding-slide .onboarding-bullets li{
  margin:6px 0;
}

/* Password field with visibility toggle */
.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.auth-password-wrap input {
  flex: 1;
  padding-right: 44px;
}
.auth-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.9;
  color: #374151;
  z-index: 2;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-password-toggle:hover { opacity: 1; }
/* On overlay the input is light – keep toggle icon dark so it’s visible */
.onboarding-overlay .auth-password-toggle {
  color: #374151;
}
.onboarding-overlay .auth-password-toggle:hover {
  color: #111;
}

/* Footer stays visible at the bottom */
.onboarding-footer{
  flex: 0 0 auto;
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  min-width: 0; /* allow nav to shrink so Next isn’t clipped (inner has overflow:hidden) */
  position: relative;
  z-index: 1;

  padding-top: 10px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.onboarding-dots {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.onboarding-dots span{
  width:8px;
  height:8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.6);
  margin-right:4px;
}
.onboarding-dots span.active{
  background:#fff;
}

.onboarding-nav {
  display: flex;
  flex-shrink: 1;
  min-width: 0;
  gap: clamp(8px, 2vw, 28px);
  justify-content: flex-end;
}
.onboarding-nav button{
  min-width: 0;
  flex: 0 1 auto;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color:#fff;
  border:1px solid rgba(255,255,255,0.24);
  /* Prevent double-tap zoom when tapping Back/Next quickly (iPad/App Store) */
  touch-action: manipulation;
}
.onboarding-nav button:active{ transform: scale(0.98); }
.onboarding-nav button:focus{
  outline: 2px solid rgba(255,255,255,0.65);
  outline-offset: 2px;
}

/* Auth form inside onboarding */
#authForm{
  margin-top:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
#authForm input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:none;
  font-size:0.95rem;
}
#authForm button[type="submit"],
#authForm #createAccountBtn,
#applyPromoBtn{
  border-radius:999px;
  border:none;
  padding:10px 14px;
  font-size:0.95rem;
}

.promo-block{ margin-top:8px; }
.promo-block label { color: #fff; }
.promo-row{ display:flex; gap:6px; margin-top:4px; }
.promo-message{ font-size:0.8rem; margin-top:4px; color: rgba(255,255,255,0.95); }

/* Onboarding: no grey text – use white, black or blue for readability (Guideline 4.0) */
.onboarding-overlay .muted,
.onboarding-overlay p.muted,
.onboarding-overlay small.muted {
  color: rgba(255,255,255,0.95);
}
.onboarding-overlay #authForm input {
  background: rgba(255,255,255,0.95);
  color: #111;
}
.onboarding-overlay #authForm input::placeholder {
  color: #374151;
}
.onboarding-overlay #authForm button[type="submit"],
.onboarding-overlay #authForm #createAccountBtn {
  background: #3F5A3A;
  color: #fff;
}
.onboarding-overlay #authForm button[type="submit"]:disabled,
.onboarding-overlay #authForm #createAccountBtn:disabled,
.onboarding-overlay .auth-primary-btn:disabled,
.onboarding-overlay .auth-secondary-btn:disabled {
  background: rgba(255,255,255,0.3);
  color: #111;
}
/* Auth button hierarchy: Create account primary, Sign in secondary (12–16px spacing, WCAG contrast) */
.onboarding-overlay .auth-buttons-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.onboarding-top-secondary-actions{
  margin-top: 0;
}
.onboarding-overlay .auth-primary-btn {
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  background: #2D4527;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.onboarding-demo-section{
  width: 100%;
  max-width: 420px;
  margin: 2px auto 0;
}
.onboarding-demo-label{
  margin: 0 0 6px;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.9);
}
.onboarding-demo-section .onboarding-demo-video-wrap{
  max-width: 420px;
  margin: 0 auto;
}
.onboarding-demo-section .onboarding-demo-video{
  max-height: min(26vh, 170px);
}
/* Step 1: video / badges / bullets sit lower and read as secondary to signup */
.onboarding-slide[data-step="1"] .onboarding-demo-section{
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.74;
}
.onboarding-slide[data-step="1"] .onboarding-demo-label{
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 5px;
}
.onboarding-slide[data-step="1"] .onboarding-demo-section .onboarding-demo-video{
  max-height: min(20vh, 142px);
}
.onboarding-features-list{
  width: 100%;
  max-width: 420px;
  margin: 2px auto 0;
  padding-left: 0;
  list-style: none;
  text-align: left;
}
.onboarding-features-list li{
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 0;
  width: 100%;
}
.onboarding-features-list li + li{
  margin-top: 6px;
}
.onboarding-slide[data-step="1"] .onboarding-features-list{
  margin-top: 8px;
  opacity: 0.62;
}
.onboarding-slide[data-step="1"] .onboarding-features-list li{
  font-size: 0.84rem;
  line-height: 1.32;
}
.onboarding-slide[data-step="1"] .onboarding-features-list li + li{
  margin-top: 5px;
}
.onboarding-step1-store-badges{
  margin: 4px auto 0;
  max-width: 420px;
  justify-content: center;
  gap: 14px;
}
.onboarding-slide[data-step="1"] .onboarding-step1-store-badges{
  margin-top: 12px;
  opacity: 0.66;
}
.onboarding-secondary-auth{
  width: 100%;
  max-width: 420px;
  margin: 2px auto 0;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
}
.onboarding-secondary-auth .promo-block{
  margin-top: 4px;
}
.onboarding-secondary-auth .promo-block label{
  display: block;
  margin-bottom: 3px;
  font-size: 0.82rem;
}
.onboarding-secondary-auth .promo-row{
  justify-content: center;
}
.onboarding-secondary-auth .promo-row input{
  max-width: 260px;
}
.onboarding-secondary-auth .muted.small{
  margin-top: 2px;
  margin-bottom: 2px;
}
.onboarding-overlay .auth-primary-btn:hover {
  background: #2D4527;
}
.onboarding-overlay .auth-primary-btn:active {
  transform: scale(0.99);
}
.onboarding-overlay .auth-secondary-btn {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.onboarding-overlay .auth-secondary-btn:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
}
.onboarding-overlay .auth-secondary-btn:active {
  background: rgba(255,255,255,0.1);
  transform: scale(0.99);
}
.onboarding-overlay #applyPromoBtn {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.onboarding-overlay .link-button {
  color: #93c5fd;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.onboarding-overlay .link-button:hover { color: #bfdbfe; }

/* Post-signup choice & subscription: cards on dark overlay – ensure no disappeared text */
.onboarding-overlay .card {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,0.08);
}
.onboarding-overlay .card .muted,
.onboarding-overlay .card p.muted,
.onboarding-overlay .card .card-subline,
.onboarding-overlay .subscription-paywall-card .card-subline,
.onboarding-overlay .subscription-paywall-card .muted {
  color: #374151;
}
.onboarding-overlay .card .join-family-row input,
.onboarding-overlay #postSignupFamilyCode {
  background: #f9fafb;
  color: #111;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  border-radius: 8px;
}
.onboarding-overlay .card .join-family-row input::placeholder,
.onboarding-overlay #postSignupFamilyCode::placeholder {
  color: #6b7280;
}
/* Cancel / ghost buttons on dark purple (outside cards) – use white so they don’t disappear */
.onboarding-overlay #postSignupChoice .btn-ghost,
.onboarding-overlay .onboarding-slide > .btn-ghost {
  color: rgba(255,255,255,0.95);
}
.onboarding-overlay #postSignupChoice .btn-ghost:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
/* Subscription card: Back / Cancel / Restore visible on white card */
.onboarding-overlay .subscription-paywall-card .btn-secondary,
.onboarding-overlay .subscription-paywall-card .btn-ghost {
  background: #f3f4f6;
  color: #111;
}
.onboarding-overlay .subscription-paywall-card .btn-ghost {
  background: transparent;
  color: #374151;
}
.onboarding-overlay .subscription-paywall-card .btn-ghost:hover {
  background: rgba(0,0,0,0.05);
}
.onboarding-overlay #postSignupFamilyStatus,
.onboarding-overlay .promo-message {
  color: #374151;
}
.onboarding-overlay .post-signup-primary-btn {
  width: 100%;
  border-radius: 999px;
  padding: 7px 12px;
  margin-top: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
  background: #4a7ec8;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.onboarding-overlay .post-signup-primary-btn:hover {
  background: #3d6dad;
  border-color: rgba(255, 255, 255, 0.2);
  transform: none;
  box-shadow: none;
}
.onboarding-overlay .post-signup-primary-btn:active {
  transform: scale(0.995);
  box-shadow: none;
}
.onboarding-overlay .post-signup-tertiary-card {
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(0,0,0,0.06);
}
.onboarding-overlay .post-signup-tertiary-card .pill {
  opacity: 0.86;
}
.onboarding-overlay .post-signup-options-wrap .card {
  width: 100%;
}

/* Small screens */
@media (max-width: 480px){
  .onboarding-inner{
    width: calc(100% - 24px);
    height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 420px;
    padding: 12px 14px 10px;
    border-radius: 22px;
  }
  .onboarding-single-hero{
    min-height: 0;
  }
  .onboarding-branding{
    gap: 0;
  }
  .onboarding-brand-lockup{
    gap: 4px;
    font-size: clamp(1.48rem, 6.1vw, 2rem);
  }
  .onboarding-brand-trust{
    margin-bottom: 12px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.48);
  }
  .onboarding-slide[data-step="1"]{
    padding-top: 10px;
  }
  .onboarding-slide[data-step="1"] .onboarding-landing-stack{
    margin-top: 0;
    gap: 6px;
  }
  .onboarding-slide[data-step="1"] #authForm{
    margin-top: 0;
  }
  .onboarding-step1-hero .onboarding-step1-subtitle{
    margin-bottom: 12px;
  }
  .onboarding-overlay p.onboarding-step1-password-hint,
  .onboarding-overlay .onboarding-step1-password-hint.muted {
    color: rgba(255, 255, 255, 0.66) !important;
    font-size: 0.74rem !important;
  }
  .onboarding-step1-auth-btn{
    width: 100%;
    font-size: 0.92rem;
    padding: 13px 14px;
    margin: 9px auto 0;
    line-height: 1.2;
    white-space: nowrap;
  }
  .onboarding-demo-section .onboarding-demo-video{
    max-height: min(22vh, 150px);
  }
  .onboarding-slide[data-step="1"] .onboarding-demo-section .onboarding-demo-video{
    max-height: min(18vh, 128px);
  }
  .onboarding-step1-hero .onboarding-step1-headline{
    font-size: clamp(0.94rem, 2.95vw, 1.12rem);
    letter-spacing: -0.02em;
  }
  .onboarding-step1-hero .onboarding-step1-subtitle{
    font-size: 0.78rem;
    max-width: min(24rem, 94vw);
  }
  .onboarding-step1-trial-note{
    margin-top: 4px;
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.4);
  }
  .onboarding-slide h2{
    font-size: 1.62rem;
    line-height: 1.15;
  }
}

/* ---------- Family sharing card ---------- */
.family-card {
  margin: 12px 0 20px;
}

.family-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.family-code-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.family-premium-chip {
  font-size: 0.72rem;
  color: #6b7280;
}

.family-invite-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(8px);
  background: #111827;
  color: #fff;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10050;
}

.family-invite-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.family-code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.family-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-top: 2px;
}

.family-code-placeholder {
  color: #9ca3af;
}

.join-family-form {
  margin-top: 6px;
}

.join-family-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  min-width: 0; /* Allow flex container to shrink */
}

.join-family-row input {
  flex: 1;
  min-width: 0; /* Allow input to shrink below content size */
}

.join-family-row button {
  flex-shrink: 0; /* Prevent button from shrinking */
  white-space: nowrap; /* Keep button text on one line */
}

/* Text-style button (used for "Join a family with a code") */
.btn-text {
  transition: transform 0.12s ease, background 0.12s ease;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--purple);
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .family-card {
    margin: 8px 0 16px;
  }
}

.text-list {
  margin: 6px 0 4px;
  padding-left: 18px;
  font-size: 0.9rem;
  color: #4b5563;
}
.text-list li + li {
  margin-top: 2px;
}





/* Pet-friendly places map */
.places-map-wrapper {
  margin-top: 10px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  background: linear-gradient(135deg, #a4f3d5, #e4fff1);
  min-height: 260px;
}

.places-map-canvas {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
}

@media (max-width: 600px) {
  .places-map-canvas {
    height: 260px;
  }
}

/* Pet-friendly places filters */
.places-filter-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.places-filter-pill {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  border: 1px solid rgba(55, 35, 69, 0.18);
  background: rgba(255, 255, 255, 0.75);
  color: #3F5A3A;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
  transition: background 0.18s ease, box-shadow 0.18s ease,
    transform 0.12s ease;
}

.places-filter-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.places-filter-pill.is-active {
  background: linear-gradient(135deg, #a4f3d5, #e4fff1);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.2);
}


.places-filters {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.places-filter-btn {
  padding: 6px 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
  font-size: 0.9rem;
}

.places-filter-btn:hover {
  background: #f1f1f1;
}

/* Pet-friendly places disclaimer text */
.places-disclaimer {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Pet-friendly places map view selector */
.places-view-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.places-view-label {
  font-size: 0.75rem;
}

.places-view-select {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 35, 69, 0.2);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}


/* ---------- Family members list (owner) ---------- */
.member-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.75);
}

.member-name {
  font-weight: 600;
}

.member-meta {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted);
}

.member-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}



/* Web-only: store buttons under the sign-in form */
.web-only-store-panel {
  margin-top: 6px;
}

/* Web-only: panel shown after "Create account" on website – complete signup via app */
.web-signup-complete-panel {
  margin-top: 8px;
}
.web-signup-complete-heading {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}
.web-signup-complete-message {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.45;
}
.web-signup-complete-back {
  margin: 20px 0 0;
}
.web-signup-complete-back .link-button {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

/* Auth tabs (Sign in | Create account) – BoatMatey-style, same purple overlay */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.auth-tab {
  padding: 10px 16px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.auth-tab:hover {
  color: #fff;
}
.auth-tab.active {
  color: #fff;
  border-bottom-color: #93c5fd;
}

/* Create-account panel (separate view, same purple / paw) */
.web-create-account-panel {
  margin-top: 8px;
}
.web-create-account-heading {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}
.web-create-account-subtext {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.95);
}
.web-create-account-form .auth-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 6px;
}
.web-create-account-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  font-size: 1rem;
  box-sizing: border-box;
  margin-bottom: 16px;
}
.web-create-account-form input::placeholder {
  color: #374151;
}
.web-create-account-form .auth-primary-btn {
  width: 100%;
  margin-top: 4px;
}

/* Clear space ~1/3 of badge height between badges per guidelines */
.web-store-buttons {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  align-items: center;
}

.web-store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.web-store-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Official store badges - identical size, no flex growth/shrink */
.web-store-btn.web-store-badge {
  padding: 0;
  border: none;
  background: transparent;
  display: inline-block;
  flex: 0 0 200px;
  width: 200px;
  height: 60px;
}

.web-store-btn.web-store-badge:hover {
  background: transparent;
  opacity: 0.9;
}

.web-store-badge-inner {
  display: block;
  width: 200px;
  height: 60px;
  overflow: hidden;
  line-height: 0;
}

.web-store-badge-img {
  width: 200px;
  height: 60px;
  object-fit: contain;
  object-position: center;
  display: block;
  vertical-align: top;
}

@media (max-width: 480px) {
  .web-store-btn.web-store-badge {
    flex: 0 0 180px;
    width: 180px;
    height: 54px;
  }
  .web-store-badge-inner {
    width: 180px;
    height: 54px;
  }
  .web-store-badge-img {
    width: 180px;
    height: 54px;
  }
  .web-store-buttons {
    gap: 24px;
  }
}


/* --- Insurance document viewer --- */
.doc-viewer{
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px;
  background: rgba(0,0,0,0.18);
}
.doc-viewer-header{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}
.doc-viewer-title{
  font-weight: 700;
  font-size: 14px;
  opacity: 0.95;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#docViewerFrame{
  width:100%;
  height: 520px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}

.lost-back-btn{
  appearance:none;
  -webkit-appearance:none;
  border: 1px solid rgba(38, 20, 68, 0.25);
  background: rgba(255, 255, 255, 0.92);
  color: #1F3919;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  margin-right: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}
.lost-back-btn:active{
  transform: scale(0.99);
}
@media (max-width: 480px){
  .lost-back-btn{
    padding: 8px 10px;
    border-radius: 14px;
  }
}


.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 820px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.home-card.home-card-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.home-card-subtle {
  font-size: 12px;
  opacity: 0.85;
}

/* --- Treatment detail form (Vaccination & treatment) — layout inspired by Stitch Treatment export --- */
#treatment-detail-view .horsehub-treatment-detail-shell {
  overflow: hidden;
}
#treatment-detail-view .horsehub-treatment-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(63, 90, 58, 0.12);
}
#treatment-detail-view .horsehub-treatment-back-btn {
  align-self: flex-start;
  font-weight: 500;
  opacity: 0.92;
}
#treatment-detail-view .horsehub-treatment-detail-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4c3e7b;
}
#treatment-detail-view .horsehub-treatment-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 12px;
}
#treatment-detail-view .horsehub-treatment-detail-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #1b1430;
}
#treatment-detail-view .horsehub-treatment-detail-pill {
  font-size: 0.7rem;
}
#treatment-detail-view .horsehub-treatment-detail-lede {
  margin: 8px 0 0;
  max-width: 40rem;
  line-height: 1.45;
  font-size: 0.9rem;
}

#treatmentForm.horsehub-treatment-detail-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

#treatment-detail-view .horsehub-treatment-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
#treatment-detail-view .horsehub-treatment-section-icon {
  width: 10px;
  height: 22px;
  border-radius: 4px;
  background: #4c3e7b;
  flex-shrink: 0;
}
#treatment-detail-view .horsehub-treatment-section-icon--accent {
  background: #5b4a8f;
}
#treatment-detail-view .horsehub-treatment-section-icon--muted {
  background: #7c6aa3;
  opacity: 0.88;
}
#treatment-detail-view .horsehub-treatment-section-icon--note {
  background: #4c3e7b;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  position: relative;
}
#treatment-detail-view .horsehub-treatment-section-icon--note::after {
  content: "";
  position: absolute;
  inset: 6px 5px;
  border-radius: 2px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-top-width: 6px;
}
#treatment-detail-view .horsehub-treatment-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f1633;
  letter-spacing: -0.01em;
}
#treatment-detail-view .horsehub-treatment-section-body {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(63, 90, 58, 0.14);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 4px 18px rgba(63, 90, 58, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#treatment-detail-view .horsehub-treatment-section-body .field-group {
  width: 100%;
}

#treatment-detail-view .horsehub-treatment-type-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  #treatment-detail-view .horsehub-treatment-type-name-row {
    grid-template-columns: 1fr;
  }
}

#treatment-detail-view .horsehub-treatment-date-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  #treatment-detail-view .horsehub-treatment-date-grid {
    grid-template-columns: 1fr;
  }
}
#treatment-detail-view .horsehub-treatment-field-optional label {
  color: #4b5563;
  font-weight: 480;
}
#treatment-detail-view .horsehub-treatment-optional-tag {
  font-weight: 500;
  color: #6b7280;
  font-size: 0.85em;
}

#treatment-detail-view .horsehub-treatment-reminder-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ede7ff 0%, #f3efff 100%);
  border: 1px solid rgba(63, 90, 58, 0.18);
}
#treatment-detail-view .horsehub-treatment-reminder-callout-text {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#treatment-detail-view .horsehub-treatment-reminder-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #352763;
}
#treatment-detail-view .horsehub-treatment-reminder-hint {
  font-size: 0.8rem;
  line-height: 1.35;
}
#treatment-detail-view .horsehub-treatment-reminder-check {
  flex-shrink: 0;
  margin: 0;
  font-weight: 600;
  font-size: 0.88rem;
  color: #312654;
}

#treatment-detail-view .horsehub-treatment-upload-card {
  margin-top: 2px;
}
#treatment-detail-view .horsehub-treatment-upload-drop {
  margin-top: 8px;
  padding: 14px 12px;
  border: 2px dashed rgba(63, 90, 58, 0.28);
  border-radius: 12px;
  background: rgba(245, 248, 243, 0.65);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
#treatment-detail-view .horsehub-treatment-upload-drop:focus-within {
  border-color: #4c3e7b;
  background: rgba(255, 255, 255, 0.95);
}
#treatment-detail-view .horsehub-treatment-doc-status {
  display: block;
  font-weight: 600;
  margin-top: 2px;
}

#treatment-detail-view .horsehub-treatment-section-body input[type="text"],
#treatment-detail-view .horsehub-treatment-section-body input[type="date"],
#treatment-detail-view .horsehub-treatment-section-body select,
#treatment-detail-view .horsehub-treatment-section-body textarea {
  background: #faf9fc;
  border-color: #cfc6e8;
}
#treatment-detail-view .horsehub-treatment-section-body textarea {
  min-height: 88px;
}
#treatment-detail-view .horsehub-treatment-section-body select:focus,
#treatment-detail-view .horsehub-treatment-section-body input:focus,
#treatment-detail-view .horsehub-treatment-section-body textarea:focus {
  border-color: #4c3e7b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 90, 58, 0.15);
}

#treatment-detail-view .horsehub-treatment-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 4px;
}
#treatment-detail-view .horsehub-treatment-actions-save {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(63, 90, 58, 0.22);
}
#treatment-detail-view .horsehub-treatment-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
#treatment-detail-view .horsehub-treatment-actions-cancel {
  min-width: 100px;
}

#section-treatments #treatment-detail-view .muted,
#section-treatments #treatment-detail-view small.muted {
  color: #4b5563;
}

/* --- Travel detail form (Passport & travel) — aligned with treatment premium style --- */
#travel-detail-view .horsehub-travel-detail-shell {
  overflow: hidden;
}
#travel-detail-view .horsehub-travel-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(63, 90, 58, 0.12);
}
#travel-detail-view .horsehub-travel-back-btn {
  align-self: flex-start;
  font-weight: 500;
  opacity: 0.92;
}
#travel-detail-view .horsehub-travel-detail-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4c3e7b;
}
#travel-detail-view .horsehub-travel-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 12px;
}
#travel-detail-view .horsehub-travel-detail-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #1b1430;
}
#travel-detail-view .horsehub-travel-detail-pill {
  font-size: 0.7rem;
}
#travel-detail-view .horsehub-travel-detail-lede {
  margin: 8px 0 0;
  max-width: 40rem;
  line-height: 1.45;
  font-size: 0.9rem;
}

#travelForm.horsehub-travel-detail-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
#travel-detail-view .horsehub-travel-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
#travel-detail-view .horsehub-travel-section-icon {
  width: 10px;
  height: 22px;
  border-radius: 4px;
  background: #4c3e7b;
  flex-shrink: 0;
}
#travel-detail-view .horsehub-travel-section-icon--accent {
  background: #5b4a8f;
}
#travel-detail-view .horsehub-travel-section-icon--muted {
  background: #7c6aa3;
  opacity: 0.88;
}
#travel-detail-view .horsehub-travel-section-icon--note {
  background: #4c3e7b;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  position: relative;
}
#travel-detail-view .horsehub-travel-section-icon--note::after {
  content: "";
  position: absolute;
  inset: 6px 5px;
  border-radius: 2px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-top-width: 6px;
}
#travel-detail-view .horsehub-travel-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f1633;
}
#travel-detail-view .horsehub-travel-section-body {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(63, 90, 58, 0.14);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 4px 18px rgba(63, 90, 58, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#travel-detail-view .horsehub-travel-section-body .field-group {
  width: 100%;
}
#travel-detail-view .horsehub-travel-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#travel-detail-view .horsehub-travel-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#travel-detail-view .horsehub-travel-field-optional label {
  color: #4b5563;
  font-weight: 480;
}
#travel-detail-view .horsehub-travel-status-badge {
  border: 1px solid rgba(63, 90, 58, 0.18);
  background: rgba(63, 90, 58, 0.08);
}
#travel-detail-view .horsehub-travel-upload-card {
  margin-top: 2px;
}
#travel-detail-view .horsehub-travel-upload-drop {
  margin-top: 8px;
  padding: 14px 12px;
  border: 2px dashed rgba(63, 90, 58, 0.28);
  border-radius: 12px;
  background: rgba(245, 248, 243, 0.65);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#travel-detail-view .horsehub-travel-upload-drop:focus-within {
  border-color: #4c3e7b;
  background: rgba(255, 255, 255, 0.95);
}
#travel-detail-view .horsehub-travel-doc-status {
  display: block;
  font-weight: 600;
  margin-top: 2px;
}
#travel-detail-view .horsehub-travel-section-body input[type="text"],
#travel-detail-view .horsehub-travel-section-body input[type="date"],
#travel-detail-view .horsehub-travel-section-body select,
#travel-detail-view .horsehub-travel-section-body textarea {
  background: #faf9fc;
  border-color: #cfc6e8;
}
#travel-detail-view .horsehub-travel-section-body textarea {
  min-height: 88px;
}
#travel-detail-view .horsehub-travel-section-body input:focus,
#travel-detail-view .horsehub-travel-section-body select:focus,
#travel-detail-view .horsehub-travel-section-body textarea:focus {
  border-color: #4c3e7b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 90, 58, 0.15);
}
#travel-detail-view .horsehub-travel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 4px;
}
#travel-detail-view .horsehub-travel-actions-save {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(63, 90, 58, 0.22);
}
#travel-detail-view .horsehub-travel-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
#travel-detail-view .horsehub-travel-actions-cancel {
  min-width: 100px;
}
#section-travel #travel-detail-view .muted,
#section-travel #travel-detail-view small.muted {
  color: #4b5563;
}
@media (max-width: 640px) {
  #travel-detail-view .horsehub-travel-two-col,
  #travel-detail-view .horsehub-travel-date-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Licence detail form (Pet licence) — aligned with treatment/travel premium style --- */
#licence-detail-view .horsehub-licence-detail-shell {
  overflow: hidden;
}
#licence-detail-view .horsehub-licence-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(63, 90, 58, 0.12);
}
#licence-detail-view .horsehub-licence-back-btn {
  align-self: flex-start;
  font-weight: 500;
  opacity: 0.92;
}
#licence-detail-view .horsehub-licence-detail-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4c3e7b;
}
#licence-detail-view .horsehub-licence-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 12px;
}
#licence-detail-view .horsehub-licence-detail-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #1b1430;
}
#licence-detail-view .horsehub-licence-detail-pill {
  font-size: 0.7rem;
}
#licence-detail-view .horsehub-licence-detail-lede {
  margin: 8px 0 0;
  max-width: 40rem;
  line-height: 1.45;
  font-size: 0.9rem;
}

#licenceForm.horsehub-licence-detail-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
#licence-detail-view .horsehub-licence-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
#licence-detail-view .horsehub-licence-section-icon {
  width: 10px;
  height: 22px;
  border-radius: 4px;
  background: #4c3e7b;
  flex-shrink: 0;
}
#licence-detail-view .horsehub-licence-section-icon--accent {
  background: #5b4a8f;
}
#licence-detail-view .horsehub-licence-section-icon--muted {
  background: #7c6aa3;
  opacity: 0.88;
}
#licence-detail-view .horsehub-licence-section-icon--note {
  background: #4c3e7b;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  position: relative;
}
#licence-detail-view .horsehub-licence-section-icon--note::after {
  content: "";
  position: absolute;
  inset: 6px 5px;
  border-radius: 2px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-top-width: 6px;
}
#licence-detail-view .horsehub-licence-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f1633;
}
#licence-detail-view .horsehub-licence-section-body {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(63, 90, 58, 0.14);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 4px 18px rgba(63, 90, 58, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#licence-detail-view .horsehub-licence-section-body .field-group {
  width: 100%;
}
#licence-detail-view .horsehub-licence-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#licence-detail-view .horsehub-licence-upload-card {
  margin-top: 2px;
}
#licence-detail-view .horsehub-licence-upload-drop {
  margin-top: 8px;
  padding: 14px 12px;
  border: 2px dashed rgba(63, 90, 58, 0.28);
  border-radius: 12px;
  background: rgba(245, 248, 243, 0.65);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#licence-detail-view .horsehub-licence-upload-drop:focus-within {
  border-color: #4c3e7b;
  background: rgba(255, 255, 255, 0.95);
}
#licence-detail-view .horsehub-licence-doc-status {
  display: block;
  font-weight: 600;
  margin-top: 2px;
}
#licence-detail-view .horsehub-licence-section-body input[type="text"],
#licence-detail-view .horsehub-licence-section-body input[type="date"],
#licence-detail-view .horsehub-licence-section-body select,
#licence-detail-view .horsehub-licence-section-body textarea {
  background: #faf9fc;
  border-color: #cfc6e8;
}
#licence-detail-view .horsehub-licence-section-body textarea {
  min-height: 88px;
}
#licence-detail-view .horsehub-licence-section-body input:focus,
#licence-detail-view .horsehub-licence-section-body select:focus,
#licence-detail-view .horsehub-licence-section-body textarea:focus {
  border-color: #4c3e7b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 90, 58, 0.15);
}


.horsehub-plan-status-card {
  background: linear-gradient(140deg, rgba(245, 235, 255, 0.95), rgba(220, 227, 216, 0.88));
}

.horsehub-plan-status-card-title {
  font-size: 1.04rem;
  font-weight: 700;
  color: #3b0764;
  margin-bottom: 6px;
}

.horsehub-plan-status-card-copy {
  margin: 0 0 12px;
  color: #3F5A3A;
}

.horsehub-plan-status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.horsehub-plan-status-block {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(139, 167, 130, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
}

.horsehub-plan-status-block h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: #2D4527;
}

.horsehub-plan-status-block p {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
}

.horsehub-soft-warning-card {
  background: linear-gradient(140deg, rgba(255, 243, 214, 0.95), rgba(242, 231, 255, 0.9));
  border-color: rgba(217, 119, 6, 0.28);
}









.horsehub-card-status-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, 0.24);
  max-width: fit-content;
}

.horsehub-card-status-subtext {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #5C7A53;
}




#licence-detail-view .horsehub-licence-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 4px;
}
#licence-detail-view .horsehub-licence-actions-save {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(63, 90, 58, 0.22);
}
#licence-detail-view .horsehub-licence-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
#licence-detail-view .horsehub-licence-actions-cancel {
  min-width: 100px;
}
#section-licence #licence-detail-view .muted,
#section-licence #licence-detail-view small.muted {
  color: #4b5563;
}
@media (max-width: 640px) {
  #licence-detail-view .horsehub-licence-two-col {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   MEDICATIONS — emerald/mint theme (distinct from existing)
   ========================================================= */
body.section-medications {
  background: #d1fae5;
}
body.section-medications .app-shell::before {
  background-size: 240px 240px;
  background-position: right 32px bottom 150px;
  opacity: 0.12;
}

/* Home + pet-dashboard cards */
.home-card[data-theme="medications"] {
  background: linear-gradient(135deg, #6ee7b7, #ecfdf5);
}
.home-card[data-theme="medications"] .card {
  background: linear-gradient(135deg, rgba(255,255,255,0.88), rgba(209,250,229,0.95));
}
#section-home .home-card[data-theme="medications"] .home-card-icon {
  background: rgba(16, 185, 129, 0.16);
}
/* Pet-dashboard primary grid: white card with coloured left band — matches Vets/Treatments/Licence/etc. */
#section-pet-dashboard .pet-dashboard-grid-primary .home-card[data-theme="medications"] {
  border-left: 3px solid #10b981;
}

/* Section background card (list area) */
#section-medications .card {
  background: linear-gradient(135deg, #34d399, #d1fae5);
  color: #1f2937;
}
#section-medications .card .muted,
#section-medications .card p.muted,
#section-medications .card small.muted,
#section-medications .card .card-subline,
#section-medications .card .pill,
#section-medications .card .pill strong {
  color: #064e3b;
}

/* Page shell + decorative paw watermark, matches licence pattern */
#section-medications .medication-page-shell {
  position: relative;
  gap: 16px;
  margin: 4px 0 16px;
  grid-template-columns: minmax(0, 1fr);
}
#section-medications .medication-page-shell::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 112px;
  height: 112px;
  background: url("Horse_logo_Transparent_Green.png") no-repeat center center;
  background-size: contain;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}
#section-medications #medications-list-column > .card,
#section-medications .medication-overview-panel {
  position: relative;
  z-index: 1;
}

/* Overview snapshot panel (right column) */
#section-medications .medication-overview-panel {
  background: linear-gradient(155deg, rgba(255,255,255,0.96), rgba(209,250,229,0.92));
  border: 1px solid rgba(4, 120, 87, 0.24);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(4, 120, 87, 0.13);
  padding: 16px;
}
#section-medications .medication-overview-panel .overview-badge {
  background: rgba(255,255,255,0.65);
  border-color: rgba(4, 120, 87, 0.16);
}
#section-medications .medication-overview-panel .overview-stat {
  border-color: rgba(4, 120, 87, 0.16);
}
#section-medications .medication-overview-panel .overview-stat strong {
  color: #064e3b;
}
#section-medications.medication-detail-active .medication-overview-panel {
  display: none;
}
#section-medications.medication-detail-active .medication-page-shell::after {
  display: none;
}
#section-medications.medication-detail-active .split-layout {
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  #section-medications .medication-page-shell {
    grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
    align-items: start;
  }
}

/* Detail view (add/edit form) — mirrors horsehub-licence-* exactly with emerald accent */
#medication-detail-view .horsehub-medication-detail-shell {
  overflow: hidden;
}
#medication-detail-view .horsehub-medication-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(4, 120, 87, 0.14);
}
#medication-detail-view .horsehub-medication-back-btn {
  align-self: flex-start;
  font-weight: 500;
  opacity: 0.92;
}
#medication-detail-view .horsehub-medication-detail-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #047857;
}
#medication-detail-view .horsehub-medication-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 12px;
}
#medication-detail-view .horsehub-medication-detail-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #052e21;
}
#medication-detail-view .horsehub-medication-detail-pill {
  font-size: 0.7rem;
}
#medication-detail-view .horsehub-medication-detail-lede {
  margin: 8px 0 0;
  max-width: 40rem;
  line-height: 1.45;
  font-size: 0.9rem;
}

#medicationForm.horsehub-medication-detail-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
#medication-detail-view .horsehub-medication-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
#medication-detail-view .horsehub-medication-section-icon {
  width: 10px;
  height: 22px;
  border-radius: 4px;
  background: #047857;
  flex-shrink: 0;
}
#medication-detail-view .horsehub-medication-section-icon--accent {
  background: #059669;
}
#medication-detail-view .horsehub-medication-section-icon--muted {
  background: #10b981;
  opacity: 0.88;
}
#medication-detail-view .horsehub-medication-section-icon--note {
  background: #047857;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  position: relative;
}
#medication-detail-view .horsehub-medication-section-icon--note::after {
  content: "";
  position: absolute;
  inset: 6px 5px;
  border-radius: 2px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-top-width: 6px;
}
#medication-detail-view .horsehub-medication-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #052e21;
}
#medication-detail-view .horsehub-medication-section-body {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(4, 120, 87, 0.16);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 4px 18px rgba(4, 120, 87, 0.07);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#medication-detail-view .horsehub-medication-section-body .field-group {
  width: 100%;
}
#medication-detail-view .horsehub-medication-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#medication-detail-view .horsehub-medication-section-body input[type="text"],
#medication-detail-view .horsehub-medication-section-body input[type="number"],
#medication-detail-view .horsehub-medication-section-body input[type="date"],
#medication-detail-view .horsehub-medication-section-body select,
#medication-detail-view .horsehub-medication-section-body textarea {
  background: #f0fdf4;
  border-color: #a7f3d0;
}
#medication-detail-view .horsehub-medication-section-body textarea {
  min-height: 88px;
}
#medication-detail-view .horsehub-medication-section-body input:focus,
#medication-detail-view .horsehub-medication-section-body select:focus,
#medication-detail-view .horsehub-medication-section-body textarea:focus {
  border-color: #047857;
  outline: none;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}
#medication-detail-view .horsehub-medication-runout-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(167, 243, 208, 0.45), rgba(209, 250, 229, 0.55));
  border: 1px solid rgba(4, 120, 87, 0.18);
}
#medication-detail-view .horsehub-medication-runout-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#medication-detail-view .horsehub-medication-runout-title {
  font-weight: 700;
  color: #064e3b;
  font-size: 0.9rem;
}
#medication-detail-view .horsehub-medication-runout-hint {
  font-size: 0.85rem;
  color: #065f46;
}
#medication-detail-view .horsehub-medication-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 4px;
}
#medication-detail-view .horsehub-medication-actions-save {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(4, 120, 87, 0.22);
}
#medication-detail-view .horsehub-medication-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
#medication-detail-view .horsehub-medication-actions-cancel {
  min-width: 100px;
}
#section-medications #medication-detail-view .muted,
#section-medications #medication-detail-view small.muted {
  color: #4b5563;
}
@media (max-width: 640px) {
  #medication-detail-view .horsehub-medication-two-col {
    grid-template-columns: 1fr;
  }
}

/* ── Inactivity warning banner ──────────────────────────────────────── */
.horsehub-inactivity-warning-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 14px;
  background: linear-gradient(140deg, rgba(255, 237, 213, 0.98), rgba(254, 215, 170, 0.92));
  border: 2px solid rgba(234, 88, 12, 0.5);
  box-shadow: 0 4px 20px rgba(194, 65, 12, 0.15);
  cursor: default;
}
.horsehub-inactivity-warning-banner[hidden] {
  display: none;
}
.horsehub-inactivity-warning-banner__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.horsehub-inactivity-warning-banner__body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.horsehub-inactivity-warning-banner__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.2;
}
.horsehub-inactivity-warning-banner__copy {
  min-width: 0;
}
.horsehub-inactivity-warning-banner__title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #7c2d12;
  line-height: 1.3;
}
.horsehub-inactivity-warning-banner__text {
  margin: 0;
  font-size: 0.84rem;
  color: #9a3412;
  line-height: 1.45;
}
.horsehub-inactivity-warning-banner__close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 0.85rem;
  color: #c2410c;
  cursor: pointer;
  line-height: 1;
  border-radius: 6px;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.horsehub-inactivity-warning-banner__close:hover,
.horsehub-inactivity-warning-banner__close:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(234, 88, 12, 0.4);
  outline-offset: 2px;
}
.horsehub-inactivity-warning-banner__cta {
  display: inline-block;
  background: #ea580c;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: background 0.15s;
}
.horsehub-inactivity-warning-banner__cta:hover,
.horsehub-inactivity-warning-banner__cta:focus-visible {
  background: #c2410c;
  outline: 2px solid rgba(234, 88, 12, 0.5);
  outline-offset: 2px;
}

/* ── Legal update notice banner ─────────────────────────────────────── */
.horsehub-legal-update-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 14px;
  background: linear-gradient(140deg, rgba(232, 237, 229, 0.95), rgba(220, 227, 216, 0.88));
  border: 2px solid rgba(63, 90, 58, 0.75);
  box-shadow: 0 4px 16px rgba(76, 29, 149, 0.1);
  cursor: pointer;
}
/* Override the UA [hidden] display:none so we can control visibility via JS */
.horsehub-legal-update-banner[hidden] {
  display: none;
}
.horsehub-legal-update-banner__body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.horsehub-legal-update-banner__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.2;
}
.horsehub-legal-update-banner__copy {
  min-width: 0;
}
.horsehub-legal-update-banner__main {
  margin: 0 0 3px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #3b0764;
  line-height: 1.35;
}
.horsehub-legal-update-banner__sub {
  margin: 0;
  font-size: 0.84rem;
  color: #3F5A3A;
  line-height: 1.35;
}
.horsehub-legal-update-banner__close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 0.85rem;
  color: #5C7A53;
  cursor: pointer;
  line-height: 1;
  border-radius: 6px;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.horsehub-legal-update-banner__close:hover,
.horsehub-legal-update-banner__close:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(63, 90, 58, 0.35);
  outline-offset: 2px;
}

