/* ============================================================
   TAVI — Design tokens & global styles
   ============================================================ */
:root {
  --black: #1A1A18;
  --acc: #C8FF3D;
  --white: #FFFFFF;
  --g10: #F5F5F2;
  --g20: #EDEDEA;
  --g30: #D8D8D4;
  --g40: #B0B0AB;
  --g50: #8C8C87;
  --g60: #6B6B66;
  --g80: #3A3A38;
  --green: #2D6A3A;
  --green-bg: #EAF2EC;
  --red: #B3261E;
  --red-bg: #FBEAE9;
  --bd: rgba(26,26,24,0.09);
  --bd2: rgba(26,26,24,0.18);
  --acc-tint: rgba(200,255,61,0.14);
  --acc-bd: rgba(160,210,40,0.42);
  --font: "DM Sans","SF Pro Text",system-ui,sans-serif;
}

/* Same-document view transitions for boosted navigation (htmx.config.globalViewTransitions,
   app.js). Short cross-fade to remove the perceived cut without feeling sluggish. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 180ms; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 1ms; }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
input, textarea, select { font-size: 16px; }

/* ---- Screen (full-page app shell) ---- */
.screen {
  max-width: 520px;
  margin: 0 auto;
  height: var(--app-height, 100svh);
  background: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
}
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.screen-scroll::-webkit-scrollbar { display: none; }
.pad { padding-left: 18px; padding-right: 18px; }

/* ---- Topbar ---- */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* Left/right slots share equal width so the center item (logo/info) stays
   truly centered regardless of how many buttons land in either slot —
   see #158. Middle selector only matches when there are exactly 3
   children (simultaneously 2nd-from-start and 2nd-from-end). */
.topbar > *:first-child, .prov-topbar > *:first-child { grid-column: 1; justify-self: start; }
.topbar > *:last-child, .prov-topbar > *:last-child { grid-column: 3; justify-self: end; }
.topbar > *:nth-child(2):nth-last-child(2),
.prov-topbar > *:nth-child(2):nth-last-child(2) { grid-column: 2; justify-self: center; }
.tb-logo { display: flex; align-items: center; gap: 5px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.tb-word { font-weight: 700; font-size: 19px; letter-spacing: -0.04em; }
.tb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); margin-bottom: -9px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 0.5px solid var(--bd);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: 0 0 auto;
}
.icon-btn:active { background: var(--g10); }
.mic-btn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.avatar-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--g20); color: var(--g80);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; cursor: pointer; flex: 0 0 auto;
  letter-spacing: 0.02em; border: none;
  overflow: hidden;
}
.avatar-btn:active { opacity: 0.85; }
.avatar-btn img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.avatar {
  border-radius: 50%;
  background: var(--g20); color: var(--g80);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; letter-spacing: 0.02em; flex-shrink: 0;
  overflow: hidden;
}
.avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.signin-btn {
  border: 0.5px solid var(--bd2); background: var(--white); color: var(--black);
  font-family: var(--font); font-size: 13px; font-weight: 600; white-space: nowrap;
  padding: 8px 16px; border-radius: 100px; cursor: pointer; flex: 0 0 auto;
}
.signin-btn:active { transform: scale(0.97); }

/* ---- Headlines ---- */
.h-display { font-size: 33px; line-height: 1.04; font-weight: 600; letter-spacing: -0.03em; }
.h-title { font-size: 23px; line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
.h-section { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.t-sub { font-size: 14px; line-height: 1.45; color: var(--g60); font-weight: 400; }
.t-body { font-size: 13px; line-height: 1.5; color: var(--g60); }
.t-meta { font-size: 12px; color: var(--g40); }
.t-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--g40); }

