/* Zara — ZiCMA assistant concept.
   Tokens follow zicmatest.info: Inter Regular/Bold/Black, navy #1B2745, slate #53607C,
   mist #E9F2F4 / #F4FAFC, line #BBD2E0, brand green #00A600, accent teal #2FBAB3. */

:root {
  --z-navy: #1B2745;
  --z-navy-deep: #121A2F;
  --z-slate: #53607C;
  --z-muted: #8391AB;
  --z-mist: #E9F2F4;
  --z-mist-2: #F4FAFC;
  --z-line: #BBD2E0;
  --z-line-soft: #DAE8F0;
  --z-green: #00A600;
  --z-green-dark: #008400;
  --z-teal: #2FBAB3;
  --z-blue: #3E89F7;
  --z-white: #fff;
  --z-font: "Inter Regular", Arial, Helvetica, sans-serif;
  --z-font-bold: "Inter Bold", Arial, Helvetica, sans-serif;
  --z-font-black: "Inter Black", Arial, Helvetica, sans-serif;
  --z-ease: cubic-bezier(.2, .8, .2, 1);
  --z-spring: cubic-bezier(.34, 1.36, .64, 1);
  --z-shadow-float: 0 16px 40px rgba(8, 12, 22, .14), 0 2px 6px rgba(8, 12, 22, .08);
  --z-shadow-panel: 0 64px 96px rgba(27, 39, 69, .18), 0 8px 24px rgba(27, 39, 69, .08);
}

.zara, .zara * { box-sizing: border-box; }
.zara { font-family: var(--z-font); color: var(--z-navy); -webkit-font-smoothing: antialiased; }
:where(.zara) button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
:where(.zara) svg { display: block; flex: none; }
.zara [hidden] { display: none !important; }

/* ── Symbol ─────────────────────────────────────────── */
.z-symbol {
  position: relative;
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  flex: none;
}
.z-symbol::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120% 120% at 30% 20%, #2A3A63 0%, var(--z-navy) 55%, var(--z-navy-deep) 100%);
  transition: opacity .3s var(--z-ease);
}
.z-symbol svg { position: relative; width: 26px; height: 26px; }
.z-symbol--sm { width: 36px; height: 36px; }
.z-symbol--sm svg { width: 18px; height: 18px; }
.z-symbol--xs { width: 28px; height: 28px; }
.z-symbol--xs svg { width: 14px; height: 14px; }
.z-symbol--lg { width: 64px; height: 64px; }
.z-symbol--lg svg { width: 30px; height: 30px; }
.z-orb .z-symbol svg { width: 46%; height: 46%; }

/* ── Dock: states 1 and 2 are one morphing pill ─────── */
.z-dock {
  position: fixed; left: 0; right: 0; bottom: 28px; z-index: 2147483000;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
  transition: opacity .2s var(--z-ease);
}
.z-dock > * { pointer-events: auto; }
.zara[data-state="chat"] .z-dock { opacity: 0; transition-duration: .16s; }
.zara[data-state="chat"] .z-dock > * { pointer-events: none; }

