/* Zoono: layout and app-level components on top of the design system
   (static ds/tokens.css and ds-components/zoono.css, served from
   ../Zoono Branding/design-system). Classes without the z- prefix are app-only.
   Carried over from the prototype (Zoono App/public/css/app.css); the Django
   additions are at the end. */


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--z-bg-page); color: var(--z-text-primary);
  font: var(--z-type-body);
}
:lang(ar) body, body:lang(ar) { font: var(--z-type-body); }
a { color: var(--z-text-brand); }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
h1:focus { outline: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50; background: var(--z-bg-surface); padding: 8px 12px; border-radius: var(--z-radius-md); }
.skip-link:focus { top: 8px; }
.stack { display: grid; gap: var(--z-space-4); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--z-text-brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- Shell ---------- */
.app-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--z-bg-page) 88%, transparent); backdrop-filter: blur(10px); }
.app-header__inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: var(--z-space-4); padding: 8px 16px; min-height: 60px; }
.app-header__nav { display: none; gap: 4px; margin-inline-start: var(--z-space-6); }
.app-header__link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--z-radius-pill);
  color: var(--z-text-secondary); text-decoration: none; font: var(--z-type-label);
}
.app-header__link:hover { background: var(--z-bg-sunken); color: var(--z-text-primary); }
.app-header__link[aria-current="page"] { background: var(--z-bg-surface); color: var(--z-text-brand); }
.app-header__link:focus-visible, .app-header__me:focus-visible, .wordmark:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; }
.app-header__me { margin-inline-start: auto; border-radius: 12px; text-decoration: none; }
.app-header__me[aria-current="page"] .z-avatar { box-shadow: 0 0 0 2px var(--z-bg-page), 0 0 0 4px var(--z-brand); }

.wordmark { display: inline-flex; border-radius: 8px; }
.wordmark img { display: block; height: 28px; width: auto; }
/* Logo lockup with the tagline: the dark version has a Sand tagline. */
.logo-lockup { display: block; height: 72px; width: auto; }
.logo-lockup--dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-lockup--light { display: none; }
  :root:not([data-theme="light"]) .logo-lockup--dark { display: block; }
}
[data-theme="dark"] .logo-lockup--light { display: none; }
[data-theme="dark"] .logo-lockup--dark { display: block; }

.app-main { margin: 0 auto; padding: 16px 16px 40px; }
.app-main--narrow { max-width: 680px; }   /* focused flows: intake, sending, a conversation */
.app-main--default { max-width: 960px; }  /* lists and dashboards: home, requests, messages, leads, account */
.app-main--wide { max-width: 1080px; }    /* side-by-side layouts: matches, profiles */
.app-main.app-main--full { max-width: none; padding: 0; }
.app-main--tabs { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.app-tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; }
.app-tabbar--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-tabbar--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-tabbar--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 860px) {
  .app-header__nav { display: flex; }
  .app-tabbar { display: none; }
  .app-main--tabs { padding-bottom: 64px; }
  .app-main { padding-top: 24px; }
}