/* ---- Brand pills ---- */
.brand-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--acc); color: var(--black);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 11px 5px 9px; border-radius: 100px; text-transform: uppercase;
}
.brand-pill .bp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--black); }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--acc); color: var(--black);
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
  padding: 5px 12px; border-radius: 100px; text-transform: uppercase;
}
.status-pill .sp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ---- Zone 3 (bottom action) ---- */
.zone3 {
  border-top: 0.5px solid var(--bd);
  padding: 12px 18px calc(26px + env(safe-area-inset-bottom));
  background: var(--white);
  flex-shrink: 0;
}
.cta {
  width: 100%; border: none; cursor: pointer;
  background: var(--black); color: var(--white);
  font-family: var(--font); font-size: 15px; font-weight: 600;
  padding: 14px 18px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: -0.01em; white-space: nowrap;
  transition: transform .12s ease, opacity .12s ease;
}
.cta:active { transform: scale(0.985); }
.cta:disabled { opacity: 0.6; cursor: default; }
.cta .cta-price { opacity: 1; font-weight: 700; }
.fb-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3); border-top-color: var(--white);
  animation: fb-spin 0.6s linear infinite;
}
@keyframes fb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .fb-spinner { animation: none; opacity: 0.7; }
}
.cta-arrow { color: var(--acc); }
.cta-passive {
  width: 100%; background: var(--g10); color: var(--g60);
  font-size: 13.5px; font-weight: 500; padding: 14px 18px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 0.5px solid var(--bd);
}
.cta-danger {
  width: 100%; background: var(--white); color: var(--red);
  border: 0.5px solid var(--red); border-radius: 100px;
  padding: 13px; font-size: 14px; font-weight: 600; font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.cta-danger:active { background: var(--red-bg); }
.cta-ghost {
  width: 100%; background: var(--white); color: var(--black);
  border: 0.5px solid var(--bd2); cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 13px 18px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.linkish {
  background: none; border: none; cursor: pointer; font-family: var(--font);
  font-size: 12.5px; color: var(--g60); text-decoration: underline;
  text-underline-offset: 2px; padding: 4px;
}

/* ---- Search box ---- */
.search {
  border: 0.5px solid var(--bd2); border-radius: 16px; background: var(--white);
  padding: 16px 16px 12px; box-shadow: 0 1px 2px rgba(26,26,24,0.03);
}
.search-in {
  width: 100%; border: none; outline: none; font-family: var(--font);
  color: var(--black); background: transparent; resize: none;
}
.search-in::placeholder { color: var(--g40); }
.search-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 11px; border-top: 0.5px solid var(--bd);
}

/* ---- Chat bubbles ---- */
.bubble-tavi {
  background: var(--g10); color: var(--black);
  font-size: 14px; line-height: 1.45; font-weight: 450;
  padding: 12px 14px; border-radius: 4px 16px 16px 16px; max-width: 80%;
  width: fit-content;
}
.bubble-user {
  background: var(--black); color: var(--white);
  font-size: 14px; line-height: 1.4; font-weight: 450;
  padding: 11px 14px; border-radius: 16px 16px 4px 16px; max-width: 78%;
  margin-left: auto; width: fit-content;
}
.bubble-photo {
  border: 0.5px solid var(--bd); border-radius: 14px; overflow: hidden;
  width: 128px; height: 96px; margin-left: auto;
}

/* ---- Input bar ---- */
.inputbar {
  display: flex; align-items: center; gap: 10px;
  border: 0.5px solid var(--bd2); border-radius: 100px;
  padding: 8px 8px 8px 16px; background: var(--white);
  margin-top: 8px;
}
.inputbar input {
  flex: 1; border: none; outline: none;
  -webkit-appearance: none; appearance: none;
  font-family: var(--font); background: transparent;
  font-size: 16px;
}
.inputbar input[type=number]::-webkit-inner-spin-button,
.inputbar input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.inputbar input[type=number] { -moz-appearance: textfield; }
.inputbar input::placeholder { color: var(--g40); }
.inputbar input.validation-hint::placeholder { color: #7A8C3C; }
.send-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--black); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}

