/* SANAA — Handmade, curated from Egypt */
/* ──────────────────────────────────────────────────────────────────────────
   1.  TOKENS  (palette · type · breakpoints)
   ────────────────────────────────────────────────────────────────────────── */
:root {
  --paper: #F4EDE2;
  --paper-2: #EDE3D2;
  --sand: #D9C8A9;
  --ink: #1C1A15;
  --olive: #2E3528;
  --olive-2: #3E4A35;
  --terracotta: #B5502E;
  --terracotta-dk: #8F3E22;
  --gold: #B8904C;
  --gold-soft: #C9A56A;
  --off: #FAF6EE;
  --muted: #6E6558;
  --line: #CFBFA3;
  --line-2: #E3D6BC;

  --ff-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --ff-editorial: "Instrument Serif", "Cormorant Garamond", serif;
  --ff-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ff-ar: "Amiri", "Scheherazade New", serif;

  /* Responsive container padding (one source of truth) */
  --gutter: 40px;
  /* Responsive section vertical rhythm */
  --section-y: 140px;
  --section-y-tight: 100px;
}
@media (max-width: 1024px) { :root { --gutter: 28px; --section-y: 110px; --section-y-tight: 80px; } }
@media (max-width: 768px)  { :root { --gutter: 22px; --section-y: 84px;  --section-y-tight: 60px; } }
@media (max-width: 480px)  { :root { --gutter: 16px; --section-y: 64px;  --section-y-tight: 48px; } }

/* ──────────────────────────────────────────────────────────────────────────
   2.  RESET / BASE
   ────────────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}
@media (max-width: 768px) { body { font-size: 14px; } }

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.11  0 0 0 0 0.10  0 0 0 0 0.09  0 0 0 0.07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: var(--terracotta); color: var(--off); }

h1, h2, h3, h4 { font-family: var(--ff-display); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }

img, svg, video { max-width: 100%; height: auto; display: block; }

/* Anything inside a flex/grid that contains long text shouldn't blow up the layout */
input, select, textarea, button { font: inherit; }
input, textarea, select { max-width: 100%; }

@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ──────────────────────────────────────────────────────────────────────────
   3.  CONTAINERS & LAYOUT PRIMITIVES
   ────────────────────────────────────────────────────────────────────────── */
.container       { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.container-wide  { max-width: 1600px; margin: 0 auto; padding: 0 var(--gutter); }

/* Override inline padding "0 40px" / "10px 40px" / "28px 40px" applied via style
   — when a container-wide also has inline padding, force the responsive gutter. */
@media (max-width: 1024px) {
  .container[style*="padding"], .container-wide[style*="padding"] {
    padding-left: var(--gutter) !important;
    padding-right: var(--gutter) !important;
  }
}

/* Gentle bound: vertical paddings in inline styles (140px, 120px) auto-shrink.
   Establishes a tighter editorial rhythm on mobile — no oversized dead zones,
   no compressed blocks. */
@media (max-width: 768px) {
  section[style*="padding: 140px"] { padding-top: var(--section-y) !important; padding-bottom: var(--section-y) !important; }
  section[style*="padding: 120px"] { padding-top: var(--section-y-tight) !important; padding-bottom: var(--section-y-tight) !important; }
  section[style*="padding: 100px"] { padding-top: var(--section-y-tight) !important; padding-bottom: var(--section-y-tight) !important; }
  section[style*="padding: 90px"]  { padding-top: 64px !important; padding-bottom: 64px !important; }
  section[style*="padding: 80px"]  { padding-top: 56px !important; padding-bottom: 56px !important; }
  section[style*="padding: 70px"]  { padding-top: 48px !important; padding-bottom: 40px !important; }
  section[style*="padding: 60px"]  { padding-top: 40px !important; padding-bottom: 32px !important; }
  section[style*="padding: 50px"]  { padding-top: 36px !important; padding-bottom: 32px !important; }
}
@media (max-width: 480px) {
  section[style*="padding: 140px"] { padding-top: var(--section-y) !important; padding-bottom: var(--section-y) !important; }
  section[style*="padding: 120px"] { padding-top: var(--section-y-tight) !important; padding-bottom: var(--section-y-tight) !important; }
  section[style*="padding: 100px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
}

/* ──────────────────────────────────────────────────────────────────────────
   4.  TYPOGRAPHY
   ────────────────────────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 500;
}
.eyebrow .dot { display: inline-block; width: 6px; height: 6px; background: var(--terracotta); border-radius: 50%; margin-right: 10px; vertical-align: middle; }

.rule { height: 1px; background: var(--line); width: 100%; }

/* Arabic text helper */
.ar { font-family: var(--ff-ar); direction: rtl; font-weight: 400; }

@media (max-width: 480px) {
  .eyebrow { font-size: 10px; letter-spacing: 0.18em; }
}

/* ──────────────────────────────────────────────────────────────────────────
   5.  BUTTONS · INPUTS
   ────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 26px;
  font-family: var(--ff-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--off);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.3s ease;
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
}
.btn:hover { background: var(--terracotta); border-color: var(--terracotta); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--off); }
.btn .arrow { transition: transform .3s; }
.btn:hover .arrow { transform: translateX(4px); }

@media (max-width: 480px) {
  .btn { padding: 14px 22px; font-size: 11px; gap: 10px; }
}

/* Hero CTAs on mobile — clear editorial hierarchy:
   primary fills as a pill, secondary becomes a quiet underlined text link.
   Two equal pills felt form-like; this reads art-directed.  */
@media (max-width: 560px) {
  .hero-cta-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 22px !important;
    margin-top: 40px !important;
  }
  .hero-cta-row .btn { width: 100%; justify-content: center; }
  .hero-cta-row .btn.ghost {
    width: auto;
    padding: 6px 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--ink) !important;
    font-family: var(--ff-mono) !important;
    font-size: 11px !important;
    letter-spacing: 0.22em !important;
    border-bottom: 1px solid var(--ink) !important;
    border-radius: 0 !important;
    min-height: auto !important;
    align-self: flex-start;
  }
  .hero-cta-row .btn.ghost:hover {
    background: transparent !important;
    color: var(--terracotta) !important;
    border-bottom-color: var(--terracotta) !important;
  }
}

