/* 3f, 25.11.2026: the bar's safe area. iOS (the only browser that answers -webkit-touch-callout) keeps the FULL inset, because its home indicator really overlaps the page; elsewhere the inset is capped at 16px (a gesture line's room): Android browsers with on-screen buttons report the button bar's height although it sits on its own opaque bar. */
:root { --zx-bar-safe: min(env(safe-area-inset-bottom, 0px), 16px); }
@supports (-webkit-touch-callout: none) { :root { --zx-bar-safe: env(safe-area-inset-bottom, 0px); } }
body:has(.zx-agent-bar) {
  padding-bottom: calc(48px + var(--zx-bar-safe, env(safe-area-inset-bottom, 0px)));
}
.zx-agent-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: calc(48px + var(--zx-bar-safe, env(safe-area-inset-bottom, 0px)));
  padding: 0 16px var(--zx-bar-safe, env(safe-area-inset-bottom, 0px));
  background: var(--page);
  border-top: 1px solid var(--line);
}
.zx-agent-open,
.zx-agent button {
  font: 500 16px/1.25 var(--body);
  cursor: pointer;
}
.zx-agent-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  box-sizing: border-box;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--muted);
  border-radius: 8px;
}
.zx-agent-open:hover {
  border-color: var(--cyan);
}
.zx-agent-open:focus-visible,
.zx-agent button:focus-visible,
.zx-agent a:focus-visible,
.zx-agent h2:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
body:has(.zx-agent-bar) .consent {
  bottom: calc(64px + var(--zx-bar-safe, env(safe-area-inset-bottom, 0px)));
}
.zx-agent {
  position: fixed;
  inset: auto;
  bottom: calc(56px + var(--zx-bar-safe, env(safe-area-inset-bottom, 0px)));
  inset-inline-start: 16px;
  margin: 0;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  overflow: auto;
  padding: 20px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--muted);
  border-radius: 12px;
  font: 400 16px/1.5 var(--body);
}
.zx-agent::backdrop {
  background: transparent;
}
@supports not selector(:popover-open) {
  .zx-agent:not(.is-open) {
    display: none;
  }
}
.zx-agent h2 {
  margin: 0 44px 8px 0;
  font: 600 20px/1.3 var(--head);
  color: var(--ink);
}
.zx-agent p {
  margin: 0 0 12px;
  font-size: 16px;
}
.zx-agent-line {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}
.zx-agent-line code {
  display: block;
  font: 400 16px/1.5 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
.zx-agent-act {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.zx-agent-copy {
  min-height: 44px;
  padding: 0 16px;
  background: var(--cyan);
  color: var(--on-accent);
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.zx-agent-status {
  color: var(--muted);
}
.zx-agent ol {
  margin: 0 0 12px;
  padding-inline-start: 24px;
}
.zx-agent li {
  margin: 0 0 4px;
  font-size: 16px;
}
.zx-agent a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--cyan);
}
.zx-agent-close {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.zx-agent-close:hover {
  border-color: var(--ink);
}
.zx-agent .zx-agent-last {
  margin-bottom: 0;
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-bar {
  background: var(--z-page);
  border-top-color: var(--z-edge);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-open {
  font: 500 16px/1.25 var(--mono);
  text-transform: lowercase;
  color: var(--z-cyan);
  border-color: var(--z-edge);
  text-shadow: none;
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-open::before {
  content: ">";
  margin-inline-end: 8px;
  color: var(--z-lime);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-open:hover {
  border-color: var(--z-cyan);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent {
  background: var(--z-panel);
  color: var(--z-ink);
  border-color: var(--z-edge);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent,
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent * {
  text-shadow: none;
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent h2 {
  color: var(--z-ink);
  font-family: var(--mono);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-line {
  background: var(--z-page);
  border-color: var(--z-line);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-line code {
  color: var(--z-lime);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-copy {
  background: var(--z-lime);
  color: var(--z-on-lime);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-status {
  color: var(--z-muted);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent a {
  color: var(--z-link);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-close {
  color: var(--z-ink);
  border-color: var(--z-line);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent-open:focus-visible,
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-agent :focus-visible {
  outline-color: var(--z-cyan);
}
@media print {
  .zx-agent-bar,
  .zx-agent {
    display: none;
  }
  body:has(.zx-agent-bar) {
    padding-bottom: 0;
  }
}
.zx-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 41;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  box-sizing: border-box;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--page);
  border-bottom: 1px solid var(--line);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s linear, visibility 0s linear 0.2s;
}
.zx-topbar.is-on {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s linear;
}
.zx-topbar .zx-topbar-ch {
  display: none;
  order: -1;
  margin: 0;
}
html.zx-rail-fold .zx-topbar .zx-topbar-ch {
  display: inline-flex;
}
a.zx-agent-open {
  text-decoration: none;
}
html.zx-topbar-on {
  scroll-padding-top: 72px;
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-topbar {
  background: var(--z-page);
  border-bottom-color: var(--z-edge);
}
@media (prefers-reduced-motion: reduce) {
  .zx-topbar,
  .zx-topbar.is-on {
    transition: none;
  }
}
@media print {
  .zx-topbar {
    display: none;
  }
}
/* Levi 22.11: Telegram beside "Connect your agent" in the bottom bar, every page. */
.zx-tg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  margin-inline-start: 8px;
  padding: 0 12px;
  box-sizing: border-box;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--muted);
  border-radius: 8px;
  font: 500 16px/1.25 var(--body);
  text-shadow: none;
}
.zx-tg:hover {
  border-color: var(--cyan);
}
.zx-tg:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.zx-tg-ico {
  flex: none;
}
.zx-tg-bar .zx-tg {
  margin-inline-start: 0;
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-tg {
  color: var(--z-cyan);
  border-color: var(--z-edge);
  font-family: var(--mono);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-tg-ico {
  color: var(--z-lime);
}
.zx-agent-bar .zx-tg {
  flex: none;
}
@media (max-width: 420px) {
  .zx-agent-bar:has(.zx-tg) .zx-agent-open {
    padding: 0 10px;
  }
  .zx-agent-bar .zx-tg {
    gap: 4px;
    margin-inline-start: 6px;
    padding: 0 8px;
  }
}
@media (max-width: 459px) {
  .zx-agent-bar:has(.zx-totop) .zx-tg {
    padding: 0 10px;
  }
  .zx-agent-bar:has(.zx-totop) .zx-tg-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
@media print {
  .zx-tg {
    display: none;
  }
}
/* Levi 22.11: the brief as a prompt line (text, voice, mail, copy). Nothing is sent to our server. */
.zx-brief {
  margin: 20px auto 8px;
  max-width: 640px;
  text-align: start;
}
.zx-brief-label {
  display: block;
  margin: 0 0 8px;
  font: 600 18px/1.35 var(--body);
  color: var(--ink);
}
.zx-brief-box {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.zx-brief-box textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 96px;
  padding: 12px;
  box-sizing: border-box;
  font: 400 17px/1.5 var(--body);
  color: var(--ink);
  background: var(--card, transparent);
  border: 2px solid var(--muted);
  border-radius: 10px;
  resize: vertical;
}
.zx-brief-box textarea:focus-visible,
.zx-brief button:focus-visible,
.zx-brief a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}
.zx-brief-mic {
  flex: none;
  width: 52px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--muted);
  border-radius: 10px;
  cursor: pointer;
}
.zx-brief-mic[hidden] {
  display: none;
}
.zx-brief-mic[aria-pressed=true] {
  border-color: var(--cyan);
  color: var(--cyan);
}
main .zx-brief p,
.zx-brief p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  max-width: none;
}
.zx-brief-note,
.zx-brief-hint {
  color: var(--muted);
}
.zx-brief-act {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  justify-content: center;
}
.zx-btn {
  min-height: 48px;
  padding: 0 20px;
  font: 600 17px/1.25 var(--body);
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--muted);
  border-radius: 10px;
  cursor: pointer;
  text-shadow: none;
}
.zx-btn.zx-btn-main {
  color: #05080d;
  background: #c6ff3d;
  border-color: #c6ff3d;
}
.zx-brief-status:empty {
  display: none;
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-brief-label {
  color: var(--z-ink);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-brief-box textarea {
  color: var(--z-ink);
  background: var(--z-page);
  border-color: var(--z-edge);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) :is(.zx-brief-mic, .zx-btn:not(.zx-btn-main)) {
  color: var(--z-ink);
  border-color: var(--z-edge);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-brief-mic[aria-pressed=true] {
  color: var(--z-cyan);
  border-color: var(--z-cyan);
}
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) :is(.zx-brief-note, .zx-brief-hint, .zx-brief-status) {
  color: var(--z-muted);
}
.zx-legal-line {
  margin: 8px 0 0;
}
/* Levi 22.11 13:5x: "they lean to one side": the bottom bar's buttons sit as one centred group, 16 px from each edge at least. */
.zx-agent-bar {
  justify-content: center;
  column-gap: 12px;
}
.zx-agent-bar .zx-tg {
  margin-inline-start: 0;
}
@media (max-width: 420px) {
  .zx-agent-bar {
    column-gap: 8px;
  }
  .zx-agent-bar .zx-tg {
    margin-inline-start: 0;
  }
}
.zx-agent-bar .zx-totop {
  margin-inline-start: 0;
}
/* Same rule for the bar when it moves to the top on scroll. */
.zx-topbar {
  justify-content: center;
}
/* 0.9.4: at 320-379 px the bar did not fit "Connect your agent" and "Telegram" side by side (4-12 px sideways). The word
   steps out of sight; the link keeps its own label ("Write to ZIONX on Telegram") and the icon stays. */
@media (max-width: 379px) {
  .zx-agent-bar .zx-tg {
    padding: 0 10px;
  }
  .zx-agent-bar .zx-tg-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.zx-brief .zx-brief-act { align-items: center; justify-content: flex-start; margin-block-start: 12px; }
.zx-brief .zx-btn-main { min-height: 48px; border: 2px solid #35480d; }
.zx-brief .zx-btn:not(.zx-btn-main) { border-color: transparent; text-decoration: underline; padding-inline: 8px; }
html:is([data-zx-theme="dark"],[data-zx-theme="eclipse"]) .zx-brief .zx-btn-main { border-color: #e6ffa7; }