.app-toast { position: fixed; inset-inline: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.app-toast .z-toast { pointer-events: auto; max-width: 480px; }
@media (min-width: 860px) { .app-toast { bottom: 24px; } }

.page-head { display: flex; align-items: flex-start; gap: var(--z-space-2); margin: 4px 0 var(--z-space-5); }
.page-head__back { margin-inline-start: -10px; margin-top: -6px; }
.page-head__text { flex: 1; min-width: 0; display: grid; gap: var(--z-space-2); }
.page-head__text .z-body { max-width: 60ch; }
.back-link { margin-inline-start: -12px; margin-bottom: var(--z-space-3); }

.section { display: grid; gap: var(--z-space-3); margin-top: var(--z-space-6); }

.empty { display: grid; justify-items: center; text-align: center; gap: var(--z-space-4); padding: 48px 16px; color: var(--z-text-secondary); }
.empty .z-body-lg { max-width: 42ch; color: var(--z-text-primary); }
.empty__actions { display: flex; gap: var(--z-space-2); flex-wrap: wrap; justify-content: center; }
.empty-inline { padding: 16px 4px; }

/* ---------- Dialog (DS candidate: responsive sheet/dialog) ---------- */
.app-dialog {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92dvh;
  background: transparent; color: var(--z-text-primary); overflow: visible;
}
.app-dialog::backdrop { background: rgb(26 26 26 / 0.5); }
.app-dialog__panel {
  background: var(--z-bg-surface); border-radius: var(--z-radius-xl) var(--z-radius-xl) 0 0; box-shadow: var(--z-shadow-raised);
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto;
  display: grid; gap: var(--z-space-3); animation: sheet-in var(--z-duration-base) var(--z-ease);
}
.app-dialog__panel > .z-actions { margin-top: var(--z-space-2); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 600px) {
  .app-dialog { margin: auto; max-width: 440px; }
  .app-dialog__panel { border-radius: var(--z-radius-xl); padding: 24px; }
  .app-dialog__panel .z-sheet__handle { display: none; }
}
@media (prefers-reduced-motion: reduce) { .app-dialog__panel { animation: none; } }
.dialog-note { display: flex; gap: 6px; align-items: flex-start; }
.dialog-note .z-icon { margin-top: 1px; }
.z-list--inset { border: 1px solid var(--z-border); }
.other-account summary { list-style: none; width: fit-content; }
.other-account summary::-webkit-details-marker { display: none; }
.other-account[open] summary { margin-bottom: var(--z-space-3); }

/* ---------- Sign-in ---------- */
.signin { min-height: 100dvh; display: grid; grid-template-rows: minmax(220px, 38dvh) auto; }
.signin__art { position: relative; overflow: hidden; background: var(--z-brand); container-type: size; }
.zoo-cluster { position: absolute; inset: 0; }
.zoo-slot {
  position: absolute; left: var(--x); top: var(--y);
  width: calc(var(--s) * 1cqmin); height: calc(var(--s) * 1cqmin);
  translate: -50% -50%; rotate: var(--r);
  animation: z-pop 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--i) * 70ms);
}
.zoo-slot .zoo-art { width: 100%; height: 100%; animation: zoo-drift calc(7s + var(--i) * 0.9s) ease-in-out calc(var(--i) * -1.3s) infinite alternate; }
@keyframes zoo-drift { from { transform: translate(0, 0) rotate(0); } to { transform: translate(2.5cqmin, -3cqmin) rotate(7deg); } }
.zoo-slot--more { display: none; }
@container (min-height: 520px) { .zoo-slot--more { display: block; } }
[dir="rtl"] .zoo-cluster { scale: -1 1; }
@media (prefers-reduced-motion: reduce) { .zoo-slot, .zoo-slot .zoo-art { animation: none; } }
.signin__body { display: grid; gap: var(--z-space-4); align-content: start; padding: 28px 20px 40px; max-width: 520px; width: 100%; margin: 0 auto; }
.signin__mark { margin: 0; }
.signin .z-display { font-size: clamp(30px, 8vw, 44px); line-height: 1.12; }
.signin .z-display:lang(ar) { line-height: 1.4; }
.signin__actions { display: grid; gap: var(--z-space-4); margin-top: var(--z-space-3); }
.signin__actions form { margin: 0; }
.signin__note { color: var(--z-text-secondary); text-align: center; }
.google-g { width: 20px; height: 20px; }
.signin__pro { color: var(--z-text-secondary); text-align: center; }
@media (min-width: 900px) {
  .signin { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .signin__body { align-content: center; padding: 48px; }
}

/* ---------- Home ---------- */
.home-hello { max-width: 22ch; margin: 8px 0 var(--z-space-4); }
.search__box { min-height: 52px; border-radius: var(--z-radius-pill); padding-inline-start: 6px; }
.search__results { margin-top: var(--z-space-3); }
/* Popular tiles: flat white cards, name and section on top, one Zoonie
   peeking from the bottom corner (the bottom padding keeps text clear of it).
   Accents decorate; purple stays the action color (DS 2.2). */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--z-space-2); }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; align-content: start; gap: 4px; min-height: 104px; padding: 14px 16px 44px;
  border-radius: var(--z-radius-lg); text-decoration: none;
  background: var(--z-bg-surface); color: var(--z-text-primary);
  transition: transform var(--z-duration-fast) var(--z-ease);
}
.tile:hover { transform: translateY(-2px); }
.tile:hover .tile__blob { transform: rotate(-10deg) scale(1.1); }
.tile:active { transform: scale(0.98); }
.tile:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; }
.tile__name { font: var(--z-type-title-3); }
.tile__meta { font: var(--z-type-caption); color: var(--z-text-secondary); }
.tile__blob {
  position: absolute; z-index: -1; width: 62px; height: 62px; inset-block-end: -10px; inset-inline-end: -10px;
  transform-origin: 70% 70%;
  transition: transform var(--z-duration-base) var(--z-ease);
}

.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding: 3px; margin: -3px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.more-btn { margin-top: var(--z-space-3); }

/* ---------- Intake flow ---------- */
.flow { display: grid; gap: var(--z-space-3); min-height: calc(100dvh - 56px); grid-template-rows: auto auto 1fr; }
.flow__top { display: flex; align-items: center; gap: var(--z-space-2); margin-inline-start: -10px; }
.flow__meta { display: grid; }
.flow__body { display: grid; grid-template-rows: 1fr auto; gap: var(--z-space-5); }
.flow__fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: var(--z-space-3); align-content: start; padding-top: var(--z-space-3); }
.flow__legend { padding: 0; float: left; width: 100%; }
.flow__legend + * { clear: both; }
.flow__sub { margin-top: -4px; margin-bottom: var(--z-space-2); }
.flow__bar {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: var(--z-space-2);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--z-bg-page);
  border-top: 1px solid var(--z-border); margin-inline: -16px; padding-inline: 16px;
}
.flow__bar .z-btn--primary { min-width: 160px; }
.flow__bar { align-items: center; }
/* Keyboard hint, only where there's a keyboard and room for it. */
.flow__keys { display: none; color: var(--z-text-secondary); margin-inline-start: auto; }
@media (min-width: 860px) and (hover: hover) { .flow__keys { display: block; } }
/* Phones: Back and Next pinned at the bottom, under the thumb. Desktop: right
   under the answers, where the eye already is. */
