:root {
  color-scheme: light;
  --ink: #16242b;
  --muted: #61717b;
  --paper: #f6f3ed;
  --surface: #ffffff;
  --line: #dbe3e5;
  --primary: #006d77;
  --primary-dark: #064f57;
  --accent: #d1495b;
  --amber: #edae49;
  --green: #2a9d8f;
  --blue: #2d6cdf;
  --soft: #eef8f5;
  --shadow: 0 18px 44px rgba(22, 36, 43, 0.12);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 109, 119, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(209, 73, 91, 0.09), transparent 30%),
    var(--paper);
}

body[dir="rtl"] {
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-sprite,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.topbar {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand,
.top-actions,
.open-link,
.chatbot-header,
.restart-button,
.chat-form,
.choice-row,
.message-actions,
.note-card a {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 168px;
  max-width: 34vw;
  height: auto;
  border-radius: 4px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.1;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.top-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.open-link,
.restart-button,
.choice-button,
.send-button,
.message-link {
  border: 0;
  border-radius: var(--radius);
  font-weight: 850;
}

.open-link {
  gap: 8px;
  min-height: 40px;
  padding: 9px 12px;
  color: #fff;
  background: var(--ink);
}

.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.lang-button {
  min-width: 46px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.lang-button.is-active {
  color: #fff;
  background: var(--primary);
}

.page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.chatbot,
.support-panel {
  min-width: 0;
}

.chatbot {
  min-height: calc(100vh - 116px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.chatbot-header {
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(238, 248, 245, 0.96), #fff 70%);
}

body[dir="rtl"] .chatbot-header {
  background:
    linear-gradient(270deg, rgba(238, 248, 245, 0.96), #fff 70%);
}

.bot-face {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
}

.bot-face svg {
  width: 28px;
  height: 28px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.restart-button {
  gap: 8px;
  margin-inline-start: auto;
  min-height: 40px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.restart-button:hover,
.choice-button.secondary:hover,
.message-link:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.chat-window {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(rgba(0, 109, 119, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 109, 119, 0.045) 1px, transparent 1px),
    #f9fbfa;
  background-size: 30px 30px;
}

.message {
  width: min(740px, 96%);
  display: grid;
  gap: 10px;
  border-radius: var(--radius);
  padding: 14px;
  line-height: 1.5;
}

.message.bot {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: #fff;
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--primary);
}

body[dir="rtl"] .message.bot {
  align-self: flex-end;
}

body[dir="rtl"] .message.user {
  align-self: flex-start;
}

.message h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.message p {
  margin: 0;
}

.message ul,
.message ol {
  margin: 0;
  padding-inline-start: 22px;
}

.message li + li {
  margin-top: 5px;
}

.step-label {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #cce3e1;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--primary-dark);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.choice-row,
.message-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.choice-button,
.message-link {
  min-height: 38px;
  padding: 9px 12px;
}

.choice-button.primary {
  color: #fff;
  background: var(--primary);
}

.choice-button.danger {
  color: #fff;
  background: var(--accent);
}

.choice-button.success {
  color: #fff;
  background: var(--green);
}

.choice-button.secondary,
.message-link {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.message-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-form {
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.16);
}

.send-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--primary);
}

.open-link:hover,
.send-button:hover,
.choice-button.primary:hover {
  background: var(--primary-dark);
}

.support-panel {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.note-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.note-card > svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: var(--primary);
}

.note-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.note-card a {
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  border-top: 1px solid var(--line);
  color: var(--primary-dark);
  font-weight: 850;
}

.note-card a:first-of-type {
  margin-top: 4px;
}

.note-card a svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 920px) {
  .topbar,
  .page {
    width: min(100% - 18px, 760px);
  }

  .topbar,
  .page {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .chatbot {
    min-height: 720px;
  }

  .support-panel {
    position: static;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar,
  .page {
    width: min(100% - 14px, 430px);
  }

  .chatbot-header {
    display: grid;
  }

  .restart-button {
    width: 100%;
    justify-content: center;
    margin-inline-start: 0;
  }

  .message {
    width: 100%;
  }

  .open-link,
  .language-switch {
    flex: 1 1 auto;
  }

  .open-link {
    justify-content: center;
  }

  .brand-logo {
    width: 132px;
    max-width: 42vw;
  }
}
