/* =========================================================================
   Tokens
   Dark theme (owner decision), brand green #10a37f. Neutrals are OKLCH
   lightness steps tinted toward the brand hue (169.5°), written as hex so
   older phones render identical colours. White on the brand green is only
   2.7:1, so filled green buttons carry dark ink (5.6:1).
   ========================================================================= */

:root {
  color-scheme: dark;

  --bg: #0b0f0e;            /* oklch(0.165 0.008 169.5) */
  --bg-side: #111614;       /* oklch(0.195 0.009 169.5) */
  --surface: #151b19;       /* oklch(0.215 0.010 169.5) */
  --raised: #1b2220;        /* oklch(0.245 0.011 169.5) */
  --field: #1a201d;         /* oklch(0.235 0.010 169.5) */
  --hover: #222a27;         /* oklch(0.275 0.012 169.5) */
  --line: #2c3431;          /* oklch(0.315 0.012 169.5) */
  --line-strong: #414a46;   /* oklch(0.400 0.014 169.5) */
  --text: #e9eeec;          /* oklch(0.945 0.006 169.5) — 16:1 on bg */
  --text-dim: #afb8b4;      /* oklch(0.775 0.012 169.5) — 9:1 */
  --text-faint: #858f8b;    /* oklch(0.640 0.012 169.5) — 5.2:1 on surface */

  --accent: #10a37f;
  --accent-hover: #03b28b;
  --accent-text: #55d8b0;   /* green for text and icons on dark, 10:1 */
  --accent-soft: #0d362a;
  --accent-ink: #061a14;    /* text on green fills */
  --accent-ring: rgb(16 163 127 / 0.28);

  --danger: #ed6863;
  --danger-text: #f98f87;
  --danger-soft: #451e1c;
  --warn: #f0ba59;
  --warn-soft: #3b2b0d;
  --info: #74c2ee;
  --info-soft: #122f3e;

  --font-ui: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sofia Sans Condensed', 'Golos Text', 'Arial Narrow', system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Fixed rem scale for an app UI, ~1.25 apart */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.375rem;

  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  --tap: 44px;
  --topbar-h: 56px;
  --sidebar-w: 304px;
  --assistant-w: clamp(340px, 30vw, 420px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow-float: 0 18px 40px -12px rgb(2 8 6 / 0.7), 0 2px 6px rgb(2 8 6 / 0.45);
}

/* =========================================================================
   Base
   ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html.is-locked {
  overflow: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent-text);
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

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

.icon {
  flex: none;
}

.dim {
  color: var(--text-faint);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

/* The identity mark: four gallery tiles, one lit. */
.app-mark {
  flex: none;
}
.app-mark__bg {
  fill: var(--raised);
  stroke: var(--line-strong);
}
.app-mark__lead {
  fill: var(--accent);
}
.app-mark__cell {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.5;
}

/* =========================================================================
   Motion
   ========================================================================= */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}
@keyframes indeterminate {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}

.reveal {
  animation: rise 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

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

/* =========================================================================
   Feedback primitives: spinner, progress, skeletons, badges, tags
   ========================================================================= */

.spinner {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgb(233 238 236 / 0.2);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}
.spinner--sm {
  width: 14px;
  height: 14px;
}

.progress {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
}
.progress__fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out);
}
.progress--indeterminate .progress__fill {
  width: 40%;
  transform: none;
  animation: indeterminate 1.3s var(--ease-in-out) infinite;
}

.skeleton,
.skeleton-row {
  display: block;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--surface) 0%, var(--raised) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton--line {
  height: 14px;
  width: 60%;
}
.skeleton--title {
  height: 36px;
  width: 55%;
}
.skeleton--steps {
  height: 58px;
}
.skeleton--block {
  height: 240px;
}
.skeleton--field {
  height: 68px;
}
.skeleton--card {
  height: 88px;
  border-radius: var(--radius-lg);
}
.skeleton--tile {
  flex: none;
  width: 128px;
  height: 196px;
  border-radius: var(--radius-lg);
}
.skeleton-list {
  display: grid;
  gap: var(--space-xs);
}
.skeleton-row {
  height: 60px;
}

/* Status badges: blue = running, amber = needs you, green = done, red = failed. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text-dim);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge--sm {
  height: 20px;
  padding: 0 8px 0 6px;
  font-size: 11px;
}
.badge--ready {
  border-color: var(--line-strong);
  color: var(--text);
}
.badge--info {
  border-color: transparent;
  background: var(--info-soft);
  color: var(--info);
}
.badge--info .badge__dot {
  animation: pulse 1.4s ease-in-out infinite;
}
.badge--warn {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}
.badge--success {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.badge--danger {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger-text);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgb(11 15 14 / 0.78);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.tag--accent,
.tag--success {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.tag--warn {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}

/* "AI" marker on fields nobody has confirmed yet */
.ai-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.count {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.count--success {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.count--warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.count--danger {
  background: var(--danger-soft);
  color: var(--danger-text);
}

/* =========================================================================
   Buttons
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--tap);
  padding: 0 var(--space-md);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--raised);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--ease-out);
}
.btn:hover:not(:disabled) {
  background: var(--hover);
  border-color: #4f5955;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}
.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-dim);
}
.btn--ghost:hover:not(:disabled) {
  border-color: transparent;
  background: var(--hover);
  color: var(--text);
}
.btn--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #1f0a09;
}
.btn--danger:hover:not(:disabled) {
  border-color: #f47f7a;
  background: #f47f7a;
}
.btn--danger-text {
  color: var(--danger-text);
}
.btn--danger-text:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.btn--approve:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn--approve.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.btn--reject:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger-text);
}
.btn--reject.is-on {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-text);
}
.btn--sm {
  min-height: 36px;
  padding: 0 var(--space-sm);
  font-size: var(--text-xs);
}
.btn--lg {
  min-height: 52px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-lg);
  font-size: var(--text-md);
}
.btn--block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-dim);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.link-btn {
  min-height: 28px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--tap);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}

/* Every control is at least 44 px tall on touch screens. */
@media (pointer: coarse) {
  .btn--sm,
  .link-btn {
    min-height: var(--tap);
  }
}

/* =========================================================================
   Form fields
   ========================================================================= */

.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.field--wide {
  grid-column: 1 / -1;
}
.field__label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
}
.field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
}
.field__req {
  color: var(--warn);
  font-weight: 800;
}
.field__aside {
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 400;
}
.field__count {
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.field__hint {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.field__hint .icon {
  align-self: center;
}
.field__error {
  margin: 0;
  color: var(--danger-text);
  font-size: var(--text-sm);
}
.field--missing .input,
.field--missing .chips {
  border-color: rgb(240 186 89 / 0.6);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-md) var(--space-lg);
}
/* Pairs (type + brand, colours + sizes) share the row evenly. */
@media (min-width: 600px) {
  .field-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--text);
  font-size: var(--text-md);
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.input::placeholder {
  color: var(--text-faint);
}
.input:hover:not(:disabled) {
  border-color: var(--line-strong);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: #1c2320;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.input:disabled {
  opacity: 0.55;
}
.input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset;
  caret-color: var(--text);
}
.input--sm {
  min-height: 40px;
  padding: 8px 10px;
  font-size: var(--text-sm);
}
.input--num {
  font-variant-numeric: tabular-nums;
}
.input--title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}
.input--price {
  padding-right: 64px;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}
.input--search {
  padding-left: 40px;
}
.input--search::-webkit-search-cancel-button {
  filter: invert(0.7);
}

.textarea {
  min-height: 92px;
  max-height: 60vh;
  resize: vertical;
  field-sizing: content; /* grows with the text where supported */
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  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='%23afb8b4' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-xs);
}
.input-group > .input {
  flex: 1 1 140px;
  min-width: 0;
}
.input-group__btn {
  border-color: var(--line);
  background: var(--field);
}

.input-affix {
  position: relative;
  display: flex;
  align-items: center;
}
.input-affix__suffix {
  position: absolute;
  right: 14px;
  color: var(--text-faint);
  font-size: var(--text-sm);
  font-weight: 600;
  pointer-events: none;
}

.form-error {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: var(--text-sm);
}

