.czat-panel-glowna {
  margin: 0 auto 1.5rem auto;
  padding: 1.6rem 1.8rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: linear-gradient(165deg, rgba(30, 10, 14, 0.94) 0%, rgba(14, 8, 10, 0.96) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  font-family: Inter, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", sans-serif;
}
.czat-panel-glowna [hidden] {
  display: none !important;
}
.czat-naglowek-panelu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.55rem;
}
.czat-naglowek-panelu h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.2px;
}
.czat-naglowek-akcje {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.czat-opis-glowna {
  margin: 0 0 1.15rem 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #cbd5e1;
}
.czat-przycisk-dol {
  padding: 0.45rem 0.9rem;
  border-radius: 7px;
  border: 1px solid rgba(248, 113, 113, 0.75);
  background: rgba(220, 38, 38, 0.28);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.czat-przycisk-dol:hover {
  background: rgba(220, 38, 38, 0.48);
}
.czat-btn-wlasciciel {
  padding: 0.4rem 0.78rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: all 0.15s ease;
}
.czat-btn-wlasciciel::-webkit-details-marker {
  display: none;
}
.czat-btn-wlasciciel:hover {
  border-color: rgba(248, 113, 113, 0.55);
  color: #ffffff;
}
.czat-detale-logowanie {
  position: relative;
}
.czat-status-wlasciciel {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  border: 1px solid rgba(74, 222, 128, 0.42);
  background: rgba(22, 163, 74, 0.16);
  color: #bbf7d0;
  font-size: 0.84rem;
  font-weight: 600;
}
.czat-form-wyloguj {
  display: inline;
  margin: 0;
}
.czat-panel-logowania {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 9px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(10, 6, 8, 0.92);
}
.czat-panel-logowania input {
  flex: 1;
  min-width: 190px;
  padding: 0.52rem 0.8rem;
  border-radius: 7px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: #0a0608;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
.czat-panel-logowania input:focus {
  border-color: #f87171;
}
/* Natywne zakotwiczenie suwaka na samym dole bez czekania na JS */
.czat-okno {
  display: flex;
  flex-direction: column-reverse;
  height: 60vh;
  min-height: 400px;
  max-height: 700px;
  overflow-y: auto;
  padding: 1.3rem 1.45rem;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.32);
  background: #0a0608;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.78);
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 68, 68, 0.55) #0a0608;
}
.czat-lista-wewnatrz {
  display: flex;
  flex-direction: column;
  margin-bottom: auto;
}
.czat-pusto {
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 1.05rem;
  color: #94a3b8;
}
.czat-wiadomosc {
  padding: 0.95rem 1.15rem;
  margin-bottom: 0.9rem;
  border-radius: 9px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  background: rgba(255, 255, 255, 0.035);
}
.czat-wiadomosc.wlasciciel {
  border-color: rgba(239, 68, 68, 0.48);
  background: linear-gradient(145deg, rgba(127, 29, 29, 0.24) 0%, rgba(20, 9, 12, 0.65) 100%);
}
.czat-wiadomosc:last-child {
  margin-bottom: 0;
  border-color: rgba(248, 113, 113, 0.55);
}
.czat-wiadomosc-gora {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.38rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.czat-autor-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.czat-autor-nazwa {
  font-size: 1.06rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.15px;
}
.czat-odznaka-wlasciciel {
  padding: 0.14rem 0.48rem;
  border-radius: 5px;
  border: 1px solid rgba(248, 113, 113, 0.65);
  background: rgba(220, 38, 38, 0.32);
  color: #ffe4e6;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}
.czat-czas {
  font-size: 0.88rem;
  font-weight: 500;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.czat-tresc {
  margin: 0;
  font-size: 1.09rem;
  line-height: 1.65;
  color: #f3f4f6;
  white-space: pre-wrap;
  word-break: break-word;
}
.czat-formularz {
  margin-top: 1.25rem;
}
.czat-wiersz-pol {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}
.czat-pole-grupa {
  display: flex;
  flex-direction: column;
}
.czat-pole-autor {
  width: 28%;
  min-width: 210px;
}
.czat-pole-tresc {
  flex: 1;
}
.czat-etykieta-rzad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.czat-etykieta {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}
.czat-licznik {
  font-size: 0.82rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.czat-input,
.czat-textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: #0a0608;
  color: #f8fafc;
  font-family: inherit;
  font-size: 1.04rem;
  line-height: 1.55;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.czat-input {
  padding: 0.72rem 0.92rem;
}
.czat-textarea {
  padding: 0.75rem 0.95rem;
  resize: vertical;
  min-height: 86px;
}
.czat-input:focus,
.czat-textarea:focus {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}
.czat-komunikat {
  margin-top: 0.8rem;
  padding: 0.65rem 0.95rem;
  border-radius: 8px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #e2e8f0;
}
.czat-komunikat.blad {
  background: rgba(239, 68, 68, 0.14);
  border-color: #ef4444;
  color: #fecaca;
}
.czat-akcje {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}
.czat-przycisk-wyslij {
  cursor: pointer;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.65);
  background: rgba(185, 28, 28, 0.55);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.15s ease;
}
.czat-przycisk-wyslij:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.78);
}
.czat-przycisk-wyslij:disabled {
  opacity: 0.6;
  cursor: wait;
}
@media (max-width: 820px) {
  .czat-wiersz-pol {
    flex-direction: column;
  }
  .czat-pole-autor {
    width: 100%;
    min-width: 0;
  }
  .czat-okno {
    height: 54vh;
    min-height: 320px;
  }
}

/* === KOLORY UZYTKOWNIKOW I WLASCICIELA === */
.czat-autor-nazwa {
  color: #ffffff;
}

.czat-wiadomosc.wlasciciel,
.czat-wiadomosc.wlasciciel:last-child {
  border: 2px solid #5b21b6;
  background: linear-gradient(145deg, rgba(59, 7, 100, 0.34) 0%, rgba(14, 7, 22, 0.85) 100%);
  box-shadow: 0 0 12px rgba(91, 33, 182, 0.42), inset 0 0 10px rgba(88, 28, 135, 0.18);
}

.czat-wiadomosc.wlasciciel .czat-wiadomosc-gora {
  border-bottom-color: rgba(139, 92, 246, 0.25);
}

.czat-wiadomosc.wlasciciel .czat-autor-nazwa {
  background: linear-gradient(180deg, #fff3a1 0%, #ff8c00 48%, #ff2400 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 85, 0, 0.7));
}

.czat-wiadomosc.wlasciciel .czat-tresc {
  color: #4ade80;
}

.czat-odznaka-wlasciciel {
  border-color: #6b21a8;
  background: rgba(88, 28, 135, 0.48);
  color: #e9d5ff;
}
