/* The business web app. Builds on /assets/base.css. */

body {
  background: var(--bg-subtle);
}

/* ---------- Signing in ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 32px 16px;
  background: radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%), var(--bg-subtle);
}
.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px;
}
.auth-card h1 {
  font-size: 26px;
  letter-spacing: -0.035em;
  margin-top: 8px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 14px;
}
.notice.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.sidebar .brandmark {
  padding: 4px 8px;
}
.switcher {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.switcher small {
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.switcher strong {
  font-size: 14px;
  line-height: 1.3;
}
.switcher select {
  border: 0;
  padding: 0;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.nav {
  display: grid;
  gap: 2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 520;
}
.nav a svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.nav a:hover {
  background: var(--bg-muted);
  color: var(--text);
}
.nav a[aria-current="page"] {
  background: var(--bg-muted);
  color: var(--text);
  font-weight: 600;
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.status-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.topbar {
  display: none;
}
.main {
  min-width: 0;
}
.view {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 32px 96px;
}
.tabbar {
  display: none;
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 16px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .brandmark img {
    width: 26px;
    height: 26px;
  }
  .topbar-business {
    min-width: 0;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar select {
    min-width: 0;
    max-width: 55vw;
    border: 0;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
  }
  .topbar .spacer {
    flex: 1;
  }
  .view {
    padding: 20px 16px 104px;
  }
  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 6px 0;
    border-radius: 10px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 11px;
    font-weight: 560;
  }
  .tabbar a svg {
    width: 20px;
    height: 20px;
  }
  .tabbar a[aria-current="page"] {
    color: var(--text);
  }
}

/* ---------- Page scaffolding ---------- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 28px;
  letter-spacing: -0.035em;
}
.page-head p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 14px;
}
.page-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
.panel {
  padding: 20px;
  min-width: 0;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2 {
  font-size: 15px;
  letter-spacing: -0.01em;
}
.panel-head p {
  font-size: 13px;
  color: var(--text-2);
}
.section-gap {
  margin-top: 16px;
}

/* KPI tiles */
.kpi {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
}
.kpi .kpi-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 520;
}
.kpi .kpi-value {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi .kpi-foot {
  font-size: 12.5px;
  color: var(--text-3);
}
.delta {
  font-weight: 600;
}
.delta.up {
  color: var(--good);
}
.delta.down {
  color: var(--bad);
}

/* Calls to action on the overview */
.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
  background: linear-gradient(135deg, var(--brand-soft), var(--surface) 75%);
}
.callout h2 {
  font-size: 17px;
}
.callout p {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 2px;
}
.callout .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Horizontal bars in lists */
.bars {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  font-size: 13.5px;
}
.bars .bar-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.bars .bar-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bars .bar-value {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.bars .bar-track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}
.bars .bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--chart);
}

/* Link rows (catalogue health) */
.rows {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rows li + li {
  border-top: 1px solid var(--border);
}
.rows a,
.rows .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.rows a:hover {
  color: var(--brand-text);
}
.rows strong {
  font-variant-numeric: tabular-nums;
}

/* Charts */
.chart {
  position: relative;
  width: 100%;
}
.chart svg {
  overflow: visible;
}
.chart-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  box-shadow: var(--shadow);
}
.chart-tip strong {
  display: block;
  font-size: 13px;
}

