/*
 * Woltanic AI – panel dostępu.
 * Wygląd według nowej strony Woltanic: granat Woltanic + słoneczny akcent z logo,
 * Instrument Sans (nagłówki) / Inter (tekst i etykiety), kropkowana siatka, lampka z logo
 * i napis „woltanic”, przez który przepływa prąd. Fonty są lokalne (assets/fonts), bez Google Fonts.
 * Wersja dla panelu z wieloma agentami (lista agentów w menu, zakładka Agenci, przypisania kont).
 * Plik zmienia wyłącznie wygląd – logowanie, MFA, API i widget działają jak dotąd.
 */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/instrument-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/instrument-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --navy: #1C3D77;
  --navy-2: #234A8E;
  --navy-deep: #0D2147;
  --navy-ink: #081834;
  --ink: #0D1626;
  --sun: #F8BE3B;
  --sun-deep: #EAA816;
  --sun-soft: #FDEDC4;
  --paper: #F4F6FA;
  --white: #FFFFFF;
  --mist: #E8EEF7;
  --line: #D9E0EB;
  --muted: #536075;
  --green: #146C43;
  --green-soft: #E2F3EA;
  --red: #A63A2B;
  --red-soft: #FCE8E6;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --gutter: clamp(20px, 3vw, 44px);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-std: cubic-bezier(.4, 0, .2, 1);

  --font-head: "Instrument Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --shadow: 0 1px 2px rgba(13, 33, 71, .05), 0 12px 32px -16px rgba(13, 33, 71, .22);
  --shadow-lg: 0 2px 6px rgba(13, 33, 71, .06), 0 40px 80px -32px rgba(13, 33, 71, .38);

  --dots: radial-gradient(rgba(28, 61, 119, .15) 1px, transparent 1.2px);
  --dots-light: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.2px);
}

/* ------------------------------------------------------------------ */
/* Podstawy                                                            */
/* ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; background: var(--paper); color: var(--ink);
  font: 400 15px/1.6 var(--font-text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; margin: 0; }
button:disabled { cursor: default; opacity: .45; }
a { color: var(--navy); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-head); color: inherit; }
h1 { font-size: clamp(34px, 3.3vw, 50px); line-height: 1.04; font-weight: 500; letter-spacing: -.04em; margin-bottom: 10px; text-wrap: balance; }
h2 { font-size: clamp(20px, 1.6vw, 23px); line-height: 1.2; font-weight: 600; letter-spacing: -.022em; }
h3 { font-size: 17px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
[hidden] { display: none !important; }
::selection { background: var(--sun); color: var(--navy-ink); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.sidebar :focus-visible, .agent-frame :focus-visible, .app-footer :focus-visible { outline-color: var(--sun); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.small { font-size: 13.5px; line-height: 1.6; }
.muted { color: var(--muted); }
.logo { display: block; width: 190px; height: auto; }

/* Nadtytuł z kropką-słońcem */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font: 500 12px/1.3 var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--navy);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(248, 190, 59, .28); flex-shrink: 0; }
.eyebrow--light { color: var(--sun); }

/* Wyróżnienie – granat z żółtym markerem */
:is(h1, .brand-title) em {
  font-style: normal; color: var(--navy);
  background: linear-gradient(transparent 68%, rgba(248, 190, 59, .55) 68%, rgba(248, 190, 59, .55) 92%, transparent 92%) no-repeat 0 0 / 100% 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.login-brand .brand-title em { color: var(--sun); background: none; }

/* Słowa w tytułach wjeżdżają po kolei (podział robi ui.js) */
.js .split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.js .split .w > span { display: inline-block; animation: wt-word .85s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms + var(--d, .05s)); }
.js .split em { animation: wt-marker 1s var(--ease) .6s backwards; }


/* ------------------------------------------------------------------ */
/* Przyciski                                                           */
/* ------------------------------------------------------------------ */

