/* ================================================================
   Personal Site — v7 stylesheet (rewritten)
   Goals:
   - Single source of truth: all surfaces consume semantic tokens.
   - No hardcoded dark-mode rgba(255,255,255,*) overlays.
   - No body::before grid pattern (removed by request).
   - Light themes stay genuinely light; dark themes stay dark.
   - Button text uses --text-on-primary for WCAG-safe contrast.
   - All sections share one consistent color system.
   ================================================================ */

:root{
  --sidebar-x:300px;
  --radius:var(--radius-lg);
  --radius-sm:var(--radius-md);
  --radius-xs:var(--radius-sm);
  --shadow:0 24px 70px var(--shadow-color);
  --shadow-soft:0 12px 32px var(--shadow-color);
  --shadow-lift:0 22px 60px var(--shadow-color);
  --easing:cubic-bezier(.4,0,.2,1);

  /* Theme-token aliases (resolved by the runtime inline <style> block). */
  --theme-bg:var(--background);
  --theme-surface:var(--surface);
  --theme-surface-2:var(--surface-container);
  --theme-surface-3:var(--surface-container-high);
  --theme-text:var(--text-primary);
  --theme-soft:var(--text-secondary);
  --theme-muted:var(--text-muted);
  --theme-line:var(--border);
  --theme-accent:var(--primary);
  --theme-accent-hover:var(--primary-hover);
  --theme-control-bg:var(--input-background);
  --theme-control-text:var(--text-primary);
  --theme-button-bg:var(--primary);
  --theme-button-text:var(--text-on-primary);
  --theme-button-border:var(--primary);
  --theme-radius:var(--radius-lg);
  --theme-shadow:0 20px 60px var(--shadow-color);
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  min-height:100vh;
  background:var(--theme-bg);
  color:var(--theme-text);
  font-family:Inter,Vazirmatn,sans-serif;
  line-height:1.85;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body.lang-fa,body.lang-ar{font-family:Vazirmatn,sans-serif}
body.lang-ru{font-family:Montserrat,sans-serif}
body.lang-zh{font-family:"Noto Sans SC",sans-serif}
body.lang-fa,body.lang-ar{padding-right:var(--sidebar-w)}
body:not(.lang-fa):not(.lang-ar){padding-left:var(--sidebar-w)}
a,button,input,textarea,select{font:inherit}
button{cursor:pointer}
a{color:inherit}
a:focus-visible,button:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--theme-accent);outline-offset:3px}
.font-heading{font-family:"Space Grotesk",Vazirmatn,sans-serif}

/* ----------------------------- Sidebar ----------------------------- */
/* v58: when the sidebar is closed it no longer slides out of the page —
 * it collapses to a narrow icon rail on the same edge, keeping its shape
 * (same background, border, blur). The main content keeps a 72px margin
 * so the layout never goes fully edge-to-edge. All rail rules live in
 * the min-width:841px block so the mobile layout (sidebar hidden, bottom
 * mobile-nav, 84px body bottom padding) is untouched. */
:root{--sidebar-rail-w:72px}
.sidebar{
  position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);padding:20px;z-index:50;
  display:flex;flex-direction:column;
  background:var(--theme-surface);
  backdrop-filter:blur(28px) saturate(1.2);
  -webkit-backdrop-filter:blur(28px) saturate(1.2);
  border-right:1px solid var(--theme-line);
  overflow:auto;
}
.lang-fa .sidebar,.lang-ar .sidebar{left:auto;right:0;border-right:0;border-left:1px solid var(--theme-line)}

.sidebar-toggle{
  position:fixed;top:18px;left:calc(var(--sidebar-w) + 14px);z-index:70;
  width:44px;height:44px;
  border:1px solid var(--theme-line);border-radius:var(--radius-sm);
  background:var(--theme-surface);color:var(--theme-text);
  box-shadow:var(--shadow-soft);
  transition:transform .3s var(--easing),border-color .3s var(--easing),color .3s var(--easing),left .3s var(--easing),right .3s var(--easing);
}
.lang-fa .sidebar-toggle,.lang-ar .sidebar-toggle{left:auto;right:calc(var(--sidebar-w) + 14px)}
.sidebar-toggle:hover{border-color:var(--theme-accent);color:var(--theme-accent-hover);transform:translateY(-2px)}

/* v58: collapsed icon rail — desktop only (≥841px). */
@media(min-width:841px){
  /* The sidebar shrinks instead of leaving the viewport. */
  .sidebar{transition:width .3s var(--easing),padding .3s var(--easing);overflow-x:hidden}
  body.sidebar-closed .sidebar{width:var(--sidebar-rail-w);padding:14px 13px 10px}

  /* Body keeps a margin for the rail (was: padding 0 when it vanished). */
  body.lang-fa.sidebar-closed,body.lang-ar.sidebar-closed{padding:0 var(--sidebar-rail-w) 0 0!important}
  body:not(.lang-fa):not(.lang-ar).sidebar-closed{padding:0 0 0 var(--sidebar-rail-w)!important}

  /* Toggle stays glued to the sidebar edge in both states (no jump). */
  body.sidebar-closed .sidebar-toggle{left:calc(var(--sidebar-rail-w) + 14px)}
  .lang-fa.sidebar-closed .sidebar-toggle,.lang-ar.sidebar-closed .sidebar-toggle{right:calc(var(--sidebar-rail-w) + 14px)}

  /* Compact avatar: photo tile only, identity text hidden. */
  body.sidebar-closed .profile-card{padding:4px;border-radius:16px}
  body.sidebar-closed .photo-placeholder{aspect-ratio:1;border-radius:12px}
  body.sidebar-closed .photo-placeholder span{display:none}
  body.sidebar-closed .id-block{display:none}

  /* Search: widget hidden, icon shortcut to the search page shown. */
  .sidebar-search .rail-search-link{display:none}
  body.sidebar-closed .sidebar-search{margin:14px 0 2px}
  body.sidebar-closed .sidebar-search .search-widget{display:none}
  body.sidebar-closed .sidebar-search .rail-search-link{
    display:flex;align-items:center;justify-content:center;
    width:44px;height:44px;margin-inline:auto;
    border:1px solid var(--theme-line);border-radius:var(--radius-sm);
    background:var(--theme-control-bg);color:var(--theme-soft);
    font-size:1.15rem;text-decoration:none;
    transition:border-color .2s var(--easing),color .2s var(--easing);
  }
  body.sidebar-closed .sidebar-search .rail-search-link:hover{border-color:var(--theme-accent);color:var(--theme-accent-hover)}

  /* Nav tabs: icon-only squares (glyph is language-neutral). */
  body.sidebar-closed .side-nav{gap:6px;margin-top:14px}
  body.sidebar-closed .side-nav button{
    width:44px;min-width:44px;min-height:44px;padding:0;margin-inline:auto;
    display:grid;place-items:center;font-size:1.12rem;
  }
  .side-nav .tab-icon{display:none}
  body.sidebar-closed .side-nav .tab-icon{display:block;line-height:1}
  body.sidebar-closed .side-nav .tab-label{display:none}
  body.sidebar-closed .side-nav button.active{box-shadow:inset 0 3px 0 var(--theme-accent)}

  /* Module CTAs: icon-only squares. */
  body.sidebar-closed .store-cta{
    width:44px;min-height:44px;padding:0;margin:10px auto 0;gap:0;
  }
  body.sidebar-closed .store-cta .store-cta-label{display:none}
  body.sidebar-closed .store-cta .store-cta-icon{width:100%;height:100%;border-radius:var(--radius-sm)}

  /* Language switch and footer return when expanded. */
  body.sidebar-closed .lang-switch{display:none}
  body.sidebar-closed .sidebar-foot{display:none}
}

.profile-card{
  padding:14px;
  border:1px solid var(--theme-line);
  border-radius:24px;
  background:var(--theme-surface);
  box-shadow:var(--shadow-soft);
}
.photo-placeholder{
  aspect-ratio:4/4.6;border-radius:17px;display:grid;place-items:center;
  background:
    radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--theme-accent) 24%, transparent), transparent 32%),
    linear-gradient(145deg,var(--theme-surface-3),var(--theme-surface-2));
  border:1px solid var(--theme-line);
  color:var(--theme-muted);font-size:.66rem;letter-spacing:.16em;text-transform:uppercase;
}
.id-block{text-align:center;padding:18px 4px 4px}
.id-block .name{font-size:1.4rem;font-weight:750;letter-spacing:-.02em;color:var(--theme-text)}
.id-block .rule{width:42px;height:2px;background:linear-gradient(90deg,transparent,var(--theme-accent),transparent);margin:10px auto}
.id-block .tagline{color:var(--theme-accent-hover);font-size:.78rem;font-weight:500}
.id-block .role{color:var(--theme-muted);font-size:.7rem;letter-spacing:.02em}
.side-nav{display:grid;gap:5px;margin-top:20px}
.side-nav button{
  min-height:44px;padding:9px 13px;
  border:1px solid transparent;border-radius:var(--radius-sm);
  background:transparent;color:var(--theme-soft);
  text-align:start;
  transition:color .2s var(--easing),background .2s var(--easing),border-color .2s var(--easing);
}
.side-nav button:hover{color:var(--theme-text);background:var(--hover-overlay)}
.side-nav button.active{
  color:var(--selected-text);
  background:var(--selected-background);
  border-color:var(--theme-accent);
  box-shadow:inset 3px 0 var(--theme-accent);
}
[dir=rtl] .side-nav button.active{box-shadow:inset -3px 0 var(--theme-accent)}
.lang-switch{margin-top:18px;display:flex;align-items:center;gap:8px}
.lang-label{font-size:.7rem;color:var(--theme-muted);letter-spacing:.04em}
.lang-switch select{
  min-width:0;flex:1;
  border:1px solid var(--theme-line);border-radius:12px;
  background:var(--theme-control-bg);color:var(--theme-control-text);padding:9px 11px;
  transition:border-color .2s var(--easing);
}
.lang-switch select:hover{border-color:var(--border-strong)}
.sidebar-foot{margin-top:auto;padding-top:18px;text-align:center;color:var(--theme-muted);font-size:.64rem;letter-spacing:.06em}

/* ----------------------------- Main panels ----------------------------- */
main{width:100%;min-height:100vh}
.panel{
  display:none;position:relative;min-height:100vh;
  width:min(1180px,100%);margin:0 auto;
  padding:clamp(82px,9vw,125px) clamp(22px,5vw,72px) 76px;
}
.panel.active{
  display:flex;flex-direction:column;justify-content:center;
  animation:rise .45s var(--easing) both;
}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* ----------------------------- Intro (v59 unified capsule) -----------------------------
 * ONE large capsule: image on top, intro text directly below it, inside the
 * SAME rounded container. The capsule width follows the admin's intro image
 * width setting (--intro-image-width, set on <body> by {lang}/index.php) but
 * is hard-capped to 100% so it can never overflow its panel. overflow:hidden
 * clips the image corners to the capsule radius — nothing escapes the capsule. */
#intro.panel.active{display:block;overflow:visible}
.intro-capsule{
  position:relative;z-index:2;
  width:100%;
  max-width:min(100%, max(320px, var(--intro-image-width, 600px)));
  min-width:0;box-sizing:border-box;
  margin-inline:auto;
  border:1px solid var(--theme-line);
  border-radius:clamp(18px,3vw,28px);
  background:var(--theme-surface);
  box-shadow:0 24px 80px var(--shadow-color);
  overflow:hidden;
}
.intro-capsule-media{position:relative;width:100%;min-width:0;display:flow-root}
/* v59: the image is IN FLOW at the top of the capsule (no longer absolutely
 * positioned). Legacy Move-editor translate offsets are neutralised with a
 * higher-specificity !important rule — same approach the mobile presentation
 * has used since v54. The capsule itself remains movable as one unit. */
