/*
 * The text Orbit (R16): the side panel of the shell (.jvp) and the pieces of the live chat shared with the view
 * #/orbit (thinking, errors, the list of conversations, the multi-line input). The base of the view (.jv-*) and the
 * tokens (--surface-*, --line*, --orbit-*, --warn*) are in css/theme.css; both themes come from there.
 */

/* ---------- the side panel ---------- */
.jvp {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-panel); /* above the sticky header, under popovers and toasts */
  width: 100vw;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  background: var(--surface-1); color: var(--text);
  border-left: 0;
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.28);
  transform: translateX(100%);
  transition: transform 180ms var(--ease-standard, ease-out);
}
.jvp.is-open { transform: translateX(0); }
.jvp-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--line); }
.jvp-who { display: grid; gap: 2px; min-width: 0; }
.jvp-who b { font-size: 16px; font-weight: 650; color: var(--text-strong); }
.jvp-status { display: inline-flex; align-items: center; font-size: 13px; color: var(--text-muted); }
.jvp-actions { margin-left: auto; display: flex; gap: 6px; }
.jvp .jv-thread { padding: 18px 16px; gap: 14px; }
.jvp .jv-msg { max-width: 90%; }
.jvp .jv-bubble { font-size: 15px; padding: 10px 14px; }
.jvp .jv-welcome { padding: 8px 0; gap: 10px; }
.jvp .jv-welcome h2 { font-size: 20px; margin-top: 4px; }
.jvp .jv-welcome p { font-size: 14px; }
.jvp .jv-foot { padding: 12px; }
.jv-tile--small { width: 36px; height: 36px; border-radius: 11px; }
.jv-tile--small svg { width: 20px; height: 20px; }

