/* ==========================================================================
   HOME-1 — adaptive Home. Scoped to #view-dashboard / .hm.
   Layout, spacing and type follow the Shopify Home reference (measured from the
   150%-scale screenshot, px / 1.5): 16px card padding, 16px radius, 12px gaps,
   16/600 titles, 13/20 body, 32px raised pill buttons.
   Colours stay on EliteDuka tokens: royal blue #168A4E, pale blue #E3F4EB, white, slate.
   ========================================================================== */
.hm { grid-column: 1 / -1; order: -10; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hm[hidden] { display: none !important; }

/* ---- welcome strip (compact) ---- */
.hm-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 4px 0 4px; }
.hm-welcome-tx { min-width: 0; }
.hm-welcome h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; color: #0F172A; }
.hm-welcome p { margin: 2px 0 0; font-size: 13px; line-height: 20px; color: #475569; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- buttons: 32px, raised, pill-ish like the reference ---- */
.hm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13px; line-height: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .12s ease, box-shadow .12s ease; }
.hm-btn i.ai { font-size: 16px; }
.hm-btn-ghost { background: #fff; color: #0F172A; border: 1px solid #E2E8F0; box-shadow: 0 1px 0 rgba(15, 23, 42, .06), inset 0 -1px 0 rgba(15, 23, 42, .08); }
.hm-btn-ghost:hover { background: #F8FAFC; }
.hm-btn-primary { background: var(--color-primary); color: var(--color-on-primary); border: 1px solid var(--color-primary-hover); box-shadow: 0 1px 0 rgba(15, 23, 42, .12), inset 0 -1px 0 rgba(0, 0, 0, .22); }
.hm-btn-primary:hover { background: var(--color-primary-hover); }
.hm-btn:focus-visible, .hm-icon-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.hm-btn:active { }

/* ---- cards ---- */
.hm-grid { display: grid; gap: 12px; align-items: stretch; }
.hm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hm-grid-1 { grid-template-columns: minmax(0, 1fr); }
.hm-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.hm-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; background: #fff; border: 1px solid #E2E8F0; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.hm-card h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -.005em; color: #0F172A; }
.hm-card > p { margin: 0; font-size: 13px; line-height: 20px; color: #475569; }
.hm-card-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }

/* image area (Pexels photo, tinted icon tile if it cannot load) */
.hm-media { position: relative; flex: 1 1 auto; min-height: 150px; margin-top: 12px; border-radius: 12px; overflow: hidden; background: var(--color-primary-soft); }
.hm-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-media-fb { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--color-primary); }
.hm-media-fb i.ai { font-size: 44px; }
.hm-media.is-fallback { border: 1px solid var(--color-primary-soft-border); }
.hm-media.is-fallback .hm-media-fb { display: flex; }
.hm-hero { min-height: 320px; }
.hm-task { min-height: 0; }
.hm-task > p { margin-top: 4px; }

/* ---- setup checklist ---- */
.hm-ring { flex: none; display: block; }
.hm-guide-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hm-count { flex: 1; min-width: 0; font-size: 13px; line-height: 20px; color: #475569; }
.hm-guide > p { margin-top: 4px; }
.hm-bar { height: 6px; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.hm-bar i { display: block; height: 100%; border-radius: inherit; background: var(--color-primary); transition: width .3s ease; }
.hm-guide-card .hm-bar, .hm-guide > .hm-bar { margin-top: 12px; }
.hm-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #64748B; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hm-icon-btn:hover { background: #F1F5F9; color: #0F172A; }
.hm-icon-btn i.ai { font-size: 16px; }
.hm-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid #F1F5F9; }
.hm-steps[hidden] { display: none; }
.hm-step { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid #F1F5F9; }
.hm-step:first-child { border-top: 0; }
.hm-step-tx { flex: 1; min-width: 0; }
.hm-step-tx b { display: block; font-size: 13px; line-height: 20px; font-weight: 600; color: #0F172A; }
.hm-step-tx small { display: block; margin-top: 2px; font-size: 12px; line-height: 18px; color: #64748B; }
.hm-step.is-done .hm-step-tx b { font-weight: 500; color: #64748B; }
.hm-step .hm-btn { align-self: center; flex: none; }
.hm-chk { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-top: 0; border-radius: 50%; border: 1.5px dashed #94A3B8; box-sizing: border-box; color: #fff; }
.hm-chk.is-done { border: 0; background: var(--color-primary); }
.hm-chk i.ai { font-size: 12px; }
.hm-step.is-next .hm-chk { border-style: solid; border-color: var(--color-primary); }

/* active stage: one slim bar above the normal dashboard */
.hm-guide-bar { padding: 12px 16px; }
.hm-guide-head { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 16px; }
.hm-guide-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hm-guide-id b { display: block; font-size: 13px; line-height: 20px; font-weight: 600; color: #0F172A; }
.hm-guide-id span { display: block; font-size: 12px; line-height: 16px; color: #64748B; }
.hm-guide-tools { display: flex; align-items: center; gap: 2px; }
.hm-guide-bar .hm-steps { margin-top: 12px; }

/* ---- new stage: hide every zero-value block of the normal dashboard ---- */
#view-dashboard.hm-new #statGrid,
#view-dashboard.hm-new #dmHero,
#view-dashboard.hm-new #dashToolbar,
#view-dashboard.hm-new #dmTrendsBtn,
#view-dashboard.hm-new .dash-pair,
#view-dashboard.hm-new #dmTarget,
#view-dashboard.hm-new #dashChannels,
#view-dashboard.hm-new .dash-sales-card,
#view-dashboard.hm-new .dash-demo-card,
#view-dashboard.hm-new .dash-orders-card,
#view-dashboard.hm-new .dash-inv-card,
#view-dashboard.hm-new #dashSources,
#view-dashboard.hm-new #dmFeed { display: none !important; }
/* what stays (stock/pending attention, share link) sits right under the onboarding */
#view-dashboard.hm-new .dm-attn { order: -6; }
#view-dashboard.hm-new .dash-share { order: -5; }

@media (max-width: 860px) {
  .hm { gap: 12px; }
  .hm-welcome h2 { font-size: 18px; line-height: 26px; }
  .hm-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-actions .hm-btn { height: 40px; }
  .hm-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hm-hero { min-height: 0; }
  .hm-media { min-height: 132px; flex: none; height: 132px; }
  .hm-card-foot .hm-btn { height: 40px; }
  .hm-guide-head { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .hm-guide-head .hm-bar { grid-column: 1 / -1; grid-row: 2; }
  .hm-step { flex-wrap: wrap; }
  .hm-step-tx { flex: 1 1 calc(100% - 32px); }
  .hm-step .hm-btn { margin-left: 30px; height: 36px; }
}
@media print { .hm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .hm-bar i, .hm-btn { transition: none; } }

/* ---- tilted product-card pair with a centred Add button ---- */
.hm-pair { position: relative; flex: 1 1 auto; min-height: 190px; margin-top: 12px; display: flex; align-items: center; justify-content: center; }
.hm-pc { position: absolute; top: 50%; width: 140px; padding: 8px; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, .12); }
.hm-pc.is-l { left: calc(50% - 178px); transform: translateY(-50%) rotate(-9deg); }
.hm-pc.is-r { left: calc(50% + 38px); transform: translateY(-50%) rotate(9deg); }
.hm-pc-img { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--color-primary-soft); display: flex; align-items: center; justify-content: center; color: var(--color-primary); }
.hm-pc-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-pc-img > i.ai { font-size: 28px; }
.hm-pc-img:not(.is-fallback) > i.ai { visibility: hidden; }
.hm-pc-l { height: 8px; margin-top: 8px; border-radius: 4px; background: #E2E8F0; }
.hm-pc-l.hm-pc-s { width: 55%; margin-top: 6px; background: #BFE3CE; }
.hm-add { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 16px; background: #fff; border: 1px dashed #CBD5E1; box-shadow: 0 6px 18px rgba(15, 23, 42, .14); color: var(--color-primary); text-decoration: none; transition: transform .12s ease, background-color .12s ease; }
.hm-add:hover { background: var(--color-primary-soft); transform: scale(1.04); }
.hm-add:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.hm-add i.ai { font-size: 26px; }
@media (max-width: 480px) { .hm-pc { width: 108px; } .hm-pc.is-l { left: calc(50% - 138px); } .hm-pc.is-r { left: calc(50% + 30px); } .hm-add { width: 60px; height: 60px; } }
@media (max-width: 860px) { .hm-pair { flex: none; height: 190px; } }

/* hover / focus: the two cards swing apart to opposite sides, like the Shopify card */
.hm-pc { transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease; will-change: transform; }
.hm-hero:hover .hm-pc.is-l, .hm-hero:focus-within .hm-pc.is-l { transform: translate(-26px, -50%) rotate(-15deg); }
.hm-hero:hover .hm-pc.is-r, .hm-hero:focus-within .hm-pc.is-r { transform: translate(26px, -50%) rotate(15deg); }
.hm-hero:hover .hm-pc, .hm-hero:focus-within .hm-pc { box-shadow: 0 10px 24px rgba(15, 23, 42, .16); }
@media (max-width: 480px) {
  .hm-hero:hover .hm-pc.is-l, .hm-hero:focus-within .hm-pc.is-l { transform: translate(-14px, -50%) rotate(-14deg); }
  .hm-hero:hover .hm-pc.is-r, .hm-hero:focus-within .hm-pc.is-r { transform: translate(14px, -50%) rotate(14deg); }
}
@media (prefers-reduced-motion: reduce) { .hm-pc { transition: none; } }

/* the card itself rises on hover and presses in on click */
.hm-hero { transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s ease, border-color .25s ease; }
.hm-hero:hover, .hm-hero:focus-within { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .06); border-color: #CBD5E1; }
.hm-clickable { cursor: pointer; }
.hm-hero:active { transform: translateY(-1px) scale(.985); box-shadow: 0 4px 10px rgba(15, 23, 42, .08); transition-duration: .08s; }
.hm-clickable:active .hm-add { transform: scale(.92); background: var(--color-primary-soft); }
@media (prefers-reduced-motion: reduce) { .hm-hero { transition: none; } .hm-hero:hover, .hm-hero:focus-within, .hm-hero:active { transform: none; } }

/* ---- laptop mockup of the default storefront homepage (virtual 1120x700 page, scaled by JS) ---- */
.hm-lap { position: relative; flex: 1 1 auto; margin: 12px auto 0; width: min(100%, 340px); align-self: center; }
.lp-screen { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; border: 5px solid #1E293B; border-bottom-width: 6px; border-radius: 10px 10px 2px 2px; box-shadow: 0 8px 20px rgba(15, 23, 42, .18); box-sizing: border-box; }
.lp-base { height: 8px; margin: 0 -7%; background: linear-gradient(#E2E8F0, #CBD5E1); border-radius: 0 0 12px 12px; box-shadow: 0 6px 12px rgba(15, 23, 42, .14); position: relative; }
.lp-base::after { content: ""; position: absolute; left: 50%; top: 0; width: 18%; height: 3px; transform: translateX(-50%); background: #94A3B8; border-radius: 0 0 4px 4px; }
.lp-page { position: absolute; left: 0; top: 0; width: 1120px; height: 700px; transform-origin: 0 0; background: #fff; font-family: inherit; color: #111827; overflow: hidden; }
.lp-top { display: flex; align-items: center; gap: 28px; height: 68px; padding: 0 36px; border-bottom: 1px solid #E5E7EB; background: #fff; }
.lp-brand { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--lg); white-space: nowrap; }
.lp-logo { height: 40px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.lp-cat { font-size: 17px; font-weight: 600; color: #111827; white-space: nowrap; }
.lp-search { flex: 1; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 18px; border-radius: 999px; background: #F3F4F6; color: #6B7280; font-size: 16px; }
.lp-search em { font-style: normal; }
.lp-search i.ai { font-size: 20px; }
.lp-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #F3F4F6; color: #111827; }
.lp-ic i.ai { font-size: 22px; }
.lp-hero { position: relative; height: 330px; background: linear-gradient(115deg, var(--lgd) 0%, var(--lg) 52%, var(--lgl) 100%); overflow: hidden; }
.lp-art { position: absolute; right: 3%; top: 6%; bottom: 6%; width: 48%; display: flex; align-items: center; justify-content: flex-end; }
.lp-art .hd-art { height: 100%; width: auto; max-width: 100%; display: block; }
.lp-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 10, 10, .58) 0%, rgba(10, 10, 10, .34) 42%, rgba(10, 10, 10, 0) 70%); }
.lp-hc { position: absolute; left: 56px; top: 50%; transform: translateY(-50%); max-width: 46%; color: #fff; }
.lp-hc h2 { margin: 0; font-size: 50px; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 1px 6px rgba(0, 0, 0, .28); }
.lp-hc p { margin: 12px 0 22px; font-size: 21px; line-height: 1.35; text-shadow: 0 1px 4px rgba(0, 0, 0, .28); }
.lp-shop { display: inline-flex; align-items: center; gap: 10px; padding: 15px 32px; border-radius: 999px; background: #fff; color: var(--lgd); font-size: 18px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.lp-shop i.ai { font-size: 16px; transform: rotate(180deg); }
.lp-sec { display: flex; align-items: baseline; justify-content: space-between; padding: 24px 36px 12px; }
.lp-sec h4 { margin: 0; font-size: 22px; font-weight: 700; color: #111827; }
.lp-sec span { font-size: 15px; font-weight: 600; color: #6B7280; }
.lp-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; padding: 0 36px; }
.lp-card { padding: 10px; border: 1px solid #E5E7EB; border-radius: 12px; background: #fff; }
.lp-img { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #F3F4F6; position: relative; }
.lp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lp-l { display: block; height: 11px; margin-top: 12px; border-radius: 6px; background: #E5E7EB; }
.lp-l.lp-s { width: 55%; margin-top: 8px; }
.lp-p { display: block; width: 38%; height: 13px; margin-top: 12px; border-radius: 6px; background: var(--lg); opacity: .8; }
/* card hover: the laptop lifts a touch with the card */
.hm-lap { transition: transform .35s cubic-bezier(.22, 1, .36, 1); }
.hm-hero:hover .hm-lap, .hm-hero:focus-within .hm-lap { transform: translateY(-3px) scale(1.02); }
@media (prefers-reduced-motion: reduce) { .hm-lap { transition: none; } .hm-hero:hover .hm-lap { transform: none; } }

.hm-lap .hd-shadow { fill: rgba(0,0,0,.25); } .hm-lap .hd-glow { fill: rgba(255,255,255,.14); }
.hm-lap .hd-phone { fill: #16161b; stroke: rgba(255,255,255,.35); stroke-width: 1.5; } .hm-lap .hd-screen { fill: #fff; }
.hm-lap .hd-sign, .hm-lap .hd-a, .hm-lap .hd-g1 { fill: var(--lg); } .hm-lap .hd-b { fill: rgba(var(--lg-rgb), .28); }
.hm-lap .hd-signline { fill: #fff; } .hm-lap .hd-btn, .hm-lap .hd-tag, .hm-lap .hd-g2, .hm-lap .hd-bag1 { fill: var(--lgold); }
.hm-lap .hd-badge { fill: var(--lgold); stroke: #fff; stroke-width: 3; } .hm-lap .hd-hand { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hm-lap .hd-card { fill: rgba(255,255,255,.95); } .hm-lap .hd-g3 { fill: #dfe2e6; }
.hm-lap .hd-cart-h { fill: none; stroke: #16161b; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.hm-lap .hd-bag2 { fill: #fff; } .hm-lap .hd-handle { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.hm-lap .hd-bag3 { fill: var(--lgl); } .hm-lap .hd-basket { fill: rgba(22,22,27,.92); }
.hm-lap .hd-grid { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 2; }
.hm-lap .hd-wheel { fill: #16161b; stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.hm-lap .lp-hc h2 { color: #fff; }
.hm-lap .lp-hc p { color: #fff; }
.hm-lap { width: min(100%, 420px); }
.lp-sec h4 { color: #111827; }

/* ==========================================================================
   Products first-run empty state (Shopify reference): headline + action left, product tile collage right.
   Active only when #view-products.is-first-run (no filters and no products); toolbar and table chrome are hidden then.
   ========================================================================== */
#view-products.is-first-run .toolbar,
#view-products.is-first-run .bulk-bar,
#view-products.is-first-run #prodLegacyCostBanner,
#view-products.is-first-run #productsTableWrap,
#view-products.is-first-run #productsGrid,
#view-products.is-first-run #productsPager { display: none !important; }
#view-products.is-first-run .card.card-flush { border-radius: 16px; overflow: hidden; }
.pe { display: flex; flex-direction: column; }
.pe-main { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 40px 48px; min-height: 260px; }
.pe-copy { min-width: 0; max-width: 520px; }
.pe-copy h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; color: #0F172A; }
.pe-copy p { margin: 4px 0 0; font-size: 13px; line-height: 20px; color: #475569; }
.pe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pe { --pe-green: var(--color-primary); }
.pe-art { flex: none; display: flex; align-items: flex-start; gap: 14px; padding-right: 8px; }
.pe-pc { width: 150px; display: flex; flex-direction: column; background: #fff; border: 1px solid #E5E7EB; border-radius: 6px; overflow: hidden; box-shadow: 0 6px 16px rgba(15, 23, 42, .08); transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease; }
.pe-pc.pe-b { margin-top: 34px; }
.pe-pc-img { position: relative; aspect-ratio: 1; padding: 6%; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--color-primary); box-sizing: border-box; }
.pe-pc-img i.ai { font-size: 30px; }
.pe-pc-img img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.pe-pc-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; }
.pe-pc-n { display: block; width: 78%; height: 9px; border-radius: 5px; background: #E5E7EB; }
.pe-pc-p { display: block; width: 46%; height: 12px; border-radius: 6px; background: var(--pe-green); opacity: .85; }
.pe-pc-cta { display: block; margin-top: 4px; padding: 7px 8px; border-radius: 6px; background: var(--pe-green); color: #fff; font-size: 11px; font-weight: 600; text-align: center; letter-spacing: .01em; }
.pe:hover .pe-a { transform: translate(-6px, -4px) rotate(-3deg); }
.pe:hover .pe-b { transform: translate(6px, -4px) rotate(3deg); }
.pe:hover .pe-pc { box-shadow: 0 12px 24px rgba(15, 23, 42, .14); }
.pe-band { padding: 24px 48px 28px; background: #F8FAFC; border-top: 1px solid #F1F5F9; }
.pe-band h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: #0F172A; }
.pe-band p { margin: 4px 0 16px; font-size: 13px; line-height: 20px; color: #475569; }
@media (max-width: 860px) {
  .pe-main { flex-direction: column-reverse; align-items: stretch; padding: 24px 16px; gap: 20px; }
  .pe-art { align-self: center; }
  .pe-band { padding: 20px 16px 24px; }
  .pe-actions .hm-btn, .pe-band .hm-btn { height: 40px; }
  .pe-pc { width: 128px; }
}
@media (prefers-reduced-motion: reduce) { .pe-pc { transition: none; } .pe:hover .pe-pc { transform: none; } }
