/* Bordaar — signed-in app shell (dashboard + admin), Ink look. Design tokens (colours, fonts,
   outlines, hard shadows, --dir) live in theme.css. */
*,*::before,*::after{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased}
html[dir="rtl"] body{font-family:var(--font-fa);line-height:1.85}
h1,h2,h3{margin:0;font-family:var(--font-display);letter-spacing:-.02em;font-weight:800;line-height:1.15;text-wrap:balance}
html[dir="rtl"] h1,html[dir="rtl"] h2,html[dir="rtl"] h3{letter-spacing:0;line-height:1.5;font-family:var(--font-fa);font-weight:800}
p{margin:0} a{color:inherit;text-decoration:none} img{max-width:100%;display:block}
html[dir="rtl"] .en-only{display:none} html[lang="en"] .fa-only{display:none}

/* ── top bar ─────────────────────────────────────────── */
.topbar{position:sticky;top:0;z-index:40;background:color-mix(in srgb, var(--bg) 85%, transparent);backdrop-filter:saturate(160%) blur(12px);border-bottom:1.5px solid var(--panel-bd)}
.topbar-in{max-width:1120px;margin-inline:auto;height:66px;display:flex;align-items:center;gap:16px;padding-inline:24px}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--font-display);font-weight:800;font-size:21px;letter-spacing:-.02em}
html[dir="rtl"] .brand{font-family:var(--font-fa);letter-spacing:0}
.mark{width:30px;height:30px;flex:none;box-sizing:content-box;border:1.5px solid var(--mark-ring);border-radius:23%;background:url("bordaar-mark-ink.svg?v=1") no-repeat center/100% 100% border-box}
.nav{display:flex;gap:6px;margin-inline:auto}
.nav a{padding:8px 15px;border-radius:999px;font-size:14.5px;font-weight:600;color:var(--ink-2);transition:.2s}
.nav a:hover{background:var(--line-soft);color:var(--ink)}
.nav a.active{background:var(--brand-fill);color:var(--brand-fill-fg)}

.who{display:flex;align-items:center;gap:11px}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--accent);color:var(--on-accent);border:1.5px solid var(--outline);display:grid;place-items:center;font-size:14.5px;font-weight:700;flex:none}
.who-meta{display:flex;flex-direction:column;line-height:1.25}
.who-meta b{font-size:14px;font-weight:620}
.who-meta span{font-size:12px;color:var(--muted)}
@media (max-width:640px){.who-meta{display:none}}
@media (max-width:600px){.topbar-in{padding-inline:14px;gap:8px}}
@media (max-width:420px){.brand span:last-child{display:none}}
.pill-role{font-size:11px;font-weight:640;padding:2px 9px;border-radius:999px;text-transform:uppercase;letter-spacing:.04em}
.pill-role.admin{color:var(--on-accent);background:var(--accent);border:1.5px solid var(--outline)}
.pill-role.user{color:var(--muted);background:var(--card);border:1.5px solid var(--line)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:42px;padding-inline:20px;border-radius:999px;font-size:14.5px;font-weight:700;font-family:inherit;border:1.5px solid transparent;cursor:pointer;white-space:nowrap;transition:transform .18s cubic-bezier(.2,.8,.3,1),background .2s,color .2s,border-color .2s}
.btn-primary{background:var(--brand-fill);color:var(--brand-fill-fg);border-color:var(--brand-fill)}
/* "go": the ONE start / next-step action of a page or panel, as the orange pill with black text (white on this
   orange is only 3.8:1). Everything else, every Save included, stays .btn-primary (black): an orange button on
   every card and form would stop meaning "start here". */
