/*
 * Zozo AI Chat Widget — widget.css
 * Light theme. Primary colour injected via JS into :root --zp-* vars.
 * Inherits from Blocksy CSS vars when present.
 */

:root {
  --zp:       #E8422A;
  --zp-50:    #FEF0ED;
  --zp-100:   #FDD9D3;
  --zp-200:   #FAB3A8;
  --zp-700:   #C73520;
  --zp-ink:   #1a1a1a;
  --zp-ink2:  #555;
  --zp-ink3:  #888;
  --zp-border:#e8e8e8;
  --zp-r:     14px;
  --zp-rsm:   8px;
  --zp-font:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --zp-chat-gutter: 1.25rem;
  --zp-result-card-width: 18.75rem;
  --zp-result-card-media-height: 118px;
}

/* Blocksy override — if Blocksy is active, inherit its vars */
@supports (--test: 0) {
  :root {
    --zp: var(--theme-palette-color-1, #E8422A);
  }
}

/* ── ROOT ── */
#zozo-chat-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000000;
  font-family: var(--zp-font);
  -webkit-font-smoothing: antialiased;
}

/* ── LAUNCHER ── */
#zozo-launcher {
  width: 54px;
  height: 54px;
  background: var(--zp);
  border: none;
  border-radius: 15px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.18), 0 0 0 0 rgba(232,66,42,.3);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
  padding: 0;
  position: relative;
  margin-left: auto;
}
#zozo-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
#zozo-launcher.z-dragging,
#zozo-launcher.z-dragging:hover {
  cursor: grabbing;
  transform: none;
  transition: none;
}
#zozo-launcher .z-logo-img {
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none; -webkit-user-drag: none; user-select: none;
  transition: opacity .2s, transform .2s;
}
#zozo-launcher .z-logo-letter {
  font-size: 22px; font-weight: 800; color: white;
  transition: opacity .2s, transform .2s;
}
#zozo-launcher .z-close-icon {
  position: absolute; color: white;
  opacity: 0; transform: rotate(-90deg) scale(.7);
  transition: opacity .2s, transform .2s;
}
#zozo-launcher.z-open .z-logo-img,
#zozo-launcher.z-open .z-logo-letter {
  opacity: 0; transform: rotate(90deg) scale(.7);
}
#zozo-launcher.z-open .z-close-icon {
  opacity: 1; transform: rotate(0) scale(1);
}
#zozo-launcher.z-open { cursor: pointer; }

/* Badge */
.z-badge {
  position: absolute; top: -4px; right: -4px;
  width: 14px; height: 14px; background: #22c55e;
  border-radius: 50%; border: 2px solid white;
  transition: transform .2s;
}
.z-badge.z-hidden { transform: scale(0); }

/* ── PANEL ── */
#zozo-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 360px;
  height: 520px;
  background: white;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  transform: translateY(12px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
}
#zozo-panel.z-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ── */
.z-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--zp-border);
  background: var(--zp-50);
  flex-shrink: 0;
}
.z-header-left { display: flex; align-items: center; gap: .6rem; }
.z-av {
  width: 36px; height: 36px; border-radius: 10px;
  overflow: hidden; flex-shrink: 0; position: relative;
  background: var(--zp);
  display: flex; align-items: center; justify-content: center;
}
.z-av img { width: 100%; height: 100%; object-fit: cover; }
.z-av span { font-size: 16px; font-weight: 800; color: white; }
.z-av::after {
  content: '';
  position: absolute; bottom: -2px; right: -2px;
  width: 8px; height: 8px; background: #22c55e;
  border-radius: 50%; border: 2px solid var(--zp-50);
  transition: background .3s;
}
.z-av.z-offline::after { background: #d1d5db; }
.z-name { font-size: .88rem; font-weight: 700; color: var(--zp-ink); line-height: 1.2; }
.z-status { font-size: .68rem; color: #16a34a; font-weight: 500; }
.z-status.z-offline-txt { color: var(--zp-ink3); }
.z-header-right { display: flex; align-items: center; gap: .6rem; }
.z-brand { font-size: .6rem; font-weight: 700; letter-spacing: .1em; color: var(--zp-ink3); }
.z-lead-trigger-btn {
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--zp-border); border-radius: 8px;
  background: rgba(255,255,255,.72); color: var(--zp-ink2); cursor: pointer;
}
.z-lead-trigger-btn:hover, .z-lead-trigger-btn:focus-visible { background: white; color: var(--zp); outline: none; }
.z-close-btn {
  display: none; /* hidden on desktop — launcher button closes */
  width: 28px; height: 28px;
  background: var(--zp-50); border: 1px solid var(--zp-100);
  border-radius: 8px; cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--zp-ink2); flex-shrink: 0;
  padding: 0;
}
.z-close-btn:hover { background: var(--zp-100); color: var(--zp); }

