/* Shared foundation for the public site, the customer dashboard and the admin panel.
   Fonts are self-hosted (no third-party requests, works under CSP default-src 'self'). The admin panel picks
   the text and heading fonts (app/core/fonts.py); browsers only download the files a page uses.
   Font files: SIL Open Font License, see /static/fonts/<family>/OFL.txt
   The @font-face block below is generated by app.core.fonts.face_css("../fonts/"); a test keeps them in sync. */

/* fonts:start */
@font-face{font-family:"Tajawal";font-style:normal;font-weight:400;font-display:swap;src:url("../fonts/tajawal/tajawal-400.woff2") format("woff2")}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:500;font-display:swap;src:url("../fonts/tajawal/tajawal-500.woff2") format("woff2")}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:600 700;font-display:swap;src:url("../fonts/tajawal/tajawal-700.woff2") format("woff2")}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:800 900;font-display:swap;src:url("../fonts/tajawal/tajawal-800.woff2") format("woff2")}
@font-face{font-family:"Rubik";font-style:normal;font-weight:300 900;font-display:swap;src:url("../fonts/rubik/rubik-var.woff2") format("woff2")}
@font-face{font-family:"Readex Pro";font-style:normal;font-weight:160 700;font-display:swap;src:url("../fonts/readex-pro/readex-pro-var.woff2") format("woff2")}
@font-face{font-family:"Zain";font-style:normal;font-weight:300;font-display:swap;src:url("../fonts/zain/zain-300.woff2") format("woff2")}
@font-face{font-family:"Zain";font-style:normal;font-weight:400 500;font-display:swap;src:url("../fonts/zain/zain-400.woff2") format("woff2")}
@font-face{font-family:"Zain";font-style:normal;font-weight:600 700;font-display:swap;src:url("../fonts/zain/zain-700.woff2") format("woff2")}
@font-face{font-family:"Zain";font-style:normal;font-weight:800;font-display:swap;src:url("../fonts/zain/zain-800.woff2") format("woff2")}
@font-face{font-family:"Zain";font-style:normal;font-weight:900;font-display:swap;src:url("../fonts/zain/zain-900.woff2") format("woff2")}
@font-face{font-family:"Aref Ruqaa Ink";font-style:normal;font-weight:300 500;font-display:swap;src:url("../fonts/aref-ruqaa-ink/aref-ruqaa-ink-400.woff2") format("woff2")}
@font-face{font-family:"Aref Ruqaa Ink";font-style:normal;font-weight:600 900;font-display:swap;src:url("../fonts/aref-ruqaa-ink/aref-ruqaa-ink-700.woff2") format("woff2")}
/* fonts:end */

:root {
  --app-font: "Tajawal", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  --heading-font: var(--app-font);
  --bs-font-sans-serif: var(--app-font);
  --bs-body-font-family: var(--app-font);
  --bs-body-line-height: 1.7;

  /* «عنك» identity (from the logo): emerald green for actions, deep green for text and dark surfaces, mint for
     highlights on dark backgrounds, and pale mint tints for backgrounds. White on --brand reads at 5.3:1 (AA). */
  --brand: #087a5c;
  --brand-hover: #066b52;
  --brand-ink: #066b52;
  --brand-soft: #e8f6f0;
  --on-brand: #ffffff;
  --mint: #19c79a;
  --charcoal: #0b3b32;
  --dark: #062a24;
  --beige: #e3f4ee;
  --ivory: #f5faf8;
  --ink: #0b3b32;
  --muted: #6b7280;
  --surface: #f5faf8;
  --line: #e5e7eb;
  --success: #2f855a;

  --bs-primary: var(--brand);
  --bs-primary-rgb: 8, 122, 92;
  --bs-success: var(--success);
  --bs-success-rgb: 47, 133, 90;
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-ink);
  --bs-link-color-rgb: 8, 122, 92;
  --bs-link-hover-color-rgb: 6, 107, 82;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
}

/* Every text element, including form controls and Bootstrap overlays, uses Tajawal.
   Code and SQL previews keep a monospace font so columns line up. */
