.lia-chat-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(15, 143, 97, 0.14), transparent 28%),
    linear-gradient(135deg, #eaf1f2 0%, #f7fafb 48%, #edf2f4 100%);
}

.lia-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: clamp(8px, 1vw, 18px);
}

.lia-desktop-frame {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: clamp(240px, 16vw, 300px) minmax(0, 1fr);
  gap: clamp(10px, 1vw, 18px);
}

.lia-desktop-sidebar {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: clamp(10px, 1vw, 18px);
  padding: clamp(12px, 1vw, 18px);
  border-radius: 28px;
  background: rgba(248, 250, 251, 0.88);
  box-shadow: var(--lia-shadow);
  border: 1px solid rgba(255, 255, 255, 0.76);
}

.lia-brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(10px, 0.9vw, 14px);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(15, 143, 97, 0.12), rgba(255, 255, 255, 0.76));
  box-shadow: var(--lia-soft-shadow);
}

.lia-brand-avatar {
  width: clamp(42px, 2.6vw, 48px);
  height: clamp(42px, 2.6vw, 48px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--lia-green), var(--lia-green-dark));
  font-weight: 700;
}

.lia-brand-card strong,
.lia-brand-card span {
  display: block;
}

.lia-brand-card strong {
  font-size: clamp(18px, 1.2vw, 22px);
  line-height: 1.1;
  font-weight: 650;
}

.lia-brand-card span {
  margin-top: 4px;
  color: var(--lia-muted);
  font-size: clamp(12px, 0.8vw, 13px);
}

.lia-desktop-menu,
.lia-settings-submenu {
  display: grid;
  gap: clamp(7px, 0.7vw, 10px);
}

.lia-settings-submenu {
  padding: clamp(10px, 0.85vw, 14px);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 4px 4px 12px rgba(24, 40, 55, 0.07), inset -4px -4px 12px rgba(255, 255, 255, 0.9);
}

.lia-settings-submenu[hidden] {
  display: none;
}

.lia-settings-submenu > strong {
  padding: 0 4px 3px;
  color: var(--lia-muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lia-menu-item,
.lia-submenu-item {
  width: 100%;
  min-height: clamp(38px, 2.7vw, 48px);
  border: 0;
  border-radius: 16px;
  padding: 0 clamp(12px, 0.9vw, 16px);
  color: var(--lia-text);
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--lia-soft-shadow);
  font-weight: 500;
}

.lia-submenu-item {
  min-height: clamp(34px, 2.25vw, 40px);
  border-radius: 14px;
  font-size: clamp(13px, 0.82vw, 14px);
}

.lia-menu-item.is-active,
.lia-submenu-item.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--lia-green), var(--lia-green-dark));
}

.lia-chat-workspace {
  min-width: 0;
  height: 100%;
  display: grid;
}

