/* Travaillo — warm "Village" theme: deep teal ink, warm orange, soft cream, large soft cards */
:root {
  --navy: #123c3f; /* deep teal ink: navigation, dark panels */
  --navy-2: #1d5357;
  --gold: #f2b84b;
  --primary: #c2410c; /* warm orange, 5.2:1 with white text (WCAG AA) */
  --primary-hover: #9a3412;
  --primary-light: #fff0e6;
  --success: #15803d;
  --success-hover: #166534;
  --bg: #faf6ef; /* soft cream */
  --card: #ffffff;
  --text: #1f2a2c;
  --muted: #5b6668; /* 5.6:1 on white, 5.2:1 on --bg (WCAG AA) */
  --divider: #ece4d8;
  --hover: #f6f0e6;
  --input: #f6f0e6;
  --secondary-btn: #f2ebdf;
  --secondary-btn-hover: #e8dfcf;
  --danger: #c81e1e;
  --shadow: 0 10px 30px rgba(31, 42, 44, 0.06);
  --shadow-lg: 0 24px 60px rgba(31, 42, 44, 0.18);
  --nav-h: 76px;
  --rail-w: 250px;
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: "Space Grotesk", Inter, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

/* The app's root element (see app.dart) lays out nothing itself. */
.app-root { display: contents; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.3px; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.6; }
input, textarea, select { font: inherit; color: inherit; }
/* Multiline fields grow with their text up to this (see index.html), then scroll. */
textarea { max-height: 50vh; }
hr { border: none; border-top: 1px solid var(--divider); margin: 12px 0; }
h1, h2, h3, h4, p { margin: 0; }
h2 { font-size: 20px; }
h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
h4 { font-size: 17px; color: var(--muted); font-weight: 600; margin: 8px 8px; }
img { display: block; }

.icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.icon-illustration img { display: block; object-fit: contain; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 12px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre-line { white-space: pre-line; }
.error-text { color: var(--danger); font-size: 14px; margin: 8px 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.15s, transform 0.1s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary-btn); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--secondary-btn-hover); }
.btn-light-primary { background: var(--primary-light); color: var(--primary); }
.btn-light-primary:hover { background: #dbe7f2; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--success-hover); }
.btn-lg { height: 48px; font-size: 17px; padding: 0 16px; }
.btn.wide { min-width: 194px; }
.btn-row { display: flex; gap: 8px; margin-top: 6px; }
.btn-row .btn { flex: 1; }
.animal-actions { flex-wrap: wrap; }
.animal-actions .btn { min-width: max-content; white-space: nowrap; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
}
.icon-btn:hover { background: var(--hover); }
.icon-btn.green, .composer-action.green { color: #45bd62; }
.icon-btn.orange, .composer-action.orange { color: #f7b928; }
.icon-btn.send { color: var(--primary); }

.round-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--secondary-btn);
  color: var(--text);
}
.round-btn:hover { background: var(--secondary-btn-hover); }
.round-btn.active { background: var(--primary-light); color: var(--primary); }

.link-btn { color: var(--text); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn.muted { color: var(--muted); font-weight: 400; }

.count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.count-badge.inline { position: static; margin-left: auto; }

/* ---------- Avatar & badges ---------- */
.avatar { position: relative; flex-shrink: 0; border-radius: 50%; }
.avatar img, .avatar-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.avatar-ring img, .avatar-ring .avatar-initials { box-shadow: 0 0 0 3px var(--primary); }
/* "Looking to adopt" frame over the avatar edge (see _AvatarFrame) */
.avatar-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.avatar-frame text {
  fill: #fff;
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.intro-list .adopting-item, .intro-list .adopting-item strong, .intro-list .adopting-item .icon { color: #0f766e; }

/* Toggle switch row (role="switch") */
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  margin: 12px 0;
  text-align: left;
  border-radius: var(--radius-sm);
  background: var(--input);
}
.switch-row > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
/* In a dialog the body's gap already spaces the rows. */
.modal-body > .switch-row { margin: 0; }
.switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: #c3ccd9;
  transition: background 0.2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 42, 44, 0.25);
  transition: transform 0.2s ease;
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) {
  .switch, .switch::after { transition: none; }
}
.online-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28%;
  height: 28%;
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  background: #31a24c;
  border: 2px solid #fff;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}
.badge-dog { background: #e8eefb; color: #1d4ed8; }
.badge-cat { background: #fff1e6; color: #d35400; }
.badge-teams { gap: 4px; background: #e8eefb; color: #1d4ed8; }
.badge-owner { background: #fdf2d6; color: #8a5a00; }
.badge-collaborator { background: #e3f1ee; color: #1d5357; }
.badge-moderator { background: #ece9f8; color: #4c3a9a; }
.badge-role { margin-left: 4px; }

/* ---------- Shell: rail + top bar ---------- */
.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1; min-width: 0; margin-left: var(--rail-w); }

/* Light menu on the page background, like Facebook's left column. */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 10px;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
}
.rail-brand { display: flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 34px; }
/* Logo: an orange cat paw, then the name in heavy type. */
.brand-logo {
  display: inline-flex;
  align-items: baseline;
  font: 700 1em/1 var(--font-display);
  letter-spacing: -0.045em;
  color: var(--navy);
  white-space: nowrap;
}
/* The Travaillo logo, a little taller than the letters. */
.brand-paw { width: 1.1em; height: 1.1em; object-fit: contain; margin-right: 0.18em; flex-shrink: 0; align-self: center; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  transition: background-color 0.15s;
}
.rail-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item.active { background: var(--secondary-btn-hover); font-weight: 600; }
.rail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--tile);
  color: #fff;
}
@media (hover: hover) and (pointer: fine) {
  .rail-item:hover:not(.active) { background: var(--secondary-btn-hover); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(238, 241, 246, 0.82);
  backdrop-filter: blur(14px);
}
.topbar-actions { position: relative; display: flex; align-items: center; gap: 10px; z-index: 2; }
.avatar-btn { border-radius: 50%; }
.click-catcher { position: fixed; inset: 0; z-index: 1; }

.search {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  width: min(460px, 100%);
  padding: 0 16px;
  border-radius: 18px;
  background: var(--card);
  color: var(--muted);
  box-shadow: var(--shadow);
}
.search input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; color: var(--text); }
.search .kbd { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.search:focus-within { box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15), var(--shadow); }
.search-results { left: 0; top: 54px; width: 100%; min-width: 320px; }

/* The search, then (on the news feed) whose posts it shows. */
.topbar-search { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.feed-filter {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 4px 0 14px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--muted);
}
.feed-filter select {
  max-width: 170px;
  height: 100%;
  padding-right: 8px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
/* The select draws no outline: the capsule shows the keyboard focus. */
.feed-filter:focus-within { box-shadow: var(--shadow), 0 0 0 2px var(--primary); }
/* The team filter: a capsule like the country's, opening the teams' list. */
.feed-team-filter { flex-shrink: 0; }
.feed-team-filter .team-picker { margin-top: 0; }
.feed-team-filter .team-picker-button { height: 46px; max-width: 220px; padding: 0 12px 0 14px; border: none; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; }

.dropdown {
  position: absolute;
  top: 56px;
  right: 0;
  width: 380px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 10px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  animation: pop-in 0.16s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.dropdown h3 { padding: 6px 8px 10px; margin: 0; font-size: 22px; }
.dropdown-account { width: 340px; }
.dropdown-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: var(--radius-sm); text-align: left; }
.dropdown-item:hover:not(.static) { background: var(--hover); }
.dropdown-item.unread .dropdown-text strong, .dropdown-item.unread .dropdown-text > span:first-child { font-weight: 700; }
.dropdown-item.unread .muted { color: var(--primary); font-weight: 600; }
/* The profile in use, then Facebook's list of the profiles to switch to. */
.account-card { background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 6px; padding: 2px 0; max-height: 50vh; overflow-y: auto; }
.account-card hr { margin: 4px 12px; }
.switch-face { position: relative; display: inline-flex; flex: none; }
.switch-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  box-shadow: 0 1px 3px rgba(31, 42, 44, 0.2);
}
.account-card .dropdown-see-all { width: auto; margin: 4px 10px 8px; }
.dropdown-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.menu-icon, .notif-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg);
  flex-shrink: 0;
}
.notif-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--navy); color: var(--gold); }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.small-menu { top: 40px; width: 260px; }

/* ---------- Layout ---------- */
.page { min-height: calc(100vh - var(--nav-h)); }
.page-center { display: flex; justify-content: center; padding: 64px; }
.home { display: flex; justify-content: center; gap: 28px; padding: 0 28px 40px; }
.feed { flex: 0 1 680px; min-width: 0; }
.sidebar-right { position: sticky; top: var(--nav-h); align-self: flex-start; width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 18px; }
.side-panels { display: flex; flex-direction: column; gap: 18px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-title h3 { margin: 0; font-size: 16px; }
.contact { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: var(--radius-sm); font-weight: 500; text-align: left; }
.contact:hover { background: var(--hover); }
.contact-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-row { display: flex; gap: 12px; padding: 8px; border-radius: var(--radius-sm); }
.request-body { flex: 1; }
.next-appointment { display: flex; align-items: center; gap: 14px; padding: 6px; border-radius: var(--radius-sm); }
.next-appointment:hover { background: var(--hover); }
.next-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.date-tile {
  width: 56px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
}
.date-tile strong { font-size: 22px; line-height: 1; font-family: var(--font-display); }
.date-tile span { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 0.5px; }
.next-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.side-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 10px; border-radius: var(--radius-sm); font-weight: 500; text-align: left; }
.side-item:hover:not(.static), .side-item.active { background: var(--hover); }
.side-item.active { color: var(--primary); }
.side-item.active .side-icon { background: var(--primary); color: #fff; }
.side-icon { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 12px; flex-shrink: 0; background: var(--bg); }

/* ---------- Stories ---------- */
/* Compact strip as on Facebook: six cards across the feed. */
.stories { position: relative; margin-bottom: 16px; }
.stories-track { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; }
.stories-track::-webkit-scrollbar { display: none; }
.story-card {
  position: relative;
  display: block;
  padding: 0;
  text-align: left;
  flex: 0 0 calc((100% - 5 * 8px) / 6);
  min-width: 96px;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #ddd;
  box-shadow: 0 1px 2px rgba(31, 42, 44, 0.15);
  scroll-snap-align: start;
}
.story-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.3), transparent 30%, transparent 60%, rgba(0,0,0,.55));
  transition: background-color 0.2s;
}
.story-card:hover::after { background-color: rgba(0, 0, 0, 0.12); }
.story-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.story-card:hover .story-bg { transform: scale(1.03); }
/* Clear of the avatar above and the name below. */
.story-text-bg { display: flex; align-items: center; justify-content: center; padding: 48px 8px 36px; color: #fff; font-weight: 700; font-size: 13px; text-align: center; word-break: break-word; }
.story-avatar { position: absolute; top: 10px; left: 10px; z-index: 1; }
.story-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-card.create { background: var(--card); }
.story-card.create::after { display: none; }
.story-create-photo { position: absolute; top: 0; left: 0; right: 0; height: 62%; overflow: hidden; }
.story-create-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.story-card.create:hover .story-create-photo img { transform: scale(1.03); }
.story-create-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #e8eefb, #fff0e6); color: var(--navy); }
.story-plus {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-create-label { position: absolute; bottom: 8px; left: 4px; right: 4px; text-align: center; font-weight: 600; font-size: 12.5px; line-height: 1.2; }
.stories-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(31, 42, 44, 0.25); z-index: 2; }
.stories-arrow.left { left: 8px; }
.stories-arrow.right { right: 8px; }

/* Story viewer: the authors on the side, the story in the middle with its
   arrows, and the reply and reactions below it, as on Facebook. */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  background: #000;
  color: #fff;
}
.story-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  transition: background-color 150ms ease, transform 100ms ease;
}
.story-ctrl:hover { background: rgba(255, 255, 255, 0.16); }
.story-ctrl:active { transform: scale(0.94); }
.story-ctrl:focus-visible, .story-arrow:focus-visible, .story-emoji:focus-visible, .story-pill:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.story-close { position: absolute; top: 16px; left: 16px; z-index: 5; background: rgba(255, 255, 255, 0.14); }
.story-close:hover { background: rgba(255, 255, 255, 0.24); }
.story-close-inline { display: none; }

.story-sidebar { flex: none; width: 340px; overflow-y: auto; padding: 76px 8px 16px; background: #18191a; border-right: 1px solid rgba(255, 255, 255, 0.08); }
.story-sidebar h2 { margin: 0; padding: 0 12px 14px; font-size: 24px; font-weight: 700; }
.story-sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.story-sidebar-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 12px; color: #fff; text-align: left; transition: background-color 150ms ease; }
.story-sidebar-item:hover { background: rgba(255, 255, 255, 0.07); }
.story-sidebar-item.current { background: rgba(255, 255, 255, 0.13); }
.story-sidebar-item:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.story-sidebar-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.story-sidebar-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.story-sidebar-text span { color: rgba(255, 255, 255, 0.62); font-size: 13px; }

.story-stage { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px 16px 20px; }
.story-column { position: relative; height: min(calc(100dvh - 118px), 900px); aspect-ratio: 9 / 16; }
.story-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-50%);
  transition: background-color 150ms ease, transform 100ms ease;
}
.story-arrow:hover { background: rgba(255, 255, 255, 0.32); }
.story-arrow:active { transform: translateY(-50%) scale(0.94); }
.story-arrow.left { left: -88px; }
.story-arrow.right { right: -88px; }