/* ---- Chips ---- */
.chip-row {
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > .chip { flex-shrink: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0.5px solid var(--bd2); background: var(--white); color: var(--black);
  font-family: var(--font); font-size: 13px; font-weight: 500; white-space: nowrap;
  padding: 8px 14px; min-height: 44px; border-radius: 100px; cursor: pointer;
  transition: background .1s ease, border-color .1s ease;
}
.chip:active { transform: scale(0.97); }
.chip.sel { background: var(--acc); border-color: transparent; color: var(--black); font-weight: 600; }

/* ---- Availability picker CTA (client intake + provider brief share this) ---- */
.avail-cta { margin-top: 11px; padding: 12px 16px; font-size: 14.5px; }

/* ---- Day rail (redesigned availability picker) ----
   Single-stage day rail + vertical win-chip hour list, ported from
   tavi-2-0/Availability.Simplified.Standalone.html. The rail itself reuses
   .chip/.chip-row/.chip.sel and the hour list reuses .win-chip/.win-chip.sel
   as-is (already pixel-identical to the prototype) -- only the scroll-shadow
   overlay and calendar popup below are new. */
.rail-shadow {
  position: absolute; top: 0; bottom: 0; width: 26px; pointer-events: none;
}
.rail-shadow-left {
  left: 0; background: linear-gradient(to right, var(--white), rgba(255,255,255,0));
}
.rail-shadow-right {
  right: 0; background: linear-gradient(to left, var(--white), rgba(255,255,255,0));
}

.cal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(26,26,24,0.28);
  display: flex; align-items: center; justify-content: center;
}
.cal-popup {
  width: 308px; max-width: calc(100vw - 32px); background: var(--white); border-radius: 18px;
  padding: 18px 18px 20px; box-shadow: 0 20px 50px rgba(26,26,24,0.28);
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav {
  width: 30px; height: 30px; border: none; border-radius: 8px; background: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.cal-nav:disabled { cursor: default; }
.cal-nav:active:not(:disabled) { background: var(--g10); }
.cal-month { font-family: var(--font); font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.cal-dow-row { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 6px; }
.cal-dow { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--g40); }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day {
  width: 100%; height: 36px; border: none; border-radius: 9px; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  background: transparent; color: var(--black);
}
.cal-day:disabled { cursor: default; color: var(--g30); }
.cal-day:active:not(:disabled) { background: var(--g10); }
.cal-day.today { font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--bd2); }
.cal-day.selected { background: var(--acc); color: var(--black); font-weight: 700; }

/* Read-only slot summary (e.g. provider brief's job card) -- deliberately
   lighter-weight than the interactive chip grid above: flat pills, no
   border/shadow/state colors, not clickable. */
.slot-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.slot-badge {
  font-size: 11px; font-weight: 500; color: var(--g80); background: var(--g10);
  border-radius: 100px; padding: 3px 9px; white-space: nowrap;
}
.slot-badge b { font-weight: 650; color: var(--black); }
/* Same badges rendered inside a dark .bubble-user chat bubble need light-on-dark colors. */
.slot-badge.on-dark { background: rgba(255,255,255,0.14); color: var(--white); }
.slot-badge.on-dark b { color: var(--acc); }

/* ---- Segments ---- */
.segment { display: inline-flex; background: var(--g10); border-radius: 100px; padding: 3px; gap: 2px; }
.seg-item {
  font-size: 12px; font-weight: 500; color: var(--g60);
  padding: 5px 13px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 100px; cursor: pointer; border: none;
  background: none; font-family: var(--font);
}
.seg-item.on { background: var(--white); color: var(--black); font-weight: 600; box-shadow: 0 1px 2px rgba(26,26,24,0.08); }

/* ---- Summary card ---- */
.summary {
  background: var(--acc-tint); border: 0.5px solid var(--acc-bd);
  border-radius: 12px; padding: 14px;
}
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 0.5px solid rgba(26,26,24,0.07); align-items: baseline; }
.summary-row:first-of-type { border-top: none; }
.summary-row .sr-k { font-size: 12.5px; color: var(--g60); flex: 0 0 auto; }
.summary-row .sr-v { font-size: 13px; font-weight: 600; text-align: right; flex: 1 1 auto; }