#intro .intro-image{
  position:static!important;display:block!important;
  width:100%!important;max-width:100%!important;height:auto!important;
  max-height:min(62vh,540px);
  object-fit:contain;object-position:center;
  left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  margin:0!important;transform:none!important;translate:none!important;
  border-radius:0!important;box-shadow:none;
}
.intro-inner{
  position:relative;z-index:2;
  min-width:0;box-sizing:border-box;
  padding:clamp(24px,4vw,44px) clamp(20px,3.5vw,42px);
  text-align:start;
  overflow-wrap:anywhere;
}
#intro .intro-inner .eyebrow{display:inline-flex;max-width:100%;margin:0 0 12px}
#intro .intro-inner h1{max-width:100%!important;margin:6px 0 0;overflow-wrap:anywhere;word-break:break-word}
#intro .intro-inner .lede{max-width:100%!important;margin:16px 0 0}
#intro .intro-inner p{max-width:100%;overflow-wrap:anywhere}
#intro .intro-inner a{max-width:100%;overflow-wrap:anywhere}

/* v59: collapsible intro text (admin toggle, default OFF).
 * main.js computes the collapsed height from the REAL rendered line-height
 * (4 lines) so the clamp adapts to every responsive font size, and only
 * reveals the toggle when the text actually overflows. */
.intro-lede.intro-collapsible{position:relative}
.intro-lede.is-clamped{overflow:hidden}
.intro-lede.is-clamped::after{
  content:"";position:absolute;inset-inline:0;bottom:0;height:2.4em;
  background:linear-gradient(to bottom, transparent, var(--theme-surface));
  pointer-events:none;
}
.intro-toggle-btn{
  display:inline-flex;align-items:center;gap:8px;
  margin-top:14px;padding:9px 16px;
  border:1px solid var(--theme-line);border-radius:999px;
  background:transparent;color:var(--theme-accent-hover);
  font:inherit;font-size:.85rem;font-weight:600;cursor:pointer;
  transition:border-color .2s var(--easing),background .2s var(--easing),color .2s var(--easing);
}
.intro-toggle-btn:hover{border-color:var(--theme-accent);background:var(--hover-overlay)}
.intro-toggle-arrow{display:inline-block;font-size:.8em;line-height:1;transition:transform .25s var(--easing)}
.intro-toggle-btn[aria-expanded="true"] .intro-toggle-arrow{transform:rotate(180deg)}
.eyebrow{
  display:inline-flex;align-items:center;gap:10px;
  color:var(--theme-accent-hover);font-size:.78rem;font-weight:600;
  letter-spacing:.1em;text-transform:uppercase;
}
.eyebrow:before{content:"";width:34px;height:1px;background:var(--theme-accent)}
h1{
  font-size:clamp(3.5rem,8vw,7.2rem);
  line-height:.96;letter-spacing:-.065em;font-weight:700;
  margin-top:18px;max-width:9ch;
  color:var(--theme-text);
}
.lede{
  max-width:62ch;margin-top:28px;
  color:var(--theme-soft);
  font-size:clamp(1rem,1.45vw,1.18rem);
  font-weight:400;
}
.section-head{
  display:flex;align-items:flex-end;justify-content:space-between;
  gap:20px;margin-bottom:34px;
}
.section-kicker{
  color:var(--theme-accent);font-size:.68rem;font-weight:600;
  letter-spacing:.16em;text-transform:uppercase;
}
.section-title{
  font-size:clamp(2rem,4vw,3.15rem);
  line-height:1.1;letter-spacing:-.04em;font-weight:700;
  color:var(--theme-text);
}

/* ----------------------------- Paragraph defaults ----------------------------- */
p{color:var(--theme-soft);font-size:1rem;max-width:74ch}
p+p{margin-top:16px}

/* ----------------------------- Cards / grid ----------------------------- */
/* Works grid: 2 columns on desktop (cards have frame).
   Store grid: 4 columns on desktop, centered. */
.works-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.store-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;justify-content:center;justify-items:center}

.work,.product-card,.article-card,.social-button,.t-item{
  border:1px solid var(--theme-line);
  background:var(--theme-surface);
  border-radius:var(--theme-radius);
  transition:transform .3s var(--easing),border-color .3s var(--easing),box-shadow .3s var(--easing),background .3s var(--easing);
}
.work{padding:14px}
.product-card{width:100%}
.work:hover,.product-card:hover,.t-item:hover{
  transform:translateY(-5px);
  border-color:var(--theme-accent);
  box-shadow:var(--shadow-lift);
}

.work-visual,.product-visual{
  aspect-ratio:16/10;border-radius:var(--radius-sm);
  display:grid;place-items:center;
  /* No second background — transparent so the card surface shows through.
     Only a subtle inner border separates the visual area from card body. */
  background:transparent;
  border:1px solid var(--theme-line);
  color:var(--theme-muted);font-size:.65rem;letter-spacing:.14em;text-transform:uppercase;
  overflow:hidden;
}
.work h3{font-size:1.14rem;margin-top:16px;font-weight:600;color:var(--theme-text)}
/* Decorative underline under work title removed by request — no visible line. */
.work .underline{display:none}
.work .alt,.work .tag{font-size:.74rem;color:var(--theme-muted)}
.work .tag{color:var(--theme-accent-hover);display:inline-block;margin-top:5px;font-weight:500}
.work .desc{font-size:.86rem;margin-top:8px;color:var(--theme-soft)}

/* ----------------------------- Articles ----------------------------- */
.articles-list,.social-list{display:grid;gap:6px}
/* Article cards have no visible frame — flat rows, no border lines. */
.article-card{overflow:hidden;border:0;background:transparent;box-shadow:none;border-radius:0}
/* Article rows are flat — no border lines, no frame. Subtle hover background only. */
.article-row,.social-row{
  display:flex;align-items:center;justify-content:space-between;
  gap:18px;padding:14px 18px;
  border:0;border-radius:10px;
  text-decoration:none;
  background:transparent;
  transition:background .25s var(--easing),color .25s var(--easing),transform .25s var(--easing);
}
.article-card .article-row{
  width:100%;border:0;border-radius:0;background:transparent;
  color:inherit;text-align:inherit;cursor:pointer;
}
.article-row:hover,.social-row:hover{
  background:var(--hover-overlay);
  border-color:transparent;
  transform:translateX(2px);
}
[dir=rtl] .article-row:hover,[dir=rtl] .social-row:hover{transform:translateX(-2px)}
.a-title{color:var(--theme-text);font-weight:500}
.a-meta{color:var(--theme-muted);font-size:.76rem;letter-spacing:.02em}
.arrow{color:var(--theme-accent);font-size:1.05rem;transition:transform .25s var(--easing)}
.article-row:hover .arrow,.social-row:hover .arrow{transform:translateX(3px)}
[dir=rtl] .article-row:hover .arrow,[dir=rtl] .social-row:hover .arrow{transform:translateX(-3px)}
.article-content{padding:0 20px 20px}
.article-content p{color:var(--theme-soft)}
.article-read-btn{
  display:inline-flex;margin-top:14px;padding:9px 13px;
  border:1px solid var(--theme-line);border-radius:var(--radius-xs);
  text-decoration:none;color:var(--theme-accent-hover);
  transition:border-color .2s var(--easing),background .2s var(--easing);
}
.article-read-btn:hover{border-color:var(--theme-accent);background:var(--hover-overlay)}

/* ----------------------------- Timeline (resume) ----------------------------- */
.timeline{display:grid;gap:14px}
.t-item{padding:22px 24px}
.t-date{color:var(--theme-accent);font-size:.75rem;font-weight:600;letter-spacing:.05em}
.t-item h3{margin-top:4px;font-weight:600;color:var(--theme-text)}
.t-item p{font-size:.88rem;color:var(--theme-soft);margin-top:4px}

/* ----------------------------- Store ----------------------------- */
#store .section-head{justify-content:center;text-align:center;margin-inline:auto}
#store .store-intro{text-align:center;margin-inline:auto;max-width:60ch}
#store .store-grid{margin-inline:auto}
.store-intro{color:var(--theme-soft);margin-bottom:20px}
.store-box{
  padding:32px;
  border:1px solid var(--theme-line);border-radius:var(--theme-radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--theme-accent) 9%, transparent), color-mix(in srgb, var(--theme-surface) 100%, transparent));
  box-shadow:var(--shadow-soft);
}
.badge{
  display:inline-flex;align-items:center;gap:8px;
  color:var(--theme-accent-hover);
  border:1px solid var(--theme-accent);border-radius:999px;
  padding:5px 12px;font-size:.72rem;font-weight:500;
  margin-bottom:14px;
}
.dot{width:6px;height:6px;border-radius:50%;background:var(--theme-accent)}
.mobile-nav,.mobile-lang-sheet{display:none}

