/* Adjoin brand stylesheet - see docs/brand-spec.md. All colours are tokens; dark theme overrides them. */
:root {
  color-scheme: light;
  /* brand tokens */
  --navy: #0F1E2E;
  --teal: #2AAFAF;
  --teal-dark: #23989A;
  --emerald: #0B5D4D;
  --sand: #D8B48E;
  --soft-sand: #F5E7D3;
  --sage: #8CBBA6;
  --warm-gray: #F2F2F2;
  --slate: #5A6473;
  --white: #FFFFFF;
  /* semantic tokens (light) */
  --bg: #FFFFFF;
  --bg-alt: #F2F2F2;
  --surface: #FFFFFF;
  --surface-2: #F2F2F2;
  --ink: #0F1E2E;
  --muted: #5A6473;
  --line: #E3E6EA;
  --link: #0B5D4D;
  --eyebrow: #0B5D4D;
  --brand-text: #0F1E2E;
  --btn-primary-bg: #2AAFAF;
  --btn-primary-bg-hover: #23989A;
  --btn-primary-fg: #0F1E2E;
  --btn-secondary-fg: #0F1E2E;
  --icon-bg: #F5E7D3;
  --icon-fg: #0B5D4D;
  --chat-bg: #0F1E2E;
  --chat-fg: #FFFFFF;
  --chat-muted: rgba(255,255,255,0.7);
  --chat-user: rgba(255,255,255,0.08);
  --chat-assistant: rgba(42,175,175,0.16);
  --chat-assistant-line: rgba(42,175,175,0.35);
  --chat-line: rgba(255,255,255,0.1);
  --ok-fg: #1A6F50;
  --ok-bg: #EEF6F1;
  --badge-ok-bg: #1F8A5E;
  --badge-ok-fg: #FFFFFF;
  --ok-line: #8CBBA6;
  --warn-fg: #8A5A1E;
  --warn-bg: #F5E7D3;
  --err-fg: #B3261E;
  --err-bg: #FBEEED;
  --err-line: #E8B4B0;
  --info-fg: #0F1E2E;
  --info-bg: #F5E7D3;
  --info-line: #D8B48E;
  --badge-muted-fg: #5A6473;
  --badge-muted-bg: #F2F2F2;
  --strip-fg: #5A6473;
  --shadow: 0 20px 50px rgba(15, 30, 46, 0.25);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "IBM Plex Sans Arabic", var(--font);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1622;
  --bg-alt: #0F1E2E;
  --surface: #0F1E2E;
  --surface-2: #16293D;
  --ink: #F5E7D3;
  --muted: #A6B1BF;
  --line: #2C3D52;
  --link: #5FD0CF;
  --eyebrow: #8CBBA6;
  --brand-text: #FFFFFF;
  --btn-primary-bg: #2AAFAF;
  --btn-primary-bg-hover: #3DC2C2;
  --btn-primary-fg: #0B1622;
  --btn-secondary-fg: #F5E7D3;
  --icon-bg: #16293D;
  --icon-fg: #8CBBA6;
  --chat-bg: #16293D;
  --chat-fg: #F5E7D3;
  --chat-muted: rgba(245,231,211,0.7);
  --chat-user: rgba(255,255,255,0.06);
  --chat-assistant: rgba(42,175,175,0.14);
  --chat-assistant-line: rgba(42,175,175,0.4);
  --chat-line: rgba(255,255,255,0.1);
  --ok-fg: #8CE0B8;
  --ok-bg: #12352A;
  --badge-ok-bg: #2FA874;
  --badge-ok-fg: #0F1E2E;
  --ok-line: #1E7F5C;
  --warn-fg: #F0C690;
  --warn-bg: #3B2A14;
  --err-fg: #F5A09A;
  --err-bg: #3E1A17;
  --err-line: #7A2E28;
  --info-fg: #F5E7D3;
  --info-bg: #16293D;
  --info-line: #D8B48E;
  --badge-muted-fg: #A6B1BF;
  --badge-muted-bg: #16293D;
  --strip-fg: #F5E7D3;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 1, "cv11" 1;
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow: auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.arabic { font-family: var(--font-arabic); color: var(--sand); direction: rtl; }

.container { width: min(1120px, 100% - 32px); margin: 0 auto; }
.narrow { width: min(760px, 100% - 32px); margin: 0 auto; }

/* Nav */
.site-head { border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 1.25rem; color: var(--brand-text); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 32px; height: 32px; color: var(--teal); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink); font-weight: 500; }
.nav-links .sep { width: 1px; height: 22px; background: var(--line); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } .nav-links { gap: 14px; } }

