:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #191c1a;
  --ink-soft: #6b7069;
  --line: #e8e6e0;
  --accent: #1f7a5c;
  --accent-soft: #e2f2ec;
  --danger: #d94f3d;
  --danger-soft: #fdeae7;
  --amber: #f5a623;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(20, 24, 22, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-gap: calc(14px + var(--safe-bottom));
  --tabbar-h: 68px;
  --search-dock-h: 64px;
  --app-height: 100dvh;
}

html.native-shell {
  --safe-top: 0px;
  --safe-bottom: 0px;
  --tabbar-gap: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

*::before,
*::after {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

img,
svg,
canvas,
video {
  -webkit-user-drag: none;
  user-select: none;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", sans-serif;
  background: #dedcd6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

html,
body,
#app,
#views,
#chat-main,
#chat-list,
.msgs,
.sheet,
.drawer-menu {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#app::-webkit-scrollbar,
#views::-webkit-scrollbar,
#chat-main::-webkit-scrollbar,
#chat-list::-webkit-scrollbar,
.msgs::-webkit-scrollbar,
.sheet::-webkit-scrollbar,
.drawer-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ===== App shell (phone frame on desktop, full-bleed on mobile) ===== */
#app {
  position: relative;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.18);
}

#app.auth-required .topbar,
#app.auth-required .search-dock,
#app.auth-required #views,
#app.auth-required .tabbar,
#app.auth-required .chat-composer,
#app.auth-required .drawer-backdrop,
#app.auth-required .drawer,
#app.auth-required .sheet-backdrop,
#app.auth-required .sheet,
#app.auth-required .toast {
  display: none !important;
}

#app.booting .auth-screen,
#app.booting .topbar,
#app.booting .search-dock,
#app.booting #views,
#app.booting .tabbar,
#app.booting .chat-composer {
  display: none !important;
}

#app:not(.auth-required) .auth-screen {
  display: none !important;
}

.auth-screen {
  position: absolute;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  isolation: isolate;
}

.auth-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(18, 75, 57, 0.28), rgba(246, 245, 242, 0.9) 62%, #f6f5f2),
    url("assets/hero-animal-care.webp") center / cover;
}

.auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(18, 75, 57, 0.08);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.auth-panel {
  position: relative;
  width: min(100%, 384px);
  padding: 32px 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px -32px rgba(15, 18, 16, 0.5);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  text-align: center;
  animation: authIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* back arrow — only on the code step */
.auth-back {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.auth-back:active {
  transform: scale(0.92);
}

.auth-back svg {
  width: 17px;
  height: 17px;
}

.auth-panel[data-step="email"] .auth-back {
  display: none;
}

.auth-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  margin: 2px auto 16px;
  display: block;
  box-shadow: 0 16px 32px -16px rgba(18, 75, 57, 0.55);
}

.auth-title h1 {
  font-size: 21.5px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.auth-title p {
  margin: 7px auto 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 280px;
}

.auth-panel[data-step="email"] .auth-code-step,
.auth-panel[data-step="code"] .auth-email-step {
  display: none !important;
}

/* --- email step --- */
.auth-email-step {
  margin-top: 22px;
}

.auth-field {
  position: relative;
  display: block;
}

.auth-field svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-soft);
  pointer-events: none;
}

.auth-field input {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: #fff;
  padding: 0 16px 0 44px;
  font-size: 15.5px;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-field input:focus + svg,
.auth-field:focus-within svg {
  color: var(--accent);
}

/* --- code step --- */
.auth-code-step {
  margin-top: 20px;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.auth-review {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.auth-review strong {
  color: var(--ink);
  font-weight: 700;
  word-break: break-all;
}

.auth-code-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  width: 100%;
}

.auth-panel .auth-code-box {
  width: 100%;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  border-radius: 15px;
  border: 1.5px solid var(--line);
  background: #fff;
  outline: 0;
  caret-color: var(--accent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease, transform 0.15s ease;
}

.auth-panel .auth-code-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: scale(1.04);
}

.auth-panel .auth-code-box:not(:placeholder-shown) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #14563f;
}

.auth-link-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.auth-link-btn b {
  color: var(--accent);
  font-weight: 800;
}

/* --- error: collapses when empty, shakes when shown --- */
.auth-error {
  display: none;
}

.auth-error:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 13px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 700;
  animation: authShake 0.32s ease;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* --- submit --- */
.auth-submit {
  width: 100%;
  margin-top: 16px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(150deg, #2b302c, #14171a 70%);
  color: #fff;
  font-size: 15.5px;
  font-weight: 800;
  box-shadow: 0 14px 30px -12px rgba(20, 24, 22, 0.55);
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.auth-submit:active {
  transform: scale(0.97);
}

.auth-submit svg {
  width: 18px;
  height: 18px;
}

/* --- footer --- */
.auth-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  justify-items: center;
}

.auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.auth-secure svg {
  width: 12px;
  height: 12px;
}

.auth-foot small {
  font-size: 11px;
  color: var(--ink-soft);
}

@media (min-width: 520px) {
  #app {
    height: min(100dvh, 940px);
    margin-top: calc((100dvh - min(100dvh, 940px)) / 2);
    border-radius: 28px;
  }
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(10px + var(--safe-top)) 14px 9px;
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(31, 122, 92, 0.18);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px -14px rgba(18, 75, 57, 0.65);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: -0.2px;
}

.location {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 0;
}

.location svg {
  width: 13px;
  height: 13px;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn .dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

/* Search bar */
.search-dock {
  position: relative;
  z-index: 19;
  flex-shrink: 0;
  min-height: var(--search-dock-h);
  background: var(--bg);
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    margin-top 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

#app:not(.tab-home) .search-dock {
  display: none;
}

#app.tab-home.search-dock-hidden .search-dock {
  margin-top: calc(-1 * var(--search-dock-h));
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.home-search {
  padding: 10px 16px 8px;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  height: 44px;
  box-shadow: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.searchbar:focus-within {
  border-color: var(--accent);
  box-shadow: none;
}

.searchbar > svg {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.searchbar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  min-width: 0;
}

.searchbar input::-webkit-search-cancel-button {
  display: none;
}

.clear-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line);
  display: none;
  place-items: center;
  flex-shrink: 0;
}

.clear-btn svg {
  width: 14px;
  height: 14px;
}

.searchbar.has-text .clear-btn {
  display: grid;
}

/* ===== Views ===== */
#views {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding-bottom: calc(var(--tabbar-h) + 24px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Chips */
.chips {
  display: flex;
  gap: 8px;
  padding: 14px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.chip:active {
  transform: scale(0.94);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Promo banner */
.promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 16px 4px;
  padding: 16px 0 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #124b39, #1f7a5c 60%, #2f9a76);
  color: #fff;
  overflow: hidden;
}

.promo-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.promo-copy strong {
  font-size: 16px;
}

.promo-copy span {
  font-size: 12.5px;
  opacity: 0.85;
}

.promo-btn {
  margin-top: 8px;
  align-self: flex-start;
  background: #fff;
  color: #124b39;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  transition: transform 0.15s ease;
}

.promo-btn:active {
  transform: scale(0.94);
}

.promo img {
  width: 132px;
  height: 108px;
  object-fit: cover;
  border-radius: 14px 0 0 14px;
  margin-left: 8px;
  opacity: 0.95;
}

/* Section titles */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 16px 10px;
}

.section-title h2 {
  font-size: 17px;
  letter-spacing: -0.2px;
}

.count {
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* ===== Pet cards grid ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}

.pet-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(20, 24, 22, 0.06);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  animation: cardIn 0.3s ease both;
}

.pet-card:active {
  transform: scale(0.97);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pet-photo {
  position: relative;
  height: 128px;
  display: grid;
  place-items: center;
  font-size: 52px;
  overflow: hidden;
}

.pet-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-photo .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
}

.pet-photo .badge.sale {
  color: #a06008;
}

.pet-photo .photo-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(7, 22, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pet-photo .photo-badge svg {
  width: 12px;
  height: 12px;
}

.heart-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.heart-btn:active {
  transform: scale(1.25);
}

.heart-btn svg {
  width: 15px;
  height: 15px;
  color: var(--ink-soft);
}

.heart-btn.saved svg {
  color: var(--danger);
  fill: var(--danger);
}

.pet-body {
  padding: 10px 12px 12px;
}

.pet-body h3 {
  font-size: 14.5px;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pet-body h3 svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.pet-body .sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.price {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.dist {
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* ===== Service list ===== */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.service-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 2px 12px rgba(20, 24, 22, 0.06);
  transition: transform 0.15s ease;
  animation: cardIn 0.3s ease both;
}

.service-card:active {
  transform: scale(0.98);
}

.service-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
}

.service-info {
  flex: 1;
  min-width: 0;
}

.service-info h3 {
  font-size: 14.5px;
  letter-spacing: -0.2px;
}

.service-info .sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 12px;
}

.service-price {
  color: var(--ink-soft);
}

.book-btn {
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.2s ease;
}

.book-btn:active {
  transform: scale(0.93);
}

.book-btn.booked {
  background: var(--accent);
  color: #fff;
}

/* ===== Forms (Sell / Lost) ===== */
.sell-head {
  padding: 20px 16px 0;
}

.sell-head h2 {
  font-size: 20px;
  letter-spacing: -0.3px;
}

.sell-head p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 3px;
}

.segmented {
  display: flex;
  gap: 4px;
  margin: 14px 16px 0;
  background: #ecebe6;
  border-radius: 14px;
  padding: 4px;
}

.segment {
  flex: 1;
  padding: 9px 0;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(20, 24, 22, 0.08);
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.card-form {
  margin: 0 16px 8px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: viewIn 0.25s ease;
}

.form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-title strong {
  font-size: 15px;
}

.app-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.app-form label > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.app-form input,
.app-form select,
.app-form textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 14.5px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-form input,
.card-form select,
.card-form textarea {
  background: var(--bg);
}

.app-form input:focus,
.app-form select:focus,
.app-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.app-form textarea {
  resize: none;
}

.form-row {
  display: flex;
  gap: 10px;
}

.photo-picker {
  cursor: pointer;
}

.photo-preview {
  position: relative;
  height: 120px;
  border: 1.5px dashed #cfcdc5;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: border-color 0.2s ease;
}

.photo-preview:active {
  border-color: var(--accent);
}

.photo-preview.has-img {
  border-style: solid;
  border-color: var(--accent);
}

.photo-preview.has-img > * {
  display: none;
}

.photo-preview.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.photo-preview .photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex !important;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(7, 22, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.photo-preview .photo-count svg {
  width: 14px;
  height: 14px;
}

.photo-preview svg {
  width: 24px;
  height: 24px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: -6px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.photo-thumb.cover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 122, 92, 0.14);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(25, 28, 26, 0.72);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.photo-remove svg {
  width: 13px;
  height: 13px;
}

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 15px;
  border-radius: 16px;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.primary-btn:active {
  transform: scale(0.97);
}

.primary-btn.danger {
  background: var(--danger);
}

.primary-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== Lost & Found ===== */
.lost-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #7c2418, #b8402e 60%, #d94f3d);
  color: #fff;
}

.lost-hero h2 {
  font-size: 18px;
  letter-spacing: -0.2px;
}

.lost-hero p {
  font-size: 12.5px;
  opacity: 0.85;
  margin-top: 3px;
  max-width: 210px;
}

.lost-filters {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) 40px;
  gap: 8px;
  padding: 0 16px 12px;
  align-items: end;
}

