.ala-chat-box {
  border: 1px solid #dcdcde;
  border-radius: 18px;
  background: #fff;
  max-width: 860px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  font-family: inherit;
}

.ala-chat-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, #18243a, #31527a);
  color: #fff;
}

.ala-chat-header strong {
  display: block;
  font-size: 18px;
}

.ala-chat-header span {
  display: block;
  opacity: .85;
  font-size: 13px;
  margin-top: 3px;
}

.ala-chat-messages {
  height: 460px;
  overflow-y: auto;
  padding: 18px;
  background: #f6f7f7;
}

.ala-msg {
  padding: 12px 14px;
  border-radius: 15px;
  max-width: 82%;
  margin-bottom: 12px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: normal;
}

.ala-msg-user {
  margin-left: auto;
  background: #2271b1;
  color: #fff;
  border-bottom-right-radius: 5px;
}

.ala-msg-assistant {
  margin-right: auto;
  background: #fff;
  color: #1d2327;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 5px;
}

.ala-loading {
  opacity: .72;
  font-style: italic;
}

.ala-chat-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #dcdcde;
  background: #fff;
}

.ala-chat-form textarea {
  flex: 1;
  resize: vertical;
  min-height: 46px;
  max-height: 160px;
  padding: 12px;
  border: 1px solid #c3c4c7;
  border-radius: 12px;
  font-family: inherit;
}

.ala-chat-form button {
  border: none;
  border-radius: 12px;
  background: #2271b1;
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

.ala-chat-form button:disabled,
.ala-chat-form textarea:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.ala-chat-hint,
.ala-chat-notice {
  font-size: 13px;
  color: #646970;
  padding: 0 16px 16px;
}

.ala-chat-notice {
  border: 1px solid #dba617;
  background: #fcf9e8;
  color: #3c434a;
  border-radius: 10px;
  padding: 12px 14px;
}

@media (max-width: 700px) {
  .ala-chat-messages { height: 380px; }
  .ala-msg { max-width: 95%; }
  .ala-chat-form { flex-direction: column; }
  .ala-chat-form button { min-height: 44px; }
}

.ala-chat-input-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ala-file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid #c3c4c7;
  border-radius: 10px;
  padding: 7px 10px;
  background: #f6f7f7;
  color: #1d2327;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ala-file-label input {
  display: none;
}

.ala-selected-files {
  min-height: 16px;
  font-size: 12px;
  color: #646970;
}

.ala-msg pre {
  white-space: pre-wrap;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 10px;
  padding: 10px;
  overflow-x: auto;
}

.ala-msg-report {
  max-width: 96%;
}

.ala-msg h3,
.ala-msg h4,
.ala-msg h5,
.ala-msg h6 {
  margin: 12px 0 8px;
  line-height: 1.25;
}

.ala-msg p {
  margin: 0 0 10px;
}

.ala-msg p:last-child {
  margin-bottom: 0;
}

.ala-msg ul,
.ala-msg ol {
  margin: 6px 0 10px 20px;
  padding: 0;
}

.ala-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  background: #fff;
}

.ala-report-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.ala-report-table th,
.ala-report-table td {
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #eef0f2;
  padding: 9px 10px;
  vertical-align: top;
  text-align: left;
}

.ala-report-table th {
  background: #f0f4f8;
  font-weight: 700;
  color: #1d2327;
  white-space: nowrap;
}

.ala-report-table tr:last-child td {
  border-bottom: 0;
}

.ala-report-table th:last-child,
.ala-report-table td:last-child {
  border-right: 0;
}

.ala-msg code {
  background: #f0f0f1;
  border-radius: 4px;
  padding: 1px 4px;
}

.ala-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.ala-download-pdf {
  border: 0;
  border-radius: 10px;
  background: #1d4f8f;
  color: #fff;
  padding: 9px 13px;
  font-weight: 700;
  cursor: pointer;
}

.ala-download-pdf:disabled {
  opacity: .65;
  cursor: wait;
}

.ala-access-box {
  width: 100%;
  max-width: 520px;
  box-sizing: border-box;
}

.ala-access-card {
  border: 1px solid #dcdcde;
  border-radius: 18px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
}

.ala-access-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f8;
  margin-bottom: 10px;
}

.ala-access-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.ala-access-muted {
  margin: 0 0 16px;
  color: #50575e;
  line-height: 1.45;
}

.ala-access-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ala-access-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  color: #1d2327;
}

.ala-access-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c3c4c7;
  border-radius: 12px;
  padding: 12px;
  min-height: 46px;
  font-size: 16px;
}

.ala-access-form button,
.ala-logout-button {
  border: 0;
  border-radius: 12px;
  background: #2271b1;
  color: #fff;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.ala-access-form button:disabled,
.ala-logout-button:disabled {
  opacity: .7;
  cursor: wait;
}

.ala-access-error {
  min-height: 18px;
  color: #b32d2e;
  font-size: 13px;
  font-weight: 700;
}

.ala-access-error.is-success {
  color: #008a20;
}

.ala-logout-button {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.35);
  padding: 8px 12px;
  min-height: 36px;
}

.ala-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ala-chat-box,
.ala-access-box {
  width: 100%;
}

.ala-chat-box * {
  box-sizing: border-box;
}

.ala-chat-form textarea,
.ala-chat-form button,
.ala-file-label {
  font-size: 16px;
}

@media (max-width: 782px) {
  .ala-chat-box {
    max-width: 100%;
    border-radius: 16px;
  }
  .ala-chat-header {
    padding: 15px 16px;
  }
  .ala-chat-header strong {
    font-size: 17px;
  }
  .ala-chat-messages {
    height: 58vh;
    min-height: 340px;
    padding: 14px;
  }
  .ala-msg {
    max-width: 100%;
    font-size: 15px;
  }
  .ala-msg-report {
    max-width: 100%;
  }
  .ala-chat-form {
    padding: 12px;
    gap: 9px;
  }
  .ala-chat-form textarea {
    min-height: 72px;
  }
  .ala-file-label {
    width: 100%;
  }
  .ala-report-table {
    min-width: 680px;
    font-size: 12px;
  }
  .ala-report-actions {
    justify-content: stretch;
  }
  .ala-download-pdf {
    width: 100%;
    min-height: 44px;
  }
  .ala-access-box {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .ala-chat-box,
  .ala-access-card {
    border-radius: 14px;
  }
  .ala-chat-messages {
    height: 56vh;
    min-height: 320px;
  }
  .ala-chat-hint {
    display: none;
  }
  .ala-chat-header span {
    font-size: 12px;
  }
}
