:root {
  /* Date brown and golden date: --palm is the brand colour, --sand the accent (names kept from the Sahifa design system) */
  --white: #FFFFFF; --palm: #6B3A1F; --sand: #D9A35B; --sand-tint: #F8F1E7; --graphite: #2A2420; --grey: #6E6259;
  --line: #EADFD2; --code: #2B1A10; --danger: #9A3B2E; --ok: #2F6B3B;
  --r-sm: 6px; --r-md: 10px;
  --f: 'Kufi', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: var(--f); color: var(--graphite); background: var(--white); line-height: 1.8; }
html[lang="en"] body { line-height: 1.6; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--palm); outline-offset: 3px; }
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
section.wrap { padding-block: 88px; }
.band { background: var(--sand-tint); }

nav { display: flex; align-items: center; gap: 28px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 24px; text-decoration: none; color: var(--palm); }
nav ul { list-style: none; display: flex; gap: 24px; padding: 0; margin-inline-start: auto; font-size: 15px; }
nav ul a { text-decoration: none; }
nav ul a:hover { color: var(--palm); }

/* Pixel wordmark */
#pixelmark { margin-block: 40px 8px; min-height: 120px; }
#pixelmark svg { width: 100%; max-width: 900px; height: auto; display: block; margin-inline: auto; }
#pixelmark rect { fill: var(--palm); animation: drop .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #pixelmark rect { animation: none; } }

.intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; padding-block: 24px 72px; align-items: end; }
h1 { font-weight: 800; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.5; }
.lead { font-size: 18px; color: var(--grey); max-width: 32em; }
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn { display: inline-block; font: 800 15px var(--f); padding: 12px 24px; border-radius: var(--r-sm); text-decoration: none; border: 2px solid var(--palm); color: var(--palm); background: var(--white); cursor: pointer; }
.btn-main { background: var(--palm); color: var(--white); }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: progress; }

h2 { font-weight: 800; font-size: 32px; line-height: 1.5; color: var(--palm); }
.sub { font-size: 17px; color: var(--grey); margin-top: 10px; max-width: 40em; }
.note { font-size: 14px; color: var(--grey); margin-top: 18px; }

