/* ==========================================================================
   Yiu Lee Trading — yiulee.com
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #141829;
  --ink-2: #363b4f;
  --muted: #6b6f80;
  --line: #e7e3da;
  --line-2: #d8d3c7;

  --brand: #2338a8;
  --brand-ink: #1b2c88;
  --brand-soft: #eceffc;
  --whatsapp: #1f9d55;
  --whatsapp-ink: #178347;
  --danger: #c2372b;
  --danger-soft: #fdecea;
  --success: #1f8a4c;
  --success-soft: #e8f6ee;
  --warn: #a86a12;
  --warn-soft: #fdf3e1;

  --sw-1: #2338a8; --sw-2: #e8553a; --sw-3: #f2b230; --sw-4: #2a9d8f; --sw-5: #7b4bb7;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 41, .06), 0 1px 1px rgba(20, 24, 41, .03);
  --shadow: 0 1px 2px rgba(20, 24, 41, .05), 0 12px 32px -14px rgba(20, 24, 41, .22);
  --shadow-lg: 0 30px 60px -24px rgba(20, 24, 41, .35);

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 72px;
}

/* ---------------------------------------------------------------- Base -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Keep in-page jump targets clear of the sticky header. This must NOT be scroll-padding on html:
   the browser would then treat the header's search box as hidden and scroll the page up on every keystroke. */
main [id] { scroll-margin-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-ink); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
::selection { background: #d8defb; }

.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn-text { color: var(--warn); font-weight: 600; }
.center { justify-content: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* -------------------------------------------------------------- Buttons -- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 650; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand); }
.btn-primary:hover { --btn-bg: var(--brand-ink); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn-dark:hover { --btn-bg: #000; }
.btn-whatsapp { --btn-bg: var(--whatsapp); --btn-fg: #fff; --btn-bd: var(--whatsapp); }
.btn-whatsapp:hover { --btn-bg: var(--whatsapp-ink); }
.btn-ghost { --btn-bg: var(--surface); }
.btn-ghost:hover { --btn-bd: var(--ink-2); }
.btn-light { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }
.btn-outline-light { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.45); }
.btn-outline-light:hover { --btn-bd: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.link-arrow .i { transition: transform .15s; }
.link-arrow:hover .i { transform: translateX(3px); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 650; text-decoration: none; }
.pill-soft { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); margin-bottom: 16px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sw-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sw-2) 20%, transparent); }
.eyebrow-light { color: #b9c3ff; }

/* --------------------------------------------------------------- Header -- */
.topbar { background: var(--ink); color: #c9cbd6; font-size: 13px; }
.topbar::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--sw-1) 0 20%, var(--sw-2) 20% 40%, var(--sw-3) 40% 60%, var(--sw-4) 60% 80%, var(--sw-5) 80%); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; }
.topbar-note { display: inline-flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-links { display: inline-flex; gap: 18px; flex: none; }
.topbar a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; text-decoration: underline; }