.story-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  animation: story-in 0.25s ease-out;
}
@keyframes story-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
.story-media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story-image { position: relative; width: 100%; height: 100%; object-fit: contain; }
.story-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(28px) brightness(0.55); transform: scale(1.15); }
.story-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 24px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  word-break: break-word;
}
.story-text-full { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px; }
.story-text-full p { color: #fff; font-size: 28px; font-weight: 700; text-align: center; word-break: break-word; white-space: pre-line; }

/* Tap the left third to go back, the rest to go on; hold to pause. */
.story-tap { position: absolute; top: 84px; bottom: 0; z-index: 1; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.story-tap.left { left: 0; width: 35%; }
.story-tap.right { right: 0; width: 65%; }

.story-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: 12px 12px 40px; background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)); pointer-events: none; }
.story-top button { pointer-events: auto; }
.story-progress { display: flex; gap: 4px; }
.story-progress .bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.story-progress .bar > span { display: block; height: 100%; width: 0; background: #fff; }
.story-progress .bar.done > span { width: 100%; }
.story-progress .bar.running > span { animation: story-progress 5s linear forwards; }
.story-frame.paused .story-progress .bar.running > span { animation-play-state: paused; }
/* Video stories follow the playback, reported a few times per second. */
.story-progress .bar.video > span { transition: width 250ms linear; }
@keyframes story-progress { to { width: 100%; } }
.story-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); }
.story-author { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.story-author strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.story-author span { flex-shrink: 0; color: rgba(255, 255, 255, 0.8); font-size: 13px; }
.story-controls { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.story-menu { position: relative; }
.story-menu .click-catcher { pointer-events: auto; }
.story-dropdown { top: 46px; right: 0; width: 240px; color: var(--text); text-shadow: none; pointer-events: auto; }
.story-dropdown .dropdown-item.danger { color: var(--primary); }
/* The sound button of a video story sits with the controls, before pause. */
.story-frame .video-sound { top: 27px; right: 96px; width: 40px; height: 40px; border-radius: 50%; background: transparent; box-shadow: none; color: #fff; }
.story-frame .video-sound:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* Below the story: reply, reactions and sharing */
.story-footer { position: relative; display: flex; flex-direction: column; align-items: center; width: min(660px, 100%); }
.story-footer > .story-error, .story-footer > .story-reply-sent { position: absolute; bottom: calc(100% + 10px); z-index: 3; }
.story-footer-row { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.story-reply { flex: 1; min-width: 0; height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 20px; border: 1.5px solid rgba(255, 255, 255, 0.7); border-radius: 999px; transition: border-color 150ms ease, background-color 150ms ease; }
.story-reply:focus-within { border-color: #fff; background: rgba(255, 255, 255, 0.06); }
.story-reply input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 16px; }
.story-reply input::placeholder { color: rgba(255, 255, 255, 0.75); }
.story-reply-send { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--primary); animation: story-in 0.15s ease-out; }
.story-reply-send:disabled { opacity: 0.5; cursor: default; }
.story-reply-sent { padding: 6px 12px; border-radius: 999px; background: rgba(21, 128, 61, 0.92); color: #fff; font-size: 13px; font-weight: 600; animation: story-in 0.2s ease-out; }
.story-error { padding: 6px 12px; border-radius: 8px; background: rgba(194, 65, 12, 0.92); color: #fff; font-size: 13px; }
.story-emojis { display: flex; gap: 4px; }
.story-emoji { width: 46px; height: 46px; border-radius: 50%; font-size: 30px; line-height: 1; transition: transform 150ms cubic-bezier(0.2, 0.8, 0.3, 1.4), background-color 150ms ease; }
.story-emoji.selected { background: rgba(255, 255, 255, 0.2); animation: story-react 0.35s ease-out; }
@keyframes story-react { 40% { transform: scale(1.35); } }
.story-pill { height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; flex-shrink: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.13); color: #fff; font-size: 14px; font-weight: 600; transition: background-color 150ms ease; }
.story-pill:hover { background: rgba(255, 255, 255, 0.22); }
.story-pill.icon-only { width: 46px; padding: 0; }
@media (hover: hover) and (pointer: fine) {
  .story-emoji:hover { transform: translateY(-3px) scale(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .story-frame, .story-emoji.selected, .story-reply-send, .story-reply-sent { animation: none; }
  .story-emoji, .story-arrow, .story-ctrl { transition: none; }
  .story-progress .bar.video > span { transition: none; }
}
@media (max-width: 1100px) {
  .story-sidebar { display: none; }
}
/* Phones: the story fills the screen, the reply and reactions under it. */
@media (max-width: 700px) {
  .story-close { display: none; }
  .story-close-inline { display: inline-flex; }
  .story-frame .video-sound { right: 138px; }
  .story-stage { justify-content: flex-start; gap: 0; padding: 0; }
  .story-column { flex: 1; min-height: 0; width: 100%; height: auto; aspect-ratio: auto; }
  .story-arrow { display: none; }
  .story-frame { border-radius: 0 0 12px 12px; }
  .story-footer { width: 100%; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .story-footer-row { flex-wrap: wrap; gap: 8px; }
  .story-reply { flex-basis: 100%; height: 44px; }
  .story-emoji { width: 40px; height: 40px; font-size: 26px; }
  .story-pill { height: 40px; }
  .story-pill.icon-only { width: 40px; }
}

.story-editor { display: flex; gap: 16px; }
.story-preview {
  width: 320px;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  flex-shrink: 0;
}
.story-preview img, .story-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-preview p { position: relative; color: #fff; font-weight: 700; font-size: 18px; text-align: center; padding: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.5); word-break: break-word; }
.story-preview p.placeholder { opacity: 0.6; }
/* Over a photo or video the text becomes a caption, as in the viewer. */
.story-preview.has-media { align-items: flex-end; }
.story-preview.has-media p { margin: 0 10px 14px; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.45); font-size: 14px; font-weight: 600; text-shadow: none; }
.story-preview .story-preview-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  box-shadow: none;
}
.story-preview .story-preview-remove:hover:not(:disabled) { background: rgba(0, 0, 0, 0.75); color: #fff; }
.story-media-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.story-media-pick > span { display: inline-flex; align-items: center; gap: 8px; }
.story-tools { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.story-tools textarea { border: 1px solid var(--divider); border-radius: 8px; padding: 10px; resize: none; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; }
.swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }

/* ---------- Composer & posts ---------- */
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  background: var(--input);
  color: var(--muted);
  text-align: left;
  font-size: 17px;
}
.composer-input:hover { background: var(--secondary-btn); }
.composer-input { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-action { width: 40px; height: 40px; }
.author-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.author-row > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.post-textarea { width: 100%; border: none; outline: none; resize: none; font-size: 22px; min-height: 120px; }
.image-preview { position: relative; border: 1px solid var(--divider); border-radius: 8px; padding: 8px; margin-bottom: 12px; }
.image-preview img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 6px; }
.image-preview .remove { position: absolute; top: 16px; right: 16px; background: #fff; box-shadow: var(--shadow); }
.post-textarea.on-background { min-height: 240px; padding: 32px 24px; border-radius: 8px; text-align: center; font-weight: 700; }
.post-textarea.on-background::placeholder { color: inherit; opacity: 0.7; }
.background-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.background-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--divider);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.background-swatch.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
.background-swatch:disabled { opacity: 0.4; cursor: not-allowed; }
.composer-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.composer-photo { position: relative; aspect-ratio: 1; }
.composer-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.composer-photo .remove { position: absolute; top: 6px; right: 6px; background: #fff; box-shadow: var(--shadow); }
.add-to-post {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
}
.image-picker { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

.post { padding: 12px 0 0; }
.post-header { display: flex; align-items: center; gap: 8px; padding: 0 16px 12px; }
.post-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.post-author { font-weight: 600; }
.post-author:hover { text-decoration: underline; }
.post-menu { position: relative; }
.post-content { padding: 0 16px 12px; white-space: pre-line; word-break: break-word; }
.post-content.big { font-size: 24px; }
.like-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(#18afff, #0062df);
  color: #fff;
  vertical-align: middle;
}
@keyframes like-pop { 50% { transform: scale(1.3) rotate(-10deg); } }
.comments { border-top: 1px solid var(--divider); margin: 0 16px; padding: 8px 0 12px; }
.comment { display: flex; gap: 6px; margin: 6px 0; }
.comment-bubble { background: var(--input); border-radius: 18px; padding: 8px 12px; display: inline-block; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-form { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.comment-form input, .chat-input input {
  flex: 1;
  height: 36px;
  border: none;
  outline: none;
  border-radius: 18px;
  background: var(--input);
  padding: 0 12px;
}
/* Grows with its lines (see fit() in chat_dock.dart), then scrolls. */
.chat-input textarea {
  flex: 1;
  min-height: 36px;
  max-height: 140px;
  border: none;
  outline: none;
  border-radius: 18px;
  background: var(--input);
  padding: 8px 12px;
  font: inherit;
  line-height: 20px;
  resize: none;
  overflow-y: auto;
}
.post-list > .btn { display: flex; margin: 8px auto 24px; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px; color: var(--muted); text-align: center; }
.spinner {
  width: 32px;
  height: 32px;
  margin: 24px auto;
  border-radius: 50%;
  border: 3px solid var(--secondary-btn);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 40px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(244, 244, 244, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in 0.15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: 500px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.96); } }
/* A sticky column frames the dialogs opened in it (its own stacking): while
   one is open, the column goes over the rest of the page and the top bar,
   so a photo of the feed beside it no longer covers the dialog. */
:is(.sidebar-right, .profile-side, .market-side, .stores-map-panel, .agenda-side, .settings-nav, .store-reviews-side):has(.modal-backdrop) {
  z-index: 95;
}
.modal-wide { width: 900px; }
.modal-header { position: relative; display: flex; align-items: center; justify-content: center; height: 60px; border-bottom: 1px solid var(--divider); flex-shrink: 0; }
.modal-close { position: absolute; right: 16px; background: var(--secondary-btn); color: var(--muted); }
.modal-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
/* Nothing shrinks when the body scrolls (the submit button used to get squashed). */
.modal-body > * { flex-shrink: 0; }
/* Buttons keep their natural width: the submit button sits at the bottom right. */
.modal-body > .btn, .story-tools > .btn { align-self: flex-end; margin-top: 6px; }
.listing-detail-info > .btn { align-self: flex-start; }

.text-field {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ccd0d5;
  border-radius: 6px;
  background: #f5f6f7;
  outline: none;
}
textarea.text-field { height: auto; padding: 10px 12px; resize: none; }
.text-field:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); background: #fff; }
.text-field.invalid { border-color: var(--danger); }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; min-width: 0; }
.field-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.form-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-field.narrow { flex: 0 0 120px; }
.community-choice { display: flex; gap: 10px; }
.community-choice.invalid .community-option { border-color: var(--danger); }
.community-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: 2px solid #ccd0d5;
  border-radius: 10px;
  color: var(--muted);
  transition: border-color 0.15s, background-color 0.15s;
}
.community-option strong { color: var(--text); }
.community-option:hover { background: var(--hover); }
.community-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.community-choice.compact .community-option { flex-direction: row; justify-content: center; padding: 8px; }
.community-choice.teams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 480px) { .community-choice.teams { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Store creation: first the kind, in groups of horizontal cards, then the
   page's form in sections under a reminder of the kind. */
.store-type-question { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.store-type-group { display: flex; flex-direction: column; gap: 8px; }
.store-type-group h4 { margin: 6px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.store-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .store-type-grid { grid-template-columns: 1fr; } }
.store-type-card, .store-kind-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
}
.store-type-card { transition: border-color 0.15s, background-color 0.15s, transform 0.15s; }
.store-type-card:hover { border-color: var(--primary); background: var(--hover); }
.store-type-card:active { transform: scale(0.99); }
.store-type-card.selected { border-color: var(--primary); background: var(--primary-light); }
.store-type-icon {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
}
.store-type-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.store-type-text strong { color: var(--text); }
.store-type-text .small { line-height: 1.35; }
.store-type-chevron { color: var(--muted); }
.store-kind-summary { background: var(--primary-light); border-color: transparent; }
.store-verification-hint { margin: 4px 0 0; }
.modal-body > .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }


/* ---------- Chat dock ---------- */
.chat-dock { position: fixed; right: 16px; bottom: 0; z-index: 70; display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.chat-dock > * { pointer-events: auto; }
.chat-bubbles { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.chat-bubble { border-radius: 50%; box-shadow: var(--shadow-lg); }
.chat-window {
  width: 328px;
  height: 455px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow-lg);
  animation: chat-in 0.2s ease-out;
}
@keyframes chat-in { from { transform: translateY(20px); opacity: 0; } }
.chat-window { position: relative; }
/* Shown while a file is dragged over the window. */
.chat-drop { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin: 6px; border: 2px dashed var(--primary); border-radius: 12px; background: rgba(255, 255, 255, 0.92); color: var(--primary); font-weight: 600; text-align: center; pointer-events: none; }
.chat-header { display: flex; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--divider); }
.chat-header .icon-btn { width: 30px; height: 30px; color: var(--primary); }
.chat-peer { flex: 1; display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-radius: 6px; min-width: 0; }
.chat-peer:hover { background: var(--hover); }
.chat-peer > div { display: flex; flex-direction: column; min-width: 0; }
.chat-peer strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-messages { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chat-time { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: fade-in 0.15s ease-out;
}
.msg.theirs .msg-bubble { background: var(--secondary-btn); }
.msg.mine .msg-bubble { background: var(--primary); color: #fff; }
.chat-error { padding: 0 12px; margin: 4px 0; }
/* Typing indicator: three dots bouncing in turn, like Messenger */
.msg.typing { align-items: flex-end; gap: 6px; margin-top: 4px; }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; padding: 12px 14px; }
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-dot 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots span { animation-name: typing-dot-fade; }
  @keyframes typing-dot-fade { 0%, 60%, 100% { opacity: 0.4; } 30% { opacity: 1; } }
}
.chat-input { display: flex; align-items: flex-end; gap: 4px; padding: 8px; }
/* The message the next one answers, above the field. */
.chat-replying { display: flex; align-items: center; gap: 8px; margin: 0 8px; padding: 6px 4px 6px 10px; border-left: 3px solid var(--primary); border-radius: 8px; background: var(--input); }
.chat-replying-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }

/* ---------- Profile ---------- */
.profile-top { background: var(--card); box-shadow: var(--shadow); }
.profile-top-inner { max-width: 1250px; margin: 0 auto; padding: 0 32px; }
/* Same 4:1 band as the crop dialog (CropFrame.cover), so what is framed is what shows. */
.cover {
  position: relative;
  aspect-ratio: 4 / 1;
  max-height: 300px;
  min-height: 120px;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--primary) 130%);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
/* The default banner is wider than the 4:1 band: keep the logo and the animals' faces in frame. */
.cover img.default-cover { object-position: center 30%; }
/* z-index: .profile-identity overlaps the bottom of the cover (negative margin) and would swallow the clicks. */
.cover-btn { position: absolute; z-index: 2; right: 24px; bottom: 16px; background: #fff; }
/* Upload in progress: local preview, dimmed until the server confirms. */
.cover.uploading img, .profile-avatar.uploading .avatar-preview { opacity: 0.6; transition: opacity 200ms ease; }
.profile-avatar .avatar-preview { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.image-picker.disabled { cursor: progress; opacity: 0.85; }
.btn-spinner.dark { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; border-color: rgba(31, 42, 44, 0.2); border-top-color: var(--text); }
.profile-identity { display: flex; align-items: flex-start; gap: 16px; padding: 0 16px 16px; margin-top: -84px; position: relative; }
.profile-avatar { position: relative; border: 4px solid #fff; border-radius: 50%; background: #fff; }
.avatar-camera { position: absolute; right: 6px; bottom: 6px; }
/* Reposition the photo in place: next to the cover button, and at the avatar's bottom left. */
.profile-names { flex: 1; min-width: 260px; padding-top: 100px; }
.profile-names h1 { font-size: 32px; font-weight: 700; }
.friend-faces { display: flex; margin-top: 6px; }
.friend-faces .avatar { margin-right: -8px; border: 2px solid #fff; }
/* Many actions (book, call, report, verify) wrap instead of squeezing the name. */
.profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 120px; max-width: 380px; }
.profile-tabs { display: flex; gap: 4px; }
.profile-tabs span { padding: 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.profile-tabs span.active { color: var(--primary); border-bottom-color: var(--primary); }
.profile-body { max-width: 1250px; margin: 16px auto; padding: 0 32px; display: flex; gap: 16px; align-items: flex-start; }
.profile-side { width: 40%; position: sticky; top: calc(var(--nav-h) + 16px); }
.profile-feed { flex: 1; min-width: 0; }
.bio { margin-bottom: 12px; }
.intro-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 12px; }
.intro-list li { display: flex; align-items: center; gap: 8px; color: var(--text); }
.intro-list .icon { color: #8c939d; }
.companion-cards { display: flex; flex-direction: column; gap: 8px; }
/* The member's invitation link, on their own profile. */
.referral-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }
.referral-card .referral-url { width: 100%; font-size: 14px; }
.referral-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.friends-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.friend-tile { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.friend-tile .avatar { width: 100% !important; height: auto !important; aspect-ratio: 1; border-radius: 8px; }
.friend-tile .avatar img, .friend-tile .avatar-initials { border-radius: 8px; }

/* ---------- Friends ---------- */
.friends-page { max-width: 1200px; margin: 0 auto; padding: 24px 32px; }
.friends-page section { margin-bottom: 8px; }
.friends-page h2 { margin-bottom: 16px; }
/* A member as a card (invitations, suggestions, friends) */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.person-card {
  position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 0 14px; margin: 0;
  overflow: hidden; text-align: center; transition: box-shadow 160ms ease, transform 160ms var(--ease-out);
}
.person-card:hover { box-shadow: var(--shadow-lg); }
.person-card.highlighted { box-shadow: var(--shadow), inset 0 0 0 2px var(--primary); }
.person-band { width: 100%; height: 64px; background: linear-gradient(135deg, #dfe8fb, #eef3fd); }
.person-card.cat .person-band { background: linear-gradient(135deg, #ece5ff, #f5f1ff); }
.person-card.highlighted .person-band { background: linear-gradient(135deg, #fde2e3, #fff1f1); }
.person-face { margin-top: -48px; border-radius: 50%; line-height: 0; }
.person-face .avatar { border: 4px solid var(--card); box-sizing: content-box; }
.person-body { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 8px 14px 0; min-width: 0; }
.person-name {
  font-weight: 700; font-size: 16px; line-height: 1.25; text-decoration: none; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.person-name:hover { text-decoration: underline; }
.person-subtitle { font-size: 12.5px; color: var(--muted); }
.person-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; width: 100%; padding: 12px 14px 0; margin-top: auto; }
.person-actions .btn { width: 100%; min-width: 0; height: 38px; padding: 0 10px; font-size: 14px; justify-content: center; gap: 6px; }
@media (max-width: 600px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .person-actions { grid-auto-flow: row; }
}

/* ---------- Marketplace ---------- */
.market { display: flex; }
.market-side {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  width: 360px;
  flex-shrink: 0;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px 8px;
  overflow-y: auto;
}
.market-side h2 { font-size: 24px; padding: 0 8px 8px; }
.market-side .btn { margin: 12px 8px; }
.market-main { flex: 1; padding: 24px; }
.market-main h2 { margin-bottom: 16px; }
.market-main .page-title h2 { margin: 0; }
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 12px; }
.listing-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; border-radius: 8px; }
.listing-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--secondary-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bcc0c4;
  margin-bottom: 6px;
}
.listing-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.listing-card:hover .listing-photo img { transform: scale(1.04); }
.listing-price { font-size: 17px; }
.listing-price.big { font-size: 22px; }
.listing-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* Projects: rows in the list, as posts, and the project's own page. */
.project-list { display: flex; flex-direction: column; gap: 16px; }
.project-row { display: flex; gap: 20px; padding: 24px; color: inherit; text-decoration: none; }
.project-row:hover .project-row-title { text-decoration: underline; }
.project-row-icon {
  flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--secondary-btn); color: var(--muted);
}
.project-row-icon img { width: 100%; height: 100%; object-fit: cover; }
.project-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.project-row-title { font-size: 19px; font-weight: 600; color: #1d4ed8; }
.project-row-excerpt { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.55; }
.project-facts, .keyword-list { display: flex; flex-wrap: wrap; align-items: center; row-gap: 2px; }
.project-facts { font-weight: 500; }
.keyword-list { font-weight: 600; }
.project-facts > span + span::before, .keyword-list > span + span::before { content: '·'; margin: 0 8px; color: var(--muted); }
.project-status::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #22a06b;
}
.project-status.closed::before { background: var(--muted); }
.project-page { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.project-detail, .project-side { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.project-detail h1 { font-size: 26px; margin: 0; }
.author-meta { display: flex; flex-direction: column; }
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.proposal-list { display: flex; flex-direction: column; }
.proposal { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--divider); }
.proposal-head, .proposal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .project-row { padding: 16px; gap: 12px; }
  .project-row-icon { width: 44px; height: 44px; }
}
.form-actions.start { justify-content: flex-start; flex-wrap: wrap; }
.listing-detail { display: flex; gap: 20px; }
.listing-detail-photo {
  flex: 1.3;
  min-height: 360px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
}
.listing-detail-photo img { width: 100%; max-height: 70vh; object-fit: contain; }

/* Detail photos open full screen */
.photo-zoom { position: relative; display: block; width: 100%; height: 100%; padding: 0; border-radius: 0; cursor: zoom-in; }
.photo-zoom img { display: block; }
.photo-zoom-hint { position: absolute; right: 10px; bottom: 10px; display: flex; padding: 7px; border-radius: 50%; background: rgba(31, 42, 44, .55); color: #fff; opacity: .85; transition: opacity .15s; }
.photo-zoom:hover .photo-zoom-hint, .photo-zoom:focus-visible .photo-zoom-hint { opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 56px 72px; background: rgba(8, 12, 20, .94); animation: fade-in .15s ease-out; }
.lightbox-photo { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; }
.lightbox button { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; transition: background-color .15s; }
.lightbox button:hover { background: rgba(255, 255, 255, .24); }
.lightbox-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; }
.lightbox-arrow { position: absolute; top: 50%; width: 52px; height: 52px; transform: translateY(-50%); }
.lightbox-arrow.prev { left: 12px; }
.lightbox-arrow.next { right: 12px; }
.lightbox-count { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-size: 14px; font-variant-numeric: tabular-nums; }
.viewer { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: rgba(8, 12, 20, .96); color: #fff; }
.viewer-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.viewer-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-type { display: flex; color: #ff7b6b; }
.viewer-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; transition: background-color .15s; }
.viewer-btn:hover { background: rgba(255, 255, 255, .24); }
.viewer-content { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px 16px; }
.viewer-photo { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.viewer-pdf { width: 100%; max-width: 1000px; height: 100%; border: 0; border-radius: 6px; background: #fff; }
.viewer-empty { color: rgba(255, 255, 255, .8); }
@media (max-width: 700px) {
  .lightbox { padding: 56px 0; }
  .lightbox-arrow { width: 44px; height: 44px; background: rgba(0, 0, 0, .35); }
}
.listing-detail-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.listing-detail-info h2 { font-size: 24px; }
.listing-detail-info h4 { margin: 8px 0 0; color: var(--text); }
.listing-upload {
  height: 180px;
  border: 2px dashed var(--divider);
  border-radius: 8px;
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  background: var(--input);
}
.listing-upload:hover { background: var(--secondary-btn); }
.listing-upload img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Event editor: its photo or video, styled text and days ---------- */
.event-media {
  position: relative;
  height: 200px;
  border: 2px dashed var(--divider);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--input);
  color: var(--muted);
  text-align: center;
}
.event-media.has-media { border-style: solid; background: #000; }
.event-media img, .event-media video { width: 100%; height: 100%; object-fit: contain; }
.event-media .event-media-remove {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff;
}
.event-media .event-media-remove:hover:not(:disabled) { background: rgba(0, 0, 0, 0.75); color: #fff; }
.event-caption-input { min-height: 84px; resize: vertical; transition: color 0.15s, background-color 0.15s; }

.caption-style-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; }
.caption-toggles { display: flex; gap: 6px; }
.caption-toggle {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--secondary-btn); color: var(--text); font-size: 15px;
  transition: background-color 0.15s, color 0.15s;
}
.caption-toggle:hover { background: var(--secondary-btn-hover); }
.caption-toggle.bold { font-weight: 800; }
.caption-toggle.italic { font-style: italic; font-family: Georgia, serif; }
.caption-toggle.selected { background: var(--navy); color: #fff; }
.caption-colors { display: flex; flex-direction: column; gap: 4px; }
.caption-colors .swatch { width: 24px; height: 24px; border-width: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.caption-colors .swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }
/* The default look: a crossed-out swatch. */
.swatch-none { background: linear-gradient(135deg, #fff 45%, var(--danger) 45%, var(--danger) 55%, #fff 55%); }

.event-days { display: flex; flex-direction: column; gap: 10px; }
.event-day {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.event-days.invalid .event-day { border-color: var(--danger); }
.event-day-head { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.event-day-hours { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.event-day-hours label { display: flex; flex-direction: column; gap: 4px; }
.event-day-add { align-self: flex-start; margin-top: 8px; }

/* An event's text under its photo or video. */
.post-caption .post-content { margin: 0 16px 12px; padding: 0; border-radius: 8px; }
.post-caption .post-content[style*="background"] { padding: 8px 12px; }

/* ---------- Stores ---------- */
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.link { color: var(--primary); }
.link:hover { text-decoration: underline; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c81a37; }
.btn-light-danger { background: #ffebee; color: var(--danger); }
.btn-light-danger:hover { background: #ffd7dd; }
a.btn { text-decoration: none; }
.badge-store-vet { background: #fff1e6; color: #d35400; }
.badge-store-breeder { background: #e8eefb; color: #1d4ed8; }
.badge-store-insurance { background: #efe7fb; color: #6f42c1; }
.badge-store-services { background: #e3f6f4; color: #0f766e; }
.badge-store-community { background: #fdeef3; color: #be185d; }
.store-logo {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e4e6eb, #ccd0d5);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-avatar .store-logo { border-radius: 50%; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
/* The member's stores, listed in the side panel like Facebook's "Pages you manage". */
/* Stores & La Bourse: filters in a horizontal toolbar so the content gets the full width */
.toolbar-page { padding: 8px 28px 40px; }
.filter-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.filter-toolbar .search { flex: 1 1 280px; width: auto; max-width: 460px; }
.filter-toolbar .side-item { width: auto; min-height: 46px; padding: 5px 14px 5px 6px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.filter-toolbar .side-icon { width: 34px; height: 34px; }
.filter-toolbar .area-button-text { max-width: 220px; }
.filter-toolbar .country-filter .text-field { width: 200px; flex: none; }
.filter-tabs { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; margin-bottom: 20px; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs .chip { flex-shrink: 0; gap: 8px; height: 38px; padding: 0 16px; white-space: nowrap; }
.filter-tabs-sep { flex-shrink: 0; width: 1px; height: 24px; margin: 0 4px; background: var(--divider); }
.page-title-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stores-page .store-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Businesses: the list on the left, the map on the right (kept in view while the list scrolls). */
.stores-split { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
.stores-list { display: flex; flex-direction: column; gap: 8px; transition: opacity .15s; }
.stores-list.busy { opacity: .6; }
.store-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border: 2px solid transparent; transition: border-color .15s, box-shadow .15s; }
.store-item.selected { border-color: var(--primary); }
.store-item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px; text-align: left; border-radius: var(--radius-sm); }
.store-item-main:hover { background: var(--hover); }
.store-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.store-item .btn.small { flex-shrink: 0; height: 34px; padding: 0 14px; font-size: 14px; }
.stores-map-panel { position: sticky; top: calc(var(--nav-h) + 12px); }
.stores-map { height: calc(100vh - var(--nav-h) - 40px); min-height: 360px; border-radius: var(--radius); overflow: hidden; background: #e8eef4; box-shadow: var(--shadow); z-index: 0; }
.stores-map.failed { display: none; }
/* Many pins close together: one bubble with their count, in the app's orange. */
.map-cluster { background: none; border: none; }
.map-cluster span {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .map-cluster:hover span { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .map-cluster span { transition: none; }
}
/* The directory card shown above a business marker on hover. */
.store-map-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: var(--radius); }
.store-map-popup .leaflet-popup-content { margin: 0; max-width: calc(100vw - 64px); }
.store-map-popup .store-map-card { margin: 0; padding: 14px; gap: 10px; box-shadow: none; }
.store-map-popup .store-item-main { cursor: default; }
.store-map-popup .store-item-main:hover { background: transparent; }
.store-map-popup .store-logo { flex-shrink: 0; }
.store-map-popup a.btn { color: var(--text); text-decoration: none; }
.area-pin.selected { z-index: 1000 !important; }
@media (max-width: 900px) {
  .stores-split { grid-template-columns: 1fr; }
  .stores-map-panel { position: static; order: -1; }
  .stores-map { height: 300px; min-height: 0; }
}
@media (max-width: 1000px) { .toolbar-page { padding: 8px 12px 40px; } }
.store-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin: 0; transition: box-shadow 0.15s, transform 0.15s; }
.store-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.store-card-cover { height: 96px; background: linear-gradient(135deg, var(--navy), var(--primary)); }
.store-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.store-card-body { display: flex; gap: 10px; padding: 0 12px 12px; align-items: flex-start; }
.store-card-body .store-logo { border: 3px solid #fff; margin-top: -28px; }
.store-card-body > div { padding-top: 6px; }
.store-card-body > div { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.store-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.open-now { font-size: 13px; font-weight: 600; }
.open-now.open { color: #31a24c; }
.open-now.closed { color: var(--danger); }
.profile-tabs button { padding: 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; border-radius: 0; }
.profile-tabs button:hover { background: var(--hover); }
.profile-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.store-about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; width: 100%; align-items: start; }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 8px 4px; border-bottom: 1px solid var(--hover); }
.hours-table td:last-child { text-align: right; }
.hours-table tr.today td { font-weight: 700; color: var(--primary); }
.store-animals, .agenda-tab { width: 100%; }
.agenda-tab { display: grid; grid-template-columns: 1fr 420px; gap: 16px; align-items: start; }
.agenda-side { position: sticky; top: calc(var(--nav-h) + 16px); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--secondary-btn);
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.15s;
}
.chip:hover { background: var(--secondary-btn-hover); }
.chip.selected { background: var(--primary-light); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

.hours-editor { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--divider); border-radius: 8px; padding: 8px 12px; }
.hours-editor.invalid { border-color: var(--danger); }
.hours-row { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.hours-row .text-field { width: 120px; height: 34px; }
.hours-day { width: 120px; font-weight: 600; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.hours-row.closed .hours-day { color: var(--muted); }
.hours-row:has(.hours-ranges) { align-items: flex-start; }
.hours-row:has(.hours-ranges) .hours-day { min-height: 34px; }
.hours-ranges { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hours-range { display: flex; align-items: center; gap: 8px; }
.hours-range-remove { width: 28px; height: 28px; color: var(--muted); }
.hours-range-add { font-size: 13px; }

/* ---------- Agenda & appointments ---------- */
.agenda { display: flex; flex-direction: column; gap: 8px; }
.agenda-head { display: flex; align-items: center; gap: 6px; }
.agenda-date { width: auto; flex: 1; }
.agenda-dayname { min-width: 80px; text-align: right; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; transition: opacity 0.15s; }
.slots.busy, .animal-grid.busy { opacity: 0.5; pointer-events: none; }
.slot { height: 38px; border-radius: 8px; font-weight: 600; border: 1px solid transparent; transition: transform 0.1s, background-color 0.15s; }
.slot:active:not(:disabled) { transform: scale(0.95); }
.slot-available { background: #e9f7ee; color: #1e7b3a; border-color: #b9e4c7; }
.slot-available:hover { background: #d4f0de; }
.slot-booked { background: var(--primary-light); color: var(--primary); }
.slot-blocked { background: #f1f1f1; color: #8a8d91; text-decoration: line-through; }
.slot-past { background: transparent; color: #bcc0c4; border-color: var(--hover); }
.slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot:disabled { opacity: 1; cursor: not-allowed; }
.legend { display: flex; gap: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; border: 1px solid var(--divider); }
.status { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pending { background: #fff4e5; color: #b26a00; }
.status-confirmed { background: #e9f7ee; color: #1e7b3a; }
.status-proposed { background: var(--primary-light); color: var(--primary); }
.status-cancelled, .status-declined { background: #f1f1f1; color: var(--muted); }
.appointments-page { max-width: 760px; margin: 0 auto; padding: 24px 16px; }
/* Settings: a theme index on the left (chips on small screens), the themes on the right. */
.settings-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-areas: "header header" "nav sections";
  column-gap: 32px;
  row-gap: 24px;
  align-items: start;
}
.settings-header { grid-area: header; display: flex; flex-direction: column; gap: 6px; }
.settings-header h1 { font-size: 30px; letter-spacing: -0.8px; }
.settings-nav { grid-area: nav; position: sticky; top: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  transition: background-color 150ms ease, color 150ms ease;
}
.settings-nav-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.settings-sections { grid-area: sections; display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.settings-section { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.settings-section-title { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.settings-section-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-light);
}
.settings-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.settings-card h3 { margin-bottom: 0; }
/* A setting: its name and explanation, then its control (switch, language…). */
.settings-row { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; }
.settings-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-row .language-switcher { margin: 0; flex-shrink: 0; }
.settings-switch { padding: 4px 0; }
.settings-switch:disabled { cursor: progress; opacity: 1; }
.settings-switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 8px; }
.settings-card > .settings-switch + .settings-switch { padding-top: 16px; border-top: 1px solid var(--divider); }
.settings-note { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
@media (hover: hover) and (pointer: fine) {
  .settings-nav-item:hover { color: var(--text); background: var(--hover); }
}
@media (max-width: 760px) {
  .settings-page { grid-template-columns: minmax(0, 1fr); grid-template-areas: "header" "nav" "sections"; row-gap: 16px; padding-top: 16px; }
  .settings-header h1 { font-size: 26px; }
  /* Sticky chips under the top bar, scrolling sideways. */
  .settings-nav {
    flex-direction: row;
    gap: 8px;
    margin: 0 -16px;
    padding: 8px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 5;
    background: var(--bg);
  }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-item { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--divider); }
  .settings-section { scroll-margin-top: calc(var(--nav-h) + 72px); }
  .settings-row:not(.settings-switch) { flex-wrap: wrap; }
}
.settings-success { padding: 10px 12px; border-radius: 8px; background: #e8f5e9; color: #1b5e20; font-weight: 600; }
.appointment { display: flex; flex-direction: column; gap: 8px; }
.appointment-head { display: flex; align-items: center; gap: 10px; }
.appointment-title { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.appointment-note { background: var(--input); border-radius: 8px; padding: 8px 12px; }
.appointment-note.cancelled { background: #ffebee; }
.appointment-subject { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); background: var(--input); }
.appointment-subject-photo { display: flex; align-items: center; justify-content: center; width: 96px; height: 64px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--bg); color: var(--muted); }
.appointment-subject-photo img { width: 100%; height: 100%; object-fit: cover; }
.appointment-subject .store-logo { background: var(--primary-light); color: var(--primary); }
.appointment-subject-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ---------- Breeders' animals ---------- */
.animal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; transition: opacity 0.15s; }
.animal-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin: 0; text-align: left; transition: box-shadow 0.15s, transform 0.15s; }
.animal-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.animal-photo { position: relative; aspect-ratio: 4 / 3; background: var(--secondary-btn); display: flex; align-items: center; justify-content: center; color: #bcc0c4; overflow: hidden; }
.animal-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.animal-card:hover .animal-photo img { transform: scale(1.04); }
.animal-species { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; background: #fff; }
.animal-species.inline { position: static; display: inline-block; }
.animal-species.dog { background: #fff0e6; color: #9a3412; }
.animal-species.cat { background: #e6f2f1; color: #115e59; }
.photo-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; border-radius: 10px; padding: 2px 8px; font-size: 12px; display: flex; align-items: center; gap: 2px; }
.animal-body { padding: 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.animal-title { font-size: 17px; }
.animal-facts { color: var(--muted); }
.animal-available { color: var(--primary); display: flex; align-items: center; gap: 2px; }
.animal-price { font-size: 20px; margin-top: 4px; }
.animal-store { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--hover); min-width: 0; }
.animal-gallery { flex: 1.3; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.animal-gallery .listing-detail-photo { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
.animal-gallery .listing-detail-photo img { height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumb { flex: 0 0 72px; height: 54px; border-radius: 6px; overflow: hidden; opacity: 0.6; border: 2px solid transparent; }
.thumb.selected { opacity: 1; border-color: var(--primary); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; }
.spec { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 6px; background: var(--input); border-radius: 8px; padding: 8px; }
.spec .icon { grid-row: span 2; color: var(--primary); }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-thumb { position: relative; width: 104px; height: 78px; border-radius: 8px; overflow: hidden; background: var(--input); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .remove { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; background: #fff; }
.photo-thumb.add { border: 2px dashed var(--divider); color: var(--muted); font-size: 12px; text-align: center; }
.photo-thumb.add:hover { background: var(--secondary-btn); }
.photo-thumb .spinner { width: 24px; height: 24px; margin: 0; }
.animal-filters { display: flex; flex-direction: column; gap: 4px; }
.animal-filters h2 { padding: 4px 8px 4px; }
.animal-filters > .chips { padding: 0 8px 8px; }
.filter-section { padding: 10px 8px; border-top: 1px solid var(--hover); display: flex; flex-direction: column; gap: 8px; }
.filter-section h4 { margin: 0; color: var(--text); font-size: 15px; }

/* Drop-down list of checkboxes (breed) */
.multi-select { position: relative; display: flex; flex-direction: column; gap: 6px; }
.multi-select-label { font-weight: 600; font-size: 14px; }
.multi-select-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; cursor: pointer; color: var(--muted); }
.multi-select-button.has-value { color: var(--text); font-weight: 600; }
.multi-select-button:disabled { cursor: default; opacity: .7; }
.multi-select-button .icon { flex-shrink: 0; transition: transform .15s; }
.multi-select.open .multi-select-button { border-color: var(--primary); }
.multi-select.open .multi-select-button .icon { transform: rotate(180deg); }
.multi-select-backdrop { position: fixed; inset: 0; z-index: 20; }
.multi-select-panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 21; margin-top: 4px; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(31, 42, 44, .18); overflow: hidden; }
.multi-select-search { margin: 8px; width: auto; }
.multi-select-options { max-height: 280px; overflow-y: auto; padding: 4px; }
.multi-select-group { padding: 8px 8px 2px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.multi-select-option { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.multi-select-option:hover { background: var(--hover); }
.multi-select-option input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--primary); }
.multi-select-image { width: 24px; height: 24px; flex-shrink: 0; object-fit: contain; }
.multi-select-none { padding: 8px; }
.multi-select-footer { display: flex; justify-content: flex-end; padding: 6px 10px; border-top: 1px solid var(--divider); }
.sort { display: flex; align-items: center; gap: 6px; }
.sort .text-field { width: auto; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 24px 0; }
.market-side h4 { margin: 14px 8px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .3px; }

/* ---------- Store news & events ---------- */
.store-posts, .news-page { width: 100%; }
.news-page { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.news-page section { margin-bottom: 32px; }
.news-page h2 { margin-bottom: 14px; }
.news-page .section-title { margin: 28px 0 14px; }
.store-post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.store-post-grid .card { margin: 0; }
.store-post { padding: 0; overflow: visible; }
.store-post-image { width: 100%; max-height: 360px; object-fit: contain; background: var(--secondary-btn); border-radius: var(--radius) var(--radius) 0 0; }
.store-post-body { display: flex; gap: 14px; padding: 14px 16px; }
.store-post-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.store-post-text h3 { margin: 0; font-size: 19px; }
.store-post-meta { display: flex; align-items: center; gap: 8px; }
.store-post-meta .post-menu { margin-left: auto; }
.store-post-content { color: var(--text); }
.store-post-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.store-post-store span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-post-store:hover span { text-decoration: underline; }
.kind { padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.kind-news { background: #efe7fb; color: #6f42c1; }
.kind-event { background: #fff1e6; color: #d35400; }

/* Event card: cover with the date, facts, attendees and the member's answer. */
.event-card { display: flex; flex-direction: column; padding: 0; }
.event-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--secondary-btn);
}
.event-cover img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.event-cover.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--primary) 140%);
}
.event-badge {
  position: absolute;
  left: 12px;
  bottom: -22px;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 4px;
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: 0 6px 18px rgba(31, 42, 44, 0.16);
  line-height: 1;
}
.event-badge-month { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--primary); }
.event-badge-day { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-top: 3px; }
.event-over {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(31, 42, 44, 0.75);
  color: #fff;
}
.event-cover-menu { position: absolute; top: 10px; right: 10px; }
.event-cover-menu .icon-btn { background: rgba(255, 255, 255, 0.92); color: var(--text); box-shadow: 0 2px 8px rgba(31, 42, 44, 0.12); }
.event-cover-menu .icon-btn:hover { background: #fff; }
.event-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 32px 16px 16px; }
.event-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.event-facts li { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.event-facts .icon { flex-shrink: 0; margin-top: 1px; }
.event-desc {
  font-size: 14px;
  color: var(--text);
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--divider); display: flex; flex-direction: column; gap: 10px; }
.event-attendees { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.event-rsvp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.event-rsvp .btn { padding: 0 10px; font-size: 14px; white-space: nowrap; }
.btn-maybe { background: #fff4d6; color: #92400e; }
.btn-maybe:hover:not(:disabled) { background: #ffeab0; }
.event-card.past .event-cover, .event-card.past .event-title { filter: grayscale(0.6); opacity: 0.8; }
.event-title a { color: inherit; text-decoration: none; }
.event-title a:hover { text-decoration: underline; }
/* The event's own page: whole title and description, bigger. */
.event-detail .event-body { gap: 14px; padding: 36px 20px 20px; }
.event-detail .event-title { font-size: 26px; display: block; overflow: visible; }
.event-detail .event-facts { font-size: 15px; gap: 8px; }
.event-detail .event-desc { font-size: 15px; line-height: 1.55; display: block; overflow: visible; }
.event-detail .event-rsvp { grid-template-columns: repeat(2, minmax(0, 160px)); }
@media (max-width: 600px) {
  .post-page > .event-detail .event-cover { border-radius: 0; }
  .event-detail .event-title { font-size: 22px; }
  .event-detail .event-rsvp { grid-template-columns: 1fr 1fr; }
}
/* A member's event inside its post, in the feed: date badge, then the facts. */
.post-event { display: flex; gap: 14px; margin: 0 18px 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--input); }
.post-event .event-badge { position: static; flex-shrink: 0; align-self: flex-start; }
.post-event-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.post-event-invited { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary); color: #fff; }
.post-event .event-footer { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.post-event.past .event-title, .post-event.past .event-badge { filter: grayscale(0.6); opacity: 0.8; }
.member-events { display: flex; flex-direction: column; gap: 16px; }

/* Agenda: the events as a timeline, one heading per month and one row per
   event (date, what / when / where / who, cover, then the member's answer). */
.planner-page { max-width: 880px; }
.planner { display: flex; flex-direction: column; gap: 24px; }
.news-page .planner-month { margin: 0; }
.planner-month-title { margin: 0 0 10px 4px; font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--muted); }
.planner-list { display: flex; flex-direction: column; gap: 12px; }
.planner-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-areas: "date main cover" "date footer footer";
  gap: 14px 18px;
  margin: 0;
  padding: 16px 16px 14px;
  cursor: pointer;
  transition: box-shadow 200ms var(--ease-out);
}
.planner-date {
  grid-area: date;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  line-height: 1;
  text-align: center;
  transition: background-color 200ms var(--ease-out);
}
.planner-date-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--primary); }
.planner-date-day { margin: 5px 0 4px; font-family: var(--font-display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.planner-date-month { font-size: 11px; font-weight: 700; letter-spacing: .6px; color: var(--muted); }
.planner-item.going .planner-date { background: var(--primary); }
.planner-item.going .planner-date > span { color: #fff; }
.planner-main { grid-area: main; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.planner-time { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.planner-soon { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--primary); color: #fff; }
.planner-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.planner-title:hover { text-decoration: underline; }
.planner-place { display: flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: 14px; color: var(--muted); }
.planner-place > .icon { flex-shrink: 0; margin-top: 2px; }
.planner-organizer { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; font-size: 13px; color: var(--muted); text-decoration: none; }
.planner-organizer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-organizer:hover span { text-decoration: underline; }
.planner-cover { grid-area: cover; align-self: start; width: 176px; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: var(--secondary-btn); }
.planner-cover img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 300ms var(--ease-out); }
.planner-footer { grid-area: footer; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--divider); }
.planner-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.planner-invited { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--primary); color: #fff; }
.planner-attendees { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.planner-rsvp { display: flex; gap: 8px; }
.planner-rsvp .btn { height: 36px; padding: 0 14px; font-size: 14px; white-space: nowrap; }
.planner-over { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--secondary-btn); color: var(--muted); }
.planner-item.past .planner-date,
.planner-item.past .planner-cover,
.planner-item.past .planner-title { filter: grayscale(0.7); opacity: 0.75; }
.planner-filters { margin-bottom: 4px; }
.planner-filters .chip { height: 36px; padding: 0 14px; }
@media (hover: hover) and (pointer: fine) {
  .planner-item:hover { box-shadow: 0 14px 34px rgba(31, 42, 44, 0.1); }
  .planner-item:hover .planner-cover img { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .planner-cover img { transition: none; }
  .planner-item:hover .planner-cover img { transform: none; }
}
@media (max-width: 600px) {
  .planner-item {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas: "date main cover" "footer footer footer";
    gap: 12px;
    padding: 14px 14px 12px;
  }
  .planner-date { padding: 8px 2px 9px; }
  .planner-date-label { font-size: 10px; letter-spacing: .2px; }
  .planner-date-day { font-size: 22px; }
  .planner-title { font-size: 16px; }
  .planner-cover { width: 64px; aspect-ratio: 1; border-radius: 12px; }
  .planner-rsvp { width: 100%; }
  .planner-rsvp .btn { flex: 1; }
  .planner-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .planner-filters::-webkit-scrollbar { display: none; }
  .planner-filters .chip { flex-shrink: 0; white-space: nowrap; }
}

/* ---------- Language switcher ---------- */
.language-switcher {
  position: relative;
  display: inline-flex;
  align-self: center;
  align-items: center;
  margin: 16px auto 0;
  color: var(--muted);
}
.language-icon { position: absolute; left: 10px; pointer-events: none; }
.language-switcher select {
  appearance: none;
  height: 36px;
  padding: 0 30px 0 32px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%235b6b82'%3E%3Cpath d='M1.6 5.1a.6.6 0 0 1 .85 0L8 10.65l5.55-5.55a.6.6 0 1 1 .85.85l-6 6a.6.6 0 0 1-.85 0l-6-6a.6.6 0 0 1 0-.85'/%3E%3C/svg%3E") no-repeat right 10px center / 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.language-switcher select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dropdown-item .language-switcher { margin: 0 0 0 auto; }

/* ---------- Village refinements ---------- */
.btn { height: 40px; padding: 0 16px; border-radius: var(--radius-sm); }
.btn-lg { height: 50px; border-radius: 16px; }
.btn-primary { box-shadow: 0 8px 18px rgba(194, 65, 12, 0.28); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 22px rgba(194, 65, 12, 0.36); }
.btn-light-primary:hover { background: #fadada; }
.btn-success { background: var(--navy); }
.btn-success:hover:not(:disabled) { background: var(--navy-2); }
.icon-btn { border-radius: 12px; }
.icon-btn.green, .composer-action.green { color: #16a34a; }
.icon-btn.orange, .composer-action.orange { color: #d4931d; }
.composer-action.red { color: var(--primary); }
.round-btn { width: 44px; height: 44px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.round-btn:hover { background: var(--card); color: var(--primary); }
.round-btn.active { background: var(--navy); color: #fff; }
.count-badge { background: var(--primary); border: 2px solid var(--bg); }
.link, .side-title a { color: var(--primary); }

.card { border-radius: var(--radius); box-shadow: var(--shadow); border: none; }
/* Feed cards are flatter and less rounded, as on Facebook. */
.feed .card { border-radius: 12px; box-shadow: 0 1px 2px rgba(31, 42, 44, 0.12); }
.text-field { border-radius: var(--radius-sm); border-color: var(--divider); background: var(--input); }
.text-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12); }
.chip { border-radius: 12px; }
.chip.selected { background: var(--navy); color: #fff; box-shadow: none; }
.badge-dog { background: #e8eefb; color: #1d4ed8; }
.badge-cat { background: #efe9ff; color: #6d28d9; }
.avatar-ring img, .avatar-ring .avatar-initials { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--primary); }
.online-dot { background: #22c55e; }
.spinner { border-top-color: var(--primary); }

/* Stories */
.story-create-placeholder { background: linear-gradient(160deg, #e8eefb, #fff0e6); color: var(--navy); }
.story-plus { background: var(--primary); border-color: var(--card); }

/* Composer & posts */
.composer { padding: 12px 16px; }
.composer-input { background: var(--input); border-radius: 20px; font-size: 16px; }
.like-bubble { background: var(--primary); }
.comment-bubble { border-radius: 16px; background: var(--bg); }
.comment-form input, .chat-input input, .chat-input textarea { border-radius: 14px; }

/* Chat */
.chat-window { border-radius: 24px 24px 0 0; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px); box-shadow: var(--shadow-lg); overflow: hidden; }
.chat-header { background: var(--navy); color: #fff; border-bottom: none; padding: 10px; }
.chat-header .muted { color: #9fb0c9; }
.chat-header .icon-btn { color: #fff; }
.chat-header .icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.chat-peer:hover { background: rgba(255, 255, 255, 0.08); }
.msg.theirs .msg-bubble { background: var(--bg); border-radius: 18px 18px 18px 6px; }
.msg.mine .msg-bubble { background: var(--navy); border-radius: 18px 18px 6px 18px; }
.chat-input .send { background: var(--primary); color: #fff; border-radius: 12px; }
.chat-input .send:hover { background: var(--primary-hover); }
.chat-bubble { box-shadow: var(--shadow-lg); }

/* Modal */
.modal-backdrop { background: rgba(18, 60, 63, 0.45); backdrop-filter: blur(4px); }
.modal { border-radius: 26px; }
.modal-header { border-bottom: 1px solid var(--divider); }
.modal-close { border-radius: 12px; }

.splash .brand-logo { font-size: 56px; }
.splash { background: var(--bg); }

/* Profile & stores */
.profile-top { background: transparent; box-shadow: none; }
.cover { border-radius: 0 0 28px 28px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--primary) 130%); }
.profile-avatar { border-color: var(--bg); background: var(--bg); }
.profile-tabs span.active, .profile-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.store-card-cover { background: linear-gradient(135deg, var(--navy), var(--navy-2) 60%, var(--primary) 140%); }
.store-card { border-radius: var(--radius); }
.date-tile { box-shadow: none; }
.status-proposed { background: #e8eefb; color: #1d4ed8; }

/* Marketplace & catalog: side filters become a floating panel */
.market { gap: 24px; padding: 0 28px 40px; }
.market-side {
  top: calc(var(--nav-h) + 8px);
  height: auto;
  max-height: calc(100vh - var(--nav-h) - 24px);
  width: 300px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 10px;
}
.market-main { padding: 8px 0; }
.listing-photo, .animal-photo { border-radius: 18px; }
.animal-card, .listing-card { border-radius: var(--radius); }
.animal-photo { margin: 8px 8px 0; border-radius: 16px; }
.spec { border-radius: 14px; }
.spec .icon { color: var(--primary); }
.friends-page, .appointments-page, .news-page { padding-top: 8px; }
.page-tabs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-tabs h2 { margin: 0; }
/* Phones: the title and its action on the first line, the tabs underneath, full width. */
@media (max-width: 700px) {
  .page-title:has(> .page-tabs) { gap: 12px 8px; }
  .page-title > .page-tabs { display: contents; }
  .page-tabs h2 { flex: 1; font-size: 22px; }
  .page-tabs .segmented { order: 1; display: flex; width: 100%; }
  .page-tabs .segmented a { flex: 1; padding: 8px 6px; text-align: center; white-space: nowrap; }
}
@media (max-width: 420px) {
  .page-title-action { width: 40px; padding: 0; border-radius: 50%; }
  .page-title-action span { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .sidebar-right { display: none; }
}
@media (max-width: 1100px) {
  :root { --rail-w: 84px; }
  .rail { padding: 18px 12px; align-items: center; }
  .rail-label, .rail .brand-tail { display: none; }
  .rail-brand { justify-content: center; padding: 0; }
  .rail-item { justify-content: center; }
  /* Fewer tabs: the saved posts stay in each post's menu. */
  .rail-item.wide-only { display: none; }
}
@media (max-width: 1000px) {
  .store-about, .agenda-tab { grid-template-columns: 1fr; }
  .agenda-side { position: static; }
  .home { padding: 0 12px 40px; }
  .profile-body { flex-direction: column; padding: 0 12px; }
  .profile-side { width: 100%; position: static; }
  .market { flex-direction: column; }
  .market-side { position: static; width: auto; height: auto; }
}
@media (max-width: 700px) {
  /* The rail becomes a bottom tab bar on phones. */
  :root { --rail-w: 0px; }
  .rail {
    inset: auto 0 0 0;
    width: 100%;
    height: 64px;
    flex-direction: row;
    justify-content: space-around;
    padding: 0 8px;
    background: var(--card);
    box-shadow: 0 -1px 2px rgba(31, 42, 44, 0.1);
    overflow: visible;
  }
  .rail-brand { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; width: 100%; }
  .rail-item { min-height: 0; padding: 6px; }
  .rail-icon { width: 34px; height: 34px; background: none; color: var(--muted); }
  .rail-item.active { background: none; }
  .rail-item.active .rail-icon { color: var(--primary); }
  .shell-main { padding-bottom: 72px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search { flex: 1; min-width: 0; width: auto; }
  .search .kbd { display: none; }
  .topbar-search { gap: 8px; }
  .feed-filter { height: 40px; padding-left: 10px; }
  .feed-filter select { max-width: 96px; }
  .feed-team-filter .team-picker-button { height: 40px; max-width: 150px; padding: 0 10px; gap: 6px; }
  .topbar-actions { gap: 6px; }
  .round-btn { width: 40px; height: 40px; }
  .dropdown { position: fixed; top: 68px; left: 8px; right: 8px; width: auto; }
  .profile-identity { flex-direction: column; align-items: center; text-align: center; margin-top: -60px; }
  .profile-names, .profile-actions { padding-top: 0; }
  .profile-names h1 { font-size: 26px; }
  .friend-faces { justify-content: center; }
  .chat-dock { bottom: 64px; }
  .chat-window { width: calc(100vw - 32px); }
  /* Taller cards, about three and a half across, as in the Facebook app. */
  .story-card { flex-basis: 30%; aspect-ratio: 3 / 5; }
  .composer-action.orange { display: none; }
  .story-editor, .listing-detail { flex-direction: column; }
  .story-preview { width: 100%; max-height: 320px; }
}



/* ---------- Auth: split screen (showcase + form) ---------- */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr);
  background:
    radial-gradient(520px 380px at 100% 0%, rgba(242, 184, 75, 0.16), transparent 70%),
    var(--bg);
}

.auth-showcase {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin: 12px;
  padding: 40px 56px;
  border-radius: 28px;
  color: #fff;
  /* The photo's dark foliage holds the text; the six companions gather bottom right. */
  background:
    linear-gradient(100deg, rgba(10, 38, 42, 0.72) 0%, rgba(10, 38, 42, 0.25) 45%, transparent 70%),
    linear-gradient(180deg, rgba(10, 38, 42, 0.45) 0%, transparent 30%),
    url("/images/auth-companions.webp") right bottom / cover no-repeat,
    var(--navy);
  box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 12px; font: 700 24px var(--font-display); letter-spacing: -0.5px; }
.auth-brand .brand-logo { font-size: 34px; color: inherit; }
.auth-pitch { margin: clamp(16px, 8vh, 96px) 0 auto; }
.auth-pitch h1 {
  max-width: 11ch;
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -2px;
}
.auth-pitch h1 { text-shadow: 0 2px 24px rgba(8, 30, 33, 0.45); }
.auth-pitch > p { max-width: 42ch; margin-top: 18px; color: #d3e0df; font-size: 17px; line-height: 1.55; }
.auth-features { list-style: none; margin: 32px 0 0; padding: 0; display: grid; justify-items: start; gap: 10px; }
.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 6px;
  border-radius: 16px;
  color: #eef4f3;
  font-size: 15px;
  background: rgba(10, 38, 42, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  /* First visit only: short ease-out stagger */
  animation: auth-rise 360ms var(--ease-out) backwards;
}
.auth-features li:nth-child(2) { animation-delay: 50ms; }
.auth-features li:nth-child(3) { animation-delay: 100ms; }
.auth-features li:nth-child(4) { animation-delay: 150ms; }
.auth-feature-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Logo paw prints walking over the whole page (see PawTrail), form card included; never intercepts clicks. */
.paw-trail { position: fixed; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.paw-print {
  position: absolute;
  width: 30px;
  height: 30px;
  translate: -50% -50%; /* left/top (set by PawTrail) are the print's center */
  opacity: 0.8;
  filter: drop-shadow(0 2px 4px rgba(8, 30, 33, 0.25));
  /* Set down in place like a pressed paw, then fades out slowly while the next prints are laid down.
     Only scale and opacity animate, never the position. */
  animation:
    paw-press 260ms var(--ease-out),
    paw-fade 4740ms linear 260ms forwards;
}
@keyframes paw-press {
  from { opacity: 0; scale: 1.3; }
}
@keyframes paw-fade {
  to { opacity: 0; }
}

/* Top-anchored (not centered) so the tabs stay put when the form height changes. */
.auth-main { position: relative; z-index: 2; display: flex; justify-content: center; align-items: flex-start; padding: clamp(40px, 11vh, 120px) 24px 48px; }
.auth-panel {
  width: 100%;
  max-width: 464px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(31, 42, 44, 0.04), var(--shadow-lg);
}

/* Segmented control: the white pill slides under the active tab. */
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg);
}
.auth-tabs-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 42, 44, 0.08), 0 4px 12px rgba(31, 42, 44, 0.08);
  transition: transform 250ms var(--ease-out);
}
.auth-tabs.register .auth-tabs-indicator { transform: translateX(100%); }
.auth-tab {
  position: relative;
  height: 40px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  transition: color 200ms ease;
}
.auth-tab.active { color: var(--text); }

.auth-step { display: flex; flex-direction: column; gap: 16px; animation: auth-rise 260ms var(--ease-out); }
@keyframes auth-rise { from { opacity: 0; transform: translateY(6px); } }
.auth-heading { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.auth-heading h2 { font-size: 30px; line-height: 1.1; letter-spacing: -0.8px; text-wrap: balance; }
.auth-heading p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.auth-step-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-light);
}

.auth-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.auth-label { font-size: 13px; font-weight: 600; color: var(--text); }
.goal-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.goal-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--divider); border-radius: var(--radius-sm); background: var(--card); font-size: 14px;
}
.goal-option input { accent-color: var(--primary); margin: 0; }
.goal-option.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.goal-options.invalid .goal-option { border-color: #9a3412; }
.auth-input { position: relative; }
.auth-step .text-field {
  height: 48px;
  padding: 0 14px;
  font-size: 16px; /* below 16px iOS zooms the page on focus */
  border: 1px solid #8592a6; /* 3:1 against white: the field boundary stays visible */
  border-radius: 12px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.auth-step .text-field::placeholder { color: #7c889b; }
.auth-step .text-field:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.12); }
.auth-step .text-field.invalid { border-color: #9a3412; box-shadow: 0 0 0 1px #9a3412; }
.auth-step .text-field.has-trailing { padding-right: 48px; }
/* 6-digit code: six boxes under one transparent input that takes the typing. */
.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.otp-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: 16px; /* no iOS zoom on focus */
  caret-color: transparent;
  cursor: text;
}
.otp-cell {
  display: grid;
  place-items: center;
  height: 64px;
  border: 1px solid #c9c1b3;
  border-radius: 14px;
  background: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.otp-cell.filled { border-color: var(--text); background: var(--bg); animation: otp-pop 160ms var(--ease-out); }
.otp-cell.active { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.14); background: #fff; }
.otp-caret { width: 2px; height: 28px; border-radius: 1px; background: var(--primary); animation: otp-blink 1s steps(1) infinite; }
.otp.invalid .otp-cell { border-color: #9a3412; background: #fff7f3; }
.otp.invalid { animation: otp-shake 320ms ease; }
@keyframes otp-pop { from { transform: scale(0.92); } }
@keyframes otp-blink { 50% { opacity: 0; } }
@keyframes otp-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .otp-cell.filled, .otp.invalid, .otp-caret { animation: none; }
}
@media (max-width: 420px) {
  .otp { gap: 6px; }
  .otp-cell { height: 54px; font-size: 24px; border-radius: 12px; }
}
.auth-strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.otp-resend { color: var(--muted); }
.auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--muted);
  transform: translateY(-50%);
  transition: color 150ms ease, background-color 150ms ease;
}
.auth-eye:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.auth-link {
  /* Padding grows the hit area to 24px+ without moving the text. */
  margin: -5px -4px;
  padding: 5px 4px;
  border-radius: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}
.auth-page button { touch-action: manipulation; }
.auth-hint, .auth-field-error { margin: 0; font-size: 13px; line-height: 1.4; }
.auth-hint { color: var(--muted); }
.auth-field-error { display: flex; align-items: center; gap: 6px; color: #9a3412; font-weight: 500; }
.auth-field-error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  color: #fff;
  background: #9a3412;
  font-size: 11px;
  font-weight: 800;
}
.btn:focus-visible { outline: 3px solid rgba(194, 65, 12, 0.45); outline-offset: 2px; }
.btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.auth-link:focus-visible, .auth-back:focus-visible, .auth-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; }
.auth-switch .auth-link { font-size: 14px; }
.auth-submit { margin-top: 4px; }
.auth-terms-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.auth-terms-check input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.auth-terms-check.invalid input { outline: 2px solid #9a3412; outline-offset: 1px; }
.auth-terms-link { align-self: flex-start; margin-left: 24px; font-size: 13px; }
.auth-info { color: var(--success); font-size: 14px; }
.auth-step .error-text { margin: 0; }
.auth-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -8px;
  padding: 6px 10px 6px 8px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 150ms ease, background-color 150ms ease;
}

.auth-panel .language-switcher { margin-top: 0; }

@media (hover: hover) and (pointer: fine) {
  .auth-tab:not(.active):hover { color: var(--text); }
  .auth-eye:hover { color: var(--text); background: var(--bg); }
  .auth-link:hover { text-decoration: underline; }
  .auth-back:hover { color: var(--text); background: var(--bg); }
}

@media (max-width: 1000px) {
  /* Tablet: photo hero, text on the left, animals on the right; the form card overlaps its bottom. */
  .auth-page { grid-template-columns: 1fr; align-content: start; }
  .auth-showcase {
    margin: 0;
    min-height: 400px;
    padding: 28px 32px 104px;
    gap: 28px;
    border-radius: 0 0 32px 32px;
    box-shadow: none;
    background:
      linear-gradient(90deg, rgba(10, 38, 42, 0.85) 0%, rgba(10, 38, 42, 0.55) 45%, transparent 75%),
      url("/images/auth-companions.webp") right 58% / cover no-repeat,
      var(--navy);
  }
  .auth-pitch { margin: auto 0 0; max-width: 52%; }
  .auth-pitch h1 { max-width: 12ch; font-size: clamp(32px, 5.4vw, 46px); letter-spacing: -1.2px; }
  .auth-pitch > p { margin-top: 12px; font-size: 16px; }
  .auth-features { display: none; }
  .auth-main { margin-top: -72px; padding: 0 24px 48px; }
  .auth-panel { max-width: 520px; padding: 32px; }
}

@media (max-width: 600px) {
  /* Mobile: text on the darkened top of the hero, the animals peeking out below it. */
  .auth-showcase {
    min-height: 0;
    padding: 20px 20px 190px;
    gap: 22px;
    border-radius: 0 0 28px 28px;
    background:
      linear-gradient(180deg, rgba(10, 38, 42, 0.92) 0%, rgba(10, 38, 42, 0.75) 40%, transparent 62%),
      url("/images/auth-companions.webp") 85% 32% / auto 150% no-repeat,
      var(--navy);
  }
  .auth-brand { font-size: 21px; }
  .auth-brand .brand-logo { font-size: 30px; }
  .auth-pitch { margin: 0; max-width: none; }
  .auth-pitch h1 { max-width: 14ch; font-size: 30px; letter-spacing: -0.9px; }
  .auth-pitch > p { margin-top: 8px; font-size: 15px; }
  .auth-main { margin-top: -64px; padding: 0 12px 32px; }
  .auth-panel { padding: 24px 20px; gap: 24px; border-radius: 24px; }
  .auth-heading h2 { font-size: 26px; }
  .paw-print { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-step, .auth-features li { animation-name: fade-in; }
  .auth-tabs-indicator { transition-property: opacity, color, background-color, border-color; }
}

/* ---------- Post card: header, full-bleed media, compact action bar ---------- */
/* No overflow clipping: the ••• menu must be able to overflow the card (the media clips itself). */
.post { padding: 0; overflow: visible; }
.post .post-header { gap: 12px; padding: 16px 10px 10px 16px; }
.post .post-meta { min-width: 0; gap: 2px; }
.post-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.post .post-author {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 600 15.5px var(--font-display);
}
.post-dot { color: var(--muted); }
.post-follow { flex-shrink: 0; color: var(--primary); font-weight: 600; font-size: 14px; }
.post-follow.sent { color: var(--muted); font-weight: 500; }
.post-time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.post .post-header .icon-btn { width: 38px; height: 38px; color: var(--muted); }
.post .post-content { padding: 0 18px 14px; font-size: 15.5px; line-height: 1.5; }
.post .post-content.big { font: 600 24px/1.3 var(--font-display); letter-spacing: -0.4px; padding: 4px 18px 20px; }
.hashtag { color: var(--primary); font-weight: 600; }

/* The photo is never cropped: its blurred copy fills the sides. */
.post-media { position: relative; margin: 0; overflow: hidden; display: flex; justify-content: center; background: #0b0d12; }
.post-media-blur {
  position: absolute;
  inset: -40px;
  background: center / cover no-repeat;
  filter: blur(36px) brightness(0.55) saturate(1.2);
}
.post-media img { position: relative; display: block; max-width: 100%; max-height: 620px; object-fit: contain; }

/* Two photos side by side; three as a large one and two stacked beside it. */
.post-photos { display: grid; gap: 2px; background: var(--divider); }
.post-photos img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.post-photos-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.post-photos-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 4 / 3; }
.post-photos-3 .post-photo-btn:first-child { grid-row: span 2; }

/* A text alone on its background: large, centered, in the color it calls for. */
.post-background { display: flex; align-items: center; justify-content: center; min-height: 280px; padding: 32px 28px; margin-bottom: 12px; text-align: center; }
.post .post-background .post-content { padding: 0; color: inherit; font: 700 26px/1.3 var(--font-display); letter-spacing: -0.4px; }
.post-background a, .post-background .hashtag { color: inherit; text-decoration: underline; }

.post-stats { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 16px; padding: 10px 0; color: var(--muted); font-size: 14px; }
.post-stats .post-comment-count { margin-left: auto; color: var(--muted); font-weight: 400; }
.post-bar { display: flex; align-items: center; gap: 4px; margin: 0 12px; padding: 4px 0; border-top: 1px solid var(--divider); }
.post-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  justify-content: center;
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.post-act:active { transform: scale(0.96); }
.post-act:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.post-act.on, .post-act.copied { color: var(--primary); }
.post-act.copied { color: var(--success); }
.post-act.on .icon { animation: like-pop 0.3s ease-out; }
.post-reactions { display: inline-flex; align-items: center; gap: 6px; }
.post-reactions .post-reaction-icon { width: 32px; height: 32px; }
.post-reactions .like-bubble {
  width: 20px;
  height: 20px;
  background: linear-gradient(180deg, #ff4a4e, var(--primary));
  box-shadow: 0 0 0 2px var(--card);
}
.post .comments { margin: 0; padding: 8px 16px 12px; }

.post-hidden { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; color: var(--muted); }
.post-page { max-width: 680px; margin: 0 auto; padding: 8px 16px 40px; }
@media (max-width: 600px) {
  .post-page { padding: 0 0 24px; }
  /* Edge to edge on phones, like the feed. */
  .post-page > .card { border-radius: 0; }
}
.post-time-link { color: inherit; }
.post-openable { cursor: pointer; }
.post-openable .comments { cursor: auto; }

@media (hover: hover) and (pointer: fine) {
  .post-act:hover { background: var(--bg); }
  .post-time-link:hover { text-decoration: underline; }
  .post .post-header .icon-btn:hover { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
  .post-act.on .icon { animation: none; }
}

/* Address opening Google Maps */
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(194, 65, 12, 0.35);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.map-link-icon { flex-shrink: 0; opacity: 0.75; }
.map-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) {
  .map-link:hover { text-decoration-color: currentColor; }
}

/* @mentions: suggestion list above the comment field, linked names in comments */
.mention-input { position: relative; flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.mention-list {
  position: absolute;
  z-index: 30;
  left: 0;
  bottom: calc(100% + 6px);
  width: min(340px, 100%);
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(31, 42, 44, 0.08), 0 12px 32px rgba(31, 42, 44, 0.18);
  transform-origin: bottom left;
  animation: mention-in 160ms var(--ease-out);
}
@keyframes mention-in { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
.mention-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.mention-option.active { background: var(--bg); }
.mention-name { font-weight: 600; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mention {
  color: var(--primary);
  font-weight: 600;
  border-radius: 4px;
  background: rgba(194, 65, 12, 0.08);
  padding: 0 2px;
}
.mention:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .mention:hover { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  .mention-list { animation-name: fade-in; }
}

/* Comment threads: replies indented under their comment, one level deep */
.comment-body { min-width: 0; }
.comment-bubble p { overflow-wrap: anywhere; }
.comment-meta { display: flex; align-items: center; gap: 12px; padding: 2px 12px 0; color: var(--muted); font-size: 12px; }
.comment-reply {
  margin: -6px -4px;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.comment-reply:focus-visible, .replies-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 4px; }
.comment-replies {
  position: relative;
  margin-left: 38px;
  padding-left: 12px;
}
/* Thread line from the parent avatar down to the replies */
.comment-replies::before {
  content: "";
  position: absolute;
  left: -22px;
  top: -6px;
  bottom: 16px;
  width: 2px;
  border-radius: 2px;
  background: var(--divider);
}
.comment.reply { margin: 4px 0; }
.comment.reply .comment-bubble { padding: 6px 11px; }
.replies-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
  padding: 4px 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.reply-form { margin-top: 4px; }
@media (hover: hover) and (pointer: fine) {
  .comment-reply:hover, .replies-toggle:hover { text-decoration: underline; }
}

/* Post audience: Public / Friends */
.audience-choice { display: inline-flex; gap: 4px; margin-top: 4px; padding: 3px; border-radius: 10px; background: var(--bg); }
.audience-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 150ms ease, color 150ms ease;
}
.audience-option.selected { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(31, 42, 44, 0.12); }
.audience-option:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.post-audience { display: inline-flex; }
/* The teams a post or a story is published in. */
.team-picker { margin-top: 6px; }
.post-audience { display: flex; flex-wrap: wrap; gap: 0 8px; }
.team-picker .multi-select-button { justify-content: flex-start; gap: 10px; font-weight: 600; }
.team-picker .multi-select-button > .ellipsis { flex: 1; min-width: 0; }
.team-picker .multi-select-button .icon { transform: none; }
.team-picker.open .multi-select-button .team-picker-chevron { transform: rotate(180deg); }
.team-picker.invalid .multi-select-button { border-color: var(--danger); }
.team-picker-faces { display: inline-flex; gap: 2px; flex-shrink: 0; }
.team-picker .icon-illustration { margin: 0; }
.team-picker .multi-select-panel { z-index: 301; }
.team-picker .multi-select-backdrop { z-index: 300; }
.team-picker .multi-select-options { max-height: 320px; }
.team-picker-option { width: 100%; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text); text-align: left; padding: 8px 10px; }
.team-picker-option > .ellipsis { flex: 1; min-width: 0; }
.team-picker-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.team-picker-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.team-picker-option.selected { background: var(--primary-light); }
.team-picker-option:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.team-picker-check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; color: var(--primary); }
.team-picker-check.box { border-radius: 6px; border: 1.6px solid var(--divider); color: #fff; transition: background-color .15s, border-color .15s; }
.team-picker-option.selected .team-picker-check.box { background: var(--primary); border-color: var(--primary); }
.post-audience > .team-picker { min-width: 0; }
/* The list is as wide as its labels, never narrower than the button. */
.team-picker .multi-select-panel { right: auto; min-width: 100%; width: max-content; max-width: min(360px, calc(100vw - 32px)); }
.team-picker-sheet-header { display: none; }
/* On a phone: the two drop-downs share the row, and the list is a sheet from the bottom. */
@media (max-width: 600px) {
  .author-row > div:has(.post-audience) { flex: 1; min-width: 0; }
  .post-audience { align-self: stretch; }
  .post-audience > .team-picker { flex: 1 1 auto; }
  .team-picker .multi-select-backdrop { background: rgba(18, 60, 63, 0.35); animation: fade-in 0.15s ease-out; }
  .team-picker .multi-select-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: 75vh;
    margin: 0;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: team-sheet-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .team-picker-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 6px 20px; font-size: 16px; }
  .team-picker-sheet-close { background: var(--secondary-btn); color: var(--muted); }
  .team-picker .multi-select-options { flex: 1; min-height: 0; max-height: none; padding: 4px 8px 12px; }
  .team-picker-option { min-height: 52px; padding: 10px 12px; border-radius: 12px; }
}
@keyframes team-sheet-in { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  .team-picker .multi-select-panel, .team-picker .multi-select-backdrop { animation: none; }
}
.dropdown-label { margin: 4px 0 0; padding: 6px 12px 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.menu-check { margin-left: auto; color: var(--primary); display: inline-flex; }
.small-menu hr { margin: 4px 0; }
@media (hover: hover) and (pointer: fine) {
  .audience-option:not(.selected):hover { color: var(--text); }
}

/* Unsubscribe page (public, opened from an email) */
.unsubscribe-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(700px 400px at 50% 0%, rgba(194, 65, 12, 0.1), transparent 70%), var(--bg);
}
.unsubscribe-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 28px;
  text-align: center;
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  animation: auth-rise 260ms var(--ease-out);
}
.unsubscribe-brand { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.unsubscribe-brand .brand-logo { font-size: 28px; }
.unsubscribe-card .auth-step-icon { margin: 0; }
.unsubscribe-card .auth-step-icon .spinner { width: 22px; height: 22px; margin: 0; }
.unsubscribe-card h1 { font-size: 24px; letter-spacing: -0.5px; }
.unsubscribe-card p { color: var(--muted); line-height: 1.55; }
.unsubscribe-card .btn { align-self: center; }
.unsubscribe-card .language-switcher { margin-top: 4px; }

/* Compact switch inside a menu row */
.small-switch { margin-left: auto; width: 36px; height: 22px; }
.small-switch::after { width: 16px; height: 16px; }
.small-switch.on::after { transform: translateX(14px); }

/* Video posts */
.post-video { background: #000; }
.post-video video { display: block; width: 100%; max-height: 620px; background: #000; }
.image-preview video { display: block; width: 100%; max-height: 360px; border-radius: 12px; background: #000; }
.icon-btn.red { color: var(--primary); }
.media-limit { margin: -2px 0 0; }

/* Upload progress of a photo or video */
.upload-progress { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.upload-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transform-origin: left;
  transition: transform 200ms linear;
}
@media (prefers-reduced-motion: reduce) {
  .upload-progress-bar { transition: none; }
}

/* Videos playing while on screen, with a sound button */
.auto-video { position: relative; width: 100%; }
.auto-video video { display: block; width: 100%; }
.auto-video.story-bg, .auto-video.story-image { position: absolute; inset: 0; height: 100%; }
.auto-video.story-bg video, .auto-video.story-image video { height: 100%; }
.auto-video.story-bg video { object-fit: cover; pointer-events: none; }
.auto-video.story-image video { object-fit: contain; }
.video-sound {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}
.video-sound:hover { background: rgba(0, 0, 0, 0.75); }

/* Place field: free text with Mapbox suggestions below */
.place-field { position: relative; }
.place-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  cursor: text;
}
.place-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12); }
.place-input-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.place-input-field { border: none; outline: none; background: transparent; padding: 2px 0; font-size: 16px; color: var(--text); }
.place-input .spinner { width: 18px; height: 18px; margin: 0; border-width: 2px; }
.place-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.place-suggestions li.muted { padding: 10px; }
.place-suggestions button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px; text-align: left; }
.place-suggestions button .icon { color: var(--muted); flex-shrink: 0; }
@media (hover: hover) and (pointer: fine) {
  .place-suggestions button:hover { background: var(--hover); }
}

/* Search area map (Leaflet, see area_map.js) */
.area-map-wrap { position: relative; }
.area-map { height: 300px; border-radius: var(--radius-sm); overflow: hidden; background: #e8eef4; z-index: 0; }
.area-map.empty, .area-map.failed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.area-map .leaflet-control-attribution { font-size: 10px; }
.area-pin { background: none; border: none; }
.area-map-wrap .area-locate { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 10px; }
.area-locate .spinner { width: 18px; height: 18px; margin: 0; border-width: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Search area row in the side panels */
.area-button-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.area-button .side-icon { color: var(--primary); }

/* Report dialog */
.report-why { font-size: 16px; margin: 0; }
.report-reasons { display: flex; flex-direction: column; gap: 6px; }
.report-reason {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
}
.report-reason input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.report-reason.selected { border-color: var(--primary); background: var(--primary-light); }
@media (hover: hover) and (pointer: fine) {
  .report-reason:hover:not(.selected) { background: var(--hover); }
}
.report-thanks { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 8px; text-align: center; }
.report-thanks-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e7f6ec;
  color: var(--success);
}
.story-reactions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.story-reactions li { display: flex; align-items: center; gap: 10px; }
.story-reaction-emoji { font-size: 22px; }

/* Moderation queue (platform and store reports) */
.moderation-page { max-width: 760px; margin: 0 auto; padding: 8px 28px 40px; }
.report-queue { display: flex; flex-direction: column; gap: 12px; }
.report-queue > .chips { margin-bottom: 4px; }
.report-card { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 16px 18px; }
.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-head .muted { margin-left: auto; }
.report-target { background: var(--bg); color: var(--text); font-weight: 600; }
.report-excerpt {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--divider);
  background: var(--bg);
  border-radius: 0 10px 10px 0;
  white-space: pre-line;
  word-break: break-word;
}

/* Store team */
.store-team { display: flex; flex-direction: column; gap: 16px; }
.store-team .card { margin: 0; }
.role-legend { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.team-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.team-search { flex: 1; min-width: 220px; width: auto; box-shadow: none; border: 1px solid var(--divider); }
.team-role-select { width: auto; min-width: 140px; }
.team-results { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.team-results li, .team-member { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); }
.team-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.team-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.team-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.store-transfer { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.store-transfer h3, .store-transfer p { margin: 0; }
.store-transfer-pending { padding: 10px 12px; border-radius: var(--radius-sm); background: #fff4e5; color: var(--text); }
@media (max-width: 700px) {
  .team-member { flex-wrap: wrap; }
  .team-actions { width: 100%; justify-content: flex-start; }
  .moderation-page { padding: 8px 12px 40px; }
}

/* Stores verified by Travaillo */
.verified-badge { display: inline-flex; vertical-align: middle; margin-left: 6px; color: #1d7bf2; }
.verified-badge .icon { display: inline-flex; }
.pending-verification {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff4e0;
  color: #9a5b00;
  font-size: 13px;
  font-weight: 600;
}
/* Shown to the team of a store suspended by Travaillo. */
.store-suspended-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: calc(100% - 32px);
  max-width: 1186px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
  box-sizing: border-box;
}
.store-suspended-banner p { margin: 4px 0 0; }
.moderation-tabs { margin-bottom: 16px; }
.verify-item { display: flex; flex-direction: column; gap: 8px; }
.verify-item .btn { align-self: flex-start; }

/* Profile tabs other than the posts: one column */
.profile-body.single { display: block; }
.profile-body.single > * { max-width: 940px; margin-left: auto; margin-right: auto; }
.profile-about { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.profile-about .card { margin: 0; }
.profile-friends .friends-grid.wide { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.profile-body .friends-page { padding: 0; }
.saved-feed h2 { margin: 0 0 12px; }
.media-tab { display: flex; flex-direction: column; gap: 12px; }
.media-tab h2 { margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.media-tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--input); }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; transition: transform 200ms var(--ease-out); }
.media-tile:hover img, .media-tile:hover video { transform: scale(1.03); }
.media-tile-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(18, 60, 63, 0.25); pointer-events: none; }
.user-store { display: flex; flex-direction: column; gap: 6px; }
.user-store-role { align-self: flex-start; background: var(--bg); color: var(--text); font-weight: 600; }
.profile-tabs button { padding: 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.profile-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
@media (max-width: 1000px) {
  .profile-about { grid-template-columns: 1fr; }
}

/* Store address: a read-only field that opens the map (see store_location_picker.dart) */
.country-filter { cursor: default; }
.country-filter .text-field { flex: 1; min-width: 0; height: 36px; }

/* Store reviews: 0 to 5 paws */
.paw-rating { position: relative; display: inline-flex; flex-shrink: 0; vertical-align: middle; line-height: 0; }
.paw-rating-empty, .paw-rating-full { display: inline-flex; gap: 2px; }
.paw-rating-empty { color: #e6dccd; }
.paw-rating-full { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--primary); white-space: nowrap; }
.paw-rating .icon { flex-shrink: 0; }
.store-rating { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.store-rating strong { font-variant-numeric: tabular-nums; }
.store-card-body .store-rating { font-size: 12.5px; gap: 4px; }
.profile-names .store-rating { margin-top: 8px; }
.store-rating.link-like { padding: 2px 6px; margin-left: -6px; border-radius: 8px; }
.store-rating.link-like:hover { background: var(--primary-light); }

.store-reviews { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.store-reviews-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.store-reviews-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rating-summary { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.rating-summary-score { font: 700 48px/1 "Space Grotesk", Inter, sans-serif; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.review-form { display: flex; flex-direction: column; gap: 12px; }
.review-form h3 { margin: 0; }
.review-form textarea { width: 100%; resize: none; }
.paw-picker { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.paw-picker button { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; transition: color 120ms ease, background-color 120ms ease, transform 120ms ease; }
.paw-picker button:active { transform: scale(0.92); }
.paw-picker-paw { width: 40px; height: 40px; color: #e6dccd; }
.paw-picker-paw.on { color: var(--primary); }
.paw-picker-paw:hover { background: var(--primary-light); }
.paw-picker-zero { width: 32px; height: 32px; margin-right: 4px; border: 1.5px solid var(--divider); font-weight: 700; color: var(--muted); }
.paw-picker-zero.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.paw-picker-value { margin-left: 6px; min-width: 32px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.review-card { display: flex; flex-direction: column; gap: 10px; }
.review-card.mine { box-shadow: inset 3px 0 0 var(--primary); }
.review-head { display: flex; align-items: center; gap: 10px; }
.review-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.review-name { font-weight: 600; text-decoration: none; }
.review-name:hover { text-decoration: underline; }
.review-meta { display: flex; align-items: center; gap: 8px; }
.review-comment { margin: 0; word-break: break-word; }
.review-head .review-delete { margin-left: auto; width: 32px; height: 32px; color: var(--muted); }
.review-reply { display: flex; gap: 10px; margin-left: 50px; padding: 10px 12px; border-radius: 12px; background: var(--hover); }
.review-reply-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.review-reply-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.review-reply-head .review-delete { margin-left: auto; width: 28px; height: 28px; color: var(--muted); }
.review-reply-toggle { align-self: flex-start; margin-left: 50px; }
.review-reply-form { display: flex; flex-direction: column; gap: 8px; margin-left: 50px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--divider); }
.store-reviews .see-more { align-self: center; }
.review-filters .chip { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.review-filters .chip:disabled { opacity: 0.45; cursor: default; }
.rating-bars { display: flex; flex-direction: column; gap: 2px; width: 100%; margin: 4px 0; }
.rating-bar { display: flex; align-items: center; gap: 8px; width: 100%; padding: 3px 6px; border-radius: 8px; font-size: 13px; transition: background-color 120ms ease; }
.rating-bar:hover, .rating-bar.active { background: var(--primary-light); }
.rating-bar-label { display: inline-flex; align-items: center; gap: 3px; width: 28px; font-weight: 600; color: var(--muted); }
.rating-bar-track { flex: 1; height: 8px; border-radius: 999px; background: #edf0f4; overflow: hidden; }
.rating-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.rating-bar-count { min-width: 24px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .paw-picker button { transition: none; } .paw-picker button:active { transform: none; } }
@media (max-width: 900px) {
  .store-reviews { grid-template-columns: 1fr; }
  .store-reviews-side { position: static; }
}

/* The Village: listings, breeders' animals and pros under one header */
.village-header { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.village-bar { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--divider); }
.village-bar .village-sections { flex: 1; min-width: 0; border-bottom: none; }
.village-bar .page-title-actions { flex-shrink: 0; padding-bottom: 6px; }
.village-sections { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); overflow-x: auto; scrollbar-width: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.village-section {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 10px 14px; margin-bottom: -1px;
  border-bottom: 3px solid transparent; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 600; text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.village-section:hover { color: var(--text); background: var(--hover, #f6f0e6); }
.village-section.active { color: var(--primary); border-bottom-color: var(--primary); }
.village-animals > .village-header { padding: 8px 28px 0; }
.village-animals > .filter-toolbar { padding: 0 28px; margin-bottom: 18px; }
@media (max-width: 1000px) {
  .village-animals > .village-header { padding: 8px 12px 0; }
  .village-animals > .filter-toolbar { padding: 0 12px; }
}
@media (max-width: 600px) {
  .village-section { padding: 10px 10px; }
}

/* Animal filters: clear all from the panel header, remove one from the results */
.filters-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 8px; }
.filters-head h2 { padding: 4px 8px; }
.filters-clear {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; height: 30px; padding: 0 6px 0 10px;
  border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 600;
  transition: background-color 150ms ease;
}
.filters-clear:hover { background: #fadada; }
.filters-clear .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: #fff;
  font-size: 11.5px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 14px; }
.active-filter {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--divider); font-size: 13px; font-weight: 600;
  transition: box-shadow 150ms ease, color 150ms ease;
}
.active-filter .icon { color: var(--muted); transition: color 150ms ease; }
.active-filter:hover { box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); }
.active-filter:hover .icon { color: var(--primary); }
.active-filters-clear { margin-left: 4px; font-size: 13px; font-weight: 600; color: var(--primary); }
.active-filters-clear:hover { text-decoration: underline; }
.empty-state .btn { margin-top: 4px; }

/* Photo framing before upload (cover, profile picture, store logo) */
.cropper {
  position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-sm); background: #123c3f;
  cursor: grab; touch-action: none; user-select: none; outline: none;
}
.cropper:focus-visible { box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.35); }
.cropper.dragging { cursor: grabbing; }
/* Zoomed out, the room left around the image is white, as in the saved crop. */
.cropper.ready, .cover .cover-cropper.ready { background: #fff; }
.cropper img { position: absolute; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.cropper .spinner { position: absolute; inset: 0; margin: auto; }
/* A thin frame, and for round photos a dimmed outside of the circle. */
.cropper-mask { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7); border-radius: inherit; }
.cropper.round { width: min(100%, 360px); align-self: center; }
.cropper.round .cropper-mask { border-radius: 50%; box-shadow: 0 0 0 9999px rgba(18, 60, 63, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.8); }
.cropper-zoom { display: flex; align-items: center; gap: 8px; width: min(100%, 420px); align-self: center; }
.cropper-zoom input[type=range] { flex: 1; accent-color: var(--primary); }
.modal-body > p.center { text-align: center; }

/* Cover menu (upload / reposition): the cover lets it overflow while open. */
.cover:has(.cover-menu .dropdown) { overflow: visible; }
.cover > img { border-radius: inherit; }
.cover-menu { background: none; }
.cover-menu > .btn { background: #fff; box-shadow: 0 2px 10px rgba(31, 42, 44, 0.12); }
.cover-menu > .btn:hover:not(:disabled) { background: var(--hover); }
.cover-menu .dropdown { top: calc(100% + 8px); width: 240px; }
.cover-menu .image-picker.dropdown-item { cursor: pointer; }

/* Facebook-style repositioning, in place over the cover. */
.cover-reposition { position: absolute; inset: 0; z-index: 3; overflow: hidden; container-type: size; border-radius: inherit; background: var(--navy); }
.cover-reposition > .spinner { position: absolute; inset: 0; margin: auto; }
/* A 4:1 frame covering the cover, centred: what overflows is what object-fit hides on the page. */
.cover .cover-cropper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, 400cqh); /* covers the cover whatever its ratio */
  transform: translate(-50%, -50%);
  border-radius: 0;
  background: transparent;
}
.cover .cover-cropper img { object-fit: fill; border-radius: 0; }
.cover-cropper .cropper-mask { box-shadow: none; }
.cover-cropper:focus-visible { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6); }
.cover-reposition-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(18, 28, 30, 0.6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.cover-reposition:has(.cropper.dragging) .cover-reposition-hint { opacity: 0; }
.cover-reposition-hint.error { background: rgba(154, 52, 18, 0.9); }
.cover-reposition-bar {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cover-reposition-bar .cropper-zoom {
  width: 220px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(31, 42, 44, 0.12);
}
.cover-reposition-bar .cropper-zoom .icon-btn { width: 32px; height: 32px; }
.cover-reposition-bar .btn-secondary { background: #fff; }
@media (max-width: 640px) {
  .cover-reposition-bar { left: 12px; right: 12px; bottom: 10px; }
  .cover-reposition-bar .cropper-zoom { display: none; }
  .cover-reposition-bar .btn { flex: 1; }
}

/* View counts (posts, listings, breeders' animals) */
.view-count { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.view-count .icon { display: inline-flex; }
.post-stats-right { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }
.animal-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.listing-card .view-count { margin-top: 2px; }

/* Share dialog, laid out like Facebook's: compose, send in a message, share to */
.share-compose { display: flex; flex-direction: column; gap: 10px; }
.share-me { display: flex; align-items: center; gap: 10px; }
.share-me-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.share-me-text strong { font-size: 15px; }
.share-chip { padding: 2px 10px; border-radius: 8px; background: var(--secondary-btn); color: var(--text); font-size: 12px; font-weight: 600; }
.share-note { width: 100%; min-height: 56px; padding: 4px 2px; border: none; outline: none; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 17px; }
.share-note::placeholder { color: var(--muted); }
.share-preview { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--divider); background: var(--bg); }
.share-preview-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.share-preview-story { gap: 12px; padding: 8px; }
.share-preview-story .share-preview-text { gap: 4px; }
.share-story-thumb { display: block; width: 44px; aspect-ratio: 9 / 16; flex-shrink: 0; border-radius: 8px; object-fit: cover; background: #000; }
.share-story-text { display: flex; align-items: center; justify-content: center; padding: 3px; overflow: hidden; color: #fff; font-size: 6px; font-weight: 600; line-height: 1.2; text-align: center; word-break: break-word; }
.share-story-text span { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.share-story-author { display: flex; align-items: center; gap: 8px; min-width: 0; }
.share-story-author strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.share-block { display: flex; flex-direction: column; gap: 12px; margin: 6px -16px 0; padding: 16px 16px 4px; border-top: 1px solid var(--divider); }
.share-block h3 { margin: 0; font-size: 17px; font-weight: 700; }
.share-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-search { flex: 0 1 200px; width: auto; height: 34px; padding: 0 12px; gap: 6px; border-radius: 999px; background: var(--input); box-shadow: none; font-size: 14px; }
.share-search:focus-within { box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 3px rgba(194, 65, 12, 0.12); }
.share-people-wrap { position: relative; }
.share-people { display: flex; gap: 4px; margin: 0 -8px; padding: 0 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.share-people::-webkit-scrollbar { display: none; }
.share-person { flex: 0 0 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; border: none; border-radius: 12px; background: none; color: var(--text); cursor: pointer; scroll-snap-align: start; transition: background-color 0.15s var(--ease-out); }
.share-person:hover:not(:disabled) { background: var(--hover); }
.share-person:active:not(:disabled) .share-person-avatar { transform: scale(0.95); }
.share-person:disabled { cursor: default; }
.share-person-avatar { position: relative; display: block; transition: transform 0.15s var(--ease-out); }
.share-person-badge { position: absolute; right: -2px; bottom: -2px; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--card); background: var(--success); color: #fff; }
.share-person-badge.send { background: var(--primary); opacity: 0; transform: scale(0.6); transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out); }
.share-person:hover .share-person-badge.send, .share-person:focus-visible .share-person-badge.send { opacity: 1; transform: none; }
.share-person-badge.busy { background: var(--card); border: 3px solid var(--divider); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
.share-person-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; font-size: 13px; line-height: 1.25; text-align: center; word-break: break-word; }
.share-person-state { margin-top: -4px; color: var(--success); font-size: 12px; font-weight: 600; }
.share-person:not(.sent) .share-person-state { color: var(--muted); }
.share-arrow { position: absolute; top: 36px; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(31, 42, 44, 0.25); cursor: pointer; z-index: 2; }
.share-arrow:hover { color: var(--primary); }
.share-arrow.left { left: -6px; }
.share-arrow.right { right: -6px; }
.share-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; margin: 0 -8px; }
.share-target { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 2px 8px; border: none; border-radius: 12px; background: none; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; }
.share-target:hover { background: var(--hover); text-decoration: none; }
.share-target-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--secondary-btn); color: var(--text); transition: transform 0.15s var(--ease-out), background-color 0.15s var(--ease-out); }
.share-target:hover .share-target-icon { background: var(--secondary-btn-hover); }
.share-target:active .share-target-icon { transform: scale(0.95); }
.share-target-check { background: var(--success); color: #fff; }
.share-target:hover .share-target-check { background: var(--success-hover); }
.share-target-whatsapp { color: #25d366; }
.share-target-facebook { color: #1877f2; }
.share-target-label { font-size: 13px; line-height: 1.25; text-align: center; }

/* Chat: photos, videos and shared posts */
.msg-body { display: flex; flex-direction: column; gap: 4px; max-width: 75%; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-body .msg-bubble { max-width: 100%; }
/* The message it answers, quoted above it. */
.msg-quote { display: flex; flex-direction: column; max-width: 100%; padding: 6px 10px; border-left: 3px solid var(--primary); border-radius: 10px; background: var(--input); font-size: 12px; opacity: 0.85; }
.msg-quote-name { font-weight: 700; }
.msg-quote-text { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-wrap; word-break: break-word; }
.msg-deleted { font-style: italic; color: var(--muted); }
.msg.mine .msg-bubble.msg-deleted, .msg.theirs .msg-bubble.msg-deleted { background: transparent; box-shadow: inset 0 0 0 1px var(--divider); color: var(--muted); }
/* The emojis, a pill hugging them, overlapping the bubble's bottom edge. */
.msg-reactions {
  position: relative; z-index: 1; align-self: flex-start; display: inline-flex; align-items: center; gap: 3px;
  margin: -10px 10px 0; padding: 2px 7px; min-height: 24px; border-radius: 999px;
  background: var(--card); border: 2px solid var(--card); box-shadow: 0 1px 3px rgba(31, 42, 44, 0.18);
  line-height: 1; cursor: default;
}
.msg.mine .msg-reactions { align-self: flex-end; }
.msg-reactions-emojis { font-size: 15px; letter-spacing: 1px; }
.msg-reactions-count { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
/* React, answer, delete: beside the hovered message. */
.msg-actions { position: relative; display: flex; align-items: center; align-self: center; opacity: 0; transition: opacity 120ms ease-out; }
.msg-actions .icon-btn { width: 28px; height: 28px; color: var(--muted); }
.msg:hover .msg-actions, .msg-actions:focus-within, .msg-actions.open { opacity: 1; }
@media (hover: none) { .msg-actions { opacity: 1; } }
.msg-reaction-picker { position: absolute; bottom: calc(100% + 4px); display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-lg); z-index: 3; animation: fade-in 0.12s ease-out; }
.msg.mine .msg-reaction-picker { right: 0; }
.msg.theirs .msg-reaction-picker { left: 0; }
.msg-reaction-option { width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 34px; transition: transform 120ms ease-out; }
.msg-reaction-option.selected { background: var(--primary-light); }
@media (hover: hover) and (pointer: fine) {
  .msg-reaction-option:hover { transform: scale(1.2); }
}
.msg-media { position: relative; overflow: hidden; border-radius: 16px; max-width: 220px; background: var(--bg); line-height: 0; }
.msg-media img, .msg-media video { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.msg-media .photo-zoom { display: block; width: 100%; padding: 0; border-radius: 0; }
.msg-uploading img, .msg-uploading video { opacity: 0.6; }
.msg-uploading .upload-progress { position: absolute; left: 8px; right: 8px; bottom: 8px; }
.msg-post {
  display: flex; flex-direction: column; width: 220px; overflow: hidden; border-radius: 16px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--divider); text-decoration: none; color: var(--text); transition: box-shadow 150ms ease;
}
.msg-post:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.msg-file {
  display: flex; align-items: center; gap: 10px; width: 220px; padding: 10px 12px; border-radius: 16px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--divider); text-decoration: none; color: var(--text); transition: box-shadow 150ms ease;
}
a.msg-file:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.msg-file-icon { flex: none; display: flex; color: #c0392b; }
.msg-file-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg-file-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-size { font-size: 12px; color: var(--muted); }
.msg-uploading > .msg-file { opacity: 0.7; }
.msg-uploading:has(> .msg-file) { position: relative; }
.msg-post-media { display: block; width: 100%; height: 120px; object-fit: cover; background: var(--bg); }
.msg-post-media.video { position: relative; }
.msg-post-media.video video { width: 100%; height: 100%; object-fit: cover; }
.msg-post-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(18, 60, 63, 0.25); }
.msg-post-text { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; }
.msg-post-author { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.msg-post-excerpt { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.msg-unavailable { font-style: italic; opacity: 0.8; }
.msg-story { display: flex; flex-direction: column; width: 160px; overflow: hidden; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--divider); }
.msg-story-media { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 260px; object-fit: cover; background: #000; }
.msg-story-text { display: flex; align-items: center; justify-content: center; padding: 12px; color: #fff; font-weight: 600; text-align: center; word-break: break-word; }
.chat-attach { flex-shrink: 0; color: var(--primary); cursor: pointer; }

/* Share a post with friends */

/* Group chats */
.group-avatar { position: relative; display: inline-block; flex-shrink: 0; }
.group-avatar-face { position: absolute; line-height: 0; }
.group-avatar-face .avatar { border: 2px solid var(--card); }
.group-avatar-face.face-0 { left: 0; top: 0; }
.group-avatar-face.face-1 { right: 0; bottom: 0; }
.group-avatar-face:only-child { inset: 0; }
.group-avatar-face:only-child .avatar { border: none; }
.chat-peer { text-align: left; }
button.chat-peer { background: none; color: inherit; cursor: pointer; }
.chat-event { align-self: center; max-width: 85%; margin: 6px 0; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; text-align: center; }
.msg.in-group { align-items: flex-end; gap: 6px; }
.msg-avatar-space { width: 28px; flex-shrink: 0; }
.msg-from { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: calc(100% - 40px); }
.msg-from .msg-body { max-width: 100%; }
.msg-sender { margin: 6px 0 0 12px; color: var(--muted); font-size: 12px; }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 4px; }
.dropdown-head h3 { padding-bottom: 6px; }
.btn-new-group { height: 34px; padding: 0 12px; font-size: 14px; }
.contact.new-group { color: var(--muted); }
.new-group-inner { display: flex; align-items: center; gap: 12px; }
.new-group-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--secondary-btn); color: var(--text); }
.friend-picker { display: flex; flex-direction: column; gap: 10px; }
.friend-picker .search { width: auto; }
.picked-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picked-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 4px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 600; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; cursor: pointer; }
.pick-row:hover { background: var(--hover); }
.pick-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
.group-info-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.group-rename { display: flex; gap: 8px; }
.group-rename .text-field { flex: 1; min-width: 0; }
.group-add { align-self: flex-start; }
.group-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.group-members li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; }
.group-members .grow { display: flex; flex-direction: column; min-width: 0; }
.group-leave { color: var(--danger); }

/* Chat: sent / seen, and messages being sent or that failed */
.msg-status { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 2px 4px 4px; color: var(--muted); font-size: 11.5px; }
.msg-status .icon { display: inline-flex; }
.msg-status.seen { color: var(--text); }
.seen-faces { display: inline-flex; }
.seen-faces .avatar { margin-left: -4px; border: 1.5px solid var(--card); }
.seen-faces .avatar:first-child { margin-left: 0; }
.msg.pending .msg-bubble, .msg.pending .msg-media { opacity: 0.6; }
.msg.failed .msg-bubble { opacity: 1; background: var(--primary-light); color: var(--primary); box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.35); }
.msg.failed .msg-media { opacity: 1; box-shadow: inset 0 0 0 2px var(--primary); }
.msg.pending .msg-status { justify-content: flex-end; }
.msg-failed { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; margin: 3px 4px 4px; color: var(--primary); font-size: 12px; }
.msg-failed .icon { display: inline-flex; }
.msg-failed .link-btn { font-size: 12px; font-weight: 700; color: var(--primary); }
.msg-failed .link-btn.muted { color: var(--muted); font-weight: 600; }

/* My pets (profile) */
.my-pets { display: flex; flex-direction: column; gap: 16px; }
.my-pets-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.my-pets-head h2 { margin: 0 0 2px; }
.pet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pet-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--card); box-shadow: var(--shadow), inset 0 0 0 1px var(--divider); text-align: left;
  transition: box-shadow 150ms ease, transform 150ms var(--ease-out);
}
.pet-card:hover { box-shadow: var(--shadow), inset 0 0 0 1px #d9cdb9; }
.pet-card.selected { box-shadow: var(--shadow), inset 0 0 0 2px var(--primary); }
.pet-card:active { transform: scale(0.98); }
.pet-card-top { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.pet-card-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--primary-light); color: var(--primary); }
.pet-card-name { display: flex; flex-direction: column; min-width: 0; }
.pet-card-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-chip { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--secondary-btn); color: var(--muted); }
.reminder-chip.overdue { background: var(--primary-light); color: var(--primary); }
.reminder-chip.soon { background: #fff4e0; color: #b45309; }
.reminder-chip.done { background: #e7f6ec; color: var(--success); }
.pet-detail { display: flex; flex-direction: column; gap: 12px; }
.pet-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pet-detail-head h3 { margin: 0; font-size: 22px; }
.pet-detail-actions { display: flex; align-items: center; gap: 6px; }
.pet-specs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0; }

/* A pet's profile, for its owner and their friends; its card on the profile opens it */
.pet-card-link { display: block; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.pet-card-link .pet-card { cursor: pointer; }
.pet-card-chevron { margin-left: auto; flex-shrink: 0; color: var(--muted); }
.pet-profile-name { margin: 0; font-size: 26px; }
.pet-profile-owner { color: inherit; text-decoration: none; }
.pet-profile-owner > div {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--input); transition: background 150ms ease;
}
.pet-profile-owner:hover > div { background: var(--secondary-btn); }
.pet-profile-owner-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pet-profile-owner-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-tabs { border-bottom: 1px solid var(--divider); }
.pet-tabs .count-badge.inline { margin-left: 6px; }

.reminders-panel { display: flex; flex-direction: column; gap: 12px; }
.reminders-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reminder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.reminder-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--input); }
.reminder-row.overdue { box-shadow: inset 3px 0 0 var(--primary); }
.reminder-row.soon { box-shadow: inset 3px 0 0 #d97706; }
.reminder-row .grow { display: flex; flex-direction: column; min-width: 0; }
.reminder-list.done .reminder-row { opacity: 0.7; }
.reminder-list.done strong { text-decoration: line-through; }
.reminder-check input { width: 20px; height: 20px; accent-color: var(--success); cursor: pointer; }
.reminder-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--card); color: var(--muted); flex-shrink: 0; }
.reminder-note { color: var(--muted); white-space: pre-line; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 10px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; background: var(--input); cursor: pointer; font-weight: 600; }
.toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
@media (max-width: 600px) {
  .reminder-row { flex-wrap: wrap; }
}

/* Single choice with search (breed, country…), styled like the other form fields */
.search-select { gap: 4px; min-width: 0; }
.search-select .multi-select-label { font-size: 13px; font-weight: 400; color: var(--muted); }
.search-select .multi-select-button { font-weight: 400; color: var(--muted); }
.search-select .multi-select-button.has-value { color: var(--text); font-weight: 500; }
.search-select .multi-select-button:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12); }
.search-select.open .multi-select-button { box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12); }
.search-select.invalid .multi-select-button { border-color: var(--danger); }
.search-select .multi-select-button:disabled { opacity: 1; background: var(--secondary-btn); }
.search-select-value { display: flex; align-items: center; gap: 10px; min-width: 0; }
.search-select-value .multi-select-image { width: 22px; height: 22px; }
.search-select .multi-select-panel { z-index: 300; margin-top: 0; }
.search-select .multi-select-options { flex: 1; min-height: 0; max-height: none; }
.search-select .multi-select-search { flex-shrink: 0; height: 40px; }
.search-select .multi-select-backdrop { z-index: 299; }
.search-select-option { cursor: pointer; }
.search-select-option.active { background: var(--hover); }
.search-select-option.selected { font-weight: 600; color: var(--primary); }
.search-select-option.selected .icon { color: var(--primary); flex-shrink: 0; }
.search-select-option.clear { color: var(--muted); }
.search-select-option .grow { flex: 1; min-width: 0; }

/* Listing form: wider, in sections; several photos */
.form-section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--divider); }
.form-section h4 { margin: 0; font-size: 15px; color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: start; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid > .field-row { grid-column: span 1; }
.photo-picker { display: flex; flex-direction: column; gap: 8px; }
.photo-picker-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.photo-picker .photo-strip { gap: 10px; }
.photo-picker .photo-thumb { width: 132px; height: 99px; border-radius: 12px; }
.photo-picker .photo-thumb.add { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photo-thumb.cover { box-shadow: 0 0 0 2px var(--primary); }
.photo-thumb.uploading { display: flex; align-items: center; justify-content: center; }
.photo-thumb.uploading img { position: absolute; inset: 0; opacity: 0.5; }
.photo-thumb.uploading .spinner { position: relative; }
.photo-cover-badge, .photo-make-cover {
  position: absolute; left: 6px; bottom: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 22px; white-space: nowrap;
}
.photo-cover-badge { background: var(--primary); color: #fff; }
.photo-make-cover { background: rgba(18, 60, 63, 0.72); color: #fff; opacity: 0; transition: opacity 150ms ease; }
.photo-thumb:hover .photo-make-cover, .photo-make-cover:focus-visible { opacity: 1; }
.listing-detail-photo { position: relative; }
@media (max-width: 700px) {
  .form-grid, .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid > .form-field:only-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
}
.animal-gallery .listing-detail-photo .photo-count { right: auto; left: 10px; pointer-events: none; }

/* Stories of members near the viewer who are not friends */
.story-suggested {
  position: absolute; top: 46px; left: 8px; z-index: 2; height: 18px; padding: 0 7px; border-radius: 999px;
  background: rgba(18, 60, 63, 0.62); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px;
  backdrop-filter: blur(4px);
}

/* Pets and breeders' animals */
.pet-photo { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; border-radius: 50%; background: var(--primary-light); color: var(--primary); }
.pet-photo img { width: 100%; height: 100%; object-fit: cover; }
.pet-detail-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pet-reminders-title { margin: 4px 0 0; color: var(--text); }
.identity-fields { display: flex; flex-direction: column; gap: 10px; }
.pet-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.pet-choice-item { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 6px; border-radius: 999px; background: var(--input); font-weight: 600; transition: background-color 120ms ease, box-shadow 120ms ease; }
.pet-choice-item:hover { background: var(--secondary-btn-hover); }
.pet-choice-item.selected { background: var(--primary-light); color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.pet-choice-item:first-child:last-child, .pet-choice-item span:only-child { padding-left: 8px; }
/* Village listings: dogs, cats or both, a segmented switch before the search */
.species-switch { display: inline-flex; flex-shrink: 0; gap: 2px; min-height: 46px; padding: 4px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.species-switch a {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 14px;
  color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease;
}
.species-switch a:hover { color: var(--text); background: var(--secondary-btn); }
.species-switch a.selected { background: var(--navy); color: #fff; }
/* Six species: their animal says it, but for the one chosen. */
.species-switch a:not(.selected) .icon + span { display: none; }
.species-switch a .icon-illustration { margin-left: -6px; }
.page-title-actions .btn.selected { background: var(--navy); color: #fff; }
@media (max-width: 600px) {
  .species-switch { width: 100%; }
  .species-switch a { flex: 1; justify-content: center; padding: 0 8px; }
}

/* Insurance quotes */
.quotes-tab { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.quotes-toolbar { margin-bottom: 0; }
.quote { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.quote-pet { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); background: var(--input); }
.quote-pet-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* The member asks to be called back: the switch, then which number. */
.quote-call-back { display: flex; flex-direction: column; gap: 10px; }
.quote-call-back-note { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.field-hint { margin: -6px 0 4px; }
.quote-answer { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: #e9f5f4; box-shadow: inset 3px 0 0 #0f766e; }
.quote-price { font: 700 22px/1.2 var(--font-display); color: #115e59; font-variant-numeric: tabular-nums; }
.quote-offer {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--divider); color: var(--text); text-decoration: none;
  transition: box-shadow 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .quote-offer:hover { box-shadow: inset 0 0 0 1px #0f766e; }
}
.quote-offer:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.quote-offer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.quote-offer-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-offer-price { flex-shrink: 0; font: 700 16px/1.2 var(--font-display); color: #115e59; font-variant-numeric: tabular-nums; }
.quote-offer-form { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--divider); border-radius: var(--radius-sm); }
.quote-offer-form-head { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.quote-offer-form-head .icon-btn { width: 30px; height: 30px; }
.quote-offer-file { align-self: flex-start; max-width: 100%; cursor: pointer; }
.quote-offer-file-chosen {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--input);
}
.quote-offer-file-chosen .link-btn { flex-shrink: 0; color: var(--primary); }
.quote-offer-add { width: 100%; border: 1px dashed var(--divider); background: transparent; color: var(--primary); }
.quote-offer-add:hover { background: var(--hover); }
.quote-status-pending { background: #fff4e0; color: #92400e; }
.quote-status-answered { background: #e7f6ec; color: var(--success); }
.quote-status-declined, .quote-status-cancelled { background: var(--secondary-btn); color: var(--muted); }

/* ---------- My pets & health tracking ---------- */
.pets-page { max-width: 940px; margin: 0 auto; padding: 24px 16px; }
.pet-insurance { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; padding: 12px 14px; border: 1px solid var(--divider); border-radius: var(--radius-sm); }
.pet-insurance legend { padding: 0 6px; font-weight: 700; }

/* QR code of a profile, a pet or a store */
.qr-code { width: min(300px, 100%); align-self: center; border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 0 0 1px var(--divider); }
.qr-code svg { display: block; width: 100%; height: auto; }
.qr-code-url { text-align: center; word-break: break-all; color: var(--muted); }
.health-page { max-width: 940px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 16px; }
.health-page .page-title { margin-bottom: 0; }
.health-page .page-title h2 { margin: 0 0 2px; }
/* Same frame as the other health tabs, so the tabs do not move between them. */
.quotes-page { max-width: 940px; padding-top: 24px; }
.health { display: flex; flex-direction: column; gap: 16px; }
.health h3 { margin: 0 0 12px; }
.health-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.health-kind {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: var(--radius-sm);
  background: var(--input); font-weight: 600; font-size: 13px; transition: background-color 120ms ease, transform 120ms var(--ease-out);
}
.health-kind:hover { background: var(--secondary-btn-hover); }
.health-kind:active { transform: scale(0.97); }
.health-emoji { font-size: 24px; line-height: 1; }
.health-overview { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 16px; }
@media (max-width: 760px) { .health-overview { grid-template-columns: 1fr; } }
.health-weight { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.health-weight h4 { margin: 12px 0 4px; }
.health-weight-value { font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.health-weight .btn { margin-top: 8px; }
.health-delta { font-size: 13px; font-weight: 600; color: var(--muted); }
.health-delta.up { color: #b45309; }
.health-delta.down { color: #0f766e; }
.health-weights { list-style: none; margin: 0; padding: 0; width: 100%; }
.health-weights li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--divider); font-variant-numeric: tabular-nums; }
.health-totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.health-total { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--input); }
.health-total strong { font-variant-numeric: tabular-nums; }
.health-total.empty strong { color: #bcc0c4; }
/* Journal: one day at a time (previous / day / next, or the month calendar), its entries as a timeline. */
.health-journal { position: relative; display: flex; flex-direction: column; gap: 12px; }
.health-journal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.health-journal-head h3 { margin: 0; }
.health-day-nav { display: flex; align-items: center; gap: 4px; }
.health-day-nav .icon-btn:disabled { opacity: 0.35; cursor: default; }
.health-day-pick {
  display: inline-flex; align-items: center; gap: 8px; min-width: 170px; justify-content: center;
  padding: 8px 14px; border: 0; border-radius: 999px; background: var(--input);
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}
.health-day-pick span::first-letter { text-transform: uppercase; }
.health-day-pick:hover, .health-day-pick.open { background: var(--secondary-btn-hover); }
.health-journal .filter-tabs { margin-bottom: 0; }
.health-empty { margin: 8px 0; text-align: center; }

/* Opens over the journal, under the day it picks. */
.health-calendar {
  position: absolute; top: 64px; right: 16px; z-index: 30; width: 320px; padding: 12px;
  border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow-lg);
  transform-origin: top right; animation: health-calendar-in 160ms var(--ease-out);
}
@keyframes health-calendar-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .health-calendar { animation: none; } }
.health-calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.health-calendar-head strong { text-transform: capitalize; }
.health-calendar-head .icon-btn:disabled { opacity: 0.35; cursor: default; }
.health-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.health-calendar-weekday { padding: 4px 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.health-calendar-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent;
  font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); cursor: pointer;
  transition: background-color 120ms ease;
}
.health-calendar-day:hover:not(:disabled) { background: var(--hover); }
.health-calendar-day:disabled { color: #bcc0c4; cursor: default; }
.health-calendar-day.today { box-shadow: inset 0 0 0 1px var(--navy); }
.health-calendar-day.selected { background: var(--navy); color: #fff; }
.health-calendar-dot { position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: #0f766e; }
.health-calendar-dot.alert { background: #dc2626; }
.health-calendar-day.selected .health-calendar-dot { background: #fff; }

/* The time, then the kind on a vertical line, then what was noted; deleting shows on hover. */
.health-timeline { list-style: none; margin: 0; padding: 0; }
.health-entry { position: relative; display: grid; grid-template-columns: 48px 36px 1fr auto; align-items: start; gap: 12px; padding: 6px 0; }
.health-entry:not(:last-child)::before {
  content: ""; position: absolute; top: 42px; bottom: -6px; left: calc(48px + 12px + 17px);
  width: 2px; background: var(--divider);
}
.health-time { padding-top: 9px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.health-bullet {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--input); font-size: 18px; line-height: 1;
}
.health-entry.alert .health-bullet { background: #fde8e8; box-shadow: 0 0 0 2px #dc2626; }
.health-entry-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 7px 12px; border-radius: var(--radius-sm); background: var(--input); }
.health-entry-value { margin-left: 6px; color: var(--muted); }
.health-entry-value::before { content: "· "; }
.health-entry .icon-btn { margin-top: 4px; }
@media (hover: hover) and (pointer: fine) {
  .health-entry .icon-btn { opacity: 0; transition: opacity 120ms ease; }
  .health-entry:hover .icon-btn, .health-entry .icon-btn:focus-visible { opacity: 1; }
}
@media (max-width: 600px) {
  .health-calendar { left: 16px; right: 16px; width: auto; }
  .health-day-pick { min-width: 0; }
  .health-entry { grid-template-columns: 40px 32px 1fr auto; gap: 8px; }
  .health-entry:not(:last-child)::before { left: calc(40px + 8px + 15px); top: 38px; }
  .health-bullet { width: 32px; height: 32px; font-size: 16px; }
}

/* Health charts: one measured kind by day, month or year. */
.health-charts { display: flex; flex-direction: column; gap: 12px; }
.health-charts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.health-charts-head h3 { margin: 0; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--input); }
.segmented button, .segmented a {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.segmented a { text-decoration: none; }
.segmented button.selected, .segmented a.selected { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(31, 42, 44, 0.12); }
.health-chart { display: flex; flex-direction: column; gap: 12px; }
.health-chart-empty { margin: 24px 0; text-align: center; }
.health-chart-stats { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.health-chart-stat { display: flex; flex-direction: column; gap: 2px; }
.health-chart-stat strong { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.health-chart-range { margin-left: auto; }
.health-chart-area { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: 200px auto; }
.health-chart-y { position: relative; }
.health-chart-y span {
  position: absolute; right: 8px; transform: translateY(50%);
  font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.health-chart-plot { position: relative; border-bottom: 1px solid #d8d0c4; }
.health-chart-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--divider); }
.health-chart-cols { position: absolute; inset: 0; display: flex; }
/* The whole column is the hit target, wider than the bar; 1px each side leaves a 2px gap between bars. */
.health-chart-col { flex: 1; display: flex; align-items: flex-end; padding: 0 1px; cursor: default; border-radius: 4px 4px 0 0; }
.health-chart-col.hovered { background: rgba(194, 65, 12, 0.06); }
.health-chart-bar { width: 100%; max-width: 40px; margin: 0 auto; border-radius: 4px 4px 0 0; background: var(--primary); }
.health-chart-col.hovered .health-chart-bar { background: var(--primary-hover); }
.health-chart-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.health-chart-line path { fill: none; stroke: var(--primary); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.health-chart-dot {
  position: absolute; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, 50%);
  background: var(--primary); box-shadow: 0 0 0 2px var(--card); pointer-events: none;
}
.health-chart-dot.hovered { width: 12px; height: 12px; }
.health-chart-tooltip {
  position: absolute; top: 4px; z-index: 2; display: flex; flex-direction: column; gap: 2px;
  min-width: 120px; padding: 8px 10px; border-radius: 10px; pointer-events: none;
  background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); white-space: nowrap;
}
.health-chart-tooltip strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.health-chart-x { grid-column: 2; display: flex; padding-top: 6px; }
.health-chart-x span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
.health-chart-table summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.health-chart-table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.health-chart-table th, .health-chart-table td { padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--divider); }
.health-chart-table td:first-child { text-transform: capitalize; }
@media (max-width: 640px) {
  .health-chart-area { grid-template-columns: 44px 1fr; grid-template-rows: 170px auto; }
  .health-chart-range { margin-left: 0; width: 100%; }
}

/* Static introduction in index.html for crawlers; shown only until the app starts. */
.seo-intro {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 24px;
  color: var(--muted);
}
.seo-intro h1 { font-family: var(--font-display); color: var(--navy); }

/* Who liked a post */
.likers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.likers a { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 12px; color: var(--text); text-decoration: none; }
.likers a:hover { background: var(--hover); }
.likers-avatar { position: relative; display: inline-flex; flex-shrink: 0; }
.likers-avatar .like-bubble { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; background: linear-gradient(180deg, #ff4a4e, var(--primary)); box-shadow: 0 0 0 2px var(--card); }

/* "See translation" under a post, like LinkedIn */
.post-translate { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px; margin-top: -4px; }
.post-translate .link-btn { font-size: 14px; color: var(--muted); }
.post-translate .link-btn:disabled { cursor: progress; opacity: 0.7; }

/* Notifications page: every notification, all or only the unread, grouped by day. */
.notifications-page { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.notifications-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notifications-head h2 { margin: 0; }
.notifications-page > .segmented { align-self: flex-start; }
.notifications-group h3 { margin: 4px 6px 8px; font-size: 17px; }
.notifications-list { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.notification-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: var(--radius-sm); text-align: left; line-height: 1.35; }
.notification-row:hover { background: var(--hover); }
.notification-row.unread { background: var(--primary-light); }
.notification-row.unread:hover { background: #ffe6d5; }
.notification-row .notif-icon { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }
.notification-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.notification-time { color: var(--muted); }
.notification-row.unread .notification-time { color: var(--primary); font-weight: 600; }
.dropdown-see-all { display: block; width: 100%; margin-top: 6px; padding: 10px; border-radius: var(--radius-sm); background: var(--hover); font-weight: 600; text-align: center; }
.dropdown-see-all:hover { background: var(--secondary-btn); }

/* ---------- Maps: Mapbox-style controls on the Mapbox base map ---------- */
.area-map, .stores-map { background: #f5f3f0; }
.leaflet-container { font-family: Inter, system-ui, sans-serif; }
.leaflet-touch .leaflet-bar, .leaflet-bar {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(13, 27, 46, 0.08), 0 2px 6px rgba(13, 27, 46, 0.12);
}
.leaflet-touch .leaflet-bar a, .leaflet-bar a {
  width: 30px;
  height: 30px;
  line-height: 30px;
  color: #333;
  font: 600 18px/30px Inter, system-ui, sans-serif;
  border-bottom: 1px solid #e3e3e3;
  background: #fff;
}
.leaflet-bar a:last-child { border-bottom: none; }
.leaflet-bar a:focus-visible { background: #f2f2f2; color: #000; }
.leaflet-bar a.locate-control { display: flex; align-items: center; justify-content: center; }
@media (hover: hover) and (pointer: fine) { .leaflet-bar a:hover { background: #f2f2f2; color: #000; } }
.leaflet-control-attribution, .leaflet-container .leaflet-control-attribution {
  margin: 0 6px 6px 0;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: rgba(0, 0, 0, 0.75);
  font-size: 10.5px;
}
.leaflet-control-attribution a { color: inherit; }
@media (hover: hover) and (pointer: fine) { .leaflet-control-attribution a:hover { text-decoration: underline; } }
/* Tooltips (business names) as Mapbox popups: white card, soft shadow. */
.leaflet-tooltip {
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font: 600 12.5px/1.4 Inter, system-ui, sans-serif;
  box-shadow: 0 2px 10px rgba(13, 27, 46, 0.18);
}

/* ---------- Roles: pinned posts, edits, length ---------- */
/* A band across the card's top, inside its rounded corners. */
.post-pinned {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--divider);
  border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  background: var(--primary-light);
  font-size: 12.5px; font-weight: 600; color: var(--primary);
}
.post-edited { color: var(--muted); }
.post-edit { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.post-length { margin: 0; text-align: right; color: var(--muted); }
.post-length.full { color: var(--danger); font-weight: 600; }
.post-story-added {
  display: flex; align-items: center; gap: 6px;
  margin: 0 16px 10px; font-size: 13px; font-weight: 600; color: var(--primary);
}
.profile-names .badge-role { margin: 6px 0; }

/* ---------- Multiline comments, links and their cards ---------- */
.comment-form textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  max-height: 240px;
  border: none;
  outline: none;
  border-radius: 18px;
  background: var(--input);
  padding: 8px 12px;
  font: inherit;
  line-height: 20px;
  resize: none;
  overflow-y: auto;
}
.comment-form { align-items: flex-end; }
.comment-bubble p { white-space: pre-line; }
.text-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
@media (hover: hover) and (pointer: fine) { .text-link:hover { color: var(--primary-hover); } }
/* In the member's own bubble (dark), links follow the white text. */
.msg.mine .msg-bubble .text-link, .msg.mine .msg-bubble .text-link:hover { color: inherit; }

.link-card {
  display: block; margin: 0 16px 12px; border: 1px solid var(--divider); border-radius: 14px;
  overflow: hidden; color: inherit; text-decoration: none; background: var(--card);
}
@media (hover: hover) and (pointer: fine) { a.link-card:hover { background: var(--hover); } }
.link-card-image { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: var(--input); }
.link-card-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 12px; background: var(--input); }
.link-card-site { font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); }
.link-card-title { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card-desc { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card.loading .link-card-body { min-height: 64px; }
.link-card-remove { position: absolute; top: 8px; right: 8px; }
.link-card-wrap { position: relative; }
.post-editor .link-card, .post-edit .link-card { margin: 0; }

/* The vets and the insurers in the health tracking: the directory's list and map need the width. */
.health-page.health-directory { max-width: 1240px; }
.stores-page.embedded { padding: 0; }

/* Keep directory filters visible; only the results list scrolls. */
.stores-page.map-directory {
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 16px;
}
.health-directory:has(.map-directory) {
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  min-height: 0;
}
.health-directory > .page-title { flex-shrink: 0; }
.health-directory > .map-directory { flex: 1; height: auto; padding: 0; }
.map-directory > main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.map-directory > main > .filter-toolbar,
.map-directory > main > .village-header { flex-shrink: 0; }
.map-directory .stores-split { flex: 1; min-height: 0; align-items: stretch; overflow: hidden; }
.map-directory .stores-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: 0 6px 12px 0;
}
.map-directory .stores-list > .store-item { flex-shrink: 0; }
.map-directory .stores-map-panel { position: static; min-height: 0; min-width: 0; }
.map-directory .stores-map { height: 100%; min-height: 0; }
@media (max-width: 900px) {
  .map-directory .stores-split { grid-template-rows: clamp(120px, 25dvh, 240px) minmax(0, 1fr); }
}

/* The audience measurement question, until answered: above the chat dock, under the dialogs. */
.consent-banner {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 80;
  width: min(440px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: chat-in .25s ease-out;
}
.consent-text p { margin: 4px 0 0; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) {
  .consent-banner { animation: none; }
}

/* The terms of use: a readable column; to accept, the actions stay in view under the scrolling text. */
/* Contact page: the email and the phone as two big links */
.contact-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 12px; padding: 28px; align-self: flex-start; }
.contact-card h1 { margin: 0; }
.contact-options { display: grid; gap: 10px; margin-top: 8px; }
.contact-option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--input); color: inherit; text-decoration: none; transition: background-color 150ms var(--ease-out); }
.contact-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.contact-option:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .contact-option:hover { background: var(--divider); } }
.contact-card .terms-actions { padding: 16px 0 0; margin-top: 4px; background: none; }
.auth-help { margin-top: -4px; }
.terms-page { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; padding: 32px 16px; background: var(--bg); }
.terms-card { width: 100%; max-width: 760px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.terms-page .terms-card { max-height: calc(100dvh - 64px); }
.terms-head { padding: 24px 28px 16px; border-bottom: 1px solid var(--divider); }
.terms-head .auth-brand { margin-bottom: 16px; }
.terms-head h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.terms-updated { margin-top: 4px; color: var(--muted); font-size: 13px; }
.terms-intro { margin-top: 12px; line-height: 1.5; }
.terms-body { flex: 1; overflow-y: auto; padding: 8px 28px 24px; line-height: 1.6; font-size: 15px; }
.terms-body:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.terms-body h2 { margin: 24px 0 8px; font-size: 18px; font-weight: 700; }
.terms-body p { margin: 0 0 10px; }
.terms-item { display: flex; gap: 8px; margin: 0 0 6px 4px; }
.terms-mark { flex-shrink: 0; min-width: 14px; color: var(--muted); }
.terms-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--divider); background: var(--card); }
.terms-actions .error-text { flex-basis: 100%; margin: 0; }
.terms-retry { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 16px; }
/* The date of birth asked before the app (GDPR age of digital consent). */
.age-body { flex: none; display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
.age-body p { margin: 0; }
.age-body .text-field { max-width: 260px; }
@media (max-width: 600px) {
  .terms-page { padding: 0; }
  .terms-page .terms-card { max-height: 100dvh; border-radius: 0; }
  .terms-head, .terms-body, .terms-actions { padding-left: 16px; padding-right: 16px; }
  .terms-actions .btn { flex: 1; }
}

/* A vet's patients (store page, "Patients" tab), their documents and models. */
.patients-tab { display: flex; flex-direction: column; gap: 12px; }
.patients-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.patients-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.patients-search { max-width: 420px; }
.patients-section { margin-top: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.patient-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.patient-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.patient-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.patient-name { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.patient-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge-pending { background: #fff4d6; color: #92400e; }
.badge-prescription { background: #e3f1ee; color: #1d5357; }
.badge-invoice { background: #e8eefb; color: #1d4ed8; }
.btn-small { height: 30px; padding: 0 10px; font-size: 13px; }

.vet-documents { display: flex; flex-direction: column; gap: 6px; }
.vet-document {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--divider); color: var(--text); text-decoration: none;
  transition: box-shadow 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .vet-document:hover { box-shadow: inset 0 0 0 1px var(--primary); }
}
.vet-document:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vet-document-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vet-document-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.patient-finder-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.patient-finder-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  text-align: left; color: var(--text);
}
button.patient-finder-row:hover, button.patient-finder-row:focus-visible { background: var(--hover); }
button.patient-finder-row span { flex: 1; font-weight: 600; }
.patient-finder-pet { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.patient-finder-owner { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }

/* Writing a document: its kind and title, then the editor or the PDF chosen. */
.doc-form { display: flex; flex-direction: column; gap: 14px; }
.doc-form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.doc-form-row > .form-field { margin: 0; }
.doc-form-title { flex: 1; min-width: 240px; }
.doc-form-model .form-field { flex: 1; min-width: 220px; }
.doc-form .segmented { align-self: flex-start; }
.doc-editor { min-height: 360px; }
.doc-editor .jodit-container { border-radius: var(--radius-sm); }
.doc-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 24px; border-radius: var(--radius-sm); border: 1px dashed var(--divider); }
.doc-upload-file { display: flex; align-items: baseline; gap: 4px; }
.doc-form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.doc-form-actions > .muted { flex: 1; min-width: 200px; }
.template-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.template-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--divider); }
.template-row > .icon { color: #c0392b; }
.template-name { flex: 1; min-width: 0; }
.template-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.template-fields .chip { height: 28px; padding: 0 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* The owner's side, on each pet: vets asking or following, and what they sent. */
.pet-vets { display: flex; flex-direction: column; gap: 8px; }
.pet-vet-request {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm);
  background: var(--primary-light);
}
.pet-vet-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.pet-vet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pet-vet > .btn { margin-left: auto; }
@media (max-width: 700px) {
  .modal-wide .doc-editor { min-height: 300px; }
  .patient-actions { width: 100%; }
}

/* ---------- Stores as pages ---------- */
.grow { flex: 1; min-width: 0; }
/* The store the member acts as, in the top bar, with a way back to themselves. */
.acting-as { display: flex; align-items: center; gap: 8px; max-width: 280px; padding: 3px 3px 3px 4px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 600; }
.acting-as-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acting-as .icon-btn { width: 26px; height: 26px; color: var(--primary); }
.acting-as .store-logo { flex-shrink: 0; }
@media (max-width: 900px) { .acting-as-text { display: none; } }
.store-followers::before { content: '·'; margin-right: 10px; }
.act-as-store { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; }
.store-inbox { padding: 6px; }
.store-inbox-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 12px; text-align: left; }
.store-inbox-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.store-inbox-row.unread strong { font-weight: 800; }
.store-inbox-row .count-badge { position: static; }
@media (hover: hover) and (pointer: fine) {
  .store-inbox-row:hover { background: var(--hover); }
}

/* A pet's photos, in its card on "My companions". */
.pet-detail .animal-gallery { margin: 14px 0 4px; max-width: 520px; }

/* The end of a list that loads its next page on its own (InfiniteScroll). */
.infinite-scroll { height: 1px; }

/* A store's pages on the social networks: the fields of its form, the logos of its page. */
.social-logo { display: inline-flex; flex-shrink: 0; line-height: 0; }
.social-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .social-fields { grid-template-columns: 1fr; } }
.social-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #ccd0d5;
  border-radius: 6px;
  background: #f5f6f7;
}
.social-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); background: #fff; }
.social-field.invalid { border-color: var(--danger); }
.social-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; color: var(--text); }
.store-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.store-socials a { display: inline-flex; border-radius: 50%; transition: transform 0.15s; }
.store-socials a:hover { transform: scale(1.08); }
.store-socials a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* "Ouvert maintenant": keeps the businesses open right now. */
.filter-toolbar .open-now-filter { gap: 8px; padding: 5px 16px; font-weight: 600; color: var(--text); }
.open-now-filter .open-now-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #31a24c; transition: background-color 0.15s; }
.open-now-filter.active { background: #e7f6ea; color: #1f7a35; box-shadow: inset 0 0 0 1px #31a24c; }
.open-now-filter.active .open-now-dot { background: #31a24c; }
.store-item-text .open-now { font-size: 13px; }

/* Store form: its profile photo, picked and framed with the rest of the page. */
.store-avatar-field { display: flex; align-items: center; gap: 14px; }
.store-avatar-pick { position: relative; flex-shrink: 0; border-radius: 50%; cursor: pointer; }
.store-avatar-pick .store-logo { box-shadow: inset 0 0 0 1px var(--divider); }
.store-avatar-pick:hover .store-logo { filter: brightness(0.95); }
.store-avatar-pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.store-avatar-camera {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--primary);
  color: #fff;
}
.store-avatar-field .link-btn { align-self: flex-start; }

/* A store's exceptional closures: a notice above its hours, the days closed in red. */
.closure-notice { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #8a1c13; font-size: 14px; line-height: 1.4; }
.closure-notice .icon { margin-top: 1px; }
.hours-table tr.exceptional td { color: var(--danger); }
.hours-table tr.exceptional td:last-child { font-weight: 600; }
.closures-editor { display: flex; flex-direction: column; gap: 8px; }
.closure-row { display: grid; grid-template-columns: 150px 150px minmax(0, 1fr) 32px; gap: 8px; align-items: end; }
.closure-row .form-field { gap: 2px; }
@media (max-width: 640px) { .closure-row { grid-template-columns: 1fr 1fr 32px; } .closure-row .closure-reason { grid-column: 1 / 3; grid-row: 2; } }
.closure-row .icon-btn { width: 32px; height: 40px; color: var(--muted); }

/* A groomer's services: edited as rows, listed with their prices, picked when booking. */
.services-editor { display: flex; flex-direction: column; gap: 12px; }
.service-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 140px auto; gap: 8px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--divider); }
.service-row .form-field { gap: 2px; }
.service-row .service-description { grid-column: 1 / -1; }
.service-row-actions { display: flex; gap: 2px; }
.service-row-actions .icon-btn { width: 32px; height: 40px; color: var(--muted); }
.service-row-actions .icon-btn:disabled { opacity: .35; }
@media (max-width: 640px) { .service-row { grid-template-columns: 1fr 1fr; } .service-row .service-name { grid-column: 1 / -1; } }
.icon-flip svg { transform: rotate(180deg); }
.services-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.service-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.service-item:last-child { border-bottom: none; }
.service-item-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.service-item-image { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.service-image img { width: 100%; max-width: 240px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.service-price { font-weight: 700; white-space: nowrap; }
.service-choices { display: flex; flex-direction: column; gap: 6px; }
.service-choice { display: flex; gap: 12px; align-items: center; justify-content: space-between; width: 100%; padding: 10px 12px; border: 1px solid var(--divider); border-radius: 10px; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.service-choice:hover { background: var(--hover); }
.service-choice.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-light); }
.service-choice-text { display: flex; flex-direction: column; gap: 2px; }
.pay-on-site { margin: 6px 0 0; }
.appointment-service { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.appointment-service .service-price { margin-left: auto; }

/* Insurance: three tiers with the same fields for direct comparison. */
.insurance-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.insurance-plan { min-width: 0; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.insurance-plan h4, .insurance-plan p { margin: 0; }
.insurance-plan-price strong { color: var(--primary); font-size: 24px; }
.insurance-plan dl { display: grid; gap: 6px; margin: 0; }
.insurance-plan dt { font-size: 13px; color: var(--muted); }
.insurance-plan dd { margin: 0 0 8px; font-weight: 700; }
.insurance-plan .form-field { min-width: 0; }
@media (max-width: 700px) { .insurance-plans { grid-template-columns: 1fr; } }

/* A concise, crawlable introduction above the veterinary directory. */
.vet-directory-intro { flex-shrink: 0; }
.vet-directory-intro h1 { font-size: 23px; line-height: 1.25; margin: 0 0 6px; }
.vet-directory-intro p { color: var(--muted); font-size: 14px; margin: 6px 0; }
.vet-directory-intro summary { color: var(--primary); cursor: pointer; font-weight: 600; }
.vet-directory-intro details[open] { max-height: min(150px, 25dvh); overflow-y: auto; overscroll-behavior-y: contain; }

/* The direct veterinary directory keeps the map dominant and the cards swipeable. */
.vet-map-page > main { max-width: none; width: 100%; }
.vet-map-explorer { display: flex; flex-direction: column; gap: 12px; }
.vet-map-explorer .stores-map-panel { position: relative; top: auto; height: max(420px, 62dvh); min-height: 420px; width: 100%; }
.vet-map-explorer .stores-map-panel > * { height: 100%; }
.vet-card-carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 8px 12px; overscroll-behavior-x: contain; }
.vet-card-carousel .store-item { flex: 0 0 min(340px, 85vw); scroll-snap-align: center; margin: 0; }
@media (max-width: 700px) {
  .vet-map-explorer .stores-map-panel { height: 60dvh; min-height: 320px; }
}

.vet-map-page.map-directory { height: auto; min-height: calc(100dvh - var(--nav-h)); }
.vet-map-page .vet-card-carousel { flex-shrink: 0; }
.vet-map-page .store-item-main { min-width: 0; }

.map-filter-backdrop { position: fixed; inset: 0; z-index: 1000; background: #0005; display: flex; justify-content: flex-end; }
.map-filter-drawer { width: min(380px, 100vw); background: var(--card, #fff); padding: 24px 20px; border-radius: 24px 0 0 24px; overflow-y: auto; box-shadow: -8px 0 32px #0002; }
.map-filter-drawer .page-title { margin-bottom: 8px; }
.map-category-filter { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-top: 8px; border-radius: 14px; border: 1px solid var(--divider); background: var(--card, #fff); font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.map-category-filter:hover { background: var(--input); }
.map-category-filter:has(input:checked) { background: var(--primary-light); border-color: var(--primary); }
.map-category-filter:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.map-category-filter input { width: 20px; height: 20px; flex-shrink: 0; margin: 0; accent-color: var(--primary); cursor: pointer; }
.map-category-filter .map-filter-marker { display: flex; align-items: center; justify-content: center; width: 32px; flex-shrink: 0; }
.map-category-filter .map-filter-marker svg, .map-category-filter .map-filter-marker img { max-height: 36px; width: auto; }
.map-category-filter > span:last-child { flex: 1; min-width: 0; }
.map-category-filter + .map-category-filter { margin-top: 8px; }
.store-category-pin { background: transparent; border: 0; }
.store-category-pin svg { width: 100%; height: 100%; }

.map-filter-marker { display: inline-flex; width: 32px; height: 40px; flex-shrink: 0; }
.map-filter-marker svg { width: 100%; height: 100%; }

/* A double heartbeat with three outgoing waves while map results load. */
.stores-map-frame { position: relative; height: 100%; }
.map-fetch-loading { position: absolute; z-index: 500; top: 50%; left: 50%; width: 120px; height: 120px; transform: translate(-50%, -50%); pointer-events: none; display: grid; place-items: center; }
.map-fetch-ripple { position: absolute; width: 112px; height: 112px; border: 2px solid var(--primary); border-radius: 50%; animation: map-fetch-ripple 1.4s linear infinite; }
.map-fetch-ripple.ripple-1 { animation-delay: -.466s; }
.map-fetch-ripple.ripple-2 { animation-delay: -.933s; }
.map-fetch-logo { position: relative; box-sizing: border-box; padding: 8px; background: #fff; border-radius: 50%; box-shadow: 0 0 14px #0003; animation: map-fetch-beat 1.4s ease-in-out infinite; }
@keyframes map-fetch-beat { 0%, 22%, 44%, 100% { transform: scale(1); } 12% { transform: scale(1.16); } 32% { transform: scale(1.1); } }
@keyframes map-fetch-ripple { from { transform: scale(.45); opacity: .55; } to { transform: scale(1.15); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .map-fetch-ripple { display: none; } .map-fetch-logo { animation: none; } }

/* ---------- Phones: the Flutter app's look, flat (no glass) ---------- */
.topbar-brand, .topbar-agenda, .topbar-filter-btn, .rail-short { display: none; }
@media (max-width: 700px) {
  :root { --nav-h: 104px; }
  /* Brand and icons on the first line, the search under it: the app's bar plus the website's search. */
  .topbar { height: auto; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 12px 8px; background: var(--bg); backdrop-filter: none; }
  .topbar-brand { display: inline-flex; order: 1; font-size: 26px; }
  .topbar-actions { order: 2; margin-left: auto; gap: 4px; }
  .topbar-search { order: 3; flex-basis: 100%; }
  .topbar-agenda { display: inline-flex; }
  /* The feed's filters leave the bar for a drawer, opened by this button next to the search. */
  .topbar-search { gap: 4px; }
  .topbar-search .feed-filter, .topbar-search .feed-team-filter { display: none; }
  .topbar-filter-btn { display: inline-flex; flex-shrink: 0; }
  .topbar-filter-drawer .map-filter-drawer { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
  .topbar-filter-drawer .feed-filter, .topbar-filter-drawer .feed-team-filter { display: flex; }
  .topbar-filter-drawer .feed-filter select { max-width: none; flex: 1; }
  .topbar-filter-drawer .feed-team-filter .team-picker-button { max-width: none; width: 100%; }
  .search, .feed-filter { height: 40px; }
  /* Bare icons, 40px to tap, orange when open. */
  .round-btn { background: none; color: var(--text); }
  .round-btn:hover { background: none; }
  .round-btn.active { background: none; color: var(--primary); }
  .count-badge { top: 0; right: 0; }
  .avatar-btn { margin-left: 6px; }

  /* The tab bar: the app's floating capsule, flat white instead of glass. Five tabs, an icon over its short
     name; the open one orange on a soft pill. */
  .rail { inset: auto 12px calc(10px + env(safe-area-inset-bottom)) 12px; width: auto; height: 64px; padding: 0 6px; border-radius: 32px; background: var(--card); border: none; box-shadow: 0 8px 28px rgba(31, 42, 44, 0.16), 0 0 0 1px var(--divider); }
  .rail-item { flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 1px; padding: 6px 2px; border-radius: 24px; color: var(--muted); }
  .rail-item.active { background: var(--hover); color: var(--primary); }
  .rail-label { display: none; }
  .rail-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 500; letter-spacing: -0.1px; }
  .rail-item.active .rail-short { font-weight: 700; }
  .rail-icon { width: 28px; height: 28px; }
  .rail-nav { gap: 2px; }
  /* The app's order (home, pets, map, market, health); the agenda moved to the bar above. */
  .rail-item[href="/vets"] { order: 3; }
  .rail-item[href="/market"] { order: 4; }
  .rail-item[href="/health"] { order: 5; }
  .rail-item[href="/news"] { display: none; }
  .shell-main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .chat-dock { bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* Buttons are pills, taller to tap. */
  .btn { min-height: 44px; border-radius: 999px; padding: 0 18px; }
  .btn-lg { min-height: 52px; }

  /* A page's sections as text tabs over a hairline, like the app's UnderlineTabs. */
  .page-tabs .segmented { padding: 0; border-radius: 0; background: none; border-bottom: 1px solid var(--divider); overflow-x: auto; }
  .page-tabs .segmented a { flex: 0 0 auto; padding: 10px 12px 9px; border-radius: 0; border-bottom: 3px solid transparent; }
  .page-tabs .segmented a.selected { background: none; box-shadow: none; color: var(--primary); border-bottom-color: var(--primary); }

  /* A conversation fills the screen, as the app's chat page: light bar, mine orange, theirs white. */
  .chat-window { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; background: var(--bg); backdrop-filter: none; box-shadow: none; animation: none; }
  .chat-header { padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top)); background: var(--bg); color: var(--text); border-bottom: 1px solid var(--divider); }
  .chat-header .muted { color: var(--muted); }
  .chat-header .icon-btn { width: 40px; height: 40px; color: var(--primary); }
  .chat-header .icon-btn:hover, .chat-peer:hover { background: none; }
  .chat-messages { padding: 12px; gap: 4px; }
  .msg-bubble { border-radius: 20px; font-size: 15px; }
  .msg.theirs .msg-bubble { background: var(--card); border-radius: 20px; }
  .msg.mine .msg-bubble { background: var(--primary); border-radius: 20px; }
  .chat-input { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); }
  .chat-input textarea { min-height: 40px; border-radius: 20px; background: var(--card); border: 1px solid var(--divider); padding: 9px 14px; }
  .chat-input .send { width: 40px; height: 40px; border-radius: 50%; }
}

.round-btn.map-filters-btn { background: var(--primary); color: #fff; flex-shrink: 0; }
.round-btn.map-filters-btn:hover { background: var(--primary-hover); }
.map-filter-drawer .area-button { width: 100%; }

/* ---------- Market on phones: the app's capsule tabs, and the animals' filters in a drawer ---------- */
.filters-toggle, .filters-close, .filters-backdrop { display: none; }
@media (max-width: 700px) {
  .village-animals > .village-header { padding-top: 4px; }
  .village-bar { flex-wrap: wrap; align-items: center; border-bottom: none; }
  .village-bar .village-sections { flex-basis: 100%; }
  .village-bar .page-title-actions { padding-bottom: 0; }
  /* The sections as the app's tab bar: a white capsule, each tab its icon over its name, the open one on a soft pill. */
  .village-sections { gap: 2px; padding: 4px; border: none; border-radius: 28px; background: var(--card); box-shadow: var(--shadow); }
  .village-section { flex: 1; flex-direction: column; justify-content: center; gap: 2px; margin: 0; padding: 6px 4px; border: none; border-radius: 24px; font-size: 11px; font-weight: 500; }
  .village-section:hover { background: none; }
  .village-section.active { background: var(--hover); color: var(--primary); font-weight: 700; }
  /* As in the app: the groomers are on the map, not in the Market. */
  .village-section[href*="type=services"] { display: none; }

  .filters-toggle { display: inline-flex; }
  .filters-backdrop.open { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.33); }
  .animal-filters { display: none; }
  .animal-filters.open { display: block; position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001; width: min(380px, 100vw); max-height: none; height: auto; overflow-y: auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 22px 0 0 22px; background: var(--card); box-shadow: -8px 0 32px rgba(0, 0, 0, 0.13); }
  .animal-filters .filters-close { display: inline-flex; order: 3; }
}

/* A pet's actions on phones: the name on its own line, then the health tracking wide and the others as icons. */
@media (max-width: 700px) {
  .pet-detail-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .pet-detail-actions { gap: 8px; }
  .pet-detail-actions .btn-light-primary { flex: 1; min-width: 0; padding: 0 12px; }
  .pet-detail-actions .btn-label { display: none; }
  .pet-detail-actions .btn-secondary, .pet-detail-actions .icon-btn { flex: none; width: 44px; height: 44px; padding: 0; }
}

/* Bold and italic buttons over a post's text box */
.format-bar { display: flex; gap: 4px; margin: 4px 0; }
.format-btn { width: 34px; height: 34px; border-radius: 10px; background: var(--secondary-btn); color: var(--text); font-size: 15px; }
.rich-editor { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; cursor: text; }
.rich-editor:empty::before { content: attr(data-placeholder); opacity: 0.5; pointer-events: none; }
.rich-editor.on-background:empty::before { color: inherit; opacity: 0.7; }
.rich-editor h1, .post-content h1 { font-size: 1.6em; line-height: 1.25; margin: 0.3em 0; }
.rich-editor h2, .post-content h2 { font-size: 1.35em; line-height: 1.3; margin: 0.3em 0; }
.rich-editor h3, .post-content h3 { font-size: 1.15em; line-height: 1.3; margin: 0.3em 0; }
.format-btn.heading { font-weight: 700; font-size: 12px; }
.format-btn.bold { font-weight: 800; }
.format-btn.italic { font-style: italic; font-weight: 600; font-family: Georgia, serif; }

.map-fetch-loading.compact { top: 60px; transform: translate(-50%, 0) scale(0.45); transform-origin: top center; }

/* The map tab: the map leaves room for the cards under it, which then show whole with air below. */
.vet-map-page { padding-bottom: 24px; }
.vet-map-explorer .stores-map-panel { height: max(360px, calc(100dvh - var(--nav-h) - 340px)); min-height: 0; }
.vet-map-page .vet-card-carousel { padding-bottom: 20px; }
@media (max-width: 700px) {
  /* Under the bars: the top one (--nav-h) and the floating tab bar. */
  .vet-map-explorer .stores-map-panel { height: max(260px, calc(100dvh - var(--nav-h) - 330px - 92px)); min-height: 0; }
}

/* The app's loading, as the map's: the logo beating, waves going out of it, and its name under. */
.pulse-loading { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 32px auto; }
.pulse-loader { position: relative; width: 150px; height: 150px; display: grid; place-items: center; pointer-events: none; }
.pulse-loader .map-fetch-ripple { width: 140px; height: 140px; }
.pulse-loader .map-fetch-logo { width: 84px; height: 84px; padding: 10px; }
.pulse-loading-text { color: var(--muted); font-size: 15px; font-weight: 600; }
@media (max-width: 700px) {
  .pulse-loader { width: 112px; height: 112px; }
  .pulse-loader .map-fetch-ripple { width: 104px; height: 104px; }
  .pulse-loader .map-fetch-logo { width: 64px; height: 64px; padding: 8px; }
}

/* A post's photos open full screen when clicked */
.post-photo-btn { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; overflow: hidden; cursor: zoom-in; }
.post-media > .post-photo-btn { z-index: 1; width: auto; height: auto; max-width: 100%; display: flex; justify-content: center; }
.post-photo-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 28px; font-weight: 700; }
.lightbox-photo { touch-action: pan-y; }

/* A single feed action opens the reaction choices on touch and desktop. */
.post-reaction-control { flex: 1; position: relative; min-width: 0; }
.post-reaction-control > .post-act { width: 100%; }
.post-reaction-dismiss { position: fixed; inset: 0; z-index: 49; background: transparent; border: 0; cursor: default; }
.post-reaction-picker { position: absolute; z-index: 50; bottom: calc(100% + 8px); left: 0; display: flex; gap: 4px; padding: 8px; background: var(--surface, #fff); color: var(--text); border: 1px solid var(--divider); border-radius: 24px; box-shadow: 0 6px 24px #0002; }
.post-reaction-option { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 60px; padding: 8px; border: 0; border-radius: 18px; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 12px; }
.post-reaction-option:hover, .post-reaction-option:focus-visible, .post-reaction-option[aria-pressed=true] { background: var(--divider); }
.post-reaction-option img { width: 40px; height: 40px; object-fit: contain; transition: transform .15s; }
.post-reaction-option:hover img { transform: scale(1.15); }

.likers-avatar .post-reaction-badge { position: absolute; right: -6px; bottom: -4px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--card); }

.post-reaction-icon { object-fit: contain; flex-shrink: 0; }
.post-reaction-icon.idle { opacity: .6; }
/* The same picker under a comment, small; the comment's reactions under its text. */
.post-reaction-control.small { flex: none; }
.comment-reply.on { color: var(--primary); }
.comment-reactions { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.comment-reactions .post-reaction-icon { width: 18px; height: 18px; }

/* Desktop and tablet: the result cards in a column on the left, the map filling the rest. */
@media (min-width: 701px) {
  .vet-map-explorer { flex-direction: row; align-items: stretch; height: max(480px, calc(100dvh - var(--nav-h) - 170px)); }
  .vet-map-explorer .stores-map-panel { flex: 1 1 auto; width: auto; height: 100%; min-width: 0; }
  .vet-map-page .vet-card-carousel {
    order: -1;
    flex: 0 0 clamp(300px, 34vw, 400px);
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    padding: 0 6px 0 0;
    scrollbar-gutter: stable;
  }
  .vet-map-page .vet-card-carousel .store-item { flex: 0 0 auto; scroll-snap-align: none; }
}

.youtube-embed { margin: 0 16px 12px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.youtube-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

.event-website { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; text-decoration: none; }

/* Jobs */
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-head { display: flex; gap: 12px; align-items: flex-start; }
.job-badges, .job-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.job-actions { margin-top: 12px; }
.job-section { margin-top: 12px; }
.job-section h4 { margin: 0 0 4px; font-size: 14px; }
.job-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.job-image-field, .job-cv-choice { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.job-cv-choice { margin: 8px 0; }

/* Jobs, like LinkedIn: the list on the left, the picked job on the right. */
.job-split { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
.job-rows { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.job-rows > .btn { margin: 12px; }
.job-row-wrap + .job-row-wrap { border-top: 1px solid var(--divider); }
.job-row { display: flex; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; border-left: 4px solid transparent; }
.job-row:hover { background: var(--hover); }
.job-row.selected { border-left-color: var(--primary); background: var(--primary-light); }
.job-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.job-row-title { font-size: 16px; color: var(--primary); }
.job-row.selected .job-row-title, .job-row:hover .job-row-title { text-decoration: underline; }
.job-detail-col { position: sticky; top: calc(var(--nav-h) + 12px); max-height: calc(100vh - var(--nav-h) - 40px); overflow-y: auto; margin: 0; }
.job-detail h2 { margin: 12px 0 4px; font-size: 24px; }
.job-detail .job-badges { margin: 12px 0; }
.job-detail-image { display: block; max-width: 100%; max-height: 260px; margin-top: 16px; border-radius: var(--radius-sm); object-fit: cover; }
.job-pill { padding: 6px 14px; border: 1px solid var(--divider); border-radius: 999px; font-weight: 600; font-size: 14px; }
.job-store { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.job-inline { display: none; }
@media (max-width: 900px) {
  .job-split { grid-template-columns: 1fr; }
  .job-detail-col { display: none; }
  .job-inline { display: block; padding: 0 16px 16px; }
}

/* Market tabs: the search and the place sit in the top bar. */
.topbar-search .place-field { width: 220px; }
.topbar-search .place-input { height: 46px; padding: 0 14px; border: none; border-radius: 18px; box-shadow: var(--shadow); }
.topbar-search .area-button-text { max-width: 200px; }
@media (min-width: 701px) { .filter-toolbar.phones-only { display: none; } }
@media (max-width: 700px) {
  .topbar-search .area-button-text { display: none; }
}
.filter-toolbar:empty { display: none; }

/* Filter pills opening a panel of checkboxes (the jobs' filters). */
.filter-pill-wrap { position: relative; flex-shrink: 0; }
.filter-pill { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.filter-pill:hover { background: var(--hover); }
.filter-pill.active { color: var(--primary); box-shadow: var(--shadow), 0 0 0 2px var(--primary); }
.filter-pill .icon { transition: transform .15s; }
.filter-pill-wrap.open .filter-pill .icon { transform: rotate(180deg); }
.filter-pill-wrap .multi-select-backdrop { z-index: 300; }
.filter-pill-panel { right: auto; z-index: 301; min-width: 240px; width: max-content; max-width: min(360px, calc(100vw - 32px)); }
.filter-pill-footer { display: flex; justify-content: space-between; gap: 8px; padding: 10px; border-top: 1px solid var(--divider); }
.filter-pill-amount { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; }
.job-simplified { color: var(--success); font-weight: 600; font-size: 13px; }

/* ---------- Candidates ---------- */
.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.candidate-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; color: inherit; text-decoration: none; }
.candidate-card:hover .candidate-name { text-decoration: underline; }
.candidate-photo {
  position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: var(--secondary-btn);
}
.candidate-photo img { width: 100%; height: 100%; object-fit: cover; }
.candidate-available {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 600;
}
.candidate-available::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #22a06b; }
.candidate-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.candidate-name { font-size: 17px; color: var(--primary); }
.candidate-headline {
  font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.candidate-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.candidate-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.candidate-skills > span { padding: 3px 10px; border-radius: 8px; background: var(--secondary-btn); font-size: 13px; }
.candidates-more { display: block; margin: 20px auto 0; }
/* The CV written on the platform, on the profile */
.resume-section { margin-top: 14px; }
.resume-section h4 { margin: 0 0 6px; font-size: 15px; }
.resume-entry { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--divider); }
.resume-entry:first-child { border-top: 0; }
.resume-entry-form {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; margin-bottom: 10px;
  border: 1px solid var(--divider); border-radius: 10px;
}
.resume-entry-form > .btn { align-self: flex-start; }

/* ---------- A candidate's page ---------- */
.candidate-page { max-width: 1100px; margin: 0 auto; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 24px; }
.candidate-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 28px; align-items: start; padding: 28px; }
.candidate-hero-photo {
  width: 220px; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--secondary-btn);
}
.candidate-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.candidate-hero-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.candidate-hero-name { margin: 0; font-size: 28px; color: var(--primary); }
.candidate-hero-headline { margin: 0; font-size: 22px; font-weight: 700; }
.candidate-hero-facts { align-items: center; gap: 8px 20px; font-size: 17px; }
.candidate-hero-facts .candidate-available { position: static; background: var(--secondary-btn); }
.candidate-hero .candidate-skills > span { padding: 8px 14px; font-size: 15px; font-weight: 600; }
.candidate-hero-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 220px; }
.candidate-hero-actions .btn { justify-content: center; }
.btn-text {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px;
  border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-text:hover { text-decoration: underline; }
.candidate-jump { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.candidate-jump-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.candidate-section { padding: 28px; scroll-margin-top: 90px; }
.candidate-section h2 { margin: 0 0 16px; font-size: 24px; }
.candidate-section h3 { margin: 20px 0 8px; font-size: 17px; }
.candidate-section h2 + h3 { margin-top: 0; }
@media (max-width: 900px) {
  .candidate-page { padding: 16px; }
  .candidate-hero { grid-template-columns: 1fr; padding: 20px; }
  .candidate-hero-photo { width: 160px; }
  .candidate-hero-actions { min-width: 0; }
}

/* ---------- The profile's edit page ---------- */
.edit-profile-page { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.edit-profile-page h1 { font-size: 30px; letter-spacing: -0.8px; }
.edit-profile-section { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.edit-profile-section h2 { margin: 0 0 4px; font-size: 20px; }
.edit-profile-group { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.edit-profile-group h3 { margin: 0; font-size: 16px; }
.edit-profile-group > .btn { align-self: flex-start; }
/* The save button stays in view while the long form scrolls. */
.edit-profile-actions {
  position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-lg);
}
.edit-profile-actions .error-text { margin: 0 auto 0 0; }
@media (max-width: 700px) {
  .edit-profile-actions { position: static; }
}
.check-row { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.check-list { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.candidate-contracts { font-size: 13px; font-weight: 600; color: var(--muted); }