/* ── MESSAGES ── */
.z-msgs {
  flex: 1; overflow-y: auto; padding: .9rem var(--zp-chat-gutter) 1rem;
  display: flex; flex-direction: column; gap: .75rem;
  scroll-behavior: smooth; background: #fafafa;
}
.z-msgs::-webkit-scrollbar { width: 3px; }
.z-msgs::-webkit-scrollbar-thumb { background: var(--zp-border); border-radius: 99px; }

.z-msg {
  display: flex; gap: .45rem; align-items: flex-end;
  animation: zFadeUp .25s ease both;
}
.z-msg.z-bot { align-self: flex-start; max-width: 86%; }
.z-msg.z-usr { align-self: flex-end; max-width: 78%; flex-direction: row-reverse; }
.z-bot > div:last-child { min-width: 0; max-width: 100%; }

/* Structured result turns need more horizontal room than prose bubbles.
   Keep the conversational bubble aligned with the avatar, then let the
   governed result presentation span the full safe chat lane beneath it. */
.z-msg.z-bot.z-msg--with-presentation {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: .45rem;
  row-gap: .35rem;
  align-items: end;
}
.z-msg.z-bot.z-msg--with-presentation > .z-msg-av {
  grid-column: 1;
  grid-row: 1;
}
.z-msg.z-bot.z-msg--with-presentation > .z-msg-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
}
.z-msg.z-bot.z-msg--with-presentation > .z-presentation {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
}

@keyframes zFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.z-msg-av {
  width: 26px; height: 26px; border-radius: 8px; overflow: hidden;
  flex-shrink: 0; margin-bottom: 2px; background: var(--zp);
  display: flex; align-items: center; justify-content: center;
}
.z-msg-av img { width: 100%; height: 100%; object-fit: cover; }
.z-msg-av span { font-size: 11px; font-weight: 800; color: white; }

.z-bubble {
  padding: .6rem .85rem; border-radius: 12px;
  font-size: .84rem; line-height: 1.65; font-weight: 400;
}
.z-bot .z-bubble {
  background: white; border: 1px solid var(--zp-border);
  border-bottom-left-radius: 3px; color: var(--zp-ink);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.z-usr .z-bubble {
  background: var(--zp); border-bottom-right-radius: 3px;
  color: white; font-weight: 500;
}

/* Rec card */


/* CTA card */
.z-cta {
  background: white; border: 1px solid var(--zp-border);
  border-left: 3px solid #22c55e;
  border-radius: var(--zp-rsm); padding: .65rem .85rem; margin-top: .35rem;
}
.z-cta-lbl   { font-size: .6rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #16a34a; margin-bottom: .2rem; }
.z-cta-title { font-size: .84rem; font-weight: 700; color: var(--zp-ink); margin-bottom: .1rem; }
.z-cta-note  { font-size: .74rem; color: var(--zp-ink2); line-height: 1.5; }
.z-cta-link  {
  display: inline-flex; align-items: center; gap: .25rem;
  margin-top: .35rem; font-size: .73rem; font-weight: 600;
  color: #16a34a; text-decoration: none; transition: gap .15s;
}
.z-cta-link:hover { gap: .4rem; }

/* Optional lead handoff offer — never a forced form timer. */
.z-lead-offer {
  position: relative; min-width: 0; box-sizing: border-box;
  background: white; border: 1px solid var(--zp-border);
  border-left: 3px solid var(--zp); border-radius: var(--zp-rsm);
  padding: .7rem 2rem .7rem .85rem;
}
.z-lead-offer-eyebrow { font-size: .6rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--zp); margin-bottom: .2rem; }
.z-lead-offer-title { font-size: .84rem; font-weight: 700; color: var(--zp-ink); }
.z-lead-offer-note { margin-top: .14rem; font-size: .7rem; line-height: 1.45; color: var(--zp-ink2); }
.z-lead-offer-btn, .z-lead-offer-keep, .z-lead-offer-dismiss, .z-lead-cancel {
  font-family: var(--zp-font); cursor: pointer;
}
.z-lead-offer-btn {
  margin-top: .4rem; padding: 0; border: 0; background: transparent;
  color: var(--zp); font-size: .74rem; font-weight: 650;
}
.z-lead-offer-keep {
  display: block; margin-top: .28rem; padding: 0; border: 0; background: transparent;
  color: var(--zp-ink2); font-size: .69rem;
}
.z-lead-offer-dismiss {
  position: absolute; top: .4rem; right: .45rem; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--zp-ink3); font-size: 1rem; line-height: 1;
}
.z-lead-offer-dismiss:hover, .z-lead-offer-btn:hover, .z-lead-offer-keep:hover { color: var(--zp-700); }

