/* Hamro Ramro admin portal · design round 1 (premium pass, real catalogue) · mobile first.
   Frame: white brand header (logo ≥160 px) → cream canvas → white cards. Red is reserved for the one primary action
   and the active nav item. Motion: CSS transitions only (transform/opacity), all off under prefers-reduced-motion.
   Breakpoints: 768 (table/grid), 1024 (header nav, edit two-column), 1280 (wider aside), 1440 (extra columns). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; scroll-padding-bottom: calc(var(--action-bar-height) + 16px); }
body { margin: 0; font-family: var(--font-sans); font-size: var(--type-body); line-height: 1.5; color: var(--color-text); background: var(--color-canvas); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--color-link); text-underline-offset: 3px; }
a:hover { color: var(--color-text); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--type-mono); font-size: 0.8125rem; letter-spacing: 0.01em; }

/* Focus: 2 px ink outline with a white gap (tokens: color.focus) */
:focus { outline: none; }
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); box-shadow: 0 0 0 2px var(--color-surface); border-radius: 4px; }
.on-dark :focus-visible { outline-color: var(--color-surface); box-shadow: 0 0 0 2px var(--color-text); }
.skip-link { position: absolute; left: 8px; top: -80px; z-index: var(--z-skip); background: var(--color-text); color: var(--color-surface); padding: 10px var(--space-4); border-radius: var(--radius-sm); font-weight: 500; }
.skip-link:focus { top: 8px; color: var(--color-surface); }

/* Icons */
.icon, .btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Prototype bar (part of the preview, not of the design) ---------- */
.proto-bar { background: var(--color-surface-inverse); color: var(--color-surface); font-size: var(--type-small); padding: var(--space-2) var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.proto-bar a { color: var(--color-surface); }
.proto-bar strong { font-weight: 600; }
.proto-bar .proto-note { color: var(--color-on-inverse-muted); }
.proto-bar .proto-states { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proto-bar .proto-states a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .45); border-radius: var(--radius-pill); text-decoration: none; transition: background-color var(--motion-fast) ease; }
.proto-bar .proto-states a:hover { background: rgba(255, 255, 255, .12); }
.proto-bar .proto-states a[aria-current="true"] { background: var(--color-surface); color: var(--color-text); }
.export .proto-states { display: none; }

/* ---------- Buttons (press = scale, never layout shift) ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--btn-height); padding: 0 18px; border-radius: var(--btn-radius); border: 1px solid transparent; font-size: 1rem; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-base) ease, transform var(--motion-fast) var(--ease-out); }
.btn:active:not([disabled]) { transform: scale(var(--press-scale)); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: 0 1px 0 rgba(36, 32, 32, .12), 0 6px 14px -8px rgba(229, 5, 16, .55); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); color: var(--btn-primary-fg); }
.btn-primary:active { background: var(--color-action-primary-pressed); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-text); }
.btn-ghost { background: transparent; color: var(--color-text); padding: 0 var(--space-3); }
.btn-ghost:hover { background: var(--color-neutral-bg); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: var(--color-surface); }
.btn-danger:hover { background: var(--color-danger-hover); color: var(--color-surface); }
.btn-danger-outline { background: var(--color-surface); color: var(--color-danger); border-color: var(--color-danger); }
.btn-danger-outline:hover { background: var(--color-danger-bg); color: var(--color-danger); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--color-disabled-bg); color: var(--color-text-muted); border-color: var(--color-disabled-bg); box-shadow: none; cursor: not-allowed; }
.btn-sm { padding: 0 var(--space-3); }
.btn-icon { width: var(--tap); padding: 0; }
.btn-block { width: 100%; }
.btn.is-busy { pointer-events: none; }
.btn .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Brand header (white, logo ≥160 px) ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.app-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border-subtle); position: relative; z-index: var(--z-menu); }
.app-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--color-action-primary) 0 64px, var(--color-accent-rule) 64px 112px, transparent 112px); }
.hdr-inner { max-width: calc(var(--container) + 2 * var(--space-8)); margin: 0 auto; padding: var(--space-3) var(--space-4); display: flex; align-items: center; gap: var(--space-4); }
.logo-link { display: block; flex: none; padding: calc(var(--header-logo) * .1); margin: calc(var(--header-logo) * -.06) 0 calc(var(--header-logo) * -.06) calc(var(--header-logo) * -.1); border-radius: var(--radius-sm); }
.logo { width: var(--header-logo); min-width: var(--logo-min); aspect-ratio: 1203 / 673; height: auto; }
.hdr-nav { display: none; }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }
.hdr-tools .view-site { display: none; }
.hdr-label { display: none; }
@media (min-width: 1024px) {
  .hdr-inner { padding: var(--space-3) var(--space-8); gap: var(--space-8); }
  .hdr-nav { display: block; align-self: stretch; }
  .hdr-nav .nav-list { flex-direction: row; height: 100%; align-items: stretch; gap: var(--space-1); }
  .hdr-nav .nav-list a { position: relative; height: 100%; min-height: var(--tap); padding: 0 var(--space-4); border-radius: 0; background: none; box-shadow: none; }
  .hdr-nav .nav-list a::after { content: ""; position: absolute; left: var(--space-4); right: var(--space-4); bottom: -13px; height: 3px; border-radius: 2px 2px 0 0; background: var(--color-action-primary); transform: scaleX(0); transform-origin: left; transition: transform var(--motion-slow) var(--ease-out); }
  .hdr-nav .nav-list a:hover::after, .hdr-nav .nav-list a[aria-current="page"]::after { transform: scaleX(1); }
  .hdr-nav .nav-list a[aria-current="page"] { color: var(--color-text); font-weight: 600; }
  .hdr-nav .nav-list a:hover { background: none; }
  .hdr-tools .view-site { display: inline-flex; }
  .hdr-tools .menu-btn { display: none; }
  .hdr-label { display: block; font-size: var(--type-eyebrow); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); padding-left: var(--space-4); border-left: 1px solid var(--color-border); margin-left: calc(var(--space-8) * -.5); }
}
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.nav-list a { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; font-weight: 500; transition: background-color var(--motion-fast) ease; }
.nav-list a svg { width: 20px; height: 20px; }
.nav-list a:hover { background: var(--color-surface-alt); }
.nav-drawer .nav-list a[aria-current="page"] { background: var(--color-selected-bg); color: var(--color-selected-fg); box-shadow: inset 3px 0 0 var(--color-action-primary); }

/* Drawer (below 1024): slides in from the right */
.nav-drawer { position: fixed; inset: 0; z-index: var(--z-drawer); background: var(--color-scrim); opacity: 0; visibility: hidden; transition: opacity var(--motion-base) ease, visibility 0s linear var(--motion-base); }
.nav-drawer.is-open { opacity: 1; visibility: visible; transition: opacity var(--motion-base) ease; }
.nav-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: var(--color-surface); padding: var(--space-4); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; transform: translateX(100%); transition: transform var(--motion-slow) var(--ease-out); }
.nav-drawer.is-open .nav-drawer-panel { transform: none; }
.nav-drawer-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border-subtle); }
.nav-drawer-head .logo { width: 160px; }
.drawer-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); }

