@import url("https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600&display=swap");

/* ARK brand */
:root {
  --orange: #ffaa00;
  --orange-soft: #fff8eb;
  --orange-line: #d9b46a;
  --charcoal: #373737;
  --charcoal-2: #4b4b4b;
  --bg: #f5f4f1;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #5c5c5c;
  --line: #e6e4df;
  --ok: #2e8b57;
  --err: #a5322a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Jost, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 16px; }
a { color: var(--charcoal); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.btn-primary { background: var(--orange); color: var(--text); border: 0; border-radius: 999px; padding: 13px 24px; font-weight: 600; font-size: 15px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-primary:hover { background: #f0a000; }
.btn-soft { background: var(--bg); border: 0; border-radius: 999px; padding: 8px 14px; font-size: 14px; min-height: 36px; color: var(--text); }
.btn-soft:hover { background: #ebe9e4; }
.btn-danger { background: transparent; border: 1px solid #e3c7c3; color: var(--err); border-radius: 999px; padding: 8px 14px; font-size: 14px; min-height: 36px; }
.btn-danger:hover { background: #fbefed; }
.input { background: #fff; border: 1.5px solid #dcd9d2; border-radius: 14px; padding: 13px 16px; font: inherit; font-size: 16px; color: var(--text); width: 100%; }
.input:focus { outline: none; border-color: var(--orange); }

/* ---------- Sign-in ---------- */
.signin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.signin-brand { flex: 1 1 480px; background: var(--charcoal); color: #fff; padding: 48px 64px; display: flex; flex-direction: column; gap: 28px; position: relative; overflow: hidden; }
.signin-brand .logo { height: 40px; width: auto; align-self: flex-start; }
.signin-copy { max-width: 460px; margin-top: 8px; display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 1; }
.overline { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--orange); font-weight: 500; }
.signin-copy h1 { margin: 0; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; font-weight: 300; }
.signin-copy p { margin: 0; font-size: 17px; line-height: 1.6; color: #dedede; }
.signin-brand .bot-big { position: absolute; right: -30px; bottom: -40px; width: 260px; height: 260px; }
.signin-foot { font-size: 14px; color: #bdbdbd; position: relative; z-index: 1; }
.signin-form-wrap { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 56px 32px; }
.signin-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.signin-form h2 { margin: 0; font-size: 34px; font-weight: 400; color: var(--charcoal); }
.signin-form p { margin: 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 500; color: var(--charcoal); }
.form-error { color: var(--err); font-size: 14px; min-height: 20px; }

/* ---------- Admin ---------- */
.admin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 240px; background: var(--charcoal); color: #fff; padding: 32px 24px; display: flex; flex-direction: column; gap: 32px; }
.sidebar .logo { height: 30px; width: auto; align-self: flex-start; }
.sidebar .brand-sub { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #d4d4d4; font-weight: 500; margin-top: 10px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 999px; color: #f0f0f0; text-decoration: none; font-size: 15px; }
.nav a:hover { background: var(--charcoal-2); }
.nav a.active { background: var(--orange); color: var(--charcoal); font-weight: 600; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 16px; }
.engine { background: var(--charcoal-2); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.engine .lbl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #d4d4d4; }
.engine .val { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #9a9a9a; }
.dot.on { background: #5fd38d; } .dot.off { background: #ff6b5e; }
.logout { background: transparent; border: 1px solid #6a6a6a; color: #f0f0f0; border-radius: 999px; padding: 12px 16px; font-size: 15px; min-height: 44px; }
.logout:hover { background: var(--charcoal-2); }

.content { flex: 999 1 560px; min-width: 0; padding: 40px 48px; display: flex; flex-direction: column; gap: 28px; max-width: 1240px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head .kicker { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #6b6b6b; font-weight: 500; }
.page-head h1 { margin: 6px 0; font-size: 40px; font-weight: 400; color: var(--charcoal); letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stat { background: var(--card); border-radius: 20px; padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.stat .lbl { color: #6b6b6b; font-size: 14px; }
.stat .val { font-size: 38px; font-weight: 500; color: var(--charcoal); }
.stat.dark { background: var(--charcoal); color: #fff; }
.stat.dark .lbl { color: #d4d4d4; }
.stat.dark .val { color: #fff; font-size: 22px; margin-top: 10px; }

.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.card { background: var(--card); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 500; color: var(--charcoal); }
.card .sub { margin: 0; color: var(--muted); font-size: 15px; }
.upload-card { flex: 3 1 420px; }
.drop { border: 2px dashed var(--orange-line); background: var(--orange-soft); border-radius: 18px; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { background: #ffefcc; border-color: var(--orange); }
.drop .circle { width: 56px; height: 56px; border-radius: 50%; background: var(--orange); display: flex; align-items: center; justify-content: center; color: var(--charcoal); }
.drop .big { font-size: 17px; font-weight: 500; color: var(--charcoal); }
.drop .small { font-size: 14px; color: var(--muted); }
.queue { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.qitem { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.qitem .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem .state { color: var(--muted); }
.qicon { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.qicon.ok { background: var(--ok); } .qicon.err { background: var(--err); }
.qicon.busy { border: 3px solid var(--orange); border-right-color: #e9e4da; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.test-card { flex: 2 1 320px; background: var(--charcoal); color: #fff; }
.test-card h2 { color: #fff; margin: 0; }
.test-head { display: flex; align-items: center; gap: 14px; }
.test-head .sub { color: #d4d4d4; font-size: 14px; }
.test-out { background: var(--charcoal-2); border-radius: 16px 16px 16px 4px; padding: 14px 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; min-height: 80px; }
.test-out .src { margin-top: 10px; padding-top: 8px; border-top: 1px solid #5e5e5e; font-size: 13px; color: #d4d4d4; }
.test-form { display: flex; gap: 8px; margin-top: auto; }
.test-form input { flex: 1; min-width: 0; background: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-size: 15px; color: var(--text); }

.lib-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 999px; padding: 10px 16px; min-width: 240px; }
.search input { border: 0; background: transparent; font: inherit; font-size: 15px; flex: 1; outline: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
th { text-align: left; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 8px; font-weight: 500; border-bottom: 1px solid var(--line); }
td { padding: 14px 8px; border-bottom: 1px solid #efede8; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: var(--charcoal); color: #fff; margin-right: 10px; }
.tag.alt { background: var(--orange); color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .content { padding: 28px 20px; }
  .signin-brand { padding: 40px 28px; }
}

/* ---------- Chat ---------- */
.chat-page { min-height: 100vh; display: flex; flex-direction: column; }
.chat-header { background: var(--charcoal); color: #fff; padding: 18px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.chat-header .left { display: flex; align-items: center; gap: 16px; }
.chat-header .logo { height: 28px; width: auto; }
.chat-header .divider { width: 1px; height: 24px; background: #6a6a6a; }
.chat-header .title { font-size: 17px; color: #f0f0f0; }
.chat-header .status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #dedede; }
.chat-main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 32px 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.welcome { background: var(--card); border-radius: 24px; padding: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.welcome > div:not(.bot-stage) { flex: 1 1 320px; }
.welcome h1 { margin: 0 0 6px; font-size: 32px; font-weight: 400; color: var(--charcoal); }
.welcome p { margin: 0; line-height: 1.55; color: var(--muted); }
.messages { flex: 1; display: flex; flex-direction: column; gap: 14px; min-height: 200px; }
.msg { max-width: 78%; padding: 13px 18px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--charcoal); color: #fff; border-radius: 20px 20px 4px 20px; }
.bot-row { align-self: flex-start; max-width: 78%; display: flex; gap: 10px; align-items: flex-end; }
.bot-row .avatar { width: 34px; height: 34px; flex: none; }
.msg.bot { background: var(--card); border-radius: 20px 20px 20px 4px; max-width: 100%; }
.msg .src { margin-top: 10px; padding-top: 8px; border-top: 1px solid #ece9e3; font-size: 13px; color: var(--muted); }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; background: #b8b2a6; border-radius: 50%; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: #fff; border: 1.5px solid #ead9b5; color: var(--charcoal); border-radius: 999px; padding: 10px 18px; font-size: 15px; min-height: 44px; }
.chip:hover { background: var(--orange-soft); border-color: var(--orange); }
.composer { display: flex; gap: 10px; background: #fff; border-radius: 999px; padding: 8px 8px 8px 24px; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(55,55,55,.08); }
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--text); padding: 10px 0; outline: none; }
.send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--orange); color: var(--text); display: flex; align-items: center; justify-content: center; flex: none; }
.send:hover { background: #f0a000; }
.foot-note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Motion ---------- */
@keyframes ark-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes ark-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.12); } }
@keyframes ark-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(var(--dx, 8px), var(--dy, -10px)) rotate(var(--r, 45deg)); }
}
@keyframes ark-orbit { to { transform: rotate(360deg); } }
@keyframes ark-glow { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .7; transform: scale(1.08); } }
@keyframes ark-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ark-think { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.bot-stage { position: relative; display: grid; place-items: center; flex: none; }
.bot-stage .glow { position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, rgba(255,170,0,.45), rgba(255,170,0,0) 70%); animation: ark-glow 4s ease-in-out infinite; }
.bot-stage .ring { position: absolute; border-radius: 50%; border: 1.5px dashed rgba(255,170,0,.55); animation: ark-orbit 18s linear infinite; }
.bot-stage .ring::after { content: ""; position: absolute; top: -5px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--orange); }
.bot-stage .ring.r2 { border-color: rgba(255,255,255,.22); border-style: solid; animation-duration: 26s; animation-direction: reverse; }
.bot-stage .ring.r2::after { background: #ffffff; width: 7px; height: 7px; margin-left: -3.5px; top: -4px; }
.bot-stage .bot { position: relative; animation: ark-float 4s ease-in-out infinite; filter: drop-shadow(0 10px 14px rgba(0,0,0,.18)); }
.bot-eyes { transform-box: fill-box; transform-origin: center; animation: ark-blink 5s infinite; }
.shape { position: absolute; display: block; animation: ark-drift var(--t, 9s) ease-in-out infinite; animation-delay: var(--d, 0s); }
.shape.c { border-radius: 50%; }
.shape.s { border-radius: 4px; }
.shape.t { width: 0 !important; height: 0 !important; background: none !important; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--tc, #ffaa00); }

/* sizes */
.welcome .bot-stage { width: 132px; height: 132px; }
.welcome .bot-stage .ring { inset: 4px; }
.welcome .bot-stage .ring.r2 { inset: -6px; }
.signin-brand .bot-stage { width: 210px; height: 210px; align-self: center; margin-top: auto; }
.signin-brand .bot-stage .ring { inset: 30px; }
.signin-brand .bot-stage .ring.r2 { inset: 0; }
.test-head .bot-stage { width: 60px; height: 60px; }

/* chat motion */
.msg.user, .bot-row { animation: ark-in .35s ease-out both; }
.welcome { animation: ark-in .5s ease-out both; }
.chip { transition: transform .15s, background .15s, border-color .15s; }
.chip:hover { transform: translateY(-2px); }
.send, .btn-primary { transition: transform .15s, background .15s; }
.send:hover, .btn-primary:hover { transform: translateY(-1px); }
.avatar.thinking .bot-eyes { animation: ark-think 1s ease-in-out infinite; }
.stat, .card { animation: ark-in .45s ease-out backwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Language, feedback, embed ---------- */
html[lang="ar"] body, [lang="ar"] { font-family: Jost, "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
.chat-header .right { display: flex; align-items: center; gap: 16px; }
.lang-btn { background: transparent; border: 1px solid #6a6a6a; color: #fff; border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: 14px; font-family: Jost, "IBM Plex Sans Arabic", sans-serif; }
.lang-btn:hover { background: var(--charcoal-2); border-color: var(--orange); }
.msg.user { border-radius: 20px; border-end-end-radius: 4px; }
.msg.bot { border-radius: 20px; border-end-start-radius: 4px; }
html[dir="rtl"] .send svg { transform: scaleX(-1); }
.feedback { margin-top: 10px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.feedback span { margin-inline-end: 4px; }
.fb-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.fb-btn:hover { border-color: var(--orange); color: var(--charcoal); background: var(--orange-soft); }
.feedback.done { color: var(--ok); }

/* embed (inside the website chat bubble) */
body.embed { background: var(--bg); }
.embed .chat-page { height: 100vh; min-height: 0; }
.embed .chat-header { padding: 12px 16px; }
.embed .chat-header .logo { height: 22px; }
.embed .chat-header .status { display: none; }
.embed .chat-main { padding: 14px 14px 12px; gap: 12px; overflow: hidden; min-height: 0; }
.embed .welcome { padding: 16px; gap: 14px; border-radius: 18px; flex-wrap: nowrap; }
.embed .welcome .bot-stage { width: 72px; height: 72px; }
.embed .welcome .bot-stage svg.bot { width: 56px; height: 56px; }
.embed .welcome .bot-stage .shape { display: none; }
.embed .welcome h1 { font-size: 19px; margin-bottom: 4px; }
.embed .welcome p { font-size: 14px; line-height: 1.45; }
.embed .welcome > div:not(.bot-stage) { flex: 1 1 auto; }
.embed .messages { overflow-y: auto; min-height: 0; padding-inline-end: 2px; }
.embed .msg, .embed .bot-row { max-width: 88%; font-size: 15px; }
.embed .chip { font-size: 14px; padding: 8px 14px; min-height: 40px; }
.embed .foot-note { font-size: 11.5px; }
.embed .composer { padding: 6px 6px 6px 18px; }
.embed .send { width: 42px; height: 42px; }

/* ---------- Insights ---------- */
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat .hint { font-size: 13px; color: var(--muted); }
@media (max-width: 1000px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.range { display: flex; gap: 6px; background: #fff; padding: 5px; border-radius: 999px; }
.range-btn { border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; font-size: 14px; color: var(--text); min-height: 38px; }
.range-btn.active { background: var(--charcoal); color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-top: 10px; overflow-x: auto; }
.bar-col { flex: 1 0 28px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar { width: 100%; max-width: 38px; background: var(--orange); border-radius: 8px 8px 3px 3px; transition: height .4s ease; }
.bar-col:hover .bar { background: #e69900; }
.bar-n { font-size: 12px; color: var(--muted); min-height: 15px; }
.bar-l { font-size: 11px; color: var(--muted); white-space: nowrap; }
.qlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: q; }
.qlist li { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: 12px; padding: 11px 14px; font-size: 15px; }
ol.qlist li::before { counter-increment: q; content: counter(q); width: 24px; height: 24px; border-radius: 50%; background: var(--charcoal); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.qlist .qtext { flex: 1; min-width: 0; }
.qlist .qcount { color: var(--muted); font-size: 13px; white-space: nowrap; }
.qlist .empty-li { color: var(--muted); background: transparent; padding-inline: 0; }
ol.qlist .empty-li::before { display: none; }
.attention .qlist li { background: var(--orange-soft); }

/* =========================================================
   Premium dark chat
   ========================================================= */
body.chat-dark { background: #1d1d1d; color: #f2f2f2; }
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 50% -10%, #424242 0%, #2a2a2a 42%, #1b1b1b 100%); }
.bg-fx .blob { position: absolute; border-radius: 50%; filter: blur(70px); animation: ark-blob 22s ease-in-out infinite; }
.bg-fx .b1 { width: 460px; height: 460px; background: #ffaa00; opacity: .20; top: -120px; left: -80px; }
.bg-fx .b2 { width: 520px; height: 520px; background: #ff8a00; opacity: .12; bottom: -180px; right: -120px; animation-delay: -8s; animation-duration: 28s; }
.bg-fx .b3 { width: 360px; height: 360px; background: #ffffff; opacity: .05; top: 40%; left: 45%; animation-delay: -14s; animation-duration: 32s; }
.bg-fx .grid-glow { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.2px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%); }
@keyframes ark-blob { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(60px, 40px) scale(1.08); } 66% { transform: translate(-40px, 30px) scale(.95); } }
.chat-dark .chat-page { position: relative; z-index: 1; }

/* header */
.chat-dark .chat-header { background: rgba(30,30,30,.55); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }

/* hero */
.chat-dark .welcome { background: transparent; flex-direction: column; text-align: center; padding: 36px 0 12px; gap: 18px; transition: padding .5s ease; }
.chat-dark .welcome > div:not(.bot-stage) { flex: none; max-width: 560px; }
.chat-dark .welcome h1 { color: #ffffff; font-size: clamp(30px, 4vw, 46px); font-weight: 300; letter-spacing: -.01em; transition: font-size .5s ease; }
.chat-dark .welcome h1::first-line { color: #fff; }
.chat-dark .welcome p { color: #cfcfcf; font-size: 17px; transition: font-size .5s ease; }
.chat-dark .welcome .bot-stage { width: 240px; height: 240px; transition: width .5s ease, height .5s ease; }
.chat-dark .welcome .bot-stage svg.bot { width: 120px; height: 120px; transition: width .5s ease, height .5s ease; }
.chat-dark .welcome .bot-stage .ring { inset: 34px; border-color: rgba(255,170,0,.5); }
.chat-dark .welcome .bot-stage .ring.r2 { inset: 6px; border-color: rgba(255,255,255,.14); }
.chat-dark .welcome .bot-stage .glow { inset: 22%; background: radial-gradient(circle, rgba(255,170,0,.55), rgba(255,170,0,0) 70%); }
.holo-orbit { position: absolute; inset: -4px; animation: ark-orbit 24s linear infinite; }
.holo { position: absolute; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  color: var(--orange); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.15); animation: ark-orbit 24s linear infinite reverse; }
.holo.h1 { top: 0; left: 50%; }
.holo.h2 { top: 75%; left: 7%; }
.holo.h3 { top: 75%; left: 93%; }
.welcome .holo-orbit { display: none; }
.chat-dark .welcome .holo-orbit { display: block; }

/* hero compacts once the conversation starts */
.chat-dark.has-chat .welcome { flex-direction: row; text-align: start; padding: 4px 0; gap: 14px; }
.chat-dark.has-chat .welcome .bot-stage { width: 72px; height: 72px; }
.chat-dark.has-chat .welcome .bot-stage svg.bot { width: 54px; height: 54px; }
.chat-dark.has-chat .welcome .holo-orbit, .chat-dark.has-chat .welcome .shape, .chat-dark.has-chat .welcome .ring.r2 { display: none; }
.chat-dark.has-chat .welcome .ring { inset: 2px; }
.chat-dark.has-chat .welcome h1 { font-size: 20px; font-weight: 400; margin-bottom: 2px; }
.chat-dark.has-chat .welcome p { font-size: 14px; }

/* messages */
.chat-dark .msg.user { background: var(--orange); color: #2b2b2b; box-shadow: 0 8px 24px rgba(255,170,0,.18); }
.chat-dark .msg.bot { background: rgba(255,255,255,.07); color: #f2f2f2; border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.chat-dark .msg .src { color: #bdbdbd; border-top-color: rgba(255,255,255,.12); }
.chat-dark .typing span { background: var(--orange); }
.typed::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-inline-start: 2px; vertical-align: -2px; background: var(--orange); animation: ark-caret .8s steps(1) infinite; }
.typed.done::after { display: none; }
@keyframes ark-caret { 50% { opacity: 0; } }
.chat-dark .feedback { color: #bdbdbd; }
.chat-dark .fb-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #e0e0e0; }
.chat-dark .fb-btn:hover { background: rgba(255,170,0,.18); border-color: var(--orange); color: #fff; }
.chat-dark .feedback.done { color: #7ee2a8; }

/* chips + composer */
.chat-dark .chips { justify-content: center; }
.chat-dark.has-chat .chips { justify-content: flex-start; }
.chat-dark .chip { background: rgba(255,255,255,.06); border: 1px solid rgba(255,170,0,.35); color: #f2f2f2; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chat-dark .chip:hover { background: rgba(255,170,0,.16); border-color: var(--orange); box-shadow: 0 0 24px rgba(255,170,0,.25); }
.chat-dark .composer { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 36px rgba(0,0,0,.3); transition: box-shadow .25s, border-color .25s; }
.chat-dark .composer:focus-within { border-color: rgba(255,170,0,.7); box-shadow: 0 0 0 3px rgba(255,170,0,.18), 0 0 40px rgba(255,170,0,.22); }
.chat-dark .composer input { color: #fff; }
.chat-dark .composer input::placeholder { color: #a9a9a9; }
.chat-dark .send { box-shadow: 0 0 20px rgba(255,170,0,.35); }
.chat-dark .foot-note { color: #a8a8a8; }

/* embed (website bubble) in dark */
.embed.chat-dark .welcome { padding: 10px 0 4px; gap: 10px; }
.embed.chat-dark .welcome .bot-stage { width: 130px; height: 130px; }
.embed.chat-dark .welcome .bot-stage svg.bot { width: 70px; height: 70px; }
.embed.chat-dark .welcome .bot-stage .ring { inset: 16px; }
.embed.chat-dark .welcome .bot-stage .ring.r2 { inset: 0; }
.embed.chat-dark .holo { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 9px; }
.embed.chat-dark .holo svg { width: 14px; height: 14px; }
.embed.chat-dark .welcome h1 { font-size: 22px; }
.embed.chat-dark .welcome p { font-size: 14px; }
.embed.chat-dark.has-chat .welcome .bot-stage { width: 52px; height: 52px; }
.embed.chat-dark.has-chat .welcome .bot-stage svg.bot { width: 40px; height: 40px; }
.embed.chat-dark.has-chat .welcome h1 { font-size: 16px; }
.embed.chat-dark.has-chat .welcome p { display: none; }

/* =========================================================
   Admin & sign-in polish
   ========================================================= */
.panel-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.panel-fx .blob { position: absolute; border-radius: 50%; filter: blur(70px); animation: ark-blob 24s ease-in-out infinite; }
.panel-fx .b1 { width: 380px; height: 380px; background: #ffaa00; opacity: .16; top: -100px; right: -80px; }
.panel-fx .b2 { width: 320px; height: 320px; background: #ffffff; opacity: .05; bottom: -80px; left: -60px; animation-delay: -10s; }
.signin-brand > *:not(.panel-fx) { position: relative; z-index: 1; }
.signin-form { animation: ark-in .6s ease-out both; }
.signin-form .input { transition: border-color .2s, box-shadow .2s; }
.signin-form .input:focus { box-shadow: 0 0 0 4px rgba(255,170,0,.18); }

.sidebar .nav a { transition: background .2s, color .2s, transform .2s; }
.sidebar .nav a:not(.active):hover { transform: translateX(3px); }
html[dir="rtl"] .sidebar .nav a:not(.active):hover { transform: translateX(-3px); }
.stat, .card { transition: transform .25s ease, box-shadow .25s ease; }
.stat:hover, .content > .card:hover, .row > .card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(55,55,55,.10); }
.stats .stat:nth-child(2) { animation-delay: .06s; } .stats .stat:nth-child(3) { animation-delay: .12s; } .stats .stat:nth-child(4) { animation-delay: .18s; }
.view-in { animation: ark-in .4s ease-out backwards; }

.drop { position: relative; overflow: hidden; }
.drop::before { content: ""; position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,170,0,.25) 80%, transparent 90%); animation: ark-orbit 6s linear infinite; opacity: 0; transition: opacity .3s; }
.drop:hover::before, .drop.over::before { opacity: 1; }
.drop > * { position: relative; }
.drop .circle { transition: transform .3s; }
.drop:hover .circle, .drop.over .circle { transform: translateY(-4px); animation: ark-float 1.6s ease-in-out infinite; }
.qitem { animation: ark-in .3s ease-out both; }
.qitem.pop .qicon { animation: ark-pop .45s ease-out; }
@keyframes ark-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #faf9f6; }
.bar { transition: height .7s cubic-bezier(.2,.8,.2,1); }
.qlist li { transition: transform .2s; }
.qlist li:hover { transform: translateX(3px); }
.test-card .bot-stage .bot { animation-duration: 3s; }

/* =========================================================
   Fit-to-screen chat layout (no page scrolling)
   ========================================================= */
.chat-dark .chat-page { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
.chat-dark .chat-header { flex: none; padding-top: 14px; padding-bottom: 14px; }
.chat-dark .chat-main { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: clamp(8px, 2vh, 24px) 24px clamp(10px, 2vh, 20px); gap: clamp(8px, 1.6vh, 16px); }
.chat-dark .welcome { flex: none; padding: clamp(4px, 2.5vh, 28px) 0 0; gap: clamp(8px, 1.8vh, 18px); }
.chat-dark .welcome .bot-stage { width: clamp(110px, 25vh, 230px); height: clamp(110px, 25vh, 230px); }
.chat-dark .welcome .bot-stage svg.bot { width: clamp(60px, 12.5vh, 118px); height: clamp(60px, 12.5vh, 118px); }
.chat-dark .welcome .bot-stage .ring { inset: 14%; }
.chat-dark .welcome .bot-stage .ring.r2 { inset: 2%; }
.chat-dark .holo { width: clamp(30px, 4.4vh, 42px); height: clamp(30px, 4.4vh, 42px); margin: calc(clamp(30px, 4.4vh, 42px) / -2) 0 0 calc(clamp(30px, 4.4vh, 42px) / -2); }
.chat-dark .welcome h1 { font-size: clamp(24px, 4.6vh, 44px); margin-bottom: 4px; }
.chat-dark .welcome p { font-size: clamp(14px, 2vh, 17px); }
.chat-dark .messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 4px 2px 2px; scroll-behavior: smooth; }
.chat-dark .chips, .chat-dark .composer, .chat-dark .foot-note { flex: none; }
.chat-dark .foot-note { font-size: 12px; }
/* once chatting, the hero is a slim header row */
.chat-dark.has-chat .welcome { padding: 0; }
.chat-dark.has-chat .welcome .bot-stage { width: 56px; height: 56px; }
.chat-dark.has-chat .welcome .bot-stage svg.bot { width: 44px; height: 44px; }
.chat-dark.has-chat .welcome h1 { font-size: 18px; }
.chat-dark.has-chat .welcome p { font-size: 13px; }
/* very short screens: hide the subtitle and decorations */
@media (max-height: 620px) {
  .chat-dark .welcome p { display: none; }
  .chat-dark .welcome .holo-orbit { display: none; }
}
/* thin dark scrollbar for the conversation */
.chat-dark .messages::-webkit-scrollbar { width: 8px; }
.chat-dark .messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 8px; }
.chat-dark .messages { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }

/* phones: one-line header, chips in one swipeable row, smaller hero */
@media (max-width: 560px) {
  .chat-dark .chat-header { flex-wrap: nowrap; padding: 10px 16px; }
  .chat-dark .chat-header .logo { height: 22px; }
  .chat-dark .chat-header .status span:last-child { display: none; }
  .chat-dark .chat-header .right { gap: 10px; }
  .chat-dark .chat-main { padding: 10px 14px 10px; }
  .chat-dark .welcome .bot-stage { width: clamp(96px, 20vh, 170px); height: clamp(96px, 20vh, 170px); }
  .chat-dark .welcome .bot-stage svg.bot { width: clamp(56px, 10vh, 90px); height: clamp(56px, 10vh, 90px); }
  .chat-dark .welcome h1 { font-size: clamp(22px, 3.8vh, 30px); }
  .chat-dark .welcome p { font-size: 14px; }
  .chat-dark .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; }
  .chat-dark .chips::-webkit-scrollbar { display: none; }
  .chat-dark .chip { flex: none; }
  .chat-dark .foot-note { font-size: 11px; }
  .chat-dark .msg, .chat-dark .bot-row { max-width: 92%; }
}