.z-pill {
  --w: 56px; --h: 56px; --r: 28px;
  position: relative;
  width: var(--w); height: var(--h);
  border-radius: var(--r);
  background: var(--z-navy);
  box-shadow: 0 14px 34px rgba(8, 12, 22, .22), 0 2px 6px rgba(8, 12, 22, .12);
  transition:
    width .5s var(--z-spring) .04s,
    height .32s var(--z-ease),
    border-radius .5s var(--z-ease),
    background-color .28s var(--z-ease),
    box-shadow .35s var(--z-ease),
    transform .2s var(--z-ease);
}
.zara[data-state="idle"] .z-pill:hover,
.zara[data-state="idle"] .z-pill:has(.z-launch:focus-visible) { --w: var(--w-hover, 172px); }
/* just returned from the chat or composer: stay a bare symbol until the pointer leaves */
.zara[data-state="idle"] .z-pill.is-settled:hover { --w: 56px; }
.zara[data-state="idle"] .z-pill.is-settled .z-launch-label { opacity: 0 !important; transform: translateX(-10px) !important; filter: blur(3px) !important; transition-delay: 0s !important; }
.zara[data-state="idle"] .z-pill.is-settled:hover .z-orb::before { opacity: 1; }
.zara[data-state="idle"] .z-pill:active { transform: scale(.96); }
/* the launcher's lit navy surface spans the whole pill; it fades as the pill turns white */
.z-pill::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(90px 70px at 22px 8px, rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 70%),
    linear-gradient(170deg, #2B3C66 0%, var(--z-navy) 55%, var(--z-navy-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .3);
  transition: opacity .3s var(--z-ease);
}
.zara[data-state="compose"] .z-pill::after { opacity: 0; }
.zara[data-state="idle"] .z-orb .z-symbol::before { opacity: 0; }
.zara[data-state="idle"] .z-pill.is-arriving { animation: z-arrive .55s var(--z-spring) both; }
@keyframes z-arrive { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.zara[data-state="compose"] .z-pill {
  --w: min(680px, calc(100vw - 40px)); --h: var(--z-pill-h, 64px); --r: 22px;
  background: var(--z-white);
  box-shadow: 0 0 0 1px rgba(187, 210, 224, .95), 0 1px 2px rgba(27, 39, 69, .06), 0 12px 32px rgba(27, 39, 69, .10);
  transition:
    width .55s var(--z-spring),
    height .32s var(--z-ease),
    border-radius .45s var(--z-ease),
    background-color .22s var(--z-ease) .06s,
    box-shadow .35s var(--z-ease);
}
.zara[data-state="compose"] .z-pill:focus-within {
  box-shadow: 0 0 0 1.5px var(--z-navy), 0 0 0 5px rgba(47, 186, 179, .14), 0 12px 32px rgba(27, 39, 69, .12);
}

/* persistent orb: the same symbol travels from launcher centre to the composer's left edge */
.z-orb {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  width: 56px; height: 56px;
  pointer-events: none;
  transition: left .5s var(--z-spring), bottom .32s var(--z-ease), width .45s var(--z-spring), height .45s var(--z-spring);
}
.z-orb .z-symbol { width: 100%; height: 100%; transition: box-shadow .3s; }
.zara[data-state="compose"] .z-orb { left: 12px; bottom: 12px; width: 40px; height: 40px; }

/* living rim on the idle orb */
.z-orb::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from var(--z-a, 0deg), rgba(47, 186, 179, 0) 0deg, rgba(47, 186, 179, .9) 70deg, rgba(138, 245, 204, 1) 110deg, rgba(47, 186, 179, 0) 170deg, rgba(47, 186, 179, 0) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: z-rim 5s linear infinite;
  transition: opacity .25s;
}
.zara[data-state="compose"] .z-orb::before,
.zara[data-state="idle"] .z-pill:hover .z-orb::before { opacity: 0; }
@property --z-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes z-rim { to { --z-a: 360deg; } }

/* badge: an open conversation is waiting */
.z-badge {
  position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%;
  background: #3DDC84; border: 2px solid var(--z-navy); display: none;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: z-badge 2.4s ease-out infinite;
}
.zara.has-session[data-state="idle"] .z-badge { display: block; }
@keyframes z-badge { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); } }

/* launcher layer (click target + label) */
.z-launch {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding-left: 52px; z-index: 1;
  border-radius: inherit; overflow: hidden;
  color: #fff; white-space: nowrap;
}
.z-launch-label {
  font-family: var(--z-font-bold); font-size: 15px; letter-spacing: -.01em;
  opacity: 0; transform: translateX(-10px); filter: blur(3px);
  transition: opacity .18s var(--z-ease), transform .3s var(--z-ease), filter .3s var(--z-ease);
}
.zara[data-state="idle"] .z-pill:hover .z-launch-label,
.zara[data-state="idle"] .z-pill:has(.z-launch:focus-visible) .z-launch-label { opacity: 1; transform: none; filter: none; transition-delay: .12s; }
.zara[data-state="compose"] .z-launch { pointer-events: none; }

/* composer layer */
.z-compose {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 10px 10px 64px; z-index: 1;
  opacity: 0; transform: translateX(-12px); pointer-events: none;
  transition: opacity .12s var(--z-ease), transform .2s var(--z-ease);
}
.zara[data-state="compose"] .z-compose {
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .3s var(--z-ease) .2s, transform .45s var(--z-ease) .2s;
}