/* ---- KV rows ---- */
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 0.5px solid var(--bd); align-items: baseline; }
.kv-row:first-child { border-top: none; }
.kv-k { font-size: 13px; color: var(--g60); flex: 0 0 auto; }
.kv-v { font-size: 13.5px; font-weight: 600; text-align: right; flex: 1 1 auto; }

/* ---- Cards ---- */
.card { border: 0.5px solid var(--bd); border-radius: 10px; background: var(--white); }
.notice { background: var(--g10); border-radius: 10px; padding: 12px 13px; font-size: 12px; line-height: 1.5; color: var(--g80); }

/* ---- Provider rows ---- */
.prov-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border: 0.5px solid var(--bd); border-radius: 10px; background: var(--white);
}
.prov-quote-card {
  border: 0.5px solid var(--bd); border-radius: 14px; overflow: hidden;
  background: var(--white); cursor: pointer;
  transition: border-left 0.12s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.prov-quote-card.best { box-shadow: 0 2px 10px rgba(0,0,0,0.07); }
.prov-quote-card.selected { border-left: 3px solid var(--acc); }
.best-badge {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 700; color: var(--black);
  background: var(--acc); padding: 2px 7px; border-radius: 100px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.detail-cell { background: var(--g10); border-radius: 8px; padding: 9px 11px; }
.detail-cell .dc-label { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--g40); font-weight: 600; }
.detail-cell .dc-val { font-size: 15px; font-weight: 600; margin-top: 2px; }

/* ---- Window picker ---- */
.win-chip {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 11px;
  border: 1px solid var(--bd2); background: var(--white);
  font-family: var(--font); font-size: 13.5px; font-weight: 500; color: var(--g80);
  cursor: pointer; text-align: left;
  transition: border-color .12s, background .12s;
}
.win-chip.sel { border-color: var(--black); background: var(--g10); font-weight: 600; color: var(--black); }
.win-chip:hover:not(.sel) { background: var(--g10); }

/* ---- Verified badge ---- */
.verified {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--green-bg); color: var(--green);
  font-size: 9px; font-weight: 600; letter-spacing: 0.03em;
  padding: 2px 6px 2px 4px; border-radius: 100px; white-space: nowrap;
}

/* ---- Avatar ---- */
.av {
  border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-weight: 600; letter-spacing: 0.01em;
}

/* ---- TAVI message ---- */
.tavi-msg {
  display: flex; gap: 11px; align-items: flex-start;
  border: 0.5px solid var(--bd); border-radius: 14px;
  padding: 13px 14px; background: var(--white);
}
.tavi-orb {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  position: relative; display: flex; align-items: center; justify-content: center;
}
.tavi-orb.live { background: var(--acc); }
.tavi-orb.still { background: var(--g10); border: 0.5px solid var(--bd); }
.tavi-orb .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--black); }
.tavi-orb.live .pulse { animation: breathe 1.5s ease-in-out infinite; }

/* ---- Stat row ---- */
.stat-row { display: flex; border: 0.5px solid var(--bd); border-radius: 12px; overflow: hidden; }
.stat-cell { flex: 1; padding: 13px 6px; text-align: center; border-right: 0.5px solid var(--bd); }
.stat-cell:last-child { border-right: none; }
.stat-num { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.stat-lab { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--g40); font-weight: 600; margin-top: 3px; }

/* ---- Reviews ---- */
.review { border-left: 2px solid var(--acc); padding: 2px 0 2px 12px; }
.review-meta { font-size: 11px; color: var(--g40); margin-top: 4px; font-weight: 500; }