.lost-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lost-filters label span {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 800;
}

.lost-filters select,
.lost-filters input {
  height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  padding: 0 10px;
  outline: 0;
}

.report-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  color: #b8402e;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 14px;
  border-radius: 999px;
  transition: transform 0.15s ease;
}

.report-btn:active {
  transform: scale(0.94);
}

.report-btn svg {
  width: 16px;
  height: 16px;
}

/* ===== My Pets care ===== */
.care-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 4px;
}

.care-head h2 {
  font-size: 22px;
  letter-spacing: -0.4px;
}

.care-head p {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.care-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 22px -12px rgba(31, 122, 92, 0.7);
  transition: transform 0.15s ease;
}

.care-add-btn:active {
  transform: scale(0.94);
}

.care-add-btn svg {
  width: 15px;
  height: 15px;
}

/* ===== Up Next hero ===== */
.care-upnext {
  padding: 12px 16px 4px;
}

.upnext {
  position: relative;
  border-radius: 22px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #1f7a5c, #16624a 60%, #124b39);
  box-shadow: 0 20px 44px -26px rgba(18, 75, 57, 0.85);
  overflow: hidden;
  animation: cardIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.upnext.is-overdue {
  background: linear-gradient(135deg, #c2412e, #a5331f 62%, #7c2418);
  box-shadow: 0 20px 44px -26px rgba(124, 36, 24, 0.8);
}

.upnext.done-state {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #2f9a76, #1f7a5c 70%);
}

.upnext-check {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.upnext-check svg {
  width: 26px;
  height: 26px;
}

.upnext-body {
  display: grid;
  gap: 2px;
}

.upnext-body strong {
  font-size: 16px;
  letter-spacing: -0.2px;
}

.upnext-body small {
  font-size: 12px;
  opacity: 0.85;
}

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

.upnext-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.85;
}

.upnext-rel {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.upnext-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.upnext-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.16);
}

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

.upnext-info {
  flex: 1;
  min-width: 0;
}

.upnext-info strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.upnext-info strong svg {
  width: 17px;
  height: 17px;
}

.upnext-info small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  opacity: 0.86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upnext-done {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  color: var(--accent);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* gentle breathing ring so the primary action reads as tappable */
.upnext-done::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  animation: upnextRing 2.4s ease-out infinite;
}

@keyframes upnextRing {
  0% { transform: scale(0.85); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}

.upnext.is-overdue .upnext-done {
  color: var(--danger);
}

.upnext-done:active {
  transform: scale(0.86);
}

.upnext-done svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.4;
}

.upnext-then {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.82;
}

.upnext-then svg {
  width: 13px;
  height: 13px;
}

.upnext-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.upnext-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.upnext-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.upnext-progress > span {
  font-size: 11.5px;
  font-weight: 800;
  opacity: 0.9;
  white-space: nowrap;
}

/* ===== Pet cards ===== */
.care-list {
  padding-bottom: 4px;
}

.care-card {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 2px 14px rgba(20, 24, 22, 0.06);
  animation: cardIn 0.3s ease both;
}

.care-pet-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.care-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 26px;
}

.care-avatar img,
.care-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.care-avatar img {
  opacity: 1;
}

.care-pet-id {
  flex: 1;
  min-width: 0;
}

.care-pet-id h3 {
  font-size: 16.5px;
  letter-spacing: -0.3px;
}