/* glass halo around the composer */
.z-glass {
  position: absolute; inset: -10px; z-index: -1;
  border-radius: calc(var(--r) + 10px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .62) 0%, rgba(244, 250, 252, .34) 100%);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(187, 210, 224, .35),
    0 0 0 1px rgba(27, 39, 69, .06),
    0 24px 56px rgba(27, 39, 69, .16);
  opacity: 0; transform: scale(.82);
  transition: opacity .2s var(--z-ease), transform .5s var(--z-spring), border-radius .45s var(--z-ease);
  pointer-events: none;
}
/* light catching the rim */
.z-glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .15) 38%, rgba(255, 255, 255, 0) 60%, rgba(47, 186, 179, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.zara[data-state="compose"] .z-glass { opacity: 1; transform: none; transition: opacity .35s var(--z-ease) .08s, transform .6s var(--z-spring) .04s, border-radius .45s var(--z-ease); }

.z-input {
  flex: 1; min-width: 0; align-self: center;
  border: 0; outline: 0; resize: none; background: transparent;
  font-family: var(--z-font); font-size: 16px; line-height: 24px; color: var(--z-navy);
  max-height: 120px; padding: 0; margin: 0; overflow-y: hidden;
}
.z-input::placeholder { color: var(--z-muted); }

.z-icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--z-slate);
  transition: background-color .15s, color .15s, transform .15s;
  margin-bottom: 4px;
}
.z-icon-btn:hover { background: var(--z-mist); color: var(--z-navy); }
.z-icon-btn:focus-visible { outline: 2px solid var(--z-blue); outline-offset: 2px; }
.z-icon-btn svg { width: 18px; height: 18px; }