/* Touch targets — ensure interactive elements are at least 40px tall on touch */
@media (hover: none) and (pointer: coarse) {
  button, a.btn { min-height: 44px; }
}

/* Generic form controls grow comfortable on mobile (16px prevents iOS zoom) */
@media (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
  input[type="search"], input[type="password"], select, textarea {
    font-size: 16px !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   6.  ARCH FRAMES · PLACEHOLDERS · STAR
   ────────────────────────────────────────────────────────────────────────── */
.arch    { border-radius: 1000px 1000px 16px 16px / 600px 600px 16px 16px; overflow: hidden; position: relative; }
.arch-sm { border-radius: 400px 400px 10px 10px / 240px 240px 10px 10px; overflow: hidden; position: relative; }

.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg, #C9B894 0 2px, transparent 2px 14px),
    linear-gradient(180deg, #D9C8A9 0%, #C9B894 100%);
  color: var(--olive);
  overflow: hidden;
}
.ph.terracotta { background: repeating-linear-gradient(135deg, #A34824 0 2px, transparent 2px 14px), linear-gradient(180deg, #B5502E 0%, #8F3E22 100%); color: var(--off); }
.ph.olive      { background: repeating-linear-gradient(135deg, #252B1E 0 2px, transparent 2px 14px), linear-gradient(180deg, #3E4A35 0%, #2E3528 100%); color: var(--off); }
.ph.gold       { background: repeating-linear-gradient(135deg, #9B7538 0 2px, transparent 2px 14px), linear-gradient(180deg, #C9A56A 0%, #B8904C 100%); color: var(--ink); }
.ph.sand       { background: repeating-linear-gradient(135deg, #BFAC87 0 2px, transparent 2px 14px), linear-gradient(180deg, #E6D5B3 0%, #C9B894 100%); color: var(--olive); }

.ph-label {
  position: absolute; inset: auto 0 0 0; padding: 14px 18px;
  font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(0deg, rgba(0,0,0,0.25), transparent);
  color: inherit;
}
.ph-label.top { inset: 0 0 auto 0; background: linear-gradient(180deg, rgba(0,0,0,0.2), transparent); }

.marquee { overflow: hidden; direction: ltr; }

.star8 {
  width: 1em; height: 1em; display: inline-block; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,2 61,39 98,50 61,61 50,98 39,61 2,50 39,39' /></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,2 61,39 98,50 61,61 50,98 39,61 2,50 39,39' /></svg>") center / contain no-repeat;
}

/* ──────────────────────────────────────────────────────────────────────────
   7.  ACCESSIBILITY
   ────────────────────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }

/* Robust brand focus ring (a11y).
   Many controls in the app set an inline `outline: 0` / `outline: none`, and
   because inline styles out-rank the bare `:focus-visible` element selector
   above, the keyboard focus ring silently disappears. These rules win:
   - the interactive-element selector is more specific AND uses !important, so
     it beats inline `outline:0` on real inputs/buttons/links/etc.
   - `.brand-focus` is an opt-in utility any custom widget (a div with
     role="button"/"listbox", a styled label, etc.) can add to inherit the
     same terracotta ring. Apply `.brand-focus` to anything that takes focus
     but isn't a native form control. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="option"]:focus-visible,
[role="combobox"]:focus-visible,
[contenteditable]:focus-visible,
.brand-focus:focus-visible {
  outline: 2px solid var(--terracotta) !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}
/* Some browsers (older Safari) don't fire :focus-visible on custom widgets we
   manage with JS — fall back to :focus for our opt-in utility only. */
.brand-focus:focus { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.brand-focus:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: fixed !important; top: -100px !important; left: -100px !important;
  width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; opacity: 0; pointer-events: none;
  white-space: nowrap; border: 0;
}
.skip-link:focus, .skip-link:focus-visible {
  top: 12px !important; left: 12px !important;
  width: auto; height: auto; opacity: 1; pointer-events: auto;
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 8px; z-index: 100;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; text-decoration: none;
}
body.rtl .skip-link:focus, body.rtl .skip-link:focus-visible { left: auto !important; right: 12px !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   8.  RTL
   ────────────────────────────────────────────────────────────────────────── */
body.rtl { direction: rtl; }
body.rtl .btn .arrow { transform: scaleX(-1); }
body.rtl .btn:hover .arrow { transform: scaleX(-1) translateX(4px); }
body.rtl .skip-link { left: auto; right: 12px; }
body.rtl .arrow-flip { transform: scaleX(-1); display: inline-block; }

/* ──────────────────────────────────────────────────────────────────────────
   9.  HORIZONTAL SCROLL ROW
   ────────────────────────────────────────────────────────────────────────── */
.hscroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }

/* ──────────────────────────────────────────────────────────────────────────
  10.  RESPONSIVE UTILITY HOOKS  (used in JSX className=)
   ────────────────────────────────────────────────────────────────────────── */

/* Show / hide by viewport */
.hide-md { }
.hide-sm { }
.show-md { display: none !important; }
.show-sm { display: none !important; }
@media (max-width: 980px) { .hide-md { display: none !important; } .show-md { display: inline-flex !important; } }
@media (max-width: 640px) { .hide-sm { display: none !important; } .show-sm { display: inline-flex !important; } }

/* ──────────────────────────────────────────────────────────────────────────
  11.  SITE NAV  (TopBar + MainNav + Mobile drawer)
   ────────────────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--ink); color: var(--paper);
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 10px var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { gap: 14px; }
.topbar-left .topbar-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 880px) {
  .topbar { font-size: 10px; padding: 8px var(--gutter); letter-spacing: 0.14em; }
  .topbar-hide-md { display: none !important; }
}
@media (max-width: 540px) {
  .topbar { padding: 8px var(--gutter); }
  .topbar-hide-sm { display: none !important; }
  .topbar-msg { font-size: 9px; }
}

.mainnav {
  background: var(--paper); position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--line-2);
}
.mainnav-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 18px var(--gutter); gap: 30px; position: relative;
  max-width: 1600px; margin: 0 auto;
}
@media (max-width: 980px) {
  .mainnav-row { grid-template-columns: auto 1fr auto; gap: 14px; padding: 14px var(--gutter); }
  .mainnav-links, .mainnav-actions-secondary { display: none !important; }
  .mainnav-actions { gap: 12px !important; }
}
@media (max-width: 380px) {
  .mainnav-row { gap: 8px; padding: 12px var(--gutter); }
  /* Shrink the wordmark on the smallest phones so SANAA never wraps */
  .mainnav-row .wordmark > span:first-child { font-size: 22px !important; letter-spacing: 0.14em !important; }
  .mainnav-row .wordmark-ar { font-size: 16px !important; }
  .nav-burger .hide-sm { display: none; }
  .nav-burger { padding: 8px 10px; }
}

.nav-burger {
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 14px; cursor: pointer;
  display: none; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--ink); min-height: 44px; min-width: 44px;
}
.nav-burger svg { width: 16px; height: 12px; }
@media (max-width: 980px) { .nav-burger { display: inline-flex; } }

/* Mobile drawer (used by MainNav) */
.nav-drawer-overlay {
  position: fixed; inset: 0; background: rgba(28,26,21,0.55); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.nav-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(86vw, 340px); background: var(--paper);
  z-index: 91; transform: translateX(-100%); transition: transform .35s ease;
  display: flex; flex-direction: column;
  box-shadow: 30px 0 60px -20px rgba(28,26,21,0.3);
  overflow-y: auto;
}
body.rtl .nav-drawer { left: auto; right: 0; transform: translateX(100%); box-shadow: -30px 0 60px -20px rgba(28,26,21,0.3); }
.nav-drawer.open { transform: translateX(0); }
body.rtl .nav-drawer.open { transform: translateX(0); }

.nav-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line-2);
}
.nav-drawer-list { padding: 14px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-drawer-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-radius: 12px; text-decoration: none;
  color: var(--ink); font-family: var(--ff-display); font-size: 22px;
  letter-spacing: -0.01em;
}
.nav-drawer-item:hover, .nav-drawer-item.active { background: var(--paper-2); }
.nav-drawer-item .ar { font-size: 16px; color: var(--muted); }
.nav-drawer-section {
  padding: 22px 22px 6px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}
.nav-drawer-foot {
  margin-top: auto; padding: 18px 22px; border-top: 1px solid var(--line-2);
  display: flex; gap: 10px; flex-wrap: wrap;
}

.mainnav-links {
  display: flex; gap: 30px; font-size: 14px; align-items: center;
}
.mainnav-actions {
  display: flex; gap: 16px; justify-content: flex-end; align-items: center; font-size: 13px;
}
@media (max-width: 980px) { .mainnav-actions { font-size: 12px; gap: 14px; } }

/* Megamenu — hide on mobile (replaced by drawer) */
@media (max-width: 980px) { .megapanel { display: none !important; } }

/* SubNav (sticky under main nav) — already uses overflow-x: auto inline */
@media (max-width: 768px) {
  /* Reduce sub-nav padding */
}

/* ──────────────────────────────────────────────────────────────────────────
  B4 — maker dashboard: keep content clear of the sticky public header.
  On #/makers/admin the storefront marketing bar is suppressed (B3) so the
  only sticky chrome is .mainnav (~65px). Give the dashboard a scroll offset
  so tab switches / in-page jumps never tuck revenue figures behind the bar.
  Scoped to body.maker-dash so the storefront is untouched.
   ────────────────────────────────────────────────────────────────────────── */
body.maker-dash main#main,
body.maker-dash main#main [id] { scroll-margin-top: 80px; }

/* ──────────────────────────────────────────────────────────────────────────
  12.  HERO  (responsive grid + editorial composition)
   ────────────────────────────────────────────────────────────────────────── */
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 80px; align-items: end; }
.hero-meta { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: start; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.hero-stats > div { padding: 0 24px; }
.hero-img-wrap { position: relative; aspect-ratio: 0.78; max-width: 560px; margin-left: auto; width: 100%; }

@media (max-width: 1024px) {
  .hero-grid { gap: 56px; }
  .hero-img-wrap { max-width: 480px; }
}

/* —— Mobile hero composition ————————————————————————————————————————————
   The hero is re-art-directed for phones: typography leads, the image is
   reduced to a calm editorial plate (not a colored block), CTAs become a
   clear hierarchy (primary pill + supporting text link), and the rhythm
   between every element is intentional, not stretched. */
@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
    align-items: stretch;
  }
  .hero-meta { grid-template-columns: 1fr; gap: 12px; }
  .hero-meta > div:first-child { padding-top: 0; }

  /* Image becomes a contained editorial plate, not a wall of colour.
     Cinematic 1.3 ratio, capped height (≈ 38 % of viewport), inset width. */
  .hero-img-wrap {
    margin: 0 auto;
    aspect-ratio: 1.3;
    width: 84%;
    max-width: 420px;
    max-height: clamp(220px, 38dvh, 320px);
  }
  .hero-img-wrap .ph,
  .hero-img-wrap .arch {
    border-radius: 600px 600px 14px 14px / 280px 280px 14px 14px;
  }

  /* Stats strip — clean editorial 2-column dividers */
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats > div {
    padding: 18px 6px;
    border-right: none !important;
    border-top: 1px solid var(--line-2);
    border-bottom: none !important;
  }
  .hero-stats > div:nth-child(odd) { border-right: 1px solid var(--line-2) !important; }

  /* Drop the numbered floater on mobile — the stats strip below already
     carries that information and the framed pill made the composition busy. */
  .hero-floater { display: none !important; }

  /* Side caption becomes a single quiet editorial credit beneath the image */
  .hero-side-caption {
    position: static !important;
    transform: none !important;
    display: block !important;
    text-align: center !important;
    margin: 16px auto 0 !important;
    white-space: normal !important;
    letter-spacing: 0.24em !important;
    font-size: 9px !important;
    color: var(--muted) !important;
    opacity: 0.9;
  }

  /* Suppress the Arabic descender — clashes with the terracotta surface */
  .hero-arabic-descender { display: none !important; }
}

@media (max-width: 480px) {
  .hero-img-wrap { width: 88%; max-width: 360px; }
}
@media (max-width: 360px) {
  .hero-stats { grid-template-columns: 1fr !important; }
  .hero-stats > div { border-right: none !important; border-top: 1px solid var(--line-2) !important; }
  .hero-img-wrap { width: 92%; }
}

/* ──────────────────────────────────────────────────────────────────────────
  13.  STORY · COLLECTIONS · MAKERS  (homepage major sections)
   ────────────────────────────────────────────────────────────────────────── */
.story-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 100px; align-items: start; }
.story-pillars { margin-top: 60px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.story-pillars > div { padding: 28px 24px; border-right: 1px solid var(--line-2); }
.story-pillars > div:last-child { border-right: none; }

@media (max-width: 1024px) { .story-grid { gap: 60px; } }
@media (max-width: 880px) {
  .story-grid { grid-template-columns: 1fr; gap: 48px; }
  .story-pillars { grid-template-columns: 1fr; }
  .story-pillars > div { border-right: none; border-bottom: 1px solid var(--line-2); }
  .story-pillars > div:last-child { border-bottom: none; }
}

.coll-row {
  display: grid;
  grid-template-columns: 80px 1fr 1.4fr 220px 160px;
  align-items: center; gap: 40px;
  padding: 36px 12px; border-top: 1px solid var(--line);
  cursor: pointer; transition: background 0.3s; position: relative;
}
.coll-row:hover { background: var(--paper-2); }
@media (max-width: 1180px) { .coll-row { grid-template-columns: 60px 1fr 1fr 180px 130px; gap: 26px; } }
@media (max-width: 980px) {
  .coll-row { grid-template-columns: 56px 1fr 110px; grid-template-areas: "num title thumb" "num desc desc" "num tag tag"; gap: 14px 22px; padding: 28px 8px; }
  .coll-row .coll-num   { grid-area: num; }
  .coll-row .coll-title { grid-area: title; }
  .coll-row .coll-desc  { grid-area: desc; }
  .coll-row .coll-tag   { grid-area: tag; align-self: start; }
  .coll-row .coll-thumb { grid-area: thumb; justify-content: end; }
}
@media (max-width: 560px) {
  .coll-row { grid-template-columns: 44px 1fr; grid-template-areas: "num title" "num thumb" "desc desc" "tag tag"; }
  .coll-row .coll-thumb { justify-content: start; }
}

.makers-row { display: flex; gap: 28px; width: max-content; }
.makers-card { width: 300px; }
@media (max-width: 768px) {
  .makers-card { width: 240px; }
}

/* Pieces grid (3-up) — on phone, single column with cinematic 4:5 frame
   that doesn't feel like a tall slab. */
.pieces-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
@media (max-width: 1024px) { .pieces-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
@media (max-width: 560px)  {
  .pieces-grid { grid-template-columns: 1fr; gap: 36px; }
  /* Re-frame the per-piece arch image to a calmer crop on phone */
  .pieces-grid > div > div:first-child { aspect-ratio: 1 !important; max-height: 460px; }
}

/* Atelier two-col */
.atelier-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 80px; align-items: start; }
.atelier-step { display: grid; grid-template-columns: 80px 1fr auto; gap: 28px; padding: 32px 0; align-items: start; }
@media (max-width: 980px) {
  .atelier-grid { grid-template-columns: 1fr; gap: 56px; }
  .atelier-grid > div:first-child { position: static !important; }
}
@media (max-width: 560px) {
  .atelier-step { grid-template-columns: 56px 1fr; gap: 16px 18px; padding: 24px 0; }
  .atelier-step > div:last-child { display: none; }
  .atelier-step h3 { font-size: 26px !important; }
}

/* Journal */
.journal-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 1024px) { .journal-grid { grid-template-columns: 1fr 1fr; } .journal-grid .journal-feature { grid-column: span 2 !important; } }
@media (max-width: 640px)  { .journal-grid { grid-template-columns: 1fr; gap: 36px; } .journal-grid .journal-feature { grid-column: auto !important; } }

/* Footer */
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) 1.2fr; gap: 60px; }
@media (max-width: 1024px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; row-gap: 48px; } .footer-grid > :nth-child(5) { grid-column: span 3; } }
@media (max-width: 640px)  { .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 36px; } .footer-grid > :nth-child(5) { grid-column: span 2; } }
@media (max-width: 420px)  { .footer-grid { grid-template-columns: 1fr; } .footer-grid > :nth-child(5) { grid-column: auto; } }

