:root {
  color-scheme: light;
  --ivory: #F4EFE6;
  --ink: #15120F;
  /* Brand colours: each chatbot sets its own in the page (chatbot.blade.php) */
  --primary: #A8202E;
  --primary-dark: #861A26;
  --accent: #B48C55;
  --header: #15120F;
  --bg: #F4EFE6;
  --muted: #766D63;
  --line: #DED5C8;
  --paper: #FBF8F2;
  --green: #568364;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 280px;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 13% 8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 33%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

#chat-app {
  width: min(100%, 440px);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 12px;
}

html.embedded #chat-app {
  width: 100%;
  max-width: 440px;
  height: 100%;
  padding: 0;
}

html.embedded .chat-panel {
  border-radius: 0;
}

html.embedded .chat-header {
  padding-right: 48px;
}

#status-dot.offline {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 18px 60px rgba(46, 34, 19, .13), 0 2px 8px rgba(46, 34, 19, .05);
}

.chat-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-height: 81px;
  padding: 13px 16px;
  color: var(--ivory);
  background: var(--header);
}

.chat-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 15%, transparent) 66%, transparent);
  content: "";
}

.brand-mark {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  background: var(--ivory);
}

.brand-mark img {
  display: block;
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.brand-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-copy h1 {
  margin: 0 0 4px;
  color: #F8F2E9;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1;
}

.online-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(244, 239, 230, .75);
  font-size: 10px;
  letter-spacing: .015em;
}

#status-dot {
  display: inline-block;
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #86B890;
  box-shadow: 0 0 0 3px rgba(134, 184, 144, .13);
}

#refresh-button {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 49px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  color: rgba(244, 239, 230, .84);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  transition: background-color .18s ease, color .18s ease;
}

#refresh-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .10);
}

#refresh-button:focus-visible,
.choice-button:focus-visible,
#back-button:focus-visible,
#send-button:focus-visible,
.portfolio-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.refresh-icon {
  width: 15px;
  height: 15px;
}

#chat-log {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 19px 16px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

#chat-log::-webkit-scrollbar {
  width: 5px;
}

#chat-log::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 42%, transparent);
}

.message {
  display: flex;
  order: 0;
  flex: 0 0 auto;
  flex-direction: column;
  max-width: 100%;
  animation: message-arrive .26s ease both;
}

.message.bot {
  align-self: flex-start;
  align-items: flex-start;
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message-meta {
  margin: 0 7px 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .045em;
}

.message.user .message-meta {
  color: #8E7860;
}

.message-body {
  max-width: min(100%, 330px);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 3px 13px 13px 13px;
  color: #332B24;
  background: #fffdf9;
  box-shadow: 0 2px 7px rgba(46, 34, 19, .045);
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.user .message-body {
  border-color: var(--primary);
  border-radius: 13px 3px 13px 13px;
  color: #fffaf5;
  background: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 13%, transparent);
}

.message-time {
  margin: 5px 7px 0;
  color: #9C9185;
  font-size: 9px;
}

#choices {
  display: flex;
  order: 1;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  padding: 1px 0 2px;
}

.choice-button {
  min-height: 36px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--primary) 42%, transparent);
  border-radius: 999px;
  color: var(--primary);
  background: #fffaf4;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  transition: transform .16s ease, color .16s ease, background-color .16s ease, border-color .16s ease;
}

.choice-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary);
  color: #fffaf5;
  background: var(--primary);
}

.choice-button:active:not(:disabled) {
  transform: translateY(0);
}

.choice-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

#back-button {
  display: inline-flex;
  order: 2;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 31px;
  padding: 4px 2px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: color .16s ease;
}

#back-button:hover {
  color: var(--primary);
}

#back-button[hidden],
#choices:empty {
  display: none;
}

.composer-wrap {
  flex: 0 0 auto;
  padding: 12px 14px 10px;
  border-top: 1px solid var(--line);
  background: #F8F4EC;
}

#form-error {
  margin: 0 2px 8px;
  color: var(--primary-dark);
  font-size: 11px;
  line-height: 1.4;
}

#form-error:empty {
  display: none;
}

#composer {
  display: flex;
  align-items: center;
  gap: 9px;
}

#input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

#message-input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  min-height: 43px;
  padding: 10px 14px;
  border: 1px solid #D8CFC2;
  border-radius: 999px;
  outline: none;
  color: var(--ink);
  background: #fffdf9;
  font-size: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

#message-input::placeholder {
  color: #978D81;
}

#message-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

#message-input:disabled {
  opacity: .65;
  background: #F0EBE2;
  cursor: not-allowed;
}

#send-button {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fffaf5;
  background: var(--primary);
  box-shadow: 0 3px 9px color-mix(in srgb, var(--primary) 18%, transparent);
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, opacity .16s ease;
}

#send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--primary-dark);
}

#send-button:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}

.send-icon {
  width: 17px;
  height: 17px;
}