@media (min-width: 860px) {
  .flow__body { grid-template-rows: auto auto; align-content: start; }
  .flow__bar { position: static; border-top: 0; padding-top: var(--z-space-2); }
}
.reveal { animation: reveal var(--z-duration-base) var(--z-ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* Filterable choice list (DS candidate: combobox). */
.filter-list { display: grid; gap: var(--z-space-3); }
.filter-list__options { max-height: min(52dvh, 460px); overflow-y: auto; padding: 18px 14px 4px 4px; padding-inline: 4px 14px; margin: -14px -4px 0; }
.filter-list .z-choice { min-height: 50px; padding-block: 10px; }

.summary { margin: 0; background: var(--z-bg-surface); border-radius: var(--z-radius-lg); padding: 4px 16px; }
.summary__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; }
.summary__row + .summary__row { border-top: 1px solid var(--z-border); }
.summary dt { font: var(--z-type-caption); color: var(--z-text-secondary); grid-column: 1; }
.summary dd { margin: 0; font: var(--z-type-body-lg); grid-column: 1; overflow-wrap: anywhere; }
.summary__edit { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: var(--z-type-label); }
.privacy-line { display: flex; gap: 6px; align-items: center; color: var(--z-text-secondary); margin-top: var(--z-space-3); }

.finding { min-height: 70dvh; display: grid; place-content: center; justify-items: center; gap: var(--z-space-5); text-align: center; padding: 24px; }
.finding__burst svg { width: 96px; height: 96px; stroke: var(--z-accent-orange); fill: none; transform: scaleX(var(--z-flip)); }
.finding__burst path { animation: burst 900ms var(--z-ease) infinite alternate; transform-origin: 15px 15px; }
.finding__burst path:nth-child(2) { animation-delay: 150ms; }
.finding__burst path:nth-child(3) { animation-delay: 300ms; }
@keyframes burst { from { opacity: 0.25; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .finding__burst path { animation: none; } }

/* ---------- Matches ---------- */
.matches { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--z-space-3); }
@media (min-width: 860px) { .matches { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.match {
  position: relative; display: grid; gap: var(--z-space-3); padding: var(--z-space-4);
  background: var(--z-bg-surface); border: 1.5px solid transparent; border-radius: var(--z-radius-lg);
  transition: border-color var(--z-duration-fast) var(--z-ease);
}
.match.is-picked { border-color: var(--z-brand); }
.match::after {
  content: ""; position: absolute; top: -18px; inset-inline-end: -13px; width: 36px; height: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cg stroke='%23FF6B3D' stroke-width='4.2' stroke-linecap='round'%3E%3Cpath d='M6 15 2.5 8'/%3E%3Cpath d='M13.5 11 15 3'/%3E%3Cpath d='M19 18.5l7.5-3.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0; transform: scaleX(var(--z-flip)) scale(0.3) rotate(-25deg); transition: opacity var(--z-duration-fast), transform 260ms cubic-bezier(0.3, 1.6, 0.5, 1);
}
.match.is-picked::after { opacity: 1; transform: scaleX(var(--z-flip)); }
.match__head { display: flex; gap: var(--z-space-3); align-items: flex-start; }
.match__who { display: grid; gap: 4px; min-width: 0; }
.match__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.match__why { color: var(--z-text-secondary); }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reasons li { display: flex; gap: 8px; align-items: flex-start; font: var(--z-type-body); }
.reasons .z-icon { margin-top: 3px; color: var(--z-success); }
.reasons li:nth-child(n+2) .z-icon { color: var(--z-text-secondary); }
.reasons__miss { color: var(--z-text-secondary); }
.match__actions { display: flex; gap: var(--z-space-2); align-items: center; justify-content: space-between; margin-top: var(--z-space-1); }
.pick {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--z-size-control-md); padding: 0 16px;
  border: 1.5px solid var(--z-border-strong); border-radius: var(--z-radius-pill); cursor: pointer; font: var(--z-type-label);
}
.pick:has(:checked) { background: var(--z-brand-subtle); border-color: var(--z-brand); color: var(--z-text-brand); }
.pick:has(:focus-visible) { outline: 3px solid var(--z-focus); outline-offset: 2px; }
.pick .z-control:focus-visible { outline: none; }
.match__done .z-icon { width: 14px; height: 14px; }

/* Sticky action bar above the tab bar (DS candidate). */
.action-bar { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 10; margin: var(--z-space-5) -16px 0; padding: 12px 16px; background: var(--z-bg-page); border-top: 1px solid var(--z-border); }
.action-bar__inner { display: flex; align-items: center; justify-content: flex-end; gap: var(--z-space-3); max-width: 1080px; margin: 0 auto; }
.action-bar__inner .z-btn--lg { flex: 1 1 auto; max-width: 360px; }
.action-bar .z-avatar-stack:empty { display: none; }
@media (min-width: 860px) { .action-bar { bottom: 0; margin-inline: 0; border-radius: var(--z-radius-lg) var(--z-radius-lg) 0 0; } }

/* ---------- Profile ---------- */
.profile { display: grid; gap: var(--z-space-3); }
@media (min-width: 860px) { .profile { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } .profile__side { position: sticky; top: 76px; } }
.profile__main { display: grid; gap: var(--z-space-3); }
.profile__card { display: grid; justify-items: center; text-align: center; gap: var(--z-space-2); padding: var(--z-space-6) var(--z-space-4); }
.profile__card .z-title-1 { margin-top: var(--z-space-2); }
.profile__rating { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.profile__card .z-btn { margin-top: var(--z-space-3); }
.facts { list-style: none; margin: var(--z-space-3) 0 0; padding: 0; display: grid; gap: 10px; text-align: start; width: 100%; }
.facts li { display: flex; gap: 10px; align-items: flex-start; font: var(--z-type-body); }
.facts .z-icon { margin-top: 3px; color: var(--z-text-secondary); }
.section-card { display: grid; gap: var(--z-space-3); padding: var(--z-space-5); }
.offered { display: grid; gap: 6px; }
.offered + .offered { border-top: 1px solid var(--z-border); padding-top: var(--z-space-3); }
.offered__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.offered__list li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--z-radius-pill); background: var(--z-bg-sunken); font: var(--z-type-caption); }
.offered__list li.is-match { background: var(--z-success-subtle); color: var(--z-success); font-weight: 600; }
.dist { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--z-space-5); align-items: center; }
.dist__score { display: grid; justify-items: center; gap: 4px; }
.dist__bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dist__bars li { display: grid; grid-template-columns: 12px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.dist__bar { height: 8px; border-radius: var(--z-radius-pill); background: var(--z-bg-sunken); overflow: hidden; }
.dist__bar span { display: block; height: 100%; background: var(--z-accent-yellow); border-radius: inherit; }
.reviews { list-style: none; margin: 0; padding: 0; display: grid; }
.review { display: grid; gap: 6px; padding: var(--z-space-4) 0; }
.review + .review { border-top: 1px solid var(--z-border); }
.review__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.review__details { color: var(--z-text-secondary); }
.review__reply { background: var(--z-bg-page); border-radius: var(--z-radius-md); padding: 10px 12px; display: grid; gap: 2px; }
.cred { display: flex; gap: 10px; align-items: flex-start; }
.cred .z-icon { color: var(--z-success); margin-top: 1px; }
/* FAQ accordion: question on the start side, chevron on the end (down when
   closed, up when open), the whole row tappable. */
.faq { border-top: 1px solid var(--z-border); }
.faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--z-space-3);
  min-height: var(--z-size-touch); padding: 10px 0; cursor: pointer; list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; border-radius: 4px; }