/* Letter (newsletter) form */
.letter-form { display: flex; align-items: center; gap: 0; padding: 6px 6px 6px 24px; border-radius: 999px; }
@media (max-width: 600px) {
  .letter-form { flex-direction: column; gap: 8px; padding: 14px; border-radius: 22px; }
  .letter-form input { width: 100%; padding: 8px 4px !important; }
  .letter-form button { width: 100%; justify-content: center; }
}

/* PageHeader (shell) — title/kicker grid */
section[style*="padding: 70px 0 60px"] > .container-wide > div[style*="grid-template-columns: 1.3fr 1fr"],
.page-hd-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: end; }
@media (max-width: 880px) {
  .page-hd-grid { grid-template-columns: 1fr; gap: 24px; }
  /* Soften the page hero h1 minimum so it never crowds the kicker */
  .page-hd-grid h1 { font-size: clamp(40px, 9vw, 96px) !important; line-height: 1 !important; }
  .page-hd-grid h1 .ar { font-size: 0.42em !important; margin-top: 10px !important; }
}

/* ──────────────────────────────────────────────────────────────────────────
  14.  SHOP / PDP / GENERIC PAGE GRIDS
   ────────────────────────────────────────────────────────────────────────── */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 50px; }
.shop-grid   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 1180px) { .shop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px)  {
  /* Hide the desktop sidebar entirely on mobile/tablet — replaced by the
     premium filter sheet below. Layout collapses to a single column. */
  .shop-layout { grid-template-columns: 1fr; gap: 0; }
  .shop-filters { display: none !important; }
  .shop-results-row { display: none !important; }
}
@media (max-width: 560px)  {
  .shop-grid { grid-template-columns: 1fr; gap: 32px; }
  /* Calmer 1:1 crop on phone — no tall slab */
  .shop-grid > a > div:first-child { aspect-ratio: 1 !important; max-height: 460px; }
}