/* Account menu (pops with a short scale-fade) */
.menu-wrap { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding: 0 var(--space-2); border: 1px solid transparent; background: none; border-radius: var(--radius-pill); transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease; }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--color-surface-alt); border-color: var(--color-border-subtle); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--color-surface-inverse); color: var(--color-surface); display: grid; place-items: center; font-size: 13px; font-weight: 600; box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-accent-rule); }
.account-btn .acc-label { display: none; font-weight: 500; white-space: nowrap; }
.account-btn .chev { width: 16px; height: 16px; color: var(--color-text-muted); transition: transform var(--motion-base) var(--ease-out); }
.account-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
@media (min-width: 768px) and (max-width: 1023.98px), (min-width: 1280px) { .account-btn .acc-label { display: inline; } }
@media (min-width: 768px) { .account-btn { padding: 0 var(--space-3) 0 var(--space-1); } }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-menu); min-width: 280px; background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); padding: var(--space-2); transform-origin: top right; animation: pop var(--motion-base) var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu .menu-meta { padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); margin-bottom: 6px; font-size: var(--type-small); color: var(--color-text-muted); }
.menu .menu-meta strong { display: block; color: var(--color-text); font-size: var(--type-label); }
.menu .menu-meta .role { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--color-text); background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-pill); padding: 1px 8px; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 var(--space-3); border: 0; background: none; border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; text-align: left; transition: background-color var(--motion-fast) ease; }
.menu a:hover, .menu button:hover { background: var(--color-surface-alt); }
.menu .sep { height: 1px; background: var(--color-border-subtle); margin: 6px 0; }

/* ---------- Page frame ---------- */
.main { flex: 1; width: 100%; max-width: calc(var(--container) + 2 * var(--space-8)); margin: 0 auto; padding: var(--space-6) var(--space-4) 120px; }
@media (min-width: 1024px) { .main { padding: var(--space-8) var(--space-8) 128px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: var(--type-eyebrow); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-selected-fg); margin-bottom: var(--space-2); }
.eyebrow::before { content: ""; width: 24px; height: 3px; border-radius: 2px; background: var(--color-accent-rule); }
.page-title { font-size: var(--type-h2); font-weight: 800; letter-spacing: -0.02em; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.page-sub { color: var(--color-text-muted); font-size: var(--type-small); margin-top: var(--space-1); }
.breadcrumb { font-size: var(--type-small); margin-bottom: var(--space-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--color-text-muted); }
.breadcrumb a { color: var(--color-text-muted); display: inline-flex; align-items: center; min-height: 32px; }
.breadcrumb a:hover { color: var(--color-text); }

/* Cards */
.card { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card-pad { padding: var(--space-4); }
@media (min-width: 768px) { .card-pad { padding: var(--space-6); } }
.section-title { font-size: var(--type-h3); font-weight: 700; letter-spacing: -0.01em; }
.section-head { display: flex; flex-direction: column; gap: var(--space-1); }
.hint { color: var(--color-text-muted); font-size: var(--type-small); }
.default-note { display: inline-flex; gap: 8px; align-items: flex-start; font-size: var(--type-small); color: var(--color-info); background: var(--color-info-bg); border: 1px solid var(--color-info-border); border-radius: var(--radius-sm); padding: 6px 10px; }
.default-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- Summary strip (real counts, each a filter) ---------- */
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
@media (min-width: 768px) { .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); } }
.sum { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--space-3); align-items: center; text-align: left; min-height: 64px; padding: var(--space-3); background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  transition: transform var(--motion-base) var(--ease-out), box-shadow var(--motion-base) ease, border-color var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.sum:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); border-color: var(--color-border); }
.sum:active { transform: scale(.985); }
.sum .sum-ic { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.sum .sum-ic svg { width: 18px; height: 18px; }
.sum .sum-n { font-size: 1.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sum .sum-l { font-size: var(--type-small); color: var(--color-text-muted); font-weight: 500; line-height: 1.3; }
.sum[data-k="published"] .sum-ic { background: var(--color-success-bg); color: var(--color-success); }
.sum[data-k="draft"] .sum-ic { background: var(--color-neutral-bg); color: var(--color-text-muted); }
.sum[data-k="noimg"] .sum-ic { background: var(--color-warning-bg); color: var(--color-warning); }
.sum[data-k="review"] .sum-ic { background: var(--color-info-bg); color: var(--color-info); }
.sum[aria-pressed="true"] { border-color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-text), var(--shadow-card); background: var(--color-row-hover); }
.sum[aria-pressed="true"]::after { content: ""; position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-action-primary); }
@media (min-width: 1024px) { .sum { min-height: 76px; padding: var(--space-4); } .sum .sum-n { font-size: 1.75rem; } }

/* ---------- Toolbar ---------- */
.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-3); padding: var(--space-3); background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.toolbar .f-search { grid-column: 1 / -1; }
.toolbar .f-status { grid-column: 1 / -1; }
.toolbar .tb-end { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-2); }
@media (min-width: 768px) {
  .toolbar { grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(130px, 1fr)); align-items: end; padding: var(--space-4); }
  .toolbar .f-search, .toolbar .f-status { grid-column: auto; }
  .toolbar .tb-end { grid-column: 1 / -1; }
}
@media (min-width: 1280px) { .toolbar { grid-template-columns: minmax(240px, 2.2fr) repeat(3, minmax(150px, 1fr)) auto; } .toolbar .tb-end { grid-column: auto; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--type-label); font-weight: 600; }
.label .opt { font-weight: 400; color: var(--color-text-muted); }
.label .req { font-weight: 500; color: var(--color-selected-fg); }
.input, .select, .textarea { width: 100%; min-height: var(--input-height); padding: 10px var(--space-3); border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--color-surface); font-size: 1rem; transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: var(--space-10); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23242020' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; text-overflow: ellipsis; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-text); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); border-color: var(--color-text); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--color-text-muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea, .field.has-error .chip-input, .field.has-error .unit-group { border-color: var(--color-danger); box-shadow: inset 0 0 0 1px var(--color-danger); }
.field.has-error .unit-group .input, .field.has-error .unit-group .select { box-shadow: none; }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--color-danger); font-size: var(--type-small); font-weight: 500; animation: rise var(--motion-base) var(--ease-out); }
.field-error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.field-ok { display: flex; gap: 6px; align-items: center; color: var(--color-success); font-size: var(--type-small); font-weight: 500; }
.field-ok svg { width: 16px; height: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(-3px); } }
.counter { font-size: 12px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.label-row { display: flex; align-items: baseline; gap: var(--space-2); }

/* View toggle (table / grid) */
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--color-neutral-bg); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-sm); }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); min-width: var(--tap); padding: 0 var(--space-3); border: 0; border-radius: 5px; background: transparent; font-size: var(--type-small); font-weight: 600; color: var(--color-text-muted); transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-fast) ease; }
.view-toggle button svg { width: 18px; height: 18px; }
.view-toggle button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-1); }
.view-toggle { min-height: var(--tap); align-items: center; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); min-height: var(--tap); }
.results-meta { font-size: var(--type-small); color: var(--color-text-muted); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.f-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 4px 0 12px; background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); font-size: var(--type-small); font-weight: 500; }
.f-chip button { width: 36px; height: 36px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; margin: -1px 0; transition: background-color var(--motion-fast) ease; }
.f-chip button::before { content: ""; position: absolute; width: var(--tap); height: var(--tap); }
.f-chip button:hover { background: var(--color-neutral-bg); }
.f-chip button svg { width: 16px; height: 16px; }