/* Theme toggle */
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: 1rem; line-height: 1; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); }
.btn-secondary { background: var(--surface); color: var(--btn-secondary-fg); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--err-fg); border-color: var(--err-fg); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Hero */
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 40px; } }
.hero .sub { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
.hero .cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.hero .note { color: var(--muted); font-size: 0.95rem; }
.h1-sub { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin: -6px 0 12px; line-height: 1.4; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 12px; }

/* Chat panel */
.chat { background: var(--chat-bg); color: var(--chat-fg); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); border: 1px solid transparent; }
:root[data-theme="dark"] .chat { border-color: var(--line); }
.chat .bar { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--chat-muted); margin-bottom: 14px; }
.chat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.chat .msg { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; font-size: 0.95rem; line-height: 1.5; }
.chat .user { background: var(--chat-user); }
.chat .assistant { background: var(--chat-assistant); border: 1px solid var(--chat-assistant-line); }
.chat table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 8px; }
.chat td, .chat th { padding: 6px 4px; border-bottom: 1px solid var(--chat-line); text-align: left; }
.chat th { color: var(--chat-muted); font-weight: 500; }
.chat td.num, .chat th.num { text-align: right; }
.chat .tool { font-size: 0.75rem; color: var(--sage); margin: 6px 0 10px; }

/* Integrations strip */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; }
.strip .row { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; justify-content: center; color: var(--strip-fg); font-weight: 600; }
.strip .row .arrow { color: var(--sand); }
.strip .row .soon { font-weight: 500; font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }

/* Service glyphs (Simple Icons, monochrome in currentColor) */
.svc { display: inline-flex; align-items: center; gap: 8px; }
.svc-icon { width: 18px; height: 18px; flex: 0 0 18px; position: relative; top: -1px; }
h3.svc .svc-icon { width: 20px; height: 20px; flex-basis: 20px; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-top: 8px; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--icon-bg); color: var(--icon-fg); display: grid; place-items: center; font-weight: 800; }

/* Pricing */
.pricing { display: grid; place-items: center; }
.price-card { max-width: 440px; width: 100%; border: 2px solid var(--teal); border-radius: 16px; padding: 32px; text-align: center; background: var(--surface); }
.price-card .amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 18px; }
.price-card .amount span { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-card .usd-equiv { color: var(--muted); font-size: 0.95rem; font-weight: 500; margin: 0 0 4px; }
.price-card .cycle-note { margin-top: 0; }
.price-card ul { list-style: none; padding: 0; margin: 20px 0; text-align: left; }
.price-card li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.price-card li:last-child { border-bottom: 0; }
.price-card .compare { color: var(--muted); font-size: 0.95rem; margin-top: 16px; }
.cycle-toggle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-top: 8px; }
.cycle-toggle button { position: relative; font: inherit; font-weight: 600; font-size: 0.9rem; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 10px 6px 8px; cursor: pointer; display: grid; gap: 2px; justify-items: center; }
.cycle-toggle button small { font-weight: 500; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cycle-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.cycle-toggle button.active small { color: var(--eyebrow); }
.cycle-toggle button:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.cycle-toggle .best { position: absolute; top: -10px; right: 6px; background: var(--emerald); color: var(--white); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
:root[data-theme="dark"] .cycle-toggle .best { background: var(--sage); color: var(--navy); }

/* Optional extras (under pricing): small and quiet */
.extras { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 28px; margin-top: 28px; color: var(--muted); font-size: 0.9rem; }
.extras-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--eyebrow); }
.extra { display: inline-flex; align-items: center; gap: 6px; }
.extra strong { color: var(--ink); font-weight: 600; }
.extra .soon { font-weight: 500; font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.extra-note { color: var(--muted); }
.extra-note::before { content: "·"; margin-right: 6px; }
@media (max-width: 720px) { .extras { flex-direction: column; gap: 8px; } .extra { flex-wrap: wrap; justify-content: center; } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 0.9rem; }
.footer .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.footer-policy { margin-top: 14px; opacity: 0.8; }
.footer .lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--brand-text); font-weight: 700; }
.footer .lockup .mark { width: 22px; height: 22px; color: var(--teal); }

/* Forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .help { color: var(--muted); font-size: 0.85rem; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: var(--surface); color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 16px; }
.alert-ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-fg); }
.alert-error { border-color: var(--err-line); background: var(--err-bg); color: var(--err-fg); }
.alert-info { border-color: var(--info-line); background: var(--info-bg); color: var(--info-fg); }

/* Dashboard */
.dash { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 32px 0 64px; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
.side a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.side a.active, .side a:hover { background: var(--surface-2); text-decoration: none; }
.badge { display: inline-block; white-space: nowrap; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-ok { background: var(--badge-ok-bg); color: var(--badge-ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-err { background: var(--err-bg); color: var(--err-fg); }
.badge-muted { background: var(--badge-muted-bg); color: var(--badge-muted-fg); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.stack { display: grid; gap: 24px; min-width: 0; }
.table-scroll { overflow-x: auto; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy input { flex: 1; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 24px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; }
.checklist .done .tick { background: var(--teal); border-color: var(--teal); color: var(--navy); }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; padding-left: 36px; position: relative; margin-bottom: 12px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 0.8rem; font-weight: 700; display: grid; place-items: center; }

/* Legal */
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal h3 { font-size: 1.05rem; margin-top: 1.5em; }
.legal .draft { border-left: 4px solid var(--sand); }

/* Coming soon */
.coming { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 0; }
.coming .mark { width: 64px; height: 64px; color: var(--teal); margin-bottom: 16px; }

/* Dashboard overview */
.dash-hero h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); margin-bottom: 0.3em; }
.lede { font-size: 1.1rem; color: var(--muted); margin-bottom: 20px; }
.trial { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--ok-line); background: var(--ok-bg); }
.trial-icon { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px; display: grid; place-items: center; background: var(--surface); color: var(--teal-dark); border: 1px solid var(--ok-line); }
.trial strong { display: block; }
.setup-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.setup-head h3 { margin: 0; flex: 1; }
.setup-close { margin: 0; }
.iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.iconbtn:hover { color: var(--ink); border-color: var(--muted); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.setup-restore { margin: -8px 0 0; }
.progress { display: inline-flex; align-items: center; gap: 12px; }
.progress .bar { display: inline-flex; gap: 4px; }
.progress .bar i { display: block; width: 56px; height: 8px; border-radius: 999px; background: var(--surface-2); }
.progress .bar i.on { background: var(--teal); }
.setup-steps { list-style: none; padding: 0; margin: 0; }
.setup-steps li { display: flex; gap: 16px; align-items: flex-start; padding: 18px 12px; margin: 0 -12px; border-radius: 10px; }
.setup-steps li + li { border-top: 1px solid var(--line); }
.setup-steps li.current { background: var(--ok-bg); border-top-color: transparent; }
.setup-steps li.current + li { border-top-color: transparent; }
.setup-num { width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line); color: var(--muted); background: var(--surface); }
.setup-steps .done .setup-num { background: var(--teal); border-color: var(--teal); color: var(--navy); }
.setup-steps .current .setup-num { background: var(--emerald); border-color: var(--emerald); color: var(--white); }
.setup-body { flex: 1; min-width: 0; }
.setup-body strong { display: block; font-size: 1.05rem; }
.setup-aside { align-self: center; white-space: nowrap; text-decoration: underline; font-weight: 600; }
.copy-row { display: flex; gap: 10px; margin: 12px 0 8px; }
.copy-row input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1rem; }
.prompt-row { margin-top: 4px; align-items: center; }
.prompt { flex: 1; min-width: 0; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-style: italic; }
@media (max-width: 720px) {
  .copy-row { flex-direction: column; }
  .setup-steps li { flex-wrap: wrap; }
  .setup-aside { align-self: flex-start; margin-left: 52px; }
  .progress .bar i { width: 36px; }
}

/* OAuth consent + hand-off */
.consent-wrap { max-width: 640px; margin: 0 auto; padding: 48px 0 72px; }
.consent { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 36px; box-shadow: 0 12px 40px rgba(15, 30, 46, 0.08); }
.consent h1 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin-bottom: 0.4em; }
.consent-client { color: var(--teal-dark); }
.consent-mark { width: 56px; height: 56px; border-radius: 14px; background: var(--icon-bg); color: var(--icon-fg); display: grid; place-items: center; margin-bottom: 20px; }
.consent-mark svg { width: 32px; height: 32px; }
.consent-mark.done { background: var(--teal); color: var(--navy); border-radius: 50%; }
.consent-perms { list-style: none; padding: 0; margin: 20px 0 24px; border-top: 1px solid var(--line); }
.consent-perms li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.consent-perms strong { display: block; }
.perm-icon { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; display: grid; place-items: center; }
.perm-icon.ok { background: var(--ok-bg); color: var(--ok-fg); }
.perm-icon.no { background: var(--err-bg); color: var(--err-fg); }
.consent-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.consent-foot { margin: 20px 0 0; }
.consent-done { text-align: center; }
.consent-done .consent-mark { margin: 0 auto 20px; }
@media (max-width: 720px) { .consent { padding: 24px; } }