.z-send {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--z-navy); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: background-color .2s, color .2s, box-shadow .2s, transform .15s;
}
.z-send:hover:not(:disabled) { background: #26365E; }
.z-send:active:not(:disabled) { transform: scale(.94); }
.z-send:disabled { background: var(--z-mist); color: var(--z-muted); box-shadow: none; cursor: default; }
.z-send svg { width: 20px; height: 20px; transition: transform .25s var(--z-spring); }
.z-send:not(:disabled):hover svg { transform: translateY(-2px); }
.z-send.is-stop { background: var(--z-navy); }

/* suggestions above the composer */
.z-suggest {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  width: min(680px, calc(100vw - 40px)); /* aligned with the composer's left edge */
  margin-bottom: 10px;
  pointer-events: none;
}
.z-suggest-row { display: flex; flex-wrap: wrap; gap: 8px; }
.z-suggest .z-chip {
  opacity: 0; transform: translateY(10px) scale(.96);
  transition: opacity .2s var(--z-ease), transform .3s var(--z-ease), background-color .15s, box-shadow .15s;
}
.zara[data-state="compose"] .z-suggest.is-on { pointer-events: auto; }
.zara[data-state="compose"] .z-suggest.is-on .z-chip {
  opacity: 1; transform: none;
  transition: opacity .35s var(--z-ease) calc(.28s + var(--i, 0) * .06s), transform .5s var(--z-spring) calc(.28s + var(--i, 0) * .06s), background-color .15s, box-shadow .15s;
}
.z-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  font-size: 14px; color: var(--z-navy);
  background: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .66));
  border: 0;
  backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(187, 210, 224, .75), 0 6px 18px rgba(27, 39, 69, .10);
  white-space: nowrap;
}
.z-chip:hover { background: #fff; box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--z-navy), 0 8px 22px rgba(27, 39, 69, .12); }
.z-chip svg { width: 15px; height: 15px; color: var(--z-slate); }
.z-suggest .z-chip--fn {
  gap: 7px; padding: 0 12px 0 11px;
  font-family: var(--z-font-bold); font-size: 13.5px; color: #fff;
  background: linear-gradient(170deg, #2B3C66, var(--z-navy) 60%, var(--z-navy-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 6px 18px rgba(27, 39, 69, .24);
}
.z-chip--fn svg { color: #8AF5CC; }
.z-chip--fn em { font-style: normal; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-right: -4px; border-radius: 10px; background: rgba(255, 255, 255, .14); font-size: 11.5px; }
.z-suggest .z-chip--fn:hover { background: var(--z-navy); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 0 0 1px #8AF5CC, 0 8px 22px rgba(27, 39, 69, .28); }
/* functions are not questions: they stay while typing */
.zara[data-state="compose"] .z-suggest-fn .z-chip {
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .35s var(--z-ease) .28s, transform .5s var(--z-spring) .28s, background-color .15s, box-shadow .15s;
}
.z-suggest .z-chip--human { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 0 0 1px rgba(0, 166, 0, .45), 0 6px 18px rgba(27, 39, 69, .10); }
.z-chip--resume { background: linear-gradient(180deg, #2B3C66, var(--z-navy)); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 6px 18px rgba(27, 39, 69, .22); }
.z-chip--resume svg { color: #8AF5CC; }
.z-chip--resume:hover { background: var(--z-navy); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 0 0 1px var(--z-navy), 0 8px 22px rgba(27, 39, 69, .26); }

/* ── State 3: chat panel ────────────────────────────── */
.z-scrim {
  position: fixed; inset: 0; z-index: 2147482990;
  background: radial-gradient(120% 90% at 50% 100%, rgba(18, 26, 47, .42), rgba(18, 26, 47, .24));
  backdrop-filter: blur(6px) saturate(1.15); -webkit-backdrop-filter: blur(6px) saturate(1.15);
  opacity: 0; pointer-events: none;
  transition: opacity .4s var(--z-ease);
}
.zara[data-state="chat"] .z-scrim { opacity: 1; pointer-events: auto; }

.z-panel {
  position: fixed; z-index: 2147482995;
  top: 40px; bottom: 40px; left: 50%;
  width: min(1240px, calc(100vw - 112px));
  transform: translateX(-50%);
  display: grid; grid-template-columns: 280px 1fr;
  background: var(--z-white);
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(187, 210, 224, .6), var(--z-shadow-panel);
  overflow: hidden;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .25s var(--z-ease), visibility 0s .25s;
}
.zara[data-state="chat"] .z-panel {
  opacity: 1; pointer-events: auto; visibility: visible;
  transition: opacity .25s var(--z-ease), visibility 0s;
}
/* during the clip morph the panel content arrives a beat after the surface */
.z-panel.is-morphing { box-shadow: none; }

/* sidebar */
.z-side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--z-mist-2);
  border-right: 1px solid var(--z-mist);
}
.z-side-head { display: flex; align-items: center; gap: 9px; padding: 16px 12px 12px 16px; }
.z-wordmark { flex: 1; min-width: 0; font-family: var(--z-font-black); font-size: 13.5px; letter-spacing: -.01em; line-height: 1; }
.z-wordmark small { display: block; margin-top: 2px; font-family: var(--z-font); font-size: 10.5px; letter-spacing: 0; color: var(--z-slate); }
.z-side-head .z-new { margin: 0; width: 34px; height: 34px; border-radius: 10px; color: var(--z-navy); background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft); }
.z-side-head .z-new:hover { background: var(--z-green); color: #fff; box-shadow: none; }
.z-side-head .z-new svg { width: 18px; height: 18px; }
.z-search {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 6px 16px; height: 36px; padding: 0 12px; border-radius: 8px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft);
  color: var(--z-muted);
}
.z-search svg { width: 16px; height: 16px; }
.z-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 14px var(--z-font); color: var(--z-navy); }
.z-search:focus-within { box-shadow: inset 0 0 0 1.5px var(--z-navy); }

.z-sessions { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
.z-group-label {
  padding: 14px 12px 6px; font-family: var(--z-font-bold); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--z-muted);
}
.z-session {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px;
  transition: background-color .12s;
}
.z-session:hover { background: rgba(145, 179, 199, .16); }
.z-session.is-active { background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft), 0 1px 2px rgba(27, 39, 69, .05); }
.z-session-title { display: block; font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-session-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--z-muted); }
.z-tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px;
  font-family: var(--z-font-bold); font-size: 10.5px; letter-spacing: .02em;
  background: var(--z-mist); color: var(--z-slate);
}
.z-tag--registry { background: #E3F6E3; color: #0B6B0B; }
.z-tag--guide { background: #E5EFFE; color: #0744A0; }
.z-tag--rules { background: #F1ECFB; color: #5A3E9B; }
.z-empty-list { padding: 16px 12px; font-size: 13px; color: var(--z-muted); }

.z-side-foot {
  margin: 0 12px 12px; padding: 12px; border-radius: 10px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft);
  font-size: 12px; line-height: 17px; color: var(--z-slate);
  display: flex; gap: 10px;
}
.z-side-foot svg { width: 16px; height: 16px; color: var(--z-slate); margin-top: 1px; }
.z-side-foot a { color: var(--z-navy); font-family: var(--z-font-bold); text-decoration: none; }
.z-side-foot a:hover { text-decoration: underline; }

/* main column */
.z-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.z-main-head {
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 16px 0 28px;
  border-bottom: 1px solid var(--z-mist);
}
.z-main-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.z-main-title h2 {
  margin: 0; font-family: var(--z-font-bold); font-size: 16px; font-weight: normal;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.z-scope {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 12px; color: var(--z-slate); background: var(--z-mist-2); box-shadow: inset 0 0 0 1px var(--z-line-soft);
  white-space: nowrap;
}
.z-scope i { width: 6px; height: 6px; border-radius: 50%; background: var(--z-green); }
.z-head-actions { display: flex; align-items: center; gap: 4px; }
.z-head-actions .z-icon-btn { margin: 0; width: 38px; height: 38px; }
.z-menu-btn { display: none !important; }

.z-thread { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.z-thread-inner { max-width: 780px; margin: 0 auto; padding: 32px 28px 24px; }

/* welcome */
.z-welcome { padding: 6vh 0 8px; text-align: center; }
.z-welcome .z-symbol { margin: 0 auto 20px; }
.z-welcome h3 { margin: 0 0 10px; font-family: var(--z-font-black); font-weight: normal; font-size: 32px; letter-spacing: -.02em; }
.z-welcome p { margin: 0 auto; max-width: 520px; font-size: 16px; line-height: 24px; color: var(--z-slate); }
.z-caps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 32px; text-align: left; }
.z-cap {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border-radius: 12px; text-align: left; text-decoration: none; color: inherit;
  background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft);
  transition: box-shadow .15s, transform .15s;
}
.z-cap:hover { box-shadow: inset 0 0 0 1px var(--z-navy), 0 6px 18px rgba(27, 39, 69, .06); }
.z-cap-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--z-mist-2); color: var(--z-navy); flex: none; }
.z-cap-ico svg { width: 18px; height: 18px; }
.z-cap b { display: block; font-family: var(--z-font-bold); font-weight: normal; font-size: 14px; margin-bottom: 3px; }
.z-cap span { display: block; font-size: 13px; line-height: 18px; color: var(--z-slate); }
.z-cap.is-locked { opacity: .75; }
.z-cap.is-locked .z-cap-ico { background: var(--z-mist); color: var(--z-muted); }