/* ──────────────────────────────────────────────────────────────────────────
   Shop · mobile filter UX (≤980)
   A premium slide-up sheet replaces the sidebar. Desktop unchanged.
   ────────────────────────────────────────────────────────────────────────── */

/* Trigger row visible only on mobile/tablet */
.shop-filterbar { display: none; }
@media (max-width: 980px) {
  .shop-filterbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    align-items: stretch; margin-bottom: 22px;
  }
}
@media (max-width: 380px) {
  .shop-filterbar { grid-template-columns: 1fr; }
}

.shop-filterbar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 13px 22px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  cursor: pointer; min-height: 48px;
  white-space: nowrap;
  transition: background .25s ease, color .25s ease;
}
.shop-filterbar-btn:hover { background: var(--ink); color: var(--paper); }
.shop-filterbar-btn .lbl {
  display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap; overflow-wrap: normal; word-break: keep-all;
}
.shop-filterbar-btn .lbl, .shop-filterbar-btn .lbl * { word-break: keep-all; overflow-wrap: normal; }
.shop-filterbar-btn .badge {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--terracotta); color: var(--paper);
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0;
}
.shop-filterbar-btn svg { flex-shrink: 0; }

.shop-filterbar-sort {
  position: relative;
  display: flex;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper);
}
.shop-filterbar-sort::before {
  content: ""; position: absolute; left: 22px; top: 50%; width: 12px; height: 12px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1A15' stroke-width='1.4'><path d='M3 6h18M6 12h12M9 18h6'/></svg>") center / contain no-repeat;
  pointer-events: none;
}
body.rtl .shop-filterbar-sort::before { left: auto; right: 22px; }
.shop-filterbar-sort select {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 13px 44px 13px 44px;
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-height: 48px;
  outline: none;
  border-radius: 999px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
body.rtl .shop-filterbar-sort select { padding: 13px 44px 13px 44px; }
.shop-filterbar-sort::after {
  content: "▾"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 12px; pointer-events: none;
}
body.rtl .shop-filterbar-sort::after { right: auto; left: 22px; }

/* Tiny meta line under the trigger row */
.shop-filterbar-meta {
  display: none;
}
@media (max-width: 980px) {
  .shop-filterbar-meta {
    display: block;
    margin: -8px 0 22px;
    font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--muted);
  }
  .shop-filterbar-meta strong { color: var(--terracotta); font-weight: 500; }
}

