:root {
  --avo-red: #c22463;
  --avo-blue: #2980b9;

  --bg: #ffffff;
  --panel: #ffffff;
  --panel2: #ffffff;

  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;

  --shadow: 0 10px 10px rgba(0, 0, 0, .12);
  --radius: 14px;
}


/* ========================================
   RESET
======================================== */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  color: var(--text);

  background: linear-gradient(
    180deg,
    #ffffff 0%,
    var(--bg) 100%
  );

  overflow: hidden;
}


/* ========================================
   GÓRA
======================================== */

.avo-title {
  font-weight: 800;
  font-size: 16px;
}

.avo-sub {
  font-size: 12px;
  color: var(--muted);
}

.avo-pill {
  font-size: 11px;

  padding: 4px 8px;

  border: 1px solid var(--border);
  border-radius: 999px;

  color: var(--muted);
}


/* ========================================
   WRAPPER
   Pełna dostępna przestrzeń
======================================== */

.avo-wrap {
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;

  max-width: none !important;
  max-height: none !important;

  margin: 0 !important;
  padding: 7px !important;

  display: flex !important;
  flex-direction: column !important;

  overflow: hidden;
}


/* ========================================
   KARTA
   100% wrappera + zaokrąglone rogi
======================================== */

.avo-card {
  width: 100% !important;
  height: 100% !important;

  min-width: 0 !important;
  min-height: 0 !important;

  max-width: none !important;
  max-height: none !important;

  margin: 0 !important;
  padding: 7px !important;

  box-sizing: border-box !important;

  display: flex !important;
  flex-direction: column !important;

  flex: 1 1 auto !important;

  border: 1px solid var(--border);

  background: linear-gradient(
    180deg,
    var(--panel) 0%,
    var(--panel2) 100%
  );

  /* ZAOKRĄGLONE ROGI */
  border-radius: var(--radius);

  /* CIEŃ */
  box-shadow: var(--shadow);

  /*
    Bardzo ważne:
    zawartość nie wychodzi poza
    zaokrąglone rogi.
  */
  overflow: hidden;
}


/* ========================================
   NAGŁÓWEK KARTY
======================================== */

.avo-card__head {
  width: 100%;

  flex: 0 0 auto;

  padding: 12px 14px 8px;

  border-bottom: 1px solid var(--border);
}

.avo-h1 {
  margin: 0;

  font-size: 16px;
}

.avo-h1::after {
  content: "";

  display: block;

  width: 120px;
  height: 3px;

  margin-top: 6px;

  border-radius: 999px;

  background: linear-gradient(
    90deg,
    var(--avo-red),
    var(--avo-blue)
  );
}

.avo-hint {
  margin-top: 6px;

  font-size: 12px;

  color: var(--muted);
}


/* ========================================
   LOG / WIADOMOŚCI

   Wypełnia całą wolną przestrzeń
======================================== */

.avo-log {
  width: 100%;

  flex: 1 1 auto;

  /*
    Konieczne przy flexboxie,
    aby scroll działał poprawnie.
  */
  min-width: 0;
  min-height: 0;

  height: auto !important;

  padding: 10px;

  overflow-y: auto;
  overflow-x: hidden;

  background: #ffffff;

  scroll-behavior: smooth;
}


/* ========================================
   SCROLLBAR
======================================== */

.avo-log::-webkit-scrollbar {
  width: 8px;
}

.avo-log::-webkit-scrollbar-track {
  background: transparent;
}

.avo-log::-webkit-scrollbar-thumb {
  background: #d1d5db;

  border-radius: 999px;
}

.avo-log::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}


/* ========================================
   WIERSZE WIADOMOŚCI
======================================== */

.avo-row {
  width: 100%;

  display: flex;

  margin: 8px 0;
}


/* UŻYTKOWNIK */

.avo-row.is-user {
  justify-content: flex-end;
}


/* BOT */

.avo-row.is-bot {
  justify-content: flex-start;
}


/* SYSTEM */

.avo-row.is-sys {
  justify-content: center;
}


/* ========================================
   DYMKI WIADOMOŚCI
======================================== */