html,
body,
button,
input,
select,
textarea,
optgroup,
.btn,
.form-control,
.form-select,
.dropdown-menu,
.tooltip,
.popover,
.toast,
.modal {
  font-family: var(--app-font);
}

body {
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .fw-heavy { font-weight: 800; letter-spacing: 0; }
h5, h6 { font-weight: 700; }
.text-muted-ink { color: var(--muted); }

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-bg: var(--brand-hover);
  --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-color: var(--on-brand);
  --bs-btn-hover-color: var(--on-brand);
  --bs-btn-active-color: var(--on-brand);
  --bs-btn-disabled-color: var(--on-brand);
  font-weight: 700;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-ink);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-hover-color: var(--on-brand);
  --bs-btn-active-bg: var(--brand-hover);
  --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-active-color: var(--on-brand);
  font-weight: 700;
}
.btn { padding-inline: 1.15rem; border-radius: .6rem; }
.card { border-color: var(--line); border-radius: .9rem; }
.accordion {
  --bs-accordion-active-bg: var(--brand-soft);
  --bs-accordion-active-color: var(--brand-ink);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 30%, transparent);
  --bs-accordion-btn-active-icon: var(--bs-accordion-btn-icon);
  --bs-accordion-border-color: var(--line);
}
.accordion-button { font-weight: 700; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ---------- Public site ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.brand-mark { font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand-mark span { color: var(--brand); }
.hero { background: #fff; border-bottom: 1px solid var(--line); padding-block: 5rem 4rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.35; }
.hero .lead { color: var(--muted); max-width: 38rem; font-size: 1.2rem; }
.hero-panel {
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff);
  border-radius: 1.1rem;
  padding: 1.25rem;
}
.chat-bubble { border-radius: 1rem; padding: .7rem 1rem; max-width: 85%; font-size: .98rem; }
.chat-bubble.from-visitor { background: #fff; border: 1px solid var(--line); margin-inline-start: auto; }
.chat-bubble.from-bot { background: var(--brand); color: var(--on-brand); }
.feature-icon {
  width: 2.75rem; height: 2.75rem; border-radius: .75rem;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 800;
}
.plan-card.featured { border: 2px solid var(--brand); }
.plan-price { font-size: 2.2rem; font-weight: 800; }
.site-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); }

/* ---------- Dashboards (customer and admin share the layout) ---------- */
body:has(.shell) { background: var(--surface); }
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.shell-nav {
  background: #fff; border-inline-end: 1px solid var(--line); padding: 1.1rem .85rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin;
}
.shell-nav .brand-mark { font-size: 1.15rem; line-height: 1.45; }
.shell-nav .nav-link {
  position: relative; color: #33454d; border-radius: .55rem; padding: .48rem .7rem; font-weight: 500; font-size: .95rem;
}
.shell-nav .nav-link:hover { background: var(--surface); color: var(--ink); }
.shell-nav .nav-link.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.shell-nav .nav-link.active::before {
  content: ""; position: absolute; inset-inline-start: -.85rem; top: .45rem; bottom: .45rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
[dir="rtl"] .shell-nav .nav-link.active::before { border-radius: 3px 0 0 3px; }
.nav-icon { width: 1.15rem; height: 1.15rem; flex: none; color: #7a8a91; }
.nav-link:hover .nav-icon { color: var(--ink); }
.nav-link.active .nav-icon { color: var(--brand); }
.shell-nav .nav-section { font-size: .74rem; color: #8a979d; font-weight: 700; margin: 1.15rem .7rem .3rem; }
.shell-top {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, #fff 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); padding: .75rem 1.75rem; min-height: 3.6rem;
}
.shell-top h1 { font-weight: 800; font-size: 1.15rem; }
.shell-main { padding: 1.75rem; max-width: 92rem; }
.shell-main > .card, .shell-main section.card, .shell-main .row .card { box-shadow: 0 1px 2px rgba(18, 34, 43, .04); }
.shell-main h2.h6 { font-weight: 800; font-size: 1rem; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-card .stat-label { color: var(--muted); font-size: .88rem; }
.stat-link { transition: border-color .12s; }
.stat-link:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.stat-warn { border-color: #f1d3a6; background: #fffaf2; }
.stat-hero { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.stat-hero .stat-label, .stat-hero .text-muted-ink { color: color-mix(in srgb, #fff 72%, transparent) !important; }
.stat-hero .stat-value { font-size: 2.4rem; }
.shell-main .table > thead th {
  font-size: .8rem; font-weight: 700; color: var(--muted); background: #fafbfb; border-bottom-color: var(--line);
  white-space: nowrap;
}
.shell-main .table > :not(caption) > * > * { padding-block: .7rem; }
.shell-main .table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7faf9; }
.empty-state { border: 1px dashed #cdd6d8; border-radius: .9rem; background: #fff; padding: 2.75rem 1.5rem; text-align: center; }
.empty-state::before {
  content: ""; display: block; width: 3rem; height: 3rem; margin: 0 auto 1rem; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23066b52' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 1.4rem no-repeat;
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }
.nav-pills .nav-link { color: var(--brand-ink); border-radius: .5rem; }
.badge { font-weight: 700; }

/* The admin panel is visibly different, so staff never confuse it with a customer dashboard. */
/* staff panel: slate actions with white text and a green accent, unlike the customer's green dashboard */
.theme-admin { --brand: #1f2937; --brand-hover: #111827; --brand-ink: #1f2937; --brand-soft: #eef1f4; --on-brand: #fff; --bs-primary-rgb: 31, 41, 55; --bs-link-color-rgb: 31, 41, 55; --bs-link-hover-color-rgb: 17, 24, 39; }
.theme-admin .shell-nav .nav-link.active::before { background: #19c79a; }
.admin-ribbon { background: #111827; color: #e5e7eb; font-size: .85rem; font-weight: 700; padding: .35rem 1.75rem; }

.min-w-0 { min-width: 0; }

/* ---------- Sign-in pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 28rem; }
.theme-admin .auth-card { border-top: 4px solid var(--brand); }

/* ---------- Dashboard pieces ---------- */
.step-dot {
  flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.step-dot.done { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.qr-box { width: 12rem; height: 12rem; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; }
.qr-box svg { width: 100%; height: 100%; }
.secret-text { font-size: .95rem; letter-spacing: .08em; word-break: break-all; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.recovery-grid code { background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; padding: .45rem .7rem; font-size: 1rem; color: var(--ink); text-align: center; }
.role-help dt { color: var(--ink); }
.role-help dd { margin-bottom: .5rem; }
.table > :not(caption) > * > * { padding: .75rem 1rem; }
code, pre, kbd, .font-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.nav-toggle { display: none; }
@media (min-width: 861px) { .nav-collapse.collapse:not(.show) { display: flex; } }

/* Disabled buttons keep the brand colour, only faded. */
.btn-primary { --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-disabled-color: var(--brand); --bs-btn-disabled-border-color: var(--brand); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .shell-nav { padding-block: .75rem; }
  .shell { grid-template-columns: 1fr; }
  .shell-nav { border-inline-end: 0; border-bottom: 1px solid var(--line); position: static; height: auto; }
  .shell-main { padding: 1.1rem; }
  .shell-top { padding-inline: 1.1rem; }
}

/* ---------- Printable invoice ---------- */
.invoice-page { background: #eef1f1; }
.invoice-sheet { background: #fff; border: 1px solid var(--line); border-radius: .9rem; padding: 2.5rem; max-width: 56rem; margin-bottom: 3rem; }
.invoice-actions { max-width: 56rem; }
.invoice-qr { width: 8.5rem; flex: 0 0 auto; }
.invoice-qr svg { width: 100%; height: auto; }
.invoice-party { border-bottom: 2px solid var(--brand); padding-bottom: .35rem; }
.invoice-meta th, .invoice-totals th { font-weight: 500; color: var(--muted); padding: .25rem 0 .25rem 1.5rem; }
.invoice-meta td, .invoice-totals td { padding: .25rem 0; font-weight: 700; }
.invoice-lines th { font-size: .85rem; }
.invoice-sheet [lang="en"] { font-size: .78em; color: var(--muted); font-weight: 400; }
.invoice-totals .grand th, .invoice-totals .grand td { border-top: 2px solid var(--ink); padding-top: .5rem; color: var(--ink); font-size: 1.1rem; font-weight: 800; }
@media print {
  @page { size: A4; margin: 14mm; }
  .invoice-page { background: #fff; }
  .invoice-actions { display: none !important; }
  .invoice-sheet { border: 0; padding: 0; max-width: none; margin: 0; }
}

/* ---------- Bots ---------- */
.bot-swatch { width: .9rem; height: .9rem; border-radius: 50%; display: inline-block; }
.model-notes li { margin-bottom: .4rem; color: var(--muted); }
.model-notes strong { color: var(--ink); font-weight: 700; }
.chat-card { overflow: hidden; display: flex; flex-direction: column; height: min(72vh, 44rem); }
.chat-head { background: var(--bot-color, var(--brand)); color: #fff; padding: .85rem 1.1rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--surface); }
.chat-msg { max-width: 82%; padding: .6rem .9rem; border-radius: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.chat-msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-start-start-radius: .3rem; }
.chat-msg.visitor { background: var(--charcoal, #0b3b32); color: #fff; align-self: flex-end; border-start-end-radius: .3rem; }
.chat-msg.error { background: #fdecea; color: #8a1c1c; border: 1px solid #f5c2c0; align-self: center; font-size: .9rem; }
.chat-msg.typing { color: var(--muted); letter-spacing: .2em; }
.chat-input { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); background: #fff; }
.chat-input textarea { resize: none; }
.chat-meta { padding: 0 1rem .6rem; background: #fff; min-height: 1.6rem; }
.prompt-preview { white-space: pre-wrap; font-size: .78rem; background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; padding: .8rem; max-height: 22rem; overflow: auto; text-align: left; }
details > summary { cursor: pointer; }

/* Query builder */
.qb-step { display: flex; align-items: center; gap: .5rem; }
.qb-step span svg { width: .95rem; height: .95rem; }
.qb-step span { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand, #087a5c); color: var(--on-brand, #0b3b32); font-size: .8rem; align-items: center; justify-content: center; }
.qb-row { border-bottom: 1px dashed var(--line, #e5e7eb); padding-bottom: .5rem; }
.qb-preview { max-height: 22rem; overflow: auto; }
details > summary { cursor: pointer; }
.text-pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Simple bar charts (admin reports): CSS only, no scripts */
.bar-row { display: grid; grid-template-columns: 4.5rem 1fr 7rem; align-items: center; gap: .6rem; margin-bottom: .35rem; font-size: .85rem; }
.bar-label { color: var(--muted, #6b7280); direction: ltr; text-align: start; }
.bar-track { background: var(--surface, #f3f5f5); border-radius: .3rem; height: .9rem; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--brand, #087a5c); border-radius: .3rem; min-width: 2px; }
.bar-alt { background: #8a5a12; }
.bar-alt2 { background: #3a6ea5; }
.bar-value { font-variant-numeric: tabular-nums; }

/* Plans (admin) */
.plan-card { display: flex; flex-direction: column; }
.plan-card-highlight { border: 2px solid var(--brand, #087a5c); box-shadow: 0 6px 24px rgba(8, 122, 92, .16); }
.plan-limits li { padding: .2rem 0; border-bottom: 1px dashed var(--bs-border-color, #e3e8e8); }
.plan-limits li:last-child { border-bottom: 0; }

/* Platform identity (admin panel: Identity and contact) */
.brand-logo { max-height: 40px; max-width: 180px; object-fit: contain; display: block; }
.auth-card .brand-logo { max-height: 52px; }
.nav-help { margin: 1.5rem .5rem 0; padding: .9rem 1rem; border-radius: .75rem; background: var(--brand-soft); color: var(--ink); }
.nav-help a { color: var(--brand-ink); text-decoration: none; }
.brand-swatch { width: 2.5rem; height: 2.5rem; border-radius: .5rem; border: 1px solid var(--line); flex: none; }

/* ---- charts (statistics page): thin marks, recessive grid, one accent ---- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--app-font); }
@media (max-width: 575.98px) { .chart { overflow-x: auto; } .chart svg { min-width: 520px; } }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: #c9d2d4; stroke-width: 1; }
.chart .tick, .chart .xlabel { fill: var(--muted); font-size: 11px; }
.chart .value-label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .bar { fill: var(--brand); transition: fill .12s; }
.chart .hit { fill: transparent; }
.chart .col:hover .bar { fill: var(--brand-ink); }
.chart .col:hover .hit { fill: rgba(18, 34, 43, .04); }
.chart .ref { stroke: #92400e; stroke-width: 1.5; }
.chart .ref-label { fill: #92400e; font-size: 11px; font-weight: 700; }
.chart-empty { position: absolute; inset: 0 0 26px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; pointer-events: none; }
.chart-tip { position: fixed; z-index: 1080; pointer-events: none; background: var(--ink); color: #fff; font-size: .82rem; padding: .3rem .6rem; border-radius: .5rem; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.chart-tip[hidden] { display: none; }
.meter { height: .55rem; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--brand); }
.meter-warning { background: #fdf0d5; } .meter-warning .meter-fill { background: #d97706; }
.meter-danger { background: #fbe0de; } .meter-danger .meter-fill { background: #c0392b; }
.share { height: .45rem; border-radius: 99px; background: var(--brand-soft); overflow: hidden; margin: .25rem 0 .6rem; min-width: 60px; }
.share-fill { height: 100%; border-radius: 99px; background: var(--brand); }
td .share { margin: 0; flex: 1 1 auto; }
.trend { font-weight: 700; color: var(--ink); }
.trend span[aria-hidden] { font-size: .7em; }
.trend.up span[aria-hidden] { color: var(--brand); } .trend.down span[aria-hidden] { color: #b45309; }

/* ---------- Sign-in pages: a quiet brand panel beside the form on wide screens ---------- */
.auth-page { background: var(--surface); }
.auth-split { display: grid; grid-template-columns: minmax(20rem, 34rem) 1fr; min-height: 100vh; }
.auth-split .auth-wrap { min-height: 100vh; }
.auth-side {
  background: var(--dark, #062a24); color: #f5faf8;
  padding: 2.25rem 2.5rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.auth-side .brand-mark, .auth-side .brand-mark span { color: #fff; }
.auth-side-body { margin-block: auto; }
.auth-side-title { font-size: 1.7rem; font-weight: 800; line-height: 1.5; color: #fff; max-width: 18ch; }
.auth-side-chat { display: flex; flex-direction: column; gap: .6rem; margin: 2rem 0; max-width: 24rem; }
.auth-side-chat .msg { margin: 0; padding: .6rem .9rem; border-radius: 1rem; max-width: 88%; line-height: 1.7; font-size: .95rem; }
.auth-side-chat .me { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-end-end-radius: .3rem; }
.auth-side-chat .bot { align-self: flex-start; background: #fff; color: var(--ink); border-end-start-radius: .3rem; }
.auth-side-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; color: color-mix(in srgb, #fff 80%, transparent); }
.auth-side-points li { display: flex; align-items: center; gap: .55rem; }
.auth-side .check-icon { width: 1.1rem; height: 1.1rem; color: #5fe0b8; stroke-width: 2.4; }
@media (max-width: 960px) { .auth-split { grid-template-columns: 1fr; } .auth-side { display: none; } }
.auth-split:not(:has(.auth-side)) { grid-template-columns: 1fr; }

/* Headings use the heading font chosen in the admin panel (the text font unless set). */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .brand-mark, .stat-value, .plan-cost strong, .auth-side-title {
  font-family: var(--heading-font);
}
/* Font picker (admin, identity page) */
.font-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem; }
.font-option { display: grid; gap: .2rem; border: 1px solid var(--line); border-radius: .75rem; padding: .75rem .9rem; cursor: pointer; position: relative; background: #fff; }
.font-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.font-option input { position: absolute; top: .8rem; inset-inline-end: .8rem; }
.font-sample { font-size: 1.3rem; line-height: 1.6; color: var(--ink); padding-inline-end: 1.5rem; }

/* ---------- 3anak logo ---------- */
.brand-logo { display: block; height: 2.5rem; width: auto; }
.shell-nav .brand-logo { height: 2.4rem; }
.auth-card .brand-logo { height: 2.8rem; margin-bottom: .25rem; }
.brand-mark:has(.brand-logo) { display: inline-flex; align-items: center; }
.brand-icon { width: 1.75rem; height: 1.75rem; vertical-align: -.45rem; margin-inline-end: .45rem; }
.text-brand { color: var(--brand-ink) !important; }
.bg-beige { background: var(--beige) !important; }

/* ---------- illustrated guides (cPanel, assisted setup) ---------- */
.cp-guide { background: #fff; border: 1px solid var(--line); border-radius: .9rem; padding: 1.5rem; margin-top: 1.5rem; }
.cp-steps { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); gap: 1rem; counter-reset: cp; }
.cp-step { counter-increment: cp; background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; padding: .85rem; }
.cp-step svg { display: block; width: 100%; height: auto; border-radius: .55rem; }
.cp-step h3 { font-size: .98rem; font-weight: 800; margin: .8rem 0 .3rem; display: flex; gap: .5rem; align-items: center; }
.cp-step h3::before { content: counter(cp); flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font-size: .82rem; }
.cp-step p { font-size: .88rem; color: #374151; line-height: 1.8; margin: 0; }
.setup-track { display: flex; gap: .5rem; align-items: center; margin: .75rem 0 1rem; flex-wrap: wrap; }
.setup-track span { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
.setup-track span::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: var(--line); }
.setup-track span.on { color: var(--ink); font-weight: 700; }
.setup-track span.on::before { background: var(--brand); }
.setup-track i { flex: 0 0 1.5rem; height: 2px; background: var(--line); }
.cipher { direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; background: #062a24; color: #8fe0c6;
  border-radius: .6rem; padding: .7rem .9rem; word-break: break-all; margin: 0; }
.assure { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.assure li { display: flex; gap: .6rem; font-size: .9rem; line-height: 1.75; }
.assure .nav-icon { color: var(--brand-ink); margin-top: .25rem; }

/* switches and checkboxes in the identity colours (Bootstrap's default is blue) */
.form-check-input:checked { background-color: var(--charcoal, #0b3b32); border-color: var(--charcoal, #0b3b32); }
.form-check-input:focus { border-color: var(--brand, #087a5c); box-shadow: 0 0 0 .2rem rgba(8, 122, 92, .25); }

/* bot kind choice */
.kind-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.kind-option { display: flex; gap: .6rem; align-items: flex-start; border: 1.5px solid var(--line, #e5e7eb); border-radius: 12px; padding: .8rem .9rem; cursor: pointer; }
.kind-option:has(input:checked) { border-color: var(--brand, #087a5c); background: #effaf6; }
.kind-option span { display: flex; flex-direction: column; gap: .2rem; }
.kind-option small { color: var(--muted, #6b7280); line-height: 1.6; }
@media (max-width: 640px) { .kind-choice { grid-template-columns: 1fr; } }

/* live chat */
.live-toggle { display: flex; align-items: center; gap: .5rem; }
.live-switch { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line, #e5e7eb); background: #fff;
  border-radius: 999px; padding: .28rem .8rem; font-size: .85rem; color: var(--muted, #6b7280); cursor: pointer; }
.live-switch .live-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #9ca3af; }
.live-switch[aria-pressed="true"] { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; font-weight: 700; }
.live-switch[aria-pressed="true"] .live-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.live-waiting { background: var(--brand, #087a5c); color: var(--on-brand, #0b3b32); border-radius: 999px; padding: .25rem .75rem;
  font-size: .82rem; font-weight: 700; text-decoration: none; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 6px rgba(8, 122, 92, .25); } }
@media (prefers-reduced-motion: reduce) { .live-waiting { animation: none; } }
.chat-msg.guest { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-start-start-radius: .3rem; }
.chat-msg.agent { background: var(--charcoal, #0b3b32); color: #fff; align-self: flex-end; border-start-end-radius: .3rem; }
.chat-msg.system { align-self: center; background: transparent; color: var(--muted, #6b7280); font-size: .82rem; padding: .1rem .5rem; }
.handoff-transcript { display: flex; flex-direction: column; gap: .4rem; max-height: 420px; overflow-y: auto; background: var(--ivory, #f5faf8); border-radius: 12px; padding: .75rem; }