.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 14.5px/1.2 var(--font-text); letter-spacing: -.005em; white-space: nowrap; text-align: center;
  transition: background-color .25s var(--ease-std), color .25s var(--ease-std), border-color .25s var(--ease-std), box-shadow .25s var(--ease-std), transform .25s var(--ease-std);
}
.primary { background: var(--sun); color: var(--navy-ink); }
.primary:hover:not(:disabled) { background: #FFCB55; box-shadow: 0 10px 28px -12px rgba(234, 168, 22, .8); }
.secondary { border-color: var(--line); background: rgba(255, 255, 255, .6); color: var(--ink); }
.secondary:hover:not(:disabled) { border-color: var(--navy); background: #fff; color: var(--navy); }
.primary:active:not(:disabled), .secondary:active:not(:disabled) { transform: translateY(1px); }

/* Przycisk z granatowym kółkiem i strzałką */
.primary--arrow { justify-content: space-between; gap: 14px; padding: 0 6px 0 24px; }
.primary--arrow::after {
  content: ""; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / 17px no-repeat;
  transition: transform .3s var(--ease);
}
.primary--arrow:hover:not(:disabled)::after { transform: translateX(3px); }
.primary--icon { padding-right: 6px; gap: 12px; }
.primary--icon .i { width: 36px; height: 36px; padding: 9px; border-radius: 50%; background: var(--navy); color: #fff; stroke-width: 2; transition: transform .4s var(--ease); }
.primary--icon:hover .i { transform: rotate(90deg); }

/* ------------------------------------------------------------------ */
/* Pola formularzy                                                     */
/* ------------------------------------------------------------------ */

label { display: grid; gap: 8px; font: 600 13.5px/1.3 var(--font-text); color: var(--ink); }
label .small { font-weight: 400; }
input, select {
  width: 100%; min-width: 0; min-height: 50px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 400;
  outline: none; transition: border-color .2s, background-color .2s, box-shadow .2s;
}
input::placeholder { color: #8892A3; }
input:hover, select:hover { border-color: #B9C5D8; }
input:focus, select:focus { border-color: var(--navy); background-color: #fff; box-shadow: 0 0 0 4px rgba(28, 61, 119, .12); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C3D77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
select:disabled, input:disabled { opacity: .6; cursor: default; }
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0;
  border-radius: 7px; border: 1.5px solid #9AA6B8; background: #fff; flex-shrink: 0; cursor: pointer;
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
input[type="checkbox"]:checked {
  border-color: var(--navy);
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F8BE3B' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
input[type="checkbox"]:focus { box-shadow: 0 0 0 4px rgba(28, 61, 119, .14); }
input[type="checkbox"]:disabled { opacity: .55; }
.reset-check { display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; }

.error { margin: 0; padding: 12px 14px; border-radius: 14px; background: #FFF1EA; color: #8A2B0B; font-size: 13.5px; line-height: 1.5; font-weight: 500; }
.feedback { min-height: 18px; margin: 0; }

/* ------------------------------------------------------------------ */
/* Plakietki i kafelki ikon                                            */
/* ------------------------------------------------------------------ */

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: var(--mist); color: var(--navy); font: 600 12px/1.2 var(--font-text); white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill .i { width: 15px; height: 15px; }
.pill.yellow { background: var(--sun-soft); color: #6B4A00; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill--dark { align-self: flex-start; background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .14); }
.pill--dark .i { color: var(--sun); }

.icon-tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--mist); color: var(--navy); flex-shrink: 0; transition: background-color .3s, color .3s; }
.icon-tile .i { width: 22px; height: 22px; }
.icon-tile--sun { background: var(--sun); color: var(--navy-ink); }
.icon-tile--navy { background: var(--navy); color: var(--sun); }

/* ------------------------------------------------------------------ */
/* Ekran ładowania: lampka z logo ładuje się od dołu do góry           */
/* ------------------------------------------------------------------ */

.lamp-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lamp-svg--base { fill: rgba(28, 61, 119, .14); }
.lamp-svg--lit { fill: var(--sun); clip-path: inset(calc((1 - var(--charge, 1)) * 100%) 0 0 0); }

.wt-loader {
  --charge: 0;
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; align-content: center; gap: 22px;
  background: var(--paper); pointer-events: none;
  transition: opacity .55s var(--ease-std), visibility 0s linear .55s;
  animation: wt-loader-safety .5s ease 3.5s forwards;
}
.wt-loader::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background-image: var(--dots); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 0, transparent 38%); mask-image: radial-gradient(circle at 50% 46%, #000 0, transparent 38%);
}
.wt-loader.is-hidden { opacity: 0; visibility: hidden; }
.wt-loader__lamp { position: relative; width: clamp(88px, 9vw, 116px); aspect-ratio: 62 / 54; }
.wt-loader__glow { position: absolute; inset: -70%; border-radius: 50%; background: radial-gradient(circle, rgba(248, 190, 59, .5), rgba(248, 190, 59, 0) 60%); opacity: calc(var(--charge) * .65); transform: scale(calc(.6 + var(--charge) * .4)); }
.wt-loader__pct { position: relative; margin: 0; font: 500 12px/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.wt-loader.is-done .wt-loader__glow { animation: wt-lamp-flash .9s var(--ease) forwards; }
.wt-loader.is-done .wt-loader__lamp { animation: wt-lamp-pop .7s var(--ease); }
.wt-loader.is-done .lamp-svg--lit { filter: drop-shadow(0 0 6px rgba(248, 190, 59, .8)); }

/* ------------------------------------------------------------------ */
/* Napis „woltanic” – przez litery powoli przechodzi prąd              */
/* ------------------------------------------------------------------ */

.volt-wrap { container-type: inline-size; contain: paint; overflow: hidden; user-select: none; pointer-events: none; }
.volt {
  --volt: 9s;
  display: block; text-align: center; white-space: nowrap; padding-bottom: .02em;
  font: 600 18vw/.78 var(--font-head); letter-spacing: -.07em; color: transparent;
  background-image: linear-gradient(100deg, transparent 43%, rgba(255, 226, 140, 0) 45%, rgba(255, 214, 110, .9) 50%, rgba(255, 226, 140, 0) 55%, transparent 57%), linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .02) 82%);
  background-size: 260% 100%, 100% 100%; background-repeat: no-repeat; background-position: 100% 0, 0 0;
  -webkit-background-clip: text; background-clip: text;
  transform: translateY(var(--gy, 18%)); transition: transform 1.4s var(--ease); will-change: transform;
}
@supports (font-size: 1cqi) { .volt { font-size: calc(100cqi / 3.56); } }
.volt-wrap.is-in .volt { --gy: 6%; }
.volt > span { color: rgba(248, 190, 59, 0); }
.volt-wrap.is-live .volt { animation: wt-volt-band var(--volt) cubic-bezier(.45, .05, .55, .95) infinite; }
.volt-wrap.is-live .volt > span { animation: wt-volt-letter var(--volt) ease-in-out infinite; animation-delay: calc(.5s + var(--i, 0) * .3s); }

/* ------------------------------------------------------------------ */
/* Logowanie                                                           */
/* ------------------------------------------------------------------ */

.login-screen { --shell-pad: clamp(10px, 1.4vw, 18px); min-height: 100svh; padding: var(--shell-pad); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: var(--shell-pad); min-height: calc(100svh - var(--shell-pad) * 2); }

/* Granatowy panel marki (jak ciemne sekcje strony) */
.login-brand {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: clamp(16px, 3vh, 28px);
  padding: clamp(28px, 3.6vw, 52px) clamp(28px, 3.6vw, 52px) 0; border-radius: var(--radius-xl);
  background: var(--navy-deep); color: #fff;
  animation: wt-clip 1.3s var(--ease) backwards;
}
.login-brand::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--dots-light); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 75% 18%, #000 10%, transparent 72%); mask-image: radial-gradient(ellipse 80% 60% at 75% 18%, #000 10%, transparent 72%);
}
.login-brand::after {
  content: ""; position: absolute; z-index: -1; width: 80%; aspect-ratio: 1; right: -24%; top: -30%; border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 190, 59, .26), rgba(248, 190, 59, 0) 62%);
}
.login-brand .logo { width: clamp(140px, 12vw, 176px); }
.brand-copy { position: relative; margin-top: auto; max-width: 600px; }
.brand-title { margin: 0 0 20px; max-width: 14ch; font: 500 clamp(34px, 3.7vw, 58px)/1.02 var(--font-head); letter-spacing: -.04em; text-wrap: balance; }
.login-brand .volt-wrap { margin: 0 calc(-1 * clamp(28px, 3.6vw, 52px)); padding-inline: clamp(8px, 1.6vw, 20px); }

/* Lampka zawieszona na przewodzie: prąd płynie, lampka się ładuje i błyska */
.brand-lamp { --charge: 1; --in: 1; position: absolute; top: 0; right: clamp(28px, 5vw, 84px); z-index: 1; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.brand-lamp__wire { position: relative; display: block; width: 2px; height: clamp(64px, 13vh, 150px); background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .22) 0 8px, transparent 8px 16px); }
.brand-lamp__wire i { position: absolute; left: -1px; top: 0; width: 4px; height: calc(var(--in) * 100%); border-radius: 4px; background: repeating-linear-gradient(180deg, var(--sun) 0 10px, rgba(248, 190, 59, .3) 10px 18px); box-shadow: 0 0 12px rgba(248, 190, 59, .5); animation: wt-wire-flow 1.1s linear infinite; }
.brand-lamp__wire i::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #FFF3CF; box-shadow: 0 0 0 4px rgba(248, 190, 59, .3), 0 0 18px 4px rgba(248, 190, 59, .65); opacity: calc(var(--in) * (1 - var(--in)) * 4); }
.brand-lamp__core { position: relative; width: clamp(92px, 8.6vw, 128px); aspect-ratio: 62 / 54; margin: 16px 0 14px; }
.brand-lamp .lamp-svg--base { fill: rgba(255, 255, 255, .14); }
.brand-lamp__glow { position: absolute; inset: -70%; border-radius: 50%; background: radial-gradient(circle, rgba(248, 190, 59, .5), rgba(248, 190, 59, 0) 60%); opacity: calc(var(--charge) * var(--charge) * .55); transform: scale(calc(.7 + var(--charge) * .3)); }
.brand-lamp__ripple { position: absolute; left: 50%; top: 50%; width: 100%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(248, 190, 59, .7); opacity: 0; transform: translate(-50%, -50%) scale(.6); }
.brand-lamp.is-full .lamp-svg--lit { filter: drop-shadow(0 0 8px rgba(248, 190, 59, .7)); }
.brand-lamp.is-full:not(.is-flash) .brand-lamp__glow { animation: wt-breathe 4.5s ease-in-out infinite; }
.brand-lamp.is-flash .brand-lamp__glow { animation: wt-lamp-flash 1.4s var(--ease); }
.brand-lamp.is-flash .brand-lamp__ripple { animation: wt-lamp-ripple 1.4s cubic-bezier(.2, .7, .3, 1); }
.brand-lamp.is-flash .brand-lamp__core { animation: wt-lamp-pop .8s var(--ease); }
.brand-lamp__meter { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 11.5px/1.3 var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .55); font-variant-numeric: tabular-nums; }
.brand-lamp__meter b { font-weight: 600; color: #fff; }
.brand-lamp.is-full .brand-lamp__meter span { color: var(--sun); }

/* Formularz po prawej */
.login-main { position: relative; isolation: isolate; display: grid; place-items: center; padding: clamp(12px, 3vh, 56px) clamp(4px, 2vw, 40px); }
.login-main::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--dots); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 15%, transparent 72%); mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 15%, transparent 72%);
}
.login-main::after { content: ""; position: absolute; z-index: -1; right: 0; bottom: 0; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 100% 100%, rgba(248, 190, 59, .2), rgba(248, 190, 59, 0) 62%); }
.login-card {
  position: relative; width: min(100%, 460px); padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius-xl); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: wt-rise .9s var(--ease) .15s backwards;
}
.login-head h1 { font-size: clamp(32px, 3vw, 44px); margin-bottom: 8px; }
.login-head p { margin: 0; }
.login-form { display: grid; gap: 18px; margin-top: 26px; }
.login-form .primary, #mfa-form .primary, .setup-form .primary { width: 100%; min-height: 52px; margin-top: 4px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 54px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--muted); transition: background-color .2s, color .2s; }
.eye:hover { background: var(--mist); color: var(--navy); }
.eye svg { width: 20px; height: 20px; }