.care-pet-id p {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-pill {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.health-watch { background: #fff4d7; color: #94630b; }
.health-medicine { background: #e8edff; color: #4859a8; }
.health-vet { background: var(--danger-soft); color: var(--danger); }

.care-edit {
  align-self: flex-start;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.care-edit:active {
  transform: scale(0.9);
}

.care-edit svg {
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
}

.care-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}

.care-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.care-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.care-progress-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

.care-tasks {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

/* ===== Cute task pills ===== */
.ctask {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 16px;
  background: #faf9f5;
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease,
    border-color 0.2s ease;
}

.ctask:active {
  transform: scale(0.975);
}

.ctask.overdue {
  background: #fdf2ef;
  border-color: rgba(217, 79, 61, 0.28);
}

.ctask.done {
  background: var(--accent-soft);
  border-color: rgba(31, 122, 92, 0.16);
}

.ctask-ic {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.ctask.overdue .ctask-ic {
  background: #fff;
  color: var(--danger);
}

.ctask-ic.done {
  background: var(--accent);
  color: #fff;
}

.ctask-ic svg {
  width: 18px;
  height: 18px;
}

.ctask-body {
  min-width: 0;
}

.ctask-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  min-width: 0;
}

.ctask.done .ctask-name {
  text-decoration: line-through;
  opacity: 0.72;
}

.ctask-sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctask.overdue .ctask-sub {
  color: var(--danger);
}

.freq-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(31, 122, 92, 0.1);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ctask-sched {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ctask-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(31, 122, 92, 0.28);
  display: grid;
  place-items: center;
  color: transparent;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ctask-check svg {
  width: 15px;
  height: 15px;
}

.ctask.overdue .ctask-check {
  border-color: rgba(217, 79, 61, 0.45);
}

.ctask:active .ctask-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.12);
}

/* completion timing colours (shared by pills, banners, sheet) */
.t-ontime { color: var(--accent); }
.t-early { color: #4859a8; }
.t-late { color: #c2412e; }

/* Mark-all card */
.care-markall-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eafaf3, #dcf1e8);
  border: 1px solid rgba(31, 122, 92, 0.22);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.care-markall-card:active {
  transform: scale(0.98);
}

.mac-ic {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mac-ic svg {
  width: 20px;
  height: 20px;
}

.mac-text {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.mac-text strong {
  display: block;
  font-size: 13.5px;
  color: #14563f;
  letter-spacing: -0.2px;
}

.mac-text small {
  font-size: 11px;
  color: var(--ink-soft);
}

.mac-arrow {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex-shrink: 0;
}

.care-allclear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.care-allclear svg {
  width: 16px;
  height: 16px;
}

/* ===== Completion confirmation sheet ===== */
.confirm-care {
  text-align: center;
  padding: 4px 2px 2px;
}

.cc-ic {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  margin: 2px auto 12px;
  display: grid;
  place-items: center;
  animation: cardIn 0.34s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.cc-ic svg {
  width: 28px;
  height: 28px;
}

.cc-ic.ontime { background: var(--accent-soft); color: var(--accent); }
.cc-ic.early { background: #e8edff; color: #4859a8; }
.cc-ic.late { background: var(--danger-soft); color: var(--danger); }
.cc-ic.done { background: var(--accent); color: #fff; }

.confirm-care h2 {
  font-size: 19px;
  letter-spacing: -0.3px;
}

.cc-prompt {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 7px;
  line-height: 1.5;
}

.cc-prompt b {
  color: var(--ink);
  font-weight: 800;
}

.cc-times {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.cc-times > div {
  flex: 1;
  background: var(--bg);
  border-radius: 14px;
  padding: 11px;
}

.cc-times span {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cc-times strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.cc-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border-radius: 13px;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 16px;
}

.cc-banner.t-ontime { background: var(--accent-soft); color: var(--accent); }
.cc-banner.t-early { background: #e8edff; color: #4859a8; }
.cc-banner.t-late { background: var(--danger-soft); color: var(--danger); }

.cc-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 16px;
  text-align: left;
}

.cc-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.cc-list li svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

.cc-list li span {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.cc-actions {
  display: flex;
  gap: 10px;
}

.cc-actions .mini-btn {
  flex: 0 0 auto;
  padding: 0 20px;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 15px;
  font-weight: 800;
  color: var(--ink);
  transition: transform 0.15s ease;
}

.cc-actions .mini-btn:active {
  transform: scale(0.96);
}

.cc-actions .primary-btn {
  flex: 1;
}

.care-done-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.care-done-toggle > svg:first-child {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.care-done-toggle .chev {
  width: 15px;
  height: 15px;
  transition: transform 0.25s ease;
}

.care-done-toggle.open .chev {
  transform: rotate(180deg);
}

.care-done-list {
  margin-top: 7px;
}

.care-muted {
  padding: 11px;
  border-radius: 13px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12.5px;
  margin-top: 12px;
}

/* ===== Editor ===== */
.care-editor {
  padding: 0;
}

.wizard-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px 20px 12px;
  margin: -10px -20px 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.wizard-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wizard-topline h2 {
  font-size: 20px;
  line-height: 1.1;
}

.wizard-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.wizard-progress {
  height: 4px;
  margin: 14px 0 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.wizard-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.wizard-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.wizard-labels .wl {
  padding: 8px 6px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.wizard-labels .wl.active,
.wizard-labels .wl.done {
  background: var(--accent-soft);
  color: var(--accent);
}

.wizard-labels .wl:active {
  transform: scale(0.96);
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: grid;
  gap: 14px;
  padding: 16px 0 2px;
  animation: viewIn 0.24s ease;
}

.wizard-nav {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 10px;
  padding: 12px 0 max(6px, env(safe-area-inset-bottom));
  margin-top: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface) 34%);
}

.wizard-nav.has-delete {
  grid-template-columns: 46px minmax(0, 0.9fr) minmax(0, 1.12fr);
}

.wizard-nav.first-step {
  grid-template-columns: minmax(0, 1fr);
}

.wizard-nav.has-delete.first-step {
  grid-template-columns: 46px minmax(0, 1fr);
}

.wizard-nav .primary-btn,
.wizard-nav .mini-btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  height: 46px;
}

.wiz-del {
  padding: 0;
  grid-column: 1;
}

.wiz-back {
  grid-column: 1;
}

.wizard-nav.has-delete .wiz-back {
  grid-column: 2;
}

#wiz-next,
#wiz-save {
  grid-column: 2;
}

.wizard-nav.has-delete #wiz-next,
.wizard-nav.has-delete #wiz-save {
  grid-column: 3;
}

.wizard-nav.first-step #wiz-next,
.wizard-nav.first-step #wiz-save {
  grid-column: 1;
}

.wizard-nav.has-delete.first-step #wiz-next,
.wizard-nav.has-delete.first-step #wiz-save {
  grid-column: 2;
}

.care-photo-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: left;
  font-size: 13.5px;
  font-weight: 800;
}

.care-photo-preview {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface);
  background-size: cover;
  background-position: center;
  color: var(--accent);
  overflow: hidden;
}

.care-photo-preview svg {
  width: 20px;
  height: 20px;
}

.care-photo-preview.is-loading {
  opacity: 0.65;
}

.routine-editor {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg);
}

.form-title small {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
}

.routine-item {
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.routine-item.on {
  border-color: rgba(31, 122, 92, 0.35);
  box-shadow: 0 6px 16px -12px rgba(31, 122, 92, 0.6);
}

.routine-editor .routine-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  cursor: pointer;
}

.routine-head input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.routine-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
}

.routine-name svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.routine-count {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 900;
}

.routine-chev {
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  opacity: 0.5;
  transition: transform 0.25s ease;
}

.routine-item.on .routine-chev {
  transform: rotate(180deg);
  opacity: 1;
}

.routine-body {
  display: none;
  padding: 0 12px 12px;
  gap: 9px;
}

.routine-item.on .routine-body {
  display: grid;
  animation: viewIn 0.24s ease;
}

.routine-slots {
  display: grid;
  gap: 9px;
}

.routine-slot {
  display: grid;
  gap: 9px;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(20, 24, 22, 0.07);
  background: rgba(246, 245, 242, 0.72);
}

.routine-slot-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.routine-slot-top .slot-time:only-child {
  grid-column: 1 / -1;
}

.slot-time {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.slot-time span {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.slot-remove {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(217, 79, 61, 0.16);
  background: var(--danger-soft);
  color: var(--danger);
  display: grid;
  place-items: center;
}

.slot-remove svg {
  width: 17px;
  height: 17px;
}

.routine-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rl-label {
  width: 52px;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.slot-time input,
.routine-line input[type="time"],
.routine-line input[type="date"] {
  flex: 1;
  height: 40px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
}

.routine-line.freq-once {
  align-items: flex-start;
}

.freq-seg {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
}

.freq-seg button {
  padding: 8px 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  transition: all 0.18s ease;
}

.freq-seg button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(20, 24, 22, 0.1);
}

.weekday-pills {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekday-pills button {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  transition: all 0.16s ease;
}

.weekday-pills button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.slot-date-tools {
  flex: 1;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.date-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.date-add-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
}

.date-add-btn svg {
  width: 17px;
  height: 17px;
}

.date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 5px 5px 9px;
  border-radius: 999px;
  background: rgba(31, 122, 92, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.date-chip button {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(31, 122, 92, 0.12);
  color: var(--accent);
}

.date-chip svg {
  width: 12px;
  height: 12px;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.date-grid button {
  min-width: 0;
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  gap: 1px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.date-grid button span {
  font-size: 8.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.date-grid button b {
  font-size: 13px;
}

.date-grid button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px -14px rgba(31, 122, 92, 0.8);
}

.date-grid button:active {
  transform: scale(0.95);
}

.add-slot-btn {
  width: 100%;
  height: 40px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed rgba(31, 122, 92, 0.32);
  background: rgba(31, 122, 92, 0.07);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 900;
}

.add-slot-btn svg {
  width: 16px;
  height: 16px;
}

.care-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.care-editor-actions .primary-btn {
  flex: 1;
}

.danger-mini {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(217, 79, 61, 0.18);
}

.lost-card {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 2px 12px rgba(20, 24, 22, 0.06);
  animation: cardIn 0.3s ease both;
  cursor: pointer;
}

.lost-card.found {
  opacity: 0.62;
}

.lost-photo {
  position: relative;
  width: 86px;
  height: 96px;
  border-radius: 14px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 36px;
  overflow: hidden;
}

.lost-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lost-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
}

.lost-tag.found-tag {
  background: var(--accent);
}

.lost-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lost-info h3 {
  font-size: 15px;
  letter-spacing: -0.2px;
}

.lost-info .sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.lost-info .area {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.lost-info .area svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.reward-chip {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #a06008;
  background: #fdf3e0;
  padding: 4px 9px;
  border-radius: 999px;
}

.lost-actions {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.lost-actions button {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: transform 0.15s ease;
}

.lost-actions button:active {
  transform: scale(0.94);
}

.seen-btn {
  background: var(--danger-soft);
  color: var(--danger);
}

.found-btn {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Empty states */
.empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 48px 24px;
}

/* ===== Tab bar ===== */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tabbar-h);
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.2s ease, transform 0.1s ease;
}

.tab:active {
  transform: scale(0.92);
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab-emoji {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
}

.tab.active {
  color: var(--accent);
}

.tab-sell .fab {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  margin-top: -22px;
  box-shadow: 0 8px 20px rgba(31, 122, 92, 0.4);
  transition: transform 0.15s ease;
}

.tab-sell:active .fab {
  transform: scale(0.9);
}

.tab-sell .fab svg {
  width: 24px;
  height: 24px;
}

.tab-sell.active .fab {
  background: var(--ink);
}

/* ===== Bottom sheet ===== */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 16, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.3, 1);
  z-index: 50;
  max-height: 82%;
  overflow-y: auto;
}

.sheet.open {
  transform: none;
}

.sheet-grab {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 4px auto 14px;
}

.sheet-photo {
  position: relative;
  height: 190px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 84px;
  overflow: hidden;
  margin-bottom: 16px;
}

.sheet-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 64px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: -8px 0 16px;
  scrollbar-width: none;
}

.sheet-gallery::-webkit-scrollbar {
  display: none;
}

.sheet-thumb {
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--surface);
}

.sheet-thumb.active {
  border-color: var(--accent);
}

.sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sheet-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-topline h2 {
  font-size: 21px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-topline h2 svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.sheet-price {
  font-size: 19px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.sheet-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.sheet-desc {
  font-size: 14px;
  line-height: 1.55;
  color: #3c403d;
  margin-top: 12px;
}

.sheet-facts {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.fact {
  background: var(--bg);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--ink-soft);
}

.fact strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.sheet-actions .chat-btn {
  flex-shrink: 0;
  width: 52px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.sheet-actions .chat-btn:active {
  transform: scale(0.93);
}

.sheet-actions .chat-btn svg {
  width: 20px;
  height: 20px;
}

.sheet-actions .primary-btn {
  flex: 1;
}

/* City picker (location sheet) */
.city-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.city-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  transition: transform 0.15s ease, background 0.2s ease;
}

.city-row:active {
  transform: scale(0.97);
}

.city-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.city-row.gps {
  border-style: dashed;
}

/* ===== Toast ===== */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 18px);
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
  z-index: 60;
  max-width: 86%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.offline-overlay {
  position: absolute;
  inset: 0;
  z-index: 160;
  display: none;
  place-items: center;
  background: rgba(246, 245, 242, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.offline-overlay.show {
  display: grid;
}

.offline-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(290px, calc(100% - 48px));
  padding: 26px 24px 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(232, 230, 224, 0.76);
  box-shadow: 0 24px 70px -34px rgba(18, 75, 57, 0.65);
}

.offline-logo {
  position: relative;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
}

.offline-logo img {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  box-shadow: 0 18px 42px -22px rgba(18, 75, 57, 0.72);
  animation: offlineLogoPulse 1.55s ease-in-out infinite;
  z-index: 2;
}

.offline-ring {
  position: absolute;
  inset: 9px;
  border-radius: 30px;
  border: 1.5px solid rgba(31, 122, 92, 0.3);
  animation: offlineRing 1.8s ease-out infinite;
}

.offline-ring.two {
  animation-delay: 0.55s;
}

.offline-panel strong {
  font-size: 18px;
  line-height: 1.1;
  color: var(--ink);
}

.offline-panel span {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
}

@keyframes offlineLogoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  45% { transform: scale(0.93); opacity: 0.72; }
  70% { transform: scale(1.04); opacity: 1; }
}

@keyframes offlineRing {
  0% { opacity: 0.7; transform: scale(0.82); }
  100% { opacity: 0; transform: scale(1.35); }
}

/* =====================================================
   Polish layer — richer shades, springier motion
   ===================================================== */

/* Soft ambient color washes behind the whole app */
#app {
  background:
    radial-gradient(1100px 420px at 110% -8%, rgba(31, 122, 92, 0.08), transparent 62%),
    radial-gradient(820px 460px at -18% 112%, rgba(217, 79, 61, 0.06), transparent 60%),
    var(--bg);
}

/* Top bar gains depth once the feed scrolls under it */
.topbar {
  transition: box-shadow 0.3s ease;
}

.topbar.scrolled {
  box-shadow: none;
}

/* Springier view + card entrances (staggered via JS animation-delay) */
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pet-card,
.service-card,
.lost-card {
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow:
    0 1px 2px rgba(20, 24, 22, 0.04),
    0 12px 28px -14px rgba(20, 24, 22, 0.18);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease;
}

@media (hover: hover) {
  .pet-card:hover,
  .service-card:hover,
  .lost-card:hover {
    transform: translateY(-3px);
    box-shadow:
      0 2px 4px rgba(20, 24, 22, 0.05),
      0 20px 40px -16px rgba(20, 24, 22, 0.3);
  }
}

.pet-card:active,
.service-card:active {
  transform: scale(0.97);
}

/* Pet emojis gently float */
.ph-emoji {
  display: block;
  animation: floaty 3.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.14));
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Chips: gradient active state + springy press */
.chip {
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.chip.active {
  background: linear-gradient(140deg, #2b312d, #14171a 75%);
  box-shadow: 0 6px 16px -6px rgba(20, 24, 22, 0.4);
}

/* Promo banner: periodic shine sweep */
.promo {
  position: relative;
  box-shadow: 0 14px 32px -14px rgba(18, 75, 57, 0.55);
}

.promo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 32%,
    rgba(255, 255, 255, 0.16) 46%,
    rgba(255, 255, 255, 0.05) 52%,
    transparent 64%
  );
  transform: translateX(-130%);
  animation: shine 5.5s ease-in-out infinite;
}

@keyframes shine {
  0%,
  55% {
    transform: translateX(-130%);
  }
  85%,
  100% {
    transform: translateX(130%);
  }
}

/* Lost hero shares the deep shadow treatment */
.lost-hero {
  box-shadow: 0 14px 32px -14px rgba(124, 36, 24, 0.55);
}

.lost-tag {
  animation: tagPulse 1.6s ease-in-out infinite;
}

.lost-tag.found-tag {
  animation: none;
}

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

/* Floating action button: gradient + breathing glow */
.tab-sell .fab {
  background: linear-gradient(145deg, #2f9a76, #1f7a5c 55%, #14563f);
  animation: fabGlow 3.2s ease-in-out infinite;
}

@keyframes fabGlow {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(31, 122, 92, 0.35);
  }
  50% {
    box-shadow: 0 12px 30px rgba(31, 122, 92, 0.6);
  }
}

/* Tabs: springy icon lift + indicator dot */
.tab {
  position: relative;
}

.tab svg {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab.active svg {
  transform: translateY(-2px) scale(1.12);
}

.tab::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab.active::after {
  opacity: 1;
  transform: scale(1);
}

.tab-sell::after {
  display: none;
}

/* Heart pop when saving */
@keyframes heartPop {
  0% {
    transform: scale(0.5);
  }
  55% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}

.heart-btn.pop svg {
  animation: heartPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Book button smooth state change */
.book-btn {
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

.book-btn.booked {
  box-shadow: 0 6px 16px -6px rgba(31, 122, 92, 0.5);
}

/* Primary buttons: deep shadow + gradient sheen */
.primary-btn {
  background: linear-gradient(150deg, #2b302c, #14171a 70%);
  box-shadow: 0 10px 24px -10px rgba(20, 24, 22, 0.5);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease;
}

.primary-btn.danger {
  background: linear-gradient(150deg, #e5654f, #c2412e 70%);
  box-shadow: 0 10px 24px -10px rgba(217, 79, 61, 0.55);
}

/* Bottom sheet: gentle overshoot + blurred backdrop */
.sheet {
  transition: transform 0.42s cubic-bezier(0.3, 1.18, 0.36, 1);
  box-shadow: 0 -18px 50px rgba(15, 18, 16, 0.22);
}

.sheet-backdrop {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* Toast: springy pop-in */
.toast {
  transition:
    opacity 0.3s ease,
    transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Segmented control: smoother slide feel */
.segment {
  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.segment:active {
  transform: scale(0.96);
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================
   v3 — floating pill tab bar, chat, filters
   ===================================================== */

:root {
  --tabbar-h: calc(78px + var(--safe-bottom)); /* pill (64) + bottom safe gap */
}

/* Floating pill nav */
.tabbar {
  left: 14px;
  right: 14px;
  bottom: var(--tabbar-gap);
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(20, 24, 22, 0.06);
  border-top: 1px solid rgba(20, 24, 22, 0.06);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 2px 6px rgba(20, 24, 22, 0.06),
    0 18px 40px -12px rgba(20, 24, 22, 0.35);
  padding: 6px;
  align-items: center;
}

.tab {
  height: 52px;
  border-radius: 999px;
  margin: 0 1px;
  min-width: 0;
  transition:
    color 0.25s ease,
    background 0.3s ease,
    transform 0.1s ease;
}

.tab.active {
  background: var(--accent-soft);
}

.tab::after {
  display: none; /* pill highlight replaces the indicator dot */
}

.tab-sell .fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-top: 0;
}

#views {
  padding-bottom: calc(var(--tabbar-h) + 34px);
}

.toast {
  bottom: calc(var(--tabbar-h) + 16px);
}

/* Compact attention badges on bottom tabs */
.tab-badge {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 15%;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  animation: badgeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  line-height: 1;
}

@keyframes badgeIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

/* ===== Filter row (radius + sort) ===== */
.filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-label {
  flex-shrink: 0;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  margin-right: 2px;
}

.filter-label svg {
  width: 15px;
  height: 15px;
}

.filter-chip {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.filter-chip:active {
  transform: scale(0.93);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: none;
}

.filter-divider {
  display: none;
}

/* ===== Chat list ===== */
.chat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 13px;
  box-shadow:
    0 1px 2px rgba(20, 24, 22, 0.04),
    0 12px 28px -14px rgba(20, 24, 22, 0.18);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.chat-card:active {
  transform: scale(0.98);
}

.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 900;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-info h3 {
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-info .sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-info .preview {
  color: #4a4f4b;
}

.chat-preview {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-preview.unread {
  color: var(--ink);
  font-weight: 600;
}

.chat-title-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: 4px;
  box-shadow: 0 8px 18px -10px rgba(217, 79, 61, 0.75);
}

.unread-dot {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.pill {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.pill-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-pending {
  background: #fdf3e0;
  color: #a06008;
}

/* ===== Chat thread ===== */
.thread-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(246, 245, 242, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 19px;
  overflow: hidden;
  font-weight: 900;
}

.thread-title {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.thread-title strong {
  font-size: 14.5px;
  display: block;
}

.thread-title small {
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.thread-bio {
  margin-top: 2px;
}

.msgs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 10px;
  min-height: calc(100dvh - 150px);
}
/* Bottom-anchor the conversation: a short chat sits just above the composer
   (empty space collapses to the top), and grows upward like a real messenger.
   margin-top:auto only consumes slack, so long chats still scroll normally. */
.msgs > *:first-child {
  margin-top: auto;
}

.msg-date-sep {
  align-self: center;
  margin: 10px 0 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(232, 230, 224, 0.9);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px -14px rgba(20, 24, 22, 0.3);
}
/* Tighter grouping — consecutive bubbles from the same side hug; the sender
   change gets a little air. */
/* Consecutive messages from the SAME sender hug together... */
.msg + .msg.me,
.msg + .msg.them {
  margin-top: 0;
}
/* ...and a clear gap opens when the sender changes. */
.msg.me + .msg.them,
.msg.them + .msg.me {
  margin-top: 16px;
}
/* Space system notices from bubbles either side. */
.msg + .msg.sys,
.msg.sys + .msg {
  margin-top: 12px;
}
/* Merge the joined corners of a same-sender run so it reads as one smooth
   block (the trailing :has rules enhance where supported). */
.msg.me + .msg.me {
  border-top-right-radius: 7px;
}
.msg.them + .msg.them {
  border-top-left-radius: 7px;
}
.msg.me:has(+ .msg.me) {
  border-bottom-right-radius: 7px;
}
.msg.them:has(+ .msg.them) {
  border-bottom-left-radius: 7px;
}

.msg {
  max-width: 80%;
  padding: 7px 11px 6px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  animation: cardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  word-wrap: break-word;
  /* let vertical scroll through but keep horizontal swipe-to-reply for JS */
  touch-action: pan-y;
  cursor: pointer;
}
.msg.swiping { animation: none; will-change: transform; }
/* reply arrow that fades in behind the bubble as you swipe toward centre */
.msg.me::before,
.msg.them::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: var(--accent, #2f9a76) center / 15px 15px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 17 4 12 9 7'/%3E%3Cpath d='M20 18v-2a4 4 0 0 0-4-4H4'/%3E%3C/svg%3E");
  opacity: 0;
  transform: scale(0.5);
  transition: opacity .12s, transform .12s;
  pointer-events: none;
}
.msg.me::before { right: -34px; }
.msg.them::before { left: -34px; }
.msg.reply-armed::before { opacity: 1; transform: scale(1); }
/* quoted message shown above the reply text */
.msg-quote {
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
  font-family: inherit;
  color: inherit;
  text-align: left;
  padding: 4px 8px;
  margin: 0 0 4px;
  border-radius: 8px;
  border: 0;
  border-left: 3px solid currentColor;
  opacity: 0.82;
  max-height: 2.7em;
  overflow: hidden;
  width: 100%;
  appearance: none;
}
button.msg-quote { cursor: pointer; }
button.msg-quote:active { transform: translateY(1px); }
.msg.me .msg-quote { background: rgba(255, 255, 255, 0.16); }
.msg.them .msg-quote { background: rgba(0, 0, 0, 0.05); border-left-color: var(--accent, #2f9a76); }
.msg.jump-highlight {
  animation: msgJumpGlow .95s ease both;
}
@keyframes msgJumpGlow {
  0% { box-shadow: 0 0 0 0 rgba(47, 154, 118, 0.34); }
  35% { box-shadow: 0 0 0 8px rgba(47, 154, 118, 0.16); transform: scale(1.015); }
  100% { box-shadow: 0 0 0 0 rgba(47, 154, 118, 0); transform: none; }
}
/* contain the floated timestamp so the bubble hugs its content */
.msg::after {
  content: "";
  display: block;
  clear: both;
}

/* Time + ticks float to the bottom-right and text wraps around them — keeps
   short messages to a single line instead of a tall two-line bubble. */
.msg time {
  float: right;
  font-size: 10px;
  opacity: 0.7;
  margin: 5px -2px 0 10px;
  line-height: 1;
}
.msg-edited {
  font-size: 9.5px;
  opacity: 0.75;
  font-style: italic;
  margin-right: 4px;
}
.ext-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.msg.me .ext-link { color: #eafff6; }
.msg.them .ext-link { color: var(--accent); }
.pet-desc .ext-link { color: var(--accent); }

.msg.me {
  align-self: flex-end;
  background: linear-gradient(150deg, #2f9a76, #1f7a5c 70%);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 16px -8px rgba(31, 122, 92, 0.6);
}

.msg.them {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.msg.sys {
  align-self: center;
  max-width: 92%;
  background: #eceae4;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
  padding: 7px 14px;
  border-radius: 999px;
}

.thread-request-actions {
  align-self: stretch;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 6px 0 2px;
}

.thread-request-actions .primary-btn {
  flex: 1;
  max-width: 260px;
}
.reject-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--danger);
  background: var(--surface);
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.reject-btn i {
  width: 17px;
  height: 17px;
}

/* Composer floats above the pill bar */
.chat-composer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(var(--tabbar-h) + 8px);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  z-index: 25;
  animation: viewIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-composer input,
.chat-composer textarea {
  flex: 1;
  min-height: 48px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 13px 18px;
  font-size: 14.5px;
  line-height: 20px;
  outline: none;
  box-shadow: 0 10px 26px -12px rgba(20, 24, 22, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-composer textarea {
  resize: none;
  overflow-y: auto;
  max-height: 132px;
  font-family: inherit;
}

.chat-composer input:focus,
.chat-composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-composer input:disabled,
.chat-composer textarea:disabled {
  opacity: 0.65;
}

.chat-composer button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2f9a76, #1f7a5c 60%);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  align-self: flex-end;
  box-shadow: 0 10px 22px -8px rgba(31, 122, 92, 0.6);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-composer button:active {
  transform: scale(0.9);
}

.chat-composer button:disabled {
  opacity: 0.55;
}

.chat-composer button svg {
  width: 19px;
  height: 19px;
}

/* Requested (pending) state on service Book buttons */
.book-btn.requested {
  background: #fdf3e0;
  color: #a06008;
  opacity: 1;
}

/* =====================================================
   v4 — brand polish, photo blur-up, shimmer
   ===================================================== */

.brand-mark img {
  width: 26px;
  height: 26px;
  display: block;
}

.profile-editor {
  display: grid;
  gap: 14px;
}

.profile-photo-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-preview,
.owner-avatar-mini,
.msg-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.profile-preview {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 22px;
  flex-shrink: 0;
}

.profile-preview img,
.owner-avatar-mini img,
.chat-avatar img,
.thread-avatar img,
.msg-avatar img,
.drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 800;
}

.profile-editor label {
  display: grid;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.profile-editor input,
.profile-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
  outline: 0;
}

.owner-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  background: var(--bg);
  margin: 10px 0 12px;
}

.owner-avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.owner-row strong,
.owner-row small {
  display: block;
}

.owner-row small {
  color: var(--ink-soft);
  font-size: 11.5px;
}

.owner-bio {
  margin-top: 4px;
  color: #4f5751;
  font-size: 12px;
  line-height: 1.35;
}

.notification-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.orders-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 14px;
}

.order-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid rgba(232, 230, 224, 0.8);
}

.order-row .chat-info {
  flex: 1;
  min-width: 0;
}

.order-row .book-btn {
  flex-shrink: 0;
}

.notification-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid rgba(232, 230, 224, 0.8);
  text-align: left;
  transition: transform 0.15s ease, background 0.2s ease;
}

.notification-row:active {
  transform: scale(0.98);
  background: var(--accent-soft);
}

.notification-row svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

.notification-row span,
.notification-empty {
  display: grid;
  gap: 2px;
}

.notification-row strong,
.notification-empty strong {
  font-size: 13.5px;
}

.notification-row small,
.notification-empty small {
  color: var(--ink-soft);
  font-size: 11.5px;
}

.notification-empty {
  padding: 16px;
  border-radius: 16px;
  background: var(--bg);
}

/* Static placeholder tint behind photos; the image covers it once it paints.
   Images are always visible (no opacity gating) so re-renders never flicker. */
.pet-photo:not([style*="background"]),
.lost-photo:not([style*="background"]),
.sheet-photo:not([style*="background"]) {
  background-color: #ecebe6;
}

.pet-photo img,
.lost-photo img,
.sheet-photo img {
  opacity: 1;
}

/* =====================================================
   v5 — top bar redesign, drawer, full-screen chat, desktop
   ===================================================== */

/* --- Top bar: brand opens the drawer, location is a pill --- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  margin-left: -4px;
  border-radius: 14px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.brand:active {
  transform: scale(0.96);
  background: rgba(20, 24, 22, 0.05);
}

.brand-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-name svg {
  width: 15px;
  height: 15px;
  color: var(--ink-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search-btn {
  width: 0;
  margin-right: -8px;
  border-width: 0;
  opacity: 0;
  transform: scale(0.82) translateY(4px);
  pointer-events: none;
  overflow: hidden;
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    margin-right 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

#app.tab-home.search-dock-hidden .top-search-btn {
  width: 36px;
  margin-right: 0;
  border-width: 1px;
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.loc-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 11px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  max-width: 150px;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.loc-pill:active {
  transform: scale(0.95);
}

.loc-pill svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.loc-pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Drawer --- */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 16, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 70;
  opacity: var(--drawer-backdrop-opacity, 0);
}

.drawer-backdrop.open {
  opacity: var(--drawer-backdrop-opacity, 1);
  pointer-events: auto;
}

.drawer-backdrop.dragging {
  transition: none;
}

.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(310px, 86%);
  background: var(--surface);
  z-index: 80;
  display: flex;
  flex-direction: column;
  border-radius: 0 26px 26px 0;
  box-shadow: 30px 0 70px -30px rgba(15, 18, 16, 0.45);
  transform: translateX(var(--drawer-x, -105%));
  transition: transform 0.34s cubic-bezier(0.3, 1.1, 0.35, 1);
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  will-change: transform;
}

.drawer.open {
  transform: translateX(var(--drawer-x, 0));
}

.drawer.dragging {
  transition: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.drawer-brand {
  flex: 1;
  line-height: 1.2;
}

.drawer-brand strong {
  font-size: 16px;
  letter-spacing: -0.3px;
  display: block;
}

.drawer-brand small {
  font-size: 11px;
  color: var(--ink-soft);
}

.drawer-user {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 2px 6px;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg);
}

.drawer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
}

.drawer-user div {
  flex: 1;
  line-height: 1.25;
}

.drawer-user strong {
  font-size: 14px;
  display: block;
}

.drawer-user small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.drawer-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  overflow-y: auto;
}

.drawer-menu button {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 12px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.2s ease, transform 0.15s ease;
}

.drawer-menu button:active {
  transform: scale(0.97);
  background: var(--accent-soft);
}

.drawer-menu button svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

.menu-icon-emoji {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}

.drawer-menu button span:first-of-type {
  flex: 1;
}

.menu-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.drawer-sep {
  height: 1px;
  background: var(--line);
  margin: 8px 12px;
}

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 13px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-foot span {
  font-size: 12.5px;
}

.drawer-foot small {
  font-size: 11px;
  color: var(--ink-soft);
}

/* --- Full-screen chat thread --- */
#app.chat-full .topbar,
#app.chat-full .tabbar {
  display: none;
}

#app.chat-full #views {
  padding-bottom: 0;
  overflow: hidden;
}
/* Proper flex column: header + scrollable messages + composer, all sized by
   flex — no min-height/padding guesswork, robust across devices & safe-areas. */
#app.chat-full .chat-shell,
#app.chat-full #chat-main {
  height: var(--app-height);
}
#app.chat-full #chat-main {
  display: flex;
  flex-direction: column;
}
#app.chat-full #chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#app.chat-full .thread-head {
  flex-shrink: 0;
}
#app.chat-full .msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 6px;
}

.msgs-bottom {
  flex: 0 0 1px;
  height: 1px;
  width: 100%;
  pointer-events: none;
}
#app.chat-full .chat-composer {
  position: static;
  flex-shrink: 0;
  bottom: auto;
  animation: none;
  transform: none;
  /* Static flex item, so lift it off the system nav bar with padding
     (a `bottom:` offset does nothing here — that was the "too low" bug). */
  padding: 8px 14px max(12px, var(--safe-bottom));
}

#app.chat-full .thread-head {
  padding-top: max(14px, var(--safe-top));
}

/* --- Thread head extras --- */
.presence {
  display: flex;
  align-items: center;
  gap: 5px;
}

.presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35c789;
  box-shadow: 0 0 0 3px rgba(53, 199, 137, 0.2);
  flex-shrink: 0;
}

.presence-dot.off {
  background: #c9c6be;
  box-shadow: none;
}

/* --- Kind-tinted avatars --- */
.kind-buy { background: #fdf3e0 !important; }
.kind-adopt { background: var(--accent-soft) !important; }
.kind-service { background: #e4e9ff !important; }
.kind-lost { background: var(--danger-soft) !important; }

/* --- Chat list refinements --- */
.chat-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.chat-time {
  font-size: 11px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

/* --- Ticks, typing, photo messages --- */
.ticks {
  font-size: 10px;
  letter-spacing: -1.5px;
  opacity: 0.75;
  margin-left: 4px;
}

.ticks.read {
  color: #7df0c0;
  opacity: 1;
}

.msg.them .ticks,
.preview .ticks {
  color: var(--accent);
}

.msg.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 16px;
  width: 64px;
}

.msg.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9beb8;
  animation: typingDot 1.1s ease-in-out infinite;
}

.msg.typing span:nth-child(2) { animation-delay: 0.18s; }
.msg.typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.msg-img {
  display: block;
  max-width: 210px;
  border-radius: 12px;
  margin: -3px -6px 3px;
}

.msg.sys.lock {
  background: #fdf6e3;
  color: #8a6d1a;
}

.thread-note {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(232, 230, 224, 0.9);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.thread-note.pending {
  background: #fdf6e3;
  border-color: #f4e8bd;
  color: #84651a;
}

.thread-note svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* --- Composer upgrades --- */
.comp-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 10px 26px -12px rgba(20, 24, 22, 0.35);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comp-btn:active {
  transform: scale(0.9);
}

.comp-btn:disabled {
  opacity: 0.55;
}

.comp-btn svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.composer-box {
  flex: 1;
  position: relative;
  display: block;
  min-width: 0;
}

.composer-box input,
.composer-box textarea {
  display: block;
  padding-right: 46px;
  width: 100%;
}

/* Emoji toggle sits INSIDE the message pill as a flat monochrome glyph
   (like WhatsApp/Telegram) — the higher specificity here is required to beat
   the generic `.chat-composer button` green-gradient rule above. */
.chat-composer .comp-emoji {
  position: absolute;
  right: 7px;
  bottom: 7px;
  margin-left: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  z-index: 2;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.15s ease, color 0.15s ease;
}

.chat-composer .comp-emoji svg {
  width: 23px;
  height: 23px;
}

.chat-composer .comp-emoji:hover {
  color: var(--accent);
}

.chat-composer .comp-emoji.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-composer .comp-emoji:active {
  transform: scale(1.12);
}

.chat-composer .comp-emoji:disabled {
  opacity: 0.4;
  transform: none;
  background: transparent;
  color: #b7c0ba;
}

.emoji-strip {
  position: absolute;
  bottom: 58px;
  left: 0;
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: 0 14px 34px -14px rgba(20, 24, 22, 0.4);
  animation: viewIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.emoji-strip button {
  font-size: 19px;
  padding: 4px 6px;
  border-radius: 10px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.emoji-strip button:active {
  transform: scale(1.4);
}

/* =====================================================
   Desktop / large screens — true full-screen layout
   ===================================================== */
@media (min-width: 760px) {
  #app {
    max-width: none;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    padding: calc(10px + var(--safe-top)) 28px 9px;
  }

  .topbar-row,
  .home-search {
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
  }

  .view {
    max-width: 1112px;
    margin: 0 auto;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 16px;
  }

  .pet-photo {
    height: 168px;
  }

  .list {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
  }

  .section-title,
  .chips,
  .filter-row {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 540px;
  }

  .chat-composer {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(760px, calc(100% - 28px));
  }

  .msgs {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
  }

  .thread-head {
    padding-left: max(16px, calc((100% - 760px) / 2));
    padding-right: max(16px, calc((100% - 760px) / 2));
  }

  .sheet {
    left: 50%;
    right: auto;
    transform: translate(-50%, 105%);
    width: min(560px, 100%);
    border-radius: 26px 26px 0 0;
  }

  .sheet.open {
    transform: translate(-50%, 0);
  }

  .toast {
    bottom: calc(var(--tabbar-h) + 18px);
  }
}

/* =====================================================
   v6 — compact chips row: filter dialog + More sheet
   ===================================================== */

.filter-btn {
  position: relative;
  width: 42px;
  display: grid;
  place-items: center;
  padding: 9px 0;
}

.filter-btn svg {
  width: 16px;
  height: 16px;
}

.filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  animation: badgeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.more-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
}

.more-chip svg {
  width: 14px;
  height: 14px;
}

/* Filter dialog groups */
.sheet-group {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 18px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sheet .filter-chip {
  padding: 10px 16px;
  font-size: 13.5px;
}

/* "More" category grid */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 8px;
}

.cat-grid .city-row {
  justify-content: flex-start;
}

/* =====================================================
   v7 — Messages screen polish
   ===================================================== */

#chat-head {
  padding: 20px 16px 4px;
}

.chat-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title-row h2 {
  font-size: 22px;
  letter-spacing: -0.4px;
}

.enc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.enc-badge svg {
  width: 12px;
  height: 12px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 44px 32px 24px;
  animation: viewIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.empty-art {
  position: relative;
  height: 120px;
  max-width: 240px;
  margin: 0 auto;
}

.empty-bubble {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow:
    0 2px 4px rgba(20, 24, 22, 0.05),
    0 16px 32px -14px rgba(20, 24, 22, 0.25);
  display: grid;
  place-items: center;
  font-size: 27px;
  animation: floaty 3.6s ease-in-out infinite;
}

.empty-bubble.b1 {
  left: 12px;
  top: 34px;
  transform: rotate(-8deg);
}

.empty-bubble.b2 {
  left: 50%;
  margin-left: -31px;
  top: 4px;
  width: 72px;
  height: 72px;
  border-radius: 26px;
  font-size: 32px;
  background: linear-gradient(145deg, #2f9a76, #1f7a5c 70%);
  box-shadow: 0 18px 36px -12px rgba(31, 122, 92, 0.55);
  animation-delay: 0.5s;
  z-index: 1;
}

.empty-bubble.b3 {
  right: 12px;
  top: 44px;
  transform: rotate(8deg);
  animation-delay: 1s;
}

.empty-state h3 {
  font-size: 17.5px;
  letter-spacing: -0.3px;
  margin-top: 20px;
}

.empty-state p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 8px auto 0;
  max-width: 300px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.empty-actions button {
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(20, 24, 22, 0.06);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease;
}

.empty-actions button:active {
  transform: scale(0.94);
  border-color: var(--accent);
}

/* =====================================================
   Mobile gesture polish
   ===================================================== */

.brand-name {
  gap: 0;
}

.loc-pill {
  justify-content: center;
  min-width: 112px;
}

#views {
  touch-action: pan-y;
}

#views.swiping {
  transition: transform 0.12s ease-out;
  transform: translateX(calc(var(--swipe-x, 0px) * 0.18));
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(42px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-42px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#views.page-slide-left .view.active {
  animation: slideFromRight 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#views.page-slide-right .view.active {
  animation: slideFromLeft 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pet-card,
.service-card,
.lost-card,
.chat-card {
  will-change: transform;
}

.pressable {
  position: relative;
  overflow: hidden;
}

.is-pressing {
  transform: scale(0.965) translateY(1px) !important;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.swipe-hint {
  transform: translateX(var(--card-drag-x, 0px)) rotate(calc(var(--card-drag-x, 0px) * 0.015deg)) !important;
  transition: none !important;
}

.tap-ripple {
  position: absolute;
  width: 18px;
  height: 18px;
  left: var(--tap-x, 50%);
  top: var(--tap-y, 50%);
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(31, 122, 92, 0.18);
  animation: tapRipple 0.48s ease-out forwards;
}

@keyframes tapRipple {
  to {
    opacity: 0;
    transform: scale(14);
  }
}

/* Bottom nav: four tabs with a soft glass selection mark */
.tabbar {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)),
    #ffffff;
  border: 1px solid rgba(20, 24, 22, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px -8px rgba(20, 24, 22, 0.18),
    0 26px 50px -18px rgba(20, 24, 22, 0.34);
}

.tab {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: rgba(25, 28, 26, 0.62);
}

.tab::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.88);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(226, 242, 236, 0.52)),
    rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(31, 122, 92, 0.08),
    0 8px 22px -12px rgba(31, 122, 92, 0.55);
  transition:
    opacity 0.26s ease,
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  background: transparent;
  color: var(--accent);
}

.tab.active::before {
  opacity: 1;
  transform: scale(1);
}

/* =====================================================
   v42 — authentic two-pane chat (desktop) / push nav (mobile)
   ===================================================== */

/* Mobile: wrappers are transparent so the flat list/thread layout is unchanged */
.chat-shell,
.chat-sidebar,
.chat-main {
  display: contents;
}

.chat-placeholder {
  display: none;
}

/* Selected conversation highlight */
.chat-card.is-open {
  background: var(--accent-soft);
}

/* ===== Desktop two-pane ===== */
@media (min-width: 760px) {
  /* let the chat fill the viewport; each pane scrolls on its own */
  #views:has(#view-chat.active) {
    overflow: hidden;
    padding-bottom: 0;
  }

  #view-chat.active {
    height: 100%;
    padding: 18px 18px 96px;
    max-width: 1160px;
    margin: 0 auto;
  }

  .chat-shell {
    display: flex;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 24px 60px -30px rgba(20, 24, 22, 0.4);
  }

  .chat-sidebar {
    display: flex;
    flex-direction: column;
    width: 344px;
    min-width: 344px;
    height: 100%;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }

  .chat-sidebar #chat-head {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--line);
  }

  .chat-sidebar #chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 10px 16px;
    display: block;
  }

  /* flatter list rows in the sidebar */
  .chat-sidebar .chat-card {
    box-shadow: none;
    border-radius: 14px;
    padding: 11px;
    margin-bottom: 2px;
    animation: none;
  }

  .chat-sidebar .chat-card:hover {
    background: var(--bg);
  }

  .chat-sidebar .chat-card.is-open {
    background: var(--accent-soft);
  }

  .chat-sidebar .empty-state {
    padding: 40px 20px;
  }

  /* right pane */
  .chat-main {
    display: flex !important;
    flex-direction: column;
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    background:
      radial-gradient(900px 500px at 120% -10%, rgba(31, 122, 92, 0.05), transparent 60%),
      var(--bg);
  }

  #chat-thread {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  #chat-thread .thread-head {
    border-radius: 0;
  }

  #thread-back {
    display: none;
  }

  .chat-main .msgs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 18px 22px 22px;
  }

  /* composer becomes a normal bottom bar of the thread pane */
  .chat-main .chat-composer {
    position: static !important;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none !important;
    width: auto;
    margin: 0;
    padding: 12px 16px;
    gap: 8px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: none;
    animation: none;
  }

  .chat-main .emoji-strip {
    left: 16px;
    bottom: 68px;
  }

  /* placeholder when no conversation is selected */
  .chat-placeholder {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 40px;
    color: var(--ink-soft);
  }

  .chat-placeholder.hidden {
    display: none;
  }

  .cp-badge {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
  }

  .cp-badge svg {
    width: 34px;
    height: 34px;
  }

  .chat-placeholder h3 {
    font-size: 19px;
    letter-spacing: -0.3px;
    color: var(--ink);
  }

  .chat-placeholder p {
    font-size: 13.5px;
    max-width: 300px;
    line-height: 1.5;
  }

  .cp-enc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 7px 14px;
    border-radius: 999px;
  }

  .cp-enc svg {
    width: 12px;
    height: 12px;
  }
}