.faq__chevron { color: var(--z-text-secondary); transform: rotate(90deg); transition: transform var(--z-duration-fast) var(--z-ease); }
.faq[open] .faq__chevron { transform: rotate(-90deg); }
.faq p { margin: 0 0 var(--z-space-3); color: var(--z-text-secondary); }
/* The customer's request (answers, area, notes) on the matches and request pages. */
.specs.faq { border-top: 0; padding-block: 4px; margin-bottom: var(--z-space-4); }
.specs .faq__q > span { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.specs__list { padding: 0; background: none; }
.specs__note { display: flex; gap: 6px; align-items: center; margin: 0 0 var(--z-space-2); }
/* Desktop: a compact grid, so the pros stay in view. */
@media (min-width: 860px) {
  .specs__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--z-space-3) var(--z-space-5); padding-bottom: var(--z-space-3); }
  .specs__list .summary__row { border-top: 0; padding: 0; grid-template-columns: auto 1fr; gap: 0 8px; align-items: baseline; }
  .specs__list .summary__row dt { grid-column: 1; }
  .specs__list .summary__row dd { grid-column: 1 / -1; grid-row: 2; }
  .specs__list .summary__edit { grid-column: 2; grid-row: 1; align-self: baseline; font: var(--z-type-caption); }
}

/* ---------- Send ---------- */
.send-to { display: grid; gap: var(--z-space-4); }
.send-to__who { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.who { display: inline-flex; align-items: center; gap: 8px; font: var(--z-type-label); }
.same-note { justify-content: space-between; width: 100%; flex-direction: row-reverse; }

/* ---------- Request status ---------- */
.intros { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--z-space-2); }
.intro { display: grid; gap: var(--z-space-3); }
.intro__head { display: flex; align-items: center; gap: var(--z-space-3); }
.intro__who { flex: 1; min-width: 0; display: grid; }
.intro__who a { color: var(--z-text-primary); text-decoration: none; }
.intro__who a:hover { text-decoration: underline; }
.intro__actions { display: flex; flex-wrap: wrap; gap: var(--z-space-2); }
/* Prototype-only controls look deliberately different from product UI. */
/* Pro profile editor */
.profile-form { display: grid; gap: var(--z-space-4); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--z-space-3); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 var(--z-space-3); }
.check-list { display: grid; padding-bottom: var(--z-space-2); }
.profile-form .faq__q > span { display: grid; gap: 2px; }
.zoono-owned h2 { display: flex; align-items: center; gap: 8px; }
.owned-list { margin: 0; display: grid; gap: var(--z-space-2); }
.owned-list div { display: flex; justify-content: space-between; gap: var(--z-space-3); padding-bottom: var(--z-space-2); border-bottom: 1px solid var(--z-border); }
.owned-list dt { color: var(--z-text-secondary); }
.owned-list dd { margin: 0; text-align: end; }
.profile-form__bar { display: flex; justify-content: flex-end; gap: var(--z-space-2); }
.account-actions { margin-top: var(--z-space-3); }

/* Testing controls (A14, DS-10, DS-17): one look for all three floating buttons, dashed so they're never
   mistaken for product UI. Person switcher at the end; direction and backdrop at the start. */
.proto-switcher, .dirs > summary {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; list-style: none;
  background: var(--z-bg-surface); color: var(--z-text-secondary); border: 1.5px dashed var(--z-border-strong);
  font: 700 14px/1 var(--z-font); opacity: .6; transition: opacity var(--z-duration-fast);
}
.proto-switcher { position: fixed; z-index: 30; inset-inline-end: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); text-decoration: none; }
.proto-switcher:hover, .proto-switcher:focus-visible, .dirs:hover > summary, .dirs[open] > summary, .dirs > summary:focus-visible { opacity: 1; }
.proto-switcher:focus-visible, .dirs > summary:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; }
.dirs > summary::-webkit-details-marker { display: none; }
@media (min-width: 860px) { body .proto-switcher { bottom: 24px; inset-inline-end: 24px; } }

/* ---- Restored: these rules were deleted by mistake in the DS-17 edit (WEB-30). ---- */
.proto-tag { display: flex; gap: 6px; align-items: center; color: var(--z-text-secondary); }
.switcher__heading { margin: var(--z-space-3) 0 0; color: var(--z-text-secondary); }
.demo-box { display: grid; gap: var(--z-space-2); padding: var(--z-space-4); border: 2px dashed var(--z-border-strong); border-radius: var(--z-radius-lg); margin-top: var(--z-space-6); }
.demo-box .z-label { display: flex; gap: 6px; align-items: center; }
.demo-box .z-btn { white-space: normal; text-align: start; }