.chat-footer {
  flex: 0 0 auto;
  padding: 4px 12px 10px;
  color: #978D81;
  background: #F8F4EC;
  font-size: 9px;
  text-align: center;
}

.chat-footer a {
  color: inherit;
  text-decoration: none;
  transition: color .16s ease;
}

.chat-footer a:hover {
  color: var(--primary);
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px;
  background: #fffdf9;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing-pulse 1s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: .15s;
}

.typing span:nth-child(3) {
  animation-delay: .3s;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.portfolio-card {
  display: flex;
  min-height: 57px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fffdf9;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.portfolio-grid .portfolio-card {
  color: var(--ink);
}

.portfolio-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: #FBF4E8;
}

.portfolio-card strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
}

.portfolio-card span {
  color: var(--muted);
  font-size: 9px;
}

.review-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
}

.review-list dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.review-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.notice {
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0 7px 7px 0;
  color: #645746;
  background: #F3EBDD;
  font-size: 11px;
  line-height: 1.55;
}

a[href^="tel:"],
a[href^="mailto:"],
a[target="_blank"] {
  color: var(--primary);
  text-underline-offset: 2px;
}

a[href^="tel:"]:hover,
a[href^="mailto:"]:hover,
a[target="_blank"]:hover {
  color: var(--primary-dark);
}

@keyframes message-arrive {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typing-pulse {
  0%, 60%, 100% { opacity: .4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 480px) {
  html:not(.embedded) body {
    min-height: 100dvh;
  }

  #chat-app {
    height: 100dvh;
    padding: 0;
  }

  .chat-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-header {
    min-height: 75px;
    padding: 11px 14px;
  }

  #chat-log {
    padding: 16px 13px 13px;
    gap: 12px;
  }

  .composer-wrap {
    padding: 10px 12px 8px;
  }
}

@media (max-width: 340px) {
  .brand-copy h1 {
    font-size: 19px;
  }

  .online-line {
    font-size: 9px;
  }

  #refresh-button {
    min-width: 41px;
  }

  .choice-button {
    padding: 7px 10px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Clearer chat: bot messages are plain text (no box), so they never look like a place to type ---------- */
.message.bot .message-body {
  padding: 0 7px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font-size: 14px;
}

/* When an answer must be typed, point to the box at the bottom and make it glow */
.typing-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin: 2px 2px 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}
.typing-hint svg { animation: hint-bob 1.4s ease-in-out infinite; }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
#composer.awaiting #message-input {
  border: 2px solid var(--primary);
  background: #fff;
  animation: input-glow 1.8s ease-in-out infinite;
}
#composer.awaiting #message-input::placeholder { color: var(--primary); opacity: .75; font-weight: 600; }
@keyframes input-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 28%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 0%, transparent); } }

/* Country code next to the mobile number */
#country-code {
  flex: 0 0 auto;
  width: 96px;
  min-height: 43px;
  padding: 0 8px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font: 600 12px var(--font-body);
  cursor: pointer;
}
#country-code[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .typing-hint svg, #composer.awaiting #message-input { animation: none; }
}

