@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-latin-700-normal.woff2') format('woff2');
}

/* ---------- 1. palette — three distinct layers ---------- */

:root {
  --hue: 200; /* per-product override via inline style; this is the site default */

  --bg-base: #08080b;
  --bg-sunken: #050507;
  --bg-surface: #101017;
  --bg-elevated: #16161f;

  --glass-fill: rgba(255, 255, 255, 0.045);
  --glass-fill-hover: rgba(255, 255, 255, 0.07);
  --glass-fill-high: rgba(255, 255, 255, 0.09);
  --glass-fallback: #14141b;

  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --hairline-top: rgba(255, 255, 255, 0.75);

  --text-primary: #f2f3f7;
  --text-secondary: #a8abba;
  --text-muted: #8b90a3;

  --accent-text: #08080b;

  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, 0.12);
  --success: #4ce0a0;
  --success-bg: rgba(76, 224, 160, 0.12);
  --pending: #ffc861;
  --pending-bg: rgba(255, 200, 97, 0.12);

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --font-size-micro: 0.6875rem;
  --font-size-sm: 0.9375rem;
  --font-size-base: 0.9375rem;
  --font-size-md: 1.375rem;
  --font-size-lg: 1.75rem;
  --font-size-xl: clamp(2rem, 5vw, 3.25rem);

  --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

* { box-sizing: border-box; }

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

/* ---------- 4. depth — background washes, built before any glass ---------- */

body {
  /* derived from --hue at THIS element's scope — --hue is only ever
     overridden per-element (body, .product-card), never at :root, so these
     must live wherever --hue does or they resolve against the :root default */
  --accent: hsl(var(--hue) 95% 62%);
  --accent-dim: hsl(var(--hue) 85% 46%);
  --glow: hsl(var(--hue) 100% 65% / 0.55);

  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -5%, hsl(var(--hue) 95% 60% / 0.16), transparent 62%),
    radial-gradient(ellipse 55% 40% at 88% 10%, hsl(calc(var(--hue) + 40) 90% 60% / 0.1), transparent 60%),
    radial-gradient(ellipse 80% 55% at 8% 100%, hsl(calc(var(--hue) - 40) 85% 55% / 0.08), transparent 65%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--font-size-base);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* admin is back-office, not a product page — a fixed, desaturated accent
   (never the per-product --hue) says "this is the system", not "this is a
   listing". Declared here, not :root, for the same reason body's --accent is:
   it must resolve at the element carrying the override. */
body.admin {
  --accent: hsl(258 55% 68%);
  --accent-dim: hsl(258 50% 52%);
  --glow: hsl(258 60% 62% / 0.4);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -5%, hsl(258 45% 55% / 0.1), transparent 62%),
    radial-gradient(ellipse 80% 55% at 8% 100%, hsl(230 35% 45% / 0.06), transparent 65%);
}

/* film grain — inline SVG turbulence, kills banding on near-black gradients */
body.grain::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-repeat: repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; }

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  position: relative;
  z-index: 2;
}

/* ---------- 2. glass recipe ---------- */

.glass {
  border-radius: var(--radius-lg);
  background-color: var(--glass-fallback);
  border: 1px solid var(--hairline);
  box-shadow:
    0 1.5px 0 0 var(--hairline-top) inset,
    0 -1.5px 0 0 rgba(0, 0, 0, 0.45) inset,
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 8px 24px -6px rgba(0, 0, 0, 0.5),
    0 24px 64px -12px rgba(0, 0, 0, 0.65);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background-color: var(--glass-fill);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
  }
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background-color: var(--glass-fallback);
  padding: var(--space-4) 0;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background-color: rgba(8, 8, 11, 0.6);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
  }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
  font-size: var(--font-size-md);
  letter-spacing: -0.018em;
  text-decoration: none;
  color: var(--text-primary);
}

.site-header.admin .brand::after {
  content: ' · admin';
  font-weight: 500;
  color: var(--text-muted);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--font-size-sm);
}

.admin-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 180ms var(--ease-out-quart);
}

