/* 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: 4px; }
.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); }

/* Prototype switcher (A14): floating, dashed like every prototype-only control.
   On phones it sits above the tab bar and bottom action bars. */
.proto-switcher {
  position: fixed; z-index: 30; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--z-bg-surface); color: var(--z-text-primary);
  border: 2px dashed var(--z-border-strong); box-shadow: var(--z-shadow-raised);
}
.proto-switcher:hover { border-color: var(--z-brand); color: var(--z-text-brand); }
.proto-switcher:focus-visible { outline: 3px solid var(--z-focus); outline-offset: 2px; }
body:has(.app-root--tabs) .proto-switcher { bottom: calc(150px + env(safe-area-inset-bottom)); }
body:has(.app-root--focus) .proto-switcher { bottom: calc(92px + env(safe-area-inset-bottom)); }
@media (min-width: 860px) { body .proto-switcher, body:has(.app-root) .proto-switcher { bottom: 24px; inset-inline-end: 24px; } }
.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); }