/* Lead form */
.z-lead {
  min-width: 0; box-sizing: border-box;
  background: white; border: 1px solid var(--zp-border);
  border-radius: var(--zp-rsm); padding: .75rem .85rem; margin-top: .35rem;
}
.z-lead-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-bottom:.5rem; }
.z-lead-lbl { font-size: .6rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--zp); }
.z-lead-cancel { padding:0; border:0; background:transparent; color:var(--zp-ink3); font-size:.67rem; font-weight:600; }
.z-lead-cancel:hover { color:var(--zp); }
.z-lead-inputs { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.z-lead-in {
  border: 1px solid var(--zp-border); border-radius: 6px;
  padding: .42rem .65rem; font-family: var(--zp-font);
  font-size: .78rem; color: var(--zp-ink); outline: none; transition: border-color .18s;
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
}
.z-lead-in:focus { border-color: var(--zp); }
.z-lead-in::placeholder { color: var(--zp-ink3); }
.z-lead-btn {
  background: var(--zp); border: none; border-radius: 6px;
  padding: .45rem .85rem; margin-top: .35rem;
  font-family: var(--zp-font); font-weight: 600; font-size: .75rem;
  color: white; cursor: pointer; transition: background .18s;
  display: inline-flex; align-items: center; gap: .35rem;
}
.z-lead-btn:hover { background: var(--zp-700); }
.z-lead-note { font-size: .65rem; color: var(--zp-ink3); margin-top: .3rem; }
.z-lead-done { font-size: .8rem; color: #16a34a; font-weight: 600; padding: .35rem 0; }
.z-lead-error { margin-top:.45rem; font-size:.68rem; line-height:1.4; color:var(--zp); }

/* Offline message */
.z-offline-msg {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; text-align: center;
  font-size: .84rem; color: var(--zp-ink2); line-height: 1.65;
  background: #fafafa;
}

/* Captcha gate */
#z-captcha-gate {
  background: #fafafa; border-bottom: 1px solid var(--zp-border);
  padding: 1rem; flex-shrink: 0;
}
.z-captcha-q { font-size: .84rem; font-weight: 600; color: var(--zp-ink); margin-bottom: .5rem; }
.z-captcha-row { display: flex; gap: .5rem; align-items: center; }
.z-captcha-in {
  border: 1px solid var(--zp-border); border-radius: 6px;
  padding: .42rem .65rem; font-size: .84rem; width: 80px; outline: none;
}
.z-captcha-in:focus { border-color: var(--zp); }
.z-captcha-btn {
  background: var(--zp); border: none; border-radius: 6px;
  padding: .45rem .85rem; font-weight: 600; font-size: .78rem;
  color: white; cursor: pointer; transition: background .18s;
}
.z-captcha-btn:hover { background: var(--zp-700); }
.z-captcha-err { font-size: .72rem; color: var(--zp); margin-top: .35rem; }

/* ── TYPING ── */
.z-typing {
  display: flex; align-items: center; gap: .45rem;
  padding: 0 .9rem; flex-shrink: 0; min-height: 22px; margin-bottom: .1rem;
}
.z-dots { display: flex; gap: 3px; }
.z-dot {
  width: 5px; height: 5px; background: var(--zp-200);
  border-radius: 50%; animation: zBounce 1.1s infinite;
}
.z-dot:nth-child(2) { animation-delay: .18s; }
.z-dot:nth-child(3) { animation-delay: .36s; }
@keyframes zBounce {
  0%,60%,100% { transform: translateY(0); opacity: .4; }
  30%          { transform: translateY(-4px); opacity: 1; }
}
.z-typing-txt { font-size: .67rem; color: var(--zp-ink3); font-style: italic; }

/* ── QUICK REPLIES ── */
.z-qr-wrap {
  display: flex; flex-wrap: wrap; gap: .3rem;
  padding: 0 .9rem .5rem; flex-shrink: 0; background: #fafafa;
}
.z-qr {
  background: white; border: 1px solid var(--zp-200); border-radius: 100px;
  padding: .28rem .75rem; font-size: .73rem; font-weight: 500;
  color: var(--zp); cursor: pointer; transition: all .15s; white-space: nowrap;
  font-family: var(--zp-font);
}
.z-qr:hover { background: var(--zp-50); }

/* ── INPUT AREA ── */
.z-input-area {
  padding: .65rem .9rem .8rem;
  border-top: 1px solid var(--zp-border);
  background: white; flex-shrink: 0;
}
.z-input-row {
  display: flex; align-items: flex-end; gap: .4rem;
  border: 1px solid var(--zp-border); border-radius: 10px;
  padding: .45rem .45rem .45rem .8rem; transition: border-color .18s;
}
.z-input-row:focus-within { border-color: var(--zp); }
.z-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--zp-font); font-size: .83rem; color: var(--zp-ink);
  font-weight: 400; resize: none; max-height: 80px; line-height: 1.5; padding: .1rem 0;
}
.z-input::placeholder { color: var(--zp-ink3); }
.z-send {
  width: 30px; height: 30px; background: var(--zp); border: none; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .16s; color: white;
}
.z-send:hover { background: var(--zp-700); }
.z-send:disabled { opacity: .35; cursor: not-allowed; }
.z-send svg { width: 13px; height: 13px; }
.z-foot { text-align: center; font-size: .6rem; color: var(--zp-ink3); margin-top: .4rem; }