.admin-nav a:hover { color: var(--text-primary); }

/* ---------- layout / typography ---------- */

main.wrap, main.login-page {
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-md);
  font-weight: 400;
  margin: 0 0 var(--space-6);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.section-header .page-title { margin-bottom: 0; }

/* ---------- product grid ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  /* redeclare against this element's own --hue — see body rule for why */
  --accent: hsl(var(--hue) 95% 62%);
  --accent-dim: hsl(var(--hue) 85% 46%);
  --glow: hsl(var(--hue) 100% 65% / 0.55);

  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: var(--text-primary);
  border-color: color-mix(in oklab, var(--accent) 28%, var(--hairline));
  box-shadow:
    0 1.5px 0 0 var(--hairline-top) inset,
    0 -1.5px 0 0 rgba(0, 0, 0, 0.45) inset,
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 8px 24px -6px rgba(0, 0, 0, 0.5),
    0 24px 64px -12px rgba(0, 0, 0, 0.65),
    0 0 32px -14px var(--glow);
  transition: transform 180ms var(--ease-out-quart), box-shadow 180ms var(--ease-out-quart), border-color 180ms var(--ease-out-quart);
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in oklab, var(--accent) 70%, var(--hairline-strong));
    box-shadow:
      0 1px 0 0 var(--hairline-top) inset,
      0 -1px 0 0 rgba(0, 0, 0, 0.35) inset,
      0 0 0 1px var(--glow),
      0 2px 4px rgba(0, 0, 0, 0.4),
      0 18px 40px -8px rgba(0, 0, 0, 0.55),
      0 0 64px -8px var(--glow),
      0 48px 120px -16px var(--glow);
  }

  .product-card:hover .product-card-image img { transform: scale(1.04); }
}

.product-card:active { transform: scale(0.98); }

.product-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--accent) 16%, var(--bg-sunken)) 0 2px,
      var(--bg-sunken) 2px 14px),
    radial-gradient(60% 65% at 50% 38%,
      color-mix(in oklab, var(--accent) 38%, transparent),
      transparent 68%),
    var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card-image::before {
  content: attr(data-glyph);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, monospace;
  font-size: 3.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: color-mix(in oklab, var(--accent) 55%, var(--text-primary));
  text-shadow: 0 0 36px var(--glow);
  opacity: 0.32;
}

.product-card-image:not(:has(img))::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    color-mix(in oklab, var(--bg-base) 78%, transparent),
    transparent 42%);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms var(--ease-out-quart);
}

.badge-type {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1;
}

.badge-type-digital_good { background: var(--success-bg); color: var(--success); }
.badge-type-service { background: var(--pending-bg); color: var(--pending); }

.badge-type-inline {
  position: static;
  display: inline-block;
  margin-bottom: var(--space-3);
}

.product-detail-meta {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin: 0 0 var(--space-4);
}

.placeholder {
  position: absolute;
  z-index: 1;
  left: var(--space-3);
  bottom: var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-size-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.product-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-title {
  font-weight: 550;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-1);
}

.product-card-footer {
  margin-top: auto;
  padding-top: var(--space-3);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  border-top: 1px solid var(--hairline);
}

.product-card-price {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ---------- product detail ---------- */

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}

.product-detail-image {
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
  /* the one focal glow on this view — a large product image earns it */
  box-shadow:
    0 1.5px 0 0 var(--hairline-top) inset,
    0 -1.5px 0 0 rgba(0, 0, 0, 0.45) inset,
    0 0 0 1px var(--glow),
    0 24px 64px -16px rgba(0, 0, 0, 0.6),
    0 0 160px -16px var(--glow);
}

.product-detail-image img { width: 100%; height: 100%; object-fit: cover; }

.product-detail-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
  text-shadow: 0 0 28px hsl(var(--hue) 100% 65% / 0.12);
}

.product-detail-price {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  margin: 0 0 var(--space-4);
}