.avo-bubble {
  max-width: 80%;

  padding: 8px 10px;

  border-radius: 12px;

  border: 1px solid var(--border);

  background: #f9fafb;

  line-height: 1.3;

  font-size: 13px;

  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}


/* Dymek użytkownika */

.avo-row.is-user .avo-bubble {
  background: rgba(194, 36, 99, .12);

  border-color: rgba(
    194,
    36,
    99,
    .35
  );
}


/* Dymek bota */

.avo-row.is-bot .avo-bubble {
  background: rgba(41, 128, 185, .12);

  border-color: rgba(
    41,
    128,
    185,
    .35
  );
}


/* Wiadomość systemowa */

.avo-row.is-sys .avo-bubble {
  background: #f3f4f6;

  color: var(--muted);
}


/* ========================================
   FORMULARZ
======================================== */

.avo-form {
  width: 100%;

  flex: 0 0 auto;

  padding: 10px;

  border-top: 1px solid var(--border);

  display: flex;

  align-items: center;

  gap: 8px;

  background: #ffffff;
}


/* ========================================
   INPUT
======================================== */

.avo-input {
  flex: 1 1 auto;

  width: 100%;
  min-width: 0;

  height: 40px;

  padding: 0 10px;

  border: 1px solid var(--border);

  border-radius: 10px;

  font-family: Arial, sans-serif;

  font-size: 13px;

  color: var(--text);

  background: #ffffff;
}

.avo-input::placeholder {
  color: var(--muted);
}

.avo-input:focus {
  outline: none;

  border-color: var(--avo-red);

  box-shadow:
    0 0 0 2px
    rgba(194, 36, 99, .20);
}


/* ========================================
   PRZYCISK
======================================== */

.avo-btn {
  flex: 0 0 auto;

  height: 40px;

  padding: 0 14px;

  border: 0;

  border-radius: 10px;

  background: var(--avo-red);

  color: #ffffff;

  font-family: Arial, sans-serif;

  font-weight: 700;

  cursor: pointer;

  transition:
    transform .15s ease,
    background .15s ease;
}

.avo-btn:hover {
  transform: scaleX(1.10);

  background: var(--avo-blue);
}

.avo-btn:active {
  transform: scale(.98);
}

.avo-btn:focus-visible {
  outline: 2px solid var(--avo-blue);

  outline-offset: 2px;
}


/* ========================================
   STOPKA
======================================== */

.avo-foot {
  width: 100%;

  flex: 0 0 auto;

  padding: 6px 10px 10px;

  font-size: 11px;

  color: var(--muted);

  text-align: center;

  background: #ffffff;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 768px) {

  .avo-wrap {
    padding: 7px !important;
  }

  .avo-card {
    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;

    /*
      Zachowujemy zaokrąglenia
      również na tablecie.
    */
    border-radius: var(--radius);
  }

  .avo-bubble {
    max-width: 85%;
  }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 520px) {

  html,
  body {
    width: 100%;
    height: 100%;
  }

  .avo-wrap {
    width: 100% !important;

    height: 100vh !important;
    height: 100dvh !important;

    padding: 7px !important;
  }

  .avo-card {
    width: 100% !important;
    height: 100% !important;

    min-width: 0 !important;
    min-height: 0 !important;

    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;

    padding: 5px !important;

    /*
      NIE usuwamy zaokrągleń
      na urządzeniach mobilnych.
    */
    border-radius: var(--radius);

    box-shadow: var(--shadow);
  }

  .avo-card__head {
    padding: 10px;
  }

  .avo-log {
    flex: 1 1 auto;

    min-height: 0;

    padding: 8px;
  }

  .avo-bubble {
    max-width: 90%;

    font-size: 13px;
  }

  .avo-form {
    padding: 8px;

    gap: 6px;
  }

  .avo-input {
    height: 42px;
  }

  .avo-btn {
    height: 42px;

    padding: 0 12px;
  }
}


/* ========================================
   BARDZO MAŁE EKRANY
======================================== */

@media (max-width: 360px) {

  .avo-wrap {
    padding: 5px !important;
  }

  .avo-card {
    border-radius: var(--radius);
  }

  .avo-bubble {
    max-width: 94%;
  }

  .avo-form {
    padding: 6px;
  }

  .avo-btn {
    padding: 0 10px;
  }
}