.btn-go{background:var(--spark);color:#111111;border-color:var(--spark)}
.btn-go:hover{transform:translateY(-2px)}
.btn-primary:hover{transform:translateY(-2px)}
.btn-ghost{background:transparent;border-color:var(--outline);color:var(--ink)}
.btn-ghost:hover{background:var(--card);transform:translateY(-2px)}
.btn-danger{background:transparent;border-color:var(--danger);color:var(--danger-ink)}
.btn-danger:hover{background:var(--danger-soft);transform:translateY(-1px)}
.btn-sm{height:36px;padding-inline:15px;font-size:13px}
.lang{display:inline-flex;align-items:center;padding:3px;border:1.5px solid var(--outline);background:var(--card);border-radius:999px;gap:2px}
.lang button{font-family:var(--font);font-size:13px;font-weight:700;height:28px;padding-inline:11px;border:0;border-radius:999px;cursor:pointer;background:transparent;color:var(--ink);transition:.2s}
.lang button.on{background:var(--brand-fill);color:var(--brand-fill-fg)}
.theme{display:inline-flex;align-items:center;padding:3px;border:1.5px solid var(--outline);background:var(--card);border-radius:999px}
.theme button{width:28px;height:28px;display:grid;place-items:center;border:0;border-radius:999px;background:transparent;color:var(--ink);cursor:pointer;transition:.2s}
.theme button:hover{color:var(--ink);background:var(--line-soft)}
.theme button svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme .ic-moon{display:none}
:root[data-theme="light"] .theme .ic-sun{display:none}
:root[data-theme="light"] .theme .ic-moon{display:block}

/* ── app shell: sidebar + page ────────────────────────────
   Every signed-in page is now `topbar` + `.shell( aside.sidebar , main.page )`.
   The sidebar's contents are ONE nav model rendered by app.js
   (`SIDEBAR_NAV`), never per-page markup — adding a destination is one entry
   there rather than eight copies across eight files that drift apart.

   A side, not two stylesheets: everything here is written in logical
   properties (inset-inline-start, border-inline-end, padding-inline,
   margin-inline), so the rail sits on the LEFT in `en` and mirrors to the
   RIGHT in `fa` from `html[dir]` alone. The two `translateX` rules in the
   drawer block below are the only physical-direction exception, because
   transform has no logical twin.

   `position:sticky`, not `fixed`: the rail stays in normal flow, so the page
   column is simply what's left of the flex row and nothing has to be offset
   by a hardcoded width. A page that never opts in (no .shell wrapper) is
   completely unaffected — `.page` keeps its own centered max-width. */
:root{--side-w:254px;--side-w-collapsed:70px;--topbar-h:66px;--shell-max:1480px}

.shell{display:flex;align-items:flex-start;max-width:var(--shell-max);margin-inline:auto}
/* The topbar has its own centered container; widen it to the shell's width
   on sidebar pages so the brand sits above the rail instead of floating
   1120px-centered over the middle of it. */
body.has-sidebar .topbar-in{max-width:var(--shell-max)}
.sidebar{
  position:sticky;top:var(--topbar-h);z-index:30;flex:none;
  width:var(--side-w);height:calc(100dvh - var(--topbar-h));
  overflow-y:auto;overscroll-behavior:contain;
  padding:18px 12px 26px;border-inline-end:1.5px solid var(--panel-bd);background:var(--bg);
  transition:width .2s ease;
}
/* Content is start-aligned against the rail rather than centred in the
   leftover space — a gap that opens and closes between the nav and the
   first card as the window resizes reads as a bug. The shell as a whole is
   what centres on an ultra-wide screen (--shell-max above). */
body.has-sidebar .shell > .page{margin-inline:0;max-width:none;padding-inline:34px;flex:1;min-width:0}

.side-head{display:flex;align-items:center;gap:8px;padding:0 4px 12px}
.side-head-label{font-size:11.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;
                 color:var(--muted);padding-inline-start:8px;margin-inline-end:auto;white-space:nowrap}
html[dir="rtl"] .side-head-label{letter-spacing:.02em}
.side-icon-btn{width:32px;height:32px;flex:none;display:grid;place-items:center;border:0;border-radius:9px;
               background:transparent;color:var(--muted);cursor:pointer;transition:.2s}
.side-icon-btn:hover{background:var(--line-soft);color:var(--ink)}
.side-icon-btn svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;
                   stroke-linecap:round;stroke-linejoin:round}

.side-group + .side-group{margin-top:18px}
.side-group-label{font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;
                  color:var(--muted);padding-inline:12px;margin-bottom:6px}
html[dir="rtl"] .side-group-label{letter-spacing:.02em}
/* Buttons and links share one look: a destination on another page is an
   <a> (middle-click, open-in-new-tab, copy link all keep working), while a
   panel switch on THIS page and Sign out are <button>s. Neither should look
   different from the other in the rail. */