.inline-alert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: var(--text-sm);
}
.inline-alert__text {
  flex: 1 1 220px;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Phones zoom into inputs smaller than 16 px; touch targets stay ≥ 44 px. */
@media (pointer: coarse) {
  .input,
  .chips__input {
    font-size: 16px;
  }
  .input--sm {
    min-height: var(--tap);
  }
}

/* Tag input (colours, sizes) */
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chips:hover {
  border-color: var(--line-strong);
}
.chips:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  height: 30px;
  padding: 0 2px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--raised);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: default;
  animation: pop 0.18s var(--ease-out);
}
.chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip__remove {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint);
}
.chip__remove::before {
  /* 44 px touch area around a small visual target */
  content: '';
  position: absolute;
  inset: -9px;
}
.chip__remove:hover {
  background: var(--hover);
  color: var(--text);
}
.chips__input {
  flex: 1 0 120px;
  min-width: 0;
  min-height: 32px;
  padding: 0 6px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: var(--text-md);
}

/* Segmented tabs (RU / UZ) */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
}
.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-weight: 600;
}
.tabs__tab:hover {
  color: var(--text);
}
.tabs__tab[aria-selected='true'] {
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
}
.tabs__code {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.tabs__name {
  font-weight: 500;
}
.tabs--sm .tabs__tab {
  min-height: 34px;
  padding: 0 12px;
}
@media (pointer: coarse) {
  .tabs__tab,
  .tabs--sm .tabs__tab {
    min-height: var(--tap);
  }
}
@media (max-width: 420px) {
  .tabs__name {
    display: none;
  }
}

/* Language switch */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
}
.lang-switch__btn {
  min-width: var(--tap);
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.lang-switch__btn:hover {
  color: var(--text);
}
.lang-switch__btn[aria-pressed='true'] {
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
}
@media (pointer: coarse) {
  .lang-switch__btn {
    min-height: var(--tap);
  }
}

/* Save state of auto-saved fields */
.save-ind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--text-faint);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.save-ind--saved .icon {
  color: var(--accent-text);
}
.save-ind__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
}
.save-ind--error {
  color: var(--danger-text);
}

/* =========================================================================
   Empty, loading and boot states
   ========================================================================= */

.empty {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  padding: var(--space-xl) var(--space-md);
  color: var(--text-dim);
  text-align: center;
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-2xs);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--raised);
  color: var(--text-dim);
}
.empty__title {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}
.empty__text {
  max-width: 46ch;
  margin: 0;
  font-size: var(--text-sm);
}
.empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}
.empty--error .empty__icon {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger-text);
}

.boot {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-md);
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-lg);
  color: var(--text-dim);
}
.boot-message {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  max-width: 34rem;
  color: var(--text-dim);
  text-align: center;
}
.boot-message p {
  margin: 0;
}

/* =========================================================================
   Login
   ========================================================================= */

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-lg) var(--space-md);
  /* a faint cutting-mat grid — this is a workbench */
  background-color: var(--bg);
  background-image:
    linear-gradient(rgb(233 238 236 / 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgb(233 238 236 / 0.028) 1px, transparent 1px);
  background-position: center;
  background-size: 32px 32px;
}
.login__panel {
  display: grid;
  gap: var(--space-md);
  width: min(100%, 400px);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-side);
}
.login__mark {
  margin-bottom: var(--space-2xs);
}
.login__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}
.login__lead {
  margin: -6px 0 var(--space-2xs);
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.login__form {
  display: grid;
  gap: var(--space-md);
}
.login__lang {
  justify-self: center;
  margin-top: var(--space-2xs);
}

/* =========================================================================
   App shell: sidebar (drawer on phones), top bar, main
   ========================================================================= */

.shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  min-height: var(--tap);
  padding: 0 var(--space-md);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--bg-side);
  color: var(--text);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  height: var(--topbar-h);
  padding: 0 var(--space-sm) 0 var(--space-2xs);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.topbar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}
.topbar__actions:empty {
  display: none;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgb(2 6 5 / 0.62);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(88vw, 340px);
  border-right: 1px solid var(--line);
  background: var(--bg-side);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform 0.28s var(--ease-out), visibility 0s linear 0.28s;
}
.sidebar.is-open {
  box-shadow: var(--shadow-float);
  transform: none;
  visibility: visible;
  transition: transform 0.28s var(--ease-out), visibility 0s;
}

.main {
  /* positioned, so absolutely positioned descendants (the visually hidden
     labels) stay inside its scroll area instead of stretching the page */
  position: relative;
  min-width: 0;
}
.main:focus {
  outline: none;
}

@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }
  .topbar,
  .scrim,
  .sidebar__close {
    display: none;
  }
  .sidebar {
    position: relative;
    z-index: auto;
    width: auto;
    /* without this the grid row grows to the whole product list and the
       page scrolls as a whole instead of the list and the main column */
    min-height: 0;
    box-shadow: none;
    transform: none;
    visibility: visible;
    transition: none;
  }
  .main {
    height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}

.sidebar__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md) var(--space-sm);
}
.sidebar__mark {
  display: inline-flex;
  border-radius: 8px;
}
.sidebar__new {
  flex: 1;
}
.sidebar__nav {
  display: grid;
  gap: 2px;
  padding: 0 var(--space-sm) var(--space-sm);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.nav-link:hover {
  background: var(--hover);
  color: var(--text);
}
.nav-link.is-active {
  background: var(--raised);
  color: var(--text);
}
.sidebar__search {
  position: relative;
  padding: 0 var(--space-md) var(--space-sm);
}
.sidebar__search-icon {
  position: absolute;
  top: 13px;
  left: calc(var(--space-md) + 12px);
  color: var(--text-faint);
  pointer-events: none;
}
.sidebar__list {
  flex: 1;
  min-height: 0;
  padding: 0 var(--space-sm) var(--space-md);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.product-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.product-item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-radius: var(--radius-md);
  transition: background-color 0.15s;
}
.product-item:hover,
.product-item.is-menu-open {
  background: var(--surface);
}
.product-item.is-active {
  background: var(--raised);
}
.product-item__link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 62px;
  padding: 8px 4px 8px 8px;
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
}
.thumb {
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text-faint);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-item__thumb {
  width: 46px;
  height: 46px;
  border-radius: 9px;
}
.product-item__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.product-item__title {
  overflow: hidden;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-item.is-active .product-item__title {
  font-weight: 700;
}
.product-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.product-item__by {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-item__more {
  opacity: 0;
}
.product-item:hover .product-item__more,
.product-item:focus-within .product-item__more,
.product-item.is-menu-open .product-item__more {
  opacity: 1;
}
@media (hover: none) {
  .product-item__more {
    opacity: 1;
  }
}
/* The row menu opens in place (never clipped by the scrolling list). */
.menu {
  display: grid;
  flex-basis: 100%;
  gap: 2px;
  margin: 0 6px 6px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--raised);
  animation: pop 0.16s var(--ease-out);
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
}
.menu__item:hover,
.menu__item:focus-visible {
  background: var(--hover);
}
.menu__item--danger {
  color: var(--danger-text);
}
.product-item__rename {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 6px;
}
.product-item__rename .input {
  flex: 1;
  min-width: 0;
}

.sidebar__foot {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
}
.me__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}
.me__avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}
.me__text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.me__name {
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me__role {
  color: var(--text-faint);
  font-size: 11px;
}
.spend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}
.spend__item {
  padding: 8px 10px;
  background: var(--bg-side);
}
.spend dt {
  color: var(--text-faint);
  font-size: 11px;
}
.spend dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.sidebar__foot .lang-switch {
  display: flex;
}
.sidebar__foot .lang-switch__btn {
  flex: 1;
}

/* =========================================================================
   Pages: home + shared headings
   ========================================================================= */

.eyebrow {
  margin: 0;
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.015em;
}
.page-head {
  display: grid;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}
.page-lead {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-lg);
}

.home {
  padding: var(--space-xl) var(--space-md) var(--space-3xl);
}
.home__inner {
  display: grid;
  justify-items: start;
  gap: var(--space-lg);
  max-width: 780px;
  margin: 0 auto;
}
.home__lead {
  max-width: 56ch;
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-lg);
  line-height: 1.5;
}
.home__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 1px;
  width: 100%;
  margin: var(--space-xs) 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
  list-style: none;
}
.home__step {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg);
}
.home__num {
  min-width: 1.1ch;
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 0.85;
}
.home__step-text {
  display: grid;
  gap: 4px;
}
.home__step-text span {
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.home__recent {
  display: grid;
  gap: var(--space-sm);
  width: 100%;
  margin-top: var(--space-lg);
}
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}
.recent-card {
  display: grid;
  gap: 8px;
  height: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.25s var(--ease-out);
}
.recent-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.recent-card__thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
}
.recent-card__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.recent-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 11px;
}

