/* 1.15.0: voice assistant (website, customer area, administration). Own palette, so it looks the same everywhere. */
.nv-assist { --a-bg: #0B172B; --a-bg2: #102039; --a-line: #344258; --a-text: #F6F7FB; --a-muted: #8F9EB4; --a-gold: #D5A85F; --a-gold2: #EBC789; --a-bad: #E5484D;
  position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 900; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--a-text); }
.nv-assist button { font: inherit; cursor: pointer; }
.nv-assist-fab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--a-gold);
  background: linear-gradient(135deg, var(--a-gold2), var(--a-gold)); color: #10192b; font-weight: 600; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.nv-assist-fab:focus-visible, .nv-assist-panel button:focus-visible, .nv-assist-panel textarea:focus-visible, .nv-assist-panel select:focus-visible { outline: 2px solid var(--a-gold2); outline-offset: 2px; }
.nv-assist.open .nv-assist-fab { display: none; }
.nv-assist-panel { width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--a-bg); border: 1px solid var(--a-line); border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,.5); overflow: hidden; }
.nv-assist-panel[hidden] { display: none; }
.nv-assist-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--a-line); background: var(--a-bg2); }
.nv-assist-head b { flex: 1; font-size: 15px; }
.nv-assist-head button, .nv-assist-head select { background: transparent; color: var(--a-text); border: 1px solid var(--a-line); border-radius: 8px; padding: 4px 8px; min-height: 32px; }
.nv-assist-head select option { color: #10192b; }
.nv-assist-head [aria-pressed="true"] { opacity: .5; }
.nv-assist-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.nv-assist-msg { max-width: 86%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.nv-assist-msg.user { align-self: flex-end; background: #2a3f6b; border-end-end-radius: 4px; }
.nv-assist-msg.assistant { align-self: flex-start; background: var(--a-bg2); border: 1px solid var(--a-line); border-end-start-radius: 4px; }
.nv-assist-msg.error { border-color: var(--a-bad); }
.nv-assist-card { align-self: stretch; border: 1px solid var(--a-gold); border-radius: 12px; padding: 10px 12px; background: rgba(213,168,95,.08); }
.nv-assist-card p { margin: 0 0 8px; }
.nv-assist-card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.nv-assist-card button, .nv-assist-card a { border-radius: 8px; padding: 6px 12px; border: 1px solid var(--a-gold); background: var(--a-gold); color: #10192b; font-weight: 600; text-decoration: none; }
.nv-assist-card button.ghost { background: transparent; color: var(--a-text); border-color: var(--a-line); }
.nv-assist-card.done { border-color: var(--a-line); opacity: .8; }
.nv-assist-status { margin: 0; padding: 0 14px 6px; min-height: 20px; font-size: 13px; color: var(--a-muted); }
.nv-assist-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--a-line); align-items: flex-end; }
.nv-assist-form textarea { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--a-line); background: var(--a-bg2); color: var(--a-text);
  font: inherit; line-height: 1.45; resize: none; display: block; max-height: 10.5em; overflow-y: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.nv-assist-mic, .nv-assist-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--a-gold); background: transparent; color: var(--a-gold2); display: grid; place-items: center; }
.nv-assist-mic { background: var(--a-gold); color: #10192b; }
.nv-assist-mic.live { background: var(--a-bad); border-color: var(--a-bad); color: #fff; animation: nv-pulse 1.2s infinite; }
.nv-assist-note { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--a-muted); }
.nv-assist-note a { color: var(--a-gold2); }
@keyframes nv-pulse { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.6); } 100% { box-shadow: 0 0 0 14px rgba(229,72,77,0); } }
@media (prefers-reduced-motion: reduce) { .nv-assist-mic.live { animation: none; } }
/* 1.22.20: clear close button, and on phones a panel that fits the visible screen (dvh) instead of covering it */
.nv-assist-head .nv-assist-close { min-width: 40px; min-height: 36px; display: inline-grid; place-items: center; border-color: var(--a-gold); color: var(--a-gold2); }
.nv-assist-head .nv-assist-close:hover { background: var(--a-gold); color: #10192b; }
/* 1.22.22: phones get a bottom sheet. Text field 16px, otherwise iOS zooms the page on focus and the panel slides out of view. */
@media (max-width: 520px) {
  .nv-assist { inset-inline-end: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); font-size: 15px; }
  .nv-assist-fab span { display: none; } .nv-assist-fab { padding: 14px; }
  .nv-assist.open { inset-inline: 0; bottom: 0; }
  .nv-assist-panel { width: 100%; height: min(640px, 82vh); height: min(640px, 82dvh); border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 0 0 100vmax rgba(3, 8, 20, .55), 0 -10px 40px rgba(0,0,0,.45); animation: nv-sheet .22s ease-out both; }
  .nv-assist-panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--a-line); margin: 8px auto 0; flex: none; }
  .nv-assist-head { padding: 6px 12px 10px; gap: 8px; background: transparent; }
  .nv-assist-head b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .nv-assist-head button, .nv-assist-head select { min-height: 38px; min-width: 38px; padding: 0 8px; border-radius: 12px; }
  .nv-assist-head .nv-assist-close { min-width: 40px; border-radius: 50%; }
  .nv-assist-log { padding: 12px 14px; gap: 8px; }
  .nv-assist-msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.55; }
  .nv-assist-status { padding: 0 16px 4px; }
  .nv-assist-form { padding: 10px 12px 8px; gap: 8px; }
  .nv-assist-form textarea { font-size: 16px; padding: 10px 14px; border-radius: 20px; }
  .nv-assist-mic, .nv-assist-send { width: 44px; height: 44px; }
  .nv-assist-note { padding: 0 16px 10px; font-size: 11px; line-height: 1.4; }
}
/* Persian text in a German page (and the other way round) gets its own direction */
.nv-assist-msg, .nv-assist-form textarea { unicode-bidi: plaintext; text-align: start; }
@keyframes nv-sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nv-assist-panel { animation: none; } }
/* History in the administration */
.assist-log .assist-line { margin: 0 0 8px; white-space: pre-wrap; }
.assist-log .assist-line b { display: inline-block; min-width: 90px; color: var(--muted, #6b7280); font-weight: 600; }
.assist-log .assist-line.user { padding-inline-start: 0; }
[dir="rtl"] .nv-assist-send { transform: scaleX(-1); }

/* 1.20.0 themes */
:root[data-theme="graphit"] .nv-assist { --a-bg: #121417; --a-bg2: #1a1d21; --a-line: #2c3036; --a-text: #F5F6F8; --a-muted: #8B9099; --a-gold: #C3CAD3; --a-gold2: #EEF1F5; }
:root[data-theme="graphit"] .nv-assist-msg.user { background: #2a2e34; }
:root[data-theme="graphit"] .nv-assist-card { background: rgba(211,216,223,.06); }
:root[data-theme="light"] .nv-assist { --a-bg: #FFFFFF; --a-bg2: #F3F1EC; --a-line: #DDD7CC; --a-text: #0E1A2D; --a-muted: #5B6779; --a-gold: #B8873B; --a-gold2: #D9B06A; }
:root[data-theme="light"] .nv-assist-fab { color: #fff; box-shadow: 0 8px 24px rgba(30,45,70,.18); }
:root[data-theme="light"] .nv-assist-panel { box-shadow: 0 18px 50px rgba(30,45,70,.18); }
:root[data-theme="light"] .nv-assist-msg.user { background: #E8EEF8; }
:root[data-theme="light"] :is(.nv-assist-card button, .nv-assist-card a, .nv-assist-mic) { color: #fff; }