/* ---------- WWS mark in the header circle ---------- */
.brand-mark { background: #fff; }
.brand-mark img { width: 26px; height: 26px; }

/* ---------- Footer: Powered by (left), Need a chatbot? (right) ---------- */
.chat-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.chat-footer .powered { display: inline-flex; align-items: center; gap: 5px; }
.chat-footer .powered img { width: 12px; height: 12px; }
.footer-link {
  padding: 3px 0;
  border: 0;
  color: var(--primary);
  background: none;
  cursor: pointer;
  font: 700 10px var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-link:hover { color: var(--primary-dark); }
.footer-link:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- See our work: same look as the website (two groups, serif names, line between) ---------- */
.message-body.wide { max-width: 100%; width: 100%; }
.pf-group { width: 100%; margin-top: 14px; }
.pf-title { margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font: 300 21px/1.1 var(--font-display); color: var(--ink); }
.pf-title em, .pf-name em { color: var(--primary); font-style: italic; }
.message-body a.pf-item, .pf-item { display: block; padding: 10px 0 11px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.pf-item:hover .pf-name { color: var(--primary); }
.pf-name { display: block; font: 300 23px/1.15 var(--font-display); transition: color .2s; }
.pf-badge { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 8px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font: 600 8px var(--font-body); letter-spacing: .18em; text-transform: uppercase; }
.pf-tag { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* Live sample link in the "Need a chatbot?" flow */
.sample-link { display: inline-flex; align-items: center; margin-top: 10px; text-decoration: none; white-space: normal; }
.message-body a.sample-link { color: var(--primary); }
.message-body a.sample-link:hover { color: #fffaf5; }

/* Domain check results */
.domain-list { list-style: none; margin: 8px 0 0; padding: 0; }
.domain-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.domain-list b { font-weight: 600; overflow-wrap: anywhere; }
.domain-mark { flex: 0 0 16px; font-weight: 700; text-align: center; }
.domain-note { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.domain-available .domain-mark, .domain-available .domain-note { color: var(--green); }
.domain-taken { opacity: .6; }
.domain-taken .domain-mark { color: var(--primary); }

/* Bigger, easier Back button */
#back-button {
  min-height: 40px;
  padding: 8px 16px 8px 12px;
  gap: 8px;
  border: 1px solid #D8CFC2;
  border-radius: 999px;
  color: var(--ink);
  background: #fffaf4;
  font-size: 13px;
}
#back-button svg { width: 17px; height: 17px; }
#back-button:hover { border-color: var(--primary); }

/* Phones and tablets only (touch screens): slightly larger chat text (+1 to +2px). Desktop keeps the original sizes.
   A width rule would not work: the desktop pop-up is narrow too. */
@media (hover: none) and (pointer: coarse) {
  .message.bot .message-body { font-size: 16px; }
  .message.user .message-body { font-size: 15px; }
  .message-meta { font-size: 10px; }
  .choice-button { font-size: 12.5px; }
  .typing-hint { font-size: 12.5px; }
  #message-input { font-size: 16px; }
  .pf-tag { font-size: 12.5px; }
  .domain-list li { font-size: 14.5px; }
  .domain-note { font-size: 12px; }
  .notice { font-size: 12px; }
}

/* Several answers allowed: ticked choices are filled red; Continue is green */
.choice-button.is-on { border-color: var(--primary); color: #fffaf5; background: var(--primary); }
.choice-button.continue-button { border-color: #15803D; color: #fff; background: #15803D; }
.choice-button.continue-button:hover:not(:disabled) { border-color: #116932; color: #fff; background: #116932; }
.choice-button.continue-button:disabled { opacity: .35; }

/* Rate us on Google */
.message-body a.rate-button, #choices a.rate-button { border-color: var(--accent); color: #15120F; background: #FBEFD9; text-decoration: none; }
#choices a.rate-button:hover { background: #F4DFB6; color: #15120F; }

/* Review step: note above a clear, filled Submit button */
.submit-note { width: 100%; margin: 4px 2px 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.choice-button.submit-button { min-width: 120px; justify-content: center; text-align: center; border-color: var(--primary); color: #fffaf5; background: var(--primary); font-size: 13px; }
.choice-button.submit-button:hover:not(:disabled) { background: var(--primary-dark); }
@media (hover: none) and (pointer: coarse) { .submit-note { font-size: 14px; } .choice-button.submit-button { font-size: 14px; } }

/* Greeting: "Our Services" with a down arrow to the buttons */
.services-label { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--primary); font-weight: 700; }
.services-label svg { animation: hint-bob 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .services-label svg { animation: none; } }

/* Bot text (no bubble) can use the full chat width */
.message.bot .message-body { max-width: 100%; }

/* Under every question: Back · Main menu · Talk to a person */
#chat-nav { display: flex; order: 2; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: 8px; }
#chat-nav[hidden] { display: none; }
.nav-link { min-height: 40px; padding: 8px 14px; border: 1px solid #D8CFC2; border-radius: 999px; color: var(--ink); background: #fffaf4; cursor: pointer; font: 600 13px var(--font-body); }
.nav-link:hover { border-color: var(--primary); color: var(--primary); }
.nav-link:disabled { opacity: .5; cursor: not-allowed; }
#person-button { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, transparent); }

/* Footer: two small links on the right */
.footer-links { display: inline-flex; gap: 12px; }
#chat-nav #back-button { order: 0; align-self: center; }

/* Small example line under a question, e.g. (For example: sharmabakery) */
.prompt-hint { color: #6F665C; font-size: 12.5px; }

/* ---------- Modern look (theme.font = "modern"): sans-serif headings ---------- */
html.font-modern { --font-display: "Manrope", sans-serif; }
html.font-modern .brand-copy h1 { font-size: 17px; font-weight: 700; letter-spacing: 0; line-height: 1.2; }
html.font-modern .pf-title { font-size: 17px; font-weight: 700; }
html.font-modern .pf-name { font-size: 17px; font-weight: 600; }

/* Office address lines in "Visit us" */
.office-line { margin: 8px 0 6px; }

/* Picture above a question (event flyer, menu, offer): tap to open full size */
.msg-image { display: block; margin: 2px 0 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; line-height: 0; }
.msg-image img { display: block; width: 100%; height: auto; }

/* YouTube video above a question: plays inside the chat */
.msg-video { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 2px 0 10px; border-radius: 12px; overflow: hidden; background: #000; }
.msg-video.tall { width: min(100%, 260px); aspect-ratio: 9 / 16; }
.msg-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.msg-video-play { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.msg-video-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.msg-video-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); transition: transform .15s; }
.msg-video-play:hover .msg-video-icon { transform: translate(-50%, -50%) scale(1.08); }
.msg-video-play:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