@media (min-width: 900px) {
  .home {
    padding: var(--space-3xl) var(--space-xl);
  }
}

/* =========================================================================
   Product page frame: header, activity, step bar
   ========================================================================= */

.product {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-3xl);
}
@media (min-width: 900px) {
  .product {
    padding: var(--space-xl) var(--space-xl) var(--space-3xl);
  }
}
.product__loading {
  display: grid;
  gap: var(--space-md);
}

.product-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  animation: rise 0.4s var(--ease-out) both;
}
.product-head__thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}
.product-head__main {
  display: grid;
  flex: 1;
  gap: 8px;
  min-width: 0;
}
.product-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.125rem);
  font-weight: 750;
  line-height: 1.05;
}
.title-btn {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.title-btn__text {
  overflow-wrap: anywhere;
}
.title-btn__icon {
  display: inline-block;
  margin-left: 8px;
  color: var(--text-faint);
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.15s;
}
.title-btn:hover .title-btn__icon,
.title-btn:focus-visible .title-btn__icon {
  opacity: 1;
}
@media (hover: none) {
  .title-btn__icon {
    opacity: 0.7;
  }
}
.product-head__rename {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}
.product-head__rename .input {
  flex: 1 1 260px;
}
.product-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0;
  color: var(--text-faint);
  font-size: var(--text-sm);
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
}
.live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.live--open .live__dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.live--connecting .live__dot,
.live--closed .live__dot {
  background: var(--warn);
  animation: pulse 1.2s ease-in-out infinite;
}
@media (max-width: 599px) {
  .product-head__thumb {
    width: 48px;
    height: 48px;
  }
  .product-head__delete {
    width: var(--tap);
    padding: 0;
  }
  .product-head__delete-text {
    display: none;
  }
}

