:root {
  --page: #f7faff;
  --page-accent: #eef5ff;
  --surface: rgba(255, 255, 255, 0.98);
  --surface-subtle: rgba(238, 245, 255, 0.94);
  --surface-raised: rgba(255, 255, 255, 0.98);
  --text: #0b1533;
  --text-soft: #5e6b8a;
  --muted: #7f8caa;
  --line: rgba(217, 230, 255, 0.92);
  --line-strong: rgba(47, 102, 245, 0.2);
  --brand: #2f66f5;
  --brand-strong: #1f54e8;
  --brand-deep: #0d3fcf;
  --brand-soft: rgba(223, 242, 255, 0.95);
  --brand-softer: rgba(238, 245, 255, 0.94);
  --cyan: #7edcff;
  --success: #14866d;
  --focus: #2f66f5;
  --shadow: 0 28px 70px rgba(13, 63, 207, 0.1);
  --shadow-small: 0 14px 34px rgba(13, 63, 207, 0.07);
  --radius-small: 14px;
  --radius: 20px;
  --radius-large: 30px;
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #081225;
  --page-accent: #0d1833;
  --surface: rgba(18, 32, 70, 0.98);
  --surface-subtle: rgba(13, 24, 51, 0.96);
  --surface-raised: rgba(18, 32, 70, 0.98);
  --text: #f5f9ff;
  --text-soft: #b8c7ea;
  --muted: #8fa3d1;
  --line: rgba(34, 55, 107, 0.95);
  --line-strong: rgba(74, 125, 255, 0.3);
  --brand-soft: rgba(207, 244, 255, 0.14);
  --brand-softer: rgba(13, 24, 51, 0.96);
  --success: #7edcff;
  --danger-soft: rgba(180, 35, 24, 0.16);
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  --shadow-small: 0 16px 38px rgba(0, 0, 0, 0.22);
}

body {
  background:
    radial-gradient(circle at 7% 8%, rgba(126, 220, 255, 0.2), transparent 25rem),
    radial-gradient(circle at 92% 14%, rgba(47, 102, 245, 0.16), transparent 25rem),
    linear-gradient(180deg, var(--page-accent), var(--page));
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(13, 63, 207, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 63, 207, 0.045) 1px, transparent 1px);
  background-size: 90px 90px;
  opacity: 0.42;
}

.app-shell {
  padding:
    max(22px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
}

.assistant-layout {
  width: min(1180px, 100%);
  height: min(880px, calc(100dvh - 44px));
  min-height: min(650px, calc(100dvh - 44px));
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.assistant-sidebar {
  position: relative;
  overflow: hidden;
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  border-inline-end: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 5%, rgba(126, 220, 255, 0.24), transparent 18rem),
    radial-gradient(circle at 85% 92%, rgba(47, 102, 245, 0.16), transparent 18rem),
    linear-gradient(180deg, var(--surface), var(--surface-subtle));
}

.assistant-sidebar::after {
  content: "";
  position: absolute;
  inset-inline-end: -34px;
  inset-block-start: 180px;
  width: 68px;
  height: 68px;
  background-image: radial-gradient(var(--line-strong) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  opacity: 0.7;
}

.site-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.site-brand-mark {
  position: relative;
  width: 54px;
  height: 54px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), var(--shadow-small);
}

.site-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-brand-copy {
  display: grid;
  gap: 2px;
  direction: ltr;
  text-align: left;
}

.site-brand-copy strong {
  color: var(--text);
  font-size: 1rem;
}

.site-brand-copy small {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.sidebar-intro {
  margin-block-start: clamp(34px, 6vh, 64px);
}

.product-pill {
  min-height: 34px;
  width: fit-content;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

html[data-theme="dark"] .product-pill {
  color: var(--cyan);
}

.product-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--brand));
  box-shadow: 0 0 0 4px rgba(126, 220, 255, 0.15);
}

.sidebar-intro h2 {
  margin: 18px 0 0;
  max-width: 12ch;
  font-size: clamp(1.55rem, 2.5vw, 2.05rem);
  line-height: 1.35;
}

.sidebar-intro p {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 0.91rem;
  line-height: 1.85;
}

.trust-list {
  margin-block-start: 28px;
  display: grid;
  gap: 10px;
}

.trust-item {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.trust-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-soft), rgba(126, 220, 255, 0.22));
  color: var(--brand);
}

.trust-icon svg,
.brand-mark svg,
.welcome-mark svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust-item > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.trust-item strong {
  color: var(--text);
  font-size: 0.87rem;
}