/* Connections page groups */
.conn-group { margin-bottom: 8px; }
.conn-card { justify-content: space-between; flex-wrap: nowrap; }
.conn-main { flex: 1; min-width: 0; }
@media (max-width: 720px) { .conn-card { flex-wrap: wrap; } }
.conn-group-title { font-size: 1.05rem; font-weight: 700; margin: 8px 0 12px; display: flex; align-items: center; gap: 10px; }
.conn-group .card + .card { margin-top: 12px; }

/* Connect pages */
.crumbs { display: flex; gap: 10px; align-items: center; font-size: 0.95rem; margin-bottom: 14px; color: var(--muted); }
.crumbs strong { color: var(--ink); font-weight: 600; }
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 12px; background: var(--ok-bg); border: 1px solid var(--ok-line); margin-bottom: 22px; }
.callout-icon { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px; display: grid; place-items: center; background: var(--surface); color: var(--teal-dark); border: 1px solid var(--ok-line); }
.callout strong { display: block; }
.callout-link { display: inline-block; margin: 8px 16px 0 0; font-weight: 600; }
.secret { display: flex; align-items: stretch; }
.secret input { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.reveal { border: 1px solid var(--line); border-left: 0; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; padding: 0 16px; border-radius: 0 10px 10px 0; cursor: pointer; }
.reveal:hover { background: var(--surface-2); }

/* Login providers */
.providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.provider { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 600; }
.provider:hover { border-color: var(--muted); text-decoration: none; }
.provider .svc-icon { width: 24px; height: 24px; flex: 0 0 24px; top: 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; margin: 26px 0 18px; }
@media (max-width: 480px) { .providers { grid-template-columns: repeat(2, 1fr); } }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Settings */
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.danger-zone { border-color: var(--err-line); }
.modal { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(15, 30, 46, 0.55); }
.modal-form { padding: 24px; margin: 0; }
.modal-form h3 { margin-top: 0; }
.modal-form .word { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); }
.modal-form .typed { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1rem; }
.modal-actions { margin-top: 16px; }

#pricing { position: relative; overflow: hidden; }

/* Pricing: service glyphs drifting in the margins (decorative) */
.float-field { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.pricing { position: relative; z-index: 1; }
.floater { position: absolute; color: var(--teal-dark); opacity: 0.22; animation: drift var(--dur, 22s) ease-in-out var(--delay, 0s) infinite alternate; will-change: transform; }
.floater .svc-icon { width: var(--size, 40px); height: var(--size, 40px); position: static; }
:root[data-theme="dark"] .floater { color: var(--sage); opacity: 0.26; }
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(-6deg); }
  50%  { transform: translate(18px, -26px) rotate(4deg); }
  100% { transform: translate(-14px, 22px) rotate(-3deg); }
}
@media (max-width: 1100px) { .float-field { display: none; } }
@media (prefers-reduced-motion: reduce) { .floater { animation: none; } }