.activity {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-xs) var(--space-sm) var(--space-md);
  border: 1px solid rgb(116 194 238 / 0.25);
  border-radius: var(--radius-lg);
  background: var(--info-soft);
}
.activity__icon {
  padding-top: 2px;
  color: var(--info);
}
.activity__body {
  display: grid;
  flex: 1;
  gap: 6px;
  min-width: 0;
}
.activity__label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xs);
  margin: 0;
  color: var(--info);
  font-size: var(--text-sm);
  font-weight: 700;
}
.activity__count {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.activity__text {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.activity .progress {
  background: rgb(116 194 238 / 0.18);
}
.activity .progress__fill {
  background: var(--info);
}
.activity--error {
  border-color: rgb(237 104 99 / 0.3);
  background: var(--danger-soft);
}
.activity--error .activity__icon,
.activity--error .activity__label {
  color: var(--danger-text);
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
}
.banner--error {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.banner__title {
  margin: 0;
  font-weight: 700;
}
.banner__text {
  margin: 2px 0 0;
  color: var(--text);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* Step bar: sticky under the top bar (phones) or at the top (desktop). */
.stepbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0 calc(var(--space-md) * -1) var(--space-lg);
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
@media (max-width: 899px) {
  .stepbar {
    top: var(--topbar-h);
  }
}
@media (min-width: 900px) {
  .stepbar {
    margin: 0 calc(var(--space-xl) * -1) var(--space-lg);
    padding: var(--space-xs) var(--space-xl);
  }
}
.steps {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2xs);
  min-width: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.step:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
}
.step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.step.is-current {
  border-color: var(--line-strong);
  background: var(--raised);
  color: var(--text);
}
.step__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.step.is-current .step__num {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.step.is-done .step__num {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.step__text {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}
.step__label {
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step__hint {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stepbar__save {
  flex: none;
}
@media (max-width: 699px) {
  .step {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 6px 2px;
    text-align: center;
  }
  .step__hint {
    display: none;
  }
  .step__label {
    font-size: 11px;
  }
  /* icon-only save state on phones */
  .stepbar__save span:not(.save-ind__dot) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

.step-panels {
  min-width: 0;
}

/* =========================================================================
   Spec-sheet sections (numbered, divided by rules — not boxed)
   ========================================================================= */

.details,
.panel,
.shops-step {
  display: grid;
}
.sheet {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--line);
}
.sheet:first-child {
  padding-top: 0;
  border-top: 0;
}
.sheet__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
.sheet__num {
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.sheet__titles {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.sheet__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 750;
  line-height: 1.1;
}
.sheet__hint {
  max-width: 46ch;
  margin: 0;
  color: var(--text-faint);
  font-size: var(--text-sm);
}
.sheet__body {
  display: grid;
  gap: var(--space-lg);
  min-width: 0;
}
.sheet__warn,
.sheet__note,
.sheet__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: var(--text-xs);
  font-weight: 700;
}
.sheet__warn {
  color: var(--warn);
}
.sheet__note {
  color: var(--info);
}
.sheet__count {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.sheet__count.is-full {
  color: var(--warn);
}
.sheet--placeholder {
  gap: var(--space-md);
}

@media (min-width: 1100px) {
  .sheet:not(.sheet--placeholder):not(.sheet--stacked) {
    grid-template-columns: 232px minmax(0, 1fr);
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
  }
  .sheet:first-child {
    padding-top: 0;
  }
  .sheet:not(.sheet--stacked) .sheet__head {
    position: sticky;
    top: 96px;
    flex-direction: column;
    align-self: start;
    gap: 6px;
  }
}
/* Wide content (tables) uses the full width with the heading on top. */
.sheet--stacked .sheet__head {
  flex-direction: column;
  gap: 4px;
}

/* =========================================================================
   Step 1 — photos, notes, analyze
   ========================================================================= */

.dropzone {
  position: relative;
  border-radius: var(--radius-lg);
}
.dropzone.is-empty {
  border: 1.5px dashed var(--line-strong);
  background: var(--surface);
}
.dropzone__empty {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
}
.dropzone__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-2xs);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.dropzone__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 750;
}
.dropzone__text {
  max-width: 40ch;
  margin: 0 0 var(--space-xs);
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.dropzone__veil {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-content: center;
  justify-items: center;
  gap: var(--space-xs);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: rgb(13 54 42 / 0.9);
  color: var(--accent-text);
  font-weight: 700;
  pointer-events: none;
}
.dropzone.is-over .dropzone__veil {
  display: grid;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }
}
.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.photo__img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line);
}
.photo__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.photo.is-selected .photo__img {
  box-shadow: 0 0 0 2px var(--accent);
}
.photo__main {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}
.photo__num {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: rgb(11 15 14 / 0.78);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
/* Drag handle: a 44 px target around a small visible chip. */
.photo__grip {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  color: var(--text);
  cursor: grab;
  touch-action: none;
}
.photo__grip::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 7px;
  background: rgb(11 15 14 / 0.78);
}
.photo__grip .icon {
  position: relative;
}
.photo.is-dragging {
  z-index: 6;
  box-shadow: var(--shadow-float);
  transition: none;
}
.photo.is-dragging .photo__grip {
  cursor: grabbing;
}
.photo.is-drop-target::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px dashed var(--accent-text);
  border-radius: 14px;
  pointer-events: none;
}
.photo--uploading {
  overflow: hidden;
}
.photo__preview {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  opacity: 0.45;
  filter: saturate(0.6);
}
.photo__overlay {
  position: absolute;
  inset: auto 8px 8px;
  display: grid;
}
.photo--uploading.is-failed .photo__overlay {
  inset: 0;
  place-items: center;
  color: var(--danger-text);
}
.photo--add {
  background: transparent;
}
.photo-add {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-dim);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.photo-add:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.photo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  animation: rise 0.2s var(--ease-out);
}
.photo-toolbar__label {
  margin-right: auto;
  padding: 0 var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.analyze-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm) var(--space-md);
}
.analyze-row__hint {
  margin: 0 auto 0 0;
  color: var(--text-faint);
  font-size: var(--text-sm);
}
.analyze-row__hint.is-blocked {
  color: var(--warn);
}

/* =========================================================================
   Product panel
   ========================================================================= */

/* Category search */
.combo {
  position: relative;
  display: grid;
  gap: 6px;
}
.combo__current {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
}
.combo__current-text {
  flex: 1;
  min-width: 0;
}
.combo__current-title {
  margin: 0;
  font-weight: 600;
}
.combo__current-path {
  margin: 2px 0 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}
.combo__field {
  position: relative;
  display: grid;
  gap: 6px;
}
.combo__list {
  position: absolute;
  top: calc(var(--tap) + 6px);
  right: 0;
  left: 0;
  z-index: 25;
  max-height: min(360px, 50vh);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--raised);
  box-shadow: var(--shadow-float);
  list-style: none;
}
.combo__option {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: var(--tap);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.combo__option.is-active {
  background: var(--hover);
}
.combo__option-title {
  font-size: var(--text-sm);
  font-weight: 600;
}
.combo__option-path {
  color: var(--text-faint);
  font-size: 11px;
}
.combo__state {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 10px;
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.combo__state--error {
  color: var(--danger-text);
}

/* Price */
.price-layout {
  display: grid;
  align-items: start;
  gap: var(--space-md);
}
@media (min-width: 700px) {
  .price-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: var(--space-lg);
  }
}
.price-card {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.price-card__title {
  margin: 0;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.price-card__empty {
  margin: 0;
  color: var(--text-faint);
  font-size: var(--text-sm);
}
.price-card__loading {
  display: grid;
  gap: 10px;
}
.price-card__error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  color: var(--danger-text);
  font-size: var(--text-sm);
}
.price-card__rows {
  display: grid;
  gap: 6px;
  margin: 0;
}
.price-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.price-row dt,
.price-row dd {
  margin: 0;
}
.price-row dd {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price-row--total {
  align-items: baseline;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}
.price-row--total dt {
  color: var(--text);
  font-weight: 600;
}
.price-row--total dd {
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
}

/* Variants */
.variants {
  display: grid;
  gap: var(--space-md);
}
.variants__bulk {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-sm) var(--space-lg);
}
.bulk {
  display: grid;
  gap: 6px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
table {
  width: 100%;
  border-collapse: collapse;
}
.vtable th,
.vtable td,
.ptable th,
.ptable td,
.utable th,
.utable td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  text-align: left;
  vertical-align: middle;
}
.vtable thead th,
.ptable thead th,
.utable thead th {
  background: var(--surface);
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.vtable thead th.num,
.utable thead th.num {
  text-align: right;
}
.vtable tbody tr:last-child > *,
.ptable tbody tr:last-child > *,
.utable tbody tr:last-child > * {
  border-bottom: 0;
}
.vtable td {
  padding-top: 6px;
  padding-bottom: 6px;
}
.vtable__name {
  font-weight: 600;
  white-space: nowrap;
}
.vtable__final {
  color: var(--accent-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vtable .input {
  max-width: 170px;
}
@media (max-width: 599px) {
  .vtable thead {
    display: none;
  }
  .vtable,
  .vtable tbody,
  .vtable tr {
    display: block;
  }
  .vtable tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .vtable tbody tr:last-child {
    border-bottom: 0;
  }
  .vtable th,
  .vtable td {
    display: grid;
    gap: 4px;
    padding: 0;
    border: 0;
  }
  .vtable__name {
    grid-column: 1 / -1;
  }
  .vtable td::before {
    content: attr(data-label);
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 600;
  }
  .vtable .input {
    max-width: none;
  }
}

/* Characteristics: several-options picker */
.multi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.multi__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--field);
  color: var(--text-dim);
  font-size: var(--text-sm);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.multi__opt:hover {
  color: var(--text);
}
.multi__opt.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.multi__more {
  align-self: center;
  margin-left: 4px;
}
@media (pointer: coarse) {
  .multi__opt {
    min-height: var(--tap);
  }
}

/* Texts */
.texts {
  display: grid;
  gap: var(--space-md);
}
.texts__rewrite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.texts__rewrite .field__hint {
  flex: 1 1 260px;
  font-size: var(--text-sm);
}

/* Gallery plan */
.plan {
  display: grid;
  gap: var(--space-sm);
}
.plan__count {
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
}
.plan__count.is-warn {
  color: var(--warn);
}
.plan__slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 599px) {
  .plan__slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.plan__slot {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.plan__slot.is-empty {
  border-style: dashed;
  background: transparent;
  color: var(--text-faint);
}
.plan__slot--fixed {
  border-color: transparent;
  background: var(--accent-soft);
}
.plan__slot-num {
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: 1;
}
.plan__slot.is-empty .plan__slot-num {
  color: var(--text-faint);
}
.plan__slot-name {
  font-size: var(--text-sm);
  font-weight: 600;
}
.plan__slot-note {
  color: var(--accent-text);
  font-size: 11px;
}
.plan__kinds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: var(--space-xs);
}
.kind {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 64px;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--field);
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}
.kind:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface);
}
.kind:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.kind.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.kind__check,
.checkbox {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  color: var(--accent-ink);
  transition: background-color 0.15s, border-color 0.15s;
}
.kind.is-on .kind__check,
.checkbox.is-on {
  border-color: var(--accent);
  background: var(--accent);
}
.kind__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.kind__name {
  font-size: var(--text-sm);
  font-weight: 600;
}
.kind__desc {
  color: var(--text-faint);
  font-size: var(--text-xs);
}
.kind.is-on .kind__desc {
  color: var(--text-dim);
}
.kind__slot {
  position: absolute;
  top: 8px;
  right: 12px;
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
}

/* Styles */
.styles {
  display: grid;
  gap: var(--space-sm);
}
.styles__list {
  display: flex;
  gap: var(--space-sm);
  padding: 4px 2px 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.style-tile {
  position: relative;
  display: grid;
  flex: none;
  gap: 6px;
  width: 128px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  scroll-snap-align: start;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.style-tile:hover:not(:disabled) {
  border-color: var(--line-strong);
}
.style-tile[aria-checked='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.style-tile__img {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 9px;
  background: var(--field);
  color: var(--text-dim);
}
.style-tile__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.style-tile__name {
  overflow: hidden;
  padding: 0 2px 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.style-tile__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgb(11 15 14 / 0.8);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
}
.style-tile__check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.style-tile--add .style-tile__img {
  border: 1.5px dashed var(--line-strong);
  background: transparent;
}
.style-tile--add:hover:not(:disabled) .style-tile__img {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Facts the AI saw */
.facts {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.facts__summary,
.cand__more > summary {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--tap);
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.facts__summary {
  padding: 0 var(--space-md);
}
.facts__summary::-webkit-details-marker,
.cand__more > summary::-webkit-details-marker {
  display: none;
}
.facts__summary:hover,
.cand__more > summary:hover {
  color: var(--text);
}
.facts__chevron,
.cand__chevron {
  transition: transform 0.2s var(--ease-out);
}
.facts[open] .facts__chevron,
.cand__more[open] .cand__chevron {
  transform: rotate(180deg);
}
.facts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: var(--space-md);
  margin: 0;
  padding: 0 var(--space-md) var(--space-md);
}
.facts__group dt {
  margin-bottom: 4px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.facts__group dd {
  margin: 0;
}
.facts__group ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-dim);
  font-size: var(--text-sm);
}

.panel__next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.panel__next-text {
  max-width: 52ch;
  margin: 0;
  color: var(--text-dim);
}

/* =========================================================================
   Step 2 — shops and Generate
   ========================================================================= */

.shops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}
.shops-toolbar__count {
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.shops-toolbar__search {
  position: relative;
  flex: 1 1 220px;
}
.shops-toolbar__search-icon {
  position: absolute;
  top: 13px;
  left: 12px;
  color: var(--text-faint);
  pointer-events: none;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--space-sm);
}
.shop-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 92px;
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s, transform 0.2s var(--ease-out);
}
.shop-card:hover {
  border-color: var(--line-strong);
}
.shop-card:active {
  transform: scale(0.99);
}
.shop-card.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.shop-card__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.shop-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 750;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.shop-card__meta {
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.shop-card__note {
  color: var(--warn);
  font-size: var(--text-xs);
}
.shop-card__note--live {
  color: var(--accent-text);
}
.shop-card-wrap {
  position: relative;
  display: grid;
}
.shop-card__remove {
  position: absolute;
  top: 8px;
  right: 8px;
}
.shop-add {
  display: grid;
  gap: 8px;
  margin-top: var(--space-md);
  max-width: 520px;
}
.shop-add__label {
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.shop-add__row {
  display: flex;
  gap: var(--space-sm);
}
.shop-add__row .input {
  flex: 1;
  min-width: 0;
}

.generate-bar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-side);
  box-shadow: 0 -16px 32px -18px rgb(2 8 6 / 0.8);
}
.generate-bar__summary {
  display: grid;
  flex: 1 1 260px;
  gap: 4px;
  min-width: 0;
}
.generate-bar__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
}
.generate-bar__meta {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.generate-bar__blockers,
.generate-bar__warns,
.publish__warns {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
  font-size: var(--text-xs);
  list-style: none;
}
.generate-bar__blockers li,
.generate-bar__warns li,
.publish__warns li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.generate-bar__blockers {
  color: var(--text-dim);
}
.generate-bar__warns,
.publish__warns {
  color: var(--warn);
}
@media (max-width: 599px) {
  .generate-bar {
    padding: var(--space-md);
  }
  .generate-bar .btn {
    width: 100%;
  }
}

/* Cost confirmation */
.cost {
  display: grid;
  gap: var(--space-md);
}
.cost__figure {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}
.cost__label {
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cost__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cost__meta {
  display: grid;
  gap: 8px;
  margin: 0;
}
.cost__meta > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  font-size: var(--text-sm);
}
.cost__meta dt {
  color: var(--text-faint);
}
.cost__meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.cost__note {
  display: flex;
  gap: 6px;
  margin: 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
}
.cost__note--warn {
  color: var(--warn);
}
.dialog-state {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  color: var(--text-dim);
}

/* =========================================================================
   Review — one card per shop
   ========================================================================= */

.review {
  display: grid;
  gap: var(--space-lg);
}
.review-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
}
.review-bar__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.review-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr));
  align-items: start;
  gap: var(--space-lg);
}