/* ── Mobile ── */
@media (max-width: 480px) {

  /* Root: stays bottom-right, just wraps the launcher */
  #zozo-chat-root {
    bottom: 16px;
    right: 16px;
    left: auto;
    width: auto;
  }

  /* Hide launcher when panel open — panel has its own close button */
  #zozo-launcher.z-open {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
    transition: opacity .2s, transform .2s;
  }

  /* Panel: anchored to all four edges via inset shorthand.
     Moved to document.body in JS so position:fixed is relative to true viewport.
     No padding here — safe area handled by header only. */
  #zozo-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    transform: translateY(100%);
    transition: transform .3s ease, opacity .2s ease;
  }

  #zozo-panel.z-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  /* Header: top padding absorbs status bar notch */
  .z-header {
    padding-top: calc(.85rem + env(safe-area-inset-top, 0px));
  }

  /* msgs: takes all remaining vertical space, scrolls internally */
  .z-msgs {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
  }

  /* Show close button in header */
  .z-close-btn {
    display: flex !important;
  }

  /* Input area: never shrinks, always visible */
  .z-input-area {
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Prevent iOS auto-zoom on input focus (any input < 16px triggers page zoom) */
  .z-input {
    font-size: 16px;
  }
}
/* ── STRUCTURED RESULT PRESENTATION (Task 8.5 foundation) ── */
.z-presentation {
  margin-top: .5rem;
  width: 100%;
}
.z-result-collapsed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .55rem .7rem;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-rsm);
  background: var(--zp-50);
}
.z-result-collapsed[hidden] { display: none !important; }
.z-result-collapsed-label {
  min-width: 0;
  font-size: .72rem;
  line-height: 1.35;
  color: var(--zp-ink2);
}
.z-result-collapsed-toggle {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  padding: .2rem .1rem;
  background: transparent;
  color: var(--zp);
  font: inherit;
  font-size: .72rem;
  font-weight: 650;
  cursor: pointer;
}
.z-result-collapsed-toggle:focus-visible {
  outline: 2px solid var(--zp);
  outline-offset: 2px;
}
.z-result-summary {
  margin-bottom: .45rem;
  font-size: .72rem;
  line-height: 1.4;
  color: var(--zp-ink3);
}
.z-result-grid {
  display: flex;
  gap: .5rem;
  min-width: 0;
}
.z-result-single {
  overflow: visible;
}
.z-result-single .z-result-card {
  flex: 1 1 100%;
  width: 100%;
}
.z-result-rail {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  padding-bottom: .15rem;
}
.z-result-rail .z-result-card {
  flex: 0 0 min(94%, var(--zp-result-card-width));
  scroll-snap-align: start;
}
.z-result-card {
  overflow: hidden;
  background: white;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-rsm);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.z-result-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--zp-50);
}
.z-result-card-body { padding: .7rem .8rem; }
.z-result-card-title {
  font-size: .82rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--zp-ink);
}
.z-result-card-summary {
  margin-top: .25rem;
  font-size: .72rem;
  line-height: 1.5;
  color: var(--zp-ink2);
}
.z-result-card-facts {
  margin: .5rem 0 0;
  padding: .45rem 0 0;
  border-top: 1px solid var(--zp-border);
}
.z-result-card-fact {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: .5rem;
  margin-top: .25rem;
  font-size: .68rem;
  line-height: 1.4;
}
.z-result-card-fact:first-child { margin-top: 0; }
.z-result-card-fact dt { color: var(--zp-ink3); }
.z-result-card-fact dd {
  margin: 0;
  color: var(--zp-ink);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.z-result-card-link,
.z-result-all-link {
  display: inline-flex;
  margin-top: .55rem;
  font-size: .72rem;
  line-height: 1.3;
  font-weight: 650;
  color: var(--zp);
  text-decoration: none;
}
.z-result-card-link:hover,
.z-result-all-link:hover { text-decoration: underline; }
.z-result-all-link { margin-top: .6rem; }

@media (max-width: 480px) {
  .z-presentation { margin-top: .45rem; }
  .z-result-card-body { padding: .7rem; }
  .z-result-card-fact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ── GOVERNED ACTION DISCOVERY (Task 9.1) ── */
.z-actions {
  display: grid;
  gap: .45rem;
  margin-top: .55rem;
}
.z-action {
  min-width: 0;
}
.z-action-btn,
.z-action-submit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  max-width: 100%;
  padding: .48rem .72rem;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-rsm);
  background: var(--zp-50);
  color: var(--zp-ink);
  font: inherit;
  font-size: .74rem;
  line-height: 1.25;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.z-action-btn--primary {
  border-color: var(--zp);
  background: var(--zp);
  color: white;
}
.z-action-btn:hover { border-color: var(--zp); }
.z-action-btn:focus-visible,
.z-action-submit:focus-visible,
.z-action-input:focus-visible {
  outline: 2px solid var(--zp);
  outline-offset: 2px;
}
.z-action-panel {
  margin-top: .4rem;
  padding: .65rem;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-rsm);
  background: white;
}
.z-action-panel[hidden] { display: none !important; }