/* ---- WhatsApp card ---- */
.wa-card { display: flex; align-items: center; gap: 12px; border: 0.5px solid var(--bd); border-radius: 12px; padding: 13px; }
.wa-ic { width: 40px; height: 40px; border-radius: 11px; background: #25D366; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }

/* ---- QR scan card ---- */
.qr-card { display: flex; align-items: center; gap: 14px; border: 0.5px solid var(--bd); border-radius: 12px; padding: 13px; }
.qr-frame { position: relative; width: 64px; height: 64px; flex: 0 0 auto; padding: 6px; background: var(--white); }
.qr-frame svg { display: block; width: 100%; height: 100%; }
.qr-frame svg path { fill: var(--black); }
.qr-corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--acc-bd); }
.qr-corner--tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-radius: 5px 0 0 0; }
.qr-corner--tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-radius: 0 5px 0 0; }
.qr-corner--bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-radius: 0 0 0 5px; }
.qr-corner--br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-radius: 0 0 5px 0; }

/* ---- Stars ---- */
.stars { display: flex; gap: 8px; justify-content: center; }
.star { cursor: pointer; }

/* ---- Request card ---- */
.req-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 0.5px solid var(--bd); border-radius: 12px; cursor: pointer; background: var(--white); transition: background .1s ease; }
.req-card:hover { border-color: var(--bd2); }
.req-card:active { background: var(--g10); }
.req-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--g10); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.ready-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--acc); color: var(--black); font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 100px; letter-spacing: 0.03em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }
.live-dot.acc { background: var(--acc); }

/* ---- Track ---- */
.track { height: 3px; border-radius: 100px; background: var(--g20); overflow: hidden; }
.track .fill { height: 100%; background: var(--acc); border-radius: 100px; transition: width .5s ease; }

/* ---- Booking confirming (loading) screen ---- */
.confirm-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; text-align: center; padding: 32px 28px; }
.confirm-orb-wrap { position: relative; width: 92px; height: 92px; margin-bottom: 30px; display: flex; align-items: center; justify-content: center; }
.confirm-orb-wrap .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--acc-bd); animation: sonar 2.2s ease-out infinite; }
.confirm-orb-wrap .ring:nth-child(2) { animation-delay: .7s; }
.confirm-orb-wrap .ring:nth-child(3) { animation-delay: 1.4s; }
.confirm-orb-core { position: relative; z-index: 1; width: 54px; height: 54px; border-radius: 50%; background: var(--black); display: flex; align-items: center; justify-content: center; transition: background .3s ease; }
.confirm-orb-core svg { animation: spin-slow 3s linear infinite; }
.confirm-orb-core.done { background: var(--acc); }
.confirm-orb-core.done svg { animation: none; }
.confirm-title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 8px; }
.confirm-stage { font-size: 14px; color: var(--g60); min-height: 20px; transition: opacity .25s ease; }
.confirm-track-wrap { width: 210px; margin-top: 26px; }
.confirm-fallback { font-size: 13px; color: var(--g40); margin-top: 22px; opacity: 0; transition: opacity .3s ease; }
.confirm-fallback.show { opacity: 1; }
.confirm-fallback a { color: var(--black); font-weight: 600; text-decoration: underline; }
@keyframes sonar { 0% { transform: scale(.62); opacity: .55; } 100% { transform: scale(2); opacity: 0; } }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .confirm-orb-wrap .ring { animation: none; opacity: .3; }
  .confirm-orb-core svg { animation: none; }
}

/* ---- Google button ---- */
.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--white); border: 1px solid var(--bd2); border-radius: 12px; padding: 14px;
  font-family: var(--font); font-size: 15px; font-weight: 600; color: var(--black); cursor: pointer;
  box-shadow: 0 1px 2px rgba(26,26,24,0.06), 0 6px 16px -10px rgba(26,26,24,0.18);
}
.google-btn:active { transform: scale(0.99); }