/* ---------- Badges, flags, carton tag, switch ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--type-small); font-weight: 600; white-space: nowrap; border: 1px solid; line-height: 1.5; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge-published { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success-border); }
.badge-draft { color: var(--color-text-muted); background: var(--color-neutral-bg); border-color: var(--color-border); }
.badge-draft::before { background: transparent; border: 2px solid currentColor; width: 8px; height: 8px; }
.flag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 1px solid; }
.flag svg { width: 14px; height: 14px; }
.flag-noimg { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.flag-review { color: var(--color-info); background: var(--color-info-bg); border-color: var(--color-info-border); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.carton { display: inline-flex; align-items: stretch; align-self: flex-start; border: 1.5px solid var(--color-text); border-radius: 8px; overflow: hidden; font-size: .875rem; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.carton .k { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; background: var(--color-surface-inverse); color: var(--color-surface); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .6875rem; }
.carton .k svg { width: 13px; height: 13px; }
.carton .v { display: inline-flex; align-items: center; padding: 6px 9px; font-weight: 700; background: var(--color-surface); color: var(--color-text); }
.carton.is-empty { border-style: dashed; border-color: var(--color-border-strong); }
.carton.is-empty .k { background: var(--color-neutral-bg); color: var(--color-text-muted); }
.carton.is-empty .v { color: var(--color-text-muted); font-weight: 500; white-space: normal; }
.carton { max-width: 100%; }
.carton-lg { font-size: 1.0625rem; border-width: 2px; border-radius: 10px; }
.carton-lg .k { font-size: .75rem; padding: 9px 11px; } .carton-lg .v { padding: 9px 13px; }

/* Publish switch: role="switch", 44 px target including its text label */
.pub-switch { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 var(--space-2) 0 0; border: 0; background: none; font-size: var(--type-small); font-weight: 600; color: var(--color-text); white-space: nowrap; border-radius: var(--radius-sm); }
.pub-switch .track { position: relative; width: var(--switch-w); height: var(--switch-h); flex: none; border-radius: var(--radius-pill); background: var(--color-switch-off); transition: background-color var(--motion-base) ease; }
.pub-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--color-surface); box-shadow: 0 1px 3px rgba(36, 32, 32, .3); transition: transform var(--motion-base) var(--ease-out); }
.pub-switch[aria-checked="true"] .track { background: var(--color-switch-on); }
.pub-switch[aria-checked="true"] .track::after { transform: translateX(16px); }
.pub-switch:active .track::after { width: 22px; }
.pub-switch[aria-checked="true"]:active .track::after { transform: translateX(12px); }
.pub-switch .st-pub { color: var(--color-success); }
.pub-switch .st-draft { color: var(--color-text-muted); }

/* ---------- Product table (real <table>; cards below 768) ---------- */
.table-card { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable caption { text-align: left; }
.ptable thead { display: none; }
.ptable tbody, .ptable tr, .ptable td { display: block; }
.ptable tr { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); transition: background-color var(--motion-fast) ease; }
.ptable tr:last-child { border-bottom: 0; }
.ptable td { padding: 0; min-width: 0; }
.ptable .c-thumb { grid-row: 1 / 3; }
.ptable .c-prod { grid-column: 2; }
.ptable .c-brand, .ptable .c-cat, .ptable .c-upd { display: none; }
.ptable .c-carton { grid-column: 2; margin-top: 6px; }
.ptable .c-status { grid-column: 1 / -1; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px dashed var(--color-border-subtle); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ptable .c-actions { position: absolute; right: var(--space-4); bottom: calc(var(--space-4) - 1px); }
.ptable tr.is-flash { animation: flash 1.2s var(--ease-out); }
@keyframes flash { 0% { background: var(--color-selected-bg); } 100% { background: transparent; } }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 84%; height: 84%; object-fit: contain; mix-blend-mode: multiply; transition: transform var(--motion-slow) var(--ease-out); }
.thumb .ph { display: grid; place-items: center; gap: 2px; color: var(--color-icon-placeholder); }
.thumb .ph svg { width: 24px; height: 24px; }
.thumb .pend { position: absolute; left: 4px; bottom: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid var(--color-warning-border); display: grid; place-items: center; }
.thumb .pend svg { width: 11px; height: 11px; }
.p-name { font-weight: 600; color: var(--color-text); text-decoration: none; line-height: 1.3; display: inline-block; }
.p-name:hover { color: var(--color-selected-fg); text-decoration: underline; }
.p-sku { display: block; color: var(--color-text-muted); margin-top: 2px; }
.p-meta { font-size: var(--type-small); color: var(--color-text-muted); margin-top: 2px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn { flex: none; display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--color-text); text-decoration: none; transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out); }
.icon-btn:hover { background: var(--color-surface-alt); border-color: var(--color-border); color: var(--color-text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.ptable .c-status .row-actions { display: none; }
@media (max-width: 767.98px) { .ptable .c-actions { position: static; } .ptable .c-actions { display: none; } .ptable .c-status .row-actions { display: flex; } }
@media (min-width: 768px) {
  .ptable thead { display: table-header-group; }
  .ptable tbody { display: table-row-group; }
  .ptable tr { display: table-row; padding: 0; }
  .ptable td, .ptable th { display: table-cell; vertical-align: middle; padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); }
  .ptable tbody tr:last-child td { border-bottom: 0; }
  .ptable th { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); text-align: left; background: var(--color-row-hover); white-space: nowrap; padding-top: 10px; padding-bottom: 10px; }
  .ptable th:first-child, .ptable td:first-child { padding-left: var(--space-4); }
  .ptable th:last-child, .ptable td:last-child { padding-right: var(--space-4); }
  .ptable tbody tr:hover { background: var(--color-row-hover); }
  .ptable tbody tr:hover .thumb img { transform: scale(1.06); }
  .ptable .c-thumb { width: calc(var(--thumb) + var(--space-4) + var(--space-3)); }
  .ptable .thumb { width: var(--thumb); height: var(--thumb); }
  .ptable .c-carton { margin: 0; white-space: nowrap; }
  .ptable td.c-status { display: table-cell; margin: 0; padding-top: var(--space-3); border-top: 0; width: 150px; }
  .ptable .c-actions { position: static; width: 104px; }
  .ptable td.c-upd { font-size: var(--type-small); color: var(--color-text-muted); white-space: nowrap; }
}
@media (min-width: 1280px) { .ptable .c-cat { display: table-cell; } .ptable td.c-cat { font-size: var(--type-small); } .p-meta .m-cat { display: none; } }
@media (min-width: 1440px) { .ptable .c-brand, .ptable .c-upd { display: table-cell; } .ptable td.c-brand { font-size: var(--type-small); font-weight: 500; } .ptable .p-meta { display: none; } }