.z-action-subject {
  margin: 0 0 6px;
  font-size: 0.82em;
  font-weight: 600;
  opacity: 0.72;
}
.z-action-description,
.z-action-help,
.z-action-status {
  font-size: .68rem;
  line-height: 1.45;
  color: var(--zp-ink2);
}
.z-action-field {
  display: grid;
  gap: .25rem;
  margin-top: .55rem;
  font-size: .7rem;
}
.z-action-label { color: var(--zp-ink); font-weight: 650; }
.z-action-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: .45rem .55rem;
  border: 1px solid var(--zp-border);
  border-radius: var(--zp-rsm);
  background: white;
  color: var(--zp-ink);
  font: inherit;
}
textarea.z-action-input { min-height: 72px; resize: vertical; }
.z-action-field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
}
.z-action-field--check .z-action-input { width: auto; min-height: 0; margin-top: .15rem; }
.z-action-field--check .z-action-help { grid-column: 2; }
.z-action-status { margin-top: .6rem; }
.z-action-submit { margin-top: .55rem; }
.z-action-submit:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 480px) {
  .z-action-btn, .z-action-submit { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .z-action-btn, .z-action-submit, .z-action-input { transition: none; }
}

/* Task 9.2 governed action review + authoritative outcome states */
.z-action-review {
  display: grid;
  gap: .45rem;
  margin: .65rem 0;
  padding: .7rem;
  border: 1px solid color-mix(in srgb, var(--zp) 18%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--zp) 5%, transparent);
}
.z-action-review[hidden], .z-action-strong-confirm[hidden], .z-action-outcome[hidden] { display: none !important; }
.z-action-review-title { font-weight: 700; color: var(--zp-ink); }
.z-action-review-subject { font-size: .88rem; color: var(--zp-muted); }
.z-action-review-row { display: flex; justify-content: space-between; gap: .8rem; font-size: .88rem; }
.z-action-review-label { color: var(--zp-muted); }
.z-action-strong-confirm { display: flex; align-items: flex-start; gap: .5rem; margin: .55rem 0; font-size: .88rem; }
.z-action-strong-confirm input { margin-top: .18rem; }
.z-action-outcome {
  margin-top: .6rem;
  padding: .65rem .7rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--zp) 6%, transparent);
  font-size: .88rem;
}
.z-action-outcome { border-inline-start: 3px solid var(--zp-200); }
.z-action-outcome-state { font-weight: 700; color: var(--zp-ink); margin-bottom: .2rem; }
.z-action-outcome-ref { margin-top: .35rem; color: var(--zp-muted); }