.product-detail-description {
  color: var(--text-secondary);
  margin: 0 0 var(--space-6);
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* ---------- forms ---------- */

.field { margin-bottom: var(--space-4); }

label {
  display: block;
  font-size: var(--font-size-micro);
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text-primary);
  background-color: var(--glass-fallback);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  transition: border-color 180ms var(--ease-out-quart), background-color 180ms var(--ease-out-quart);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  input, select, textarea {
    background-color: var(--glass-fill);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

textarea { min-height: 120px; resize: vertical; }

input:hover, select:hover, textarea:hover { border-color: var(--hairline-top); }

input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:user-invalid { border-color: var(--danger); }

.form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font: inherit;
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  background-color: var(--accent);
  background-image: linear-gradient(to bottom, color-mix(in oklab, var(--accent) 55%, white), var(--accent) 60%, var(--accent-dim));
  color: var(--accent-text);
  box-shadow:
    0 1.5px 0 0 rgba(255, 255, 255, 0.65) inset,
    0 -3px 6px 0 rgba(0, 0, 0, 0.3) inset,
    0 10px 28px -6px var(--glow);
  transition: box-shadow 180ms var(--ease-out-quart), transform 120ms var(--ease-out-quart), filter 180ms var(--ease-out-quart);
}

.btn:hover {
  filter: brightness(1.12);
  box-shadow:
    0 1.5px 0 0 rgba(255, 255, 255, 0.65) inset,
    0 -3px 6px 0 rgba(0, 0, 0, 0.3) inset,
    0 0 0 1px var(--glow),
    0 16px 48px -8px var(--glow);
}

.btn:active { transform: scale(0.97); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:disabled:hover { filter: none; box-shadow: 0 1.5px 0 0 rgba(255, 255, 255, 0.65) inset, 0 -3px 6px 0 rgba(0, 0, 0, 0.3) inset; }

.btn-block { width: 100%; padding: var(--space-4); font-size: var(--font-size-base); }

.btn-secondary {
  background-image: none;
  background-color: var(--glass-fallback);
  color: var(--text-primary);
  border-color: var(--hairline-strong);
  box-shadow: none;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .btn-secondary { background-color: var(--glass-fill); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}

.btn-secondary:hover { background-color: var(--glass-fill-hover); border-color: var(--hairline-top); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 45%, transparent);
}

.btn-danger:hover { background: var(--danger-bg); }

.btn-small { padding: var(--space-2) var(--space-3); font-size: 0.8125rem; }

.link-button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button:hover { color: var(--text-primary); }

.row-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.row-actions form { margin: 0; }

/* ---------- cards / kv ---------- */

.card {
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.card.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

.card.narrow .page-title { margin-bottom: var(--space-5); }

.address-value {
  word-break: break-all;
  font-family: ui-monospace, monospace;
  color: var(--text-primary);
}

.kv-list { display: flex; flex-direction: column; gap: var(--space-3); }

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--hairline);
}

.kv-row:last-child { border-bottom: none; padding-bottom: 0; }

.kv-row .k { color: var(--text-muted); }
.kv-row .v { font-weight: 600; text-align: right; color: var(--text-primary); }

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  font-size: var(--font-size-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--pending-bg); color: var(--pending); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background-color: var(--glass-fill); color: var(--text-muted); border: 1px solid var(--hairline); }

/* ---------- login ---------- */

.login-page {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  padding: var(--space-6) var(--space-5);
  position: relative;
  z-index: 2;
}

/* ---------- confirmation / empty states ---------- */

.confirmation { max-width: 480px; margin: 0 auto; text-align: center; }

.confirmation-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto var(--space-4);
}

.confirmation .card { text-align: left; }

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-5);
}

.empty-state a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- admin tables ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--hairline);
  font-size: var(--font-size-sm);
}

th {
  color: var(--text-muted);
  font-weight: 560;
  text-transform: uppercase;
  font-size: var(--font-size-micro);
  letter-spacing: 0.14em;
  background: rgba(255, 255, 255, 0.02);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--glass-fill); }

/* admin's own row rhythm: an operator scans dozens of rows, the storefront
   grid shows a handful of cards — same table markup, denser here. */
