.oranje-chat,
.oranje-chat * {
  box-sizing: border-box;
}

.oranje-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99990;
  color: #251820;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.oranje-chat-launcher {
  position: relative;
  display: grid;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #251820;
  background: rgba(255, 253, 251, 0.96);
  border: 1px solid rgba(37, 24, 32, 0.16);
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(37, 24, 32, 0.16);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

.oranje-chat-launcher:hover,
.oranje-chat-launcher:focus-visible {
  color: #fff;
  background: #251820;
  border-color: #251820;
  box-shadow: 0 12px 34px rgba(37, 24, 32, 0.22);
  outline: 3px solid rgba(37, 24, 32, 0.12);
  outline-offset: 3px;
}

.oranje-chat-launcher-icon {
  display: block;
  width: 23px;
  height: 23px;
}

.oranje-chat-launcher-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.oranje-chat-launcher i {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  color: #fff;
  background: #c65324;
  border: 2px solid #fff;
  border-radius: 99px;
  font-size: 11px;
  font-style: normal;
}

.oranje-chat-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: flex;
  width: min(390px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 110px));
  flex-direction: column;
  overflow: hidden;
  background: #fffdfb;
  border: 1px solid #e4d8cf;
  border-radius: 14px;
  box-shadow: 0 22px 70px rgba(37, 24, 32, 0.2);
  animation: oranje-chat-open 180ms ease-out;
}

.oranje-chat-panel[hidden] {
  display: none;
}

@keyframes oranje-chat-open {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.oranje-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 19px 20px 17px;
  color: #251820;
  background: #fffdfb;
  border-bottom: 1px solid #e8dfd8;
}

.oranje-chat-header h2 {
  margin: 5px 0 4px;
  color: #251820;
  font-size: 18px;
  line-height: 1.2;
}

.oranje-chat-header p {
  margin: 0;
  color: #796b63;
  font-size: 12px;
  line-height: 1.4;
}

.oranje-chat-header > button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: #574950;
  background: #f5efea;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.oranje-chat-presence {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #b8aea8;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #f0e9e4;
}

.oranje-chat-presence.is-online {
  background: #68d391;
}

.oranje-chat-error {
  margin: 12px 16px 0;
  padding: 10px 12px;
  color: #852414;
  background: #fff0ec;
  border: 1px solid #f2c8bd;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.oranje-chat-start {
  display: grid;
  gap: 13px;
  padding: 18px;
  overflow-y: auto;
}

.oranje-chat-start[hidden],
.oranje-chat-conversation[hidden],
.oranje-chat-compose[hidden] {
  display: none;
}

.oranje-chat-start label {
  display: grid;
  gap: 6px;
  color: #4b3d36;
  font-size: 12px;
  font-weight: 700;
}

.oranje-chat-start input,
.oranje-chat-start textarea,
.oranje-chat-compose textarea {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  color: #251820;
  background: #fff;
  border: 1px solid #d9cec5;
  border-radius: 9px;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  resize: none;
}

.oranje-chat-start input:focus,
.oranje-chat-start textarea:focus,
.oranje-chat-compose textarea:focus {
  border-color: #d9551e;
  outline: 3px solid rgba(217, 85, 30, 0.12);
}

.oranje-chat-consent {
  grid-template-columns: 18px 1fr !important;
  align-items: start;
  font-weight: 500 !important;
  line-height: 1.45;
}

.oranje-chat-consent input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.oranje-chat-consent a {
  color: #a64017;
}

.oranje-chat-account {
  margin: 0;
  padding: 10px 12px;
  color: #5f5148;
  background: #f7f1eb;
  border-radius: 8px;
  font-size: 12px;
}

.oranje-chat-primary,
.oranje-chat-new {
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  background: #d9551e;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.oranje-chat-primary:disabled,
.oranje-chat-compose button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.oranje-chat-conversation {
  display: flex;
  min-height: 360px;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.oranje-chat-messages {
  display: flex;
  min-height: 270px;
  padding: 18px;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  background: #f8f4f0;
}

.oranje-chat-message {
  width: fit-content;
  max-width: 82%;
  padding: 10px 12px 7px;
  background: #fff;
  border: 1px solid #e4d9d0;
  border-radius: 13px 13px 13px 4px;
}

.oranje-chat-message.is-customer {
  align-self: flex-end;
  color: #fff;
  background: #4a2938;
  border-color: #4a2938;
  border-radius: 13px 13px 4px 13px;
}

.oranje-chat-message strong,
.oranje-chat-message time {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  opacity: 0.68;
}

.oranje-chat-message p {
  margin: 4px 0 5px;
  color: inherit;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.oranje-chat-message time {
  text-align: right;
}

.oranje-chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e7ddd5;
}

.oranje-chat-compose button {
  width: 44px;
  color: #fff;
  background: #d9551e;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 20px;
}

.oranje-chat-closed {
  margin: 0;
  padding: 13px 18px 6px;
  color: #6d5f56;
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
}

.oranje-chat-new {
  margin: 8px 18px 16px;
}

@media (max-width: 782px) {
  .oranje-chat {
    right: 14px;
    bottom: 78px;
  }

  .oranje-chat-launcher {
    width: 48px;
    height: 48px;
  }

  .oranje-chat-panel {
    position: fixed;
    inset: 10px 10px 76px;
    width: auto;
    max-height: none;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oranje-chat-panel { animation: none; }
}