/* ----------------------------- Detail / store shared ----------------------------- */
.content-image{
  max-width:100%;height:auto;border-radius:16px;
  box-shadow:0 12px 36px var(--shadow-color);
}.product-card{overflow:hidden;padding:0}
.product-main-link{text-decoration:none;color:inherit}
.product-info{padding:18px}
.product-top{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.product-type{color:var(--theme-accent);font-size:.68rem;font-weight:600;letter-spacing:.05em}
.product-price{color:var(--theme-accent-hover);font-weight:700;font-size:1rem}
.product-info h3{color:var(--theme-text);font-size:1.1rem;font-weight:600;margin-top:6px}
.product-info p{color:var(--theme-soft);font-size:.88rem;margin-top:6px}
.product-actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
.product-btn,.checkout-btn,.detail-cart-btn,.back-link,.cart-link{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:10px 14px;
  border:1px solid var(--theme-line);border-radius:11px;
  text-decoration:none;
  background:var(--theme-surface-2);
  color:var(--theme-text);
  transition:border-color .2s var(--easing),background .2s var(--easing),transform .15s var(--easing);
}
.product-btn:hover,.checkout-btn:hover,.detail-cart-btn:hover,.back-link:hover,.cart-link:hover{
  border-color:var(--theme-accent);
  background:var(--hover-overlay);
}
.product-btn:active,.checkout-btn:active,.detail-cart-btn:active{transform:translateY(1px)}
.primary-btn{
  border-color:var(--theme-button-border);
  background:var(--theme-button-bg);
  color:var(--theme-button-text);
  font-weight:700;
  box-shadow:0 8px 24px color-mix(in srgb, var(--theme-accent) 25%, transparent);
  transition:transform .2s var(--easing),box-shadow .2s var(--easing);
}
.primary-btn:hover{transform:translateY(-2px);box-shadow:0 12px 32px color-mix(in srgb, var(--theme-accent) 35%, transparent)}
.primary-btn:active{transform:translateY(0)}

/* ----------------------------- Responsive ----------------------------- */
@media(max-width:1040px){
  :root{--sidebar-w:260px}
  .panel{padding-inline:42px}
  /* Tablet: works goes to 2 cols, store goes to 2 cols (still 4-per-row look on tablet is too tight). */
  .works-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .store-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:840px){
  body,body.lang-fa,body.lang-ar{padding:0 0 84px!important}
  .sidebar,.sidebar-toggle{display:none}
  .panel{width:100%;min-height:auto;padding:58px 20px 46px}
  .panel.active{min-height:calc(100vh - 84px);display:flex;flex-direction:column;justify-content:flex-start}
  h1{font-size:clamp(3rem,14vw,5.4rem)}
  .section-head{align-items:flex-start;flex-direction:column;margin-bottom:22px;gap:12px}
  .section-head .cart-link{align-self:flex-start}
  /* Mobile: both works and store collapse to a single column. */
  .works-grid,.store-grid{grid-template-columns:1fr}
  /* Keep store visually centered even when collapsed to 1 column. */
  #store .section-head{align-items:center;text-align:center}
  #store .section-head .cart-link{align-self:center}
  .mobile-nav{
    /* v54: one auto-sized column per quick action — works for 6–9 items
       regardless of which sections/store are enabled. */
    position:fixed;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:3px;
    left:8px;right:8px;bottom:8px;z-index:100;padding:8px;
    border:1px solid var(--theme-line);border-radius:20px;
    background:var(--theme-surface);
    backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);
    box-shadow:0 20px 60px var(--shadow-color);
  }
  .mobile-nav button,.mobile-nav .mobile-store-cta,.mobile-nav .mobile-search-link{
    min-width:0;border:0;border-radius:12px;padding:9px 2px;
    background:transparent;color:var(--theme-muted);
    display:flex;align-items:center;justify-content:center;
    font-size:.58rem;line-height:1.2;
    transition:color .2s,background .2s;
  }
  .mobile-nav .mobile-store-cta,.mobile-nav .mobile-search-link{
    border:1px solid color-mix(in srgb, var(--theme-accent) 35%, transparent);
    background:color-mix(in srgb, var(--theme-accent) 10%, transparent);
    color:var(--theme-text);font-weight:700;text-decoration:none;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  .mobile-nav button.active{color:var(--theme-accent-hover);background:var(--selected-background)}
  .mobile-lang{font-size:.61rem!important;flex-direction:column;gap:2px}
  .mobile-lang span{font-size:.5rem}
  .mobile-lang-sheet{position:fixed;inset:0;z-index:110;background:var(--backdrop);backdrop-filter:blur(8px);padding:16px;align-items:flex-end;justify-content:center}
  .mobile-lang-sheet.open{display:flex}
  .mobile-lang-card{width:min(100%,430px);padding:18px;border:1px solid var(--theme-line);border-radius:22px;background:var(--theme-control-bg);display:grid;gap:7px;box-shadow:var(--shadow-lift)}
  .mobile-lang-card strong{color:var(--theme-accent-hover);padding:4px 8px 8px}
  .mobile-lang-card a{padding:12px 13px;border-radius:11px;background:var(--theme-surface-2);text-decoration:none;color:var(--theme-text)}
  .mobile-lang-card a[aria-current=page]{background:var(--selected-background);color:var(--selected-text)}

  /* =================================================================
     INTRO — mobile refinements for the v59 unified capsule.
     The capsule itself (image above text, one container) is defined
     unscoped above and already works at every width; these rules only
     tighten paddings/fonts/heights for small screens.
     ================================================================= */
  #intro.panel.active{display:flex;flex-direction:column;justify-content:flex-start;overflow:visible}
  .intro-capsule{border-radius:18px;box-shadow:var(--shadow-soft)}
  #intro .intro-image{max-height:min(56vh,480px)}
  .intro-inner{padding:22px 18px}
  #intro .intro-inner .eyebrow{letter-spacing:.06em;font-size:.74rem}
  #intro .intro-inner h1{
    font-size:clamp(2rem,10.5vw,3.6rem)!important;
    line-height:1.08;letter-spacing:-.02em;
  }
  #intro .intro-inner .lede{
    font-size:clamp(.95rem,3.9vw,1.08rem)!important;
    line-height:1.85;color:var(--theme-soft);
  }
  .intro-toggle-btn{padding:8px 14px;font-size:.8rem}

  .detail-panel .detail-actions{flex-direction:column;align-items:stretch}
  .detail-panel .detail-actions .back-link,
  .detail-panel .detail-actions .cart-link{width:100%;justify-content:center}
  .cart-item{grid-template-columns:auto 1fr auto;gap:10px;padding:12px}
  .cart-item form{grid-column:2/-1;margin-top:6px}
  .cart-item form button{width:100%;height:32px}
  .store-box{padding:22px 16px}
  .timeline{gap:10px}
  .t-item{padding:16px}
  .about-item{padding-inline-start:15px}
  .about-item summary{grid-template-columns:42px minmax(0,1fr);gap:8px}
  .about-item .expand-body{padding-inline-start:0;padding-top:14px}
  .article-row,.social-row{flex-wrap:wrap;gap:10px;padding:14px}
  .article-content{padding:0 16px 16px}
  .product-info{padding:14px}
  .product-actions{gap:6px}
  .product-btn,.back-link,.cart-link,.checkout-btn,.detail-cart-btn{padding:9px 12px;font-size:.88rem}
}
@media(max-width:520px){
  .panel{padding-inline:15px}
  .mobile-nav{left:5px;right:5px;bottom:5px}
  .mobile-nav button{padding:10px 2px;font-size:.55rem}
  .article-row,.social-row{padding:12px}
  .store-box{padding:18px 14px}
  .product-actions .product-btn{flex:1}
  .product-info{padding:12px}
  .product-info h3{font-size:1rem}
  .product-info p{font-size:.82rem}
  .cart-item{padding:10px;gap:8px}
  .cart-item-icon{width:30px;height:30px}
  .cart-item-main a{font-size:.9rem}
  .cart-item-main span{font-size:.72rem}
  .cart-total{padding:12px}
  .cart-total strong{font-size:1.15rem}
  .detail-panel .detail-title{font-size:clamp(1.5rem,5vw,2rem)}
  .detail-panel .detail-meta{font-size:1.1rem}
  .detail-panel .detail-text p{font-size:.95rem}
}
@media(prefers-reduced-motion:reduce){*,html{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* ================================================================
   ABOUT / RESUME VISUAL SYSTEM
   ================================================================ */
.about-timeline{position:relative;gap:14px}
.about-timeline:before{content:"";position:absolute;inset-inline-start:17px;top:16px;bottom:16px;width:1px;background:linear-gradient(180deg,var(--theme-accent),color-mix(in srgb, var(--theme-line) 50%, transparent));pointer-events:none}
.about-item{position:relative;padding-inline-start:22px}
.about-item summary{position:relative;display:grid;grid-template-columns:58px minmax(0,1fr);align-items:center;gap:12px;cursor:pointer;list-style:none}
.about-item summary::-webkit-details-marker{display:none}
.about-item .about-index{position:relative;z-index:2;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--theme-surface-2);border:1px solid var(--theme-accent);box-shadow:0 0 0 6px var(--theme-surface);color:var(--theme-accent-hover);font-variant-numeric:tabular-nums;font-weight:600}
.about-item h3{margin:0;font-size:clamp(1rem,2vw,1.25rem);font-weight:600;color:var(--theme-text)}
.about-item .expand-body{padding-inline-start:70px;padding-top:18px}
.about-item .expand-body p{max-width:70ch;color:var(--theme-soft)}
.about-item .content-image{max-width:min(620px,100%);margin-bottom:18px}
.about-item[open]{border-color:var(--theme-accent);background:var(--hover-overlay)}
@media(max-width:600px){.about-timeline:before{inset-inline-start:14px}.about-item{padding-inline-start:15px}.about-item summary{grid-template-columns:46px minmax(0,1fr);gap:8px}.about-item .expand-body{padding-inline-start:0;padding-top:16px}.about-item .about-index{width:30px;height:30px}
  /* v56: tall content images (about items, article/work details) must not
     stretch the page on phones — cap the height; width is auto so the
     aspect ratio is preserved without any distortion or crop. */
  .content-image{width:auto;max-width:100%;max-height:min(66vh,560px);object-fit:contain}
  .about-item .content-image{max-width:100%;max-height:min(66vh,560px);object-fit:contain;margin-inline:auto;display:block}}

/* ================================================================
   SOCIAL SECTION
   ================================================================ */
.social-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.social-card{
  display:grid;grid-template-columns:50px minmax(0,1fr) auto;
  align-items:center;gap:14px;
  padding:18px 20px;min-height:86px;
  text-decoration:none!important;
  transition:transform .3s var(--easing),border-color .3s var(--easing),background .3s var(--easing);
}
.social-card:hover{transform:translateY(-3px);border-color:var(--theme-accent)}
.social-icon-badge{
  width:50px;height:50px;display:grid;place-items:center;
  border-radius:15px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--theme-accent) 20%, transparent), color-mix(in srgb, var(--theme-accent) 4%, transparent));
  border:1px solid var(--theme-accent);
  color:var(--theme-accent-hover);font-size:.8rem;font-weight:800;letter-spacing:.03em;
  transition:transform .3s var(--easing),border-color .3s var(--easing),background .3s var(--easing);
}
.social-copy{display:grid;gap:2px;min-width:0}
.social-copy b{font-size:.98rem;color:var(--theme-text);font-weight:600}
.social-copy small{font-size:.68rem;color:var(--theme-muted);letter-spacing:.08em;text-transform:uppercase}
.social-card.is-disabled{opacity:.55;cursor:default}
.social-card.is-disabled .arrow{display:none}
.social-card:hover .social-icon-badge{transform:translateY(-2px);border-color:var(--theme-accent);background:linear-gradient(145deg, color-mix(in srgb, var(--theme-accent) 28%, transparent), color-mix(in srgb, var(--theme-accent) 8%, transparent))}
@media(max-width:700px){.social-grid{grid-template-columns:1fr}.social-card{min-height:78px;padding:15px}}

/* ================================================================
   DETAIL PAGE REFINEMENTS
   ================================================================ */
.detail-panel .detail-title{font-size:clamp(2rem,5vw,3rem);font-weight:700;letter-spacing:-.03em;margin-top:6px;color:var(--theme-text)}
.detail-panel .detail-meta{color:var(--theme-accent-hover);font-size:1.4rem;font-weight:700;margin-top:8px}
.detail-panel .detail-text p{color:var(--theme-soft);font-size:1.05rem;line-height:1.85;margin-top:14px}
.detail-panel .detail-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:24px;flex-wrap:wrap}
.detail-panel .cart-notice{padding:10px 14px;border:1px solid var(--theme-accent);border-radius:11px;background:var(--hover-overlay);color:var(--theme-accent-hover);font-size:.88rem;margin-bottom:18px}
.detail-visual{
  aspect-ratio:16/10;border-radius:16px;display:grid;place-items:center;margin-bottom:18px;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--theme-accent) 18%, transparent), transparent 30%),
    linear-gradient(135deg,var(--theme-surface-3),var(--theme-surface));
  border:1px solid var(--theme-line);overflow:hidden;
}
.detail-visual img{max-width:100%;max-height:100%;object-fit:contain}
.detail-visual span{color:var(--theme-accent-hover);font-size:3rem}
.cart-list{display:grid;gap:10px;margin-bottom:18px}
.cart-item{
  display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:14px;
  padding:14px 16px;border:1px solid var(--theme-line);border-radius:14px;
  background:var(--theme-surface);
}
.cart-item-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:color-mix(in srgb, var(--theme-accent) 10%, transparent);color:var(--theme-accent-hover)}
.cart-item-main a{color:var(--theme-text);text-decoration:none;font-weight:500}
.cart-item-main a:hover{color:var(--theme-accent-hover)}
.cart-item-main span{display:block;color:var(--theme-muted);font-size:.78rem;margin-top:2px}
.cart-item strong{color:var(--theme-accent-hover);font-weight:700}
.cart-item form button{
  width:30px;height:30px;border:1px solid var(--theme-line);border-radius:8px;
  background:var(--theme-surface-2);color:var(--theme-soft);
  display:grid;place-items:center;cursor:pointer;
  transition:border-color .2s,color .2s,background .2s;
}
.cart-item form button:hover{border-color:var(--theme-accent);color:var(--theme-accent-hover);background:var(--hover-overlay)}
.cart-total{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;border:1px solid var(--theme-line);border-radius:14px;background:color-mix(in srgb, var(--theme-accent) 5%, var(--theme-surface));margin-bottom:18px}
.cart-total span{color:var(--theme-soft);font-weight:500}
.cart-total strong{color:var(--theme-accent-hover);font-size:1.4rem;font-weight:700}
.cart-empty{padding:32px 18px;text-align:center;color:var(--theme-muted);border:1px dashed var(--theme-line);border-radius:14px}
.checkout-btn{width:100%;padding:14px;font-size:1rem}

/* ================================================================
   THEME-SAFE INVARIANTS
   Light themes: every surface remains light; only text may be dark.
   Dark themes: no legacy light surface may leak through.
   ================================================================ */
body[data-theme-mode="light"]{color-scheme:light}
body[data-theme-mode="dark"]{color-scheme:dark}