.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(20,24,41,.4); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 4px 8px rgba(35,56,168,.25)); }
.brand-text { display: grid; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-sub { font-size: 13px; color: var(--muted); letter-spacing: .2em; margin-top: 3px; }
.brand-light, .brand-light:hover { color: #fff; }
.brand-light .brand-sub { color: #9aa0b8; }

/* Search lives in the sticky header on every page, so it stays at the top while scrolling. */
.header-search { display: flex; align-items: center; flex: 1; max-width: 600px; margin-left: auto; padding: 4px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.header-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.header-search > .i { margin-left: 10px; color: var(--muted); }
.header-search input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 0; background: none; font-size: 15px; }
.header-search input:focus { outline: none; }
.header-search-btn { min-height: 38px; padding: 0 18px; border-radius: 999px; }
.header-search { position: relative; }
.header-search.is-loading > .i { animation: search-pulse .8s ease-in-out infinite alternate; color: var(--brand); }
@keyframes search-pulse { to { opacity: .3; } }

/* Live search results */
.search-panel { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-results { max-height: min(62vh, 480px); overflow-y: auto; padding: 6px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.search-item:hover, .search-item.is-active { background: var(--brand-soft); color: var(--ink); }
.search-thumb { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--line); background: #fff; overflow: hidden; color: var(--line-2); }
.search-thumb img { width: 100%; height: 100%; object-fit: contain; }
.search-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.search-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-title mark { background: #ffe9a8; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-meta { font-size: 12.5px; color: var(--muted); }
.search-price { flex: none; font-weight: 750; font-size: 14.5px; white-space: nowrap; }
.search-price.is-ask { font-weight: 600; font-size: 13px; color: var(--brand); }
.search-all { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-weight: 650; text-decoration: none; }
.search-all:hover { background: var(--brand-soft); }
.search-empty { padding: 16px; color: var(--ink-2); font-size: 15px; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a:not(.btn) { padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.main-nav > a:not(.btn):hover { background: rgba(20,24,41,.05); color: var(--ink); }
.main-nav > a[aria-current="page"] { color: var(--brand); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; }
.nav-toggle .when-open { display: none; }

/* --------------------------------------------------------------- Flash -- */
.flash-stack { display: grid; gap: 10px; margin-top: 18px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r); border: 1px solid; font-weight: 550; font-size: 15px; animation: flash-in .3s ease-out; }
.flash > .i { margin-top: 2px; }
.flash span { flex: 1; }
.flash-success { background: var(--success-soft); border-color: #bfe5cf; color: #14653a; }
.flash-error { background: var(--danger-soft); border-color: #f4c7c1; color: #9a2a20; }
.flash-info { background: var(--brand-soft); border-color: #cfd6f7; color: var(--brand-ink); }
.flash-close { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 2px; }
.flash-close:hover { opacity: 1; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------------------------------------------------------- Search box -- */
.hero-search { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px; margin: 26px 0 18px; max-width: 560px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); }
.hero-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }
.hero-search > .i { margin-left: 12px; color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; padding: 0 4px; font-size: 16px; }
.hero-search input:focus { outline: none; }
.hero-search .btn { border-radius: 13px; min-height: 48px; }
.hero-search-sm { margin-inline: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }


/* ------------------------------------------------------------ Sections -- */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; margin-top: 6px; }


/* ------------------------------------------------------- Product cards -- */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.catalog .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.product-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.product-media { position: relative; aspect-ratio: 1; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 6%; transition: transform .35s; }
.product-card:hover .product-media img { transform: scale(1.04); }
.product-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line-2); background: repeating-linear-gradient(-45deg, var(--surface-2) 0 12px, #fff 12px 24px); }
.product-noimg .i { width: 42px; height: 42px; stroke-width: 1.5; }
.product-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.product-cat { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-title { font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.product-price { margin-top: auto; padding-top: 6px; font-weight: 800; font-size: 17px; color: var(--ink); }
.product-price.is-ask { font-weight: 650; font-size: 14px; color: var(--brand); }

/* ------------------------------------------------------------ Features -- */


/* ------------------------------------------------------------ Page head -- */
.page-head { padding: 28px 0 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--bg)); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumb .i { width: 14px; height: 14px; opacity: .6; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }
.page-title { font-size: clamp(28px, 4vw, 42px); font-weight: 800; }
.page-sub { color: var(--muted); margin: 6px 0 0; }

/* ------------------------------------------------------------- Catalog -- */
.catalog { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; padding-top: 28px; padding-bottom: 64px; }
.catalog-side { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; padding-right: 4px; }
.side-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.cat-list, .cat-sub { list-style: none; padding: 0; margin: 0; }
.cat-list a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 15px; }
.cat-list a:hover { background: var(--surface); color: var(--ink); }
.cat-list a.is-active { background: var(--surface); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand), var(--shadow-sm); }
.cat-list .count { color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cat-sub { margin: 2px 0 8px 12px; border-left: 1px solid var(--line-2); padding-left: 6px; }
.cat-sub a { font-size: 14px; padding: 6px 10px; }
.cat-sub a.is-active { box-shadow: none; background: var(--brand-soft); }

.chip-scroller { display: none; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chip-scroller::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-sm { padding: 6px 12px; font-size: 13px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 18px; }
.input-icon { position: relative; flex: 1; }
.input-icon .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { width: 100%; height: 46px; padding: 0 14px 0 42px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.input-icon input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input-sm input { height: 40px; }
.select-wrap { position: relative; display: inline-flex; }
.select-wrap select { appearance: none; -webkit-appearance: none; height: 46px; padding: 0 40px 0 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; font-weight: 550; }
.select-wrap select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.select-wrap > .i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.select-block, .select-block select { width: 100%; }
.js .toolbar-submit { display: none; }
.filter-note { color: var(--ink-2); font-size: 15px; margin: -6px 0 16px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.page-numbers { display: inline-flex; gap: 6px; align-items: center; }
.page-num, .page-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 650; text-decoration: none; }
.page-num:hover, .page-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.page-num.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-gap { color: var(--muted); padding: 0 4px; }

.empty { text-align: center; padding: 56px 20px; max-width: 560px; margin: 0 auto; }
.empty h1, .empty h2 { font-size: 26px; margin: 16px 0 8px; }
.empty p { color: var(--ink-2); }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); }
.empty-icon .i { width: 30px; height: 30px; }
.empty-code { display: block; font-size: 88px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; background: linear-gradient(90deg, var(--sw-1), var(--sw-5) 40%, var(--sw-2) 70%, var(--sw-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.empty .hero-search { margin: 24px auto 16px; }
.narrow-page { max-width: 720px; padding-top: 48px; padding-bottom: 72px; }
.debug { text-align: left; white-space: pre-wrap; font-size: 12px; background: #fff; border: 1px solid var(--line); padding: 12px; border-radius: 8px; overflow: auto; }

/* ------------------------------------------------------------- Product -- */
.owner-bar { background: var(--brand); color: #fff; font-size: 14px; }
.owner-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.owner-bar span { display: inline-flex; align-items: center; gap: 8px; }
.product-page { padding-top: 24px; padding-bottom: 48px; }
.product-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: 8px; }
.gallery { position: sticky; top: calc(var(--header-h) + 16px); }
.gallery-stage { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 1; }
.gallery-main { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 4%; transition: opacity .2s; }
.gallery-main img.is-loading { opacity: .4; }
.gallery-zoom { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.9); border: 1px solid var(--line); color: var(--ink-2); opacity: 0; transition: opacity .2s; }
.gallery-stage:hover .gallery-zoom { opacity: 1; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.gallery-nav.prev { left: 12px; } .gallery-nav.next { right: 12px; }
.gallery-nav:hover { background: #fff; }
.gallery-count { position: absolute; left: 14px; bottom: 14px; padding: 4px 10px; border-radius: 999px; background: rgba(20,24,41,.75); color: #fff; font-size: 13px; font-weight: 600; }
.gallery-empty { display: grid; place-items: center; align-content: center; gap: 10px; height: 100%; color: var(--muted); background: repeating-linear-gradient(-45deg, var(--surface-2) 0 14px, #fff 14px 28px); }
.gallery-empty .i { width: 56px; height: 56px; stroke-width: 1.4; color: var(--line-2); }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.gallery-thumb { flex: none; width: 76px; height: 76px; padding: 0; border-radius: 12px; border: 2px solid var(--line); background: #fff; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--brand); }
.gallery-thumb:hover { border-color: var(--ink-2); }

.product-info { padding-top: 6px; }
.product-name { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -0.03em; margin: 14px 0 16px; overflow-wrap: anywhere; }
.product-pricebox { display: grid; gap: 6px; padding: 18px 0; border-block: 1px solid var(--line); margin-bottom: 20px; }
.price-big { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.price-big.is-ask { font-size: 24px; color: var(--brand); }
.price-note { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.buy-actions { display: grid; gap: 10px; }
.facts { margin: 24px 0 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.fact { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.fact:last-child { border-bottom: 0; }
.fact dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.fact dd { margin: 0; color: var(--ink); }
.share-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 8px 2px; border: 0; background: none; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.share-btn:hover { color: var(--brand); }
.product-desc { max-width: 820px; margin-top: 48px; }
.product-desc h2 { font-size: 24px; margin-bottom: 14px; }
.prose { font-size: 17px; color: var(--ink-2); overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.3em; }

.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(10,12,22,.94); }
.lightbox::backdrop { background: rgba(10,12,22,.9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; user-select: none; }
.lightbox-close, .lightbox-nav { position: fixed; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.22); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 18px; } .lightbox-nav.next { right: 18px; }

/* ------------------------------------------------------------- Contact -- */
.contact-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; padding-top: 32px; padding-bottom: 72px; align-items: start; }
.contact-cards { display: grid; gap: 14px; }
.contact-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
a.contact-card:hover { color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.contact-card > span:last-child { display: grid; gap: 2px; }
.contact-icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.contact-icon .i { width: 22px; height: 22px; }
.contact-label { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); }
.contact-value { font-size: 18px; font-weight: 650; }
.contact-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 14px; margin-top: 4px; }
.hours { margin: 6px 0 0; display: grid; gap: 4px; }
.hours div { display: flex; gap: 16px; justify-content: space-between; }
.hours dt { font-weight: 600; } .hours dd { margin: 0; color: var(--ink-2); }

/* ---------------------------------------------------------------- Cards -- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 28px); box-shadow: var(--shadow-sm); }
.card-quiet { background: var(--surface-2); box-shadow: none; }
.card-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.card-title-sm { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 750; margin-bottom: 14px; }
.card-sub { color: var(--muted); margin-bottom: 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-head .card-title-sm { margin-bottom: 12px; }
.center-card { text-align: center; }
.center-card .empty-icon { margin-bottom: 16px; }
.success-state { text-align: center; padding: 24px 0; }
.success-state h2 { font-size: 24px; margin: 16px 0 8px; }
.success-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.success-icon .i { width: 30px; height: 30px; stroke-width: 2.5; }

/* ---------------------------------------------------------------- Forms -- */
.form { display: grid; gap: 0; }
.field { display: grid; gap: 7px; margin-bottom: 18px; align-content: start; }
.field label, .label-row { font-weight: 650; font-size: 15px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.small-link { font-size: 14px; font-weight: 550; }
.optional { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 4px; }
.field input:not([type=checkbox]):not([type=file]), .field textarea, .field select {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field input:disabled { background: var(--surface-2); color: var(--muted); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 14px; font-weight: 600; margin: 0; }
.field-hint { color: var(--muted); font-size: 14px; margin: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.input-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input-prefix span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); border-right: 1px solid var(--line); color: var(--muted); font-weight: 650; }
.field .input-prefix input { border: 0; border-radius: 0; box-shadow: none !important; }
.has-error .input-prefix { border-color: var(--danger); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px !important; }
.password-wrap .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }

.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; flex: none; width: 46px; height: 28px; margin-top: 2px; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.switch-text { display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.switch-text strong { color: var(--ink); font-size: 15px; }

/* ----------------------------------------------------------------- Auth -- */
.auth-page { padding-top: clamp(24px, 5vw, 64px); padding-bottom: 72px; }
.auth-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 920px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); }
.auth-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; background: var(--ink); color: #c9cbd6; overflow: hidden; min-height: 460px; }
.auth-art-inner { position: relative; z-index: 1; }
.auth-art .brand-mark { width: 52px; height: 52px; }
.auth-art-title { font-size: 28px; font-weight: 800; color: #fff; margin: 22px 0 8px; letter-spacing: -0.02em; }
.auth-stripes { position: absolute; inset: auto -10% -14% -10%; height: 46%; display: flex; gap: 10px; transform: rotate(-8deg); }
.auth-stripes span { flex: 1; border-radius: 14px 14px 0 0; }
.auth-stripes span:nth-child(1) { background: var(--sw-1); height: 70%; align-self: flex-end; }
.auth-stripes span:nth-child(2) { background: var(--sw-3); height: 95%; align-self: flex-end; }
.auth-stripes span:nth-child(3) { background: var(--sw-2); height: 80%; align-self: flex-end; }
.auth-stripes span:nth-child(4) { background: var(--sw-4); height: 100%; align-self: flex-end; }
.auth-stripes span:nth-child(5) { background: var(--sw-5); height: 75%; align-self: flex-end; }
.auth-form { padding: clamp(28px, 5vw, 48px); }
.auth-form .flash { margin-bottom: 18px; }
.auth-foot { margin: 18px 0 0; text-align: center; color: var(--muted); }

/* -------------------------------------------------------------- Account -- */
.account-head { padding-top: 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.account-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.account-user { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
.account-user-text { display: grid; line-height: 1.2; font-size: 14px; }
.account-user-text span { color: var(--muted); font-size: 12.5px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--muted); font-weight: 650; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-muted { margin-left: auto; font-weight: 550; font-size: 14px; }
.account-body { padding-top: 24px; padding-bottom: 120px; }
.account-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.account-toolbar-right { display: flex; gap: 10px; align-items: center; flex: 1; justify-content: flex-end; }
.account-toolbar-right .input-icon { max-width: 300px; }
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.seg-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 650; font-size: 14px; text-decoration: none; white-space: nowrap; }
.seg-item:hover { color: var(--ink); background: var(--surface-2); }
.seg-item.is-active { background: var(--ink); color: #fff; }
.seg-count { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: rgba(20,24,41,.08); font-variant-numeric: tabular-nums; }
.seg-item.is-active .seg-count { background: rgba(255,255,255,.18); }
.scope-note { font-size: 14px; color: var(--muted); margin: -4px 0 14px; }

.plist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.plist-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 120px 150px auto; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background .15s; }
.plist-row:last-child { border-bottom: 0; }
.plist-row:hover { background: var(--surface-2); }
.plist-thumb { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); color: var(--line-2); }
.plist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plist-main { display: grid; gap: 2px; min-width: 0; }
.plist-title { font-weight: 650; color: var(--ink); text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.plist-title:hover { color: var(--brand); }
.plist-meta { color: var(--muted); font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.plist-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.plist-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.plist-actions form { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-live { background: var(--success-soft); color: var(--success); }
.badge-hidden { background: #eef0f3; color: #596075; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-blocked { background: var(--danger-soft); color: var(--danger); }

.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; text-decoration: none; margin-bottom: 16px; }
.back-link:hover { color: var(--ink); }
.editor { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.editor + .savebar, .account-body > .flash { margin-bottom: 16px; }
.editor-side { display: grid; gap: 16px; }
.editor-side .card { padding: 20px; }
.stack-actions { display: grid; gap: 8px; justify-items: start; margin-bottom: 10px; }
.stack-actions form { margin: 0; }

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photo-grid:not(:empty) { margin-bottom: 12px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid var(--line); background: #fff; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile.is-cover { border-color: var(--sw-3); }
.photo-tile.is-pending img { opacity: .5; }
.photo-tile .progress { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.8); overflow: hidden; }
.photo-tile .progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.cover-badge { position: absolute; left: 6px; top: 6px; display: none; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--sw-3); color: var(--ink); font-size: 11.5px; font-weight: 750; }
.cover-badge .i { width: 12px; height: 12px; fill: currentColor; }
.photo-tile.is-cover .cover-badge { display: inline-flex; }
.photo-actions { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.photo-actions form { margin: 0; }
.photo-actions .icon-btn { background: rgba(255,255,255,.95); border-color: var(--line); }
.photo-tile:hover .photo-actions, .photo-tile:focus-within .photo-actions { opacity: 1; }
.photo-tile.is-cover .photo-actions form[data-ajax="cover"] { display: none; }
.photo-remove { position: absolute; right: 4px; top: 4px; }

.dropzone { position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); margin-bottom: 4px; }
.dropzone-title { font-weight: 700; }
.dropzone-sub { color: var(--muted); font-size: 13.5px; }
.upload-status { margin-top: 10px; font-size: 14px; font-weight: 600; }
.upload-status.is-error { color: var(--danger); }
.upload-status.is-ok { color: var(--success); }

.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
.btn-danger:hover { --btn-bg: #a32c22; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-danger-outline { --btn-bg: #fff; --btn-fg: var(--danger); --btn-bd: #ecb4ad; }
.btn-danger-outline:hover { --btn-bd: var(--danger); --btn-bg: var(--danger-soft); }
.link-danger { color: var(--danger) !important; }
.delete-link { margin-top: 14px; }
.icon-btn.danger { color: #b0574e; }
.delete-card { max-width: 640px; margin: 0 auto; padding: clamp(20px, 4vw, 32px); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--danger); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.delete-steps { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0 0 20px; font-size: 14px; font-weight: 650; color: var(--muted); }
.delete-steps li { display: inline-flex; align-items: center; gap: 8px; }
.delete-steps span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); font-size: 12px; }
.delete-steps .is-current { color: var(--danger); }
.delete-steps .is-current span { border-color: var(--danger); background: var(--danger); color: #fff; }
.delete-steps .is-done span { border-color: var(--success); color: var(--success); }
.delete-product { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.delete-product .plist-main { flex: 1; }
.delete-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.delete-heading { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 24px 0 12px; color: var(--danger); }
.delete-list { margin: 0 0 20px; padding-left: 1.2em; color: var(--ink-2); display: grid; gap: 6px; }
.delete-lead { color: var(--ink-2); }
.delete-lead code { background: var(--danger-soft); color: var(--danger); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.delete-alt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 20px; border-radius: var(--r); background: var(--brand-soft); color: var(--brand-ink); font-size: 14.5px; }
.delete-alt span { display: flex; gap: 8px; align-items: flex-start; }
.delete-alt form { margin: 0; flex: none; }
.delete-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
#confirm-text { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* Diagnostics */
.diag-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.diag-bar-top p { margin: 0; max-width: 560px; font-size: 14px; }
.diag-run { display: flex; gap: 8px; }
.diag-run .input-icon { width: 220px; }
.diag-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.diag-card { display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.diag-label { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.diag-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.diag-value-sm { font-size: 18px; padding: 6px 0 4px; }
.diag-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.diag-fail { color: var(--danger); }
.diag-section { margin-bottom: 18px; }
.diag-table td { vertical-align: middle; }
.diag-desc { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; white-space: normal; }
.diag-bar-cell { width: 22%; }
.diag-meter { display: block; height: 8px; border-radius: 99px; background: var(--success); }
.diag-meter.diag-ok { background: #e3a13a; }
.diag-meter.diag-slow { background: var(--danger); }
.diag-index { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.diag-index li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; }
.diag-index li.is-missing { background: #fff8ec; border-color: #f3d9a8; }
.diag-index-state { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.is-missing .diag-index-state { background: var(--warn-soft); color: var(--warn); }
.diag-index-state .i { width: 15px; height: 15px; }
.diag-index code { font-size: 13px; }
.diag-fix { display: block; margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--ink); color: #e5e7f0; white-space: pre-wrap; word-break: break-all; }
.diag-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.diag-facts { margin: 0; display: grid; gap: 0; }
.diag-facts div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.diag-facts div:last-child { border-bottom: 0; }
.diag-facts dt { color: var(--muted); font-weight: 600; }
.diag-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .diag-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diag-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .diag-hide-sm { display: none; }
  .diag-run { width: 100%; }
  .diag-run .input-icon { flex: 1; width: auto; }
  .diag-value { font-size: 22px; }
  .diag-facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

.perm-panel { margin-bottom: 20px; padding: 20px; border: 1px solid #f4c7c1; border-left: 4px solid var(--danger); border-radius: var(--r-lg); background: #fffaf9; }
.perm-head { display: flex; gap: 14px; align-items: flex-start; }
.perm-head h2 { font-size: 18px; margin-bottom: 4px; }
.perm-head p { margin: 0; color: var(--ink-2); }
.perm-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); }
.perm-panel code, .perm-ok code { font-size: 13px; background: rgba(20,24,41,.06); padding: 1px 6px; border-radius: 6px; }
.perm-table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.perm-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.perm-table tr:last-child td { border-bottom: 0; }
.perm-table tr.is-bad td { background: #fff5f4; }
.perm-table code { background: none; padding: 0; }
.perm-okcount { display: flex; align-items: center; gap: 6px; margin: -6px 0 14px; color: var(--success); }
.perm-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.perm-actions form { margin: 0; }
.perm-actions .field-hint { flex: 1; min-width: 240px; }
.perm-warn { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-soft); color: #7a4c0c; font-size: 14px; }
.perm-manual { margin-top: 12px; }
.perm-manual summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; }
.cmds { margin: 10px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--ink); color: #e5e7f0; font-size: 12.5px; line-height: 1.7; overflow-x: auto; white-space: pre; }
.perm-ok { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--success); font-size: 13.5px; font-weight: 600; }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(20,24,41,.35); }
.savebar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.savebar-note { color: var(--muted); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.savebar-note.is-dirty { color: var(--warn); font-weight: 650; }
.savebar-actions { display: flex; gap: 10px; flex: none; }
.settings-layout { max-width: 760px; }

/* --------------------------------------------------------------- Footer -- */
.site-footer { margin-top: 24px; background: var(--ink); color: #aab0c4; }
.paint-stripe { height: 6px; background: linear-gradient(90deg, var(--sw-1) 0 20%, var(--sw-2) 20% 40%, var(--sw-3) 40% 60%, var(--sw-4) 60% 80%, var(--sw-5) 80%); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; padding-top: 48px; padding-bottom: 36px; }
.footer-brand p { margin-top: 16px; max-width: 28em; }
.footer-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-links li { display: flex; gap: 8px; align-items: flex-start; }
.footer-links .i { margin-top: 3px; color: #7f87a3; }
.footer-links a { color: #dfe2ec; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgba(255,255,255,.08); font-size: 14px; }

/* ----------------------------------------------------------------- Home -- */
.home-title { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; letter-spacing: -0.025em; }
.home-sub { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.home-products { padding-top: 22px; padding-bottom: 36px; }
.home-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.product-grid.dense { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dense .product-body { padding: 12px 14px 14px; }
.dense .product-title { font-size: 15px; }
.home-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; color: var(--muted); font-size: 14px; }
.ask-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 36px; border-radius: var(--r-lg); background: var(--ink); color: #d6d8e3; }
.ask-strip p { flex: 1; min-width: 220px; margin: 0; }
.ask-strip strong { color: #fff; }
.ask-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.1); color: #8fe3b0; }
.ask-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1180px) { .product-grid.dense { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .product-grid.dense { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .product-grid.dense { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ask-actions { width: 100%; }
  .ask-actions .btn { flex: 1; }
}

/* ----------------------------------------------------------- Responsive -- */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog { grid-template-columns: 210px minmax(0, 1fr); gap: 24px; }
  .plist-row { grid-template-columns: 56px minmax(0, 1fr) 100px auto; }
  .plist-status { display: none; }
  .header-search { max-width: 420px; }
  .header-search-btn { padding: 0 14px; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  main [id] { scroll-margin-top: 150px; }
  /* Phones/tablets: logo + menu on the first row, the search bar on its own row below. */
  .header-inner { flex-wrap: wrap; row-gap: 10px; min-height: 0; padding-top: 10px; padding-bottom: 10px; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .nav-toggle { display: inline-grid; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px var(--gutter) 20px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; }
  .nav-open .main-nav { transform: none; opacity: 1; visibility: visible; }
  .nav-open .nav-toggle .when-open { display: block; }
  .nav-open .nav-toggle .when-closed { display: none; }
  .main-nav > a:not(.btn) { padding: 14px 12px; font-size: 17px; }
  .nav-cta { margin: 8px 0 0; min-height: 50px; }
  .catalog { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .catalog-side { display: none; }
  .chip-scroller { display: flex; }
  .catalog .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-layout { grid-template-columns: minmax(0, 1fr); }
  .gallery { position: static; }
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-card { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 180px; padding: 28px; }
  .auth-art p:not(.auth-art-title) { display: none; }
  .auth-art-title { margin: 14px 0 0; font-size: 22px; }
  .auth-stripes { inset: auto -10% -30% 40%; height: 100%; }
}

@media (max-width: 640px) {
  .topbar-note { display: none; }
  .topbar-inner { justify-content: flex-end; }
  .brand-name { font-size: 16px; }
  .brand-sub { font-size: 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .hero-search { flex-wrap: nowrap; }
  .hero-search .btn { padding: 0 14px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .product-grid, .catalog .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-body { padding: 12px; }
  .product-title { font-size: 15px; }
  .product-price { font-size: 16px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .input-icon { flex-basis: 100%; }
  .toolbar .select-wrap { flex: 1; }
  .toolbar .select-wrap select { width: 100%; }
  .fact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .account-head-row { flex-direction: column; align-items: stretch; }
  .account-user { align-self: flex-start; }
  .account-toolbar-right { flex-wrap: wrap; }
  .account-toolbar-right .input-icon { max-width: none; flex-basis: 100%; }
  .account-toolbar-right .btn { flex: 1; }
  .plist-row { grid-template-columns: 56px minmax(0, 1fr); row-gap: 8px; }
  .plist-price { grid-column: 2; font-size: 15px; }
  .plist-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .savebar-note { display: none; }
  .savebar-actions { width: 100%; }
  .savebar-actions .btn { flex: 1; }
  .tab-muted { margin-left: 0; }
  .owner-bar-inner { font-size: 13px; }
  .gallery-nav { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