.cand {
  container-type: inline-size;
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  transition: border-color 0.2s, opacity 0.2s;
  animation: rise 0.35s var(--ease-out) both;
}
.cand--approved {
  border-color: rgb(16 163 127 / 0.65);
}
.cand--rejected {
  opacity: 0.62;
}
.cand--rejected:hover,
.cand--rejected:focus-within {
  opacity: 1;
}
.cand--placeholder {
  gap: var(--space-md);
}
.cand__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}
.cand__titles {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.cand__shop {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.1;
}
.cand__shop .icon {
  color: var(--text-faint);
}
.cand__product {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: var(--text-xs);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cand__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@container (min-width: 560px) {
  .cand__gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tile {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.tile__img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.tile__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease-out);
}
.tile__img:hover img {
  transform: scale(1.03);
}
.tile__img:focus-visible {
  outline-offset: -3px;
}
.tile__state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  color: var(--text-dim);
  font-size: var(--text-xs);
  text-align: center;
}
.tile--loading .tile__state {
  background: linear-gradient(90deg, var(--field) 0%, var(--raised) 50%, var(--field) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.tile__state--overlay {
  background: rgb(11 15 14 / 0.62);
  color: var(--text);
}
.tile__state--error {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.tile__error {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.tile__cap {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  padding: 24px 6px 6px;
  background: linear-gradient(to top, rgb(6 9 8 / 0.88), rgb(6 9 8 / 0));
  pointer-events: none;
}
.tile__kind {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile__badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
/* Narrow cards (phones): kind name on its own line above the badges. */
@container (max-width: 459px) {
  .tile__cap {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-top: 32px;
  }
  .tile__kind {
    max-width: 100%;
  }
}
.tile__regen {
  position: absolute;
  top: 2px;
  right: 2px;
}
.tile__regen::before {
  content: '';
  position: absolute;
  inset: 7px;
  z-index: -1;
  border-radius: 9px;
  background: rgb(11 15 14 / 0.78);
}
.tile__regen {
  z-index: 1;
  color: var(--text);
}
.tile__regen:hover:not(:disabled) {
  background: transparent;
  color: var(--accent-text);
}
.tile__flag {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 10px;
  font-weight: 700;
}
.verdict {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.verdict--pass {
  background: var(--accent);
  color: var(--accent-ink);
}
.verdict--fail {
  background: var(--warn);
  color: #2b1d03;
}

.cand__more {
  padding-top: 2px;
  border-top: 1px solid var(--line);
}
.notes-list {
  display: grid;
  gap: 8px;
  margin: 0 0 var(--space-xs);
  padding: 0;
  font-size: var(--text-sm);
  list-style: none;
}
.notes-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-dim);
}
.notes-list__kind {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--raised);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}
.cand__texts {
  display: grid;
  gap: var(--space-sm);
  padding-bottom: var(--space-sm);
}
.cand__texts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.cand__texts [role='tabpanel'] {
  display: grid;
  gap: var(--space-sm);
}
.cand__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  padding-top: var(--space-2xs);
}

.regen {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.regen__thumb {
  width: 54px;
  height: 72px;
  border-radius: 8px;
}
.regen__shop {
  margin: 0;
  font-weight: 700;
}
.regen__kind {
  margin: 2px 0 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
}

/* =========================================================================
   Publishing
   ========================================================================= */

.publish {
  display: grid;
  gap: var(--space-lg);
}
.publish__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md) var(--space-lg);
}
.publish__progress {
  display: grid;
  flex: 1 1 320px;
  gap: 10px;
}
.publish__figure {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}
.publish__done {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.publish__total {
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}
.publish__label {
  margin-left: 4px;
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.publish .progress {
  height: 8px;
}
.publish__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.publish__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.ptable__shop {
  font-weight: 700;
  white-space: nowrap;
}
.ptable__shop .icon,
.utable__user .icon {
  display: inline-block;
  margin-right: 6px;
  color: var(--text-faint);
  vertical-align: -3px;
}
.ptable__error {
  max-width: 380px;
  color: var(--danger-text);
  overflow-wrap: anywhere;
}
.ptable__action {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

/* =========================================================================
   Admin
   ========================================================================= */

.admin {
  display: grid;
  gap: var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-3xl);
}
@media (min-width: 900px) {
  .admin {
    padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
  }
}
.utable__user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.utable__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.utable tfoot th,
.utable tfoot td {
  border-top: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  align-items: start;
  gap: var(--space-md) var(--space-lg);
}
.admin-form .form-error,
.admin-form__actions {
  grid-column: 1 / -1;
}
.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent-text);
  animation: rise 0.25s var(--ease-out);
}
.callout__body {
  display: grid;
  flex: 1 1 260px;
  gap: 6px;
  color: var(--text);
}
.callout__title {
  margin: 0;
  font-weight: 700;
}
.callout__text {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.callout__actions {
  display: flex;
  gap: 6px;
}
.creds {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
}
.creds > div {
  display: flex;
  gap: var(--space-xs);
}
.creds dt {
  min-width: 96px;
  color: var(--text-faint);
  font-size: var(--text-sm);
}
.creds dd {
  margin: 0;
}

/* Tables become stacked rows on phones. */
@media (max-width: 699px) {
  .ptable thead,
  .utable thead {
    display: none;
  }
  .ptable,
  .ptable tbody,
  .utable,
  .utable tbody,
  .utable tfoot {
    display: block;
  }
  .ptable tr,
  .utable tr {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .ptable tbody tr:last-child,
  .utable tbody tr:last-child {
    border-bottom: 0;
  }
  .ptable th,
  .ptable td,
  .utable th,
  .utable td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .ptable td[data-label],
  .utable td[data-label] {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
  }
  .ptable td[data-label]::before,
  .utable td[data-label]::before {
    content: attr(data-label);
    color: var(--text-faint);
    font-size: var(--text-xs);
  }
  .ptable td:empty,
  .utable td:empty {
    display: none;
  }
  .ptable__action,
  .utable__actions {
    justify-content: flex-start;
    width: auto;
    text-align: left;
  }
  .ptable__error {
    max-width: none;
  }
  .utable tfoot tr {
    border-top: 1px solid var(--line-strong);
    background: var(--surface);
  }
  .utable tfoot th,
  .utable tfoot td {
    border-top: 0;
    background: transparent;
  }
}

/* =========================================================================
   Assistant (product page)
   Launcher: floating bottom-right on PC, in the top bar below 900 px.
   Panel: a bottom sheet on phones, over the page from 600 px, docked beside
   it from 1200 px — <html data-assistant="open|closed"> lets the page make
   room (the main column narrows, toasts step aside).
   Stacking: launcher 34 < sheet scrim 36 < panel 37 < phone drawer 40/50 <
   lightbox, dialogs and toasts, so all of those still cover it.
   ========================================================================= */

.assistant-fab {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  z-index: 34;
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--raised);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  box-shadow: var(--shadow-float);
  animation: rise 0.3s var(--ease-out) both;
  transition: border-color 0.15s, background-color 0.15s, bottom 0.3s var(--ease-out);
}
.assistant-fab:hover {
  border-color: var(--accent);
  background: var(--hover);
}
/* Shops step: clear of the sticky Generate bar. */
.assistant-fab.is-raised {
  bottom: calc(var(--space-lg) + 120px);
}
.assistant-fab__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
}
@media (min-width: 900px) {
  .assistant-fab {
    display: inline-flex;
  }
}

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.launcher-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}

.topbar-assistant {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--raised);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.topbar-assistant .icon {
  color: var(--accent-text);
}
.topbar-assistant:hover,
.topbar-assistant.is-open {
  border-color: var(--accent);
  background: var(--hover);
}
@media (pointer: coarse) {
  .topbar-assistant {
    min-height: var(--tap);
  }
}
/* The smallest phones: icon only (the name stays for screen readers). */
@media (max-width: 374px) {
  .topbar-assistant {
    justify-content: center;
    width: var(--tap);
    padding: 0;
  }
  .topbar-assistant__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.assistant-scrim {
  position: fixed;
  inset: 0;
  z-index: 36;
  background: rgb(2 6 5 / 0.62);
}

.assistant {
  position: fixed;
  z-index: 37;
  display: flex;
  flex-direction: column;
  background: var(--bg-side);
  color: var(--text);
}
.assistant:focus {
  outline: none;
}
.assistant--side,
.assistant--docked {
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--assistant-w);
  max-width: calc(100vw - 48px);
  border-left: 1px solid var(--line);
}
.assistant--side {
  box-shadow: var(--shadow-float);
}
/* --kb / --vvh: the phone keyboard's height and the visible height (set
   from visualViewport), so the message box stays above the keyboard. */
.assistant--sheet {
  right: 0;
  bottom: var(--kb, 0px);
  left: 0;
  height: min(88vh, calc(var(--vvh, 100vh) - 8px));
  height: min(88dvh, calc(var(--vvh, 100dvh) - 8px));
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-float);
}