.side-link{display:flex;align-items:center;gap:11px;width:100%;padding:9px 12px;border-radius:999px;
           border:0;background:none;font:inherit;font-size:14.5px;font-weight:600;line-height:1.35;
           color:var(--ink-2);text-align:start;cursor:pointer;
           transition:background .18s,color .18s}
.side-link + .side-link{margin-top:2px}
.side-link:hover{background:var(--line-soft);color:var(--ink)}
/* the current page: a gold pill with the navy outline, like the highlighted word on the landing page */
.side-link.active{background:var(--nav-active-bg);color:var(--nav-active-fg);font-weight:700;box-shadow:var(--nav-active-ring)}
.side-link:focus-visible{outline:3px solid var(--kicker);outline-offset:2px}
.side-link svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;
               stroke-linecap:round;stroke-linejoin:round}
.side-link-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* A count after a rail entry (the audit rules' flags). Red for the most serious level, quiet otherwise; hidden in the collapsed rail. */
.side-badge{margin-inline-start:auto;flex:none;min-width:20px;height:20px;padding:0 6px;border-radius:999px;display:inline-grid;place-items:center;
            font-size:11.5px;font-weight:700;background:var(--line-soft);color:var(--ink-2);border:1px solid var(--line)}
.side-badge.s3{background:var(--danger-soft);color:var(--danger-ink);border-color:var(--danger-soft-border)}
body.side-collapsed .side-badge{display:none}
.side-link.danger{color:var(--muted)}
.side-link.danger:hover{background:var(--danger-soft);color:var(--danger-ink)}
/* The product a product-scoped page is currently about (product.html,
   conversations.html, gaps.html, insight.html all carry ?id=). Named, so
   the rail says which product the group below it belongs to. */
.side-context{display:flex;align-items:center;gap:9px;padding:8px 12px;margin-bottom:6px;
              border:1.5px solid var(--panel-bd);border-radius:14px;background:var(--card)}
.side-context .dot{width:8px;height:8px;flex:none;border-radius:50%;background:var(--spark)}
.side-context b{font-size:13.5px;font-weight:640;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── collapsed rail (desktop) ─────────────────────────────
   Icon-only. Labels are removed from the flow rather than hidden with
   visibility, so the 70px rail doesn't keep a 254px-wide text box inside
   it and scroll sideways. `title` carries the label to a tooltip. */
body.side-collapsed .sidebar{width:var(--side-w-collapsed);padding-inline:10px}
body.side-collapsed .side-link-text,
body.side-collapsed .side-head-label,
body.side-collapsed .side-context b{display:none}
body.side-collapsed .side-link{justify-content:center;padding-inline:0}
body.side-collapsed .side-context{justify-content:center;padding-inline:0}
/* A group label can't shrink to an icon, so collapsed mode replaces each
   one with the rule that was implicitly beside it. */
body.side-collapsed .side-group-label{height:1px;margin:14px 8px 10px;padding:0;overflow:hidden;
                                      background:var(--line);color:transparent}
body.side-collapsed .side-head{justify-content:center}

/* ── drawer (small screens) ───────────────────────────────
   Below 980px the rail leaves the flow entirely and becomes an overlay
   opened by the topbar's hamburger, so the page keeps its full width. */
.side-toggle{display:none}
.side-scrim{display:none}
@media (max-width:980px){
  .side-toggle{display:grid;width:38px;height:38px;flex:none;place-items:center;
               border:1.5px solid var(--outline);border-radius:12px;background:var(--card);
               color:var(--ink-2);cursor:pointer}
  .side-toggle svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round}
  .sidebar{position:fixed;top:0;bottom:0;inset-inline-start:0;z-index:80;
           width:min(282px,84vw);height:100dvh;padding-top:16px;
           border-inline-end:1.5px solid var(--outline);box-shadow:none;
           transform:translateX(-100%);transition:transform .24s ease,box-shadow .24s ease}
  html[dir="rtl"] .sidebar{transform:translateX(100%)}
  /* the shadow only while it is open: a closed drawer waits just off-screen and its shadow
     reached back onto the page as a grey smear along the edge */
  body.side-open .sidebar{transform:none;box-shadow:var(--shadow-lg)}
  .side-scrim{display:block;position:fixed;inset:0;z-index:75;background:rgba(18,20,42,.55);
              opacity:0;pointer-events:none;transition:opacity .24s ease}
  body.side-open .side-scrim{opacity:1;pointer-events:auto}
  body.has-sidebar .shell > .page{padding-inline:18px}
  /* Collapsed is a desktop-only preference; the drawer is always full width. */
  body.side-collapsed .sidebar{width:min(282px,84vw);padding-inline:12px}
  body.side-collapsed .side-link-text,
  body.side-collapsed .side-head-label,
  body.side-collapsed .side-context b{display:block}
  body.side-collapsed .side-badge{display:inline-grid}
  body.side-collapsed .side-link,body.side-collapsed .side-context{justify-content:flex-start;padding-inline:12px}
  body.side-collapsed .side-group-label{height:auto;margin:0 0 6px;padding-inline:12px;
                                        background:none;color:var(--muted)}
  body.side-collapsed .side-head{justify-content:flex-start}
}
/* The rail carries its own Sign out, and the topbar now has one control
   more in it than it used to (the hamburger). At 375px that left the
   duplicate topbar button pressed against the right edge with ~3px of
   padding left; the duplicate is what gives way, not the nav. */
@media (max-width:600px){
  body.has-sidebar #logout{display:none}
}

/* ── page ────────────────────────────────────────────── */
.page{max-width:1120px;margin-inline:auto;padding:40px 24px 72px}
.page-head{margin-bottom:30px}
.page-head h1{font-size:clamp(26px,3vw,34px)}
.page-head p{margin-top:9px;color:var(--ink-2);font-size:16px}
.kicker{font-size:12.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--kicker)}
html[dir="rtl"] .kicker{letter-spacing:0;text-transform:none;font-size:13.5px}