/* =====================================================
   v43 — tighter, less cluttered My Pets
   ===================================================== */
.care-head { padding: 14px 16px 2px; }
.care-head h2 { font-size: 20px; }
.care-head p { font-size: 12px; }

.care-upnext { padding: 10px 16px 2px; }
.upnext { padding: 14px; border-radius: 18px; }
.upnext-avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }
.upnext-main { gap: 11px; margin-top: 10px; }
.upnext-info strong { font-size: 16px; }
.upnext-info strong svg { width: 16px; height: 16px; }
.upnext-info small { font-size: 12px; }
.upnext-done { width: 44px; height: 44px; }
.upnext-done svg { width: 21px; height: 21px; }
.upnext-then { margin-top: 9px; font-size: 11.5px; }
.upnext-progress { margin-top: 10px; }

#view-care .section-title { padding: 14px 16px 8px; }
#view-care .section-title h2 { font-size: 16px; }

.care-card { padding: 12px; border-radius: 18px; }
.care-avatar { width: 50px; height: 50px; border-radius: 14px; font-size: 24px; }
.care-pet-id h3 { font-size: 15.5px; }
.care-pet-id p { font-size: 12px; }
.health-pill { margin-top: 5px; padding: 3px 8px; }
.care-progress-row { margin-top: 11px; }
.care-tasks { gap: 6px; margin-top: 10px; }