/* ---------- Empty and loading ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-2);
}
.empty h3 {
  color: var(--text);
  font-size: 16px;
}
.empty p {
  max-width: 34em;
  font-size: 14px;
}
.empty .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-muted);
  color: var(--text-2);
}
.empty-icon svg {
  width: 22px;
  height: 22px;
}
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--bg-muted), var(--surface-2), var(--bg-muted));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Products ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 360px;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search .input {
  padding-left: 36px;
  min-height: 38px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.toolbar .select {
  width: auto;
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 13px;
  border-radius: 999px;
}
.table-card {
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table .w-check {
  width: 44px;
}
.table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
}
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.thumb {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-3);
  overflow: hidden;
}
.thumb svg {
  width: 18px;
  height: 18px;
}
.product-name {
  display: grid;
  min-width: 0;
}
.product-name button {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-weight: 560;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-name button:hover {
  color: var(--brand-text);
}
.product-name small {
  color: var(--text-3);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.price-btn {
  padding: 5px 8px;
  margin: -5px -8px;
  text-align: inherit; /* right in the table, left on phone cards */
  border: 1px dashed transparent;
  border-radius: 8px;
  background: none;
  cursor: text;
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}
.price-btn:hover {
  border-color: var(--border-strong);
}
.price-btn .unit {
  display: block;
  color: var(--text-3);
  font-weight: 400;
  font-size: 12px;
}
.price-btn.none {
  color: var(--text-3);
  font-weight: 400;
}
.price-edit {
  width: 110px;
  min-height: 34px;
  padding: 5px 10px;
  text-align: right;
}
.when {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}
.when.stale {
  color: var(--warn);
}
.list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}
@media (max-width: 760px) {
  .products-table thead {
    display: none;
  }
  .products-table tbody tr {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-areas:
      "check product product"
      ". price stock";
    gap: 8px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  .products-table td {
    padding: 0;
    border: 0;
  }
  .products-table td.c-check {
    grid-area: check;
  }
  .products-table td.c-product {
    grid-area: product;
  }
  .products-table td.c-price {
    grid-area: price;
    text-align: left;
  }
  .products-table td.c-stock {
    grid-area: stock;
    justify-self: end;
  }
  .products-table td.c-when,
  .products-table td.c-more {
    display: none;
  }
}

/* Other tables stack on phones: one card per row, each cell with its column's name. */
.table-card.scroll {
  overflow-x: auto;
}
@media (max-width: 760px) {
  .table.stack thead {
    display: none;
  }
  .table.stack tbody tr {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
  }
  .table.stack tbody tr:last-child {
    border-bottom: 0;
  }
  .table.stack td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .table.stack td::before {
    content: attr(data-label);
    color: var(--text-3);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-top: 2px;
  }
  .table.stack td.no-label {
    grid-template-columns: 1fr;
  }
  .table.stack td.no-label::before {
    display: none;
  }
}

/* The bar that appears when products are selected */
.selection {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: var(--inverse);
  color: var(--on-inverse);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  overflow-x: auto;
}
.selection strong {
  font-size: 13.5px;
  white-space: nowrap;
  margin-right: 6px;
}
.selection .btn {
  --h: 32px;
  padding: 0 12px;
  font-size: 13px;
  background: color-mix(in srgb, var(--on-inverse) 12%, transparent);
  color: var(--on-inverse);
}
.selection .btn:hover {
  background: color-mix(in srgb, var(--on-inverse) 22%, transparent);
  opacity: 1;
}
@media (max-width: 900px) {
  .selection {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

/* ---------- Drawers, dialogs, toasts ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgb(12 10 9 / 0.38);
  animation: fade 0.15s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(480px, 100%);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: slide 0.2s ease;
}
@keyframes slide {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 41;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(640px, calc(100% - 24px));
  max-height: min(820px, calc(100dvh - 32px));
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
  animation: pop 0.18s ease;
}
.dialog.small {
  width: min(440px, calc(100% - 24px));
}
@keyframes pop {
  from {
    transform: translate(-50%, -48%);
    opacity: 0;
  }
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.sheet-head h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}
.sheet-head p {
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.sheet-body {
  overflow: auto;
  padding: 20px 22px;
  display: grid;
  gap: 18px;
  align-content: start;
}
.sheet-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}
.sheet-foot .spacer {
  flex: 1;
}
@media (max-width: 640px) {
  .dialog {
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    transform: translateX(-50%);
    animation: rise 0.2s ease;
  }
  @keyframes rise {
    from {
      transform: translate(-50%, 24px);
      opacity: 0;
    }
  }
}
.photo-drop {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  text-align: center;
  cursor: pointer;
}
.photo-drop:hover,
.photo-drop.over {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-text);
}
.photo-drop svg {
  width: 22px;
  height: 22px;
}
.photo-preview {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-muted);
}
.photo-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}
.photo-preview .photo-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}
.history {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.history li:last-child {
  border-bottom: 0;
}
.toasts {
  position: fixed;
  z-index: 60;
  top: 16px;
  left: 50%;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--inverse);
  color: var(--on-inverse);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: pop-down 0.2s ease;
}
.toast.bad {
  background: var(--bad);
  color: #fff;
}
@keyframes pop-down {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
}

/* Upload and price tools */
.dropzone {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone svg {
  width: 26px;
  height: 26px;
  color: var(--text-3);
}
.dropzone strong {
  font-size: 15px;
}
.dropzone span {
  font-size: 13px;
  color: var(--text-2);
}
.map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.map-table td,
.map-table th {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.map-table th {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.map-table .select {
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 13px;
}
.map-table .sample {
  color: var(--text-2);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.summary div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-2);
}
.summary strong {
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) {
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}
.progress div {
  height: 100%;
  background: var(--brand);
  transition: width 0.2s ease;
}
.errors {
  max-height: 200px;
  overflow: auto;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13px;
  list-style: none;
}
.errors li + li {
  margin-top: 4px;
}
.radio-cards {
  display: grid;
  gap: 8px;
}
.radio-cards label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}
.radio-cards label:has(input:checked) {
  border-color: var(--brand);
  box-shadow: var(--focus);
}
.radio-cards input {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}
.radio-cards .select {
  margin-left: auto;
  width: auto;
  min-height: 32px;
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 13px;
}
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.preview-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.preview-table td + td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 12px;
}
.arrow {
  color: var(--text-3);
  margin: 0 4px;
}

/* ---------- Profile ---------- */
.form-card {
  padding: 24px;
}
.form-card h2 {
  font-size: 16px;
  margin-bottom: 4px;
}
.form-card > p {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  gap: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cat-chips .chip {
  cursor: default;
  background: var(--brand-soft);
  color: var(--brand-text);
  border-color: transparent;
}
.cat-chips button {
  border: 0;
  background: none;
  padding: 0 0 0 2px;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.gallery figure {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-muted);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery figcaption {
  position: absolute;
  left: 8px;
  top: 8px;
}
.gallery .remove {
  position: absolute;
  right: 6px;
  top: 6px;
  --h: 28px;
}
.gallery .add {
  display: grid;
  place-items: center;
  gap: 4px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1.5px dashed var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.gallery .add svg {
  width: 20px;
  height: 20px;
}
.gallery .add:hover {
  border-color: var(--brand);
  color: var(--brand-text);
}
.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.save-bar .muted {
  margin-right: auto;
  font-size: 13px;
}
@media (max-width: 900px) {
  .save-bar {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}
.outcome {
  display: inline-flex;
}

/* Adding many photos: each file, and the product it goes on */
.photo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.photo-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.photo-table .thumb {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-muted);
}
.photo-table .file {
  max-width: 180px;
  color: var(--text-2);
  word-break: break-all;
}
.photo-table .input {
  min-width: 180px;
  min-height: 36px;
  font-size: 13.5px;
}
.link-cell {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