.lia-chat-card,
.lia-settings-panel {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 28px;
  background: var(--lia-panel);
  box-shadow: var(--lia-shadow);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.lia-chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.lia-chat-card[hidden],
.lia-settings-panel[hidden] {
  display: none;
}

.lia-chat-header,
.lia-settings-header {
  min-height: clamp(62px, 4.2vw, 82px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(12px, 1vw, 18px) clamp(16px, 1.2vw, 22px);
  color: #ffffff;
  background: linear-gradient(135deg, var(--lia-green), var(--lia-green-deep));
}

.lia-header-left,
.lia-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lia-avatar {
  width: clamp(40px, 2.6vw, 48px);
  height: clamp(40px, 2.6vw, 48px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--lia-green);
  background: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.lia-header-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.lia-header-text strong,
.lia-settings-header strong {
  font-size: clamp(18px, 1.15vw, 20px);
  line-height: 1.1;
  font-weight: 650;
}

.lia-header-text span,
.lia-settings-header span {
  display: block;
  margin-top: 3px;
  font-size: clamp(12px, 0.8vw, 14px);
  opacity: 0.9;
  font-weight: 400;
}

.lia-header-button,
.lia-header-icon,
.lia-settings-close {
  border: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.17);
  box-shadow: none;
  font-weight: 500;
}

.lia-header-button,
.lia-settings-close {
  border-radius: 999px;
  padding: clamp(8px, 0.65vw, 10px) clamp(12px, 0.9vw, 16px);
}

.lia-header-icon {
  width: clamp(36px, 2.4vw, 42px);
  height: clamp(36px, 2.4vw, 42px);
  border-radius: 14px;
}

.lia-messages {
  min-height: 0;
  padding: clamp(18px, 1.45vw, 28px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 12%, rgba(15, 143, 97, 0.10), transparent 24%),
    linear-gradient(180deg, #fffdf8 0%, #f7f3ec 100%);
}

.lia-message {
  display: flex;
  margin: 0 0 14px;
}

.lia-message-user {
  justify-content: flex-end;
}

.lia-message-assistant {
  justify-content: flex-start;
}

.lia-bubble {
  max-width: min(68%, 760px);
  padding: 12px 16px;
  border-radius: 22px;
  font-size: clamp(14px, 0.92vw, 16px);
  line-height: 1.42;
  box-shadow: 0 9px 20px rgba(20, 35, 50, 0.12);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lia-message-assistant .lia-bubble {
  border-top-left-radius: 7px;
  background: linear-gradient(180deg, #f4fdff, var(--lia-assistant));
}

.lia-message-user .lia-bubble {
  border-top-right-radius: 7px;
  background: linear-gradient(180deg, #e5ffc9, var(--lia-user));
}

.lia-typing {
  display: none;
}

.lia-typing-message {
  align-items: flex-start;
}

.lia-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  min-height: 38px;
  padding: 12px 16px;
}

.lia-typing-bubble span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lia-green);
  animation: liaTyping 1s infinite ease-in-out;
}

.lia-typing-bubble span:nth-child(2) {
  animation-delay: 0.12s;
}

.lia-typing-bubble span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes liaTyping {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.lia-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 13px 16px 14px;
  background: #f7f9fa;
  border-top: 1px solid rgba(105, 125, 140, 0.12);
}

.lia-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.lia-input {
  width: 100%;
  max-height: 120px;
  min-height: 42px;
  resize: none;
  border: 0;
  outline: none;
  padding: 11px 14px;
  border-radius: 22px;
  background: #ffffff;
  color: var(--lia-text);
  box-shadow: inset 4px 4px 10px rgba(24, 40, 55, 0.08), inset -4px -4px 10px rgba(255, 255, 255, 0.9);
}

.lia-icon-button,
.lia-send-button {
  min-height: 42px;
  border: 0;
  border-radius: 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--lia-green), var(--lia-green-dark));
  box-shadow: 0 8px 18px rgba(15, 143, 97, 0.22);
}

.lia-icon-button {
  width: 42px;
}

.lia-send-button {
  padding: 0 18px;
  font-weight: 650;
}

.lia-send-button:disabled,
.lia-icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lia-settings-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.lia-settings-content {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(16px, 1.35vw, 26px);
  background:
    radial-gradient(circle at 10% 10%, rgba(15, 143, 97, 0.08), transparent 25%),
    linear-gradient(180deg, #fffdf8 0%, #f7f3ec 100%);
}

.lia-settings-section {
  display: none;
}

.lia-settings-section.is-active {
  display: block;
}

.lia-section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(12px, 1vw, 22px);
}

.lia-section-title-row h2 {
  margin: 0 0 4px;
  font-size: clamp(26px, 1.75vw, 34px);
  font-weight: 650;
}

.lia-section-title-row p {
  margin: 0;
  color: var(--lia-muted);
  font-size: clamp(14px, 0.9vw, 16px);
}

.lia-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lia-primary-button,
.lia-secondary-button {
  min-height: clamp(38px, 2.35vw, 46px);
  border: 0;
  border-radius: 999px;
  padding: 0 clamp(16px, 1.1vw, 22px);
  font-weight: 650;
}

.lia-primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--lia-green), var(--lia-green-dark));
  box-shadow: 0 8px 18px rgba(15, 143, 97, 0.22);
}

.lia-secondary-button {
  color: var(--lia-text);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--lia-soft-shadow);
}

.lia-general-card {
  display: grid;
  gap: clamp(16px, 1.25vw, 28px);
  padding: clamp(18px, 1.45vw, 28px);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--lia-shadow);
}

.lia-photo-row {
  display: grid;
  grid-template-columns: clamp(84px, 5.4vw, 118px) minmax(0, 1fr);
  gap: clamp(14px, 1.2vw, 24px);
  align-items: center;
}

.lia-photo-preview {
  width: clamp(84px, 5.4vw, 118px);
  height: clamp(84px, 5.4vw, 118px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: clamp(20px, 1.45vw, 28px);
  color: #ffffff;
  background: linear-gradient(135deg, var(--lia-green), var(--lia-green-dark));
  font-size: clamp(28px, 1.95vw, 38px);
  font-weight: 650;
}

.lia-photo-preview img,
.lia-avatar img,
.lia-brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lia-form-block-title {
  display: grid;
  gap: 4px;
}

.lia-form-block-title strong {
  font-size: clamp(18px, 1.2vw, 22px);
  font-weight: 650;
}

.lia-form-block-title span {
  color: var(--lia-muted);
  font-size: clamp(13px, 0.85vw, 16px);
}

.lia-general-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 0.9vw, 18px) clamp(18px, 1.45vw, 28px);
}

.lia-mission-field {
  grid-column: 1 / -1;
}