/* Store CTA */
.store-cta{
  display:flex;align-items:center;justify-content:center;gap:10px;margin-top:14px;min-height:48px;padding:11px 15px;
  border:1px solid var(--theme-accent);border-radius:16px;
  background:var(--theme-button-bg);color:var(--theme-button-text);
  text-decoration:none;font-weight:700;
  box-shadow:var(--shadow-soft);
  transition:transform .25s var(--easing),box-shadow .25s var(--easing),border-color .25s var(--easing);
}
.store-cta:hover{transform:translateY(-2px);box-shadow:var(--shadow-lift)}
.store-cta-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:color-mix(in srgb, var(--theme-accent) 20%, transparent);color:var(--theme-button-text)}
.mobile-store-cta{
  display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;padding:9px 6px;
  border:1px solid var(--theme-accent);border-radius:12px;
  background:color-mix(in srgb, var(--theme-accent) 12%, transparent);color:var(--theme-text);
  text-decoration:none;font-size:.58rem;font-weight:700;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.mobile-store-cta:hover{border-color:var(--theme-accent);color:var(--theme-accent-hover)}
@media(max-width:900px){.store-cta{margin-top:12px}.mobile-store-cta{font-size:.55rem}}

/* =====================================================================
   MOBILE STABILITY + TEXT CONTAINMENT (v54 — consolidated)
   All intro-specific mobile rules now live ONLY in the dedicated intro
   block inside @media(max-width:840px) above. This block keeps the
   generic containment rules for other components.
   ===================================================================== */
*,*::before,*::after{min-width:0}
:where(.capsule,.pill,.badge,.chip,.tag,.status,.meta-chip,.section-kicker,.product-type){
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:normal;
  line-height:1.35;
}
:where(.capsule,.pill,.badge,.chip,.tag,.status,.meta-chip){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

/* ---- Long-content safety (URLs, long English words, code) ----
   Applies at every width so a long token can never stretch a card,
   a column, or the page itself. `pre` scrolls internally instead. */
pre{
  max-width:100%;
  overflow-x:auto;
  overflow-wrap:break-word;
  -webkit-overflow-scrolling:touch;
  box-sizing:border-box;
}
code,kbd,samp{
  max-width:100%;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}
pre code{display:block;min-width:0}

@media (max-width:840px){
  .panel,.panel.active,.section-head,.section-head>div,.intro-inner,.product-card,.product-info,.product-main-link,
  .article-row,.social-row,.detail-panel,.cart-item,.cart-item-main,.store-box{min-width:0;max-width:100%}
  .section-title,h1,h2,h3,h4,p,.lede,.intro-inner .eyebrow,.intro-inner .lede,.product-info h3,.product-info p,
  .article-content,.article-content p,.store-intro,.detail-text,.detail-text p,.cart-item-main a,.cart-item-main span{
    overflow-wrap:anywhere;word-break:break-word;hyphens:auto;
  }
  .product-top{min-width:0;align-items:flex-start;gap:7px;flex-wrap:wrap}
  .product-price,.product-type{max-width:100%;white-space:normal;overflow-wrap:anywhere}
  .product-actions{min-width:0;flex-wrap:wrap}
  .product-actions>*{min-width:0;max-width:100%}
  /* On phones, code wraps instead of scrolling — zero overflow, readable. */
  pre{overflow-x:hidden}
  pre code{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
}
@media (max-width:520px){
  .panel{padding-inline:13px}
  .section-head{width:100%}
  .section-title{font-size:clamp(1.6rem,8vw,2.4rem);line-height:1.1}
  :where(.capsule,.pill,.badge,.chip,.tag,.status,.meta-chip,.section-kicker,.product-type){font-size:.72rem;padding-inline:8px}
  .mobile-nav{max-width:calc(100vw - 10px)}
  .store-topbar,.store-links{min-width:0;flex-wrap:wrap}
  .store-links a{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal;text-align:center}
}
@media (max-width:430px){
  /* Bottom navigation becomes a compact TWO-ROW grid so all 9 quick
     actions (sections + store + search + language) stay visible and
     readable even on 320px screens — nothing hidden behind a scroll. */
  body,body.lang-fa,body.lang-ar{padding:0 0 118px!important}
  .panel.active{min-height:calc(100vh - 118px)}
  .mobile-nav{
    display:grid;grid-auto-flow:row;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:4px;
  }
  .mobile-nav button{padding:9px 2px}
  .mobile-nav button,.mobile-nav .mobile-store-cta,.mobile-nav .mobile-search-link{
    min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  .mobile-nav .mobile-lang span{display:inline}
}
@media (max-width:375px){
  /* v59: intro-inner is the lower half of the unified capsule — tighter
     padding on the smallest phones, no own border/radius (the capsule owns it). */
  #intro .intro-inner{padding:18px 13px}
  #intro .intro-inner .lede{font-size:clamp(.9rem,3.7vw,1rem)}
  .mobile-nav{gap:3px;padding:7px}
  .mobile-nav button,.mobile-nav .mobile-store-cta,.mobile-nav .mobile-search-link{font-size:.52rem}
}
@media (min-width:1441px){
  /* Large displays: panels keep comfortable max width, spacing grows. */
  .panel{padding:clamp(96px,10vw,150px) clamp(28px,5vw,90px) 90px}
  .works-grid,.social-grid{gap:24px}
}

/* ================================================================
   SCOPED THEME RUNTIME
   All surfaces in the public site scope consume the active semantic
   tokens emitted by theme_css_vars(). No hardcoded rgba colors.
   ================================================================ */
body[data-theme-scope="site"],
body[data-theme-scope="store"],
body[data-theme-scope="store-admin"]{
  background:var(--background)!important;
  color:var(--text-primary)!important;
  transition:background-color .2s ease,color .2s ease;
}
body[data-theme-scope="site"] *,
body[data-theme-scope="store"] *,
body[data-theme-scope="store-admin"] *{
  border-color:var(--border);
}
body[data-theme-scope="site"] .sidebar,
body[data-theme-scope="site"] .sidebar-toggle,
body[data-theme-scope="site"] .lang-switch select{
  background:var(--surface)!important;color:var(--text-primary)!important;
  border-color:var(--border)!important;
}
body[data-theme-scope="site"] .work,
body[data-theme-scope="site"] .product-card,
body[data-theme-scope="site"] .article-card,
body[data-theme-scope="site"] .social-button,
body[data-theme-scope="site"] .t-item{
  background:var(--surface)!important;color:var(--text-primary)!important;
  border-color:var(--border)!important;box-shadow:0 16px 40px var(--shadow-color);
}
body[data-theme-scope="site"] .work-visual,
body[data-theme-scope="site"] .product-visual,
body[data-theme-scope="store"] .product-visual{
  background:transparent!important;color:var(--text-muted)!important;border-color:var(--border)!important;
}
body[data-theme-scope="site"] p,
body[data-theme-scope="site"] .lede,
body[data-theme-scope="site"] .work .alt,
body[data-theme-scope="site"] .work .tag{
  color:var(--text-secondary);
}
body[data-theme-scope="site"] h1,
body[data-theme-scope="site"] h2,
body[data-theme-scope="site"] h3,
body[data-theme-scope="site"] h4,
body[data-theme-scope="site"] .section-title,
body[data-theme-scope="site"] .id-block .name{color:var(--text-primary)!important}
body[data-theme-scope="site"] .eyebrow,
body[data-theme-scope="site"] .section-kicker,
body[data-theme-scope="site"] .id-block .tagline{color:var(--primary)!important}
body[data-theme-scope="site"] .side-nav button{color:var(--text-secondary);background:transparent!important}
body[data-theme-scope="site"] .side-nav button:hover{color:var(--text-primary);background:var(--hover-overlay)!important}
body[data-theme-scope="site"] .side-nav button.active{
  color:var(--selected-text)!important;background:var(--selected-background)!important;border-color:var(--primary)!important;
}
body[data-theme-scope="site"] a:focus-visible,
body[data-theme-scope="site"] button:focus-visible,
body[data-theme-scope="site"] select:focus-visible,
body[data-theme-scope="site"] input:focus-visible,
body[data-theme-scope="site"] textarea:focus-visible{outline-color:var(--focus-ring)!important}
body[data-theme-scope="site"] button,
body[data-theme-scope="site"] .btn,
body[data-theme-scope="site"] .primary-btn{
  border-color:var(--primary)!important;
}
body[data-theme-scope="site"] .primary-btn,
body[data-theme-scope="site"] button.primary,
body[data-theme-scope="site"] .store-button{
  background:var(--primary)!important;
  color:var(--text-on-primary)!important;
}
body[data-theme-scope="site"] input,
body[data-theme-scope="site"] select,
body[data-theme-scope="site"] textarea{
  background:var(--input-background)!important;color:var(--text-primary)!important;border-color:var(--input-border)!important;
}
body[data-theme-scope="site"] input::placeholder,
body[data-theme-scope="site"] textarea::placeholder{color:var(--input-placeholder)!important}
body[data-theme-scope="site"] .badge,
body[data-theme-scope="site"] .tag,
body[data-theme-scope="site"] .pill,
body[data-theme-scope="site"] .capsule{
  background:var(--surface-container)!important;color:var(--text-primary)!important;border-color:var(--border)!important;
}
body[data-theme-scope="site"][data-theme-mode="dark"]{color-scheme:dark}

/* Store scope — .panel is transparent (just layout container) to avoid the
   "double background" issue: only .product-card / .cart-item / .detail-panel
   get the surface treatment. */
body[data-theme-scope="store"] .store-standalone,
body[data-theme-scope="store-admin"] .store-admin-wrap{
  background:transparent!important;color:var(--text-primary)!important;
}
body[data-theme-scope="store"] .panel,
body[data-theme-scope="store-admin"] .panel{
  background:transparent!important;color:var(--text-primary)!important;
  border-color:transparent!important;box-shadow:none!important;
}
/* Store pages don't vertically center content — that .panel.active rule is
   only meant for the single-page site sections. Store pages start at top. */
body[data-theme-scope="store"] .panel.active,
body[data-theme-scope="store-admin"] .panel.active{
  justify-content:flex-start!important;
}
body[data-theme-scope="store"] .store-shell,
body[data-theme-scope="store"] .product-card,
body[data-theme-scope="store"] .store-box,
body[data-theme-scope="store"] .detail-panel,
body[data-theme-scope="store"] .cart-item,
body[data-theme-scope="store"] .checkout-box,
body[data-theme-scope="store-admin"] .hero-panel,
body[data-theme-scope="store-admin"] .store-admin-item,
body[data-theme-scope="store-admin"] .theme-group,
body[data-theme-scope="store-admin"] .theme-option{
  background:var(--surface)!important;color:var(--text-primary)!important;border-color:var(--border)!important;box-shadow:0 16px 40px var(--shadow-color)!important;
}
body[data-theme-scope="store"] .product-visual,
body[data-theme-scope="store"] .cart-total,
body[data-theme-scope="store"] input,
body[data-theme-scope="store"] select,
body[data-theme-scope="store"] textarea,
body[data-theme-scope="store-admin"] input,
body[data-theme-scope="store-admin"] select,
body[data-theme-scope="store-admin"] textarea{
  background:var(--input-background)!important;color:var(--text-primary)!important;border-color:var(--input-border)!important;
}
body[data-theme-scope="store"] h1,
body[data-theme-scope="store"] h2,
body[data-theme-scope="store"] h3,
body[data-theme-scope="store"] h4,
body[data-theme-scope="store"] strong,
body[data-theme-scope="store-admin"] h1,
body[data-theme-scope="store-admin"] h2,
body[data-theme-scope="store-admin"] h3,
body[data-theme-scope="store-admin"] h4,
body[data-theme-scope="store-admin"] strong,
body[data-theme-scope="store-admin"] label{color:var(--text-primary)!important}
body[data-theme-scope="store"] p,
body[data-theme-scope="store-admin"] p,
body[data-theme-scope="store-admin"] small{color:var(--text-secondary)!important}
body[data-theme-scope="store"] button,
body[data-theme-scope="store"] .product-btn,
body[data-theme-scope="store"] .primary-btn,
body[data-theme-scope="store-admin"] button,
body[data-theme-scope="store-admin"] .primary-btn{
  background:var(--primary)!important;color:var(--text-on-primary)!important;border-color:var(--primary)!important;
}
body[data-theme-scope="store"] .secondary,
body[data-theme-scope="store-admin"] .site-link,
body[data-theme-scope="store-admin"] .logout,
body[data-theme-scope="store-admin"] .lang-chip{
  background:var(--surface-container)!important;color:var(--text-primary)!important;border-color:var(--border)!important;
}
body[data-theme-scope="store"][data-theme-mode="dark"],body[data-theme-scope="store-admin"][data-theme-mode="dark"]{color-scheme:dark}

/* ================================================================
   TARGETED UI FIXES
   1) Article/work detail pages inherit the active site theme.
   2) Store + article/work detail content is centered in the viewport.
   3) Outer section/panel framing lines are removed; inner cards remain.
   ================================================================ */
body[data-theme-scope="site"] .detail-panel{
  width:min(920px,calc(100% - 32px));
  max-width:920px;min-width:0;
  margin-inline:auto !important;
  align-self:center !important;
  justify-self:center;
  background:var(--surface) !important;
  color:var(--text-primary) !important;
  border:0 !important;
  box-shadow:none !important;
  box-sizing:border-box;
}
body[data-theme-scope="site"] .detail-panel :where(.detail-title,h1,h2,h3,strong){color:var(--text-primary) !important}
body[data-theme-scope="site"] .detail-panel :where(.detail-text,p){color:var(--text-secondary) !important}
body[data-theme-scope="site"] .detail-panel :where(input,select,textarea){background:var(--input-background) !important;color:var(--text-primary) !important;border-color:var(--input-border) !important}
body[data-theme-scope="site"] .detail-panel :where(button,.btn,.detail-cart-btn){background:var(--primary) !important;color:var(--text-on-primary) !important;border-color:var(--primary) !important}
body[data-theme-scope="site"] .detail-panel .back-link,
body[data-theme-scope="site"] .detail-panel .cart-link{background:var(--surface-container) !important;color:var(--text-primary) !important;border-color:var(--border) !important}
body[data-theme-scope="store"] .detail-panel{
  width:min(920px,calc(100% - 32px));
  max-width:920px;min-width:0;
  margin-inline:auto !important;
  align-self:center !important;
  justify-self:center;
  background:var(--surface) !important;
  color:var(--text-primary) !important;
  border:0 !important;
  box-shadow:none !important;
  box-sizing:border-box;
}
body[data-theme-scope="store"] .detail-panel :where(.detail-title,h1,h2,h3,strong){color:var(--text-primary) !important}
body[data-theme-scope="store"] .detail-panel :where(.detail-text,p){color:var(--text-secondary) !important}
body[data-theme-scope="store"] .detail-panel :where(input,select,textarea){background:var(--input-background) !important;color:var(--text-primary) !important;border-color:var(--input-border) !important}
body[data-theme-scope="store"] .detail-panel :where(button,.btn,.detail-cart-btn){background:var(--primary) !important;color:var(--text-on-primary) !important;border-color:var(--primary) !important}
body[data-theme-scope="store"] .detail-panel .back-link,
body[data-theme-scope="store"] .detail-panel .cart-link{background:var(--surface-container) !important;color:var(--text-primary) !important;border-color:var(--border) !important}
body[data-theme-scope="store"] .store-standalone{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  min-width:0;
}

/* Remove only the outer framing from section containers; cards/components keep their own borders. */
body[data-theme] > main > .panel,
body[data-theme] main > .panel.detail-panel,
body[data-theme-scope="store"] .store-box{
  border:0!important;
  box-shadow:none!important;
}
body[data-theme-scope="site"] .detail-panel .content-image{
  display:block;
  max-width:100%;
}

/* Section-level presentation: cards inherit surface, framing removed. */
body[data-theme-scope="site"] :where(#articles,#works,#store){
  border:0 !important;
  box-shadow:none !important;
}
body[data-theme-scope="site"] :where(#articles,#works,#store) > .section-content,
body[data-theme-scope="site"] :where(#articles,#works,#store) > .section-head{
  width:100%;
  max-width:100%;
  min-width:0;
}
body[data-theme-scope="site"] .article-card,
body[data-theme-scope="site"] .work{
  background:var(--surface) !important;
  color:var(--text-primary) !important;
  border-color:var(--border) !important;
  box-shadow:0 16px 40px var(--shadow-color) !important;
  border-radius:var(--theme-radius,var(--radius)) !important;
}
/* Article cards stay flat (no border, no shadow) — by request. */
body[data-theme-scope="site"] .article-card{
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
}
body[data-theme-scope="site"] .article-row{
  background:transparent !important;
  color:var(--text-primary) !important;
  border-color:transparent !important;
}
body[data-theme-scope="site"] .article-row .a-title{color:var(--text-primary) !important}
body[data-theme-scope="site"] .article-row .a-meta{color:var(--text-secondary) !important}

@media (max-width:600px){
  body[data-theme-scope="site"] .detail-panel,
  body[data-theme-scope="store"] .detail-panel{
    width:calc(100% - 20px);
    max-width:100%;
  }
}

/* MOBILE PERFORMANCE — preserve layout, reduce GPU-heavy effects on phones */
@media (max-width: 840px){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.12s!important;scroll-behavior:auto!important}
  [style*="backdrop-filter"],[class*="glass"],[class*="blur"]{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .ambient,.login-orb{filter:none!important;opacity:.08!important}
}

.store-external-link{display:block;text-decoration:none;color:inherit;cursor:pointer}

/* ================================================================
   FINAL TARGETED FIX — detail/store presentation only
   - Remove the extra large surface behind detail/store content.
   - Center detail content in the actual viewport, not the
     sidebar-reduced body content area.
   - No changes to HTML/PHP/JS or component structure.
   ================================================================ */
body[data-theme-scope="site"] .detail-panel,
body[data-theme-scope="store"] .detail-panel,
body[data-theme-scope="store"] .store-standalone .panel{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

body.lang-fa[data-theme-scope="site"] .detail-panel,
body.lang-ar[data-theme-scope="site"] .detail-panel{
  position:relative;
  left:calc(var(--sidebar-w) / 2);
}

body:not(.lang-fa):not(.lang-ar)[data-theme-scope="site"] .detail-panel{
  position:relative;
  left:calc(var(--sidebar-w) / -2);
}

@media (max-width:840px){
  body.lang-fa[data-theme-scope="site"] .detail-panel,
  body.lang-ar[data-theme-scope="site"] .detail-panel,
  body:not(.lang-fa):not(.lang-ar)[data-theme-scope="site"] .detail-panel{
    left:0;
  }
}


/* ================================================================
   FINAL TARGETED FIX 2 — articles + store only
   - Restore full-width article detail media/content where it was
     appearing unnecessarily small.
   - Center the store panel like the works section and give only
     the store its rectangular themed background.
   - No HTML/PHP/JS changes.
   ================================================================ */
body[data-theme-scope="site"] .detail-panel .content-image{
  width:100%;
  max-width:100%;
  height:auto;
  display:block;
}

body[data-theme-scope="site"] #store{
  width:min(100%,1200px);
  margin-inline:auto !important;
  align-self:center !important;
  box-sizing:border-box;
  background:var(--surface) !important;
  border:1px solid var(--border) !important;
  border-radius:var(--theme-radius,var(--radius)) !important;
  box-shadow:0 16px 40px var(--shadow-color) !important;
}

body[data-theme-scope="site"] #store .store-grid{
  width:100%;
  max-width:100%;
  margin-inline:auto !important;
  justify-content:center;
  justify-items:center;
}

@media(max-width:840px){
  body[data-theme-scope="site"] #store{
    width:calc(100% - 30px);
    max-width:100%;
  }
}

/* ================================================================
   FINAL TARGETED FIX — article cards + standalone store alignment
   CSS ONLY
   ================================================================ */

/* Articles: each article renders as ONE independent full-width row
   (single column on desktop as well as mobile — v54 requirement).
   The existing article-content remains collapsible and hidden until opened. */
body[data-theme-scope="site"] #articles .articles-list{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  width:100%;
  margin-inline:auto;
}
body[data-theme-scope="site"] #articles .article-card{
  display:block;
  min-width:0;
  overflow:hidden;
  background:var(--surface)!important;
  border:1px solid var(--border)!important;
  border-radius:var(--theme-radius,var(--radius))!important;
  box-shadow:0 12px 30px var(--shadow-color)!important;
}
body[data-theme-scope="site"] #articles .article-row,
body[data-theme-scope="site"] #articles .article-card .article-row{
  width:100%;
  min-height:74px;
  padding:15px 16px;
  margin:0;
  background:transparent!important;
  border:0!important;
  border-radius:inherit!important;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  text-align:inherit;
}
body[data-theme-scope="site"] #articles .article-row .a-title{
  min-width:0;
  overflow-wrap:anywhere;
  line-height:1.45;
}
body[data-theme-scope="site"] #articles .article-row .a-meta{
  flex:0 0 auto;
  white-space:nowrap;
}
body[data-theme-scope="site"] #articles .article-content{
  padding:0 16px 16px;
}