.grid{display:grid;gap:20px}
.cards{grid-template-columns:repeat(3,1fr)}
.stats{grid-template-columns:repeat(4,1fr)}
@media (max-width:820px){.cards{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr)}}

.card{background:var(--card);border:1.5px solid var(--panel-bd);border-radius:22px;padding:26px;box-shadow:var(--hard);transition:transform .22s cubic-bezier(.2,.8,.3,1);position:relative;isolation:isolate}
.card.link:hover{transform:translateY(-3px)}
/* Glow only on .card.link (the two clickable nav tiles on dashboard.html —
   Products, Admin) — never on plain .card, which on dashboard.html is a
   static info panel (subscription, usage, payment) that isn't clickable.
   A hover glow there would signal interactivity that doesn't exist. Shares
   the landing page's index.html .card::before recipe, so the two card
   families feel like one language rather than two implementations. */
/* (the old pointer-tracked glow is gone: cards are flat) */
.ico{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;background:var(--ico-bg);border:1.5px solid var(--panel-bd);margin-bottom:16px}
.ico svg{width:21px;height:21px;stroke:var(--ico-fg);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.card h3{font-size:17px}
.card p{margin-top:8px;font-size:14.5px;color:var(--ink-2)}
.card .go{margin-top:16px;font-size:14px;font-weight:700;color:var(--accent-ink);display:inline-flex;align-items:center;gap:6px}
.card .go svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2}
html[dir="rtl"] .card .go svg{transform:scaleX(-1)}

.stat{background:var(--card);border:1.5px solid var(--panel-bd);border-radius:20px;padding:20px 22px;box-shadow:var(--hard)}
/* Smaller than the default 42px .ico (built for the wider feature cards) —
   this tile only has ~20px of padding to work with. */
.stat .ico{width:34px;height:34px;border-radius:10px;margin-bottom:12px}
.stat .ico svg{width:17px;height:17px}
/* Big numbers are plain ink in the display face: they read on cream and on navy without a
   theme-specific accent colour. */
.stat b{display:block;font-family:var(--font-display);font-size:32px;font-weight:800;letter-spacing:-.02em;color:var(--ink)}
html[dir="rtl"] .stat b{font-family:var(--font-fa);letter-spacing:0}
.stat span{font-size:13.5px;color:var(--ink-2)}

