@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #27323b;
  --muted: #899096;
  --line: #e8e8e5;
  --paper: #ffffff;
  --page: #f5f6f8;
  --wine: #a90f27;
  --wine-dark: #830c20;
  --green: #315d4e;
  --blue: #0c5b9b;
  --blue-soft: #a7c1df;
  --bubble: #edf3f8;
  --shadow: 0 18px 60px rgba(35, 45, 56, 0.08), 0 2px 10px rgba(35, 45, 56, 0.03);
  font-family: Inter, "Noto Sans Arabic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--page); }
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 35%, #fafbfc 0, var(--page) 72%);
  font-size: 16px;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(12, 91, 155, 0.42); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: 0.56; }
.skip-link, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}
.skip-link:focus {
  z-index: 20;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  clip-path: none;
  color: #fff;
  background: var(--wine-dark);
  border-radius: 9px;
}

.app-shell {
  width: min(100%, 1060px);
  min-height: calc(100vh - 78px);
  min-height: calc(100svh - 78px);
  margin: 0 auto;
  padding: 28px 30px 12px;
  display: flex;
  flex-direction: column;
}
.page-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: #92989c;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.page-intro p { margin: 0; }
.flag-disc {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #e7e6df;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.04);
  font-size: 21px;
}

.chat-card {
  position: relative;
  display: flex;
  width: min(100%, 780px);
  min-height: min(940px, calc(100vh - 230px));
  min-height: min(940px, calc(100svh - 230px));
  margin: 56px auto 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: visible;
  background: var(--paper);
  border: 1px solid rgba(222, 224, 224, 0.94);
  border-radius: 34px;
  box-shadow: var(--shadow);
}
.card-accent {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  height: 7px;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 34px 34px 0 0;
  pointer-events: none;
}
.card-accent span:first-child { width: 66%; background: var(--blue); }
.card-accent span:last-child { justify-self: end; width: 66%; background: #ef443c; }

.assistant-header {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 32px 22px;
  border-bottom: 1px solid #ececea;
}
.brand-lockup { display: flex; min-width: 0; align-items: center; gap: 14px; }
.brand-mark { display: grid; width: 62px; height: 62px; flex: 0 0 auto; place-items: center; }
.brand-mark svg { width: 58px; height: 58px; overflow: visible; }
.mark-bubble { fill: var(--wine); }
.mark-tail { fill: var(--green); }
.mark-letter {
  fill: #fff;
  font-family: "Noto Sans Arabic", Tahoma, sans-serif;
  font-size: 29px;
  font-weight: 700;
  text-anchor: middle;
}
.brand-copy { min-width: 0; }
.brand-name { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.arabic-brand { color: #1f292d; font-family: "Noto Sans Arabic", Tahoma, sans-serif; font-size: 23px; font-weight: 700; line-height: 1.25; }
.latin-brand { color: #7c8285; font-size: 17px; font-weight: 600; }
.assistant-status { display: flex; align-items: center; gap: 9px; margin-top: 7px; color: #8a9195; font-size: 14px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; background: #2467a0; border-radius: 50%; }
.language-picker { position: relative; flex: 0 0 auto; }
.language-trigger {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid #e2e3df;
  border-radius: 999px;
  background: #fbfbf8;
  box-shadow: 0 1px 2px rgba(25, 31, 34, 0.03);
  color: #5e6867;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.language-trigger:hover { border-color: #cdd7dc; background: #fff; transform: translateY(-1px); }
.trigger-flag { font-size: 17px; line-height: 1; }
.globe-icon, .chevron-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.chevron-icon { width: 14px; height: 14px; transition: transform 160ms ease; }
.language-trigger[aria-expanded="true"] .chevron-icon { transform: rotate(180deg); }
.language-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  min-width: 194px;
  gap: 3px;
  padding: 7px;
  border: 1px solid #e6e8e6;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(25, 39, 46, 0.14);
}
.language-menu[hidden] { display: none; }
.language-menu button {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}
.language-menu button:hover, .language-menu button:focus-visible { background: #f4f6f6; }

.conversation-area {
  display: flex;
  min-height: 0;
  padding: 38px 25px 27px;
  flex: 1;
  flex-direction: column;
}
.conversation-log {
  display: flex;
  min-height: 145px;
  max-height: 42vh;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 0 4px 12px;
  scrollbar-color: #d9e0e5 transparent;
  scrollbar-width: thin;
}
.message { display: flex; max-width: 100%; align-items: flex-end; gap: 11px; animation: message-in 240ms ease both; }
.message.assistant-message { align-self: flex-start; }
.message.user-message { align-self: flex-end; flex-direction: row-reverse; }
.mini-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 50%;
  color: #fff;
  background: var(--wine);
  box-shadow: inset -4px -1px 0 var(--green);
  font-family: "Noto Sans Arabic", Tahoma, sans-serif;
  font-size: 17px;
  font-weight: 700;
}
.user-avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid #d8e1e7; border-radius: 50%; color: #446276; background: #f4f8fa; font-size: 13px; font-weight: 700; }
.message-bubble {
  max-width: min(78%, 570px);
  padding: 19px 22px;
  border-radius: 25px 25px 25px 7px;
  color: #283540;
  background: var(--bubble);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.welcome-bubble { padding: 20px 22px; }
.user-message .message-bubble { border-radius: 25px 25px 7px 25px; color: #fff; background: #1d5d8e; }
.message-copy { white-space: pre-wrap; }

.demo-controls { width: 100%; margin-top: auto; padding: 8px 4px 0; }
.suggestion-heading { margin: 0 0 14px 3px; color: #92989a; font-size: 14px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.suggestion-chip {
  min-height: 44px;
  padding: 9px 17px;
  border: 1px solid #e0e2df;
  border-radius: 999px;
  color: #67716e;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(40, 48, 49, 0.025);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.suggestion-chip:hover { border-color: #b9cbd5; background: #fbfdff; box-shadow: 0 3px 9px rgba(32, 54, 63, 0.06); transform: translateY(-1px); }
.suggestion-chip:active { transform: translateY(0); }
.composer {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 20px;
  border: 1px solid #dedfdd;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(34, 39, 42, 0.025);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.composer:focus-within { border-color: #a8c1d8; box-shadow: 0 0 0 3px rgba(12, 91, 155, 0.08); }
.composer input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 0;
  outline: 0;
  color: #293640;
  background: transparent;
  font-size: 16px;
}
.composer input::placeholder { color: #66717b; opacity: 1; }
.composer input:focus-visible { outline: none; }
.send-button {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: #9bb9d8;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}
.send-button:hover { background: #6e9ac7; transform: translateY(-1px); }
.send-button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.account-actions { display: flex; align-items: center; flex-direction: column; gap: 11px; padding: 17px 0 0; }
.google-button {
  display: flex;
  width: min(100%, 405px);
  min-height: 53px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid #dedfda;
  border-radius: 16px;
  color: #34413d;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.google-button:hover { border-color: #c6d2d4; background: #fbfcfc; }
.google-button svg, .create-account-button svg, .privacy-note svg { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.create-account-button {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 2px 5px;
  border: 0;
  color: #1f2b28;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}
.create-account-button:hover { color: var(--wine-dark); }
.create-account-button svg { width: 22px; height: 22px; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 1px 0 0; color: #a1a5a4; font-size: 12px; text-align: center; }
.privacy-note svg { width: 18px; height: 18px; }

.language-footer {
  position: relative;
  z-index: 5;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(224, 226, 225, 0.86);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}
.footer-label { color: #929895; font-size: 13px; white-space: nowrap; }
.footer-languages { display: flex; max-width: 100%; align-items: center; gap: 9px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
.footer-languages::-webkit-scrollbar { display: none; }
.footer-language {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 110px;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid #dedfda;
  border-radius: 999px;
  background: #fff;
  color: #55605c;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.footer-language:hover { border-color: #c4d2d9; }
.footer-language.is-active { border-color: #d3b9bc; background: #fff7f7; box-shadow: 0 1px 4px rgba(133, 47, 57, 0.06); }
.footer-language[aria-pressed="true"] { color: #7d2835; }
.footer-language .globe-icon { width: 19px; height: 19px; }
.made-with {
  position: fixed;
  z-index: 7;
  right: max(20px, calc((100vw - 1060px) / 2 + 8px));
  bottom: 17px;
  display: flex;
  min-height: 49px;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 18px;
  border: 1px solid #191919;
  border-radius: 999px;
  color: #fff;
  background: #171717;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.17);
  font-size: 14px;
  font-weight: 600;
}
.made-symbol { font-size: 22px; line-height: 1; }
.made-with button { display: grid; width: 32px; height: 32px; margin-left: 4px; place-items: center; border: 0; border-left: 1px solid rgba(255,255,255,.14); color: #aaa; background: transparent; cursor: pointer; font-size: 22px; }
.made-with button:hover { color: #fff; }
.made-with.is-hidden { display: none; }
.toast {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 13px 17px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 13px;
  color: #fff;
  background: #263238;
  box-shadow: 0 10px 28px rgba(25, 40, 45, 0.2);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

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

@media (min-width: 1000px) {
  .assistant-header { padding-right: 36px; padding-left: 36px; }
  .conversation-area { padding-right: 30px; padding-left: 30px; }
  .conversation-log { max-height: 46vh; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .app-shell { min-height: calc(100vh - 74px); min-height: calc(100svh - 74px); padding: max(18px, env(safe-area-inset-top)) 15px 9px; }
  .page-intro { min-height: 41px; gap: 10px; font-size: 13px; }
  .flag-disc { width: 40px; height: 40px; font-size: 19px; }
  .chat-card { min-height: max(600px, calc(100svh - 210px)); margin-top: 34px; border-radius: 28px; }
  .card-accent { height: 6px; border-radius: 28px 28px 0 0; }
  .assistant-header { min-height: 91px; gap: 8px; padding: 17px 14px 16px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 45px; height: 45px; }
  .brand-mark svg { width: 44px; height: 44px; }
  .brand-name { gap: 7px; }
  .arabic-brand { font-size: 19px; }
  .latin-brand { font-size: 14px; }
  .assistant-status { gap: 7px; margin-top: 5px; font-size: 12px; }
  .status-dot { width: 8px; height: 8px; }
  .language-trigger { min-height: 42px; gap: 6px; padding: 0 10px; font-size: 12px; }
  .trigger-flag { font-size: 15px; }
  .language-trigger .globe-icon { width: 17px; height: 17px; }
  .chevron-icon { display: none; }
  .conversation-area { padding: 27px 13px 18px; }
  .conversation-log { min-height: 125px; max-height: 34vh; gap: 12px; padding-right: 0; padding-left: 0; }
  .message { gap: 8px; }
  .mini-mark, .user-avatar { width: 27px; height: 27px; font-size: 15px; }
  .message-bubble { max-width: min(83%, 570px); padding: 15px 16px; border-radius: 21px 21px 21px 6px; font-size: 15px; line-height: 1.6; }
  .welcome-bubble { padding: 16px; }
  .suggestion-heading { margin-bottom: 11px; font-size: 13px; }
  .suggestions { gap: 7px; margin-bottom: 15px; }
  .suggestion-chip { min-height: 39px; padding: 8px 13px; font-size: 12px; }
  .composer { min-height: 61px; gap: 8px; padding: 6px 7px 6px 15px; border-radius: 21px; }
  .composer input { min-height: 43px; font-size: 14px; }
  .send-button { width: 47px; height: 47px; border-radius: 15px; }
  .account-actions { gap: 7px; padding-top: 12px; }
  .google-button { min-height: 47px; font-size: 14px; }
  .create-account-button { min-height: 32px; font-size: 15px; }
  .create-account-button svg { width: 19px; height: 19px; }
  .privacy-note { gap: 6px; font-size: 10px; }
  .privacy-note svg { width: 16px; height: 16px; }
  .language-footer { min-height: 0; align-items: flex-start; flex-direction: column; gap: 6px; padding: 9px 10px calc(10px + env(safe-area-inset-bottom)); }
  .footer-label { flex: 0 0 auto; font-size: 10px; }
  .footer-languages { max-width: 100%; flex-wrap: wrap; gap: 6px; overflow: visible; }
  .footer-language { min-width: 0; min-height: 38px; gap: 5px; padding: 5px 10px; font-size: 12px; }
  .footer-language .globe-icon { width: 17px; height: 17px; }
  .made-with { position: relative; right: auto; bottom: auto; align-self: flex-end; min-height: 43px; gap: 8px; margin: 6px 12px calc(10px + env(safe-area-inset-bottom)); padding: 0 8px 0 13px; font-size: 12px; }
  .made-symbol { font-size: 19px; }
  .made-with button { width: 27px; height: 28px; font-size: 20px; }
  .toast { bottom: calc(95px + env(safe-area-inset-bottom)); font-size: 13px; }
}
@media (max-width: 370px) {
  .page-intro { font-size: 12px; }
  .assistant-header { padding-right: 10px; padding-left: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-mark svg { width: 40px; height: 40px; }
  .latin-brand { font-size: 13px; }
  .assistant-status { font-size: 11px; }
  .language-trigger { gap: 5px; padding: 0 8px; font-size: 11px; }
  .footer-label { display: none; }
  .language-footer { align-items: center; }
  .footer-languages { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