/* Standalone store: remove the site's RTL/LTR sidebar offset and keep the
   entire store centered. Use one theme background only. */
body[data-theme-scope="store"]{
  padding:0!important;
  margin:0!important;
  min-width:0!important;
  background:var(--background)!important;
}
body[data-theme-scope="store"] .store-standalone{
  width:100%!important;
  max-width:none!important;
  min-height:100vh;
  padding:28px 18px 70px!important;
  margin:0!important;
  background:var(--background)!important;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
body[data-theme-scope="store"] .store-shell{
  width:min(1200px,100%)!important;
  max-width:1200px!important;
  margin:0 auto!important;
  min-width:0!important;
}
body[data-theme-scope="store"] .store-topbar{
  width:100%;
  margin-inline:auto;
  align-items:center;
}
body[data-theme-scope="store"] .store-topbar .store-links{
  justify-content:center;
  align-items:center;
}
body[data-theme-scope="store"] .panel.active{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:0!important;
  margin:0 auto!important;
  padding:18px 0 0!important;
  display:flex!important;
  flex-direction:column;
  justify-content:flex-start!important;
  align-items:stretch!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body[data-theme-scope="store"] .panel.active .section-head,
body[data-theme-scope="store"] .panel.active .store-intro,
body[data-theme-scope="store"] .panel.active .store-grid{
  width:100%;
  margin-inline:auto;
}
body[data-theme-scope="store"] .panel.active .section-head{
  justify-content:center;
  text-align:center;
}
body[data-theme-scope="store"] .panel.active .store-intro{
  text-align:center;
  max-width:60ch;
}
body[data-theme-scope="store"] .store-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  justify-content:center!important;
  justify-items:stretch!important;
  align-items:start;
  gap:18px;
}
body[data-theme-scope="store"] .product-card{
  width:100%!important;
  min-width:0!important;
  visibility:visible!important;
  opacity:1!important;
  display:flex!important;
  flex-direction:column;
}
body[data-theme-scope="store"] .product-main-link,
body[data-theme-scope="store"] .product-info,
body[data-theme-scope="store"] .product-actions{
  min-width:0;
  visibility:visible!important;
  opacity:1!important;
}
body[data-theme-scope="store"] .product-actions{
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 18px 18px;
}
body[data-theme-scope="store"] .product-actions form{
  margin:0;
  display:block;
}
body[data-theme-scope="store"] .cart-link{
  visibility:visible!important;
  opacity:1!important;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
}

@media (max-width:900px){
  body[data-theme-scope="site"] #articles .articles-list{
    grid-template-columns:1fr;
  }
  body[data-theme-scope="store"] .store-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media (max-width:600px){
  body[data-theme-scope="site"] #articles .article-row{
    min-height:66px;
    padding:13px 14px;
  }
  body[data-theme-scope="site"] #articles .article-row .a-meta{
    font-size:.7rem;
  }
  body[data-theme-scope="store"] .store-standalone{
    padding:18px 12px 60px!important;
  }
  body[data-theme-scope="store"] .store-topbar{
    flex-direction:column;
    justify-content:center;
    text-align:center;
  }
  body[data-theme-scope="store"] .store-grid{
    grid-template-columns:1fr!important;
  }
}