/* ---------- Grid view (cards echo the public catalogue card) ---------- */
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (min-width: 768px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); } }
.gcard { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-card); box-shadow: var(--shadow-card); transition: transform var(--motion-slow) var(--ease-out), box-shadow var(--motion-slow) var(--ease-out); }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.gcard-media { position: relative; aspect-ratio: 1 / 1; background: var(--color-surface-alt); border-radius: var(--radius-card) var(--radius-card) 0 0; overflow: hidden; display: grid; place-items: center; }
.gcard-media img { width: 78%; height: 78%; object-fit: contain; mix-blend-mode: multiply; transition: transform .6s var(--ease-out); }
.gcard:hover .gcard-media img { transform: scale(1.05); }
.gcard-media .ph { display: grid; justify-items: center; gap: 6px; color: var(--color-text-muted); font-size: var(--type-small); text-align: center; padding: var(--space-3); }
.gcard-media .ph svg { width: 32px; height: 32px; color: var(--color-icon-placeholder); }
.gcard-media .badge { position: absolute; top: 10px; left: 10px; background: var(--color-surface); }
.gcard-body { display: flex; flex-direction: column; gap: 4px; padding: var(--space-3) var(--space-3) 0; flex: 1; }
.gcard-brand { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.gcard .p-name { font-size: .9375rem; }
.gcard .carton { margin-top: auto; }
.gcard .flags { margin-top: 2px; }
.gcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); margin-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); }
.gcard .carton { font-size: .8125rem; }
@media (max-width: 400px) { .gcard .carton { flex-direction: column; align-self: stretch; } .gcard .carton .k { justify-content: center; } .gcard .carton .v { justify-content: center; } .gcard-body { padding: 10px 10px 0; } .gcard-foot { padding-left: 6px; } .pub-switch { gap: 6px; } }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); font-size: var(--type-small); color: var(--color-text-muted); }
.pager .pages { display: flex; gap: 6px; }
.pager .pages button { min-width: var(--tap); min-height: var(--tap); border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: var(--color-surface); transition: background-color var(--motion-fast) ease; }
.pager .pages button:hover:not([disabled]) { background: var(--color-surface-alt); }
.pager .pages button[aria-current="page"] { background: var(--color-surface-inverse); color: var(--color-surface); border-color: var(--color-surface-inverse); }
.pager .pages button[disabled] { color: var(--color-disabled-fg); border-color: var(--color-border); cursor: not-allowed; }

/* ---------- Empty, loading, error ---------- */
.state-box { text-align: center; padding: var(--space-12) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-card); box-shadow: var(--shadow-card); animation: rise var(--motion-slow) var(--ease-out); }
.state-box .state-ic { width: 64px; height: 64px; margin: 0 auto var(--space-4); border-radius: 50%; background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); display: grid; place-items: center; color: var(--color-text-muted); }
.state-box .state-ic svg { width: 28px; height: 28px; }
.state-box h2 { font-size: var(--type-h3); margin-bottom: 6px; }
.state-box p { color: var(--color-text-muted); margin: 0 auto var(--space-5); max-width: 46ch; }
.state-box .state-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.state-box.is-error .state-ic { background: var(--color-danger-bg); border-color: var(--color-danger); color: var(--color-danger); }
.state-box.is-error h2 { color: var(--color-danger); }
.skel { background: linear-gradient(90deg, var(--color-skeleton) 0%, var(--color-skeleton-shine) 50%, var(--color-skeleton) 100%); background-size: 200% 100%; animation: skel 1.4s infinite linear; border-radius: 6px; }
@keyframes skel { to { background-position: -200% 0; } }
.skel-row { display: grid; grid-template-columns: var(--thumb) 1fr; gap: var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
.skel-row:last-child { border-bottom: 0; }
.skel-row .s1 { width: var(--thumb); height: var(--thumb); border-radius: 10px; }
.skel-row .s2 { height: 14px; width: 55%; margin-bottom: var(--space-2); }
.skel-row .s3 { height: 12px; width: 30%; }
.skel-sum { height: 64px; border-radius: var(--radius-md); }
@media (min-width: 768px) { .skel-row { grid-template-columns: var(--thumb) minmax(0, 2fr) 1fr 120px; } .skel-row .s4 { height: 26px; width: 110px; border-radius: 8px; } .skel-row .s5 { height: 24px; width: 90px; border-radius: 99px; } }
@media (max-width: 767.98px) { .skel-row .s4, .skel-row .s5 { display: none; } }

/* Alerts */
.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: 14px var(--space-4); border-radius: var(--radius-md); border: 1px solid; margin-bottom: var(--space-4); animation: rise var(--motion-base) var(--ease-out); }
.alert > svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert h2, .alert h3 { font-size: 1rem; margin-bottom: var(--space-1); }
.alert ul { margin: 6px 0 0; padding-left: var(--space-5); }
.alert li + li { margin-top: 2px; }
.alert-error { background: var(--color-danger-bg); border-color: var(--color-danger); color: var(--color-text); }
.alert-error > svg, .alert-error h2 { color: var(--color-danger); }
.alert-error a { color: var(--color-danger); font-weight: 600; }
.alert-info { background: var(--color-info-bg); border-color: var(--color-info-border); }
.alert-info > svg { color: var(--color-info); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.alert-warning > svg { color: var(--color-warning); }

/* ---------- Toasts: slide up in, fade out faster; paused on hover/focus ---------- */
.toasts { position: fixed; z-index: var(--z-toast); left: 16px; right: 16px; bottom: calc(var(--action-bar-height) + 16px); display: flex; flex-direction: column; gap: var(--space-2); align-items: center; pointer-events: none; }
@media (min-width: 1024px) { .toasts { left: auto; right: 32px; bottom: calc(var(--action-bar-height) + 24px); align-items: flex-end; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--space-3); max-width: 480px; width: 100%; background: var(--color-surface-inverse); color: var(--color-surface); padding: 8px 8px 8px var(--space-4); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); animation: toast-in var(--motion-slow) var(--ease-out); }
.toast.is-leaving { animation: toast-out var(--motion-base) var(--ease-in) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.toast > svg { width: 20px; height: 20px; flex: none; color: var(--color-toast-icon); }
.toast .toast-msg { flex: 1; font-size: .9375rem; }
.toast .toast-act { color: var(--color-surface); background: none; border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--radius-sm); min-height: var(--tap); padding: 0 var(--space-3); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; transition: background-color var(--motion-fast) ease; }
.toast .toast-act:hover { background: rgba(255, 255, 255, .12); color: var(--color-surface); }
.toast .toast-act svg { width: 16px; height: 16px; }
.toast .toast-x { width: var(--tap); height: var(--tap); border: 0; background: none; color: var(--color-on-inverse-muted); border-radius: var(--radius-sm); display: grid; place-items: center; }
.toast .toast-x:hover { color: var(--color-surface); background: rgba(255, 255, 255, .1); }
.toast .toast-x svg { width: 18px; height: 18px; }
.toast :focus-visible { outline-color: var(--color-surface); box-shadow: 0 0 0 2px var(--color-text); }