.ctask {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 13px;
}
.ctask-ic { width: 34px; height: 34px; border-radius: 11px; }
.ctask-ic svg { width: 16px; height: 16px; }
.ctask-name { font-size: 13.5px; }
.ctask-sub { font-size: 11px; margin-top: 1px; }
.ctask-sched { font-size: 11.5px; }
.ctask-check { width: 25px; height: 25px; }
.ctask-check svg { width: 13px; height: 13px; }

.care-markall-card { padding: 9px 11px; gap: 10px; border-radius: 13px; margin-top: 6px; }
.mac-ic { width: 32px; height: 32px; border-radius: 10px; }
.mac-ic svg { width: 17px; height: 17px; }
.mac-text strong { font-size: 13px; }
.care-done-toggle { margin-top: 6px; font-size: 11.5px; }

/* =====================================================
   v46 — drawer restructure (grouped, tappable profile)
   ===================================================== */
.drawer-user {
  width: 100%;
  margin: 14px 2px 6px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.drawer-user:active {
  transform: scale(0.98);
  background: #eef0ec;
}

.du-info {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.du-info strong {
  font-size: 14px;
  display: block;
}
.du-info small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.du-loc {
  display: flex !important;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.du-loc svg {
  width: 11px;
  height: 11px;
  color: var(--accent);
  flex-shrink: 0;
}

/* section labels */
.drawer-section-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 13px 12px 4px;
}
.drawer-section-label:first-child {
  padding-top: 4px;
}

/* sign out — distinct danger row */
.drawer-signout {
  margin-top: 12px;
}
.drawer-menu button.drawer-signout,
.drawer-menu button.drawer-signout span:first-of-type {
  color: var(--danger);
}
.drawer-menu button.drawer-signout svg {
  color: var(--danger);
}
.drawer-menu button.drawer-signout:active {
  background: var(--danger-soft);
}

/* consolidated orders sheet */
.orders-seg {
  margin: 14px 0 12px;
}

/* info sheets (help / safety / terms) */
.info-sheet {
  margin: 14px 0 16px;
}
.info-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 11px;
}
.info-steps li {
  font-size: 13.5px;
  line-height: 1.5;
  color: #3c403d;
}
.info-steps b,
.info-list b {
  color: var(--ink);
}
.info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.info-list li {
  font-size: 13.5px;
  line-height: 1.5;
  color: #3c403d;
  padding: 11px 13px;
  background: var(--bg);
  border-radius: 12px;
}
.info-note {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 12px;
}

/* =====================================================
   v47 — 3D card drawer (profile on top, grouped cards)
   ===================================================== */
.drawer {
  background: var(--bg);
  padding: max(14px, env(safe-area-inset-top)) 15px calc(10px + env(safe-area-inset-bottom));
}

.drawer-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px -5px rgba(20, 24, 22, 0.28);
  transition: transform 0.15s ease;
}
.drawer-close:active {
  transform: scale(0.9);
}
.drawer-close svg {
  width: 18px;
  height: 18px;
}

