/* ==========================================================================
   v4 — Feature tour, compact buy bar, reactive background
   ========================================================================== */

/* ---------- Reactive background scene ---------- */
.bg-scene {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.bg-orb {
  position: absolute; border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.orb-a {
  width: 620px; height: 620px; top: -220px; right: -140px;
  background: radial-gradient(circle at 35% 35%, rgba(59, 130, 246, .30), rgba(147, 197, 253, .14) 55%, transparent 72%);
}
.orb-b {
  width: 540px; height: 540px; bottom: -160px; left: -200px;
  background: radial-gradient(circle at 60% 40%, rgba(37, 99, 235, .22), rgba(199, 210, 254, .16) 55%, transparent 72%);
}
.orb-c {
  width: 420px; height: 420px; top: 38%; left: 46%;
  background: radial-gradient(circle at 50% 50%, rgba(96, 165, 250, .18), transparent 70%);
}
.bg-dots {
  position: absolute; inset: -40px;
  background-image: radial-gradient(rgba(37, 99, 235, .17) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 38%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 38%, #000 20%, transparent 78%);
  will-change: transform;
}
[data-theme="dark"] .orb-a { background: radial-gradient(circle at 35% 35%, rgba(37, 99, 235, .30), rgba(30, 64, 175, .10) 55%, transparent 72%); }
[data-theme="dark"] .orb-b { background: radial-gradient(circle at 60% 40%, rgba(59, 130, 246, .20), rgba(49, 46, 129, .14) 55%, transparent 72%); }
[data-theme="dark"] .orb-c { background: radial-gradient(circle at 50% 50%, rgba(96, 165, 250, .12), transparent 70%); }
[data-theme="dark"] .bg-dots { background-image: radial-gradient(rgba(147, 197, 253, .14) 1px, transparent 1.4px); }
main, .site-footer { position: relative; z-index: 1; }
.features-section { background: transparent; }
.install-section { background: transparent; }
.demo-section { background: transparent; }

/* ---------- Sticky buy bar: slim pill ---------- */
.scroll-buy { bottom: 14px; }
.scroll-buy-inner {
  max-width: 540px;
  padding: 6px 8px 6px 14px;
  gap: 12px;
  border-radius: 999px;
  box-shadow: 0 16px 38px -14px rgba(2, 6, 23, .55);
}
.scroll-buy-text { flex-direction: row; align-items: center; gap: 8px; line-height: 1.4; }
.scroll-buy-text strong { font-size: 12.5px; }
.scroll-buy-text span {
  font-size: 10.5px; color: rgba(255, 255, 255, .74);
  padding-inline-start: 8px; border-inline-start: 1px solid rgba(255, 255, 255, .28);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scroll-buy .btn { height: 31px; padding: 0 14px; font-size: 11.8px; border-radius: 999px; gap: 6px; }
.scroll-buy .btn .ic { width: 13px; height: 13px; }
body.has-scroll-buy .toast { bottom: 70px; }

@media (max-width: 680px) {
  .scroll-buy { bottom: 10px; }
  .scroll-buy-inner {
    max-width: min(360px, calc(100vw - 24px));
    margin: 0 auto;
    padding: 5px 6px 5px 13px;
    gap: 8px;
  }
  .scroll-buy-text { gap: 6px; }
  .scroll-buy-text strong { font-size: 11px; }
  .scroll-buy-text span { display: none; }
  .scroll-buy .btn { height: 30px; padding: 0 12px; font-size: 11px; }
  body.has-scroll-buy .toast { bottom: 62px; }
}
@media (max-width: 420px) {
  .scroll-buy-text { display: flex; }
  .scroll-buy-inner { justify-content: space-between; }
  .scroll-buy .btn { width: auto; }
}

/* ---------- Compare rows ---------- */
.compare-table tbody tr { transition: background .15s; }

/* ---------- Feature tour ---------- */
.ftour {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 30px 70px -36px rgba(15, 23, 42, .35);
}
[data-theme="dark"] .ftour { box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .65); }

.ft-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-bottom: 12px; }
.ft-tab {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 8px;
  font-family: inherit; text-align: start; color: var(--text); cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 9px 9px;
  transition: background .22s, border-color .22s, color .22s, transform .22s, box-shadow .22s;
}
.ft-tab:hover { border-color: var(--blue-pale); transform: translateY(-1px); }
.ft-tab.active {
  background: linear-gradient(145deg, #1e40af, #2563eb 62%, #3b82f6);
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 24px -16px rgba(37, 99, 235, .95);
}
.ft-tab-ic {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--blue-light); color: var(--blue);
  transition: background .22s, color .22s;
}
.ft-tab-ic .ic { width: 15px; height: 15px; }
.ft-tab.active .ft-tab-ic { background: rgba(255, 255, 255, .18); color: #fff; }
.ft-tab-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.35; }
.ft-tab-tx b {
  font-size: 11.2px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ft-tab-tx i { font-style: normal; font-size: 9.6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-tab.active .ft-tab-tx i { color: #cfe0ff; }
.ft-tab-bar { position: absolute; inset: auto 0 0 0; height: 2.5px; background: rgba(255, 255, 255, .18); opacity: 0; }
.ft-tab.active .ft-tab-bar { opacity: 1; }
.ft-tab-bar span { display: block; height: 100%; width: 0; background: #fff; }
.ft-tab.active .ft-tab-bar span { animation: ftProg var(--ft-cycle, 8s) linear forwards; }
.ftour.is-paused .ft-tab.active .ft-tab-bar span,
.ftour.no-auto .ft-tab.active .ft-tab-bar span { animation-play-state: paused; }
.ftour.no-auto .ft-tab-bar span { width: 100%; }
@keyframes ftProg { from { width: 0; } to { width: 100%; } }

.ft-body { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 12px; align-items: stretch; }
.ft-frame {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ft-frame .browser-bar { padding: 8px 12px; }
.ft-counter {
  margin-inline-start: 9px;
  font-size: 10px; font-weight: 800; color: var(--muted);
  direction: ltr;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.ft-media { position: relative; overflow: hidden; background: #f8fafc; aspect-ratio: 1600 / 994; }
[data-theme="dark"] .ft-media { background: #0f172a; }
.ft-shot { display: none; margin: 0; position: relative; }
.ft-shot.active { display: block; animation: ftScene .45s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes ftScene { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }
.ft-shot img { display: block; width: 100%; height: auto; }

/* side "next page" markers — inside the aspect-locked .ft-media, so they never move */
.ft-side {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 10px;
  font-family: inherit; font-size: 11px; font-weight: 800; line-height: 1;
  color: #1e3a8a; background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(37, 99, 235, .4); border-radius: 999px;
  box-shadow: 0 10px 24px -12px rgba(2, 6, 23, .55);
  backdrop-filter: blur(2px);
  cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.ft-side .ic { width: 14px; height: 14px; flex: none; }
.ft-side--next { inset-inline-end: 10px; }
.ft-side--prev { inset-inline-start: 10px; }
.ft-side--next .ic { transform: rotate(90deg); }
.ft-side--prev .ic { transform: rotate(-90deg); }
.ft-side:hover { background: #fff; color: #1d4ed8; transform: translateY(-50%) scale(1.05); box-shadow: 0 12px 26px -12px rgba(37, 99, 235, .7); }
.ft-side:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ft-side--next { animation: ftNextNudge 3.2s ease-in-out infinite; }
@keyframes ftNextNudge {
  0%, 62%, 100% { translate: 0 0; }
  70% { translate: -6px 0; }
  80% { translate: 3px 0; }
  88% { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) { .ft-side--next { animation: none; } }
[data-theme="dark"] .ft-side { background: rgba(15, 23, 42, .88); color: #bfdbfe; border-color: rgba(148, 163, 184, .4); }
[data-theme="dark"] .ft-side:hover { background: rgba(15, 23, 42, .97); color: #dbeafe; }

.ft-nav {
  display: flex; align-items: center; justify-content: center;
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.ft-dots { display: flex; align-items: center; gap: 5px; }
.ft-dot {
  width: 7px; height: 7px; padding: 0; flex: none;
  background: rgba(100, 116, 139, .35);
  border: 0; border-radius: 99px; cursor: pointer;
  transition: width .25s, background .25s, transform .2s;
}
.ft-dot:hover { background: rgba(100, 116, 139, .6); transform: scale(1.2); }
.ft-dot.is-on { width: 20px; background: var(--blue); }
.ft-dot:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[data-theme="dark"] .ft-dot { background: rgba(148, 163, 184, .38); }
[data-theme="dark"] .ft-dot:hover { background: rgba(148, 163, 184, .62); }
[data-theme="dark"] .ft-dot.is-on { background: #60a5fa; }
@media (max-width: 640px) {
  .ft-side { height: 28px; padding: 0 8px; font-size: 10px; }
  .ft-side--next { inset-inline-end: 6px; }
  .ft-side--prev { inset-inline-start: 6px; }
  .ft-nav { padding: 6px 8px; }
  .ft-dots { gap: 4px; }
}

.ft-pin { position: absolute; left: var(--x); top: var(--y); width: 21px; height: 21px; z-index: 3; transform: translate(-50%, -50%); }
.ft-pin b {
  position: relative; z-index: 1;
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: #fff;
  background: linear-gradient(140deg, #1d4ed8, #3b82f6);
  box-shadow: 0 3px 10px rgba(2, 6, 23, .45), 0 0 0 2px rgba(255, 255, 255, .9);
}
.ft-pin b::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid rgba(59, 130, 246, .85);
  animation: pinRing 2.4s ease-out infinite;
}
@keyframes pinRing { 0% { transform: scale(.72); opacity: .9; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
.ft-pin-lbl {
  position: absolute; top: 50%; transform: translateY(-50%);
  white-space: nowrap; direction: rtl;
  font-size: 10.4px; font-weight: 700; line-height: 1.6; color: #fff;
  background: rgba(15, 23, 42, .88);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px; padding: 3px 8px;
  box-shadow: 0 8px 20px -10px rgba(2, 6, 23, .8);
  backdrop-filter: blur(4px);
}
.lbl-left .ft-pin-lbl { right: calc(100% + 7px); }
.lbl-right .ft-pin-lbl { left: calc(100% + 7px); }

.ft-panel {
  position: relative; overflow-x: hidden; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--blue-pale) transparent;
  display: flex;
  background: linear-gradient(165deg, #eff6ff 0%, #ffffff 55%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 16px;
}
[data-theme="dark"] .ft-panel { background: linear-gradient(165deg, rgba(37, 99, 235, .16) 0%, rgba(20, 29, 46, .9) 55%); }
.ft-panel-item { display: none; }
.ft-panel-item.active { display: flex; flex-direction: column; width: 100%; animation: ftPanel .4s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes ftPanel { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ft-kicker {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: .2px;
  color: var(--blue); background: var(--blue-light);
  border-radius: 999px; padding: 2px 9px; margin-bottom: 9px;
}
.ft-panel-item h3 { font-size: 17px; font-weight: 900; line-height: 1.55; margin-bottom: 6px; letter-spacing: -.2px; }
.ft-panel-item p { font-size: 12.2px; color: var(--muted); line-height: 1.9; }
.ft-steps { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 12px 0 13px; }
.ft-steps li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11.6px; line-height: 1.7;
  background: rgba(255, 255, 255, .72);
  border: 1px solid #dbeafe;
  border-radius: 9px; padding: 5px 8px;
}
[data-theme="dark"] .ft-steps li { background: rgba(30, 41, 59, .55); border-color: rgba(96, 165, 250, .22); }
.ft-steps b {
  flex: none; width: 18px; height: 18px; margin-top: 1px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 900; color: #fff;
  background: var(--blue); border-radius: 50%;
}
.ft-tip {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: auto;
  padding: 7px 9px;
  border: 1px dashed var(--blue-pale);
  border-radius: 9px;
  background: rgba(37, 99, 235, .05);
  font-size: 10.6px; line-height: 1.8; color: var(--muted);
}
.ft-tip b {
  flex: none; margin-top: 1px;
  font-size: 9.5px; font-weight: 800; color: var(--blue);
  background: var(--blue-light); border-radius: 999px; padding: 0 6px;
}
[data-theme="dark"] .ft-tip { border-color: rgba(96, 165, 250, .28); background: rgba(37, 99, 235, .1); }
.ft-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ft-chips span {
  font-size: 10px; font-weight: 700; color: var(--blue-dark);
  background: var(--surface);
  border: 1px solid var(--blue-pale);
  border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}
[data-theme="dark"] .ft-chips span { color: #bfdbfe; background: rgba(37, 99, 235, .16); border-color: rgba(96, 165, 250, .3); }
.ft-extra { list-style: none; display: flex; flex-direction: column; gap: 3px; margin: 9px 0 2px; }
.ft-extra li {
  position: relative; padding-inline-start: 16px;
  font-size: 10.6px; line-height: 1.7; color: var(--muted);
  animation: ftExtra .32s ease both;
}
.ft-extra li:nth-child(2) { animation-delay: .05s; }
.ft-extra li:nth-child(3) { animation-delay: .1s; }
@keyframes ftExtra { from { opacity: 0; transform: translateX(4px); } to { opacity: 1; transform: none; } }
.ft-extra li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: 6px;
  width: 9px; height: 9px; border-radius: 3px;
  background: rgba(22, 163, 74, .12);
}
.ft-extra li::after {
  content: ""; position: absolute; inset-inline-start: 4px; top: 8.5px;
  width: 5px; height: 2.5px; border-left: 1.5px solid var(--green); border-bottom: 1.5px solid var(--green);
  transform: rotate(-45deg);
}
[data-theme="dark"] .ft-extra li { color: #94a3b8; }
[data-theme="dark"] .ft-extra li::before { background: rgba(34, 197, 94, .16); }
[data-theme="dark"] .ft-extra li::after { border-color: #4ade80; }

/* ---------- All-features grid ---------- */
.feat-all {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-sm);
}
.fa-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.fa-head-tx h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; }
.fa-head h3 .ic { width: 17px; height: 17px; color: var(--blue); }
.fa-sub { margin-top: 5px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.fa-sub b { color: var(--blue-dark); font-weight: 900; }
[data-theme="dark"] .fa-sub b { color: #93c5fd; }
.fa-ver {
  font-size: 10.5px; font-weight: 800; color: var(--blue);
  background: var(--blue-light); border-radius: 999px; padding: 3px 10px; white-space: nowrap; margin-top: 1px;
}
.fa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fa-col {
  --fa-c: #2563eb; --fa-d: #1e40af; --fa-soft: rgba(37, 99, 235, .06); --fa-ring: rgba(37, 99, 235, .18);
  position: relative; overflow: hidden;
  padding: 12px 12px 13px;
  border: 1px solid var(--border); border-radius: 14px;
  background: linear-gradient(180deg, var(--fa-soft) 0%, transparent 62%);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.fa-col::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2.5px;
  background: linear-gradient(90deg, var(--fa-c), transparent 92%);
  opacity: .55;
}
.fa-col:hover { transform: translateY(-2px); border-color: var(--fa-ring); box-shadow: var(--shadow-sm); }
.fa-col--table { --fa-c: #7c3aed; --fa-d: #5b21b6; --fa-soft: rgba(124, 58, 237, .06); --fa-ring: rgba(124, 58, 237, .2); }
.fa-col--secure { --fa-c: #16a34a; --fa-d: #15803d; --fa-soft: rgba(22, 163, 74, .06); --fa-ring: rgba(22, 163, 74, .2); }
.fa-col--data { --fa-c: #d97706; --fa-d: #b45309; --fa-soft: rgba(217, 119, 6, .07); --fa-ring: rgba(217, 119, 6, .22); }
[data-theme="dark"] .fa-col { --fa-d: #93c5fd; --fa-soft: rgba(37, 99, 235, .09); }
[data-theme="dark"] .fa-col--table { --fa-d: #c4b5fd; --fa-soft: rgba(124, 58, 237, .12); }
[data-theme="dark"] .fa-col--secure { --fa-d: #86efac; --fa-soft: rgba(22, 163, 74, .1); }
[data-theme="dark"] .fa-col--data { --fa-d: #fcd34d; --fa-soft: rgba(217, 119, 6, .12); }
.fa-col h4 {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11.6px; font-weight: 900; color: var(--fa-d);
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.fa-n {
  flex: none; font-size: 9.5px; font-weight: 800; color: var(--fa-d);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 7px;
}
.fa-col ul { list-style: none; display: flex; flex-direction: column; gap: 4.5px; }
.fa-col li {
  position: relative; padding-inline-start: 16px;
  font-size: 11.2px; color: var(--text); line-height: 1.65;
}
.fa-col li b { font-weight: 800; color: var(--fa-d); }
.fa-col li::before {
  content: ""; position: absolute; inset-inline-start: 1px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--green-soft);
}
.fa-col li::after {
  content: ""; position: absolute; inset-inline-start: 4px; top: 9.5px;
  width: 5px; height: 2.5px; border-left: 1.6px solid var(--green); border-bottom: 1.6px solid var(--green);
  transform: rotate(-45deg);
}

/* ---------- Tour responsive ---------- */
@media (max-width: 1120px) {
  .ft-tab-tx i { display: none; }
  .ft-tab-tx b { white-space: normal; overflow: visible; line-height: 1.3; }
  .ft-tab { padding: 8px; gap: 6px; }
  .ft-tab-ic { width: 26px; height: 26px; }
  .ft-body { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 960px) {
  .ft-tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    gap: 6px; padding-bottom: 3px; margin-bottom: 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .ft-tabs::-webkit-scrollbar { display: none; }
  .ft-tab { flex: 0 0 auto; min-width: 132px; }
  .ft-body { grid-template-columns: 1fr; }
  .ft-panel { padding: 15px 16px; }
  .ft-panel-item p { font-size: 12px; }
  .ft-tip { margin-top: 12px; }
  .fa-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 22px; }
}
@media (max-width: 700px) {
  .compare-table { min-width: 0; font-size: 10.4px; }
  .compare-table th { padding: 9px 7px; font-size: 10.2px; }
  .compare-table td { padding: 8px 7px; line-height: 1.65; }
  .compare-table td:nth-child(2), .compare-table td:nth-child(3) { width: 28%; }
  .compare-table td .ic { width: 12px; height: 12px; margin-left: 2px; }
  .ftour { padding: 10px; border-radius: 18px; }
  .ft-tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    gap: 6px; padding-bottom: 3px; margin-bottom: 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .ft-tabs::-webkit-scrollbar { display: none; }
  .ft-tab { flex: 0 0 auto; min-width: 128px; padding: 7px 9px; }
  .ft-tab-tx i { display: block; }
  .ft-pin { width: 18px; height: 18px; }
  .ft-pin b { width: 18px; height: 18px; font-size: 9.5px; }
  .ft-pin-lbl { display: none; }
  .ft-panel-item h3 { font-size: 15.5px; }
  .ft-steps { gap: 5px; }
  .feat-all { padding: 15px 16px 16px; }
}
@media (max-width: 480px) {
  .fa-grid { grid-template-columns: 1fr; gap: 14px; }
  .fa-col li { font-size: 11.2px; }
}

@media (prefers-reduced-motion: reduce) {
  .ft-tab.active .ft-tab-bar span { animation: none; width: 100%; }
  .ft-pin b::after { animation: none; opacity: 0; }
  .ft-shot.active, .ft-panel-item.active { animation: none; }
}

/* ---------- Demo product thumbnails (real photos) ---------- */
.demo-thumb.has-img {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .14);
  overflow: hidden;
}
.demo-thumb.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.demo-table tbody tr:hover .demo-thumb.has-img { transform: scale(1.12) rotate(0deg); }
[data-theme="dark"] .demo-thumb.has-img { background: #0f172a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }

/* ---------- Demo: plugin-faithful controls ---------- */
.demo-shell { position: relative; }

.demo-qtyfilter { display: inline-flex; align-items: center; gap: 6px; }
.demo-qtyfilter .demo-select { width: 62px; padding: 0 6px; text-align: center; font-weight: 700; }
.demo-qtyfilter .demo-input { width: 68px; text-align: center; }

.demo-op { position: relative; }
.demo-op-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 12px; max-width: 260px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.demo-op-btn:hover { border-color: #bfdbfe; }
.demo-op-btn[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.demo-op-btn > .ic { width: 14px; height: 14px; color: var(--blue); flex-shrink: 0; }
.demo-op-btn .chev { width: 13px; height: 13px; color: var(--muted); margin-right: auto; }
.demo-op-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 35;
  width: 248px; max-height: 312px; overflow-y: auto;
  padding: 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: 0 22px 44px -18px rgba(15,23,42,.35);
}
.demo-op-menu[hidden] { display: none; }
.demo-op-group {
  padding: 8px 8px 4px; font-size: 10px; font-weight: 800;
  letter-spacing: .2px; color: var(--muted); opacity: .85;
}
.demo-op-item {
  display: block; width: 100%; text-align: right;
  padding: 7px 9px; border: 0; background: transparent;
  font-family: inherit; appearance: none;
  border-radius: 8px;
  font-size: 12.3px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background .12s, color .12s;
}
.demo-op-item:hover { background: var(--blue-light); color: var(--blue-deeper); }
.demo-op-item.active { background: var(--blue); color: #fff; }
[data-theme="dark"] .demo-op-item:hover { background: #16233d; color: #bfdbfe; }

.demo-colbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: relative;
}
.demo-cols-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--muted);
  font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.demo-cols-btn:hover { border-color: #bfdbfe; color: var(--blue); }
.demo-cols-btn .ic { width: 13px; height: 13px; }
.demo-cols-btn .chev { width: 12px; height: 12px; }
.demo-col-menu {
  position: absolute; top: calc(100% - 2px); right: 12px; z-index: 34;
  min-width: 190px; padding: 8px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--surface);
  box-shadow: 0 20px 40px -18px rgba(15,23,42,.35);
  display: grid; gap: 2px;
}
.demo-col-menu[hidden] { display: none; }
.demo-col-menu label {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 7px; border-radius: 7px; font-size: 12px;
  color: var(--text); cursor: pointer;
}
.demo-col-menu label:hover { background: var(--surface-2); }
.demo-col-menu input { accent-color: var(--blue); width: 14px; height: 14px; }
.demo-colbar-note { font-size: 10.5px; color: var(--muted); }

#demo-table.hide-col-id th:nth-child(5), #demo-table.hide-col-id td:nth-child(5),
#demo-table.hide-col-sku th:nth-child(6), #demo-table.hide-col-sku td:nth-child(6),
#demo-table.hide-col-cat th:nth-child(7), #demo-table.hide-col-cat td:nth-child(7),
#demo-table.hide-col-discount th:nth-child(10), #demo-table.hide-col-discount td:nth-child(10),
#demo-table.hide-col-qty th:nth-child(12), #demo-table.hide-col-qty td:nth-child(12),
#demo-table.hide-col-updated th:nth-child(14), #demo-table.hide-col-updated td:nth-child(14) { display: none; }

/* manual stock state */
.stock-btn.manual { background: var(--surface-2); color: var(--muted); }
[data-theme="dark"] .stock-btn.manual { background: #1a2337; color: #93a4bd; }
.cell-off { color: var(--muted); }

/* plugin-style preview modal */
.demo-modal {
  position: absolute; inset: 0; z-index: 45;
  display: grid; place-items: center; padding: 18px;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px);
  animation: demoModalIn .2s ease both;
}
.demo-modal[hidden] { display: none; }
@keyframes demoModalIn { from { opacity: 0; } to { opacity: 1; } }
.demo-modal-card {
  width: min(720px, 100%); max-height: 88%;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 40px 90px -30px rgba(15,23,42,.5);
  overflow: hidden;
  animation: demoCardIn .22s ease both;
}
@keyframes demoCardIn { from { transform: translateY(10px) scale(.98); opacity: .6; } to { transform: none; opacity: 1; } }
.demo-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.demo-modal-head h4 { font-size: 14px; font-weight: 800; }
.demo-modal-x {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; color: var(--muted);
}
.demo-modal-x:hover { background: var(--surface-2); color: var(--text); }
.demo-modal-x .ic { width: 14px; height: 14px; }
.demo-modal-body { padding: 14px 16px; overflow-y: auto; }
.demo-modal-sum { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.demo-modal-note { font-size: 12.5px; color: var(--muted); padding: 12px 4px; text-align: center; }
.demo-pv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.demo-pv-table th {
  padding: 8px 9px; text-align: right; font-size: 10.5px; font-weight: 700;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border);
}
.demo-pv-table td {
  padding: 8px 9px; border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.demo-pv-table td.before { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(100,116,139,.5); }
.demo-pv-table td.after { color: #059669; font-weight: 800; }
[data-theme="dark"] .demo-pv-table td.after { color: #6ee7b7; }
.demo-modal-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2);
}

@media (max-width: 560px) {
  .demo-qtyfilter .demo-select { width: 52px; }
  .demo-qtyfilter .demo-input { width: 56px; }
  .demo-op-btn { max-width: 190px; font-size: 11.5px; }
  .demo-op-menu { width: 220px; }
  .demo-modal { padding: 10px; }
  .demo-modal-card { max-height: 92%; }
}

/* ---------- Theme hint (screenshots have dark versions) ---------- */
.theme-hint {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-top: 14px; padding: 7px 8px 7px 16px;
  border: 1px solid var(--blue-pale); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.theme-hint .ic { width: 17px; height: 17px; color: var(--blue); flex: 0 0 auto; }
.theme-hint-btn {
  font: inherit; font-size: 12.5px; font-weight: 800; line-height: 1.2;
  color: #fff; background: var(--blue); border: 0;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .65);
  transition: background .15s ease, transform .15s ease;
}
.theme-hint-btn:hover { background: var(--blue-dark); transform: translateY(-1px); }
.theme-hint-btn:active { transform: translateY(0); }
.theme-hint-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[data-theme="dark"] .theme-hint { background: #101b30; border-color: #2b3d61; }
[data-theme="dark"] .theme-hint .ic { color: #93c5fd; }
[data-theme="dark"] .theme-hint-btn { color: #fff; background: var(--blue); }
[data-theme="dark"] .theme-hint-btn:hover { background: #3b82f6; }
@media (max-width: 560px) {
  .theme-hint { font-size: 12px; padding: 7px 7px 7px 13px; }
  .theme-hint-btn { font-size: 12px; padding: 8px 12px; }
}

/* ---------- "تیره" badge on the header theme toggle ---------- */
.theme-toggle { position: relative; }
.theme-new {
  position: absolute; top: -9px; inset-inline-end: -12px;
  z-index: 2; pointer-events: none;
  font-size: 9px; font-weight: 900; line-height: 1;
  padding: 4px 6px; border-radius: 999px;
  background: var(--blue); color: #fff; white-space: nowrap;
  box-shadow: 0 0 0 3px var(--nav-bg), 0 4px 10px -2px rgba(37, 99, 235, .55);
  animation: themeNewPulse 2.6s ease-in-out infinite;
}
[data-theme="dark"] .theme-new { display: none; }
@keyframes themeNewPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-new { animation: none; }
}