/* The sheet itself — slides up from bottom */
.shop-fsheet-overlay {
  position: fixed; inset: 0;
  background: rgba(28,26,21,0.55);
  z-index: 88;
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
  backdrop-filter: blur(2px);
}
.shop-fsheet-overlay.open { opacity: 1; pointer-events: auto; }

.shop-fsheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 89;
  background: var(--paper); color: var(--ink);
  border-radius: 24px 24px 0 0;
  max-height: min(92dvh, 92vh, 760px);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .38s cubic-bezier(.16,.84,.44,1);
  box-shadow: 0 -30px 60px -20px rgba(28,26,21,0.4);
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow: hidden;
}
.shop-fsheet.open { transform: translateY(0); }

.shop-fsheet-grip {
  width: 44px; height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.shop-fsheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 18px;
  border-bottom: 1px solid var(--line-2);
  flex-shrink: 0;
}
.shop-fsheet-eyebrow {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--muted);
}
.shop-fsheet-title {
  font-family: var(--ff-display); font-size: 30px; line-height: 1;
  letter-spacing: -0.01em; margin-top: 6px;
  display: flex; align-items: baseline; gap: 12px;
}
.shop-fsheet-title em {
  font-style: italic; color: var(--terracotta); font-size: 22px;
}
.shop-fsheet-title .ar {
  font-family: var(--ff-ar); font-size: 22px; color: var(--terracotta); font-style: normal;
}
.shop-fsheet-close {
  background: var(--paper-2); border: 1px solid var(--line-2);
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 20px; color: var(--ink);
  cursor: pointer; display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease;
}
.shop-fsheet-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.shop-fsheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 24px 24px;
  overscroll-behavior: contain;
}
.shop-fsheet-body::-webkit-scrollbar { width: 4px; }
.shop-fsheet-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.shop-fsheet-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line-2);
}
.shop-fsheet-section:last-of-type { border-bottom: none; }