/* ── table ───────────────────────────────────────────── */
.panel-card{background:var(--card);border:1.5px solid var(--panel-bd);border-radius:22px;box-shadow:var(--hard);overflow:hidden}
.panel-top{display:flex;align-items:center;gap:14px;padding:18px 20px;border-bottom:1.5px solid var(--panel-bd);flex-wrap:wrap}
.panel-top h3{font-size:16px;margin-inline-end:auto}
.search{position:relative;display:flex;align-items:center}
.search svg{position:absolute;inset-inline-start:12px;width:16px;height:16px;stroke:var(--muted);fill:none;stroke-width:1.8}
.search input{height:40px;border:1.5px solid var(--outline);border-radius:999px;padding-inline:38px 16px;font:inherit;font-size:14px;background:var(--card);color:var(--ink);min-width:220px}
.search input:focus{outline:none;border-color:var(--kicker);box-shadow:0 0 0 4px var(--accent-glow)}
.table-scroll{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14.5px}
th,td{text-align:start;padding:14px 20px;border-bottom:1px solid var(--line-soft);white-space:nowrap}
th{font-size:12.5px;font-weight:700;color:var(--ink-2);text-transform:uppercase;letter-spacing:.03em;background:var(--band2)}
html[dir="rtl"] th{letter-spacing:0;text-transform:none;font-size:13.5px}
tbody tr:hover{background:var(--line-soft)}
tbody tr:last-child td{border-bottom:0}
.u-cell{display:flex;align-items:center;gap:11px}
.u-cell .avatar{width:32px;height:32px;font-size:13px}
.u-name{font-weight:600} .u-email{font-size:12.5px;color:var(--muted)}
.badge{font-size:11.5px;font-weight:700;padding:3px 10px;border-radius:999px}
.badge.admin{color:var(--on-accent);background:var(--accent);border:1.5px solid var(--outline)}
.badge.user{color:var(--ink-2);background:var(--card);border:1.5px solid var(--line)}
.badge.on{color:var(--ok-ink);background:var(--ok-soft);border:1px solid var(--ok-soft-border)}
.badge.off{color:var(--danger-ink);background:var(--danger-soft);border:1px solid var(--danger-soft-border)}
.row-actions{display:flex;gap:7px;justify-content:flex-end}
.icon-btn{width:36px;height:36px;border-radius:12px;border:1.5px solid var(--outline);background:var(--card);display:grid;place-items:center;cursor:pointer;color:var(--ink);transition:.2s}
.icon-btn:hover{background:var(--accent);color:var(--on-accent)}
.icon-btn.danger:hover{border-color:var(--danger-soft-border);color:var(--danger);background:var(--danger-soft)}
.icon-btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.muted-row td{padding:34px 20px;text-align:center;color:var(--muted)}