.admin-table td { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.admin-table .product-title-cell { font-weight: 550; }

/* ---------- row action hierarchy ---------- */
/* Edit is the routine action and reads as a plain link, no button chrome.
   Publish toggle is secondary weight. Delete is the only outlined button and
   is icon-only at rest so it never visually competes with Edit for attention
   — its label appears on hover/focus so it stays a real accessible button. */

.row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: nowrap;
}

.row-actions form { margin: 0; }

.row-action-link {
  color: var(--accent);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-decoration: none;
}

.row-action-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.row-action-button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.row-action-toggle {
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
}

.row-action-toggle:hover { color: var(--text-primary); }

.row-action-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 150ms var(--ease-out-quart), background-color 150ms var(--ease-out-quart), border-color 150ms var(--ease-out-quart);
}

.row-action-delete:hover, .row-action-delete:focus-visible {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: color-mix(in oklab, var(--danger) 40%, transparent);
}

.row-action-delete svg { width: 15px; height: 15px; }

@media (max-width: 400px) {
  table.stack-on-mobile,
  table.stack-on-mobile thead,
  table.stack-on-mobile tbody,
  table.stack-on-mobile tr,
  table.stack-on-mobile td {
    display: block;
    width: 100%;
  }

  table.stack-on-mobile thead { display: none; }

  table.stack-on-mobile tr {
    border-bottom: 1px solid var(--hairline);
    padding: var(--space-3) var(--space-4);
  }

  table.stack-on-mobile tbody tr:last-child { border-bottom: none; }

  table.stack-on-mobile td {
    border-bottom: none;
    padding: var(--space-1) 0;
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
  }

  table.stack-on-mobile td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-weight: 560;
    font-size: var(--font-size-micro);
    text-transform: uppercase;
    letter-spacing: 0.14em;
  }

  table.stack-on-mobile td .row-actions {
    justify-content: flex-end;
    width: 100%;
  }
}

/* ---------- file input ---------- */
/* the native control is an OS-themed grey widget that ignores every token
   above it — ::file-selector-button is the one part of <input type=file>
   that accepts styling, so the button becomes the visible control and the
   native "no file chosen" text is left to inherit the dark field around it */

input[type='file'] {
  padding: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

input[type='file']::file-selector-button {
  font: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background-color: var(--glass-fill-high);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-right: var(--space-3);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out-quart), border-color 150ms var(--ease-out-quart);
}

input[type='file']::file-selector-button:hover {
  background-color: var(--glass-fill-hover);
  border-color: var(--hairline-top);
}

/* ---------- admin edit form ---------- */
/* a single field at 420px in a 1080px wrap leaves a void either side; give
   the form two deliberate columns instead — fields left, framed image right
   — so the width is used instead of centered against empty space */

.admin-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: var(--space-6);
  align-items: start;
  max-width: none;
}

.admin-form-layout > * { min-width: 0; }

.admin-form-image {
  width: 100%;
  max-width: 320px;
  /* Product art is 3:2. A square well cropped the sides off with object-fit:
     cover, cutting the baked-in title. Match the art and show all of it. */
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--font-size-micro);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.admin-form-image img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 760px) {
  .admin-form-layout {
    grid-template-columns: 1fr;
  }

  .admin-form-image {
    order: -1;
    max-width: none;
    aspect-ratio: 16 / 9;
  }
}

/* ---------- orders: status + money ---------- */

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: var(--space-2);
  background: currentColor;
  box-shadow: 0 0 8px 0 currentColor;
}

.badge-status-paid { color: var(--pending); background: var(--pending-bg); }
.badge-status-delivered { color: var(--success); background: var(--success-bg); }
.badge-status-pending_payment { color: var(--text-muted); background: var(--glass-fill); border: 1px solid var(--hairline); }
.badge-status-expired,
.badge-status-cancelled { color: var(--danger); background: var(--danger-bg); }

.money-cell {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- motion ---------- */

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

  .product-card:hover,
  .product-card:hover .product-card-image img {
    transform: none !important;
  }
}