/* Etapy logowania: 01 login i hasło → 02 kod MFA */
.steps { list-style: none; display: flex; align-items: center; gap: 12px; margin: 0 0 26px; padding: 0 0 22px; border-bottom: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: 10px; min-width: 0; font: 500 11.5px/1.2 var(--font-text); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: color .4s; }
.step--login { flex: 1; color: var(--ink); }
.step--login::after { content: ""; flex: 1; min-width: 14px; height: 2px; margin-left: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--navy), var(--sun)) 0 0 / 0% 100% no-repeat, var(--line); transition: background-size .9s var(--ease); }
.step__label { white-space: nowrap; }
.step__num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); font: 600 12px/1 var(--font-text); letter-spacing: 0; color: var(--muted); flex-shrink: 0; transition: background-color .5s, border-color .5s, color .5s, transform .5s var(--ease); }
.step--login .step__num { background: var(--navy); border-color: var(--navy); color: #fff; }
.login-card:has(#mfa-panel:not([hidden])) .step--login .step__num { background: var(--sun); border-color: var(--sun); color: var(--navy-ink); }
.login-card:has(#mfa-panel:not([hidden])) .step--login::after { background-size: 100% 100%, auto; }
.login-card:has(#mfa-panel:not([hidden])) .step--mfa { color: var(--ink); }
.login-card:has(#mfa-panel:not([hidden])) .step--mfa .step__num { background: var(--navy); border-color: var(--navy); color: #fff; transform: scale(1.06); }
.login-card:has(#mfa-panel:not([hidden])) .login-head,
.login-card:has(#setup-panel:not([hidden])) .login-head,
.login-card:has(#setup-panel:not([hidden])) .steps { display: none; }

.mfa-panel { animation: wt-rise .6s var(--ease) backwards; }
.mfa-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.mfa-head h2 { margin: 2px 0 4px; font-size: clamp(24px, 2.2vw, 30px); font-weight: 500; letter-spacing: -.03em; }
.mfa-head p { margin: 0; }
.mfa-panel form, .setup-form { display: grid; gap: 14px; }
#enrollment { margin-bottom: 18px; }
#enrollment p { margin: 0; }
.secret-box { display: block; margin: 12px 0; padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1.5px dashed #B9C5D8; font: 600 14px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; word-break: break-all; color: var(--navy); }
.code-input { min-height: 62px; text-align: center; font: 600 26px/1 var(--font-head); letter-spacing: .4em; padding-left: calc(16px + .4em); }
.login-foot { display: flex; align-items: center; gap: 8px; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.login-foot .i { width: 17px; height: 17px; color: var(--sun-deep); }

/* ------------------------------------------------------------------ */
/* Panel: menu boczne                                                  */
/* ------------------------------------------------------------------ */

.app { display: grid; grid-template-columns: 284px minmax(0, 1fr); min-height: 100svh; }
/* Menu boczne: granatowe tło na całą wysokość treści, zawartość „przyklejona” do ekranu */
.sidebar { position: relative; z-index: 30; isolation: isolate; overflow: clip; background: var(--navy-deep); color: #fff; animation: wt-slide-in .6s var(--ease) backwards; }
.sidebar::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 320px; z-index: -1; background-image: var(--dots-light); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent);
}
.sidebar::after { content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; left: -150px; top: -170px; border-radius: 50%; background: radial-gradient(circle, rgba(248, 190, 59, .22), rgba(248, 190, 59, 0) 62%); }
.sidebar-inner {
  position: sticky; top: 0; height: 100%; max-height: 100svh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 26px; padding: 24px 16px 22px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.sidebar .muted { color: rgba(255, 255, 255, .55); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px 0; }
.sidebar .logo { width: 150px; }
.sidebar-badge { padding: 6px 10px; border-radius: 999px; background: var(--sun); color: var(--navy-ink); font: 700 11px/1 var(--font-text); letter-spacing: .14em; }

/* Lista agentów w lewym pasku. Przyciski „Agent 1”, „Agent 2”… tworzy app.js; awatar dodaje CSS. */
.sidebar-agents { display: grid; gap: 6px; min-width: 0; }
.sidebar-agents .nav-label { margin-bottom: 4px; }
.agent-tabs { display: grid; gap: 6px; min-width: 0; }
.agent-tabs > p { margin: 0; padding: 0 8px; }
.agent-tab {
  position: relative; display: grid; gap: 2px; width: 100%; min-width: 0; min-height: 58px; padding: 10px 14px 10px 58px; text-align: left; align-content: center;
  border-radius: 18px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .86);
  transition: background-color .25s var(--ease-std), border-color .25s, color .25s, box-shadow .3s;
}
.agent-tab::before { content: ""; position: absolute; left: 10px; top: 50%; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; background: var(--navy) url("avatar-woltanic.png") center / cover no-repeat; }
.agent-tab:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.agent-tab.active { background: #fff; border-color: #fff; color: var(--navy-ink); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .7); }
.agent-tab-number { font: 600 10.5px/1.2 var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--sun); }
.agent-tab.active .agent-tab-number { color: var(--navy); }
.agent-tab-name { font: 600 15px/1.25 var(--font-head); letter-spacing: -.01em; overflow-wrap: anywhere; }
.agent-tab-description { font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, .55); overflow-wrap: anywhere; }
.agent-tab.active .agent-tab-description { color: var(--muted); }

.nav { display: grid; gap: 3px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); }
.nav-label { display: flex; align-items: center; gap: 10px; margin: 0 8px 8px; font: 500 11.5px/1.3 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.nav-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(248, 190, 59, .22); }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 15px; border-radius: 999px; text-align: left; color: rgba(255, 255, 255, .84); font: 500 14.5px/1.2 var(--font-text); transition: background-color .2s var(--ease-std), color .2s var(--ease-std); }
.nav button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav button.active { background: #fff; color: var(--navy); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .7); }
.nav button .i { width: 19px; height: 19px; transition: transform .3s var(--ease); }
.nav button:hover .i { transform: translateX(2px); }
.nav button.active .i { color: var(--navy); }


/* Stopka: granatowa zaokrąglona karta pod treścią (jak panel logowania) z dużym napisem „woltanic”, przez który przechodzi prąd */
.app-footer {
  position: relative; isolation: isolate; overflow: hidden; width: min(100% - var(--gutter) * 2, 1320px); margin: 0 auto var(--gutter);
  padding-top: clamp(26px, 3.6vw, 48px); border-radius: var(--radius-xl); background: var(--navy-deep); color: rgba(255, 255, 255, .62);
}
.app-footer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--dots-light); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 10%, transparent 75%);
}
.app-footer::after { content: ""; position: absolute; z-index: -1; width: 55%; aspect-ratio: 1; right: -12%; top: -70%; border-radius: 50%; background: radial-gradient(circle, rgba(248, 190, 59, .22), rgba(248, 190, 59, 0) 62%); }
.volt-wrap--footer { padding-inline: clamp(8px, 1.6vw, 24px); }

/* ------------------------------------------------------------------ */
/* Panel: górny pasek i treść                                          */
/* ------------------------------------------------------------------ */

.workspace { min-width: 0; min-height: 100svh; display: flex; flex-direction: column; }
.workspace > .content { flex: 1 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px var(--gutter); transition: background-color .3s var(--ease-std), box-shadow .3s var(--ease-std), padding .3s var(--ease-std); }
.topbar.is-scrolled { padding-block: 10px; background: var(--paper); box-shadow: 0 1px 0 rgba(13, 33, 71, .08), 0 10px 24px -20px rgba(13, 33, 71, .5); }
.topbar { justify-content: flex-end; }
/* Ścieżka „Panel / …” powtarzała tytuł strony – zostaje w kodzie dla app.js, ale jest ukryta. */
.breadcrumb { display: none !important; align-items: center; gap: 10px; min-width: 0; font: 500 12px/1.3 var(--font-text); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.breadcrumb::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(248, 190, 59, .28); flex-shrink: 0; }
.user-control { display: flex; align-items: center; gap: 12px; padding: 5px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); flex-shrink: 0; }
.initials { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; font: 600 13px/1 var(--font-head); letter-spacing: .02em; flex-shrink: 0; }
.user-details { display: grid; gap: 1px; font-size: 12px; line-height: 1.3; }
#current-name { font: 600 14px/1.25 var(--font-head); color: var(--ink); }
.logout { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 15px; border-radius: 999px; background: var(--paper); color: var(--ink); font: 600 13px/1 var(--font-text); transition: background-color .2s, color .2s; }
.logout:hover { background: var(--navy); color: #fff; }
.logout .i { width: 16px; height: 16px; }

.content { width: min(100% - var(--gutter) * 2, 1320px); margin: 0 auto; padding: clamp(6px, 1.2vw, 14px) 0 clamp(40px, 5vw, 72px); }

/* Wejście widoku: elementy pojawiają się po kolei przy każdym przełączeniu */
[data-section] > * { animation: wt-rise .5s var(--ease) backwards; }
[data-section] > :nth-child(2) { animation-delay: .05s; }
[data-section] > :nth-child(3) { animation-delay: .1s; }
[data-section] > :nth-child(4) { animation-delay: .15s; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading > div { min-width: 0; }
.page-heading p { margin: 0; }
.page-heading p.eyebrow { margin-bottom: 10px; }
.page-heading .small.muted { font-size: 15px; max-width: 62ch; }
.agent-line .agent-name { font-weight: 600; color: var(--navy); }
/* Stan dostępu: żółty w trakcie sprawdzania, zielony po autoryzacji */
.state-pill { padding: 8px 14px; font-size: 12.5px; transition: background-color .4s, color .4s; }
#view-assistant:has(#agent-lock[hidden]) .state-pill { background: var(--green-soft); color: var(--green); }

/* ------------------------------------------------------------------ */
/* Asystent: scena rozmowy                                             */
/* ------------------------------------------------------------------ */

.assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: stretch; }
.agent-frame {
  position: relative; isolation: isolate; overflow: hidden; min-height: 500px; height: calc(100svh - 360px); max-height: 780px;
  border-radius: var(--radius-xl); background: var(--navy-deep); box-shadow: var(--shadow-lg);
}
.agent-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 0; background-image: var(--dots-light); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 42%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 60% 55% at 50% 42%, #000 10%, transparent 75%);
}
.agent-frame::after { content: ""; position: absolute; z-index: 0; width: 70%; aspect-ratio: 1; left: 15%; top: -10%; border-radius: 50%; background: radial-gradient(circle, rgba(248, 190, 59, .2), rgba(248, 190, 59, 0) 60%); }
/*
 * Widget 0.19.0 (placement „bottom”) przykleja swój panel do dołu: wysokość panelu = min(wysokość − 112 px, 550 px),
 * logo 192 px na środku panelu. Przesunięcie o max(40 px, 50% − 291 px) w górę ustawia logo dokładnie na środku sceny –
 * tam, gdzie stoi zastępcze logo przed wczytaniem widgetu, więc logo nie „opada” po sekundzie.
 */
.native-widget {
  --wt-lift: max(40px, 50% - 291px);
  display: block; position: absolute !important; top: calc(-1 * var(--wt-lift)) !important; bottom: var(--wt-lift) !important; left: 0 !important; right: 0 !important;
  width: 100% !important; height: auto !important; transform: none !important; z-index: 1 !important;
  --el-base: #0D2147; --el-base-hover: #132B5A; --el-base-active: #1A3A73; --el-base-primary: #FFFFFF; --el-base-subtle: #AFC0DD; --el-base-border: #2A4680; --el-base-error: #FFB4A8;
  --el-accent: #F8BE3B; --el-accent-hover: #FFCB55; --el-accent-active: #EAA816; --el-accent-primary: #081834;
  --el-button-radius: 999px; --el-input-radius: 14px; --el-overlay-padding: 16px;
}
.avatar-fallback { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* Po wczytaniu widgetu zastępcze logo nie znika od razu, tylko płynnie gaśnie nad logo widgetu (ta sama pozycja) – bez mignięcia. */
#avatar-fallback[hidden] { display: flex !important; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s ease .25s, visibility 0s linear .6s; }
#avatar-fallback[hidden] .stage-rings { display: none; }
.stage-avatar { position: relative; display: grid; place-items: center; width: 192px; height: 192px; }
.stage-avatar img { position: relative; z-index: 1; width: 192px; height: 192px; border-radius: 50%; box-shadow: 0 0 0 10px rgba(248, 190, 59, .08), 0 30px 60px -20px rgba(0, 0, 0, .6); }
.stage-rings { position: absolute; inset: 0; }
.stage-rings i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(248, 190, 59, .5); opacity: 0; animation: wt-ring 3.6s cubic-bezier(.2, .7, .3, 1) infinite; }
.stage-rings i:nth-child(2) { animation-delay: 1.8s; }
.stage-name { padding: 9px 16px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font: 600 13.5px/1.2 var(--font-text); text-align: center; max-width: calc(100% - 40px); }
.agent-lock {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  padding: 14px 18px; border-radius: 22px; background: rgba(8, 24, 52, .92); border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .88); font-size: 13.5px; line-height: 1.55; text-align: center;
  animation: wt-rise .5s var(--ease) backwards;
}
.agent-lock .secondary { min-height: 40px; padding: 0 16px; border-color: rgba(255, 255, 255, .3); background: transparent; color: #fff; font-size: 13.5px; }
.agent-lock .secondary:hover:not(:disabled) { background: #fff; border-color: #fff; color: var(--navy); }

/* Rozwijane karty: zwinięte pokazują tylko tytuł, po kliknięciu rozwijają się (jak akordeon na stronie) */
.acc { margin-bottom: 10px; border-radius: 22px; background: #fff; border: 1px solid var(--line); transition: border-color .3s, box-shadow .35s; }
.acc:hover { border-color: rgba(28, 61, 119, .3); }
.acc[open] { box-shadow: var(--shadow); border-color: rgba(28, 61, 119, .22); }
.acc > summary { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: inherit; cursor: pointer; list-style: none; user-select: none; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.acc-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--mist); color: var(--navy); flex-shrink: 0; transition: background-color .3s, color .3s; }
.acc-icon .i { width: 20px; height: 20px; }
.acc-icon--navy { background: var(--navy); color: var(--sun); }
.acc > summary:hover .acc-icon:not(.acc-icon--navy), .acc[open] .acc-icon:not(.acc-icon--navy) { background: var(--sun); color: var(--navy-ink); }
.acc-title { flex: 1; min-width: 0; display: grid; gap: 2px; font: 600 15.5px/1.25 var(--font-head); letter-spacing: -.01em; color: var(--ink); }
.acc-title small { font: 400 12.5px/1.35 var(--font-text); letter-spacing: 0; color: var(--muted); }
.acc-toggle { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); flex-shrink: 0; transition: transform .45s var(--ease), background-color .3s, border-color .3s; }
.acc-toggle::before, .acc-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; border-radius: 2px; background: var(--navy); }
.acc-toggle::after { transform: rotate(90deg); }
.acc > summary:hover .acc-toggle { border-color: var(--navy); }
.acc[open] .acc-toggle { transform: rotate(45deg); background: var(--sun); border-color: var(--sun); }
.acc-body { padding: 2px 18px 18px; animation: wt-open .45s var(--ease) backwards; }
.acc-body > p { margin: 0; }
.acc--card > summary { padding: 18px 18px 18px 20px; }
.acc--card .acc-body { padding: 4px 22px 22px; }
.acc--card .pill { flex-shrink: 0; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.detail-row:last-child { border: 0; padding-bottom: 0; }
.detail-row span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.acc-body > .agent-access-note { margin-bottom: 8px; font-weight: 600; color: var(--navy); }
.agent-access-note:empty { display: none; }
.status-ok { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }
.status-ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.numlist { list-style: none; margin: 0; padding: 0; counter-reset: wt-n; }
.numlist li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 8px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.numlist li:last-child { padding-bottom: 0; }
.numlist li::before { counter-increment: wt-n; content: counter(wt-n, decimal-leading-zero); grid-row: span 2; font: 600 12px/1.6 var(--font-text); color: var(--navy); }
.numlist b { font: 600 14.5px/1.3 var(--font-head); }
.numlist span { color: var(--muted); }
.numlist li:first-child { border-top: 0; padding-top: 4px; }

/* Czat z agentem: pod rozwijanymi kartami, wypełnia resztę wysokości sceny.
   Rozwinięcie karty nad czatem zmniejsza okno wiadomości (najmniej 300 px), potem wydłuża stronę. */
.assistant-info { display: flex; flex-direction: column; min-width: 0; }
.chat-card { flex: 1 1 0; min-height: 300px; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: #fff; border: 1px solid var(--line); transition: border-color .3s, box-shadow .35s; }
.chat-card:focus-within { border-color: rgba(28, 61, 119, .3); box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.chat-head h2 { margin: 0; font: 600 15.5px/1.25 var(--font-head); letter-spacing: -.01em; }
#chat-status { font-size: 12.5px; line-height: 1.4; }
.chat-card[data-state="live"] #chat-status { color: var(--green); }
.chat-card[data-state="error"] #chat-status { color: var(--red); }
.chat-end { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); flex-shrink: 0; transition: background-color .2s, border-color .2s, color .2s; }
.chat-end:hover { background: var(--red-soft); border-color: var(--red-soft); color: var(--red); }
.chat-end .i { width: 15px; height: 15px; }
.chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--paper); scrollbar-width: thin; }
.chat-msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; animation: wt-open .3s var(--ease) backwards; }
.chat-msg:empty { display: none; }
.chat-msg--user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 6px; }
.chat-msg--agent { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 6px; }
.chat-note { align-self: center; max-width: 100%; margin: 2px 0; padding: 4px 10px; border-radius: 999px; background: var(--mist); color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
/* „Agent pisze…”: trzy kropki po ostatniej wiadomości */
.chat-card.is-typing .chat-log::after { content: ""; flex-shrink: 0; align-self: flex-start; width: 52px; height: 30px; border-radius: 15px 15px 15px 6px; border: 1px solid var(--line); background: #fff radial-gradient(circle, var(--navy) 2.5px, transparent 3px) 0 50% / 12px 100% repeat-x; background-origin: content-box; padding: 0 9px; animation: wt-breathe 1.1s ease-in-out infinite; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-form textarea {
  flex: 1; min-width: 0; min-height: 44px; max-height: 132px; padding: 11px 14px; resize: none; border-radius: 14px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 400 14px/1.45 var(--font-text); outline: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.chat-form textarea::placeholder { color: #8892A3; }
.chat-form textarea:focus { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(28, 61, 119, .12); }
.chat-form textarea:disabled { opacity: .6; }
.chat-send { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sun); color: var(--navy-ink); flex-shrink: 0; transition: background-color .2s, transform .25s var(--ease); }
.chat-send:hover:not(:disabled) { background: #FFCB55; transform: translateY(-1px); }
.chat-send .i { width: 19px; height: 19px; stroke-width: 2.2; }

/* ------------------------------------------------------------------ */
/* Agenci                                                              */
/* ------------------------------------------------------------------ */

/* Karty agentów tworzy app.js: nagłówek (nazwa + status), opis, ID ElevenLabs, liczba kont, przyciski. */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-bottom: 14px; }
.agents-grid > .side-card:not(.agent-card) { padding: 28px; border-radius: var(--radius-lg); border: 1.5px dashed var(--line); background: #fff; color: var(--muted); text-align: center; }
.agent-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: clamp(20px, 2.2vw, 26px); border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); transition: transform .35s var(--ease), box-shadow .35s, border-color .3s; animation: wt-rise .6s var(--ease) backwards; }
.agent-card:nth-child(2) { animation-delay: .06s; }
.agent-card:nth-child(3) { animation-delay: .12s; }
.agent-card:nth-child(n+4) { animation-delay: .18s; }
.agent-card::after { content: ""; position: absolute; right: -110px; top: -110px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(248, 190, 59, .22), transparent 65%); pointer-events: none; transition: transform .6s var(--ease); }
.agent-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(28, 61, 119, .3); }
.agent-card:hover::after { transform: scale(1.25); }
.agent-card > * { position: relative; z-index: 1; }
.agent-card .integration-header { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.agent-card .integration-header::before { content: ""; width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; background: var(--navy-deep) url("avatar-woltanic-prad.svg") center / cover no-repeat; box-shadow: 0 12px 26px -14px rgba(13, 33, 71, .7); }
.agent-card h2 { flex: 1; min-width: 0; margin: 0; font-size: 21px; overflow-wrap: anywhere; }
.agent-card .integration-header .pill { flex-shrink: 0; }
.agent-card p { margin: 0; }
.agent-card .agent-description { font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.agent-card .agent-provider { align-self: flex-start; max-width: 100%; padding: 5px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); font: 500 12px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--navy); overflow-wrap: anywhere; }
.agent-card p.small.muted:not(.agent-description):not(.agent-provider) { padding-top: 12px; border-top: 1px dashed var(--line); line-height: 1.8; }
.agent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.agent-actions button { min-height: 42px; padding: 0 16px; font-size: 13.5px; }
.agents-more { max-width: 900px; }
.numlist code { padding: 1px 6px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); font-size: 12px; color: var(--navy); }