/* ---------- the live chat ---------- */
.jv-bubble { white-space: pre-wrap; }
.jv-msg--pending .jv-bubble { opacity: 0.72; }
.jv-msg--error .jv-bubble { background: var(--warn-bg); color: var(--text-strong); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.jv-msg--thinking .jv-bubble { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); }
.jv-dots { display: inline-flex; gap: 4px; }
.jv-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: jv-dot 1.2s infinite ease-in-out; }
.jv-dots i:nth-child(2) { animation-delay: 0.15s; }
.jv-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes jv-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.jv-thinking { font-size: 14px; }
.jv-note { margin: 0; padding: 10px 14px; border-radius: var(--radius-m); background: var(--surface-2); color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.jv-note a { color: var(--accent-text, var(--text-strong)); font-weight: 600; }
.jv-welcome .jv-note { margin-top: 6px; }

/* The track of the view must not grow with the textarea (its default width of 20 columns pushed the send button out at 390 px). */
.jv-main { grid-template-columns: minmax(0, 1fr); }
/* Orbit with one conversation: no list beside the chat and no head above it, the chat takes the whole window */
.jv.jv--single { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.jv-main.jv-main--plain { grid-template-rows: minmax(0, 1fr) auto; }
textarea.jv-input {
  height: 52px; min-height: 52px; max-height: 160px; padding: 14px 20px; resize: none; overflow-y: hidden;
  border-radius: 26px; font: 400 16px/24px var(--font-sans);
}
.jvp textarea.jv-input { height: 46px; min-height: 46px; padding: 11px 16px; border-radius: 23px; font-size: 15px; }
.jvp .jv-round { width: 46px; height: 46px; }
.jvp .jv-round--small { width: 44px; height: 44px; }
.jv-round:disabled { opacity: 0.45; cursor: default; }
.jv-compose { align-items: flex-end; }
.jv-compose.is-busy .jv-round--send { opacity: 0.5; }

/* ---------- the field of the message with the microphone of the dictation inside ---------- */
.jv-field { position: relative; flex: 1; min-width: 0; display: flex; }
.jv-field .jv-input { flex: 1; width: 100%; }
.jv-compose.has-mic .jv-field .jv-input { padding-right: 54px; }
.jv-field .jv-round--mic, .jvp .jv-field .jv-round--mic { position: absolute; right: 6px; bottom: 6px; width: 40px; height: 40px; background: transparent; border-color: transparent; color: var(--text-muted); }
.jvp .jv-field .jv-round--mic { right: 5px; bottom: 5px; width: 36px; height: 36px; }
.jv-field .jv-round--mic:hover { background: var(--surface-2); color: var(--text-strong); }

/* ---------- voice: the microphone of the dictation ---------- */
.jv-round--mic { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.jv-round--mic.is-live { background: var(--orbit-soft); border-color: var(--orbit-line); color: var(--text-strong); animation: jv-live 1.4s infinite ease-in-out; }
@keyframes jv-live { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orbit-line) 70%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.jv-round[hidden] { display: none; }

/* ---------- the stage of the live conversation: the orb of Orbit ---------- */
.jv-thread.is-live { display: grid; place-items: center; padding: 0; overflow: hidden; }
.orb-stage { display: grid; justify-items: center; gap: 10px; padding: 24px 20px; text-align: center; width: 100%; animation: orb-in 260ms var(--ease-standard, ease-out); }
.orb { width: min(300px, 62%, 44vh); aspect-ratio: 1; overflow: visible; }
.orb-core, .orb-glow, .orb-ring { will-change: transform; }
.orb-gold, .orb-glow, .orb-ring { opacity: 0; transition: opacity 520ms ease; }
.orb-shine { opacity: 0.5; transition: opacity 520ms ease; }
.orb-plain { filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.28)); }
.orb-stage.is-on .orb-gold, .orb-stage.is-on .orb-ring { opacity: 1; }
.orb-stage.is-on .orb-glow { opacity: 0.9; }
.orb-stage.is-on .orb-shine { opacity: 0.85; }
.orb-stage.is-on .orb-ring:nth-of-type(1) { transition-delay: 60ms; }
.orb-stage.is-on .orb-ring:nth-of-type(2) { transition-delay: 140ms; }
.orb-stage[data-state="tool"] .orb-ring ellipse { stroke-dasharray: 10 8; }
.orb-status { margin: 6px 0 0; font: 650 19px/1.3 var(--font-sans); color: var(--text-strong); letter-spacing: 0.01em; }
.orb-stage[data-state="connecting"] .orb-status { color: var(--text-muted); animation: orb-wait 1.2s infinite ease-in-out; }
.orb-caption { margin: 0; max-width: 52ch; font-size: 15px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.orb-caption--me { min-height: 1.55em; color: var(--text-muted); font-size: 14px; }
.orb-caption--me:not(:empty)::before { content: '„'; }
.orb-caption--me:not(:empty)::after { content: '“'; }
.orb-caption--orbit { min-height: 4.65em; color: var(--text-strong); }
.orb-end { all: unset; box-sizing: border-box; cursor: pointer; margin-top: 4px; padding: 9px 20px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text); font: 600 14px/1.2 var(--font-sans); }
.orb-end:hover { background: var(--surface-2); color: var(--text-strong); }
.orb-end:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jvp .orb { width: min(220px, 60%, 34vh); }
.jvp .orb-status { font-size: 17px; }
.jvp .orb-caption { font-size: 14px; }
@keyframes orb-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes orb-wait { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ---------- conversations of the view ---------- */
.jv-item { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 10px 12px; border-radius: var(--radius-m); border: 1px solid transparent; }
.jv-item:hover { background: var(--surface-2); }
.jv-item.is-active { background: var(--orbit-soft); border-color: var(--orbit-line); }
.jv-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jv-item-title { font-size: 14px; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jv-item-time { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

@media (min-width: 821px) {
  .jvp { width: min(440px, 100vw); border-left: 1px solid var(--line-strong); }
  .jvp .jv-round--small { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .jvp { transition: none; }
  .jv-round--mic.is-live { animation: none; }
  .orb-stage, .orb-stage[data-state="connecting"] .orb-status { animation: none; }
  .jv-dots i { animation: none; opacity: 0.6; }
}

/* ---------- cards of an answer (lib/tools/akce.php): a step waiting for a yes, a draft of a reply, a step done ----------
   Quiet as the dialogs of the system: flat, no shadow, no hover; the yes is the blue of the system (Štěpán 13. 11. 2026). */
.jv-card { display: grid; gap: 10px; width: min(460px, 100%); margin-top: 6px; padding: 12px 14px; border: 0; border-radius: 14px;
  background: var(--surface-1); color: var(--text); text-align: left; animation: jv-card-in 200ms var(--ease-standard, ease-out); }
.jv-msg--orbit .jv-card { justify-self: start; }
.jv-card__text { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text-strong); }
.jv-card.is-past { opacity: 0.6; }
.jv-card__head { display: grid; gap: 2px; font-size: 13px; color: var(--text-muted); }
.jv-card__head b { font-size: 14px; color: var(--text-strong); font-weight: 650; }
.jv-card__draft { margin: 0; max-height: 220px; overflow: auto; white-space: pre-wrap; font-size: 14px; line-height: 1.55; color: var(--text);
  padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--text-strong) 5%, transparent); }
.jv-card__btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.jv-card__btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; min-width: 64px;
  padding: 7px 16px; border-radius: 10px; font: 500 14px/1.2 var(--font-sans); color: var(--text-strong);
  background: color-mix(in srgb, var(--text-strong) 10%, transparent); transition: filter 0.08s ease; }
.jv-card__btn--yes, a.jv-card__btn--yes, a.jv-card__btn--yes:hover, a.jv-card__btn--yes:visited { background: var(--sys-blue, #0a84ff); color: #fff; text-decoration: none; }
.jv-card__btn:active { filter: brightness(0.88); }
.jv-card__btn:focus-visible { outline: 2px solid var(--sys-blue, #0a84ff); outline-offset: 2px; }
.jv-card--done { display: flex; align-items: center; gap: 10px; width: auto; max-width: 100%; padding: 8px 18px 8px 8px; border-radius: 999px; font-size: 14px; }
/* the tick as the marks of IMScout (HRM, Pošta, Chat): a light grey tile with a neutral dark tick, no red or gold (Štěpán 13. 11. 2026) */
.jv-card__tick { flex: none; width: 22px; height: 22px; border-radius: 50%; position: relative;
  background: linear-gradient(180deg, #f4f4f4 0%, #d9d9d9 100%); box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.jv-card__tick::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 8px; border: solid #3a3a3c; border-width: 0 2px 2px 0;
  transform: translate(-50%, -62%) rotate(45deg); } /* the tick sits in the middle of its tile (its own box is lower than its look) */
.orb-card { display: grid; justify-items: center; width: 100%; }
.orb-card:empty { display: none; }
.orb-card .jv-card { margin-top: 0; }
@keyframes jv-card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .jv-card { animation: none; } }
/* a line that opens an app or a page again (Orbit opened it) */
.jv-card--open { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: auto; max-width: 100%; margin-top: 6px;
  padding: 8px 18px 8px 8px; border-radius: 999px; background: var(--surface-1); color: var(--text); font-size: 14px; }
.jv-card--open:focus-visible { outline: 2px solid var(--sys-blue, #0a84ff); outline-offset: 2px; }
.jv-card__tick--open::after { border: 0; width: 7px; height: 7px; border-top: 2px solid #3a3a3c; border-right: 2px solid #3a3a3c; transform: translate(-60%, -50%) rotate(45deg); }