.trust-item small {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.sidebar-footer {
  position: relative;
  z-index: 1;
  padding-block-start: 18px;
  border-block-start: 1px solid var(--line);
}

.sidebar-footer p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.sidebar-footer p span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #14b884;
  box-shadow: 0 0 0 4px rgba(20, 184, 132, 0.12);
}

.sidebar-footer small {
  display: block;
  margin-block-start: 9px;
  color: var(--muted);
  font-size: 0.67rem;
}

.chat-panel {
  width: auto;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.chat-header {
  min-height: 86px;
  padding: 15px 20px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  gap: 11px;
}

.brand-mark {
  width: 45px;
  height: 45px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: linear-gradient(135deg, var(--brand-soft), rgba(126, 220, 255, 0.26));
  color: var(--brand);
  box-shadow: none;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.assistant-subtitle {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 0.77rem;
}

.header-actions {
  gap: 9px;
}

.connection-status {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  font-size: 0.75rem;
}

.theme-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
}

.theme-icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: block;
}

#newChatButton {
  min-height: 42px;
  padding-inline: 14px;
  border-radius: 999px;
}

#newChatButton svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

#websiteButton {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
}

#websiteButton svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.9;
}

.conversation {
  background:
    radial-gradient(circle at 12% 10%, rgba(126, 220, 255, 0.13), transparent 24rem),
    radial-gradient(circle at 88% 90%, rgba(47, 102, 245, 0.1), transparent 22rem),
    var(--surface);
}

.welcome {
  padding: clamp(28px, 5vw, 54px) clamp(22px, 5vw, 52px);
}

.welcome-content {
  width: min(700px, 100%);
}

.welcome-mark {
  width: 62px;
  height: 62px;
  margin-block-end: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand-soft), rgba(126, 220, 255, 0.3));
  color: var(--brand);
  box-shadow: 0 16px 32px rgba(47, 102, 245, 0.12);
}

.welcome-mark svg {
  width: 29px;
  height: 29px;
}

.welcome-eyebrow {
  margin-block-end: 8px;
  color: var(--brand);
  font-size: 0.75rem;
}

.welcome h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.3;
}

.welcome-description {
  margin-block-start: 9px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.prompt-list {
  width: 100%;
  margin-block-start: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.prompt-chip {
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface-raised);
  color: var(--text);
  text-align: start;
  white-space: normal;
  box-shadow: 0 10px 26px rgba(13, 63, 207, 0.04);
}

.prompt-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(13, 63, 207, 0.08);
}

.prompt-icon {
  width: 39px;
  height: 39px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-soft), rgba(126, 220, 255, 0.2));
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
  direction: ltr;
}

.prompt-chip > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.prompt-chip strong {
  font-size: 0.86rem;
  line-height: 1.45;
}

.prompt-chip small {
  color: var(--text-soft);
  font-size: 0.71rem;
}

.welcome-cta {
  margin-block-start: 19px;
  min-height: 42px;
  padding-inline: 18px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.messages {
  padding: 28px clamp(20px, 5vw, 48px) 22px;
}

.message-row.user .message-bubble {
  border-radius: 20px;
  border-end-end-radius: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 12px 24px rgba(47, 102, 245, 0.16);
}

.message-row.assistant .message-avatar {
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--brand-soft), rgba(126, 220, 255, 0.25));
  color: var(--brand);
}

.message-row.assistant .message-bubble {
  border-color: var(--line);
  border-radius: 20px;
  border-end-start-radius: 6px;
  background: var(--surface-subtle);
  box-shadow: none;
}

.sources,
.lead-cta,
.error-card {
  border-color: var(--line);
  background: var(--surface-subtle);
}

.composer-area {
  padding: 13px 20px 15px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(18px);
}

.composer {
  min-height: 58px;
  padding: 6px 7px 6px 15px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.composer:focus-within {
  border-color: rgba(47, 102, 245, 0.48);
  box-shadow: 0 0 0 4px rgba(47, 102, 245, 0.1);
}

#messageInput {
  color: var(--text);
}

#messageInput::placeholder {
  color: var(--muted);
}

.send-button {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 10px 20px rgba(47, 102, 245, 0.2);
}

.send-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.composer-meta {
  padding-inline: 6px;
  color: var(--muted);
  font-size: 0.68rem;
}