/* FINAL FIX — standalone store product + cart content visibility only */
body[data-theme-scope="store"] #content{
  width:100%;
  min-height:100vh;
  display:block!important;
  position:relative;
  z-index:1;
}
body[data-theme-scope="store"] #content > .detail-panel.active{
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
  align-items:stretch!important;
  visibility:visible!important;
  opacity:1!important;
  position:relative!important;
  z-index:2;
  width:min(920px,calc(100% - 32px))!important;
  max-width:920px!important;
  min-height:0!important;
  height:auto!important;
  margin:28px auto 70px!important;
  padding:28px!important;
  overflow:visible!important;
  box-sizing:border-box!important;
  color:var(--text-primary)!important;
  background:var(--surface)!important;
  border:1px solid var(--border)!important;
  border-radius:var(--theme-radius,var(--radius))!important;
  box-shadow:0 16px 40px var(--shadow-color)!important;
}
body[data-theme-scope="store"] .detail-panel.active > *{
  visibility:visible!important;
  opacity:1!important;
}
body[data-theme-scope="store"] .detail-panel.active .detail-actions,
body[data-theme-scope="store"] .detail-panel.active .detail-visual,
body[data-theme-scope="store"] .detail-panel.active .section-kicker,
body[data-theme-scope="store"] .detail-panel.active .detail-title,
body[data-theme-scope="store"] .detail-panel.active .detail-meta,
body[data-theme-scope="store"] .detail-panel.active .detail-text,
body[data-theme-scope="store"] .detail-panel.active form,
body[data-theme-scope="store"] .detail-panel.active .cart-list,
body[data-theme-scope="store"] .detail-panel.active .cart-total,
body[data-theme-scope="store"] .detail-panel.active .cart-empty,
body[data-theme-scope="store"] .detail-panel.active .checkout-btn{
  display:flex;
}
body[data-theme-scope="store"] .detail-panel.active .detail-visual{display:grid;}
body[data-theme-scope="store"] .detail-panel.active .detail-text{flex-direction:column;}
body[data-theme-scope="store"] .detail-panel.active .cart-list{flex-direction:column;}
body[data-theme-scope="store"] .detail-panel.active .detail-title,
body[data-theme-scope="store"] .detail-panel.active .detail-meta,
body[data-theme-scope="store"] .detail-panel.active .section-kicker,
body[data-theme-scope="store"] .detail-panel.active .cart-empty{display:block;}
body[data-theme-scope="store"] .detail-panel.active .checkout-btn{justify-content:center;align-items:center;text-decoration:none;}
@media(max-width:600px){
  body[data-theme-scope="store"] #content > .detail-panel.active{
    width:calc(100% - 20px)!important;
    padding:18px!important;
    margin:18px auto 60px!important;
  }
}


/* Store product/cart visibility fix — scoped only to store detail pages. */
body[data-theme-scope="store"] #content > .detail-panel.active, body[data-theme-scope="store"] .detail-panel.active{display:block!important;visibility:visible!important;opacity:1!important;overflow:visible!important;}
body[data-theme-scope="store"] .detail-panel.active .detail-actions, body[data-theme-scope="store"] .detail-panel.active .detail-visual, body[data-theme-scope="store"] .detail-panel.active .detail-text, body[data-theme-scope="store"] .detail-panel.active form{display:block!important;visibility:visible!important;opacity:1!important;}
body[data-theme-scope="store"] .detail-panel.active .detail-visual{display:grid!important;}
body[data-theme-scope="store"] .detail-panel.active .section-kicker, body[data-theme-scope="store"] .detail-panel.active .detail-title, body[data-theme-scope="store"] .detail-panel.active .detail-meta, body[data-theme-scope="store"] .detail-panel.active .detail-text p, body[data-theme-scope="store"] .detail-panel.active .detail-cart-btn, body[data-theme-scope="store"] .detail-panel.active .cart-notice{visibility:visible!important;opacity:1!important;}
body[data-theme-scope="store"] .detail-panel.active .detail-cart-btn{display:inline-flex!important;align-items:center;justify-content:center;}
body[data-theme-scope="store"] .detail-panel.active .cart-list, body[data-theme-scope="store"] .detail-panel.active .cart-item, body[data-theme-scope="store"] .detail-panel.active .cart-total, body[data-theme-scope="store"] .detail-panel.active .cart-empty, body[data-theme-scope="store"] .detail-panel.active .checkout-btn{visibility:visible!important;opacity:1!important;}
body[data-theme-scope="store"] .detail-panel.active .cart-list{display:grid!important;} body[data-theme-scope="store"] .detail-panel.active .cart-item{display:grid!important;} body[data-theme-scope="store"] .detail-panel.active .cart-total{display:flex!important;} body[data-theme-scope="store"] .detail-panel.active .cart-empty{display:block!important;} body[data-theme-scope="store"] .detail-panel.active .checkout-btn{display:inline-flex!important;}


/* ================================================================
   STORE FRONT-END — FINAL CLEAN LAYOUT
   This block consolidates and replaces the previous conflicting
   overrides for /stor/* pages (standalone store, product detail,
   cart). It is the LAST block in styles.css so it wins the cascade.
   Goals:
     • Standalone store pages do NOT use the main-site sidebar layout
     • Detail/cart pages render as a centered 920px card on a flat
       themed background, no sidebar offset, no min-height:100vh
     • All store elements use the active store theme tokens
   ================================================================ */

/* 1. Standalone store shell — applies to /stor/{lang}/index.php */
body[data-theme-scope="store"]{
  padding:0!important;
  margin:0!important;
  background:var(--background)!important;
  color:var(--text-primary)!important;
  min-width:0!important;
  font-family:var(--theme-font,Inter,Vazirmatn,sans-serif)!important;
}
body.lang-fa[data-theme-scope="store"],
body.lang-ar[data-theme-scope="store"]{
  font-family:Vazirmatn,sans-serif!important;
  padding:0!important;
}

/* 2. Top-level standalone store container */
body[data-theme-scope="store"] .store-standalone{
  width:100%!important;
  max-width:none!important;
  min-height:100vh;
  padding:32px clamp(16px,4vw,40px) 80px!important;
  margin:0!important;
  background:var(--background)!important;
  display:block!important;
}
body[data-theme-scope="store"] .store-shell{
  width:min(1200px,100%)!important;
  max-width:1200px!important;
  margin:0 auto!important;
  min-width:0!important;
}

/* 3. Topbar — header navigation between store and main site */
body[data-theme-scope="store"] .store-topbar{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:28px;
  padding-bottom:18px;
  border-bottom:1px solid var(--border);
  flex-wrap:wrap;
}
body[data-theme-scope="store"] .store-topbar a{
  color:inherit;
  text-decoration:none;
}
body[data-theme-scope="store"] .store-brand{
  font-weight:700;
  font-size:.95rem;
  letter-spacing:-.01em;
}
body[data-theme-scope="store"] .store-links{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
body[data-theme-scope="store"] .store-links a{
  padding:9px 14px;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--surface-container);
  color:var(--text-primary);
  font-size:13px;
  font-weight:500;
  transition:border-color .2s ease,background .2s ease;
}
body[data-theme-scope="store"] .store-links a:hover{
  border-color:var(--primary);
  background:var(--hover-overlay);
}

/* 4. Store section panel — header + intro + grid */
body[data-theme-scope="store"] .panel.active{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  display:block!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  justify-content:flex-start!important;
  align-items:stretch!important;
}
body[data-theme-scope="store"] .panel.active .section-head{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  text-align:center;
  gap:16px;
  margin-bottom:22px;
  flex-wrap:wrap;
}
body[data-theme-scope="store"] .panel.active .section-kicker{
  color:var(--primary);
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:8px;
  display:block;
}
body[data-theme-scope="store"] .panel.active .section-title{
  font-size:clamp(1.8rem,3.5vw,2.6rem);
  letter-spacing:-.03em;
  font-weight:700;
  color:var(--text-primary);
}
body[data-theme-scope="store"] .panel.active .store-intro{
  text-align:center;
  max-width:60ch;
  margin:0 auto 26px;
  color:var(--text-secondary);
  font-size:.95rem;
  line-height:1.7;
}

/* 5. Product grid — 4 columns desktop, 2 tablet, 1 mobile */
body[data-theme-scope="store"] .store-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:18px;
  width:100%;
  margin:0;
  justify-items:stretch;
  align-items:start;
}

/* 6. Product card */
body[data-theme-scope="store"] .product-card{
  width:100%!important;
  min-width:0!important;
  display:flex!important;
  flex-direction:column;
  background:var(--surface)!important;
  color:var(--text-primary)!important;
  border:1px solid var(--border)!important;
  border-radius:var(--radius-lg,16px)!important;
  overflow:hidden;
  transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease;
  box-shadow:0 4px 14px var(--shadow-color);
}
body[data-theme-scope="store"] .product-card:hover{
  transform:translateY(-4px);
  border-color:var(--primary)!important;
  box-shadow:0 16px 40px var(--shadow-color);
}
body[data-theme-scope="store"] .product-main-link{
  text-decoration:none;
  color:inherit;
  display:block;
}
body[data-theme-scope="store"] .product-visual{
  aspect-ratio:16/10;
  width:100%;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb,var(--primary) 16%,transparent), transparent 60%),
    var(--surface-container);
  border-bottom:1px solid var(--border);
  color:var(--primary);
  font-size:2.4rem;
  font-weight:600;
  overflow:hidden;
}
body[data-theme-scope="store"] .product-visual img{
  width:100%;
  height:100%;
  object-fit:cover;
}
body[data-theme-scope="store"] .product-info{
  padding:16px 16px 12px;
  display:block;
}
body[data-theme-scope="store"] .product-top{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  margin-bottom:6px;
}
body[data-theme-scope="store"] .product-type{
  color:var(--primary);
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}
body[data-theme-scope="store"] .product-price{
  color:var(--text-primary);
  font-weight:700;
  font-size:1.05rem;
}
body[data-theme-scope="store"] .product-info h3{
  color:var(--text-primary);
  font-size:1.05rem;
  font-weight:600;
  margin-top:4px;
  letter-spacing:-.01em;
  line-height:1.3;
}
body[data-theme-scope="store"] .product-info p{
  color:var(--text-secondary);
  font-size:.85rem;
  margin-top:6px;
  line-height:1.55;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
body[data-theme-scope="store"] .product-actions{
  display:flex;
  gap:8px;
  padding:0 16px 16px;
  margin-top:auto;
  flex-wrap:wrap;
}
body[data-theme-scope="store"] .product-actions form{
  margin:0;
  flex:1;
  min-width:0;
}
body[data-theme-scope="store"] .product-actions .product-btn{
  flex:1;
  justify-content:center;
  padding:9px 12px;
  font-size:.82rem;
  font-weight:600;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--surface-container);
  color:var(--text-primary);
  text-decoration:none;
  transition:all .2s ease;
}
body[data-theme-scope="store"] .product-actions .product-btn:hover{
  border-color:var(--primary);
  background:var(--hover-overlay);
  color:var(--primary);
}
body[data-theme-scope="store"] .product-actions .product-btn:not(.secondary){
  background:var(--primary);
  color:var(--text-on-primary);
  border-color:var(--primary);
}
body[data-theme-scope="store"] .product-actions .product-btn:not(.secondary):hover{
  background:var(--primary-hover);
  border-color:var(--primary-hover);
  color:var(--text-on-primary);
}

/* 7. Cart link in topbar */
body[data-theme-scope="store"] .cart-link{
  display:inline-flex!important;
  align-items:center;
  gap:7px;
  padding:9px 14px;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--surface-container);
  color:var(--text-primary);
  text-decoration:none;
  font-size:13px;
  font-weight:500;
}
body[data-theme-scope="store"] .cart-link span{
  display:inline-grid;
  place-items:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  background:var(--primary);
  color:var(--text-on-primary);
  border-radius:999px;
  font-size:11px;
  font-weight:700;
}

/* ================================================================
   8. DETAIL PAGE — /stor/{lang}/{slug}.php
   Centered 920px max-width card on a flat themed background.
   ================================================================ */
body[data-theme-scope="store"] #content{
  width:100%;
  min-height:100vh;
  display:block!important;
  position:relative;
  padding:32px clamp(16px,4vw,40px) 80px;
  background:var(--background);
}
body[data-theme-scope="store"] #content > .detail-panel.active{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  overflow:visible!important;
  position:relative;
  width:min(920px,100%);
  max-width:920px;
  min-height:0!important;
  height:auto;
  margin:0 auto;
  padding:32px clamp(20px,3vw,36px);
  background:var(--surface);
  color:var(--text-primary);
  border:1px solid var(--border);
  border-radius:var(--radius-lg,16px);
  box-shadow:0 16px 50px var(--shadow-color);
  box-sizing:border-box;
}
body[data-theme-scope="store"] .detail-panel.active > *{
  visibility:visible!important;
  opacity:1!important;
}