.shop-fsheet-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.shop-fsheet-section-title {
  font-family: var(--ff-display); font-size: 20px; color: var(--ink);
  letter-spacing: -0.005em;
}
.shop-fsheet-section-title .ar {
  margin-left: 10px; font-size: 14px; color: var(--muted);
}
body.rtl .shop-fsheet-section-title .ar { margin-left: 0; margin-right: 10px; }
.shop-fsheet-section-count {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--terracotta);
}

.shop-fsheet-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.shop-fsheet-pill {
  display: inline-flex; align-items: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--ff-sans); font-size: 14px;
  cursor: pointer; white-space: nowrap;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.shop-fsheet-pill:hover { border-color: var(--ink); }
.shop-fsheet-pill:active { transform: scale(0.97); }
.shop-fsheet-pill.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.shop-fsheet-pill.active::before {
  content: "✓"; margin-right: 8px; font-size: 12px;
}
body.rtl .shop-fsheet-pill.active::before { margin-right: 0; margin-left: 8px; }

/* Sort radios inside the sheet — same pill grammar but exclusive */
.shop-fsheet-radio { display: flex; flex-direction: column; gap: 2px; }
.shop-fsheet-radio label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  font-family: var(--ff-display); font-size: 18px;
  color: var(--ink);
}
.shop-fsheet-radio label:last-child { border-bottom: none; }
.shop-fsheet-radio label .dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: border-color .2s ease;
  flex-shrink: 0;
}
.shop-fsheet-radio label.active .dot { border-color: var(--ink); }
.shop-fsheet-radio label.active .dot::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta);
}
.shop-fsheet-radio input { display: none; }

/* Sticky footer actions */
.shop-fsheet-foot {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  padding: 16px 24px 18px;
  border-top: 1px solid var(--line-2);
  background: var(--paper);
  flex-shrink: 0;
}
.shop-fsheet-foot .btn { width: 100%; justify-content: center; min-height: 50px; padding: 14px 22px; }
@media (max-width: 360px) {
  .shop-fsheet-foot { grid-template-columns: 1fr; }
}

.pdp-layout    { display: grid; grid-template-columns: 1fr 0.85fr; gap: 60px; }
.pdp-thumbs    { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pdp-promise   { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
@media (max-width: 980px)  { .pdp-layout { grid-template-columns: 1fr; gap: 32px; } }
@media (max-width: 560px)  { .pdp-thumbs { grid-template-columns: repeat(4, 1fr); } .pdp-promise { grid-template-columns: 1fr; text-align: center; gap: 12px; } }

/* Auto-grid: pieces, makers cards, etc. */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
@media (max-width: 480px) { .auto-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; } }

/* Generic 4-col stat grid that should collapse */
.stat-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1024px) { .stat-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .stat-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .stat-grid-4 { grid-template-columns: 1fr; } }

/* Account orders rows */
@media (max-width: 640px) {
  .orders-row { grid-template-columns: 1fr 1fr !important; gap: 12px !important; row-gap: 8px !important; }
}
/* Account nav as horizontal-scroll tabs on mobile */
@media (max-width: 980px) {
  .account-nav { flex-direction: row !important; gap: 6px !important; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .account-nav::-webkit-scrollbar { display: none; }
  .account-nav button { white-space: nowrap; flex-shrink: 0; }
}

/* Generic 3-col / 2-col stack helpers */
.col-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.col-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 880px) { .col-3 { grid-template-columns: 1fr; } .col-2 { grid-template-columns: 1fr; } }

/* Side-by-side hero/visual splits */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.split-2-tight { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
@media (max-width: 880px) { .split-2, .split-2-tight { grid-template-columns: 1fr; gap: 32px; } }

/* Gift / promo card */
.bigsplit-1614 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: stretch; }
@media (max-width: 880px) { .bigsplit-1614 { grid-template-columns: 1fr; } }

/* Apply / Visit page two-col 1.4 ratios */
.split-1-14 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 60px; align-items: center; }
@media (max-width: 880px) { .split-1-14 { grid-template-columns: 1fr; gap: 40px; } }

/* Workshops / Process step strips */
.proc-strip { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 18px; position: relative; }
@media (max-width: 1024px) { .proc-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .proc-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .proc-strip { grid-template-columns: 1fr; } }

/* Help / FAQ list */
.help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (max-width: 880px) { .help-grid { grid-template-columns: 1fr; gap: 22px; } }
.help-row  { display: grid; grid-template-columns: 0.7fr 1fr; }
@media (max-width: 640px) { .help-row { grid-template-columns: 1fr; } }

/* Press logos */
.press-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1024px) { .press-grid { grid-template-columns: repeat(3, 1fr); } .press-grid .press-cell { border-right: none !important; border-bottom: 1px solid var(--line-2); } }
@media (max-width: 600px)  { .press-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .press-grid { grid-template-columns: 1fr; } .press-grid .press-cell { border-bottom: 1px solid var(--line-2) !important; } }
@media (max-width: 880px) {
  .press-head { grid-template-columns: 1fr !important; gap: 20px !important; }
}