/* messages */
.z-msg { margin-bottom: 28px; animation: z-in .35s var(--z-ease) both; }
@keyframes z-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.z-msg--user { display: flex; justify-content: flex-end; }
.z-bubble {
  max-width: 78%; padding: 12px 16px; border-radius: 18px 18px 4px 18px;
  background: var(--z-mist); font-size: 15px; line-height: 23px; white-space: pre-wrap; word-wrap: break-word;
}
.z-msg--ai { display: grid; grid-template-columns: 28px 1fr; gap: 14px; }
.z-ai-body { min-width: 0; padding-top: 3px; }
.z-ai-name { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--z-font-bold); font-size: 14px; }
.z-ai-name .z-restored { font-family: var(--z-font); font-size: 12px; color: var(--z-muted); }
.z-ai-text { font-size: 15px; line-height: 24px; color: var(--z-navy); }
.z-ai-text p { margin: 0 0 12px; }
.z-ai-text p:last-child { margin-bottom: 0; }
.z-ai-text ol, .z-ai-text ul { margin: 0 0 12px; padding-left: 22px; }
.z-ai-text li { margin-bottom: 6px; }
.z-ai-text b { font-family: var(--z-font-bold); font-weight: normal; }
.z-ai-text a { color: var(--z-blue); text-decoration: none; }
.z-ai-text a:hover { text-decoration: underline; }
.z-cite {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px;
  border-radius: 5px; vertical-align: 2px;
  font-family: var(--z-font-bold); font-size: 11px; line-height: 1;
  background: var(--z-mist); color: var(--z-slate); cursor: pointer;
}
.z-cite:hover { background: var(--z-navy); color: #fff; }

/* progress (tool steps) */
.z-steps { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 14px; }
.z-step { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--z-slate); }
.z-step-dot { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
.z-step-dot svg { width: 16px; height: 16px; }
.z-step.is-done { color: var(--z-muted); }
.z-step.is-done .z-step-dot { color: var(--z-green); }
.z-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--z-line-soft); border-top-color: var(--z-teal); animation: z-spin .8s linear infinite; }
@keyframes z-spin { to { transform: rotate(360deg); } }
.z-steps.is-collapsed { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.z-steps.is-collapsed .z-step { font-size: 12.5px; }

/* rich blocks */
.z-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 16px; }
.z-stat { padding: 14px 14px 12px; border-radius: 12px; background: var(--z-mist-2); box-shadow: inset 0 0 0 1px var(--z-line-soft); }
.z-stat b { display: block; font-family: var(--z-font-black); font-weight: normal; font-size: 22px; letter-spacing: -.01em; line-height: 28px; }
.z-stat span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--z-slate); }