/* ------------------------------------------------------------------ */
/* Użytkownicy                                                       */
/* ------------------------------------------------------------------ */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-width: 0; min-height: 148px; padding: clamp(18px, 2vw, 26px); border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); transition: transform .35s var(--ease), box-shadow .35s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat span { font: 500 12px/1.3 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.stat strong { display: block; font: 500 clamp(36px, 3.6vw, 54px)/1 var(--font-head); letter-spacing: -.045em; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat--accent { background: var(--navy); border-color: var(--navy); }
.stat--accent span { color: rgba(255, 255, 255, .64); }
.stat--accent strong { color: #fff; }
.table-card { min-width: 0; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); overflow: hidden; }
.table-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 280px; max-width: 400px; }
.search .i { position: absolute; left: 17px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 46px; border-radius: 999px; background-color: #fff; }
.table-toolbar select { width: auto; flex: 0 1 210px; min-width: 0; border-radius: 999px; background-color: #fff; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 720px; text-align: left; font-size: 14px; }
th { padding: 14px 20px; background: var(--paper); color: var(--muted); font: 500 11.5px/1.3 var(--font-text); letter-spacing: .1em; }
td { padding: 15px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background-color .2s; }
tbody tr:hover { background: #FAFBFD; }
.person { display: flex; align-items: center; gap: 12px; }
.person .initials { width: 36px; height: 36px; font-size: 12px; }
.person-name { font: 600 14.5px/1.3 var(--font-head); }
.person span.small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.agent-cell { max-width: 280px; min-width: 160px; white-space: normal; font-size: 13.5px; line-height: 1.55; }
.edit-button { min-height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: 600 13px/1 var(--font-text); color: var(--ink); transition: background-color .2s, border-color .2s, color .2s; }
.edit-button:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.table-note { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.empty { padding: 36px !important; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Integracje                                                          */
/* ------------------------------------------------------------------ */

.integrations { display: grid; gap: 0; max-width: 840px; }
.connection-form { display: grid; gap: 14px; margin-top: 18px; }
.connection-form .primary { justify-self: start; }
.mapping { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.mapping code { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 12px; color: var(--navy); }

/* ------------------------------------------------------------------ */
/* Okna dialogowe                                                      */
/* ------------------------------------------------------------------ */

dialog { width: min(540px, calc(100% - 32px)); max-height: calc(100svh - 40px); overflow: auto; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; color: var(--ink); box-shadow: var(--shadow-lg); }
dialog[open] { animation: wt-dialog .5s var(--ease) backwards; }
dialog::backdrop { background: rgba(8, 24, 52, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog[open]::backdrop { animation: wt-fade .3s ease backwards; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.modal-header .eyebrow { margin-bottom: 8px; }
.modal-header h2 { margin: 0; font-size: clamp(24px, 2.2vw, 28px); font-weight: 500; letter-spacing: -.03em; }
.close-modal { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--paper); color: var(--ink); flex-shrink: 0; transition: background-color .2s, transform .35s var(--ease); }
.close-modal:hover { background: var(--mist); transform: rotate(90deg); }
.close-modal .i { width: 18px; height: 18px; }
.account-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* Edycja konta: dostęp do agentów (pola wyboru tworzy app.js) */
.agent-grants { min-width: 0; margin: 0; padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.agent-grants legend { padding: 0 6px; font: 500 12px/1.3 var(--font-text); letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
.agent-grants > p { margin: 0 0 6px; }
#account-agents { max-height: 220px; overflow: auto; }
#account-agents > p { margin: 0; }
.grant-option { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: 12px; font: 500 14px/1.4 var(--font-text); cursor: pointer; transition: background-color .2s; }
.grant-option:hover { background: #fff; }
.grant-description { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.dialog-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--sun-soft); color: var(--navy-ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Komunikat */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 450; display: flex; align-items: center; gap: 12px;
  max-width: min(560px, calc(100vw - 32px)); padding: 13px 20px 13px 16px; border-radius: 20px;
  background: var(--navy-deep); color: #fff; font-size: 14px; line-height: 1.5; box-shadow: 0 18px 40px -16px rgba(8, 24, 52, .7);
  transform: translateX(-50%); animation: wt-toast .5s var(--ease) backwards;
}
.toast::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(248, 190, 59, .25); flex-shrink: 0; }

/* ------------------------------------------------------------------ */
/* Animacje                                                            */
/* ------------------------------------------------------------------ */

@keyframes wt-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes wt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wt-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes wt-word { from { transform: translateY(108%); } to { transform: none; } }
@keyframes wt-marker { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
@keyframes wt-line { from { transform: scaleX(0); } to { transform: none; } }
@keyframes wt-clip { from { clip-path: inset(6% 4% 0 4% round var(--radius-xl)); } to { clip-path: inset(0 0 0 0 round var(--radius-xl)); } }
@keyframes wt-slide-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes wt-dialog { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes wt-toast { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes wt-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(248, 190, 59, .3); } 50% { box-shadow: 0 0 0 7px rgba(248, 190, 59, .08); } }
@keyframes wt-dot { 0%, 100% { box-shadow: 0 0 0 0 rgba(20, 108, 67, .45); } 60% { box-shadow: 0 0 0 6px rgba(20, 108, 67, 0); } }
@keyframes wt-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.5); } }
@keyframes wt-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes wt-breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes wt-sun-drift { from { transform: translate(0, 0); } to { transform: translate(-8%, 6%); } }
@keyframes wt-wire-flow { to { background-position: 0 18px; } }
@keyframes wt-loader-safety { to { opacity: 0; visibility: hidden; } }
@keyframes wt-lamp-flash { 0% { opacity: .55; transform: scale(1); } 16% { opacity: 1; transform: scale(1.45); } 100% { opacity: .55; transform: scale(1); } }
@keyframes wt-lamp-ripple { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.6); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); } }
@keyframes wt-lamp-pop { 0% { transform: scale(1); } 30% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes wt-volt-band { 0% { background-position: 100% 0, 0 0; } 40%, 100% { background-position: 0% 0, 0 0; } }
@keyframes wt-volt-letter {
  0%, 100% { color: rgba(248, 190, 59, 0); text-shadow: 0 0 0 rgba(248, 190, 59, 0); }
  2.6% { color: rgba(255, 214, 110, .95); text-shadow: 0 0 24px rgba(248, 190, 59, .7), 0 0 4px rgba(255, 236, 180, .85); }
  3.6% { color: rgba(255, 214, 110, .6); }
  4.6% { color: rgba(255, 228, 150, 1); text-shadow: 0 0 30px rgba(248, 190, 59, .8), 0 0 6px rgba(255, 240, 200, .9); }
  13% { color: rgba(248, 190, 59, .16); text-shadow: 0 0 36px rgba(248, 190, 59, 0); }
  22% { color: rgba(248, 190, 59, 0); text-shadow: 0 0 0 rgba(248, 190, 59, 0); }
}

/* ------------------------------------------------------------------ */
/* Responsywność                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 1240px) {
  .assistant-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1100px) {
  .assistant-layout { grid-template-columns: minmax(0, 1fr); }
  .assistant-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; align-items: start; }
  .assistant-info .acc { margin: 0; }
  .chat-card { grid-column: 1 / -1; flex: none; height: 440px; min-height: 0; }
  .agent-frame { height: 600px; }
  .app { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar .logo { width: 132px; }
}
@media (max-height: 760px) and (min-width: 1024px) {
  .brand-lamp__wire { height: 36px; }
  .brand-lamp__meter { display: none; }
}
@media (max-width: 1023px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .login-brand { gap: 18px; padding: 24px 24px 0; }
  .login-brand .logo { width: 140px; }
  .brand-lamp { display: none; }
  .brand-copy { margin-top: 4px; }
  .brand-title { max-width: 20ch; margin-bottom: 4px; font-size: clamp(28px, 5.4vw, 40px); }
  .login-brand .volt-wrap { margin-inline: -24px; }
  .login-main { padding: 18px 0 28px; }
  .login-card { width: min(100%, 560px); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .workspace { min-height: 0; }
  .app-footer { width: auto; margin: 8px 16px 16px; border-radius: var(--radius-lg); }
  .sidebar { border-radius: 0 0 28px 28px; animation-name: wt-fade; }
  .sidebar::before { height: 100%; }
  .sidebar-inner { position: static; height: auto; max-height: none; overflow: visible; gap: 14px; padding: 16px 16px 14px; }
  .sidebar-head { padding: 0 2px; }
  .sidebar .logo { width: 128px; }
  /* Telefon i tablet: agenci jako przewijana pozioma lista u góry */
  .sidebar-agents .nav-label { display: flex; margin: 0 2px 6px; }
  .agent-tabs { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
  .agent-tab { flex: none; width: 236px; scroll-snap-align: start; }
  .agent-tab-description { font-size: 12px; }
  .nav { display: flex; gap: 6px; overflow-x: auto; }
  .nav-label { display: none; }
  .nav button { width: auto; flex: none; white-space: nowrap; padding: 9px 14px; font-size: 13.5px; background: rgba(255, 255, 255, .06); }
  .topbar { padding: 10px 16px; }
  .user-details { display: none; }
  .content { width: min(100% - 32px, 1320px); }
}
@media (max-width: 640px) {
  .page-heading { flex-wrap: wrap; align-items: flex-start; gap: 14px; }
  .page-heading .primary { min-height: 44px; font-size: 13.5px; }
  .agent-frame { min-height: 480px; height: 540px; border-radius: var(--radius-lg); }
  .acc--card > summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) 32px; grid-template-areas: "icon title toggle" "icon pill toggle"; row-gap: 6px; padding: 14px 14px 14px 16px; }
  .acc--card .acc-icon { grid-area: icon; align-self: start; }
  .acc--card .acc-title { grid-area: title; }
  .acc--card .pill { grid-area: pill; justify-self: start; }
  .acc--card .acc-toggle { grid-area: toggle; }
  .acc--card .acc-body { padding: 4px 16px 18px; }
  .stats { gap: 8px; }
  .stat { min-height: 0; gap: 10px; padding: 14px; border-radius: var(--radius); }
  .stat span { font-size: 10.5px; letter-spacing: .06em; }
  .stat strong { font-size: 32px; }
  .table-toolbar { flex-direction: column; padding: 12px; }
  .search, .table-toolbar select { max-width: none; flex: none; width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .login-card { padding: 22px; border-radius: var(--radius-lg); }
  .steps { gap: 8px; }
  .step { gap: 8px; letter-spacing: .06em; }
  .breadcrumb { font-size: 11px; letter-spacing: .06em; }
  .logout { padding: 0 12px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions button { flex: 1 1 auto; }
}

/* Ograniczony ruch: bez animacji i bez ekranu ładowania */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .wt-loader { display: none; }
  .js .split .w > span { transform: none; }
}