/* ---- Category row ---- */
.cat-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 8px; border: 0.5px solid var(--bd); border-radius: 10px;
  cursor: pointer; background: var(--white);
  transition: border-color .12s ease, background .12s ease;
}
.cat-row:hover { border-color: var(--bd2); }
.cat-row:active { background: var(--g10); }
.cat-ic { width: 26px; height: 26px; border-radius: 8px; background: var(--g10); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.cat-ic svg { width: 15px; height: 15px; }
.cat-name { font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.cat-desc { font-size: 9.5px; color: var(--g40); margin-top: 1px; }
.cat-row.sel { background: var(--acc-tint); border-color: var(--acc-bd); }

/* ---- Provider-side brand ---- */
.prov-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; }
.prov-brand { display: flex; align-items: center; font-weight: 700; font-size: 16px; letter-spacing: -0.03em; }
.prov-brand-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); margin: 0 6px 0 1px; align-self: flex-end; margin-bottom: 4px; }
.prov-brand-tag { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--g40); }
.prov-newtag { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: var(--green); background: var(--green-bg); padding: 2px 8px; border-radius: 100px; }
.brief-sec { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--g40); margin: 18px 0 7px; }
.brief-block { border: 0.5px solid var(--bd); border-radius: 10px; overflow: hidden; }
.brief-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 12px; border-top: 0.5px solid var(--bd); }
.brief-row:first-child { border-top: none; }
.brief-k { font-size: 12.5px; color: var(--g60); flex: 0 0 auto; }
.brief-v { font-size: 13px; font-weight: 600; text-align: right; }

/* ---- Provider bottom tab bar ---- */
.prov-tabbar { border-top: 0.5px solid var(--bd); background: var(--white); display: flex; padding-bottom: calc(14px + env(safe-area-inset-bottom)); padding-top: 8px; flex-shrink: 0; }
.prov-tabbar button, .prov-tabbar a { flex: 1; border: none; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; font-family: var(--font); text-decoration: none; }
.ptb-badge { background: var(--acc); color: var(--black); font-size: 8.5px; font-weight: 700; border-radius: 50%; min-width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0 2px; position: absolute; top: -3px; right: -7px; }

/* ---- Scroll fade ---- */
.prov-scrollfade {
  position: sticky; bottom: 0; left: 0; right: 0;
  height: 52px; margin-top: -52px;
  pointer-events: none; z-index: 3;
  transition: opacity .25s ease;
  background: linear-gradient(to top, var(--white) 18%, rgba(255,255,255,0) 100%);
}

/* ---- Typing indicator ---- */
.typing span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--g40); margin: 0 1.5px; animation: blink 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }

/* ---- Photo action sheet ---- */
.ps-overlay { position: fixed; inset: 0; z-index: 90; }
.ps-backdrop { position: fixed; inset: 0; background: rgba(26,26,24,0.48); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ps-sheet { position: fixed; left: calc(50% - (min(520px,100vw) - 24px) / 2); bottom: 24px; width: calc(min(520px,100vw) - 24px); display: flex; flex-direction: column; gap: 10px; }
.ps-card { background: var(--white); border-radius: 18px; overflow: hidden; border: 0.5px solid var(--bd); }
.ps-opt {
  width: 100%; background: transparent; border: none; border-radius: 0; padding: 15px 18px;
  font-family: var(--font); font-size: 15px; font-weight: 500; color: var(--black); cursor: pointer;
  display: flex; align-items: center; gap: 13px;
  border-bottom: 0.5px solid var(--bd);
  transition: background .1s ease;
}
.ps-opt:last-child { border-bottom: none; }
.ps-opt:active { background: var(--g10); }
.ps-opt-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--g10); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ps-cancel {
  width: 100%; background: var(--white); border: 0.5px solid var(--bd); border-radius: 18px; padding: 16px;
  font-family: var(--font); font-size: 15px; font-weight: 700; color: var(--black); cursor: pointer;
  transition: background .1s ease;
}
.ps-cancel:active { background: var(--g10); }