.z-table-wrap { margin: 4px 0 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--z-line-soft); overflow: hidden; overflow-x: auto; }
.z-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.z-table th { text-align: left; padding: 10px 14px; background: var(--z-mist-2); font-family: var(--z-font-bold); font-weight: normal; font-size: 12px; color: var(--z-slate); border-bottom: 1px solid var(--z-line-soft); white-space: nowrap; }
.z-table td { padding: 10px 14px; border-bottom: 1px solid var(--z-mist); white-space: nowrap; }
.z-table tr:last-child td { border-bottom: 0; }
.z-table td.num, .z-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.z-callout {
  display: flex; gap: 10px; margin: 4px 0 14px; padding: 12px 14px; border-radius: 10px;
  background: #FFF8E6; box-shadow: inset 0 0 0 1px #F3DFA8; font-size: 13.5px; line-height: 20px; color: #6B5310;
}
.z-callout svg { width: 18px; height: 18px; margin-top: 1px; }

.z-sources { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.z-source {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  height: 32px; padding: 0 12px 0 6px; border-radius: 8px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft);
  font-size: 13px; color: var(--z-navy); text-decoration: none;
  transition: box-shadow .15s;
}
.z-source:hover { box-shadow: inset 0 0 0 1px var(--z-navy); }
.z-source.is-flash { box-shadow: inset 0 0 0 1.5px var(--z-teal), 0 0 0 4px rgba(47, 186, 179, .15); }
.z-source em { font-style: normal; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--z-mist); font-family: var(--z-font-bold); font-size: 11px; color: var(--z-slate); }
.z-source span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-source small { color: var(--z-muted); font-size: 12px; }

.z-ai-actions { display: flex; align-items: center; gap: 2px; margin-top: 12px; margin-left: -8px; }
.z-ai-actions .z-icon-btn { width: 32px; height: 32px; margin: 0; }
.z-ai-actions .z-icon-btn svg { width: 16px; height: 16px; }
.z-ai-actions .z-icon-btn.is-on { color: var(--z-green); background: #E3F6E3; }
.z-provenance { margin-left: 8px; font-size: 12px; color: var(--z-muted); }

.z-caret { display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--z-teal); animation: z-blink 1s steps(2) infinite; }
@keyframes z-blink { 50% { opacity: 0; } }

.z-followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.z-followups .z-chip { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; box-shadow: 0 0 0 1px var(--z-line-soft); height: 32px; font-size: 13px; }
.z-followups .z-chip:hover { box-shadow: 0 0 0 1px var(--z-navy); }

/* bottom composer inside the panel */
.z-foot { padding: 0 28px 18px; }
.z-foot-inner { max-width: 780px; margin: 0 auto; }
.z-box {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px; border-radius: 20px;
  background: #fff; box-shadow: 0 0 0 1px var(--z-line), 0 8px 24px rgba(27, 39, 69, .06);
  transition: box-shadow .15s;
}
.z-box:focus-within { box-shadow: 0 0 0 1.5px var(--z-navy), 0 8px 24px rgba(27, 39, 69, .08); }
.z-box .z-input { padding-left: 8px; }
.z-disclaimer { margin: 10px 0 0; text-align: center; font-size: 12px; line-height: 17px; color: var(--z-muted); }

/* ── Talk to a person (ticket to a ZiCMA representative) ── */
.z-head-actions .z-human-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 12px; border-radius: 18px;
  font-family: var(--z-font-bold); font-size: 13px; color: var(--z-navy);
  box-shadow: inset 0 0 0 1px var(--z-line-soft);
  transition: box-shadow .15s, background-color .15s;
}
.z-human-btn:hover { background: var(--z-mist-2); box-shadow: inset 0 0 0 1px var(--z-navy); }
.z-human-btn svg { width: 17px; height: 17px; color: var(--z-green); }
.z-head-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--z-mist); }

.z-chip--human svg { color: var(--z-green); }
.z-followups .z-chip--human, .z-fb-hint .z-chip--human { box-shadow: 0 0 0 1px rgba(0, 166, 0, .35); background: #F3FBF3; }
.z-followups .z-chip--human:hover, .z-fb-hint .z-chip--human:hover { box-shadow: 0 0 0 1px var(--z-green); background: #EAF7EA; }
.z-fb-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--z-slate); animation: z-in .3s var(--z-ease) both; }
.z-fb-hint .z-chip { height: 32px; font-size: 13px; backdrop-filter: none; }