/* Elevated profile card at the top */
.drawer-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  margin-bottom: 6px;
  border-radius: 20px;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(155deg, #ffffff, #eef4f0);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 5px rgba(20, 24, 22, 0.05),
    0 18px 38px -20px rgba(18, 75, 57, 0.45);
  transition: transform 0.15s ease;
}
.drawer-profile:active {
  transform: scale(0.985);
}

.drawer-profile .drawer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 16px;
  box-shadow: 0 8px 18px -8px rgba(31, 122, 92, 0.5);
}

.dp-info {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  padding-right: 4px;
}
.dp-info strong {
  font-size: 15.5px;
  letter-spacing: -0.2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 44px;
}
.dp-info small {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.dp-loc svg {
  width: 11px;
  height: 11px;
  color: var(--accent);
  flex-shrink: 0;
}
.dp-arrow {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 16px;
  height: 16px;
  color: #c4c1b9;
}
.drawer-profile .pill {
  position: absolute;
  top: 13px;
  right: 12px;
}

/* scroll area holds the grouped cards */
.drawer-scroll {
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  margin: 0 -3px;
  padding: 0 3px 20px;
  scrollbar-width: none;
}
.drawer-scroll::-webkit-scrollbar {
  display: none;
}

.drawer-group-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 15px 12px 7px;
}

/* grouped card */
.drawer-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow:
    0 1px 2px rgba(20, 24, 22, 0.04),
    0 12px 26px -18px rgba(20, 24, 22, 0.35);
  overflow: hidden;
  margin-bottom: 6px;
}

.drawer-card button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.15s ease;
}
.drawer-card button + button {
  border-top: 1px solid var(--line);
}
.drawer-card button:active {
  background: var(--bg);
}