/* ──────────────────────────────────────────────────────────────────────────
  15.  TABLES (admin · maker · orders · payouts)
   ────────────────────────────────────────────────────────────────────────── */
/* Wraps any data table — horizontal scroll fallback for ultra-narrow screens. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Force table-style grids to keep their column layout but become scrollable.
   For tables that don't have their own bespoke responsive collapse rules, the
   row keeps a min-width and the parent scrolls horizontally. Tables that DO
   collapse (e.g. .adm-tbl-row.collapsible) opt out via the .stack class. */
@media (max-width: 980px) {
  .adm-tbl-h:not(.stack), .adm-tbl-row:not(.stack) { min-width: 720px; }
  /* Auto-scroll the immediate parent of any admin table header */
  *:has(> .adm-tbl-h:not(.stack)) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  *:has(> .adm-tbl-h:not(.stack))::-webkit-scrollbar { height: 6px; }
  *:has(> .adm-tbl-h:not(.stack))::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
}

/* Admin shell helpers (extend admin-shell.jsx <style> block) */
.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.adm-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.adm-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 980px) {
  .adm-grid-2 { grid-template-columns: 1fr; }
  .adm-grid-3 { grid-template-columns: 1fr; }
  .adm-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .adm-grid-4 { grid-template-columns: 1fr; }
}

/* Hide overflow-prone meta on tiny screens (admin tables) */
@media (max-width: 700px) {
  .adm-hide-mobile { display: none !important; }
}

/* Admin sidebar (already responsive) — improve overlay drawer */
.adm-sidebar { transition: transform .3s ease; }

/* ──────────────────────────────────────────────────────────────────────────
  16.  MAKER ADMIN  (keep + extend)
   ────────────────────────────────────────────────────────────────────────── */
.maker-grid { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.maker-burger { display: none; }
@media (max-width: 880px) {
  .maker-grid { grid-template-columns: 1fr; gap: 20px; }
  .maker-aside { position: fixed !important; top: 0; left: 0; bottom: 0; width: 280px; max-width: 86vw; background: var(--paper); border-right: 1px solid var(--line-2); padding: 20px 16px; transform: translateX(-100%); transition: transform .3s ease; z-index: 95; box-shadow: 30px 0 60px -20px rgba(28,26,21,0.3); overflow-y: auto; }
  body.rtl .maker-aside { left: auto; right: 0; transform: translateX(100%); border-right: none; border-left: 1px solid var(--line-2); }
  .maker-aside.open { transform: translateX(0); }
  .maker-burger { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); }
  .maker-header-cta { display: none !important; }
  .maker-stats { grid-template-columns: 1fr 1fr !important; }
  .maker-twocol { grid-template-columns: 1fr !important; }
  .maker-table-wrap { overflow-x: auto; }
}
@media (max-width: 520px) {
  .maker-stats { grid-template-columns: 1fr !important; }
}

/* Tables inside maker-admin and similar dashboards — horizontal-scroll on mobile */
@media (max-width: 980px) {
  .mk-tbl, .mk-tbl-row { min-width: 720px; }
  *:has(> .mk-tbl) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Maker admin form rows — 2-col stack to 1-col */
@media (max-width: 700px) {
  .mk-form-2 { grid-template-columns: 1fr !important; }
  .mk-form-icon { grid-template-columns: 1fr !important; gap: 14px !important; }
}

/* Messaging conversation grid (maker + customer) */
@media (max-width: 880px) {
  .mk-conv-grid { grid-template-columns: 1fr !important; min-height: auto !important; }
  .mk-conv-list { max-height: 280px !important; border-right: none !important; border-bottom: 1px solid var(--line-2); }

  /* When a thread is open on mobile, swap to single-pane view: hide the list, show only the thread + back link */
  .mk-conv-grid[data-thread-open="true"] .mk-conv-list { display: none; }
  .mk-conv-grid[data-thread-open="true"] .mk-conv-thread .mk-conv-back { display: inline-block !important; }
  .mk-conv-grid[data-thread-open="true"] .mk-conv-thread { max-height: none !important; }
}

/* ──────────────────────────────────────────────────────────────────────────
  17.  CART DRAWER · MODAL · FORMS
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* CartDrawer (already 460/100vw) — make rows lighter */
  .cart-row { grid-template-columns: 64px 1fr auto !important; gap: 12px !important; }
  .cart-foot { padding: 18px 22px !important; }
}

/* CheckoutModal (and modal pattern) */
.modal-card { width: 520px; max-width: 96vw; max-height: 92vh; overflow-y: auto; }
@media (max-width: 480px) {
  .modal-card { width: 100vw !important; max-width: 100vw !important; height: 100dvh; max-height: 100dvh; border-radius: 0 !important; padding: 22px 18px !important; }
  .modal-form-row { grid-template-columns: 1fr !important; }
}

/* Form 2-col rows that should stack on mobile */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row-2 { grid-template-columns: 1fr; } }

/* ──────────────────────────────────────────────────────────────────────────
  18.  ADMIN tables / charts visual helpers
   ────────────────────────────────────────────────────────────────────────── */
/* Charts with fixed heights — keep aspect on small screens */
.chart-frame { width: 100%; min-width: 0; }
.chart-frame svg { display: block; max-width: 100%; }

/* Long titles in cards never break layout */
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ──────────────────────────────────────────────────────────────────────────
  19.  GLOBAL OVERFLOW SAFETY  (last-resort, no horizontal scroll)
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  /* Block overflow from things like 100vw children inside containers */
  .container, .container-wide { overflow-x: clip; }
  /* Force any inline section padding > 80px on mobile to be reasonable */
  section { max-width: 100vw; }
}

