/* dock = compact corner; expand = centered conversational layout */
#cos-inquiry-root {
  --cos-inq-gray: #6b6b6b;
  --cos-inq-panel: #f0f1f3;
  --cos-inq-text: #333;
  --cos-inq-link: #2b6cb0;
  --cos-inq-line: #e4e4e4;
  --cos-inq-wa: #25d366;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  z-index: 999900;
}

#cos-inquiry-root * {
  box-sizing: border-box;
}

#cos-inquiry-root .cos-inq-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999901;
  background: rgba(20, 20, 20, 0.42);
  display: none;
}

#cos-inquiry-root.open.mode-expand .cos-inq-backdrop {
  display: block;
}

#cos-inquiry-root .cos-inq-backdrop[hidden] {
  display: none !important;
}

#cos-inquiry-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999903;
  width: 76px;
  height: 76px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#cos-inquiry-fab .cos-inq-fab-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  pointer-events: none;
}

#cos-inquiry-fab:hover {
  transform: translateY(-1px);
}

#cos-inquiry-root.open.mode-expand #cos-inquiry-fab {
  display: none;
}

#cos-inquiry-panel {
  position: fixed;
  z-index: 999904;
  background: #fff;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

#cos-inquiry-root.open #cos-inquiry-panel {
  display: flex;
}

#cos-inquiry-panel[hidden] {
  display: none !important;
}

/* —— dock: chip-first, shorter compose —— */
#cos-inquiry-root.mode-dock #cos-inquiry-panel {
  right: 20px;
  bottom: 96px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(72vh, 540px);
  border-radius: 8px;
}

#cos-inquiry-root.mode-dock .cos-inq-body {
  flex: 1 1 auto;
  max-height: 46%;
  padding: 10px 12px 8px;
}

#cos-inquiry-root.mode-dock .cos-inq-compose {
  flex: 0 0 auto;
  padding: 8px 10px 10px;
}

#cos-inquiry-root.mode-dock .cos-inq-input {
  min-height: 72px;
  max-height: 120px;
}

#cos-inquiry-root.mode-dock .cos-inq-chips-label,
#cos-inquiry-root.mode-dock .cos-inq-send-hint {
  font-size: 11px;
}

/* —— expand: message-first, balanced —— */
#cos-inquiry-root.mode-expand #cos-inquiry-panel {
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(740px, calc(100vw - 32px));
  height: min(82vh, 700px);
  max-height: min(82vh, 700px);
  border-radius: 10px;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.3);
}

#cos-inquiry-root.mode-expand .cos-inq-body {
  flex: 0 0 auto;
  max-height: 34%;
  padding: 12px 16px 10px;
  overflow: auto;
}

#cos-inquiry-root.mode-expand .cos-inq-compose {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  background: #f7f7f8;
}

#cos-inquiry-root.mode-expand .cos-inq-input {
  flex: 1 1 auto;
  min-height: 200px;
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
}

#cos-inquiry-panel .cos-inq-head {
  background: var(--cos-inq-gray);
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#cos-inquiry-root.mode-expand .cos-inq-head {
  padding: 12px 16px;
}

#cos-inquiry-panel .cos-inq-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #8a8a8a;
  flex-shrink: 0;
}

#cos-inquiry-root.mode-expand .cos-inq-avatar {
  width: 42px;
  height: 42px;
}

#cos-inquiry-panel .cos-inq-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

#cos-inquiry-root.mode-expand .cos-inq-title {
  font-size: 17px;
}

#cos-inquiry-panel .cos-inq-size,
#cos-inquiry-panel .cos-inq-min {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#cos-inquiry-panel .cos-inq-size img,
#cos-inquiry-panel .cos-inq-min img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

#cos-inquiry-panel .cos-inq-size:hover,
#cos-inquiry-panel .cos-inq-min:hover {
  background: rgba(255, 255, 255, 0.26);
}

#cos-inquiry-panel .cos-inq-body {
  background: var(--cos-inq-panel);
  overflow: auto;
  min-height: 0;
}

#cos-inquiry-panel .cos-inq-intro {
  margin: 0 0 8px;
  font-size: 13px;
  color: #555;
  line-height: 1.45;
}

#cos-inquiry-root.mode-expand .cos-inq-intro {
  font-size: 14px;
  color: #444;
  margin-bottom: 10px;
}

#cos-inquiry-panel .cos-inq-contact {
  margin-bottom: 8px;
  font-size: 12px;
  color: #666;
}

#cos-inquiry-panel .cos-inq-contact a {
  color: var(--cos-inq-link);
  text-decoration: none;
  word-break: break-all;
}

#cos-inquiry-panel .cos-inq-contact a:hover {
  text-decoration: underline;
}

#cos-inquiry-panel .cos-inq-chips-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

#cos-inquiry-panel .cos-inq-presets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#cos-inquiry-root.mode-expand .cos-inq-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#cos-inquiry-panel .cos-inq-preset {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  color: var(--cos-inq-text);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.35;
  cursor: pointer;
}

#cos-inquiry-root.mode-expand .cos-inq-preset {
  font-size: 13px;
  padding: 11px 12px;
  min-height: 52px;
}

#cos-inquiry-panel .cos-inq-preset:hover {
  border-color: #bdbdbd;
  color: var(--cos-inq-link);
  background: #fafafa;
}

#cos-inquiry-panel .cos-inq-compose {
  border-top: 1px solid var(--cos-inq-line);
  background: #fff;
}

#cos-inquiry-panel .cos-inq-input {
  width: 100%;
  border: 1px solid var(--cos-inq-line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 13px;
  outline: none;
  background: #fafafa;
  resize: none;
  line-height: 1.45;
}

#cos-inquiry-panel .cos-inq-input:focus {
  border-color: #aaa;
  background: #fff;
}

#cos-inquiry-panel .cos-inq-send-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #888;
  line-height: 1.35;
}

#cos-inquiry-panel .cos-inq-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

#cos-inquiry-panel .cos-inq-send-btn {
  flex: 1;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
}

#cos-inquiry-root.mode-expand .cos-inq-send-btn {
  padding: 14px 16px;
  font-size: 15px;
}

#cos-inquiry-panel .cos-inq-send-btn.cos-inq-mailto {
  background: #4a4a4a;
}

#cos-inquiry-panel .cos-inq-send-btn.cos-inq-mailto:hover {
  background: #333;
}

#cos-inquiry-panel .cos-inq-send-btn.cos-inq-whatsapp {
  background: var(--cos-inq-wa);
}

#cos-inquiry-panel .cos-inq-send-btn.cos-inq-whatsapp:hover {
  filter: brightness(0.96);
}

@media (max-width: 640px) {
  #cos-inquiry-root.mode-expand .cos-inq-presets {
    grid-template-columns: 1fr;
  }
  #cos-inquiry-root.mode-expand #cos-inquiry-panel {
    width: calc(100vw - 16px);
    height: min(88vh, 720px);
  }
  #cos-inquiry-root.mode-expand .cos-inq-input {
    min-height: 160px;
  }
  #cos-inquiry-root.mode-dock #cos-inquiry-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
  }
}