/* tinted icon tiles for depth */
.mi {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.mi svg {
  width: 16px;
  height: 16px;
}
.mi-green { background: var(--accent-soft); color: var(--accent); }
.mi-red { background: var(--danger-soft); color: var(--danger); }
.mi-amber { background: #fdf3e0; color: #a06008; }
.mi-blue { background: #e8edff; color: #4859a8; }
.mi-teal { background: #d9f2ec; color: #0f766e; }
.mi-gray { background: #ecebe6; color: #6b7069; }

.mi-label {
  flex: 1;
  min-width: 0;
}
.mi-arrow {
  width: 16px;
  height: 16px;
  color: #c7c4bc;
  flex-shrink: 0;
}

.drawer-signout .mi-label {
  color: var(--danger);
}

.drawer-foot {
  border-top: 0;
  padding: 16px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* =====================================================
   v49 — fix intermittent taps: native double-tap-zoom off
   without cancelling clicks (replaces the touchend hack)
   ===================================================== */
html,
body,
#app {
  touch-action: manipulation;
}
button,
.tab,
a,
label,
input,
select,
textarea,
[data-menu],
[role="button"] {
  touch-action: manipulation;
}

/* =====================================================
   v50 — cute iOS selects, age year/month picker, lost nearby filters
   ===================================================== */
.cute-select {
  position: relative;
}
.cute-select select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 46px;
  padding: 0 34px 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.cute-select select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cute-select > svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  pointer-events: none;
}

/* year / month age picker */
.age-field {
  display: flex;
  gap: 8px;
}
.age-field .cute-select {
  flex: 1;
}
.age-field .cute-select:first-child {
  flex: 0 0 62px;
}
.age-field .cute-select:first-child select {
  padding: 0 22px 0 11px;
}
.age-field .cute-select:first-child > svg {
  right: 7px;
}
.age-field .cute-select:last-child select {
  padding-right: 28px;
}
.age-field .cute-select:last-child > svg {
  right: 9px;
}

/* Lost & Found cute filters */
.lost-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 4px 16px 6px;
  align-items: stretch;
}
.lost-filters .searchbar {
  height: 46px;
}
.lost-filters .filter-row {
  padding: 0;
}
.lost-type-select {
  flex-shrink: 0;
}
.lost-type-select select {
  height: 38px;
  padding: 0 30px 0 13px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
}
.lost-type-select > svg {
  right: 10px;
  width: 14px;
  height: 14px;
}
.lost-dist {
  color: var(--accent);
  font-weight: 800;
}

/* =====================================================
   v56 — age weeks, "completed at" time picker, lost polish
   ===================================================== */

/* care confirm — editable "Completed at" time */
.cc-time-pick {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border-radius: 14px;
  padding: 11px;
  display: block;
  text-align: left;
  cursor: pointer;
}
.cc-time-pick span {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cc-time-pick input[type="time"] {
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  padding: 2px 0 0;
  width: 100%;
  outline: none;
}
.cc-note-line {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  margin: -6px 0 14px;
}

/* Lost — tighter gap under the filters + sweeter single search box */
.lost-filters {
  gap: 9px;
  padding: 2px 16px 8px;
}
.lost-filters .searchbar {
  height: 48px;
  border-radius: 16px;
  box-shadow: 0 3px 12px -4px rgba(20, 24, 22, 0.12);
}
.lost-filters .searchbar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lost-filter-row {
  scrollbar-width: none;
  padding-bottom: 0;
}
.lost-filter-row::-webkit-scrollbar {
  display: none;
}
#lost-list {
  padding-top: 0;
}

/* search inputs must be borderless so the searchbar is a single clean box */
.searchbar input {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

/* =====================================================
   v57 — tighter gap between Lost hero and "Recent alerts"
   ===================================================== */
#view-lost .lost-hero {
  margin-bottom: 6px;
}
#view-lost .section-title {
  padding-top: 8px;
}

/* ---------- Contact reveal + offline outbox ---------- */
.ticks.queued {
  letter-spacing: 0;
  opacity: 0.85;
}
.owner-contact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}
.owner-contact i {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.owner-contact small {
  font-weight: 500;
  color: var(--ink-soft);
}
.owner-contact.call {
  color: var(--accent);
  text-decoration: none;
}
.owner-contact.shown {
  color: var(--accent);
}
.owner-contact.hidden,
.owner-contact.locked,
.owner-contact.muted {
  color: var(--ink-soft);
  font-weight: 500;
}
.service-call {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.service-call i {
  width: 13px;
  height: 13px;
  stroke-width: 2.3;
}

/* Profile editor: account type + reveal toggle */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.seg-toggle {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg);
  border: 1.5px solid var(--line);
}
.seg-toggle .seg {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg-toggle .seg i {
  width: 15px;
  height: 15px;
}
.seg-toggle .seg.on {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.reveal-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
.reveal-toggle.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.reveal-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reveal-text strong {
  font-size: 13.5px;
  color: var(--ink);
}
.reveal-text small {
  font-size: 11.5px;
  color: var(--ink-soft);
}
.reveal-switch {
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.18s;
}
.reveal-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s;
}
.reveal-switch i {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 13px;
  height: 13px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1;
}
.reveal-toggle.on .reveal-switch {
  background: var(--accent);
}
.reveal-toggle.on .reveal-switch::after {
  transform: translateX(16px);
}
.reveal-toggle.on .reveal-switch i {
  opacity: 1;
}

/* ============ Activity page (requests & bookings, stepped) ============ */
.pill-done {
  background: var(--accent);
  color: #fff;
}
.activity-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.activity-open-btn i {
  width: 15px;
  height: 15px;
}

.activity-page {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  visibility: hidden;
}
.activity-page.open {
  transform: translateY(0);
  visibility: visible;
}
.activity-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 18px 16px;
  background: var(--accent);
  color: #fff;
}
.activity-back {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.activity-back i {
  width: 20px;
  height: 20px;
}
.activity-head-text h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}
.activity-head-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  opacity: 0.85;
}
.activity-seg {
  display: flex;
  gap: 6px;
  padding: 12px 14px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}
.aseg {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 4px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.aseg i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.aseg.active {
  background: var(--accent);
  color: #fff;
}
.aseg-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.aseg.active .aseg-count {
  background: rgba(255, 255, 255, 0.25);
}
.aseg-count.hidden {
  display: none;
}
.activity-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activity-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 6px 18px rgba(18, 75, 57, 0.05);
  animation: acRise 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes acRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.ac-top {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}
.ac-emoji {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 21px;
}
.ac-headtext {
  flex: 1;
  min-width: 0;
}
.ac-headtext h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-headtext p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ----- the cool stepper ----- */
.stepper {
  display: flex;
  align-items: flex-start;
  padding: 2px 4px 4px;
}
.step {
  flex: 0 0 auto;
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}
.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  transition: all 0.2s;
}
.step-dot i {
  width: 15px;
  height: 15px;
  stroke-width: 3;
}
.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.2;
}
.step.done .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.step.done .step-label {
  color: var(--ink);
}
.step.current .step-dot {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: stepPulse 1.8s ease-in-out infinite;
}
.step.current .step-label {
  color: var(--accent);
  font-weight: 700;
}
@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50% { box-shadow: 0 0 0 7px rgba(31, 122, 92, 0.12); }
}
.step-line {
  flex: 1 1 auto;
  height: 3px;
  margin-top: 13.5px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.25s;
}
.step-line.fill {
  background: var(--accent);
}

.ac-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.act-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 10px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.act-btn i {
  width: 15px;
  height: 15px;
}
.act-btn.ghost {
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.activity-empty {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
}
.ae-emoji {
  font-size: 44px;
}
.activity-empty strong {
  font-size: 16px;
  color: var(--ink);
}
.activity-empty small {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 260px;
  line-height: 1.5;
}

/* ============ Public profile page ============ */
.owner-row.tappable {
  cursor: pointer;
  gap: 10px;
}
.owner-row .owner-main {
  flex: 1;
  min-width: 0;
}
.owner-chevron {
  align-self: center;
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.profile-page {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  visibility: hidden;
  overflow-y: auto;
}
.profile-page.open {
  transform: translateY(0);
  visibility: visible;
}
.profile-hero {
  position: relative;
  overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) 20px 42px;
  background: linear-gradient(150deg, #2f9a76, var(--accent) 65%, #124b39);
  color: #fff;
  text-align: center;
}
/* Faint paw watermark scattered across the hero. */
.profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128' viewBox='0 0 128 128'%3E%3Cg fill='%23ffffff' fill-opacity='0.07'%3E%3Cellipse cx='64' cy='78' rx='19' ry='15'/%3E%3Ccircle cx='42' cy='52' r='7.5'/%3E%3Ccircle cx='62' cy='44' r='7.5'/%3E%3Ccircle cx='82' cy='48' r='7.5'/%3E%3Ccircle cx='96' cy='66' r='6.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 118px 118px;
  pointer-events: none;
}
.profile-hero .activity-back {
  position: absolute;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
}
.profile-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}
.profile-avatar-lg {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.55);
  font-size: 34px;
  font-weight: 800;
  color: #fff;
}
.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-av-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.profile-paw {
  position: absolute;
  right: 0;
  bottom: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.profile-paw i {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
  font-weight: 600;
}
.profile-chip i {
  width: 15px;
  height: 15px;
}
.profile-chip b {
  font-weight: 800;
}
.profile-hero-inner h2 {
  font-size: 21px;
  font-weight: 800;
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-you {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}
.profile-bio {
  margin: 2px 0 0;
  font-size: 13.5px;
  opacity: 0.92;
  max-width: 300px;
  line-height: 1.5;
}
.profile-stats {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.92;
}
.profile-stats b {
  font-weight: 800;
}
.profile-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.profile-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.profile-action i {
  width: 16px;
  height: 16px;
}
.profile-action.ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
}
.profile-body {
  position: relative;
  z-index: 1;
  margin-top: -20px;
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  padding: 24px 14px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.profile-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-section h3 i {
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.pl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  margin-bottom: 8px;
}
.pl-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 11px;
  background-size: cover;
  background-position: center;
  background-color: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.pl-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pl-info strong {
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-info small {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-right {
  flex-shrink: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent);
}

/* Report sheet */
.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.report-reason {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.report-reason i {
  width: 17px;
  height: 17px;
  color: var(--ink-soft);
}
.report-reason:active {
  background: var(--bg);
}

/* ============ Chat list: search + activity highlights ============ */
.chat-h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 2px 4px 10px;
}
.chat-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.chat-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--line);
}
.chat-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.chat-search i {
  width: 17px;
  height: 17px;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.chat-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
}
.chat-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.chat-search-row .activity-open-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
}

