/* XCodeSol Buyback Shop — customer styles (mobile-first, WCAG AA contrast) */

.xcsbc-app {
  max-width: 720px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1d2327;
  line-height: 1.5;
}

.xcsbc-app *,
.xcsbc-app *::before,
.xcsbc-app *::after {
  box-sizing: border-box;
}

.xcsbc-step {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  background: #fff;
}

.xcsbc-step h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.xcsbc-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.xcsbc-select,
.xcsbc-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
}

.xcsbc-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
  cursor: pointer;
}

.xcsbc-option input {
  width: 1.25rem;
  height: 1.25rem;
}

.xcsbc-button {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border: 0;
  border-radius: 6px;
  background: #2271b1;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.xcsbc-button:hover { background: #135e96; }
.xcsbc-button:focus-visible { outline: 3px solid #2271b1; outline-offset: 2px; }
.xcsbc-button:disabled { opacity: 0.55; cursor: not-allowed; }

.xcsbc-button--secondary {
  background: #fff;
  color: #2271b1;
  border: 1px solid #2271b1;
}

.xcsbc-error {
  padding: 0.75rem 1rem;
  border-left: 4px solid #d63638;
  background: #fcf0f1;
  color: #8a1f11;
}

.xcsbc-notice {
  padding: 0.75rem 1rem;
  border-left: 4px solid #72aee6;
  background: #f0f6fc;
}

.xcsbc-estimate {
  padding: 1.25rem;
  border-radius: 8px;
  background: #f6f7f7;
  text-align: center;
}

.xcsbc-estimate-value {
  font-size: 2rem;
  font-weight: 700;
}

.xcsbc-estimate-disclaimer {
  font-size: 0.85rem;
  color: #50575e;
}

.xcsbc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.xcsbc-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #dcdcde;
}

.xcsbc-status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #e5f5e5;
  color: #156015;
  font-size: 0.8rem;
}

.xcsbc-chat-messages {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #f6f7f7;
}

.xcsbc-chat-message {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: #fff;
}

.xcsbc-chat-message--agent { background: #e5f5e5; }
.xcsbc-chat-message--customer { background: #f0f6fc; }

/* ---------------------------------------------------------------------
 * Support chat (My Account -> Buyback Support, and the support-chat block)
 * ------------------------------------------------------------------- */

.xcsbc-support-chat { max-width: 720px; }

.xcsbc-conversation-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.xcsbc-conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #dcdcde;
}

.xcsbc-conversation-item:last-child { border-bottom: 0; }

.xcsbc-conversation-main { flex: 1; min-width: 0; }

.xcsbc-conversation-open {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.6rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  font: inherit;
}

.xcsbc-conversation-open:hover { background: #f0f6fc; }

.xcsbc-conversation-open.is-active { background: #f0f6fc; box-shadow: inset 3px 0 0 #135e96; }

.xcsbc-conversation-subject { display: block; }

.xcsbc-conversation-meta { display: block; font-size: 0.8rem; color: #646970; }

.xcsbc-status-pill--open { background: #e5f5e5; color: #156015; }

.xcsbc-status-pill--closed { background: #f0f0f1; color: #50575e; }

.xcsbc-support-new { margin: 0.5rem 0 0; }

.xcsbc-thread-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dcdcde;
  margin-bottom: 0.75rem;
}

.xcsbc-thread-back {
  background: none;
  border: 0;
  color: #135e96;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font: inherit;
  border-radius: 4px;
}

.xcsbc-thread-back:hover { background: #f0f6fc; }

.xcsbc-thread {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  background: #f0f2f5;
}

/* Left/right chat layout: own messages right, support left. */
.xcsbc-msg { display: flex; }

.xcsbc-msg--mine { justify-content: flex-end; }

.xcsbc-msg--staff { justify-content: flex-start; }

.xcsbc-msg__bubble {
  max-width: 76%;
  padding: 0.55rem 0.9rem 0.65rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e2e5ea;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Bubble tails. */
.xcsbc-msg--mine .xcsbc-msg__bubble { border-bottom-right-radius: 4px; background: #135e96; border-color: #135e96; color: #fff; }

.xcsbc-msg--staff .xcsbc-msg__bubble { border-bottom-left-radius: 4px; }

.xcsbc-msg__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.xcsbc-msg__name {
  font-size: 0.72rem;
  font-weight: 600;
}

.xcsbc-msg--mine .xcsbc-msg__name { color: rgba(255, 255, 255, 0.9); }

.xcsbc-msg--staff .xcsbc-msg__name { color: #135e96; }

.xcsbc-msg__time { font-size: 0.65rem; opacity: 0.7; white-space: nowrap; }

.xcsbc-msg__body { font-size: 0.92rem; line-height: 1.45; word-break: break-word; }

.xcsbc-composer {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}

.xcsbc-composer__input {
  flex: 1;
  min-height: 64px;
  resize: vertical;
}

.xcsbc-composer__send { flex-shrink: 0; }

.xcsbc-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.xcsbc-brand-tabs button {
  transition: all 0.2s ease;
}

.xcsbc-model-card {
  transition: all 0.2s ease;
}

.xcsbc-model-card:hover {
  border-color: #2271b1 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.xcsbc-back-btn {
  background: #f0f0f1;
  color: #50575e;
  border: 1px solid #c3c4c7;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.xcsbc-back-btn:hover {
  background: #dcdcde;
  color: #1d2327;
}

.xcsbc-estimate-box {
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.xcsbc-single-assessment-app {
  width: 100%;
}

.xcsbc-thankyou {
  background: #e7f5ea;
  border: 1px solid #46b450;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 20px 0;
}

.xcsbc-thankyou h2 {
  margin-top: 0;
  color: #1e4620;
}

.xcsbc-thankyou a {
  font-weight: 600;
  color: #135e96;
}

@media (min-width: 600px) {
  .xcsbc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
}