/* Orbi — asystent zapytania. Kolory i krój z tokenów strony, więc działa w obu motywach. */
.orbi-launch {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60; display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 20px 0 10px; border: 0; border-radius: 999px;
  background: var(--green); color: var(--surface); font: 600 var(--t-small)/1 var(--font);
  cursor: pointer; box-shadow: 0 8px 28px rgba(0,0,0,.28);
  transition: transform var(--m-in) var(--ease-out);
}
.orbi-launch:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (hover: hover) { .orbi-launch:hover { transform: translateY(-2px); } }
.orbi-open .orbi-launch { display: none; }

.orbi-panel {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 61; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--ink); border: var(--border); border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.4); font-family: var(--font);
}
.orbi-panel[hidden] { display: none; }
.orbi-panel:focus { outline: none; }
.orbi-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 18px; border-bottom: var(--border); }
.orbi-title { display: grid; gap: 2px; min-width: 0; }
.orbi-title strong { font-size: 1.125rem; letter-spacing: -0.01em; }
.orbi-title span { font-size: .875rem; color: var(--ink-2); line-height: 1.35; }
.orbi-close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.orbi-close:focus-visible, .orbi-chip:focus-visible, .orbi-input:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.orbi-log { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.orbi-msg { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: var(--t-small); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.orbi-msg--bot { align-self: flex-start; background: var(--bg); border: var(--border); border-bottom-left-radius: 4px; }
.orbi-msg--me { align-self: flex-end; background: var(--green); color: var(--surface); border-bottom-right-radius: 4px; }
.orbi-dots { display: inline-flex; gap: 5px; padding: 14px 16px; }
.orbi-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-2); opacity: .5; animation: orbi-blink 1s infinite ease-in-out; }
.orbi-dots i:nth-child(2) { animation-delay: .15s; } .orbi-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes orbi-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.orbi-choices { padding: 8px 16px 12px; display: flex; flex-wrap: wrap; gap: 8px; max-height: 46%; overflow-y: auto; border-top: var(--border); background: var(--surface); }
.orbi-choices:empty { display: none; }
.orbi-chip {
  display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--green); border-radius: 999px; background: transparent; color: var(--ink);
  font: 600 var(--t-small)/1.25 var(--font); text-decoration: none; cursor: pointer;
}
.orbi-chip--main { background: var(--green); color: var(--surface); }
@media (hover: hover) { .orbi-chip:hover { background: var(--green); color: var(--surface); } }

.orbi-form { width: 100%; display: grid; gap: 8px; }
.orbi-label { font-size: .875rem; color: var(--ink-2); }
.orbi-input { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: 500 1rem var(--font); }
.orbi-error { margin: 0; min-height: 1.2em; font-size: .875rem; color: var(--gold); }
.orbi-row { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 30em) {
  .orbi-panel { right: 0; bottom: 0; left: 0; width: auto; height: min(88dvh, 640px); border-radius: 18px 18px 0 0; }
  /* na telefonie sam znaczek Orbiego, bez napisu: nie zasłania przycisków pod spodem */
  .orbi-launch { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: 52px; padding: 0; justify-content: center; }
  .orbi-launch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .orbi-dots i { animation: none; opacity: .6; } .orbi-launch { transition: none; } }

/* Główka Orbiego */
.orbi-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.orbi-av { display: block; flex: none; overflow: visible; }
.orbi-launch .orbi-av { --orbi-ring: var(--surface); }
.orbi-head .orbi-av { --orbi-ring: var(--green); }
.orbi-body { fill: var(--gold); stroke: #14231F; stroke-width: 1.6; }
.orbi-ring { fill: none; stroke: var(--orbi-ring); stroke-width: 3.4; stroke-linecap: round; }
.orbi-stem { stroke: #14231F; stroke-width: 1.8; stroke-linecap: round; }
.orbi-tip { fill: var(--orbi-ring); stroke: #14231F; stroke-width: 1.4; }
.orbi-smile { fill: none; stroke: #14231F; stroke-width: 2.2; stroke-linecap: round; }
.orbi-eye { transform-box: fill-box; transform-origin: center; animation: orbi-mrug 5.5s infinite; }
.orbi-tip { transform-box: fill-box; transform-origin: center; animation: orbi-puls 2.4s infinite ease-in-out; }
.orbi-eye:nth-of-type(2) { animation-delay: 0s; }
@keyframes orbi-mrug { 0%, 91%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes orbi-puls { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes orbi-kiwka { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-9deg); } 65% { transform: rotate(7deg); } }
@media (hover: hover) { .orbi-launch:hover .orbi-av { animation: orbi-kiwka .6s ease-in-out; } }
@media (prefers-reduced-motion: reduce) { .orbi-eye, .orbi-tip, .orbi-launch:hover .orbi-av { animation: none; } }

/* Wstecz i Zacznij od nowa: stały pasek pod odpowiedziami */
.orbi-bar { display: flex; justify-content: space-between; gap: 8px; padding: 0 8px; border-top: var(--border); background: var(--surface); }
.orbi-bar button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 .875rem/1 var(--font); cursor: pointer; }
.orbi-bar button:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.orbi-bar button:disabled { opacity: .4; cursor: default; }
@media (hover: hover) { .orbi-bar button:not(:disabled):hover { color: var(--ink); text-decoration: underline; } }

/* wybór wielokrotny */
.orbi-chip[aria-pressed="true"] { background: var(--green); color: var(--surface); }
.orbi-chip:disabled { opacity: .4; cursor: default; }
@media (hover: hover) { .orbi-chip:disabled:hover { background: var(--green); color: var(--surface); } }