/* ---------- Pro ---------- */
.wallet { display: grid; justify-items: end; gap: 0; padding: 8px 12px; background: var(--z-bg-surface); border-radius: var(--z-radius-md); }
.wallet .z-icon { display: none; }
.lead-row__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: transparent; }
.lead-row__dot.is-new { background: var(--z-accent-orange); }
.customer-card { display: grid; gap: var(--z-space-3); }
.customer-card__head { display: flex; gap: var(--z-space-3); align-items: center; }
.customer-card.is-revealed { box-shadow: inset 0 0 0 2px var(--z-accent-green); }
.hidden-avatar { background: var(--z-bg-sunken); color: var(--z-text-secondary); }
.hidden-avatar .z-icon { width: 24px; height: 24px; }
.note { margin: 0; padding: 14px 16px; background: var(--z-bg-surface); border-radius: var(--z-radius-lg); border-start-start-radius: 4px; font: var(--z-type-body-lg); white-space: pre-wrap; }
.pay-box { display: grid; gap: 8px; padding: 14px 16px; background: var(--z-bg-page); border-radius: var(--z-radius-md); }
.pay-box__row { display: flex; justify-content: space-between; gap: 12px; }
.pay-box__total { border-top: 1px solid var(--z-border); padding-top: 8px; }

/* ---------- Messages ---------- */
.thread-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Message list: the request each conversation belongs to, and unread state. */
.thread-project { display: flex; align-items: center; gap: 4px; font: var(--z-type-caption); color: var(--z-text-brand); min-width: 0; }
.thread-project span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-project--link { text-decoration: none; width: fit-content; max-width: 100%; }
.thread-project--link:hover { text-decoration: underline; }
.thread-row__end { display: grid; justify-items: end; gap: 6px; }
.thread-row--unread .thread-row__name { font-weight: 700; }
.thread-row--unread .thread-preview { color: var(--z-text-primary); font-weight: 600; }
.unread-count, .nav-count {
  display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--z-radius-pill);
  background: var(--z-brand); color: var(--z-text-on-brand); font: 700 12px/20px var(--z-font-latin); text-align: center;
}
.app-header__link .nav-count { margin-inline-start: 2px; }
.app-tabbar a { position: relative; }
.app-tabbar .nav-count { position: absolute; top: 4px; inset-inline-start: calc(50% + 4px); }
.bubble__status { font-weight: 600; }
.thread { display: grid; gap: var(--z-space-3); }
.thread__contact { display: flex; gap: 8px; }
.thread__intro { display: flex; gap: 6px; align-items: center; justify-content: center; color: var(--z-text-secondary); text-align: center; }
.bubbles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-height: 30dvh; align-content: end; }
.bubble { max-width: min(80%, 480px); padding: 10px 14px 6px; background: var(--z-bg-surface); border-radius: 18px; border-end-start-radius: 6px; justify-self: start; display: grid; gap: 2px; }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { color: var(--z-text-secondary); justify-self: end; font-size: 11.5px; }
.bubble--mine { justify-self: end; background: var(--z-brand); color: var(--z-text-on-brand); border-radius: 18px; border-end-end-radius: 6px; }
.bubble--mine time { color: inherit; opacity: 0.8; }
.composer {
  position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 0; background: var(--z-bg-page);
}
.composer__input { min-height: 48px; max-height: 160px; border-radius: 24px; padding: 12px 16px; resize: none; field-sizing: content; }
textarea.composer__input { min-height: 48px; }
.composer__send { background: var(--z-brand); color: var(--z-text-on-brand); width: 48px; height: 48px; }
.composer__send:hover { background: var(--z-brand-hover); }
@media (min-width: 860px) { .composer { bottom: 0; } }

/* ---------- Account ---------- */
.me-card { display: flex; gap: var(--z-space-3); align-items: center; margin-bottom: var(--z-space-3); }
.settings { background: var(--z-bg-surface); border-radius: var(--z-radius-lg); padding: 4px 16px; gap: 0; }
.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; }
.setting + .setting { border-top: 1px solid var(--z-border); }
.setting .z-label { display: inline-flex; gap: 8px; align-items: center; }