.chat-highlight {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  font-size: 12.5px;
  font-weight: 600;
}
.chat-highlight.hot {
  color: var(--accent);
}
.chat-highlight.warn {
  color: #a06008;
}
.chat-highlight.ok {
  color: var(--ink-soft);
}
.chat-highlight.muted {
  color: var(--ink-soft);
  font-weight: 500;
}
.hl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============ Chat / message delete menu ============ */
.chat-menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
/* Rich option cards: circular tinted icon + title/subtitle + chevron. */
.opt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
.opt-card:active {
  background: var(--bg);
}
.opt-ic {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.opt-ic i {
  width: 22px;
  height: 22px;
}
.opt-ic.ok {
  background: var(--accent-soft);
}
.opt-ic.ok i {
  color: var(--accent);
}
.opt-ic.bad {
  background: var(--danger-soft);
}
.opt-ic.bad i {
  color: var(--danger);
}
.opt-tx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.opt-tx b {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.opt-tx small {
  font-size: 13px;
  color: var(--ink-soft);
}
.opt-card.danger .opt-tx b {
  color: var(--danger);
}
.opt-chev {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--ink-soft);
}
.chat-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.chat-menu-item i {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
}
.chat-menu-item.danger {
  color: var(--danger);
}
.chat-menu-item.danger i {
  color: var(--danger);
}
.chat-menu-item:active {
  background: var(--bg);
}
/* long-press affordance */
.msg {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ============ Mute indicators ============ */
.chat-menu-item.ok {
  color: var(--accent);
}
.chat-menu-item.ok i {
  color: var(--accent);
}
.chat-muted-ic {
  width: 13px;
  height: 13px;
  color: var(--ink-soft);
  vertical-align: -2px;
  margin-right: 4px;
}
.presence-mute {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  margin-right: 2px;
}
.menu-badge-text {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #a06008;
  background: #fdf3e0;
  padding: 2px 8px;
  border-radius: 999px;
}
.menu-badge-text.hidden {
  display: none;
}

/* ============ Message reactions ============ */
/* ---------- Contextual message menu (long-press) ---------- */
.ctx-menu-root {
  position: fixed;
  inset: 0;
  z-index: 75;
}
.ctx-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 22, 0.32);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.ctx-menu-root.show .ctx-backdrop { opacity: 1; }
.ctx-reactions,
.ctx-actions {
  position: fixed;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1.3, 0.5, 1);
}
.ctx-menu-root.show .ctx-reactions,
.ctx-menu-root.show .ctx-actions {
  opacity: 1;
  transform: scale(1);
}
.ctx-reactions {
  display: flex;
  gap: 2px;
  padding: 5px 7px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.32);
  transform-origin: bottom center;
}
.ctx-reactions .react-emoji { font-size: 25px; padding: 5px; }
.ctx-actions {
  min-width: 218px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(232, 230, 224, 0.9);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 18px 42px -14px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px) saturate(1.15);
  transform-origin: top center;
  overflow: hidden;
}
.ctx-actions .chat-menu-item {
  width: 100%;
  min-height: 58px;
  padding: 0 17px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  box-shadow: none;
}
.ctx-actions .chat-menu-item + .chat-menu-item {
  border-top: 1px solid rgba(25, 28, 26, 0.08);
}
.ctx-actions .chat-menu-item i {
  width: 21px;
  height: 21px;
}
.ctx-actions .chat-menu-item:active {
  background: rgba(31, 122, 92, 0.08);
}
.ctx-actions .chat-menu-item.danger:active {
  background: rgba(217, 79, 61, 0.08);
}

.react-bar {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 4px 6px 12px;
}
.react-emoji {
  font-size: 27px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: transform 0.12s ease, background 0.12s;
}
.react-emoji:active {
  transform: scale(1.25);
}
.react-emoji.on {
  background: var(--accent-soft);
  transform: scale(1.12);
}
.msg.has-react {
  margin-bottom: 13px;
}
.msg-react {
  position: absolute;
  bottom: -11px;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 5px 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  animation: reactPop 0.25s cubic-bezier(0.22, 1.4, 0.5, 1) both;
}
@keyframes reactPop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
.msg.me .msg-react {
  left: 8px;
}
.msg.them .msg-react {
  right: 8px;
}

/* ============ Sweet, small message receipt ticks ============ */
.msg time .tick {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
  margin-left: 3px;
  vertical-align: -3px;
  opacity: 0.7;
}
.msg time .tick.read {
  color: #7df0c0;
  opacity: 1;
}
.msg time .tick[data-lucide="clock"] {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
}

/* ============ Listing status (sold / paused) ============ */
.badge.sold {
  background: #191c1a;
  color: #fff;
}
.badge.paused {
  background: #6b7069;
  color: #fff;
}
.pet-card.is-sold .pet-photo::after,
.pet-card.is-paused .pet-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(246, 245, 242, 0.45);
}
.pet-card.is-sold .pet-body,
.pet-card.is-paused .pet-body {
  opacity: 0.72;
}
.primary-btn.manage {
  background: var(--ink);
}

/* ============ Chat gallery/attach button — clearly visible ============ */
#composer-attach.comp-btn {
  background: var(--accent-soft);
  border-color: transparent;
}
#composer-attach.comp-btn svg {
  color: var(--accent);
  stroke-width: 2.3;
  width: 21px;
  height: 21px;
}
#composer-attach.comp-btn:disabled {
  opacity: 0.5;
}

/* ============ Chat: tappable peer header + online presence ============ */
.thread-peer {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.thread-peer .thread-title {
  min-width: 0;
}
.thread-peer .thread-title strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.chat-avatar {
  position: relative;
}
/* Presence dot sits on a non-clipping wrapper (the avatar itself is
   overflow:hidden, which used to clip the dot). Corner-anchored, no overlap. */
.chat-av-wrap {
  position: relative;
  flex-shrink: 0;
}
.online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #2ec07a;
  border: 3px solid var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  z-index: 2;
}
.presence-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ec07a;
  margin-right: 5px;
  vertical-align: 1px;
}
.presence-dot.off {
  background: var(--ink-soft);
}

/* ===================== Listing detail page ===================== */
.pet-page {
  position: fixed;
  inset: 0;
  z-index: 46;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}
.pet-page.open {
  transform: none;
  visibility: visible;
}
.pet-page-top {
  display: flex;
  align-items: center;
  gap: 6px;
  /* Match the system status/notification bar (#f6f5f2) so there's no white
     seam, and keep the row compact so its contents sit centered. */
  padding: max(2px, env(safe-area-inset-top)) 8px 8px;
  background: var(--bg);
}
/* Flat, minimal controls — plain back arrow + name, no rounded "app" chrome. */
.pet-top-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.pet-top-icon i {
  width: 25px;
  height: 25px;
}
.pet-top-name {
  flex: 1;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
}
.pet-page-top #pet-bell {
  margin-left: auto;
  flex: 0 0 auto;
}
.pet-page-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Swipeable gallery */
.pet-gallery {
  position: relative;
  background: #0d0d0d;
}
.pet-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pet-carousel::-webkit-scrollbar {
  display: none;
}
.pet-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 4 / 3;
}
.pet-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pet-slide-ph {
  display: grid;
  place-items: center;
}
.pet-slide-ph .ph-emoji {
  font-size: 74px;
}
.pet-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
}
.pet-badge.sold {
  background: var(--ink-soft);
}
.pet-fav {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  border: none;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.pet-fav i {
  width: 22px;
  height: 22px;
  color: var(--ink-soft);
}
.pet-fav.on i {
  color: var(--danger);
  fill: var(--danger);
}
.pet-counter {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
}
.pet-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.pet-thumbs::-webkit-scrollbar {
  display: none;
}
.pet-thumb {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--surface);
  padding: 0;
  cursor: pointer;
}
.pet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pet-thumb.active {
  border-color: var(--accent);
}

/* Detail body */
.pet-detail {
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pet-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pet-headline h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pet-verified {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.pet-price {
  font-size: 21px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}
.pet-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.pet-meta-i {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pet-meta-i i {
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.pet-meta-dot {
  opacity: 0.5;
}
.pet-desc {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}

/* Attribute grid */
.pet-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}
.pfact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.pfact > i {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}
.pfact-tx {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pfact-tx b {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pfact-tx small {
  font-size: 12px;
  color: var(--ink-soft);
}
.pfact.warn > i,
.pfact.warn .pfact-tx b {
  color: #d98a1f;
}
.pet-report-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
}
.pet-report-link i {
  width: 15px;
  height: 15px;
}

/* Sticky action bar */
.pet-page-cta {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.pet-page-cta .primary-btn {
  width: 100%;
}

/* Unblock pill in the blocked-accounts sheet */
.pill-btn {
  margin-left: auto;
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* ===== Reply banner (above composer) ===== */
.reply-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: 12px 12px 0 0;
  border-left: 3px solid var(--accent);
}
.reply-bar-line {
  display: none;
}
.reply-snippet {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-snippet::before {
  content: "Replying to: ";
  color: var(--accent);
  font-weight: 700;
}
.reply-cancel {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px 4px;
}

/* Compact long-press menu: Reply + Delete side by side */
.chat-menu.compact {
  flex-direction: row;
  gap: 10px;
}
.chat-menu.compact .chat-menu-item {
  flex: 1;
  justify-content: center;
}

/* ===== Full-screen photo viewer ===== */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 10, 9, 0.94);
  display: flex;
  flex-direction: column;
}
.iv-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  color: #fff;
}
.iv-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.iv-title {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.9;
}
.iv-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 12px;
}
.iv-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.iv-bottom {
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}
.iv-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
}
.iv-save i {
  width: 18px;
  height: 18px;
}

/* Jump-to-newest floating button (chat thread) */
#scroll-bottom-btn {
  position: fixed;
  right: 16px;
  bottom: calc(76px + var(--safe-bottom));
  height: 40px;
  min-width: 42px;
  padding: 0 13px;
  gap: 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  z-index: 26;
  cursor: pointer;
}
#scroll-bottom-btn i {
  width: 17px;
  height: 17px;
}
#scroll-bottom-btn.hidden {
  display: none;
}

/* Country & currency picker */
.country-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 62vh;
  overflow-y: auto;
}
.country-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.country-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.country-row .cflag { font-size: 20px; }
.country-row .cname { flex: 1; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.country-row .ccur { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.country-row i { width: 18px; height: 18px; color: var(--accent); }

/* My Pets tab segments (Care / My Listings / Lost) */
.care-seg {
  display: flex;
  gap: 3px;
  width: calc(100% - 32px);
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin: 2px 16px 12px;
}
.cseg {
  flex: 1 1 0;
  min-width: 0; /* allow equal shrink so the row never overflows the screen */
  padding: 6px 6px;
  border: none;
  background: none;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.cseg.active {
  background: var(--accent);
  color: #fff;
}

/* Smooth content transition when switching segments */
@keyframes segFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Create button at the top of the Selling / Lost segments */
.seg-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  margin-bottom: 10px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.seg-cta i {
  width: 16px;
  height: 16px;
}
/* Tighter, sweeter listing rows in the My Pets segments */
#care-alt {
  gap: 6px;
}
#care-alt .pl-row {
  margin-bottom: 0;
  padding: 8px 10px;
}
#care-alt .pl-thumb {
  width: 42px;
  height: 42px;
}

/* Directional message entrances — only new bubbles animate (JS gates it) */
@keyframes msgInMe {
  from { opacity: 0; transform: translateX(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes msgInThem {
  from { opacity: 0; transform: translateX(-14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.msg.me { animation: msgInMe 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; }
.msg.them { animation: msgInThem 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; }

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