.assistant-enter-active,
.assistant-leave-active {
  transition: transform 0.28s var(--ease-out), opacity 0.2s ease;
}
.assistant-enter-from,
.assistant-leave-to {
  opacity: 0;
  transform: translateX(28px);
}
.assistant--sheet.assistant-enter-from,
.assistant--sheet.assistant-leave-to {
  opacity: 1;
  transform: translateY(100%);
}

.assistant__head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-xs) var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--line);
}
.assistant__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.assistant__titles {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.assistant__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.05;
}
.assistant__product {
  margin: 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant__thread {
  flex: 1;
  min-height: 0;
  padding: var(--space-md);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.assistant__log {
  display: grid;
  gap: var(--space-md);
}

.assistant__empty {
  display: grid;
  justify-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-2xs) var(--space-md);
  text-align: center;
}
.assistant__empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.assistant__empty-text {
  max-width: 34ch;
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.assistant__examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}
.assistant__example {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--field);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.3;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.assistant__example:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
@media (pointer: coarse) {
  .assistant__example {
    min-height: var(--tap);
  }
}

/* Messages */
.amsg {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.amsg--user {
  justify-items: end;
}
.amsg__bubble {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
}
.amsg--user .amsg__bubble {
  max-width: 88%;
  padding: 9px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--accent-soft);
  white-space: pre-wrap;
}
.amsg--assistant .amsg__bubble {
  display: grid;
  gap: var(--space-sm);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
}
.amsg__text {
  margin: 0;
  white-space: pre-wrap;
}
.amsg__failed {
  display: grid;
  justify-items: end;
  gap: 4px;
  max-width: 92%;
}
.amsg__failed-text {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--danger-text);
  font-size: var(--text-xs);
}
.amsg__failed-text .icon {
  margin-top: 1px;
}
.amsg__failed-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2xs);
}
.amsg__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--line);
}
.amsg__suggestion {
  height: auto;
  padding-top: 6px;
  padding-bottom: 6px;
  text-align: left;
  white-space: normal;
}
.amsg__suggestion .icon {
  color: var(--accent-text);
}
.amsg__suggestion.is-blocked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* What changed: label, then old → new */
.achanges {
  display: grid;
  gap: 8px;
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--line-strong);
}
.achanges__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.achanges.is-undone .achanges__title {
  color: var(--info);
}
.achanges__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.achange {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.achange__label {
  color: var(--text-dim);
  font-size: var(--text-xs);
  font-weight: 600;
}
.achange__values {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.achange__from,
.achange__to ins {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.achange__from {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: rgb(175 184 180 / 0.5);
}
/* The arrow travels with the new value when long values wrap. */
.achange__to {
  display: flex;
  gap: 8px;
  min-width: 0;
  color: var(--accent-text);
  font-weight: 600;
}
.achange__to ins {
  min-width: 0;
  text-decoration: none;
}
.achanges.is-undone .achange__to {
  color: var(--text);
}
.achange__arrow {
  margin-top: 0.3em;
  color: var(--text-faint);
}
.achanges__foot {
  display: flex;
  align-items: center;
}
.achanges__undo {
  margin-left: -8px;
}
.achanges__note {
  margin: 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
}

/* Waiting for an answer */
.amsg__bubble.typing {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
  padding: 15px 16px;
}
.typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typing 1.2s ease-in-out infinite;
}
.typing__dot:nth-child(2) {
  animation-delay: 0.15s;
}
.typing__dot:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: none;
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Message box */
.assistant__foot {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md) calc(var(--space-sm) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.assistant__notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--info-soft);
  color: var(--info);
  font-size: var(--text-sm);
}
.assistant__notice-text {
  flex: 1 1 180px;
  margin: 0;
  color: var(--text);
}
.assistant__listening {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--danger-text);
  font-size: var(--text-xs);
  font-weight: 700;
}
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.2s ease-in-out infinite;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 3px 3px 3px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--field);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer:hover {
  border-color: var(--line-strong);
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.composer.is-listening {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(237 104 99 / 0.22);
}
.composer__input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  max-height: 168px;
  padding: 11px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: var(--text-md);
  line-height: 1.45;
  resize: none;
}
.composer__input:focus-visible {
  outline: none;
}
.composer__input::placeholder {
  color: var(--text-faint);
}
.composer__mic.is-on {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.composer__send {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  transition: background-color 0.15s, opacity 0.15s;
}
.composer__send:hover:not(:disabled) {
  background: var(--accent-hover);
}
.composer__send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.composer__hint {
  margin: 0;
  color: var(--text-faint);
  font-size: 11px;
}
@media (pointer: coarse) {
  .composer__input {
    font-size: 16px; /* phones zoom into smaller text */
  }
  .composer__hint {
    display: none;
  }
}

/* A field the assistant just changed lights up for a moment. */
.is-flash {
  position: relative;
}
.is-flash::after {
  content: '';
  position: absolute;
  inset: -6px;
  z-index: 1;
  border-radius: var(--radius-lg);
  background: rgb(16 163 127 / 0.1);
  box-shadow: 0 0 0 2px var(--accent);
  pointer-events: none;
  animation: flash-out 1.8s var(--ease-out) forwards;
}
.table-wrap.is-flash::after,
.cand.is-flash::after,
.tabs__tab.is-flash::after {
  inset: 0;
  border-radius: inherit;
}
@keyframes flash-out {
  0% {
    opacity: 0;
  }
  12%,
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* The page makes room for the assistant. */
@media (max-width: 599px) {
  /* The sheet is modal: the page behind stays put, toasts move to the top. */
  html[data-assistant='open'] {
    overflow: hidden;
  }
  html[data-assistant='open'] .toasts {
    top: calc(var(--space-sm) + env(safe-area-inset-top));
    bottom: auto;
  }
}
@media (min-width: 600px) {
  html[data-assistant='open'] .toasts {
    right: calc(var(--assistant-w) + var(--space-md));
    width: min(400px, calc(100vw - var(--assistant-w) - 2 * var(--space-md)));
  }
}
@media (min-width: 900px) {
  /* The floating launcher owns the bottom-right corner. */
  html[data-assistant='closed'] .toasts {
    bottom: calc(var(--space-lg) + 64px);
  }
  html[data-assistant='closed'] .product {
    padding-bottom: calc(var(--space-3xl) + var(--space-lg));
  }
}
@media (min-width: 1200px) {
  html[data-assistant='open'] .main {
    margin-right: var(--assistant-w);
  }
}
/* Docked, the page column is ~400 px narrower than the window: keep the
   spec sheets stacked (heading above the fields, as on smaller screens)
   until the label column fits again. */
@media (min-width: 1200px) and (max-width: 1519px) {
  html[data-assistant='open'] .sheet:not(.sheet--placeholder):not(.sheet--stacked) {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
    padding: var(--space-lg) 0;
  }
  html[data-assistant='open'] .sheet:not(.sheet--placeholder):not(.sheet--stacked):first-child {
    padding-top: 0;
  }
  html[data-assistant='open'] .sheet:not(.sheet--stacked) .sheet__head {
    position: static;
    flex-direction: row;
    align-self: auto;
    gap: var(--space-sm);
  }
}

/* =========================================================================
   Overlays: dialogs (bottom sheets on phones), lightbox, toasts
   Stacking: lightbox 70 < dialogs 80 < toasts 90, so a dialog opened from
   the viewer sits on top of it and toasts stay visible over both.
   ========================================================================= */

.dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--space-md);
  overflow-y: auto;
  background: rgb(2 6 5 / 0.66);
  animation: fade 0.18s ease-out;
}
.dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-side);
  box-shadow: var(--shadow-float);
  animation: pop 0.22s var(--ease-out);
}
.dialog:focus {
  outline: none;
}
.dialog--sm {
  width: min(100%, 440px);
}
.dialog--lg {
  width: min(100%, 720px);
}
.dialog__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-sm) 0 var(--space-lg);
}
.dialog__title {
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.15;
}
.dialog__body {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  overflow-y: auto;
}
.dialog__message {
  margin: 0;
  color: var(--text-dim);
}
.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg) var(--space-lg);
}
@media (max-width: 599px) {
  .dialog-layer {
    place-items: end center;
    padding: 0;
  }
  .dialog,
  .dialog--sm,
  .dialog--lg {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 20px 20px 0 0;
    animation: sheet-up 0.3s var(--ease-out);
  }
  .dialog__actions .btn {
    flex: 1;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #050807;
  color: var(--text);
  animation: fade 0.2s ease-out;
}
.lightbox:focus {
  outline: none;
}
.lightbox__bar {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 6px 6px var(--space-md);
  padding-top: calc(6px + env(safe-area-inset-top));
  background: rgb(5 8 7 / 0.92);
}
.lightbox__count {
  min-width: 52px;
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.lightbox__titles {
  flex: 1;
  min-width: 0;
}
.lightbox__title,
.lightbox__subtitle {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox__title {
  font-weight: 700;
}
.lightbox__subtitle {
  color: var(--text-faint);
  font-size: var(--text-xs);
}
.lightbox__tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.lightbox__zoom {
  min-width: 56px;
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-dim);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lightbox__zoom:hover {
  background: var(--hover);
  color: var(--text);
}
.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox__stage.is-zoomed {
  cursor: grab;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: transform 0.22s var(--ease-out), opacity 0.2s;
  will-change: transform;
  -webkit-user-drag: none;
}
.lightbox__img.is-loaded {
  opacity: 1;
}
.lightbox__spinner {
  position: absolute;
}
.lightbox__failed {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  color: var(--danger-text);
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgb(17 22 20 / 0.85);
  color: var(--text);
  transform: translateY(-50%);
}
.lightbox__nav--prev {
  left: 12px;
}
.lightbox__nav--next {
  right: 12px;
}
.lightbox__nav:disabled {
  opacity: 0;
  pointer-events: none;
}
/* Phones swipe between images; the arrows would only cover the picture. */
@media (pointer: coarse) and (max-width: 599px) {
  .lightbox__nav {
    display: none;
  }
}
.lightbox__info {
  display: grid;
  gap: 8px;
  max-height: 34vh;
  padding: var(--space-sm) var(--space-md);
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: rgb(5 8 7 / 0.94);
}
.lightbox__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lightbox__notes {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-dim);
  font-size: var(--text-sm);
}
.lightbox__regen {
  justify-self: start;
}

.toasts {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 90;
  display: grid;
  gap: var(--space-xs);
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
@media (max-width: 599px) {
  .toasts {
    right: auto;
    bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
  }
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 4px 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow: var(--shadow-float);
  pointer-events: auto;
}
.toast--error {
  border-color: rgb(237 104 99 / 0.45);
}
.toast__icon {
  padding-top: 1px;
  color: var(--info);
}
.toast--success .toast__icon {
  color: var(--accent-text);
}
.toast--error .toast__icon {
  color: var(--danger-text);
}
.toast__body {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  padding-top: 1px;
}
.toast__title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
}
.toast__message {
  margin: 0;
  color: var(--text-dim);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.toast__title + .toast__message {
  font-size: var(--text-xs);
}
.toast__close {
  margin: -10px 0;
}
.toast-enter-active {
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
}
.toast-leave-active {
  transition: opacity 0.2s, transform 0.2s;
}
.toast-enter-from {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}
.toast-leave-to {
  opacity: 0;
  transform: translateX(16px);
}
.toast-move {
  transition: transform 0.25s var(--ease-out);
}

/* Cost mode picker (cost dialog) — premium / economy / batch */
.cost-modes {
  display: grid;
  gap: 8px;
  margin: 0 0 var(--space-md);
  padding: 0;
  border: 0;
}
.cost-modes__legend {
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cost-mode {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
}
.cost-mode input {
  grid-row: span 2;
  accent-color: var(--accent);
}
.cost-mode--on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cost-mode__name {
  font-weight: 700;
}
.cost-mode__desc {
  color: var(--text-dim);
  font-size: var(--text-xs);
}

/* Bulk IKPU page */
.ikpu__bar { display: grid; gap: var(--space-md); }
.ikpu__row { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: flex-end; }
.ikpu__shop { flex: 0 1 320px; }
.ikpu__search { flex: 1 1 280px; }
.ikpu__code { flex: 1 1 360px; position: relative; }
.ikpu__apply { flex: 0 0 auto; }
.ikpu__options { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; max-height: 320px; overflow: auto; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md, 10px); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.ikpu__option { display: grid; gap: 2px; width: 100%; padding: 8px 10px; text-align: left; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; }
.ikpu__option:hover, .ikpu__option:focus-visible { background: var(--accent-soft); }
.ikpu__option-name { font-size: var(--text-sm); }
.ikpu__option-group { color: var(--text-faint); font-size: var(--text-xs); }
.ikpu__job { display: grid; gap: 6px; }
.ikpu__job progress { width: 100%; }
.ikpu__problems { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: var(--text-sm); }
.ikpu__table tbody tr { cursor: pointer; }
.ikpu__table tbody tr.is-on { background: var(--accent-soft); }
.ikpu__product { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.ikpu__product img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; flex: none; }
.ikpu__title { display: block; font-weight: 600; }
.ikpu__id { display: block; color: var(--text-faint); font-size: var(--text-xs); }
.ikpu__table .tag { margin: 2px 4px 2px 0; }
.ikpu__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); margin-top: var(--space-sm); }
.table-wrap { overflow-x: auto; }

/* Bulk IKPU — grid view */
.ikpu__viewbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); margin-bottom: var(--space-sm); flex-wrap: wrap; }
.ikpu__selall { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); cursor: pointer; }
.ikpu__views { display: inline-flex; gap: 6px; }
.ikpu__views .btn { display: inline-flex; align-items: center; gap: 6px; }
.ikpu__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-md); margin: 0; padding: 0; list-style: none; }
.ikpu__card { display: grid; grid-template-rows: auto 1fr; width: 100%; height: 100%; padding: 0; overflow: hidden; text-align: left; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ikpu__card:hover { border-color: var(--line-strong); }
.ikpu__card.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ikpu__card-img { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--surface-2, rgba(255,255,255,.04)); }
.ikpu__card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ikpu__card-check { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px;
  border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.35); color: #fff; }