/* ---------- Dialogs: scale-fade in (sheet slides up on phones) ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: var(--z-dialog); background: var(--color-scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--motion-base) ease; }
@media (min-width: 768px) { .dialog-backdrop { align-items: center; padding: var(--space-6); } }
@keyframes fade { from { opacity: 0; } }
.dialog { background: var(--color-surface); width: 100%; max-width: 520px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: var(--space-6) var(--space-5); box-shadow: var(--shadow-pop); max-height: 90vh; overflow-y: auto; animation: sheet-in var(--motion-slow) var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .4; } }
@media (min-width: 768px) { .dialog { border-radius: var(--radius-lg); padding: 28px; animation-name: dlg-in; } }
@keyframes dlg-in { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.dialog-backdrop.is-leaving { animation: fade-out var(--motion-fast) var(--ease-in) forwards; }
@keyframes fade-out { to { opacity: 0; } }
.dialog h2 { font-size: var(--type-h3); margin-bottom: var(--space-2); }
.dialog > p { color: var(--color-text-muted); }
.dialog .dialog-body { display: flex; flex-direction: column; gap: 14px; margin: var(--space-4) 0 var(--space-5); }
.dialog .dialog-body:empty { margin: var(--space-2) 0 var(--space-4); }
.dialog .dialog-actions { display: flex; flex-direction: column-reverse; gap: var(--space-2); }
@media (min-width: 480px) { .dialog .dialog-actions { flex-direction: row; justify-content: flex-end; } }
.danger-head { display: flex; gap: 10px; align-items: center; color: var(--color-danger); }
.danger-head svg { width: 24px; height: 24px; flex: none; }
.confirm-target { display: inline-block; margin-top: 4px; padding: 2px 8px; background: var(--color-neutral-bg); border: 1px solid var(--color-border); border-radius: 6px; font-weight: 600; user-select: all; }
.tip { display: flex; gap: 8px; font-size: var(--type-small); color: var(--color-text); background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; }
.tip svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--color-text-muted); }

/* ---------- Edit form ---------- */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 1024px) { .edit-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: var(--space-6); } .aside-stack { position: sticky; top: 24px; } }
@media (min-width: 1280px) { .edit-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
.form-stack, .aside-stack { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.form-card { display: flex; flex-direction: column; gap: 20px; }
.form-card .section-head { padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
.sec-num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 50%; background: var(--color-surface-alt); border: 1px solid var(--color-border); font-size: 13px; font-weight: 700; vertical-align: 2px; }
.two-col, .three-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 1fr; } .three-col { grid-template-columns: 1.1fr 0.9fr 1.2fr; } }
.with-add { display: flex; gap: var(--space-2); }
.with-add .select { flex: 1; min-width: 0; }
.slug-row { display: flex; align-items: stretch; border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; background: var(--color-surface); transition: border-color var(--motion-fast) ease; }
.slug-row:hover { border-color: var(--color-text); }
.slug-row .prefix { display: flex; align-items: center; padding: 0 10px; background: var(--color-surface-alt); color: var(--color-text-muted); font-size: var(--type-small); border-right: 1px solid var(--color-border); white-space: nowrap; }
.slug-row .input { border: 0; border-radius: 0; min-width: 0; }
.field.has-error .slug-row { border-color: var(--color-danger); box-shadow: inset 0 0 0 1px var(--color-danger); }
.sku-input { text-transform: uppercase; font-family: var(--type-mono); letter-spacing: .02em; }
.unit-group { display: flex; border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; background: var(--color-surface); transition: border-color var(--motion-fast) ease; }
.unit-group:hover { border-color: var(--color-text); }
.unit-group .input { border: 0; border-radius: 0; min-width: 0; flex: 1; font-variant-numeric: tabular-nums; }
.unit-group .select { border: 0; border-left: 1px solid var(--color-border); border-radius: 0; width: 84px; flex: none; background-color: var(--color-surface-alt); padding-right: 32px; background-position: right 8px center; }
.unit-group .input:focus-visible, .unit-group .select:focus-visible { outline-offset: -2px; }
.carton-preview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--color-surface-alt); border: 1px dashed var(--color-border); border-radius: var(--radius-md); }
.carton-preview .cp-label { font-size: var(--type-small); color: var(--color-text-muted); }
.carton-preview .carton { transition: transform var(--motion-base) var(--ease-out); }
.carton-preview .carton.is-bump { animation: bump var(--motion-slow) var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.04); } }

/* Chips (other pack sizes) */
.chip-input { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: 4px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); min-height: var(--tap); background: var(--color-surface); }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--color-surface-alt); border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 0 0 0 var(--space-3); min-height: 36px; font-size: var(--type-label); font-weight: 500; animation: rise var(--motion-base) var(--ease-out); }
.chip button { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; transition: background-color var(--motion-fast) ease; }
.chip button::before { content: ""; position: absolute; inset: -4px; }
.chip button:hover { background: var(--color-chip-hover); }
.chip button svg { width: 16px; height: 16px; }
.chip-input .input { border: 0; flex: 1 1 160px; min-height: var(--tap); padding: 4px 8px; }
.chip-input .btn { min-height: var(--tap); }
.chip-input .btn::before { content: ""; position: absolute; inset: -4px 0; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--type-small); color: var(--color-text-muted); }
.suggestions button { min-height: var(--tap); padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px dashed var(--color-border-strong); background: var(--color-surface); font-size: var(--type-small); transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.suggestions button:hover { border-style: solid; background: var(--color-surface-alt); }

/* Simple editor */
.editor-wrap { border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color var(--motion-fast) ease; }
.editor-wrap:hover { border-color: var(--color-text); }
.editor-tools { display: flex; gap: var(--space-1); padding: var(--space-1); background: var(--color-surface-alt); border-bottom: 1px solid var(--color-border); }
.editor-tools button { min-width: var(--tap); min-height: var(--tap); border: 1px solid transparent; border-radius: var(--radius-sm); background: none; display: grid; place-items: center; transition: background-color var(--motion-fast) ease; }
.editor-tools button:hover { background: var(--color-surface); border-color: var(--color-border); }
.editor-tools svg { width: 18px; height: 18px; }
.editor { min-height: 140px; padding: var(--space-3); line-height: 1.6; }
.editor:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; box-shadow: none; border-radius: 0; }
.editor ul { margin: 0 0 0 var(--space-5); padding: 0; }
.editor p + p { margin-top: 10px; }