/* ── banner / toast ──────────────────────────────────── */
.banner{display:none;gap:10px;align-items:center;font-size:14.5px;border-radius:16px;padding:13px 16px;margin-bottom:20px}
.banner.show{display:flex}
.banner.ok{background:var(--ok-soft);border:1.5px solid var(--ok);color:var(--ok-ink)}
.banner.bad{background:var(--danger-soft);border:1.5px solid var(--danger);color:var(--danger-ink)}
.toast{position:fixed;inset-block-end:22px;inset-inline:0;margin-inline:auto;width:max-content;max-width:90%;background:var(--midnight);color:#fff;border:1.5px solid var(--outline);font-size:14px;font-weight:600;padding:12px 22px;border-radius:999px;box-shadow:var(--shadow-lg);opacity:0;transform:translateY(12px);transition:.25s;pointer-events:none;z-index:60}
.toast.show{opacity:1;transform:none}
.toast.bad{background:#7A1233}

.loading{padding:60px;text-align:center;color:var(--muted)}
.spin{display:inline-block;width:22px;height:22px;border:2.5px solid var(--line);border-top-color:var(--kicker);border-radius:50%;animation:sp .7s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.gate{min-height:70vh;display:grid;place-items:center;text-align:center;padding:24px}
.gate .card{max-width:380px}

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

/* ── what differs in SHAPE, not just colour (all the colour is tokens in theme.css) ───── */
/* the current page is a quiet grey pill with the one orange dot at its far end */
.side-link.active::after{content:"";margin-inline-start:auto;width:7px;height:7px;flex:none;border-radius:50%;background:var(--spark)}
body.side-collapsed .side-link.active::after{display:none}
/* The current-page dot and a count both push themselves to the end; with a count present the dot just follows it. */
.side-link.active:has(.side-badge)::after{margin-inline-start:8px}
/* without a hard shadow, "selected" needs another cue */
.card.link:hover{border-color:var(--outline)}
/* links drawn only by colour (accent-ink is plain ink) need an underline */
a[style*="--accent-ink"]{text-decoration:underline;text-underline-offset:3px}

/* ── Help: the support assistant from any signed-in page (app.js, mountHelp) ───────────────────────────
   A quiet pill in the top bar and a panel beside the page. The panel does NOT dim or lock the page (someone following a
   step needs to click on it), so from 1100px the page makes room for it; below that it overlaps; on a phone it is a sheet. */
.help-wrap{position:relative;display:inline-flex}
.help-btn{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 14px;border:1.5px solid var(--outline);border-radius:999px;background:var(--card);color:var(--ink);font:inherit;font-size:13.5px;font-weight:700;cursor:pointer;transition:.2s}
.help-btn{position:relative}
.help-btn:hover,.help-btn[aria-expanded="true"]{border-color:var(--ink)}
.help-btn[aria-expanded="true"]{background:var(--line-soft)}
.help-btn:focus-visible{outline:3px solid var(--kicker);outline-offset:2px}
.help-btn svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.help-panel{position:fixed;top:var(--topbar-h);bottom:0;inset-inline-end:0;width:min(390px,100vw);z-index:38;display:flex;flex-direction:column;background:var(--card);border-inline-start:1.5px solid var(--panel-bd);box-shadow:var(--shadow-lg)}
.help-panel[hidden]{display:none}
.help-head{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1.5px solid var(--panel-bd)}
.help-head b{flex:1;min-width:0;font-size:15px}
.help-av .bsw-avatar{width:34px;height:34px}
.help-av .bsw-avatar svg{width:40px;height:40px}
.help-x{flex:none;display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink-2);cursor:pointer}
.help-x:hover{background:var(--line-soft)}
.help-x svg,.help-tip-x svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.help-host{flex:1;min-height:0;display:flex;flex-direction:column}
.help-host .bsw-embed{flex:1;min-height:0;height:auto;max-height:none;border:0;border-radius:0}
.help-load,.help-fail{margin:auto;padding:24px;text-align:center;color:var(--muted);font-size:14px}
.help-foot{margin:0;padding:9px 14px 12px;border-top:1.5px solid var(--panel-bd);font-size:12px;line-height:1.6;color:var(--muted)}
/* From 1100px the panel is a third column of the .shell, docked like the sidebar (sticky under the top bar): the page beside it simply
   gets narrower, the top bar is untouched, and all three move together if the browser bounces the page at the top (a fixed panel
   did not, and slid under the sticky top bar). Below 1100px it overlaps the page as a fixed layer. */
@media (min-width:1100px){
  .help-panel{position:sticky;top:var(--topbar-h);bottom:auto;inset-inline-end:auto;flex:none;align-self:flex-start;width:390px;height:calc(100dvh - var(--topbar-h));z-index:30;box-shadow:none}
}
@media (max-width:700px){
  .help-btn{width:36px;padding:0;justify-content:center}
  .help-btn span{display:none}
  .help-panel{top:0;width:100vw;z-index:85;border-inline-start:0}
  body.help-open{overflow:hidden}
}
/* the one-time "Need help?" hint under the button */
.help-tip{position:absolute;top:calc(100% + 10px);inset-inline-end:0;z-index:50;display:flex;align-items:center;gap:8px;width:max-content;max-width:240px;padding:9px 8px 9px 14px;border-radius:14px;background:var(--brand-fill);color:var(--brand-fill-fg);font-size:13px;font-weight:600;line-height:1.5;box-shadow:var(--shadow-lg);animation:help-in .25s ease-out}
.help-tip::before{content:"";position:absolute;top:-5px;inset-inline-end:14px;width:10px;height:10px;background:inherit;transform:rotate(45deg)}
.help-tip-x{flex:none;display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer}
@keyframes help-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.help-tip{animation:none}}

/* "New chat": in the Help panel's header and in the dashboard's Contact support card (shown once the conversation has a message) */
.help-new{flex:none;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border:1.5px solid var(--outline);border-radius:999px;background:var(--card);color:var(--ink);font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;transition:.2s}
.help-new[hidden]{display:none}
.help-new:hover:not(:disabled){border-color:var(--ink)}
.help-new:disabled{opacity:.5;cursor:default}
.help-new:focus-visible{outline:3px solid var(--kicker);outline-offset:2px}
.help-new svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.help-head b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* A Latin initial in a circle or tile (the top bar's "KA", a product's letter) sits about 1.6px HIGH on a Persian page, because Vazirmatn's
   Latin glyphs have a deep descent: the same effect, and the same push (--digit-pad, theme.css), as a digit in a circle. Only Latin ones
   carry .latin: a Persian letter has dots and tails and is balanced differently. `line-height:1` keeps the push from overflowing the circle. */
html .avatar.latin, html .prod-mark.latin{line-height:1;padding-top:var(--digit-pad)}

/* "Send feedback": the dialog opened from the rail, the page footers and the Help panel. Written out in full here because dialogs are styled per page elsewhere. */
dialog.fbd{border:1.5px solid var(--panel-bd);border-radius:24px;padding:0;box-shadow:var(--hard-lg);max-width:520px;width:calc(100% - 32px);background:var(--card);color:var(--ink);font-family:inherit}
dialog.fbd::backdrop{background:rgba(18,20,42,.55)}
.fbd-in{position:relative;padding:30px 30px 26px}
.fbd-in h3{font-size:23px;line-height:1.3;margin:0 0 8px;padding-inline-end:36px}
html[dir="rtl"] .fbd-in h3{font-size:22px;font-weight:800;line-height:1.5}
.fbd-x{position:absolute;top:18px;inset-inline-end:18px;width:34px;height:34px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink-2);cursor:pointer}
.fbd-x:hover{background:var(--line-soft);color:var(--ink)}
.fbd-x:focus-visible{outline:3px solid var(--kicker);outline-offset:2px}
.fbd-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.fbd-lead{margin:0 0 20px;color:var(--ink-2);font-size:15px;line-height:1.65;text-wrap:pretty}
.fbd-label{margin:0 0 8px;font-size:12.5px;font-weight:700;color:var(--ink-2)}
.fbd-kinds{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.fbd-kind{height:36px;padding-inline:16px;border-radius:999px;border:1.5px solid var(--outline);background:var(--card);color:var(--ink);font:inherit;font-size:13.5px;font-weight:600;line-height:1;cursor:pointer;transition:border-color .15s,background .15s}
.fbd-kind:hover{border-color:var(--kicker)}
.fbd-kind.on{background:var(--ink);color:var(--card);border-color:var(--ink)}
.fbd-kind:focus-visible{outline:3px solid var(--kicker);outline-offset:2px}
#fbd-text{display:block;width:100%;min-height:150px;resize:vertical;border:1.5px solid var(--outline);border-radius:16px;padding:14px 16px;font:inherit;font-size:15px;line-height:1.7;background:var(--card);color:var(--ink)}
html[dir="rtl"] #fbd-text{line-height:1.9}
#fbd-text::placeholder{color:var(--muted);opacity:1}
#fbd-text:focus{outline:none;border-color:var(--kicker);box-shadow:0 0 0 4px var(--accent-glow)}
.fbd-count{margin-top:6px;font-size:12px;line-height:1.4;color:var(--muted);text-align:end;font-variant-numeric:tabular-nums}
.fbd-note{margin:14px 0 0;padding:12px 14px;border-radius:14px;background:var(--accent-soft);font-size:13px;line-height:1.7;color:var(--ink-2);text-wrap:pretty}
html[dir="rtl"] .fbd-note{font-size:13.5px;line-height:1.9}
.fbd-note span:first-child{display:block;font-weight:700;color:var(--ink)}
.fbd-error{margin:14px 0 0;padding:11px 14px;border:1.5px solid var(--danger);border-radius:14px;background:var(--danger-soft);color:var(--danger-ink);font-size:13.5px;line-height:1.55}
.fbd-error[hidden]{display:none}
.fbd-ok{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;margin-bottom:14px;background:var(--ok);color:#fff}
.fbd-ok svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.fbd-thanks{margin:0;font-size:15.5px;line-height:1.7;color:var(--ink-2)}
.fbd-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:22px}
@media (max-width:480px){.fbd-in{padding:24px 20px 20px}.fbd-actions .btn{flex:1}}
#fbd-send:disabled{opacity:.45;cursor:not-allowed}

/* Feedback is offered inside the Help panel only after the assistant has answered (the card), and, on a server with no assistant,
   as a line at the foot of every owner page (.fb-foot). Both use the same pill button. Neutral on purpose: the page's one orange is its main action. */
.fbcard{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 14px 12px;padding:14px;border:1.5px solid var(--panel-bd);border-radius:20px;background:var(--accent-soft);animation:fbcard-in .3s ease-out}
.fbcard[hidden]{display:none}
.fbcard-ic{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--card);color:var(--ink);border:1.5px solid var(--outline)}
.fbcard-ic svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.fbcard-text{flex:1 1 calc(100% - 56px);min-width:0;display:flex;flex-direction:column;gap:1px}
.fbcard-text b{font-size:14px;font-weight:700;line-height:1.45}
.fbcard-text small{font-size:12.5px;line-height:1.55;color:var(--ink-2)}
.fbcard-btn{flex:none;display:inline-flex;align-items:center;gap:8px;height:38px;padding-inline:16px;border:1.5px solid var(--ink);border-radius:999px;background:var(--ink);color:var(--card);font:inherit;font-size:13.5px;font-weight:700;line-height:1;white-space:nowrap;cursor:pointer;transition:transform .18s,box-shadow .18s}
.fbcard .fbcard-btn{flex:1 1 100%;width:100%;justify-content:center;height:40px}
.fbcard-btn:hover{box-shadow:0 6px 16px -8px var(--ink)}
.fbcard-btn:focus-visible{outline:3px solid var(--kicker);outline-offset:2px}
.fbcard-arrow{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform .18s}
html[dir="rtl"] .fbcard-arrow{transform:scaleX(-1)}
.fbcard-btn:hover .fbcard-arrow{transform:translateX(3px)}
html[dir="rtl"] .fbcard-btn:hover .fbcard-arrow{transform:scaleX(-1) translateX(3px)}
@keyframes fbcard-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.fbcard{animation:none}.fbcard-btn,.fbcard-arrow{transition:none}}