/* ==================== Django additions ==================== */
/* ---------- Focused pages (phone sign-in) and simple pages ---------- */
.page { max-width: 520px; margin: 0 auto; padding: 16px 20px 48px; display: grid; gap: var(--z-space-5); }
.page__top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.page__head { display: grid; gap: var(--z-space-2); }
.form { display: grid; gap: var(--z-space-4); }
.code-input { font-size: 24px !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.text-actions { display: flex; flex-wrap: wrap; gap: var(--z-space-4); justify-content: center; }
.link-btn { background: none; border: 0; padding: 4px; font: var(--z-type-label); color: var(--z-text-brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; border-radius: 4px; }

.account-list { list-style: none; margin: 0; padding: 0; display: grid; }
.account { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px; border: 0; border-bottom: 1px solid var(--z-border); background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; border-radius: 8px; }
.account:hover { background: var(--z-bg-sunken); }
.account:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; }
.account__text { display: grid; }
.account-list form { margin: 0; }
.with-icon { display: flex; gap: 10px; align-items: center; }

/* Section chips are links (server-side filter), so they use aria-current, styled like a pressed chip. */
.z-chip[aria-current="true"] { background: var(--z-brand-subtle); border-color: var(--z-brand); }
a.z-chip { text-decoration: none; color: inherit; }
/* Language links in the segmented control (they change the URL, so they're links). */
.z-segmented a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--z-radius-pill); color: var(--z-text-secondary); text-decoration: none; font: var(--z-type-label); }
.z-segmented a[aria-current="true"] { background: var(--z-bg-surface); color: var(--z-text-primary); box-shadow: 0 1px 2px rgb(26 26 26 / 0.12); }
.z-segmented a:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 1px; }
form.z-segmented { margin: 0; }
.z-list form { margin: 0; }
.z-list button.z-list__item { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.demo-box--page { display: grid; gap: var(--z-space-2); align-items: start; }
.more-pros { display: grid; gap: var(--z-space-2); justify-items: start; margin-top: var(--z-space-5); }
.empty__zoonie { width: 72px; height: 72px; }
.wallet { text-decoration: none; color: inherit; }
.wallet-card { display: grid; gap: var(--z-space-3); justify-items: start; }
.ledger-amount.is-plus { color: var(--z-success); }
.z-list__end { gap: var(--z-space-2); }
.decline-confirm:not([open]) > :not(summary) { display: none; }
.decline-confirm { margin-bottom: var(--z-space-4); }
.decline-confirm .z-card { display: grid; gap: var(--z-space-3); }

/* Design-direction switcher (DS-10, testing only): small, quiet, bottom start. */
.dirs { position: fixed; z-index: 30; inset-inline-start: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); font: var(--z-type-caption); }
.dirs__menu {
  position: absolute; bottom: 48px; inset-inline-start: 0; display: grid; gap: 2px; min-width: 190px; padding: 6px;
  background: var(--z-bg-surface); color: var(--z-text-primary); border: 1px solid var(--z-border); border-radius: var(--z-radius-md); box-shadow: var(--z-shadow-raised);
}
.dirs__menu a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; font-weight: 600; }
.dirs__menu a:hover { background: var(--z-bg-sunken); }
.dirs__menu a[aria-current] { background: var(--z-brand-subtle); color: var(--z-text-brand); }
.dirs__about { margin-top: 4px; border-top: 1px solid var(--z-border); padding-top: 4px; }
.dirs__about > summary { all: unset; display: block; padding: 8px 10px; cursor: pointer; font-weight: 600; color: var(--z-text-secondary); border-radius: 8px; }
.dirs__about > summary:hover { background: var(--z-bg-sunken); }
.dirs__about dl { margin: 4px 10px 8px; max-width: 260px; display: grid; gap: 2px; font-weight: 400; }
.dirs__about dt { margin-top: 6px; font-weight: 700; color: var(--z-text-secondary); }
.dirs__about dd { margin: 0; }
.dirs__menu p { margin: 4px 10px 2px; color: var(--z-text-secondary); }
@media (min-width: 860px) { .dirs { bottom: 24px; inset-inline-start: 24px; } }
body:has(.app-root--focus) .dirs, body:has(.app-root--focus) .proto-switcher { bottom: calc(96px + env(safe-area-inset-bottom)); }
/* Second control, beside the direction switcher. */
.dirs--bg { inset-inline-start: 60px; }
.dirs--bg > summary svg { width: 20px; height: 20px; fill: currentColor; }
@media (min-width: 860px) { .dirs--bg { inset-inline-start: 72px; } }
.dirs--bg .dirs__menu { min-width: 230px; padding: 10px 12px; gap: 10px; }
.dirs--bg label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-weight: 600; }
.dirs--bg label input { grid-column: 1 / -1; width: 100%; accent-color: var(--z-brand); }
.dirs--bg output { color: var(--z-text-secondary); font-weight: 500; }
.dirs--bg button { justify-self: start; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--z-border); background: var(--z-bg-surface); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }

/* Faded Zoonies behind everything (DS-17). Count, size and opacity come from --bgz-* set by app.js. */
.bgz { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: var(--bgz-op, 0); }
.bgz i { position: absolute; left: var(--x); top: var(--y); width: calc(var(--s) * 1vmin * var(--bgz-size, 1)); aspect-ratio: 1; translate: -50% -50%; rotate: var(--r); display: none; }
.bgz svg { width: 100%; height: 100%; }
.bgz[data-n="1"] i:nth-child(-n + 1) { display: block; }
.bgz[data-n="2"] i:nth-child(-n + 2) { display: block; }
.bgz[data-n="3"] i:nth-child(-n + 3) { display: block; }
.bgz[data-n="4"] i:nth-child(-n + 4) { display: block; }
.bgz[data-n="5"] i:nth-child(-n + 5) { display: block; }
.bgz[data-n="6"] i:nth-child(-n + 6) { display: block; }
.bgz[data-n="7"] i:nth-child(-n + 7) { display: block; }
.bgz[data-n="8"] i:nth-child(-n + 8) { display: block; }
.bgz[data-n="9"] i:nth-child(-n + 9) { display: block; }
.bgz[data-n="10"] i:nth-child(-n + 10) { display: block; }
.bgz[data-n="11"] i:nth-child(-n + 11) { display: block; }
.bgz[data-n="12"] i:nth-child(-n + 12) { display: block; }

/* Page background per direction (DS-17, testing). Current: a very light neutral grey. A keeps the sand (token
   default). B and C: white. Dark mode keeps its own tokens. */
html[data-dir="b"] { --z-bg-page: var(--exp-page-white); --z-bg-sunken: var(--exp-sunken-white); }
/* C is a chat app: a cool pale grey page so the white surfaces read as separate, like a message list. */
html[data-dir="c"] { --z-bg-page: var(--exp-page-chat); --z-bg-sunken: var(--exp-sunken-chat); --c-edge: var(--exp-edge-chat); }
html[data-dir="base"][data-theme="light"], html[data-dir="base"]:not([data-theme]) { --z-bg-page: var(--exp-page-grey); --z-bg-sunken: var(--exp-sunken-grey); }
@media (prefers-color-scheme: dark) { html[data-dir="base"]:not([data-theme]) { --z-bg-page: initial; --z-bg-sunken: initial; } }