/* Images */
.img-summary { display: flex; flex-wrap: wrap; gap: 6px var(--space-3); align-items: center; font-size: var(--type-small); color: var(--color-text-muted); }
.dropzone { border: 2px dashed var(--color-border-strong); border-radius: var(--radius-md); padding: var(--space-5) var(--space-4); text-align: center; background: var(--color-surface-alt); transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, transform var(--motion-base) var(--ease-out); }
.dropzone.is-over { border-color: var(--color-action-primary); background: var(--color-selected-bg); transform: scale(1.01); }
.dropzone .dz-ic { width: 44px; height: 44px; margin: 0 auto var(--space-2); border-radius: 50%; background: var(--color-surface); border: 1px solid var(--color-border); display: grid; place-items: center; color: var(--color-text-muted); }
.dropzone .dz-ic svg { width: 22px; height: 22px; }
.dropzone p { margin-bottom: var(--space-3); }
.dropzone .dz-row { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; align-items: center; }
.img-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: var(--space-3); }
.img-card { position: relative; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface); display: flex; flex-direction: column; box-shadow: var(--shadow-1); animation: rise var(--motion-slow) var(--ease-out); transition: box-shadow var(--motion-base) ease; }
.img-card.is-main { border-color: var(--color-action-primary); box-shadow: 0 0 0 1px var(--color-action-primary), var(--shadow-1); }
.img-card.is-moved { animation: flash 1s var(--ease-out); }
.img-frame { aspect-ratio: 4 / 3; background: var(--color-surface-alt); display: grid; place-items: center; position: relative; }
.img-frame img { width: 80%; height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.img-frame.is-pending img { opacity: .78; }
.img-frame .ph { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--color-text-muted); font-size: var(--type-small); }
.img-frame .ph svg { width: 32px; height: 32px; }
.img-pos { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--color-surface); border: 1px solid var(--color-border); font-size: 12px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.main-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; background: var(--color-action-primary-pressed); color: var(--color-surface); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-pill); }
.main-badge svg { width: 12px; height: 12px; }
.img-progress { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 6px; background: var(--color-surface); border-radius: 3px; overflow: hidden; border: 1px solid var(--color-border); }
.img-progress span { display: block; height: 100%; background: var(--color-surface-inverse); width: 100%; transform-origin: left; transition: transform .25s linear; }
.img-body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.img-file { font-size: 12px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.rights { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; padding: 2px 9px 2px 7px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; border: 1px solid; }
.rights svg { width: 14px; height: 14px; }
.rights-cleared { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success-border); }
.rights-pending { color: var(--color-warning); background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-size: var(--type-small); font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--color-success); flex: none; cursor: pointer; }
.check-hint { font-size: 12px; color: var(--color-text-muted); margin-top: -6px; }
.img-body .input { min-height: var(--tap); padding: 6px var(--space-2); font-size: var(--type-small); }
.img-body .alt-label { font-size: 13px; font-weight: 600; }
.img-tools { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: auto; padding-top: var(--space-2); border-top: 1px solid var(--color-border-subtle); }
.img-tools button { min-height: var(--tap); min-width: var(--tap); padding: 0 var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-surface); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out); }
.img-tools button:hover:not([disabled]) { border-color: var(--color-text); background: var(--color-surface-alt); }
.img-tools button:active:not([disabled]) { transform: scale(.95); }
.img-tools button[disabled] { color: var(--color-disabled-fg); cursor: not-allowed; border-color: var(--color-disabled-bg); }
.img-tools svg { width: 16px; height: 16px; }
.img-tools .del { color: var(--color-danger); }
.img-tools .rep { flex: 1; }
.set-main { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); font-size: 13px; font-weight: 600; transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease; }
.set-main:hover { border-style: solid; background: var(--color-surface-alt); }
.set-main svg { width: 16px; height: 16px; }
.is-main-note { display: inline-flex; align-items: center; min-height: var(--tap); font-size: 13px; color: var(--color-text-muted); }
.img-empty { text-align: center; padding: var(--space-4); color: var(--color-text-muted); font-size: var(--type-small); }

/* Internal notes card (never on the website) */
.internal-card { background: repeating-linear-gradient(-45deg, var(--color-surface) 0 12px, var(--color-row-hover) 12px 24px); border-style: dashed; border-color: var(--color-border); }
.internal-tag { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); padding: 2px 10px 2px 8px; }
.internal-tag svg { width: 14px; height: 14px; }

/* Status + preview (aside) */
.status-card .row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.status-card .stack { display: flex; flex-direction: column; gap: 10px; margin-top: var(--space-4); }
.status-card dl { margin: var(--space-4) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); font-size: var(--type-small); display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-3); }
.status-card dt { color: var(--color-text-muted); }
.status-card dd { margin: 0; overflow-wrap: anywhere; }
.status-card .danger-zone { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
.preview-card .pv-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.preview-card .pv-head h2 { font-size: 1rem; }
.pv-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.pv-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 0 rgba(29, 107, 58, .5); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(29, 107, 58, 0); } 100% { box-shadow: 0 0 0 0 rgba(29, 107, 58, 0); } }
.pv-stage { background: var(--color-canvas); border-radius: var(--radius-md); padding: var(--space-4); display: grid; place-items: center; border: 1px solid var(--color-border-subtle); }
.pcard { position: relative; width: 100%; max-width: 260px; display: flex; flex-direction: column; border-radius: 20px; background: var(--color-surface); box-shadow: var(--shadow-card); overflow: hidden; }
.pcard-media { position: relative; aspect-ratio: 1 / 1; background: var(--color-surface-alt); display: grid; place-items: center; }
.pcard-media img { width: 80%; height: 80%; object-fit: contain; mix-blend-mode: multiply; animation: fade var(--motion-slow) ease; }
.pcard-media .ph { display: grid; justify-items: center; gap: 8px; color: var(--color-text-muted); font-size: var(--type-small); }
.pcard-media .ph svg { width: 36px; height: 36px; color: var(--color-icon-placeholder); }
.pcard-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.pcard-brand { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); min-height: 1.2em; }
.pcard-name { font-size: 1rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.pcard-name.is-empty, .pcard-brand.is-empty { color: var(--color-disabled-fg); font-weight: 500; }
.pv-overlay { position: absolute; top: 10px; left: 10px; }
.pv-specs { margin: var(--space-4) 0 0; font-size: var(--type-small); display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-3); }
.pv-specs dt { color: var(--color-text-muted); }
.pv-specs dd { margin: 0; overflow-wrap: anywhere; }
.pv-note { margin-top: var(--space-3); font-size: 12px; color: var(--color-text-muted); }

/* Sticky action bar */
.action-bar { position: fixed; z-index: var(--z-sticky); left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--color-border-subtle); box-shadow: 0 -8px 24px -16px rgba(36, 32, 32, .35); }
@supports (backdrop-filter: blur(8px)) { .action-bar { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(10px); } }
.action-inner { max-width: calc(var(--container) + 2 * var(--space-8)); margin: 0 auto; padding: 10px var(--space-4); display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; }
@media (min-width: 1024px) { .action-inner { padding: var(--space-3) var(--space-8); } }
.action-bar .dirty { margin-right: auto; font-size: var(--type-small); color: var(--color-warning); font-weight: 600; display: flex; align-items: center; gap: 6px; animation: rise var(--motion-base) var(--ease-out); }
.action-bar .dirty svg { width: 16px; height: 16px; }
.action-bar .btn { flex: 1 1 0; }
@media (min-width: 768px) { .action-bar .btn { flex: none; } }
@media (max-width: 767.98px) { .action-bar .dirty { display: none !important; } .action-bar #cancel { display: none; } }

/* ---------- Brands / categories ---------- */
.tax-table .t-name { font-weight: 600; }
.tax-table .t-slug { display: block; margin-top: 2px; color: var(--color-text-muted); }
.tax-table .t-count a { font-weight: 600; font-variant-numeric: tabular-nums; }
.tax-table .t-block { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--color-text-muted); margin-top: 4px; max-width: 32ch; }
.tax-table .t-block svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.tax-table .t-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.tax-table tr { grid-template-columns: minmax(0, 1fr) auto; }
.tax-table .t-count { grid-column: 2; grid-row: 1; text-align: right; }
.tax-table td.t-actions { grid-column: 1 / -1; justify-content: flex-start; margin-top: var(--space-2); display: flex; }
@media (min-width: 768px) { .tax-table td.t-actions { display: table-cell; } .tax-table td.t-actions > div { display: flex; gap: var(--space-2); justify-content: flex-end; } .tax-table .t-count { text-align: left; } .tax-table td.t-actions .t-block { margin: 6px 0 0 auto; } .tax-table td.t-actions { width: 300px; } }
@media (max-width: 767.98px) { .tax-table td.t-actions > div { display: flex; flex-wrap: wrap; gap: var(--space-2); } }