.lia-mission-field textarea {
  min-height: clamp(150px, 16vh, 210px);
}

.lia-field {
  display: grid;
  gap: 6px;
}

.lia-field span {
  color: var(--lia-text);
  font-size: clamp(13px, 0.82vw, 15px);
  font-weight: 600;
}

.lia-field input,
.lia-field textarea {
  width: 100%;
  border: 1px solid rgba(120, 140, 155, 0.16);
  outline: none;
  border-radius: 16px;
  padding: clamp(9px, 0.7vw, 13px) 13px;
  color: var(--lia-text);
  background: #ffffff;
  box-shadow: inset 4px 4px 10px rgba(24, 40, 55, 0.07), inset -4px -4px 10px rgba(255, 255, 255, 0.92);
  font-weight: 400;
}

.lia-field input {
  min-height: clamp(38px, 2.35vw, 46px);
}

.lia-field textarea {
  resize: vertical;
  min-height: clamp(72px, 5.4vw, 100px);
}

.lia-field small {
  color: var(--lia-muted);
  line-height: 1.35;
  font-size: clamp(12px, 0.78vw, 14px);
}

.lia-photo-field input {
  padding: 8px 10px;
}

.lia-settings-section > p {
  max-width: 760px;
  margin: 0;
  color: var(--lia-muted);
  font-size: 15px;
  line-height: 1.5;
}

@media (max-height: 820px) and (min-width: 761px) {
  .lia-chat-header,
  .lia-settings-header {
    min-height: 58px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .lia-settings-content {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .lia-section-title-row {
    margin-bottom: 10px;
  }

  .lia-section-title-row h2 {
    font-size: 28px;
  }

  .lia-general-card {
    gap: 14px;
    padding: 18px;
  }

  .lia-photo-preview {
    width: 82px;
    height: 82px;
  }

  .lia-photo-row {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .lia-form-block-title strong {
    font-size: 18px;
  }

  .lia-field input {
    min-height: 38px;
  }

  .lia-field textarea {
    min-height: 70px;
  }
}

.lia-messages,
#lia-messages,
.lia-chat-messages,
.lia-live-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding-right: 18px;
}

.lia-chat-card,
.lia-chat-workspace,
.lia-chat-main,
.lia-chat-body {
  min-height: 0;
}

.lia-message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 10px 0;
}

.lia-message-row-assistant {
  justify-content: flex-start;
}

.lia-message-row-user {
  justify-content: flex-end;
}

.lia-message-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  overflow: hidden;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(135deg, #149f82, #22a9c8);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.lia-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lia-message-bubble {
  position: relative;
  display: inline-block;
  max-width: min(72%, 760px);
  padding: 12px 14px 8px;
  border-radius: 18px;
  line-height: 1.42;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.lia-message-bubble-assistant {
  background: #e9f8fc;
  color: #17202a;
  border-top-left-radius: 8px;
}

.lia-message-bubble-user {
  background: #d8f8bc;
  color: #17202a;
  border-top-right-radius: 8px;
}

.lia-message-text {
  white-space: pre-wrap;
}

.lia-message-time {
  display: inline-block;
  margin-left: 10px;
  transform: translateY(2px);
  color: rgba(23, 32, 42, 0.58);
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
}

.lia-date-separator {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 8px 0 18px;
  pointer-events: none;
}

.lia-date-separator span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #5d5d5d;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.06);
}



.lia-typing-indicator,
.lia-typing-dots,
[data-lia-typing="true"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 1em;
  vertical-align: middle;
  line-height: 1;
}

.lia-typing-indicator span,
.lia-typing-dots span,
[data-lia-typing="true"] span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.52;
  transform: translateY(0);
}

.lia-live-bubble {
  max-width: min(72%, 760px);
}

.lia-live-bubble-assistant {
  margin-left: 44px;
}


.lia-composer {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.lia-composer .lia-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lia-composer .lia-input {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  resize: none;
  border-radius: 28px;
  padding: 14px 18px;
}

.lia-composer .lia-icon-button,
.lia-composer .lia-send-button {
  order: 2;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.lia-composer .lia-send-button {
  font-size: 28px;
  font-weight: 800;
}

.lia-composer-is-idle .lia-send-button,
.lia-composer:not(.lia-composer-has-text) .lia-send-button {
  display: none !important;
}

.lia-composer-has-text .lia-icon-button {
  display: none !important;
}

.lia-composer-is-recording .lia-icon-button {
  display: inline-grid !important;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.22);
}

.lia-composer-is-recording .lia-input {
  color: #0f172a;
  border-color: rgba(220, 38, 38, 0.34);
  box-shadow: inset 0 1px 2px rgba(18, 28, 45, 0.04), 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.lia-composer .lia-icon-button[hidden],
.lia-composer .lia-send-button[hidden] {
  display: none !important;
}