.z-action-async-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .65rem;
}
.z-action-async-btn {
  min-height: 38px;
  padding: .45rem .75rem;
  border: 1px solid var(--zp-200);
  border-radius: 999px;
  background: transparent;
  color: var(--zp-ink);
  font: inherit;
  cursor: pointer;
}
.z-action-async-btn:focus-visible { outline: 2px solid var(--zp); outline-offset: 2px; }
.z-action-async-btn:disabled { opacity: .55; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .z-action-async-btn { transition: none; } }


/* ── TASK 8.11 COMPACT PROVIDER RESULT CARD ── */
.z-result-card--compact { min-width: 0; }
.z-result-card--compact.z-result-card--media-left {
  display: grid;
  grid-template-columns: minmax(0, 35%) minmax(0, 1fr);
  align-items: stretch;
  min-height: var(--zp-result-card-media-height);
}
.z-result-card--media-left .z-result-card-image-link { display: block; min-width: 0; height: 100%; min-height: var(--zp-result-card-media-height); overflow: hidden; }
.z-result-card--media-left .z-result-card-image { width: 100%; height: 100%; min-height: var(--zp-result-card-media-height); aspect-ratio: auto; object-fit: cover; }
.z-result-card--media-left .z-result-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: .78rem .82rem;
}
.z-result-card--media-top .z-result-card-image-link { display: block; overflow: hidden; }
.z-result-card--media-top .z-result-card-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.z-result-card--no-media { display: block; min-height: 0; }
.z-result-card--no-media .z-result-card-body { width: 100%; }
.z-result-card--compact .z-result-card-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--zp-ink);
  text-decoration: none;
  font-size: .84rem;
  line-height: 1.28;
}
.z-result-card--compact .z-result-card-meta { margin-top: .32rem; color: var(--zp-ink3); font-size: .71rem; line-height: 1.35; }
.z-result-card--compact .z-result-card-price { margin-top: .48rem; color: var(--zp-ink); font-size: .96rem; line-height: 1.2; font-weight: 750; }
@media (max-width: 330px) {
  .z-result-card--compact.z-result-card--media-left { display: block; }
  .z-result-card--media-left .z-result-card-image { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
}

/* ── Desktop expanded workspace ──
   Visitor-controlled overlay mode for rich cards/results. It never reflows the
   host theme and is ignored by the existing <=480px full-screen mobile model. */
.z-expand-btn {
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--zp-border); border-radius: 8px;
  background: rgba(255,255,255,.72); color: var(--zp-ink2); cursor: pointer;
}
.z-expand-btn:hover { background: white; color: var(--zp); }
#zozo-panel.z-panel--expanded {
  position: fixed !important;
  top: 12px !important; right: 12px !important; bottom: 12px !important; left: auto !important;
  width: min(460px, calc(100vw - 24px)) !important;
  height: auto !important; max-height: none !important;
  border-radius: 18px;
  z-index: 1000001;
}
#zozo-panel.z-panel--expanded .z-close-btn { display: flex; }
@media (max-width: 480px) {
  .z-expand-btn { display: none !important; }
  #zozo-panel.z-panel--expanded { inset: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0 !important; }
}

/* Lead form verification: the contact action always opens. If the session has
   not passed the bot check yet, verification lives inside Quick Details. */
.z-lead-captcha {
  margin: .65rem 0 .75rem;
  padding: .7rem;
  border: 1px solid var(--zp-border);
  border-radius: 10px;
  background: var(--zp-50);
}
.z-lead-captcha .z-captcha-q { margin-bottom: .4rem; }
.z-lead-captcha .z-captcha-in { width: 100%; min-height: 40px; box-sizing: border-box; }
