/* Pomocnik AI: pływający przycisk i panel czatu (prawy dolny róg). */
.pomocnik-kontener {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: inherit;
  color: var(--ink, #1e293b);
}

.pomocnik-przycisk {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  background: var(--head, #0f766e);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.35);
}

.pomocnik-przycisk:hover,
.pomocnik-przycisk:focus-visible {
  background: var(--head-dark, #115e59);
  outline: 2px solid rgba(15, 118, 110, 0.4);
  outline-offset: 2px;
}

.pomocnik-panel {
  /* Domyślnie większe niż na starcie (było 400x600); okno rozciąga się w lewo
     i w górę, bo kontener jest zaczepiony prawym dolnym rogiem. Rozmiar da się
     przeciągnąć uchwytem w lewym górnym rogu (zapamiętywany per przeglądarka),
     a granice tu ustawione to tylko krańce, w jakich wolno go rozciągać. */
  width: min(560px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 100px));
  min-width: 320px;
  min-height: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #dbe2ea);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.pomocnik-panel[hidden] {
  display: none;
}

.pomocnik-uchwyt {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 2;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(255, 255, 255, 0.85) 42% 46%, transparent 46% 58%, rgba(255, 255, 255, 0.85) 58% 62%, transparent 62% 100%);
}
.pomocnik-uchwyt:hover,
.pomocnik-uchwyt:focus-visible {
  background-color: rgba(15, 118, 110, 0.25);
}
.pomocnik-panel.pomocnik-zmiana-rozmiaru {
  user-select: none;
}

.pomocnik-naglowek {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 26px;
  background: var(--head, #0f766e);
  color: #fff;
}

.pomocnik-akcje {
  display: flex;
  gap: 6px;
}

.pomocnik-ikona {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}

.pomocnik-ikona:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pomocnik-info {
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted, #64748b);
  border-bottom: 1px solid var(--line, #dbe2ea);
  background: var(--bg, #f6f7f9);
}

.pomocnik-lista {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg, #f6f7f9);
}

.pomocnik-wiadomosc {
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #dbe2ea);
}

.pomocnik-user {
  align-self: flex-end;
  background: #e6f4f1;
  border-color: #bfe3dc;
}

.pomocnik-assistant {
  align-self: flex-start;
}

.pomocnik-uwaga {
  align-self: stretch;
  background: var(--warn-bg, #fef3c7);
  border-color: #f2dd9b;
  color: var(--warn, #a16207);
}

.pomocnik-czeka .pomocnik-tresc {
  color: var(--muted, #64748b);
  font-style: italic;
}

.pomocnik-kto {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #64748b);
  margin-bottom: 2px;
}

.pomocnik-tresc p {
  margin: 0 0 6px;
}

.pomocnik-tresc p:last-child {
  margin-bottom: 0;
}

.pomocnik-tresc ul {
  margin: 0 0 6px;
  padding-left: 18px;
}

.pomocnik-tabela {
  margin: 0 0 6px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  overflow-x: auto;
  background: var(--table-row-alt, #f8fafc);
  border: 1px solid var(--table-line, #cbd5e1);
  border-radius: 6px;
  white-space: pre;
}

.pomocnik-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.pomocnik-podpowiedzi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 0;
  background: var(--panel, #fff);
  border-top: 1px solid var(--line, #dbe2ea);
}

.pomocnik-chip {
  border: 1px solid var(--line, #dbe2ea);
  background: var(--bg, #f6f7f9);
  color: var(--head-dark, #115e59);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.pomocnik-chip:hover {
  background: #e6f4f1;
}

.pomocnik-form {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel, #fff);
}

.pomocnik-pole {
  flex: 1;
  resize: none;
  border: 1px solid var(--line, #dbe2ea);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  min-height: 44px;
}

.pomocnik-pole:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.4);
  border-color: var(--head, #0f766e);
}

.pomocnik-wyslij {
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--head, #0f766e);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.pomocnik-wyslij:disabled,
.pomocnik-pole:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pomocnik-stopka {
  padding: 6px 14px 10px;
  font-size: 11px;
  color: var(--muted, #64748b);
  background: var(--panel, #fff);
  border-top: 1px solid var(--line, #dbe2ea);
  min-height: 16px;
}

@media (max-width: 600px) {
  .pomocnik-kontener {
    right: 10px;
    bottom: 10px;
  }

  .pomocnik-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 90px);
  }
}

@media print {
  .pomocnik-kontener {
    display: none;
  }
}