/* ---------- Access pages (Cloudflare Access mock) ---------- */
.access-body { background: var(--color-canvas); min-height: 100vh; display: flex; flex-direction: column; }
.access-band { background: var(--color-action-primary); height: 120px; position: relative; }
.access-band svg.curve { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 40px; }
@media (min-width: 768px) { .access-band { height: 180px; } .access-band svg.curve { height: 64px; } }
.access-main { flex: 1; display: flex; justify-content: center; padding: 0 var(--space-4) var(--space-12); margin-top: -72px; position: relative; }
@media (min-width: 768px) { .access-main { margin-top: -120px; } }
.access-card { width: 100%; max-width: 440px; background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 28px var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); animation: rise var(--motion-slow) var(--ease-out); }
@media (min-width: 768px) { .access-card { padding: 36px; } }
.access-card .logo-wrap { display: flex; justify-content: center; padding: 18px; }
.access-card .logo { width: 180px; }
.access-card h1 { font-size: var(--type-h3); text-align: center; }
.access-card .sub { text-align: center; color: var(--color-text-muted); font-size: var(--type-small); }
.access-card .sub-strong { text-align: center; }
.divider { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text-muted); font-size: var(--type-small); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.btn-google { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-google:hover { background: var(--color-surface-alt); color: var(--color-text); }
.btn-google svg { width: 20px; height: 20px; }
.access-foot { text-align: center; font-size: var(--type-small); color: var(--color-text-muted); padding: var(--space-4); }
.gold-rule-c { height: 3px; width: 56px; background: var(--color-accent-rule); border-radius: 2px; margin: 0 auto; }
.mock-note { font-size: var(--type-small); background: var(--color-info-bg); color: var(--color-text); border: 1px solid var(--color-info-border); border-radius: var(--radius-sm); padding: 10px var(--space-3); display: flex; gap: var(--space-2); }
.mock-note svg { width: 18px; height: 18px; color: var(--color-info); flex: none; margin-top: 1px; }
.code-input { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.access-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* ---------- Screen list (index) ---------- */
.index-hero { background: var(--color-surface); border-bottom: 1px solid var(--color-border-subtle); position: relative; }
.index-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--color-action-primary) 0 64px, var(--color-accent-rule) 64px 112px, transparent 112px); }
.index-hero-in { max-width: 1120px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); display: grid; gap: var(--space-4); }
@media (min-width: 1024px) { .index-hero-in { grid-template-columns: auto 1fr; gap: var(--space-10); align-items: center; padding: var(--space-10) var(--space-8); } }
.index-hero .logo { width: 200px; }
.index-hero h1 { font-size: var(--type-h1); font-weight: 800; letter-spacing: -0.02em; }
.index-hero p { color: var(--color-text-muted); max-width: 70ch; margin-top: var(--space-2); }
.index-wrap { max-width: 1120px; margin: 0 auto; padding: var(--space-6) var(--space-4) 64px; }
@media (min-width: 1024px) { .index-wrap { padding: var(--space-8) var(--space-8) 80px; } }
.index-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.index-grid > * { min-width: 0; }
@media (min-width: 768px) { .index-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .index-grid { grid-template-columns: repeat(3, 1fr); } }
.index-grid h2 { font-size: 1.125rem; margin-bottom: var(--space-3); display: flex; align-items: center; gap: 10px; }
.index-grid h2 .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-surface-inverse); color: var(--color-surface); font-size: 13px; }
.screen-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.screen-list a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--tap); padding: 6px 0; border-bottom: 1px solid var(--color-border-subtle); color: var(--color-text); text-decoration: none; font-weight: 500; transition: color var(--motion-fast) ease, padding var(--motion-base) var(--ease-out); }
.screen-list li:last-child a { border-bottom: 0; }
.screen-list a:hover { color: var(--color-selected-fg); padding-left: 4px; }
.screen-list a small { color: var(--color-text-muted); font-weight: 400; font-size: 12px; }
.screen-list a svg { width: 16px; height: 16px; color: var(--color-text-muted); flex: none; }
.fields-table { width: 100%; border-collapse: collapse; font-size: var(--type-small); }
.fields-table th, .fields-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border-subtle); vertical-align: top; }
.fields-table th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); background: var(--color-row-hover); }
.fields-table td:first-child { font-weight: 600; white-space: nowrap; }
.fields-table .new { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-selected-fg); background: var(--color-selected-bg); border-radius: 4px; padding: 0 5px; }
.table-scroll { overflow-x: auto; }
.wide { grid-column: 1 / -1; }
.note-list { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: 6px; }

/* ---------- Offers (CR-001) ---------- */
.badge-live { color: var(--color-success); background: var(--color-success-bg); border-color: var(--color-success-border); }
.badge-scheduled { color: var(--color-info); background: var(--color-info-bg); border-color: var(--color-info-border); }
.badge-scheduled::before { background: transparent; border: 2px solid currentColor; width: 8px; height: 8px; }
.badge-expired { color: var(--color-text-muted); background: var(--color-surface); border-color: var(--color-border-strong); border-style: dashed; }
.badge-expired::before { width: 8px; height: 2px; border-radius: 1px; }
.summary-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 768px) { .summary-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sum[data-k="live"] .sum-ic { background: var(--color-success-bg); color: var(--color-success); }
.sum[data-k="scheduled"] .sum-ic { background: var(--color-info-bg); color: var(--color-info); }
.sum[data-k="expired"] .sum-ic { background: var(--color-neutral-bg); color: var(--color-text-muted); }
@media (max-width: 479.98px) { .summary-3 .sum { grid-template-columns: 1fr; grid-template-rows: auto auto auto; row-gap: 4px; } .summary-3 .sum .sum-ic { grid-row: auto; width: 30px; height: 30px; } }
.scope-note { display: flex; gap: 10px; align-items: flex-start; font-size: var(--type-small); background: var(--color-warning-bg); border: 1px solid var(--color-warning-border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: var(--space-4); }
.scope-note svg { width: 18px; height: 18px; color: var(--color-warning); flex: none; margin-top: 1px; }
.flyer-thumb { position: relative; display: block; width: 56px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); box-shadow: var(--shadow-1); }
.flyer-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--motion-slow) var(--ease-out); }
.otable tr { grid-template-columns: 64px minmax(0, 1fr); }
.otable .o-title { font-weight: 600; color: var(--color-text); text-decoration: none; line-height: 1.3; }
.otable .o-title:hover { color: var(--color-selected-fg); text-decoration: underline; }
.otable .o-text { font-size: var(--type-small); color: var(--color-text-muted); margin-top: 2px; max-width: 52ch; }
.otable .o-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--color-text-muted); }
.otable .o-meta svg { width: 14px; height: 14px; }
.otable .o-meta span { display: inline-flex; align-items: center; gap: 4px; }
.otable .c-dates { display: none; }
.otable .c-order { grid-column: 2; margin-top: 6px; }
.order-ctl { display: inline-flex; align-items: center; gap: 4px; }
.order-ctl .pos { min-width: 64px; white-space: nowrap; font-size: var(--type-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.order-ctl .pos.off { color: var(--color-text-muted); font-weight: 500; }
.icon-btn.del { color: var(--color-danger); }
.icon-btn[disabled] { color: var(--color-disabled-fg); cursor: not-allowed; background: none; border-color: transparent; }
@media (min-width: 768px) {
  .otable .c-thumb { width: 88px; }
  .otable .flyer-thumb { width: 52px; }
  .otable tbody tr:hover .flyer-thumb img { transform: scale(1.05); }
  .otable td.c-order { width: 196px; margin: 0; }
  .otable td.c-actions { width: 156px; }
}
@media (min-width: 1024px) { .otable .c-dates { display: table-cell; } .otable td.c-dates { font-size: var(--type-small); white-space: nowrap; } .otable .o-meta .m-dates { display: none; } }

/* Offer edit */
.offer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 1024px) { .offer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; } .offer-grid .aside-stack { position: sticky; top: 24px; } }
@media (min-width: 1280px) { .offer-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); } }
.flyer-up { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 479.98px) { .flyer-up { grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-3); } }
.flyer-frame { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--color-surface-alt); border: 1px solid var(--color-border); box-shadow: var(--shadow-card); }
.flyer-frame img { width: 100%; height: 100%; object-fit: cover; animation: fade var(--motion-slow) ease; }
.flyer-frame .img-progress { left: 8px; right: 8px; bottom: 8px; }
.flyer-frame.is-empty { border: 2px dashed var(--color-border-strong); display: grid; place-items: center; color: var(--color-text-muted); box-shadow: none; }
.flyer-frame.is-empty svg { width: 28px; height: 28px; }
.field.has-error .flyer-frame.is-empty { border-color: var(--color-danger); }
.flyer-side { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.flyer-side .btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.spec-box { display: grid; gap: 4px; font-size: var(--type-small); background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; }
.spec-box strong { font-weight: 700; }
.spec-box a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); font-weight: 600; }
.spec-box a svg { width: 16px; height: 16px; }
.date-row { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 480px) { .date-row { grid-template-columns: 1fr 1fr; } }
.sched-line { display: flex; gap: 8px; align-items: flex-start; font-size: var(--type-small); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--color-surface-alt); border: 1px solid var(--color-border-subtle); }
.sched-line svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--color-text-muted); }