.z-human-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 12px; padding: 14px 16px; border-radius: 12px; text-align: left;
  background: #F3FBF3; box-shadow: inset 0 0 0 1px rgba(0, 166, 0, .25);
  transition: box-shadow .15s, background-color .15s;
}
.z-human-link:hover { background: #EAF7EA; box-shadow: inset 0 0 0 1px var(--z-green); }
.z-human-link .z-cap-ico { background: #fff; color: var(--z-green); }
.z-human-link > span:nth-child(2) { flex: 1; }
.z-human-link b { display: block; font-family: var(--z-font-bold); font-weight: normal; font-size: 14px; margin-bottom: 3px; }
.z-human-link span span { display: block; font-size: 13px; line-height: 18px; color: var(--z-slate); }
.z-human-link > svg { width: 18px; height: 18px; color: var(--z-green); transition: transform .2s var(--z-ease); }
.z-human-link:hover > svg { transform: translateX(3px); }

.z-tag--ticket { background: #FFF1DE; color: #8A4B00; }

/* ticket card in the thread */
.z-msg--ticket { display: flex; justify-content: center; }
.z-tcard {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px;
  padding: 12px 14px; border-radius: 14px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft), 0 4px 14px rgba(27, 39, 69, .05);
}
.z-tcard-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #EAF7EA; color: var(--z-green); flex: none; }
.z-tcard-ico svg { width: 18px; height: 18px; }
.z-tcard-body { flex: 1; min-width: 0; }
.z-tcard-body b { display: block; font-family: var(--z-font-bold); font-weight: normal; font-size: 14px; }
.z-tcard-body span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--z-slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-tcard-status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; background: #FFF1DE; color: #8A4B00; font-family: var(--z-font-bold); font-size: 11.5px; white-space: nowrap; }
.z-tcard-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #F29A1F; }

/* the ticket sheet */
.z-ticket {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(244, 250, 252, .62);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--z-ease), visibility 0s .25s;
}
.z-panel.ticket-open .z-ticket { opacity: 1; visibility: visible; transition: opacity .25s var(--z-ease), visibility 0s; }
.z-ticket-card {
  position: relative; width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto;
  padding: 24px; border-radius: 20px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(187, 210, 224, .8), 0 24px 60px rgba(27, 39, 69, .16);
  transform: translateY(18px) scale(.98);
  transition: transform .45s var(--z-spring);
}
.z-panel.ticket-open .z-ticket-card { transform: none; }
.z-ticket-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.z-ticket-head > div { flex: 1; }
.z-ticket-head h3 { margin: 2px 0 4px; font-family: var(--z-font-black); font-weight: normal; font-size: 22px; letter-spacing: -.01em; }
.z-ticket-head p { margin: 0; font-size: 14px; line-height: 20px; color: var(--z-slate); }
.z-ticket-head .z-icon-btn { margin: -4px -6px 0 0; }
.z-ticket-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #EAF7EA; color: var(--z-green); flex: none; }
.z-ticket-ico svg { width: 22px; height: 22px; }

.z-ticket-form { display: flex; flex-direction: column; gap: 14px; }
.z-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.z-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.z-field > span { font-family: var(--z-font-bold); font-size: 12.5px; color: var(--z-slate); }
.z-field > span i { font-style: normal; color: #D93025; }
.z-field input, .z-field select, .z-field textarea {
  width: 100%; border: 0; outline: 0; border-radius: 10px;
  padding: 10px 12px; font: 14px/20px var(--z-font); color: var(--z-navy);
  background: #fff; box-shadow: inset 0 0 0 1px var(--z-line);
  transition: box-shadow .15s;
}
.z-field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2353607C' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat; }
.z-field textarea { resize: vertical; min-height: 96px; }
.z-field input::placeholder, .z-field textarea::placeholder { color: var(--z-muted); }
.z-field input:focus, .z-field select:focus, .z-field textarea:focus { box-shadow: inset 0 0 0 1.5px var(--z-navy), 0 0 0 4px rgba(47, 186, 179, .12); }
.z-err { display: none; font-style: normal; font-size: 12px; color: #D93025; }
.z-field.is-invalid input, .z-field.is-invalid textarea { box-shadow: inset 0 0 0 1.5px #D93025; }
.z-field.is-invalid .z-err { display: block; }

.z-ticket-form.is-sharing .z-manual, .z-ticket-form:not(.is-sharing) .z-clarify { display: none; }
.z-manual { display: flex; flex-direction: column; gap: 14px; animation: z-in .3s var(--z-ease) both; }
.z-field > span small { font-family: var(--z-font); font-size: 12px; color: var(--z-muted); margin-left: 4px; }
.z-context[hidden] { display: none; }
.z-context { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--z-mist-2); }
.z-context-label { font-family: var(--z-font-bold); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--z-muted); }
.z-attach { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--z-line-soft); cursor: pointer; }
.z-attach[hidden] { display: none; }
.z-attach input { position: absolute; opacity: 0; pointer-events: none; }
.z-attach-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--z-mist-2); color: var(--z-navy); flex: none; }
.z-attach-ico svg { width: 16px; height: 16px; }
.z-attach-text { flex: 1; min-width: 0; }
.z-attach-text b { display: block; font-family: var(--z-font-bold); font-weight: normal; font-size: 13px; }
.z-attach-text small { display: block; font-size: 12px; color: var(--z-slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--z-green); color: #fff; flex: none; transition: background-color .15s, box-shadow .15s; }
.z-check svg { width: 13px; height: 13px; }
.z-attach input:not(:checked) ~ .z-check { background: #fff; color: transparent; box-shadow: inset 0 0 0 1.5px var(--z-line); }
.z-attach input:not(:checked) ~ .z-attach-text, .z-attach input:not(:checked) ~ .z-attach-ico { opacity: .5; }
.z-attach input:focus-visible ~ .z-check { outline: 2px solid var(--z-blue); outline-offset: 2px; }

.z-ticket-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.z-ticket-foot p { flex: 1; margin: 0; font-size: 12px; line-height: 16px; color: var(--z-muted); }
.z-btn { height: 40px; padding: 0 18px; border-radius: 8px; font-family: var(--z-font-bold) !important; font-size: 14px; white-space: nowrap; transition: background-color .15s, box-shadow .15s; }
.z-btn--primary { background: var(--z-green) !important; color: #fff !important; }
.z-btn--primary:hover { background: var(--z-green-dark) !important; }
.z-btn--ghost { background: #fff !important; box-shadow: inset 0 0 0 1px var(--z-line); }
.z-btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--z-navy); }

.z-ticket-done { display: none; text-align: center; padding: 12px 8px 4px; }
.z-ticket.is-done .z-ticket-form, .z-ticket.is-done .z-ticket-head { display: none; }
.z-ticket.is-done .z-ticket-done { display: block; animation: z-in .4s var(--z-ease) both; }
.z-done-ico { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: var(--z-green); color: #fff; animation: z-pop .5s var(--z-spring) both .05s; }
.z-done-ico svg { width: 28px; height: 28px; }
@keyframes z-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.z-ticket-done h3 { margin: 0 0 8px; font-family: var(--z-font-black); font-weight: normal; font-size: 22px; }
.z-ticket-done p { margin: 0 auto 20px; max-width: 380px; font-size: 14px; line-height: 21px; color: var(--z-slate); }
.z-ticket-done b { font-family: var(--z-font-bold); font-weight: normal; color: var(--z-navy); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .z-panel { width: calc(100vw - 48px); top: 24px; bottom: 24px; grid-template-columns: 248px 1fr; }
}
@media (max-width: 760px) {
  .z-dock { bottom: 16px; }
  .z-panel { width: calc(100vw - 20px); top: 10px; bottom: 10px; border-radius: 18px; grid-template-columns: 1fr; }
  .z-side {
    position: absolute; inset: 0 auto 0 0; width: 84%; max-width: 320px; z-index: 3;
    transform: translateX(-102%); transition: transform .3s var(--z-ease);
    box-shadow: 16px 0 40px rgba(27, 39, 69, .14);
  }
  .z-panel.side-open .z-side { transform: none; }
  .z-menu-btn { display: grid !important; }
  .z-human-btn span, .z-head-sep { display: none; }
  .z-head-actions .z-human-btn { width: 38px; padding: 0; justify-content: center; }
  .z-field-row { grid-template-columns: 1fr; }
  .z-ticket { padding: 10px; align-items: flex-end; }
  .z-ticket-card { padding: 18px; }
  .z-ticket-foot { flex-wrap: wrap; }
  .z-ticket-foot p { flex-basis: 100%; }
  .z-main-head { padding: 0 8px 0 8px; }
  .z-scope { display: none; }
  .z-thread-inner { padding: 20px 16px; }
  .z-foot { padding: 0 12px 12px; }
  .z-caps { grid-template-columns: 1fr; }
  .z-stats { grid-template-columns: repeat(2, 1fr); }
  .z-welcome h3 { font-size: 26px; }
  .z-suggest { width: 100vw; }
  .z-suggest-row { flex-wrap: nowrap; overflow-x: auto; padding: 2px 16px 6px; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 40px), transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .zara *, .zara *::before, .zara *::after { animation: none !important; transition-duration: .01ms !important; }
}
