/* Bismillah - static/ui/tour/tour.css — the 3-minute tour + demo mode
 * (tools_tour.py, ui/tour/*). Builds on expertini-ui.css tokens (--x-*) and
 * its .x-btn / .x-itile / .x-card. Loaded only on demo / tour pages. */

/* ── demo strip: one slim line (≈38px), in the page flow (its height is
   reserved — no layout shift). Plain demo: sticks under the site header on
   desktop. Tour stop (.xdemo--tour): scrolls away — the bottom bar has the
   buttons. Never above the header (z 40 < header 50). ── */
.xdemo{position:sticky;top:calc(var(--x-topbar-h,64px) + 1px);z-index:40;display:flex;align-items:center;gap:6px 10px;
  box-sizing:border-box;min-height:38px;margin:0 0 14px;padding:4px 6px 4px 6px;border:1px solid #fcd34d;border-radius:10px;
  background:#fffbeb;box-shadow:0 2px 8px rgba(15,23,42,.05);font-size:13px;line-height:1.35;color:#78350f}
.xdemo--tour{position:relative;top:auto;box-shadow:none}
.xdemo__tag{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;padding:3px 9px;border-radius:999px;background:#f59e0b;color:#fff;
  font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}
.xdemo__tag .x-ico{width:11px;height:11px}
.xdemo__txt{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.xdemo__txt.is-sample{color:#065f46}
.xdemo .x-btn{white-space:nowrap;flex-shrink:0}
.xdemo__try{padding:5px 11px!important;font-size:12px!important}
.xdemo__exit{flex-shrink:0;padding:4px 8px;border-radius:7px;font-size:12.5px;font-weight:500;color:#92400e!important;text-decoration:underline!important;white-space:nowrap}
.xdemo__exit:hover{background:#fef3c7}
/* the real plan chip, the guest "save" note and the tools' own "Saved to your
   account" indicators mean nothing in a demo (the banner says nothing is saved) */
html.xdemo-on .xt-meter,html.xdemo-on .xt > .xt-note:not([data-xt-status]):not([data-xt-import]),
html.xdemo-on [data-cvb-state],html.xdemo-on [data-cl-state]{display:none!important}

/* demo toast with a link */
.xdemo-toast{position:fixed;left:50%;bottom:calc(var(--xtour-top,0px) + 18px);z-index:130;transform:translate(-50%,12px);
  max-width:min(560px,calc(100vw - 32px));padding:12px 16px;border-radius:14px;background:var(--x-text,#0f172a);color:#fff;
  font-size:13.5px;line-height:1.5;box-shadow:0 12px 32px rgba(15,23,42,.25);opacity:0;pointer-events:none;
  transition:opacity .2s,transform .2s}
.xdemo-toast.is-on{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.xdemo-toast a{color:#93c5fd;font-weight:600;text-decoration:underline;margin-left:6px;white-space:nowrap}

/* ── "See an example" button in the tool header ── */
.xt-example .x-ico{width:15px;height:15px}

/* ── tour bar (fixed bottom) — COMPACT, owner 2026-10-04 ──
   One row on desktop (≈58px from the bottom edge): 3/12 · tool · About ·
   Back · Next · Try it with my data · Exit · minimise; a 3px progress line
   on its top edge. "About this tool" (.is-about) opens the what/when text
   above the row. Minimised (.is-min): only a small "Tour 3/12" pill.
   tour.js sets --xtour-h (the bar's height + a gap = the page's bottom
   padding, so everything can scroll clear of it) and --xtour-top (viewport
   bottom → top of the bar or pill; toasts sit above it). */
.xtour{position:fixed;left:0;right:0;bottom:0;z-index:90;display:flex;justify-content:center;
  padding:0 16px calc(8px + env(safe-area-inset-bottom,0px));pointer-events:none}
.xtour__in{pointer-events:auto;position:relative;box-sizing:border-box;width:100%;max-width:1040px;padding:8px 8px 8px 12px;
  border:1px solid var(--x-border,#e2e8f0);border-radius:14px;background:rgba(255,255,255,.97);
  box-shadow:0 -2px 18px rgba(15,23,42,.12);overflow:hidden}
.xtour__prog{position:absolute;left:0;right:0;top:0;height:3px;background:#e2e8f0}
.xtour__prog i{display:block;height:100%;border-radius:0 999px 999px 0;background:linear-gradient(90deg,var(--x-primary,#2563eb),var(--x-accent,#06b6d4))}
.xtour__row{display:flex;align-items:center;gap:8px;min-width:0}
.xtour__n{flex-shrink:0;min-width:34px;font:500 12px/1 var(--x-f-disp,inherit);color:var(--x-subtext,#64748b);white-space:nowrap;
  font-variant-numeric:tabular-nums}
.xtour__n b{font-size:14px;font-weight:600;color:var(--x-primary,#2563eb)}
.xtour__t{display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:0;margin:0;font:600 14.5px/1.25 var(--x-f-disp,inherit)!important;
  color:var(--x-text,#0f172a)}
.xtour__t .x-itile{width:26px;height:26px;border-radius:8px;box-shadow:none}
.xtour__tt{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.xtour__g{flex-shrink:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 12px/1.25 var(--x-f-body,inherit);
  color:var(--x-subtext,#64748b)}
.xtour__g::before{content:'· '}
.xtour__info,.xtour__min{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex-shrink:0;height:32px;margin:0;
  padding:0 9px;border:0;border-radius:8px;background:transparent;font:500 12.5px var(--x-f-body,inherit);cursor:pointer;white-space:nowrap}
.xtour__info{color:var(--x-primary,#2563eb)}
.xtour__info:hover,.xtour__info[aria-expanded="true"]{background:#eff6ff}
.xtour__info[aria-expanded="true"]{color:#1d4ed8}
.xtour__min{width:32px;padding:0;color:var(--x-subtext,#64748b)}
.xtour__min:hover{background:#f1f5f9;color:var(--x-text,#0f172a)}
.xtour__acts{display:flex;align-items:center;gap:6px;flex-shrink:0}
.xtour__acts .x-btn{white-space:nowrap;gap:5px}
.xtour__acts .x-ico,.xtour__info .x-ico{width:14px;height:14px}
.xtour__exit{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;height:32px;padding:0 8px;border-radius:8px;font-size:12.5px;
  font-weight:500;color:var(--x-subtext,#64748b)!important;white-space:nowrap;text-decoration:none!important}
.xtour__exit:hover{background:#f1f5f9;color:var(--x-text,#0f172a)!important}
.xtour__exit .x-ico{display:none}
/* "About this tool" — folded by default */
.xtour__about{display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 22px;margin:2px 0 8px;padding:2px 2px 8px;
  border-bottom:1px solid var(--x-border,#e2e8f0);font-size:13px;line-height:1.5;color:var(--x-text-2,#334155)}
.xtour.is-about .xtour__about{display:grid}
.xtour__about p{margin:0}
/* minimised: the pill only */
.xtour__pill{display:none;pointer-events:auto;align-items:center;gap:6px;height:36px;margin:0 0 0 auto;padding:0 10px 0 12px;
  border:1px solid var(--x-border,#e2e8f0);border-radius:999px;background:rgba(255,255,255,.97);box-shadow:0 4px 16px rgba(15,23,42,.16);
  font:500 12.5px var(--x-f-body,inherit);color:var(--x-text-2,#334155);cursor:pointer;white-space:nowrap}
.xtour__pill b{font-weight:600;color:var(--x-primary,#2563eb)}
.xtour__pill .x-ico{width:13px;height:13px;color:var(--x-primary,#2563eb)}
.xtour__pill:hover{border-color:#93c5fd}
.xtour.is-min .xtour__in{display:none}
.xtour.is-min .xtour__pill{display:inline-flex}
.xtour a:focus-visible,.xdemo a:focus-visible,.xtour button:focus-visible{outline:3px solid rgba(37,99,235,.45);outline-offset:2px;border-radius:8px}
/* everything on the page can scroll clear of the bar (tour.js measures it) */
html.xtour-on body{padding-bottom:var(--xtour-h,72px)}
/* the kit's own toast moves above the bar */
html.xtour-on .x-toast{bottom:calc(var(--xtour-top,72px) + 12px)}
/* desktop dashboard: centre the bar on the content column, not over the sidebar */
@media (min-width:961px){
  .x-page--dash .xtour{left:var(--x-sidebar-w,264px)}
  .x-rail .x-page--dash .xtour{left:76px}
}
/* narrower content column: icon-only About, then icon-only Back */
@media (max-width:1279px){
  .xtour__info .xtour__lbl{display:none}
  .xtour__info{width:32px;padding:0}
  .xtour__g{display:none}
}
@media (max-width:1100px){
  .xtour__prev .xtour__lbl{display:none}
  .xtour__prev{padding:7px 9px}
}
/* phones/tablets: the dashboard's bottom nav (.x-bnav, 64px) is shown — sit on top of it */
@media (max-width:960px){
  .xtour{bottom:calc(64px + env(safe-area-inset-bottom,0px));padding-bottom:6px}
  .xdemo-toast{bottom:calc(var(--xtour-top,64px) + 14px)}
  .xdemo{position:relative;top:auto}
}
/* phones: two short rows — [3/12 · tool · i · ▾] [← · Next → · Try it with my data · ✕] */
@media (max-width:760px){
  .xtour{padding:0 6px 6px}
  .xtour__in{padding:7px 6px 6px 10px;border-radius:12px}
  .xtour__row{flex-wrap:wrap;gap:4px 6px}
  .xtour__n{min-width:0}
  .xtour__t{font-size:14px!important}
  .xtour__t .x-itile{display:none}
  .xtour__info,.xtour__min{height:28px}
  .xtour__acts{order:5;flex:1 1 100%;gap:6px;padding-right:2px}
  .xtour__acts .x-btn{padding:7px 10px;font-size:12.5px}
  .xtour__try{flex:1 1 auto;justify-content:center;min-width:0;overflow:hidden;text-overflow:ellipsis}
  .xtour__exit{width:32px;padding:0;justify-content:center}
  .xtour__exit .x-ico{display:block}
  .xtour__exit .xtour__lbl{display:none}
  .xtour__about{grid-template-columns:1fr;max-height:38vh;overflow:auto;font-size:12.5px;margin:0 0 6px}
  .xdemo{flex-wrap:wrap;padding:4px 4px 4px 6px;font-size:12.5px}
  .xdemo__txt{flex:1 1 0;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  /* plain demo (no tour bar): [DEMO · text] then [Try it with my data · Exit] on the right */
  .xdemo:not(.xdemo--tour){row-gap:2px}
  .xdemo:not(.xdemo--tour) .xdemo__txt{flex:1 1 calc(100% - 90px)}
  .xdemo:not(.xdemo--tour) .xdemo__try{margin-left:auto;padding:4px 10px!important}
}
@media (max-width:370px){
  .xtour__acts .x-btn{padding:7px 8px;font-size:12px}
  .xtour__n{font-size:11px}
  .xtour__n b{font-size:13px}
  .xtr-chip{padding:5px 10px;font-size:12.5px}
}

/* ── tour landing + stop cards ── */
.xtr-hero{display:flex;gap:24px;align-items:center;padding:24px;margin-bottom:22px}
.xtr-hero__img{flex-shrink:0;width:160px;height:160px;border-radius:50%;background:#eff6ff}
.xtr-hero__txt{min-width:0}
.xtr-hero h2,.xtr-card h2,.xtr-about h2{margin:0 0 8px;font:600 19px/1.35 var(--x-f-disp,inherit)!important;color:var(--x-text,#0f172a)}
.xtr-hero p,.xtr-card p,.xtr-about p{margin:0 0 10px;font-size:14px;line-height:1.65;color:var(--x-text-2,#334155)}
.xtr-facts{list-style:none;margin:6px 0 16px;padding:0;display:grid;gap:6px}
.xtr-facts li{display:flex;gap:8px;align-items:flex-start;font-size:13px;line-height:1.5;color:var(--x-text-3,#475569)}
.xtr-facts .x-ico{flex-shrink:0;margin-top:3px;color:var(--x-primary,#2563eb)}
.xtr-hero__acts,.xtr-acts{display:flex;flex-wrap:wrap;gap:10px;margin-top:6px}
.xtr-sec{margin:4px 0 12px;font:600 17px/1.3 var(--x-f-disp,inherit)!important;color:var(--x-text,#0f172a)}
.xtr-stops{list-style:none;margin:0 0 22px;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.xtr-stop{display:flex;align-items:center;gap:12px;height:100%;padding:12px 14px;border:1px solid var(--x-border,#e2e8f0);border-radius:14px;
  background:var(--x-surface,#fff);color:inherit!important;text-decoration:none!important;transition:border-color .15s,box-shadow .15s}
.xtr-stop:hover,.xtr-stop:focus-visible{border-color:#93c5fd;box-shadow:0 6px 18px rgba(37,99,235,.10)}
.xtr-stop__n{flex-shrink:0;width:24px;font:600 13px/1 var(--x-f-disp,inherit);color:var(--x-subtext,#64748b);text-align:center}
.xtr-stop .x-itile{flex-shrink:0;width:36px;height:36px;border-radius:10px}
.xtr-stop__txt{flex:1;min-width:0}
.xtr-stop__txt b{display:block;font-size:14px;font-weight:600;color:var(--x-text,#0f172a)}
.xtr-stop__txt small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12.5px;line-height:1.45;color:var(--x-subtext,#64748b)}
.xtr-stop__go{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;font-size:12px;font-weight:600;color:var(--x-primary,#2563eb)}
.xtr-about{padding:20px 22px;margin-bottom:12px}
.xtr-done{margin-bottom:16px}
.xtr-card{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:24px;padding:24px;margin-bottom:18px;align-items:center}
.xtr-kicker{display:inline-block;margin-bottom:8px;font-size:11.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--x-primary,#2563eb)}
.xtr-list{margin:4px 0 12px;padding-left:20px;font-size:14px;line-height:1.65;color:var(--x-text-2,#334155)}
.xtr-list li{margin-bottom:4px;list-style:disc}
.xtr-note{font-size:13px!important;color:var(--x-subtext,#64748b)!important}
.xtr-svg{display:block;width:100%;height:auto;max-width:380px;margin:0 auto}
.xtr-cap{margin:8px 0 0!important;font-size:12px!important;line-height:1.5!important;color:var(--x-subtext,#64748b)!important;text-align:center}
.xtr-back{margin:6px 0 20px;font-size:13px}
.xtr-back a{display:inline-flex;align-items:center;gap:6px}
.xtr-plans{margin:8px 0 10px;border:1px solid var(--x-border,#e2e8f0);border-radius:12px;overflow:hidden;font-size:13px}
.xtr-plans__row{display:grid;grid-template-columns:1fr 1.3fr 1.6fr 1.2fr;gap:10px;padding:10px 12px;border-top:1px solid var(--x-border,#e2e8f0);color:var(--x-text-2,#334155)}
.xtr-plans__head{border-top:0;background:#f8fafc;font-weight:600;color:var(--x-text-3,#475569);font-size:12px}
/* ── "All tools, explained" (landing section; the bar's group = .xtour__g above) ── */
.xtr-all{margin:6px 0 22px;scroll-margin-top:calc(var(--x-topbar-h,64px) + 12px)}
.xtr-all__lead{margin:0 0 12px;font-size:14px;line-height:1.6;color:var(--x-text-2,#334155)}
.xtr-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.xtr-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid var(--x-border,#e2e8f0);border-radius:999px;
  background:var(--x-surface,#fff);font-size:13px;font-weight:500;color:var(--x-text-2,#334155)!important;text-decoration:none!important}
.xtr-chip span{font-size:11.5px;font-weight:600;color:var(--x-subtext,#64748b)}
.xtr-chip:hover,.xtr-chip:focus-visible{border-color:#93c5fd;color:var(--x-primary,#2563eb)!important}
.xtr-all__start{margin:0 0 6px}
.xtr-grp{scroll-margin-top:calc(var(--x-topbar-h,64px) + 12px)}
.xtr-grp__h{display:flex;align-items:baseline;gap:8px;margin:16px 0 10px;font:600 15px/1.3 var(--x-f-disp,inherit)!important;color:var(--x-text,#0f172a)}
.xtr-grp__h span{font-size:12px;font-weight:500;color:var(--x-subtext,#64748b)}
.xtr-stops--all{margin-bottom:6px}
.xtr-ai{display:inline-block;margin-left:4px;padding:1px 6px;border-radius:999px;background:#ede9fe;color:#6d28d9;font-style:normal;
  font-size:10.5px;font-weight:600;vertical-align:1px}
.xtr-art{text-align:center}
.xtr-art__ico{display:inline-flex;width:96px!important;height:96px!important;border-radius:28px!important;align-items:center;justify-content:center}
.xtr-art__ico .x-ico{width:44px;height:44px}
@media (max-width:860px){
  .xtr-card{grid-template-columns:1fr}
  .xtr-stops{grid-template-columns:1fr}
}
@media (max-width:560px){
  .xtr-hero{flex-direction:column;align-items:flex-start;padding:18px}
  .xtr-hero__img{width:110px;height:110px}
  .xtr-card{padding:18px}
  .xtr-plans__row{grid-template-columns:1fr 1fr}
  .xtr-plans__head{display:none}
  .xtr-stop__go{display:none}
  /* all tools: keep "Example" / "Explained" visible — it says what opens */
  .xtr-stops--all .xtr-stop__go{display:inline-flex;font-size:11px}
  .xtr-stops--all .xtr-stop__go .x-ico{display:none}
}