.fb-foot{margin-top:48px;padding-top:18px;border-top:1px solid var(--line-soft);display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap;font-size:13.5px;color:var(--muted);line-height:1.7}
body.pg-padbar .fb-foot{margin-bottom:8px}

/* the Help button asks for a look when the owner seems stuck (helpAttention in app.js): a ring that grows and fades twice, then stops */
.help-btn.help-attn{border-color:var(--spark)}
.help-btn.help-attn::after{content:"";position:absolute;inset:-3px;border-radius:inherit;border:2px solid var(--spark);pointer-events:none;animation:help-ring 1.6s ease-out 2 both}
@keyframes help-ring{0%{transform:scale(.96);opacity:.85}100%{transform:scale(1.28,1.7);opacity:0}}
@media (prefers-reduced-motion:reduce){.help-btn.help-attn::after{animation:none;opacity:.75}}


/* ── "Viewing as" bar: an admin is acting as an owner (mountViewingBar in app.js) ──────────────────────────────
   Sticky at the very top. The top bar, the rail and the help panel all hang off --topbar-h, so while the bar shows
   that variable grows by the bar's own height (--imp-h, measured by the script because the bar wraps on a phone). */
.imp-bar{position:sticky;top:0;z-index:60;display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;padding:8px 24px;background:#B42318;color:#fff;font-size:14px;line-height:1.5}
.imp-bar b{font-weight:700;overflow-wrap:anywhere}
.imp-note{opacity:.92}
.imp-time{opacity:.92;font-variant-numeric:tabular-nums}
.imp-stop{margin-inline-start:auto;font:inherit;font-weight:700;padding:5px 14px;border-radius:999px;border:1.5px solid #fff;background:#fff;color:#7A1A12;cursor:pointer}
.imp-stop:hover{background:#FEE4E2}
.imp-stop:focus-visible{outline:3px solid #fff;outline-offset:2px}
body.imp-on{--topbar-h:calc(66px + var(--imp-h, 44px))}
body.imp-on .topbar{top:var(--imp-h, 44px)}
@media (max-width:600px){.imp-bar{padding:8px 14px}.imp-stop{margin-inline-start:0}}