.ikpu__card.is-on .ikpu__card-check { background: var(--accent); border-color: var(--accent); }
.ikpu__card-body { display: grid; gap: 4px; padding: 10px 12px 12px; align-content: start; }
.ikpu__card .ikpu__title { font-size: var(--text-sm); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ikpu__card-ikpu { display: flex; flex-wrap: wrap; margin-top: 2px; }
.ikpu__card-ikpu .tag { margin: 2px 4px 0 0; font-size: 11px; }

/* Bulk IKPU — scroll loading */
.ikpu__loader { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: var(--space-md) 0; color: var(--text-dim); font-size: var(--text-sm); }
.ikpu__loader progress { flex: 1 1 200px; height: 6px; }
.ikpu__loader-count { font-variant-numeric: tabular-nums; }
.ikpu__sentinel { height: 1px; }

.ikpu__selwrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.ikpu__card-shop { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: fit-content; max-width: calc(100% - 16px); }

.ikpu__refresh { margin-left: 10px; }

.ikpu__sync { display: grid; gap: 8px; }
.ikpu__sync-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-md); }
.ikpu__sync-text { margin: 0; color: var(--text-dim); }
.ikpu__sync progress { width: 100%; height: 8px; }

/* SKU section — photos per colour */
.skus { display: grid; gap: 8px; margin: var(--space-md) 0; }
.skus__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-md); }
.sku-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); background: var(--surface); }
.sku-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sku-card__name { font-weight: 700; font-size: var(--text-md, 1rem); }
.sku-card__count { color: var(--text-faint); font-size: var(--text-xs); }
.sku-card__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.sku-card__photo { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--surface-2, rgba(255,255,255,.04)); }
.sku-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sku-card__remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.sku-card__add { aspect-ratio: 3 / 4; display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed var(--line-strong);
  border-radius: 8px; color: var(--text-dim); font-size: var(--text-xs); cursor: pointer; text-align: center; padding: 4px; }
