/* Okno „Zapytaj Claude” pulpitu huba i modulow bez wlasnego czatu
   (public/czat.js). Wlasne klasy z przedrostkiem czat-, zeby nie zderzyc sie
   z arkuszem zadnego modulu; kolory ze zmiennych app.css (z zapasem). */

.czat-fab {
  position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 55; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px;
  border-radius: 999px; border: 0; background: var(--accent, #eb4325); color: #fff;
  font: 500 14px/1.2 'Roboto', ui-sans-serif, system-ui, sans-serif;
  box-shadow: var(--shadow, 0 12px 30px rgba(0, 0, 0, .08)); cursor: pointer;
}
.czat-fab:hover { background: var(--accent-hover, #fd5b3d); }
.czat-fab[hidden], .czat-okno[hidden] { display: none !important; }
.czat-fab-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: .85; }

.czat-okno {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, 100%);
  display: flex; flex-direction: column; background: var(--surface, #fff); color: var(--ink, #3f3f3f);
  border-left: 1px solid var(--line, #ededee); box-shadow: var(--shadow, 0 12px 30px rgba(0, 0, 0, .08));
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  font-size: 13.5px; line-height: 1.5; text-align: left;
}
/* Szeroki ekran: strona odsuwa sie, zeby okno nie zaslanialo tresci. */
@media (min-width: 1300px) { body.czat-otwarty { margin-right: 440px; } }
/* Telefon: okno na caly widoczny ekran, strona pod spodem stoi. */
@media (max-width: 640px) {
  .czat-okno { width: 100%; border-left: 0; top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); }
  html.czat-blokada, html.czat-blokada body { overflow: hidden; }
}

.czat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line, #ededee); }
.czat-title { display: flex; align-items: baseline; gap: 8px; }
.czat-title b { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 15px; }
.czat-title span { font-size: 12px; color: var(--muted, #808285); }
.czat-head-act { display: flex; gap: 6px; align-items: center; }

.czat-btn {
  border: 1px solid var(--line-strong, #ddd); background: var(--surface, #fff); color: var(--ink, #3f3f3f);
  border-radius: var(--radius-sm, 8px); padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.czat-btn:hover { border-color: var(--accent, #eb4325); color: var(--accent, #eb4325); }
.czat-ikona { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted, #808285); cursor: pointer; }
.czat-ikona:hover { background: var(--hover, #f0f0f1); color: var(--ink, #3f3f3f); }

.czat-log { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.czat-pusty p { margin: 0 0 10px; color: var(--muted, #808285); }
.czat-sug { display: flex; flex-wrap: wrap; gap: 6px; }
.czat-sug .czat-btn { white-space: normal; text-align: left; }

.czat-m { max-width: 100%; overflow-wrap: anywhere; }
.czat-ja { align-self: flex-end; background: var(--accent-soft, #fbe8e3); padding: 8px 12px; border-radius: 12px 12px 4px 12px; }
.czat-claude { align-self: flex-start; }
.czat-claude p { margin: 0 0 6px; }
.czat-claude p:last-child { margin-bottom: 0; }
.czat-claude ul, .czat-claude ol { margin: 2px 0 6px; padding-left: 20px; }
.czat-claude li { margin: 2px 0; }
.czat-claude code { font-family: 'Cousine', monospace; font-size: 12px; background: var(--hover, #f0f0f1); padding: 1px 4px; border-radius: 4px; }
.czat-claude .czat-h { font-weight: 700; margin-top: 6px; }
.czat-claude a { color: var(--accent, #eb4325); text-decoration: underline; text-underline-offset: 2px; }
.czat-tab { overflow-x: auto; margin: 4px 0 8px; }
.czat-tab table { border-collapse: collapse; font-size: 12.5px; }
.czat-tab th, .czat-tab td { border: 1px solid var(--line, #ededee); padding: 4px 8px; text-align: left; vertical-align: top; }
.czat-tab th { background: var(--surface-2, #fafafa); font-weight: 600; }
.czat-blad { align-self: stretch; background: #fbe4e2; color: #b3261e; padding: 8px 12px; border-radius: var(--radius-sm, 8px); font-size: 12.5px; }

.czat-status { padding: 6px 14px; font-size: 12px; color: var(--muted, #808285); border-top: 1px solid var(--line, #ededee); animation: czatpuls 1.6s ease-in-out infinite; }
.czat-status[hidden] { display: none; }
@keyframes czatpuls { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .czat-status { animation: none; } }

.czat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 14px 6px; border-top: 1px solid var(--line, #ededee); align-items: end; }
.czat-form textarea {
  resize: none; min-height: 44px; max-height: 160px; width: 100%; font: inherit; font-size: 13.5px; line-height: 1.4;
  padding: 8px 10px; border: 1px solid var(--line-strong, #ddd); border-radius: var(--radius-sm, 8px); background: var(--surface, #fff); color: inherit;
}
.czat-form textarea:focus { outline: 2px solid var(--accent-soft, #fbe8e3); border-color: var(--accent, #eb4325); }
.czat-wyslij { border: 0; border-radius: var(--radius-sm, 8px); background: var(--accent, #eb4325); color: #fff; padding: 10px 14px; font: inherit; font-weight: 500; cursor: pointer; }
.czat-wyslij:hover { background: var(--accent-hover, #fd5b3d); }
.czat-wyslij:disabled { opacity: .6; cursor: default; }
.czat-foot { margin: 0; padding: 0 14px 10px; font-size: 11px; color: var(--muted, #808285); }
.czat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Dotyk: pola 16 px (iOS powieksza mniejsze), wieksze cele. */
@media (pointer: coarse) {
  .czat-form textarea { font-size: 16px; }
  .czat-ikona { width: 40px; height: 40px; }
}