/* ---- Photo attach ---- */
.photo-attach { display: flex; align-items: center; gap: 11px; border: 0.5px solid var(--bd2); border-radius: 12px; padding: 9px 11px; }
.pa-thumb { width: 44px; height: 44px; border-radius: 9px; flex: 0 0 auto; background-color: var(--g20); cursor: pointer; overflow: hidden; }
.pa-thumb.pa-file { display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--g60); text-transform: uppercase; }
.pa-x { width: 30px; height: 30px; border-radius: 50%; border: 0.5px solid var(--bd); background: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.attach-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.attach-error { font-size: 12.5px; color: #B3261E; margin: 8px 0 0; }

/* ---- Animations ---- */
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.55); opacity: .5; } }
@keyframes fadeUp { from { transform: translateY(7px); } to { transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(18px); } to { transform: translateY(0); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes checkPop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fbFileIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fbFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes chipFlash {
  0% { background: var(--white); border-color: var(--bd2); transform: scale(1); }
  15% { background: var(--acc-tint); border-color: var(--acc-bd); transform: scale(1.06); }
  70% { background: var(--acc-tint); border-color: var(--acc-bd); transform: scale(1); }
  100% { background: var(--white); border-color: var(--bd2); transform: scale(1); }
}
.anim-up { animation: fadeUp .28s ease both; }
.anim-in { animation: fadeUp .24s ease both; }
.sheet { animation: slideUp .26s cubic-bezier(.22,.61,.36,1) both; }
.fb-check { animation: checkPop .3s cubic-bezier(.16,1,.3,1) both; }
.sheet-up { animation: sheetUp .26s cubic-bezier(.22,.61,.36,1) both; }
.chip-flash { animation: chipFlash 1.8s cubic-bezier(.22,.61,.36,1) both; }

@media (prefers-reduced-motion: reduce) {
  .anim-up, .anim-in, .sheet, .sheet-up { animation: none !important; }
  .tavi-orb.live .pulse { animation: none !important; }
  [style*="fbFileIn"], [style*="fbFadeUp"] { animation: none !important; }
  .chip-flash { animation: none !important; background: var(--acc-tint); border-color: var(--acc-bd); }
}

/* ---- HTMX loading state ---- */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* ---- Sort dropdown ---- */
.sort-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--white); border: 0.5px solid var(--bd2);
  border-radius: 11px; overflow: hidden; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10); min-width: 130px;
}
.sort-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; border: none; background: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; color: var(--g60);
  border-bottom: 0.5px solid var(--bd);
}
.sort-item:last-child { border-bottom: none; }
.sort-item.active { font-weight: 600; color: var(--black); }

/* ---- Provider question cards ---- */
.q-card { background: var(--g10); }
.q-card-top { border-radius: 11px 11px 0 0; }
.q-card-mid { border-radius: 0; }
.q-card-bot { border-radius: 0 0 11px 11px; }

/* ---- 404 ---- */
.err404 {
  display: flex; flex-direction: column; min-height: 100%;
}
.err404-top { padding: 6px 0 0; flex-shrink: 0; }
.err404-body {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px 0 48px;
}
.err404-code {
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(72px, 22vw, 108px); font-weight: 700;
  line-height: 1; color: var(--black);
  margin-bottom: 4px;
}
.err404-o {
  color: var(--acc); -webkit-text-stroke: 2.5px var(--black);
  position: relative; animation: err404-spin 5s linear infinite;
  display: inline-block; margin: 0 3px;
}
@keyframes err404-spin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .err404-o { animation: none !important; }
}
.q-card-solo { border-radius: 11px; }

/* Toggle switch — workspace notification rows and the provider push row. */
.switch {
  position: relative; width: 32px; height: 19px; border-radius: 100px;
  border: none; background: var(--bd2); padding: 2px; cursor: pointer;
  transition: background .18s; flex-shrink: 0;
}
.switch-on { background: var(--acc); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch-thumb {
  display: block; width: 15px; height: 15px; border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: transform .18s cubic-bezier(0.22,1,0.36,1);
}
.switch-on .switch-thumb { transform: translateX(13px); }