/* Demo */
.demo { margin-top: 36px; }
[role="tablist"] { display: flex; gap: 4px; border-bottom: 2px solid var(--palm); max-width: 420px; }
[role="tab"] { flex: 1; font: 800 15px var(--f); padding: 10px; border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: var(--sand-tint); color: var(--palm); cursor: pointer; }
[role="tab"][aria-selected="true"] { background: var(--palm); color: var(--white); }
.panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: 24px; }
.panel[hidden] { display: none; }
.input { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.input label { font-weight: 800; font-size: 15px; }
textarea, input[type="url"] { width: 100%; font: 13px/1.7 ui-monospace, Consolas, monospace; color: #F3E9DD; background: var(--code); border: 0; border-inline-start: 6px solid var(--sand); padding: 14px 16px; border-radius: var(--r-sm); }
textarea { min-height: 360px; resize: vertical; }
input[type="url"] { font-size: 15px; }
/* Demo frame: border made of small squares */
.output { padding: 12px; border-radius: var(--r-md); background: conic-gradient(var(--palm) 25%, transparent 0 50%, var(--palm) 0 75%, transparent 0) 0 0 / 12px 12px; }
.view { position: relative; background: var(--white); height: 420px; overflow: hidden; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.view img, .view iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; object-position: top; }
.output figcaption { font-size: 14px; padding: 10px 14px; border-radius: 0 0 var(--r-sm) var(--r-sm); background: var(--sand-tint); color: var(--grey); }
.output figcaption.error { color: var(--danger); }
.output figcaption a { color: var(--palm); font-weight: 800; margin-inline-start: 8px; }

/* Code samples on a dark background so they read as code */
.swap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
.swap figure { background: var(--code); color: #F3E9DD; padding: 22px 26px; border-inline-start: 6px solid var(--sand); border-radius: var(--r-md); }
.swap figcaption { font-size: 14px; color: #CDB79C; margin-bottom: 10px; }
pre { direction: ltr; text-align: left; font: 14.5px/2 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.del { color: #F0A497; }
.add { color: #8EE3B5; font-weight: 700; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 40px; }
.facts div { padding-inline: 28px; }
.facts div:first-child { padding-inline-start: 0; }
.facts div + div { border-inline-start: 1px solid var(--line); }
.facts h3 { font-weight: 800; font-size: 19px; }
.facts h3::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--sand); margin-inline-end: 10px; }
.facts p { color: var(--grey); margin-top: 6px; font-size: 15.5px; }
.facts small { display: block; font-size: 12px; color: #8A9096; margin-top: 6px; }
html[dir="rtl"] .facts small { text-align: right; }

.prices { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 36px; background: var(--white); border-radius: var(--r-md); overflow: hidden; }
.prices div { padding: 26px 22px; }
.prices div + div { border-inline-start: 1px solid var(--line); }
.prices .hl { background: var(--palm); color: var(--white); }
.prices h3 { font-size: 16px; font-weight: 800; }
.prices strong { display: block; font-size: 34px; font-weight: 800; margin-block: 8px 4px; }
.prices span { font-size: 14px; opacity: .8; }

footer.wrap { padding-block: 32px 48px; text-align: center; font-size: 14px; color: var(--grey); }

@media (max-width: 900px) {
  .intro, .panel, .swap, .facts { grid-template-columns: 1fr; }
  .intro { gap: 16px; padding-bottom: 48px; }
  .prices { grid-template-columns: 1fr 1fr; }
  .prices div:nth-child(3) { border-inline-start: 0; }
  .facts div { padding: 18px 0; }
  .facts div + div { border-inline-start: 0; border-top: 1px solid var(--line); }
  textarea { min-height: 220px; }
  .view { height: 340px; }
  nav { flex-wrap: wrap; row-gap: 10px; }
  nav ul.menu { flex-wrap: wrap; gap: 8px 18px; margin-inline-start: 0; width: 100%; font-size: 14px; }
  section.wrap { padding-block: 64px; }
}

/* Screenshots keep their 16:10 ratio so nothing is cropped */
#panel-take .view { height: auto; aspect-ratio: 1280 / 800; }
#panel-take .view img { object-fit: contain; }
@media (max-width: 900px) { .prices strong { font-size: 26px; white-space: nowrap; } }

/* Loading overlay: translucent layer, pixel loader, shimmering wait text */
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(3px); animation: fade .2s ease-out both; }
@keyframes fade { from { opacity: 0; } }
.loading .px { display: grid; grid-template-columns: repeat(3, 14px); gap: 4px; margin-bottom: 6px; }
.loading .px i { width: 14px; height: 14px; border-radius: 3px; background: var(--palm); animation: pulse 1.2s ease-in-out infinite; }
.loading .px i:nth-child(3n+2) { animation-delay: .15s; }
.loading .px i:nth-child(3n+3) { animation-delay: .3s; }
.loading .px i:nth-child(n+4) { animation-delay: .45s; }
.loading .px i:nth-child(n+7) { animation-delay: .6s; }
@keyframes pulse { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: 1; transform: none; } }
.loading .shimmer { font-weight: 800; font-size: 26px; line-height: 1.6;
  background: linear-gradient(90deg, var(--palm) 0 35%, var(--sand) 50%, var(--palm) 65% 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: sweep 1.8s linear infinite; }
html[dir="rtl"] .loading .shimmer { animation-direction: reverse; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
.loading .small { font-size: 14px; color: var(--grey); }
@media (prefers-reduced-motion: reduce) {
  .loading, .loading .px i, .loading .shimmer { animation: none; }
  .loading .px i { opacity: .6; }
  .loading .shimmer { color: var(--palm); background: none; }
}

/* Error state on top of the previous result */
.failed { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(3px); }
.failed p { max-width: 28em; text-align: center; font-weight: 800; font-size: 17px; color: var(--danger);
  background: var(--white); border: 2px solid var(--danger); border-radius: var(--r-md); padding: 16px 20px; }

/* Card logos */
.paycards { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; font-size: 13px; color: var(--grey); }
.paycards span { margin-inline-end: 4px; }
.paycards svg { width: 46px; height: 30px; display: block; border-radius: 4px; box-shadow: 0 0 0 1px rgba(10, 20, 40, .14); }

/* Demo option */
.check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; font-size: 14px !important; color: var(--grey); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--palm); }

/* Footer */
.site-foot { background: var(--code); color: #E9DCCD; margin-top: 0; }
.site-foot a { color: #FFFFFF; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-block: 56px 32px; }
.foot-grid h2 { font-size: 15px; color: var(--sand); margin-bottom: 10px; line-height: 1.6; }
.foot-grid ul { list-style: none; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.foot-grid p { font-size: 14px; margin-top: 10px; }
.foot-grid .small { font-size: 12px; color: #BFA990; }
.site-foot .brand { color: #FFFFFF; font-size: 26px; }
.site-foot .paycards { color: #E9DCCD; }
.ltr-block { direction: ltr; text-align: start; }
html[dir="rtl"] .ltr-block { text-align: right; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }
.trademarks { font-size: 12px; color: #BFA990; padding-bottom: 32px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-company { grid-column: 1 / -1; } }

/* Legal pages */
.doc main.prose { max-width: 760px; padding-block: 48px 88px; }
.prose h1 { color: var(--palm); font-size: clamp(30px, 4vw, 40px); }
.prose h2 { font-size: 22px; margin-top: 36px; color: var(--graphite); }
.prose h3 { font-size: 17px; margin-top: 18px; }
.prose p, .prose li, .prose dd { font-size: 16px; color: #3A4046; margin-top: 10px; }
.prose ul { padding-inline-start: 22px; }
.prose a { color: var(--palm); font-weight: 800; }
.prose a.btn-main { color: var(--white); text-decoration: none; }
.prose dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin-top: 12px; }
.prose dt { font-weight: 800; }
.prose dd { margin: 0; }
.updated { color: var(--grey); font-size: 14px !important; }
.ar-note { background: var(--sand-tint); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px !important; margin-bottom: 20px; }
.mails a { unicode-bidi: isolate; }
.prose h2[id] { scroll-margin-top: 24px; }
a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }

/* Docs layout */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-block: 32px 88px; }
.docs-nav { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; font-size: 14px; }
.docs-nav summary { display: none; }
.docs-nav h2 { font-size: 12px; color: var(--grey); margin: 18px 0 6px; line-height: 1.4; }
.docs-nav ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.docs-nav a { display: block; padding: 5px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--graphite); }
.docs-nav a:hover { background: var(--sand-tint); }
.docs-nav a[aria-current="page"] { background: var(--palm); color: var(--white); font-weight: 800; }
.docs-main { max-width: 820px; }
.docs-main h1 { color: var(--palm); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.3; }
.docs-main .lead { margin-top: 10px; }
.docs-main h2 { font-size: 19px; margin-top: 40px; color: var(--graphite); line-height: 1.4; scroll-margin-top: 16px; }
.docs-main h3 { font-size: 15.5px; margin-top: 24px; scroll-margin-top: 16px; }
.docs-main p, .docs-main li { font-size: 16px; color: #3A4046; margin-top: 10px; }
.docs-main ul, .docs-main ol { padding-inline-start: 22px; }
.docs-main a { color: var(--palm); font-weight: 800; }
.docs-main code { font: 0.92em ui-monospace, Consolas, monospace; background: var(--sand-tint); padding: 1px 5px; border-radius: 4px; }
.docs-main .doc-next { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
pre.code { position: relative; direction: ltr; text-align: left; margin-top: 14px; background: var(--code); color: #F3E9DD; border-radius: var(--r-md);
  padding: 18px 20px; overflow-x: auto; font: 13.5px/1.7 ui-monospace, Consolas, monospace; white-space: pre; }
pre.code code { background: none; padding: 0; color: inherit; font: inherit; }
pre.code .copy { position: absolute; top: 8px; right: 8px; font: 700 12px var(--f); padding: 4px 10px; border-radius: 4px; border: 0;
  background: rgba(255, 255, 255, .12); color: #F3E9DD; cursor: pointer; }
pre.code .copy:hover { background: rgba(255, 255, 255, .22); }
.codetabs { margin-top: 16px; }
.codetabs [role="tablist"] { max-width: none; border-bottom: 0; gap: 4px; flex-wrap: wrap; }
.codetabs [role="tab"] { flex: 0 0 auto; padding: 6px 14px; font-size: 13px; }
.codetabs pre.code { margin-top: 0; border-top-left-radius: 0; }
.params { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
.params th, .params td { text-align: start; vertical-align: top; padding: 10px 10px; border-bottom: 1px solid var(--line); }
.params th { font-size: 13px; color: var(--grey); font-weight: 800; }
.params td:first-child { white-space: nowrap; }
.params td:first-child code { font-weight: 700; }
.table-wrap { overflow-x: auto; }
.cols3 { width: 100%; table-layout: fixed; }
.cols3 td:first-child { white-space: normal; }
.cols3 th:nth-child(1) { width: 36%; } .cols3 th:nth-child(2) { width: 38%; }
.cols3.price th:nth-child(1), .cols3.price th:nth-child(2) { width: 22%; }
.callout { margin-top: 18px; padding: 14px 18px; border-radius: var(--r-md); background: var(--sand-tint); border-inline-start: 6px solid var(--sand); }
.callout.warn { border-inline-start-color: #C9782E; }
.callout p:first-child { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.cards a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; }
.cards a:hover { border-color: var(--palm); }
.cards strong { display: block; color: var(--palm); }
.cards span { display: block; color: var(--grey); font-weight: 400; font-size: 14px; margin-top: 4px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 800; font-size: 16px; }
@media (max-width: 680px) {
  .docs-layout { grid-template-columns: 1fr; gap: 16px; }
  .docs-nav { position: static; max-height: none; }
  .docs-nav summary { display: block; cursor: pointer; font-weight: 800; padding: 10px 14px; background: var(--sand-tint); border-radius: var(--r-sm); }
}
/* Grid children must be allowed to shrink, otherwise long code lines widen the page */
.docs-layout > * { min-width: 0; }
@media (max-width: 680px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) and (min-width: 681px) { .docs-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; } }

/* Syntax colours on the dark code background (contrast checked against #0E2A20) */
.hljs-comment, .hljs-quote { color: #B8A28A; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: #E8C98A; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #9BE6B9; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #F2A98E; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #8CCBFF; }
.hljs-title.class_, .hljs-type { color: #F0D98C; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: #C9B6FF; }
.hljs-name, .hljs-tag { color: #8CCBFF; }
.hljs-params { color: #F3E9DD; }
.hljs-meta { color: #CDB79C; }
.hljs-deletion { color: #F0A497; }
.hljs-subst { color: #F3E9DD; }
html[dir="rtl"] .codetabs pre.code { border-top-left-radius: var(--r-md); border-top-right-radius: 0; }
/* Inline code keeps its own left-to-right order inside Arabic text */
.docs-main code, .prose code { direction: ltr; unicode-bidi: isolate; }
.notfound { padding-block: 96px; max-width: 640px; }
.notfound .brand { font-size: 32px; }
.notfound h1 { margin-top: 24px; }
.notfound h2 { margin-top: 48px; font-size: 22px; }
.notfound p { margin-top: 12px; color: var(--grey); }
.notfound a { color: var(--palm); font-weight: 800; }

/* Account area */
.account { max-width: 760px; padding-block: 40px 88px; }
.account .card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px 26px; margin-top: 20px; background: var(--white); }
.account h1 { color: var(--palm); font-size: clamp(24px, 3vw, 30px); line-height: 1.4; }
.account h2 { font-size: 18px; line-height: 1.5; }
.account .sub { margin-top: 8px; }
.account form { display: grid; gap: 10px; margin-top: 18px; }
.account label { font-weight: 800; font-size: 14px; }
.account input[type="email"], .account input[type="text"] { font: 16px var(--f); padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); width: 100%; }
.account input:focus { border-color: var(--palm); outline: none; box-shadow: 0 0 0 3px rgba(107, 58, 31, .15); }
.account .fine { font-size: 13.5px; color: var(--grey); margin-top: 8px; }
.account .fine.warn { color: #9A5A1E; }
.account .perks { margin-top: 18px; padding-inline-start: 20px; color: var(--grey); font-size: 14.5px; display: grid; gap: 4px; }
.account .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.account-status { margin-top: 12px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--sand-tint); font-size: 15px; }
.account-status.error { background: #FBEDEA; color: var(--danger); font-weight: 800; }
.keybox { display: flex; gap: 10px; align-items: stretch; margin-top: 16px; }
.keybox code { flex: 1; font: 15px ui-monospace, Consolas, monospace; background: var(--code); color: #9BE6B9; padding: 12px 14px; border-radius: var(--r-sm); word-break: break-all; }
.dash-head .sub { margin-top: 4px; }
.plan-line { margin-top: 8px; font-size: 18px; }
.meter { height: 10px; background: var(--sand-tint); border-radius: 5px; overflow: hidden; margin-top: 14px; }
.meter-bar { height: 100%; width: 0; background: var(--palm); border-radius: 5px; transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .meter-bar { transition: none; } }
.plans, .langs { border: 0; padding: 0; display: grid; gap: 8px; }
.plan-option { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-weight: 400 !important; }
.plan-option:has(input:checked) { border-color: var(--palm); background: #FBF5EE; }
.plan-option .fine { margin-top: 0; }
.account .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14.5px; }
.account .check input { margin-top: 5px; accent-color: var(--palm); }
.account .check a { color: var(--palm); font-weight: 800; }
.btn[disabled] { cursor: not-allowed; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.danger { margin-top: 18px; }
.danger summary { cursor: pointer; color: var(--danger); font-weight: 800; font-size: 14.5px; }
pre.code.quick { margin-top: 12px; }
nav .signin { font-weight: 800; color: var(--palm); }
.account h1:focus { outline: none; }
.account form .btn { justify-self: start; }
html[dir="rtl"] #dash-email { text-align: right; }
nav ul.menu a[aria-current="page"] { color: var(--palm); font-weight: 800; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* Coloured HTML editor: a highlighted copy sits behind a transparent textarea and follows it while typing */
.editor { position: relative; width: 100%; border-radius: var(--r-sm); background: var(--code); border-inline-start: 6px solid var(--sand); }
.editor textarea, .editor .editor-hl {
  margin: 0; border: 0; border-radius: 0; padding: 14px 16px; font: 13px/1.7 ui-monospace, Consolas, monospace;
  white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; tab-size: 2; letter-spacing: 0;
}
.editor .editor-hl { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: #F3E9DD; background: none; direction: ltr; text-align: left; }
.editor .editor-hl code { font: inherit; background: none; padding: 0; }
.editor textarea { position: relative; display: block; background: transparent; color: transparent; caret-color: #F3E9DD; border-inline-start: 0; }
.editor textarea::selection { background: rgba(216, 198, 158, .35); color: transparent; }

/* Support chat */
.chat-fab { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 50; width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--palm); color: var(--white); cursor: pointer; box-shadow: 0 6px 18px rgba(107, 58, 31, .35); display: grid; place-items: center; }
.chat-fab svg { width: 28px; height: 28px; }
.chat-fab:hover { filter: brightness(1.1); }
.chat-open .chat-fab { display: none; }
.chat-panel { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 60; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 40px));
  display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 18px 48px rgba(35, 39, 43, .22); overflow: hidden; animation: chat-in .18s ease-out; }
.chat-panel[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .chat-panel { animation: none; } }
.chat-panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--palm); color: var(--white); }
.chat-panel h2 { font-size: 16px; color: var(--white); line-height: 1.4; }
.chat-close { background: none; border: 0; color: inherit; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); }
.chat-close svg { width: 20px; height: 20px; }
.chat-close:focus-visible { outline-color: var(--sand); outline-offset: 0; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.chat-notice { font-size: 12.5px; color: var(--grey); background: var(--sand-tint); border-radius: var(--r-sm); padding: 8px 10px; line-height: 1.6; }
.chat-suggest[hidden] { display: none; }
.chat-suggest { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.chat-suggest button { text-align: start; font: 14px var(--f); padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--palm); cursor: pointer; }
.chat-suggest button:hover { border-color: var(--palm); }
.chat-log { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.chat-msg { font-size: 14.5px; line-height: 1.7; padding: 9px 12px; border-radius: var(--r-md); max-width: 92%; overflow-wrap: anywhere; }
.chat-q { align-self: flex-end; background: var(--palm); color: var(--white); white-space: pre-wrap; }
.chat-a { align-self: flex-start; background: var(--sand-tint); }
.chat-a p + p, .chat-a p + ul, .chat-a ul + p, .chat-a pre { margin-top: 8px; }
.chat-a ul, .chat-a ol { padding-inline-start: 20px; }
.chat-a pre { white-space: pre; background: var(--code); color: #F3E9DD; border-radius: var(--r-sm); padding: 8px 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; text-align: left; }
.chat-a code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; unicode-bidi: isolate; }
.chat-a a { color: var(--palm); font-weight: 700; }
.chat-sources { font-size: 12.5px; color: var(--grey); margin-top: 8px; }
.chat-wait { display: flex; align-items: center; gap: 8px; color: var(--grey); font-size: 13px; }
.chat-wait .px { display: inline-flex; gap: 3px; }
.chat-wait .px i { width: 7px; height: 7px; border-radius: 2px; background: var(--palm); animation: pulse 1.2s ease-in-out infinite; }
.chat-wait .px i:nth-child(2) { animation-delay: .15s; }
.chat-wait .px i:nth-child(3) { animation-delay: .3s; }
.chat-form { display: flex; align-items: stretch; flex: none; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; width: auto; min-height: 0; height: 64px; resize: none; font: 14.5px/1.5 var(--f); color: var(--graphite); background: var(--white); padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.chat-form textarea:focus-visible { outline-offset: 0; }
.chat-send { width: 44px; border: 0; border-radius: var(--r-sm); background: var(--palm); color: var(--white); cursor: pointer; display: grid; place-items: center; }
.chat-send svg { width: 20px; height: 20px; }
[dir="rtl"] .chat-send svg { transform: scaleX(-1); }
.chat-send[disabled] { opacity: .5; cursor: progress; }
.chat-panel footer { padding: 0 12px 10px; font-size: 13px; }
.chat-mail { color: var(--palm); font-weight: 700; }
@media (max-width: 600px) {
  .chat-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
  .chat-open body { overflow: hidden; }
}

/* Survey */
.survey { max-width: 760px; padding-block: 48px 88px; }
.survey h1 { color: var(--palm); }
.survey .sub { margin-top: 8px; }
.survey-progress { list-style: none; padding: 0; margin: 28px 0 8px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: step; }
.survey-progress li { counter-increment: step; font-size: 12.5px; color: var(--grey); border-top: 4px solid var(--line); padding-top: 6px; line-height: 1.4; }
.survey-progress li::before { content: counter(step) ". "; font-weight: 800; }
.survey-progress li.done { border-color: var(--sand); }
.survey-progress li[aria-current] { border-color: var(--palm); color: var(--palm); font-weight: 800; }
.survey-step h2 { font-size: 22px; margin-top: 24px; }
.survey-step h2:focus { outline: none; }
.survey .q { border: 0; padding: 0; margin: 22px 0 0; }
.survey .q legend, .survey .q > label:not(.opt) { font-weight: 800; font-size: 16px; line-height: 1.5; margin-bottom: 8px; display: block; padding: 0; }
.survey .q-hint { display: block; font-weight: 400; font-size: 13px; color: var(--grey); }
.survey .opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; line-height: 1.5; }
.survey .opt:hover { border-color: var(--palm); }
.survey .opt input { margin-top: 5px; accent-color: var(--palm); width: 17px; height: 17px; flex: none; }
.survey .opt:has(input:checked) { border-color: var(--palm); background: var(--sand-tint); }
.survey .opt-text, .survey .q input[type="text"], .survey .q input[type="email"], .survey .q textarea {
  width: 100%; min-height: 0; font: 15px/1.5 var(--f); color: var(--graphite); background: var(--white); border: 1px solid var(--line);
  border-inline-start: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; margin-top: 6px; }
.survey .q textarea { resize: vertical; }
.survey .q-missing legend, .survey .q-missing > label:not(.opt) { color: var(--danger); }
.survey .q-missing .opt, .survey .q-missing input, .survey .q-missing textarea { border-color: var(--danger); }
.survey .consent { margin-top: 18px; }
.survey .hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.survey-error { margin-top: 18px; color: var(--danger); font-weight: 700; }
.survey-buttons { display: flex; gap: 12px; margin-top: 28px; }
.survey-buttons [type="submit"], .survey-buttons [data-go="next"] { margin-inline-start: auto; }
.survey-buttons [hidden] { display: none; }
.survey-done { margin-top: 28px; }
.survey-done:focus { outline: none; }
@media (max-width: 600px) {
  .survey-progress { grid-template-columns: repeat(5, 1fr); }
  .survey-progress li { font-size: 0; }
  .survey-progress li::before { font-size: 13px; }
}

/* Print (also used for the DPA PDF): the document only, no navigation, footer, chat or buttons */
@media print {
  header.wrap nav, .site-foot, .chat-fab, .chat-panel, .no-print, #pixelmark { display: none !important; }
  body { font-size: 10.5pt; line-height: 1.55; }
  main.wrap { max-width: none; padding: 0; }
  .prose h1 { font-size: 20pt; margin-top: 0; }
  .prose h2 { font-size: 13pt; break-after: avoid; }
  .prose a { color: inherit; text-decoration: none; }
  .callout, table, tr { break-inside: avoid; }
}

/* ---- Maqadi home page ---- */
.badge { display: inline-block; font-size: 13.5px; font-weight: 800; color: var(--palm); background: var(--sand-tint); border: 1px solid var(--sand); border-radius: 999px; padding: 4px 14px; margin-bottom: 14px; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 40px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 4px solid var(--sand); padding-top: 18px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--palm); color: var(--white); font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.steps h3 { font-weight: 800; font-size: 19px; }
.steps p { color: var(--grey); margin-top: 6px; font-size: 15.5px; }
.sides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
.side { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px 22px 24px; text-decoration: none; transition: border-color .15s, transform .15s; }
.side:hover { border-color: var(--palm); transform: translateY(-2px); }
.side strong { display: block; color: var(--palm); font-size: 18px; }
.side span { display: block; color: var(--grey); font-size: 15px; margin-top: 6px; }
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; }
.paths div { background: var(--white); border-radius: var(--r-md); padding: 24px 26px; border-inline-start: 6px solid var(--sand); }
.paths h3 { font-weight: 800; font-size: 19px; color: var(--palm); }
.paths p { color: var(--grey); margin-top: 8px; font-size: 15.5px; }
.prices.three { grid-template-columns: repeat(3, 1fr); }
.faq details { max-width: 820px; }
.faq details p { color: var(--grey); margin-top: 8px; font-size: 15.5px; }
#faq h2 { margin-bottom: 18px; }
.beta-strip { font-size: 13.5px; color: var(--grey); background: var(--sand-tint); border-inline-start: 4px solid var(--sand); border-radius: var(--r-sm); padding: 8px 12px; margin-bottom: 18px; }
@media (max-width: 900px) {
  .steps, .sides, .paths, .prices.three { grid-template-columns: 1fr; }
  .prices.three div + div { border-inline-start: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } .side:hover { transform: none; } }