.lead-dialog,
.dialog-card,
.field input,
.field textarea,
.contact-fields {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 920px) {
  .app-shell {
    padding: 12px;
  }

  .assistant-layout {
    height: calc(100dvh - 24px);
    min-height: 580px;
    grid-template-columns: 1fr;
    border-radius: 26px;
  }

  .assistant-sidebar {
    padding: 13px 16px;
    display: block;
    border-inline-end: 0;
    border-block-end: 1px solid var(--line);
  }

  .site-brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 14px;
  }

  .sidebar-intro,
  .trust-list,
  .sidebar-footer {
    display: none;
  }

  .chat-panel {
    min-height: 0;
  }
}

@media (max-width: 650px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .assistant-layout {
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .assistant-sidebar {
    padding:
      max(9px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      9px
      max(12px, env(safe-area-inset-left));
  }

  .site-brand-copy small,
  .assistant-subtitle,
  .connection-status,
  #newChatButton span {
    display: none;
  }

  .chat-header {
    min-height: 70px;
    padding: 10px 12px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 13px;
  }

  #newChatButton,
  #websiteButton {
    width: 42px;
    height: 42px;
    padding: 0;
  }

  #languageButton {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding-inline: 0;
  }

  #newChatButton::before {
    content: none;
  }

  .welcome {
    padding: 24px 16px;
  }

  .welcome-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

  .prompt-list {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-block-start: 20px;
  }

  .prompt-chip {
    min-height: 65px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .prompt-chip small {
    display: none;
  }

  .messages {
    padding: 20px 12px;
  }

  .composer-area {
    padding:
      10px
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .composer-meta {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .assistant-layout {
    animation: accordev-enter 0.55s ease both;
  }

  .prompt-chip {
    animation: accordev-rise 0.5s ease both;
  }

  .prompt-chip:nth-child(2) {
    animation-delay: 60ms;
  }

  .prompt-chip:nth-child(3) {
    animation-delay: 120ms;
  }

  .prompt-chip:nth-child(4) {
    animation-delay: 180ms;
  }
}

@keyframes accordev-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes accordev-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}


/* ==========================================================================\n   FINAL LAYOUT FIX\n   Keeps the composer visible, slightly raised, and stable before/after messages.\n   ========================================================================== */
html,
body {
  height: 100%;
}

body {
  overflow: hidden !important;
}

.chat-panel {
  width: 100% !important;
  height: calc(100dvh - 18px) !important;
  min-height: 0 !important;
  margin: 0 0 18px !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
}

.conversation {
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-block-end: 0 !important;
}

.welcome {
  min-height: 100% !important;
  padding: 18px 24px 24px !important;
  display: grid !important;
  align-items: start !important;
  justify-items: center !important;
  overflow: auto !important;
}

.welcome-content {
  transform: none !important;
  margin-top: 0 !important;
  padding-bottom: 18px !important;
}

.welcome-cta {
  margin-block-start: 14px !important;
  margin-bottom: 0 !important;
}

.composer-area {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  margin: 0 !important;
  z-index: 20 !important;
  padding: 9px 28px 10px !important;
  border-block-start: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--surface) 97%, transparent) !important;
  box-shadow: 0 -10px 30px rgba(13, 63, 207, 0.045) !important;
  backdrop-filter: blur(18px) !important;
}

.composer-meta {
  min-height: 16px !important;
  margin-block-start: 3px !important;
}

@media (max-width: 760px) {
  body {
    overflow: hidden !important;
  }

  .chat-panel {
    width: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
  }

  .welcome {
    padding: 14px 14px 18px !important;
  }

  .composer-area {
    padding:
      8px
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left)) !important;
  }
}


/* ===== Accordev logo restoration ===== */
.brand-mark,
.welcome-mark {
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.brand-logo-image,
.welcome-logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
}

.welcome-mark {
  width: 96px;
  height: 96px;
  margin-block-end: 12px;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(47, 102, 245, 0.16);
}

.message-avatar {
  overflow: hidden;
  padding: 0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 650px) {
  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .welcome-mark {
    width: 76px;
    height: 76px;
    border-radius: 20px;
  }
}


/* ===== Composer appointment button ===== */
.booking-composer-button {
  min-width: 118px;
  min-height: 46px;
  padding: 0 15px;
  flex: 0 0 auto;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  color: var(--brand);
  box-shadow: none;
  white-space: nowrap;
}

.booking-composer-button:hover:not(:disabled) {
  border-color: rgba(47, 102, 245, 0.42);
  background: var(--brand-softer);
  color: var(--brand-deep);
  box-shadow: 0 8px 18px rgba(47, 102, 245, 0.08);
}

.booking-composer-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 650px) {
  .booking-composer-button {
    min-width: 46px;
    width: 46px;
    padding: 0;
  }

  .booking-composer-button span {
    display: none;
  }
}