/* Long words / URLs never break out */
p, span, a, h1, h2, h3, h4, li, td, th { overflow-wrap: anywhere; word-break: break-word; }
.ar { word-break: normal; }

/* ──────────────────────────────────────────────────────────────────────────
  20.  BRAND FORM CONTROLS  (BrandSelect · BrandDate · BrandFileDrop · toast)
       Shared, reusable controls — see primitives.jsx for the components.
       Everything here is logical-property driven so it mirrors in RTL.
   ────────────────────────────────────────────────────────────────────────── */

/* —— Shared field shell (paper surface, ink text, hairline border) ———— */
.bf-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding-block: 12px;
  padding-inline: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  text-align: start;
}
.bf-field:hover { border-color: var(--ink); }
.bf-field[aria-disabled="true"],
.bf-field[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--paper-2);
}
.bf-field[aria-disabled="true"]:hover,
.bf-field[disabled]:hover { border-color: var(--line); }
/* The placeholder / empty state reads quiet */
.bf-placeholder { color: var(--muted); }
/* Trailing chevron / icon slot — logical end so it flips in RTL */
.bf-affix {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 14px;
  display: flex;
  align-items: center;
  color: var(--olive);
  pointer-events: none;
}
.bf-affix svg { display: block; }

/* —— BrandSelect (custom listbox) ———————————————————————————————————— */
.bsel { position: relative; width: 100%; }
.bsel-trigger {
  /* inherits .bf-field; reserve room for the chevron on the logical end */
  padding-inline-end: 40px;
  justify-content: space-between;
  gap: 10px;
}
.bsel-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bsel-chevron { transition: transform .2s ease; }
.bsel[data-open="true"] .bsel-chevron { transform: rotate(180deg); }

.bsel-pop {
  position: absolute;
  z-index: 70;
  inset-inline: 0;
  top: calc(100% + 6px);
  max-height: 280px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 44px -22px rgba(28,26,21,0.45);
  padding: 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* open upward when there isn't room below */
.bsel-pop.up { top: auto; bottom: calc(100% + 6px); }
.bsel-pop::-webkit-scrollbar { width: 5px; }
.bsel-pop::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.bsel-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 7px;
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  text-align: start;
}
.bsel-opt:hover,
.bsel-opt[data-active="true"] { background: var(--paper-2); }
.bsel-opt[aria-selected="true"] { color: var(--terracotta); }
.bsel-opt[aria-selected="true"] .bsel-tick { opacity: 1; }
.bsel-opt[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.bsel-tick { opacity: 0; color: var(--terracotta); flex-shrink: 0; }

/* —— BrandDate (localized display over a transparent native input) ——— */
.bdate { position: relative; width: 100%; }
.bdate-display {
  /* inherits .bf-field; leave room for the calendar glyph */
  padding-inline-end: 44px;
}
/* The real <input type=date|datetime-local> sits transparent on top so the
   native picker + keyboard still work, while the localized text shows beneath. */
.bdate-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  /* keep it interactive but invisible; do NOT display:none (picker needs it) */
  background: transparent;
  color: transparent;
  z-index: 2;
}
.bdate-native:disabled { cursor: not-allowed; }
/* Make the whole field show the picker indicator hit-area, not just the icon */
.bdate-native::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.bdate-native::-webkit-datetime-edit { opacity: 0; }
/* When the native input is keyboard-focused, ring the visible display */
.bdate-native:focus-visible + .bdate-display {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-color: var(--ink);
}

/* —— BrandFileDrop (dashed paper dropzone) ——————————————————————————— */
.bfile { width: 100%; }
.bfile-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 30px 24px;
  background: var(--paper);
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  color: var(--olive);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.bfile-zone:hover { border-color: var(--gold); background: var(--paper-2); }
.bfile-zone[data-drag="true"] { border-color: var(--terracotta); background: var(--paper-2); }
.bfile-zone[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.bfile-zone[aria-disabled="true"]:hover { border-color: var(--line); background: var(--paper); }
.bfile-icon { color: var(--olive); }
.bfile-label {
  font-family: var(--ff-display);
  font-size: 19px;
  line-height: 1.2;
  color: var(--ink);
}
.bfile-hint {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.bfile-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 4px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.bfile-list {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
}
.bfile-file {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--ink); text-align: start;
}
.bfile-file .bfile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bfile-file .bfile-size { color: var(--muted); flex-shrink: 0; letter-spacing: 0.08em; }
.bfile-remove {
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted); display: inline-flex; padding: 4px; border-radius: 6px; flex-shrink: 0;
}
.bfile-remove:hover { color: var(--terracotta); }

/* —— toast() — brand-styled, RTL-aware, auto-dismiss ————————————————— */
.bf-toast-host {
  position: fixed;
  z-index: 1000;
  inset-block-end: 24px;
  inset-inline: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  pointer-events: none;
}
.bf-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  max-width: min(460px, 92vw);
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid rgba(244,237,226,0.14);
  font-family: var(--ff-sans); font-size: 13px; font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 18px 44px -20px rgba(28,26,21,0.5);
  animation: bfToastIn .28s cubic-bezier(.16,.84,.44,1);
}
.bf-toast.out { animation: bfToastOut .26s ease forwards; }
.bf-toast .bf-toast-icon { display: inline-flex; flex-shrink: 0; }
.bf-toast .bf-toast-text { overflow-wrap: anywhere; }
.bf-toast.ar, .bf-toast[dir="rtl"] { font-family: var(--ff-ar); }
/* tones — terracotta used sparingly, like a wax seal, only on error */
.bf-toast.success { background: var(--olive); }
.bf-toast.error   { background: var(--terracotta); }
.bf-toast.info    { background: var(--ink); }
@keyframes bfToastIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bfToastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(8px); } }