.sku-card__add:hover { border-color: var(--accent); color: var(--accent-text); }
.sku-card__add.is-busy { pointer-events: none; opacity: .7; }
.sku-card__note { margin: 0; color: var(--text-faint); font-size: var(--text-xs); }

/* Upload page */
.upl__bar { display: grid; gap: var(--space-md); }
.upl__shops { display: flex; flex-wrap: wrap; gap: 8px; }
.upl__shop { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: inherit; cursor: pointer; font-weight: 600; }
.upl__shop.is-on { border-color: var(--accent); background: var(--accent-soft); }
.upl__shop-check { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; border: 1.5px solid var(--line-strong); }
.upl__shop.is-on .upl__shop-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.upl__shop-id { color: var(--text-faint); font-size: var(--text-xs); font-weight: 400; }
.upl__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); }
.upl__search { flex: 1 1 260px; }
.upl__row .btn--primary { display: inline-flex; align-items: center; gap: 8px; }
.upl__items { margin: 0; padding-left: 18px; max-height: 320px; overflow: auto; font-size: var(--text-sm); color: var(--text-dim); }
.upl__items .is-done b { color: var(--success, #22c55e); }
.upl__items .is-failed b { color: var(--danger, #ef4444); }
.upl__card { cursor: pointer; }
.upl__card.is-off { opacity: .55; cursor: not-allowed; }
.upl__states { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.upl__states .tag { font-size: 10px; }
.upl__open { font-size: var(--text-xs); color: var(--accent-text); margin-top: 4px; width: fit-content; }

.upl__card { position: relative; }
.upl__check { position: absolute; top: 8px; left: 8px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: rgba(0,0,0,.55); cursor: pointer; }
.upl__check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.upl__regen { padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: 8px; }

/* Upload page — product card */
.upl__img { cursor: ew-resize; }
.upl__dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 4px; padding: 0 8px; }
.upl__dots i { flex: 1 1 0; max-width: 28px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.45); }
.upl__dots i.is-on { background: #fff; }
.upl__nocard { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; text-align: center; }
.upl__title-ru { font-weight: 700; font-size: var(--text-sm); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upl__title-uz { color: var(--text-dim); font-size: var(--text-xs); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upl__price { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.upl__price .input { width: 120px; font-weight: 700; }
.upl__price-unit { color: var(--text-faint); font-size: var(--text-xs); }
.upl__regen-one { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-dim); cursor: pointer; margin-top: 2px; }

/* Regeneration page */
.regen__note { display: inline-flex; align-items: center; gap: 8px; margin: var(--space-xs) 0 0; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--text-sm); font-weight: 600; }
.regen__note .icon, .regen__note svg { flex: none; }
.regen__bar { display: grid; gap: var(--space-md); }
.regen__shops { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.regen__shops legend { padding: 0; margin-bottom: 8px; }
.regen__chip { position: relative; user-select: none; }
.regen__chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.regen__recent { flex: 0 1 320px; min-width: 0; }
.regen__missing { display: block; margin-top: 2px; color: var(--text-faint); font-size: var(--text-xs); }
.regen .tag--danger { border-color: transparent; background: var(--danger-soft); color: var(--danger-text); }
.regen .tag--info { border-color: transparent; background: var(--info-soft); color: var(--info); }
.regen .tag .spinner { margin-right: 6px; }

/* Regeneration page — run panel */
.regen__job { display: grid; gap: var(--space-sm); }
.regen__job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px var(--space-md); }
.regen__job-title { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.regen__job-meta { color: var(--text-dim); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.regen__job-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.regen__job-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.regen__job-progress { display: grid; gap: 6px; }
.regen__job-progress p { margin: 0; font-size: var(--text-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.regen__job-progress progress { width: 100%; height: 8px; }
.regen__items { display: grid; gap: var(--space-sm); margin: 0; padding: 0; list-style: none; max-height: 70vh; overflow: auto; }
.regen__item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg, 14px); background: var(--surface); }
.regen__item.is-failed { border-color: var(--danger-soft); }
.regen__item.is-done { border-color: var(--accent-soft); }
.regen__item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); }
.regen__item-title { min-width: 0; }
.regen__item-title .ikpu__title { font-size: var(--text-sm); overflow-wrap: anywhere; }
.regen__item-msg { margin: 0; font-size: var(--text-xs); color: var(--text-dim); }
.regen__item-msg.is-error { color: var(--danger-text); }
.regen__galleries { display: flex; align-items: flex-start; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.regen__arrow { align-self: center; color: var(--text-faint); font-size: var(--text-lg); flex: none; }
.regen__gallery { flex: none; display: grid; gap: 4px; width: 112px; margin: 0; }
.regen__gallery figcaption { display: flex; justify-content: space-between; gap: 4px; font-size: var(--text-xs); }
.regen__gallery-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.regen__gallery.is-before { opacity: .85; }
.regen__gallery.is-before .regen__gallery-label { color: var(--text-dim); }
.regen__tile { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: inherit; cursor: zoom-in; }
.regen__tile:not(:disabled):hover { border-color: var(--line-strong); }
.regen__tile:disabled, .regen__tile--wait { cursor: default; }
.regen__tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.regen__tile--wait { gap: 6px; align-content: center; }
.regen__tile-empty { padding: 6px; color: var(--text-faint); font-size: var(--text-xs); text-align: center; }

/* Regeneration page — sticky action bar */
.regen__action .btn--primary { display: inline-flex; align-items: center; gap: 8px; }
.regen__action-text { display: grid; gap: 2px; margin: 0; min-width: 0; flex: 1 1 260px; }
.regen__action-text span { color: var(--text-dim); font-size: var(--text-sm); }
@media (max-width: 599px) {
  .regen__action { padding: var(--space-sm) var(--space-md); padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); }
  .regen__action .btn--primary { width: 100%; justify-content: center; }
  .regen__job-actions { margin-left: 0; }
  .regen__gallery { width: 92px; }
  .regen__recent { flex: 1 1 100%; }
}