/* Backdrop options (DS-17): drift and placement. */
.bgz--drift svg { animation: bgz-drift 22s ease-in-out infinite alternate; }
.bgz--drift i:nth-child(3n) svg { animation-duration: 29s; animation-direction: alternate-reverse; }
.bgz--drift i:nth-child(3n + 1) svg { animation-duration: 36s; animation-delay: -9s; }
.bgz--drift i:nth-child(4n) svg { animation-delay: -15s; }
@keyframes bgz-drift { from { transform: translate(-1.6vmin, 1.2vmin) rotate(-5deg); } to { transform: translate(2.2vmin, -2.4vmin) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .bgz--drift svg { animation: none; } }
.dirs--bg label.dirs__check { grid-template-columns: auto 1fr; align-items: center; }
.dirs--bg label.dirs__check input { grid-column: auto; width: auto; }
.dirs--bg select { grid-column: 1 / -1; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--z-border); background: var(--z-bg-surface); color: inherit; font: inherit; }

/* The language switch is two links, not buttons, so give them the segmented-button look (DS only styles buttons). */
.z-segmented a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: var(--z-radius-pill);
  background: transparent; color: var(--z-text-secondary); font: var(--z-type-label); text-decoration: none;
}
.z-segmented a[aria-current="true"] { background: var(--z-bg-surface); color: var(--z-text-primary); box-shadow: 0 1px 2px rgb(26 26 26 / 0.12); }
.z-segmented a:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 1px; }

/* Staff text editor (WEB-19) */
.text-find { display: flex; flex-wrap: wrap; gap: var(--z-space-2); margin: var(--z-space-3) 0; }
.text-find input[type=search] { flex: 1 1 240px; }
.text-row { display: grid; gap: var(--z-space-3); margin-bottom: var(--z-space-3); border: 1px solid var(--z-border); scroll-margin-top: 80px; }
.text-row__head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.text-row__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--z-space-3); }
.text-row label { display: grid; gap: 4px; font: var(--z-type-label); }
.text-row textarea { min-height: 84px; font: var(--z-type-body); }
.text-row__bar { display: flex; flex-wrap: wrap; gap: var(--z-space-2); align-items: center; }
.text-find .z-input { width: auto; flex: 1 1 200px; }
.text-find input[type=search] { flex: 2 1 280px; }

/* Header language link and the site footer (DS-19). The base look: quiet, one row of links. */
.app-header__lang { margin-inline-start: auto; padding: 6px 12px; border-radius: var(--z-radius-pill); color: var(--z-text-secondary); text-decoration: none; font: var(--z-type-label); }
.app-header__lang:hover { background: var(--z-bg-sunken); color: var(--z-text-primary); }
.app-header__lang:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; }
.app-header__lang + .app-header__me { margin-inline-start: 0; }
.site-footer { margin-top: var(--z-space-6); color: var(--z-text-secondary); font: var(--z-type-caption); }
.site-footer__inner { max-width: 1080px; margin: 0 auto; padding: 20px 16px; display: grid; gap: 10px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer__links a { color: inherit; text-decoration: none; padding: 6px 0; min-height: 32px; display: inline-flex; align-items: center; }
.site-footer__links a:hover { color: var(--z-text-primary); text-decoration: underline; }
.site-footer__links a:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; border-radius: 4px; }
.site-footer__fine { margin: 0; }
.app-root--tabs .app-main--tabs { padding-bottom: 8px; }
.app-root--tabs .site-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (min-width: 860px) { .app-root--tabs .site-footer { padding-bottom: 12px; } .app-root--tabs .app-main--tabs { padding-bottom: 8px; } }
.signin .site-footer { margin-top: var(--z-space-4); }
.signin .site-footer__inner { padding-inline: 0; }
/* Short pages: the footer sits at the bottom of the window, not in the middle. */
.app-root:not(.app-root--focus) { min-height: 100dvh; display: flex; flex-direction: column; }
.app-root:not(.app-root--focus) > .app-main { flex: 1 0 auto; width: 100%; }

/* Long pages (WEB-20) */
.prose { display: grid; gap: var(--z-space-3); font: var(--z-type-body-lg); line-height: 1.6; max-width: 68ch; }
.prose h2 { font: var(--z-type-title-2); margin: var(--z-space-4) 0 0; }
.prose h3 { font: var(--z-type-title-3, 700 18px/1.3 var(--z-font)); margin: var(--z-space-3) 0 0; }
.prose p, .prose ul, .prose ol { margin: 0; }
.prose ul, .prose ol { padding-inline-start: 1.4em; display: grid; gap: 6px; }
.page-form { display: grid; gap: var(--z-space-3); margin: var(--z-space-3) 0; }
.page-col { display: grid; gap: var(--z-space-3); align-content: start; }
.page-form label { display: grid; gap: 4px; font: var(--z-type-label); }
textarea.z-input.page-body { min-height: 360px; font: var(--z-type-body); line-height: 1.5; }
.text-help { margin: var(--z-space-2) 0; }
.text-help summary { cursor: pointer; font-weight: 600; }

/* Admin: header link and the People list (roomier rows). */
.app-header__admin { padding: 6px 12px; border-radius: var(--z-radius-pill); background: var(--z-brand-subtle); color: var(--z-text-brand); text-decoration: none; font: var(--z-type-label); margin-inline-start: auto; }
.app-header__admin[aria-current="page"], .app-header__admin:hover { background: var(--z-brand); color: var(--z-text-on-brand); }
.app-header__admin:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; }
.app-header__admin + .app-header__lang { margin-inline-start: 0; }
.person { display: grid; gap: var(--z-space-3); padding: var(--z-space-4) var(--z-space-4); }
.person + .person { border-top: 1px solid var(--z-border); }
.person__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--z-space-2) var(--z-space-4); }
.person__who { display: grid; gap: 4px; min-width: 0; }
.person__name { font: var(--z-type-body-lg); font-weight: 600; overflow-wrap: anywhere; }
.person__sub { font: var(--z-type-caption); color: var(--z-text-secondary); overflow-wrap: anywhere; }
.person__actions { display: flex; flex-wrap: wrap; gap: var(--z-space-2); }
.z-list > .z-list__item.log { padding-block: var(--z-space-3); }
.site-footer__logo { display: none; }
.export-steps { margin: 0; padding: var(--z-space-3) var(--z-space-4); background: var(--z-bg-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius-md); overflow-x: auto; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }

/* A plain stacked form with real gaps; and breathing room for the admin pages' heading rows. */
.stack-form { display: grid; gap: var(--z-space-4); margin-top: var(--z-space-2); }
.stack-form .text-actions { display: flex; gap: var(--z-space-4); flex-wrap: wrap; }
.app-main > p:first-child { margin: 0 0 var(--z-space-5); }
.app-main > p:first-child a { display: inline-block; padding: 6px 0; }
.app-main > h1.z-title-1, .app-main > h1.z-title-2 { margin: 0 0 var(--z-space-3); }
.app-main > h1 + p { margin: 0 0 var(--z-space-5); }

/* Drop-downs (native select, and the type-to-filter input): our own chevron with room on both sides. The browser's
   arrow sits hard against the border and can't be moved, so it is replaced. */
select:not([multiple]), input.combo {
  -webkit-appearance: none; appearance: none; background-repeat: no-repeat; background-size: 16px 16px;
  background-position: right 16px center; padding-inline-end: 48px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2389867F' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
}
[dir="rtl"] select:not([multiple]), [dir="rtl"] input.combo { background-position: left 16px center; }
input.combo::-webkit-calendar-picker-indicator { opacity: 0; width: 40px; margin-inline-end: -40px; cursor: pointer; }
.dirs--bg select { padding-inline-end: 36px; background-position: right 12px center; }
[dir="rtl"] .dirs--bg select { background-position: left 12px center; }

/* Navigation in progress: a thin bar at the very top, so a slow page never feels like a dead click. */
.nav-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; overflow: hidden; background: color-mix(in srgb, var(--z-brand) 18%, transparent); pointer-events: none; }
.nav-progress[hidden] { display: none; }
.nav-progress::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 40%; background: var(--z-brand); border-radius: 3px; animation: nav-progress 1.1s ease-in-out infinite; }
@keyframes nav-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
[dir="rtl"] .nav-progress::before { animation-direction: reverse; }
html[aria-busy="true"] body { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .nav-progress::before { animation: none; width: 100%; opacity: .6; } }

.search--section { margin-bottom: var(--z-space-3); }
#browse { scroll-margin-top: 72px; }

/* Pro profile photos (WEB-26) */
.z-avatar--photo { overflow: hidden; background: var(--z-bg-sunken); }
.z-avatar--photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-card { margin-bottom: var(--z-space-4); }
.photo-card__row { display: flex; gap: var(--z-space-4); align-items: flex-start; }
.photo-card__text { display: grid; gap: var(--z-space-3); min-width: 0; flex: 1; }
.photo-card__form { display: flex; flex-wrap: wrap; gap: var(--z-space-2); align-items: center; }
.photo-card__file { flex: 1 1 200px; padding: 10px 12px; font: var(--z-type-caption); }
.text-count { margin: 0 0 var(--z-space-3); }
.intro__note { margin: 0; color: var(--z-text-secondary); }

/* Live conversation (WEB-31): "is typing" is three tiny Zoonies hopping in a bubble, no words (the words are for screen readers). */
.typing { display: flex; margin: 4px 0 0; }
.typing[hidden] { display: none; }
.typing__bubble { display: inline-flex; align-items: flex-end; gap: 7px; padding: 11px 15px 9px; background: var(--z-bg-surface); border-radius: 18px; border-end-start-radius: 6px; }
.typing__z { width: 19px; height: 19px; display: block; animation: typing-hop 1.15s ease-in-out infinite; transform-origin: 50% 80%; }
.typing__bubble .typing__z:nth-child(2) { animation-delay: .16s; }
.typing__bubble .typing__z:nth-child(3) { animation-delay: .32s; }
@keyframes typing-hop { 0%, 55%, 100% { transform: translateY(0) rotate(0) scale(1); } 25% { transform: translateY(-6px) rotate(-14deg) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .typing__z { animation: none; } }

/* The per-conversation typing switch (WEB-32): the same three Zoonies as the indicator it controls, grey and struck through while it is off. */
.typing-toggle { position: relative; }
.typing-toggle__z { display: inline-flex; align-items: center; gap: 2px; }
.typing-toggle__dot { width: 10px; height: 10px; display: block; }
.typing-toggle.is-off .typing-toggle__dot { fill: var(--z-neutral-400, var(--z-text-secondary)); }
.typing-toggle.is-off { color: var(--z-text-secondary); }
.typing-toggle.is-off::after { content: ""; position: absolute; width: 30px; height: 2px; background: var(--z-text-secondary); rotate: -45deg; border-radius: 2px; }
.thread__contact form { margin: 0; }

/* Sharing a phone number from inside a conversation (WEB-33) */
.thread__note { display: flex; gap: 6px; align-items: center; justify-content: center; color: var(--z-text-secondary); text-align: center; margin: 0; }
.share-phone { padding: var(--z-space-3) var(--z-space-4); }
.share-phone summary { display: flex; gap: 8px; align-items: center; cursor: pointer; font: var(--z-type-label); }
.share-phone summary::-webkit-details-marker { display: none; }
.share-phone__form { display: grid; gap: var(--z-space-3); margin-top: var(--z-space-3); }
.share-phone--on { display: flex; flex-wrap: wrap; gap: var(--z-space-2) var(--z-space-4); align-items: center; justify-content: space-between; }
.share-phone--on p, .share-phone--on form { margin: 0; }