/* Language switch */
.lang-toggle { font-weight: 600; color: var(--ink); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--font-arabic); }
.lang-toggle:hover { text-decoration: none; border-color: var(--muted); }

/* Right-to-left (Arabic) */
[dir="rtl"] body, [dir="rtl"] button, [dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea { font-family: var(--font-arabic); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { letter-spacing: 0; line-height: 1.3; }
[dir="rtl"] .eyebrow, [dir="rtl"] .or { letter-spacing: 0; }
[dir="rtl"] .chat td, [dir="rtl"] .chat th { text-align: right; }
[dir="rtl"] .chat td.num, [dir="rtl"] .chat th.num { text-align: left; }
[dir="rtl"] .strip .row .soon { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .strip .arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .price-card ul { text-align: right; }
[dir="rtl"] .cycle-toggle .best { right: auto; left: 6px; }
[dir="rtl"] .extra-note::before { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
[dir="rtl"] .steps li { padding-left: 0; padding-right: 36px; }
[dir="rtl"] .steps li::before { left: auto; right: 0; }
[dir="rtl"] .legal .draft { border-left: 0; border-right: 4px solid var(--sand); }
[dir="rtl"] .setup-aside { margin-left: 0; margin-right: 52px; }
[dir="rtl"] .secret input { border-radius: 10px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
[dir="rtl"] .reveal { border-left: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; }
[dir="rtl"] .callout-link { margin: 8px 0 0 16px; }
[dir="rtl"] .arabic { color: var(--sand); }
[dir="rtl"] code, [dir="rtl"] pre, [dir="rtl"] .mono, [dir="rtl"] input[type=email], [dir="rtl"] input[type=url], [dir="rtl"] .copy-row input { direction: ltr; text-align: left; unicode-bidi: isolate; }
[dir="rtl"] .num { direction: ltr; unicode-bidi: isolate; }

/* Pricing page */
.pricing-head { padding: 56px 0 8px; text-align: center; max-width: 760px; }
.pricing-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.pricing-head .sub { color: var(--muted); font-size: 1.1rem; }
.faq { margin: 20px 0; }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 6px 0 0; color: var(--muted); }

.extra-aed { font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
[dir="rtl"] .extra-aed { margin-left: 0; margin-right: 4px; }

.price-card .svc-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.price-card .svc-list .svc { font-weight: 500; }

/* Homepage: hero reassurance, use cases, setup section */
.hero .reassure { margin-top: 16px; font-size: 0.95rem; color: var(--muted); }
.chat .sample { margin-left: auto; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--chat-line); border-radius: 999px; padding: 2px 8px; }
[dir="rtl"] .chat .sample { margin-left: 0; margin-right: auto; }
.chat .tool { opacity: 0.8; }
.center { text-align: center; margin-top: 24px; }
.usecase .q { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.usecase .a { color: var(--muted); }
.usecase .src { display: inline-flex; gap: 8px; color: var(--muted); }
.setup-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: start; }
.setup-list { list-style: none; padding: 0; margin: 20px 0; }
.setup-list li { display: grid; grid-template-columns: 180px 130px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: baseline; }
.setup-list .time { font-size: 0.85rem; color: var(--teal-dark); font-weight: 600; white-space: nowrap; }
.setup-list .need { color: var(--muted); }
.steps.small li { margin-bottom: 6px; color: var(--muted); }
@media (max-width: 860px) {
  .setup-grid { grid-template-columns: 1fr; }
  .setup-list li { grid-template-columns: 1fr; gap: 4px; }
}
.nav-links a { white-space: nowrap; }
@media (max-width: 720px) {
  .nav-links { gap: 10px; }
  .nav-links .btn-sm { padding: 8px 10px; font-size: 0.85rem; }
  .lang-toggle { padding: 6px 8px; font-size: 0.9rem; }
}
@media (max-width: 480px) { .nav-links > a:not(.btn):not(.lang-toggle) { display: none; } }

.setup-grid .why { font-size: 0.95rem; margin: 4px 0 0; }
.callout.concierge { margin: 18px 0 14px; background: var(--surface); border-color: var(--sand); }
.callout.concierge .callout-icon { color: var(--emerald); border-color: var(--sand); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; font-weight: 600; background: var(--surface); }
.pill .svc-icon { width: 15px; height: 15px; flex-basis: 15px; top: 0; }
.extra.roadmap { color: var(--muted); font-weight: 500; }
.extra.roadmap .soon { margin: 0 6px 0 0; }
[dir="rtl"] .extra.roadmap .soon { margin: 0 0 0 6px; }

.footer .social { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.footer .social .svc-icon { width: 13px; height: 13px; flex-basis: 13px; top: 0; }

/* Admin / support console */
.side-title { padding: 8px 10px 4px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.side-search { padding: 10px 10px 0; }
.side-search input { width: 100%; }
.side-admin { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 14px !important; border-radius: 0 0 8px 8px !important; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 16px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
a.stat:hover { border-color: var(--btn-primary-bg); text-decoration: none; }
.stat .big { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 960px) { .admin-cols { grid-template-columns: 1fr; } }
.table.compact th, .table.compact td { padding: 8px 8px; font-size: 0.92rem; }
.table.compact tr:last-child td { border-bottom: 0; }
.table.compact td.when { white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; }
.wrap-any { overflow-wrap: anywhere; }

/* Sample conversation: the follow-up question is a real button that reveals one more exchange */
.next-check { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 10px 12px; background: var(--chat-user); color: inherit; border: 1px solid var(--chat-line); border-radius: 10px; font: inherit; text-align: left; cursor: pointer; }
.next-check:hover, .next-check:focus-visible { border-color: var(--teal); outline: none; }
.next-check-hint { white-space: nowrap; font-size: 0.82rem; font-weight: 700; color: var(--chat-bg); background: var(--teal); padding: 5px 11px; border-radius: 999px; }
.next-check:hover .next-check-hint { filter: brightness(1.08); }
.next-check[aria-expanded="true"] { display: none; }
.demo-more { animation: demo-in 0.35s ease-out; }
@keyframes demo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .next-check { text-align: right; }

/* Admin viewing the dashboard as a tenant */
.viewas-bar { background: var(--warn-bg); color: var(--warn-fg); border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.viewas-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .actions-grid { grid-template-columns: 1fr; } }
.action { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; }
.action.danger { border-color: var(--err-line); }
.action input[type=number] { width: 90px; }
.action input[type=text] { width: 100%; }
.platform-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 900px) { .platform-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .platform-grid { grid-template-columns: repeat(2, 1fr); } }
.platform-tile { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "icon count" "name name"; align-items: center; gap: 2px 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.platform-tile .svc-icon { grid-area: icon; }
.platform-tile .platform-count { grid-area: count; }
.platform-tile .platform-name { grid-area: name; }
.platform-tile.empty { background: transparent; color: var(--muted); }
.platform-tile .svc-icon { width: 18px; height: 18px; flex-basis: 18px; top: 0; }
.platform-name { font-size: 0.82rem; font-weight: 600; color: var(--muted); line-height: 1.25; }
.platform-count { font-weight: 700; font-size: 1.25rem; line-height: 1; }

.card[id] { scroll-margin-top: 24px; }

/* Status page */
.status-page { padding: 48px 0 72px; max-width: 860px; }
.status-banner { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); margin: 8px 0 10px; }
.status-banner.level-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bg); }
.status-banner.level-degraded { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bg); }
.status-banner.level-down { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-line); }
.status-banner strong { font-size: 1.15rem; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex: 0 0 12px; }
.status-services { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0 36px; }
@media (max-width: 600px) { .status-services { grid-template-columns: 1fr; } }
.status-service { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.status-timeline { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.status-timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { .status-timeline li { grid-template-columns: 1fr; gap: 4px; } }
.status-date { font-weight: 600; color: var(--muted); font-size: 0.92rem; }
.status-post { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 8px; }
.status-post.level-down { border-color: var(--err-line); }
.status-post.level-degraded { border-color: var(--warn-bg); }
.status-post p { margin: 6px 0 0; white-space: pre-line; }

/* Quick start: per-client snippets */
.qs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 760px) { .qs-grid { grid-template-columns: 1fr; } }
.qs-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.qs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; }
.qs-head span { display: inline-flex; align-items: center; gap: 6px; }
.qs-head .svc-icon { width: 16px; height: 16px; flex-basis: 16px; top: 0; }
.qs-copy { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--link); cursor: pointer; }
.qs-copy:hover { border-color: var(--link); }
.qs-card pre { margin: 0; border-radius: 0; background: var(--chat-bg); color: var(--chat-fg); padding: 14px; font-size: 0.85rem; line-height: 1.5; flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.qs-note { padding: 10px 14px; font-size: 0.85rem; color: var(--muted); }
[dir="rtl"] .qs-card pre { direction: ltr; text-align: left; }

/* Homepage: demo CTA, compact compatibility block, final CTA */
.demo-btn { padding: 8px 14px; font-size: 0.9rem; }
.demo-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; color: var(--chat-muted); }
.compat { padding-top: 40px; padding-bottom: 40px; }
.compat h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.qs-details > summary { cursor: pointer; font-weight: 600; color: var(--link); list-style: none; display: inline-block; margin-top: 8px; }
.qs-details > summary::-webkit-details-marker { display: none; }
.qs-details > summary::before { content: "+ "; }
.qs-details[open] > summary::before { content: "\2212 "; }
.final-cta { border-top: 1px solid var(--line); }
.final-cta .btn { margin-top: 8px; }

/* Connections: card grid */
.conn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .conn-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .conn-grid { grid-template-columns: 1fr; } }
.conn-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.conn-tile.pending { background: var(--surface-2); }
.conn-tile-icon .svc-icon { width: 36px; height: 36px; flex-basis: 36px; top: 0; }
.conn-tile-name { margin: 0; font-size: 1.05rem; }
.conn-tile-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); text-align: left; }
.conn-tile-meta { display: flex; flex-direction: column; min-width: 0; }
.conn-count { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.conn-error { color: var(--err-fg); overflow-wrap: anywhere; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 5; display: grid; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--ink); border-radius: 6px; cursor: pointer; text-decoration: none; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.menu-list button.danger { color: var(--err-fg); }
.menu-list form { margin: 0; }
.conn-tile.pending .conn-tile-foot { flex-direction: column; align-items: stretch; }
.conn-tile.pending .conn-tile-meta .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.conn-tile.pending .btn { text-align: center; }
[dir="rtl"] .conn-tile-foot { text-align: right; }
[dir="rtl"] .menu-list { right: auto; left: 0; }
[dir="rtl"] .menu-list a, [dir="rtl"] .menu-list button { text-align: right; }

.h-captcha { margin: 4px 0 12px; }

/* Admin: compact filter bar and connections table */
.admin-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.admin-filter select { width: auto; min-width: 160px; }
.admin-filter input[type=search] { width: auto; min-width: 280px; flex: 0 1 320px; }
.table .nowrap { white-space: nowrap; }
.admin-conn td { vertical-align: top; }
.acct-list { margin-top: 4px; }
.acct-list > summary { cursor: pointer; color: var(--link); font-size: 0.82rem; list-style: none; }
.acct-list > summary::-webkit-details-marker { display: none; }
.acct-list[open] > summary { margin-bottom: 4px; }
.acct-list div { padding: 2px 0; }
.admin-conn td:nth-child(3) { min-width: 150px; }
.admin-conn td:nth-child(4) { min-width: 190px; }
.err-short { color: var(--err-fg); max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }

/* persona pages (/for/...) */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.persona-closing { margin: 0 0 28px; }
.persona-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.persona-switch a { border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--surface); }
.persona-switch a:hover { border-color: var(--teal); color: var(--teal-dark); }
.footer-for { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.footer-for-label { color: var(--muted); opacity: 0.8; }