/* 9. Detail actions — back + cart links at top */
body[data-theme-scope="store"] .detail-panel.active .detail-actions{
  display:flex!important;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:22px;
  flex-wrap:wrap;
}
body[data-theme-scope="store"] .detail-panel.active .detail-actions .back-link,
body[data-theme-scope="store"] .detail-panel.active .detail-actions .cart-link{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:9px 14px;
  font-size:13px;
  font-weight:500;
  border-radius:11px;
  border:1px solid var(--border);
  background:var(--surface-container);
  color:var(--text-primary);
  text-decoration:none;
  transition:all .2s ease;
}
body[data-theme-scope="store"] .detail-panel.active .detail-actions .back-link:hover,
body[data-theme-scope="store"] .detail-panel.active .detail-actions .cart-link:hover{
  border-color:var(--primary);
  color:var(--primary);
}

/* 10. Cart notice — "added to cart" confirmation */
body[data-theme-scope="store"] .detail-panel.active .cart-notice{
  padding:11px 14px;
  border:1px solid var(--primary);
  border-radius:11px;
  background:color-mix(in srgb,var(--primary) 8%,transparent);
  color:var(--primary);
  font-size:.86rem;
  font-weight:500;
  margin-bottom:18px;
}

/* 11. Detail visual — image / icon area */
body[data-theme-scope="store"] .detail-panel.active .detail-visual{
  display:grid!important;
  place-items:center;
  aspect-ratio:16/10;
  width:100%;
  margin-bottom:22px;
  border-radius:14px;
  border:1px solid var(--border);
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb,var(--primary) 18%,transparent), transparent 50%),
    linear-gradient(135deg,var(--surface-container-high),var(--surface));
  overflow:hidden;
}
body[data-theme-scope="store"] .detail-panel.active .detail-visual img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
body[data-theme-scope="store"] .detail-panel.active .detail-visual span{
  color:var(--primary);
  font-size:4rem;
  font-weight:600;
  line-height:1;
}

/* 12. Detail text content */
body[data-theme-scope="store"] .detail-panel.active .section-kicker{
  display:block;
  color:var(--primary);
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:8px;
}
body[data-theme-scope="store"] .detail-panel.active .detail-title{
  display:block;
  color:var(--text-primary);
  font-size:clamp(1.6rem,3.5vw,2.4rem);
  font-weight:700;
  letter-spacing:-.03em;
  line-height:1.15;
  margin-bottom:10px;
}
body[data-theme-scope="store"] .detail-panel.active .detail-meta{
  display:block;
  color:var(--primary);
  font-size:1.5rem;
  font-weight:700;
  margin-bottom:20px;
}
body[data-theme-scope="store"] .detail-panel.active .detail-text{
  display:block;
  margin-bottom:24px;
}
body[data-theme-scope="store"] .detail-panel.active .detail-text p{
  color:var(--text-secondary);
  font-size:1rem;
  line-height:1.85;
  margin-top:12px;
  max-width:70ch;
}
body[data-theme-scope="store"] .detail-panel.active .detail-text p:first-child{
  margin-top:0;
}

/* 13. Detail add-to-cart button */
body[data-theme-scope="store"] .detail-panel.active form{
  display:block!important;
  margin-top:8px;
}
body[data-theme-scope="store"] .detail-panel.active .detail-cart-btn{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:13px 26px;
  font-size:.95rem;
  font-weight:700;
  border-radius:12px;
  border:1px solid var(--primary);
  background:var(--primary);
  color:var(--text-on-primary);
  cursor:pointer;
  transition:transform .15s ease,box-shadow .2s ease,background .2s ease;
}
body[data-theme-scope="store"] .detail-panel.active .detail-cart-btn:hover{
  background:var(--primary-hover);
  border-color:var(--primary-hover);
  transform:translateY(-2px);
  box-shadow:0 12px 28px color-mix(in srgb,var(--primary) 30%,transparent);
}
body[data-theme-scope="store"] .detail-panel.active .detail-cart-btn:active{
  transform:translateY(0);
}

/* ================================================================
   14. CART PAGE — /stor/{lang}/cart.php
   ================================================================ */
body[data-theme-scope="store"] .detail-panel.active .cart-list{
  display:grid!important;
  grid-template-columns:1fr;
  gap:10px;
  margin-bottom:18px;
}
body[data-theme-scope="store"] .detail-panel.active .cart-item{
  display:grid!important;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface-container);
  transition:border-color .2s ease;
}
body[data-theme-scope="store"] .detail-panel.active .cart-item:hover{
  border-color:var(--primary);
}
body[data-theme-scope="store"] .detail-panel.active .cart-item-icon{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:color-mix(in srgb,var(--primary) 12%,transparent);
  border:1px solid color-mix(in srgb,var(--primary) 22%,transparent);
  color:var(--primary);
  font-size:1.2rem;
}
body[data-theme-scope="store"] .detail-panel.active .cart-item-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
body[data-theme-scope="store"] .detail-panel.active .cart-item-main a{
  color:var(--text-primary);
  text-decoration:none;
  font-weight:600;
  font-size:.95rem;
  transition:color .2s ease;
}
body[data-theme-scope="store"] .detail-panel.active .cart-item-main a:hover{
  color:var(--primary);
}
body[data-theme-scope="store"] .detail-panel.active .cart-item-main span{
  font-size:.78rem;
  color:var(--text-muted);
}
body[data-theme-scope="store"] .detail-panel.active .cart-item strong{
  color:var(--primary);
  font-weight:700;
  font-size:1.05rem;
}
body[data-theme-scope="store"] .detail-panel.active .cart-item form button{
  width:32px;
  height:32px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--surface);
  color:var(--text-secondary);
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:1.1rem;
  line-height:1;
  transition:all .2s ease;
}
body[data-theme-scope="store"] .detail-panel.active .cart-item form button:hover{
  border-color:var(--danger,#dc2626);
  background:color-mix(in srgb,#dc2626 12%,transparent);
  color:#f87171;
}
body[data-theme-scope="store"] .detail-panel.active .cart-total{
  display:flex!important;
  justify-content:space-between;
  align-items:center;
  padding:16px 18px;
  border:1px solid var(--border);
  border-radius:14px;
  background:color-mix(in srgb,var(--primary) 6%,var(--surface));
  margin-bottom:18px;
}
body[data-theme-scope="store"] .detail-panel.active .cart-total span{
  color:var(--text-secondary);
  font-weight:500;
  font-size:.95rem;
}
body[data-theme-scope="store"] .detail-panel.active .cart-total strong{
  color:var(--primary);
  font-size:1.5rem;
  font-weight:800;
}
body[data-theme-scope="store"] .detail-panel.active .cart-empty{
  display:block!important;
  padding:48px 24px;
  text-align:center;
  color:var(--text-muted);
  border:1px dashed var(--border);
  border-radius:14px;
  font-size:1rem;
  background:var(--surface-container);
}
body[data-theme-scope="store"] .detail-panel.active .checkout-btn{
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  padding:15px 24px;
  font-size:1rem;
  font-weight:700;
  border-radius:14px;
  border:1px solid var(--primary);
  background:var(--primary);
  color:var(--text-on-primary);
  text-decoration:none;
  transition:transform .15s ease,box-shadow .2s ease,background .2s ease;
}
body[data-theme-scope="store"] .detail-panel.active .checkout-btn:hover{
  background:var(--primary-hover);
  border-color:var(--primary-hover);
  transform:translateY(-2px);
  box-shadow:0 14px 32px color-mix(in srgb,var(--primary) 32%,transparent);
}

/* ================================================================
   15. STORE RESPONSIVE
   ================================================================ */
@media(max-width:1040px){
  body[data-theme-scope="store"] .store-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media(max-width:900px){
  body[data-theme-scope="store"] .store-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body[data-theme-scope="store"] .store-topbar{
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }
  body[data-theme-scope="store"] .detail-panel.active .detail-actions{
    flex-direction:row;
    flex-wrap:wrap;
  }
  body[data-theme-scope="store"] .detail-panel.active .detail-actions .back-link,
  body[data-theme-scope="store"] .detail-panel.active .detail-actions .cart-link{
    flex:1;
    min-width:120px;
    justify-content:center;
  }
}
@media(max-width:640px){
  body[data-theme-scope="store"] #content{
    padding:18px 14px 60px;
  }
  body[data-theme-scope="store"] #content > .detail-panel.active{
    padding:22px 18px;
  }
  body[data-theme-scope="store"] .store-standalone{
    padding:18px 14px 60px!important;
  }
  body[data-theme-scope="store"] .store-grid{
    grid-template-columns:1fr!important;
  }
  body[data-theme-scope="store"] .detail-panel.active .cart-item{
    grid-template-columns:auto 1fr;
    gap:10px;
  }
  body[data-theme-scope="store"] .detail-panel.active .cart-item strong{
    grid-column:2;
  }
  body[data-theme-scope="store"] .detail-panel.active .cart-item form{
    grid-column:1/-1;
    margin-top:6px;
  }
  body[data-theme-scope="store"] .detail-panel.active .cart-item form button{
    width:100%;
    height:36px;
  }
  body[data-theme-scope="store"] .detail-panel.active .detail-title{
    font-size:1.6rem;
  }
  body[data-theme-scope="store"] .detail-panel.active .detail-meta{
    font-size:1.25rem;
  }
}


/* v-next: modern standalone store product listing */
body[data-theme-scope="store"] .store-standalone{
  background:var(--background)!important;
  padding:clamp(24px,4vw,46px) clamp(14px,3vw,28px) 72px!important;
}
body[data-theme-scope="store"] .store-shell{
  width:min(1240px,100%)!important;
  margin-inline:auto!important;
}
body[data-theme-scope="store"] .store-standalone .panel.active{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  margin:0!important;
}
body[data-theme-scope="store"] .store-standalone .store-grid{
  width:100%!important;
  max-width:1240px!important;
  margin:0 auto!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))!important;
  gap:clamp(16px,2vw,24px)!important;
  background:transparent!important;
}
body[data-theme-scope="store"] .store-standalone .product-card{
  position:relative!important;
  background:var(--surface)!important;
  border:1px solid color-mix(in srgb,var(--border) 72%,transparent)!important;
  border-radius:20px!important;
  box-shadow:0 8px 28px color-mix(in srgb,var(--shadow-color) 55%,transparent)!important;
  overflow:hidden!important;
  transform:none!important;
}
body[data-theme-scope="store"] .store-standalone .product-card:hover{
  transform:translateY(-5px)!important;
  border-color:color-mix(in srgb,var(--primary) 60%,var(--border))!important;
  box-shadow:0 18px 44px color-mix(in srgb,var(--shadow-color) 72%,transparent)!important;
}
body[data-theme-scope="store"] .store-standalone .product-visual{
  aspect-ratio:16/10!important;
  background:var(--surface-container)!important;
  border:0!important;
}
body[data-theme-scope="store"] .store-standalone .product-info{padding:17px 18px 8px!important}
body[data-theme-scope="store"] .store-standalone .product-actions{
  padding:8px 18px 18px!important;
  margin:0!important;
}
body[data-theme-scope="store"] .store-standalone .product-actions .product-btn{min-height:40px!important;border-radius:12px!important}
@media(max-width:680px){
  body[data-theme-scope="store"] .store-standalone{padding-inline:14px!important}
  body[data-theme-scope="store"] .store-standalone .store-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
  body[data-theme-scope="store"] .store-standalone .product-info{padding:13px 13px 6px!important}
  body[data-theme-scope="store"] .store-standalone .product-actions{padding:6px 13px 13px!important}
}
@media(max-width:430px){
  body[data-theme-scope="store"] .store-standalone .store-grid{grid-template-columns:1fr!important}
}

/* ================================================================
   MODERN STANDALONE STORE LIST — FINAL OVERRIDES
   Keep the store on the page background; no large panel/container
   behind the product grid.
   ================================================================ */