/* Searchable multi-select (combobox + listbox) */
.ms { position: relative; }
.ms-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: var(--z-menu); max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); animation: pop var(--motion-base) var(--ease-out); }
.ms-opt { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--type-small); }
.ms-opt .box { width: 18px; height: 18px; flex: none; border: 2px solid var(--color-border-strong); border-radius: 4px; display: grid; place-items: center; background: var(--color-surface); transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease; }
.ms-opt .box svg { width: 14px; height: 14px; color: var(--color-surface); opacity: 0; }
.ms-opt[aria-selected="true"] .box { background: var(--color-success); border-color: var(--color-success); }
.ms-opt[aria-selected="true"] .box svg { opacity: 1; }
.ms-opt .ms-name { flex: 1; min-width: 0; }
.ms-opt .ms-sku { color: var(--color-text-muted); font-size: 12px; }
.ms-opt:hover, .ms-opt.is-active { background: var(--color-surface-alt); }
.ms-opt.is-active { box-shadow: inset 0 0 0 2px var(--color-focus); }
.ms-empty { padding: 12px; font-size: var(--type-small); color: var(--color-text-muted); }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chips:empty { display: none; }

/* Crop dialog */
.crop-stage { position: relative; background: var(--color-surface-inverse); border-radius: var(--radius-md); overflow: hidden; display: grid; place-items: center; padding: 12px; }
.crop-stage canvas { max-width: 100%; max-height: 46vh; width: auto; height: auto; display: block; }
.crop-pos { display: flex; flex-wrap: wrap; gap: 6px; }
.crop-pos button { min-height: var(--tap); padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--color-border-strong); background: var(--color-surface); font-size: var(--type-small); font-weight: 600; transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease; }
.crop-pos button[aria-pressed="true"] { background: var(--color-surface-inverse); color: var(--color-surface); border-color: var(--color-surface-inverse); }

/* Hero preview: an approximation of the public home-page hero, scaled to fit */
.pv-tabs { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.hero-viewport { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--color-border-subtle); background: var(--color-surface); }
.hero-viewport.is-mobile { max-width: 300px; margin: 0 auto; border-radius: 24px; border: 6px solid var(--color-surface-inverse); }
.hero-scale { transform-origin: top left; position: absolute; top: 0; left: 0; }
.hm { width: 1200px; background: var(--color-action-primary); color: var(--color-surface); position: relative; overflow: hidden; }
.hm-bar { height: 72px; background: var(--color-surface); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; color: var(--color-text); font-size: 15px; font-weight: 500; }
.hm-bar img { width: 128px; height: auto; }
.hm-bar span { display: flex; gap: 24px; }
.hm-in { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: center; padding: 48px 64px 64px; }
.hm-eyebrow { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hm-eyebrow::before { content: ""; width: 32px; height: 3px; border-radius: 2px; background: var(--color-accent-rule); }
.hm-title { font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 18px; overflow-wrap: anywhere; }
.hm-text { font-size: 20px; font-weight: 500; line-height: 1.45; max-width: 34ch; margin-bottom: 28px; }
.hm-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 28px; border-radius: 999px; background: var(--color-surface); color: var(--color-selected-fg); font-weight: 700; font-size: 18px; }
.hm-cta svg { width: 20px; height: 20px; }
.hm-prods { margin-top: 22px; font-size: 15px; font-weight: 500; }
.hm-flyer { aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .55); background: var(--color-surface-alt); transform: rotate(1.5deg); }
.hm-flyer img { width: 100%; height: 100%; object-fit: cover; }
.hm-dots { position: absolute; left: 64px; bottom: 24px; display: flex; gap: 8px; }
.hm-dots i { width: 10px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .5); }
.hm-dots i.on { background: var(--color-surface); width: 28px; }
.hm.is-mobile { width: 390px; }
.hm.is-mobile .hm-bar { padding: 0 16px; }
.hm.is-mobile .hm-bar img { width: 112px; }
.hm.is-mobile .hm-in { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 20px 48px; }
.hm.is-mobile .hm-title { font-size: 40px; }
.hm.is-mobile .hm-text { font-size: 17px; margin-bottom: 20px; }
.hm.is-mobile .hm-cta { font-size: 17px; min-height: 52px; }
.hm.is-mobile .hm-flyer { transform: none; width: 100%; }
.hm.is-mobile .hm-dots { left: 20px; bottom: 18px; }
.hm .is-ghost { opacity: .6; }

/* Hidden file inputs: show focus on their visible button */
.dropzone:has(#file:focus-visible) label.btn, .flyer-side:has(#file:focus-visible) #file-btn { outline: var(--focus-ring); outline-offset: var(--focus-offset); box-shadow: 0 0 0 2px var(--color-surface); }

input[type="date"].input:focus { outline: var(--focus-ring); outline-offset: var(--focus-offset); border-color: var(--color-text); }

/* ---------- Reduced motion: no transforms, no animations ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .skel { animation: none !important; }
  .pv-live::before { animation: none !important; }
  .btn:active, .sum:hover, .sum:active, .gcard:hover, .icon-btn:active, .img-tools button:active { transform: none !important; }
  .gcard:hover .gcard-media img, .ptable tbody tr:hover .thumb img { transform: none !important; }
}

/* Export mode (static screenshots) */
.export .action-bar { position: static; box-shadow: none; backdrop-filter: none; }
.export *, .export *::before, .export *::after { animation: none !important; transition: none !important; }
