/* In-app Niya support — small button on the right */

.tbs-niya-root {
  position: fixed;
  z-index: 2147482800;
  right: 16px;
  bottom: 18px;
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
}

.tbs-niya-fab {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: #347433;
  color: #fff;
  box-shadow: 0 10px 24px rgba(27, 61, 26, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tbs-niya-fab .material-icons {
  font-size: 26px;
  color: #fff;
}

.tbs-niya-fab:hover {
  background: #265c25;
}

.tbs-niya-panel {
  display: none;
  width: min(360px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 96px));
  margin-bottom: 12px;
  background: #fff;
  color: #1f2937;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  border: 1px solid #c8e9c7;
  flex-direction: column;
}

.tbs-niya-root.is-open .tbs-niya-panel {
  display: flex;
}

.tbs-niya-root.is-open .tbs-niya-fab {
  display: none;
}

.tbs-niya-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #347433;
  color: #fff;
}

.tbs-niya-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.tbs-niya-head p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.tbs-niya-head-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.tbs-niya-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f4f7f4;
}

.tbs-niya-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.tbs-niya-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #dfe6df;
}

.tbs-niya-msg.user {
  align-self: flex-end;
  background: #347433;
  color: #fff;
}

.tbs-niya-intake {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tbs-niya-intake p {
  margin: 0 0 4px;
  font-size: 13px;
  color: #4b5563;
}

.tbs-niya-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #265c25;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tbs-niya-field em {
  color: #b53346;
  font-style: normal;
}

.tbs-niya-field input {
  border: 1px solid #bbc9cc;
  background: #fff;
  color: #111;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.tbs-niya-err {
  margin: 0;
  font-size: 12.5px;
  color: #b53346;
}

.tbs-niya-intake button,
.tbs-niya-form button {
  border: 0;
  border-radius: 8px;
  background: #347433;
  color: #fff;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

.tbs-niya-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #dfe6df;
  background: #fff;
}

.tbs-niya-form input {
  flex: 1;
  border: 1px solid #bbc9cc;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
}

.tbs-niya-form button:disabled,
.tbs-niya-intake button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media print {
  .tbs-niya-root {
    display: none !important;
  }
}

@media (max-width: 700px) {
  .tbs-niya-root {
    right: 10px;
    bottom: 10px;
  }
  .tbs-niya-panel {
    height: min(70vh, 560px);
  }
}