body[data-theme-scope="store"] .store-standalone{
  padding:28px clamp(16px,3.2vw,44px) 76px!important;
  background:var(--background)!important;
}
body[data-theme-scope="store"] .store-shell{
  width:min(1280px,100%)!important;
  max-width:1280px!important;
}
body[data-theme-scope="store"] .store-topbar{
  margin-bottom:42px!important;
  padding:0 0 18px!important;
  border-bottom:1px solid color-mix(in srgb,var(--border) 65%,transparent)!important;
}
body[data-theme-scope="store"] .store-topbar .store-brand{
  font-size:.92rem!important;
  font-weight:650!important;
}
body[data-theme-scope="store"] .store-links a{
  padding:8px 13px!important;
  border-radius:999px!important;
  background:transparent!important;
  border-color:color-mix(in srgb,var(--border) 72%,transparent)!important;
}
body[data-theme-scope="store"] .store-links a:hover{
  background:color-mix(in srgb,var(--primary) 9%,transparent)!important;
}
body[data-theme-scope="store"] .panel.active,
body[data-theme-scope="store"] .store-standalone .panel{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body[data-theme-scope="store"] .panel.active .section-head{
  margin-bottom:10px!important;
}
body[data-theme-scope="store"] .panel.active .section-kicker{
  margin-bottom:7px!important;
  font-size:.68rem!important;
  opacity:.78;
}
body[data-theme-scope="store"] .panel.active .section-title{
  margin:0!important;
  font-size:clamp(2rem,4vw,3rem)!important;
  line-height:1.1!important;
  letter-spacing:-.035em!important;
}
body[data-theme-scope="store"] .panel.active .store-intro{
  margin:0 auto 34px!important;
  max-width:620px!important;
  font-size:.92rem!important;
  line-height:1.8!important;
  opacity:.78;
}
body[data-theme-scope="store"] .store-grid{
  width:100%!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:20px!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
}
body[data-theme-scope="store"] .product-card{
  position:relative!important;
  width:100%!important;
  min-height:100%!important;
  background:color-mix(in srgb,var(--surface) 92%,transparent)!important;
  border:1px solid color-mix(in srgb,var(--border) 78%,transparent)!important;
  border-radius:20px!important;
  box-shadow:0 8px 26px color-mix(in srgb,var(--shadow-color) 42%,transparent)!important;
  transform:none!important;
  transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease!important;
}
body[data-theme-scope="store"] .product-card:hover{
  transform:translateY(-5px)!important;
  border-color:color-mix(in srgb,var(--primary) 62%,var(--border))!important;
  box-shadow:0 18px 42px color-mix(in srgb,var(--shadow-color) 62%,transparent)!important;
}
body[data-theme-scope="store"] .product-main-link{
  display:flex!important;
  flex-direction:column!important;
  height:auto!important;
}
body[data-theme-scope="store"] .product-visual{
  aspect-ratio:1.45/1!important;
  min-height:170px!important;
  border:0!important;
  border-radius:19px 19px 0 0!important;
  background:
    radial-gradient(circle at 50% 35%,color-mix(in srgb,var(--primary) 12%,transparent),transparent 62%),
    color-mix(in srgb,var(--surface-container) 88%,var(--background))!important;
  font-size:2.7rem!important;
}
body[data-theme-scope="store"] .product-visual img{
  object-fit:cover!important;
  border-radius:inherit!important;
}
body[data-theme-scope="store"] .product-info{
  padding:17px 17px 13px!important;
}
body[data-theme-scope="store"] .product-top{
  margin-bottom:9px!important;
}
body[data-theme-scope="store"] .product-type{
  font-size:.64rem!important;
  letter-spacing:.09em!important;
  opacity:.72;
}
body[data-theme-scope="store"] .product-price{
  font-size:1rem!important;
  font-weight:800!important;
}
body[data-theme-scope="store"] .product-info h3{
  margin:0!important;
  font-size:1.05rem!important;
  line-height:1.45!important;
}
body[data-theme-scope="store"] .product-info p{
  margin:7px 0 0!important;
  font-size:.82rem!important;
  line-height:1.7!important;
  opacity:.76;
}
body[data-theme-scope="store"] .product-actions{
  padding:4px 17px 17px!important;
  gap:8px!important;
  margin-top:auto!important;
}
body[data-theme-scope="store"] .product-actions .product-btn{
  min-height:40px!important;
  padding:8px 11px!important;
  border-radius:12px!important;
  font-size:.78rem!important;
  font-weight:700!important;
}
body[data-theme-scope="store"] .product-actions .product-btn.secondary{
  background:transparent!important;
  border-color:color-mix(in srgb,var(--border) 85%,transparent)!important;
}
body[data-theme-scope="store"] .product-actions .product-btn.secondary:hover{
  background:color-mix(in srgb,var(--primary) 8%,transparent)!important;
}
@media(max-width:1100px){
  body[data-theme-scope="store"] .store-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:820px){
  body[data-theme-scope="store"] .store-standalone{padding-inline:18px!important}
  body[data-theme-scope="store"] .store-topbar{margin-bottom:32px!important}
  body[data-theme-scope="store"] .store-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px!important}
}
@media(max-width:560px){
  body[data-theme-scope="store"] .store-standalone{padding:20px 13px 55px!important}
  body[data-theme-scope="store"] .store-topbar{align-items:stretch!important;margin-bottom:28px!important}
  body[data-theme-scope="store"] .store-links{width:100%!important}
  body[data-theme-scope="store"] .store-links a{flex:1!important;text-align:center!important}
  body[data-theme-scope="store"] .store-grid{grid-template-columns:1fr!important;gap:14px!important}
  body[data-theme-scope="store"] .product-visual{min-height:190px!important}
}


/* Store product listing: no outer panel behind the product cards. */
body[data-theme-scope="store"] .store-standalone .store-products-section{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  animation:none!important;
}
body[data-theme-scope="store"] .store-standalone .store-products-section .store-grid{
  background:transparent!important;
}

/* ============================================================
   v51 — mobile taskbar: card-style items
   ============================================================

   The user asked for the main site's mobile bottom taskbar to look
   more like individual cards (more beautiful). This section gives
   each tab button its own card appearance: rounded background,
   visible border, padding, and a subtle lift on active.
*/

@media (max-width:900px){
  .mobile-nav{
    gap:6px!important;
    padding:10px!important;
    border-radius:22px!important;
    background:color-mix(in srgb,var(--theme-surface) 92%,transparent)!important;
    box-shadow:0 14px 44px rgba(0,0,0,.32)!important;
  }
  .mobile-nav button,
  .mobile-nav .mobile-store-cta,
  .mobile-nav .mobile-search-link,
  .mobile-nav .mobile-academy-cta{
    border:1px solid var(--theme-line,var(--border-subtle,var(--border)))!important;
    border-radius:14px!important;
    padding:10px 4px!important;
    background:var(--theme-surface-2,var(--surface-container,#142A3B))!important;
    color:var(--theme-muted,var(--text-muted))!important;
    font-size:.6rem!important;
    line-height:1.3!important;
    min-height:48px!important;
    transition:transform .18s,border-color .18s,background .18s,color .18s!important;
    gap:3px!important;
  }
  .mobile-nav button:hover,
  .mobile-nav .mobile-store-cta:hover,
  .mobile-nav .mobile-search-link:hover,
  .mobile-nav .mobile-academy-cta:hover{
    border-color:var(--theme-accent,var(--primary))!important;
    color:var(--theme-text,var(--text-primary))!important;
    transform:translateY(-2px)!important;
  }
  .mobile-nav button.active{
    border-color:var(--theme-accent,var(--primary))!important;
    background:var(--selected-background,color-mix(in srgb,var(--primary) 14%,var(--surface)))!important;
    color:var(--selected-text,var(--text-primary))!important;
    font-weight:800!important;
    box-shadow:0 6px 18px color-mix(in srgb,var(--primary) 22%,transparent)!important;
  }
  .mobile-nav .mobile-store-cta,
  .mobile-nav .mobile-academy-cta{
    background:color-mix(in srgb,var(--theme-accent,var(--primary)) 10%,var(--theme-surface-2,var(--surface)))!important;
    border-color:color-mix(in srgb,var(--theme-accent,var(--primary)) 35%,var(--theme-line,var(--border-subtle)))!important;
    color:var(--theme-text,var(--text-primary))!important;
    font-weight:700!important;
  }
  .mobile-lang{
    min-height:48px!important;
    border:1px solid var(--theme-line,var(--border-subtle,var(--border)))!important;
    border-radius:14px!important;
    background:var(--theme-surface-2,var(--surface-container,#142A3B))!important;
    padding:6px 4px!important;
    font-size:.6rem!important;
    gap:2px!important;
  }
  .mobile-lang span{font-size:.52rem!important}
}

@media (max-width:420px){
  .mobile-nav{
    gap:4px!important;
    padding:8px!important;
    left:5px!important;
    right:5px!important;
    bottom:5px!important;
  }
  .mobile-nav button,
  .mobile-nav .mobile-store-cta,
  .mobile-nav .mobile-search-link,
  .mobile-nav .mobile-academy-cta,
  .mobile-lang{
    padding:8px 2px!important;
    min-height:44px!important;
    font-size:.55rem!important;
    border-radius:12px!important;
  }
}

/* =====================================================================
   v60 — RICH CONTENT (admin rich text editor output).
   Applied wherever editor HTML renders publicly: .intro-inner .lede
   (intro capsule), .article-content-text/.article-content-extra (article
   + work detail), .capsule-text (about/resume expandable items).
   Tables render inside .rich-table-wrap — an overflow-x:auto box scoped
   to the table itself, so a wide table scrolls INSIDE its own container
   and can never push the capsule/panel/page sideways on phones.
   ===================================================================== */
.rich-content{max-width:100%}
.rich-content p{margin:0 0 .85em}
.rich-content p:last-child{margin-bottom:0}
.rich-content h1,.rich-content h2,.rich-content h3,.rich-content h4,.rich-content h5,.rich-content h6{
  margin:1.1em 0 .5em;line-height:1.3;color:var(--theme-text)
}
.rich-content h1:first-child,.rich-content h2:first-child,.rich-content h3:first-child,.rich-content h4:first-child{margin-top:.2em}
.rich-content h1{font-size:1.7em}
.rich-content h2{font-size:1.45em}
.rich-content h3{font-size:1.22em}
.rich-content h4{font-size:1.08em}
.rich-content ul,.rich-content ol{margin:0 0 .85em;padding-inline-start:1.5em}
.rich-content li{margin:0 0 .32em}
.rich-content blockquote{
  margin:0 0 .85em;padding:.5em 1em;border-inline-start:3px solid color-mix(in srgb,var(--theme-accent) 55%,transparent);
  background:color-mix(in srgb,var(--theme-surface-2) 55%,transparent);border-radius:10px
}
.rich-content a{color:var(--theme-accent-hover);text-decoration:underline;text-underline-offset:2px}
.rich-content a:hover{opacity:.85}
.rich-content hr{border:0;border-top:1px solid var(--theme-line);margin:1.2em 0}
.rich-content img{max-width:100%;height:auto;border-radius:12px}
.rich-content mark{background:color-mix(in srgb,var(--theme-accent) 30%,transparent);color:inherit;border-radius:4px;padding:0 3px}
.rich-content small{font-size:.82em}
/* ---- Table: readable, capped, and scrollable inside its own wrapper ---- */
.rich-table-wrap{
  overflow-x:auto;overflow-y:hidden;
  max-width:100%;margin:0 0 1em;
  border-radius:12px;
  border:1px solid var(--theme-line);
  background:color-mix(in srgb,var(--theme-surface-2) 45%,transparent);
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.rich-table-wrap::-webkit-scrollbar{height:8px}
.rich-table-wrap::-webkit-scrollbar-thumb{background:var(--theme-line);border-radius:4px}
.rich-content .rich-table-wrap:last-child{margin-bottom:0}
.rich-content table{
  border-collapse:collapse;width:100%;max-width:100%;
  font-size:.92em;line-height:1.6;
}
.rich-content table:not(:only-child){margin:0}
.rich-content th,.rich-content td{
  border:1px solid var(--theme-line);
  padding:8px 11px;text-align:start;vertical-align:top;
  overflow-wrap:anywhere;word-break:normal;
}
.rich-content th{
  background:color-mix(in srgb,var(--theme-accent) 12%,transparent);
  font-weight:700;white-space:nowrap;
}
.rich-content td:empty::after{content:"\00a0"}
/* The intro capsule keeps tighter vertical rhythm. */
.intro-inner .lede.rich-content p{margin:0 0 .7em}
.intro-inner .lede.rich-content ul,.intro-inner .lede.rich-content ol{margin:0 0 .7em}
.intro-inner .lede.rich-content table{font-size:.9em}
/* About/resume expandable items. */
.expand-body .capsule-text.rich-content{margin:6px 0 0}
